@sproutsocial/seeds-react-menu 0.2.0 → 0.2.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 +10 -10
- package/CHANGELOG.md +13 -0
- package/dist/esm/index.js +35 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +35 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ActionMenu/ActionMenu.tsx +2 -2
- package/src/MenuItem/styles.tsx +3 -1
- package/src/MenuRoot/MenuRoot.feature +20 -10
- package/src/MenuRoot/MenuRoot.tsx +1 -0
- package/src/MenuRoot/__tests__/MenuRoot.test.tsx +163 -30
- package/src/MultiSelectMenu/MultiSelectMenu.feature +2 -13
- package/src/MultiSelectMenu/__tests__/MultiSelectMenu.test.tsx +139 -133
- package/src/hooks/useItemsFromChildren.tsx +7 -4
- package/src/index.ts +1 -0
- package/src/types.ts +2 -5
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
ESM dist/esm/index.js 80.43 KB
|
|
12
|
+
ESM dist/esm/index.js.map 251.90 KB
|
|
13
|
+
ESM ⚡️ Build success in 486ms
|
|
14
|
+
CJS dist/index.js 85.03 KB
|
|
15
|
+
CJS dist/index.js.map 252.76 KB
|
|
16
|
+
CJS ⚡️ Build success in 495ms
|
|
17
17
|
DTS Build start
|
|
18
|
-
DTS ⚡️ Build success in
|
|
19
|
-
DTS dist/index.d.ts 13.
|
|
20
|
-
DTS dist/index.d.mts 13.
|
|
21
|
-
Done in
|
|
18
|
+
DTS ⚡️ Build success in 11030ms
|
|
19
|
+
DTS dist/index.d.ts 13.55 KB
|
|
20
|
+
DTS dist/index.d.mts 13.55 KB
|
|
21
|
+
Done in 13.63s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-menu
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6db5ede: Restores MenuItem CSS transitions
|
|
8
|
+
- Fixes a bug where MenuItem was not animating as expected
|
|
9
|
+
|
|
10
|
+
## 0.2.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- c2ddea7: Added the menuPopout prop back to the MenuRoot popout to reenable menu specific motion
|
|
15
|
+
|
|
3
16
|
## 0.2.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/esm/index.js
CHANGED
|
@@ -1701,13 +1701,14 @@ var highlightedStyles = css4`
|
|
|
1701
1701
|
cursor: pointer;
|
|
1702
1702
|
border: 1px solid ${({ theme: theme2 }) => theme2.colors.listItem.border.base};
|
|
1703
1703
|
background-color: ${({ theme: theme2 }) => theme2.colors.listItem.background.hover};
|
|
1704
|
+
color: ${({ theme: theme2 }) => theme2.colors.text.body};
|
|
1705
|
+
text-decoration: none;
|
|
1704
1706
|
`;
|
|
1705
1707
|
var MenuItemContainer = styled.li`
|
|
1706
1708
|
box-sizing: border-box;
|
|
1707
1709
|
list-style-type: none;
|
|
1708
1710
|
margin-left: ${({ theme: theme2 }) => theme2.space[300]};
|
|
1709
1711
|
margin-right: ${({ theme: theme2 }) => theme2.space[300]};
|
|
1710
|
-
transition: all ${({ theme: theme2 }) => theme2.duration["fast"]};
|
|
1711
1712
|
|
|
1712
1713
|
&:first-child {
|
|
1713
1714
|
margin-top: ${({ theme: theme2 }) => theme2.space[300]};
|
|
@@ -1732,6 +1733,7 @@ var StyledMenuItem = styled.div`
|
|
|
1732
1733
|
padding: ${({ theme: theme2 }) => theme2.space[300]};
|
|
1733
1734
|
outline: 0;
|
|
1734
1735
|
${({ theme: theme2 }) => theme2.typography[200]};
|
|
1736
|
+
transition: all ${({ theme: theme2 }) => theme2.duration["fast"]};
|
|
1735
1737
|
|
|
1736
1738
|
/* Highlighted */
|
|
1737
1739
|
${({ $highlighted }) => $highlighted && highlightedStyles}
|
|
@@ -2160,20 +2162,33 @@ var Text = ({ fontSize: fontSize2, children, qa, color: color2, ...rest }) => {
|
|
|
2160
2162
|
}
|
|
2161
2163
|
);
|
|
2162
2164
|
};
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
Text.
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
Text.
|
|
2175
|
-
|
|
2176
|
-
|
|
2165
|
+
var withTextLogic = (Component) => {
|
|
2166
|
+
return ({ children, ...props }) => {
|
|
2167
|
+
const qaText = typeof children === "string" ? children : void 0;
|
|
2168
|
+
return /* @__PURE__ */ jsx7(Component, { "data-qa-text": qaText, ...props, children });
|
|
2169
|
+
};
|
|
2170
|
+
};
|
|
2171
|
+
var HeadlineWithLogic = withTextLogic(Headline);
|
|
2172
|
+
HeadlineWithLogic.displayName = "Text.Headline";
|
|
2173
|
+
Text.Headline = HeadlineWithLogic;
|
|
2174
|
+
var SubHeadlineWithLogic = withTextLogic(SubHeadline);
|
|
2175
|
+
SubHeadlineWithLogic.displayName = "Text.SubHeadline";
|
|
2176
|
+
Text.SubHeadline = SubHeadlineWithLogic;
|
|
2177
|
+
var SmallSubHeadlineWithLogic = withTextLogic(SmallSubHeadline);
|
|
2178
|
+
SmallSubHeadlineWithLogic.displayName = "Text.SmallSubHeadline";
|
|
2179
|
+
Text.SmallSubHeadline = SmallSubHeadlineWithLogic;
|
|
2180
|
+
var BylineWithLogic = withTextLogic(Byline);
|
|
2181
|
+
BylineWithLogic.displayName = "Text.Byline";
|
|
2182
|
+
Text.Byline = BylineWithLogic;
|
|
2183
|
+
var SmallBylineWithLogic = withTextLogic(SmallByline);
|
|
2184
|
+
SmallBylineWithLogic.displayName = "Text.SmallByline";
|
|
2185
|
+
Text.SmallByline = SmallBylineWithLogic;
|
|
2186
|
+
var BodyCopyWithLogic = withTextLogic(BodyCopy);
|
|
2187
|
+
BodyCopyWithLogic.displayName = "Text.BodyCopy";
|
|
2188
|
+
Text.BodyCopy = BodyCopyWithLogic;
|
|
2189
|
+
var SmallBodyCopyWithLogic = withTextLogic(SmallBodyCopy);
|
|
2190
|
+
SmallBodyCopyWithLogic.displayName = "Text.SmallBodyCopy";
|
|
2191
|
+
Text.SmallBodyCopy = SmallBodyCopyWithLogic;
|
|
2177
2192
|
var Text_default = Text;
|
|
2178
2193
|
var src_default = Text_default;
|
|
2179
2194
|
|
|
@@ -2255,6 +2270,7 @@ var MenuRoot = ({
|
|
|
2255
2270
|
return /* @__PURE__ */ jsx9(MenuProvider, { ...contextProps, children: /* @__PURE__ */ jsx9(
|
|
2256
2271
|
Popout,
|
|
2257
2272
|
{
|
|
2273
|
+
menuPopout: true,
|
|
2258
2274
|
isOpen: !!isOpen,
|
|
2259
2275
|
setIsOpen,
|
|
2260
2276
|
content: /* @__PURE__ */ jsx9(CustomPopoutContent, { width: width2, children }),
|
|
@@ -2349,13 +2365,12 @@ var useItemsFromChildren = ({
|
|
|
2349
2365
|
const allMenuItemElements = getAllMenuItems(children);
|
|
2350
2366
|
const menuItemsMap2 = {};
|
|
2351
2367
|
const allMenuItems2 = allMenuItemElements.map(
|
|
2352
|
-
({ element
|
|
2368
|
+
({ element }, index) => {
|
|
2353
2369
|
const item = {
|
|
2354
2370
|
id: element.props.id,
|
|
2355
2371
|
disabled: element.props.disabled,
|
|
2356
2372
|
index,
|
|
2357
|
-
element
|
|
2358
|
-
parents
|
|
2373
|
+
menuItemProps: element.props
|
|
2359
2374
|
};
|
|
2360
2375
|
menuItemsMap2[`${item.id}`] = item;
|
|
2361
2376
|
return item;
|
|
@@ -2400,11 +2415,11 @@ var handleStateChange = (changes, currentSelectedItem) => {
|
|
|
2400
2415
|
const selectedItem = changes.selectedItem || currentSelectedItem;
|
|
2401
2416
|
if (!selectedItem)
|
|
2402
2417
|
return;
|
|
2403
|
-
if (selectedItem.
|
|
2418
|
+
if (selectedItem.disabled) {
|
|
2404
2419
|
return;
|
|
2405
2420
|
}
|
|
2406
2421
|
const isEnterKeyDown = changes.type === useSelect2.stateChangeTypes.ToggleButtonKeyDownEnter;
|
|
2407
|
-
const selectedItemProps = selectedItem.
|
|
2422
|
+
const selectedItemProps = selectedItem.menuItemProps;
|
|
2408
2423
|
if (selectedItemProps?.onClick) {
|
|
2409
2424
|
const syntheticKeyboardEvent = new KeyboardEvent("keydown", {
|
|
2410
2425
|
key: isEnterKeyDown ? "Enter" : " ",
|