Skip to content
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

Merged
merged 6 commits into from
Jan 22, 2024

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Jan 12, 2024

Summary

⚠️ I skipped EuiBasicTable for this PR, as our tabular content components are heckin' complex and probably deserve their own dedicated PR where we consider what exactly we want out of those stories/embeds

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.

The letter B

QA

Regression type check

General checklist

N/A, docs only

@cee-chen cee-chen added documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog labels Jan 12, 2024
- 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
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

@cee-chen cee-chen marked this pull request as ready for review January 12, 2024 18:51
@cee-chen cee-chen requested a review from a team as a code owner January 12, 2024 18:51
@tkajtoch tkajtoch self-requested a review January 17, 2024 21:09
component: EuiButton,
argTypes: {
iconType: { control: 'text' },
// TODO: the `minWidth` prop takes many different types (bool, string, number)
Copy link
Member

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'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this! 🎉

Copy link
Member

@tkajtoch tkajtoch left a 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!

@cee-chen cee-chen merged commit 12295fb into elastic:main Jan 22, 2024
8 checks passed
@cee-chen cee-chen deleted the storybook/b branch January 22, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants