@yamada-ui/motion 1.0.1 → 1.0.3-dev-20231230014952

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.
@@ -22,4 +22,4 @@ var Motion = forwardRef(
22
22
  export {
23
23
  Motion
24
24
  };
25
- //# sourceMappingURL=chunk-BRU5IQGF.mjs.map
25
+ //# sourceMappingURL=chunk-CC4SJRTT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import type { HTMLUIProps, OmitProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { HTMLMotionProps } from \"framer-motion\"\nimport { motion } from \"framer-motion\"\nimport type { ReactHTML } from \"react\"\nimport type { MotionAs } from \"./motion.types\"\n\ntype UIProps = \"children\" | \"color\"\n\ntype MotionOptions = {\n as?: MotionAs\n}\n\nexport type MotionProps<Y extends keyof ReactHTML = \"div\"> = OmitProps<\n HTMLUIProps<Y>,\n keyof Omit<HTMLMotionProps<Y>, UIProps>\n> &\n Omit<HTMLMotionProps<Y>, UIProps> &\n MotionOptions\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/others/#motion\n */\nexport const Motion = forwardRef<MotionProps, \"div\", false>(\n ({ as = \"div\", className, ...rest }, ref) => {\n return (\n <ui.div\n as={motion[as]}\n ref={ref}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;AACA,SAAS,IAAI,kBAAkB;AAC/B,SAAS,UAAU;AAEnB,SAAS,cAAc;AAyBjB;AAHC,IAAM,SAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC3C,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC,IAAI,OAAO,EAAE;AAAA,QACb;AAAA,QACA,WAAW,GAAG,aAAa,SAAS;AAAA,QACnC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":[]}
package/dist/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { AnimatePresence, DragControls, HTMLMotionProps, LayoutGroup, LazyMotion, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptions as MotionAnimationOptions, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationProps as MotionAnimationProps, AnimationType as MotionAnimationType, MotionConfig, MotionConfigProps, LayoutProps as MotionLayoutProps, LazyProps as MotionLazyProps, Reorder as MotionReorder, MotionStyle, Transition as MotionTransition, MotionValue, Variants as MotionVariants, SVGMotionProps, m, motion, transform, useCycle, useDragControls, useInView, useIsPresent, useAnimation as useMotionAnimation, useAnimationControls as useMotionAnimationControls, useAnimationFrame as useMotionAnimationFrame, useMotionTemplate, useMotionValue, useMotionValueEvent, useReducedMotion, useScroll, useSpring, useTime, useTransform, useVelocity, useViewportScroll } from 'framer-motion';
2
- export { Motion, MotionProps } from './motion.mjs';
3
- export { MotionDelayProps, MotionDurationProps, MotionTransitionEndProps, MotionTransitionProperties, MotionTransitionProps, MotionTransitionVariants, WithTransitionProps } from './motion.types.mjs';
2
+ export { a as Motion, c as MotionAs, g as MotionDelayProps, h as MotionDurationProps, b as MotionProps, f as MotionTransitionEndProps, M as MotionTransitionProperties, e as MotionTransitionProps, d as MotionTransitionVariants, i as MotionUIPropGetter, R as RequiredMotionUIPropGetter, W as WithTransitionProps } from './motion-6FH35pOn.mjs';
4
3
  export { MOTION_TRANSITION_DEFAULTS, MOTION_TRANSITION_EASINGS, MOTION_TRANSITION_VARIANTS, transitionEnter, transitionExit } from './utils.mjs';
5
4
  import '@yamada-ui/core';
6
5
  import 'react';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { AnimatePresence, DragControls, HTMLMotionProps, LayoutGroup, LazyMotion, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptions as MotionAnimationOptions, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationProps as MotionAnimationProps, AnimationType as MotionAnimationType, MotionConfig, MotionConfigProps, LayoutProps as MotionLayoutProps, LazyProps as MotionLazyProps, Reorder as MotionReorder, MotionStyle, Transition as MotionTransition, MotionValue, Variants as MotionVariants, SVGMotionProps, m, motion, transform, useCycle, useDragControls, useInView, useIsPresent, useAnimation as useMotionAnimation, useAnimationControls as useMotionAnimationControls, useAnimationFrame as useMotionAnimationFrame, useMotionTemplate, useMotionValue, useMotionValueEvent, useReducedMotion, useScroll, useSpring, useTime, useTransform, useVelocity, useViewportScroll } from 'framer-motion';
2
- export { Motion, MotionProps } from './motion.js';
3
- export { MotionDelayProps, MotionDurationProps, MotionTransitionEndProps, MotionTransitionProperties, MotionTransitionProps, MotionTransitionVariants, WithTransitionProps } from './motion.types.js';
2
+ export { a as Motion, c as MotionAs, g as MotionDelayProps, h as MotionDurationProps, b as MotionProps, f as MotionTransitionEndProps, M as MotionTransitionProperties, e as MotionTransitionProps, d as MotionTransitionVariants, i as MotionUIPropGetter, R as RequiredMotionUIPropGetter, W as WithTransitionProps } from './motion-6FH35pOn.js';
4
3
  export { MOTION_TRANSITION_DEFAULTS, MOTION_TRANSITION_EASINGS, MOTION_TRANSITION_VARIANTS, transitionEnter, transitionExit } from './utils.js';
5
4
  import '@yamada-ui/core';
6
5
  import 'react';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/motion.tsx","../src/utils.ts"],"sourcesContent":["export {\n m,\n motion,\n AnimatePresence,\n LayoutGroup,\n LazyMotion,\n MotionConfig,\n Reorder as MotionReorder,\n useMotionTemplate,\n useScroll,\n useSpring,\n useTime,\n useTransform,\n transform,\n useVelocity,\n useViewportScroll,\n useAnimation as useMotionAnimation,\n useAnimationControls as useMotionAnimationControls,\n useAnimationFrame as useMotionAnimationFrame,\n useDragControls,\n useInView,\n useIsPresent,\n useReducedMotion,\n useMotionValue,\n useMotionValueEvent,\n useCycle,\n} from \"framer-motion\"\nexport { Motion } from \"./motion\"\nexport type { MotionProps } from \"./motion\"\nexport * from \"./motion.types\"\nexport * from \"./utils\"\n","import type { HTMLUIProps, OmitProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { HTMLMotionProps } from \"framer-motion\"\nimport { motion } from \"framer-motion\"\nimport type { ReactHTML } from \"react\"\n\ntype MotionOptions = {\n as?: keyof typeof motion\n}\n\nexport type MotionProps<Y extends keyof ReactHTML = \"div\"> = OmitProps<\n HTMLUIProps<Y>,\n keyof HTMLMotionProps<Y>\n> &\n HTMLMotionProps<Y> &\n MotionOptions\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/styled-system/animation#motion\n */\nexport const Motion = forwardRef<MotionProps, \"div\", false>(\n ({ as = \"div\", className, ...rest }, ref) => {\n return (\n <ui.div\n as={motion[as]}\n ref={ref}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n","import { isNumber } from \"@yamada-ui/utils\"\nimport type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProperties } from \"./motion.types\"\n\nexport const MOTION_TRANSITION_EASINGS = {\n ease: [0.25, 0.1, 0.25, 1],\n easeIn: [0.4, 0, 1, 1],\n easeOut: [0, 0, 0.2, 1],\n easeInOut: [0.4, 0, 0.2, 1],\n} as const\n\nexport const MOTION_TRANSITION_VARIANTS = {\n scale: {\n enter: { scale: 1 },\n exit: { scale: 0.95 },\n },\n fade: {\n enter: { opacity: 1 },\n exit: { opacity: 0 },\n },\n pushLeft: {\n enter: { x: \"100%\" },\n exit: { x: \"-30%\" },\n },\n pushRight: {\n enter: { x: \"-100%\" },\n exit: { x: \"30%\" },\n },\n pushUp: {\n enter: { y: \"100%\" },\n exit: { y: \"-30%\" },\n },\n pushDown: {\n enter: { y: \"-100%\" },\n exit: { y: \"30%\" },\n },\n slideLeft: {\n position: { left: 0, top: 0, bottom: 0, width: \"100%\" },\n enter: { x: 0, y: 0 },\n exit: { x: \"-100%\", y: 0 },\n },\n slideRight: {\n position: { right: 0, top: 0, bottom: 0, width: \"100%\" },\n enter: { x: 0, y: 0 },\n exit: { x: \"100%\", y: 0 },\n },\n slideUp: {\n position: { top: 0, left: 0, right: 0, maxWidth: \"100vw\" },\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"-100%\" },\n },\n slideDown: {\n position: { bottom: 0, left: 0, right: 0, maxWidth: \"100vw\" },\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"100%\" },\n },\n} as const\n\nexport const MOTION_TRANSITION_DEFAULTS = {\n enter: {\n duration: 0.25,\n ease: MOTION_TRANSITION_EASINGS.easeOut,\n },\n exit: {\n duration: 0.2,\n ease: MOTION_TRANSITION_EASINGS.easeIn,\n },\n} as const\n\nexport const transitionEnter =\n (transition?: Transition) =>\n (\n delay?: MotionTransitionProperties[\"delay\"],\n duration?: MotionTransitionProperties[\"duration\"],\n ): Transition => ({\n ...(transition ?? MOTION_TRANSITION_DEFAULTS.enter),\n ...(duration\n ? { duration: isNumber(duration) ? duration : duration?.enter }\n : {}),\n delay: isNumber(delay) ? delay : delay?.enter,\n })\n\nexport const transitionExit =\n (transition?: Transition) =>\n (\n delay?: MotionTransitionProperties[\"delay\"],\n duration?: MotionTransitionProperties[\"duration\"],\n ): Transition => ({\n ...(transition ?? MOTION_TRANSITION_DEFAULTS.exit),\n ...(duration\n ? { duration: isNumber(duration) ? duration : duration?.exit }\n : {}),\n delay: isNumber(delay) ? delay : delay?.exit,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AAAA,EACL,WAAO,wBAAS,KAAK,IAAI,QAAQ,+BAAO;AAC1C;AAEK,IAAM,iBACX,CAAC,eACD,CACE,OACA,cACgB;AAAA,EAChB,GAAI,kCAAc,2BAA2B;AAAA,EAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,qCAAU,KAAK,IAC3D,CAAC;AAAA,EACL,WAAO,wBAAS,KAAK,IAAI,QAAQ,+BAAO;AAC1C;","names":["import_framer_motion","import_utils"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/motion.tsx","../src/utils.ts"],"sourcesContent":["export {\n m,\n motion,\n AnimatePresence,\n LayoutGroup,\n LazyMotion,\n MotionConfig,\n Reorder as MotionReorder,\n useMotionTemplate,\n useScroll,\n useSpring,\n useTime,\n useTransform,\n transform,\n useVelocity,\n useViewportScroll,\n useAnimation as useMotionAnimation,\n useAnimationControls as useMotionAnimationControls,\n useAnimationFrame as useMotionAnimationFrame,\n useDragControls,\n useInView,\n useIsPresent,\n useReducedMotion,\n useMotionValue,\n useMotionValueEvent,\n useCycle,\n} from \"framer-motion\"\nexport { Motion } from \"./motion\"\nexport type { MotionProps } from \"./motion\"\nexport * from \"./motion.types\"\nexport * from \"./utils\"\n","import type { HTMLUIProps, OmitProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { HTMLMotionProps } from \"framer-motion\"\nimport { motion } from \"framer-motion\"\nimport type { ReactHTML } from \"react\"\nimport type { MotionAs } from \"./motion.types\"\n\ntype UIProps = \"children\" | \"color\"\n\ntype MotionOptions = {\n as?: MotionAs\n}\n\nexport type MotionProps<Y extends keyof ReactHTML = \"div\"> = OmitProps<\n HTMLUIProps<Y>,\n keyof Omit<HTMLMotionProps<Y>, UIProps>\n> &\n Omit<HTMLMotionProps<Y>, UIProps> &\n MotionOptions\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/others/#motion\n */\nexport const Motion = forwardRef<MotionProps, \"div\", false>(\n ({ as = \"div\", className, ...rest }, ref) => {\n return (\n <ui.div\n as={motion[as]}\n ref={ref}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n","import { isNumber } from \"@yamada-ui/utils\"\nimport type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProperties } from \"./motion.types\"\n\nexport const MOTION_TRANSITION_EASINGS = {\n ease: [0.25, 0.1, 0.25, 1],\n easeIn: [0.4, 0, 1, 1],\n easeOut: [0, 0, 0.2, 1],\n easeInOut: [0.4, 0, 0.2, 1],\n} as const\n\nexport const MOTION_TRANSITION_VARIANTS = {\n scale: {\n enter: { scale: 1 },\n exit: { scale: 0.95 },\n },\n fade: {\n enter: { opacity: 1 },\n exit: { opacity: 0 },\n },\n pushLeft: {\n enter: { x: \"100%\" },\n exit: { x: \"-30%\" },\n },\n pushRight: {\n enter: { x: \"-100%\" },\n exit: { x: \"30%\" },\n },\n pushUp: {\n enter: { y: \"100%\" },\n exit: { y: \"-30%\" },\n },\n pushDown: {\n enter: { y: \"-100%\" },\n exit: { y: \"30%\" },\n },\n slideLeft: {\n position: { left: 0, top: 0, bottom: 0, width: \"100%\" },\n enter: { x: 0, y: 0 },\n exit: { x: \"-100%\", y: 0 },\n },\n slideRight: {\n position: { right: 0, top: 0, bottom: 0, width: \"100%\" },\n enter: { x: 0, y: 0 },\n exit: { x: \"100%\", y: 0 },\n },\n slideUp: {\n position: { top: 0, left: 0, right: 0, maxWidth: \"100vw\" },\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"-100%\" },\n },\n slideDown: {\n position: { bottom: 0, left: 0, right: 0, maxWidth: \"100vw\" },\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"100%\" },\n },\n} as const\n\nexport const MOTION_TRANSITION_DEFAULTS = {\n enter: {\n duration: 0.25,\n ease: MOTION_TRANSITION_EASINGS.easeOut,\n },\n exit: {\n duration: 0.2,\n ease: MOTION_TRANSITION_EASINGS.easeIn,\n },\n} as const\n\nexport const transitionEnter =\n (transition?: Transition) =>\n (\n delay?: MotionTransitionProperties[\"delay\"],\n duration?: MotionTransitionProperties[\"duration\"],\n ): Transition => ({\n ...(transition ?? MOTION_TRANSITION_DEFAULTS.enter),\n ...(duration\n ? { duration: isNumber(duration) ? duration : duration?.enter }\n : {}),\n delay: isNumber(delay) ? delay : delay?.enter,\n })\n\nexport const transitionExit =\n (transition?: Transition) =>\n (\n delay?: MotionTransitionProperties[\"delay\"],\n duration?: MotionTransitionProperties[\"duration\"],\n ): Transition => ({\n ...(transition ?? MOTION_TRANSITION_DEFAULTS.exit),\n ...(duration\n ? { duration: isNumber(duration) ? duration : duration?.exit }\n : {}),\n delay: isNumber(delay) ? delay : delay?.exit,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,wBA0BO;;;ACzBP,kBAA+B;AAC/B,mBAAmB;AAEnB,2BAAuB;AAyBjB;AAHC,IAAM,aAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC3C,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC,IAAI,4BAAO,EAAE;AAAA,QACb;AAAA,QACA,eAAW,iBAAG,aAAa,SAAS;AAAA,QACnC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;;;ACrCA,IAAAC,gBAAyB;AAIlB,IAAM,4BAA4B;AAAA,EACvC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAAA,EACzB,QAAQ,CAAC,KAAK,GAAG,GAAG,CAAC;AAAA,EAC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GAAG,GAAG,GAAG,EAAE;AAAA,IACpB,MAAM,EAAE,GAAG,GAAG,GAAG,QAAQ;AAAA,EAC3B;AAAA,EACA,WAAW;AAAA,IACT,UAAU,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,QAAQ;AAAA,IAC5D,OAAO,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,IACpB,MAAM,EAAE,GAAG,GAAG,GAAG,OAAO;AAAA,EAC1B;AACF;AAEO,IAAM,6BAA6B;AAAA,EACxC,OAAO;AAAA,IACL,UAAU;AAAA,IACV,MAAM,0BAA0B;AAAA,EAClC;AAAA,EACA,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,MAAM,0BAA0B;AAAA,EAClC;AACF;AAEO,IAAM,kBACX,CAAC,eACD,CACE,OACA,cACgB;AAAA,EAChB,GAAI,kCAAc,2BAA2B;AAAA,EAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,qCAAU,MAAM,IAC5D,CAAC;AAAA,EACL,WAAO,wBAAS,KAAK,IAAI,QAAQ,+BAAO;AAC1C;AAEK,IAAM,iBACX,CAAC,eACD,CACE,OACA,cACgB;AAAA,EAChB,GAAI,kCAAc,2BAA2B;AAAA,EAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,qCAAU,KAAK,IAC3D,CAAC;AAAA,EACL,WAAO,wBAAS,KAAK,IAAI,QAAQ,+BAAO;AAC1C;","names":["import_framer_motion","import_utils"]}
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  Motion
4
- } from "./chunk-BRU5IQGF.mjs";
4
+ } from "./chunk-CC4SJRTT.mjs";
5
5
  import "./chunk-R3D52RAW.mjs";
