@yamada-ui/motion 2.3.0-dev-20241230232329 → 2.3.0-dev-20250106053503
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XGL4MMJG.mjs → chunk-B4RBFVQG.mjs} +14 -10
- package/dist/chunk-B4RBFVQG.mjs.map +1 -0
- package/dist/index.js +127 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/motion.js +13 -9
- package/dist/motion.js.map +1 -1
- package/dist/motion.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-XGL4MMJG.mjs.map +0 -1
@@ -7,20 +7,24 @@ import {
|
|
7
7
|
import { ui } from "@yamada-ui/core";
|
8
8
|
import { cx } from "@yamada-ui/utils";
|
9
9
|
import { motion } from "motion/react";
|
10
|
+
import { useMemo } from "react";
|
10
11
|
import { jsx } from "react/jsx-runtime";
|
11
12
|
var disableStyleProps = ["transition"];
|
12
13
|
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
13
14
|
var Component = ui("div", { disableStyleProp });
|
14
15
|
var Motion = motionForwardRef(
|
15
|
-
({ as = "div", className, ...rest }, ref) =>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
({ as: asProp = "div", className, ...rest }, ref) => {
|
17
|
+
const as = useMemo(() => motion.create(asProp), [asProp]);
|
18
|
+
return /* @__PURE__ */ jsx(
|
19
|
+
Component,
|
20
|
+
{
|
21
|
+
ref,
|
22
|
+
as,
|
23
|
+
className: cx("ui-motion", className),
|
24
|
+
...rest
|
25
|
+
}
|
26
|
+
);
|
27
|
+
}
|
24
28
|
);
|
25
29
|
Motion.displayName = "Motion";
|
26
30
|
Motion.__ui__ = "Motion";
|
@@ -28,4 +32,4 @@ Motion.__ui__ = "Motion";
|
|
28
32
|
export {
|
29
33
|
Motion
|
30
34
|
};
|
31
|
-
//# sourceMappingURL=chunk-
|
35
|
+
//# sourceMappingURL=chunk-B4RBFVQG.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/motion.tsx"],"sourcesContent":["import type { Dict } from \"@yamada-ui/utils\"\nimport type { MotionProps } from \"./motion.types\"\nimport { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"motion/react\"\nimport { useMemo } from \"react\"\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: asProp = \"div\", className, ...rest }, ref) => {\n const as = useMemo(() => motion.create(asProp), [asProp])\n\n return (\n <Component\n ref={ref}\n as={as}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n\nMotion.displayName = \"Motion\"\nMotion.__ui__ = \"Motion\"\n"],"mappings":";;;;;;AAEA,SAAS,UAAU;AACnB,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,eAAe;AAmBlB;AAhBN,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,IAAI,SAAS,OAAO,WAAW,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,KAAK,QAAQ,MAAM,OAAO,OAAO,MAAM,GAAG,CAAC,MAAM,CAAC;AAExD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,WAAW,GAAG,aAAa,SAAS;AAAA,QACnC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AACrB,OAAO,SAAS;","names":[]}
|
package/dist/index.js
CHANGED
@@ -31,127 +31,127 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
31
31
|
// src/index.ts
|
32
32
|
var index_exports = {};
|
33
33
|
__export(index_exports, {
|
34
|
-
AcceleratedAnimation: () =>
|
35
|
-
AnimatePresence: () =>
|
36
|
-
AnimateSharedLayout: () =>
|
37
|
-
DeprecatedLayoutGroupContext: () =>
|
38
|
-
DragControls: () =>
|
39
|
-
FlatTree: () =>
|
40
|
-
LayoutGroup: () =>
|
41
|
-
LayoutGroupContext: () =>
|
42
|
-
LazyMotion: () =>
|
34
|
+
AcceleratedAnimation: () => import_react4.AcceleratedAnimation,
|
35
|
+
AnimatePresence: () => import_react4.AnimatePresence,
|
36
|
+
AnimateSharedLayout: () => import_react4.AnimateSharedLayout,
|
37
|
+
DeprecatedLayoutGroupContext: () => import_react4.DeprecatedLayoutGroupContext,
|
38
|
+
DragControls: () => import_react4.DragControls,
|
39
|
+
FlatTree: () => import_react4.FlatTree,
|
40
|
+
LayoutGroup: () => import_react4.LayoutGroup,
|
41
|
+
LayoutGroupContext: () => import_react4.LayoutGroupContext,
|
42
|
+
LazyMotion: () => import_react4.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
|
-
createScopedAnimate: () =>
|
78
|
-
cubicBezier: () =>
|
79
|
-
delay: () =>
|
80
|
-
disableInstantTransitions: () =>
|
81
|
-
distance: () =>
|
82
|
-
distance2D: () =>
|
83
|
-
domAnimation: () =>
|
84
|
-
domMax: () =>
|
85
|
-
easeIn: () =>
|
86
|
-
easeInOut: () =>
|
87
|
-
easeOut: () =>
|
88
|
-
filterProps: () =>
|
89
|
-
frame: () =>
|
90
|
-
frameData: () =>
|
91
|
-
inView: () =>
|
92
|
-
interpolate: () =>
|
93
|
-
invariant: () =>
|
94
|
-
isBrowser: () =>
|
95
|
-
isDragActive: () =>
|
96
|
-
isMotionComponent: () =>
|
97
|
-
isMotionValue: () =>
|
98
|
-
isValidMotionProp: () =>
|
99
|
-
m: () =>
|
100
|
-
makeUseVisualState: () =>
|
101
|
-
mirrorEasing: () =>
|
102
|
-
mix: () =>
|
47
|
+
MotionConfig: () => import_react4.MotionConfig,
|
48
|
+
MotionConfigContext: () => import_react4.MotionConfigContext,
|
49
|
+
MotionContext: () => import_react4.MotionContext,
|
50
|
+
MotionGlobalConfig: () => import_react4.MotionGlobalConfig,
|
51
|
+
MotionReorder: () => import_react4.Reorder,
|
52
|
+
PresenceContext: () => import_react4.PresenceContext,
|
53
|
+
SwitchLayoutGroupContext: () => import_react4.SwitchLayoutGroupContext,
|
54
|
+
VisualElement: () => import_react4.VisualElement,
|
55
|
+
addPointerInfo: () => import_react4.addPointerInfo,
|
56
|
+
addScaleCorrector: () => import_react4.addScaleCorrector,
|
57
|
+
animate: () => import_react4.animate,
|
58
|
+
animateValue: () => import_react4.animateValue,
|
59
|
+
animateVisualElement: () => import_react4.animateVisualElement,
|
60
|
+
animationControls: () => import_react4.animationControls,
|
61
|
+
animations: () => import_react4.animations,
|
62
|
+
anticipate: () => import_react4.anticipate,
|
63
|
+
backIn: () => import_react4.backIn,
|
64
|
+
backInOut: () => import_react4.backInOut,
|
65
|
+
backOut: () => import_react4.backOut,
|
66
|
+
buildTransform: () => import_react4.buildTransform,
|
67
|
+
calcLength: () => import_react4.calcLength,
|
68
|
+
cancelFrame: () => import_react4.cancelFrame,
|
69
|
+
cancelSync: () => import_react4.cancelSync,
|
70
|
+
circIn: () => import_react4.circIn,
|
71
|
+
circInOut: () => import_react4.circInOut,
|
72
|
+
circOut: () => import_react4.circOut,
|
73
|
+
clamp: () => import_react4.clamp,
|
74
|
+
color: () => import_react4.color,
|
75
|
+
complex: () => import_react4.complex,
|
76
|
+
createBox: () => import_react4.createBox,
|
77
|
+
createScopedAnimate: () => import_react4.createScopedAnimate,
|
78
|
+
cubicBezier: () => import_react4.cubicBezier,
|
79
|
+
delay: () => import_react4.delay,
|
80
|
+
disableInstantTransitions: () => import_react4.disableInstantTransitions,
|
81
|
+
distance: () => import_react4.distance,
|
82
|
+
distance2D: () => import_react4.distance2D,
|
83
|
+
domAnimation: () => import_react4.domAnimation,
|
84
|
+
domMax: () => import_react4.domMax,
|
85
|
+
easeIn: () => import_react4.easeIn,
|
86
|
+
easeInOut: () => import_react4.easeInOut,
|
87
|
+
easeOut: () => import_react4.easeOut,
|
88
|
+
filterProps: () => import_react4.filterProps,
|
89
|
+
frame: () => import_react4.frame,
|
90
|
+
frameData: () => import_react4.frameData,
|
91
|
+
inView: () => import_react4.inView,
|
92
|
+
interpolate: () => import_react4.interpolate,
|
93
|
+
invariant: () => import_react4.invariant,
|
94
|
+
isBrowser: () => import_react4.isBrowser,
|
95
|
+
isDragActive: () => import_react4.isDragActive,
|
96
|
+
isMotionComponent: () => import_react4.isMotionComponent,
|
97
|
+
isMotionValue: () => import_react4.isMotionValue,
|
98
|
+
isValidMotionProp: () => import_react4.isValidMotionProp,
|
99
|
+
m: () => import_react4.m,
|
100
|
+
makeUseVisualState: () => import_react4.makeUseVisualState,
|
101
|
+
mirrorEasing: () => import_react4.mirrorEasing,
|
102
|
+
mix: () => import_react4.mix,
|
103
103
|
motion: () => motion,
|
104
104
|
motionForwardRef: () => motionForwardRef,
|
105
|
-
motionValue: () =>
|
106
|
-
optimizedAppearDataAttribute: () =>
|
107
|
-
pipe: () =>
|
108
|
-
progress: () =>
|
109
|
-
px: () =>
|
110
|
-
resolveMotionValue: () =>
|
111
|
-
reverseEasing: () =>
|
112
|
-
scroll: () =>
|
113
|
-
scrollInfo: () =>
|
114
|
-
spring: () =>
|
115
|
-
stagger: () =>
|
116
|
-
startOptimizedAppearAnimation: () =>
|
117
|
-
steps: () =>
|
118
|
-
sync: () =>
|
119
|
-
transform: () =>
|
105
|
+
motionValue: () => import_react4.motionValue,
|
106
|
+
optimizedAppearDataAttribute: () => import_react4.optimizedAppearDataAttribute,
|
107
|
+
pipe: () => import_react4.pipe,
|
108
|
+
progress: () => import_react4.progress,
|
109
|
+
px: () => import_react4.px,
|
110
|
+
resolveMotionValue: () => import_react4.resolveMotionValue,
|
111
|
+
reverseEasing: () => import_react4.reverseEasing,
|
112
|
+
scroll: () => import_react4.scroll,
|
113
|
+
scrollInfo: () => import_react4.scrollInfo,
|
114
|
+
spring: () => import_react4.spring,
|
115
|
+
stagger: () => import_react4.stagger,
|
116
|
+
startOptimizedAppearAnimation: () => import_react4.startOptimizedAppearAnimation,
|
117
|
+
steps: () => import_react4.steps,
|
118
|
+
sync: () => import_react4.sync,
|
119
|
+
transform: () => import_react4.transform,
|
120
120
|
transitionEnter: () => transitionEnter,
|
121
121
|
transitionExit: () => transitionExit,
|
122
|
-
unwrapMotionComponent: () =>
|
123
|
-
useAnimate: () =>
|
124
|
-
useAnimationControls: () =>
|
125
|
-
useAnimationFrame: () =>
|
126
|
-
useCycle: () =>
|
127
|
-
useDeprecatedAnimatedState: () =>
|
128
|
-
useDeprecatedInvertedScale: () =>
|
129
|
-
useDomEvent: () =>
|
130
|
-
useDragControls: () =>
|
131
|
-
useElementScroll: () =>
|
132
|
-
useForceUpdate: () =>
|
133
|
-
useInView: () =>
|
134
|
-
useInstantLayoutTransition: () =>
|
135
|
-
useInstantTransition: () =>
|
136
|
-
useIsPresent: () =>
|
137
|
-
useIsomorphicLayoutEffect: () =>
|
138
|
-
useMotionAnimation: () =>
|
139
|
-
useMotionTemplate: () =>
|
140
|
-
useMotionValue: () =>
|
141
|
-
useMotionValueEvent: () =>
|
142
|
-
usePresence: () =>
|
143
|
-
useReducedMotion: () =>
|
144
|
-
useReducedMotionConfig: () =>
|
145
|
-
useResetProjection: () =>
|
146
|
-
useScroll: () =>
|
147
|
-
useSpring: () =>
|
148
|
-
useTime: () =>
|
149
|
-
useTransform: () =>
|
150
|
-
useVelocity: () =>
|
151
|
-
useViewportScroll: () =>
|
152
|
-
useWillChange: () =>
|
153
|
-
visualElementStore: () =>
|
154
|
-
wrap: () =>
|
122
|
+
unwrapMotionComponent: () => import_react4.unwrapMotionComponent,
|
123
|
+
useAnimate: () => import_react4.useAnimate,
|
124
|
+
useAnimationControls: () => import_react4.useAnimationControls,
|
125
|
+
useAnimationFrame: () => import_react4.useAnimationFrame,
|
126
|
+
useCycle: () => import_react4.useCycle,
|
127
|
+
useDeprecatedAnimatedState: () => import_react4.useDeprecatedAnimatedState,
|
128
|
+
useDeprecatedInvertedScale: () => import_react4.useDeprecatedInvertedScale,
|
129
|
+
useDomEvent: () => import_react4.useDomEvent,
|
130
|
+
useDragControls: () => import_react4.useDragControls,
|
131
|
+
useElementScroll: () => import_react4.useElementScroll,
|
132
|
+
useForceUpdate: () => import_react4.useForceUpdate,
|
133
|
+
useInView: () => import_react4.useInView,
|
134
|
+
useInstantLayoutTransition: () => import_react4.useInstantLayoutTransition,
|
135
|
+
useInstantTransition: () => import_react4.useInstantTransition,
|
136
|
+
useIsPresent: () => import_react4.useIsPresent,
|
137
|
+
useIsomorphicLayoutEffect: () => import_react4.useIsomorphicLayoutEffect,
|
138
|
+
useMotionAnimation: () => import_react4.useAnimation,
|
139
|
+
useMotionTemplate: () => import_react4.useMotionTemplate,
|
140
|
+
useMotionValue: () => import_react4.useMotionValue,
|
141
|
+
useMotionValueEvent: () => import_react4.useMotionValueEvent,
|
142
|
+
usePresence: () => import_react4.usePresence,
|
143
|
+
useReducedMotion: () => import_react4.useReducedMotion,
|
144
|
+
useReducedMotionConfig: () => import_react4.useReducedMotionConfig,
|
145
|
+
useResetProjection: () => import_react4.useResetProjection,
|
146
|
+
useScroll: () => import_react4.useScroll,
|
147
|
+
useSpring: () => import_react4.useSpring,
|
148
|
+
useTime: () => import_react4.useTime,
|
149
|
+
useTransform: () => import_react4.useTransform,
|
150
|
+
useVelocity: () => import_react4.useVelocity,
|
151
|
+
useViewportScroll: () => import_react4.useViewportScroll,
|
152
|
+
useWillChange: () => import_react4.useWillChange,
|
153
|
+
visualElementStore: () => import_react4.visualElementStore,
|
154
|
+
wrap: () => import_react4.wrap
|
155
155
|
});
|
156
156
|
module.exports = __toCommonJS(index_exports);
|
157
157
|
|
@@ -188,20 +188,24 @@ function motionForwardRef(render) {
|
|
188
188
|
var import_core2 = require("@yamada-ui/core");
|
189
189
|
var import_utils = require("@yamada-ui/utils");
|
190
190
|
var import_react2 = require("motion/react");
|
191
|
+
var import_react3 = require("react");
|
191
192
|
var import_jsx_runtime = require("react/jsx-runtime");
|
192
193
|
var disableStyleProps = ["transition"];
|
193
194
|
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
194
195
|
var Component = (0, import_core2.ui)("div", { disableStyleProp });
|
195
196
|
var Motion = motionForwardRef(
|
196
|
-
({ as = "div", className, ...rest }, ref) =>
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
197
|
+
({ as: asProp = "div", className, ...rest }, ref) => {
|
198
|
+
const as = (0, import_react3.useMemo)(() => import_react2.motion.create(asProp), [asProp]);
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
200
|
+
Component,
|
201
|
+
{
|
202
|
+
ref,
|
203
|
+
as,
|
204
|
+
className: (0, import_utils.cx)("ui-motion", className),
|
205
|
+
...rest
|
206
|
+
}
|
207
|
+
);
|
208
|
+
}
|
205
209
|
);
|
206
210
|
Motion.displayName = "Motion";
|
207
211
|
Motion.__ui__ = "Motion";
|
@@ -290,7 +294,7 @@ function transitionExit(transition) {
|
|
290
294
|
}
|
291
295
|
|
292
296
|
// src/index.ts
|
293
|
-
var
|
297
|
+
var import_react4 = require("motion/react");
|
294
298
|
// Annotate the CommonJS export names for ESM import in node:
|
295
299
|
0 && (module.exports = {
|
296
300
|
AcceleratedAnimation,
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/factory.ts","../src/forward-ref.tsx","../src/motion.tsx","../src/utils.ts"],"sourcesContent":["export * from \"./factory\"\nexport * from \"./forward-ref\"\nexport { Motion } from \"./motion\"\nexport type * from \"./motion.types\"\nexport * from \"./utils\"\nexport {\n AcceleratedAnimation,\n addPointerInfo,\n addScaleCorrector,\n animate,\n AnimatePresence,\n AnimateSharedLayout,\n animateValue,\n animateVisualElement,\n animationControls,\n animations,\n anticipate,\n backIn,\n backInOut,\n backOut,\n buildTransform,\n calcLength,\n cancelFrame,\n cancelSync,\n circIn,\n circInOut,\n circOut,\n clamp,\n color,\n complex,\n createBox,\n 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 wrap,\n} from \"motion/react\"\n","import type { StyledOptions } from \"@yamada-ui/core\"\nimport type { ComponentType, ForwardRefExoticComponent } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\nimport { styled } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"motion/react\"\n\ninterface Factory extends MotionFactory, MotionComponents {}\n\nfunction factory() {\n const cache = new Map<MotionAs, ComponentType<any>>()\n\n return new Proxy(styled, {\n apply: (_target, _thisArg, [el, options]: [MotionAs, StyledOptions]) => {\n const component = styled(el, options) as ForwardRefExoticComponent<any>\n\n return _motion.create(component)\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el)) {\n const component = styled(el) as ForwardRefExoticComponent<any>\n\n cache.set(el, _motion.create(component))\n }\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 \"motion/react\"\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.create(as)}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n ),\n)\n\nMotion.displayName = \"Motion\"\nMotion.__ui__ = \"Motion\"\n","import type { Transition } from \"motion/react\"\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;AAAA;AAAA;AAAA;;;ACGA,kBAAuB;AACvB,mBAAkC;AAIlC,SAAS,UAAU;AACjB,QAAM,QAAQ,oBAAI,IAAkC;AAEpD,SAAO,IAAI,MAAM,oBAAQ;AAAA,IACvB,OAAO,CAAC,SAAS,UAAU,CAAC,IAAI,OAAO,MAAiC;AACtE,YAAM,gBAAY,oBAAO,IAAI,OAAO;AAEpC,aAAO,aAAAA,OAAQ,OAA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G,UAAU,SAAS,OAAO,GAAG,KAAK,EAAE;AAAA,EAC3D;AACF;AAEO,IAAM,6BAA6B;AAAA,EACxC,OAAO;AAAA,IACL,UAAU;AAAA,IACV,MAAM,0BAA0B;AAAA,EAClC;AAAA,EACA,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,MAAM,0BAA0B;AAAA,EAClC;AACF;AAEO,SAAS,gBAAgB,YAAyB;AACvD,SAAO,SACLC,QACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,SAAS,MAAM,IAC3D,CAAC;AAAA,MACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;AAEO,SAAS,eAAe,YAAyB;AACtD,SAAO,SACLA,QACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,SAAS,KAAK,IAC1D,CAAC;AAAA,MACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;;;AJ5FA,IAAAC,gBAkHO;","names":["_motion","import_core","import_react","import_utils","delay","import_react"]}
|
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 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 wrap,\n} from \"motion/react\"\n","import type { StyledOptions } from \"@yamada-ui/core\"\nimport type { ComponentType, ForwardRefExoticComponent } from \"react\"\nimport type { MotionAs, MotionComponents, MotionFactory } from \"./motion.types\"\nimport { styled } from \"@yamada-ui/core\"\nimport { motion as _motion } from \"motion/react\"\n\ninterface Factory extends MotionFactory, MotionComponents {}\n\nfunction factory() {\n const cache = new Map<MotionAs, ComponentType<any>>()\n\n return new Proxy(styled, {\n apply: (_target, _thisArg, [el, options]: [MotionAs, StyledOptions]) => {\n const component = styled(el, options) as ForwardRefExoticComponent<any>\n\n return _motion.create(component)\n },\n\n get: (_target, el: MotionAs) => {\n if (!cache.has(el)) {\n const component = styled(el) as ForwardRefExoticComponent<any>\n\n cache.set(el, _motion.create(component))\n }\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 \"motion/react\"\nimport { useMemo } from \"react\"\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: asProp = \"div\", className, ...rest }, ref) => {\n const as = useMemo(() => motion.create(asProp), [asProp])\n\n return (\n <Component\n ref={ref}\n as={as}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n\nMotion.displayName = \"Motion\"\nMotion.__ui__ = \"Motion\"\n","import type { Transition } from \"motion/react\"\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;AAAA;AAAA;AAAA;;;ACGA,kBAAuB;AACvB,mBAAkC;AAIlC,SAAS,UAAU;AACjB,QAAM,QAAQ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AAA,IACpB,MAAM,EAAE,GAAG,QAAQ,GAAG,EAAE;AAAA,IACxB,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,OAAO;AAAA,EACzD;AAAA,EACA,SAAS;AAAA,IACP,OAAO,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,IACpB,MAAM,EAAE,GAAG,GAAG,GAAG,QAAQ;AAAA,IACzB,UAAU,EAAE,MAAM,GAAG,UAAU,SAAS,OAAO,GAAG,KAAK,EAAE;AAAA,EAC3D;AACF;AAEO,IAAM,6BAA6B;AAAA,EACxC,OAAO;AAAA,IACL,UAAU;AAAA,IACV,MAAM,0BAA0B;AAAA,EAClC;AAAA,EACA,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,MAAM,0BAA0B;AAAA,EAClC;AACF;AAEO,SAAS,gBAAgB,YAAyB;AACvD,SAAO,SACLC,QACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,SAAS,MAAM,IAC3D,CAAC;AAAA,MACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;AAEO,SAAS,eAAe,YAAyB;AACtD,SAAO,SACLA,QACA,UACY;AACZ,WAAO;AAAA,MACL,GAAI,kCAAc,2BAA2B;AAAA,MAC7C,GAAI,WACA,EAAE,cAAU,wBAAS,QAAQ,IAAI,WAAW,SAAS,KAAK,IAC1D,CAAC;AAAA,MACL,WAAO,wBAASA,MAAK,IAAIA,SAAQA,UAAA,gBAAAA,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;;;AJ5FA,IAAAC,gBAkHO;","names":["_motion","import_core","import_react","import_utils","delay","import_react"]}
|
package/dist/index.mjs
CHANGED
package/dist/motion.js
CHANGED
@@ -37,6 +37,7 @@ module.exports = __toCommonJS(motion_exports);
|
|
37
37
|
var import_core = require("@yamada-ui/core");
|
38
38
|
var import_utils = require("@yamada-ui/utils");
|
39
39
|
var import_react = require("motion/react");
|
40
|
+
var import_react2 = require("react");
|
40
41
|
|
41
42
|
// src/forward-ref.tsx
|
42
43
|
var React = __toESM(require("react"));
|
@@ -52,15 +53,18 @@ var disableStyleProps = ["transition"];
|
|
52
53
|
var disableStyleProp = (prop) => disableStyleProps.includes(prop);
|
53
54
|
var Component = (0, import_core.ui)("div", { disableStyleProp });
|
54
55
|
var Motion = motionForwardRef(
|
55
|
-
({ as = "div", className, ...rest }, ref) =>
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
56
|
+
({ as: asProp = "div", className, ...rest }, ref) => {
|
57
|
+
const as = (0, import_react2.useMemo)(() => import_react.motion.create(asProp), [asProp]);
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
59
|
+
Component,
|
60
|
+
{
|
61
|
+
ref,
|
62
|
+
as,
|
63
|
+
className: (0, import_utils.cx)("ui-motion", className),
|
64
|
+
...rest
|
65
|
+
}
|
66
|
+
);
|
67
|
+
}
|
64
68
|
);
|
65
69
|
Motion.displayName = "Motion";
|
66
70
|
Motion.__ui__ = "Motion";
|
package/dist/motion.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/motion.tsx","../src/forward-ref.tsx"],"sourcesContent":["import type { Dict } from \"@yamada-ui/utils\"\nimport type { MotionProps } from \"./motion.types\"\nimport { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"motion/react\"\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
|
1
|
+
{"version":3,"sources":["../src/motion.tsx","../src/forward-ref.tsx"],"sourcesContent":["import type { Dict } from \"@yamada-ui/utils\"\nimport type { MotionProps } from \"./motion.types\"\nimport { ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { motion } from \"motion/react\"\nimport { useMemo } from \"react\"\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: asProp = \"div\", className, ...rest }, ref) => {\n const as = useMemo(() => motion.create(asProp), [asProp])\n\n return (\n <Component\n ref={ref}\n as={as}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n )\n },\n)\n\nMotion.displayName = \"Motion\"\nMotion.__ui__ = \"Motion\"\n","import type { WithoutAs } from \"@yamada-ui/core\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type { MotionAs, MotionComponent } from \"./motion.types\"\nimport * as React from \"react\"\n\nexport function motionForwardRef<Y extends object, M extends MotionAs>(\n render: React.ForwardRefRenderFunction<\n any,\n { as?: MotionAs } & Merge<React.ComponentPropsWithoutRef<M>, WithoutAs<Y>>\n >,\n) {\n return React.forwardRef(\n render as React.ForwardRefRenderFunction<any>,\n ) as unknown as MotionComponent<M, Y>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAmB;AACnB,mBAAmB;AACnB,mBAAuB;AACvB,IAAAA,gBAAwB;;;ACFxB,YAAuB;AAEhB,SAAS,iBACd,QAIA;AACA,SAAa;AAAA,IACX;AAAA,EACF;AACF;;;ADUM;AAhBN,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,gBAAY,gBAAgB,OAAO,EAAE,iBAAiB,CAAC;AAOtD,IAAM,SAAS;AAAA,EACpB,CAAC,EAAE,IAAI,SAAS,OAAO,WAAW,GAAG,KAAK,GAAG,QAAQ;AACnD,UAAM,SAAK,uBAAQ,MAAM,oBAAO,OAAO,MAAM,GAAG,CAAC,MAAM,CAAC;AAExD,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,eAAW,iBAAG,aAAa,SAAS;AAAA,QACnC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AACrB,OAAO,SAAS;","names":["import_react"]}
|
package/dist/motion.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@yamada-ui/motion",
|
3
|
-
"version": "2.3.0-dev-
|
3
|
+
"version": "2.3.0-dev-20250106053503",
|
4
4
|
"description": "Yamada UI motion components",
|
5
5
|
"keywords": [
|
6
6
|
"yamada",
|
@@ -36,9 +36,9 @@
|
|
36
36
|
"url": "https://github.com/yamada-ui/yamada-ui/issues"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"motion": "^11.
|
40
|
-
"@yamada-ui/core": "1.17.0-dev-
|
41
|
-
"@yamada-ui/utils": "1.7.0-dev-
|
39
|
+
"motion": "^11.15.0",
|
40
|
+
"@yamada-ui/core": "1.17.0-dev-20250106053503",
|
41
|
+
"@yamada-ui/utils": "1.7.0-dev-20250106053503"
|
42
42
|
},
|
43
43
|
"devDependencies": {
|
44
44
|
"clean-package": "2.2.0",
|
@@ -1 +0,0 @@
|
|
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 \"motion/react\"\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.create(as)}\n className={cx(\"ui-motion\", className)}\n {...rest}\n />\n ),\n)\n\nMotion.displayName = \"Motion\"\nMotion.__ui__ = \"Motion\"\n"],"mappings":";;;;;;AAEA,SAAS,UAAU;AACnB,SAAS,UAAU;AACnB,SAAS,cAAc;AAgBnB;AAbJ,IAAM,oBAAoB,CAAC,YAAY;AAEvC,IAAM,mBAAmB,CAAC,SAAiB,kBAAkB,SAAS,IAAI;AAE1E,IAAM,YAAY,GAAgB,OAAO,EAAE,iBAAiB,CAAC;AAOtD,IAAM,SAAS;AAAA,EACpB,CAAC,EAAE,KAAK,OAAO,WAAW,GAAG,KAAK,GAAG,QACnC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI,OAAO,OAAO,EAAE;AAAA,MACpB,WAAW,GAAG,aAAa,SAAS;AAAA,MACnC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,OAAO,cAAc;AACrB,OAAO,SAAS;","names":[]}
|