From f84077486462bb3990b021bd28bebc163a910e68 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Fri, 15 Nov 2024 11:58:40 +0000 Subject: [PATCH] Merge pull request #29546 from storybookjs/docs_adjust_svelte_snippets_v5 Docs: Svelte CSF snippets (cherry picked from commit c7569a60f827d04db7d588844b5d8ad2ac6bcf52) --- docs/_snippets/button-group-story.md | 124 ++++++- ...utton-story-click-handler-simplificated.md | 23 -- docs/_snippets/button-story-click-handler.md | 17 - .../button-story-component-args-primary.md | 73 +++- .../button-story-component-decorator.md | 61 ++- .../button-story-controls-primary-variant.md | 95 ++++- .../button-story-controls-radio-group.md | 105 +++++- docs/_snippets/button-story-decorator.md | 67 +++- .../button-story-default-docs-code.md | 67 ---- ...ton-story-default-export-with-component.md | 43 ++- .../button-story-primary-composition.md | 140 ++++++- .../button-story-primary-long-name.md | 149 +++++++- docs/_snippets/button-story-rename-story.md | 7 +- docs/_snippets/button-story-using-args.md | 136 +++++-- .../button-story-with-addon-example.md | 84 ++++- docs/_snippets/button-story-with-args.md | 78 ++-- docs/_snippets/button-story-with-emojis.md | 97 +++-- docs/_snippets/button-story.md | 66 ++-- docs/_snippets/checkbox-story-csf.md | 126 ++++++- docs/_snippets/checkbox-story.md | 38 +- ...y-conditional-controls-mutual-exclusion.md | 135 ++++++- ...onent-story-conditional-controls-toggle.md | 117 +++++- .../component-story-custom-args-complex.md | 151 ++++++-- .../component-story-custom-args-mapping.md | 189 +++++++++- .../component-story-disable-controls-alt.md | 105 +++++- .../component-story-disable-controls-regex.md | 227 ++++++++++- .../component-story-disable-controls.md | 117 +++++- .../component-story-sort-controls.md | 77 +++- .../component-story-static-asset-cdn.md | 73 +++- ...omponent-story-static-asset-with-import.md | 83 +++-- ...onent-story-static-asset-without-import.md | 63 +++- .../component-story-with-accessibility.md | 78 +++- .../gizmo-story-controls-customization.md | 351 +++++++++++++++++- docs/_snippets/histogram-story.md | 100 +++-- docs/_snippets/list-story-expanded.md | 110 ++++-- docs/_snippets/list-story-starter.md | 103 ++++- .../login-form-with-play-function.md | 191 ++++++++-- .../main-config-csf-addon-register.md | 28 -- .../main-config-svelte-csf-register.md | 24 ++ docs/_snippets/margindecorator.md | 39 +- docs/_snippets/my-component-disable-toc.md | 119 +++++- .../my-component-play-function-alt-queries.md | 158 +++++++- ...my-component-play-function-query-findby.md | 170 ++++++++- .../my-component-play-function-waitfor.md | 236 +++++++++++- .../my-component-play-function-with-canvas.md | 152 +++++++- ...component-play-function-with-clickevent.md | 218 ++++++++++- .../my-component-play-function-with-delay.md | 215 ++++++++++- ...omponent-play-function-with-selectevent.md | 231 +++++++++++- .../my-component-story-basic-and-props.md | 58 ++- .../my-component-vite-env-variables.md | 116 +++++- .../my-component-with-env-variables.md | 124 ++++++- docs/_snippets/page-story-slots.md | 63 +++- docs/_snippets/page-story.md | 55 ++- docs/_snippets/parameters-in-meta.md | 145 ++++++-- docs/_snippets/parameters-in-story.md | 126 ++++++- .../register-component-with-play-function.md | 271 +++++++++++++- .../storybook-addon-a11y-component-config.md | 201 +++++++++- .../_snippets/storybook-addon-a11y-disable.md | 73 +++- .../storybook-addon-a11y-story-config.md | 118 +++++- .../storybook-auto-docs-baseline-example.md | 42 +-- .../storybook-auto-docs-custom-file.md | 13 +- ...ybook-auto-docs-mdx-docs-docs-only-page.md | 33 +- .../storybook-auto-docs-mdx-docs-dos-donts.md | 9 +- .../storybook-auto-docs-mdx-docs-imports.md | 15 +- ...storybook-auto-docs-mdx-docs-meta-block.md | 19 +- .../storybook-auto-docs-mdx-docs-story.md | 19 +- .../_snippets/storybook-auto-docs-mdx-file.md | 81 +++- .../storybook-auto-docs-standalone-page.md | 6 +- .../storybook-auto-docs-starter-example.md | 43 ++- .../storybook-custom-docs-markdown.md | 9 +- docs/_snippets/svelte-csf-addon-options.md | 31 ++ docs/_snippets/svelte-csf-addon-tags.md | 31 ++ .../svelte-csf-story-custom-children.md | 39 ++ docs/_snippets/svelte-csf-story-migration.md | 27 ++ .../svelte-vite-framework-options.md | 27 ++ .../svelte-webpack-framework-options.md | 27 ++ docs/_snippets/sveltekit-framework-options.md | 27 ++ .../table-story-fully-customize-controls.md | 30 -- docs/_snippets/tags-autodocs-in-meta.md | 79 +++- .../tags-autodocs-remove-component.md | 79 +++- docs/_snippets/tags-autodocs-remove-story.md | 107 +++++- docs/_snippets/tags-combo-example.md | 129 +++++-- docs/_snippets/tags-docs-only-in-meta.md | 155 ++++++-- docs/_snippets/tags-in-meta-and-story.md | 313 ++++++++++++---- docs/_snippets/tags-in-preview.md | 21 +- docs/_snippets/tags-remove-in-story.md | 145 ++++++-- .../your-component-with-decorator.md | 62 +++- docs/_snippets/your-component.md | 88 +++-- docs/essentials/controls.mdx | 53 ++- docs/get-started/browse-stories.mdx | 2 +- docs/get-started/frameworks/svelte-vite.mdx | 133 ++++++- .../frameworks/svelte-webpack5.mdx | 45 +-- docs/get-started/frameworks/sveltekit.mdx | 141 +++++-- docs/get-started/install.mdx | 16 +- docs/get-started/setup.mdx | 6 +- docs/get-started/whats-a-story.mdx | 26 +- docs/writing-docs/autodocs.mdx | 10 +- docs/writing-docs/mdx.mdx | 2 +- docs/writing-stories/args.mdx | 48 ++- docs/writing-stories/decorators.mdx | 68 +++- docs/writing-stories/index.mdx | 143 +++++-- docs/writing-stories/parameters.mdx | 34 +- docs/writing-stories/play-function.mdx | 18 +- docs/writing-stories/typescript.mdx | 2 +- docs/writing-tests/accessibility-testing.mdx | 31 +- 105 files changed, 8108 insertions(+), 1182 deletions(-) delete mode 100644 docs/_snippets/button-story-default-docs-code.md delete mode 100644 docs/_snippets/main-config-csf-addon-register.md create mode 100644 docs/_snippets/main-config-svelte-csf-register.md create mode 100644 docs/_snippets/svelte-csf-addon-options.md create mode 100644 docs/_snippets/svelte-csf-addon-tags.md create mode 100644 docs/_snippets/svelte-csf-story-custom-children.md create mode 100644 docs/_snippets/svelte-csf-story-migration.md create mode 100644 docs/_snippets/svelte-vite-framework-options.md create mode 100644 docs/_snippets/svelte-webpack-framework-options.md create mode 100644 docs/_snippets/sveltekit-framework-options.md delete mode 100644 docs/_snippets/table-story-fully-customize-controls.md diff --git a/docs/_snippets/button-group-story.md b/docs/_snippets/button-group-story.md index e7695e6334a4..14a3021bbabd 100644 --- a/docs/_snippets/button-group-story.md +++ b/docs/_snippets/button-group-story.md @@ -160,7 +160,46 @@ export const Pair: Story = { }; ``` -```js filename="ButtonGroup.stories.js" renderer="svelte" language="js" +```svelte filename="ButtonGroup.stories.svelte" renderer="svelte" language="js" tabTitle="Svelte CSF" + + + + + + + +``` + +```js filename="ButtonGroup.stories.js" renderer="svelte" language="js" tabTitle="CSF" import ButtonGroup from '../ButtonGroup.svelte'; //πŸ‘‡ Imports the Button stories @@ -178,7 +217,46 @@ export const Pair = { }; ``` -```ts filename="ButtonGroup.stories.ts" renderer="svelte" language="ts-4-9" +```svelte filename="ButtonGroup.stories.svelte" renderer="svelte" language="ts-4-9" tabTitle="Svelte CSF" + + + + + + + +``` + +```ts filename="ButtonGroup.stories.ts" renderer="svelte" language="ts-4-9" tabTitle="CSF" import type { Meta, StoryObj } from '@storybook/svelte'; import ButtonGroup from './ButtonGroup.svelte'; @@ -201,7 +279,46 @@ export const Pair: Story = { }; ``` -```ts filename="ButtonGroup.stories.ts" renderer="svelte" language="ts" +```svelte filename="ButtonGroup.stories.svelte" renderer="svelte" language="ts" tabTitle="Svelte CSF" + + + + + + + +``` + +```ts filename="ButtonGroup.stories.ts" renderer="svelte" language="ts" tabTitle="CSF" import type { Meta, StoryObj } from '@storybook/svelte'; import ButtonGroup from './ButtonGroup.svelte'; @@ -350,4 +467,3 @@ export const Pair: Story = { }, }; ``` - diff --git a/docs/_snippets/button-story-click-handler-simplificated.md b/docs/_snippets/button-story-click-handler-simplificated.md index 7c15bd02541b..983d07c5a843 100644 --- a/docs/_snippets/button-story-click-handler-simplificated.md +++ b/docs/_snippets/button-story-click-handler-simplificated.md @@ -119,28 +119,6 @@ export const Text = { }; ``` -```html renderer="svelte" language="ts" tabTitle="native-format" -{/* Button.stories.svelte */} - - - -{/* - See https://storybook.js.org/docs/essentials/actions#action-argtype-annotation - to learn how to set up argTypes for actions -*/} - - - - - - -``` - ```ts filename="Button.stories.ts" renderer="svelte" language="ts-4-9" import type { Meta, StoryObj } from '@storybook/svelte'; @@ -262,4 +240,3 @@ export const Text: Story = { args: {}, }; ``` - diff --git a/docs/_snippets/button-story-click-handler.md b/docs/_snippets/button-story-click-handler.md index c9b2e1a206d1..731f41ac6a79 100644 --- a/docs/_snippets/button-story-click-handler.md +++ b/docs/_snippets/button-story-click-handler.md @@ -149,22 +149,6 @@ export const Text = { }; ``` -```html renderer="svelte" language="ts" tabTitle="native-format" -{/* Button.stories.svelte */} - - - - - -