@yamada-ui/motion 0.3.2 → 0.3.4

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.
@@ -0,0 +1,6 @@
1
+ export { AnimatePresence, DragControls, HTMLMotionProps, LayoutGroup, LazyMotion, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptions as MotionAnimationOptions, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationProps as MotionAnimationProps, AnimationType as MotionAnimationType, MotionConfig, MotionConfigProps, LayoutProps as MotionLayoutProps, LazyProps as MotionLazyProps, Reorder as MotionReorder, MotionStyle, Transition as MotionTransition, MotionValue, Variants as MotionVariants, SVGMotionProps, m, motion, transform, useCycle, useDragControls, useInView, useIsPresent, useAnimation as useMotionAnimation, useAnimationControls as useMotionAnimationControls, useAnimationFrame as useMotionAnimationFrame, useMotionTemplate, useMotionValue, useMotionValueEvent, useReducedMotion, useScroll, useSpring, useTime, useTransform, useVelocity, useViewportScroll } from 'framer-motion';
2
+ export { Motion, MotionProps } from './motion.mjs';
3
+ export { MotionDelayProps, MotionDurationProps, MotionTransitionEndProps, MotionTransitionProperties, MotionTransitionProps, MotionTransitionVariants, WithTransitionProps } from './motion.types.mjs';
4
+ export { MOTION_TRANSITION_DEFAULTS, MOTION_TRANSITION_EASINGS, MOTION_TRANSITION_VARIANTS, transitionEnter, transitionExit } from './utils.mjs';
5
+ import '@yamada-ui/core';
6
+ import '@yamada-ui/utils';
@@ -0,0 +1,11 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { HTMLUIProps } from '@yamada-ui/core';
3
+ import { HTMLMotionProps, motion } from 'framer-motion';
4
+
5
+ type MotionOptions = {
6
+ as?: keyof typeof motion;
7
+ };
8
+ type MotionProps = Omit<HTMLUIProps<'div'>, 'as' | 'style' | 'onDrag' | 'onDragStart' | 'onDragEnd'> & HTMLMotionProps<'div'> & MotionOptions;
9
+ declare const Motion: _yamada_ui_core.Component<"div", MotionProps>;
10
+
11
+ export { Motion, MotionProps };
@@ -0,0 +1,58 @@
1
+ import { Dict } from '@yamada-ui/utils';
2
+ import { Transition, Target, TargetAndTransition } from 'framer-motion';
3
+ export { DragControls, HTMLMotionProps, AnimatePresenceProps as MotionAnimatePresenceProps, AnimationControls as MotionAnimationControls, AnimationLifecycles as MotionAnimationLifecycles, AnimationOptions as MotionAnimationOptions, AnimationPlaybackControls as MotionAnimationPlaybackControls, AnimationProps as MotionAnimationProps, AnimationType as MotionAnimationType, MotionConfigProps, LayoutProps as MotionLayoutProps, LazyProps as MotionLazyProps, MotionStyle, Transition as MotionTransition, MotionValue, Variants as MotionVariants, SVGMotionProps } from 'framer-motion';
4
+
5
+ type TargetResolver<Y = Dict> = (props: Y & MotionTransitionProperties) => TargetAndTransition;
6
+ type Variant<Y = Dict> = TargetAndTransition | TargetResolver<Y>;
7
+ type MotionTransitionVariants<Y = Dict> = {
8
+ enter: Variant<Y>;
9
+ exit: Variant<Y>;
10
+ initial?: Variant<Y>;
11
+ };
12
+ type MotionTransitionProperties = {
13
+ /**
14
+ * Custom `transition` definition for `enter` and `exit`.
15
+ */
16
+ transition?: MotionTransitionProps;
17
+ /**
18
+ * Custom `transitionEnd` definition for `enter` and `exit`.
19
+ */
20
+ transitionEnd?: MotionTransitionEndProps;
21
+ /**
22
+ * Custom `delay` definition for `enter` and `exit`.
23
+ */
24
+ delay?: number | MotionDelayProps;
25
+ /**
26
+ * Custom `duration` definition for `enter` and `exit`.
27
+ */
28
+ duration?: number | MotionDurationProps;
29
+ /**
30
+ * Custom `enter`.
31
+ */
32
+ enter?: any;
33
+ /**
34
+ * Custom `exit`.
35
+ */
36
+ exit?: any;
37
+ /**
38
+ * Custom `initial`.
39
+ */
40
+ initial?: any;
41
+ };
42
+ type WithMotionProps<Y> = Partial<Record<'enter' | 'exit', Y>>;
43
+ type MotionTransitionProps = WithMotionProps<Transition>;
44
+ type MotionTransitionEndProps = WithMotionProps<Target>;
45
+ type MotionDelayProps = WithMotionProps<number>;
46
+ type MotionDurationProps = WithMotionProps<number>;
47
+ type WithTransitionProps<Y extends object> = Omit<Y, 'transition'> & MotionTransitionProperties & {
48
+ /**
49
+ * If `true`, the element will unmount when `isOpen={false}` and animation is done.
50
+ */
51
+ unmountOnExit?: boolean;
52
+ /**
53
+ * Show the component. triggers when enter or exit states.
54
+ */
55
+ isOpen?: boolean;
56
+ };
57
+
58
+ export { MotionDelayProps, MotionDurationProps, MotionTransitionEndProps, MotionTransitionProperties, MotionTransitionProps, MotionTransitionVariants, WithTransitionProps };
@@ -0,0 +1,138 @@
1
+ import { Transition } from 'framer-motion';
2
+ import { MotionTransitionProperties } from './motion.types.mjs';
3
+ import '@yamada-ui/utils';
4
+
5
+ declare const MOTION_TRANSITION_EASINGS: {
6
+ readonly ease: readonly [0.25, 0.1, 0.25, 1];
7
+ readonly easeIn: readonly [0.4, 0, 1, 1];
8
+ readonly easeOut: readonly [0, 0, 0.2, 1];
9
+ readonly easeInOut: readonly [0.4, 0, 0.2, 1];
10
+ };
11
+ declare const MOTION_TRANSITION_VARIANTS: {
12
+ readonly scale: {
13
+ readonly enter: {
14
+ readonly scale: 1;
15
+ };
16
+ readonly exit: {
17
+ readonly scale: 0.95;
18
+ };
19
+ };
20
+ readonly fade: {
21
+ readonly enter: {
22
+ readonly opacity: 1;
23
+ };
24
+ readonly exit: {
25
+ readonly opacity: 0;
26
+ };
27
+ };
28
+ readonly pushLeft: {
29
+ readonly enter: {
30
+ readonly x: "100%";
31
+ };
32
+ readonly exit: {
33
+ readonly x: "-30%";
34
+ };
35
+ };
36
+ readonly pushRight: {
37
+ readonly enter: {
38
+ readonly x: "-100%";
39
+ };
40
+ readonly exit: {
41
+ readonly x: "30%";
42
+ };
43
+ };
44
+ readonly pushUp: {
45
+ readonly enter: {
46
+ readonly y: "100%";
47
+ };
48
+ readonly exit: {
49
+ readonly y: "-30%";
50
+ };
51
+ };
52
+ readonly pushDown: {
53
+ readonly enter: {
54
+ readonly y: "-100%";
55
+ };
56
+ readonly exit: {
57
+ readonly y: "30%";
58
+ };
59
+ };
60
+ readonly slideLeft: {
61
+ readonly position: {
62
+ readonly left: 0;
63
+ readonly top: 0;
64
+ readonly bottom: 0;
65
+ readonly width: "100%";
66
+ };
67
+ readonly enter: {
68
+ readonly x: 0;
69
+ readonly y: 0;
70
+ };
71
+ readonly exit: {
72
+ readonly x: "-100%";
73
+ readonly y: 0;
74
+ };
75
+ };
76
+ readonly slideRight: {
77
+ readonly position: {
78
+ readonly right: 0;
79
+ readonly top: 0;
80
+ readonly bottom: 0;
81
+ readonly width: "100%";
82
+ };
83
+ readonly enter: {
84
+ readonly x: 0;
85
+ readonly y: 0;
86
+ };
87
+ readonly exit: {
88
+ readonly x: "100%";
89
+ readonly y: 0;
90
+ };
91
+ };
92
+ readonly slideUp: {
93
+ readonly position: {
94
+ readonly top: 0;
95
+ readonly left: 0;
96
+ readonly right: 0;
97
+ readonly maxWidth: "100vw";
98
+ };
99
+ readonly enter: {
100
+ readonly x: 0;
101
+ readonly y: 0;
102
+ };
103
+ readonly exit: {
104
+ readonly x: 0;
105
+ readonly y: "-100%";
106
+ };
107
+ };
108
+ readonly slideDown: {
109
+ readonly position: {
110
+ readonly bottom: 0;
111
+ readonly left: 0;
112
+ readonly right: 0;
113
+ readonly maxWidth: "100vw";
114
+ };
115
+ readonly enter: {
116
+ readonly x: 0;
117
+ readonly y: 0;
118
+ };
119
+ readonly exit: {
120
+ readonly x: 0;
121
+ readonly y: "100%";
122
+ };
123
+ };
124
+ };
125
+ declare const MOTION_TRANSITION_DEFAULTS: {
126
+ readonly enter: {
127
+ readonly duration: 0.25;
128
+ readonly ease: readonly [0, 0, 0.2, 1];
129
+ };
130
+ readonly exit: {
131
+ readonly duration: 0.2;
132
+ readonly ease: readonly [0.4, 0, 1, 1];
133
+ };
134
+ };
135
+ declare const transitionEnter: (transition?: Transition) => (delay?: MotionTransitionProperties['delay'], duration?: MotionTransitionProperties['duration']) => Transition;
136
+ declare const transitionExit: (transition?: Transition) => (delay?: MotionTransitionProperties['delay'], duration?: MotionTransitionProperties['duration']) => Transition;
137
+
138
+ export { MOTION_TRANSITION_DEFAULTS, MOTION_TRANSITION_EASINGS, MOTION_TRANSITION_VARIANTS, transitionEnter, transitionExit };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/motion",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Yamada UI motion components",
5
5
  "keywords": [
6
6
  "yamada",
@@ -36,8 +36,8 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "framer-motion": "^9.1.7",
39
- "@yamada-ui/core": "0.4.3",
40
- "@yamada-ui/utils": "0.1.2"
39
+ "@yamada-ui/core": "0.5.1",
40
+ "@yamada-ui/utils": "0.1.3"
41
41
  },
42
42
  "devDependencies": {
43
43
  "react": "^18.0.0",