@sproutsocial/seeds-react-menu 1.10.2 → 1.10.4

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
12
+ CJS dist/v2/index.js 73.13 KB
13
+ CJS dist/index.js.map 178.88 KB
14
+ CJS dist/v2/index.js.map 152.10 KB
15
+ CJS ⚡️ Build success in 67ms
11
16
  ESM dist/esm/index.js 72.69 KB
12
- ESM dist/esm/v2/index.js 62.08 KB
13
17
  ESM dist/esm/chunk-ROQATIB7.js 9.15 KB
18
+ ESM dist/esm/v2/index.js 62.59 KB
14
19
  ESM dist/esm/index.js.map 154.90 KB
15
- ESM dist/esm/v2/index.js.map 131.58 KB
16
20
  ESM dist/esm/chunk-ROQATIB7.js.map 22.93 KB
17
- ESM ⚡️ Build success in 55ms
18
- CJS dist/index.js 91.81 KB
19
- CJS dist/v2/index.js 72.63 KB
20
- CJS dist/index.js.map 178.88 KB
21
- CJS dist/v2/index.js.map 151.20 KB
22
- CJS ⚡️ Build success in 55ms
21
+ ESM dist/esm/v2/index.js.map 132.48 KB
22
+ ESM ⚡️ Build success in 67ms
23
23
  DTS Build start
24
- DTS ⚡️ Build success in 4929ms
24
+ DTS ⚡️ Build success in 5052ms
25
25
  DTS dist/index.d.ts 39.08 KB
26
- DTS dist/v2/index.d.ts 5.43 KB
26
+ DTS dist/v2/index.d.ts 5.55 KB
27
27
  DTS dist/index.d.mts 39.08 KB
28
- DTS dist/v2/index.d.mts 5.43 KB
29
- Done in 5.62s.
28
+ DTS dist/v2/index.d.mts 5.55 KB
29
+ Done in 5.77s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - d7658f1: Fix React crash when MultiAutocomplete is used inside Radix-based containers
8
+
9
+ **seeds-react-token-input**: Wrap TokenInput class component with `React.forwardRef` so the standard `ref` prop resolves to the root Container DOM node instead of the class instance. This fixes a `TypeError: contains is not a function` crash in Radix UI's `onInteractOutside` handler, which expects `triggerRef` to be a DOM element. The existing `innerRef` prop continues to forward to the underlying `<input>`.
10
+
11
+ **seeds-react-menu**: Add `{ suppressRefError: true }` to all `getMenuProps` calls in v2 `ComboboxContent` (virtualized, normal, and grouped variants). This suppresses false-positive dev-mode errors from downshift when the menu popout is closed and the menu ref is not attached to a DOM node. This matches the existing pattern used in v1 menu components.
12
+
13
+ - Updated dependencies [d7658f1]
14
+ - @sproutsocial/seeds-react-token-input@1.4.31
15
+
16
+ ## 1.10.3
17
+
18
+ ### Patch Changes
19
+
20
+ - 11bdba2: Fix virtualized combobox item sizing
21
+
3
22
  ## 1.10.2
4
23
 
5
24
  ### Patch Changes
