From dde3e33798656804ec7db7b2cf81edb636a52774 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Tue, 13 Jun 2023 21:20:03 -0600 Subject: [PATCH 1/2] Remove (deprecated) from headings - Removed to ensure heading anchor links are stable over time - Consistently display deprecated properties throughout API references --- docs/api/arg-types.md | 4 +- docs/api/doc-block-canvas.md | 24 ++++++++--- docs/api/doc-block-description.md | 12 ++++-- docs/api/doc-block-primary.md | 4 +- docs/api/doc-block-source.md | 8 +++- docs/api/doc-block-story.md | 40 ++++++++++++++----- docs/api/main-config-config.md | 4 +- docs/api/main-config.md | 2 +- .../angular/arg-types-default-value.ts.mdx | 2 +- .../common/arg-types-default-value.js.mdx | 2 +- .../common/arg-types-default-value.ts.mdx | 2 +- .../arg-types-default-value.js.mdx | 2 +- .../arg-types-default-value.ts.mdx | 2 +- 13 files changed, 77 insertions(+), 31 deletions(-) diff --git a/docs/api/arg-types.md b/docs/api/arg-types.md index cff029e9fc32..c6ae8fa6e056 100644 --- a/docs/api/arg-types.md +++ b/docs/api/arg-types.md @@ -479,7 +479,9 @@ If you only need to specify the documented type, you should use [`table.type`](# -### `defaultValue` (deprecated) +### `defaultValue` + +(⛔️ **Deprecated**) Type: `any` diff --git a/docs/api/doc-block-canvas.md b/docs/api/doc-block-canvas.md index ec479efe3f93..a77fb401d1f0 100644 --- a/docs/api/doc-block-canvas.md +++ b/docs/api/doc-block-canvas.md @@ -202,37 +202,49 @@ Default: `parameters.docs.canvas.withToolbar` Determines whether to render a toolbar containing tools to interact with the story. -### `children` (deprecated) +### `children` + +(⛔️ **Deprecated**) Type: `React.ReactNode` Expects only [Story](./doc-block-story.md) children. Reference the story with the `of` prop instead. -### `columns` (deprecated) +### `columns` + +(⛔️ **Deprecated**) Type: `number` Splits the stories based on the number of defined columns. Multiple stories are not supported. -### `isColumn` (deprecated) +### `isColumn` + +(⛔️ **Deprecated**) Type: `boolean` Displays the stories one above the other. Multiple stories are not supported. -### `mdxSource` (deprecated) +### `mdxSource` + +(⛔️ **Deprecated**) Type: `string` Provides source to display. Use [`source.code`](#source) instead. -### `withSource` (deprecated) +### `withSource` + +(⛔️ **Deprecated**) Type: `'open' | 'closed' | 'none'` Controls the source code block visibility. Use [`sourceState`](#sourcestate) instead. -### `withToolbar` (deprecated) +### `withToolbar` + +(⛔️ **Deprecated**) Type: `boolean` diff --git a/docs/api/doc-block-description.md b/docs/api/doc-block-description.md index 4a8a99303888..e9efa50e2e9e 100644 --- a/docs/api/doc-block-description.md +++ b/docs/api/doc-block-description.md @@ -35,19 +35,25 @@ Specifies where to pull the description from. It can either point to a story or Descriptions are pulled from the JSDoc comments or parameters, and they are rendered as markdown. See [Writing descriptions](#writing-descriptions) for more details. -### `children` (deprecated) +### `children` + +(⛔️ **Deprecated**) Type: `string` See [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo). -### `markdown` (deprecated) +### `markdown` + +(⛔️ **Deprecated**) Type: `string` See [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#description-block-parametersnotes-and-parametersinfo). -### `type` (deprecated) +### `type` + +(⛔️ **Deprecated**) Type: `'info' | 'notes' | 'docgen' | 'auto'` diff --git a/docs/api/doc-block-primary.md b/docs/api/doc-block-primary.md index d8b1675eff4d..be806ab0c50b 100644 --- a/docs/api/doc-block-primary.md +++ b/docs/api/doc-block-primary.md @@ -27,7 +27,9 @@ import { Primary } from '@storybook/blocks'; `Primary` is configured with the following props: -### `name` (deprecated) +### `name` + +(⛔️ **Deprecated**) Type: `string` diff --git a/docs/api/doc-block-source.md b/docs/api/doc-block-source.md index 5ea1615bec55..df4a79049d10 100644 --- a/docs/api/doc-block-source.md +++ b/docs/api/doc-block-source.md @@ -151,13 +151,17 @@ Specifies how the source code is rendered. -### `id` (deprecated) +### `id` + +(⛔️ **Deprecated**) Type: `string` Specifies the story id for which to render the source code. Referencing a story this way is no longer supported; use the [`of` prop](#of), instead. -### `ids` (deprecated) +### `ids` + +(⛔️ **Deprecated**) Type: `string[]` diff --git a/docs/api/doc-block-story.md b/docs/api/doc-block-story.md index bfb97ead8d22..1532740946fd 100644 --- a/docs/api/doc-block-story.md +++ b/docs/api/doc-block-story.md @@ -124,61 +124,81 @@ Type: Story export Specifies which story is rendered by the `Story` block. If no `of` is defined and the MDX file is [attached](./doc-block-meta.md#attached-vs-unattached), the primary (first) story will be rendered. -### `args` (deprecated) +### `args` + +(⛔️ **Deprecated**) Type: `Partial` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `argTypes` (deprecated) +### `argTypes` + +(⛔️ **Deprecated**) Type: `Partial>` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `decorators` (deprecated) +### `decorators` + +(⛔️ **Deprecated**) Type: `DecoratorFunction[]` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `loaders` (deprecated) +### `loaders` + +(⛔️ **Deprecated**) Type: `LoaderFunction[]` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `name` (deprecated) +### `name` + +(⛔️ **Deprecated**) Type: `StoryName` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `parameters` (deprecated) +### `parameters` + +(⛔️ **Deprecated**) Type: `Parameters` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `play` (deprecated) +### `play` + +(⛔️ **Deprecated**) Type: `PlayFunction` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `render` (deprecated) +### `render` + +(⛔️ **Deprecated**) Type: `ArgsStoryFn` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `story` (deprecated) +### `story` + +(⛔️ **Deprecated**) Type: `Omit, 'story'>` Defining and configuring stories in MDX is deprecated. See the [Migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mdx-docs-files) for details. -### `storyName` (deprecated) +### `storyName` + +(⛔️ **Deprecated**) Type: `StoryName` diff --git a/docs/api/main-config-config.md b/docs/api/main-config-config.md index 2f3a68174e03..326f28f9ace7 100644 --- a/docs/api/main-config-config.md +++ b/docs/api/main-config-config.md @@ -2,10 +2,10 @@ title: 'config' --- +(⛔️ **Deprecated**) + Parent: [main.js|ts configuration](./main-config.md) Type: `string[] | ((config: string[], options: Options) => string[] | Promise)` -Deprecated: `true` - Add additional scripts to run in the story preview. Deprecated in favor of [`previewAnnotations`](./main-config-preview-annotations.md). diff --git a/docs/api/main-config.md b/docs/api/main-config.md index 17406cad47b7..5dc77b40e897 100644 --- a/docs/api/main-config.md +++ b/docs/api/main-config.md @@ -44,4 +44,4 @@ An object to configure Storybook containing the following properties: - [`typescript`](./main-config-typescript.md) - [`viteFinal`](./main-config-vite-final.md) - [`webpackFinal`](./main-config-webpack-final.md) -- [`config`](./main-config-config.md) (deprecated) +- [`config`](./main-config-config.md) (⛔️ Deprecated) diff --git a/docs/snippets/angular/arg-types-default-value.ts.mdx b/docs/snippets/angular/arg-types-default-value.ts.mdx index 41e3d3987501..acd4522cf751 100644 --- a/docs/snippets/angular/arg-types-default-value.ts.mdx +++ b/docs/snippets/angular/arg-types-default-value.ts.mdx @@ -9,7 +9,7 @@ const meta: Meta = { component: Example, argTypes: { value: { - // ❌ Deprecated + // ⛔️ Deprecated, do not use defaultValue: 0, }, }, diff --git a/docs/snippets/common/arg-types-default-value.js.mdx b/docs/snippets/common/arg-types-default-value.js.mdx index a5425e8bc1b9..2b978568c148 100644 --- a/docs/snippets/common/arg-types-default-value.js.mdx +++ b/docs/snippets/common/arg-types-default-value.js.mdx @@ -7,7 +7,7 @@ export default { component: Example, argTypes: { value: { - // ❌ Deprecated + // ⛔️ Deprecated, do not use defaultValue: 0, }, }, diff --git a/docs/snippets/common/arg-types-default-value.ts.mdx b/docs/snippets/common/arg-types-default-value.ts.mdx index 4ec1f545818b..1f8b26d385e8 100644 --- a/docs/snippets/common/arg-types-default-value.ts.mdx +++ b/docs/snippets/common/arg-types-default-value.ts.mdx @@ -10,7 +10,7 @@ const meta: Meta = { component: Example, argTypes: { value: { - // ❌ Deprecated + // ⛔️ Deprecated, do not use defaultValue: 0, }, }, diff --git a/docs/snippets/web-components/arg-types-default-value.js.mdx b/docs/snippets/web-components/arg-types-default-value.js.mdx index 731f6b020070..1adbe70fb486 100644 --- a/docs/snippets/web-components/arg-types-default-value.js.mdx +++ b/docs/snippets/web-components/arg-types-default-value.js.mdx @@ -5,7 +5,7 @@ export default { component: 'demo-example', argTypes: { value: { - // ❌ Deprecated + // ⛔️ Deprecated, do not use defaultValue: 0, }, }, diff --git a/docs/snippets/web-components/arg-types-default-value.ts.mdx b/docs/snippets/web-components/arg-types-default-value.ts.mdx index 225ba930e756..73a989becbbe 100644 --- a/docs/snippets/web-components/arg-types-default-value.ts.mdx +++ b/docs/snippets/web-components/arg-types-default-value.ts.mdx @@ -7,7 +7,7 @@ const meta: Meta = { component: 'demo-example', argTypes: { value: { - // ❌ Deprecated + // ⛔️ Deprecated, do not use defaultValue: 0, }, }, From 320aed54f66e40ebf72a3e02d0a477dc92ab26c7 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Tue, 13 Jun 2023 21:26:49 -0600 Subject: [PATCH 2/2] Remove (required) from headings - Removed to ensure heading anchor links are stable over time - Consistently display required properties throughout API references --- docs/api/doc-block-colorpalette.md | 12 +++++++++--- docs/api/doc-block-icongallery.md | 4 +++- docs/api/doc-block-useof.md | 4 +++- docs/api/main-config-framework.md | 4 ++-- docs/api/main-config-stories.md | 8 ++++---- docs/api/main-config.md | 4 ++-- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/docs/api/doc-block-colorpalette.md b/docs/api/doc-block-colorpalette.md index 62dd565cf884..3229612173c3 100644 --- a/docs/api/doc-block-colorpalette.md +++ b/docs/api/doc-block-colorpalette.md @@ -66,19 +66,25 @@ import { ColorItem } from '@storybook/blocks'; `ColorItem` is configured with the following props: -### `colors` (required) +### `colors` + +(**Required**) Type: `string[] | { [key: string]: string }` Provides the list of colors to be displayed. Accepts any valid CSS color format (hex, RGB, HSL, etc.). When an object is provided, the keys will be displayed above the values. -### `subtitle` (required) +### `subtitle` + +(**Required**) Type: `string` Provides an additional description of the color. -### `title` (required) +### `title` + +(**Required**) Type: `string` diff --git a/docs/api/doc-block-icongallery.md b/docs/api/doc-block-icongallery.md index a9861905ba74..db16ee30ed53 100644 --- a/docs/api/doc-block-icongallery.md +++ b/docs/api/doc-block-icongallery.md @@ -75,7 +75,9 @@ import { IconItem } from '@storybook/blocks'; `IconItem` is configured with the following props: -### `name` (required) +### `name` + +(**Required**) Type: `string` diff --git a/docs/api/doc-block-useof.md b/docs/api/doc-block-useof.md index 44d4521cd1ab..4499478aef5e 100644 --- a/docs/api/doc-block-useof.md +++ b/docs/api/doc-block-useof.md @@ -67,7 +67,9 @@ useOf = ( ## Parameters -### `moduleExportOrType` (required) +### `moduleExportOrType` + +(**Required**) Type: `ModuleExport | 'story' | 'meta' | 'component'` diff --git a/docs/api/main-config-framework.md b/docs/api/main-config-framework.md index abf8e0ca2b5a..4e4e563ee3ee 100644 --- a/docs/api/main-config-framework.md +++ b/docs/api/main-config-framework.md @@ -2,12 +2,12 @@ title: 'framework' --- +(**Required**) + Parent: [main.js|ts configuration](./main-config.md) Type: `FrameworkName | { name: FrameworkName; options?: FrameworkOptions }` -Required: `true` - Configures Storybook based on a set of [framework-specific](../configure/frameworks.md) settings. diff --git a/docs/api/main-config-stories.md b/docs/api/main-config-stories.md index aac62a1b3d98..9eefa1360565 100644 --- a/docs/api/main-config-stories.md +++ b/docs/api/main-config-stories.md @@ -2,6 +2,8 @@ title: 'stories' --- +(**Required**) + Parent: [main.js|ts configuration](./main-config.md) Type: @@ -11,8 +13,6 @@ Type: | async (list: (string | StoriesSpecifier)[]) => (string | StoriesSpecifier)[] ``` -Required: `true` - Configures Storybook to load stories from the specified locations. The intention is for you to colocate a story file along with the component it documents: ``` @@ -91,9 +91,9 @@ Type: #### `StoriesSpecifier.directory` -Type: `string` +(**Required**) -Required: `true` +Type: `string` Where to start looking for story files, relative to the root of your project. diff --git a/docs/api/main-config.md b/docs/api/main-config.md index 5dc77b40e897..ed4b1b387319 100644 --- a/docs/api/main-config.md +++ b/docs/api/main-config.md @@ -25,8 +25,8 @@ A typical Storybook configuration file looks like this: An object to configure Storybook containing the following properties: -- [`framework`](./main-config-framework.md) (required) -- [`stories`](./main-config-stories.md) (required) +- [`framework`](./main-config-framework.md) (Required) +- [`stories`](./main-config-stories.md) (Required) - [`addons`](./main-config-addons.md) - [`babel`](./main-config-babel.md) - [`babelDefault`](./main-config-babel-default.md)