Skip to content

Commit 7ce1a0c

Browse files
authored
Merge branch 'main' into 16994-inconsistent-focus-for-nested-menu-items
2 parents 19b8faf + e3a8267 commit 7ce1a0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+846
-359
lines changed

.github/renovate.json5

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111

1212
// https://docs.renovatebot.com/presets-npm/#npmunpublishsafe
1313
'npm:unpublishSafe',
14-
15-
// https://docs.renovatebot.com/presets-schedule/#scheduledaily
16-
'schedule:every weekday',
1714
],
15+
"schedule": [
16+
"after 10pm every weekday",
17+
"before 5am every weekday",
18+
"every weekend"
19+
]
1820
vulnerabilityAlerts: {
1921
enabled: true,
2022
},

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2121
- name: Use Node.js 20.x
22-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
22+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
2323
with:
2424
node-version: '20.x'
2525
- name: Run yarn dedupe
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3232
- name: Use Node.js 20.x
33-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
33+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
3434
with:
3535
node-version: '20.x'
3636
- name: Install dependencies
@@ -43,7 +43,7 @@ jobs:
4343
steps:
4444
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4545
- name: Use Node.js 20.x
46-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
46+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
4747
with:
4848
node-version: '20.x'
4949
- name: Install dependencies
@@ -58,7 +58,7 @@ jobs:
5858
steps:
5959
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
6060
- name: Use Node.js 20.x
61-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
61+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
6262
with:
6363
node-version: '20.x'
6464
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
@@ -85,7 +85,7 @@ jobs:
8585
steps:
8686
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
8787
- name: Use Node.js 20.x
88-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
88+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
8989
with:
9090
node-version: '20.x'
9191
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
@@ -125,7 +125,7 @@ jobs:
125125
steps:
126126
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
127127
- name: Use Node.js 20.x
128-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
128+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
129129
with:
130130
node-version: '20.x'
131131
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
@@ -188,7 +188,7 @@ jobs:
188188
steps:
189189
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
190190
- name: Use Node.js 20.x
191-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
191+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
192192
with:
193193
node-version: '20.x'
194194
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2

.github/workflows/deploy-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
repository: carbon-design-system/design-language-website
2222
ref: master
2323
- name: Use Node.js 20.x
24-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
24+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
2525
with:
2626
node-version: '20.x'
2727
registry-url: 'https://registry.npmjs.org'
@@ -63,7 +63,7 @@ jobs:
6363
repository: carbon-design-system/gatsby-theme-carbon
6464
ref: main
6565
- name: Use Node.js 20.x
66-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
66+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
6767
with:
6868
node-version: '20.x'
6969
registry-url: 'https://registry.npmjs.org'

.github/workflows/deploy-react-storybook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
3232
- name: Use Node.js 20.x
33-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
33+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
3434
with:
3535
node-version: '20.x'
3636
- name: Install dependencies

.github/workflows/nightly-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1717
- name: Use Node.js 20.x
18-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
18+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
1919
with:
2020
node-version: '20.x'
2121
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2222

2323
- name: Use Node.js 20.x
24-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
24+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
2525
with:
2626
node-version: '20.x'
2727
registry-url: 'https://registry.npmjs.org'

.github/workflows/sync-generated-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1111
- name: Use Node.js 20.x
12-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
12+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
1313
with:
1414
node-version: '20.x'
1515
- name: Install dependencies

.github/workflows/v10-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1717

1818
- name: Use Node.js 20.x
19-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
19+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
2020
with:
2121
node-version: '20.x'
2222
- name: Run yarn dedupe
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
ref: v10
3131
- name: Use Node.js 20.x
32-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
32+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
3333
with:
3434
node-version: '20.x'
3535
- name: Install dependencies
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
ref: v10
4646
- name: Use Node.js 20.x
47-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
47+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
4848
with:
4949
node-version: '20.x'
5050
- name: Install dependencies
@@ -61,7 +61,7 @@ jobs:
6161
with:
6262
ref: v10
6363
- name: Use Node.js 20.x
64-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
64+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
6565
with:
6666
node-version: '20.x'
6767
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
@@ -89,7 +89,7 @@ jobs:
8989
with:
9090
ref: v10
9191
- name: Use Node.js 20.x
92-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
92+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
9393
with:
9494
node-version: '20.x'
9595
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2