6
6
  import {
7
7
  MOTION_TRANSITION_DEFAULTS,
@@ -0,0 +1,75 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { OmitProps, HTMLUIProps } from '@yamada-ui/core';
3
+ import { motion, Transition, Target, TargetAndTransition, HTMLMotionProps } from 'framer-motion';
4
+ import { ReactHTML, Ref, RefAttributes } from 'react';
5
+ import { Dict, Merge } from '@yamada-ui/utils';
6
+
7
+ type MotionAs = keyof typeof motion;
8
+ type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProperties) => TargetAndTransition;
9
+ type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
10
+ type MotionTransitionVariants<Y = Dict> = {
11
+ enter: Variant<Y>;
12
+ exit: Variant<Y>;
13
+ initial?: Variant<Y>;
14
+ };
15
+ type MotionTransitionProperties = {
16
+ /**
17
+ * Custom `transition` definition for `enter` and `exit`.
18
+ */
19
+ transition?: MotionTransitionProps;
20
+ /**
21
+ * Custom `transitionEnd` definition for `enter` and `exit`.
22
+ */
23
+ transitionEnd?: MotionTransitionEndProps;
24
+ /**
25
+ * Custom `delay` definition for `enter` and `exit`.
26
+ */
27
+ delay?: number | MotionDelayProps;
28
+ /**
29
+ * Custom `duration` definition for `enter` and `exit`.
30
+ */
31
+ duration?: number | MotionDurationProps;
32
+ /**
33
+ * Custom `enter`.
34
+ */
35
+ enter?: any;
36
+ /**
37
+ * Custom `exit`.
38
+ */
39
+ exit?: any;
40
+ /**
41
+ * Custom `initial`.
42
+ */
43
+ initial?: any;
44
+ };
45
+ type WithMotionProps<Y> = Partial<Record<"enter" | "exit", Y>>;
46
+ type MotionTransitionProps = WithMotionProps<Transition>;
47
+ type MotionTransitionEndProps = WithMotionProps<Target>;
48
+ type MotionDelayProps = WithMotionProps<number>;
49
+ type MotionDurationProps = WithMotionProps<number>;
50
+ type WithTransitionProps<Y extends object> = Omit<Y, "transition"> & MotionTransitionProperties & {
51
+ /**
52
+ * If `true`, the element will unmount when `isOpen={false}` and animation is done.
53
+ */
54
+ unmountOnExit?: boolean;
55
+ /**
56
+ * Show the component. triggers when enter or exit states.
57
+ */
58
+ isOpen?: boolean;
59
+ };
60
+ type MotionUIPropGetter<Y extends keyof ReactHTML = "div", M = undefined> = (props?: Merge<MotionProps<Y>, M>, ref?: Ref<any>) => MotionProps<Y> & RefAttributes<any>;
61
+ type RequiredMotionUIPropGetter<Y extends keyof ReactHTML = "div", M = undefined> = (props: Merge<MotionProps<Y>, M>, ref?: Ref<any>) => MotionProps<Y> & RefAttributes<any>;
62
+
63
+ type UIProps = "children" | "color";
64
+ type MotionOptions = {
65
+ as?: MotionAs;
66
+ };
67
+ type MotionProps<Y extends keyof ReactHTML = "div"> = OmitProps<HTMLUIProps<Y>, keyof Omit<HTMLMotionProps<Y>, UIProps>> & Omit<HTMLMotionProps<Y>, UIProps> & MotionOptions;
68
+ /**
69
+ * `Motion` is a component that allows for the easy implementation of a wide variety of animations.
70
+ *
71
+ * @see Docs https://yamada-ui.com/others/#motion
72
+ */
73
+ declare const Motion: _yamada_ui_core.Component<"div", MotionProps<"div">>;
74
+
75
+ export { type MotionTransitionProperties as M, type RequiredMotionUIPropGetter as R, type WithTransitionProps as W, Motion as a, type MotionProps as b, type MotionAs as c, type MotionTransitionVariants as d, type MotionTransitionProps as e, type MotionTransitionEndProps as f, type MotionDelayProps as g, type MotionDurationProps as h, type MotionUIPropGetter as i };
@@ -0,0 +1,75 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { OmitProps, HTMLUIProps } from '@yamada-ui/core';
3
+ import { motion, Transition, Target, TargetAndTransition, HTMLMotionProps } from 'framer-motion';
4
+ import { ReactHTML, Ref, RefAttributes } from 'react';
5
+ import { Dict, Merge } from '@yamada-ui/utils';
6
+
7
+ type MotionAs = keyof typeof motion;
8
+ type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProperties) => TargetAndTransition;
9
+ type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
10
+ type MotionTransitionVariants<Y = Dict> = {
11
+ enter: Variant<Y>;
12
+ exit: Variant<Y>;
13
+ initial?: Variant<Y>;
14
+ };
15
+ type MotionTransitionProperties = {
16
+ /**
17
+ * Custom `transition` definition for `enter` and `exit`.
18
+ */
19
+ transition?: MotionTransitionProps;
20
+ /**
21
+ * Custom `transitionEnd` definition for `enter` and `exit`.
22
+ */
23
+ transitionEnd?: MotionTransitionEndProps;
24
+ /**
25
+ * Custom `delay` definition for `enter` and `exit`.
26
+ */
27
+ delay?: number | MotionDelayProps;
28
+ /**
29
+ * Custom `duration` definition for `enter` and `exit`.
30
+ */
31
+ duration?: number | MotionDurationProps;
32
+ /**
33
+ * Custom `enter`.
34
+ */
35
+ enter?: any;
36
+ /**
37
+ * Custom `exit`.
38
+ */
39
+ exit?: any;
40
+ /**
41
+ * Custom `initial`.
42
+ */
43
+ initial?: any;
44
+ };
45
+ type WithMotionProps<Y> = Partial<Record<"enter" | "exit", Y>>;
46
+ type MotionTransitionProps = WithMotionProps<Transition>;
47
+ type MotionTransitionEndProps = WithMotionProps<Target>;
48
+ type MotionDelayProps = WithMotionProps<number>;
49
+ type MotionDurationProps = WithMotionProps<number>;
50
+ type WithTransitionProps<Y extends object> = Omit<Y, "transition"> & MotionTransitionProperties & {
51
+ /**
52
+ * If `true`, the element will unmount when `isOpen={false}` and animation is done.
53
+ */
54
+ unmountOnExit?: boolean;
55
+ /**
56
+ * Show the component. triggers when enter or exit states.
57
+ */
58
+ isOpen?: boolean;
59
+ };
60
+ type MotionUIPropGetter<Y extends keyof ReactHTML = "div", M = undefined> = (props?: Merge<MotionProps<Y>, M>, ref?: Ref<any>) => MotionProps<Y> & RefAttributes<any>;
61
+ type RequiredMotionUIPropGetter<Y extends keyof ReactHTML = "div", M = undefined> = (props: Merge<MotionProps<Y>, M>, ref?: Ref<any>) => MotionProps<Y> & RefAttributes<any>;
62
+
63
+ type UIProps = "children" | "color";
64
+ type MotionOptions = {
65
+ as?: MotionAs;
66
+ };
67
+ type MotionProps<Y extends keyof ReactHTML = "div"> = OmitProps<HTMLUIProps<Y>, keyof Omit<HTMLMotionProps<Y>, UIProps>> & Omit<HTMLMotionProps<Y>, UIProps> & MotionOptions;
68
+ /**
69
+ * `Motion` is a component that allows for the easy implementation of a wide variety of animations.
70
+ *
71
+ * @see Docs https://yamada-ui.com/others/#motion
72
+ */
73
+ declare const Motion: _yamada_ui_core.Component<"div", MotionProps<"div">>;
74
+
75
+ export { type MotionTransitionProperties as M, type RequiredMotionUIPropGetter as R, type WithTransitionProps as W, Motion as a, type MotionProps as b, type MotionAs as c, type MotionTransitionVariants as d, type MotionTransitionProps as e, type MotionTransitionEndProps as f, type MotionDelayProps as g, type MotionDurationProps as h, type MotionUIPropGetter as i };
package/dist/motion.d.mts CHANGED
@@ -1,17 +1,5 @@
1
- import * as _yamada_ui_core from '@yamada-ui/core';
2
- import { OmitProps, HTMLUIProps } from '@yamada-ui/core';
3
- import { HTMLMotionProps, motion } from 'framer-motion';
4
- import { ReactHTML } from 'react';
5
-
6
- type MotionOptions = {
7
- as?: keyof typeof motion;
8
- };
9
- type MotionProps<Y extends keyof ReactHTML = "div"> = OmitProps<HTMLUIProps<Y>, keyof HTMLMotionProps<Y>> & HTMLMotionProps<Y> & MotionOptions;
10
- /**
11
- * `Motion` is a component that allows for the easy implementation of a wide variety of animations.
12
- *
13
- * @see Docs https://yamada-ui.com/styled-system/animation#motion
14
- */
15
- declare const Motion: _yamada_ui_core.Component<"div", MotionProps<"div">>;
16
-
17
- export { Motion, type MotionProps };
1
+ import '@yamada-ui/core';
2
+ import 'framer-motion';
3
+ import 'react';
4
+ export { a as Motion, b as MotionProps } from './motion-6FH35pOn.mjs';
5
+ import '@yamada-ui/utils';
package/dist/motion.d.ts CHANGED
@@ -1,17 +1,5 @@
1
- import * as _yamada_ui_core from '@yamada-ui/core';
2
- import { OmitProps, HTMLUIProps } from '@yamada-ui/core';
3
- import { HTMLMotionProps, motion } from 'framer-motion';
4
- import { ReactHTML } from 'react';
5
-
6
- type MotionOptions = {
7
- as?: keyof typeof motion;
8
- };
9
- type MotionProps<Y extends keyof ReactHTML = "div"> = OmitProps<HTMLUIProps<Y>, keyof HTMLMotionProps<Y>> & HTMLMotionProps<Y> & MotionOptions;
10
- /**
11
- * `Motion` is a component that allows for the easy implementation of a wide variety of animations.
12
- *
13
- * @see Docs https://yamada-ui.com/styled-system/animation#motion
14
- */
15
- declare const Motion: _yamada_ui_core.Component<"div", MotionProps<"div">>;
16
-
17
- export { Motion, type MotionProps };
1
+ import '@yamada-ui/core';
2
+ import 'framer-motion';
3
+ import 'react';
4
+ export { a as Motion, b as MotionProps } from './motion-6FH35pOn.js';
5
+ import '@yamada-ui/utils';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import type { HTMLUIProps, OmitProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { HTMLMotionProps } from \"framer-motion\"\nimport { motion } from \"framer-motion\"\nimport type { ReactHTML } from \"react\"\n\ntype MotionOptions = {\n as?: keyof typeof motion\n}\n\nexport type MotionProps<Y extends keyof ReactHTML = \"div\"> = OmitProps<\n HTMLUIProps<Y>,\n keyof HTMLMotionProps<Y>\n> &\n HTMLMotionProps<Y> &\n MotionOptions\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/styled-system/animation#motion\n */\nexport const Motion = forwardRef<MotionProps, \"div\", false>(\n ({ as = \"div\", className, ...rest }, ref) => {\n return (\n <ui.div\n as={motion[as]}\n ref={ref}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,mBAAmB;AAEnB,2BAAuB;AAsBjB;AAHC,IAAM,aAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC3C,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC,IAAI,4BAAO,EAAE;AAAA,QACb;AAAA,QACA,eAAW,iBAAG,aAAa,SAAS;AAAA,QACnC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import type { HTMLUIProps, OmitProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { HTMLMotionProps } from \"framer-motion\"\nimport { motion } from \"framer-motion\"\nimport type { ReactHTML } from \"react\"\nimport type { MotionAs } from \"./motion.types\"\n\ntype UIProps = \"children\" | \"color\"\n\ntype MotionOptions = {\n as?: MotionAs\n}\n\nexport type MotionProps<Y extends keyof ReactHTML = \"div\"> = OmitProps<\n HTMLUIProps<Y>,\n keyof Omit<HTMLMotionProps<Y>, UIProps>\n> &\n Omit<HTMLMotionProps<Y>, UIProps> &\n MotionOptions\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/others/#motion\n */\nexport const Motion = forwardRef<MotionProps, \"div\", false>(\n ({ as = \"div\", className, ...rest }, ref) => {\n return (\n <ui.div\n as={motion[as]}\n ref={ref}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,mBAAmB;AAEnB,2BAAuB;AAyBjB;AAHC,IAAM,aAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC3C,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC,IAAI,4BAAO,EAAE;AAAA,QACb;AAAA,QACA,eAAW,iBAAG,aAAa,SAAS;AAAA,QACnC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":[]}
package/dist/motion.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  Motion
4
- } from "./chunk-BRU5IQGF.mjs";
4
+ } from "./chunk-CC4SJRTT.mjs";
5
5
  export {
6
6
  Motion
7
7
  };
