-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(button-group): fixed border style with hidden or single child
- Loading branch information
Showing
3 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
56 changes: 56 additions & 0 deletions
56
packages/lumx-react/src/components/button/ButtonGroup.stories.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
|
||
import { Button, ButtonGroup, Emphasis, IconButton, Size } from '@lumx/react'; | ||
import { mdiAbjadArabic, mdiAbjadHebrew, mdiFoodApple, mdiMenuDown } from '@lumx/icons'; | ||
import { withCombinations } from '@lumx/react/stories/decorators/withCombinations'; | ||
|
||
export default { | ||
title: 'LumX components/button/ButtonGroup', | ||
component: ButtonGroup, | ||
argTypes: { children: { control: false } }, | ||
}; | ||
|
||
/** Size & emphasis variants */ | ||
export const Variants = { | ||
render: ({ size, emphasis, theme }: any) => ( | ||
<ButtonGroup> | ||
<span className="visually-hidden">Ignore me</span> | ||
<Button size={size} emphasis={emphasis} theme={theme}> | ||
Button | ||
</Button> | ||
<IconButton size={size} emphasis={emphasis} theme={theme} label="IconButton" icon={mdiMenuDown} /> | ||
<span className="visually-hidden">Ignore me</span> | ||
</ButtonGroup> | ||
), | ||
decorators: [ | ||
withCombinations({ | ||
cellStyle: { padding: '10px' }, | ||
combinations: { | ||
rows: { '': { size: Size.m }, 'size=s': { size: Size.s } }, | ||
cols: { key: 'emphasis', options: [undefined, Emphasis.medium, Emphasis.low] }, | ||
}, | ||
}), | ||
], | ||
}; | ||
|
||
export const OneButton = { | ||
args: { children: <Button>Button</Button> }, | ||
}; | ||
|
||
export const ManyButtons = { | ||
args: { | ||
children: ( | ||
<> | ||
<span className="visually-hidden">Ignore me</span> | ||
<Button>Button 1</Button> | ||
<span className="visually-hidden">Ignore me</span> | ||
<IconButton label="IconButton" icon={mdiFoodApple} /> | ||
<span className="visually-hidden">Ignore me</span> | ||
<IconButton label="IconButton" icon={mdiAbjadArabic} /> | ||
<span className="visually-hidden">Ignore me</span> | ||
<Button>Button 2</Button> | ||
<span className="visually-hidden">Ignore me</span> | ||
</> | ||
), | ||
}, | ||
}; |