@@ -597,6 +597,7 @@ var VirtualizedComboboxContent = ({
597
597
  groupBy,
598
598
  allData,
599
599
  selectAllItem,
600
+ estimatedItemHeight = 35,
600
601
  ...rest
601
602
  }) => {
602
603
  const containerRef = useRef2(null);
@@ -606,7 +607,7 @@ var VirtualizedComboboxContent = ({
606
607
  getScrollElement: () => containerRef.current,
607
608
  estimateSize: (index) => {
608
609
  const item = items[index];
609
- return isGroupHeading(item) ? 30 : 35;
610
+ return isGroupHeading(item) ? 40 : estimatedItemHeight;
610
611
  }
611
612
  });
612
613
  useEffect(() => {
@@ -615,7 +616,10 @@ var VirtualizedComboboxContent = ({
615
616
  }
616
617
  }, [highlightedIndex, rowVirtualizer]);
617
618
  const virtualItems = rowVirtualizer.getVirtualItems();
618
- const menuProps = getMenuProps({ ref: containerRef });
619
+ const menuProps = getMenuProps(
620
+ { ref: containerRef },
621
+ { suppressRefError: true }
622
+ );
619
623
  return /* @__PURE__ */ jsx6("div", { ...menuProps, ...rest, children: !hasItems && EmptyState ? /* @__PURE__ */ jsx6("div", { style: { padding: "16px" }, children: EmptyState }) : /* @__PURE__ */ jsx6(
620
624
  StyledMenuContent,
621
625
  {
@@ -653,6 +657,7 @@ var VirtualizedComboboxContent = ({
653
657
  return /* @__PURE__ */ jsx6(
654
658
  MenuHeading,
655
659
  {
660
+ ref: rowVirtualizer.measureElement,
656
661
  ...headingItemProps,
657
662
  $highlighted: highlightedIndex === virtualItem.index,
658
663
  label: item.label,
@@ -674,6 +679,7 @@ var VirtualizedComboboxContent = ({
674
679
  return /* @__PURE__ */ jsx6(
675
680
  MenuItem,
676
681
  {
682
+ ref: rowVirtualizer.measureElement,
677
683
  inputType,
678
684
  selected: isItemSelected2,
679
685
  id: toggleItem.id,
@@ -702,6 +708,7 @@ var VirtualizedComboboxContent = ({
702
708
  },
703
709
  $highlighted: highlightedIndex === virtualItem.index,
704
710
  $active: false,
711
+ ref: rowVirtualizer.measureElement,
705
712
  children: renderItem(dataItem)
706
713
  },
707
714
  virtualItem.key
@@ -731,7 +738,7 @@ var NormalComboboxContent = ({
731
738
  ...rest
732
739
  }) => {
733
740
  const hasItems = items.some((item) => !isGroupHeading(item));
734
- const menuProps = getMenuProps();
741
+ const menuProps = getMenuProps({}, { suppressRefError: true });
735
742
  return /* @__PURE__ */ jsx6("div", { ...menuProps, ...rest, children: !hasItems && EmptyState ? /* @__PURE__ */ jsx6("div", { style: { padding: "16px" }, children: EmptyState }) : /* @__PURE__ */ jsx6(
736
743
  StyledMenuContent,
737
744
  {
@@ -824,7 +831,7 @@ var GroupedComboboxContent = ({
824
831
  ...rest
825
832
  }) => {
826
833
  const hasItems = items.some((item) => !isGroupHeading(item));
827
- const menuProps = getMenuProps();
834
+ const menuProps = getMenuProps({}, { suppressRefError: true });
828
835
  const groupedItems = groupItems(
829
836
  items,
830
837
  groupBy,
@@ -943,6 +950,7 @@ function SingleSelect({
943
950
  groupBy,
944
951
  renderGroupHeading,
945
952
  isVirtualized = false,
953
+ estimatedItemHeight,
946
954
  placeholder,
947
955
  onSelectedItemIdChange,
948
956
  onIsOpenChange,
@@ -1098,6 +1106,7 @@ function SingleSelect({
1098
1106
  itemToString,
1099
1107
  inputType,
1100
1108
  isVirtualized,
1109
+ estimatedItemHeight,
1101
1110
  groupBy,
1102
1111
  selectHeadings: false,
1103
1112
  ...menuProps
@@ -1157,6 +1166,7 @@ function MultiSelect({
1157
1166
  groupBy,
1158
1167
  renderGroupHeading,
1159
1168
  isVirtualized = false,
1169
+ estimatedItemHeight,
1160
1170
  showSelectedItems = false,
1161
1171
  selectHeadings = false,
1162
1172
  selectAllItem,
@@ -1399,6 +1409,7 @@ function MultiSelect({
1399
1409
  allData: data,
1400
1410
  selectAllItem,
1401
1411
  isVirtualized,
1412
+ estimatedItemHeight,
1402
1413
  ...menuProps
1403
1414
  }
1404
1415
  ),
@@ -1451,6 +1462,7 @@ function SingleAutocomplete({
1451
1462
  groupBy,
1452
1463
  renderGroupHeading,
1453
1464
  isVirtualized = false,
1465
+ estimatedItemHeight,
1454
1466
  EmptyState,
1455
1467
  placeholder,
1456
1468
  onSelectedItemIdChange,
@@ -1672,6 +1684,7 @@ function SingleAutocomplete({
1672
1684
  selectHeadings: false,
1673
1685
  groupBy,
1674
1686
  isVirtualized,
1687
+ estimatedItemHeight,
1675
1688
  placeholderItem: includePlaceholderItem ? placeholderItem : void 0,
1676
1689
  ...menuProps
1677
1690
  }
@@ -1737,6 +1750,7 @@ function MultiAutocomplete({
1737
1750
  groupBy,
1738
1751
  renderGroupHeading,
1739
1752
  isVirtualized = false,
1753
+ estimatedItemHeight,
1740
1754
  showSelectedItems = false,
1741
1755
  selectHeadings = false,
1742
1756
  selectAllItem,
@@ -2028,6 +2042,7 @@ function MultiAutocomplete({
2028
2042
  allData: data,
2029
2043
  selectAllItem,
2030
2044
  isVirtualized,
2045
+ estimatedItemHeight,
2031
2046
  ...menuProps
2032
2047
  }
2033
2048
  ),