@yamada-ui/motion 0.4.22 → 0.4.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-AWGG7Z3O.mjs → chunk-2RLQTJG7.mjs} +1 -0
- package/dist/chunk-2RLQTJG7.mjs.map +1 -0
- package/dist/{chunk-UZ2AJI25.mjs → chunk-5HBYS4WH.mjs} +1 -0
- package/dist/chunk-5HBYS4WH.mjs.map +1 -0
- package/dist/chunk-R3D52RAW.mjs +2 -0
- package/dist/chunk-R3D52RAW.mjs.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -0
- package/dist/motion.js +1 -0
- package/dist/motion.js.map +1 -0
- package/dist/motion.mjs +2 -1
- package/dist/motion.mjs.map +1 -0
- package/dist/motion.types.js +1 -0
- package/dist/motion.types.js.map +1 -0
- package/dist/motion.types.mjs +2 -1
- package/dist/motion.types.mjs.map +1 -0
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +2 -1
- package/dist/utils.mjs.map +1 -0
- package/package.json +5 -4
- package/dist/chunk-DZJNVIL6.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.ts"],"sourcesContent":["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,SAAS,gBAAgB;AAIlB,IAAM,4BAA4B;AAAA,EACvC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AAA,IACP,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,QAAQ;AAAA,IACzD,OAAO,EAAE,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,UAAU,SAAS,QAAQ,IAAI,WAAW,qCAAU,MAAM,IAC5D,CAAC;AAAA,EACL,OAAO,SAAS,KAAK,IAAI,QAAQ,+BAAO;AAC1C;AAEK,IAAM,iBACX,CAAC,eACD,CACE,OACA,cACgB;AAAA,EAChB,GAAI,kCAAc,2BAA2B;AAAA,EAC7C,GAAI,WACA,EAAE,UAAU,SAAS,QAAQ,IAAI,WAAW,qCAAU,KAAK,IAC3D,CAAC;AAAA,EACL,OAAO,SAAS,KAAK,IAAI,QAAQ,+BAAO;AAC1C;","names":[]}
|
|
@@ -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\"\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\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;AAiBjB;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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +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\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;AAiBjB;AAHC,IAAM,aAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAA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AAK,IAAI,QAAQ,+BAAO;AAC1C;","names":["import_framer_motion","import_utils"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
Motion
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5HBYS4WH.mjs";
|
|
5
|
+
import "./chunk-R3D52RAW.mjs";
|
|
6
6
|
import {
|
|
7
7
|
MOTION_TRANSITION_DEFAULTS,
|
|
8
8
|
MOTION_TRANSITION_EASINGS,
|
|
9
9
|
MOTION_TRANSITION_VARIANTS,
|
|
10
10
|
transitionEnter,
|
|
11
11
|
transitionExit
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2RLQTJG7.mjs";
|
|
13
13
|
|
|
14
14
|
// src/index.ts
|
|
15
15
|
import {
|
|
@@ -72,3 +72,4 @@ export {
|
|
|
72
72
|
useVelocity,
|
|
73
73
|
useViewportScroll
|
|
74
74
|
};
|
|
75
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.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"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA,EACE;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,EACgB;AAAA,EACQ;AAAA,EACH;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
package/dist/motion.js
CHANGED
|
@@ -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\"\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\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;AAiBjB;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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/motion.types.js
CHANGED
|
@@ -0,0 +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":[]}
|
package/dist/motion.types.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/utils.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.ts"],"sourcesContent":["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,mBAAyB;AAIlB,IAAM,4BAA4B;AAAA,EACvC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAAA,EACzB,QAAQ,CAAC,KAAK,GAAG,GAAG,CAAC;AAAA,EACrB,SAAS,CAAC,GAAG,GAAG,KAAK,CAAC;AAAA,EACtB,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B;AAEO,IAAM,6BAA6B;AAAA,EACxC,OAAO;AAAA,IACL,OAAO,EAAE,OAAO,EAAE;AAAA,IAClB,MAAM,EAAE,O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O,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,uBAAS,QAAQ,IAAI,WAAW,qCAAU,MAAM,IAC5D,CAAC;AAAA,EACL,WAAO,uBAAS,KAAK,IAAI,QAAQ,+BAAO;AAC1C;AAEK,IAAM,iBACX,CAAC,eACD,CACE,OACA,cACgB;AAAA,EAChB,GAAI,kCAAc,2BAA2B;AAAA,EAC7C,GAAI,WACA,EAAE,cAAU,uBAAS,QAAQ,IAAI,WAAW,qCAAU,KAAK,IAC3D,CAAC;AAAA,EACL,WAAO,uBAAS,KAAK,IAAI,QAAQ,+BAAO;AAC1C;","names":[]}
|
package/dist/utils.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
MOTION_TRANSITION_VARIANTS,
|
|
6
6
|
transitionEnter,
|
|
7
7
|
transitionExit
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2RLQTJG7.mjs";
|
|
9
9
|
export {
|
|
10
10
|
MOTION_TRANSITION_DEFAULTS,
|
|
11
11
|
MOTION_TRANSITION_EASINGS,
|
|
@@ -13,3 +13,4 @@ export {
|
|
|
13
13
|
transitionEnter,
|
|
14
14
|
transitionExit
|
|
15
15
|
};
|
|
16
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/motion",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.24",
|
|
4
4
|
"description": "Yamada UI motion components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"framer-motion": "^9.1.7",
|
|
39
|
-
"@yamada-ui/core": "0.14.
|
|
40
|
-
"@yamada-ui/utils": "0.
|
|
39
|
+
"@yamada-ui/core": "0.14.2",
|
|
40
|
+
"@yamada-ui/utils": "0.5.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"react": "^18.0.0",
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
],
|
|
57
57
|
"banner": {
|
|
58
58
|
"js": "\"use client\""
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
|
+
"sourcemap": true
|
|
60
61
|
},
|
|
61
62
|
"module": "dist/index.mjs",
|
|
62
63
|
"types": "dist/index.d.ts",
|
package/dist/chunk-DZJNVIL6.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client"
|