You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After the update from version 5 to 6.x import { PropsTable } from '@storybook/components' component is no longer available and I'm trying to replicate it with the new import { ArgsTable } from "@storybook/addon-docs/blocks" with no luck.
Why do I even need it? Well in our open source component library we have created an util that helps us with documenting props of styled-system package because prop-types that are being spread from another package does not render properly in storybook.
This util is then used directly in *.mdx files like that:
<StyledSystemProps of={Select} margin />
In SB5 this generated 2 propTables, one for the props defined directly on the component, and the second one which is created manually with the styled-system props.
So after updating to SB6 I've done some digging and after finding this comment #11105 (comment)
I tried using the ArgsTable with properly structured rows prop (but without story or component props) to create a custom ArgsTable, but no matter what I do I always end up with No inputs found for this component. Read the docs error message. I even tried copy pasting the code from https://next--storybookjs.netlify.app/official-storybook/?path=/docs/docs-argstable--normal but still I get the same message all the time.
So to sum up: <ArgsTable of={Component} /> works fine but <ArgsTable rows={...} /> does not in mdx files
To Reproduce
I hope I described it well enough in the section above.
Expected behavior
I'd like to see my custom defined ArgsTable
After doing some more digging I've noticed that it actually works, but the ArgsTable has to be imported: import { ArgsTable } from "@storybook/components"
instead of import { ArgsTable } from "@storybook/addon-docs/blocks"
to be able to pass other props like rows or error.
Kinda hard to find it in documentation tbh :)
@mkrds those @storybook/components components are undocumented internal APIs subject to change. the doc blocks from @storybook/addon-docs/blocks are the public APIs. Documentation is thin, but will be getting better https://storybook.js.org/docs/react/writing-docs/doc-blocks
Describe the bug
After the update from version 5 to 6.x
import { PropsTable } from '@storybook/components'
component is no longer available and I'm trying to replicate it with the newimport { ArgsTable } from "@storybook/addon-docs/blocks"
with no luck.Why do I even need it? Well in our open source component library we have created an util that helps us with documenting props of
styled-system
package because prop-types that are being spread from another package does not render properly in storybook.Here's the util:
https://github.com/Sage/carbon/blob/master/.storybook/utils/styled-system-props.js#L468
This util is then used directly in
*.mdx
files like that:<StyledSystemProps of={Select} margin />
In SB5 this generated 2 propTables, one for the props defined directly on the component, and the second one which is created manually with the
styled-system
props.Expected result of that can be seen at the bottom of this page: https://carbon.sage.com/?path=/docs/design-system-select--controlled
So after updating to SB6 I've done some digging and after finding this comment #11105 (comment)
I tried using the
ArgsTable
with properly structuredrows
prop (but withoutstory
orcomponent
props) to create a customArgsTable
, but no matter what I do I always end up withNo inputs found for this component. Read the docs
error message. I even tried copy pasting the code from https://next--storybookjs.netlify.app/official-storybook/?path=/docs/docs-argstable--normal but still I get the same message all the time.So to sum up:
<ArgsTable of={Component} />
works fine but<ArgsTable rows={...} />
does not inmdx
filesTo Reproduce
I hope I described it well enough in the section above.
Expected behavior
I'd like to see my custom defined
ArgsTable
System
System:
OS: macOS 11.1
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Binaries:
Node: 12.16.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.8 - ~/Code/carbon/node_modules/.bin/npm
npmPackages:
@storybook/addon-a11y: ^6.1.18 => 6.1.18
@storybook/addon-actions: ^6.1.18 => 6.1.18
@storybook/addon-docs: ^6.1.18 => 6.1.18
@storybook/addon-google-analytics: ^6.1.18 => 6.1.18
@storybook/addon-knobs: ^6.1.18 => 6.1.18
@storybook/addon-links: ^6.1.18 => 6.1.18
@storybook/addon-viewport: ^6.1.18 => 6.1.18
@storybook/addons: ^6.1.18 => 6.1.18
@storybook/components: ^6.1.18 => 6.1.18
@storybook/react: ^6.1.18 => 6.1.18
@storybook/theming: ^6.1.18 => 6.1.18
The text was updated successfully, but these errors were encountered: