From 033162ee21fb8273105e662cfe3801d3fa765e0a Mon Sep 17 00:00:00 2001 From: Josh Black Date: Fri, 12 Feb 2021 10:03:55 -0600 Subject: [PATCH 1/5] Delete .npmignore (#7783) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/storybook-addon-carbon-theme/.npmignore | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/storybook-addon-carbon-theme/.npmignore diff --git a/packages/storybook-addon-carbon-theme/.npmignore b/packages/storybook-addon-carbon-theme/.npmignore deleted file mode 100644 index 81ba1598b971..000000000000 --- a/packages/storybook-addon-carbon-theme/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -**/__mocks__/** -**/__tests__/** -**/examples/** -**/tasks/** \ No newline at end of file From ddd3bb6380520b879dd6efc30dba7acd7f3be2fb Mon Sep 17 00:00:00 2001 From: Josh Black Date: Fri, 12 Feb 2021 14:53:16 -0600 Subject: [PATCH 2/5] feat(motion): add duration tokens to motion (#7782) * feat(motion): add duration tokens to motion * chore(elements): update snapshots Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../__snapshots__/PublicAPI-test.js.snap | 6 +++ .../__snapshots__/motion-test.js.snap | 47 +++++++++++++++++++ packages/motion/__tests__/motion-test.js | 30 ++++++++++++ packages/motion/scss/motion.scss | 24 ++++++++++ packages/motion/src/index.js | 16 +++++++ 5 files changed, 123 insertions(+) create mode 100644 packages/motion/__tests__/__snapshots__/motion-test.js.snap create mode 100644 packages/motion/__tests__/motion-test.js diff --git a/packages/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap index 2e64e18ff0b9..6df53f6619e1 100644 --- a/packages/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -87,6 +87,8 @@ Array [ "expressiveHeading05", "expressiveHeading06", "expressiveParagraph01", + "fast01", + "fast02", "field01", "field02", "fluid", @@ -184,6 +186,8 @@ Array [ "magenta90", "miniUnit", "miniUnits", + "moderate01", + "moderate02", "motion", "orange", "orange40", @@ -231,6 +235,8 @@ Array [ "selectedUI", "skeleton01", "skeleton02", + "slow01", + "slow02", "spacing", "spacing01", "spacing02", diff --git a/packages/motion/__tests__/__snapshots__/motion-test.js.snap b/packages/motion/__tests__/__snapshots__/motion-test.js.snap new file mode 100644 index 000000000000..793bd5fa4a91 --- /dev/null +++ b/packages/motion/__tests__/__snapshots__/motion-test.js.snap @@ -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", + ], +} +`; diff --git a/packages/motion/__tests__/motion-test.js b/packages/motion/__tests__/motion-test.js new file mode 100644 index 000000000000..c6d653f6ecf7 --- /dev/null +++ b/packages/motion/__tests__/motion-test.js @@ -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(); + }); +}); diff --git a/packages/motion/scss/motion.scss b/packages/motion/scss/motion.scss index f4d215b422e5..eddd8c5891ca 100644 --- a/packages/motion/scss/motion.scss +++ b/packages/motion/scss/motion.scss @@ -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 diff --git a/packages/motion/src/index.js b/packages/motion/src/index.js index c028e345fa7f..0e4839cfd149 100644 --- a/packages/motion/src/index.js +++ b/packages/motion/src/index.js @@ -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)', From f94ee2590c91e6318522c352c04ed8a2560a5619 Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Fri, 12 Feb 2021 13:24:05 -0800 Subject: [PATCH 3/5] feat(type): nest values in breakpoint object (#7788) * feat(type): nest values in breakpoint object * chore: update snapshots Co-authored-by: emyarod Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../__tests__/__snapshots__/styles-test.js.snap | 4 +--- packages/type/src/styles.js | 16 +++++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/type/src/__tests__/__snapshots__/styles-test.js.snap b/packages/type/src/__tests__/__snapshots__/styles-test.js.snap index 75f8fdc34e01..795253539d59 100644 --- a/packages/type/src/__tests__/__snapshots__/styles-test.js.snap +++ b/packages/type/src/__tests__/__snapshots__/styles-test.js.snap @@ -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`] = ` diff --git a/packages/type/src/styles.js b/packages/type/src/styles.js index 2009036b176d..8b1a198e0d38 100644 --- a/packages/type/src/styles.js +++ b/packages/type/src/styles.js @@ -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, + }, }, }; From dbe33f4b154f9e809c6c3aaa5293f306b89e9647 Mon Sep 17 00:00:00 2001 From: DAK <40970507+dakahn@users.noreply.github.com> Date: Fri, 12 Feb 2021 15:57:10 -0600 Subject: [PATCH 4/5] Add aria-hidden to visually hidden batch action toolbar (#7789) * fix(TableBatchActions): add aria hiding visually unseen batch action bar * test(TableBatchActions): update snapshots Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/react/src/components/DataTable/TableBatchActions.js | 5 ++++- .../DataTable/__tests__/__snapshots__/DataTable-test.js.snap | 2 ++ .../__tests__/__snapshots__/TableBatchActions-test.js.snap | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react/src/components/DataTable/TableBatchActions.js b/packages/react/src/components/DataTable/TableBatchActions.js index 566a06d3830b..5839edd24fdc 100644 --- a/packages/react/src/components/DataTable/TableBatchActions.js +++ b/packages/react/src/components/DataTable/TableBatchActions.js @@ -45,7 +45,10 @@ const TableBatchActions = ({ ); return ( -
+

diff --git a/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap b/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap index d84336c1a497..7a087e7d6fb7 100644 --- a/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap +++ b/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap @@ -2016,6 +2016,7 @@ exports[`DataTable should render 1`] = ` translateWithId={[Function]} >

Date: Fri, 12 Feb 2021 16:21:23 -0600 Subject: [PATCH 5/5] fix(PasswordInput): add missing button class (#7799) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../react/src/components/TextInput/ControlledPasswordInput.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react/src/components/TextInput/ControlledPasswordInput.js b/packages/react/src/components/TextInput/ControlledPasswordInput.js index c22402fe5da6..255e79456328 100644 --- a/packages/react/src/components/TextInput/ControlledPasswordInput.js +++ b/packages/react/src/components/TextInput/ControlledPasswordInput.js @@ -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`,