@sproutsocial/seeds-react-menu 1.5.2 → 1.6.1
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 +10 -86
- package/CHANGELOG.md +12 -0
- package/dist/esm/index.js +30 -27
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +31 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ActionMenu/ActionMenu.stories.tsx +20 -1
- package/src/MenuContent/DefaultMenuEmptyState.tsx +10 -6
- package/src/MenuContent/index.tsx +3 -2
- package/src/MenuGroup/__tests__/MenuGroup.test.tsx +33 -0
- package/src/MenuGroup/__tests__/MenuGroup.typetest.tsx +5 -0
- package/src/hooks/useMenuChildren.tsx +23 -22
- package/src/types.ts +2 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,90 +8,14 @@ CLI Target: es2022
|
|
|
8
8
|
CLI Cleaning output folder
|
|
9
9
|
CJS Build start
|
|
10
10
|
ESM Build start
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
18
|
-
|
|
19
|
-
../../seeds-design-tokens/seeds-motion/package.json:10:6:
|
|
20
|
-
[37m 10 │ [32m"import"[37m: "./dist/seeds-motion.esm.js",
|
|
21
|
-
╵ [32m~~~~~~~~[0m
|
|
22
|
-
|
|
23
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
24
|
-
|
|
25
|
-
../../seeds-design-tokens/seeds-motion/package.json:11:6:
|
|
26
|
-
[37m 11 │ [32m"require"[37m: "./dist/seeds-motion.js",
|
|
27
|
-
╵ [32m~~~~~~~~~[0m
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
[warn] [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json]
|
|
31
|
-
|
|
32
|
-
../../seeds-design-tokens/seeds-motion/package.json:17:6:
|
|
33
|
-
[37m 17 │ [32m"types"[37m: "./dist/seeds-motion-unitless.d.ts"
|
|
34
|
-
╵ [32m~~~~~~~[0m
|
|
35
|
-
|
|
36
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
37
|
-
|
|
38
|
-
../../seeds-design-tokens/seeds-motion/package.json:15:6:
|
|
39
|
-
[37m 15 │ [32m"import"[37m: "./dist/seeds-motion-unitless.esm.js",
|
|
40
|
-
╵ [32m~~~~~~~~[0m
|
|
41
|
-
|
|
42
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
43
|
-
|
|
44
|
-
../../seeds-design-tokens/seeds-motion/package.json:16:6:
|
|
45
|
-
[37m 16 │ [32m"require"[37m: "./dist/seeds-motion-unitless.js",
|
|
46
|
-
╵ [32m~~~~~~~~~[0m
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
[warn] [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json]
|
|
50
|
-
|
|
51
|
-
../../seeds-design-tokens/seeds-motion/package.json:12:6:
|
|
52
|
-
[37m 12 │ [32m"types"[37m: "./dist/seeds-motion.d.ts"
|
|
53
|
-
╵ [32m~~~~~~~[0m
|
|
54
|
-
|
|
55
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
56
|
-
|
|
57
|
-
../../seeds-design-tokens/seeds-motion/package.json:10:6:
|
|
58
|
-
[37m 10 │ [32m"import"[37m: "./dist/seeds-motion.esm.js",
|
|
59
|
-
╵ [32m~~~~~~~~[0m
|
|
60
|
-
|
|
61
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
62
|
-
|
|
63
|
-
../../seeds-design-tokens/seeds-motion/package.json:11:6:
|
|
64
|
-
[37m 11 │ [32m"require"[37m: "./dist/seeds-motion.js",
|
|
65
|
-
╵ [32m~~~~~~~~~[0m
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
[warn] [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json]
|
|
69
|
-
|
|
70
|
-
../../seeds-design-tokens/seeds-motion/package.json:17:6:
|
|
71
|
-
[37m 17 │ [32m"types"[37m: "./dist/seeds-motion-unitless.d.ts"
|
|
72
|
-
╵ [32m~~~~~~~[0m
|
|
73
|
-
|
|
74
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
75
|
-
|
|
76
|
-
../../seeds-design-tokens/seeds-motion/package.json:15:6:
|
|
77
|
-
[37m 15 │ [32m"import"[37m: "./dist/seeds-motion-unitless.esm.js",
|
|
78
|
-
╵ [32m~~~~~~~~[0m
|
|
79
|
-
|
|
80
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
81
|
-
|
|
82
|
-
../../seeds-design-tokens/seeds-motion/package.json:16:6:
|
|
83
|
-
[37m 16 │ [32m"require"[37m: "./dist/seeds-motion-unitless.js",
|
|
84
|
-
╵ [32m~~~~~~~~~[0m
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
CJS dist/index.js 143.99 KB
|
|
88
|
-
CJS dist/index.js.map 371.54 KB
|
|
89
|
-
CJS ⚡️ Build success in 717ms
|
|
90
|
-
ESM dist/esm/index.js 134.23 KB
|
|
91
|
-
ESM dist/esm/index.js.map 370.30 KB
|
|
92
|
-
ESM ⚡️ Build success in 716ms
|
|
11
|
+
CJS dist/index.js 144.30 KB
|
|
12
|
+
CJS dist/index.js.map 371.92 KB
|
|
13
|
+
CJS ⚡️ Build success in 706ms
|
|
14
|
+
ESM dist/esm/index.js 134.40 KB
|
|
15
|
+
ESM dist/esm/index.js.map 370.64 KB
|
|
16
|
+
ESM ⚡️ Build success in 709ms
|
|
93
17
|
DTS Build start
|
|
94
|
-
DTS ⚡️ Build success in
|
|
95
|
-
DTS dist/index.d.ts
|
|
96
|
-
DTS dist/index.d.mts
|
|
97
|
-
Done in
|
|
18
|
+
DTS ⚡️ Build success in 15887ms
|
|
19
|
+
DTS dist/index.d.ts 39.00 KB
|
|
20
|
+
DTS dist/index.d.mts 39.00 KB
|
|
21
|
+
Done in 19.66s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-menu
|
|
2
2
|
|
|
3
|
+
## 1.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 70e4ee7: [DS-3753] Fix handling of conditional items in menu groups
|
|
8
|
+
|
|
9
|
+
## 1.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 74bb102: Export the DefaultMenuEmptyState for external use
|
|
14
|
+
|
|
3
15
|
## 1.5.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/esm/index.js
CHANGED
|
@@ -2139,10 +2139,11 @@ var walkAllChildren = (children, callback) => {
|
|
|
2139
2139
|
if (element === null || element === void 0) return;
|
|
2140
2140
|
callback(element, parents2);
|
|
2141
2141
|
const newParents = [...parents2, element];
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2142
|
+
if (React4.isValidElement(element) && element.props?.children) {
|
|
2143
|
+
React4.Children.toArray(element.props.children).forEach((child) => {
|
|
2144
|
+
walk(child, newParents);
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2146
2147
|
};
|
|
2147
2148
|
const parents = [];
|
|
2148
2149
|
React4.Children.toArray(children).forEach((child) => {
|
|
@@ -2186,21 +2187,20 @@ var addItemsFromGroup = ({
|
|
|
2186
2187
|
});
|
|
2187
2188
|
});
|
|
2188
2189
|
} else if (menuGroup.props.children) {
|
|
2189
|
-
|
|
2190
|
-
if (!Array.isArray(children)) {
|
|
2191
|
-
children = [children];
|
|
2192
|
-
}
|
|
2190
|
+
const children = React4.Children.toArray(menuGroup.props.children);
|
|
2193
2191
|
children.forEach((menuItem) => {
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2192
|
+
if (React4.isValidElement(menuItem)) {
|
|
2193
|
+
addMenuItem({
|
|
2194
|
+
itemProps: {
|
|
2195
|
+
id: menuItem.props.id,
|
|
2196
|
+
disabled: menuItem.props.disabled,
|
|
2197
|
+
menuItemProps: menuItem.props,
|
|
2198
|
+
menuGroupProps: menuGroup.props
|
|
2199
|
+
},
|
|
2200
|
+
allMenuItems,
|
|
2201
|
+
menuItemsMap
|
|
2202
|
+
});
|
|
2203
|
+
}
|
|
2204
2204
|
});
|
|
2205
2205
|
}
|
|
2206
2206
|
};
|
|
@@ -2307,16 +2307,18 @@ import { useCallback } from "react";
|
|
|
2307
2307
|
|
|
2308
2308
|
// src/MenuContent/DefaultMenuEmptyState.tsx
|
|
2309
2309
|
import styled4 from "styled-components";
|
|
2310
|
+
import { Box as Box2 } from "@sproutsocial/seeds-react-box";
|
|
2310
2311
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
2311
|
-
var StyledEmptyState = styled4
|
|
2312
|
+
var StyledEmptyState = styled4(Box2)`
|
|
2312
2313
|
padding: ${({ theme: theme2 }) => theme2.space[350]};
|
|
2313
2314
|
text-align: center;
|
|
2314
2315
|
font-size: ${({ theme: theme2 }) => theme2.typography[200].fontSize};
|
|
2315
2316
|
`;
|
|
2316
2317
|
var DefaultMenuEmptyState = ({
|
|
2317
|
-
children
|
|
2318
|
+
children = "No items found",
|
|
2319
|
+
...props
|
|
2318
2320
|
}) => {
|
|
2319
|
-
return /* @__PURE__ */ jsx6(StyledEmptyState, {
|
|
2321
|
+
return /* @__PURE__ */ jsx6(StyledEmptyState, { ...props, children });
|
|
2320
2322
|
};
|
|
2321
2323
|
|
|
2322
2324
|
// src/MenuContent/MenuContent.tsx
|
|
@@ -2381,8 +2383,8 @@ import "react";
|
|
|
2381
2383
|
|
|
2382
2384
|
// src/MenuFooter/styles.tsx
|
|
2383
2385
|
import styled5 from "styled-components";
|
|
2384
|
-
import { Box as
|
|
2385
|
-
var StyledMenuFooterBox = styled5(
|
|
2386
|
+
import { Box as Box3 } from "@sproutsocial/seeds-react-box";
|
|
2387
|
+
var StyledMenuFooterBox = styled5(Box3)`
|
|
2386
2388
|
padding: ${({ theme: theme2 }) => theme2.space[350]} ${({ theme: theme2 }) => theme2.space[400]};
|
|
2387
2389
|
border-top: 1px solid ${(p) => p.theme.colors.container.border.base};
|
|
2388
2390
|
`;
|
|
@@ -3052,7 +3054,7 @@ var MenuSearchTokenInput = ({
|
|
|
3052
3054
|
// src/SubmenuItem/SubmenuItem.tsx
|
|
3053
3055
|
import React13 from "react";
|
|
3054
3056
|
import { Icon as Icon2 } from "@sproutsocial/seeds-react-icon";
|
|
3055
|
-
import { Box as
|
|
3057
|
+
import { Box as Box4 } from "@sproutsocial/seeds-react-box";
|
|
3056
3058
|
import { mergeRefs as mergeRefs2 } from "@sproutsocial/seeds-react-utilities";
|
|
3057
3059
|
import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3058
3060
|
var SubmenuItemTrigger = ({
|
|
@@ -3080,7 +3082,7 @@ var SubmenuItemTrigger = ({
|
|
|
3080
3082
|
{ suppressRefError: true }
|
|
3081
3083
|
),
|
|
3082
3084
|
id,
|
|
3083
|
-
children: /* @__PURE__ */ jsxs4(
|
|
3085
|
+
children: /* @__PURE__ */ jsxs4(Box4, { display: "flex", justifyContent: "space-between", children: [
|
|
3084
3086
|
children,
|
|
3085
3087
|
/* @__PURE__ */ jsx17(MenuItemActionRight, { children: /* @__PURE__ */ jsx17(Icon2, { name: "chevron-right-outline" }) })
|
|
3086
3088
|
] })
|
|
@@ -4072,7 +4074,7 @@ import { mergeRefs as mergeRefs3 } from "@sproutsocial/seeds-react-utilities";
|
|
|
4072
4074
|
|
|
4073
4075
|
// src/NestedMenu/NestedMenuItem.tsx
|
|
4074
4076
|
import { Icon as Icon5 } from "@sproutsocial/seeds-react-icon";
|
|
4075
|
-
import { Box as
|
|
4077
|
+
import { Box as Box5 } from "@sproutsocial/seeds-react-box";
|
|
4076
4078
|
import { jsx as jsx29, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4077
4079
|
var NestedMenuItem = ({
|
|
4078
4080
|
children,
|
|
@@ -4089,7 +4091,7 @@ var NestedMenuItem = ({
|
|
|
4089
4091
|
}
|
|
4090
4092
|
}
|
|
4091
4093
|
} : {};
|
|
4092
|
-
return /* @__PURE__ */ jsx29(MenuItem, { ...onClickProps, ...rest, children: /* @__PURE__ */ jsxs6(
|
|
4094
|
+
return /* @__PURE__ */ jsx29(MenuItem, { ...onClickProps, ...rest, children: /* @__PURE__ */ jsxs6(Box5, { display: "flex", justifyContent: "space-between", children: [
|
|
4093
4095
|
children,
|
|
4094
4096
|
childMenuId && /* @__PURE__ */ jsx29(MenuItemActionRight, { children: /* @__PURE__ */ jsx29(Icon5, { name: "arrow-right-outline" }) })
|
|
4095
4097
|
] }) });
|
|
@@ -4484,6 +4486,7 @@ export {
|
|
|
4484
4486
|
AutocompleteSelect,
|
|
4485
4487
|
AutocompleteTokenInput,
|
|
4486
4488
|
CustomPopoutContent,
|
|
4489
|
+
DefaultMenuEmptyState,
|
|
4487
4490
|
INPUT_TYPES,
|
|
4488
4491
|
ListboxToggleButton,
|
|
4489
4492
|
MenuContent,
|