storybook-design-token icon indicating copy to clipboard operation
storybook-design-token copied to clipboard

Possible bug when reading parameters?

Open Smolations opened this issue 2 years ago • 2 comments

Some lists of tokens, like colors, are often very long. It makes sense to have a search field for them. Others, like line height, will contain just a couple. In trying to disable the search field for just a single set of tokens in MDX fails for me. No errors, just doesn't work (input remains visible). According to the storybook MDX blocks documentation, these should be allowed via the <Meta /> block. However, trying this with with your addon has no effect. Basically, I tried this within the MDX:

<Meta
  title="Design Tokens/Line Height"
  parameters={{ designToken: { showSearch: false } }}
/>

I also tried the same on the provided <DesignTokenDocBlock /> as well, also with no effect. Is this not supported?

Smolations avatar Sep 20 '22 20:09 Smolations

I'll look into it. Maybe an oversight.

Sqrrl avatar Nov 20 '22 10:11 Sqrrl

@Smolations DesignTokenDocBlock doesn't use configuration provided to Meta parameters.

To disable search, you just need to use showSearch of the DesignTokenDocBlock component in the following way:

<DesignTokenDocBlock categoryName="Colors" maxHeight="none" viewType="table" showSearch={false}/>

acherkashin avatar Nov 05 '23 09:11 acherkashin