Closed tay1orjones closed 1 year ago
Process
withKnobs
decorator, if it existsexport default {
// ...
parameters: {
// ...
controls: {
hideNoControlsWarning: true,
},
},
argTypes: {
children: {
table: {
disable: true,
},
},
},
};
action
from componentsargs
to render, restructure, and pass to componentPreview
to Canvas
Props
to ArgsTable
How-to's
action('onClick')
to a control by giving it the type action
Questions
children
and className
be visible under Controls?Observations
Approaches
Goals
Options
Questions
What's done in the industry?
Preferences
Options
Just an fyi @tay1orjones and @tw15egan I am handling
Ensure there is a playground story
Add argtypes to playground story
For TextInput in this pr => https://github.com/carbon-design-system/carbon/pull/12139
I also plan to open a pr to help out with more of these soon
Thanks @TannerS!
I had a question for the team. here is a screenshot with numbers relating to my quesitons
1) When i see something like this (a task and a subtask of that task with two type of story files)
components/Pagination/Pagination-story.js
components/Pagination/next/Pagination.stories.js
does that mean too do both files? they both need playgrounds?
2) A lot of these components have a Default
set up that basically has all the args and argtypes set up, i find myself basically duplicating these for a "playground". I am curious if this is ok or are the defauts suppose to be replaced. One example is pagination
. once i understand intent i can improve my ongoing PR
3) do I need to only do storys in the next
folder?
4) Some components like the Form
and others, have no props for a playground, like this one has onlye classname and children. Technically for a playground class and children dont make much sense since u cant see anything or pass in a control with jsx but they are on the list. How should these be handled?
thanks in advance
cc: @tay1orjones @tw15egan @abbeyhrt
@TannerS
next
folder deleted.
Every component in the storybook sidebar should have a Playground story, those stories should have operable controls.
High level checklist for each component:
.stories.js
file out ofnext
folder, or create.stories.js
file and copy contents of*-story.js
file over.knobs
package and usage.argtypes
to playground story...args
to playground story, spread them on the applicable component(s)FAQ:
Checklist