@@ -1,58 +1,5 @@
1
- import { Dict } from '@yamada-ui/utils';
2
- import { Transition, Target, TargetAndTransition } from 'framer-motion';
1
+ import '@yamada-ui/utils';
3
2
  export { DragControls, HTMLMotionProps, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptions as MotionAnimationOptions, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationProps as MotionAnimationProps, AnimationType as MotionAnimationType, MotionConfigProps, LayoutProps as MotionLayoutProps, LazyProps as MotionLazyProps, MotionStyle, Transition as MotionTransition, MotionValue, Variants as MotionVariants, SVGMotionProps } from 'framer-motion';
4
-
5
- type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProperties) => TargetAndTransition;
6
- type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
7
- type MotionTransitionVariants<Y = Dict> = {
8
- enter: Variant<Y>;
9
- exit: Variant<Y>;
10
- initial?: Variant<Y>;
11
- };
12
- type MotionTransitionProperties = {
13
- /**
14
- * Custom `transition` definition for `enter` and `exit`.
15
- */
16
- transition?: MotionTransitionProps;
17
- /**
18
- * Custom `transitionEnd` definition for `enter` and `exit`.
19
- */
20
- transitionEnd?: MotionTransitionEndProps;
21
- /**
22
- * Custom `delay` definition for `enter` and `exit`.
23
- */
24
- delay?: number | MotionDelayProps;
25
- /**
26
- * Custom `duration` definition for `enter` and `exit`.
27
- */
28
- duration?: number | MotionDurationProps;
29
- /**
30
- * Custom `enter`.
31
- */
32
- enter?: any;
33
- /**
34
- * Custom `exit`.
35
- */
36
- exit?: any;
37
- /**
38
- * Custom `initial`.
39
- */
40
- initial?: any;
41
- };
42
- type WithMotionProps<Y> = Partial<Record<"enter" | "exit", Y>>;
43
- type MotionTransitionProps = WithMotionProps<Transition>;
44
- type MotionTransitionEndProps = WithMotionProps<Target>;
45
- type MotionDelayProps = WithMotionProps<number>;
46
- type MotionDurationProps = WithMotionProps<number>;
47
- type WithTransitionProps<Y extends object> = Omit<Y, "transition"> & MotionTransitionProperties & {
48
- /**
49
- * If `true`, the element will unmount when `isOpen={false}` and animation is done.
50
- */
51
- unmountOnExit?: boolean;
52
- /**
53
- * Show the component. triggers when enter or exit states.
54
- */
55
- isOpen?: boolean;
56
- };
57
-
58
- export type { MotionDelayProps, MotionDurationProps, MotionTransitionEndProps, MotionTransitionProperties, MotionTransitionProps, MotionTransitionVariants, WithTransitionProps };
3
+ import 'react';
4
+ export { c as MotionAs, g as MotionDelayProps, h as MotionDurationProps, f as MotionTransitionEndProps, M as MotionTransitionProperties, e as MotionTransitionProps, d as MotionTransitionVariants, i as MotionUIPropGetter, R as RequiredMotionUIPropGetter, W as WithTransitionProps } from './motion-6FH35pOn.mjs';
5
+ import '@yamada-ui/core';
@@ -1,58 +1,5 @@
1
- import { Dict } from '@yamada-ui/utils';
2
- import { Transition, Target, TargetAndTransition } from 'framer-motion';
1
+ import '@yamada-ui/utils';
3
2
  export { DragControls, HTMLMotionProps, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptions as MotionAnimationOptions, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationProps as MotionAnimationProps, AnimationType as MotionAnimationType, MotionConfigProps, LayoutProps as MotionLayoutProps, LazyProps as MotionLazyProps, MotionStyle, Transition as MotionTransition, MotionValue, Variants as MotionVariants, SVGMotionProps } from 'framer-motion';
