Skip to content

Commit

Permalink
Merge branch 'master' into 7734-resolve-sketch-plugin-color-layer-sty…
Browse files Browse the repository at this point in the history
…le-duplication
  • Loading branch information
kodiakhq[bot] authored Feb 12, 2021
2 parents c369682 + 82abdc6 commit e774911
Show file tree
Hide file tree
Showing 19 changed files with 159 additions and 40 deletions.
6 changes: 2 additions & 4 deletions packages/components/src/components/accordion/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@
width: 1rem;
height: 1rem;
margin: $accordion-arrow-margin;
// TODO: RTL rotate(180deg);
transform: rotate(90deg);
transform: rotate(90deg) #{'/*rtl:ignore*/'};
transition: all $duration--fast-02 motion(standard, productive);
fill: $ui-05;

Expand Down Expand Up @@ -197,8 +196,7 @@
}

.#{$prefix}--accordion__arrow {
/* rtl:ignore */
transform: rotate(-90deg);
transform: rotate(-90deg) #{'/*rtl:ignore*/'};
fill: $ui-05;

// Windows, Firefox HCM Fix
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/components/checkbox/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@
left: rem(6px);
width: rem(9px);
height: rem(5px);
margin-top: rem(-3px) /* rtl: 0rem */;
margin-top: rem(-3px) #{'/*rtl:0rem*/'};
background: none;
border-bottom: 2px solid $inverse-01;
border-left: 2px solid $inverse-01;
transform: scale(0) rotate(-45deg) /* rtl: scale(0) rotate(45deg) */;
transform-origin: bottom right /* rtl: center */;
transform: scale(0) rotate(-45deg);
transform-origin: bottom right #{'/*rtl:center*/'};
content: '';
}

Expand All @@ -127,7 +127,7 @@
// Display the check
.#{$prefix}--checkbox:checked + .#{$prefix}--checkbox-label::after,
.#{$prefix}--checkbox-label[data-contained-checkbox-state='true']::after {
transform: scale(1) rotate(-45deg) /* rtl: scale(-1,1) rotate(45deg) */;
transform: scale(1) rotate(-45deg) #{'/*rtl:scale(1.2) rotate3d(.5, 1, 0, 158deg)*/'};
}

