@yamada-ui/motion 2.2.2-dev-20240915031944 → 2.2.2-dev-20240917033401

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/dist/{chunk-2OYU7I6R.mjs → chunk-HOM46QCE.mjs} +3 -3
  2. package/dist/chunk-HOM46QCE.mjs.map +1 -0
  3. package/dist/{chunk-CJBAGLAE.mjs → chunk-IBE7Q3Z3.mjs} +4 -4
  4. package/dist/chunk-IBE7Q3Z3.mjs.map +1 -0
  5. package/dist/{chunk-IYC7RHQQ.mjs → chunk-M6WLOAFU.mjs} +2 -2
  6. package/dist/chunk-M6WLOAFU.mjs.map +1 -0
  7. package/dist/{chunk-WZQCVPKI.mjs → chunk-Z6I57MQV.mjs} +19 -11
  8. package/dist/chunk-Z6I57MQV.mjs.map +1 -0
  9. package/dist/factory.d.mts +3 -1
  10. package/dist/factory.d.ts +3 -1
  11. package/dist/factory.js +2 -2
  12. package/dist/factory.js.map +1 -1
  13. package/dist/factory.mjs +1 -1
  14. package/dist/{motion-forward-ref.d.mts → forward-ref.d.mts} +2 -2
  15. package/dist/{motion-forward-ref.d.ts → forward-ref.d.ts} +2 -2
  16. package/dist/{motion-forward-ref.js → forward-ref.js} +7 -7
  17. package/dist/forward-ref.js.map +1 -0
  18. package/dist/forward-ref.mjs +8 -0
  19. package/dist/index.d.mts +2 -2
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +23 -15
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +4 -4
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/motion.js +3 -3
  26. package/dist/motion.js.map +1 -1
  27. package/dist/motion.mjs +2 -2
  28. package/dist/motion.types.d.mts +32 -29
  29. package/dist/motion.types.d.ts +32 -29
  30. package/dist/motion.types.js.map +1 -1
  31. package/dist/utils.d.mts +2 -2
  32. package/dist/utils.d.ts +2 -2
  33. package/dist/utils.js +18 -10
  34. package/dist/utils.js.map +1 -1
  35. package/dist/utils.mjs +1 -1
  36. package/package.json +3 -3
  37. package/dist/chunk-2OYU7I6R.mjs.map +0 -1
  38. package/dist/chunk-CJBAGLAE.mjs.map +0 -1
  39. package/dist/chunk-IYC7RHQQ.mjs.map +0 -1
  40. package/dist/chunk-WZQCVPKI.mjs.map +0 -1
  41. package/dist/motion-forward-ref.js.map +0 -1
  42. package/dist/motion-forward-ref.mjs +0 -8
  43. /package/dist/{motion-forward-ref.mjs.map → forward-ref.mjs.map} +0 -0
@@ -3,7 +3,7 @@
3
3
  // src/factory.ts
4
4
  import { styled } from "@yamada-ui/core";
5
5
  import { motion as _motion } from "framer-motion";
6
- var factory = () => {
6
+ function factory() {
7
7
  const cache = /* @__PURE__ */ new Map();
8
8
  return new Proxy(styled, {
9
9
  apply: (_target, _thisArg, [el, options]) => {
@@ -14,10 +14,10 @@ var factory = () => {
14
14
  return cache.get(el);
15
15
  }
16
16
  });
17
- };
17
+ }
18
18
  var motion = factory();
19
19
 
20
20
  export {
21
21
  motion
22
22
  };
23
- //# sourceMappingURL=chunk-2OYU7I6R.mjs.map
23
+ //# sourceMappingURL=chunk-HOM46QCE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import { styled } from \"@yamada-ui/core\"\nimport type { StyledOptions } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\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"],"mappings":";;;AAAA,SAAS,cAAc;AAEvB,SAAS,UAAU,eAAe;AAMlC,SAAS,UAAU;AACjB,QAAM,QAAQ,oBAAI,IAA6B;AAE/C,SAAO,IAAI,MAAM,QAAQ;AAAA,IACvB,OAAO,CAAC,SAAS,UAAU,CAAC,IAAI,OAAO,MAAiC;AACtE,aAAO,QAAQ,OAAO,IAAI,OAAO,CAAkB;AAAA,IACrD;AAAA,IAEA,KAAK,CAAC,SAAS,OAAiB;AAC9B,UAAI,CAAC,MAAM,IAAI,EAAE,EAAG,OAAM,IAAI,IAAI,QAAQ,OAAO,EAAE,CAAkB,CAAC;AAEtE,aAAO,MAAM,IAAI,EAAE;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAOO,IAAM,SAAS,QAAQ;","names":[]}
@@ -1,14 +1,14 @@
1
1
  "use client"
2
2
 
3
- // src/motion-forward-ref.tsx
3
+ // src/forward-ref.tsx
4
4
  import * as React from "react";
5
- var motionForwardRef = (render) => {
5
+ function motionForwardRef(render) {
6
6
  return React.forwardRef(
7
7
  render
8
8
  );
9
- };
9
+ }
10
10
 
11
11
  export {
12
12
  motionForwardRef
13
13
  };
14
- //# sourceMappingURL=chunk-CJBAGLAE.mjs.map
14
+ //# sourceMappingURL=chunk-IBE7Q3Z3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/forward-ref.tsx"],"sourcesContent":["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":";;;AAEA,YAAY,WAAW;AAGhB,SAAS,iBACd,QAIA;AACA,SAAa;AAAA,IACX;AAAA,EACF;AACF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  motionForwardRef
4
- } from "./chunk-CJBAGLAE.mjs";
4
+ } from "./chunk-IBE7Q3Z3.mjs";
5
5
 
6
6
  // src/motion.tsx
7
7
  import { ui } from "@yamada-ui/core";
@@ -26,4 +26,4 @@ var Motion = motionForwardRef(
26
26
  export {
27
27
  Motion
28
28
  };
29
- //# sourceMappingURL=chunk-IYC7RHQQ.mjs.map
29
+ //# sourceMappingURL=chunk-M6WLOAFU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/motion.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"],"mappings":";;;;;;AAAA,SAAS,UAAU;AAEnB,SAAS,UAAU;AACnB,SAAS,cAAc;AAiBnB;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":[]}
@@ -64,16 +64,24 @@ var MOTION_TRANSITION_DEFAULTS = {
64
64
  ease: MOTION_TRANSITION_EASINGS.easeIn
65
65
  }
66
66
  };
67
- var transitionEnter = (transition) => (delay, duration) => ({
68
- ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
69
- ...duration ? { duration: isNumber(duration) ? duration : duration == null ? void 0 : duration.enter } : {},
70
- delay: isNumber(delay) ? delay : delay == null ? void 0 : delay.enter
71
- });
72
- var transitionExit = (transition) => (delay, duration) => ({
73
- ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
74
- ...duration ? { duration: isNumber(duration) ? duration : duration == null ? void 0 : duration.exit } : {},
75
- delay: isNumber(delay) ? delay : delay == null ? void 0 : delay.exit
76
- });
67
+ function transitionEnter(transition) {
68
+ return function(delay, duration) {
69
+ return {
70
+ ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
71
+ ...duration ? { duration: isNumber(duration) ? duration : duration == null ? void 0 : duration.enter } : {},
72
+ delay: isNumber(delay) ? delay : delay == null ? void 0 : delay.enter
73
+ };
74
+ };
75
+ }
76
+ function transitionExit(transition) {
77
+ return function(delay, duration) {
78
+ return {
79
+ ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
80
+ ...duration ? { duration: isNumber(duration) ? duration : duration == null ? void 0 : duration.exit } : {},
81
+ delay: isNumber(delay) ? delay : delay == null ? void 0 : delay.exit
82
+ };
83
+ };
84
+ }
77
85
 
