Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update code snippet and data table accessibility tabs #2786

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions src/pages/components/code-snippet/accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ import {

<PageDescription>

No accessibility annotations are needed for code snippets, but keep these considerations in mind if you’re modifying Carbon or creating a custom component.
No accessibility annotations are needed for code snippets, but keep these
considerations in mind if you’re modifying Carbon or creating a custom
component.

</PageDescription>

<AnchorLinks>
<AnchorLink>What Carbon provides</AnchorLink>
<AnchorLink>Developer considerations</AnchorLink>
<AnchorLink>Development considerations</AnchorLink>
</AnchorLinks>

## What Carbon provides
Expand All @@ -35,8 +37,8 @@ accessibility considerations.

### Keyboard interaction

For all three variants, the code snippet can be copied with `Space` or `Enter`. Arrow
keys can operate scroll bars.
For all three variants, the code snippet can be copied with `Space` or `Enter`.
Arrow keys can operate scroll bars.

<Row>
<Column colLg={8}>
Expand All @@ -46,7 +48,8 @@ keys can operate scroll bars.
</Column>
</Row>

By default, each inline code snippet is reachable by `Tab` and copied with `Space` or `Enter`.
By default, each inline code snippet is reachable by `Tab` and copied with
`Space` or `Enter`.

<Row>
<Column colLg={8}>
Expand All @@ -56,7 +59,8 @@ By default, each inline code snippet is reachable by `Tab` and copied with `Spac
</Column>
</Row>

The single line code snippet tabstop supports left and right arrow key scrolling.
The single line code snippet tabstop supports left and right arrow key
scrolling.

<Row>
<Column colLg={8}>
Expand All @@ -66,13 +70,14 @@ The single line code snippet tabstop supports left and right arrow key scrolling
</Column>
</Row>

The multi-line’s buttons are reachable by `Tab` and activated with `Space` or `Enter`.
The multi-line’s buttons are reachable by `Tab` and activated with `Space` or
`Enter`.

### Labeling and updates

Carbon provides the copy button's default label and tooltip behavior. Carbon
handles notices about the success of the copy function, as well as updates to the
Show more mechanism.
handles notices about the success of the copy function, as well as updates to
the Show more mechanism.

<Row>
<Column colLg={8}>
Expand All @@ -94,9 +99,9 @@ The code snippet’s buttons expose their labels on hover or focus.

The results of activating buttons are provided in text.

## Developer considerations
## Development considerations

Keep this in mind if you’re modifying Carbon or creating a custom component:

* the inline code text is implemented as a button so its text can be copied
* single line snippets take an additional tabstop to support arrow key scrolling
- the inline code text is implemented as a button so its text can be copied
- single line snippets take an additional tabstop to support arrow key scrolling
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 33 additions & 16 deletions src/pages/components/data-table/accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,29 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']

<PageDescription>

Design annotations are needed for specific instances shown below, but for the standard data table component, Carbon already incorporates accessibility.
Design annotations are needed for specific instances shown below, but for the
standard data table component, Carbon already incorporates accessibility.

</PageDescription>

<AnchorLinks>
<AnchorLink>What Carbon provides</AnchorLink>
<AnchorLink>Design annotations</AnchorLink>
<AnchorLink>Developer considerations</AnchorLink>
<AnchorLink>Design recommendations</AnchorLink>
<AnchorLink>Development considerations</AnchorLink>
</AnchorLinks>

## What Carbon provides

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.
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.

### Keyboard interaction

There are three data table variants with different interactions. Optional features like column sorting can appear in any of the variants. Table [pagination](https://www.carbondesignsystem.com/components/pagination/usage/) is treated as a separate component.
There are three data table variants with different interactions. Optional
features like column sorting can appear in any of the variants. Table
[pagination](https://www.carbondesignsystem.com/components/pagination/usage/) is
treated as a separate component.

<Row>
<Column colLg={8}>
Expand All @@ -34,11 +40,15 @@ There are three data table variants with different interactions. Optional featur
</Column>
</Row>

For sortable tables, the column headers are reachable by `Tab` and sortable with `Space` or `Enter`.
For sortable tables, the column headers are reachable by `Tab` and sortable with
`Space` or `Enter`.

### Controls inside tables

Any interactive controls in data cells are in the tab order and maintain normal keyboard operation. This also applies to expandable table rows, which operate in the same manner as [accordions](https://www.carbondesignsystem.com/components/accordions/usage/)
Any interactive controls in data cells are in the tab order and maintain normal
keyboard operation. This also applies to expandable table rows, which operate in
the same manner as
[accordions](https://www.carbondesignsystem.com/components/accordions/usage/)

<Row>
<Column colLg={8}>
Expand All @@ -48,11 +58,13 @@ Any interactive controls in data cells are in the tab order and maintain normal
</Column>
</Row>

Links, inputs, and other interactive controls inside tables operate by keyboard as normal.
Links, inputs, and other interactive controls inside tables operate by keyboard
as normal.

### Labelling and updates
### Labeling and updates

If columns are sortable, the sort symbols appear on hover or focus. A sorted column retains an indicator until it is no longer sorted.
If columns are sortable, the sort symbols appear on hover or focus. A sorted
column retains an indicator until it is no longer sorted.

<Row>
<Column colLg={8}>
Expand All @@ -62,11 +74,14 @@ If columns are sortable, the sort symbols appear on hover or focus. A sorted col
</Column>
</Row>

Sort indicators appear on hover and focus. A sorted column is indicated visually.
Sort indicators appear on hover and focus. A sorted column is indicated
visually.

## Design annotations
## Design recommendations

Since there is no persistent visual indicator that a table is sortable, designers need to annotate if a table should be implemented with sortable column headers.
Since there is no persistent visual indicator that a table is sortable,
designers need to annotate if a table should be implemented with sortable column
headers.

<Row>
<Column colLg={8}>
Expand All @@ -78,9 +93,11 @@ Since there is no persistent visual indicator that a table is sortable, designer

Annotate if a table is sortable.

## Developer considerations
## Development considerations

Keep this in mind if you’re modifying Carbon or creating a custom component:

* Column sorting indicators are matched programmatically using `aria-sort`
* See the [ARIA authoring practices](https://www.w3.org/TR/wai-aria-practices-1.2/#table) for more considerations
- Column sorting indicators are matched programmatically using `aria-sort`
- See the
[ARIA authoring practices](https://www.w3.org/TR/wai-aria-practices-1.2/#table)
for more considerations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.