@sproutsocial/seeds-react-menu 1.8.5 → 1.9.2

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.
@@ -3,27 +3,27 @@ $ tsup --dts
3
3
  CLI Building entry: {"index":"src/index.ts","v2/index":"src/v2/index.ts"}
4
4
  CLI Using tsconfig: tsconfig.json
5
5
  CLI tsup v8.5.0
6
- CLI Using tsup config: /home/runner/work/seeds/seeds/seeds-react/seeds-react-menu/tsup.config.ts
6
+ CLI Using tsup config: /home/runner/_work/seeds/seeds/seeds-react/seeds-react-menu/tsup.config.ts
7
7
  CLI Target: es2022
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  CJS dist/index.js 90.52 KB
12
- CJS dist/v2/index.js 71.41 KB
12
+ CJS dist/v2/index.js 72.63 KB
13
13
  CJS dist/index.js.map 176.37 KB
14
- CJS dist/v2/index.js.map 148.47 KB
15
- CJS ⚡️ Build success in 380ms
14
+ CJS dist/v2/index.js.map 151.20 KB
15
+ CJS ⚡️ Build success in 65ms
16
16
  ESM dist/esm/index.js 71.41 KB
17
- ESM dist/esm/v2/index.js 60.86 KB
18
17
  ESM dist/esm/chunk-ROQATIB7.js 9.15 KB
18
+ ESM dist/esm/v2/index.js 62.08 KB
19
19
  ESM dist/esm/index.js.map 152.38 KB
20
- ESM dist/esm/v2/index.js.map 128.83 KB
21
20
  ESM dist/esm/chunk-ROQATIB7.js.map 22.93 KB
22
- ESM ⚡️ Build success in 381ms
21
+ ESM dist/esm/v2/index.js.map 131.58 KB
22
+ ESM ⚡️ Build success in 65ms
23
23
  DTS Build start
24
- DTS ⚡️ Build success in 17567ms
24
+ DTS ⚡️ Build success in 4976ms
25
25
  DTS dist/index.d.ts 39.04 KB
26
- DTS dist/v2/index.d.ts 4.87 KB
26
+ DTS dist/v2/index.d.ts 5.43 KB
27
27
  DTS dist/index.d.mts 39.04 KB
28
- DTS dist/v2/index.d.mts 4.87 KB
29
- Done in 19.14s.
28
+ DTS dist/v2/index.d.mts 5.43 KB
29
+ Done in 5.66s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7d54d67]
8
+ - @sproutsocial/seeds-react-button@1.4.0
9
+ - @sproutsocial/seeds-react-popout@2.4.28
10
+ - @sproutsocial/seeds-react-input@1.5.7
11
+ - @sproutsocial/seeds-react-token-input@1.4.28
12
+
13
+ ## 1.9.1
14
+
15
+ ### Patch Changes
16
+
17
+ - b3d31ac: Clear MultiAutocomplete input text when the popout closes
18
+ - c281089: Fix popoutPlacement="top" rendering the popout invisible
19
+ - Updated dependencies [17d4f12]
20
+ - @sproutsocial/seeds-react-theme@3.6.0
21
+ - @sproutsocial/seeds-react-box@1.1.14
22
+ - @sproutsocial/seeds-react-icon@2.2.5
23
+ - @sproutsocial/seeds-react-label@1.0.14
24
+ - @sproutsocial/seeds-react-token-input@1.4.27
25
+ - @sproutsocial/seeds-react-checkbox@1.3.24
26
+ - @sproutsocial/seeds-react-input@1.5.6
27
+ - @sproutsocial/seeds-react-popout@2.4.27
28
+ - @sproutsocial/seeds-react-button@1.3.20
29
+ - @sproutsocial/seeds-react-switch@1.2.23
30
+ - @sproutsocial/seeds-react-radio@1.3.14
31
+
32
+ ## 1.9.0
33
+
34
+ ### Minor Changes
35
+
36
+ - 2194620: Fixed scroll bar mouse handling bugs in AutoComplete V2
37
+
38
+ ## 1.8.7
39
+
40
+ ### Patch Changes
41
+
42
+ - fe24df3: Enable `Select` component consumers to control popoutProps
43
+ - @sproutsocial/seeds-react-button@1.3.19
44
+ - @sproutsocial/seeds-react-checkbox@1.3.23
45
+ - @sproutsocial/seeds-react-input@1.5.5
46
+ - @sproutsocial/seeds-react-radio@1.3.13
47
+ - @sproutsocial/seeds-react-switch@1.2.22
48
+ - @sproutsocial/seeds-react-token-input@1.4.26
49
+ - @sproutsocial/seeds-react-popout@2.4.26
50
+
51
+ ## 1.8.6
52
+
53
+ ### Patch Changes
54
+
55
+ - 4f91ec2: Expose onPointerDownOutside and onInteractOutside on all v2 menu components
56
+
57
+ Adds `onPointerDownOutside` and `onInteractOutside` props to `BaseSelectProps`,
58
+ making them available on all v2 components: `MultiAutocomplete`, `SingleAutocomplete`,
59
+ `MultiSelect`, `SingleSelect`, `SearchableSelect`, and `SearchableMultiSelect`.
60
+
61
+ These props are forwarded to the internal `Popout`/`Popover.Content`, enabling
62
+ consumers to call `event.preventDefault()` to prevent the popout from dismissing
63
+ when a pointer-down event occurs outside — critical for fixing the Radix
64
+ DismissableLayer conflict that causes a nested `flushSync` crash when any of these
65
+ components are used inside a `ModalV2` (Dialog).
66
+
3
67
  ## 1.8.5