78
86
  export {
79
87
  MOTION_TRANSITION_EASINGS,
@@ -82,4 +90,4 @@ export {
82
90
  transitionEnter,
83
91
  transitionExit
84
92
  };
85
- //# sourceMappingURL=chunk-WZQCVPKI.mjs.map
93
+ //# sourceMappingURL=chunk-Z6I57MQV.mjs.map
@@ -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 { MotionTransitionProps } 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 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,SAAS,gBAAgB;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,OAAO,KAAK;AAAA,EACtB;AAAA,EACA,MAAM;AAAA,IACJ,OAAO,EAAE,SAAS,EAAE;AAAA,IACpB,MAAM,EAAE,SAAS,EAAE;AAAA,EACrB;AAAA,EACA,UAAU;AAAA,IACR,OAAO,EAAE,GAAG,OAAO;AAAA,IACnB,MAAM,EAAE,GAAG,OAAO;AAAA,EACpB;AAAA,EACA,WAAW;AAAA,IACT,OAAO,EAAE,GAAG,QAAQ;AAAA,IACpB,MAAM,EAAE,GAAG,MAAM;AAAA,EACnB;AAAA,EACA,QAAQ;AAAA,IACN,OAAO,EAAE,GAAG,OAAO;AAAA,IACnB,MAAM,EAAE,GAAG,OAAO;AAAA,EACpB;AAAA,EACA,UAAU;AAAA,IACR,OAAO,EAAE,GAAG,QAAQ;AAAA,IACpB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QAAQ,+BAAO;AAAA,IAC1C;AAAA,EACF;AACF;AAEO,SAAS,eAAe,YAAyB;AACtD,SAAO,SACL,OACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,UAAU,SAAS,QAAQ,IAAI,WAAW,qCAAU,KAAK,IAC3D,CAAC;AAAA,MACL,OAAO,SAAS,KAAK,IAAI,QAAQ,+BAAO;AAAA,IAC1C;AAAA,EACF;AACF;","names":[]}
@@ -4,11 +4,13 @@ import '@yamada-ui/utils';
4
4
  import 'framer-motion';
5
5
  import 'react';
6
6
 
7
+ interface Factory extends MotionFactory, MotionComponents {
8
+ }
7
9
  /**
8
10
  * `motion` is a component that allows for the easy implementation of a wide variety of animations.
9
11
  *
10
12
  * @see Docs https://yamada-ui.com/components/other/motion
11
13
  */
12
- declare const motion: MotionFactory & MotionComponents;
14
+ declare const motion: Factory;
13
15
 
14
16
  export { motion };
package/dist/factory.d.ts CHANGED
@@ -4,11 +4,13 @@ import '@yamada-ui/utils';
4
4
  import 'framer-motion';
5
5
  import 'react';
6
6
 
7
+ interface Factory extends MotionFactory, MotionComponents {
8
+ }
7
9
  /**
8
10
  * `motion` is a component that allows for the easy implementation of a wide variety of animations.
9
11
  *
10
12
  * @see Docs https://yamada-ui.com/components/other/motion
11
13
  */
12
- declare const motion: MotionFactory & MotionComponents;
14
+ declare const motion: Factory;
13
15
 
14
16
  export { motion };
package/dist/factory.js CHANGED
@@ -26,7 +26,7 @@ __export(factory_exports, {
26
26
  module.exports = __toCommonJS(factory_exports);
27
27
  var import_core = require("@yamada-ui/core");
28
28
  var import_framer_motion = require("framer-motion");
29
- var factory = () => {
29
+ function factory() {
30
30
  const cache = /* @__PURE__ */ new Map();
31
31
  return new Proxy(import_core.styled, {
32
32
  apply: (_target, _thisArg, [el, options]) => {
@@ -37,7 +37,7 @@ var factory = () => {
37
37
  return cache.get(el);
38
38
  }
39
39
  });
40
- };
40
+ }
41
41
  var motion = factory();
42
42
  // Annotate the CommonJS export names for ESM import in node:
43
43
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import { styled, type StyledOptions } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\n\nconst 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 MotionFactory & MotionComponents\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2C;AAC3C,2BAAkC;AAIlC,IAAM,UAAU,MAAM;AACpB,QAAM,QAAQ,oBAAI,IAA6B;AAE/C,SAAO,IAAI,MAAM,oBAAQ;AAAA,IACvB,OAAO,CAAC,SAAS,UAAU,CAAC,IAAI,OAAO,MAAiC;AACtE,iBAAO,qBAAAA,YAAQ,oBAAO,IAAI,OAAO,CAAkB;AAAA,IACrD;AAAA,IAEA,KAAK,CAAC,SAAS,OAAiB;AAC9B,UAAI,CAAC,MAAM,IAAI,EAAE,EAAG,OAAM,IAAI,QAAI,qBAAAA,YAAQ,oBAAO,EAAE,CAAkB,CAAC;AAEtE,aAAO,MAAM,IAAI,EAAE;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAOO,IAAM,SAAS,QAAQ;","names":["_motion"]}
1
+ {"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import { styled } from \"@yamada-ui/core\"\nimport type { StyledOptions } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuB;AAEvB,2BAAkC;AAMlC,SAAS,UAAU;AACjB,QAAM,QAAQ,oBAAI,IAA6B;AAE/C,SAAO,IAAI,MAAM,oBAAQ;AAAA,IACvB,OAAO,CAAC,SAAS,UAAU,CAAC,IAAI,OAAO,MAAiC;AACtE,iBAAO,qBAAAA,YAAQ,oBAAO,IAAI,OAAO,CAAkB;AAAA,IACrD;AAAA,IAEA,KAAK,CAAC,SAAS,OAAiB;AAC9B,UAAI,CAAC,MAAM,IAAI,EAAE,EAAG,OAAM,IAAI,QAAI,qBAAAA,YAAQ,oBAAO,EAAE,CAAkB,CAAC;AAEtE,aAAO,MAAM,IAAI,EAAE;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAOO,IAAM,SAAS,QAAQ;","names":["_motion"]}
package/dist/factory.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  motion
4
- } from "./chunk-2OYU7I6R.mjs";
4
+ } from "./chunk-HOM46QCE.mjs";
5
5
  export {
6
6
  motion
7
7
  };
@@ -4,8 +4,8 @@ import * as React from 'react';
4
4
  import { MotionAs, MotionComponent } from './motion.types.mjs';
5
5
  import 'framer-motion';
6
6
 
7
- declare const motionForwardRef: <Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any, Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & {
7
+ declare function motionForwardRef<Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any, Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & {
8
8
  as?: MotionAs;
9
- }>) => MotionComponent<M, Y>;
9
+ }>): MotionComponent<M, Y>;
10
10
 
11
11
  export { motionForwardRef };
@@ -4,8 +4,8 @@ import * as React from 'react';
4
4
  import { MotionAs, MotionComponent } from './motion.types.js';
5
5
  import 'framer-motion';
6
6
 
7
- declare const motionForwardRef: <Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any, Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & {
7
+ declare function motionForwardRef<Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any, Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & {
8
8
  as?: MotionAs;
9
- }>) => MotionComponent<M, Y>;
9
+ }>): MotionComponent<M, Y>;
10
10
 
11
11
  export { motionForwardRef };
@@ -28,20 +28,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  ));
29
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
30
 