4
-
5
- type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProperties) => TargetAndTransition;
6
- type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
7
- type MotionTransitionVariants<Y = Dict> = {
8
- enter: Variant<Y>;
9
- exit: Variant<Y>;
10
- initial?: Variant<Y>;
11
- };
12
- type MotionTransitionProperties = {
13
- /**
14
- * Custom `transition` definition for `enter` and `exit`.
15
- */
16
- transition?: MotionTransitionProps;
17
- /**
18
- * Custom `transitionEnd` definition for `enter` and `exit`.
19
- */
20
- transitionEnd?: MotionTransitionEndProps;
21
- /**
22
- * Custom `delay` definition for `enter` and `exit`.
23
- */
24
- delay?: number | MotionDelayProps;
25
- /**
26
- * Custom `duration` definition for `enter` and `exit`.
27
- */
28
- duration?: number | MotionDurationProps;
29
- /**
30
- * Custom `enter`.
31
- */
32
- enter?: any;
33
- /**
34
- * Custom `exit`.
35
- */
36
- exit?: any;
37
- /**
38
- * Custom `initial`.
39
- */
40
- initial?: any;
41
- };
42
- type WithMotionProps<Y> = Partial<Record<"enter" | "exit", Y>>;
43
- type MotionTransitionProps = WithMotionProps<Transition>;
44
- type MotionTransitionEndProps = WithMotionProps<Target>;
45
- type MotionDelayProps = WithMotionProps<number>;
46
- type MotionDurationProps = WithMotionProps<number>;
47
- type WithTransitionProps<Y extends object> = Omit<Y, "transition"> & MotionTransitionProperties & {
48
- /**
49
- * If `true`, the element will unmount when `isOpen={false}` and animation is done.
50
- */
51
- unmountOnExit?: boolean;
52
- /**
53
- * Show the component. triggers when enter or exit states.
54
- */
55
- isOpen?: boolean;
56
- };
57
-
58
- export type { MotionDelayProps, MotionDurationProps, MotionTransitionEndProps, MotionTransitionProperties, MotionTransitionProps, MotionTransitionVariants, WithTransitionProps };
3
+ import 'react';
4
+ export { c as MotionAs, g as MotionDelayProps, h as MotionDurationProps, f as MotionTransitionEndProps, M as MotionTransitionProperties, e as MotionTransitionProps, d as MotionTransitionVariants, i as MotionUIPropGetter, R as RequiredMotionUIPropGetter, W as WithTransitionProps } from './motion-6FH35pOn.js';
5
+ import '@yamada-ui/core';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/motion.types.ts"],"sourcesContent":["import type { Dict } from \"@yamada-ui/utils\"\nimport type { Target, TargetAndTransition, Transition } from \"framer-motion\"\n\nexport type {\n HTMLMotionProps,\n SVGMotionProps,\n Variants as MotionVariants,\n Transition as MotionTransition,\n AnimatePresenceProps as MotionAnimatePresenceProps,\n LayoutProps as MotionLayoutProps,\n LazyProps as MotionLazyProps,\n MotionConfigProps,\n MotionStyle,\n DragControls,\n AnimationControls as MotionAnimationControls,\n AnimationProps as MotionAnimationProps,\n AnimationType as MotionAnimationType,\n AnimationLifecycles as MotionAnimationLifecycles,\n AnimationOptions as MotionAnimationOptions,\n AnimationPlaybackControls as MotionAnimationPlaybackControls,\n MotionValue,\n} from \"framer-motion\"\n\ntype TargetResolver<Y = Dict> = (\n props: Y & MotionTransitionProperties,\n) => TargetAndTransition\n\ntype Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>\n\nexport type MotionTransitionVariants<Y = Dict> = {\n enter: Variant<Y>\n exit: Variant<Y>\n initial?: Variant<Y>\n}\n\nexport type MotionTransitionProperties = {\n /**\n * Custom `transition` definition for `enter` and `exit`.\n */\n transition?: MotionTransitionProps\n /**\n * Custom `transitionEnd` definition for `enter` and `exit`.\n */\n transitionEnd?: MotionTransitionEndProps\n /**\n * Custom `delay` definition for `enter` and `exit`.\n */\n delay?: number | MotionDelayProps\n /**\n * Custom `duration` definition for `enter` and `exit`.\n */\n duration?: number | MotionDurationProps\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\ntype WithMotionProps<Y> = Partial<Record<\"enter\" | \"exit\", Y>>\n\nexport type MotionTransitionProps = WithMotionProps<Transition>\n\nexport type MotionTransitionEndProps = WithMotionProps<Target>\n\nexport type MotionDelayProps = WithMotionProps<number>\n\nexport type MotionDurationProps = WithMotionProps<number>\n\nexport type WithTransitionProps<Y extends object> = Omit<Y, \"transition\"> &\n MotionTransitionProperties & {\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 { Dict, Merge } from \"@yamada-ui/utils\"\nimport type {\n Target,\n TargetAndTransition,\n Transition,\n motion,\n} from \"framer-motion\"\nimport type { Ref, RefAttributes, ReactHTML } from \"react\"\nimport type { MotionProps } from \"./motion\"\n\nexport type {\n HTMLMotionProps,\n SVGMotionProps,\n Variants as MotionVariants,\n Transition as MotionTransition,\n AnimatePresenceProps as MotionAnimatePresenceProps,\n LayoutProps as MotionLayoutProps,\n LazyProps as MotionLazyProps,\n MotionConfigProps,\n MotionStyle,\n DragControls,\n AnimationControls as MotionAnimationControls,\n AnimationProps as MotionAnimationProps,\n AnimationType as MotionAnimationType,\n AnimationLifecycles as MotionAnimationLifecycles,\n AnimationOptions as MotionAnimationOptions,\n AnimationPlaybackControls as MotionAnimationPlaybackControls,\n MotionValue,\n} from \"framer-motion\"\n\nexport type MotionAs = keyof typeof motion\n\ntype TargetResolver<Y = Dict> = (\n props: Y & MotionTransitionProperties,\n) => TargetAndTransition\n\ntype Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>\n\nexport type MotionTransitionVariants<Y = Dict> = {\n enter: Variant<Y>\n exit: Variant<Y>\n initial?: Variant<Y>\n}\n\nexport type MotionTransitionProperties = {\n /**\n * Custom `transition` definition for `enter` and `exit`.\n */\n transition?: MotionTransitionProps\n /**\n * Custom `transitionEnd` definition for `enter` and `exit`.\n */\n transitionEnd?: MotionTransitionEndProps\n /**\n * Custom `delay` definition for `enter` and `exit`.\n */\n delay?: number | MotionDelayProps\n /**\n * Custom `duration` definition for `enter` and `exit`.\n */\n duration?: number | MotionDurationProps\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\ntype WithMotionProps<Y> = Partial<Record<\"enter\" | \"exit\", Y>>\n\nexport type MotionTransitionProps = WithMotionProps<Transition>\n\nexport type MotionTransitionEndProps = WithMotionProps<Target>\n\nexport type MotionDelayProps = WithMotionProps<number>\n\nexport type MotionDurationProps = WithMotionProps<number>\n\nexport type WithTransitionProps<Y extends object> = Omit<Y, \"transition\"> &\n MotionTransitionProperties & {\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\nexport type MotionUIPropGetter<\n Y extends keyof ReactHTML = \"div\",\n M = undefined,\n> = (\n props?: Merge<MotionProps<Y>, M>,\n ref?: Ref<any>,\n) => MotionProps<Y> & RefAttributes<any>\n\nexport type RequiredMotionUIPropGetter<\n Y extends keyof ReactHTML = \"div\",\n M = undefined,\n> = (\n props: Merge<MotionProps<Y>, M>,\n ref?: Ref<any>,\n) => MotionProps<Y> & RefAttributes<any>\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/dist/utils.d.mts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { Transition } from 'framer-motion';
2
- import { MotionTransitionProperties } from './motion.types.mjs';
2
+ import { M as MotionTransitionProperties } from './motion-6FH35pOn.mjs';
3
+ import '@yamada-ui/core';
4
+ import 'react';
3
5
  import '@yamada-ui/utils';
