-
Notifications
You must be signed in to change notification settings - Fork 839
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
[Storybook] Add playground stories for components beginning with the letter B #7459
Conversation
- requires some typing shenanigans to get storybook controls to behave :| + enhance DX of existing EuiButtonEmpty controls while we're here, + remove unnecessary `as any`
- should accept anything base buttons accept, which includes `reset` - update all button components across the board to use the attributes type
Preview staging links for this PR:
|
💚 Build Succeeded
|
component: EuiButton, | ||
argTypes: { | ||
iconType: { control: 'text' }, | ||
// TODO: the `minWidth` prop takes many different types (bool, string, 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.
👍🏻
@@ -69,7 +69,7 @@ export interface CommonEuiButtonEmptyProps | |||
href?: string; | |||
target?: string; | |||
rel?: string; | |||
type?: 'button' | 'submit'; | |||
type?: ButtonHTMLAttributes<HTMLButtonElement>['type']; |
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.
Love this! 🎉
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.
The changes look and work great!
Summary
Note:
EuiButton
had some shenanigans that required a type workaround (shouldn't affect actual end-types, will verify with the docs props table) to get Storybook to read extended types as controls. Everything else was straightforward.I also DRYed out the
type
type (ha) for our button components in 0bc375d, which was somewhat all over the place.QA
Regression type check
s
andm
(noxs
)General checklist
N/A, docs only