@sproutsocial/seeds-react-menu 1.10.7 → 1.10.9

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.
@@ -8,22 +8,22 @@ $ tsup --dts
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
- CJS dist/index.js 91.81 KB
11
+ CJS dist/index.js 92.62 KB
12
12
  CJS dist/v2/index.js 73.13 KB
13
- CJS dist/index.js.map 178.88 KB
13
+ CJS dist/index.js.map 180.20 KB
14
14
  CJS dist/v2/index.js.map 152.10 KB
15
- CJS ⚡️ Build success in 64ms
16
- ESM dist/esm/index.js 72.69 KB
15
+ CJS ⚡️ Build success in 56ms
16
+ ESM dist/esm/index.js 73.57 KB
17
17
  ESM dist/esm/chunk-ROQATIB7.js 9.15 KB
18
18
  ESM dist/esm/v2/index.js 62.59 KB
19
- ESM dist/esm/index.js.map 154.90 KB
19
+ ESM dist/esm/index.js.map 156.22 KB
20
20
  ESM dist/esm/chunk-ROQATIB7.js.map 22.93 KB
21
21
  ESM dist/esm/v2/index.js.map 132.48 KB
22
- ESM ⚡️ Build success in 66ms
22
+ ESM ⚡️ Build success in 56ms
23
23
  DTS Build start
24
- DTS ⚡️ Build success in 5517ms
25
- DTS dist/index.d.ts 39.08 KB
24
+ DTS ⚡️ Build success in 4990ms
25
+ DTS dist/index.d.ts 39.09 KB
26
26
  DTS dist/v2/index.d.ts 5.55 KB
27
- DTS dist/index.d.mts 39.08 KB
27
+ DTS dist/index.d.mts 39.09 KB
28
28
  DTS dist/v2/index.d.mts 5.55 KB
29
- Done in 6.24s.
29
+ Done in 5.69s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.10.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 31b0eb1: [DS-4271] Fix invalid ARIA emitted by `MenuGroup` and `MenuItem`.
8
+
9
+ - `MenuGroup` no longer sets `role="group"` on its outer `<li>` (axe
10
+ `aria-allowed-role`). The group role and `aria-labelledby` now live on
11
+ the inner `<ul>`, which also resolves the axe `list` and
12
+ `aria-required-parent` violations.
13
+ - `MenuItem` strips `aria-selected` from the props returned by
14
+ downshift's `getItemProps` when used as a `menuitem` (ActionMenu).
15
+ `aria-selected` is only valid on `role="option"`; for menu items it
16
+ failed axe `aria-allowed-attr`. Listbox menus (`SingleSelectMenu`,
17
+ `MultiSelectMenu`) are unchanged.
18
+
19
+ ## 1.10.8
20
+
21
+ ### Patch Changes
22
+
23
+ - 1f8fc73: [ENTCAP-961] Call passed in onChange within filtering
24
+
3
25
  ## 1.10.7
4
26
 
5
27
  ### Patch Changes
package/dist/esm/index.js CHANGED
@@ -144,22 +144,26 @@ var MenuItem = ({
144
144
  });
145
145
  const item = itemsMap[id] || { index: 0, id };
146
146
  const highlighted = highlightedIndex === item?.index;
147
+ const downshiftItemProps = getItemProps?.({
148
+ ...isListbox ? {} : { role: "menuitem" },
149
+ item,
150
+ index: item.index,
151
+ // The disabled prop no longer supported in downshift. Use isItemDisabled instead.
152
+ // disabled,
153
+ onClick,
154
+ onKeyDown,
155
+ ref: innerRef
156
+ }) ?? {};
157
+ if (!isListbox && "aria-selected" in downshiftItemProps) {
158
+ delete downshiftItemProps["aria-selected"];
159
+ }
147
160
  return hiddenItemsMap[item.id] ? /* @__PURE__ */ jsx2(Fragment, {}) : /* @__PURE__ */ jsx2(MenuItemContainer, { role: "none", children: /* @__PURE__ */ jsx2(
148
161
  StyledMenuItem,
149
162
  {
150
163
  id,
151
164
  $highlighted: highlighted,
152
165
  $active: active,
153
- ...getItemProps?.({
154
- ...isListbox ? {} : { role: "menuitem" },
155
- item,
156
- index: item.index,
157
- // The disabled prop no longer supported in downshift. Use isItemDisabled instead.
158
- // disabled,
159
- onClick,
160
- onKeyDown,
161
- ref: innerRef
162
- }),
166
+ ...downshiftItemProps,
163
167
  as: isListbox ? void 0 : href ? "a" : "button",
164
168
  type: href ? void 0 : "button",
165
169
  href,
@@ -599,20 +603,37 @@ var MenuGroup = ({
599
603
  if (!children) {
600
604
  return null;
601
605
  }
602
- return /* @__PURE__ */ jsxs3(
603
- StyledMenuGroup,
604
- {
605
- role: "group",
606
- id,
607
- isSingleSelect,
608
- "aria-labelledby": title ? titleId : void 0,
609
- color: color3,
610
- ...rest,
611
- children: [
612
- title && /* @__PURE__ */ jsx8(StyledTitle, { role: "heading", as: titleAs, id: titleId, children: title }),
613
- /* @__PURE__ */ jsx8(StyledMenuGroupUl, { children })
614
- ]
615
- }
606
+ return (
607
+ // role="none" on the outer <li>: this wrapper is purely visual (it exists
608
+ // for the border-bottom divider between groups in the parent menu <ul>).
609
+ // The ARIA group semantics live on the inner <ul> below — axe rejects
610
+ // role="group" on <li>, and a native <ul> here would trigger the `list`
611
+ // rule because its children are <li role="none"> menuitem wrappers.
612
+ //
613
+ // TODO(DS-4273): drop the list-based DOM entirely (MenuContent/MenuGroup
614
+ // as <div>, no <ul>/<li>, no role="none" wrappers). This is the followup
615
+ // to DS-4271's minimal ARIA patch.
616
+ /* @__PURE__ */ jsxs3(
617
+ StyledMenuGroup,
618
+ {
619
+ role: "none",
620
+ id,
621
+ isSingleSelect,
622
+ color: color3,
623
+ ...rest,
624
+ children: [
625
+ title && /* @__PURE__ */ jsx8(StyledTitle, { role: "heading", as: titleAs, id: titleId, children: title }),
626
+ /* @__PURE__ */ jsx8(
627
+ StyledMenuGroupUl,
628
+ {
629
+ role: "group",
630
+ "aria-labelledby": title ? titleId : void 0,
631
+ children
632
+ }
633
+ )
634
+ ]
635
+ }
636
+ )
616
637
  );
617
638
  };
618
639
  MenuGroup.__MENU_PRIMITIVE_TYPE = "MenuGroup";
@@ -851,6 +872,7 @@ import { jsx as jsx11 } from "react/jsx-runtime";
851
872
  var MenuSearchInput = ({
852
873
  getIsItemVisible,
853
874
  inputProps,
875
+ onChange,
854
876
  ...restInputProps
855
877
  }) => {
856
878
  const {
@@ -882,6 +904,7 @@ var MenuSearchInput = ({
882
904
  {
883
905
  onChange: (e, value) => {
884
906
  updateFilteredItems({ inputValue: value });
907
+ onChange?.(e, value);
885
908
  },
886
909
  onKeyDown: handleKeyDown,
887
910
  autoComplete: false,