Skip to content

Commit

Permalink
Merge branch 'main' into 10670-rtl
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Mar 2, 2022
2 parents 32af1dd + a474a3e commit 6fdf994
Show file tree
Hide file tree
Showing 35 changed files with 101 additions and 151 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
dedupe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Run yarn dedupe
Expand All @@ -23,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
Expand All @@ -36,7 +39,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
Expand All @@ -51,7 +54,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- uses: actions/[email protected]
Expand All @@ -77,7 +80,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- uses: actions/[email protected]
Expand Down Expand Up @@ -113,7 +116,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-react-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@main
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-vanilla-devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@main
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@main
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2

- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2.5.1
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion config/eslint-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"eslint-plugin-cypress": "^2.11.3",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^26.0.0",
"eslint-plugin-jsdoc": "^36.0.3",
"eslint-plugin-jsdoc": "^37.0.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
Expand Down
22 changes: 21 additions & 1 deletion docs/migration/v11.md
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ below.
| `TimePicker` | Updated from a class to functional component |
| `TimePickerSelect` | Updated from a class to functional component |
| `ToastNotification` | View changes [here](#notifications) |
| `Toggle` | Updated from a class to functional component |
| `Toggle` | View changes [here](#toggle) |
| `ToggleSkeleton` | Removed |
| `ToggleSmall` | Removed |
| `ToggleSmallSkeleton` | Removed |
Expand Down Expand Up @@ -1056,6 +1056,26 @@ ToastNotification` updates:
- The `closeOnEscape` prop toggles the closing of notifications via the `escape`
key.

### Toggle

The toggle component has been updated to improve its accessibility, rtl
compatibility and flexibility to layout.

- The underlying element has been changed from a checkbox
(`<input type="checkbox">`) to a switch button (`<button role="switch">`).
- `props.onChange` has been removed since it's not available on `<button>`
elements.
- `props.onClick` has been added to substitute the previous `onChange` event.
- `props['aria-label']` is no longer required.
- `props.labelText` will always be available to screen readers without the use
of `aria-label`.
- If `props['aria-label']` is still passed, it will be emitted on the
`<button>` element.
- `props.hideLabel` has been added. This hides `labelA` and `labelB` while
moving `labelText` to the side for height-restricted layouts.
- `props.labelA` and `props.labelB` have been made optional and default to "Off"
and "On" respectively.

### Tabs

### Tooltips
Expand Down
2 changes: 1 addition & 1 deletion packages/carbon-react/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { configureActions } from '@storybook/addon-actions';
import { white, g10, g90, g100 } from '@carbon/themes';
import React from 'react';
import { breakpoints } from '@carbon/layout';
import { unstable_ThemeContext as ThemeContext } from '../src';
import { ThemeContext } from '../src';
import { addParameters } from '@storybook/react';

export const globalTypes = {
Expand Down
12 changes: 6 additions & 6 deletions packages/carbon-react/__tests__/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe('Carbon Components React', () => {
"Heading",
"IconButton",
"IconSkeleton",
"IconTab",
"InlineLoading",
"InlineNotification",
"Layer",
Expand All @@ -106,6 +107,7 @@ describe('Carbon Components React', () => {
"Popover",
"PopoverContent",
"PrimaryButton",
"ProgressBar",
"ProgressIndicator",
"ProgressIndicatorSkeleton",
"ProgressStep",
Expand Down Expand Up @@ -157,6 +159,9 @@ describe('Carbon Components React', () => {
"SwitcherItem",
"Tab",
"TabContent",
"TabList",
"TabPanel",
"TabPanels",
"Table",
"TableActionList",
"TableBatchAction",
Expand Down Expand Up @@ -186,6 +191,7 @@ describe('Carbon Components React', () => {
"TextInput",
"TextInputSkeleton",
"Theme",
"ThemeContext",
"Tile",
"TileAboveTheFoldContent",
"TileBelowTheFoldContent",
Expand All @@ -206,7 +212,6 @@ describe('Carbon Components React', () => {
"Tooltip",
"UnorderedList",
"VStack",
"unstable_IconTab",
"unstable_Menu",
"unstable_MenuDivider",
"unstable_MenuGroup",
Expand All @@ -215,11 +220,6 @@ describe('Carbon Components React', () => {
"unstable_MenuSelectableItem",
"unstable_PageSelector",
"unstable_Pagination",
"unstable_ProgressBar",
"unstable_TabList",
"unstable_TabPanel",
"unstable_TabPanels",
"unstable_ThemeContext",
"unstable_TreeNode",
"unstable_TreeView",
"unstable_useContextMenu",
Expand Down
13 changes: 6 additions & 7 deletions packages/carbon-react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export {
Grid,
Column,
unstable_FlexGrid as FlexGrid,
// Experimental
unstable_useContextMenu,
unstable_FeatureFlags as FeatureFlags,
unstable_Heading as Heading,
Expand All @@ -204,14 +203,14 @@ export {
unstable_Pagination,
unstable_Popover as Popover,
unstable_PopoverContent as PopoverContent,
unstable_ProgressBar,
unstable_ProgressBar as ProgressBar,
unstable_Section as Section,
unstable_Stack as Stack,
unstable_TabPanel,
unstable_TabPanels,
unstable_TabList,
unstable_IconTab,
unstable_ThemeContext,
unstable_TabPanel as TabPanel,
unstable_TabPanels as TabPanels,
unstable_TabList as TabList,
unstable_IconTab as IconTab,
unstable_ThemeContext as ThemeContext,
unstable_Theme as Theme,
unstable_Tooltip as Tooltip,
unstable_DefinitionTooltip as DefinitionTooltip,
Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"html-loader": "^0.5.0",
"jasmine-core": "^4.0.0",
"karma": "^6.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.3",
"karma-firefox-launcher": "^2.1.0",
"karma-html2js-preprocessor": "^1.1.0",
Expand All @@ -138,7 +138,7 @@
"karma-sourcemap-loader": "~0.3.7",
"karma-spec-reporter": "0.0.33",
"karma-webpack": "^3.0.0",
"lolex": "^3.0.0",
"lolex": "^5.0.0",
"markdown-it": "^12.0.4",
"minimatch": "^3.0.4",
"mkdirp": "^0.5.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4532,6 +4532,7 @@ Map {
"ariaLabel": "open and close list of options",
"direction": "bottom",
"flipped": false,
"focusTrap": true,
"iconDescription": "open and close list of options",
"light": false,
"menuOffset": [Function],
Expand Down Expand Up @@ -4569,6 +4570,9 @@ Map {
"flipped": Object {
"type": "bool",
},
"focusTrap": Object {
"type": "bool",
},
"iconClass": Object {
"type": "string",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,7 @@ exports[`DataTable should render 1`] = `
className="bx--toolbar-action bx--overflow-menu"
direction="bottom"
flipped={true}
focusTrap={true}
iconDescription="Settings"
light={false}
menuOffset={[Function]}
Expand Down Expand Up @@ -3381,6 +3382,7 @@ exports[`DataTable sticky header should render 1`] = `
className="bx--toolbar-action bx--overflow-menu"
direction="bottom"
flipped={true}
focusTrap={true}
iconDescription="Settings"
light={false}
menuOffset={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exports[`DataTable.TableToolbarMenu should render 1`] = `
className="custom-class bx--toolbar-action bx--overflow-menu"
direction="bottom"
flipped={true}
focusTrap={true}
iconDescription="Add"
light={false}
menuOffset={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { IconButton } from '../';

export default {
title: 'Experimental/unstable_IconButton',
title: 'Components/IconButton',
component: IconButton,
parameters: {
controls: {
Expand Down
9 changes: 8 additions & 1 deletion packages/react/src/components/OverflowMenu/OverflowMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ class OverflowMenu extends Component {
*/
flipped: PropTypes.bool,

/**
* Enable or disable focus trap behavior
*/
focusTrap: PropTypes.bool,

/**
* The CSS class for the icon.
*/
Expand Down Expand Up @@ -234,6 +239,7 @@ class OverflowMenu extends Component {
open: false,
direction: DIRECTION_BOTTOM,
flipped: false,
focusTrap: true,
renderIcon: OverflowMenuVertical16,
onClick: () => {},
onKeyDown: () => {},
Expand Down Expand Up @@ -461,6 +467,7 @@ class OverflowMenu extends Component {
iconDescription,
direction,
flipped,
focusTrap,
menuOffset,
menuOffsetFlip,
iconClass,
Expand Down Expand Up @@ -528,7 +535,7 @@ class OverflowMenu extends Component {

const wrappedMenuBody = (
<FloatingMenu
focusTrap
focusTrap={focusTrap}
triggerRef={this._triggerRef}
menuDirection={direction}
menuOffset={flipped ? menuOffsetFlip : menuOffset}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Popover, PopoverContent } from '../../Popover';
import mdx from './Popover.mdx';

export default {
title: 'Experimental/unstable_Popover',
title: 'Components/Popover',
component: Popover,
subcomponents: {
PopoverContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { useState, useEffect } from 'react';
import ProgressBar from '../';

export default {
title: 'Experimental/unstable_ProgressBar',
title: 'Components/ProgressBar',
component: ProgressBar,
};

Expand Down
Loading

0 comments on commit 6fdf994

Please sign in to comment.