@yamada-ui/motion 2.2.1-dev-20240907114945 → 2.2.1-dev-20240907122824
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-IER3FOYD.mjs → chunk-2OYU7I6R.mjs} +3 -6
- package/dist/chunk-2OYU7I6R.mjs.map +1 -0
- package/dist/chunk-CJBAGLAE.mjs +14 -0
- package/dist/chunk-CJBAGLAE.mjs.map +1 -0
- package/dist/chunk-IYC7RHQQ.mjs +29 -0
- package/dist/chunk-IYC7RHQQ.mjs.map +1 -0
- package/dist/factory.d.mts +2 -0
- package/dist/factory.d.ts +2 -0
- package/dist/factory.js +2 -5
- package/dist/factory.js.map +1 -1
- package/dist/factory.mjs +1 -1
- package/dist/index.js +158 -142
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/motion-forward-ref.d.mts +1 -1
- package/dist/motion-forward-ref.d.ts +1 -1
- package/dist/motion-forward-ref.js +4 -2
- package/dist/motion-forward-ref.js.map +1 -1
- package/dist/motion-forward-ref.mjs +1 -1
- package/dist/motion.d.mts +2 -2
- package/dist/motion.d.ts +2 -2
- package/dist/motion.js +33 -18
- package/dist/motion.js.map +1 -1
- package/dist/motion.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-IER3FOYD.mjs.map +0 -1
- package/dist/chunk-K3SPRYR3.mjs +0 -12
- package/dist/chunk-K3SPRYR3.mjs.map +0 -1
- package/dist/chunk-ZSIGLH6W.mjs +0 -12
- package/dist/chunk-ZSIGLH6W.mjs.map +0 -1
@@ -3,17 +3,14 @@
|
|
3
3
|
// src/factory.ts
|
4
4
|
import { styled } from "@yamada-ui/core";
|
5
5
|
import { motion as _motion } from "framer-motion";
|
6
|
-
var disableStyleProps = ["transition"];
|
7
|
-
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
8
6
|
var factory = () => {
|
9
7
|
const cache = /* @__PURE__ */ new Map();
|
10
8
|
return new Proxy(styled, {
|
11
9
|
apply: (_target, _thisArg, [el, options]) => {
|
12
|
-
return styled(
|
10
|
+
return _motion(styled(el, options));
|
13
11
|
},
|
14
12
|
get: (_target, el) => {
|
15
|
-
if (!cache.has(el))
|
16
|
-
cache.set(el, styled(_motion(el), { disableStyleProp }));
|
13
|
+
if (!cache.has(el)) cache.set(el, _motion(styled(el)));
|
17
14
|
return cache.get(el);
|
18
15
|
}
|
19
16
|
});
|
@@ -23,4 +20,4 @@ var motion = factory();
|
|
23
20
|
export {
|
24
21
|
motion
|
25
22
|
};
|
26
|
-
//# sourceMappingURL=chunk-
|
23
|
+
//# sourceMappingURL=chunk-2OYU7I6R.mjs.map
|
@@ -0,0 +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,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":[]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
// src/motion-forward-ref.tsx
|
4
|
+
import * as React from "react";
|
5
|
+
var motionForwardRef = (render) => {
|
6
|
+
return React.forwardRef(
|
7
|
+
render
|
8
|
+
);
|
9
|
+
};
|
10
|
+
|
11
|
+
export {
|
12
|
+
motionForwardRef
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=chunk-CJBAGLAE.mjs.map
|
@@ -0,0 +1 @@
|
|
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":[]}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use client"
|
2
|
+
import {
|
3
|
+
motionForwardRef
|
4
|
+
} from "./chunk-CJBAGLAE.mjs";
|
5
|
+
|
6
|
+
// src/motion.tsx
|
7
|
+
import { ui } from "@yamada-ui/core";
|
8
|
+
import { cx } from "@yamada-ui/utils";
|
9
|
+
import { motion } from "framer-motion";
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
11
|
+
var disableStyleProps = ["transition"];
|
12
|
+
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
13
|
+
var Component = ui("div", { disableStyleProp });
|
14
|
+
var Motion = motionForwardRef(
|
15
|
+
({ as = "div", className, ...rest }, ref) => /* @__PURE__ */ jsx(
|
16
|
+
Component,
|
17
|
+
{
|
18
|
+
ref,
|
19
|
+
as: motion[as],
|
20
|
+
className: cx("ui-motion", className),
|
21
|
+
...rest
|
22
|
+
}
|
23
|
+
)
|
24
|
+
);
|
25
|
+
|
26
|
+
export {
|
27
|
+
Motion
|
28
|
+
};
|
29
|
+
//# sourceMappingURL=chunk-IYC7RHQQ.mjs.map
|
@@ -0,0 +1 @@
|
|
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":[]}
|
package/dist/factory.d.mts
CHANGED
@@ -5,7 +5,9 @@ import 'framer-motion';
|
|
5
5
|
import 'react';
|
6
6
|
|
7
7
|
/**
|
8
|
+
* `motion` is a component that allows for the easy implementation of a wide variety of animations.
|
8
9
|
*
|
10
|
+
* @see Docs https://yamada-ui.com/components/other/motion
|
9
11
|
*/
|
10
12
|
declare const motion: MotionFactory & MotionComponents;
|
11
13
|
|
package/dist/factory.d.ts
CHANGED
@@ -5,7 +5,9 @@ import 'framer-motion';
|
|
5
5
|
import 'react';
|
6
6
|
|
7
7
|
/**
|
8
|
+
* `motion` is a component that allows for the easy implementation of a wide variety of animations.
|
8
9
|
*
|
10
|
+
* @see Docs https://yamada-ui.com/components/other/motion
|
9
11
|
*/
|
10
12
|
declare const motion: MotionFactory & MotionComponents;
|
11
13
|
|
package/dist/factory.js
CHANGED
@@ -26,17 +26,14 @@ __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 disableStyleProps = ["transition"];
|
30
|
-
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
31
29
|
var factory = () => {
|
32
30
|
const cache = /* @__PURE__ */ new Map();
|
33
31
|
return new Proxy(import_core.styled, {
|
34
32
|
apply: (_target, _thisArg, [el, options]) => {
|
35
|
-
return (0,
|
33
|
+
return (0, import_framer_motion.motion)((0, import_core.styled)(el, options));
|
36
34
|
},
|
37
35
|
get: (_target, el) => {
|
38
|
-
if (!cache.has(el))
|
39
|
-
cache.set(el, (0, import_core.styled)((0, import_framer_motion.motion)(el), { disableStyleProp }));
|
36
|
+
if (!cache.has(el)) cache.set(el, (0, import_framer_motion.motion)((0, import_core.styled)(el)));
|
40
37
|
return cache.get(el);
|
41
38
|
}
|
42
39
|
});
|
package/dist/factory.js.map
CHANGED
@@ -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
|
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"]}
|
package/dist/factory.mjs
CHANGED
package/dist/index.js
CHANGED
@@ -31,165 +31,164 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
31
31
|
// src/index.ts
|
32
32
|
var src_exports = {};
|
33
33
|
__export(src_exports, {
|
34
|
-
AcceleratedAnimation: () =>
|
35
|
-
AnimatePresence: () =>
|
36
|
-
AnimateSharedLayout: () =>
|
37
|
-
DeprecatedLayoutGroupContext: () =>
|
38
|
-
DragControls: () =>
|
39
|
-
FlatTree: () =>
|
40
|
-
LayoutGroup: () =>
|
41
|
-
LayoutGroupContext: () =>
|
42
|
-
LazyMotion: () =>
|
34
|
+
AcceleratedAnimation: () => import_framer_motion3.AcceleratedAnimation,
|
35
|
+
AnimatePresence: () => import_framer_motion3.AnimatePresence,
|
36
|
+
AnimateSharedLayout: () => import_framer_motion3.AnimateSharedLayout,
|
37
|
+
DeprecatedLayoutGroupContext: () => import_framer_motion3.DeprecatedLayoutGroupContext,
|
38
|
+
DragControls: () => import_framer_motion3.DragControls,
|
39
|
+
FlatTree: () => import_framer_motion3.FlatTree,
|
40
|
+
LayoutGroup: () => import_framer_motion3.LayoutGroup,
|
41
|
+
LayoutGroupContext: () => import_framer_motion3.LayoutGroupContext,
|
42
|
+
LazyMotion: () => import_framer_motion3.LazyMotion,
|
43
43
|
MOTION_TRANSITION_DEFAULTS: () => MOTION_TRANSITION_DEFAULTS,
|
44
44
|
MOTION_TRANSITION_EASINGS: () => MOTION_TRANSITION_EASINGS,
|
45
45
|
MOTION_TRANSITION_VARIANTS: () => MOTION_TRANSITION_VARIANTS,
|
46
46
|
Motion: () => Motion,
|
47
|
-
MotionConfig: () =>
|
48
|
-
MotionConfigContext: () =>
|
49
|
-
MotionContext: () =>
|
50
|
-
MotionGlobalConfig: () =>
|
51
|
-
MotionReorder: () =>
|
52
|
-
PresenceContext: () =>
|
53
|
-
SwitchLayoutGroupContext: () =>
|
54
|
-
VisualElement: () =>
|
55
|
-
addPointerInfo: () =>
|
56
|
-
addScaleCorrector: () =>
|
57
|
-
animate: () =>
|
58
|
-
animateValue: () =>
|
59
|
-
animateVisualElement: () =>
|
60
|
-
animationControls: () =>
|
61
|
-
animations: () =>
|
62
|
-
anticipate: () =>
|
63
|
-
backIn: () =>
|
64
|
-
backInOut: () =>
|
65
|
-
backOut: () =>
|
66
|
-
buildTransform: () =>
|
67
|
-
calcLength: () =>
|
68
|
-
cancelFrame: () =>
|
69
|
-
cancelSync: () =>
|
70
|
-
circIn: () =>
|
71
|
-
circInOut: () =>
|
72
|
-
circOut: () =>
|
73
|
-
clamp: () =>
|
74
|
-
color: () =>
|
75
|
-
complex: () =>
|
76
|
-
createBox: () =>
|
77
|
-
createDomMotionComponent: () =>
|
78
|
-
createMotionComponent: () =>
|
79
|
-
createScopedAnimate: () =>
|
80
|
-
cubicBezier: () =>
|
81
|
-
delay: () =>
|
82
|
-
disableInstantTransitions: () =>
|
83
|
-
distance: () =>
|
84
|
-
distance2D: () =>
|
85
|
-
domAnimation: () =>
|
86
|
-
domMax: () =>
|
87
|
-
easeIn: () =>
|
88
|
-
easeInOut: () =>
|
89
|
-
easeOut: () =>
|
90
|
-
filterProps: () =>
|
91
|
-
frame: () =>
|
92
|
-
frameData: () =>
|
93
|
-
inView: () =>
|
94
|
-
interpolate: () =>
|
95
|
-
invariant: () =>
|
96
|
-
isBrowser: () =>
|
97
|
-
isDragActive: () =>
|
98
|
-
isMotionComponent: () =>
|
99
|
-
isMotionValue: () =>
|
100
|
-
isValidMotionProp: () =>
|
101
|
-
m: () =>
|
102
|
-
makeUseVisualState: () =>
|
103
|
-
mirrorEasing: () =>
|
104
|
-
mix: () =>
|
105
|
-
motion: () =>
|
47
|
+
MotionConfig: () => import_framer_motion3.MotionConfig,
|
48
|
+
MotionConfigContext: () => import_framer_motion3.MotionConfigContext,
|
49
|
+
MotionContext: () => import_framer_motion3.MotionContext,
|
50
|
+
MotionGlobalConfig: () => import_framer_motion3.MotionGlobalConfig,
|
51
|
+
MotionReorder: () => import_framer_motion3.Reorder,
|
52
|
+
PresenceContext: () => import_framer_motion3.PresenceContext,
|
53
|
+
SwitchLayoutGroupContext: () => import_framer_motion3.SwitchLayoutGroupContext,
|
54
|
+
VisualElement: () => import_framer_motion3.VisualElement,
|
55
|
+
addPointerInfo: () => import_framer_motion3.addPointerInfo,
|
56
|
+
addScaleCorrector: () => import_framer_motion3.addScaleCorrector,
|
57
|
+
animate: () => import_framer_motion3.animate,
|
58
|
+
animateValue: () => import_framer_motion3.animateValue,
|
59
|
+
animateVisualElement: () => import_framer_motion3.animateVisualElement,
|
60
|
+
animationControls: () => import_framer_motion3.animationControls,
|
61
|
+
animations: () => import_framer_motion3.animations,
|
62
|
+
anticipate: () => import_framer_motion3.anticipate,
|
63
|
+
backIn: () => import_framer_motion3.backIn,
|
64
|
+
backInOut: () => import_framer_motion3.backInOut,
|
65
|
+
backOut: () => import_framer_motion3.backOut,
|
66
|
+
buildTransform: () => import_framer_motion3.buildTransform,
|
67
|
+
calcLength: () => import_framer_motion3.calcLength,
|
68
|
+
cancelFrame: () => import_framer_motion3.cancelFrame,
|
69
|
+
cancelSync: () => import_framer_motion3.cancelSync,
|
70
|
+
circIn: () => import_framer_motion3.circIn,
|
71
|
+
circInOut: () => import_framer_motion3.circInOut,
|
72
|
+
circOut: () => import_framer_motion3.circOut,
|
73
|
+
clamp: () => import_framer_motion3.clamp,
|
74
|
+
color: () => import_framer_motion3.color,
|
75
|
+
complex: () => import_framer_motion3.complex,
|
76
|
+
createBox: () => import_framer_motion3.createBox,
|
77
|
+
createDomMotionComponent: () => import_framer_motion3.createDomMotionComponent,
|
78
|
+
createMotionComponent: () => import_framer_motion3.createMotionComponent,
|
79
|
+
createScopedAnimate: () => import_framer_motion3.createScopedAnimate,
|
80
|
+
cubicBezier: () => import_framer_motion3.cubicBezier,
|
81
|
+
delay: () => import_framer_motion3.delay,
|
82
|
+
disableInstantTransitions: () => import_framer_motion3.disableInstantTransitions,
|
83
|
+
distance: () => import_framer_motion3.distance,
|
84
|
+
distance2D: () => import_framer_motion3.distance2D,
|
85
|
+
domAnimation: () => import_framer_motion3.domAnimation,
|
86
|
+
domMax: () => import_framer_motion3.domMax,
|
87
|
+
easeIn: () => import_framer_motion3.easeIn,
|
88
|
+
easeInOut: () => import_framer_motion3.easeInOut,
|
89
|
+
easeOut: () => import_framer_motion3.easeOut,
|
90
|
+
filterProps: () => import_framer_motion3.filterProps,
|
91
|
+
frame: () => import_framer_motion3.frame,
|
92
|
+
frameData: () => import_framer_motion3.frameData,
|
93
|
+
inView: () => import_framer_motion3.inView,
|
94
|
+
interpolate: () => import_framer_motion3.interpolate,
|
95
|
+
invariant: () => import_framer_motion3.invariant,
|
96
|
+
isBrowser: () => import_framer_motion3.isBrowser,
|
97
|
+
isDragActive: () => import_framer_motion3.isDragActive,
|
98
|
+
isMotionComponent: () => import_framer_motion3.isMotionComponent,
|
99
|
+
isMotionValue: () => import_framer_motion3.isMotionValue,
|
100
|
+
isValidMotionProp: () => import_framer_motion3.isValidMotionProp,
|
101
|
+
m: () => import_framer_motion3.m,
|
102
|
+
makeUseVisualState: () => import_framer_motion3.makeUseVisualState,
|
103
|
+
mirrorEasing: () => import_framer_motion3.mirrorEasing,
|
104
|
+
mix: () => import_framer_motion3.mix,
|
105
|
+
motion: () => motion2,
|
106
106
|
motionForwardRef: () => motionForwardRef,
|
107
|
-
motionValue: () =>
|
108
|
-
optimizedAppearDataAttribute: () =>
|
109
|
-
pipe: () =>
|
110
|
-
progress: () =>
|
111
|
-
px: () =>
|
112
|
-
resolveMotionValue: () =>
|
113
|
-
reverseEasing: () =>
|
114
|
-
scroll: () =>
|
115
|
-
scrollInfo: () =>
|
116
|
-
spring: () =>
|
117
|
-
stagger: () =>
|
118
|
-
startOptimizedAppearAnimation: () =>
|
119
|
-
steps: () =>
|
120
|
-
sync: () =>
|
121
|
-
transform: () =>
|
107
|
+
motionValue: () => import_framer_motion3.motionValue,
|
108
|
+
optimizedAppearDataAttribute: () => import_framer_motion3.optimizedAppearDataAttribute,
|
109
|
+
pipe: () => import_framer_motion3.pipe,
|
110
|
+
progress: () => import_framer_motion3.progress,
|
111
|
+
px: () => import_framer_motion3.px,
|
112
|
+
resolveMotionValue: () => import_framer_motion3.resolveMotionValue,
|
113
|
+
reverseEasing: () => import_framer_motion3.reverseEasing,
|
114
|
+
scroll: () => import_framer_motion3.scroll,
|
115
|
+
scrollInfo: () => import_framer_motion3.scrollInfo,
|
116
|
+
spring: () => import_framer_motion3.spring,
|
117
|
+
stagger: () => import_framer_motion3.stagger,
|
118
|
+
startOptimizedAppearAnimation: () => import_framer_motion3.startOptimizedAppearAnimation,
|
119
|
+
steps: () => import_framer_motion3.steps,
|
120
|
+
sync: () => import_framer_motion3.sync,
|
121
|
+
transform: () => import_framer_motion3.transform,
|
122
122
|
transitionEnter: () => transitionEnter,
|
123
123
|
transitionExit: () => transitionExit,
|
124
|
-
unwrapMotionComponent: () =>
|
125
|
-
useAnimate: () =>
|
126
|
-
useAnimationControls: () =>
|
127
|
-
useAnimationFrame: () =>
|
128
|
-
useCycle: () =>
|
129
|
-
useDeprecatedAnimatedState: () =>
|
130
|
-
useDeprecatedInvertedScale: () =>
|
131
|
-
useDomEvent: () =>
|
132
|
-
useDragControls: () =>
|
133
|
-
useElementScroll: () =>
|
134
|
-
useForceUpdate: () =>
|
135
|
-
useInView: () =>
|
136
|
-
useInstantLayoutTransition: () =>
|
137
|
-
useInstantTransition: () =>
|
138
|
-
useIsPresent: () =>
|
139
|
-
useIsomorphicLayoutEffect: () =>
|
140
|
-
useMotionAnimation: () =>
|
141
|
-
useMotionTemplate: () =>
|
142
|
-
useMotionValue: () =>
|
143
|
-
useMotionValueEvent: () =>
|
144
|
-
usePresence: () =>
|
145
|
-
useReducedMotion: () =>
|
146
|
-
useReducedMotionConfig: () =>
|
147
|
-
useResetProjection: () =>
|
148
|
-
useScroll: () =>
|
149
|
-
useSpring: () =>
|
150
|
-
useTime: () =>
|
151
|
-
useTransform: () =>
|
152
|
-
useVelocity: () =>
|
153
|
-
useViewportScroll: () =>
|
154
|
-
useWillChange: () =>
|
155
|
-
visualElementStore: () =>
|
156
|
-
warning: () =>
|
157
|
-
wrap: () =>
|
124
|
+
unwrapMotionComponent: () => import_framer_motion3.unwrapMotionComponent,
|
125
|
+
useAnimate: () => import_framer_motion3.useAnimate,
|
126
|
+
useAnimationControls: () => import_framer_motion3.useAnimationControls,
|
127
|
+
useAnimationFrame: () => import_framer_motion3.useAnimationFrame,
|
128
|
+
useCycle: () => import_framer_motion3.useCycle,
|
129
|
+
useDeprecatedAnimatedState: () => import_framer_motion3.useDeprecatedAnimatedState,
|
130
|
+
useDeprecatedInvertedScale: () => import_framer_motion3.useDeprecatedInvertedScale,
|
131
|
+
useDomEvent: () => import_framer_motion3.useDomEvent,
|
132
|
+
useDragControls: () => import_framer_motion3.useDragControls,
|
133
|
+
useElementScroll: () => import_framer_motion3.useElementScroll,
|
134
|
+
useForceUpdate: () => import_framer_motion3.useForceUpdate,
|
135
|
+
useInView: () => import_framer_motion3.useInView,
|
136
|
+
useInstantLayoutTransition: () => import_framer_motion3.useInstantLayoutTransition,
|
137
|
+
useInstantTransition: () => import_framer_motion3.useInstantTransition,
|
138
|
+
useIsPresent: () => import_framer_motion3.useIsPresent,
|
139
|
+
useIsomorphicLayoutEffect: () => import_framer_motion3.useIsomorphicLayoutEffect,
|
140
|
+
useMotionAnimation: () => import_framer_motion3.useAnimation,
|
141
|
+
useMotionTemplate: () => import_framer_motion3.useMotionTemplate,
|
142
|
+
useMotionValue: () => import_framer_motion3.useMotionValue,
|
143
|
+
useMotionValueEvent: () => import_framer_motion3.useMotionValueEvent,
|
144
|
+
usePresence: () => import_framer_motion3.usePresence,
|
145
|
+
useReducedMotion: () => import_framer_motion3.useReducedMotion,
|
146
|
+
useReducedMotionConfig: () => import_framer_motion3.useReducedMotionConfig,
|
147
|
+
useResetProjection: () => import_framer_motion3.useResetProjection,
|
148
|
+
useScroll: () => import_framer_motion3.useScroll,
|
149
|
+
useSpring: () => import_framer_motion3.useSpring,
|
150
|
+
useTime: () => import_framer_motion3.useTime,
|
151
|
+
useTransform: () => import_framer_motion3.useTransform,
|
152
|
+
useVelocity: () => import_framer_motion3.useVelocity,
|
153
|
+
useViewportScroll: () => import_framer_motion3.useViewportScroll,
|
154
|
+
useWillChange: () => import_framer_motion3.useWillChange,
|
155
|
+
visualElementStore: () => import_framer_motion3.visualElementStore,
|
156
|
+
warning: () => import_framer_motion3.warning,
|
157
|
+
wrap: () => import_framer_motion3.wrap
|
158
158
|
});
|
159
159
|
module.exports = __toCommonJS(src_exports);
|
160
|
-
var
|
160
|
+
var import_framer_motion3 = require("framer-motion");
|
161
161
|
|
162
162
|
// src/motion-forward-ref.tsx
|
163
163
|
var React = __toESM(require("react"));
|
164
|
-
var motionForwardRef = (
|
165
|
-
return React.forwardRef(
|
164
|
+
var motionForwardRef = (render) => {
|
165
|
+
return React.forwardRef(
|
166
|
+
render
|
167
|
+
);
|
166
168
|
};
|
167
169
|
|
168
|
-
// src/
|
170
|
+
// src/motion.tsx
|
169
171
|
var import_core = require("@yamada-ui/core");
|
172
|
+
var import_utils = require("@yamada-ui/utils");
|
170
173
|
var import_framer_motion = require("framer-motion");
|
174
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
171
175
|
var disableStyleProps = ["transition"];
|
172
176
|
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
173
|
-
var
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
return cache.get(el);
|
177
|
+
var Component = (0, import_core.ui)("div", { disableStyleProp });
|
178
|
+
var Motion = motionForwardRef(
|
179
|
+
({ as = "div", className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
180
|
+
Component,
|
181
|
+
{
|
182
|
+
ref,
|
183
|
+
as: import_framer_motion.motion[as],
|
184
|
+
className: (0, import_utils.cx)("ui-motion", className),
|
185
|
+
...rest
|
183
186
|
}
|
184
|
-
|
185
|
-
|
186
|
-
var motion = factory();
|
187
|
-
|
188
|
-
// src/motion.tsx
|
189
|
-
var Motion = motion("div");
|
187
|
+
)
|
188
|
+
);
|
190
189
|
|
191
190
|
// src/utils.ts
|
192
|
-
var
|
191
|
+
var import_utils2 = require("@yamada-ui/utils");
|
193
192
|
var MOTION_TRANSITION_EASINGS = {
|
194
193
|
ease: [0.25, 0.1, 0.25, 1],
|
195
194
|
easeIn: [0.4, 0, 1, 1],
|
@@ -254,14 +253,31 @@ var MOTION_TRANSITION_DEFAULTS = {
|
|
254
253
|
};
|
255
254
|
var transitionEnter = (transition) => (delay2, duration) => ({
|
256
255
|
...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.enter,
|
257
|
-
...duration ? { duration: (0,
|
258
|
-
delay: (0,
|
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
|
259
258
|
});
|
260
259
|
var transitionExit = (transition) => (delay2, duration) => ({
|
261
260
|
...transition != null ? transition : MOTION_TRANSITION_DEFAULTS.exit,
|
262
|
-
...duration ? { duration: (0,
|
263
|
-
delay: (0,
|
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
|
264
263
|
});
|
264
|
+
|
265
|
+
// src/factory.ts
|
266
|
+
var import_core2 = require("@yamada-ui/core");
|
267
|
+
var import_framer_motion2 = require("framer-motion");
|
268
|
+
var factory = () => {
|
269
|
+
const cache = /* @__PURE__ */ new Map();
|
270
|
+
return new Proxy(import_core2.styled, {
|
271
|
+
apply: (_target, _thisArg, [el, options]) => {
|
272
|
+
return (0, import_framer_motion2.motion)((0, import_core2.styled)(el, options));
|
273
|
+
},
|
274
|
+
get: (_target, el) => {
|
275
|
+
if (!cache.has(el)) cache.set(el, (0, import_framer_motion2.motion)((0, import_core2.styled)(el)));
|
276
|
+
return cache.get(el);
|
277
|
+
}
|
278
|
+
});
|
279
|
+
};
|
280
|
+
var motion2 = factory();
|
265
281
|
// Annotate the CommonJS export names for ESM import in node:
|
266
282
|
0 && (module.exports = {
|
267
283
|
AcceleratedAnimation,
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/motion-forward-ref.tsx","../src/factory.ts","../src/motion.tsx","../src/utils.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 component: React.ForwardRefRenderFunction<\n any,\n Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & {\n as?: MotionAs\n }\n >,\n) => {\n return React.forwardRef(component) as unknown as MotionComponent<M, Y>\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 disableStyleProps = [\"transition\"]\n\nconst disableStyleProp = (prop: string) => disableStyleProps.includes(prop)\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 styled(_motion(el), { disableStyleProp, ...options })\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el))\n cache.set(el, styled(_motion(el), { disableStyleProp }))\n\n return cache.get(el)\n },\n }) as MotionFactory & MotionComponents\n}\n\n/**\n *\n */\nexport const motion = factory()\n","import { motion } from \"./factory\"\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 = motion(\"div\")\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"],"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;AAA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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,CACEC,QACA,cACgB;AAAA,EAChB,GAAI,kCAAc,2BAA2B;AAAA,EAC7C,GAAI,WACA,EAAE,cAAU,uBAAS,QAAQ,IAAI,WAAW,qCAAU,MAAM,IAC5D,CAAC;AAAA,EACL,WAAO,uBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAC1C;AAEK,IAAM,iBACX,CAAC,eACD,CACEA,QACA,cACgB;AAAA,EAChB,GAAI,kCAAc,2BAA2B;AAAA,EAC7C,GAAI,WACA,EAAE,cAAU,uBAAS,QAAQ,IAAI,WAAW,qCAAU,KAAK,IAC3D,CAAC;AAAA,EACL,WAAO,uBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAC1C;","names":["import_framer_motion","_motion","delay"]}
|
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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAC,wBAqHO;;;ACnHP,YAAuB;AAGhB,IAAM,mBAAmB,CAC9B,WAIG;AACH,SAAa;AAAA,IACX;AAAA,EACF;AACF;;;ACdA,kBAAmB;AACnB,mBAAmB;AACnB,2BAAuB;AAiBnB;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,gBAAY,gBAAuB,OAAO,EAA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AAW,qCAAU,KAAK,IAC3D,CAAC;AAAA,EACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAC1C;;;AC7FF,IAAAC,eAA2C;AAC3C,IAAAC,wBAAkC;AAIlC,IAAM,UAAU,MAAM;AACpB,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"]}
|
package/dist/index.mjs
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
|
-
|
4
|
-
} from "./chunk-
|
3
|
+
motion
|
4
|
+
} from "./chunk-2OYU7I6R.mjs";
|
5
5
|
import {
|
6
6
|
Motion
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-IYC7RHQQ.mjs";
|
8
8
|
import {
|
9
|
-
|
10
|
-
} from "./chunk-
|
9
|
+
motionForwardRef
|
10
|
+
} from "./chunk-CJBAGLAE.mjs";
|
11
11
|
import "./chunk-R3D52RAW.mjs";
|
12
12
|
import {
|
13
13
|
MOTION_TRANSITION_DEFAULTS,
|
@@ -4,7 +4,7 @@ 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>(
|
7
|
+
declare const motionForwardRef: <Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any, Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & {
|
8
8
|
as?: MotionAs;
|
9
9
|
}>) => MotionComponent<M, Y>;
|
10
10
|
|
@@ -4,7 +4,7 @@ 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>(
|
7
|
+
declare const motionForwardRef: <Y extends object, M extends MotionAs>(render: React.ForwardRefRenderFunction<any, Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & {
|
8
8
|
as?: MotionAs;
|
9
9
|
}>) => MotionComponent<M, Y>;
|
10
10
|
|
@@ -35,8 +35,10 @@ __export(motion_forward_ref_exports, {
|
|
35
35
|
});
|
36
36
|
module.exports = __toCommonJS(motion_forward_ref_exports);
|
37
37
|
var React = __toESM(require("react"));
|
38
|
-
var motionForwardRef = (
|
39
|
-
return React.forwardRef(
|
38
|
+
var motionForwardRef = (render) => {
|
39
|
+
return React.forwardRef(
|
40
|
+
render
|
41
|
+
);
|
40
42
|
};
|
41
43
|
// Annotate the CommonJS export names for ESM import in node:
|
42
44
|
0 && (module.exports = {
|
@@ -1 +1 @@
|
|
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
|
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":[]}
|
package/dist/motion.d.mts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { MotionComponent, MotionProps } from './motion.types.mjs';
|
2
2
|
import '@yamada-ui/core';
|
3
3
|
import '@yamada-ui/utils';
|
4
4
|
import 'framer-motion';
|
@@ -9,6 +9,6 @@ import 'react';
|
|
9
9
|
*
|
10
10
|
* @see Docs https://yamada-ui.com/components/other/motion
|
11
11
|
*/
|
12
|
-
declare const Motion:
|
12
|
+
declare const Motion: MotionComponent<"div", MotionProps>;
|
13
13
|
|
14
14
|
export { Motion };
|
package/dist/motion.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { MotionComponent, MotionProps } from './motion.types.js';
|
2
2
|
import '@yamada-ui/core';
|
3
3
|
import '@yamada-ui/utils';
|
4
4
|
import 'framer-motion';
|
@@ -9,6 +9,6 @@ import 'react';
|
|
9
9
|
*
|
10
10
|
* @see Docs https://yamada-ui.com/components/other/motion
|
11
11
|
*/
|
12
|
-
declare const Motion:
|
12
|
+
declare const Motion: MotionComponent<"div", MotionProps>;
|
13
13
|
|
14
14
|
export { Motion };
|
package/dist/motion.js
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
"use strict";
|
3
|
+
var __create = Object.create;
|
3
4
|
var __defProp = Object.defineProperty;
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
9
|
var __export = (target, all) => {
|
8
10
|
for (var name in all)
|
@@ -16,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
18
|
}
|
17
19
|
return to;
|
18
20
|
};
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
27
|
+
mod
|
28
|
+
));
|
19
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
30
|
|
21
31
|
// src/motion.tsx
|
@@ -24,29 +34,34 @@ __export(motion_exports, {
|
|
24
34
|
Motion: () => Motion
|
25
35
|
});
|
26
36
|
module.exports = __toCommonJS(motion_exports);
|
27
|
-
|
28
|
-
// src/factory.ts
|
29
37
|
var import_core = require("@yamada-ui/core");
|
38
|
+
var import_utils = require("@yamada-ui/utils");
|
30
39
|
var import_framer_motion = require("framer-motion");
|
31
|
-
|
32
|
-
|
33
|
-
var
|
34
|
-
|
35
|
-
return
|
36
|
-
|
37
|
-
|
38
|
-
},
|
39
|
-
get: (_target, el) => {
|
40
|
-
if (!cache.has(el))
|
41
|
-
cache.set(el, (0, import_core.styled)((0, import_framer_motion.motion)(el), { disableStyleProp }));
|
42
|
-
return cache.get(el);
|
43
|
-
}
|
44
|
-
});
|
40
|
+
|
41
|
+
// src/motion-forward-ref.tsx
|
42
|
+
var React = __toESM(require("react"));
|
43
|
+
var motionForwardRef = (render) => {
|
44
|
+
return React.forwardRef(
|
45
|
+
render
|
46
|
+
);
|
45
47
|
};
|
46
|
-
var motion = factory();
|
47
48
|
|
48
49
|
// src/motion.tsx
|
49
|
-
var
|
50
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
51
|
+
var disableStyleProps = ["transition"];
|
52
|
+
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
53
|
+
var Component = (0, import_core.ui)("div", { disableStyleProp });
|
54
|
+
var Motion = motionForwardRef(
|
55
|
+
({ as = "div", className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
56
|
+
Component,
|
57
|
+
{
|
58
|
+
ref,
|
59
|
+
as: import_framer_motion.motion[as],
|
60
|
+
className: (0, import_utils.cx)("ui-motion", className),
|
61
|
+
...rest
|
62
|
+
}
|
63
|
+
)
|
64
|
+
);
|
50
65
|
// Annotate the CommonJS export names for ESM import in node:
|
51
66
|
0 && (module.exports = {
|
52
67
|
Motion
|
package/dist/motion.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/motion.tsx","../src/
|
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":[]}
|
package/dist/motion.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@yamada-ui/motion",
|
3
|
-
"version": "2.2.1-dev-
|
3
|
+
"version": "2.2.1-dev-20240907122824",
|
4
4
|
"description": "Yamada UI motion components",
|
5
5
|
"keywords": [
|
6
6
|
"yamada",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
39
|
"framer-motion": "11.3.24",
|
40
|
-
"@yamada-ui/core": "1.13.1-dev-
|
40
|
+
"@yamada-ui/core": "1.13.1-dev-20240907122824",
|
41
41
|
"@yamada-ui/utils": "1.4.0"
|
42
42
|
},
|
43
43
|
"devDependencies": {
|
@@ -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 disableStyleProps = [\"transition\"]\n\nconst disableStyleProp = (prop: string) => disableStyleProps.includes(prop)\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 styled(_motion(el), { disableStyleProp, ...options })\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el))\n cache.set(el, styled(_motion(el), { disableStyleProp }))\n\n return cache.get(el)\n },\n }) as MotionFactory & MotionComponents\n}\n\n/**\n *\n */\nexport const motion = factory()\n"],"mappings":";;;AAAA,SAAS,cAAkC;AAC3C,SAAS,UAAU,eAAe;AAIlC,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,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,OAAO,QAAQ,EAAE,GAAG,EAAE,kBAAkB,GAAG,QAAQ,CAAC;AAAA,IAC7D;AAAA,IAEA,KAAK,CAAC,SAAS,OAAiB;AAC9B,UAAI,CAAC,MAAM,IAAI,EAAE;AACf,cAAM,IAAI,IAAI,OAAO,QAAQ,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC;AAEzD,aAAO,MAAM,IAAI,EAAE;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAKO,IAAM,SAAS,QAAQ;","names":[]}
|
package/dist/chunk-K3SPRYR3.mjs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import { motion } from \"./factory\"\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 = motion(\"div\")\n"],"mappings":";;;;;;AAOO,IAAM,SAAS,OAAO,KAAK;","names":[]}
|
package/dist/chunk-ZSIGLH6W.mjs
DELETED
@@ -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 component: React.ForwardRefRenderFunction<\n any,\n Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>> & {\n as?: MotionAs\n }\n >,\n) => {\n return React.forwardRef(component) as unknown as MotionComponent<M, Y>\n}\n"],"mappings":";;;AAEA,YAAY,WAAW;AAGhB,IAAM,mBAAmB,CAC9B,cAMG;AACH,SAAa,iBAAW,SAAS;AACnC;","names":[]}
|