Skip to content

[Storybook] Add playground stories for components beginning with the letter B - #7459

Merged
cee-chen merged 6 commits into
elastic:mainfrom
cee-chen:storybook/b
Jan 22, 2024
Merged

cee-chen merged 6 commits into
elastic:mainfrom
cee-chen:storybook/b

Conversation

@cee-chen

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

Copy link
Copy Markdown
Contributor

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 Use on PRs to skip changelog requirement (Don't delete - used for automation) 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
Copy Markdown
Contributor

@elasticmachine

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍🏻

target?: string;
rel?: string;
type?: 'button' | 'submit';
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Love this! 🎉

@tkajtoch tkajtoch left a comment

Copy link
Copy Markdown
Contributor

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
@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 Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants