Skip to content

Commit

Permalink
Merge branch 'master' into new-search-height
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack authored Oct 9, 2019
2 parents af55be7 + 0c05b81 commit 18bc529
Show file tree
Hide file tree
Showing 32 changed files with 237 additions and 56 deletions.
6 changes: 4 additions & 2 deletions packages/components/src/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@
}

&:focus {
color: $text-04;
color: $inverse-01;
background-color: $interactive-03;
}

&:active {
background-color: $active-primary;
color: $inverse-01;
}

&:disabled,
Expand All @@ -112,6 +112,7 @@
&.#{$prefix}--btn--disabled:focus {
background: transparent;
color: $disabled;
outline: none;

& > .#{$prefix}--btn__icon path {
fill: $disabled;
Expand Down Expand Up @@ -161,6 +162,7 @@
color: $disabled;
background: transparent;
border-color: transparent;
outline: none;

.#{$prefix}--btn__icon path {
fill: $disabled;
Expand Down
7 changes: 4 additions & 3 deletions packages/components/src/components/checkbox/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@
@mixin checkbox {
// Spacing between checkboxes
.#{$prefix}--form-item.#{$prefix}--checkbox-wrapper {
margin-bottom: rem(8px);
margin-bottom: $carbon--spacing-02;
}

// Spacing above collection of checkboxes
.#{$prefix}--form-item.#{$prefix}--checkbox-wrapper:first-of-type {
margin-top: rem(3px);
}

// Remove spacing above collection of checkboxes if label is present
// Shift collection of checkboxes up if label is present
// to account for the 2px top margin for the first checkbox
.#{$prefix}--label + .#{$prefix}--form-item.#{$prefix}--checkbox-wrapper {
margin-top: 0;
margin-top: -#{$carbon--spacing-01};
}

// Spacing below collection of checkboxes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
//TOOLBAR
//-------------------------------------------------
.#{$prefix}--table-toolbar {
display: flex;
width: 100%;
background: $ui-01;
display: flex;
height: $layout-04;
overflow: hidden;
position: relative; //need for batch actions
width: 100%;
}

.#{$prefix}--toolbar-content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
.#{$prefix}--date-picker-input__wrapper {
display: flex;
align-items: center;
position: relative;

~ .#{$prefix}--form-requirement {
max-height: rem(200px);
Expand Down Expand Up @@ -130,6 +131,9 @@
fill: $icon-01;
cursor: pointer;
z-index: 1;
// vertically center icon within parent container on IE11
top: 50%;
transform: translateY(-50%);
}

.#{$prefix}--date-picker__icon ~ .#{$prefix}--date-picker__input {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
margin-top: rem(6px);
}

// Remove spacing above collection of radio buttons if label is present
.#{$prefix}--label + .#{$prefix}--form-item .#{$prefix}--radio-button-group {
margin-top: 0;
}

// vertical radio button
.#{$prefix}--radio-button-group--vertical {
flex-direction: column;
Expand All @@ -37,6 +42,7 @@

.#{$prefix}--radio-button__label {
margin-right: 0;
line-height: carbon--mini-units(2.5);
}

.#{$prefix}--radio-button__label:not(:last-of-type) {
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/components/slider/_slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
&:focus {
// 20px / 14px = 1.4285714286
transform: translate(-50%, -50%) scale(1.4285714286);
box-shadow: inset 0 0 0 2px $interactive-01, inset 0 0 0 3px $ui-01;
background-color: $interactive-01;
box-shadow: inset 0 0 0 2px $interactive-04, inset 0 0 0 3px $ui-01;
background-color: $interactive-04;
}

&:active {
transform: translate(-50%, -50%) scale(1.4285714286);
box-shadow: inset 0 0 0 2px $interactive-01;
box-shadow: inset 0 0 0 2px $interactive-04;
}
}

Expand All @@ -130,7 +130,7 @@
}

.#{$prefix}--slider__thumb:focus ~ .#{$prefix}--slider__filled-track {
background-color: $interactive-01;
background-color: $interactive-04;
}

// Disabled state
Expand Down
16 changes: 16 additions & 0 deletions packages/components/src/components/toggle/_toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@
margin-left: carbon--rem(56px);
@include type-style('body-short-01');
user-select: none;
// top offset needed to vertically center absolutely positioned flex child in IE11
top: 50%;
transform: translateY(-50%);
}

//----------------------------------------------
Expand Down Expand Up @@ -435,6 +438,19 @@
.#{$prefix}--toggle__check {
fill: $disabled-02;
}

//----------------------------------------------
// Skeleton
// ---------------------------------------------

.#{$prefix}--toggle__label.#{$prefix}--skeleton {
flex-direction: column;
align-items: flex-start;

.#{$prefix}--toggle__label-text {
margin-bottom: $carbon--spacing-03;
}
}
}