4
68
 
5
69
  ### Patch Changes
@@ -217,8 +217,21 @@ function Popout({
217
217
  const popoverOnOpenChange = isControlled ? onOpenChange : handleOpenChange;
218
218
  const radixRef = React2.useRef(null);
219
219
  return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, onOpenChange: popoverOnOpenChange, children: [
220
- /* @__PURE__ */ jsx(Popover.Trigger, { ref: radixRef, asChild: true, children }),
221
- /* @__PURE__ */ jsx(Popover.Anchor, { children: /* @__PURE__ */ jsx("div", { style: { height: "1px" }, children: "\xA0" }) }),
220
+ /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
221
+ /* @__PURE__ */ jsx(Popover.Trigger, { ref: radixRef, asChild: true, children }),
222
+ /* @__PURE__ */ jsx(
223
+ Popover.Anchor,
224
+ {
225
+ style: {
226
+ position: "absolute",
227
+ top: side === "top" ? 0 : "100%",
228
+ left: 0,
229
+ right: 0,
230
+ height: "1px"
231
+ }
232
+ }
233
+ )
234
+ ] }),
222
235
  /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(
223
236
  StyledContent,
224
237
  {
@@ -608,7 +621,8 @@ var VirtualizedComboboxContent = ({
608
621
  {
609
622
  style: {
610
623
  height: `${rowVirtualizer.getTotalSize()}px`,
611
- position: "relative"
624
+ position: "relative",
625
+ overflow: "hidden"
612
626
  },
613
627
  children: /* @__PURE__ */ jsx6(
614
628
  "div",
@@ -936,7 +950,10 @@ function SingleSelect({
936
950
  triggerButtonProps,
937
951
  menuProps,
938
952
  inputType = "icon",
939
- removePlaceholderItem = false
953
+ removePlaceholderItem = false,
954
+ onPointerDownOutside,
955
+ onInteractOutside,
956
+ popoutPlacement
940
957
  }) {
941
958
  const [uncontrolledSelectedItemId, setUncontrolledSelectedItemId] = useState2(null);
942
959
  const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState2(false);
@@ -1035,6 +1052,7 @@ function SingleSelect({
1035
1052
  {
1036
1053
  open: selectIsOpen,
1037
1054
  onOpenChange: updateIsOpen,
1055
+ side: popoutPlacement,
1038
1056
  animationConfig: menuAnimationConfig,
1039
1057
  onOpenAutoFocus: (e) => {
1040
1058
  e.preventDefault();
@@ -1042,6 +1060,8 @@ function SingleSelect({
1042
1060
  onCloseAutoFocus: (e) => {
1043
1061
  e.preventDefault();
1044
1062
  },
1063
+ onPointerDownOutside,
1064
+ onInteractOutside,
1045
1065
  content: /* @__PURE__ */ jsx7(
1046
1066
  ComboboxContent,
1047
1067
  {
@@ -1147,7 +1167,10 @@ function MultiSelect({
1147
1167
  triggerButtonProps,
1148
1168
  menuProps,
1149
1169
  inputType = "checkbox",
1150
- shouldOverflow
1170
+ shouldOverflow,
1171
+ onPointerDownOutside,
1172
+ onInteractOutside,
1173
+ popoutPlacement
1151
1174
  }) {
1152
1175
  const [uncontrolledSelectedItemIds, setUncontrolledSelectedItemIds] = useState3([]);
1153
1176
  const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState3(false);
@@ -1322,12 +1345,15 @@ function MultiSelect({
1322
1345
  {
1323
1346
  open: selectIsOpen,
1324
1347
  onOpenChange: updateIsOpen,
1348
+ side: popoutPlacement,
1325
1349
  onOpenAutoFocus: (e) => {
1326
1350
  e.preventDefault();
1327
1351
  },
1328
1352
  onCloseAutoFocus: (e) => {
1329
1353
  e.preventDefault();
1330
1354
  },
1355
+ onPointerDownOutside,
1356
+ onInteractOutside,
1331
1357
  animationConfig: menuAnimationConfig,
1332
1358
  content: /* @__PURE__ */ jsx8(
1333
1359
  ComboboxContent,
@@ -1433,7 +1459,10 @@ function SingleAutocomplete({
1433
1459
  stateReducer = defaultReducer3,
1434
1460
  menuProps,
1435
1461
  inputType = "icon",
1436
- includePlaceholderItem = false
1462
+ includePlaceholderItem = false,
1463
+ onPointerDownOutside,
1464
+ onInteractOutside,
1465
+ popoutPlacement
1437
1466
  }) {
1438
1467
  const [uncontrolledInputValue, setUncontrolledInputValue] = useState4("");
1439
1468
  const [uncontrolledSelectedItemId, setUncontrolledSelectedItemId] = useState4(null);
@@ -1603,6 +1632,7 @@ function SingleAutocomplete({
1603
1632
  {
1604
1633
  open: comboboxIsOpen,
1605
1634
  onOpenChange: updateIsOpen,
1635
+ side: popoutPlacement,
1606
1636
  animationConfig: menuAnimationConfig,
1607
1637
  onOpenAutoFocus: (e) => {
1608
1638
  e.preventDefault();
@@ -1610,6 +1640,8 @@ function SingleAutocomplete({
1610
1640
  onCloseAutoFocus: (e) => {
1611
1641
  e.preventDefault();
1612
1642
  },
1643
+ onPointerDownOutside,
1644
+ onInteractOutside,
1613
1645
  content: /* @__PURE__ */ jsx9(
1614
1646
  ComboboxContent,
1615
1647
  {
@@ -1667,7 +1699,7 @@ function SingleAutocomplete({
1667
1699
  }
1668
1700
 
1669
1701
  // src/v2/Autocomplete/MultiAutocomplete.tsx
1670
- import { useState as useState5, useMemo as useMemo6 } from "react";
1702
+ import { useState as useState5, useMemo as useMemo6, useRef as useRef3 } from "react";
1671
1703
  import { useCombobox as useCombobox2, useMultipleSelection as useMultipleSelection2 } from "downshift";
1672
1704
  import { TokenInput } from "@sproutsocial/seeds-react-token-input";
1673
1705
  import { jsx as jsx10 } from "react/jsx-runtime";
@@ -1715,8 +1747,12 @@ function MultiAutocomplete({
1715
1747
  onIsOpenChange,
1716
1748
  stateReducer = defaultReducer4,
1717
1749
  menuProps,
1718
- inputType = "checkbox"
1750
+ inputType = "checkbox",
1751
+ onPointerDownOutside,
1752
+ onInteractOutside,
1753
+ popoutPlacement
1719
1754
  }) {
1755
+ const mousedownInPopoverRef = useRef3(false);
1720
1756
  const [uncontrolledInputValue, setUncontrolledInputValue] = useState5("");
1721
1757
  const [uncontrolledSelectedItemIds, setUncontrolledSelectedItemIds] = useState5([]);
1722
1758
  const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState5(false);
@@ -1743,6 +1779,9 @@ function MultiAutocomplete({
1743
1779
  onInputValueChange?.(newInputValue);
1744
1780
  };
1745
1781
  const updateIsOpen = (newIsOpen) => {
1782
+ if (!newIsOpen) {
1783
+ updateInputValue("");
1784
+ }
1746
1785
  if (!isIsOpenControlled) {
1747
1786
  setUncontrolledIsOpen(newIsOpen);
1748
1787
  }
@@ -1919,6 +1958,11 @@ function MultiAutocomplete({
1919
1958
  if (inputProps.onBlur) {
1920
1959
  inputProps.onBlur(e);
1921
1960
  }
1961
+ if (mousedownInPopoverRef.current) {
1962
+ mousedownInPopoverRef.current = false;
1963
+ e.target.focus();
1964
+ return;
1965
+ }
1922
1966
  updateIsOpen(false);
1923
1967
  };
1924
1968
  const inputPropsToSpread = { ...inputProps };
@@ -1928,13 +1972,22 @@ function MultiAutocomplete({
1928
1972
  {
1929
1973
  open: comboboxIsOpen,
1930
1974
  onOpenChange: updateIsOpen,
1975
+ side: popoutPlacement,
1931
1976
  onOpenAutoFocus: (e) => {
1932
1977
  e.preventDefault();
1933
1978
  },
1934
1979
  onCloseAutoFocus: (e) => {
1935
1980
  e.preventDefault();
1936
1981
  },
1982
+ onPointerDownOutside,
1983
+ onInteractOutside,
1937
1984
  animationConfig: menuAnimationConfig,
1985
+ onMouseDown: () => {
1986
+ mousedownInPopoverRef.current = true;
1987
+ },
1988
+ onMouseUp: () => {
1989
+ mousedownInPopoverRef.current = false;
1990
+ },
1938
1991
  content: /* @__PURE__ */ jsx10(
1939
1992
  ComboboxContent,
1940
1993
  {