Skip to content

Commit

Permalink
Merge branch 'master' into form-spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack authored Nov 6, 2019
2 parents 302756a + 2152c39 commit c97cce7
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
word-break: break-word;
}

.#{$prefix}--inline-notification__action-button {
.#{$prefix}--inline-notification__action-button.#{$prefix}--btn--ghost {
height: rem(32px);
margin: $carbon--spacing-03 0;

Expand All @@ -177,6 +177,12 @@
color: $inverse-link;
}

&:focus {
border-color: transparent;
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}

&:hover {
background-color: $inverse-hover-ui;
}
Expand All @@ -199,6 +205,11 @@
transition: outline $duration--fast-02 motion(standard, productive),
background-color $duration--fast-02 motion(standard, productive);

&:focus {
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}

.#{$prefix}--inline-notification__close-icon {
fill: $inverse-01;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@

.#{$prefix}--toast-notification__close-button {
@include focus-outline('reset');
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: transparent;
border: none;
cursor: pointer;
Expand All @@ -123,7 +127,8 @@
transition: outline $transition--base, background-color $transition--base;

&:focus {
@include focus-outline('outline');
outline: 2px solid $inverse-focus-ui;
outline-offset: -2px;
}

.#{$prefix}--toast-notification__close-icon {
Expand All @@ -140,7 +145,7 @@
.#{$prefix}--toast-notification__title {
@include type-style('productive-heading-01');
font-weight: 600;
margin-top: $carbon--spacing-04;
margin-top: $carbon--spacing-05;
word-break: break-word;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
.#{$prefix}--number__input-wrapper {
display: flex;
align-items: center;
position: relative;

~ .#{$prefix}--form-requirement {
color: $support-01;
Expand All @@ -98,6 +99,9 @@
flex-direction: column;
justify-content: center;
align-items: center;
// vertically center controls within parent container on IE11
top: 50%;
transform: translateY(-50%);
}

.#{$prefix}--number__control-btn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,14 @@ describe('<ComposedModal />', () => {
});

it('should change class of <body> upon open state', () => {
mount(<ComposedModal open />);
const wrapper = mount(<ComposedModal open />);
expect(
document.body.classList.contains('bx--body--with-modal-open')
).toEqual(true);
wrapper.unmount();
expect(
document.body.classList.contains('bx--body--with-modal-open')
).toEqual(false);
mount(<ComposedModal open={false} />);
expect(
document.body.classList.contains('bx--body--with-modal-open')
Expand Down
12 changes: 8 additions & 4 deletions packages/react/src/components/ComposedModal/ComposedModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ export default class ComposedModal extends Component {
}
};

componentDidUpdate(prevProps) {
if (!prevProps.open && this.props.open) {
componentDidUpdate(prevProps, prevState) {
if (!prevState.open && this.state.open) {
this.beingOpen = true;
} else if (prevProps.open && !this.props.open) {
} else if (prevState.open && !this.state.open) {
this.beingOpen = false;
}
toggleClass(
document.body,
`${prefix}--body--with-modal-open`,
this.props.open
this.state.open
);
}

Expand All @@ -148,6 +148,10 @@ export default class ComposedModal extends Component {
}
};

componentWillUnmount() {
toggleClass(document.body, `${prefix}--body--with-modal-open`, false);
}

componentDidMount() {
toggleClass(
document.body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const props = () => ({
),
});

NumberInput.displayName = 'NumberInput';

storiesOf('NumberInput', module)
.addDecorator(withKnobs)
.add(
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ const Select = React.forwardRef(function Select(
);
});

Select.displayName = 'Select';

Select.propTypes = {
/**
* Provide the contents of your Select
Expand Down

0 comments on commit c97cce7

Please sign in to comment.