@sproutsocial/seeds-react-menu 1.16.16 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +14 -14
- package/CHANGELOG.md +21 -0
- package/dist/esm/v3/index.js +90 -56
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/v3/index.d.mts +18 -0
- package/dist/v3/index.d.ts +18 -0
- package/dist/v3/index.js +90 -56
- package/dist/v3/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ActionMenu/ActionMenu.stories.tsx +1 -1
- package/src/Autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/MenuContent/MenuContent.stories.tsx +1 -1
- package/src/MenuFooter/MenuFooter.stories.tsx +1 -1
- package/src/MenuGroup/MenuGroup.stories.tsx +1 -1
- package/src/MenuHeader/MenuHeader.stories.tsx +1 -1
- package/src/MenuItem/MenuItem.stories.tsx +1 -1
- package/src/MenuToggleButton/MenuToggleButton.stories.tsx +1 -1
- package/src/MultiSelectMenu/MultiSelectMenu.stories.tsx +1 -1
- package/src/NestedMenu/NestedMenu.stories.tsx +1 -1
- package/src/SingleSelectMenu/SingleSelectMenu.stories.tsx +1 -1
- package/src/SubmenuItem/SubmenuItem.stories.tsx +1 -1
- package/src/v2/Autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/v2/Select/Select.stories.tsx +1 -1
- package/src/v3/ActionMenu.stories.tsx +1 -1
- package/src/v3/MenuButton.stories.tsx +1 -1
- package/src/v3/ModalStories.stories.tsx +1 -1
- package/src/v3/MultiCombobox.stories.tsx +1 -1
- package/src/v3/MultiCombobox.tsx +7 -0
- package/src/v3/MultiSearchableSelect.stories.tsx +1 -1
- package/src/v3/MultiSearchableSelect.tsx +7 -0
- package/src/v3/MultiSelect.stories.tsx +1 -1
- package/src/v3/MultiSelect.tsx +9 -1
- package/src/v3/SingleCombobox.stories.tsx +1 -1
- package/src/v3/SingleCombobox.tsx +7 -0
- package/src/v3/SingleSearchableSelect.stories.tsx +1 -1
- package/src/v3/SingleSearchableSelect.tsx +7 -0
- package/src/v3/SingleSelect.stories.tsx +1 -1
- package/src/v3/SingleSelect.tsx +9 -1
- package/src/v3/__tests__/ariaLabels.test.tsx +133 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -9,27 +9,27 @@ $ tsup --dts
|
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[32mCJS[39m [1mdist/index.js [22m[32m92.65 KB[39m
|
|
12
|
-
[32mCJS[39m [1mdist/v3/index.js [22m[32m121.51 KB[39m
|
|
13
12
|
[32mCJS[39m [1mdist/v2/index.js [22m[32m73.18 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/v3/index.js [22m[32m123.01 KB[39m
|
|
14
14
|
[32mCJS[39m [1mdist/index.js.map [22m[32m180.28 KB[39m
|
|
15
|
-
[32mCJS[39m [1mdist/v3/index.js.map [22m[32m213.07 KB[39m
|
|
16
15
|
[32mCJS[39m [1mdist/v2/index.js.map [22m[32m152.19 KB[39m
|
|
17
|
-
[32mCJS[39m
|
|
18
|
-
[
|
|
19
|
-
[32mESM[39m [1mdist/esm/v3/index.js [22m[32m108.01 KB[39m
|
|
20
|
-
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js [22m[32m9.15 KB[39m
|
|
16
|
+
[32mCJS[39m [1mdist/v3/index.js.map [22m[32m215.51 KB[39m
|
|
17
|
+
[32mCJS[39m ⚡️ Build success in 318ms
|
|
21
18
|
[32mESM[39m [1mdist/esm/v2/index.js [22m[32m62.63 KB[39m
|
|
22
|
-
[32mESM[39m [1mdist/esm/index.js
|
|
23
|
-
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js
|
|
24
|
-
[32mESM[39m [1mdist/esm/
|
|
19
|
+
[32mESM[39m [1mdist/esm/v3/index.js [22m[32m109.51 KB[39m
|
|
20
|
+
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js [22m[32m9.15 KB[39m
|
|
21
|
+
[32mESM[39m [1mdist/esm/index.js [22m[32m73.60 KB[39m
|
|
25
22
|
[32mESM[39m [1mdist/esm/v2/index.js.map [22m[32m132.57 KB[39m
|
|
26
|
-
[32mESM[39m
|
|
23
|
+
[32mESM[39m [1mdist/esm/v3/index.js.map [22m[32m215.56 KB[39m
|
|
24
|
+
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js.map [22m[32m22.93 KB[39m
|
|
25
|
+
[32mESM[39m [1mdist/esm/index.js.map [22m[32m156.29 KB[39m
|
|
26
|
+
[32mESM[39m ⚡️ Build success in 319ms
|
|
27
27
|
[34mDTS[39m Build start
|
|
28
|
-
[32mDTS[39m ⚡️ Build success in
|
|
28
|
+
[32mDTS[39m ⚡️ Build success in 7612ms
|
|
29
29
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.12 KB[39m
|
|
30
30
|
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m5.55 KB[39m
|
|
31
|
-
[32mDTS[39m [1mdist/v3/index.d.ts [22m[
|
|
31
|
+
[32mDTS[39m [1mdist/v3/index.d.ts [22m[32m24.63 KB[39m
|
|
32
32
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m39.12 KB[39m
|
|
33
33
|
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m5.55 KB[39m
|
|
34
|
-
[32mDTS[39m [1mdist/v3/index.d.mts [22m[
|
|
35
|
-
Done in
|
|
34
|
+
[32mDTS[39m [1mdist/v3/index.d.mts [22m[32m24.63 KB[39m
|
|
35
|
+
Done in 9.02s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-menu
|
|
2
2
|
|
|
3
|
+
## 1.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 60f85a0: Adds optional `aria-label` and `aria-labelledby` props to the v3 `SingleSelect`,
|
|
8
|
+
`MultiSelect`, `SingleCombobox`, `MultiCombobox`, `SingleSearchableSelect` and
|
|
9
|
+
`MultiSearchableSelect`, and forwards them to the popup listbox.
|
|
10
|
+
|
|
11
|
+
Base UI's `Select.List` and `Combobox.List` render `role="listbox"` with only an id — they
|
|
12
|
+
never derive a name from the trigger or from `Select.Label` — and these components spread no
|
|
13
|
+
extra props, so the popup listbox had no accessible name and no way for a consumer to give it
|
|
14
|
+
one.
|
|
15
|
+
|
|
16
|
+
That goes unnoticed while the popup is open, because axe exempts a listbox that a
|
|
17
|
+
`role="combobox"` element references through a live `aria-controls`. It surfaces on close:
|
|
18
|
+
Base UI keeps the popup mounted through the exit animation while the trigger has already
|
|
19
|
+
dropped `aria-controls`, leaving the listbox painted, unnamed and unreferenced. axe reports
|
|
20
|
+
that window as `aria-input-field-name` (serious).
|
|
21
|
+
|
|
22
|
+
No change for callers that pass neither prop.
|
|
23
|
+
|
|
3
24
|
## 1.16.16
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -307,6 +307,8 @@ var StyledValue = styled4(Select3.Value)`
|
|
|
307
307
|
function SingleSelect(props) {
|
|
308
308
|
const { id, placeholder, includePlaceholderItem, fullWidth = true } = props;
|
|
309
309
|
const ariaDescribedBy = props["aria-describedby"];
|
|
310
|
+
const ariaLabel = props["aria-label"];
|
|
311
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
310
312
|
const isInvalid = props.isInvalid;
|
|
311
313
|
const isChildrenMode = "children" in props && props.children != null;
|
|
312
314
|
const selectedItemId = props.selectedItemId;
|
|
@@ -380,43 +382,50 @@ function SingleSelect(props) {
|
|
|
380
382
|
),
|
|
381
383
|
/* @__PURE__ */ jsx3(Select3.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx3(SelectPositioner, { sideOffset: 8, alignItemWithTrigger: false, children: /* @__PURE__ */ jsxs2(SelectPopup, { children: [
|
|
382
384
|
/* @__PURE__ */ jsx3(Select3.ScrollUpArrow, {}),
|
|
383
|
-
/* @__PURE__ */ jsx3(
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
385
|
+
/* @__PURE__ */ jsx3(
|
|
386
|
+
Select3.List,
|
|
387
|
+
{
|
|
388
|
+
"aria-label": ariaLabel,
|
|
389
|
+
"aria-labelledby": ariaLabelledBy,
|
|
390
|
+
children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ jsxs2(React4.Fragment, { children: [
|
|
391
|
+
/* @__PURE__ */ jsxs2(SelectGroup, { children: [
|
|
392
|
+
/* @__PURE__ */ jsx3(SelectGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
393
|
+
group.items.map((item) => /* @__PURE__ */ jsx3(
|
|
394
|
+
SelectItem,
|
|
395
|
+
{
|
|
396
|
+
value: String(item.id),
|
|
397
|
+
label: itemToString(item),
|
|
398
|
+
disabled: item.disabled,
|
|
399
|
+
inputType,
|
|
400
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
401
|
+
},
|
|
402
|
+
item.id
|
|
403
|
+
))
|
|
404
|
+
] }),
|
|
405
|
+
index < arr.length - 1 && /* @__PURE__ */ jsx3(SelectSeparator, {})
|
|
406
|
+
] }, group.value)) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
407
|
+
includePlaceholderItem && /* @__PURE__ */ jsx3(
|
|
408
|
+
SelectItem,
|
|
409
|
+
{
|
|
410
|
+
value: null,
|
|
411
|
+
label: placeholder ?? ""
|
|
412
|
+
},
|
|
413
|
+
"placeholder"
|
|
414
|
+
),
|
|
415
|
+
data.map((item) => /* @__PURE__ */ jsx3(
|
|
416
|
+
SelectItem,
|
|
417
|
+
{
|
|
418
|
+
value: String(item.id),
|
|
419
|
+
label: itemToString(item),
|
|
420
|
+
disabled: item.disabled,
|
|
421
|
+
inputType,
|
|
422
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
423
|
+
},
|
|
424
|
+
item.id
|
|
425
|
+
))
|
|
426
|
+
] })
|
|
427
|
+
}
|
|
428
|
+
),
|
|
420
429
|
/* @__PURE__ */ jsx3(Select3.ScrollDownArrow, {})
|
|
421
430
|
] }) }) })
|
|
422
431
|
]
|
|
@@ -447,6 +456,8 @@ var Placeholder = styled5.div`
|
|
|
447
456
|
function MultiSelect(props) {
|
|
448
457
|
const { id, placeholder = "Select...", fullWidth = true } = props;
|
|
449
458
|
const ariaDescribedBy = props["aria-describedby"];
|
|
459
|
+
const ariaLabel = props["aria-label"];
|
|
460
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
450
461
|
const isInvalid = props.isInvalid;
|
|
451
462
|
const isChildrenMode = "children" in props && props.children != null;
|
|
452
463
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -532,10 +543,29 @@ function MultiSelect(props) {
|
|
|
532
543
|
),
|
|
533
544
|
/* @__PURE__ */ jsx4(Select4.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx4(SelectPositioner, { sideOffset: 8, alignItemWithTrigger: false, children: /* @__PURE__ */ jsxs3(SelectPopup, { children: [
|
|
534
545
|
/* @__PURE__ */ jsx4(Select4.ScrollUpArrow, {}),
|
|
535
|
-
/* @__PURE__ */ jsx4(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
546
|
+
/* @__PURE__ */ jsx4(
|
|
547
|
+
Select4.List,
|
|
548
|
+
{
|
|
549
|
+
"aria-label": ariaLabel,
|
|
550
|
+
"aria-labelledby": ariaLabelledBy,
|
|
551
|
+
children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ jsxs3(React5.Fragment, { children: [
|
|
552
|
+
/* @__PURE__ */ jsxs3(SelectGroup, { children: [
|
|
553
|
+
/* @__PURE__ */ jsx4(SelectGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
554
|
+
group.items.map((item) => /* @__PURE__ */ jsx4(
|
|
555
|
+
SelectItem,
|
|
556
|
+
{
|
|
557
|
+
value: String(item.id),
|
|
558
|
+
label: itemToString(item),
|
|
559
|
+
disabled: item.disabled,
|
|
560
|
+
inputType,
|
|
561
|
+
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
562
|
+
renderItem: renderItem ? () => renderItem(item) : void 0
|
|
563
|
+
},
|
|
564
|
+
item.id
|
|
565
|
+
))
|
|
566
|
+
] }),
|
|
567
|
+
index < arr.length - 1 && /* @__PURE__ */ jsx4(SelectSeparator, {})
|
|
568
|
+
] }, group.value)) : data.map((item) => /* @__PURE__ */ jsx4(
|
|
539
569
|
SelectItem,
|
|
540
570
|
{
|
|
541
571
|
value: String(item.id),
|
|
@@ -543,24 +573,12 @@ function MultiSelect(props) {
|
|
|
543
573
|
disabled: item.disabled,
|
|
544
574
|
inputType,
|
|
545
575
|
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
546
|
-
renderItem: renderItem ? () => renderItem(item) :
|
|
576
|
+
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
547
577
|
},
|
|
548
578
|
item.id
|
|
549
579
|
))
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
] }, group.value)) : data.map((item) => /* @__PURE__ */ jsx4(
|
|
553
|
-
SelectItem,
|
|
554
|
-
{
|
|
555
|
-
value: String(item.id),
|
|
556
|
-
label: itemToString(item),
|
|
557
|
-
disabled: item.disabled,
|
|
558
|
-
inputType,
|
|
559
|
-
hidden: removeSelectedItems && value.includes(String(item.id)),
|
|
560
|
-
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
561
|
-
},
|
|
562
|
-
item.id
|
|
563
|
-
)) }),
|
|
580
|
+
}
|
|
581
|
+
),
|
|
564
582
|
/* @__PURE__ */ jsx4(Select4.ScrollDownArrow, {})
|
|
565
583
|
] }) }) })
|
|
566
584
|
]
|
|
@@ -1359,6 +1377,8 @@ function SingleCombobox(props) {
|
|
|
1359
1377
|
fullWidth = true
|
|
1360
1378
|
} = props;
|
|
1361
1379
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1380
|
+
const ariaLabel = props["aria-label"];
|
|
1381
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
1362
1382
|
const isInvalid = props.isInvalid;
|
|
1363
1383
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1364
1384
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -1462,6 +1482,8 @@ function SingleCombobox(props) {
|
|
|
1462
1482
|
/* @__PURE__ */ jsx8(
|
|
1463
1483
|
ComboboxList,
|
|
1464
1484
|
{
|
|
1485
|
+
"aria-label": ariaLabel,
|
|
1486
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1465
1487
|
style: isVirtualized ? {
|
|
1466
1488
|
padding: 0,
|
|
1467
1489
|
flex: 1,
|
|
@@ -1551,6 +1573,8 @@ function MultiCombobox(props) {
|
|
|
1551
1573
|
fullWidth = true
|
|
1552
1574
|
} = props;
|
|
1553
1575
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1576
|
+
const ariaLabel = props["aria-label"];
|
|
1577
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
1554
1578
|
const isInvalid = props.isInvalid;
|
|
1555
1579
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1556
1580
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -1911,6 +1935,8 @@ function MultiCombobox(props) {
|
|
|
1911
1935
|
/* @__PURE__ */ jsx9(
|
|
1912
1936
|
ComboboxList,
|
|
1913
1937
|
{
|
|
1938
|
+
"aria-label": ariaLabel,
|
|
1939
|
+
"aria-labelledby": ariaLabelledBy,
|
|
1914
1940
|
style: isVirtualized ? {
|
|
1915
1941
|
padding: 0,
|
|
1916
1942
|
flex: 1,
|
|
@@ -2008,6 +2034,8 @@ function SingleSearchableSelect(props) {
|
|
|
2008
2034
|
fullWidth = true
|
|
2009
2035
|
} = props;
|
|
2010
2036
|
const ariaDescribedBy = props["aria-describedby"];
|
|
2037
|
+
const ariaLabel = props["aria-label"];
|
|
2038
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
2011
2039
|
const isInvalid = props.isInvalid;
|
|
2012
2040
|
const isChildrenMode = "children" in props && props.children != null;
|
|
2013
2041
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -2115,6 +2143,8 @@ function SingleSearchableSelect(props) {
|
|
|
2115
2143
|
/* @__PURE__ */ jsx10(
|
|
2116
2144
|
SearchableSelectList,
|
|
2117
2145
|
{
|
|
2146
|
+
"aria-label": ariaLabel,
|
|
2147
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2118
2148
|
style: isVirtualized ? {
|
|
2119
2149
|
padding: 0,
|
|
2120
2150
|
flex: 1,
|
|
@@ -2221,6 +2251,8 @@ function MultiSearchableSelect(props) {
|
|
|
2221
2251
|
fullWidth = true
|
|
2222
2252
|
} = props;
|
|
2223
2253
|
const ariaDescribedBy = props["aria-describedby"];
|
|
2254
|
+
const ariaLabel = props["aria-label"];
|
|
2255
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
2224
2256
|
const isInvalid = props.isInvalid;
|
|
2225
2257
|
const isChildrenMode = "children" in props && props.children != null;
|
|
2226
2258
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -2525,6 +2557,8 @@ function MultiSearchableSelect(props) {
|
|
|
2525
2557
|
/* @__PURE__ */ jsx11(
|
|
2526
2558
|
SearchableSelectList,
|
|
2527
2559
|
{
|
|
2560
|
+
"aria-label": ariaLabel,
|
|
2561
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2528
2562
|
style: isVirtualized ? {
|
|
2529
2563
|
padding: 0,
|
|
2530
2564
|
flex: 1,
|