@yamada-ui/motion 2.2.5-dev-20241016150325 → 2.2.5-dev-20241016161554
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-2V3EH5L5.mjs → chunk-TEUF5ZAQ.mjs} +3 -1
- package/dist/{chunk-2V3EH5L5.mjs.map → chunk-TEUF5ZAQ.mjs.map} +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/motion.js +2 -0
- package/dist/motion.js.map +1 -1
- package/dist/motion.mjs +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/motion.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"],"mappings":";;;;;;AAEA,SAAS,UAAU;AACnB,SAAS,UAAU;AACnB,SAAS,cAAc;AAgBnB;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,YAAY,GAAgB,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,OAAO,EAAE;AAAA,MACb,WAAW,GAAG,aAAa,SAAS;AAAA,MACnC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
1
|
+
{"version":3,"sources":["../src/motion.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\nMotion.displayName = \"Motion\"\nMotion.__ui__ = \"Motion\"\n"],"mappings":";;;;;;AAEA,SAAS,UAAU;AACnB,SAAS,UAAU;AACnB,SAAS,cAAc;AAgBnB;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,YAAY,GAAgB,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,OAAO,EAAE;AAAA,MACb,WAAW,GAAG,aAAa,SAAS;AAAA,MACnC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,OAAO,cAAc;AACrB,OAAO,SAAS;","names":[]}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/factory.ts","../src/forward-ref.tsx","../src/motion.tsx","../src/utils.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","import type { StyledOptions } from \"@yamada-ui/core\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\nimport { styled } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\n\ninterface Factory extends MotionFactory, MotionComponents {}\n\nfunction factory() {\n const cache = new Map<MotionAs, ComponentType>()\n\n return new Proxy(styled, {\n apply: (_target, _thisArg, [el, options]: [MotionAs, StyledOptions]) => {\n return _motion(styled(el, options) as ComponentType)\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el)) cache.set(el, _motion(styled(el) as ComponentType))\n\n return cache.get(el)\n },\n }) as Factory\n}\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 = factory()\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","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 { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } from \"./motion.types\"\nimport { isNumber } from \"@yamada-ui/utils\"\n\nexport const MOTION_TRANSITION_EASINGS = {\n ease: [0.25, 0.1, 0.25, 1],\n easeIn: [0.4, 0, 1, 1],\n easeInOut: [0.4, 0, 0.2, 1],\n easeOut: [0, 0, 0.2, 1],\n} as const\n\nexport const MOTION_TRANSITION_VARIANTS = {\n fade: {\n enter: { opacity: 1 },\n exit: { opacity: 0 },\n },\n pushDown: {\n enter: { y: \"-100%\" },\n exit: { y: \"30%\" },\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 scale: {\n enter: { scale: 1 },\n exit: { scale: 0.95 },\n },\n slideDown: {\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"100%\" },\n position: { bottom: 0, left: 0, maxWidth: \"100vw\", right: 0 },\n },\n slideLeft: {\n enter: { x: 0, y: 0 },\n exit: { x: \"-100%\", y: 0 },\n position: { bottom: 0, left: 0, top: 0, width: \"100%\" },\n },\n slideRight: {\n enter: { x: 0, y: 0 },\n exit: { x: \"100%\", y: 0 },\n position: { bottom: 0, right: 0, top: 0, width: \"100%\" },\n },\n slideUp: {\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"-100%\" },\n position: { left: 0, maxWidth: \"100vw\", right: 0, top: 0 },\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 function transitionEnter(transition?: Transition) {\n return function (\n delay?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"duration\"],\n ): Transition {\n return {\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 }\n}\n\nexport function transitionExit(transition?: Transition) {\n return function (\n delay?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"duration\"],\n ): Transition {\n return {\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 }\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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AY;AAAA,IACV,OAAO,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,IACpB,MAAM,EAAE,GAAG,QAAQ,GAAG,EAAE;AAAA,IACxB,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,OAAO;AAAA,EACzD;AAAA,EACA,SAAS;AAAA,IACP,OAAO,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,IACpB,MAAM,EAAE,GAAG,GAAG,GAAG,QAAQ;AAAA,IACzB,UAAU,EAAE,MAAM,GAAG,UAAU,SAAS,OAAO,GAAG,KAAK,EAAE;AAAA,EAC3D;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,SAAS,gBAAgB,YAAyB;AACvD,SAAO,SACLC,QACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,SAAS,MAAM,IAC3D,CAAC;AAAA,MACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;AAEO,SAAS,eAAe,YAAyB;AACtD,SAAO,SACLA,QACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,SAAS,KAAK,IAC1D,CAAC;AAAA,MACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;;;AJ5FA,IAAAC,wBAqHO;","names":["_motion","import_core","import_framer_motion","import_utils","delay","import_framer_motion"]}
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/factory.ts","../src/forward-ref.tsx","../src/motion.tsx","../src/utils.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","import type { StyledOptions } from \"@yamada-ui/core\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\nimport { styled } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\n\ninterface Factory extends MotionFactory, MotionComponents {}\n\nfunction factory() {\n const cache = new Map<MotionAs, ComponentType>()\n\n return new Proxy(styled, {\n apply: (_target, _thisArg, [el, options]: [MotionAs, StyledOptions]) => {\n return _motion(styled(el, options) as ComponentType)\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el)) cache.set(el, _motion(styled(el) as ComponentType))\n\n return cache.get(el)\n },\n }) as Factory\n}\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 = factory()\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","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\nMotion.displayName = \"Motion\"\nMotion.__ui__ = \"Motion\"\n","import type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } from \"./motion.types\"\nimport { isNumber } from \"@yamada-ui/utils\"\n\nexport const MOTION_TRANSITION_EASINGS = {\n ease: [0.25, 0.1, 0.25, 1],\n easeIn: [0.4, 0, 1, 1],\n easeInOut: [0.4, 0, 0.2, 1],\n easeOut: [0, 0, 0.2, 1],\n} as const\n\nexport const MOTION_TRANSITION_VARIANTS = {\n fade: {\n enter: { opacity: 1 },\n exit: { opacity: 0 },\n },\n pushDown: {\n enter: { y: \"-100%\" },\n exit: { y: \"30%\" },\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 scale: {\n enter: { scale: 1 },\n exit: { scale: 0.95 },\n },\n slideDown: {\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"100%\" },\n position: { bottom: 0, left: 0, maxWidth: \"100vw\", right: 0 },\n },\n slideLeft: {\n enter: { x: 0, y: 0 },\n exit: { x: \"-100%\", y: 0 },\n position: { bottom: 0, left: 0, top: 0, width: \"100%\" },\n },\n slideRight: {\n enter: { x: 0, y: 0 },\n exit: { x: \"100%\", y: 0 },\n position: { bottom: 0, right: 0, top: 0, width: \"100%\" },\n },\n slideUp: {\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"-100%\" },\n position: { left: 0, maxWidth: \"100vw\", right: 0, top: 0 },\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 function transitionEnter(transition?: Transition) {\n return function (\n delay?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"duration\"],\n ): Transition {\n return {\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 }\n}\n\nexport function transitionExit(transition?: Transition) {\n return function (\n delay?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"duration\"],\n ): Transition {\n return {\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 }\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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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}
|
package/dist/index.mjs
CHANGED
package/dist/motion.js
CHANGED
package/dist/motion.js.map
CHANGED
@@ -1 +1 @@
|
|
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":[]}
|
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\nMotion.displayName = \"Motion\"\nMotion.__ui__ = \"Motion\"\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;AAEA,OAAO,cAAc;AACrB,OAAO,SAAS;","names":[]}
|
package/dist/motion.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@yamada-ui/motion",
|
3
|
-
"version": "2.2.5-dev-
|
3
|
+
"version": "2.2.5-dev-20241016161554",
|
4
4
|
"description": "Yamada UI motion components",
|
5
5
|
"keywords": [
|
6
6
|
"yamada",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
39
|
"framer-motion": "11.3.24",
|
40
|
-
"@yamada-ui/core": "1.15.3-dev-
|
40
|
+
"@yamada-ui/core": "1.15.3-dev-20241016161554",
|
41
41
|
"@yamada-ui/utils": "1.5.3"
|
42
42
|
},
|
43
43
|
"devDependencies": {
|