// Indeterminate symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Array [
"expressiveHeading05",
"expressiveHeading06",
"expressiveParagraph01",
"fast01",
"fast02",
"field01",
"field02",
"fluid",
Expand Down Expand Up @@ -184,6 +186,8 @@ Array [
"magenta90",
"miniUnit",
"miniUnits",
"moderate01",
"moderate02",
"motion",
"orange",
"orange40",
Expand Down Expand Up @@ -231,6 +235,8 @@ Array [
"selectedUI",
"skeleton01",
"skeleton02",
"slow01",
"slow02",
"spacing",
"spacing01",
"spacing02",
Expand Down
47 changes: 47 additions & 0 deletions packages/motion/__tests__/__snapshots__/motion-test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`@carbon/motion @carbon/motion/scss/motion.scss 1`] = `
Array [
"fast-01",
"fast-02",
"moderate-01",
"moderate-02",
"slow-01",
"slow-02",
"carbon--easings",
]
`;

exports[`@carbon/motion Public API 1`] = `
Object {
"easings": Object {
"entrance": Object {
"expressive": "cubic-bezier(0, 0, 0.3, 1)",
"productive": "cubic-bezier(0, 0, 0.38, 0.9)",
},
"exit": Object {
"expressive": "cubic-bezier(0.4, 0.14, 1, 1)",
"productive": "cubic-bezier(0.2, 0, 1, 0.9)",
},
"standard": Object {
"expressive": "cubic-bezier(0.4, 0.14, 0.3, 1)",
"productive": "cubic-bezier(0.2, 0, 0.38, 0.9)",
},
},
"fast01": "70ms",
"fast02": "110ms",
"moderate01": "150ms",
"moderate02": "240ms",
"motion": [Function],
"slow01": "400ms",
"slow02": "700ms",
"unstable_tokens": Array [
"fast01",
"fast02",
"moderate01",
"moderate02",
"slow01",
"slow02",
],
}
`;
30 changes: 30 additions & 0 deletions packages/motion/__tests__/motion-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright IBM Corp. 2018, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

import { SassRenderer } from '@carbon/test-utils/scss';
import * as CarbonMotion from '../src';

const { render } = SassRenderer.create(__dirname);

describe('@carbon/motion', () => {
test('Public API', () => {
expect(CarbonMotion).toMatchSnapshot();
});

test('@carbon/motion/scss/motion.scss', async () => {
const { getValue } = await render(`
@use 'sass:meta';
@use '../scss/motion';
$_: get-value(meta.module-variables('motion'));
`);
const variables = getValue(0);
expect(Object.keys(variables)).toMatchSnapshot();
});
});
24 changes: 24 additions & 0 deletions packages/motion/scss/motion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@
// LICENSE file in the root directory of this source tree.
//

/// @access public
/// @group @carbon/motion
$fast-01: 70ms !default;

/// @access public
/// @group @carbon/motion
$fast-02: 110ms !default;

/// @access public
/// @group @carbon/motion
$moderate-01: 150ms !default;

/// @access public
/// @group @carbon/motion
$moderate-02: 240ms !default;

/// @access public
/// @group @carbon/motion
$slow-01: 400ms !default;

/// @access public
/// @group @carbon/motion
$slow-02: 700ms !default;

/// Common component easings
/// @type Map
/// @access public
Expand Down
16 changes: 16 additions & 0 deletions packages/motion/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
* LICENSE file in the root directory of this source tree.
*/

export const fast01 = '70ms';
export const fast02 = '110ms';
export const moderate01 = '150ms';
export const moderate02 = '240ms';
export const slow01 = '400ms';
export const slow02 = '700ms';

export const unstable_tokens = [
'fast01',
'fast02',
'moderate01',
'moderate02',
'slow01',
'slow02',
];

export const easings = {
standard: {
productive: 'cubic-bezier(0.2, 0, 0.38, 0.9)',
Expand Down
16 changes: 3 additions & 13 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ Map {
"type": "oneOf",
},
"titleText": Object {
"type": "string",
"type": "node",
},
"translateWithId": Object {
"type": "func",
Expand Down Expand Up @@ -2407,17 +2407,7 @@ Map {
"type": "oneOf",
},
"titleText": Object {
"args": Array [
Array [
Object {
"type": "string",
},
Object {
"type": "node",
},
],
],
"type": "oneOfType",
"type": "node",
},
"translateWithId": Object {
"type": "func",
Expand Down Expand Up @@ -3881,7 +3871,7 @@ Map {
"type": "func",
},
"titleText": Object {
"type": "string",
"type": "node",
},
"translateWithId": Object {
"type": "func",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/ComboBox/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default class ComboBox extends React.Component {
* Provide text to be used in a `<label>` element that is tied to the
* combobox via ARIA attributes.
*/
titleText: PropTypes.string,
titleText: PropTypes.node,

/**
* Specify a custom translation function that takes in a message identifier
Expand Down
5 changes: 4 additions & 1 deletion packages/react/src/components/DataTable/TableBatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ const TableBatchActions = ({
);

return (
<div {...rest} className={batchActionsClasses}>
<div
{...rest}
aria-hidden={!shouldShowBatchActions}
className={batchActionsClasses}>
<div className={`${prefix}--batch-summary`}>
<p className={`${prefix}--batch-summary__para`}>
<span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2016,6 +2016,7 @@ exports[`DataTable should render 1`] = `
translateWithId={[Function]}
>
<div
aria-hidden={true}
className="bx--batch-actions"
>
<div
Expand Down Expand Up @@ -3021,6 +3022,7 @@ exports[`DataTable sticky header should render 1`] = `
translateWithId={[Function]}
>
<div
aria-hidden={true}
className="bx--batch-actions"
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`DataTable.TableBatchActions should render 1`] = `
translateWithId={[Function]}
>
<div
aria-hidden={true}
className="bx--batch-actions custom-class"
>
<div
Expand Down Expand Up @@ -62,6 +63,7 @@ exports[`DataTable.TableBatchActions should render 2`] = `
translateWithId={[Function]}
>
<div
aria-hidden={false}
className="bx--batch-actions bx--batch-actions--active custom-class"
>
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ Dropdown.propTypes = {
* Provide the title text that will be read by a screen reader when
* visiting this control
*/
titleText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
titleText: PropTypes.node,

/**
* Callback function for translating ListBoxMenuIcon SVG title
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/MultiSelect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ MultiSelect.propTypes = {
* Provide text to be used in a `<label>` element that is tied to the
* multiselect via ARIA attributes.
*/
titleText: PropTypes.string,
titleText: PropTypes.node,

/**
* Callback function for translating ListBoxMenuIcon SVG title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ export function ProgressStep({
// eslint-disable-next-line react/prop-types
const SVGIcon = ({ complete, current, description, invalid, prefix }) => {
if (invalid) {
return <Warning16 className={`${prefix}--progress__warning`} />;
return (
<Warning16 className={`${prefix}--progress__warning`}>
<title>{description}</title>
</Warning16>
);
}
if (current) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const ControlledPasswordInput = React.forwardRef(
);
const passwordVisibilityToggleClasses = classNames(
`${prefix}--text-input--password__visibility__toggle`,
`${prefix}--btn`,
`${prefix}--btn--icon-only`,
`${prefix}--tooltip__trigger`,
`${prefix}--tooltip--a11y`,
Expand Down
4 changes: 0 additions & 4 deletions packages/storybook-addon-carbon-theme/.npmignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ exports[`styles expressiveParagraph01 should be printable 1`] = `
"font-size: 1.5rem;
font-weight: 300;
line-height: 1.334;
letter-spacing: 0;
lg: [object Object];
max: [object Object];"
letter-spacing: 0;"
`;

exports[`styles heading01 should be printable 1`] = `
Expand Down
16 changes: 9 additions & 7 deletions packages/type/src/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,15 @@ export const expressiveParagraph01 = {
fontWeight: fontWeights.light,
lineHeight: 1.334,
letterSpacing: 0,
lg: {
fontSize: rem(scale[6]),
lineHeight: 1.29,
},
max: {
fontSize: rem(scale[7]),
lineHeight: 1.25,
breakpoints: {
lg: {
fontSize: rem(scale[6]),
lineHeight: 1.29,
},
max: {
fontSize: rem(scale[7]),
lineHeight: 1.25,
},
},
};

Expand Down

0 comments on commit e774911

Please sign in to comment.