@sproutsocial/seeds-react-menu 1.4.1 → 1.5.0

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.
@@ -84,14 +84,14 @@ ESM Build start
84
84
  ╵ ~~~~~~~~~
85
85
 
86
86
 
87
- CJS dist/index.js 143.00 KB
88
- CJS dist/index.js.map 369.68 KB
89
- CJS ⚡️ Build success in 665ms
90
- ESM dist/esm/index.js 133.33 KB
91
- ESM dist/esm/index.js.map 368.41 KB
92
- ESM ⚡️ Build success in 668ms
87
+ CJS dist/index.js 143.93 KB
88
+ CJS dist/index.js.map 371.38 KB
89
+ CJS ⚡️ Build success in 697ms
90
+ ESM dist/esm/index.js 134.17 KB
91
+ ESM dist/esm/index.js.map 370.11 KB
92
+ ESM ⚡️ Build success in 700ms
93
93
  DTS Build start
94
- DTS ⚡️ Build success in 11765ms
95
- DTS dist/index.d.ts 37.42 KB
96
- DTS dist/index.d.mts 37.42 KB
97
- Done in 15.66s.
94
+ DTS ⚡️ Build success in 12460ms
95
+ DTS dist/index.d.ts 38.55 KB
96
+ DTS dist/index.d.mts 38.55 KB
97
+ Done in 16.02s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d79bdc9: [DS-3494]
8
+ - Fix motion origin for Menu based on placement, passed to the motion.div custom prop in the Popout component
9
+ - Updated NestedMenu to use the Popout lockPlacement so it does not jump while switching panels
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [d79bdc9]
14
+ - @sproutsocial/seeds-react-popout@2.4.0
15
+
3
16
  ## 1.4.1
4
17
 
5
18
  ### 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 { Popout } from "@sproutsocial/seeds-react-popout";
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
- initial: {
2603
- scale: 0,
2604
- opacity: 0,
2605
- originX: 0,
2606
- originY: 0
2607
- },
2608
- animate: {
2609
- opacity: 1,
2610
- scale: 1,
2611
- originX: 0,
2612
- originY: 0,
2613
- transition: {
2614
- type: "tween",
2615
- duration: MOTION_DURATION_FAST,
2616
- ease: "circOut"
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
- exit: {
2620
- opacity: 0,
2621
- scale: 1,
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,