Skip to content

Commit 0b2f6d2

Browse files
authored
fix: storybook docs (#1634)
1 parent 0193b58 commit 0b2f6d2

File tree

11 files changed

+99
-119
lines changed

11 files changed

+99
-119
lines changed

.storybook/preview.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ReactRenderer } from '@storybook/react';
1+
import type { Preview, ReactRenderer } from '@storybook/react';
22
import type { ReactNode } from 'react';
33
import type { DecoratorFunction, GlobalTypes, Parameters } from 'storybook/internal/types';
44

@@ -54,7 +54,7 @@ const RouterProvider = ({ children }: { children: ReactNode }) => {
5454
);
5555
};
5656

57-
export const parameters: Parameters = {
57+
const parameters: Parameters = {
5858
actions: { disable: true },
5959
controls: { expanded: true },
6060
options: {
@@ -85,16 +85,12 @@ export const parameters: Parameters = {
8585
prefersReducedMotion: 'reduce',
8686
},
8787
docs: {
88-
source: {
89-
excludeDecorators: true,
90-
},
9188
theme: window.matchMedia('(prefers-color-scheme: dark)').matches ? themes.dark : themes.light,
9289
codePanel: true,
9390
},
94-
tags: ['autodocs'],
9591
};
9692

97-
export const decorators: DecoratorFunction<ReactRenderer>[] = [
93+
const decorators: DecoratorFunction<ReactRenderer>[] = [
9894
(StoryFn, context) => {
9995
const mirror = context.viewMode === 'story' ? context.globals.mirror : undefined;
10096
const sideBySide = mirror === 'side-by-side';
@@ -139,7 +135,7 @@ export const decorators: DecoratorFunction<ReactRenderer>[] = [
139135
}),
140136
];
141137

142-
export const globalTypes: GlobalTypes = {
138+
const globalTypes: GlobalTypes = {
143139
mirror: {
144140
name: 'Mirror',
145141
description: 'Mirror themes',
@@ -154,3 +150,12 @@ export const globalTypes: GlobalTypes = {
154150
},
155151
},
156152
};
153+
154+
const preview: Preview = {
155+
tags: ['autodocs'],
156+
parameters,
157+
decorators,
158+
globalTypes,
159+
};
160+
161+
export default preview;

docs/stories/contributing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Markdown } from '@storybook/blocks';
1+
import { Meta, Markdown } from '@storybook/addon-docs/blocks';
22

33
import Contributing from '../../CONTRIBUTING.md?raw';
44

docs/stories/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta } from '@storybook/blocks';
1+
import { Meta } from '@storybook/addon-docs/blocks';
22
import { Figma } from '@storybook/addon-designs/blocks';
33

44
<Meta title="Getting started" />

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@
4040
"@commitlint/config-conventional": "^19.8.0",
4141
"@commitlint/types": "^19.8.0",
4242
"@figma/code-connect": "^1.3.1",
43-
"@storybook/addon-a11y": "^9.0.0-alpha.17",
44-
"@storybook/addon-designs": "^9.0.0-next.2",
45-
"@storybook/addon-docs": "^9.0.0-alpha.17",
46-
"@storybook/addon-themes": "^9.0.0-alpha.17",
47-
"@storybook/blocks": "^9.0.0-alpha.17",
48-
"@storybook/react": "^9.0.0-alpha.17",
49-
"@storybook/react-vite": "^9.0.0-alpha.17",
43+
"@storybook/addon-a11y": "^9.0.0-alpha.19",
44+
"@storybook/addon-designs": "^10.0.0",
45+
"@storybook/addon-docs": "^9.0.0-alpha.19",
46+
"@storybook/addon-themes": "^9.0.0-alpha.19",
47+
"@storybook/react": "^9.0.0-alpha.19",
48+
"@storybook/react-vite": "^9.0.0-alpha.19",
5049
"@testing-library/dom": "^10.4.0",
5150
"@testing-library/jest-dom": "^6.6.2",
5251
"@testing-library/react": "^16.3.0",
@@ -74,7 +73,7 @@
7473
"react-dom": "19.1.0",
7574
"react-router": "7.0.1",
7675
"rollup-plugin-pure": "^0.3.0",
77-
"storybook": "^9.0.0-alpha.17",
76+
"storybook": "^9.0.0-alpha.19",
7877
"storybook-addon-pseudo-states": "^4.0.2",
7978
"tsx": "^4.19.3",
8079
"typescript": "^5.8.2",

packages/components/stories/recipes/ComboBoxDialog.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Canvas } from '@storybook/blocks';
1+
import { Meta, Canvas } from '@storybook/addon-docs/blocks';
22
import { ComboBoxDialog } from './composition.stories';
33

44
<Meta title="Recipes/ComboBoxDialog" />

packages/components/stories/recipes/CopyToClipboard.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Canvas } from '@storybook/blocks';
1+
import { Meta, Canvas } from '@storybook/addon-docs/blocks';
22
import { CopyToClipboard } from './composition.stories';
33

44
<Meta title="Recipes/CopyToClipboard" />

packages/components/stories/recipes/DisabledWithTooltip.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Canvas } from '@storybook/blocks';
1+
import { Meta, Canvas } from '@storybook/addon-docs/blocks';
22
import { DisabledWithTooltip } from './composition.stories';
33

44
<Meta title="Recipes/DisabledWithTooltip" />

packages/components/stories/recipes/ListBoxTooltip.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Canvas } from '@storybook/blocks';
1+
import { Meta, Canvas } from '@storybook/addon-docs/blocks';
22
import { ListBoxTooltip } from './composition.stories';
33

44
<Meta title="Recipes/ListBoxTooltip" />

packages/components/stories/recipes/Pagination.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Canvas } from '@storybook/blocks';
1+
import { Meta, Canvas } from '@storybook/addon-docs/blocks';
22
import { Pagination } from './composition.stories';
33

44
<Meta title="Recipes/Pagination" />

packages/components/stories/recipes/RadioButtonGroup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Canvas } from '@storybook/blocks';
1+
import { Meta, Canvas } from '@storybook/addon-docs/blocks';
22
import { RadioButtonGroup } from './composition.stories';
33

44
<Meta title="Recipes/RadioButtonGroup" />

0 commit comments

Comments
 (0)