Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniebigodes committed Jan 31, 2024
1 parent 50238d9 commit d1ce421
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/configure/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ If you're using Vue single file components and TypeScript, you can add both [Vol

### Storybook doesn't create the required types for external packages

If you're working with a project relying on a third-party library and you're running into an issue where you notice that the required types are not being generated, preventing you from accurately documenting your components, you can adjust the `reactDocgen` configuration option in your Storybook configuration file to use `react-docgen-typescript` instead and include the required options. For example:
If your project relies on a third-party library and the expected types are not being generated, preventing you from accurately documenting your components, you can adjust the `reactDocgen` configuration option in your Storybook configuration file to use `react-docgen-typescript` instead and include the required options. For example:

<!-- prettier-ignore-start -->

Expand Down
12 changes: 6 additions & 6 deletions docs/essentials/controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Finally, update your `.storybook/preview.ts` file to include the following confi

<!-- prettier-ignore-end -->

When you set the `component` annotation to the default export of your story file, it will be used to infer the controls and auto-generate the matching [`argTypes`](../api/arg-types.md) for your component.
When you set the `component` annotation of the default export of your story file, it will be used to infer the controls and auto-generate the matching [`argTypes`](../api/arg-types.md) for your component.

<!-- prettier-ignore-start -->

Expand All @@ -89,9 +89,9 @@ When you set the `component` annotation to the default export of your story file

<IfRenderer renderer='ember'>

By default, Storybook will try to infer the required argTypes and associated controls for your stories based on the metadata provided by the [`@storybook/ember-cli-storybook`](https://github.com/storybookjs/ember-cli-storybook) addon. You'll need to take some additional steps to set it up properly.
By default, Storybook will try to infer the required argTypes and associated controls for your stories based on the metadata provided by the [`@storybook/ember-cli-storybook`](https://github.com/storybookjs/ember-cli-storybook) adapter. You'll need to take some additional steps to set it up properly.

Update your `ember-cli-build.js` configuration file to include the addon.
Update your `ember-cli-build.js` configuration file to include the adapter.

<!-- prettier-ignore-start -->

Expand Down Expand Up @@ -121,7 +121,7 @@ Enabling this feature will generate a `storybook-docgen/index.json` automaticall

</Callout>

When you set the `component` annotation to the default export of your story file, it will be used to infer the controls and auto-generate the matching [`argTypes`](../api/arg-types.md) for your component.
When you set the `component` annotation of the default export of your story file, it will be used to infer the controls and auto-generate the matching [`argTypes`](../api/arg-types.md) for your component.

<!-- prettier-ignore-start -->

Expand Down Expand Up @@ -171,7 +171,7 @@ By default, Storybook will choose a control for each arg based on its initial va

<IfRenderer renderer='web-components'>

By default, Storybook will try to infer the required argTypes and associated controls for your stories based on the component's definition and the initial value of the args. You'll need to take some additional steps to set it up properly. You can opt to generate a [`custom-elements.json`](https://github.com/webcomponents/custom-elements-json) file with [`@custom-elements-manifest/analyzer`](https://github.com/open-wc/custom-elements-manifest) if you're using the `pre-v1.0.0` version of the elements file or [`@custom-elements-manifest/analyzer`](https://github.com/open-wc/custom-elements-manifest) for newer versions and configure it in your Storybook UI configuration file (i.e., `.storybook/preview.js|ts`) to enable it.
By default, Storybook will try to infer the required argTypes and associated controls for your stories based on the component's definition and the initial value of the args. You'll need to take some additional steps to set it up properly. You can opt to generate a [`custom-elements.json`](https://github.com/webcomponents/custom-elements-json) file with [`@custom-elements-manifest/analyzer`](https://github.com/open-wc/custom-elements-manifest) if you're using the `pre-v1.0.0` version of the elements file or [`@custom-elements-manifest/analyzer`](https://github.com/open-wc/custom-elements-manifest/tree/master/packages/analyzer) for newer versions and configure it in your Storybook UI configuration file (i.e., `.storybook/preview.js|ts`) to enable it.

<!-- prettier-ignore-start -->

Expand All @@ -185,7 +185,7 @@ By default, Storybook will try to infer the required argTypes and associated con

<!-- prettier-ignore-end -->

When you set the `component` annotation to the default export of your story file, it will be used to infer the controls and auto-generate the matching [`argTypes`](../api/arg-types.md) for your component.
When you set the `component` annotation of the default export of your story file, it will be used to infer the controls and auto-generate the matching [`argTypes`](../api/arg-types.md) for your component.

<!-- prettier-ignore-start -->

Expand Down
4 changes: 3 additions & 1 deletion docs/snippets/react/storybook-main-prop-filter.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const config: StorybookConfig = {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
propFilter: () => true,
// Filter out third-party props from node_modules except @mui packages.
propFilter: (prop) =>
prop.parent ? !/node_modules\/(?!@mui)/.test(prop.parent.fileName) : true,
},
},
};
Expand Down

0 comments on commit d1ce421

Please sign in to comment.