Skip to content

Commit

Permalink
Merge branch 'main' into carbon-tutorial-web-components
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase authored Nov 20, 2024
2 parents c51e610 + 36ba86e commit 0b7746c
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 73 deletions.
8 changes: 8 additions & 0 deletions src/data/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,14 @@
"testing": {
"screenreader": "manual"
}
},
{
"component": "Menu button",
"parentComponent": "Menu buttons",
"overview": false,
"testing": {
"screenreader": "manual"
}
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 24 additions & 17 deletions src/pages/components/dropdown/accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ each variant.

#### Dropdown

The default dropdown opens with `Enter`, `Space`, or `Down arrow`, with focus
moving to the currently selected option. Arrow keys change options, and any
option with focus is selected with `Space` or `Enter`, which also closes the
The default dropdown opens with `Enter`, `Space`, or `Down arrow`. If an option
is already selected or if `Down arrow` is used to open the component, the focus
moves to the first or currently selected option. Arrow keys change options, and
any option with focus is selected with `Space` or `Enter`, which also closes the
dropdown. Pressing `Esc` or `Tab` closes a dropdown without changing the
selected option.

Expand All @@ -72,11 +73,14 @@ selected option.

#### Multiselect

The multiselect opens with the `Enter` or `Space` keys, which are also used to
toggle the selection of any option. Once items are selected, a tag appears in
the field, showing a numerical representation of the number of items selected
along with an ‘x’. Pressing `Esc` closes the multiselect. Pressing `Delete`
while focus is in the collapsed field will clear all selected options.
The multiselect opens with `Down arrow`, or with the `Enter` or `Space` keys,
which are also used to toggle the selection of any option. Focus handling is the
same as with the default dropdown: focus is only moved to the options list if an
item is already selected or if the multiselect is opened with the `Down arrow`.
Once items are selected, a tag appears in the field, showing a numerical
representation of the number of items selected along with an ‘x’. Pressing `Esc`
closes the multiselect. Pressing `Delete` while focus is in the collapsed field
will clear all selected options.

<Row>
<Column colLg={8}>
Expand All @@ -93,15 +97,18 @@ while focus is in the collapsed field will clear all selected options.

#### Combo box

The combo box's operation is quite different, since it is a combination of a
text input and a dropdown. `Enter` or the `Up` or `Down` arrow keys will open
the list of options, as will typing any character or string of characters (which
will also filter the list to only show items that match the typed string).
Pressing `Esc` will clear the input and collapse the list. Pressing `Enter` will
select a highlighted option and collapse the list. (If nothing is highlighted in
the list, pressing `Enter` will toggle the combo box open and closed.) `Space`
cannot be used for selecting, as pressing it will submit a space character into
the filter string.
The combo box’s operation (as well as the filterable multiselect's) is quite
different, since it is a combination of a text input and a dropdown. `Enter` or
the `Up` or `Down arrow` keys will open the list of options, as will typing any
matching character or string of characters (which will also filter the list to
only show items that match the typed string). Focus handling in the options list
is similar to the default dropdown: focus is only moved to the options list if
an item is already selected, a matching string is entered, or if opened with an
arrow key. Pressing `Esc` will collapse the list or clear the typed string.
Pressing `Enter` will select a highlighted option and collapse the list. (If
nothing is highlighted in the list, pressing `Enter` will toggle the combo box
open and closed.) `Space` cannot be used for selecting, as pressing it will
submit a space character into the filter string.

<Row>
<Column colLg={8}>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/pages/components/dropdown/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,25 @@ boxes are useful when the data populating the list may come from a database.
</Column>
</Row>

#### Entering a custom value

In a combo box, users can type in a custom or unique value that is not included
in the list of predefined options.

- If the desired option isn’t available in the list, users can start typing
their custom value directly in the field, filtering out options as they type.
- To save the new custom value, click outside the field with the mouse or press
`Tab` or `Enter` on the keyboard.
- Once saved, the placeholder text changes to display the custom typed value.

<Row>
<Column colLg={8}>

![Entering a custom value in a default combo box.](images/dropdown-usage-11d.png)

</Column>
</Row>

## Modifiers

#### Inline
Expand Down
5 changes: 4 additions & 1 deletion src/pages/components/menu-buttons/accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,7 @@ custom component.
- When the combo button menu is open, the element (`div`) wrapping the entire
combo button is given `aria-owns` with a value of the menu `id`.

<A11yStatus layout="table" components="Menu buttons" />
<A11yStatus
layout="table"
components={['Menu button', 'Combo button', 'Overflow menu']}
/>
5 changes: 4 additions & 1 deletion src/pages/components/menu-buttons/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ menu with a list of interactive options.
]}
/>

<A11yStatus layout="cards" components="Menu buttons" />
<A11yStatus
layout="cards"
components={['Menu button', 'Combo button', 'Overflow menu']}
/>

## Overview

Expand Down
18 changes: 18 additions & 0 deletions src/pages/components/notification/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ description:
tabs: ['Usage', 'Style', 'Code', 'Accessibility']
---

import { Tag } from '@carbon/react';

<PageDescription>

Preview the notification component with the React live demo. For detailed code
Expand All @@ -23,6 +25,7 @@ usage documentation, see the Storybooks for each framework below.
>

<MdxIcon name="react" />
<Tag type="blue">Feature flag</Tag>

</ResourceCard>
</Column>
Expand Down Expand Up @@ -58,6 +61,21 @@ usage documentation, see the Storybooks for each framework below.
</Column>
</Row>

### Feature flags

A [feature flag](/components/overview/feature-flags/) has been added to the
actionable notification variant to improve accessibility and changes parts of
its functionality, not its visual appearance. For more code-specific feature
flag information, refer to the
[@carbon/react](https://react.carbondesignsystem.com/?path=/docs/components-notifications-actionable-feature-flag--flag-details)
framework.

The `enable-experimental-focus-wrap-without-sentinels` flag is a new approach to
focus wrap behavior, modifying the DOM to no longer include hidden "sentinel
nodes" that previously marked the beginning and end of the wrapped focus. This
behavior considers all interactive child nodes and wraps focus based on their
tab order.

## Live demo

<StorybookDemo
Expand Down
13 changes: 13 additions & 0 deletions src/pages/components/notification/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']
---

import A11yStatus from 'components/A11yStatus';
import { Tag } from '@carbon/react';

<PageDescription>

<Tag type="blue">Feature flag</Tag>

Notifications are messages that communicate information to the user. The four
variants of notifications are toast, inline, actionable, and callout.

Expand Down Expand Up @@ -85,6 +88,16 @@ although some product teams also support banners and notification centers.
| [Actionable](#actionable) | Actionable notifications allow for interactive elements within a notification styled like an inline or toast notification. |
| [Callout](#callout) | Callouts are used to highlight important information that loads with the contents of the page, is placed contextually, and cannot be dismissed. |

### Feature flags

A [feature flag](/components/overview/feature-flags/) has been added to the
actionable notification variant to improve accessibility and changes parts of
its functionality, not its visual appearance. For code-specific feature flag
information, refer to the [Code](/components/notification/code/) tab. The
current actionable notification is not being deprecated, but teams are
encouraged to use the feature flag notification for their products moving
forward.

## Formatting

### Anatomy
Expand Down
Loading

0 comments on commit 0b7746c

Please sign in to comment.