.github/workflows/v10-deploy-react-storybook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2020

2121
- name: Use Node.js 20.x
22-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
22+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
2323
with:
2424
node-version: '20.x'
2525
- name: Install dependencies

.github/workflows/v10-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2020

2121
- name: Use Node.js 20.x
22-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
22+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
2323
with:
2424
node-version: '20.x'
2525
registry-url: 'https://registry.npmjs.org'

.github/workflows/version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
fetch-depth: '0'
3434
- name: Use Node.js 20.x
35-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
35+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3
3636
with:
3737
node-version: '20.x'
3838
registry-url: 'https://registry.npmjs.org'
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.

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,8 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
297297
<td align="center"><a href="https://github.com/nandininarayanofficial"><img src="https://avatars.githubusercontent.com/u/165769075?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nandininarayanofficial</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=nandininarayanofficial" title="Code">💻</a></td>
298298
<td align="center"><a href="https://github.com/digiacomo-a"><img src="https://avatars.githubusercontent.com/u/117646602?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrea DG</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=digiacomo-a" title="Code">💻</a></td>
299299
<td align="center"><a href="https://github.com/lluisrojass"><img src="https://avatars.githubusercontent.com/u/15043356?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Luis</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=lluisrojass" title="Code">💻</a></td>
300-
301300
<td align="center"><a href="https://github.com/lharrison13"><img src="https://avatars.githubusercontent.com/u/172074450?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Luke Harrison</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=lharrison13" title="Code">💻</a></td>
302-
303301
<td align="center"><a href="https://github.com/tekno0ryder"><img src="https://avatars.githubusercontent.com/u/8721803?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ahmed Alsinan</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=tekno0ryder" title="Code">💻</a></td>
304-
305302
</tr>
306303
</table>
307304

achecker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
const path = require('path');
1111

