Skip to content

docs(button): add danger and warning use cases #1235

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
*/
export default { title: 'LumX components/button/Button Demos' };

export { App as Danger } from './danger';
export { App as EmphasisHigh } from './emphasis-high';
export { App as EmphasisLow } from './emphasis-low';
export { App as EmphasisMedium } from './emphasis-medium';
export { App as FullWidth } from './full-width';
export { App as Small } from './small';
export { App as Toggle } from './toggle';
export { App as Warning } from './warning';
13 changes: 13 additions & 0 deletions packages/site-demo/content/product/components/button/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ Use full width when you need to get the button full width.

<DemoBlock vAlign="center" demo="full-width" withThemeSwitcher />

## Warning

Use `Warning` buttons to confirm actions that may cause a significant change.
Low emphasis is currently not supported.

<DemoBlock vAlign="center" demo="warning" withThemeSwitcher />

## Danger

Use `Danger` buttons to confirm a destructive and irreversible action, such as deleting.

<DemoBlock vAlign="center" demo="danger" withThemeSwitcher />

### Accessibility concerns

#### Button
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { mdiDelete } from '@lumx/icons';
import { Button, Emphasis, FlexBox, IconButton, Orientation, Size } from '@lumx/react';
import React from 'react';

export const App = ({ theme }: any) => (
<>
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
<Button color="red" theme={theme}>
Delete
</Button>
<IconButton label="Delete" icon={mdiDelete} color="red" theme={theme} />
</FlexBox>
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
<Button emphasis={Emphasis.medium} color="red" theme={theme}>
Delete
</Button>
<IconButton label="Delete" icon={mdiDelete} emphasis={Emphasis.medium} color="red" theme={theme} />
</FlexBox>
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
<Button emphasis={Emphasis.low} color="red" theme={theme}>
Delete
</Button>
<IconButton label="Delete" icon={mdiDelete} emphasis={Emphasis.low} color="red" theme={theme} />
</FlexBox>
</>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { mdiClose } from '@lumx/icons';
import { Button, Emphasis, FlexBox, IconButton, Orientation, Size } from '@lumx/react';
import React from 'react';

export const App = ({ theme }: any) => (
<>
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
<Button color="yellow" theme={theme}>
Remove
</Button>
<IconButton label="Remove" icon={mdiClose} color="yellow" theme={theme} />
</FlexBox>
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
<Button emphasis={Emphasis.medium} color="yellow" theme={theme}>
Remove
</Button>
<IconButton label="Remove" icon={mdiClose} emphasis={Emphasis.medium} color="yellow" theme={theme} />
</FlexBox>
</>
);
Loading