4
6
 
5
7
  declare const MOTION_TRANSITION_EASINGS: {
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { Transition } from 'framer-motion';
2
- import { MotionTransitionProperties } from './motion.types.js';
2
+ import { M as MotionTransitionProperties } from './motion-6FH35pOn.js';
3
+ import '@yamada-ui/core';
4
+ import 'react';
3
5
  import '@yamada-ui/utils';
4
6
 
5
7
  declare const MOTION_TRANSITION_EASINGS: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/motion",
3
- "version": "1.0.1",
3
+ "version": "1.0.3-dev-20231230014952",
4
4
  "description": "Yamada UI motion components",
5
5
  "keywords": [
6
6
  "yamada",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "framer-motion": "^9.1.7",
40
- "@yamada-ui/core": "1.1.0",
41
- "@yamada-ui/utils": "1.0.0"
40
+ "@yamada-ui/core": "1.1.2-dev-20231230014952",
41
+ "@yamada-ui/utils": "1.0.1-dev-20231230014952"
42
42
  },
43
43
  "devDependencies": {
44
44
  "react": "^18.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import type { HTMLUIProps, OmitProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { HTMLMotionProps } from \"framer-motion\"\nimport { motion } from \"framer-motion\"\nimport type { ReactHTML } from \"react\"\n\ntype MotionOptions = {\n as?: keyof typeof motion\n}\n\nexport type MotionProps<Y extends keyof ReactHTML = \"div\"> = OmitProps<\n HTMLUIProps<Y>,\n keyof HTMLMotionProps<Y>\n> &\n HTMLMotionProps<Y> &\n MotionOptions\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/styled-system/animation#motion\n */\nexport const Motion = forwardRef<MotionProps, \"div\", false>(\n ({ as = \"div\", className, ...rest }, ref) => {\n return (\n <ui.div\n as={motion[as]}\n ref={ref}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;AACA,SAAS,IAAI,kBAAkB;AAC/B,SAAS,UAAU;AAEnB,SAAS,cAAc;AAsBjB;AAHC,IAAM,SAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC3C,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC,IAAI,OAAO,EAAE;AAAA,QACb;AAAA,QACA,WAAW,GAAG,aAAa,SAAS;AAAA,QACnC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":[]}