Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook tweaks #2409

Merged
merged 24 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
08a9ecb
docs(ffe-accordion-react): småjusteringer i storybook
antidecaf Nov 5, 2024
c9eb3ab
docs(ffe-account-selector-react): småjusteringer i storybook
antidecaf Nov 5, 2024
82a5510
docs(ffe-buttons-react): småjusteringer i storybook
antidecaf Nov 5, 2024
196947f
docs(ffe-cards-react): småjusteringer i storybook
antidecaf Nov 5, 2024
3cb170d
docs(ffe-chart-donut-react): småjusteringer i storybook
antidecaf Nov 5, 2024
482f724
docs(ffe-chips-react): småjusteringer i storybook
antidecaf Nov 5, 2024
754d327
docs(ffe-collapse-react): småjusteringer i storybook
antidecaf Nov 5, 2024
4375fb8
docs(ffe-core-react): småjusteringer i storybook
antidecaf Nov 5, 2024
eb3c338
docs(ffe-datepicker-react): småjusteringer i storybook
antidecaf Nov 5, 2024
be02f9b
docs(ffe-feedback-react): småjusteringer i storybook
antidecaf Nov 5, 2024
cdb219b
docs(ffe-file-upload-react): småjusteringer i storybook
antidecaf Nov 5, 2024
baf14b8
docs(ffe-form-react): småjusteringer i storybook
antidecaf Nov 5, 2024
51e3b66
docs(ffe-grid-react): småjusteringer i storybook
antidecaf Nov 5, 2024
0a37016
docs(ffe-header-react): småjusteringer i storybook
antidecaf Nov 5, 2024
0eb315a
docs(ffe-icons-react): småjusteringer i storybook
antidecaf Nov 5, 2024
8647171
docs(ffe-lists-react): småjusteringer i storybook
antidecaf Nov 5, 2024
763450f
docs(ffe-messages-react): småjusteringer i storybook
antidecaf Nov 5, 2024
96dce41
docs(ffe-modals-react): småjusteringer i storybook
antidecaf Nov 5, 2024
bac7bf7
docs(ffe-pagination-react): småjusteringer i storybook
antidecaf Nov 5, 2024
41b36f8
docs(ffe-searchable-dropdown-react): småjusteringer i storybook
antidecaf Nov 5, 2024
9ace99d
docs(ffe-spinner-react): småjusteringer i storybook
antidecaf Nov 5, 2024
0d777cc
docs(ffe-tables-react): småjusteringer i storybook
antidecaf Nov 5, 2024
5982134
docs(ffe-tabs-react): småjusteringer i storybook
antidecaf Nov 5, 2024
2a5e79f
docs: småjusteringer i storybook
antidecaf Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ function getAbsolutePath(value: string): any {

const config: StorybookConfig = {
stories: [
'../packages/**/*.stories.@(js|jsx|mjs|ts|tsx)',
'../packages/**/*.@(mdx)',
'../packages/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
getAbsolutePath('@storybook/addon-links'),
Expand Down
6 changes: 6 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ const preview: Preview = {
date: /Date$/i,
},
},
viewMode: 'docs',
docs: {
components,
},
options: {
storySort: {
method: 'alphabetical',
},
},
},
decorators: [
(Story, context) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-accordion-react/src/Accordion.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AccordionItem } from './AccordionItem';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof Accordion> = {
title: 'components/accordion/Accordion',
title: 'Komponenter/Accordion/Accordion',
component: Accordion,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AccordionItem } from './AccordionItem.tsx';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof AccordionItem> = {
title: 'components/accordion/AccordionItem',
title: 'Komponenter/Accordion/AccordionItem',
component: AccordionItem,
argTypes: {
ariaLabel: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Account } from '../types';
import { TertiaryButton } from '@sb1/ffe-buttons-react';

const meta: Meta<typeof AccountSelectorMulti> = {
title: 'components/account-selector/AccountSelectorMulti',
title: 'Komponenter/Account-selector/AccountSelectorMulti',
component: AccountSelectorMulti,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { StoryObj, Meta } from '@storybook/react';
import { SmallText } from '@sb1/ffe-core-react';

const meta: Meta<typeof AccountSelector> = {
title: 'components/account-selector/AccountSelector',
title: 'Komponenter/Account-selector/AccountSelector',
component: AccountSelector,
argTypes: {
postListElement: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-buttons-react/src/ActionButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof ActionButton<any>> = {
title: 'components/buttons/ActionButton',
title: 'Komponenter/Buttons/ActionButton',
component: ActionButton,
argTypes: {
as: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-buttons-react/src/BackButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof BackButton<any>> = {
title: 'components/buttons/BackButton',
title: 'Komponenter/Buttons/BackButton',
component: BackButton,
argTypes: {
as: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-buttons-react/src/ButtonGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TertiaryButton } from './TertiaryButton';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof ButtonGroup> = {
title: 'components/buttons/ButtonGroup',
title: 'Komponenter/Buttons/ButtonGroup',
component: ButtonGroup,
};
export default meta;
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-buttons-react/src/Buttons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TableDataCell,
} from '@sb1/ffe-tables-react';

<Meta title="components/buttons/Buttons" />
<Meta title="Komponenter/Buttons/Buttons" />

# Knapper

Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-buttons-react/src/ExpandButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { StoryObj, Meta } from '@storybook/react';
import { ExpandButton } from './ExpandButton';

const meta: Meta<typeof ExpandButton> = {
title: 'components/buttons/ExpandButton',
title: 'Komponenter/Buttons/ExpandButton',
component: ExpandButton,
argTypes: {},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof InlineExpandButton<any>> = {
title: 'components/buttons/InlineExpandButton',
title: 'Komponenter/Buttons/InlineExpandButton',
component: InlineExpandButton,
argTypes: {
as: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-buttons-react/src/PrimaryButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof PrimaryButton<any>> = {
title: 'components/buttons/PrimaryButton',
title: 'Komponenter/Buttons/PrimaryButton',
component: PrimaryButton,
argTypes: {
as: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof SecondaryButton<any>> = {
title: 'components/buttons/SecondaryButton',
title: 'Komponenter/Buttons/SecondaryButton',
component: SecondaryButton,
argTypes: {
as: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof ShortcutButton<any>> = {
title: 'components/buttons/ShortcutButton',
title: 'Komponenter/Buttons/ShortcutButton',
component: ShortcutButton,
argTypes: {
as: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-buttons-react/src/TaskButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof TaskButton<any>> = {
title: 'components/buttons/TaskButton',
title: 'Komponenter/Buttons/TaskButton',
component: TaskButton,
argTypes: {
as: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof TertiaryButton<any>> = {
title: 'components/buttons/TertiaryButton',
title: 'Komponenter/Buttons/TertiaryButton',
component: TertiaryButton,
argTypes: {
as: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-cards-react/src/CardBase.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'div'>> = props => (
);

const meta: Meta<typeof CardBase<any>> = {
title: 'components/cards/CardBase',
title: 'Komponenter/Cards/CardBase',
component: CardBase,
argTypes: {
as: {
Expand Down
9 changes: 9 additions & 0 deletions packages/ffe-cards-react/src/Cards.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Meta } from '@storybook/blocks';

<Meta title="Komponenter/Cards/Cards" />

# Kort

## Bruk av kort

Kortene skal hjelpe brukerne med å navigere seg til riktig side. De skal gi en kort og tydelig oppsummering av hva slags informasjon som finnes på undersiden.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Heading2, Paragraph } from '@sb1/ffe-core-react';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof GroupCard> = {
title: 'components/cards/GroupCard',
title: 'Komponenter/Cards/GroupCard',
component: GroupCard,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Custom: React.FC<React.ComponentProps<'div'>> = props => (
);

const meta: Meta<typeof IconCard<any>> = {
title: 'components/cards/IconCard',
title: 'Komponenter/Cards/IconCard',
component: IconCard,
argTypes: {
as: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Custom: React.FC<React.ComponentProps<'div'>> = props => (
);

const meta: Meta<typeof IllustrationCard<any>> = {
title: 'components/cards/IllustrationCard',
title: 'Komponenter/Cards/IllustrationCard',
component: IllustrationCard,
argTypes: {
as: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'div'>> = props => (
);

const meta: Meta<typeof ImageCard<any>> = {
title: 'components/cards/ImageCard',
title: 'Komponenter/Cards/ImageCard',
component: ImageCard,
argTypes: {
as: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Custom: React.FC<React.ComponentProps<'div'>> = props => (
);

const meta: Meta<typeof StippledCard<any>> = {
title: 'components/cards/StippledCard',
title: 'Komponenter/Cards/StippledCard',
component: StippledCard,
argTypes: {
as: {
Expand Down
5 changes: 4 additions & 1 deletion packages/ffe-cards-react/src/TextCard/TextCard.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Canvas, Meta, Controls } from '@storybook/blocks';
import * as TextCardStories from './TextCard.stories.tsx';

<Meta of={TextCardStories} />
<Meta
of={TextCardStories}
parameters={{ viewMode: 'docs' }}
/>

# TextCard

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Custom: React.FC<React.ComponentProps<'div'>> = props => (
);

const meta: Meta<typeof TextCard<any>> = {
title: 'components/cards/TextCard',
title: 'Komponenter/Cards/TextCard',
component: TextCard,
argTypes: {
as: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Custom: React.FC<React.ComponentProps<'a'>> = props => (
);

const meta: Meta<typeof CardActionComponent<any>> = {
title: 'components/cards/CardAction',
title: 'Komponenter/Cards/CardAction',
component: CardActionComponent,
argTypes: {
as: {
Expand Down
16 changes: 16 additions & 0 deletions packages/ffe-chart-donut-react/src/ChartDonut.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Canvas, Meta, Controls } from '@storybook/blocks';
import * as ChartDonutStories from './ChartDonut.stories.tsx';

<Meta of={ChartDonutStories} />

# ChartDonut

Diagram i SpareBank 1-drakt.

<Canvas of={ChartDonutStories.Standard} />
<Controls of={ChartDonutStories.Standard} />

Med egentilpasset innhold.

<Canvas of={ChartDonutStories.Custom} />
<Controls of={ChartDonutStories.Custom} />
3 changes: 1 addition & 2 deletions packages/ffe-chart-donut-react/src/ChartDonut.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { ChartDonut } from './ChartDonut';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof ChartDonut> = {
title: 'components/chart-donut/ChartDonut',
title: 'Komponenter/Chart-donut/ChartDonut',
component: ChartDonut,
tags: ['autodocs'],
};
export default meta;

Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-chips-react/src/Chip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { StoryObj, Meta } from '@storybook/react';
import { fargeFjell, spacingXs } from '@sb1/ffe-core';

const meta: Meta<typeof Chip<any>> = {
title: 'components/chips/Chip',
title: 'Komponenter/Chips/Chip',
component: Chip,
};
export default meta;
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-chips-react/src/ChipRemovable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { StoryObj, Meta } from '@storybook/react';
import { fargeFjell, spacingXs } from '@sb1/ffe-core';

const meta: Meta<typeof ChipRemovable<any>> = {
title: 'components/chips/ChipRemovable',
title: 'Komponenter/Chips/ChipRemovable',
component: ChipRemovable,
};
export default meta;
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-chips-react/src/ChipSelectable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { StoryObj, Meta } from '@storybook/react';
import { fargeFjell, spacingXs } from '@sb1/ffe-core';

const meta: Meta<typeof ChipSelectable<any>> = {
title: 'components/chips/ChipSelectable',
title: 'Komponenter/Chips/ChipSelectable',
component: ChipSelectable,
};
export default meta;
Expand Down
2 changes: 1 addition & 1 deletion packages/ffe-collapse-react/src/Collapse.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { StoryObj, Meta } from '@storybook/react';
import { ExpandButton } from '@sb1/ffe-buttons-react';

const meta: Meta<typeof Collapse> = {
title: 'components/collapse/Collapse',
title: 'Komponenter/Collapse/Collapse',
component: Collapse,
argTypes: {},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DividerLine } from './DividerLine';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof DividerLine> = {
title: 'components/core/DividerLine',
title: 'Komponenter/Core/DividerLine',
component: DividerLine,
tags: ['autodocs'],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EmphasizedText } from './EmphasizedText';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof EmphasizedText> = {
title: 'components/core/EmphasizedText',
title: 'Komponenter/Core/EmphasizedText',
component: EmphasizedText,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Heading1 } from './Heading';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof Heading1> = {
title: 'components/core/Heading1',
title: 'Komponenter/Core/Heading1',
component: Heading1,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Heading2 } from './Heading';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof Heading2> = {
title: 'components/core/Heading2',
title: 'Komponenter/Core/Heading2',
component: Heading2,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Heading3 } from './Heading';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof Heading3> = {
title: 'components/core/Heading3',
title: 'Komponenter/Core/Heading3',
component: Heading3,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Heading4 } from './Heading';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof Heading4> = {
title: 'components/core/Heading4',
title: 'Komponenter/Core/Heading4',
component: Heading4,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Heading5 } from './Heading';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof Heading5> = {
title: 'components/core/Heading5',
title: 'Komponenter/Core/Heading5',
component: Heading5,
};
export default meta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Heading6 } from './Heading';
import type { StoryObj, Meta } from '@storybook/react';

const meta: Meta<typeof Heading6> = {
title: 'components/core/Heading6',
title: 'Komponenter/Core/Heading6',
component: Heading6,
};
export default meta;
Expand Down
Loading
Loading