diff --git a/package.json b/package.json index f8305241d20..bc69065691b 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,9 @@ "@carbon/charts-react": "0.55.0", "@carbon/elements": "^11.19.0", "@carbon/icons-react": "^11.16.0", - "@carbon/pictograms": "^12.12.0", - "@carbon/pictograms-react": "^11.38.0", - "@carbon/react": "^1.22.0", + "@carbon/pictograms": "^12.13.0", + "@carbon/pictograms-react": "^11.39.0", + "@carbon/react": "^1.23.0", "@loadable/component": "^5.15.2", "@slack/web-api": "^5.11.0", "babel-preset-env": "^1.7.0", diff --git a/src/data/docgen/react-docgen.json b/src/data/docgen/react-docgen.json index 346309fd6eb..f6b81c364d8 100644 --- a/src/data/docgen/react-docgen.json +++ b/src/data/docgen/react-docgen.json @@ -8573,7 +8573,7 @@ } } }, - "unstable_TreeView": { + "TreeView": { "description": "", "displayName": "TreeView", "props": { @@ -8596,12 +8596,12 @@ "description": "Array representing all selected node IDs in the tree" }, "size": { - "defaultValue": { "value": "'default'", "computed": false }, + "defaultValue": { "value": "'sm'", "computed": false }, "type": { "name": "enum", "value": [ - { "value": "'default'", "computed": false }, - { "value": "'compact'", "computed": false } + { "value": "'sm'", "computed": false }, + { "value": "'xs'", "computed": false } ] }, "required": false, @@ -8642,7 +8642,7 @@ } } }, - "unstable_TreeNode": { + "TreeNode": { "description": "", "displayName": "TreeNode", "props": { diff --git a/src/data/nav-items.yaml b/src/data/nav-items.yaml index 425d36119d3..84b80f77f33 100644 --- a/src/data/nav-items.yaml +++ b/src/data/nav-items.yaml @@ -198,6 +198,8 @@ path: /patterns/empty-states-pattern/ - title: Filtering path: /patterns/filtering/ + - title: Fluid styles + path: /patterns/fluid-styles/ - title: Forms path: /patterns/forms-pattern/ - title: Global header diff --git a/src/pages/all-about-carbon/releases.mdx b/src/pages/all-about-carbon/releases.mdx index e801b5974fb..d3dae487e03 100755 --- a/src/pages/all-about-carbon/releases.mdx +++ b/src/pages/all-about-carbon/releases.mdx @@ -15,22 +15,22 @@ planned for Carbon’s future. ## Resources - - - - - - - - -![ZenHub icon](images/z-icon.svg) - - - + + + + + + + + + + ## Releases diff --git a/src/pages/components/UI-shell-header/images/header-accessibility-1.png b/src/pages/components/UI-shell-header/images/header-accessibility-1.png index 83a7345ba18..06f130bc743 100644 Binary files a/src/pages/components/UI-shell-header/images/header-accessibility-1.png and b/src/pages/components/UI-shell-header/images/header-accessibility-1.png differ diff --git a/src/pages/components/UI-shell-header/images/header-accessibility-4.png b/src/pages/components/UI-shell-header/images/header-accessibility-4.png index bd722b69bbb..37fb8805ba6 100644 Binary files a/src/pages/components/UI-shell-header/images/header-accessibility-4.png and b/src/pages/components/UI-shell-header/images/header-accessibility-4.png differ diff --git a/src/pages/components/UI-shell-header/images/header-accessibility-5.png b/src/pages/components/UI-shell-header/images/header-accessibility-5.png index e8f5dcfd4c5..9659b47e1c2 100644 Binary files a/src/pages/components/UI-shell-header/images/header-accessibility-5.png and b/src/pages/components/UI-shell-header/images/header-accessibility-5.png differ diff --git a/src/pages/components/button/usage.mdx b/src/pages/components/button/usage.mdx index d989c17a760..3b3300573f6 100755 --- a/src/pages/components/button/usage.mdx +++ b/src/pages/components/button/usage.mdx @@ -323,20 +323,20 @@ button locations include: | _Right-justified_ | Inline notifications, inline field buttons and data tables, progressive forms, wizards, and single-button dialogs | | _Full-span_ | Dialogs, side panels, and small tiles; currently Carbon does not offer a way to implement full-span buttons in code, without an override, they max out at 320px | -#### Fluid versus fixed buttons +#### Fluid versus default buttons Button alignment is also closely related to whether the button is treated as a -fixed or a fluid element within a layout. When we say “fluid”, we mean that the -button becomes a part of a larger, compound component by bleeding to two or more -edges of its container. Rather than defining the a fluid button’s width in +default or a fluid element within a layout. When we say “fluid”, we mean that +the button becomes a part of a larger, compound component by bleeding to two or +more edges of its container. Rather than defining the a fluid button’s width in columns or mini units, its width is defined as a percentage (often 50%) of the -container’s width. Also, as a general rule, fluid buttons are never left-aligned -in a layout or a container—they’re always either right-aligned, or span the full -width of the container. +container’s width. Also, as a general rule, fluid primary buttons are never +left-aligned in a layout or a container—they’re always either right-aligned, or +span the full width of the container. Fluid components like button never exist in isolation. As you can see in the examples above, they are always part of another component, like modal or form. -Other fluid components include tiles and most recently, +Other fluid components include tiles and most recently, form inputs such as [text inputs](/components/text-input/usage). @@ -384,15 +384,20 @@ recommended feature to improve accessibility. -#### Using the grid +#### Fluid-width default buttons -By default the container’s width is set to the size of the text label with 64px -fixed padding on the right side and 16px fixed padding on the left. However, -when possible set the button container’s relative position to the responsive -layout grid and match button width to the other elements on the page. Ideally, -when using groups of related buttons (not including ghost buttons), they should -all be the same width. See [button groups](#Button-groups) below for more -detailed information. +The default button’s width is set to the size of the text label with 64px fixed +padding on the right side and 16px fixed padding on the left. However, there is +a hybrid scenario where a floating default-style button can span a designated +number of columns on the responsive column grid, giving it a fluid width. These +are called "fluid-width default buttons." + +Fluid-width default buttons are always preferable to fixed-width default buttons +in a layout. When possible set the default button container’s relative position +to the responsive layout grid and match button width to the width of other +elements on the page. Ideally, when using groups of related buttons (not +including ghost buttons), they should all be the same width. See button groups +below for more detailed information. @@ -523,15 +528,15 @@ button groups are also common in products, to save real estate in narrow columns and occasionally side panels. In these instances, the primary button is always on top and the secondary or tertiary button is below. -Generally, when designers stack buttons, they tend to use the fixed buttons. -However, stacked fluid buttons are also an option in desktop side panels with -especially long calls to action. _Note: experimenting with stacked fluid buttons -would require an override to the existing code._ +Generally, when designers stack buttons, they tend to use the hybrid fluid +buttons. However, stacked fluid buttons are also an option in desktop side +panels with especially long calls to action. Note: experimenting with stacked +fluid buttons would require an override to the existing code. -![Fluid and fixed stacked button group examples](images/button_usage_24.png) +![Fluid and default stacked button group examples](images/button_usage_24.png) diff --git a/src/pages/components/content-switcher/accessibility.mdx b/src/pages/components/content-switcher/accessibility.mdx index ff81a42d32e..2f30ef81be4 100644 --- a/src/pages/components/content-switcher/accessibility.mdx +++ b/src/pages/components/content-switcher/accessibility.mdx @@ -2,90 +2,111 @@ title: Content switcher description: Content switchers manipulate the content shown following an exclusive or - “either/or” pattern. It is used to toggle between two or more content sections + "either/or" pattern. It is used to toggle between two or more content sections within the same space on screen. tabs: ['Usage', 'Style', 'Code', 'Accessibility'] --- -The content switcher React Carbon component has been tested against the latest -[W3C Web Content Accessibility Guidelines (WCAG) 2.1 Level A and AA success criteria](https://www.w3.org/TR/WCAG21/) -and violations have been identified as high priority issues. This document will -be updated when these accessibility issues are resolved. +Design annotations are needed for specific instances shown below, but for the +standard content switcher component, Carbon already incorporates accessibility. - Accessibility considerations - Resources - Accessibility testing + What Carbon provides + Design recommendations + Development considerations -## Accessibility considerations +## What Carbon provides -1. Each content switcher tab must have a unique title that clearly describes the - content panel. This is particularly helpful for users of assistive - technologies so they have the necessary information to efficiently navigate - the content. -2. Carbon components should be used to create the content that displays within - each content panel. -3. Content authors need to ensure the content that is added to the tab panel is - accessible. For example, if you add an image to the panel you need to include - alternative text to pass accessibility testing. +Carbon bakes keyboard operation into its components, improving the experience of +blind users and others who operate via the keyboard. Carbon incorporates many +other accessibility considerations, some of which are described below. -## Resources +### Keyboard interactions -- [W3C WAI-ARIA Tab Design Pattern](https://www.w3.org/TR/wai-aria-practices-1.1/#tabpanel) - covers the usage of ARIA names, state and roles, as well as the expected - keyboard interactions. -- [IBM Accessibility Requirements](https://www.ibm.com/able/requirements/requirements/): +Like tabs, content switchers can be automatic or manual. In both instances, the +content switcher takes one tab stop, and arrow keys are used to navigate between +content tabs. - - [1.3.1 Info and Relationships](https://www.ibm.com/able/requirements/requirements/#1_3_1) - (WCAG Success Criteria - [1.3.1](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships)) - - [1.3.2 Meaningful Sequence](https://www.ibm.com/able/requirements/requirements/#1_3_2) - (WCAG Success Criteria - [1.3.2](https://www.w3.org/WAI/WCAG21/Understanding/meaningful-sequence)) + + + +![A user tabs to the content switcher then changes the selection with left and right arrow keys. Pressing tab again moves focus to a link inside the section's content.](images/content-switcher-accessibility-1.png) + + + Manual and automatic content switchers have the same basic keyboard + interaction. + + + + + +Automatic and manual switchers differ in how they are activated. The following +illustration shows what will happen for each variant when a right arrow key is +pressed with the All content tab selected and focused. + +For automatic switchers, focus and selection are synchronized. When the user +arrows to a tab, it is selected and the content section under the switcher is +updated in real time. + +Manual switchers allow the user to arrow between the content tabs without +updating the content section underneath. When the user right arrows, the All +content tab remains selected while focus moves to the Read tab. In order to +select the Read tab (and update the content section under the switcher) the user +would press `Enter` or `Space`. + + + -## Accessibility testing +![Two variants of a content switcher with tabs called All, Read and Unread. In the first, the Read tab is selected and focused. In the second the All tab is selected and the Read tab has a focus indicator](images/content-switcher-accessibility-2.png) -Automated, manual and screen reader accessibility verification test has been -performed on the Content Switcher React Carbon Component. -[WCAG 2.1 Level A and AA success criteria](https://www.w3.org/TR/WCAG21/) issues -have been identified and the list of open accessibility violations is available -in the Carbon Component GitHub repository. + + Arrows keys alone update the selected tab in an automatic content switcher. + The Space and Enter keys are used to select a content tab after arrowing to it + in a manual variant. + -### Automated test + + + +## Design recommendations + +### Indicate which variant to implement + +The automatic and manual switchers are visually indistinguishable in a +wireframe, so designers should annotate which variant the team has decided to +implement. Since the choice largely concerns technical considerations about +potential latency when updating the content section’s information, architects or +developers should be involved in the discussion. - - - - - - Automated test environment - - Results - - - - - - - macOS Mojave version 10.14.2 with VoiceOver -
- - Chrome version 77.0.3865.90 -
- - Dynamic Assessment Plugin (DAP) version 1.8.0.0 - IBM - Accessibility WCAG 2.1 Sept. 2019 Ruleset -
- Carbon React version 7.7.1 -
- - DAP test: -
- Violations -
-
-
-
-
+ + +![Two content switchers, one with a pink annotation reading "auto", the other with an annotation "manual"](images/content-switcher-accessibility-3.png) + + + Annotate whether the switcher should be implemented as automatic or manual. + + +
+ +## Development considerations + +Keep these considerations in mind if you are modifying Carbon or creating a +custom component. + +- The Content switcher is implemented as a `tablist`, with each content tab + implemented as a `