@any-tdf/react-motion 0.0.0-alpha.0
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/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/animate.d.ts +40 -0
- package/dist/animate.js +105 -0
- package/dist/easing.d.ts +66 -0
- package/dist/easing.js +106 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/internal.d.ts +26 -0
- package/dist/internal.js +226 -0
- package/dist/interpolate.d.ts +1 -0
- package/dist/interpolate.js +40 -0
- package/dist/motion.d.ts +90 -0
- package/dist/motion.js +452 -0
- package/dist/react.d.ts +33 -0
- package/dist/react.js +132 -0
- package/dist/transition.d.ts +80 -0
- package/dist/transition.js +164 -0
- package/package.json +73 -0
package/dist/react.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
import { runAnimationConfig } from './internal';
|
|
3
|
+
import { transitionMap } from './transition';
|
|
4
|
+
const resolveTransition = (transition, node, params, direction) => {
|
|
5
|
+
if (!transition)
|
|
6
|
+
return null;
|
|
7
|
+
if (typeof transition === 'string') {
|
|
8
|
+
const fn = transitionMap[transition];
|
|
9
|
+
if (!fn)
|
|
10
|
+
return null;
|
|
11
|
+
return fn(node, params, { direction });
|
|
12
|
+
}
|
|
13
|
+
return transition(node, params, { direction });
|
|
14
|
+
};
|
|
15
|
+
export const useTransition = (visible, options = {}) => {
|
|
16
|
+
const nodeRef = useRef(null);
|
|
17
|
+
const controllerRef = useRef(null);
|
|
18
|
+
const hasMountedRef = useRef(false);
|
|
19
|
+
const [shouldRender, setShouldRender] = useState(visible);
|
|
20
|
+
const [status, setStatus] = useState(visible ? 'entered' : 'exited');
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (visible)
|
|
23
|
+
setShouldRender(true);
|
|
24
|
+
}, [visible]);
|
|
25
|
+
useLayoutEffect(() => {
|
|
26
|
+
const node = nodeRef.current;
|
|
27
|
+
if (!node || (!visible && !shouldRender))
|
|
28
|
+
return;
|
|
29
|
+
const initialMount = !hasMountedRef.current;
|
|
30
|
+
hasMountedRef.current = true;
|
|
31
|
+
const selectedMode = options.mode ?? (options.inTransition || options.outTransition ? 'separate' : 'bidirectional');
|
|
32
|
+
const direction = visible ? 'in' : 'out';
|
|
33
|
+
const transition = visible ? options.inTransition ?? options.transition : options.outTransition ?? options.transition;
|
|
34
|
+
const params = visible ? options.inParams ?? options.params : options.outParams ?? options.params;
|
|
35
|
+
const currentController = controllerRef.current;
|
|
36
|
+
const currentT = currentController?.t();
|
|
37
|
+
currentController?.cancel();
|
|
38
|
+
controllerRef.current = null;
|
|
39
|
+
const config = resolveTransition(transition, node, params, selectedMode === 'bidirectional' ? 'both' : direction);
|
|
40
|
+
if (!config) {
|
|
41
|
+
controllerRef.current = null;
|
|
42
|
+
if (visible) {
|
|
43
|
+
setStatus('entered');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
setStatus('exited');
|
|
47
|
+
setShouldRender(false);
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const targetT = visible ? 1 : 0;
|
|
52
|
+
const fromT = selectedMode === 'bidirectional' && currentT !== undefined ? currentT : visible ? 0 : 1;
|
|
53
|
+
if (initialMount && visible && options.intro === false) {
|
|
54
|
+
runAnimationConfig(node, config, 1, { fromT: 1, direction: selectedMode === 'bidirectional' ? 'both' : direction }).cancel();
|
|
55
|
+
setStatus('entered');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const controller = runAnimationConfig(node, config, targetT, {
|
|
59
|
+
fromT,
|
|
60
|
+
direction: selectedMode === 'bidirectional' ? 'both' : direction,
|
|
61
|
+
onStart: () => {
|
|
62
|
+
if (visible) {
|
|
63
|
+
setStatus('entering');
|
|
64
|
+
options.onIntroStart?.();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
setStatus('exiting');
|
|
68
|
+
options.onOutroStart?.();
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
onEnd: () => {
|
|
72
|
+
if (visible) {
|
|
73
|
+
setStatus('entered');
|
|
74
|
+
options.onIntroEnd?.();
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
setStatus('exited');
|
|
78
|
+
setShouldRender(false);
|
|
79
|
+
options.onOutroEnd?.();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
controllerRef.current = controller;
|
|
84
|
+
return () => {
|
|
85
|
+
controller.deactivate();
|
|
86
|
+
};
|
|
87
|
+
}, [
|
|
88
|
+
visible,
|
|
89
|
+
shouldRender,
|
|
90
|
+
options.transition,
|
|
91
|
+
options.params,
|
|
92
|
+
options.inTransition,
|
|
93
|
+
options.outTransition,
|
|
94
|
+
options.inParams,
|
|
95
|
+
options.outParams,
|
|
96
|
+
options.mode,
|
|
97
|
+
options.intro,
|
|
98
|
+
options.onIntroStart,
|
|
99
|
+
options.onIntroEnd,
|
|
100
|
+
options.onOutroStart,
|
|
101
|
+
options.onOutroEnd
|
|
102
|
+
]);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
return () => {
|
|
105
|
+
controllerRef.current?.cancel();
|
|
106
|
+
controllerRef.current = null;
|
|
107
|
+
};
|
|
108
|
+
}, []);
|
|
109
|
+
return { ref: nodeRef, shouldRender, status };
|
|
110
|
+
};
|
|
111
|
+
export const Transition = ({ visible, as = 'div', children, transition = 'fade', params, inTransition, outTransition, inParams, outParams, mode, intro, onIntroStart, onIntroEnd, onOutroStart, onOutroEnd, ...rest }) => {
|
|
112
|
+
const { ref, shouldRender } = useTransition(visible, {
|
|
113
|
+
transition,
|
|
114
|
+
params,
|
|
115
|
+
inTransition,
|
|
116
|
+
outTransition,
|
|
117
|
+
inParams,
|
|
118
|
+
outParams,
|
|
119
|
+
mode,
|
|
120
|
+
intro,
|
|
121
|
+
onIntroStart,
|
|
122
|
+
onIntroEnd,
|
|
123
|
+
onOutroStart,
|
|
124
|
+
onOutroEnd
|
|
125
|
+
});
|
|
126
|
+
if (!shouldRender)
|
|
127
|
+
return null;
|
|
128
|
+
return React.createElement(as, {
|
|
129
|
+
...rest,
|
|
130
|
+
ref
|
|
131
|
+
}, children);
|
|
132
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type EasingFunction } from './easing';
|
|
2
|
+
import { runAnimationConfig, type AnimationConfig } from './internal';
|
|
3
|
+
export { runAnimationConfig };
|
|
4
|
+
export type { AnimationConfig as TransitionConfig, AnimationController, MaybeDeferredAnimationConfig } from './internal';
|
|
5
|
+
export type { EasingFunction };
|
|
6
|
+
export interface BlurParams {
|
|
7
|
+
delay?: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
easing?: EasingFunction;
|
|
10
|
+
amount?: number | string;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FadeParams {
|
|
14
|
+
delay?: number;
|
|
15
|
+
duration?: number;
|
|
16
|
+
easing?: EasingFunction;
|
|
17
|
+
}
|
|
18
|
+
export interface FlyParams {
|
|
19
|
+
delay?: number;
|
|
20
|
+
duration?: number;
|
|
21
|
+
easing?: EasingFunction;
|
|
22
|
+
x?: number | string;
|
|
23
|
+
y?: number | string;
|
|
24
|
+
opacity?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface SlideParams {
|
|
27
|
+
delay?: number;
|
|
28
|
+
duration?: number;
|
|
29
|
+
easing?: EasingFunction;
|
|
30
|
+
axis?: 'x' | 'y';
|
|
31
|
+
}
|
|
32
|
+
export interface ScaleParams {
|
|
33
|
+
delay?: number;
|
|
34
|
+
duration?: number;
|
|
35
|
+
easing?: EasingFunction;
|
|
36
|
+
start?: number;
|
|
37
|
+
opacity?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface DrawParams {
|
|
40
|
+
delay?: number;
|
|
41
|
+
speed?: number;
|
|
42
|
+
duration?: number | ((len: number) => number);
|
|
43
|
+
easing?: EasingFunction;
|
|
44
|
+
}
|
|
45
|
+
export interface CrossfadeParams {
|
|
46
|
+
delay?: number;
|
|
47
|
+
duration?: number | ((len: number) => number);
|
|
48
|
+
easing?: EasingFunction;
|
|
49
|
+
}
|
|
50
|
+
export type TransitionName = 'fade' | 'fly' | 'slide' | 'scale' | 'blur' | 'draw';
|
|
51
|
+
export type TransitionFunction<P = unknown> = (node: Element, params?: P, options?: {
|
|
52
|
+
direction: 'in' | 'out' | 'both';
|
|
53
|
+
}) => AnimationConfig | ((options?: {
|
|
54
|
+
direction: 'in' | 'out' | 'both';
|
|
55
|
+
}) => AnimationConfig);
|
|
56
|
+
export declare const blur: (node: Element, { delay, duration, easing, amount, opacity }?: BlurParams) => AnimationConfig;
|
|
57
|
+
export declare const fade: (node: Element, { delay, duration, easing }?: FadeParams) => AnimationConfig;
|
|
58
|
+
export declare const fly: (node: Element, { delay, duration, easing, x, y, opacity }?: FlyParams) => AnimationConfig;
|
|
59
|
+
export declare const slide: (node: Element, { delay, duration, easing, axis }?: SlideParams) => AnimationConfig;
|
|
60
|
+
export declare const scale: (node: Element, { delay, duration, easing, start, opacity }?: ScaleParams) => AnimationConfig;
|
|
61
|
+
export declare const draw: (node: SVGElement & {
|
|
62
|
+
getTotalLength(): number;
|
|
63
|
+
}, { delay, speed, duration, easing }?: DrawParams) => AnimationConfig;
|
|
64
|
+
export declare const crossfade: ({ fallback, ...defaults }: CrossfadeParams & {
|
|
65
|
+
fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => AnimationConfig;
|
|
66
|
+
}) => [(node: Element, params: CrossfadeParams & {
|
|
67
|
+
key: unknown;
|
|
68
|
+
}) => () => AnimationConfig | undefined, (node: Element, params: CrossfadeParams & {
|
|
69
|
+
key: unknown;
|
|
70
|
+
}) => () => AnimationConfig | undefined];
|
|
71
|
+
export declare const transitionMap: {
|
|
72
|
+
readonly blur: (node: Element, { delay, duration, easing, amount, opacity }?: BlurParams) => AnimationConfig;
|
|
73
|
+
readonly fade: (node: Element, { delay, duration, easing }?: FadeParams) => AnimationConfig;
|
|
74
|
+
readonly fly: (node: Element, { delay, duration, easing, x, y, opacity }?: FlyParams) => AnimationConfig;
|
|
75
|
+
readonly slide: (node: Element, { delay, duration, easing, axis }?: SlideParams) => AnimationConfig;
|
|
76
|
+
readonly scale: (node: Element, { delay, duration, easing, start, opacity }?: ScaleParams) => AnimationConfig;
|
|
77
|
+
readonly draw: (node: SVGElement & {
|
|
78
|
+
getTotalLength(): number;
|
|
79
|
+
}, { delay, speed, duration, easing }?: DrawParams) => AnimationConfig;
|
|
80
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { cubicInOut, cubicOut, linear } from './easing';
|
|
2
|
+
import { runAnimationConfig, splitCssUnit } from './internal';
|
|
3
|
+
export { runAnimationConfig };
|
|
4
|
+
const readOpacity = (node) => Number.parseFloat(getComputedStyle(node).opacity || '1');
|
|
5
|
+
export const blur = (node, { delay = 0, duration = 400, easing = cubicInOut, amount = 5, opacity = 0 } = {}) => {
|
|
6
|
+
const style = getComputedStyle(node);
|
|
7
|
+
const targetOpacity = readOpacity(node);
|
|
8
|
+
const filter = style.filter === 'none' ? '' : style.filter;
|
|
9
|
+
const opacityDelta = targetOpacity * (1 - opacity);
|
|
10
|
+
const [value, unit] = splitCssUnit(amount);
|
|
11
|
+
return {
|
|
12
|
+
delay,
|
|
13
|
+
duration,
|
|
14
|
+
easing,
|
|
15
|
+
css: (_t, u) => `opacity: ${targetOpacity - opacityDelta * u}; filter: ${filter} blur(${u * value}${unit});`
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const fade = (node, { delay = 0, duration = 400, easing = linear } = {}) => {
|
|
19
|
+
const opacity = readOpacity(node);
|
|
20
|
+
return {
|
|
21
|
+
delay,
|
|
22
|
+
duration,
|
|
23
|
+
easing,
|
|
24
|
+
css: (t) => `opacity: ${t * opacity};`
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export const fly = (node, { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}) => {
|
|
28
|
+
const style = getComputedStyle(node);
|
|
29
|
+
const targetOpacity = readOpacity(node);
|
|
30
|
+
const transform = style.transform === 'none' ? '' : style.transform;
|
|
31
|
+
const opacityDelta = targetOpacity * (1 - opacity);
|
|
32
|
+
const [xValue, xUnit] = splitCssUnit(x);
|
|
33
|
+
const [yValue, yUnit] = splitCssUnit(y);
|
|
34
|
+
return {
|
|
35
|
+
delay,
|
|
36
|
+
duration,
|
|
37
|
+
easing,
|
|
38
|
+
css: (t, u) => `
|
|
39
|
+
transform: ${transform} translate(${(1 - t) * xValue}${xUnit}, ${(1 - t) * yValue}${yUnit});
|
|
40
|
+
opacity: ${targetOpacity - opacityDelta * u};
|
|
41
|
+
`
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export const slide = (node, { delay = 0, duration = 400, easing = cubicOut, axis = 'y' } = {}) => {
|
|
45
|
+
const style = getComputedStyle(node);
|
|
46
|
+
const opacity = readOpacity(node);
|
|
47
|
+
const primaryProperty = axis === 'y' ? 'height' : 'width';
|
|
48
|
+
const primaryPropertyValue = Number.parseFloat(style.getPropertyValue(primaryProperty));
|
|
49
|
+
const secondaryProperties = axis === 'y' ? ['top', 'bottom'] : ['left', 'right'];
|
|
50
|
+
const paddingStartValue = Number.parseFloat(style.getPropertyValue(`padding-${secondaryProperties[0]}`));
|
|
51
|
+
const paddingEndValue = Number.parseFloat(style.getPropertyValue(`padding-${secondaryProperties[1]}`));
|
|
52
|
+
const marginStartValue = Number.parseFloat(style.getPropertyValue(`margin-${secondaryProperties[0]}`));
|
|
53
|
+
const marginEndValue = Number.parseFloat(style.getPropertyValue(`margin-${secondaryProperties[1]}`));
|
|
54
|
+
const borderWidthStartValue = Number.parseFloat(style.getPropertyValue(`border-${secondaryProperties[0]}-width`));
|
|
55
|
+
const borderWidthEndValue = Number.parseFloat(style.getPropertyValue(`border-${secondaryProperties[1]}-width`));
|
|
56
|
+
return {
|
|
57
|
+
delay,
|
|
58
|
+
duration,
|
|
59
|
+
easing,
|
|
60
|
+
css: (t) => 'overflow: hidden;' +
|
|
61
|
+
`opacity: ${Math.min(t * 20, 1) * opacity};` +
|
|
62
|
+
`${primaryProperty}: ${t * primaryPropertyValue}px;` +
|
|
63
|
+
`padding-${secondaryProperties[0]}: ${t * paddingStartValue}px;` +
|
|
64
|
+
`padding-${secondaryProperties[1]}: ${t * paddingEndValue}px;` +
|
|
65
|
+
`margin-${secondaryProperties[0]}: ${t * marginStartValue}px;` +
|
|
66
|
+
`margin-${secondaryProperties[1]}: ${t * marginEndValue}px;` +
|
|
67
|
+
`border-${secondaryProperties[0]}-width: ${t * borderWidthStartValue}px;` +
|
|
68
|
+
`border-${secondaryProperties[1]}-width: ${t * borderWidthEndValue}px;` +
|
|
69
|
+
`min-${primaryProperty}: 0;`
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export const scale = (node, { delay = 0, duration = 400, easing = cubicOut, start = 0, opacity = 0 } = {}) => {
|
|
73
|
+
const style = getComputedStyle(node);
|
|
74
|
+
const targetOpacity = readOpacity(node);
|
|
75
|
+
const transform = style.transform === 'none' ? '' : style.transform;
|
|
76
|
+
const scaleDelta = 1 - start;
|
|
77
|
+
const opacityDelta = targetOpacity * (1 - opacity);
|
|
78
|
+
return {
|
|
79
|
+
delay,
|
|
80
|
+
duration,
|
|
81
|
+
easing,
|
|
82
|
+
css: (_t, u) => `
|
|
83
|
+
transform: ${transform} scale(${1 - scaleDelta * u});
|
|
84
|
+
opacity: ${targetOpacity - opacityDelta * u};
|
|
85
|
+
`
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export const draw = (node, { delay = 0, speed, duration, easing = cubicInOut } = {}) => {
|
|
89
|
+
let len = node.getTotalLength();
|
|
90
|
+
const style = getComputedStyle(node);
|
|
91
|
+
if (style.strokeLinecap !== 'butt') {
|
|
92
|
+
len += Number.parseInt(style.strokeWidth, 10);
|
|
93
|
+
}
|
|
94
|
+
let resolvedDuration;
|
|
95
|
+
if (duration === undefined) {
|
|
96
|
+
resolvedDuration = speed === undefined ? 800 : len / speed;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
resolvedDuration = typeof duration === 'function' ? duration(len) : duration;
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
delay,
|
|
103
|
+
duration: resolvedDuration,
|
|
104
|
+
easing,
|
|
105
|
+
css: (_t, u) => `
|
|
106
|
+
stroke-dasharray: ${len};
|
|
107
|
+
stroke-dashoffset: ${u * len};
|
|
108
|
+
`
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const assign = (target, source) => Object.assign(target, source);
|
|
112
|
+
export const crossfade = ({ fallback, ...defaults }) => {
|
|
113
|
+
const toReceive = new Map();
|
|
114
|
+
const toSend = new Map();
|
|
115
|
+
const makeCrossfade = (fromNode, node, params) => {
|
|
116
|
+
const merged = assign(assign({}, defaults), params);
|
|
117
|
+
const delay = merged.delay ?? 0;
|
|
118
|
+
const duration = merged.duration ?? ((distance) => Math.sqrt(distance) * 30);
|
|
119
|
+
const easing = merged.easing ?? cubicOut;
|
|
120
|
+
const from = fromNode.getBoundingClientRect();
|
|
121
|
+
const to = node.getBoundingClientRect();
|
|
122
|
+
const dx = from.left - to.left;
|
|
123
|
+
const dy = from.top - to.top;
|
|
124
|
+
const dw = from.width / to.width;
|
|
125
|
+
const dh = from.height / to.height;
|
|
126
|
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
127
|
+
const style = getComputedStyle(node);
|
|
128
|
+
const transform = style.transform === 'none' ? '' : style.transform;
|
|
129
|
+
const opacity = Number.parseFloat(style.opacity || '1');
|
|
130
|
+
return {
|
|
131
|
+
delay,
|
|
132
|
+
duration: typeof duration === 'function' ? duration(distance) : duration,
|
|
133
|
+
easing,
|
|
134
|
+
css: (t, u) => `
|
|
135
|
+
opacity: ${t * opacity};
|
|
136
|
+
transform-origin: top left;
|
|
137
|
+
transform: ${transform} translate(${u * dx}px, ${u * dy}px) scale(${t + (1 - t) * dw}, ${t + (1 - t) * dh});
|
|
138
|
+
`
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
const transition = (items, counterparts, intro) => {
|
|
142
|
+
return (node, params) => {
|
|
143
|
+
items.set(params.key, node);
|
|
144
|
+
return () => {
|
|
145
|
+
if (counterparts.has(params.key)) {
|
|
146
|
+
const otherNode = counterparts.get(params.key);
|
|
147
|
+
counterparts.delete(params.key);
|
|
148
|
+
return makeCrossfade(otherNode, node, params);
|
|
149
|
+
}
|
|
150
|
+
items.delete(params.key);
|
|
151
|
+
return fallback?.(node, params, intro);
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
return [transition(toSend, toReceive, false), transition(toReceive, toSend, true)];
|
|
156
|
+
};
|
|
157
|
+
export const transitionMap = {
|
|
158
|
+
blur,
|
|
159
|
+
fade,
|
|
160
|
+
fly,
|
|
161
|
+
slide,
|
|
162
|
+
scale,
|
|
163
|
+
draw
|
|
164
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@any-tdf/react-motion",
|
|
3
|
+
"version": "0.0.0-alpha.0",
|
|
4
|
+
"description": "React motion utilities compatible with Svelte transition, animate, easing, and motion APIs.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc -p tsconfig.json",
|
|
11
|
+
"docs:dev": "vite --config site/vite.config.ts --host 0.0.0.0",
|
|
12
|
+
"docs:build": "vite build --config site/vite.config.ts",
|
|
13
|
+
"docs:preview": "vite preview --config site/vite.config.ts --host 0.0.0.0",
|
|
14
|
+
"test": "bun test"
|
|
15
|
+
},
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./easing": {
|
|
26
|
+
"types": "./dist/easing.d.ts",
|
|
27
|
+
"import": "./dist/easing.js",
|
|
28
|
+
"default": "./dist/easing.js"
|
|
29
|
+
},
|
|
30
|
+
"./transition": {
|
|
31
|
+
"types": "./dist/transition.d.ts",
|
|
32
|
+
"import": "./dist/transition.js",
|
|
33
|
+
"default": "./dist/transition.js"
|
|
34
|
+
},
|
|
35
|
+
"./animate": {
|
|
36
|
+
"types": "./dist/animate.d.ts",
|
|
37
|
+
"import": "./dist/animate.js",
|
|
38
|
+
"default": "./dist/animate.js"
|
|
39
|
+
},
|
|
40
|
+
"./motion": {
|
|
41
|
+
"types": "./dist/motion.d.ts",
|
|
42
|
+
"import": "./dist/motion.js",
|
|
43
|
+
"default": "./dist/motion.js"
|
|
44
|
+
},
|
|
45
|
+
"./react": {
|
|
46
|
+
"types": "./dist/react.d.ts",
|
|
47
|
+
"import": "./dist/react.js",
|
|
48
|
+
"default": "./dist/react.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
53
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"react": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"react-dom": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@types/react": "^19.1.4",
|
|
65
|
+
"@types/react-dom": "^19.1.5",
|
|
66
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
67
|
+
"lucide-react": "^1.21.0",
|
|
68
|
+
"react": "^19.1.0",
|
|
69
|
+
"react-dom": "^19.1.0",
|
|
70
|
+
"typescript": "^5.8.3",
|
|
71
|
+
"vite": "^6.3.5"
|
|
72
|
+
}
|
|
73
|
+
}
|