@include exports('toggle') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ export default class BreadcrumbSkeleton extends React.Component {
render() {
const item = (
<div className={`${prefix}--breadcrumb-item`}>
<a href="/#" className={`${prefix}--link`}>
&nbsp;
</a>
<span className={`${prefix}--link`}>&nbsp;</span>
</div>
);
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,29 @@ exports[`BreadcrumbSkeleton should render 1`] = `
<div
className="bx--breadcrumb-item"
>
<a
<span
className="bx--link"
href="/#"
>
 
</a>
</span>
</div>
<div
className="bx--breadcrumb-item"
>
<a
<span
className="bx--link"
href="/#"
>
 
</a>
</span>
</div>
<div
className="bx--breadcrumb-item"
>
<a
<span
className="bx--link"
href="/#"
>
 
</a>
</span>
</div>
</div>
</BreadcrumbSkeleton>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/ComboBox/ComboBox-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const itemToElement = item => {
return (
<div>
<span>{itemAsArray[0]}</span>
<span style={{ color: 'red' }}> {itemAsArray[1]}</span>
<span style={{ color: 'blue' }}> {itemAsArray[1]}</span>
</div>
);
};
Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/components/ComboBox/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ export default class ComboBox extends React.Component {
aria-labelledby={comboBoxA11yId}
tabIndex="0"
aria-disabled={disabled}
aria-controls={`${id}__menu`}
aria-owns={`${id}__menu`}
aria-controls={isOpen ? `${id}__menu` : null}
aria-owns={isOpen ? `${id}__menu` : null}
aria-autocomplete="list"
ref={this.textInput}
{...rest}
Expand All @@ -347,6 +347,7 @@ export default class ComboBox extends React.Component {
<ListBox.Selection
clearSelection={clearSelection}
translateWithId={translateWithId}
disabled={disabled}
/>
)}
<ListBox.MenuIcon
Expand Down
8 changes: 7 additions & 1 deletion packages/react/src/components/DataTable/TableSelectRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@

import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import { settings } from 'carbon-components';
import InlineCheckbox from '../InlineCheckbox';
import RadioButton from '../RadioButton';

const { prefix } = settings;
const TableSelectRow = ({
ariaLabel,
checked,
Expand All @@ -28,8 +31,11 @@ const TableSelectRow = ({
disabled,
};
const InlineInputComponent = radio ? RadioButton : InlineCheckbox;
const tableSelectRowClasses = classNames(`${prefix}--table-column-checkbox`, {
[className]: className,
});
return (
<td className={className}>
<td className={tableSelectRowClasses}>
<InlineInputComponent
{...selectionInputProps}
{...(radio && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const TableToolbarSearch = ({
small
className={className}
value={value}
id={typeof id !== 'undefined' ? id : uniqueId}
id={typeof id !== 'undefined' ? id : uniqueId.toString()}
aria-hidden={!expanded}
labelText={labelText || t('carbon.table.toolbar.search.label')}
placeHolderText={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ describe('DataTable.TableToolbarSearch', () => {
);
expect(wrapper).toMatchSnapshot();
});
it('should set an appropriate unique id', () => {
const wrapper = mount(
<TableToolbarSearch className="custom-class" onChange={jest.fn()} />
);
expect(typeof wrapper.find('Search').prop('id')).toBe('string');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@ exports[`DataTable selection -- radio buttons should render 1`] = `
onSelect={[Function]}
radio={true}
>
<td>
<td
className="bx--table-column-checkbox"
>
<ForwardRef(RadioButton)
checked={false}
disabled={false}
Expand Down Expand Up @@ -613,7 +615,9 @@ exports[`DataTable selection -- radio buttons should render 1`] = `
onSelect={[Function]}
radio={true}
>
<td>
<td
className="bx--table-column-checkbox"
>
<ForwardRef(RadioButton)
checked={false}
disabled={false}
Expand Down Expand Up @@ -698,7 +702,9 @@ exports[`DataTable selection -- radio buttons should render 1`] = `
onSelect={[Function]}
radio={true}
>
<td>
<td
className="bx--table-column-checkbox"
>
<ForwardRef(RadioButton)
checked={false}
disabled={false}
Expand Down Expand Up @@ -1417,7 +1423,9 @@ exports[`DataTable selection should render 1`] = `
onSelect={[Function]}
radio={null}
>
<td>
<td
className="bx--table-column-checkbox"
>
<ForwardRef(InlineCheckbox)
ariaLabel="Select row"
checked={false}
Expand Down Expand Up @@ -1484,7 +1492,9 @@ exports[`DataTable selection should render 1`] = `
onSelect={[Function]}
radio={null}
>
<td>
<td
className="bx--table-column-checkbox"
>
<ForwardRef(InlineCheckbox)
ariaLabel="Select row"
checked={false}
Expand Down Expand Up @@ -1551,7 +1561,9 @@ exports[`DataTable selection should render 1`] = `
onSelect={[Function]}
radio={null}
>
<td>
<td
className="bx--table-column-checkbox"
>
<ForwardRef(InlineCheckbox)
ariaLabel="Select row"
checked={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`DataTable.TableSelectRow should render 1`] = `
onSelect={[MockFunction]}
>
<td
className="custom-class-name"
className="bx--table-column-checkbox custom-class-name"
>
<ForwardRef(InlineCheckbox)
ariaLabel="Aria label"
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/components/FileUploader/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,8 @@ export class FileUploaderButton extends Component {
}
}}
htmlFor={this.uid}
role={role}
{...other}>
{this.state.labelText}
<span role={role}>{this.state.labelText}</span>
</label>
<input
className={`${prefix}--visually-hidden`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,14 @@ export default function FileUploaderDropContainer(props) {
<label
className={labelClasses}
htmlFor={id || uid.current}
role={role || 'button'}
tabIndex={tabIndex || 0}
onKeyDown={evt => {
if (matches(evt, [keys.Enter, keys.Space])) {
inputRef.current.click();
}
}}
{...other}>
<div className={dropareaClasses}>
<div className={dropareaClasses} role={role || 'button'}>
{labelText}
<input
type="file"
Expand Down
Loading

0 comments on commit 18bc529

Please sign in to comment.