Skip to content

Commit

Permalink
revert(button): revert changes to button for v11 (#10510)
Browse files Browse the repository at this point in the history
* revert(button): revert changes to button for v11

* fix(ui-shell): fix alignment for header action icons

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
joshblack and kodiakhq[bot] committed Jan 26, 2022
1 parent c5bb06f commit 885c987
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
33 changes: 6 additions & 27 deletions packages/react/src/components/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,16 @@ const Button = React.forwardRef(function Button(
[`${prefix}--btn--${kind}`]: kind,
[`${prefix}--btn--disabled`]: disabled,
[`${prefix}--btn--expressive`]: isExpressive,
[`${prefix}--tooltip--visible`]: !enabled && isHovered,
[`${prefix}--tooltip--hidden`]:
!enabled && hasIconOnly && !allowTooltipVisibility,
[`${prefix}--tooltip--visible`]: isHovered,
[`${prefix}--tooltip--hidden`]: hasIconOnly && !allowTooltipVisibility,
[`${prefix}--btn--icon-only`]: hasIconOnly,
[`${prefix}--btn--selected`]: hasIconOnly && isSelected && kind === 'ghost',
[`${prefix}--tooltip__trigger`]: !enabled && hasIconOnly,
[`${prefix}--tooltip--a11y`]: !enabled && hasIconOnly,
[`${prefix}--tooltip__trigger`]: hasIconOnly,
[`${prefix}--tooltip--a11y`]: hasIconOnly,
[`${prefix}--btn--icon-only--${tooltipPosition}`]:
!enabled && hasIconOnly && tooltipPosition,
hasIconOnly && tooltipPosition,
[`${prefix}--tooltip--align-${tooltipAlignment}`]:
!enabled && hasIconOnly && tooltipAlignment,
hasIconOnly && tooltipAlignment,
});

const commonProps = {
Expand Down Expand Up @@ -215,26 +214,6 @@ const Button = React.forwardRef(function Button(
otherProps = anchorProps;
}

if (enabled) {
delete otherProps['aria-describedby'];

return React.createElement(
component,
{
onMouseEnter,
onMouseLeave,
onFocus,
onBlur,
onClick,
type,
...other,
...commonProps,
...otherProps,
},
children
);
}

return React.createElement(
component,
{
Expand Down
2 changes: 2 additions & 0 deletions packages/styles/scss/components/ui-shell/header/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
.#{$prefix}--header__action {
@include button-reset.reset();

display: inline-flex;
width: mini-units(6);
height: mini-units(6);
border: rem(2px) solid transparent;
Expand Down Expand Up @@ -80,6 +81,7 @@
}

.#{$prefix}--header__action.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger {
align-items: center;
justify-content: center;
}

Expand Down

0 comments on commit 885c987

Please sign in to comment.