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

#749 - Button - New variant #752

Merged
merged 1 commit into from
Aug 31, 2023
Merged
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
25 changes: 25 additions & 0 deletions packages/react-components/src/components/Button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,31 @@ $base-class: 'btn';
}
}

&--destructive-outline {
border-color: var(--action-negative-default);
background-color: var(--surface-accent-emphasis-min-negative);
color: var(--action-negative-default);

&:hover {
border-color: var(--action-negative-hover);
background-color: var(--surface-accent-emphasis-low-negative);
color: var(--action-negative-hover);
}

&:active,
&:focus {
border-color: var(--action-negative-active);
background-color: var(--surface-accent-emphasis-low-negative);
color: var(--action-negative-active);
}

&[aria-disabled='true'] {
border-color: var(--action-negative-disabled);
background-color: var(--surface-primary-default);
color: var(--action-negative-disabled);
}
}

&--compact {
padding: 6px 16px;
min-width: 32px;
Expand Down
47 changes: 47 additions & 0 deletions packages/react-components/src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,53 @@ export const KindsAndStates = (): React.ReactElement => (
icon={<Icon source={MaterialIcons.AddCircle} />}
/>
</StoryDescriptor>
<StoryDescriptor title="Destructive Outline">
<Button kind="destructive-outline">Destructive Outline</Button>
<Button disabled kind="destructive-outline">
Disabled
</Button>
<Button loading kind="destructive-outline">
Disabled
</Button>
</StoryDescriptor>
<StoryDescriptor title="Destructive Outline with icon">
<Button
kind="destructive-outline"
icon={<Icon source={MaterialIcons.AddCircle} />}
>
Destructive Outline
</Button>
<Button
disabled
kind="destructive-outline"
icon={<Icon source={MaterialIcons.AddCircle} />}
>
Disabled
</Button>
<Button
loading
kind="destructive-outline"
icon={<Icon source={MaterialIcons.AddCircle} />}
>
Disabled
</Button>
</StoryDescriptor>
<StoryDescriptor title="Destructive Outline with icon only">
<Button
kind="destructive-outline"
icon={<Icon source={MaterialIcons.AddCircle} />}
/>
<Button
disabled
kind="destructive-outline"
icon={<Icon source={MaterialIcons.AddCircle} />}
/>
<Button
loading
kind="destructive-outline"
icon={<Icon source={MaterialIcons.AddCircle} />}
/>
</StoryDescriptor>
<StoryDescriptor title="Text">
<Button kind="text">Text</Button>
<Button disabled kind="text">
Expand Down
1 change: 1 addition & 0 deletions packages/react-components/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type ButtonKind =
| 'primary'
| 'secondary'
| 'destructive'
| 'destructive-outline'
| 'text'
| 'link'
| 'link-light'
Expand Down