diff --git a/examples/standalone-preview/package.json b/examples/standalone-preview/package.json index 3f67f73c8cfe..36819a46d34a 100644 --- a/examples/standalone-preview/package.json +++ b/examples/standalone-preview/package.json @@ -6,6 +6,7 @@ "storybook": "parcel ./storybook.html --port 1337" }, "devDependencies": { + "@storybook/addon-docs": "6.4.0-alpha.11", "@storybook/react": "6.4.0-alpha.11", "parcel": "^1.12.4", "react": "16.14.0", diff --git a/examples/standalone-preview/storybook.html b/examples/standalone-preview/storybook.html index ed566e7e2af9..834cd2e00ca0 100644 --- a/examples/standalone-preview/storybook.html +++ b/examples/standalone-preview/storybook.html @@ -9,7 +9,7 @@
- +
diff --git a/examples/standalone-preview/storybook.ts b/examples/standalone-preview/storybook.ts index 6480e83e1f2d..b218ec5b6f50 100644 --- a/examples/standalone-preview/storybook.ts +++ b/examples/standalone-preview/storybook.ts @@ -1,5 +1,14 @@ -import { configure } from '@storybook/react'; +import { configure, addParameters } from '@storybook/react'; +import { DocsPage, DocsContainer } from '@storybook/addon-docs'; + import * as Comp1 from './stories/Component1.stories'; import * as Comp2 from './stories/Component2.stories'; +addParameters({ + docs: { + page: DocsPage, + container: DocsContainer, + }, +}); + configure(() => [Comp1, Comp2], module); diff --git a/examples/standalone-preview/storybook.tsx b/examples/standalone-preview/storybook.tsx deleted file mode 100644 index 4d02fd13e1dc..000000000000 --- a/examples/standalone-preview/storybook.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react'; -import { configure, storiesOf, addParameters } from '@storybook/react'; -import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks'; - -addParameters({ - docsContainer: DocsContainer, - docs: DocsPage, -}); - -configure(() => { - storiesOf('Component 1', module).add('Story 1', () =>
Component 1 - Story 1
); - - storiesOf('Component 2', module) - .add('Story 1', () =>
Category 2 - Story 1
) - .add('Story 2', () =>
Category 2 - Story 2
); -}, module);