[Storybook] Add playground stories for components beginning with the letter B #7459
Merged
cee-chen merged 6 commits intoelastic:mainfrom Jan 22, 2024
Merged
[Storybook] Add playground stories for components beginning with the letter B #7459cee-chen merged 6 commits intoelastic:mainfrom
cee-chen merged 6 commits intoelastic:mainfrom
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:
|
Collaborator
💚 Build Succeeded
|
tkajtoch
reviewed
Jan 22, 2024
| component: EuiButton, | ||
| argTypes: { | ||
| iconType: { control: 'text' }, | ||
| // TODO: the `minWidth` prop takes many different types (bool, string, number) |
tkajtoch
reviewed
Jan 22, 2024
| target?: string; | ||
| rel?: string; | ||
| type?: 'button' | 'submit'; | ||
| type?: ButtonHTMLAttributes<HTMLButtonElement>['type']; |
tkajtoch
approved these changes
Jan 22, 2024
Member
tkajtoch
left a comment
There was a problem hiding this comment.
The changes look and work great!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Note:
EuiButtonhad 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
typetype (ha) for our button components in 0bc375d, which was somewhat all over the place.QA
Regression type check
sandm(noxs)General checklist
N/A, docs only