31
- // src/motion-forward-ref.tsx
32
- var motion_forward_ref_exports = {};
33
- __export(motion_forward_ref_exports, {
31
+ // src/forward-ref.tsx
32
+ var forward_ref_exports = {};
33
+ __export(forward_ref_exports, {
34
34
  motionForwardRef: () => motionForwardRef
35
35
  });
36
- module.exports = __toCommonJS(motion_forward_ref_exports);
36
+ module.exports = __toCommonJS(forward_ref_exports);
37
37
  var React = __toESM(require("react"));
38
- var motionForwardRef = (render) => {
38
+ function motionForwardRef(render) {
39
39
  return React.forwardRef(
40
40
  render
41
41
  );
42
- };
42
+ }
43
43
  // Annotate the CommonJS export names for ESM import in node:
44
44
  0 && (module.exports = {
45
45
  motionForwardRef
46
46
  });
47
- //# sourceMappingURL=motion-forward-ref.js.map
47
+ //# sourceMappingURL=forward-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/forward-ref.tsx"],"sourcesContent":["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;AAEA,YAAuB;AAGhB,SAAS,iBACd,QAIA;AACA,SAAa;AAAA,IACX;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ "use client"
2
+ import {
3
+ motionForwardRef
4
+ } from "./chunk-IBE7Q3Z3.mjs";
5
+ export {
6
+ motionForwardRef
7
+ };
8
+ //# sourceMappingURL=forward-ref.mjs.map
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { AcceleratedAnimation, AnimatePresence, AnimateSharedLayout, CSSStyleDeclarationWithTransform, DOMMotionComponents, DeprecatedLayoutGroupContext, DragControls, FlatTree, HTMLMotionProps, LayoutGroup, LayoutGroupContext, LazyMotion, AbsoluteKeyframe as MotionAbsoluteKeyframe, MotionAdvancedProps, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationDefinition as MotionAnimationDefinition, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptionsWithValueOverrides as MotionAnimationOptionsWithValueOverrides, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationPlaybackLifecycles as MotionAnimationPlaybackLifecycles, AnimationPlaybackOptions as MotionAnimationPlaybackOptions, AnimationProps as MotionAnimationProps, AnimationScope as MotionAnimationScope, AnimationSequence as MotionAnimationSequence, AnimationType as MotionAnimationType, At as MotionAt, Axis as MotionAxis, AxisDelta as MotionAxisDelta, BezierDefinition as MotionBezierDefinition, BoundingBox as MotionBoundingBox, Box as MotionBox, MotionConfig, MotionConfigContext, MotionConfigProps, MotionContext, CreateVisualElement as MotionCreateVisualElement, CustomDomComponent as MotionCustomDomComponent, CustomValueType as MotionCustomValueType, Cycle as MotionCycle, CycleState as MotionCycleState, DOMKeyframesDefinition as MotionDOMKeyframesDefinition, DOMSegment as MotionDOMSegment, DOMSegmentWithTransition as MotionDOMSegmentWithTransition, DecayOptions as MotionDecayOptions, DelayedFunction as MotionDelayedFunction, Delta as MotionDelta, DevMessage as MotionDevMessage, DragElastic as MotionDragElastic, DragHandlers as MotionDragHandlers, DraggableProps as MotionDraggableProps, DurationSpringOptions as MotionDurationSpringOptions, DynamicAnimationOptions as MotionDynamicAnimationOptions, DynamicOption as MotionDynamicOption, Easing as MotionEasing, EasingDefinition as MotionEasingDefinition, EasingFunction as MotionEasingFunction, EasingModifier as MotionEasingModifier, ElementOrSelector as MotionElementOrSelector, EventInfo as MotionEventInfo, FeatureBundle as MotionFeatureBundle, FeatureDefinition as MotionFeatureDefinition, FeatureDefinitions as MotionFeatureDefinitions, FeaturePackage as MotionFeaturePackage, FeaturePackages as MotionFeaturePackages, FocusHandlers as MotionFocusHandlers, MotionGlobalConfig, HoverHandlers as MotionHoverHandlers, HydratedFeatureDefinition as MotionHydratedFeatureDefinition, HydratedFeatureDefinitions as MotionHydratedFeatureDefinitions, IProjectionNode as MotionIProjectionNode, Inertia as MotionInertia, InertiaOptions as MotionInertiaOptions, InterpolateOptions as MotionInterpolateOptions, KeyframeOptions as MotionKeyframeOptions, Keyframes as MotionKeyframes, KeyframesTarget as MotionKeyframesTarget, LayoutProps as MotionLayoutProps, LazyFeatureBundle as MotionLazyFeatureBundle, LazyProps as MotionLazyProps, MixerFactory as MotionMixerFactory, None as MotionNone, Orchestration as MotionOrchestration, PanHandlers as MotionPanHandlers, PanInfo as MotionPanInfo, PassiveEffect as MotionPassiveEffect, Point as MotionPoint, RelayoutInfo as MotionRelayoutInfo, RenderComponent as MotionRenderComponent, Reorder as MotionReorder, Repeat as MotionRepeat, RepeatType as MotionRepeatType, ResolveKeyframes as MotionResolveKeyframes, ResolveLayoutTransition as MotionResolveLayoutTransition, ResolvedAnimationDefinition as MotionResolvedAnimationDefinition, ResolvedAnimationDefinitions as MotionResolvedAnimationDefinitions, ResolvedKeyframesTarget as MotionResolvedKeyframesTarget, ResolvedSingleTarget as MotionResolvedSingleTarget, ResolvedValueTarget as MotionResolvedValueTarget, ResolvedValues as MotionResolvedValues, Segment as MotionSegment, SequenceLabel as MotionSequenceLabel, SequenceLabelWithTime as MotionSequenceLabelWithTime, SequenceMap as MotionSequenceMap, SequenceOptions as MotionSequenceOptions, SequenceTime as MotionSequenceTime, SingleTarget as MotionSingleTarget, Spring as MotionSpring, SpringOptions as MotionSpringOptions, MotionStyle, StyleKeyframesDefinition as MotionStyleKeyframesDefinition, StyleTransitions as MotionStyleTransitions, Subscriber as MotionSubscriber, TapHandlers as MotionTapHandlers, TapInfo as MotionTapInfo, Target as MotionTarget, TargetAndTransition as MotionTargetAndTransition, MotionTransform, TransformPoint as MotionTransformPoint, Transition as MotionTransition, Tween as MotionTween, UnresolvedValueKeyframe as MotionUnresolvedValueKeyframe, UseInViewOptions as MotionUseInViewOptions, MotionValue, ValueAnimationOptions as MotionValueAnimationOptions, ValueAnimationTransition as MotionValueAnimationTransition, ValueKeyframe as MotionValueKeyframe, ValueKeyframesDefinition as MotionValueKeyframesDefinition, MotionValueSegment, MotionValueSegmentWithTransition, ValueSequence as MotionValueSequence, ValueTarget as MotionValueTarget, ValueType as MotionValueType, VariableKeyframesDefinition as MotionVariableKeyframesDefinition, VariableTransitions as MotionVariableTransitions, Variant as MotionVariant, VariantLabels as MotionVariantLabels, Variants as MotionVariants, VelocityOptions as MotionVelocityOptions, VisualState as MotionVisualState, PresenceContext, SVGAttributesAsMotionValues, SVGKeyframesDefinition, SVGMotionProps, SVGPathKeyframesDefinition, SVGPathTransitions, SVGTransitions, ScrapeMotionValuesFromProps, ScrollMotionValues, SwitchLayoutGroupContext, VisualElement, addPointerInfo, addScaleCorrector, animate, animateValue, animateVisualElement, animationControls, animations, anticipate, backIn, backInOut, backOut, buildTransform, calcLength, cancelFrame, cancelSync, circIn, circInOut, circOut, clamp, color, complex, createBox, createDomMotionComponent, createMotionComponent, createScopedAnimate, cubicBezier, delay, disableInstantTransitions, distance, distance2D, domAnimation, domMax, easeIn, easeInOut, easeOut, filterProps, frame, frameData, inView, interpolate, invariant, isBrowser, isDragActive, isMotionComponent, isMotionValue, isValidMotionProp, m, makeUseVisualState, mirrorEasing, mix, motionValue, optimizedAppearDataAttribute, pipe, progress, px, resolveMotionValue, reverseEasing, scroll, scrollInfo, spring, stagger, startOptimizedAppearAnimation, steps, sync, transform, unwrapMotionComponent, useAnimate, useAnimationControls, useAnimationFrame, useCycle, useDeprecatedAnimatedState, useDeprecatedInvertedScale, useDomEvent, useDragControls, useElementScroll, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useIsPresent, useIsomorphicLayoutEffect, useAnimation as useMotionAnimation, useMotionTemplate, useMotionValue, useMotionValueEvent, usePresence, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useVelocity, useViewportScroll, useWillChange, visualElementStore, warning, wrap } from 'framer-motion';
2
- export { motionForwardRef } from './motion-forward-ref.mjs';
2
+ export { motionForwardRef } from './forward-ref.mjs';
3
3
  export { Motion } from './motion.mjs';
4
- export { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, MotionUIPropGetter, RequiredMotionUIPropGetter, UIMotionComponent, WithTransitionProps } from './motion.types.mjs';
4
+ export { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutAs, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, UIMotionComponent, WithTransitionProps } from './motion.types.mjs';
5
5
  export { MOTION_TRANSITION_DEFAULTS, MOTION_TRANSITION_EASINGS, MOTION_TRANSITION_VARIANTS, transitionEnter, transitionExit } from './utils.mjs';
6
6
  export { motion } from './factory.mjs';
7
7
  import '@yamada-ui/core';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { AcceleratedAnimation, AnimatePresence, AnimateSharedLayout, CSSStyleDeclarationWithTransform, DOMMotionComponents, DeprecatedLayoutGroupContext, DragControls, FlatTree, HTMLMotionProps, LayoutGroup, LayoutGroupContext, LazyMotion, AbsoluteKeyframe as MotionAbsoluteKeyframe, MotionAdvancedProps, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationDefinition as MotionAnimationDefinition, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptionsWithValueOverrides as MotionAnimationOptionsWithValueOverrides, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationPlaybackLifecycles as MotionAnimationPlaybackLifecycles, AnimationPlaybackOptions as MotionAnimationPlaybackOptions, AnimationProps as MotionAnimationProps, AnimationScope as MotionAnimationScope, AnimationSequence as MotionAnimationSequence, AnimationType as MotionAnimationType, At as MotionAt, Axis as MotionAxis, AxisDelta as MotionAxisDelta, BezierDefinition as MotionBezierDefinition, BoundingBox as MotionBoundingBox, Box as MotionBox, MotionConfig, MotionConfigContext, MotionConfigProps, MotionContext, CreateVisualElement as MotionCreateVisualElement, CustomDomComponent as MotionCustomDomComponent, CustomValueType as MotionCustomValueType, Cycle as MotionCycle, CycleState as MotionCycleState, DOMKeyframesDefinition as MotionDOMKeyframesDefinition, DOMSegment as MotionDOMSegment, DOMSegmentWithTransition as MotionDOMSegmentWithTransition, DecayOptions as MotionDecayOptions, DelayedFunction as MotionDelayedFunction, Delta as MotionDelta, DevMessage as MotionDevMessage, DragElastic as MotionDragElastic, DragHandlers as MotionDragHandlers, DraggableProps as MotionDraggableProps, DurationSpringOptions as MotionDurationSpringOptions, DynamicAnimationOptions as MotionDynamicAnimationOptions, DynamicOption as MotionDynamicOption, Easing as MotionEasing, EasingDefinition as MotionEasingDefinition, EasingFunction as MotionEasingFunction, EasingModifier as MotionEasingModifier, ElementOrSelector as MotionElementOrSelector, EventInfo as MotionEventInfo, FeatureBundle as MotionFeatureBundle, FeatureDefinition as MotionFeatureDefinition, FeatureDefinitions as MotionFeatureDefinitions, FeaturePackage as MotionFeaturePackage, FeaturePackages as MotionFeaturePackages, FocusHandlers as MotionFocusHandlers, MotionGlobalConfig, HoverHandlers as MotionHoverHandlers, HydratedFeatureDefinition as MotionHydratedFeatureDefinition, HydratedFeatureDefinitions as MotionHydratedFeatureDefinitions, IProjectionNode as MotionIProjectionNode, Inertia as MotionInertia, InertiaOptions as MotionInertiaOptions, InterpolateOptions as MotionInterpolateOptions, KeyframeOptions as MotionKeyframeOptions, Keyframes as MotionKeyframes, KeyframesTarget as MotionKeyframesTarget, LayoutProps as MotionLayoutProps, LazyFeatureBundle as MotionLazyFeatureBundle, LazyProps as MotionLazyProps, MixerFactory as MotionMixerFactory, None as MotionNone, Orchestration as MotionOrchestration, PanHandlers as MotionPanHandlers, PanInfo as MotionPanInfo, PassiveEffect as MotionPassiveEffect, Point as MotionPoint, RelayoutInfo as MotionRelayoutInfo, RenderComponent as MotionRenderComponent, Reorder as MotionReorder, Repeat as MotionRepeat, RepeatType as MotionRepeatType, ResolveKeyframes as MotionResolveKeyframes, ResolveLayoutTransition as MotionResolveLayoutTransition, ResolvedAnimationDefinition as MotionResolvedAnimationDefinition, ResolvedAnimationDefinitions as MotionResolvedAnimationDefinitions, ResolvedKeyframesTarget as MotionResolvedKeyframesTarget, ResolvedSingleTarget as MotionResolvedSingleTarget, ResolvedValueTarget as MotionResolvedValueTarget, ResolvedValues as MotionResolvedValues, Segment as MotionSegment, SequenceLabel as MotionSequenceLabel, SequenceLabelWithTime as MotionSequenceLabelWithTime, SequenceMap as MotionSequenceMap, SequenceOptions as MotionSequenceOptions, SequenceTime as MotionSequenceTime, SingleTarget as MotionSingleTarget, Spring as MotionSpring, SpringOptions as MotionSpringOptions, MotionStyle, StyleKeyframesDefinition as MotionStyleKeyframesDefinition, StyleTransitions as MotionStyleTransitions, Subscriber as MotionSubscriber, TapHandlers as MotionTapHandlers, TapInfo as MotionTapInfo, Target as MotionTarget, TargetAndTransition as MotionTargetAndTransition, MotionTransform, TransformPoint as MotionTransformPoint, Transition as MotionTransition, Tween as MotionTween, UnresolvedValueKeyframe as MotionUnresolvedValueKeyframe, UseInViewOptions as MotionUseInViewOptions, MotionValue, ValueAnimationOptions as MotionValueAnimationOptions, ValueAnimationTransition as MotionValueAnimationTransition, ValueKeyframe as MotionValueKeyframe, ValueKeyframesDefinition as MotionValueKeyframesDefinition, MotionValueSegment, MotionValueSegmentWithTransition, ValueSequence as MotionValueSequence, ValueTarget as MotionValueTarget, ValueType as MotionValueType, VariableKeyframesDefinition as MotionVariableKeyframesDefinition, VariableTransitions as MotionVariableTransitions, Variant as MotionVariant, VariantLabels as MotionVariantLabels, Variants as MotionVariants, VelocityOptions as MotionVelocityOptions, VisualState as MotionVisualState, PresenceContext, SVGAttributesAsMotionValues, SVGKeyframesDefinition, SVGMotionProps, SVGPathKeyframesDefinition, SVGPathTransitions, SVGTransitions, ScrapeMotionValuesFromProps, ScrollMotionValues, SwitchLayoutGroupContext, VisualElement, addPointerInfo, addScaleCorrector, animate, animateValue, animateVisualElement, animationControls, animations, anticipate, backIn, backInOut, backOut, buildTransform, calcLength, cancelFrame, cancelSync, circIn, circInOut, circOut, clamp, color, complex, createBox, createDomMotionComponent, createMotionComponent, createScopedAnimate, cubicBezier, delay, disableInstantTransitions, distance, distance2D, domAnimation, domMax, easeIn, easeInOut, easeOut, filterProps, frame, frameData, inView, interpolate, invariant, isBrowser, isDragActive, isMotionComponent, isMotionValue, isValidMotionProp, m, makeUseVisualState, mirrorEasing, mix, motionValue, optimizedAppearDataAttribute, pipe, progress, px, resolveMotionValue, reverseEasing, scroll, scrollInfo, spring, stagger, startOptimizedAppearAnimation, steps, sync, transform, unwrapMotionComponent, useAnimate, useAnimationControls, useAnimationFrame, useCycle, useDeprecatedAnimatedState, useDeprecatedInvertedScale, useDomEvent, useDragControls, useElementScroll, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useIsPresent, useIsomorphicLayoutEffect, useAnimation as useMotionAnimation, useMotionTemplate, useMotionValue, useMotionValueEvent, usePresence, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useVelocity, useViewportScroll, useWillChange, visualElementStore, warning, wrap } from 'framer-motion';
2
- export { motionForwardRef } from './motion-forward-ref.js';
2
+ export { motionForwardRef } from './forward-ref.js';
3
3
  export { Motion } from './motion.js';
4
- export { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, MotionUIPropGetter, RequiredMotionUIPropGetter, UIMotionComponent, WithTransitionProps } from './motion.types.js';
4
+ export { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutAs, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, UIMotionComponent, WithTransitionProps } from './motion.types.js';
5
5
  export { MOTION_TRANSITION_DEFAULTS, MOTION_TRANSITION_EASINGS, MOTION_TRANSITION_VARIANTS, transitionEnter, transitionExit } from './utils.js';
6
6
  export { motion } from './factory.js';
7
7
  import '@yamada-ui/core';
package/dist/index.js CHANGED
@@ -159,13 +159,13 @@ __export(src_exports, {
159
159
  module.exports = __toCommonJS(src_exports);
160
160
  var import_framer_motion3 = require("framer-motion");
161
161
 
162
- // src/motion-forward-ref.tsx
162
+ // src/forward-ref.tsx
163
163
  var React = __toESM(require("react"));
164
- var motionForwardRef = (render) => {
164
+ function motionForwardRef(render) {
165
165
  return React.forwardRef(
166
166
  render
167
167
  );
168
- };
168
+ }
169
169
 
170
170
  // src/motion.tsx
171
171
  var import_core = require("@yamada-ui/core");
@@ -251,21 +251,29 @@ var MOTION_TRANSITION_DEFAULTS = {
251
251
  ease: MOTION_TRANSITION_EASINGS.easeIn
252
252
  }
253
253
  };
254
- var transitionEnter = (transition) => (delay2, duration) => ({
255
- ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
256
- ...duration ? { duration: (0, import_utils2.isNumber)(duration) ? duration : duration == null ? void 0 : duration.enter } : {},
257
- delay: (0, import_utils2.isNumber)(delay2) ? delay2 : delay2 == null ? void 0 : delay2.enter
258
- });
259
- var transitionExit = (transition) => (delay2, duration) => ({
260
- ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
261
- ...duration ? { duration: (0, import_utils2.isNumber)(duration) ? duration : duration == null ? void 0 : duration.exit } : {},
262
- delay: (0, import_utils2.isNumber)(delay2) ? delay2 : delay2 == null ? void 0 : delay2.exit
263
- });
254
+ function transitionEnter(transition) {
255
+ return function(delay2, duration) {
256
+ return {
257
+ ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
258
+ ...duration ? { duration: (0, import_utils2.isNumber)(duration) ? duration : duration == null ? void 0 : duration.enter } : {},
259
+ delay: (0, import_utils2.isNumber)(delay2) ? delay2 : delay2 == null ? void 0 : delay2.enter
260
+ };
261
+ };
262
+ }
263
+ function transitionExit(transition) {
264
+ return function(delay2, duration) {
265
+ return {
266
+ ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
267
+ ...duration ? { duration: (0, import_utils2.isNumber)(duration) ? duration : duration == null ? void 0 : duration.exit } : {},
268
+ delay: (0, import_utils2.isNumber)(delay2) ? delay2 : delay2 == null ? void 0 : delay2.exit
269
+ };
270
+ };
271
+ }
264
272
 
265
273
  // src/factory.ts
266
274
  var import_core2 = require("@yamada-ui/core");
267
275
  var import_framer_motion2 = require("framer-motion");
268
- var factory = () => {
276
+ function factory() {
269
277
  const cache = /* @__PURE__ */ new Map();
270
278
  return new Proxy(import_core2.styled, {
271
279
  apply: (_target, _thisArg, [el, options]) => {
@@ -276,7 +284,7 @@ var factory = () => {
276
284
  return cache.get(el);
277
285
  }
278
286
  });
279
- };
287
+ }
280
288
  var motion2 = factory();
281
289
  // Annotate the CommonJS export names for ESM import in node:
282
290
  0 && (module.exports = {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/motion-forward-ref.tsx","../src/motion.tsx","../src/utils.ts","../src/factory.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 \"./motion-forward-ref\"\nexport { Motion } from \"./motion\"\nexport * from \"./motion.types\"\nexport * from \"./utils\"\nexport * from \"./factory\"\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 const 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","import { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"framer-motion\"\nimport { motionForwardRef } from \"./motion-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\", MotionProps>(\"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 { isNumber } from \"@yamada-ui/utils\"\nimport type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } 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?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"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?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"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","import { styled, type StyledOptions } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\n\nconst 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 MotionFactory & MotionComponents\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"],"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;AA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CAAC;AAEtE,aAAO,MAAM,IAAI,EAAE;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAOO,IAAMC,UAAS,QAAQ;","names":["motion","import_framer_motion","import_utils","delay","import_core","import_framer_motion","_motion","motion"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/forward-ref.tsx","../src/motion.tsx","../src/utils.ts","../src/factory.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","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","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 { isNumber } from \"@yamada-ui/utils\"\nimport type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } 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 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","import { styled } from \"@yamada-ui/core\"\nimport type { StyledOptions } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\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"],"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;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AAO,MAAM,IAAI,EAAE;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAOO,IAAMC,UAAS,QAAQ;","names":["motion","import_framer_motion","import_utils","delay","import_core","import_framer_motion","_motion","motion"]}
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  "use client"
2
2
  import {
3
3
  motion
4
- } from "./chunk-2OYU7I6R.mjs";
4
+ } from "./chunk-HOM46QCE.mjs";
5
5
  import {
6
6
  Motion
7
- } from "./chunk-IYC7RHQQ.mjs";
7
+ } from "./chunk-M6WLOAFU.mjs";
8
8
  import {
9
9
  motionForwardRef
10
- } from "./chunk-CJBAGLAE.mjs";
10
+ } from "./chunk-IBE7Q3Z3.mjs";
11
11
  import "./chunk-R3D52RAW.mjs";
12
12
  import {
13
13
  MOTION_TRANSITION_DEFAULTS,
@@ -15,7 +15,7 @@ import {
15
15
  MOTION_TRANSITION_VARIANTS,
16
16
  transitionEnter,
17
17
  transitionExit
18
- } from "./chunk-WZQCVPKI.mjs";
18
+ } from "./chunk-Z6I57MQV.mjs";
19
19
 
20
20
  // src/index.ts
21
21
  import {
@@ -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 \"./motion-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 {\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":[]}
package/dist/motion.js CHANGED
@@ -38,13 +38,13 @@ var import_core = require("@yamada-ui/core");
38
38
  var import_utils = require("@yamada-ui/utils");
39
39
  var import_framer_motion = require("framer-motion");
40
40
 
41
- // src/motion-forward-ref.tsx
41
+ // src/forward-ref.tsx
42
42
  var React = __toESM(require("react"));
43
- var motionForwardRef = (render) => {
43
+ function motionForwardRef(render) {
44
44
  return React.forwardRef(
45
45
  render
46
46
  );
47
- };
47
+ }
48
48
 
49
49
  // src/motion.tsx
50
50
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/motion.tsx","../src/motion-forward-ref.tsx"],"sourcesContent":["import { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"framer-motion\"\nimport { motionForwardRef } from \"./motion-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\", MotionProps>(\"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 const 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;AACnB,mBAAmB;AACnB,2BAAuB;;;ACAvB,YAAuB;AAGhB,IAAM,mBAAmB,CAC9B,WAIG;AACH,SAAa;AAAA,IACX;AAAA,EACF;AACF;;;ADKI;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,gBAAY,gBAAuB,OAAO,EAAE,iBAAiB,CAAC;AAO7D,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 { 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":[]}
package/dist/motion.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import {
3
3
  Motion
4
- } from "./chunk-IYC7RHQQ.mjs";
5
- import "./chunk-CJBAGLAE.mjs";
4
+ } from "./chunk-M6WLOAFU.mjs";
5
+ import "./chunk-IBE7Q3Z3.mjs";
6
6
  export {
7
7
  Motion
8
8
  };
