Skip to content

Commit

Permalink
fix(button): remove danger ghost icon only button svg margin (#7618)
Browse files Browse the repository at this point in the history
* fix(button): remove danger ghost icon only button svg margin

* docs(Button): add new button kind prop values

* docs(Button): remove danger icon only button

* feat(button): add danger--tertiary disabled styles

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
emyarod and kodiakhq[bot] authored Jan 26, 2021
1 parent 199c839 commit 46d64be
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
14 changes: 13 additions & 1 deletion packages/components/src/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@
position: static;
}

&.#{$prefix}--btn--ghost .#{$prefix}--btn__icon {
&.#{$prefix}--btn--ghost .#{$prefix}--btn__icon,
&.#{$prefix}--btn--danger--ghost .#{$prefix}--btn__icon {
margin: 0;
}
}
Expand Down Expand Up @@ -309,6 +310,17 @@
color: $text-04;
border-color: $active-danger;
}

&:disabled,
&:hover:disabled,
&:focus:disabled,
&.#{$prefix}--btn--disabled,
&.#{$prefix}--btn--disabled:hover,
&.#{$prefix}--btn--disabled:focus {
color: $disabled-03;
background: transparent;
outline: none;
}
}

// TODO: deprecate single dash ghost
Expand Down
18 changes: 6 additions & 12 deletions packages/react/src/components/Button/Button-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const kinds = {
'Secondary button (secondary)': 'secondary',
'Tertiary button (tertiary)': 'tertiary',
'Danger button (danger)': 'danger',
'Danger tertiary button (danger--tertiary)': 'danger--tertiary',
'Danger ghost button (danger--ghost)': 'danger--ghost',
'Ghost button (ghost)': 'ghost',
};

Expand Down Expand Up @@ -73,17 +75,7 @@ const props = {
}
return {
className: 'some-class',
kind: select(
'Button kind (kind)',
{
'Primary button (primary)': 'primary',
'Secondary button (secondary)': 'secondary',
'Tertiary button (tertiary)': 'tertiary',
'Ghost button (ghost)': 'ghost',
'Danger button (danger)': 'danger',
},
'primary'
),
kind: select('Button kind (kind)', kinds, 'primary'),
disabled: boolean('Disabled (disabled)', false),
size: select('Button size (size)', sizes, 'default'),
renderIcon: !iconToUse || iconToUse.svgData ? undefined : iconToUse,
Expand Down Expand Up @@ -184,7 +176,9 @@ export const Playground = () => {
}}>
<Button {...regularProps}>Button</Button>
&nbsp;
<Button hasIconOnly {...iconOnly}></Button>
{!regularProps.kind.includes('danger') && (
<Button hasIconOnly {...iconOnly}></Button>
)}
</div>
<div
style={{
Expand Down

0 comments on commit 46d64be

Please sign in to comment.