@yamada-ui/motion 2.2.4-dev-20241005220629 → 2.2.4-dev-20241006000212
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-M6WLOAFU.mjs → chunk-2V3EH5L5.mjs} +2 -2
- package/dist/{chunk-M6WLOAFU.mjs.map → chunk-2V3EH5L5.mjs.map} +1 -1
- package/dist/{chunk-HOM46QCE.mjs → chunk-4MMUMOXF.mjs} +1 -1
- package/dist/{chunk-HOM46QCE.mjs.map → chunk-4MMUMOXF.mjs.map} +1 -1
- package/dist/{chunk-Z6I57MQV.mjs → chunk-AWDPDZLD.mjs} +23 -23
- package/dist/chunk-AWDPDZLD.mjs.map +1 -0
- package/dist/{chunk-IBE7Q3Z3.mjs → chunk-RXCU3ZFK.mjs} +1 -1
- package/dist/chunk-RXCU3ZFK.mjs.map +1 -0
- package/dist/factory.js.map +1 -1
- package/dist/factory.mjs +1 -1
- package/dist/forward-ref.d.mts +3 -3
- package/dist/forward-ref.d.ts +3 -3
- package/dist/forward-ref.js.map +1 -1
- package/dist/forward-ref.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +46 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -24
- package/dist/index.mjs.map +1 -1
- package/dist/motion.js.map +1 -1
- package/dist/motion.mjs +2 -2
- package/dist/motion.types.d.mts +20 -20
- package/dist/motion.types.d.ts +20 -20
- package/dist/motion.types.js.map +1 -1
- package/dist/motion.types.mjs +0 -1
- package/dist/utils.d.mts +35 -35
- package/dist/utils.d.ts +35 -35
- package/dist/utils.js +22 -22
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-IBE7Q3Z3.mjs.map +0 -1
- package/dist/chunk-R3D52RAW.mjs +0 -2
- package/dist/chunk-R3D52RAW.mjs.map +0 -1
- package/dist/chunk-Z6I57MQV.mjs.map +0 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
motionForwardRef
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-RXCU3ZFK.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-
|
29
|
+
//# sourceMappingURL=chunk-2V3EH5L5.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import {
|
1
|
+
{"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import type { Dict } from \"@yamada-ui/utils\"\nimport type { MotionProps } from \"./motion.types\"\nimport { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"framer-motion\"\nimport { motionForwardRef } from \"./forward-ref\"\n\nconst disableStyleProps = [\"transition\"]\n\nconst disableStyleProp = (prop: string) => disableStyleProps.includes(prop)\n\nconst Component = ui<\"div\", Dict>(\"div\", { disableStyleProp })\n\n/**\n * `Motion` is a component that allows for the easy implementation of a wide variety of animations.\n *\n * @see Docs https://yamada-ui.com/components/other/motion\n */\nexport const Motion = motionForwardRef<MotionProps, \"div\">(\n ({ as = \"div\", className, ...rest }, ref) => (\n <Component\n ref={ref}\n as={motion[as]}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n ),\n)\n"],"mappings":";;;;;;AAEA,SAAS,UAAU;AACnB,SAAS,UAAU;AACnB,SAAS,cAAc;AAgBnB;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,YAAY,GAAgB,OAAO,EAAE,iBAAiB,CAAC;AAOtD,IAAM,SAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QACnC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI,OAAO,EAAE;AAAA,MACb,WAAW,GAAG,aAAa,SAAS;AAAA,MACnC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import {
|
1
|
+
{"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import type { StyledOptions } from \"@yamada-ui/core\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\nimport { styled } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\n\ninterface Factory extends MotionFactory, MotionComponents {}\n\nfunction factory() {\n const cache = new Map<MotionAs, ComponentType>()\n\n return new Proxy(styled, {\n apply: (_target, _thisArg, [el, options]: [MotionAs, StyledOptions]) => {\n return _motion(styled(el, options) as ComponentType)\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el)) cache.set(el, _motion(styled(el) as ComponentType))\n\n return cache.get(el)\n },\n }) as Factory\n}\n\n/**\n * `motion` is a component that allows for the easy implementation of a wide variety of animations.\n *\n * @see Docs https://yamada-ui.com/components/other/motion\n */\nexport const motion = factory()\n"],"mappings":";;;AAGA,SAAS,cAAc;AACvB,SAAS,UAAU,eAAe;AAIlC,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":[]}
|
@@ -5,18 +5,18 @@ import { isNumber } from "@yamada-ui/utils";
|
|
5
5
|
var MOTION_TRANSITION_EASINGS = {
|
6
6
|
ease: [0.25, 0.1, 0.25, 1],
|
7
7
|
easeIn: [0.4, 0, 1, 1],
|
8
|
-
|
9
|
-
|
8
|
+
easeInOut: [0.4, 0, 0.2, 1],
|
9
|
+
easeOut: [0, 0, 0.2, 1]
|
10
10
|
};
|
11
11
|
var MOTION_TRANSITION_VARIANTS = {
|
12
|
-
scale: {
|
13
|
-
enter: { scale: 1 },
|
14
|
-
exit: { scale: 0.95 }
|
15
|
-
},
|
16
12
|
fade: {
|
17
13
|
enter: { opacity: 1 },
|
18
14
|
exit: { opacity: 0 }
|
19
15
|
},
|
16
|
+
pushDown: {
|
17
|
+
enter: { y: "-100%" },
|
18
|
+
exit: { y: "30%" }
|
19
|
+
},
|
20
20
|
pushLeft: {
|
21
21
|
enter: { x: "100%" },
|
22
22
|
exit: { x: "-30%" }
|
@@ -29,29 +29,29 @@ var MOTION_TRANSITION_VARIANTS = {
|
|
29
29
|
enter: { y: "100%" },
|
30
30
|
exit: { y: "-30%" }
|
31
31
|
},
|
32
|
-
|
33
|
-
enter: {
|
34
|
-
exit: {
|
32
|
+
scale: {
|
33
|
+
enter: { scale: 1 },
|
34
|
+
exit: { scale: 0.95 }
|
35
|
+
},
|
36
|
+
slideDown: {
|
37
|
+
enter: { x: 0, y: 0 },
|
38
|
+
exit: { x: 0, y: "100%" },
|
39
|
+
position: { bottom: 0, left: 0, maxWidth: "100vw", right: 0 }
|
35
40
|
},
|
36
41
|
slideLeft: {
|
37
|
-
position: { left: 0, top: 0, bottom: 0, width: "100%" },
|
38
42
|
enter: { x: 0, y: 0 },
|
39
|
-
exit: { x: "-100%", y: 0 }
|
43
|
+
exit: { x: "-100%", y: 0 },
|
44
|
+
position: { bottom: 0, left: 0, top: 0, width: "100%" }
|
40
45
|
},
|
41
46
|
slideRight: {
|
42
|
-
position: { right: 0, top: 0, bottom: 0, width: "100%" },
|
43
47
|
enter: { x: 0, y: 0 },
|
44
|
-
exit: { x: "100%", y: 0 }
|
48
|
+
exit: { x: "100%", y: 0 },
|
49
|
+
position: { bottom: 0, right: 0, top: 0, width: "100%" }
|
45
50
|
},
|
46
51
|
slideUp: {
|
47
|
-
position: { top: 0, left: 0, right: 0, maxWidth: "100vw" },
|
48
|
-
enter: { x: 0, y: 0 },
|
49
|
-
exit: { x: 0, y: "-100%" }
|
50
|
-
},
|
51
|
-
slideDown: {
|
52
|
-
position: { bottom: 0, left: 0, right: 0, maxWidth: "100vw" },
|
53
52
|
enter: { x: 0, y: 0 },
|
54
|
-
exit: { x: 0, y: "100%" }
|
53
|
+
exit: { x: 0, y: "-100%" },
|
54
|
+
position: { left: 0, maxWidth: "100vw", right: 0, top: 0 }
|
55
55
|
}
|
56
56
|
};
|
57
57
|
var MOTION_TRANSITION_DEFAULTS = {
|
@@ -68,7 +68,7 @@ function transitionEnter(transition) {
|
|
68
68
|
return function(delay, duration) {
|
69
69
|
return {
|
70
70
|
...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
|
71
|
-
...duration ? { duration: isNumber(duration) ? duration : duration
|
71
|
+
...duration ? { duration: isNumber(duration) ? duration : duration.enter } : {},
|
72
72
|
delay: isNumber(delay) ? delay : delay == null ? void 0 : delay.enter
|
73
73
|
};
|
74
74
|
};
|
@@ -77,7 +77,7 @@ function transitionExit(transition) {
|
|
77
77
|
return function(delay, duration) {
|
78
78
|
return {
|
79
79
|
...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
|
80
|
-
...duration ? { duration: isNumber(duration) ? duration : duration
|
80
|
+
...duration ? { duration: isNumber(duration) ? duration : duration.exit } : {},
|
81
81
|
delay: isNumber(delay) ? delay : delay == null ? void 0 : delay.exit
|
82
82
|
};
|
83
83
|
};
|
@@ -90,4 +90,4 @@ export {
|
|
90
90
|
transitionEnter,
|
91
91
|
transitionExit
|
92
92
|
};
|
93
|
-
//# sourceMappingURL=chunk-
|
93
|
+
//# sourceMappingURL=chunk-AWDPDZLD.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/utils.ts"],"sourcesContent":["import type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } from \"./motion.types\"\nimport { isNumber } from \"@yamada-ui/utils\"\n\nexport const MOTION_TRANSITION_EASINGS = {\n ease: [0.25, 0.1, 0.25, 1],\n easeIn: [0.4, 0, 1, 1],\n easeInOut: [0.4, 0, 0.2, 1],\n easeOut: [0, 0, 0.2, 1],\n} as const\n\nexport const MOTION_TRANSITION_VARIANTS = {\n fade: {\n enter: { opacity: 1 },\n exit: { opacity: 0 },\n },\n pushDown: {\n enter: { y: \"-100%\" },\n exit: { y: \"30%\" },\n },\n pushLeft: {\n enter: { x: \"100%\" },\n exit: { x: \"-30%\" },\n },\n pushRight: {\n enter: { x: \"-100%\" },\n exit: { x: \"30%\" },\n },\n pushUp: {\n enter: { y: \"100%\" },\n exit: { y: \"-30%\" },\n },\n scale: {\n enter: { scale: 1 },\n exit: { scale: 0.95 },\n },\n slideDown: {\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"100%\" },\n position: { bottom: 0, left: 0, maxWidth: \"100vw\", right: 0 },\n },\n slideLeft: {\n enter: { x: 0, y: 0 },\n exit: { x: \"-100%\", y: 0 },\n position: { bottom: 0, left: 0, top: 0, width: \"100%\" },\n },\n slideRight: {\n enter: { x: 0, y: 0 },\n exit: { x: \"100%\", y: 0 },\n position: { bottom: 0, right: 0, top: 0, width: \"100%\" },\n },\n slideUp: {\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"-100%\" },\n position: { left: 0, maxWidth: \"100vw\", right: 0, top: 0 },\n },\n} as const\n\nexport const MOTION_TRANSITION_DEFAULTS = {\n enter: {\n duration: 0.25,\n ease: MOTION_TRANSITION_EASINGS.easeOut,\n },\n exit: {\n duration: 0.2,\n ease: MOTION_TRANSITION_EASINGS.easeIn,\n },\n} as const\n\nexport function transitionEnter(transition?: Transition) {\n return function (\n delay?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"duration\"],\n ): Transition {\n return {\n ...(transition ?? MOTION_TRANSITION_DEFAULTS.enter),\n ...(duration\n ? { duration: isNumber(duration) ? duration : duration.enter }\n : {}),\n delay: isNumber(delay) ? delay : delay?.enter,\n }\n }\n}\n\nexport function transitionExit(transition?: Transition) {\n return function (\n delay?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"duration\"],\n ): Transition {\n return {\n ...(transition ?? MOTION_TRANSITION_DEFAULTS.exit),\n ...(duration\n ? { duration: isNumber(duration) ? duration : duration.exit }\n : {}),\n delay: isNumber(delay) ? delay : delay?.exit,\n }\n }\n}\n"],"mappings":";;;AAEA,SAAS,gBAAgB;AAElB,IAAM,4BAA4B;AAAA,EACvC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAAA,EACzB,QAAQ,CAAC,KAAK,GAAG,GAAG,CAAC;AAAA,EACrB,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;AAAA,EAC1B,SAAS,CAAC,GAAG,GAAG,KAAK,CAAC;AACxB;AAEO,IAAM,6BAA6B;AAAA,EACxC,MAAM;AAAA,IACJ,OAAO,EAAE,SAAS,EAAE;AAAA,IACpB,MAAM,EAAE,SAAS,EAAE;AAAA,EACrB;AAAA,EACA,UAAU;AAAA,IACR,OAAO,EAAE,GAAG,QAAQ;AAAA,IACpB,MAAM,EAAE,GAAG,MAAM;AAAA,EACnB;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,EAC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AC3D,CAAC;AAAA,MACL,OAAO,SAAS,KAAK,IAAI,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,SAAS,KAAK,IAC1D,CAAC;AAAA,MACL,OAAO,SAAS,KAAK,IAAI,QAAQ,+BAAO;AAAA,IAC1C;AAAA,EACF;AACF;","names":[]}
|
@@ -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 type { MotionAs, MotionComponent } from \"./motion.types\"\nimport * as React from \"react\"\n\nexport function motionForwardRef<Y extends object, M extends MotionAs>(\n render: React.ForwardRefRenderFunction<\n any,\n { as?: MotionAs } & Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>>\n >,\n) {\n return React.forwardRef(\n render as React.ForwardRefRenderFunction<any>,\n ) as unknown as MotionComponent<M, Y>\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAEhB,SAAS,iBACd,QAIA;AACA,SAAa;AAAA,IACX;AAAA,EACF;AACF;","names":[]}
|
package/dist/factory.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import {
|
1
|
+
{"version":3,"sources":["../src/factory.ts"],"sourcesContent":["import type { StyledOptions } from \"@yamada-ui/core\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\nimport { styled } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\n\ninterface Factory extends MotionFactory, MotionComponents {}\n\nfunction factory() {\n const cache = new Map<MotionAs, ComponentType>()\n\n return new Proxy(styled, {\n apply: (_target, _thisArg, [el, options]: [MotionAs, StyledOptions]) => {\n return _motion(styled(el, options) as ComponentType)\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el)) cache.set(el, _motion(styled(el) as ComponentType))\n\n return cache.get(el)\n },\n }) as Factory\n}\n\n/**\n * `motion` is a component that allows for the easy implementation of a wide variety of animations.\n *\n * @see Docs https://yamada-ui.com/components/other/motion\n */\nexport const motion = factory()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuB;AACvB,2BAAkC;AAIlC,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
package/dist/forward-ref.d.mts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import { WithoutAs } from '@yamada-ui/core';
|
2
2
|
import { Merge } from '@yamada-ui/utils';
|
3
|
-
import * as React from 'react';
|
4
3
|
import { MotionAs, MotionComponent } from './motion.types.mjs';
|
4
|
+
import * as React from 'react';
|
5
5
|
import 'framer-motion';
|
6
6
|
|
7
|
-
declare function motionForwardRef<Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any,
|
7
|
+
declare function motionForwardRef<Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any, {
|
8
8
|
as?: MotionAs;
|
9
|
-
}
|
9
|
+
} & Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>>>): MotionComponent<M, Y>;
|
10
10
|
|
11
11
|
export { motionForwardRef };
|
package/dist/forward-ref.d.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import { WithoutAs } from '@yamada-ui/core';
|
2
2
|
import { Merge } from '@yamada-ui/utils';
|
3
|
-
import * as React from 'react';
|
4
3
|
import { MotionAs, MotionComponent } from './motion.types.js';
|
4
|
+
import * as React from 'react';
|
5
5
|
import 'framer-motion';
|
6
6
|
|
7
|
-
declare function motionForwardRef<Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any,
|
7
|
+
declare function motionForwardRef<Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any, {
|
8
8
|
as?: MotionAs;
|
9
|
-
}
|
9
|
+
} & Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>>>): MotionComponent<M, Y>;
|
10
10
|
|
11
11
|
export { motionForwardRef };
|
package/dist/forward-ref.js.map
CHANGED
@@ -1 +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
|
1
|
+
{"version":3,"sources":["../src/forward-ref.tsx"],"sourcesContent":["import type { WithoutAs } from \"@yamada-ui/core\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { MotionAs, MotionComponent } from \"./motion.types\"\nimport * as React from \"react\"\n\nexport function motionForwardRef<Y extends object, M extends MotionAs>(\n render: React.ForwardRefRenderFunction<\n any,\n { as?: MotionAs } & Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>>\n >,\n) {\n return React.forwardRef(\n render as React.ForwardRefRenderFunction<any>,\n ) as unknown as MotionComponent<M, Y>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,YAAuB;AAEhB,SAAS,iBACd,QAIA;AACA,SAAa;AAAA,IACX;AAAA,EACF;AACF;","names":[]}
|
package/dist/forward-ref.mjs
CHANGED
package/dist/index.d.mts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
export {
|
1
|
+
export { motion } from './factory.mjs';
|
2
2
|
export { motionForwardRef } from './forward-ref.mjs';
|
3
3
|
export { Motion } from './motion.mjs';
|
4
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
|
-
export {
|
6
|
+
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';
|
7
7
|
import '@yamada-ui/core';
|
8
8
|
import '@yamada-ui/utils';
|
9
9
|
import 'react';
|
package/dist/index.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
export {
|
1
|
+
export { motion } from './factory.js';
|
2
2
|
export { motionForwardRef } from './forward-ref.js';
|
3
3
|
export { Motion } from './motion.js';
|
4
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
|
-
export {
|
6
|
+
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';
|
7
7
|
import '@yamada-ui/core';
|
8
8
|
import '@yamada-ui/utils';
|
9
9
|
import 'react';
|
package/dist/index.js
CHANGED
@@ -102,7 +102,7 @@ __export(src_exports, {
|
|
102
102
|
makeUseVisualState: () => import_framer_motion3.makeUseVisualState,
|
103
103
|
mirrorEasing: () => import_framer_motion3.mirrorEasing,
|
104
104
|
mix: () => import_framer_motion3.mix,
|
105
|
-
motion: () =>
|
105
|
+
motion: () => motion,
|
106
106
|
motionForwardRef: () => motionForwardRef,
|
107
107
|
motionValue: () => import_framer_motion3.motionValue,
|
108
108
|
optimizedAppearDataAttribute: () => import_framer_motion3.optimizedAppearDataAttribute,
|
@@ -157,7 +157,23 @@ __export(src_exports, {
|
|
157
157
|
wrap: () => import_framer_motion3.wrap
|
158
158
|
});
|
159
159
|
module.exports = __toCommonJS(src_exports);
|
160
|
-
|
160
|
+
|
161
|
+
// src/factory.ts
|
162
|
+
var import_core = require("@yamada-ui/core");
|
163
|
+
var import_framer_motion = require("framer-motion");
|
164
|
+
function factory() {
|
165
|
+
const cache = /* @__PURE__ */ new Map();
|
166
|
+
return new Proxy(import_core.styled, {
|
167
|
+
apply: (_target, _thisArg, [el, options]) => {
|
168
|
+
return (0, import_framer_motion.motion)((0, import_core.styled)(el, options));
|
169
|
+
},
|
170
|
+
get: (_target, el) => {
|
171
|
+
if (!cache.has(el)) cache.set(el, (0, import_framer_motion.motion)((0, import_core.styled)(el)));
|
172
|
+
return cache.get(el);
|
173
|
+
}
|
174
|
+
});
|
175
|
+
}
|
176
|
+
var motion = factory();
|
161
177
|
|
162
178
|
// src/forward-ref.tsx
|
163
179
|
var React = __toESM(require("react"));
|
@@ -168,19 +184,19 @@ function motionForwardRef(render) {
|
|
168
184
|
}
|
169
185
|
|
170
186
|
// src/motion.tsx
|
171
|
-
var
|
187
|
+
var import_core2 = require("@yamada-ui/core");
|
172
188
|
var import_utils = require("@yamada-ui/utils");
|
173
|
-
var
|
189
|
+
var import_framer_motion2 = require("framer-motion");
|
174
190
|
var import_jsx_runtime = require("react/jsx-runtime");
|
175
191
|
var disableStyleProps = ["transition"];
|
176
192
|
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
177
|
-
var Component = (0,
|
193
|
+
var Component = (0, import_core2.ui)("div", { disableStyleProp });
|
178
194
|
var Motion = motionForwardRef(
|
179
195
|
({ as = "div", className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
180
196
|
Component,
|
181
197
|
{
|
182
198
|
ref,
|
183
|
-
as:
|
199
|
+
as: import_framer_motion2.motion[as],
|
184
200
|
className: (0, import_utils.cx)("ui-motion", className),
|
185
201
|
...rest
|
186
202
|
}
|
@@ -192,18 +208,18 @@ var import_utils2 = require("@yamada-ui/utils");
|
|
192
208
|
var MOTION_TRANSITION_EASINGS = {
|
193
209
|
ease: [0.25, 0.1, 0.25, 1],
|
194
210
|
easeIn: [0.4, 0, 1, 1],
|
195
|
-
|
196
|
-
|
211
|
+
easeInOut: [0.4, 0, 0.2, 1],
|
212
|
+
easeOut: [0, 0, 0.2, 1]
|
197
213
|
};
|
198
214
|
var MOTION_TRANSITION_VARIANTS = {
|
199
|
-
scale: {
|
200
|
-
enter: { scale: 1 },
|
201
|
-
exit: { scale: 0.95 }
|
202
|
-
},
|
203
215
|
fade: {
|
204
216
|
enter: { opacity: 1 },
|
205
217
|
exit: { opacity: 0 }
|
206
218
|
},
|
219
|
+
pushDown: {
|
220
|
+
enter: { y: "-100%" },
|
221
|
+
exit: { y: "30%" }
|
222
|
+
},
|
207
223
|
pushLeft: {
|
208
224
|
enter: { x: "100%" },
|
209
225
|
exit: { x: "-30%" }
|
@@ -216,29 +232,29 @@ var MOTION_TRANSITION_VARIANTS = {
|
|
216
232
|
enter: { y: "100%" },
|
217
233
|
exit: { y: "-30%" }
|
218
234
|
},
|
219
|
-
|
220
|
-
enter: {
|
221
|
-
exit: {
|
235
|
+
scale: {
|
236
|
+
enter: { scale: 1 },
|
237
|
+
exit: { scale: 0.95 }
|
238
|
+
},
|
239
|
+
slideDown: {
|
240
|
+
enter: { x: 0, y: 0 },
|
241
|
+
exit: { x: 0, y: "100%" },
|
242
|
+
position: { bottom: 0, left: 0, maxWidth: "100vw", right: 0 }
|
222
243
|
},
|
223
244
|
slideLeft: {
|
224
|
-
position: { left: 0, top: 0, bottom: 0, width: "100%" },
|
225
245
|
enter: { x: 0, y: 0 },
|
226
|
-
exit: { x: "-100%", y: 0 }
|
246
|
+
exit: { x: "-100%", y: 0 },
|
247
|
+
position: { bottom: 0, left: 0, top: 0, width: "100%" }
|
227
248
|
},
|
228
249
|
slideRight: {
|
229
|
-
position: { right: 0, top: 0, bottom: 0, width: "100%" },
|
230
250
|
enter: { x: 0, y: 0 },
|
231
|
-
exit: { x: "100%", y: 0 }
|
251
|
+
exit: { x: "100%", y: 0 },
|
252
|
+
position: { bottom: 0, right: 0, top: 0, width: "100%" }
|
232
253
|
},
|
233
254
|
slideUp: {
|
234
|
-
position: { top: 0, left: 0, right: 0, maxWidth: "100vw" },
|
235
|
-
enter: { x: 0, y: 0 },
|
236
|
-
exit: { x: 0, y: "-100%" }
|
237
|
-
},
|
238
|
-
slideDown: {
|
239
|
-
position: { bottom: 0, left: 0, right: 0, maxWidth: "100vw" },
|
240
255
|
enter: { x: 0, y: 0 },
|
241
|
-
exit: { x: 0, y: "100%" }
|
256
|
+
exit: { x: 0, y: "-100%" },
|
257
|
+
position: { left: 0, maxWidth: "100vw", right: 0, top: 0 }
|
242
258
|
}
|
243
259
|
};
|
244
260
|
var MOTION_TRANSITION_DEFAULTS = {
|
@@ -255,7 +271,7 @@ function transitionEnter(transition) {
|
|
255
271
|
return function(delay2, duration) {
|
256
272
|
return {
|
257
273
|
...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
|
258
|
-
...duration ? { duration: (0, import_utils2.isNumber)(duration) ? duration : duration
|
274
|
+
...duration ? { duration: (0, import_utils2.isNumber)(duration) ? duration : duration.enter } : {},
|
259
275
|
delay: (0, import_utils2.isNumber)(delay2) ? delay2 : delay2 == null ? void 0 : delay2.enter
|
260
276
|
};
|
261
277
|
};
|
@@ -264,28 +280,14 @@ function transitionExit(transition) {
|
|
264
280
|
return function(delay2, duration) {
|
265
281
|
return {
|
266
282
|
...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
|
267
|
-
...duration ? { duration: (0, import_utils2.isNumber)(duration) ? duration : duration
|
283
|
+
...duration ? { duration: (0, import_utils2.isNumber)(duration) ? duration : duration.exit } : {},
|
268
284
|
delay: (0, import_utils2.isNumber)(delay2) ? delay2 : delay2 == null ? void 0 : delay2.exit
|
269
285
|
};
|
270
286
|
};
|
271
287
|
}
|
272
288
|
|
273
|
-
// src/
|
274
|
-
var
|
275
|
-
var import_framer_motion2 = require("framer-motion");
|
276
|
-
function factory() {
|
277
|
-
const cache = /* @__PURE__ */ new Map();
|
278
|
-
return new Proxy(import_core2.styled, {
|
279
|
-
apply: (_target, _thisArg, [el, options]) => {
|
280
|
-
return (0, import_framer_motion2.motion)((0, import_core2.styled)(el, options));
|
281
|
-
},
|
282
|
-
get: (_target, el) => {
|
283
|
-
if (!cache.has(el)) cache.set(el, (0, import_framer_motion2.motion)((0, import_core2.styled)(el)));
|
284
|
-
return cache.get(el);
|
285
|
-
}
|
286
|
-
});
|
287
|
-
}
|
288
|
-
var motion2 = factory();
|
289
|
+
// src/index.ts
|
290
|
+
var import_framer_motion3 = require("framer-motion");
|
289
291
|
// Annotate the CommonJS export names for ESM import in node:
|
290
292
|
0 && (module.exports = {
|
291
293
|
AcceleratedAnimation,
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
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;AAAA;AAAA,gBAAAA;AAAA,EAAA;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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AO,SACLC,QACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,qCAAU,MAAM,IAC5D,CAAC;AAAA,MACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;AAEO,SAAS,eAAe,YAAyB;AACtD,SAAO,SACLA,QACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,qCAAU,KAAK,IAC3D,CAAC;AAAA,MACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;;;ACjGA,IAAAC,eAAuB;AAEvB,IAAAC,wBAAkC;AAMlC,SAAS,UAAU;AACjB,QAAM,QAAQ,oBAAI,IAA6B;AAE/C,SAAO,IAAI,MAAM,qBAAQ;AAAA,IACvB,OAAO,CAAC,SAAS,UAAU,CAAC,IAAI,OAAO,MAAiC;AACtE,iBAAO,sBAAAC,YAAQ,qBAAO,IAAI,OAAO,CAAkB;AAAA,IACrD;AAAA,IAEA,KAAK,CAAC,SAAS,OAAiB;AAC9B,UAAI,CAAC,MAAM,IAAI,EAAE,EAAG,OAAM,IAAI,QAAI,sBAAAA,YAAQ,qBAAO,EAAE,CAAkB,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/factory.ts","../src/forward-ref.tsx","../src/motion.tsx","../src/utils.ts"],"sourcesContent":["export * from \"./factory\"\nexport * from \"./forward-ref\"\nexport { Motion } from \"./motion\"\nexport type * from \"./motion.types\"\nexport * from \"./utils\"\nexport {\n AcceleratedAnimation,\n addPointerInfo,\n addScaleCorrector,\n animate,\n AnimatePresence,\n AnimateSharedLayout,\n animateValue,\n animateVisualElement,\n animationControls,\n animations,\n anticipate,\n backIn,\n backInOut,\n backOut,\n buildTransform,\n calcLength,\n cancelFrame,\n cancelSync,\n circIn,\n circInOut,\n circOut,\n clamp,\n color,\n complex,\n createBox,\n createDomMotionComponent,\n createMotionComponent,\n createScopedAnimate,\n cubicBezier,\n delay,\n DeprecatedLayoutGroupContext,\n disableInstantTransitions,\n distance,\n distance2D,\n domAnimation,\n domMax,\n DragControls,\n easeIn,\n easeInOut,\n easeOut,\n filterProps,\n FlatTree,\n frame,\n frameData,\n interpolate,\n invariant,\n inView,\n isBrowser,\n isDragActive,\n isMotionComponent,\n isMotionValue,\n isValidMotionProp,\n LayoutGroup,\n LayoutGroupContext,\n LazyMotion,\n m,\n makeUseVisualState,\n mirrorEasing,\n mix,\n MotionConfig,\n MotionConfigContext,\n MotionContext,\n MotionGlobalConfig,\n motionValue,\n optimizedAppearDataAttribute,\n pipe,\n PresenceContext,\n progress,\n px,\n Reorder as MotionReorder,\n resolveMotionValue,\n reverseEasing,\n scroll,\n scrollInfo,\n spring,\n stagger,\n startOptimizedAppearAnimation,\n steps,\n SwitchLayoutGroupContext,\n sync,\n transform,\n unwrapMotionComponent,\n useAnimate,\n useAnimation as useMotionAnimation,\n useAnimationControls,\n useAnimationFrame,\n useCycle,\n useDeprecatedAnimatedState,\n useDeprecatedInvertedScale,\n useDomEvent,\n useDragControls,\n useElementScroll,\n useForceUpdate,\n useInstantLayoutTransition,\n useInstantTransition,\n useInView,\n useIsomorphicLayoutEffect,\n useIsPresent,\n useMotionTemplate,\n useMotionValue,\n useMotionValueEvent,\n usePresence,\n useReducedMotion,\n useReducedMotionConfig,\n useResetProjection,\n useScroll,\n useSpring,\n useTime,\n useTransform,\n useVelocity,\n useViewportScroll,\n useWillChange,\n VisualElement,\n visualElementStore,\n warning,\n wrap,\n} from \"framer-motion\"\n","import type { StyledOptions } from \"@yamada-ui/core\"\nimport type { ComponentType } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\nimport { styled } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"framer-motion\"\n\ninterface Factory extends MotionFactory, MotionComponents {}\n\nfunction factory() {\n const cache = new Map<MotionAs, ComponentType>()\n\n return new Proxy(styled, {\n apply: (_target, _thisArg, [el, options]: [MotionAs, StyledOptions]) => {\n return _motion(styled(el, options) as ComponentType)\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el)) cache.set(el, _motion(styled(el) as ComponentType))\n\n return cache.get(el)\n },\n }) as Factory\n}\n\n/**\n * `motion` is a component that allows for the easy implementation of a wide variety of animations.\n *\n * @see Docs https://yamada-ui.com/components/other/motion\n */\nexport const motion = factory()\n","import type { WithoutAs } from \"@yamada-ui/core\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { MotionAs, MotionComponent } from \"./motion.types\"\nimport * as React from \"react\"\n\nexport function motionForwardRef<Y extends object, M extends MotionAs>(\n render: React.ForwardRefRenderFunction<\n any,\n { as?: MotionAs } & Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>>\n >,\n) {\n return React.forwardRef(\n render as React.ForwardRefRenderFunction<any>,\n ) as unknown as MotionComponent<M, Y>\n}\n","import type { Dict } from \"@yamada-ui/utils\"\nimport type { MotionProps } from \"./motion.types\"\nimport { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"framer-motion\"\nimport { motionForwardRef } from \"./forward-ref\"\n\nconst disableStyleProps = [\"transition\"]\n\nconst disableStyleProp = (prop: string) => disableStyleProps.includes(prop)\n\nconst Component = ui<\"div\", Dict>(\"div\", { disableStyleProp })\n\n/**\n * `Motion` is a component that allows for the easy implementation of a wide variety of animations.\n *\n * @see Docs https://yamada-ui.com/components/other/motion\n */\nexport const Motion = motionForwardRef<MotionProps, \"div\">(\n ({ as = \"div\", className, ...rest }, ref) => (\n <Component\n ref={ref}\n as={motion[as]}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n ),\n)\n","import type { Transition } from \"framer-motion\"\nimport type { MotionTransitionProps } from \"./motion.types\"\nimport { isNumber } from \"@yamada-ui/utils\"\n\nexport const MOTION_TRANSITION_EASINGS = {\n ease: [0.25, 0.1, 0.25, 1],\n easeIn: [0.4, 0, 1, 1],\n easeInOut: [0.4, 0, 0.2, 1],\n easeOut: [0, 0, 0.2, 1],\n} as const\n\nexport const MOTION_TRANSITION_VARIANTS = {\n fade: {\n enter: { opacity: 1 },\n exit: { opacity: 0 },\n },\n pushDown: {\n enter: { y: \"-100%\" },\n exit: { y: \"30%\" },\n },\n pushLeft: {\n enter: { x: \"100%\" },\n exit: { x: \"-30%\" },\n },\n pushRight: {\n enter: { x: \"-100%\" },\n exit: { x: \"30%\" },\n },\n pushUp: {\n enter: { y: \"100%\" },\n exit: { y: \"-30%\" },\n },\n scale: {\n enter: { scale: 1 },\n exit: { scale: 0.95 },\n },\n slideDown: {\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"100%\" },\n position: { bottom: 0, left: 0, maxWidth: \"100vw\", right: 0 },\n },\n slideLeft: {\n enter: { x: 0, y: 0 },\n exit: { x: \"-100%\", y: 0 },\n position: { bottom: 0, left: 0, top: 0, width: \"100%\" },\n },\n slideRight: {\n enter: { x: 0, y: 0 },\n exit: { x: \"100%\", y: 0 },\n position: { bottom: 0, right: 0, top: 0, width: \"100%\" },\n },\n slideUp: {\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"-100%\" },\n position: { left: 0, maxWidth: \"100vw\", right: 0, top: 0 },\n },\n} as const\n\nexport const MOTION_TRANSITION_DEFAULTS = {\n enter: {\n duration: 0.25,\n ease: MOTION_TRANSITION_EASINGS.easeOut,\n },\n exit: {\n duration: 0.2,\n ease: MOTION_TRANSITION_EASINGS.easeIn,\n },\n} as const\n\nexport function transitionEnter(transition?: Transition) {\n return function (\n delay?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"duration\"],\n ): Transition {\n return {\n ...(transition ?? MOTION_TRANSITION_DEFAULTS.enter),\n ...(duration\n ? { duration: isNumber(duration) ? duration : duration.enter }\n : {}),\n delay: isNumber(delay) ? delay : delay?.enter,\n }\n }\n}\n\nexport function transitionExit(transition?: Transition) {\n return function (\n delay?: MotionTransitionProps[\"delay\"],\n duration?: MotionTransitionProps[\"duration\"],\n ): Transition {\n return {\n ...(transition ?? MOTION_TRANSITION_DEFAULTS.exit),\n ...(duration\n ? { duration: isNumber(duration) ? duration : duration.exit }\n : {}),\n delay: isNumber(delay) ? delay : delay?.exit,\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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