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

📝 Add ButtonGroup to Storybook #2420

Merged
merged 17 commits into from
Aug 24, 2022
Merged

Conversation

martalalik
Copy link
Contributor

Resolves #2419

@martalalik martalalik marked this pull request as ready for review August 17, 2022 07:01
@martalalik
Copy link
Contributor Author

I would still consider to create a separate story for ButtonGroup 🤔

@martalalik martalalik requested a review from oddvernes August 17, 2022 09:44
@martalalik martalalik changed the title 📝 Add ButtonGroup to Storybook 🚧 Add ButtonGroup to Storybook Aug 18, 2022
@martalalik martalalik force-pushed the docs/ML-2419-button-group branch from 939768b to add6098 Compare August 19, 2022 06:49
@martalalik martalalik force-pushed the docs/ML-2419-button-group branch from e44193e to 3aaa0c3 Compare August 22, 2022 06:47
@martalalik
Copy link
Contributor Author

Can someone review Split Button Group? I need some feedback, thanks.

@martalalik
Copy link
Contributor Author

To fix position of menu button added:
style={{ position: 'absolute', height: '36px' }}

@martalalik
Copy link
Contributor Author

martalalik commented Aug 22, 2022

Should Group include:

  • role="group"
  • aria-label or aria-labelledby

Looking into:

@oddvernes
Copy link
Collaborator

To fix position of menu button added: style={{ position: 'absolute', height: '36px' }}

Instead add display: flex to group and use same default button type for both buttons, but in the story, overwrite padding on the dropdown button to make it narrower and overwrite gap to 1px on group

@martalalik martalalik changed the title 🚧 Add ButtonGroup to Storybook 📝 Add ButtonGroup to Storybook Aug 23, 2022
@martalalik
Copy link
Contributor Author

Do we want SplitButton in Compact story?

@martalalik martalalik requested a review from oddvernes August 23, 2022 10:08
@oddvernes
Copy link
Collaborator

Do we want SplitButton in Compact story?

Make sure it works at least, but i don't think there will be an issue we only override left/right padding to something smaller so it'll just get less tall

@oddvernes
Copy link
Collaborator

  • ToggleButton

I would rename Group to ButtonGroup. And that is all for this pr. ToggleButton is the upcoming component we havent made yet which is going to be something along the lines of ToggleButton from MUI / SegmentedControl from mantine / SelectorGroup from circuit

@mimarz
Copy link
Contributor

mimarz commented Aug 23, 2022

Should we maybe expose Group via a proxy component as Button.Group to keep inline with the style of our other components?

Do we have other usages for this kind of grouping? Maybe Chip or Avatar?

image

@oddvernes
Copy link
Collaborator

Should we maybe expose Group via a proxy component as Button.Group to keep inline with the style of our other components?

Do we have other usages for this kind of grouping? Maybe Chip or Avatar?

But our pattern is Component.SubComponent whereas here it would be Child.Parent ? But I see what you mean, certain components could be wrapped in Component.Group if there is more

@mimarz
Copy link
Contributor

mimarz commented Aug 23, 2022

Should we maybe expose Group via a proxy component as Button.Group to keep inline with the style of our other components?
Do we have other usages for this kind of grouping? Maybe Chip or Avatar?

But our pattern is Component.SubComponent whereas here it would be Child.Parent ? But I see what you mean, certain components could be wrapped in Component.Group if there is more

Yeah, naming is tricky 🙈 We could also name it Buttons or just leave it as Group and have a prop for toggling of rounding borders and gap instead. Many ways to do this.

I saw Mantine are using a combination for Component.SubComponent and Component.Parent, so they are using more of a way to show that some things are related to eachother 🤔

@martalalik
Copy link
Contributor Author

martalalik commented Aug 23, 2022

I was to quick 🙈

@oddvernes
Copy link
Collaborator

If we one day decide to (or are asked) to make layout helper components like what mantine have, we should reserve very general names like "Group" for that i feel. But currently this is out of scope for eds as i understand (its too trivial and projects can quickly make them themselves anyway, it would make us responsible for everyone getting their layout correctly etc). ButtonGroup meanwhile only does one thing: its a wrapper that modifies the styling of buttons, nothing more, nothing less 🤷‍♂️

@martalalik martalalik requested a review from oddvernes August 24, 2022 07:03
Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

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

LGTM!

@mimarz
Copy link
Contributor

mimarz commented Aug 24, 2022

