-
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
ColorPicker: Remove knobs in stories #46772
Conversation
const LegacyExample = () => { | ||
const [ legacyColor, setLegacyColor ] = useState( '#fff' ); | ||
const legacyProps = { | ||
color: legacyColor, | ||
onChangeComplete: setLegacyColor, | ||
disableAlpha: boolean( 'disableAlpha', true ), | ||
}; |
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.
Removing the legacy example because this is/should be covered in the automated tests.
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.
Considering that the scope is to migrate away from knobs, this PR LGTM 🚀 Does it deserve a CHANGELOG entry?
Apart from that, we still need to:
- migrate the story to TypeScript and get the TS docgen to work
- see how we can split / exclude (or at least flag) legacy props from new props
// We can't use a `on*` regex because this component will switch to | ||
// legacy mode when an onChangeComplete prop is passed. | ||
onChange: { action: 'onChange' }, |
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.
Nice catch (and interesting nuance)!
} | ||
|
||
return ( | ||
<Flex |
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 honestly don't remember why we had put two pickers side-by-side
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 have to assume it was to demonstrate that the values are synced over properly?
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 guess!
Nope, Storybook-only 👍 |
Part of #35665
What?
Remove the Knobs add-on from
ColorPicker
stories.Why?
This is now a blocker for supporting npm 8 (#46443).
How?
Just a quick, minimal refactor.
Testing Instructions
npm run storybook:dev