@sproutsocial/seeds-react-menu 1.4.1 → 1.5.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 +19 -0
- package/dist/esm/index.js +47 -25
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +46 -2
- package/dist/index.d.ts +46 -2
- package/dist/index.js +46 -24
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/Menu.tsx +3 -1
- package/src/MenuRoot/MenuRoot.tsx +55 -27
- package/src/MenuRoot/__tests__/MenuRoot.test.tsx +37 -0
- package/src/NestedMenu/NestedMenu.stories.tsx +0 -3
- package/src/NestedMenu/NestedMenuPopout.tsx +1 -2
- package/src/NestedMenu/NestedMenuTypes.ts +0 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -84,14 +84,14 @@ ESM Build start
|
|
|
84
84
|
╵ [32m~~~~~~~~~[0m
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
CJS dist/index.js 143.
|
|
88
|
-
CJS dist/index.js.map
|
|
89
|
-
CJS ⚡️ Build success in
|
|
90
|
-
ESM dist/esm/index.js
|
|
91
|
-
ESM dist/esm/index.js.map
|
|
92
|
-
ESM ⚡️ Build success in
|
|
87
|
+
CJS dist/index.js 143.93 KB
|
|
88
|
+
CJS dist/index.js.map 371.38 KB
|
|
89
|
+
CJS ⚡️ Build success in 626ms
|
|
90
|
+
ESM dist/esm/index.js 134.17 KB
|
|
91
|
+
ESM dist/esm/index.js.map 370.11 KB
|
|
92
|
+
ESM ⚡️ Build success in 628ms
|
|
93
93
|
DTS Build start
|
|
94
|
-
DTS ⚡️ Build success in
|
|
95
|
-
DTS dist/index.d.ts
|
|
96
|
-
DTS dist/index.d.mts
|
|
97
|
-
Done in
|
|
94
|
+
DTS ⚡️ Build success in 15609ms
|
|
95
|
+
DTS dist/index.d.ts 38.55 KB
|
|
96
|
+
DTS dist/index.d.mts 38.55 KB
|
|
97
|
+
Done in 18.46s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-menu
|
|
2
2
|
|
|
3
|
+
## 1.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e6023c4: [DS-3555] Add NestedMenuItem and NestedMenuHeader to the Menu.tsx exports for the NestedMenu docs
|
|
8
|
+
|
|
9
|
+
## 1.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- d79bdc9: [DS-3494]
|
|
14
|
+
- Fix motion origin for Menu based on placement, passed to the motion.div custom prop in the Popout component
|
|
15
|
+
- Updated NestedMenu to use the Popout lockPlacement so it does not jump while switching panels
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [d79bdc9]
|
|
20
|
+
- @sproutsocial/seeds-react-popout@2.4.0
|
|
21
|
+
|
|
3
22
|
## 1.4.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/esm/index.js
CHANGED
|
@@ -2583,7 +2583,9 @@ import React7, {
|
|
|
2583
2583
|
useLayoutEffect
|
|
2584
2584
|
} from "react";
|
|
2585
2585
|
import styled8 from "styled-components";
|
|
2586
|
-
import {
|
|
2586
|
+
import {
|
|
2587
|
+
Popout
|
|
2588
|
+
} from "@sproutsocial/seeds-react-popout";
|
|
2587
2589
|
import { mergeRefs } from "@sproutsocial/seeds-react-utilities";
|
|
2588
2590
|
|
|
2589
2591
|
// ../../seeds-design-tokens/seeds-motion/dist/seeds-motion-unitless.esm.js
|
|
@@ -2597,34 +2599,51 @@ var CustomPopoutContent = styled8(Popout.Content)`
|
|
|
2597
2599
|
margin-right: 0;
|
|
2598
2600
|
overflow: hidden;
|
|
2599
2601
|
`;
|
|
2602
|
+
var menuPlacementOrigin = {
|
|
2603
|
+
top: { originX: 0.5, originY: 1 },
|
|
2604
|
+
["top-start"]: { originX: 0, originY: 1 },
|
|
2605
|
+
["top-end"]: { originX: 1, originY: 1 },
|
|
2606
|
+
bottom: { originX: 0.5, originY: 0 },
|
|
2607
|
+
["bottom-start"]: { originX: 0, originY: 0 },
|
|
2608
|
+
["bottom-end"]: { originX: 1, originY: 0 },
|
|
2609
|
+
left: { originX: 1, originY: 0.5 },
|
|
2610
|
+
["left-start"]: { originX: 1, originY: 0 },
|
|
2611
|
+
["left-end"]: { originX: 1, originY: 1 },
|
|
2612
|
+
right: { originX: 0, originY: 0.5 },
|
|
2613
|
+
["right-start"]: { originX: 0, originY: 0 },
|
|
2614
|
+
["right-end"]: { originX: 0, originY: 1 }
|
|
2615
|
+
};
|
|
2600
2616
|
var menuAnimationConfig = {
|
|
2601
2617
|
layout: true,
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2618
|
+
variants: {
|
|
2619
|
+
initial: (custom = { placement: "bottom" }) => ({
|
|
2620
|
+
...menuPlacementOrigin[custom.placement],
|
|
2621
|
+
scale: 0,
|
|
2622
|
+
opacity: 0
|
|
2623
|
+
}),
|
|
2624
|
+
animate: (custom = { placement: "bottom" }) => ({
|
|
2625
|
+
...menuPlacementOrigin[custom.placement],
|
|
2626
|
+
opacity: 1,
|
|
2627
|
+
scale: 1,
|
|
2628
|
+
transition: {
|
|
2629
|
+
type: "tween",
|
|
2630
|
+
duration: MOTION_DURATION_FAST,
|
|
2631
|
+
ease: "circOut"
|
|
2632
|
+
}
|
|
2633
|
+
}),
|
|
2634
|
+
exit: {
|
|
2635
|
+
opacity: 0,
|
|
2636
|
+
scale: 1,
|
|
2637
|
+
transition: {
|
|
2638
|
+
type: "tween",
|
|
2639
|
+
duration: MOTION_DURATION_FAST,
|
|
2640
|
+
ease: "circIn"
|
|
2641
|
+
}
|
|
2617
2642
|
}
|
|
2618
2643
|
},
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
transition: {
|
|
2623
|
-
type: "tween",
|
|
2624
|
-
duration: MOTION_DURATION_FAST,
|
|
2625
|
-
ease: "circIn"
|
|
2626
|
-
}
|
|
2627
|
-
}
|
|
2644
|
+
initial: "initial",
|
|
2645
|
+
animate: "animate",
|
|
2646
|
+
exit: "exit"
|
|
2628
2647
|
};
|
|
2629
2648
|
var MenuPopout = ({
|
|
2630
2649
|
content,
|
|
@@ -4197,6 +4216,7 @@ var NestedMenuPopout = ({
|
|
|
4197
4216
|
return /* @__PURE__ */ jsx33(
|
|
4198
4217
|
MenuPopout,
|
|
4199
4218
|
{
|
|
4219
|
+
lockPlacement: true,
|
|
4200
4220
|
onClose: () => {
|
|
4201
4221
|
onClose?.();
|
|
4202
4222
|
setTimeout(() => resetSelectedMenuPath?.(), 100);
|
|
@@ -4505,6 +4525,8 @@ export {
|
|
|
4505
4525
|
getChildrenFromMenuItems,
|
|
4506
4526
|
getSelectedItemIds,
|
|
4507
4527
|
mapMenuItems,
|
|
4528
|
+
menuAnimationConfig,
|
|
4529
|
+
menuPlacementOrigin,
|
|
4508
4530
|
useMenu,
|
|
4509
4531
|
useMenuChildren,
|
|
4510
4532
|
useMenuContentContext,
|