After discussing on a call 24 august 2020, we decided the following:

  • Group is renamed to ButtonGroup
  • ButtonGroup is moved in under Button and exposed as a compound component (Button.Group)
  • ButtonGroup stories are moved to Button.docs.mdx with the following stories
    • Split button
    • Orientation
    • Existing compact story is updated with ButtonGroup example

@martalalik martalalik requested a review from oddvernes August 24, 2022 11:27
@martalalik
Copy link
Contributor Author

martalalik commented Aug 24, 2022

Can anyone review it with this upcoming change?

@@ -308,6 +310,12 @@ export const Compact: Story<ButtonProps> = () => {
<Button variant="ghost_icon">
<Icon data={menu} title="Ghost icon menu"></Icon>
</Button>
<Button.Group ria-label="button group compact">
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing a in aria

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok you misunderstood slightly; what i mean is above here is this (ria label): <Button.Group ria-label="button group compact">
I don't think you need aria label on the buttons

Copy link
Contributor Author

@martalalik martalalik Aug 24, 2022

Choose a reason for hiding this comment

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

Oh i see a typo!
Every button with icon should have an aria-label. Here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh true 😄

@martalalik martalalik requested a review from oddvernes August 24, 2022 12:19
Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

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

LGTM

@martalalik martalalik merged commit edb4de3 into develop Aug 24, 2022
@martalalik martalalik deleted the docs/ML-2419-button-group branch August 24, 2022 13:02
@martalalik martalalik restored the docs/ML-2419-button-group branch August 24, 2022 13:06
@martalalik martalalik deleted the docs/ML-2419-button-group branch August 24, 2022 13:13
hkfb pushed a commit to equinor/webviz-subsurface-components that referenced this pull request Feb 13, 2024
## [0.5.2](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@0.5.2) (2024-02-13)

### Bug Fixes

* bump @equinor/eds-icons from 0.19.3 to 0.21.0 and @equinor/eds-core-react from 0.33.0 to 0.36.0 in /typescript ([#1892](#1892)) ([c7bd611](c7bd611)), closes [equinor/design-system#2367](equinor/design-system#2367) [equinor/design-system#2431](equinor/design-system#2431) [equinor/design-system#2378](equinor/design-system#2378) [equinor/design-system#2399](equinor/design-system#2399) [equinor/design-system#2410](equinor/design-system#2410) [equinor/design-system#2432](equinor/design-system#2432) [equinor/design-system#2442](equinor/design-system#2442) [equinor/design-system#2420](equinor/design-system#2420) [equinor/design-system#2377](equinor/design-system#2377) [equinor/design-system#2384](equinor/design-system#2384) [equinor/design-system#2405](equinor/design-system#2405) [equinor/design-system#2460](equinor/design-system#2460) [equinor/design-system#2247](equinor/design-system#2247) [equinor/design-system#2436](equinor/design-system#2436) [equinor/design-system#2451](equinor/design-system#2451) [equinor/design-system#2303](equinor/design-system#2303) [equinor/design-system#2327](equinor/design-system#2327) [equinor/design-system#2337](equinor/design-system#2337) [equinor/design-system#2335](equinor/design-system#2335) [equinor/design-system#2313](equinor/design-system#2313) [equinor/design-system#3177](equinor/design-system#3177) [#3239](https://github.com/equinor/webviz-subsurface-components/issues/3239) [#3219](https://github.com/equinor/webviz-subsurface-components/issues/3219) [#3177](https://github.com/equinor/webviz-subsurface-components/issues/3177) [#3137](https://github.com/equinor/webviz-subsurface-components/issues/3137) [#3132](https://github.com/equinor/webviz-subsurface-components/issues/3132) [#3121](https://github.com/equinor/webviz-subsurface-components/issues/3121) [#3020](https://github.com/equinor/webviz-subsurface-components/issues/3020) [#3019](https://github.com/equinor/webviz-subsurface-components/issues/3019)
hkfb pushed a commit to equinor/webviz-subsurface-components that referenced this pull request Feb 13, 2024
## [1.2.2](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@1.2.2) (2024-02-13)

### Bug Fixes

* bump @equinor/eds-icons from 0.19.3 to 0.21.0 and @equinor/eds-core-react from 0.33.0 to 0.36.0 in /typescript ([#1892](#1892)) ([c7bd611](c7bd611)), closes [equinor/design-system#2367](equinor/design-system#2367) [equinor/design-system#2431](equinor/design-system#2431) [equinor/design-system#2378](equinor/design-system#2378) [equinor/design-system#2399](equinor/design-system#2399) [equinor/design-system#2410](equinor/design-system#2410) [equinor/design-system#2432](equinor/design-system#2432) [equinor/design-system#2442](equinor/design-system#2442) [equinor/design-system#2420](equinor/design-system#2420) [equinor/design-system#2377](equinor/design-system#2377) [equinor/design-system#2384](equinor/design-system#2384) [equinor/design-system#2405](equinor/design-system#2405) [equinor/design-system#2460](equinor/design-system#2460) [equinor/design-system#2247](equinor/design-system#2247) [equinor/design-system#2436](equinor/design-system#2436) [equinor/design-system#2451](equinor/design-system#2451) [equinor/design-system#2303](equinor/design-system#2303) [equinor/design-system#2327](equinor/design-system#2327) [equinor/design-system#2337](equinor/design-system#2337) [equinor/design-system#2335](equinor/design-system#2335) [equinor/design-system#2313](equinor/design-system#2313) [equinor/design-system#3177](equinor/design-system#3177) [#3239](https://github.com/equinor/webviz-subsurface-components/issues/3239) [#3219](https://github.com/equinor/webviz-subsurface-components/issues/3219) [#3177](https://github.com/equinor/webviz-subsurface-components/issues/3177) [#3137](https://github.com/equinor/webviz-subsurface-components/issues/3137) [#3132](https://github.com/equinor/webviz-subsurface-components/issues/3132) [#3121](https://github.com/equinor/webviz-subsurface-components/issues/3121) [#3020](https://github.com/equinor/webviz-subsurface-components/issues/3020) [#3019](https://github.com/equinor/webviz-subsurface-components/issues/3019)
hkfb pushed a commit to equinor/webviz-subsurface-components that referenced this pull request Feb 13, 2024
## [0.16.2](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@0.16.2) (2024-02-13)

### Bug Fixes

* bump @equinor/eds-icons from 0.19.3 to 0.21.0 and @equinor/eds-core-react from 0.33.0 to 0.36.0 in /typescript ([#1892](#1892)) ([c7bd611](c7bd611)), closes [equinor/design-system#2367](equinor/design-system#2367) [equinor/design-system#2431](equinor/design-system#2431) [equinor/design-system#2378](equinor/design-system#2378) [equinor/design-system#2399](equinor/design-system#2399) [equinor/design-system#2410](equinor/design-system#2410) [equinor/design-system#2432](equinor/design-system#2432) [equinor/design-system#2442](equinor/design-system#2442) [equinor/design-system#2420](equinor/design-system#2420) [equinor/design-system#2377](equinor/design-system#2377) [equinor/design-system#2384](equinor/design-system#2384) [equinor/design-system#2405](equinor/design-system#2405) [equinor/design-system#2460](equinor/design-system#2460) [equinor/design-system#2247](equinor/design-system#2247) [equinor/design-system#2436](equinor/design-system#2436) [equinor/design-system#2451](equinor/design-system#2451) [equinor/design-system#2303](equinor/design-system#2303) [equinor/design-system#2327](equinor/design-system#2327) [equinor/design-system#2337](equinor/design-system#2337) [equinor/design-system#2335](equinor/design-system#2335) [equinor/design-system#2313](equinor/design-system#2313) [equinor/design-system#3177](equinor/design-system#3177) [#3239](https://github.com/equinor/webviz-subsurface-components/issues/3239) [#3219](https://github.com/equinor/webviz-subsurface-components/issues/3219) [#3177](https://github.com/equinor/webviz-subsurface-components/issues/3177) [#3137](https://github.com/equinor/webviz-subsurface-components/issues/3137) [#3132](https://github.com/equinor/webviz-subsurface-components/issues/3132) [#3121](https://github.com/equinor/webviz-subsurface-components/issues/3121) [#3020](https://github.com/equinor/webviz-subsurface-components/issues/3020) [#3019](https://github.com/equinor/webviz-subsurface-components/issues/3019)
hkfb pushed a commit to equinor/webviz-subsurface-components that referenced this pull request Feb 13, 2024
## [1.1.2](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@1.1.2) (2024-02-13)

### Bug Fixes

* bump @equinor/eds-icons from 0.19.3 to 0.21.0 and @equinor/eds-core-react from 0.33.0 to 0.36.0 in /typescript ([#1892](#1892)) ([c7bd611](c7bd611)), closes [equinor/design-system#2367](equinor/design-system#2367) [equinor/design-system#2431](equinor/design-system#2431) [equinor/design-system#2378](equinor/design-system#2378) [equinor/design-system#2399](equinor/design-system#2399) [equinor/design-system#2410](equinor/design-system#2410) [equinor/design-system#2432](equinor/design-system#2432) [equinor/design-system#2442](equinor/design-system#2442) [equinor/design-system#2420](equinor/design-system#2420) [equinor/design-system#2377](equinor/design-system#2377) [equinor/design-system#2384](equinor/design-system#2384) [equinor/design-system#2405](equinor/design-system#2405) [equinor/design-system#2460](equinor/design-system#2460) [equinor/design-system#2247](equinor/design-system#2247) [equinor/design-system#2436](equinor/design-system#2436) [equinor/design-system#2451](equinor/design-system#2451) [equinor/design-system#2303](equinor/design-system#2303) [equinor/design-system#2327](equinor/design-system#2327) [equinor/design-system#2337](equinor/design-system#2337) [equinor/design-system#2335](equinor/design-system#2335) [equinor/design-system#2313](equinor/design-system#2313) [equinor/design-system#3177](equinor/design-system#3177) [#3239](https://github.com/equinor/webviz-subsurface-components/issues/3239) [#3219](https://github.com/equinor/webviz-subsurface-components/issues/3219) [#3177](https://github.com/equinor/webviz-subsurface-components/issues/3177) [#3137](https://github.com/equinor/webviz-subsurface-components/issues/3137) [#3132](https://github.com/equinor/webviz-subsurface-components/issues/3132) [#3121](https://github.com/equinor/webviz-subsurface-components/issues/3121) [#3020](https://github.com/equinor/webviz-subsurface-components/issues/3020) [#3019](https://github.com/equinor/webviz-subsurface-components/issues/3019)
hkfb pushed a commit to equinor/webviz-subsurface-components that referenced this pull request Feb 13, 2024
## [1.4.2](https://github.com/equinor/webviz-subsurface-components/compare/[email protected]@1.4.2) (2024-02-13)

### Bug Fixes

* bump @equinor/eds-icons from 0.19.3 to 0.21.0 and @equinor/eds-core-react from 0.33.0 to 0.36.0 in /typescript ([#1892](#1892)) ([c7bd611](c7bd611)), closes [equinor/design-system#2367](equinor/design-system#2367) [equinor/design-system#2431](equinor/design-system#2431) [equinor/design-system#2378](equinor/design-system#2378) [equinor/design-system#2399](equinor/design-system#2399) [equinor/design-system#2410](equinor/design-system#2410) [equinor/design-system#2432](equinor/design-system#2432) [equinor/design-system#2442](equinor/design-system#2442) [equinor/design-system#2420](equinor/design-system#2420) [equinor/design-system#2377](equinor/design-system#2377) [equinor/design-system#2384](equinor/design-system#2384) [equinor/design-system#2405](equinor/design-system#2405) [equinor/design-system#2460](equinor/design-system#2460) [equinor/design-system#2247](equinor/design-system#2247) [equinor/design-system#2436](equinor/design-system#2436) [equinor/design-system#2451](equinor/design-system#2451) [equinor/design-system#2303](equinor/design-system#2303) [equinor/design-system#2327](equinor/design-system#2327) [equinor/design-system#2337](equinor/design-system#2337) [equinor/design-system#2335](equinor/design-system#2335) [equinor/design-system#2313](equinor/design-system#2313) [equinor/design-system#3177](equinor/design-system#3177) [#3239](https://github.com/equinor/webviz-subsurface-components/issues/3239) [#3219](https://github.com/equinor/webviz-subsurface-components/issues/3219) [#3177](https://github.com/equinor/webviz-subsurface-components/issues/3177) [#3137](https://github.com/equinor/webviz-subsurface-components/issues/3137) [#3132](https://github.com/equinor/webviz-subsurface-components/issues/3132) [#3121](https://github.com/equinor/webviz-subsurface-components/issues/3121) [#3020](https://github.com/equinor/webviz-subsurface-components/issues/3020) [#3019](https://github.com/equinor/webviz-subsurface-components/issues/3019)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button Group add to Storybook
3 participants