1212
module.exports = {
13-
ruleArchive: 'latest',
13+
ruleArchive: '17June2024',
1414
policies: ['Custom_Ruleset'],
1515
failLevels: ['violation'],
1616
reportLevels: [

docs/migration/v11.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,3 +2136,11 @@ were importing `@carbon/type/scss/styles` in v10 you would now only import
21362136
| | display-02 | fluid-display-02 | Updated |
21372137
| | display-03 | fluid-display-03 | Updated |
21382138
| | display-04 | fluid-display-04 | Updated |
2139+
2140+
When applying a fluid token with the `type-style()` mixin, you'll need to pass a
2141+
second parameter to indicate it's a fluid token:
2142+
2143+
```diff
2144+
- @include type.type-style('expressive-heading-04');
2145+
+ @include type.type-style('fluid-heading-04', true);
2146+
```

packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,16 @@ Map {
12781278
"disabled": Object {
12791279
"type": "bool",
12801280
},
1281+
"downshiftActions": Object {
1282+
"args": Array [
1283+
Object {
1284+
"current": Object {
1285+
"type": "any",
1286+
},
1287+
},
1288+
],
1289+
"type": "exact",
1290+
},
12811291
"downshiftProps": Object {
12821292
"type": "object",
12831293
},
@@ -7717,6 +7727,9 @@ Map {
77177727
"onKeyDown": Object {
77187728
"type": "func",
77197729
},
7730+
"rel": Object {
7731+
"type": "string",
7732+
},
77207733
"tabIndex": Object {
77217734
"type": "number",
77227735
},

packages/react/src/components/ComboBox/ComboBox.mdx

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,64 @@ next element.
4949
<Combobox disabled />
5050
```
5151

52-
## Combobox `downshiftProps`
52+
## Combobox uses Downshift
5353

5454
Our `Combobox` component utilizes [Downshift](https://www.downshift-js.com/)
5555
under the hood to help provide complex yet accessible custom dropdown
56-
components. We provide access to the built in Downshift features with this prop.
56+
components.
5757

58-
Use with caution: anything you define here overrides the components' internal
59-
handling of that prop. Downshift internals are subject to change, and in some
60-
cases they can not be shimmed to shield you from potentially breaking changes.
58+
### `downshiftProps`
6159

62-
For more information, checkout the Downshift prop
63-
[documentation](https://www.downshift-js.com/downshift#props-used-in-examples)
60+
`downshiftProps` is made available as a passthrough to the underlying downshift
61+
`useCombobox` hook.
62+
63+
**Use with caution:** anything you define here overrides the components'
64+
internal handling of that prop. Downshift internals are subject to change, and
65+
in some cases they can not be shimmed to shield you from potentially breaking
66+
changes.
67+
68+
For more information, checkout the Downshift `useCombobox` props
69+
[documentation](https://github.com/downshift-js/downshift/tree/v9.0.7/src/hooks/useCombobox#basic-props)
70+
71+
### Combobox `downshiftActions`
72+
73+
The downshift action methods are made available through the `downshiftActions`
74+
prop. While not recommended, this prop allows you to modify downshift's internal
75+
state without having to fully control the component.
76+
77+
**Use with caution:** calling these actions modifies the internal state of
78+
downshift. It may conflict with or override the state management used within
79+
Combobox. Downshift APIs and internals are subject to change, and in some cases
80+
they can not be shimmed by Carbon to shield you from potentially breaking
81+
changes.
82+
83+
#### `downshiftActions` Usage
84+
85+
Provide a ref that will be mutated to contain an object of downshift action
86+
functions. These can be called to change the internal state of the downshift
87+
useCombobox hook.
88+
89+
```
90+
const downshiftActions = useRef();
91+
92+
return (
93+
<ComboBox
94+
...
95+
downshiftActions={downshiftActions}
96+
downshiftProps={{
97+
onStateChange: (changes) => {
98+
if (changes.selectedItem === null) {
99+
downshiftActions?.current?.openMenu?.();
100+
return;
101+
}
102+
},
103+
}}
104+
/>
105+
);
106+
```
107+
108+
For more information, checkout the Downshift `useCombobox` action functions
109+
[documentation](https://github.com/downshift-js/downshift/tree/v9.0.7/src/hooks/useCombobox#actions)
64110

65111
## Placeholders and Labeling
66112

packages/react/src/components/ComboBox/ComboBox.stories.js

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import React from 'react';
8+
import React, { useRef } from 'react';
99

1010
import { WithLayer } from '../../../.storybook/templates/WithLayer';
1111

@@ -65,6 +65,42 @@ export default {
6565
},
6666
};
6767

68+
export const DownshiftActionsTest = () => {
69+
const downshiftActions = useRef();
70+
71+
return (
72+
<div style={{ width: 300 }}>
73+
<ComboBox
74+
onChange={() => {}}
75+
id="carbon-combobox"
76+
items={items}
77+
itemToString={(item) => (item ? item.text : '')}
78+
titleText="ComboBox title"
79+
helperText="Combobox helper text"
80+
downshiftActions={downshiftActions}
81+
downshiftProps={{
82+
onStateChange: (changes) => {
83+
console.log('onStateChange changes', changes);
84+
85+
if (changes.selectedItem === null) {
86+
downshiftActions?.current?.openMenu?.();
87+
return;
88+
}
89+
if (changes?.isOpen && changes?.inputValue === 'Option 1') {
90+
downshiftActions?.current?.setInputValue?.('');
91+
return;
92+
}
93+
if (!changes?.isOpen && changes?.inputValue !== 'Option 1') {
94+
downshiftActions?.current?.setInputValue?.('Option 1');
95+
return;
96+
}
97+
},
98+
}}
99+
/>
100+
</div>
101+
);
102+
};
103+
68104
export const Default = () => (
69105
<div style={{ width: 300 }}>
70106
<ComboBox

0 commit comments

Comments
 (0)