@@ -1,48 +1,53 @@
1
- import { StyledOptions, ComponentArgs, UIProps, ComponentMergeProps } from '@yamada-ui/core';
2
- import { Merge, Dict, MergeIfDefined } from '@yamada-ui/utils';
3
- import * as Motion from 'framer-motion';
1
+ import { StyledOptions, ComponentArgs, UIProps, WithoutAs, OmitProps } from '@yamada-ui/core';
2
+ import { Merge, Dict } from '@yamada-ui/utils';
3
+ import { DOMMotionComponents, MotionProps as MotionProps$1, Transition, Target, TargetAndTransition } from 'framer-motion';
4
4
  export { CSSStyleDeclarationWithTransform, DOMMotionComponents, HTMLMotionProps, AbsoluteKeyframe as MotionAbsoluteKeyframe, MotionAdvancedProps, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationDefinition as MotionAnimationDefinition, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptionsWithValueOverrides as MotionAnimationOptionsWithValueOverrides, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationPlaybackLifecycles as MotionAnimationPlaybackLifecycles, AnimationPlaybackOptions as MotionAnimationPlaybackOptions, AnimationProps as MotionAnimationProps, AnimationScope as MotionAnimationScope, AnimationSequence as MotionAnimationSequence, AnimationType as MotionAnimationType, At as MotionAt, Axis as MotionAxis, AxisDelta as MotionAxisDelta, BezierDefinition as MotionBezierDefinition, BoundingBox as MotionBoundingBox, Box as MotionBox, MotionConfigProps, CreateVisualElement as MotionCreateVisualElement, CustomDomComponent as MotionCustomDomComponent, CustomValueType as MotionCustomValueType, Cycle as MotionCycle, CycleState as MotionCycleState, DOMKeyframesDefinition as MotionDOMKeyframesDefinition, DOMSegment as MotionDOMSegment, DOMSegmentWithTransition as MotionDOMSegmentWithTransition, DecayOptions as MotionDecayOptions, DelayedFunction as MotionDelayedFunction, Delta as MotionDelta, DevMessage as MotionDevMessage, DragElastic as MotionDragElastic, DragHandlers as MotionDragHandlers, DraggableProps as MotionDraggableProps, DurationSpringOptions as MotionDurationSpringOptions, DynamicAnimationOptions as MotionDynamicAnimationOptions, DynamicOption as MotionDynamicOption, Easing as MotionEasing, EasingDefinition as MotionEasingDefinition, EasingFunction as MotionEasingFunction, EasingModifier as MotionEasingModifier, ElementOrSelector as MotionElementOrSelector, EventInfo as MotionEventInfo, FeatureBundle as MotionFeatureBundle, FeatureDefinition as MotionFeatureDefinition, FeatureDefinitions as MotionFeatureDefinitions, FeaturePackage as MotionFeaturePackage, FeaturePackages as MotionFeaturePackages, FocusHandlers as MotionFocusHandlers, HoverHandlers as MotionHoverHandlers, HydratedFeatureDefinition as MotionHydratedFeatureDefinition, HydratedFeatureDefinitions as MotionHydratedFeatureDefinitions, IProjectionNode as MotionIProjectionNode, Inertia as MotionInertia, InertiaOptions as MotionInertiaOptions, InterpolateOptions as MotionInterpolateOptions, KeyframeOptions as MotionKeyframeOptions, Keyframes as MotionKeyframes, KeyframesTarget as MotionKeyframesTarget, LayoutProps as MotionLayoutProps, LazyFeatureBundle as MotionLazyFeatureBundle, LazyProps as MotionLazyProps, MixerFactory as MotionMixerFactory, None as MotionNone, Orchestration as MotionOrchestration, PanHandlers as MotionPanHandlers, PanInfo as MotionPanInfo, PassiveEffect as MotionPassiveEffect, Point as MotionPoint, RelayoutInfo as MotionRelayoutInfo, RenderComponent as MotionRenderComponent, Repeat as MotionRepeat, RepeatType as MotionRepeatType, ResolveKeyframes as MotionResolveKeyframes, ResolveLayoutTransition as MotionResolveLayoutTransition, ResolvedAnimationDefinition as MotionResolvedAnimationDefinition, ResolvedAnimationDefinitions as MotionResolvedAnimationDefinitions, ResolvedKeyframesTarget as MotionResolvedKeyframesTarget, ResolvedSingleTarget as MotionResolvedSingleTarget, ResolvedValueTarget as MotionResolvedValueTarget, ResolvedValues as MotionResolvedValues, Segment as MotionSegment, SequenceLabel as MotionSequenceLabel, SequenceLabelWithTime as MotionSequenceLabelWithTime, SequenceMap as MotionSequenceMap, SequenceOptions as MotionSequenceOptions, SequenceTime as MotionSequenceTime, SingleTarget as MotionSingleTarget, Spring as MotionSpring, SpringOptions as MotionSpringOptions, MotionStyle, StyleKeyframesDefinition as MotionStyleKeyframesDefinition, StyleTransitions as MotionStyleTransitions, Subscriber as MotionSubscriber, TapHandlers as MotionTapHandlers, TapInfo as MotionTapInfo, Target as MotionTarget, TargetAndTransition as MotionTargetAndTransition, MotionTransform, TransformPoint as MotionTransformPoint, Transition as MotionTransition, Tween as MotionTween, UnresolvedValueKeyframe as MotionUnresolvedValueKeyframe, UseInViewOptions as MotionUseInViewOptions, MotionValue, ValueAnimationOptions as MotionValueAnimationOptions, ValueAnimationTransition as MotionValueAnimationTransition, ValueKeyframe as MotionValueKeyframe, ValueKeyframesDefinition as MotionValueKeyframesDefinition, MotionValueSegment, MotionValueSegmentWithTransition, ValueSequence as MotionValueSequence, ValueTarget as MotionValueTarget, ValueType as MotionValueType, VariableKeyframesDefinition as MotionVariableKeyframesDefinition, VariableTransitions as MotionVariableTransitions, Variant as MotionVariant, VariantLabels as MotionVariantLabels, Variants as MotionVariants, VelocityOptions as MotionVelocityOptions, VisualState as MotionVisualState, SVGAttributesAsMotionValues, SVGKeyframesDefinition, SVGMotionProps, SVGPathKeyframesDefinition, SVGPathTransitions, SVGTransitions, ScrapeMotionValuesFromProps, ScrollMotionValues } from 'framer-motion';
