@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.
- package/.turbo/turbo-build.log +12 -12
- package/CHANGELOG.md +19 -0
- package/dist/esm/v2/index.js +19 -4
- package/dist/esm/v2/index.js.map +1 -1
- package/dist/v2/index.d.mts +5 -4
- package/dist/v2/index.d.ts +5 -4
- package/dist/v2/index.js +19 -4
- package/dist/v2/index.js.map +1 -1
- package/package.json +2 -2
- package/src/v2/Autocomplete/Autocomplete.stories.tsx +1 -1
- package/src/v2/Autocomplete/MultiAutocomplete.tsx +2 -0
- package/src/v2/Autocomplete/SingleAutocomplete.tsx +2 -0
- package/src/v2/Common-V2/ComboboxContent.tsx +12 -4
- package/src/v2/Common-V2/props.ts +1 -0
- package/src/v2/Select/MultiSelect.tsx +2 -0
- package/src/v2/Select/SingleSelect.tsx +2 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,22 +8,22 @@ $ tsup --dts
|
|
|
8
8
|
[34mCLI[39m Cleaning output folder
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m91.81 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/v2/index.js [22m[32m73.13 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m178.88 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/v2/index.js.map [22m[32m152.10 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 67ms
|
|
11
16
|
[32mESM[39m [1mdist/esm/index.js [22m[32m72.69 KB[39m
|
|
12
|
-
[32mESM[39m [1mdist/esm/v2/index.js [22m[32m62.08 KB[39m
|
|
13
17
|
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js [22m[32m9.15 KB[39m
|
|
18
|
+
[32mESM[39m [1mdist/esm/v2/index.js [22m[32m62.59 KB[39m
|
|
14
19
|
[32mESM[39m [1mdist/esm/index.js.map [22m[32m154.90 KB[39m
|
|
15
|
-
[32mESM[39m [1mdist/esm/v2/index.js.map [22m[32m131.58 KB[39m
|
|
16
20
|
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js.map [22m[32m22.93 KB[39m
|
|
17
|
-
[32mESM[39m
|
|
18
|
-
[
|
|
19
|
-
[32mCJS[39m [1mdist/v2/index.js [22m[32m72.63 KB[39m
|
|
20
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m178.88 KB[39m
|
|
21
|
-
[32mCJS[39m [1mdist/v2/index.js.map [22m[32m151.20 KB[39m
|
|
22
|
-
[32mCJS[39m ⚡️ Build success in 55ms
|
|
21
|
+
[32mESM[39m [1mdist/esm/v2/index.js.map [22m[32m132.48 KB[39m
|
|
22
|
+
[32mESM[39m ⚡️ Build success in 67ms
|
|
23
23
|
[34mDTS[39m Build start
|
|
24
|
-
[32mDTS[39m ⚡️ Build success in
|
|
24
|
+
[32mDTS[39m ⚡️ Build success in 5052ms
|
|
25
25
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.08 KB[39m
|
|
26
|
-
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m5.
|
|
26
|
+
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m5.55 KB[39m
|
|
27
27
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m39.08 KB[39m
|
|
28
|
-
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m5.
|
|
29
|
-
Done in 5.
|
|
28
|
+
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m5.55 KB[39m
|
|
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
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -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) ?
|
|
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(
|
|
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
|
),
|