@sproutsocial/seeds-react-menu 1.6.0 → 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 -10
- package/CHANGELOG.md +6 -0
- package/dist/esm/index.js +18 -18
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ActionMenu/ActionMenu.stories.tsx +20 -1
- 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,14 +8,14 @@ CLI Target: es2022
|
|
|
8
8
|
CLI Cleaning output folder
|
|
9
9
|
CJS Build start
|
|
10
10
|
ESM Build start
|
|
11
|
-
CJS dist/index.js 144.
|
|
12
|
-
CJS dist/index.js.map 371.
|
|
13
|
-
CJS ⚡️ Build success in
|
|
14
|
-
ESM dist/esm/index.js 134.
|
|
15
|
-
ESM dist/esm/index.js.map 370.
|
|
16
|
-
ESM ⚡️ Build success in
|
|
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
|
|
17
17
|
DTS Build start
|
|
18
|
-
DTS ⚡️ Build success in
|
|
19
|
-
DTS dist/index.d.ts
|
|
20
|
-
DTS dist/index.d.mts
|
|
21
|
-
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
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
|
};
|