@sproutsocial/seeds-react-menu 1.8.6 → 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.
- package/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +48 -0
- package/dist/esm/v2/index.js +45 -8
- package/dist/esm/v2/index.js.map +1 -1
- package/dist/v2/index.d.mts +9 -4
- package/dist/v2/index.d.ts +9 -4
- package/dist/v2/index.js +44 -7
- package/dist/v2/index.js.map +1 -1
- package/package.json +13 -13
- package/src/v2/Autocomplete/Autocomplete.stories.tsx +36 -0
- package/src/v2/Autocomplete/MultiAutocomplete.tsx +21 -1
- package/src/v2/Autocomplete/SingleAutocomplete.tsx +2 -0
- package/src/v2/Common-V2/ComboboxContent.tsx +1 -0
- package/src/v2/Common-V2/Popout.tsx +22 -6
- package/src/v2/Common-V2/props.ts +5 -0
- package/src/v2/SearchableSelect/SearchableMultiSelect.tsx +2 -0
- package/src/v2/SearchableSelect/SearchableSelect.tsx +2 -0
- package/src/v2/Select/MultiSelect.tsx +2 -0
- package/src/v2/Select/SingleSelect.tsx +2 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -3,27 +3,27 @@ $ tsup --dts
|
|
|
3
3
|
[34mCLI[39m Building entry: {"index":"src/index.ts","v2/index":"src/v2/index.ts"}
|
|
4
4
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
5
5
|
[34mCLI[39m tsup v8.5.0
|
|
6
|
-
[34mCLI[39m Using tsup config: /home/runner/
|
|
6
|
+
[34mCLI[39m Using tsup config: /home/runner/_work/seeds/seeds/seeds-react/seeds-react-menu/tsup.config.ts
|
|
7
7
|
[34mCLI[39m Target: es2022
|
|
8
8
|
[34mCLI[39m Cleaning output folder
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[32mCJS[39m [1mdist/index.js [22m[32m90.52 KB[39m
|
|
12
|
-
[32mCJS[39m [1mdist/v2/index.js [22m[
|
|
12
|
+
[32mCJS[39m [1mdist/v2/index.js [22m[32m72.63 KB[39m
|
|
13
13
|
[32mCJS[39m [1mdist/index.js.map [22m[32m176.37 KB[39m
|
|
14
|
-
[32mCJS[39m [1mdist/v2/index.js.map [22m[
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m [1mdist/v2/index.js.map [22m[32m151.20 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 65ms
|
|
16
16
|
[32mESM[39m [1mdist/esm/index.js [22m[32m71.41 KB[39m
|
|
17
|
-
[32mESM[39m [1mdist/esm/v2/index.js [22m[32m61.25 KB[39m
|
|
18
17
|
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js [22m[32m9.15 KB[39m
|
|
18
|
+
[32mESM[39m [1mdist/esm/v2/index.js [22m[32m62.08 KB[39m
|
|
19
19
|
[32mESM[39m [1mdist/esm/index.js.map [22m[32m152.38 KB[39m
|
|
20
|
-
[32mESM[39m [1mdist/esm/v2/index.js.map [22m[32m129.54 KB[39m
|
|
21
20
|
[32mESM[39m [1mdist/esm/chunk-ROQATIB7.js.map [22m[32m22.93 KB[39m
|
|
22
|
-
[32mESM[39m
|
|
21
|
+
[32mESM[39m [1mdist/esm/v2/index.js.map [22m[32m131.58 KB[39m
|
|
22
|
+
[32mESM[39m ⚡️ Build success in 65ms
|
|
23
23
|
[34mDTS[39m Build start
|
|
24
|
-
[32mDTS[39m ⚡️ Build success in
|
|
24
|
+
[32mDTS[39m ⚡️ Build success in 4976ms
|
|
25
25
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.04 KB[39m
|
|
26
|
-
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m5.
|
|
26
|
+
[32mDTS[39m [1mdist/v2/index.d.ts [22m[32m5.43 KB[39m
|
|
27
27
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m39.04 KB[39m
|
|
28
|
-
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m5.
|
|
29
|
-
Done in
|
|
28
|
+
[32mDTS[39m [1mdist/v2/index.d.mts [22m[32m5.43 KB[39m
|
|
29
|
+
Done in 5.66s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
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
|
+
|
|
3
51
|
## 1.8.6
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -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__ */
|
|
221
|
-
|
|
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",
|
|
@@ -938,7 +952,8 @@ function SingleSelect({
|
|
|
938
952
|
inputType = "icon",
|
|
939
953
|
removePlaceholderItem = false,
|
|
940
954
|
onPointerDownOutside,
|
|
941
|
-
onInteractOutside
|
|
955
|
+
onInteractOutside,
|
|
956
|
+
popoutPlacement
|
|
942
957
|
}) {
|
|
943
958
|
const [uncontrolledSelectedItemId, setUncontrolledSelectedItemId] = useState2(null);
|
|
944
959
|
const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState2(false);
|
|
@@ -1037,6 +1052,7 @@ function SingleSelect({
|
|
|
1037
1052
|
{
|
|
1038
1053
|
open: selectIsOpen,
|
|
1039
1054
|
onOpenChange: updateIsOpen,
|
|
1055
|
+
side: popoutPlacement,
|
|
1040
1056
|
animationConfig: menuAnimationConfig,
|
|
1041
1057
|
onOpenAutoFocus: (e) => {
|
|
1042
1058
|
e.preventDefault();
|
|
@@ -1153,7 +1169,8 @@ function MultiSelect({
|
|
|
1153
1169
|
inputType = "checkbox",
|
|
1154
1170
|
shouldOverflow,
|
|
1155
1171
|
onPointerDownOutside,
|
|
1156
|
-
onInteractOutside
|
|
1172
|
+
onInteractOutside,
|
|
1173
|
+
popoutPlacement
|
|
1157
1174
|
}) {
|
|
1158
1175
|
const [uncontrolledSelectedItemIds, setUncontrolledSelectedItemIds] = useState3([]);
|
|
1159
1176
|
const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState3(false);
|
|
@@ -1328,6 +1345,7 @@ function MultiSelect({
|
|
|
1328
1345
|
{
|
|
1329
1346
|
open: selectIsOpen,
|
|
1330
1347
|
onOpenChange: updateIsOpen,
|
|
1348
|
+
side: popoutPlacement,
|
|
1331
1349
|
onOpenAutoFocus: (e) => {
|
|
1332
1350
|
e.preventDefault();
|
|
1333
1351
|
},
|
|
@@ -1443,7 +1461,8 @@ function SingleAutocomplete({
|
|
|
1443
1461
|
inputType = "icon",
|
|
1444
1462
|
includePlaceholderItem = false,
|
|
1445
1463
|
onPointerDownOutside,
|
|
1446
|
-
onInteractOutside
|
|
1464
|
+
onInteractOutside,
|
|
1465
|
+
popoutPlacement
|
|
1447
1466
|
}) {
|
|
1448
1467
|
const [uncontrolledInputValue, setUncontrolledInputValue] = useState4("");
|
|
1449
1468
|
const [uncontrolledSelectedItemId, setUncontrolledSelectedItemId] = useState4(null);
|
|
@@ -1613,6 +1632,7 @@ function SingleAutocomplete({
|
|
|
1613
1632
|
{
|
|
1614
1633
|
open: comboboxIsOpen,
|
|
1615
1634
|
onOpenChange: updateIsOpen,
|
|
1635
|
+
side: popoutPlacement,
|
|
1616
1636
|
animationConfig: menuAnimationConfig,
|
|
1617
1637
|
onOpenAutoFocus: (e) => {
|
|
1618
1638
|
e.preventDefault();
|
|
@@ -1679,7 +1699,7 @@ function SingleAutocomplete({
|
|
|
1679
1699
|
}
|
|
1680
1700
|
|
|
1681
1701
|
// src/v2/Autocomplete/MultiAutocomplete.tsx
|
|
1682
|
-
import { useState as useState5, useMemo as useMemo6 } from "react";
|
|
1702
|
+
import { useState as useState5, useMemo as useMemo6, useRef as useRef3 } from "react";
|
|
1683
1703
|
import { useCombobox as useCombobox2, useMultipleSelection as useMultipleSelection2 } from "downshift";
|
|
1684
1704
|
import { TokenInput } from "@sproutsocial/seeds-react-token-input";
|
|
1685
1705
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
@@ -1729,8 +1749,10 @@ function MultiAutocomplete({
|
|
|
1729
1749
|
menuProps,
|
|
1730
1750
|
inputType = "checkbox",
|
|
1731
1751
|
onPointerDownOutside,
|
|
1732
|
-
onInteractOutside
|
|
1752
|
+
onInteractOutside,
|
|
1753
|
+
popoutPlacement
|
|
1733
1754
|
}) {
|
|
1755
|
+
const mousedownInPopoverRef = useRef3(false);
|
|
1734
1756
|
const [uncontrolledInputValue, setUncontrolledInputValue] = useState5("");
|
|
1735
1757
|
const [uncontrolledSelectedItemIds, setUncontrolledSelectedItemIds] = useState5([]);
|
|
1736
1758
|
const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState5(false);
|
|
@@ -1757,6 +1779,9 @@ function MultiAutocomplete({
|
|
|
1757
1779
|
onInputValueChange?.(newInputValue);
|
|
1758
1780
|
};
|
|
1759
1781
|
const updateIsOpen = (newIsOpen) => {
|
|
1782
|
+
if (!newIsOpen) {
|
|
1783
|
+
updateInputValue("");
|
|
1784
|
+
}
|
|
1760
1785
|
if (!isIsOpenControlled) {
|
|
1761
1786
|
setUncontrolledIsOpen(newIsOpen);
|
|
1762
1787
|
}
|
|
@@ -1933,6 +1958,11 @@ function MultiAutocomplete({
|
|
|
1933
1958
|
if (inputProps.onBlur) {
|
|
1934
1959
|
inputProps.onBlur(e);
|
|
1935
1960
|
}
|
|
1961
|
+
if (mousedownInPopoverRef.current) {
|
|
1962
|
+
mousedownInPopoverRef.current = false;
|
|
1963
|
+
e.target.focus();
|
|
1964
|
+
return;
|
|
1965
|
+
}
|
|
1936
1966
|
updateIsOpen(false);
|
|
1937
1967
|
};
|
|
1938
1968
|
const inputPropsToSpread = { ...inputProps };
|
|
@@ -1942,6 +1972,7 @@ function MultiAutocomplete({
|
|
|
1942
1972
|
{
|
|
1943
1973
|
open: comboboxIsOpen,
|
|
1944
1974
|
onOpenChange: updateIsOpen,
|
|
1975
|
+
side: popoutPlacement,
|
|
1945
1976
|
onOpenAutoFocus: (e) => {
|
|
1946
1977
|
e.preventDefault();
|
|
1947
1978
|
},
|
|
@@ -1951,6 +1982,12 @@ function MultiAutocomplete({
|
|
|
1951
1982
|
onPointerDownOutside,
|
|
1952
1983
|
onInteractOutside,
|
|
1953
1984
|
animationConfig: menuAnimationConfig,
|
|
1985
|
+
onMouseDown: () => {
|
|
1986
|
+
mousedownInPopoverRef.current = true;
|
|
1987
|
+
},
|
|
1988
|
+
onMouseUp: () => {
|
|
1989
|
+
mousedownInPopoverRef.current = false;
|
|
1990
|
+
},
|
|
1954
1991
|
content: /* @__PURE__ */ jsx10(
|
|
1955
1992
|
ComboboxContent,
|
|
1956
1993
|
{
|