5
5
  import * as React from 'react';
6
6
 
7
- type MotionFactory = {
7
+ interface MotionFactory {
8
8
  <T extends MotionAs = MotionAs, M extends object = {}>(el: T, options?: StyledOptions): UIMotionComponent<T, M>;
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> & {
12
+ as?: M;
9
13
  };
10
- type ComponentProps<Y extends object, M extends object, D extends object, H extends MotionAs> = ComponentMergeProps<Y, M, D> & {
11
- as?: H;
12
- };
13
- type MotionComponent<Y extends MotionAs, M extends object = {}> = {
14
- <D extends MotionAs = Y>(props: ComponentProps<React.ComponentProps<Y>, React.ComponentProps<D>, M, D>): JSX.Element;
15
- } & ComponentArgs;
16
- type MotionAs = keyof Motion.DOMMotionComponents;
14
+ interface MotionComponent<Y extends MotionAs, D extends object = {}> extends ComponentArgs {
15
+ <M extends MotionAs = Y>(props: ComponentProps<Y, M, D>): JSX.Element;
16
+ }
17
+ type MotionAs = keyof DOMMotionComponents;
17
18
  type MotionComponents = {
18
- [Y in MotionAs]: MotionComponent<Y, MotionProps<Y>>;
19
+ [Y in MotionAs]: UIMotionComponent<Y>;
19
20
  };
20
- type UIMotionComponent<Y extends MotionAs, M extends object = {}> = MotionComponent<Y, Merge<UIMotionProps, M>>;
21
- type UIMotionProps = Merge<UIProps, Motion.MotionProps>;
21
+ interface UIMotionComponent<Y extends MotionAs, M extends object = {}> extends MotionComponent<Y, Merge<UIMotionProps, M>> {
22
+ }
23
+ interface UIMotionProps extends Merge<UIProps, MotionProps$1> {
24
+ as?: MotionAs;
25
+ }
22
26
  type FactoryAttributes<Y> = Y extends React.DetailedHTMLFactory<infer M, any> ? M : Y extends React.SVGFactory ? React.SVGAttributes<SVGElement> : never;
23
27
  type FactoryElement<Y> = Y extends React.DetailedHTMLFactory<any, infer M> ? M : Y extends React.SVGFactory ? SVGElement : never;
24
28
  type DOMAttributes<Y extends React.HTMLAttributes<M> | React.SVGAttributes<SVGElement>, M extends HTMLElement | SVGElement> = Y;
25
- type MotionProps<Y extends MotionAs = "div"> = Merge<DOMAttributes<FactoryAttributes<React.ReactDOM[Y]>, FactoryElement<React.ReactDOM[Y]>>, UIMotionProps> & {
26
- as?: MotionAs;
27
- };
29
+ type MotionProps<Y extends MotionAs = "div"> = Merge<DOMAttributes<FactoryAttributes<React.ReactDOM[Y]>, FactoryElement<React.ReactDOM[Y]>>, UIMotionProps>;
30
+ type MotionPropsWithoutAs<Y extends MotionAs = "div"> = WithoutAs<MotionProps<Y>>;
28
31
  type MotionPropsWithoutChildren<Y extends MotionAs = "div"> = Omit<MotionProps<Y>, "children">;
29
- type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProps) => Motion.TargetAndTransition;
30
- type Variant<Y = Dict> = Motion.TargetAndTransition | TargetResolver<Y>;
31
- type MotionTransitionVariants<Y = Dict> = {
32
+ type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProps) => TargetAndTransition;
33
+ type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
34
+ interface MotionTransitionVariants<Y = Dict> {
32
35
  enter: Variant<Y>;
33
36
  exit: Variant<Y>;
34
37
  initial?: Variant<Y>;
38
+ }
39
+ type MotionLifecycleProps<Y> = {
40
+ [key in "enter" | "exit"]?: Y;
35
41
  };
36
- type MotionLifecycleProps<Y> = Partial<Record<"enter" | "exit", Y>>;
37
- type MotionTransitionProps = {
42
+ interface MotionTransitionProps {
38
43
  /**
39
44
  * Custom `transition` definition for `enter` and `exit`.
40
45
  */
41
- transition?: MotionLifecycleProps<Motion.Transition>;
46
+ transition?: MotionLifecycleProps<Transition>;
42
47
  /**
43
48
  * Custom `transitionEnd` definition for `enter` and `exit`.
44
49
  */
45
- transitionEnd?: MotionLifecycleProps<Motion.Target>;
50
+ transitionEnd?: MotionLifecycleProps<Target>;
46
51
  /**
47
52
  * Custom `delay` definition for `enter` and `exit`.
48
53
  */
@@ -63,8 +68,8 @@ type MotionTransitionProps = {
63
68
  * Custom `initial`.
64
69
  */
65
70
  initial?: any;
66
- };
67
- type WithTransitionProps<Y extends object> = Omit<Y, "transition"> & MotionTransitionProps & {
71
+ }
72
+ type WithTransitionProps<Y extends object> = Omit<Y, "variants" | "transition"> & MotionTransitionProps & {
68
73
  /**
69
74
  * If `true`, the element will unmount when `isOpen={false}` and animation is done.
70
75
  */
@@ -74,7 +79,5 @@ type WithTransitionProps<Y extends object> = Omit<Y, "transition"> & MotionTrans
74
79
  */
75
80
  isOpen?: boolean;
76
81
  };
77
- type MotionUIPropGetter<Y extends MotionAs = "div", M = undefined> = (props?: MergeIfDefined<MotionProps<Y>, M>, ref?: React.Ref<any>) => MotionProps<Y> & React.RefAttributes<any>;
78
- type RequiredMotionUIPropGetter<Y extends MotionAs = "div", M = undefined> = (props: MergeIfDefined<MotionProps<Y>, M>, ref?: React.Ref<any>) => MotionProps<Y> & React.RefAttributes<any>;
79
82
 
80
- export type { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, MotionUIPropGetter, RequiredMotionUIPropGetter, UIMotionComponent, WithTransitionProps };
83
+ export type { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutAs, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, UIMotionComponent, WithTransitionProps };
@@ -1,48 +1,53 @@
1
- import { StyledOptions, ComponentArgs, UIProps, ComponentMergeProps } from '@yamada-ui/core';
2
- import { Merge, Dict, MergeIfDefined } from '@yamada-ui/utils';
3
- import * as Motion from 'framer-motion';
1
+ import { StyledOptions, ComponentArgs, UIProps, WithoutAs, OmitProps } from '@yamada-ui/core';
2
+ import { Merge, Dict } from '@yamada-ui/utils';
3
+ import { DOMMotionComponents, MotionProps as MotionProps$1, Transition, Target, TargetAndTransition } from 'framer-motion';
4
4
  export { CSSStyleDeclarationWithTransform, DOMMotionComponents, HTMLMotionProps, AbsoluteKeyframe as MotionAbsoluteKeyframe, MotionAdvancedProps, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationDefinition as MotionAnimationDefinition, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptionsWithValueOverrides as MotionAnimationOptionsWithValueOverrides, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationPlaybackLifecycles as MotionAnimationPlaybackLifecycles, AnimationPlaybackOptions as MotionAnimationPlaybackOptions, AnimationProps as MotionAnimationProps, AnimationScope as MotionAnimationScope, AnimationSequence as MotionAnimationSequence, AnimationType as MotionAnimationType, At as MotionAt, Axis as MotionAxis, AxisDelta as MotionAxisDelta, BezierDefinition as MotionBezierDefinition, BoundingBox as MotionBoundingBox, Box as MotionBox, MotionConfigProps, CreateVisualElement as MotionCreateVisualElement, CustomDomComponent as MotionCustomDomComponent, CustomValueType as MotionCustomValueType, Cycle as MotionCycle, CycleState as MotionCycleState, DOMKeyframesDefinition as MotionDOMKeyframesDefinition, DOMSegment as MotionDOMSegment, DOMSegmentWithTransition as MotionDOMSegmentWithTransition, DecayOptions as MotionDecayOptions, DelayedFunction as MotionDelayedFunction, Delta as MotionDelta, DevMessage as MotionDevMessage, DragElastic as MotionDragElastic, DragHandlers as MotionDragHandlers, DraggableProps as MotionDraggableProps, DurationSpringOptions as MotionDurationSpringOptions, DynamicAnimationOptions as MotionDynamicAnimationOptions, DynamicOption as MotionDynamicOption, Easing as MotionEasing, EasingDefinition as MotionEasingDefinition, EasingFunction as MotionEasingFunction, EasingModifier as MotionEasingModifier, ElementOrSelector as MotionElementOrSelector, EventInfo as MotionEventInfo, FeatureBundle as MotionFeatureBundle, FeatureDefinition as MotionFeatureDefinition, FeatureDefinitions as MotionFeatureDefinitions, FeaturePackage as MotionFeaturePackage, FeaturePackages as MotionFeaturePackages, FocusHandlers as MotionFocusHandlers, HoverHandlers as MotionHoverHandlers, HydratedFeatureDefinition as MotionHydratedFeatureDefinition, HydratedFeatureDefinitions as MotionHydratedFeatureDefinitions, IProjectionNode as MotionIProjectionNode, Inertia as MotionInertia, InertiaOptions as MotionInertiaOptions, InterpolateOptions as MotionInterpolateOptions, KeyframeOptions as MotionKeyframeOptions, Keyframes as MotionKeyframes, KeyframesTarget as MotionKeyframesTarget, LayoutProps as MotionLayoutProps, LazyFeatureBundle as MotionLazyFeatureBundle, LazyProps as MotionLazyProps, MixerFactory as MotionMixerFactory, None as MotionNone, Orchestration as MotionOrchestration, PanHandlers as MotionPanHandlers, PanInfo as MotionPanInfo, PassiveEffect as MotionPassiveEffect, Point as MotionPoint, RelayoutInfo as MotionRelayoutInfo, RenderComponent as MotionRenderComponent, Repeat as MotionRepeat, RepeatType as MotionRepeatType, ResolveKeyframes as MotionResolveKeyframes, ResolveLayoutTransition as MotionResolveLayoutTransition, ResolvedAnimationDefinition as MotionResolvedAnimationDefinition, ResolvedAnimationDefinitions as MotionResolvedAnimationDefinitions, ResolvedKeyframesTarget as MotionResolvedKeyframesTarget, ResolvedSingleTarget as MotionResolvedSingleTarget, ResolvedValueTarget as MotionResolvedValueTarget, ResolvedValues as MotionResolvedValues, Segment as MotionSegment, SequenceLabel as MotionSequenceLabel, SequenceLabelWithTime as MotionSequenceLabelWithTime, SequenceMap as MotionSequenceMap, SequenceOptions as MotionSequenceOptions, SequenceTime as MotionSequenceTime, SingleTarget as MotionSingleTarget, Spring as MotionSpring, SpringOptions as MotionSpringOptions, MotionStyle, StyleKeyframesDefinition as MotionStyleKeyframesDefinition, StyleTransitions as MotionStyleTransitions, Subscriber as MotionSubscriber, TapHandlers as MotionTapHandlers, TapInfo as MotionTapInfo, Target as MotionTarget, TargetAndTransition as MotionTargetAndTransition, MotionTransform, TransformPoint as MotionTransformPoint, Transition as MotionTransition, Tween as MotionTween, UnresolvedValueKeyframe as MotionUnresolvedValueKeyframe, UseInViewOptions as MotionUseInViewOptions, MotionValue, ValueAnimationOptions as MotionValueAnimationOptions, ValueAnimationTransition as MotionValueAnimationTransition, ValueKeyframe as MotionValueKeyframe, ValueKeyframesDefinition as MotionValueKeyframesDefinition, MotionValueSegment, MotionValueSegmentWithTransition, ValueSequence as MotionValueSequence, ValueTarget as MotionValueTarget, ValueType as MotionValueType, VariableKeyframesDefinition as MotionVariableKeyframesDefinition, VariableTransitions as MotionVariableTransitions, Variant as MotionVariant, VariantLabels as MotionVariantLabels, Variants as MotionVariants, VelocityOptions as MotionVelocityOptions, VisualState as MotionVisualState, SVGAttributesAsMotionValues, SVGKeyframesDefinition, SVGMotionProps, SVGPathKeyframesDefinition, SVGPathTransitions, SVGTransitions, ScrapeMotionValuesFromProps, ScrollMotionValues } from 'framer-motion';
5
5
  import * as React from 'react';
6
6
 
7
- type MotionFactory = {
7
+ interface MotionFactory {
8
8
  <T extends MotionAs = MotionAs, M extends object = {}>(el: T, options?: StyledOptions): UIMotionComponent<T, M>;
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> & {
12
+ as?: M;
9
13
  };
10
- type ComponentProps<Y extends object, M extends object, D extends object, H extends MotionAs> = ComponentMergeProps<Y, M, D> & {
11
- as?: H;
12
- };
13
- type MotionComponent<Y extends MotionAs, M extends object = {}> = {
14
- <D extends MotionAs = Y>(props: ComponentProps<React.ComponentProps<Y>, React.ComponentProps<D>, M, D>): JSX.Element;
15
- } & ComponentArgs;
16
- type MotionAs = keyof Motion.DOMMotionComponents;
14
+ interface MotionComponent<Y extends MotionAs, D extends object = {}> extends ComponentArgs {
15
+ <M extends MotionAs = Y>(props: ComponentProps<Y, M, D>): JSX.Element;
16
+ }
17
+ type MotionAs = keyof DOMMotionComponents;
17
18
  type MotionComponents = {
18
- [Y in MotionAs]: MotionComponent<Y, MotionProps<Y>>;
19
+ [Y in MotionAs]: UIMotionComponent<Y>;
19
20
  };
20
- type UIMotionComponent<Y extends MotionAs, M extends object = {}> = MotionComponent<Y, Merge<UIMotionProps, M>>;
21
- type UIMotionProps = Merge<UIProps, Motion.MotionProps>;
21
+ interface UIMotionComponent<Y extends MotionAs, M extends object = {}> extends MotionComponent<Y, Merge<UIMotionProps, M>> {
22
+ }
23
+ interface UIMotionProps extends Merge<UIProps, MotionProps$1> {
24
+ as?: MotionAs;
25
+ }
22
26
  type FactoryAttributes<Y> = Y extends React.DetailedHTMLFactory<infer M, any> ? M : Y extends React.SVGFactory ? React.SVGAttributes<SVGElement> : never;
23
27
  type FactoryElement<Y> = Y extends React.DetailedHTMLFactory<any, infer M> ? M : Y extends React.SVGFactory ? SVGElement : never;
24
28
  type DOMAttributes<Y extends React.HTMLAttributes<M> | React.SVGAttributes<SVGElement>, M extends HTMLElement | SVGElement> = Y;
25
- type MotionProps<Y extends MotionAs = "div"> = Merge<DOMAttributes<FactoryAttributes<React.ReactDOM[Y]>, FactoryElement<React.ReactDOM[Y]>>, UIMotionProps> & {
26
- as?: MotionAs;
27
- };
29
+ type MotionProps<Y extends MotionAs = "div"> = Merge<DOMAttributes<FactoryAttributes<React.ReactDOM[Y]>, FactoryElement<React.ReactDOM[Y]>>, UIMotionProps>;
30
+ type MotionPropsWithoutAs<Y extends MotionAs = "div"> = WithoutAs<MotionProps<Y>>;
28
31
  type MotionPropsWithoutChildren<Y extends MotionAs = "div"> = Omit<MotionProps<Y>, "children">;
29
- type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProps) => Motion.TargetAndTransition;
30
- type Variant<Y = Dict> = Motion.TargetAndTransition | TargetResolver<Y>;
31
- type MotionTransitionVariants<Y = Dict> = {
32
+ type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProps) => TargetAndTransition;
33
+ type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
34
+ interface MotionTransitionVariants<Y = Dict> {
32
35
  enter: Variant<Y>;
33
36
  exit: Variant<Y>;
34
37
  initial?: Variant<Y>;
38
+ }
39
+ type MotionLifecycleProps<Y> = {
40
+ [key in "enter" | "exit"]?: Y;
35
41
  };
36
- type MotionLifecycleProps<Y> = Partial<Record<"enter" | "exit", Y>>;
37
- type MotionTransitionProps = {
42
+ interface MotionTransitionProps {
38
43
  /**
39
44
  * Custom `transition` definition for `enter` and `exit`.
40
45
  */
41
- transition?: MotionLifecycleProps<Motion.Transition>;
46
+ transition?: MotionLifecycleProps<Transition>;
42
47
  /**
43
48
  * Custom `transitionEnd` definition for `enter` and `exit`.
44
49
  */
45
- transitionEnd?: MotionLifecycleProps<Motion.Target>;
50
+ transitionEnd?: MotionLifecycleProps<Target>;
46
51
  /**
47
52
  * Custom `delay` definition for `enter` and `exit`.
48
53
  */
@@ -63,8 +68,8 @@ type MotionTransitionProps = {
63
68
  * Custom `initial`.
64
69
  */
65
70
  initial?: any;
66
- };
67
- type WithTransitionProps<Y extends object> = Omit<Y, "transition"> & MotionTransitionProps & {
71
+ }
72
+ type WithTransitionProps<Y extends object> = Omit<Y, "variants" | "transition"> & MotionTransitionProps & {
68
73
  /**
69
74
  * If `true`, the element will unmount when `isOpen={false}` and animation is done.
70
75
  */
@@ -74,7 +79,5 @@ type WithTransitionProps<Y extends object> = Omit<Y, "transition"> & MotionTrans
74
79
  */
75
80
  isOpen?: boolean;
76
81
  };
77
- type MotionUIPropGetter<Y extends MotionAs = "div", M = undefined> = (props?: MergeIfDefined<MotionProps<Y>, M>, ref?: React.Ref<any>) => MotionProps<Y> & React.RefAttributes<any>;
78
- type RequiredMotionUIPropGetter<Y extends MotionAs = "div", M = undefined> = (props: MergeIfDefined<MotionProps<Y>, M>, ref?: React.Ref<any>) => MotionProps<Y> & React.RefAttributes<any>;
79
82
 
80
- export type { MotionAs, MotionComponent, MotionComponents, MotionFactory, MotionProps, MotionPropsWithoutChildren, MotionTransitionProps, MotionTransitionVariants, MotionUIPropGetter, RequiredMotionUIPropGetter, UIMotionComponent, WithTransitionProps };
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 ComponentMergeProps,\n StyledOptions,\n UIProps,\n} from \"@yamada-ui/core\"\nimport type { Dict, Merge, MergeIfDefined } from \"@yamada-ui/utils\"\nimport type * as Motion 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 type MotionFactory = {\n <T extends MotionAs = MotionAs, M extends object = {}>(\n el: T,\n options?: StyledOptions,\n ): UIMotionComponent<T, M>\n}\n\ntype ComponentProps<\n Y extends object,\n M extends object,\n D extends object,\n H extends MotionAs,\n> = ComponentMergeProps<Y, M, D> & {\n as?: H\n}\n\nexport type MotionComponent<Y extends MotionAs, M extends object = {}> = {\n <D extends MotionAs = Y>(\n props: ComponentProps<\n React.ComponentProps<Y>,\n React.ComponentProps<D>,\n M,\n D\n >,\n ): JSX.Element\n} & ComponentArgs\n\nexport type MotionAs = keyof Motion.DOMMotionComponents\n\nexport type MotionComponents = {\n [Y in MotionAs]: MotionComponent<Y, MotionProps<Y>>\n}\n\nexport type UIMotionComponent<\n Y extends MotionAs,\n M extends object = {},\n> = MotionComponent<Y, Merge<UIMotionProps, M>>\n\ntype UIMotionProps = Merge<UIProps, Motion.MotionProps>\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 as?: MotionAs\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) => Motion.TargetAndTransition\n\ntype Variant<Y = Dict> = Motion.TargetAndTransition | TargetResolver<Y>\n\nexport type MotionTransitionVariants<Y = Dict> = {\n enter: Variant<Y>\n exit: Variant<Y>\n initial?: Variant<Y>\n}\n\ntype MotionLifecycleProps<Y> = Partial<Record<\"enter\" | \"exit\", Y>>\n\nexport type MotionTransitionProps = {\n /**\n * Custom `transition` definition for `enter` and `exit`.\n */\n transition?: MotionLifecycleProps<Motion.Transition>\n /**\n * Custom `transitionEnd` definition for `enter` and `exit`.\n */\n transitionEnd?: MotionLifecycleProps<Motion.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<Y, \"transition\"> &\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\nexport type MotionUIPropGetter<Y extends MotionAs = \"div\", M = undefined> = (\n props?: MergeIfDefined<MotionProps<Y>, M>,\n ref?: React.Ref<any>,\n) => MotionProps<Y> & React.RefAttributes<any>\n\nexport type RequiredMotionUIPropGetter<\n Y extends MotionAs = \"div\",\n M = undefined,\n> = (\n props: MergeIfDefined<MotionProps<Y>, M>,\n ref?: React.Ref<any>,\n) => MotionProps<Y> & React.RefAttributes<any>\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 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":[]}
package/dist/utils.d.mts CHANGED
@@ -134,7 +134,7 @@ declare const MOTION_TRANSITION_DEFAULTS: {
134
134
  readonly ease: readonly [0.4, 0, 1, 1];
135
135
  };
136
136
  };
137
- declare const transitionEnter: (transition?: Transition) => (delay?: MotionTransitionProps["delay"], duration?: MotionTransitionProps["duration"]) => Transition;
138
- declare const transitionExit: (transition?: Transition) => (delay?: MotionTransitionProps["delay"], duration?: MotionTransitionProps["duration"]) => Transition;
137
+ declare function transitionEnter(transition?: Transition): (delay?: MotionTransitionProps["delay"], duration?: MotionTransitionProps["duration"]) => Transition;
138
+ declare function transitionExit(transition?: Transition): (delay?: MotionTransitionProps["delay"], duration?: MotionTransitionProps["duration"]) => Transition;
139
139
 
140
140
  export { MOTION_TRANSITION_DEFAULTS, MOTION_TRANSITION_EASINGS, MOTION_TRANSITION_VARIANTS, transitionEnter, transitionExit };
package/dist/utils.d.ts CHANGED
@@ -134,7 +134,7 @@ declare const MOTION_TRANSITION_DEFAULTS: {
134
134
  readonly ease: readonly [0.4, 0, 1, 1];
135
135
  };
136
136
  };
137
- declare const transitionEnter: (transition?: Transition) => (delay?: MotionTransitionProps["delay"], duration?: MotionTransitionProps["duration"]) => Transition;
138
- declare const transitionExit: (transition?: Transition) => (delay?: MotionTransitionProps["delay"], duration?: MotionTransitionProps["duration"]) => Transition;
137
+ declare function transitionEnter(transition?: Transition): (delay?: MotionTransitionProps["delay"], duration?: MotionTransitionProps["duration"]) => Transition;
138
+ declare function transitionExit(transition?: Transition): (delay?: MotionTransitionProps["delay"], duration?: MotionTransitionProps["duration"]) => Transition;
139
139
 
140
140
  export { MOTION_TRANSITION_DEFAULTS, MOTION_TRANSITION_EASINGS, MOTION_TRANSITION_VARIANTS, transitionEnter, transitionExit };
package/dist/utils.js CHANGED
@@ -91,16 +91,24 @@ var MOTION_TRANSITION_DEFAULTS = {
91
91
  ease: MOTION_TRANSITION_EASINGS.easeIn
92
92
  }
93
93
  };
94
- var transitionEnter = (transition) => (delay, duration) => ({
95
- ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
96
- ...duration ? { duration: (0, import_utils.isNumber)(duration) ? duration : duration == null ? void 0 : duration.enter } : {},
97
- delay: (0, import_utils.isNumber)(delay) ? delay : delay == null ? void 0 : delay.enter
98
- });
99
- var transitionExit = (transition) => (delay, duration) => ({
100
- ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
101
- ...duration ? { duration: (0, import_utils.isNumber)(duration) ? duration : duration == null ? void 0 : duration.exit } : {},
102
- delay: (0, import_utils.isNumber)(delay) ? delay : delay == null ? void 0 : delay.exit
103
- });
94
+ function transitionEnter(transition) {
95
+ return function(delay, duration) {
96
+ return {
97
+ ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
98
+ ...duration ? { duration: (0, import_utils.isNumber)(duration) ? duration : duration == null ? void 0 : duration.enter } : {},
99
+ delay: (0, import_utils.isNumber)(delay) ? delay : delay == null ? void 0 : delay.enter
100
+ };
101
+ };
102
+ }
103
+ function transitionExit(transition) {
104
+ return function(delay, duration) {
105
+ return {
106
+ ...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
107
+ ...duration ? { duration: (0, import_utils.isNumber)(duration) ? duration : duration == null ? void 0 : duration.exit } : {},
108
+ delay: (0, import_utils.isNumber)(delay) ? delay : delay == null ? void 0 : delay.exit
109
+ };
110
+ };
111
+ }
104
112
  // Annotate the CommonJS export names for ESM import in node:
105
113
  0 && (module.exports = {
106
114
  MOTION_TRANSITION_DEFAULTS,
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils.ts"],"sourcesContent":["import { isNumber } from \"@yamada-ui/utils\"\nimport type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } 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?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"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?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"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,IAA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AAA,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,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":[]}
1
+ {"version":3,"sources":["../src/utils.ts"],"sourcesContent":["import { isNumber } from \"@yamada-ui/utils\"\nimport type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } 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 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":";;;;;;;;;;;;;;;;;;;;;AA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@@ import {
5
5
  MOTION_TRANSITION_VARIANTS,
6
6
  transitionEnter,
7
7
  transitionExit
8
- } from "./chunk-WZQCVPKI.mjs";
8
+ } from "./chunk-Z6I57MQV.mjs";
9
9
  export {
10
10
  MOTION_TRANSITION_DEFAULTS,
11
11
  MOTION_TRANSITION_EASINGS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/motion",
3
- "version": "2.2.2-dev-20240915031944",
3
+ "version": "2.2.2-dev-20240917033401",
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": "11.3.24",
40
- "@yamada-ui/core": "1.14.1-dev-20240915031944",
41
- "@yamada-ui/utils": "1.5.0"
40
+ "@yamada-ui/core": "1.14.1-dev-20240917033401",
41
+ "@yamada-ui/utils": "1.5.1-dev-20240917033401"
42
42
  },
43
43
  "devDependencies": {
44
44
  "clean-package": "2.2.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import { styled, type StyledOptions } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\n\nconst 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 MotionFactory & MotionComponents\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"],"mappings":";;;AAAA,SAAS,cAAkC;AAC3C,SAAS,UAAU,eAAe;AAIlC,IAAM,UAAU,MAAM;AACpB,QAAM,QAAQ,oBAAI,IAA6B;AAE/C,SAAO,IAAI,MAAM,QAAQ;AAAA,IACvB,OAAO,CAAC,SAAS,UAAU,CAAC,IAAI,OAAO,MAAiC;AACtE,aAAO,QAAQ,OAAO,IAAI,OAAO,CAAkB;AAAA,IACrD;AAAA,IAEA,KAAK,CAAC,SAAS,OAAiB;AAC9B,UAAI,CAAC,MAAM,IAAI,EAAE,EAAG,OAAM,IAAI,IAAI,QAAQ,OAAO,EAAE,CAAkB,CAAC;AAEtE,aAAO,MAAM,IAAI,EAAE;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAOO,IAAM,SAAS,QAAQ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/motion-forward-ref.tsx"],"sourcesContent":["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 const 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":";;;AAEA,YAAY,WAAW;AAGhB,IAAM,mBAAmB,CAC9B,WAIG;AACH,SAAa;AAAA,IACX;AAAA,EACF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"framer-motion\"\nimport { motionForwardRef } from \"./motion-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\", MotionProps>(\"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":";;;;;;AAAA,SAAS,UAAU;AACnB,SAAS,UAAU;AACnB,SAAS,cAAc;AAiBnB;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,YAAY,GAAuB,OAAO,EAAE,iBAAiB,CAAC;AAO7D,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 +0,0 @@
1
- {"version":3,"sources":["../src/utils.ts"],"sourcesContent":["import { isNumber } from \"@yamada-ui/utils\"\nimport type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } 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?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"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?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"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,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAAA,EACzB,QAAQ,CAAC,KAAK,GAAG,GAAG,CAAC;AAAA,EACrB,SAAS,CAAC,GAAG,GAAG,KAAK,CAAC;AAAA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AE,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":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/motion-forward-ref.tsx"],"sourcesContent":["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 const 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;AAEA,YAAuB;AAGhB,IAAM,mBAAmB,CAC9B,WAIG;AACH,SAAa;AAAA,IACX;AAAA,EACF;AACF;","names":[]}
@@ -1,8 +0,0 @@
1
- "use client"
2
- import {
3
- motionForwardRef
4
- } from "./chunk-CJBAGLAE.mjs";
5
- export {
6
- motionForwardRef
7
- };
8
- //# sourceMappingURL=motion-forward-ref.mjs.map