Skip to content

Commit

Permalink
Merge branch 'master' into helper-text-swap
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandra Davila authored May 13, 2020
2 parents 4346f81 + 818705a commit 67fe5ff
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 39 deletions.
57 changes: 38 additions & 19 deletions packages/components/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -6461,6 +6461,7 @@ $interactive-01: if(
- [button [mixin]](#button-mixin)
- [data-table-v2-action [mixin]](#data-table-v2-action-mixin)
- [date-picker [mixin]](#date-picker-mixin)
- [inline-notifications [mixin]](#inline-notifications-mixin)
- [pseudo-underline [mixin]](#pseudo-underline-mixin)
- [progress-indicator [mixin]](#progress-indicator-mixin)
- [tooltip--definition--legacy [mixin]](#tooltip--definition--legacy-mixin)
Expand Down Expand Up @@ -7099,6 +7100,7 @@ $link-01: if(
- [button [mixin]](#button-mixin)
- [file-uploader [mixin]](#file-uploader-mixin)
- [link [mixin]](#link-mixin)
- [inline-notifications [mixin]](#inline-notifications-mixin)
- [progress-indicator [mixin]](#progress-indicator-mixin)

### ✅inverse-link [variable]
Expand Down Expand Up @@ -7580,6 +7582,7 @@ $focus: if(
- [data-table-v2-action [mixin]](#data-table-v2-action-mixin)
- [data-table-expandable [mixin]](#data-table-expandable-mixin)
- [modal [mixin]](#modal-mixin)
- [inline-notifications [mixin]](#inline-notifications-mixin)
- [radio-button [mixin]](#radio-button-mixin)
- [search [mixin]](#search-mixin)
- [tags [mixin]](#tags-mixin)
Expand Down Expand Up @@ -20050,30 +20053,43 @@ Inline notification styles
}

.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost {
color: $inverse-link;
height: rem(32px);
margin-bottom: $carbon--spacing-03;
margin-left: $carbon--spacing-08;

@include carbon--breakpoint(md) {
margin: $carbon--spacing-03 0;
}
}

&,
&:hover,
&:focus,
&:active {
color: $inverse-link;
}
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost {
color: $link-01;
}

&:focus {
border-color: transparent;
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:active,
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:hover {
background-color: $inverse-hover-ui;
}

&:hover {
background-color: $inverse-hover-ui;
}
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:active,
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:hover {
background-color: $carbon--white-0;
}

.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:focus {
border-color: transparent;
box-shadow: none;
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}

.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:focus {
outline-color: $focus;
}

.#{$prefix}--inline-notification--hide-close-button
Expand Down Expand Up @@ -20116,7 +20132,7 @@ Inline notification styles
}

.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__close-button {
.#{$prefix}--inline-notification__close-button:focus {
@include focus-outline('outline');
}

Expand All @@ -20127,10 +20143,10 @@ Inline notification styles
}

.#{$prefix}--inline-notification__action-button {
color: $carbon--blue-60;
color: $interactive-01;

&:active {
color: $carbon--blue-80;
color: $interactive-01;
}

&:active,
Expand Down Expand Up @@ -20165,8 +20181,11 @@ Inline notification styles
- [carbon--spacing-02 [variable]](#carbon--spacing-02-variable)
- [carbon--spacing-03 [variable]](#carbon--spacing-03-variable)
- [carbon--spacing-08 [variable]](#carbon--spacing-08-variable)
- [inverse-focus-ui [variable]](#inverse-focus-ui-variable)
- [link-01 [variable]](#link-01-variable)
- [inverse-hover-ui [variable]](#inverse-hover-ui-variable)
- [inverse-focus-ui [variable]](#inverse-focus-ui-variable)
- [focus [variable]](#focus-variable)
- [interactive-01 [variable]](#interactive-01-variable)

### ❌inline-notification--color [mixin]

Expand Down Expand Up @@ -20378,7 +20397,7 @@ Toast notification styles
}

.#{$prefix}--toast-notification--low-contrast
.#{$prefix}--toast-notification__close-button {
.#{$prefix}--toast-notification__close-button:focus {
@include focus-outline('outline');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,30 +190,43 @@
}

.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost {
color: $inverse-link;
height: rem(32px);
margin-bottom: $carbon--spacing-03;
margin-left: $carbon--spacing-08;

@include carbon--breakpoint(md) {
margin: $carbon--spacing-03 0;
}
}

&,
&:hover,
&:focus,
&:active {
color: $inverse-link;
}
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost {
color: $link-01;
}

&:focus {
border-color: transparent;
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:active,
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:hover {
background-color: $inverse-hover-ui;
}

&:hover {
background-color: $inverse-hover-ui;
}
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:active,
.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:hover {
background-color: $carbon--white-0;
}

.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:focus {
border-color: transparent;
box-shadow: none;
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}

.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost:focus {
outline-color: $focus;
}

.#{$prefix}--inline-notification--hide-close-button
Expand Down Expand Up @@ -256,7 +269,7 @@
}

.#{$prefix}--inline-notification--low-contrast
.#{$prefix}--inline-notification__close-button {
.#{$prefix}--inline-notification__close-button:focus {
@include focus-outline('outline');
}

Expand All @@ -267,10 +280,10 @@
}

.#{$prefix}--inline-notification__action-button {
color: $carbon--blue-60;
color: $interactive-01;

&:active {
color: $carbon--blue-80;
color: $interactive-01;
}

&:active,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
}

.#{$prefix}--toast-notification--low-contrast
.#{$prefix}--toast-notification__close-button {
.#{$prefix}--toast-notification__close-button:focus {
@include focus-outline('outline');
}

Expand Down
12 changes: 10 additions & 2 deletions packages/react/src/components/UIShell/SideNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,16 @@ const SideNav = React.forwardRef(function SideNav(props, ref) {
let eventHandlers = {};

if (addFocusListeners) {
eventHandlers.onFocus = event => handleToggle(event, true);
eventHandlers.onBlur = event => handleToggle(event, false);
eventHandlers.onFocus = event => {
if (!event.currentTarget.contains(event.relatedTarget)) {
handleToggle(event, true);
}
};
eventHandlers.onBlur = event => {
if (!event.currentTarget.contains(event.relatedTarget)) {
handleToggle(event, false);
}
};
}

if (addMouseListeners && isRail) {
Expand Down

0 comments on commit 67fe5ff

Please sign in to comment.