@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.
Files changed (39) hide show
  1. package/.turbo/turbo-build.log +14 -14
  2. package/CHANGELOG.md +21 -0
  3. package/dist/esm/v3/index.js +90 -56
  4. package/dist/esm/v3/index.js.map +1 -1
  5. package/dist/v3/index.d.mts +18 -0
  6. package/dist/v3/index.d.ts +18 -0
  7. package/dist/v3/index.js +90 -56
  8. package/dist/v3/index.js.map +1 -1
  9. package/package.json +1 -1
  10. package/src/ActionMenu/ActionMenu.stories.tsx +1 -1
  11. package/src/Autocomplete/Autocomplete.stories.tsx +1 -1
  12. package/src/MenuContent/MenuContent.stories.tsx +1 -1
  13. package/src/MenuFooter/MenuFooter.stories.tsx +1 -1
  14. package/src/MenuGroup/MenuGroup.stories.tsx +1 -1
  15. package/src/MenuHeader/MenuHeader.stories.tsx +1 -1
  16. package/src/MenuItem/MenuItem.stories.tsx +1 -1
  17. package/src/MenuToggleButton/MenuToggleButton.stories.tsx +1 -1
  18. package/src/MultiSelectMenu/MultiSelectMenu.stories.tsx +1 -1
  19. package/src/NestedMenu/NestedMenu.stories.tsx +1 -1
  20. package/src/SingleSelectMenu/SingleSelectMenu.stories.tsx +1 -1
  21. package/src/SubmenuItem/SubmenuItem.stories.tsx +1 -1
  22. package/src/v2/Autocomplete/Autocomplete.stories.tsx +1 -1
  23. package/src/v2/Select/Select.stories.tsx +1 -1
  24. package/src/v3/ActionMenu.stories.tsx +1 -1
  25. package/src/v3/MenuButton.stories.tsx +1 -1
  26. package/src/v3/ModalStories.stories.tsx +1 -1
  27. package/src/v3/MultiCombobox.stories.tsx +1 -1
  28. package/src/v3/MultiCombobox.tsx +7 -0
  29. package/src/v3/MultiSearchableSelect.stories.tsx +1 -1
  30. package/src/v3/MultiSearchableSelect.tsx +7 -0
  31. package/src/v3/MultiSelect.stories.tsx +1 -1
  32. package/src/v3/MultiSelect.tsx +9 -1
  33. package/src/v3/SingleCombobox.stories.tsx +1 -1
  34. package/src/v3/SingleCombobox.tsx +7 -0
  35. package/src/v3/SingleSearchableSelect.stories.tsx +1 -1
  36. package/src/v3/SingleSearchableSelect.tsx +7 -0
  37. package/src/v3/SingleSelect.stories.tsx +1 -1
  38. package/src/v3/SingleSelect.tsx +9 -1
  39. package/src/v3/__tests__/ariaLabels.test.tsx +133 -0
@@ -9,27 +9,27 @@ $ tsup --dts
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  CJS dist/index.js 92.65 KB
12
- CJS dist/v3/index.js 121.51 KB
13
12
  CJS dist/v2/index.js 73.18 KB
13
+ CJS dist/v3/index.js 123.01 KB
14
14
  CJS dist/index.js.map 180.28 KB
15
- CJS dist/v3/index.js.map 213.07 KB
16
15
  CJS dist/v2/index.js.map 152.19 KB
17
- CJS ⚡️ Build success in 73ms
18
- ESM dist/esm/index.js 73.60 KB
19
- ESM dist/esm/v3/index.js 108.01 KB
20
- ESM dist/esm/chunk-ROQATIB7.js 9.15 KB
16
+ CJS dist/v3/index.js.map 215.51 KB
17
+ CJS ⚡️ Build success in 318ms
21
18
  ESM dist/esm/v2/index.js 62.63 KB
22
- ESM dist/esm/index.js.map 156.29 KB
23
- ESM dist/esm/chunk-ROQATIB7.js.map 22.93 KB
24
- ESM dist/esm/v3/index.js.map 213.12 KB
19
+ ESM dist/esm/v3/index.js 109.51 KB
20
+ ESM dist/esm/chunk-ROQATIB7.js 9.15 KB
21
+ ESM dist/esm/index.js 73.60 KB
25
22
  ESM dist/esm/v2/index.js.map 132.57 KB
26
- ESM ⚡️ Build success in 84ms
23
+ ESM dist/esm/v3/index.js.map 215.56 KB
24
+ ESM dist/esm/chunk-ROQATIB7.js.map 22.93 KB
25
+ ESM dist/esm/index.js.map 156.29 KB
26
+ ESM ⚡️ Build success in 319ms
27
27
  DTS Build start
28
- DTS ⚡️ Build success in 7381ms
28
+ DTS ⚡️ Build success in 7612ms
29
29
  DTS dist/index.d.ts 39.12 KB
30
30
  DTS dist/v2/index.d.ts 5.55 KB
31
- DTS dist/v3/index.d.ts 23.92 KB
31
+ DTS dist/v3/index.d.ts 24.63 KB
32
32
  DTS dist/index.d.mts 39.12 KB
33
33
  DTS dist/v2/index.d.mts 5.55 KB
34
- DTS dist/v3/index.d.mts 23.92 KB
35
- Done in 8.14s.
34
+ DTS dist/v3/index.d.mts 24.63 KB
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
@@ -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(Select3.List, { children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ jsxs2(React4.Fragment, { children: [
384
- /* @__PURE__ */ jsxs2(SelectGroup, { children: [
385
- /* @__PURE__ */ jsx3(SelectGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
386
- group.items.map((item) => /* @__PURE__ */ jsx3(
387
- SelectItem,
388
- {
389
- value: String(item.id),
390
- label: itemToString(item),
391
- disabled: item.disabled,
392
- inputType,
393
- renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
394
- },
395
- item.id
396
- ))
397
- ] }),
398
- index < arr.length - 1 && /* @__PURE__ */ jsx3(SelectSeparator, {})
399
- ] }, group.value)) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
400
- includePlaceholderItem && /* @__PURE__ */ jsx3(
401
- SelectItem,
402
- {
403
- value: null,
404
- label: placeholder ?? ""
405
- },
406
- "placeholder"
407
- ),
408
- data.map((item) => /* @__PURE__ */ jsx3(
409
- SelectItem,
410
- {
411
- value: String(item.id),
412
- label: itemToString(item),
413
- disabled: item.disabled,
414
- inputType,
415
- renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
416
- },
417
- item.id
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(Select4.List, { children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ jsxs3(React5.Fragment, { children: [
536
- /* @__PURE__ */ jsxs3(SelectGroup, { children: [
537
- /* @__PURE__ */ jsx4(SelectGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
538
- group.items.map((item) => /* @__PURE__ */ jsx4(
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) : void 0
576
+ renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
547
577
  },
548
578
  item.id
549
579
  ))
550
- ] }),
551
- index < arr.length - 1 && /* @__PURE__ */ jsx4(SelectSeparator, {})
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,