-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ToolTip: Remove knobs in stories #46515
Conversation
{ showMessage ? <p>Hello World!</p> : null } | ||
</> | ||
); | ||
export const DisabledChild = Template.bind( {} ); |
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.
I think this story can be removed because it's basically just a mock for manual testing (that is already covered in unit tests #35254) 🤔 I'm fine with leaving it in for now though.
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.
I'm fine with leaving it as well, I guess someone could find it useful.
Size Change: 0 B Total Size: 1.32 MB ℹ️ View Unchanged
|
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.
Works well and code LGTM 👍
@@ -17,79 +6,80 @@ import Tooltip from '../'; | |||
export default { | |||
title: 'Components/ToolTip', | |||
component: Tooltip, | |||
argTypes: { | |||
delay: { control: 'number' }, |
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.
Should we also add a defaultValue
of 700
to keep the default value that was there when we used knobs?
delay: { control: 'number' }, | |
delay: { control: 'number', defaultValue: 700 }, |
Feel free to place it in Default.args
if that makes more sense for you.
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.
In general we've been taking the direction of not re-specifying default values in Storybook, so we can showcase the actual defaults that are coming from the component code.
The props table will show descriptions and default values once this is converted to TypeScript, which will also help.
@@ -17,79 +6,80 @@ import Tooltip from '../'; | |||
export default { | |||
title: 'Components/ToolTip', | |||
component: Tooltip, | |||
argTypes: { | |||
delay: { control: 'number' }, | |||
position: { |
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.
Should we default to top center
as we did for the previous version of the story that used knobs?
position: { | |
position: { | |
defaultValue: 'top center', |
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.
Same here.
{ showMessage ? <p>Hello World!</p> : null } | ||
</> | ||
); | ||
export const DisabledChild = Template.bind( {} ); |
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.
I'm fine with leaving it as well, I guess someone could find it useful.
Thanks for helping out with reviews @tyxla 🙏🙏 |
Part of #35665
What?
Remove the Knobs add-on from
ToolTip
stories.Why?
This is now a blocker for supporting npm 8 (#46443).
How?
Just a quick, minimal refactor. Eventually we should leverage TypeScript types once this component is typed properly.
Testing Instructions
npm run storybook:dev
ToolTip
component. (Careful, there is also aTooltip
component 🙃)