@yamada-ui/motion 2.2.4-next-20241005232637 → 2.2.4-next-20241008193728

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -1,44 +1,29 @@
1
1
  "use client"
2
2
  import {
3
3
  motion
4
- } from "./chunk-HOM46QCE.mjs";
4
+ } from "./chunk-4MMUMOXF.mjs";
5
5
  import {
6
6
  Motion
7
- } from "./chunk-M6WLOAFU.mjs";
7
+ } from "./chunk-2V3EH5L5.mjs";
8
8
  import {
9
9
  motionForwardRef
10
- } from "./chunk-IBE7Q3Z3.mjs";
11
- import "./chunk-R3D52RAW.mjs";
10
+ } from "./chunk-RXCU3ZFK.mjs";
12
11
  import {
13
12
  MOTION_TRANSITION_DEFAULTS,
14
13
  MOTION_TRANSITION_EASINGS,
15
14
  MOTION_TRANSITION_VARIANTS,
16
15
  transitionEnter,
17
16
  transitionExit
18
- } from "./chunk-Z6I57MQV.mjs";
17
+ } from "./chunk-AWDPDZLD.mjs";
19
18
 
20
19
  // src/index.ts
21
20
  import {
22
21
  AcceleratedAnimation,
23
- AnimatePresence,
24
- AnimateSharedLayout,
25
- DeprecatedLayoutGroupContext,
26
- DragControls,
27
- FlatTree,
28
- LayoutGroup,
29
- LayoutGroupContext,
30
- LazyMotion,
31
- MotionConfig,
32
- MotionConfigContext,
33
- MotionContext,
34
- MotionGlobalConfig,
35
- PresenceContext,
36
- Reorder,
37
- SwitchLayoutGroupContext,
38
- VisualElement,
39
22
  addPointerInfo,
40
23
  addScaleCorrector,
41
24
  animate,
25
+ AnimatePresence,
26
+ AnimateSharedLayout,
42
27
  animateValue,
43
28
  animateVisualElement,
44
29
  animationControls,
@@ -63,34 +48,46 @@ import {
63
48
  createScopedAnimate,
64
49
  cubicBezier,
65
50
  delay,
51
+ DeprecatedLayoutGroupContext,
66
52
  disableInstantTransitions,
67
53
  distance,
68
54
  distance2D,
69
55
  domAnimation,
70
56
  domMax,
57
+ DragControls,
71
58
  easeIn,
72
59
  easeInOut,
73
60
  easeOut,
74
61
  filterProps,
62
+ FlatTree,
75
63
  frame,
76
64
  frameData,
77
- inView,
78
65
  interpolate,
79
66
  invariant,
67
+ inView,
80
68
  isBrowser,
81
69
  isDragActive,
82
70
  isMotionComponent,
83
71
  isMotionValue,
84
72
  isValidMotionProp,
73
+ LayoutGroup,
74
+ LayoutGroupContext,
75
+ LazyMotion,
85
76
  m,
86
77
  makeUseVisualState,
87
78
  mirrorEasing,
88
79
  mix,
80
+ MotionConfig,
81
+ MotionConfigContext,
82
+ MotionContext,
83
+ MotionGlobalConfig,
89
84
  motionValue,
90
85
  optimizedAppearDataAttribute,
91
86
  pipe,
87
+ PresenceContext,
92
88
  progress,
93
89
  px,
90
+ Reorder,
94
91
  resolveMotionValue,
95
92
  reverseEasing,
96
93
  scroll,
@@ -99,6 +96,7 @@ import {
99
96
  stagger,
100
97
  startOptimizedAppearAnimation,
101
98
  steps,
99
+ SwitchLayoutGroupContext,
102
100
  sync,
103
101
  transform,
104
102
  unwrapMotionComponent,
@@ -113,11 +111,11 @@ import {
113
111
  useDragControls,
114
112
  useElementScroll,
115
113
  useForceUpdate,
116
- useInView,
117
114
  useInstantLayoutTransition,
118
115
  useInstantTransition,
119
- useIsPresent,
116
+ useInView,
120
117
  useIsomorphicLayoutEffect,
118
+ useIsPresent,
121
119
  useMotionTemplate,
122
120
  useMotionValue,
123
121
  useMotionValueEvent,
@@ -132,6 +130,7 @@ import {
132
130
  useVelocity,
133
131
  useViewportScroll,
134
132
  useWillChange,
133
+ VisualElement,
135
134
  visualElementStore,
136
135
  warning,
137
136
  wrap
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n AcceleratedAnimation,\n AnimatePresence,\n AnimateSharedLayout,\n DeprecatedLayoutGroupContext,\n DragControls,\n FlatTree,\n LayoutGroup,\n LayoutGroupContext,\n LazyMotion,\n MotionConfig,\n MotionConfigContext,\n MotionContext,\n MotionGlobalConfig,\n PresenceContext,\n Reorder as MotionReorder,\n SwitchLayoutGroupContext,\n VisualElement,\n addPointerInfo,\n addScaleCorrector,\n animate,\n animateValue,\n animateVisualElement,\n animationControls,\n animations,\n anticipate,\n backIn,\n backInOut,\n backOut,\n buildTransform,\n calcLength,\n cancelFrame,\n cancelSync,\n circIn,\n circInOut,\n circOut,\n clamp,\n color,\n complex,\n createBox,\n createDomMotionComponent,\n createMotionComponent,\n createScopedAnimate,\n cubicBezier,\n delay,\n disableInstantTransitions,\n distance,\n distance2D,\n domAnimation,\n domMax,\n easeIn,\n easeInOut,\n easeOut,\n filterProps,\n frame,\n frameData,\n inView,\n interpolate,\n invariant,\n isBrowser,\n isDragActive,\n isMotionComponent,\n isMotionValue,\n isValidMotionProp,\n m,\n makeUseVisualState,\n mirrorEasing,\n mix,\n motionValue,\n optimizedAppearDataAttribute,\n pipe,\n progress,\n px,\n resolveMotionValue,\n reverseEasing,\n scroll,\n scrollInfo,\n spring,\n stagger,\n startOptimizedAppearAnimation,\n steps,\n sync,\n transform,\n unwrapMotionComponent,\n useAnimate,\n useAnimation as useMotionAnimation,\n useAnimationControls,\n useAnimationFrame,\n useCycle,\n useDeprecatedAnimatedState,\n useDeprecatedInvertedScale,\n useDomEvent,\n useDragControls,\n useElementScroll,\n useForceUpdate,\n useInView,\n useInstantLayoutTransition,\n useInstantTransition,\n useIsPresent,\n useIsomorphicLayoutEffect,\n useMotionTemplate,\n useMotionValue,\n useMotionValueEvent,\n usePresence,\n useReducedMotion,\n useReducedMotionConfig,\n useResetProjection,\n useScroll,\n useSpring,\n useTime,\n useTransform,\n useVelocity,\n useViewportScroll,\n useWillChange,\n visualElementStore,\n warning,\n wrap,\n} from \"framer-motion\"\nexport * from \"./forward-ref\"\nexport { Motion } from \"./motion\"\nexport * from \"./motion.types\"\nexport * from \"./utils\"\nexport * from \"./factory\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./factory\"\nexport * from \"./forward-ref\"\nexport { Motion } from \"./motion\"\nexport type * from \"./motion.types\"\nexport * from \"./utils\"\nexport {\n AcceleratedAnimation,\n addPointerInfo,\n addScaleCorrector,\n animate,\n AnimatePresence,\n AnimateSharedLayout,\n animateValue,\n animateVisualElement,\n animationControls,\n animations,\n anticipate,\n backIn,\n backInOut,\n backOut,\n buildTransform,\n calcLength,\n cancelFrame,\n cancelSync,\n circIn,\n circInOut,\n circOut,\n clamp,\n color,\n complex,\n createBox,\n createDomMotionComponent,\n createMotionComponent,\n createScopedAnimate,\n cubicBezier,\n delay,\n DeprecatedLayoutGroupContext,\n disableInstantTransitions,\n distance,\n distance2D,\n domAnimation,\n domMax,\n DragControls,\n easeIn,\n easeInOut,\n easeOut,\n filterProps,\n FlatTree,\n frame,\n frameData,\n interpolate,\n invariant,\n inView,\n isBrowser,\n isDragActive,\n isMotionComponent,\n isMotionValue,\n isValidMotionProp,\n LayoutGroup,\n LayoutGroupContext,\n LazyMotion,\n m,\n makeUseVisualState,\n mirrorEasing,\n mix,\n MotionConfig,\n MotionConfigContext,\n MotionContext,\n MotionGlobalConfig,\n motionValue,\n optimizedAppearDataAttribute,\n pipe,\n PresenceContext,\n progress,\n px,\n Reorder as MotionReorder,\n resolveMotionValue,\n reverseEasing,\n scroll,\n scrollInfo,\n spring,\n stagger,\n startOptimizedAppearAnimation,\n steps,\n SwitchLayoutGroupContext,\n sync,\n transform,\n unwrapMotionComponent,\n useAnimate,\n useAnimation as useMotionAnimation,\n useAnimationControls,\n useAnimationFrame,\n useCycle,\n useDeprecatedAnimatedState,\n useDeprecatedInvertedScale,\n useDomEvent,\n useDragControls,\n useElementScroll,\n useForceUpdate,\n useInstantLayoutTransition,\n useInstantTransition,\n useInView,\n useIsomorphicLayoutEffect,\n useIsPresent,\n useMotionTemplate,\n useMotionValue,\n useMotionValueEvent,\n usePresence,\n useReducedMotion,\n useReducedMotionConfig,\n useResetProjection,\n useScroll,\n useSpring,\n useTime,\n useTransform,\n useVelocity,\n useViewportScroll,\n useWillChange,\n VisualElement,\n visualElementStore,\n warning,\n wrap,\n} from \"framer-motion\"\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/motion.tsx","../src/forward-ref.tsx"],"sourcesContent":["import { ui } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"framer-motion\"\nimport { motionForwardRef } from \"./forward-ref\"\nimport type { MotionProps } from \"./motion.types\"\n\nconst disableStyleProps = [\"transition\"]\n\nconst disableStyleProp = (prop: string) => disableStyleProps.includes(prop)\n\nconst Component = ui<\"div\", Dict>(\"div\", { disableStyleProp })\n\n/**\n * `Motion` is a component that allows for the easy implementation of a wide variety of animations.\n *\n * @see Docs https://yamada-ui.com/components/other/motion\n */\nexport const Motion = motionForwardRef<MotionProps, \"div\">(\n ({ as = \"div\", className, ...rest }, ref) => (\n <Component\n ref={ref}\n as={motion[as]}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n ),\n)\n","import type { WithoutAs } from \"@yamada-ui/core\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport * as React from \"react\"\nimport type { MotionComponent, MotionAs } from \"./motion.types\"\n\nexport function motionForwardRef<Y extends object, M extends MotionAs>(\n render: React.ForwardRefRenderFunction<\n any,\n Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & { as?: MotionAs }\n >,\n) {\n return React.forwardRef(\n render as React.ForwardRefRenderFunction<any>,\n ) as unknown as MotionComponent<M, Y>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AAEnB,mBAAmB;AACnB,2BAAuB;;;ACDvB,YAAuB;AAGhB,SAAS,iBACd,QAIA;AACA,SAAa;AAAA,IACX;AAAA,EACF;AACF;;;ADMI;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,gBAAY,gBAAgB,OAAO,EAAE,iBAAiB,CAAC;AAOtD,IAAM,SAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QACnC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI,4BAAO,EAAE;AAAA,MACb,eAAW,iBAAG,aAAa,SAAS;AAAA,MACnC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/motion.tsx","../src/forward-ref.tsx"],"sourcesContent":["import type { Dict } from \"@yamada-ui/utils\"\nimport type { MotionProps } from \"./motion.types\"\nimport { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"framer-motion\"\nimport { motionForwardRef } from \"./forward-ref\"\n\nconst disableStyleProps = [\"transition\"]\n\nconst disableStyleProp = (prop: string) => disableStyleProps.includes(prop)\n\nconst Component = ui<\"div\", Dict>(\"div\", { disableStyleProp })\n\n/**\n * `Motion` is a component that allows for the easy implementation of a wide variety of animations.\n *\n * @see Docs https://yamada-ui.com/components/other/motion\n */\nexport const Motion = motionForwardRef<MotionProps, \"div\">(\n ({ as = \"div\", className, ...rest }, ref) => (\n <Component\n ref={ref}\n as={motion[as]}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n ),\n)\n","import type { WithoutAs } from \"@yamada-ui/core\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { MotionAs, MotionComponent } from \"./motion.types\"\nimport * as React from \"react\"\n\nexport function motionForwardRef<Y extends object, M extends MotionAs>(\n render: React.ForwardRefRenderFunction<\n any,\n { as?: MotionAs } & Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>>\n >,\n) {\n return React.forwardRef(\n render as React.ForwardRefRenderFunction<any>,\n ) as unknown as MotionComponent<M, Y>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAmB;AACnB,mBAAmB;AACnB,2BAAuB;;;ACDvB,YAAuB;AAEhB,SAAS,iBACd,QAIA;AACA,SAAa;AAAA,IACX;AAAA,EACF;AACF;;;ADMI;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,gBAAY,gBAAgB,OAAO,EAAE,iBAAiB,CAAC;AAOtD,IAAM,SAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QACnC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI,4BAAO,EAAE;AAAA,MACb,eAAW,iBAAG,aAAa,SAAS;AAAA,MACnC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
package/dist/motion.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import {
3
3
  Motion
4
- } from "./chunk-M6WLOAFU.mjs";
5
- import "./chunk-IBE7Q3Z3.mjs";
4
+ } from "./chunk-2V3EH5L5.mjs";
5
+ import "./chunk-RXCU3ZFK.mjs";
6
6
  export {
7
7
  Motion
8
8
  };
@@ -7,12 +7,12 @@ import * as React from 'react';
7
7
  interface MotionFactory {
8
8
  <T extends MotionAs = MotionAs, M extends object = {}>(el: T, options?: StyledOptions): UIMotionComponent<T, M>;
9
9
  }
10
- type ComponentConditionalProps<Y extends MotionAs, M extends MotionAs, D extends object = {}> = Y extends M ? OmitProps<React.ComponentProps<Y>, D> : OmitProps<React.ComponentProps<Y>, D> | OmitProps<React.ComponentProps<M>, D>;
11
- type ComponentProps<Y extends MotionAs, M extends MotionAs, D extends object = {}> = ComponentConditionalProps<Y, M, D> & {
10
+ type ComponentConditionalProps<Y extends MotionAs, M extends MotionAs, D extends object = {}> = Y extends M ? OmitProps<React.ComponentProps<Y>, D> : OmitProps<React.ComponentProps<M>, D> | OmitProps<React.ComponentProps<Y>, D>;
11
+ type ComponentProps<Y extends MotionAs, M extends MotionAs, D extends object = {}> = {
12
12
  as?: M;
13
- };
13
+ } & ComponentConditionalProps<Y, M, D>;
14
14
  interface MotionComponent<Y extends MotionAs, D extends object = {}> extends ComponentArgs {
15
- <M extends MotionAs = Y>(props: ComponentProps<Y, M, D>): JSX.Element;
15
+ <M extends MotionAs = Y>(props: ComponentProps<Y, M, D>): React.ReactElement;
16
16
  }
17
17
  type MotionAs = keyof DOMMotionComponents;
18
18
  type MotionComponents = {
@@ -29,7 +29,7 @@ type DOMAttributes<Y extends React.HTMLAttributes<M> | React.SVGAttributes<SVGEl
29
29
  type MotionProps<Y extends MotionAs = "div"> = Merge<DOMAttributes<FactoryAttributes<React.ReactDOM[Y]>, FactoryElement<React.ReactDOM[Y]>>, UIMotionProps>;
30
30
  type MotionPropsWithoutAs<Y extends MotionAs = "div"> = WithoutAs<MotionProps<Y>>;
31
31
  type MotionPropsWithoutChildren<Y extends MotionAs = "div"> = Omit<MotionProps<Y>, "children">;
32
- type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProps) => TargetAndTransition;
32
+ type TargetResolver<Y = Dict> = (props: MotionTransitionProps & Y) => TargetAndTransition;
33
33
  type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
34
34
  interface MotionTransitionVariants<Y = Dict> {
35
35
  enter: Variant<Y>;
@@ -40,22 +40,14 @@ type MotionLifecycleProps<Y> = {
40
40
  [key in "enter" | "exit"]?: Y;
41
41
  };
42
42
  interface MotionTransitionProps {
43
- /**
44
- * Custom `transition` definition for `enter` and `exit`.
45
- */
46
- transition?: MotionLifecycleProps<Transition>;
47
- /**
48
- * Custom `transitionEnd` definition for `enter` and `exit`.
49
- */
50
- transitionEnd?: MotionLifecycleProps<Target>;
51
43
  /**
52
44
  * Custom `delay` definition for `enter` and `exit`.
53
45
  */
54
- delay?: number | MotionLifecycleProps<number>;
46
+ delay?: MotionLifecycleProps<number> | number;
55
47
  /**
56
48
  * Custom `duration` definition for `enter` and `exit`.
57
49
  */
58
- duration?: number | MotionLifecycleProps<number>;
50
+ duration?: MotionLifecycleProps<number> | number;
59
51
  /**
60
52
  * Custom `enter`.
61
53
  */
@@ -68,16 +60,24 @@ interface MotionTransitionProps {
68
60
  * Custom `initial`.
69
61
  */
70
62
  initial?: any;
71
- }
72
- type WithTransitionProps<Y extends object> = Omit<Y, "variants" | "transition"> & MotionTransitionProps & {
73
63
  /**
74
- * If `true`, the element will unmount when `isOpen={false}` and animation is done.
64
+ * Custom `transition` definition for `enter` and `exit`.
75
65
  */
76
- unmountOnExit?: boolean;
66
+ transition?: MotionLifecycleProps<Transition>;
67
+ /**
68
+ * Custom `transitionEnd` definition for `enter` and `exit`.
69
+ */
70
+ transitionEnd?: MotionLifecycleProps<Target>;
71
+ }
72
+ type WithTransitionProps<Y extends object> = {
77
73
  /**
78
74
  * Show the component. triggers when enter or exit states.
79
75
  */
80
76
  isOpen?: boolean;
81
- };
77
+ /**
78
+ * If `true`, the element will unmount when `isOpen={false}` and animation is done.
79
+ */
80
+ unmountOnExit?: boolean;
81
+ } & MotionTransitionProps & Omit<Y, "transition" | "variants">;
82
82
 
83
83
  export type { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutAs, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, UIMotionComponent, WithTransitionProps };
@@ -7,12 +7,12 @@ import * as React from 'react';
7
7
  interface MotionFactory {
8
8
  <T extends MotionAs = MotionAs, M extends object = {}>(el: T, options?: StyledOptions): UIMotionComponent<T, M>;
9
9
  }
10
- type ComponentConditionalProps<Y extends MotionAs, M extends MotionAs, D extends object = {}> = Y extends M ? OmitProps<React.ComponentProps<Y>, D> : OmitProps<React.ComponentProps<Y>, D> | OmitProps<React.ComponentProps<M>, D>;
11
- type ComponentProps<Y extends MotionAs, M extends MotionAs, D extends object = {}> = ComponentConditionalProps<Y, M, D> & {
10
+ type ComponentConditionalProps<Y extends MotionAs, M extends MotionAs, D extends object = {}> = Y extends M ? OmitProps<React.ComponentProps<Y>, D> : OmitProps<React.ComponentProps<M>, D> | OmitProps<React.ComponentProps<Y>, D>;
11
+ type ComponentProps<Y extends MotionAs, M extends MotionAs, D extends object = {}> = {
12
12
  as?: M;
13
- };
13
+ } & ComponentConditionalProps<Y, M, D>;
14
14
  interface MotionComponent<Y extends MotionAs, D extends object = {}> extends ComponentArgs {
15
- <M extends MotionAs = Y>(props: ComponentProps<Y, M, D>): JSX.Element;
15
+ <M extends MotionAs = Y>(props: ComponentProps<Y, M, D>): React.ReactElement;
16
16
  }
17
17
  type MotionAs = keyof DOMMotionComponents;
18
18
  type MotionComponents = {
@@ -29,7 +29,7 @@ type DOMAttributes<Y extends React.HTMLAttributes<M> | React.SVGAttributes<SVGEl
29
29
  type MotionProps<Y extends MotionAs = "div"> = Merge<DOMAttributes<FactoryAttributes<React.ReactDOM[Y]>, FactoryElement<React.ReactDOM[Y]>>, UIMotionProps>;
30
30
  type MotionPropsWithoutAs<Y extends MotionAs = "div"> = WithoutAs<MotionProps<Y>>;
31
31
  type MotionPropsWithoutChildren<Y extends MotionAs = "div"> = Omit<MotionProps<Y>, "children">;
32
- type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProps) => TargetAndTransition;
32
+ type TargetResolver<Y = Dict> = (props: MotionTransitionProps & Y) => TargetAndTransition;
33
33
  type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
34
34
  interface MotionTransitionVariants<Y = Dict> {
35
35
  enter: Variant<Y>;
@@ -40,22 +40,14 @@ type MotionLifecycleProps<Y> = {
40
40
  [key in "enter" | "exit"]?: Y;
41
41
  };
42
42
  interface MotionTransitionProps {
43
- /**
44
- * Custom `transition` definition for `enter` and `exit`.
45
- */
46
- transition?: MotionLifecycleProps<Transition>;
47
- /**
48
- * Custom `transitionEnd` definition for `enter` and `exit`.
49
- */
50
- transitionEnd?: MotionLifecycleProps<Target>;
51
43
  /**
52
44
  * Custom `delay` definition for `enter` and `exit`.
53
45
  */
54
- delay?: number | MotionLifecycleProps<number>;
46
+ delay?: MotionLifecycleProps<number> | number;
55
47
  /**
56
48
  * Custom `duration` definition for `enter` and `exit`.
57
49
  */
58
- duration?: number | MotionLifecycleProps<number>;
50
+ duration?: MotionLifecycleProps<number> | number;
59
51
  /**
60
52
  * Custom `enter`.
61
53
  */
@@ -68,16 +60,24 @@ interface MotionTransitionProps {
68
60
  * Custom `initial`.
69
61
  */
70
62
  initial?: any;
71
- }
72
- type WithTransitionProps<Y extends object> = Omit<Y, "variants" | "transition"> & MotionTransitionProps & {
73
63
  /**
74
- * If `true`, the element will unmount when `isOpen={false}` and animation is done.
64
+ * Custom `transition` definition for `enter` and `exit`.
75
65
  */
76
- unmountOnExit?: boolean;
66
+ transition?: MotionLifecycleProps<Transition>;
67
+ /**
68
+ * Custom `transitionEnd` definition for `enter` and `exit`.
69
+ */
70
+ transitionEnd?: MotionLifecycleProps<Target>;
71
+ }
72
+ type WithTransitionProps<Y extends object> = {
77
73
  /**
78
74
  * Show the component. triggers when enter or exit states.
79
75
  */
80
76
  isOpen?: boolean;
81
- };
77
+ /**
78
+ * If `true`, the element will unmount when `isOpen={false}` and animation is done.
79
+ */
80
+ unmountOnExit?: boolean;
81
+ } & MotionTransitionProps & Omit<Y, "transition" | "variants">;
82
82
 
83
83
  export type { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutAs, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, UIMotionComponent, WithTransitionProps };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/motion.types.ts"],"sourcesContent":["import type {\n ComponentArgs,\n OmitProps,\n StyledOptions,\n UIProps,\n WithoutAs,\n} from \"@yamada-ui/core\"\nimport type { Dict, Merge } from \"@yamada-ui/utils\"\nimport type {\n DOMMotionComponents,\n Target,\n TargetAndTransition,\n Transition,\n MotionProps as OriginMotionProps,\n} from \"framer-motion\"\nimport type * as React from \"react\"\n\nexport type {\n MotionValue,\n AbsoluteKeyframe as MotionAbsoluteKeyframe,\n AnimatePresenceProps as MotionAnimatePresenceProps,\n AnimationControls as MotionAnimationControls,\n AnimationDefinition as MotionAnimationDefinition,\n AnimationLifecycles as MotionAnimationLifecycles,\n AnimationOptionsWithValueOverrides as MotionAnimationOptionsWithValueOverrides,\n AnimationPlaybackControls as MotionAnimationPlaybackControls,\n AnimationPlaybackLifecycles as MotionAnimationPlaybackLifecycles,\n AnimationPlaybackOptions as MotionAnimationPlaybackOptions,\n AnimationProps as MotionAnimationProps,\n AnimationScope as MotionAnimationScope,\n AnimationSequence as MotionAnimationSequence,\n AnimationType as MotionAnimationType,\n At as MotionAt,\n Axis as MotionAxis,\n AxisDelta as MotionAxisDelta,\n BezierDefinition as MotionBezierDefinition,\n BoundingBox as MotionBoundingBox,\n Box as MotionBox,\n CSSStyleDeclarationWithTransform,\n CreateVisualElement as MotionCreateVisualElement,\n CustomDomComponent as MotionCustomDomComponent,\n CustomValueType as MotionCustomValueType,\n Cycle as MotionCycle,\n CycleState as MotionCycleState,\n DOMKeyframesDefinition as MotionDOMKeyframesDefinition,\n DOMMotionComponents,\n DOMSegment as MotionDOMSegment,\n DOMSegmentWithTransition as MotionDOMSegmentWithTransition,\n DecayOptions as MotionDecayOptions,\n DelayedFunction as MotionDelayedFunction,\n Delta as MotionDelta,\n DevMessage as MotionDevMessage,\n DragElastic as MotionDragElastic,\n DragHandlers as MotionDragHandlers,\n DraggableProps as MotionDraggableProps,\n DurationSpringOptions as MotionDurationSpringOptions,\n DynamicAnimationOptions as MotionDynamicAnimationOptions,\n DynamicOption as MotionDynamicOption,\n Easing as MotionEasing,\n EasingDefinition as MotionEasingDefinition,\n EasingFunction as MotionEasingFunction,\n EasingModifier as MotionEasingModifier,\n ElementOrSelector as MotionElementOrSelector,\n EventInfo as MotionEventInfo,\n FeatureBundle as MotionFeatureBundle,\n FeatureDefinition as MotionFeatureDefinition,\n FeatureDefinitions as MotionFeatureDefinitions,\n FeaturePackage as MotionFeaturePackage,\n FeaturePackages as MotionFeaturePackages,\n FocusHandlers as MotionFocusHandlers,\n HoverHandlers as MotionHoverHandlers,\n HydratedFeatureDefinition as MotionHydratedFeatureDefinition,\n HydratedFeatureDefinitions as MotionHydratedFeatureDefinitions,\n HTMLMotionProps,\n IProjectionNode as MotionIProjectionNode,\n Inertia as MotionInertia,\n InertiaOptions as MotionInertiaOptions,\n InterpolateOptions as MotionInterpolateOptions,\n KeyframeOptions as MotionKeyframeOptions,\n Keyframes as MotionKeyframes,\n KeyframesTarget as MotionKeyframesTarget,\n LayoutProps as MotionLayoutProps,\n LazyFeatureBundle as MotionLazyFeatureBundle,\n LazyProps as MotionLazyProps,\n MixerFactory as MotionMixerFactory,\n MotionAdvancedProps,\n MotionConfigProps,\n MotionStyle,\n MotionTransform,\n MotionValueSegment,\n MotionValueSegmentWithTransition,\n None as MotionNone,\n Orchestration as MotionOrchestration,\n PanHandlers as MotionPanHandlers,\n PanInfo as MotionPanInfo,\n PassiveEffect as MotionPassiveEffect,\n Point as MotionPoint,\n RelayoutInfo as MotionRelayoutInfo,\n RenderComponent as MotionRenderComponent,\n Repeat as MotionRepeat,\n RepeatType as MotionRepeatType,\n ResolveKeyframes as MotionResolveKeyframes,\n ResolveLayoutTransition as MotionResolveLayoutTransition,\n ResolvedAnimationDefinition as MotionResolvedAnimationDefinition,\n ResolvedAnimationDefinitions as MotionResolvedAnimationDefinitions,\n ResolvedKeyframesTarget as MotionResolvedKeyframesTarget,\n ResolvedSingleTarget as MotionResolvedSingleTarget,\n ResolvedValueTarget as MotionResolvedValueTarget,\n ResolvedValues as MotionResolvedValues,\n SVGAttributesAsMotionValues,\n SVGKeyframesDefinition,\n SVGMotionProps,\n SVGPathKeyframesDefinition,\n SVGPathTransitions,\n SVGTransitions,\n ScrapeMotionValuesFromProps,\n ScrollMotionValues,\n Segment as MotionSegment,\n SequenceLabel as MotionSequenceLabel,\n SequenceLabelWithTime as MotionSequenceLabelWithTime,\n SequenceMap as MotionSequenceMap,\n SequenceOptions as MotionSequenceOptions,\n SequenceTime as MotionSequenceTime,\n SingleTarget as MotionSingleTarget,\n Spring as MotionSpring,\n SpringOptions as MotionSpringOptions,\n StyleKeyframesDefinition as MotionStyleKeyframesDefinition,\n StyleTransitions as MotionStyleTransitions,\n Subscriber as MotionSubscriber,\n TapHandlers as MotionTapHandlers,\n TapInfo as MotionTapInfo,\n Target as MotionTarget,\n TargetAndTransition as MotionTargetAndTransition,\n TransformPoint as MotionTransformPoint,\n Transition as MotionTransition,\n Tween as MotionTween,\n UnresolvedValueKeyframe as MotionUnresolvedValueKeyframe,\n UseInViewOptions as MotionUseInViewOptions,\n ValueAnimationOptions as MotionValueAnimationOptions,\n ValueAnimationTransition as MotionValueAnimationTransition,\n ValueKeyframe as MotionValueKeyframe,\n ValueKeyframesDefinition as MotionValueKeyframesDefinition,\n ValueSequence as MotionValueSequence,\n ValueTarget as MotionValueTarget,\n ValueType as MotionValueType,\n VariableKeyframesDefinition as MotionVariableKeyframesDefinition,\n VariableTransitions as MotionVariableTransitions,\n Variant as MotionVariant,\n VariantLabels as MotionVariantLabels,\n Variants as MotionVariants,\n VelocityOptions as MotionVelocityOptions,\n VisualState as MotionVisualState,\n} from \"framer-motion\"\n\nexport interface MotionFactory {\n <T extends MotionAs = MotionAs, M extends object = {}>(\n el: T,\n options?: StyledOptions,\n ): UIMotionComponent<T, M>\n}\n\ntype ComponentConditionalProps<\n Y extends MotionAs,\n M extends MotionAs,\n D extends object = {},\n> = Y extends M\n ? OmitProps<React.ComponentProps<Y>, D>\n :\n | OmitProps<React.ComponentProps<Y>, D>\n | OmitProps<React.ComponentProps<M>, D>\n\ntype ComponentProps<\n Y extends MotionAs,\n M extends MotionAs,\n D extends object = {},\n> = ComponentConditionalProps<Y, M, D> & {\n as?: M\n}\n\nexport interface MotionComponent<Y extends MotionAs, D extends object = {}>\n extends ComponentArgs {\n <M extends MotionAs = Y>(props: ComponentProps<Y, M, D>): JSX.Element\n}\n\nexport type MotionAs = keyof DOMMotionComponents\n\nexport type MotionComponents = {\n [Y in MotionAs]: UIMotionComponent<Y>\n}\n\nexport interface UIMotionComponent<Y extends MotionAs, M extends object = {}>\n extends MotionComponent<Y, Merge<UIMotionProps, M>> {}\n\ninterface UIMotionProps extends Merge<UIProps, OriginMotionProps> {\n as?: MotionAs\n}\n\ntype FactoryAttributes<Y> =\n Y extends React.DetailedHTMLFactory<infer M, any>\n ? M\n : Y extends React.SVGFactory\n ? React.SVGAttributes<SVGElement>\n : never\ntype FactoryElement<Y> =\n Y extends React.DetailedHTMLFactory<any, infer M>\n ? M\n : Y extends React.SVGFactory\n ? SVGElement\n : never\ntype DOMAttributes<\n Y extends React.HTMLAttributes<M> | React.SVGAttributes<SVGElement>,\n M extends HTMLElement | SVGElement,\n> = Y\n\nexport type MotionProps<Y extends MotionAs = \"div\"> = Merge<\n DOMAttributes<\n FactoryAttributes<React.ReactDOM[Y]>,\n FactoryElement<React.ReactDOM[Y]>\n >,\n UIMotionProps\n>\n\nexport type MotionPropsWithoutAs<Y extends MotionAs = \"div\"> = WithoutAs<\n MotionProps<Y>\n>\n\nexport type MotionPropsWithoutChildren<Y extends MotionAs = \"div\"> = Omit<\n MotionProps<Y>,\n \"children\"\n>\n\ntype TargetResolver<Y = Dict> = (\n props: Y & MotionTransitionProps,\n) => TargetAndTransition\n\ntype Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>\n\nexport interface MotionTransitionVariants<Y = Dict> {\n enter: Variant<Y>\n exit: Variant<Y>\n initial?: Variant<Y>\n}\n\ntype MotionLifecycleProps<Y> = { [key in \"enter\" | \"exit\"]?: Y }\n\nexport interface MotionTransitionProps {\n /**\n * Custom `transition` definition for `enter` and `exit`.\n */\n transition?: MotionLifecycleProps<Transition>\n /**\n * Custom `transitionEnd` definition for `enter` and `exit`.\n */\n transitionEnd?: MotionLifecycleProps<Target>\n /**\n * Custom `delay` definition for `enter` and `exit`.\n */\n delay?: number | MotionLifecycleProps<number>\n /**\n * Custom `duration` definition for `enter` and `exit`.\n */\n duration?: number | MotionLifecycleProps<number>\n /**\n * Custom `enter`.\n */\n enter?: any\n /**\n * Custom `exit`.\n */\n exit?: any\n /**\n * Custom `initial`.\n */\n initial?: any\n}\n\nexport type WithTransitionProps<Y extends object> = Omit<\n Y,\n \"variants\" | \"transition\"\n> &\n MotionTransitionProps & {\n /**\n * If `true`, the element will unmount when `isOpen={false}` and animation is done.\n */\n unmountOnExit?: boolean\n /**\n * Show the component. triggers when enter or exit states.\n */\n isOpen?: boolean\n }\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/motion.types.ts"],"sourcesContent":["import type {\n ComponentArgs,\n OmitProps,\n StyledOptions,\n UIProps,\n WithoutAs,\n} from \"@yamada-ui/core\"\nimport type { Dict, Merge } from \"@yamada-ui/utils\"\nimport type {\n DOMMotionComponents,\n MotionProps as OriginMotionProps,\n Target,\n TargetAndTransition,\n Transition,\n} from \"framer-motion\"\nimport type * as React from \"react\"\n\nexport type {\n AbsoluteKeyframe as MotionAbsoluteKeyframe,\n AnimatePresenceProps as MotionAnimatePresenceProps,\n AnimationControls as MotionAnimationControls,\n AnimationDefinition as MotionAnimationDefinition,\n AnimationLifecycles as MotionAnimationLifecycles,\n AnimationOptionsWithValueOverrides as MotionAnimationOptionsWithValueOverrides,\n AnimationPlaybackControls as MotionAnimationPlaybackControls,\n AnimationPlaybackLifecycles as MotionAnimationPlaybackLifecycles,\n AnimationPlaybackOptions as MotionAnimationPlaybackOptions,\n AnimationProps as MotionAnimationProps,\n AnimationScope as MotionAnimationScope,\n AnimationSequence as MotionAnimationSequence,\n AnimationType as MotionAnimationType,\n At as MotionAt,\n Axis as MotionAxis,\n AxisDelta as MotionAxisDelta,\n BezierDefinition as MotionBezierDefinition,\n BoundingBox as MotionBoundingBox,\n Box as MotionBox,\n CreateVisualElement as MotionCreateVisualElement,\n CSSStyleDeclarationWithTransform,\n CustomDomComponent as MotionCustomDomComponent,\n CustomValueType as MotionCustomValueType,\n Cycle as MotionCycle,\n CycleState as MotionCycleState,\n DecayOptions as MotionDecayOptions,\n DelayedFunction as MotionDelayedFunction,\n Delta as MotionDelta,\n DevMessage as MotionDevMessage,\n DOMKeyframesDefinition as MotionDOMKeyframesDefinition,\n DOMMotionComponents,\n DOMSegment as MotionDOMSegment,\n DOMSegmentWithTransition as MotionDOMSegmentWithTransition,\n DragElastic as MotionDragElastic,\n DraggableProps as MotionDraggableProps,\n DragHandlers as MotionDragHandlers,\n DurationSpringOptions as MotionDurationSpringOptions,\n DynamicAnimationOptions as MotionDynamicAnimationOptions,\n DynamicOption as MotionDynamicOption,\n Easing as MotionEasing,\n EasingDefinition as MotionEasingDefinition,\n EasingFunction as MotionEasingFunction,\n EasingModifier as MotionEasingModifier,\n ElementOrSelector as MotionElementOrSelector,\n EventInfo as MotionEventInfo,\n FeatureBundle as MotionFeatureBundle,\n FeatureDefinition as MotionFeatureDefinition,\n FeatureDefinitions as MotionFeatureDefinitions,\n FeaturePackage as MotionFeaturePackage,\n FeaturePackages as MotionFeaturePackages,\n FocusHandlers as MotionFocusHandlers,\n HoverHandlers as MotionHoverHandlers,\n HTMLMotionProps,\n HydratedFeatureDefinition as MotionHydratedFeatureDefinition,\n HydratedFeatureDefinitions as MotionHydratedFeatureDefinitions,\n Inertia as MotionInertia,\n InertiaOptions as MotionInertiaOptions,\n InterpolateOptions as MotionInterpolateOptions,\n IProjectionNode as MotionIProjectionNode,\n KeyframeOptions as MotionKeyframeOptions,\n Keyframes as MotionKeyframes,\n KeyframesTarget as MotionKeyframesTarget,\n LayoutProps as MotionLayoutProps,\n LazyFeatureBundle as MotionLazyFeatureBundle,\n LazyProps as MotionLazyProps,\n MixerFactory as MotionMixerFactory,\n MotionAdvancedProps,\n MotionConfigProps,\n MotionStyle,\n MotionTransform,\n MotionValue,\n MotionValueSegment,\n MotionValueSegmentWithTransition,\n None as MotionNone,\n Orchestration as MotionOrchestration,\n PanHandlers as MotionPanHandlers,\n PanInfo as MotionPanInfo,\n PassiveEffect as MotionPassiveEffect,\n Point as MotionPoint,\n RelayoutInfo as MotionRelayoutInfo,\n RenderComponent as MotionRenderComponent,\n Repeat as MotionRepeat,\n RepeatType as MotionRepeatType,\n ResolvedAnimationDefinition as MotionResolvedAnimationDefinition,\n ResolvedAnimationDefinitions as MotionResolvedAnimationDefinitions,\n ResolvedKeyframesTarget as MotionResolvedKeyframesTarget,\n ResolvedSingleTarget as MotionResolvedSingleTarget,\n ResolvedValues as MotionResolvedValues,\n ResolvedValueTarget as MotionResolvedValueTarget,\n ResolveKeyframes as MotionResolveKeyframes,\n ResolveLayoutTransition as MotionResolveLayoutTransition,\n ScrapeMotionValuesFromProps,\n ScrollMotionValues,\n Segment as MotionSegment,\n SequenceLabel as MotionSequenceLabel,\n SequenceLabelWithTime as MotionSequenceLabelWithTime,\n SequenceMap as MotionSequenceMap,\n SequenceOptions as MotionSequenceOptions,\n SequenceTime as MotionSequenceTime,\n SingleTarget as MotionSingleTarget,\n Spring as MotionSpring,\n SpringOptions as MotionSpringOptions,\n StyleKeyframesDefinition as MotionStyleKeyframesDefinition,\n StyleTransitions as MotionStyleTransitions,\n Subscriber as MotionSubscriber,\n SVGAttributesAsMotionValues,\n SVGKeyframesDefinition,\n SVGMotionProps,\n SVGPathKeyframesDefinition,\n SVGPathTransitions,\n SVGTransitions,\n TapHandlers as MotionTapHandlers,\n TapInfo as MotionTapInfo,\n Target as MotionTarget,\n TargetAndTransition as MotionTargetAndTransition,\n TransformPoint as MotionTransformPoint,\n Transition as MotionTransition,\n Tween as MotionTween,\n UnresolvedValueKeyframe as MotionUnresolvedValueKeyframe,\n UseInViewOptions as MotionUseInViewOptions,\n ValueAnimationOptions as MotionValueAnimationOptions,\n ValueAnimationTransition as MotionValueAnimationTransition,\n ValueKeyframe as MotionValueKeyframe,\n ValueKeyframesDefinition as MotionValueKeyframesDefinition,\n ValueSequence as MotionValueSequence,\n ValueTarget as MotionValueTarget,\n ValueType as MotionValueType,\n VariableKeyframesDefinition as MotionVariableKeyframesDefinition,\n VariableTransitions as MotionVariableTransitions,\n Variant as MotionVariant,\n VariantLabels as MotionVariantLabels,\n Variants as MotionVariants,\n VelocityOptions as MotionVelocityOptions,\n VisualState as MotionVisualState,\n} from \"framer-motion\"\n\nexport interface MotionFactory {\n <T extends MotionAs = MotionAs, M extends object = {}>(\n el: T,\n options?: StyledOptions,\n ): UIMotionComponent<T, M>\n}\n\ntype ComponentConditionalProps<\n Y extends MotionAs,\n M extends MotionAs,\n D extends object = {},\n> = Y extends M\n ? OmitProps<React.ComponentProps<Y>, D>\n :\n | OmitProps<React.ComponentProps<M>, D>\n | OmitProps<React.ComponentProps<Y>, D>\n\ntype ComponentProps<\n Y extends MotionAs,\n M extends MotionAs,\n D extends object = {},\n> = {\n as?: M\n} & ComponentConditionalProps<Y, M, D>\n\nexport interface MotionComponent<Y extends MotionAs, D extends object = {}>\n extends ComponentArgs {\n <M extends MotionAs = Y>(props: ComponentProps<Y, M, D>): React.ReactElement\n}\n\nexport type MotionAs = keyof DOMMotionComponents\n\nexport type MotionComponents = {\n [Y in MotionAs]: UIMotionComponent<Y>\n}\n\nexport interface UIMotionComponent<Y extends MotionAs, M extends object = {}>\n extends MotionComponent<Y, Merge<UIMotionProps, M>> {}\n\ninterface UIMotionProps extends Merge<UIProps, OriginMotionProps> {\n as?: MotionAs\n}\n\ntype FactoryAttributes<Y> =\n Y extends React.DetailedHTMLFactory<infer M, any>\n ? M\n : Y extends React.SVGFactory\n ? React.SVGAttributes<SVGElement>\n : never\ntype FactoryElement<Y> =\n Y extends React.DetailedHTMLFactory<any, infer M>\n ? M\n : Y extends React.SVGFactory\n ? SVGElement\n : never\ntype DOMAttributes<\n Y extends React.HTMLAttributes<M> | React.SVGAttributes<SVGElement>,\n M extends HTMLElement | SVGElement,\n> = Y\n\nexport type MotionProps<Y extends MotionAs = \"div\"> = Merge<\n DOMAttributes<\n FactoryAttributes<React.ReactDOM[Y]>,\n FactoryElement<React.ReactDOM[Y]>\n >,\n UIMotionProps\n>\n\nexport type MotionPropsWithoutAs<Y extends MotionAs = \"div\"> = WithoutAs<\n MotionProps<Y>\n>\n\nexport type MotionPropsWithoutChildren<Y extends MotionAs = \"div\"> = Omit<\n MotionProps<Y>,\n \"children\"\n>\n\ntype TargetResolver<Y = Dict> = (\n props: MotionTransitionProps & Y,\n) => TargetAndTransition\n\ntype Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>\n\nexport interface MotionTransitionVariants<Y = Dict> {\n enter: Variant<Y>\n exit: Variant<Y>\n initial?: Variant<Y>\n}\n\ntype MotionLifecycleProps<Y> = { [key in \"enter\" | \"exit\"]?: Y }\n\nexport interface MotionTransitionProps {\n /**\n * Custom `delay` definition for `enter` and `exit`.\n */\n delay?: MotionLifecycleProps<number> | number\n /**\n * Custom `duration` definition for `enter` and `exit`.\n */\n duration?: MotionLifecycleProps<number> | number\n /**\n * Custom `enter`.\n */\n enter?: any\n /**\n * Custom `exit`.\n */\n exit?: any\n /**\n * Custom `initial`.\n */\n initial?: any\n /**\n * Custom `transition` definition for `enter` and `exit`.\n */\n transition?: MotionLifecycleProps<Transition>\n /**\n * Custom `transitionEnd` definition for `enter` and `exit`.\n */\n transitionEnd?: MotionLifecycleProps<Target>\n}\n\nexport type WithTransitionProps<Y extends object> = {\n /**\n * Show the component. triggers when enter or exit states.\n */\n isOpen?: boolean\n /**\n * If `true`, the element will unmount when `isOpen={false}` and animation is done.\n */\n unmountOnExit?: boolean\n} & MotionTransitionProps &\n Omit<Y, \"transition\" | \"variants\">\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,3 +1,2 @@
1
1
  "use client"
2
- import "./chunk-R3D52RAW.mjs";
3
2
  //# sourceMappingURL=motion.types.mjs.map
package/dist/utils.d.mts CHANGED
@@ -7,24 +7,24 @@ import 'react';
7
7
  declare const MOTION_TRANSITION_EASINGS: {
8
8
  readonly ease: readonly [0.25, 0.1, 0.25, 1];
9
9
  readonly easeIn: readonly [0.4, 0, 1, 1];
10
- readonly easeOut: readonly [0, 0, 0.2, 1];
11
10
  readonly easeInOut: readonly [0.4, 0, 0.2, 1];
11
+ readonly easeOut: readonly [0, 0, 0.2, 1];
12
12
  };
13
13
  declare const MOTION_TRANSITION_VARIANTS: {
14
- readonly scale: {
14
+ readonly fade: {
15
15
  readonly enter: {
16
- readonly scale: 1;
16
+ readonly opacity: 1;
17
17
  };
18
18
  readonly exit: {
19
- readonly scale: 0.95;
19
+ readonly opacity: 0;
20
20
  };
21
21
  };
22
- readonly fade: {
22
+ readonly pushDown: {
23
23
  readonly enter: {
24
- readonly opacity: 1;
24
+ readonly y: "-100%";
25
25
  };
26
26
  readonly exit: {
27
- readonly opacity: 0;
27
+ readonly y: "30%";
28
28
  };
29
29
  };
30
30
  readonly pushLeft: {
@@ -51,21 +51,31 @@ declare const MOTION_TRANSITION_VARIANTS: {
51
51
  readonly y: "-30%";
52
52
  };
53
53
  };
54
- readonly pushDown: {
54
+ readonly scale: {
55
55
  readonly enter: {
56
- readonly y: "-100%";
56
+ readonly scale: 1;
57
57
  };
58
58
  readonly exit: {
59
- readonly y: "30%";
59
+ readonly scale: 0.95;
60
60
  };
61
61
  };
62
- readonly slideLeft: {
62
+ readonly slideDown: {
63
+ readonly enter: {
64
+ readonly x: 0;
65
+ readonly y: 0;
66
+ };
67
+ readonly exit: {
68
+ readonly x: 0;
69
+ readonly y: "100%";
70
+ };
63
71
  readonly position: {
64
- readonly left: 0;
65
- readonly top: 0;
66
72
  readonly bottom: 0;
67
- readonly width: "100%";
73
+ readonly left: 0;
74
+ readonly maxWidth: "100vw";
75
+ readonly right: 0;
68
76
  };
77
+ };
78
+ readonly slideLeft: {
69
79
  readonly enter: {
70
80
  readonly x: 0;
71
81
  readonly y: 0;
@@ -74,14 +84,14 @@ declare const MOTION_TRANSITION_VARIANTS: {
74
84
  readonly x: "-100%";
75
85
  readonly y: 0;
76
86
  };
77
- };
78
- readonly slideRight: {
79
87
  readonly position: {
80
- readonly right: 0;
81
- readonly top: 0;
82
88
  readonly bottom: 0;
89
+ readonly left: 0;
90
+ readonly top: 0;
83
91
  readonly width: "100%";
84
92
  };
93
+ };
94
+ readonly slideRight: {
85
95
  readonly enter: {
86
96
  readonly x: 0;
87
97
  readonly y: 0;
@@ -90,14 +100,14 @@ declare const MOTION_TRANSITION_VARIANTS: {
90
100
  readonly x: "100%";
91
101
  readonly y: 0;
92
102
  };
93
- };
94
- readonly slideUp: {
95
103
  readonly position: {
96
- readonly top: 0;
97
- readonly left: 0;
104
+ readonly bottom: 0;
98
105
  readonly right: 0;
99
- readonly maxWidth: "100vw";
106
+ readonly top: 0;
107
+ readonly width: "100%";
100
108
  };
109
+ };
110
+ readonly slideUp: {
101
111
  readonly enter: {
102
112
  readonly x: 0;
103
113
  readonly y: 0;
@@ -106,21 +116,11 @@ declare const MOTION_TRANSITION_VARIANTS: {
106
116
  readonly x: 0;
107
117
  readonly y: "-100%";
108
118
  };
109
- };
110
- readonly slideDown: {
111
119
  readonly position: {
112
- readonly bottom: 0;
113
120
  readonly left: 0;
114
- readonly right: 0;
115
121
  readonly maxWidth: "100vw";
116
- };
117
- readonly enter: {
118
- readonly x: 0;
119
- readonly y: 0;
120
- };
121
- readonly exit: {
122
- readonly x: 0;
123
- readonly y: "100%";
122
+ readonly right: 0;
123
+ readonly top: 0;
124
124
  };
125
125
  };
126
126
  };
package/dist/utils.d.ts CHANGED
@@ -7,24 +7,24 @@ import 'react';
7
7
  declare const MOTION_TRANSITION_EASINGS: {
8
8
  readonly ease: readonly [0.25, 0.1, 0.25, 1];
9
9
  readonly easeIn: readonly [0.4, 0, 1, 1];
10
- readonly easeOut: readonly [0, 0, 0.2, 1];
11
10
  readonly easeInOut: readonly [0.4, 0, 0.2, 1];
11
+ readonly easeOut: readonly [0, 0, 0.2, 1];
12
12
  };
13
13
  declare const MOTION_TRANSITION_VARIANTS: {
14
- readonly scale: {
14
+ readonly fade: {
15
15
  readonly enter: {
16
- readonly scale: 1;
16
+ readonly opacity: 1;
17
17
  };
18
18
  readonly exit: {
19
- readonly scale: 0.95;
19
+ readonly opacity: 0;
20
20
  };
21
21
  };
22
- readonly fade: {
22
+ readonly pushDown: {
23
23
  readonly enter: {
24
- readonly opacity: 1;
24
+ readonly y: "-100%";
25
25
  };
26
26
  readonly exit: {
27
- readonly opacity: 0;
27
+ readonly y: "30%";
28
28
  };
29
29
  };
30
30
  readonly pushLeft: {
@@ -51,21 +51,31 @@ declare const MOTION_TRANSITION_VARIANTS: {
51
51
  readonly y: "-30%";
52
52
  };
53
53
  };
54
- readonly pushDown: {
54
+ readonly scale: {
55
55
  readonly enter: {
56
- readonly y: "-100%";
56
+ readonly scale: 1;
57
57
  };
58
58
  readonly exit: {
59
- readonly y: "30%";
59
+ readonly scale: 0.95;
60
60
  };
61
61
  };
62
- readonly slideLeft: {
62
+ readonly slideDown: {
63
+ readonly enter: {
64
+ readonly x: 0;
65
+ readonly y: 0;
66
+ };
67
+ readonly exit: {
68
+ readonly x: 0;
69
+ readonly y: "100%";
70
+ };
63
71
  readonly position: {
64
- readonly left: 0;
65
- readonly top: 0;
66
72
  readonly bottom: 0;
67
- readonly width: "100%";
73
+ readonly left: 0;
74
+ readonly maxWidth: "100vw";
75
+ readonly right: 0;
68
76
  };
77
+ };
78
+ readonly slideLeft: {
69
79
  readonly enter: {
70
80
  readonly x: 0;
71
81
  readonly y: 0;
@@ -74,14 +84,14 @@ declare const MOTION_TRANSITION_VARIANTS: {
74
84
  readonly x: "-100%";
75
85
  readonly y: 0;
76
86
  };
77
- };
78
- readonly slideRight: {
79
87
  readonly position: {
80
- readonly right: 0;
81
- readonly top: 0;
82
88
  readonly bottom: 0;
89
+ readonly left: 0;
90
+ readonly top: 0;
83
91
  readonly width: "100%";
84
92
  };
93
+ };
94
+ readonly slideRight: {
85
95
  readonly enter: {
86
96
  readonly x: 0;
87
97
  readonly y: 0;
@@ -90,14 +100,14 @@ declare const MOTION_TRANSITION_VARIANTS: {
90
100
  readonly x: "100%";
91
101
  readonly y: 0;
92
102
  };
93
- };
94
- readonly slideUp: {
95
103
  readonly position: {
96
- readonly top: 0;
97
- readonly left: 0;
104
+ readonly bottom: 0;
98
105
  readonly right: 0;
99
- readonly maxWidth: "100vw";
106
+ readonly top: 0;
107
+ readonly width: "100%";
100
108
  };
109
+ };
110
+ readonly slideUp: {
101
111
  readonly enter: {
102
112
  readonly x: 0;
103
113
  readonly y: 0;
@@ -106,21 +116,11 @@ declare const MOTION_TRANSITION_VARIANTS: {
106
116
  readonly x: 0;
107
117
  readonly y: "-100%";
108
118
  };
109
- };
110
- readonly slideDown: {
111
119
  readonly position: {
112
- readonly bottom: 0;
113
120
  readonly left: 0;
114
- readonly right: 0;
115
121
  readonly maxWidth: "100vw";
116
- };
117
- readonly enter: {
118
- readonly x: 0;
119
- readonly y: 0;
120
- };
121
- readonly exit: {
122
- readonly x: 0;
123
- readonly y: "100%";
122
+ readonly right: 0;
123
+ readonly top: 0;
124
124
  };
125
125
  };
126
126
  };