New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from storybook knobs to controls #966
Conversation
|
a6d01e4
to
c64490f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing to stop reminders until Netlify deploy failure has been resolved. Please request a re-review once all the status checks pass. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, Caleb, this is awesome. I have some high-level questions in here, but just wanted to leave a note letting you know I'm very pleased with the progress overall.
@tylersticka I can switch radio buttons back to select. Should I switch just the ones where the empty value makes the radio button off center, or should I switch all of the radios back to selects? |
I haven't reviewed every control, but the ones with empty values or more than 3 or 4 values should probably use a |
@tylersticka I went through all the radios/selects and set them based on the # of items and whether they had empty values ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@calebeby I think we may have some options for further simplifying the definition of controls.
You can avoid associating argTypes
with every individual story by assigning it to the Meta
element at the beginning of the file:
<Meta title="Components/Button" argTypes={argTypes} />
You can then limit usage of argTypes
on Story
elements to cases where you want to override those for some reason.
We can also simplify variations by using the args
property rather than modifying and passing along a unique argTypes
value. Example:
// ...
<Meta title="Objects/Media" argTypes={argTypes} />
// ...
<Canvas>
<Story name="Image">{(args) => imageDemo(args)}</Story>
</Canvas>
// ...
<Canvas>
<Story name="Image Reversed" args={{ reverse: true }}>
{(args) => imageDemo(args)}
</Story>
</Canvas>
@tylersticka This is ready for another review! I switched many of the stories to use |
import messageDemo from './demo/default-message.twig'; | ||
import messageWithCloseDemo from './demo/message-with-close.twig'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tylersticka I removed this since I could just use the default demo and pass in the include_close
arg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. Thanks, @calebeby!
Overview
Closes #947
It is worth testing the behavior of all the stories I updated. I updated them by hand and there are likely places where the behavior is not exactly the way we want.
Testing