@enact-ui/animate 0.1.0 → 0.2.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/api-schema.json +206 -0
- package/dist/components/CountUp.d.ts +84 -0
- package/dist/components/CountUp.d.ts.map +1 -0
- package/dist/components/CountUp.js +68 -0
- package/dist/components/CountUp.js.map +1 -0
- package/dist/components/MotionDiv.d.ts +159 -0
- package/dist/components/MotionDiv.d.ts.map +1 -0
- package/dist/components/MotionDiv.js +162 -0
- package/dist/components/MotionDiv.js.map +1 -0
- package/dist/components/StaggerContainer.d.ts +136 -0
- package/dist/components/StaggerContainer.d.ts.map +1 -0
- package/dist/components/StaggerContainer.js +166 -0
- package/dist/components/StaggerContainer.js.map +1 -0
- package/dist/hooks/use-component-animation.d.ts +156 -0
- package/dist/hooks/use-component-animation.d.ts.map +1 -0
- package/dist/hooks/use-component-animation.js +231 -0
- package/dist/hooks/use-component-animation.js.map +1 -0
- package/dist/hooks/use-count-up.d.ts +111 -0
- package/dist/hooks/use-count-up.d.ts.map +1 -0
- package/dist/hooks/use-count-up.js +246 -0
- package/dist/hooks/use-count-up.js.map +1 -0
- package/dist/hooks/use-draw-path.d.ts +96 -0
- package/dist/hooks/use-draw-path.d.ts.map +1 -0
- package/dist/hooks/use-draw-path.js +227 -0
- package/dist/hooks/use-draw-path.js.map +1 -0
- package/dist/hooks/use-motion-preset.d.ts.map +1 -1
- package/dist/hooks/use-motion-preset.js +17 -16
- package/dist/hooks/use-motion-preset.js.map +1 -1
- package/dist/hooks/use-stagger.d.ts +174 -0
- package/dist/hooks/use-stagger.d.ts.map +1 -0
- package/dist/hooks/use-stagger.js +256 -0
- package/dist/hooks/use-stagger.js.map +1 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2442 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2335 -25
- package/dist/index.mjs.map +1 -1
- package/dist/presets/component-presets.d.ts +246 -0
- package/dist/presets/component-presets.d.ts.map +1 -0
- package/dist/presets/component-presets.js +472 -0
- package/dist/presets/component-presets.js.map +1 -0
- package/dist/presets/micro-interactions.d.ts +451 -0
- package/dist/presets/micro-interactions.d.ts.map +1 -0
- package/dist/presets/micro-interactions.js +856 -0
- package/dist/presets/micro-interactions.js.map +1 -0
- package/dist/presets/motion-presets.d.ts.map +1 -1
- package/dist/presets/motion-presets.js +0 -1
- package/dist/presets/motion-presets.js.map +1 -1
- package/dist/presets/motion-styles.d.ts +186 -0
- package/dist/presets/motion-styles.d.ts.map +1 -0
- package/dist/presets/motion-styles.js +204 -0
- package/dist/presets/motion-styles.js.map +1 -0
- package/dist/presets/stagger-presets.d.ts +378 -0
- package/dist/presets/stagger-presets.d.ts.map +1 -0
- package/dist/presets/stagger-presets.js +582 -0
- package/dist/presets/stagger-presets.js.map +1 -0
- package/dist/showcase/motion-presets.demo.d.ts +25 -0
- package/dist/showcase/motion-presets.demo.d.ts.map +1 -0
- package/dist/showcase/motion-presets.demo.js +96 -0
- package/dist/showcase/motion-presets.demo.js.map +1 -0
- package/dist/showcase/motion-presets.story.d.ts +37 -0
- package/dist/showcase/motion-presets.story.d.ts.map +1 -0
- package/dist/showcase/motion-presets.story.js +151 -0
- package/dist/showcase/motion-presets.story.js.map +1 -0
- package/dist/utils/easing.d.ts +294 -0
- package/dist/utils/easing.d.ts.map +1 -0
- package/dist/utils/easing.js +265 -0
- package/dist/utils/easing.js.map +1 -0
- package/dist/utils/reduced-motion.d.ts +322 -0
- package/dist/utils/reduced-motion.d.ts.map +1 -0
- package/dist/utils/reduced-motion.js +362 -0
- package/dist/utils/reduced-motion.js.map +1 -0
- package/dist/utils/select-preset.d.ts +186 -0
- package/dist/utils/select-preset.d.ts.map +1 -0
- package/dist/utils/select-preset.js +320 -0
- package/dist/utils/select-preset.js.map +1 -0
- package/dist/utils/spring-configs.d.ts +187 -0
- package/dist/utils/spring-configs.d.ts.map +1 -0
- package/dist/utils/spring-configs.js +169 -0
- package/dist/utils/spring-configs.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
// Copyright (c) 2026 Amsterdam Data Labs
|
|
2
|
+
import { getMotionStyle, msToSeconds } from "./motion-styles";
|
|
3
|
+
/**
|
|
4
|
+
* Creates base item variants used across all stagger presets.
|
|
5
|
+
*
|
|
6
|
+
* @param style - The motion style for animation configuration
|
|
7
|
+
* @returns Base item variants with fade and slide effect
|
|
8
|
+
*/
|
|
9
|
+
function createBaseItemVariants(style) {
|
|
10
|
+
const config = getMotionStyle(style);
|
|
11
|
+
return {
|
|
12
|
+
hidden: {
|
|
13
|
+
opacity: 0,
|
|
14
|
+
y: 20,
|
|
15
|
+
},
|
|
16
|
+
visible: {
|
|
17
|
+
opacity: 1,
|
|
18
|
+
y: 0,
|
|
19
|
+
transition: {
|
|
20
|
+
type: "spring",
|
|
21
|
+
stiffness: config.spring.stiffness,
|
|
22
|
+
damping: config.spring.damping,
|
|
23
|
+
mass: config.spring.mass,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Sequential Stagger - Items animate one after another from top to bottom.
|
|
30
|
+
*
|
|
31
|
+
* The most common stagger pattern where items appear in their natural order.
|
|
32
|
+
* Creates a clean, predictable animation flow that guides the eye downward.
|
|
33
|
+
*
|
|
34
|
+
* @ai-hint Use staggerSequential for standard lists, menus, and vertical
|
|
35
|
+
* content where you want items to appear in reading order (top to bottom).
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* import { staggerSequential } from "@enact-ui/animate";
|
|
40
|
+
*
|
|
41
|
+
* // Navigation menu items
|
|
42
|
+
* <motion.nav variants={staggerSequential.getContainerVariants("standard")}>
|
|
43
|
+
* {menuItems.map((item) => (
|
|
44
|
+
* <motion.a variants={staggerSequential.getItemVariants("standard")}>
|
|
45
|
+
* {item.label}
|
|
46
|
+
* </motion.a>
|
|
47
|
+
* ))}
|
|
48
|
+
* </motion.nav>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export const staggerSequential = {
|
|
52
|
+
name: "Sequential",
|
|
53
|
+
description: "Items animate one after another from top to bottom",
|
|
54
|
+
useCase: ["Navigation menus", "Vertical lists", "Table rows", "Form fields", "Sidebar items"],
|
|
55
|
+
getDelay(index, _total, style) {
|
|
56
|
+
const config = getMotionStyle(style);
|
|
57
|
+
return msToSeconds(config.staggerDelay * index);
|
|
58
|
+
},
|
|
59
|
+
getContainerVariants(style) {
|
|
60
|
+
const config = getMotionStyle(style);
|
|
61
|
+
return {
|
|
62
|
+
hidden: { opacity: 0 },
|
|
63
|
+
visible: {
|
|
64
|
+
opacity: 1,
|
|
65
|
+
transition: {
|
|
66
|
+
staggerChildren: msToSeconds(config.staggerDelay),
|
|
67
|
+
delayChildren: msToSeconds(config.duration.fast * 0.5),
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
getItemVariants: createBaseItemVariants,
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Reverse Stagger - Items animate from bottom to top.
|
|
76
|
+
*
|
|
77
|
+
* Creates an upward flow effect, useful for content that should draw
|
|
78
|
+
* attention upward or create a "rising" visual metaphor.
|
|
79
|
+
*
|
|
80
|
+
* @ai-hint Use staggerReverse for toast notifications, chat messages
|
|
81
|
+
* (newest first), or any content where bottom-to-top flow makes sense.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* import { staggerReverse } from "@enact-ui/animate";
|
|
86
|
+
*
|
|
87
|
+
* // Toast notification stack
|
|
88
|
+
* <motion.div variants={staggerReverse.getContainerVariants("standard")}>
|
|
89
|
+
* {toasts.map((toast) => (
|
|
90
|
+
* <motion.div variants={staggerReverse.getItemVariants("standard")}>
|
|
91
|
+
* {toast.message}
|
|
92
|
+
* </motion.div>
|
|
93
|
+
* ))}
|
|
94
|
+
* </motion.div>
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export const staggerReverse = {
|
|
98
|
+
name: "Reverse",
|
|
99
|
+
description: "Items animate from bottom to top",
|
|
100
|
+
useCase: ["Toast notifications", "Chat messages (newest first)", "Bottom-anchored content", "Rising effect animations", "Upward reveals"],
|
|
101
|
+
getDelay(index, total, style) {
|
|
102
|
+
const config = getMotionStyle(style);
|
|
103
|
+
const reverseIndex = total - 1 - index;
|
|
104
|
+
return msToSeconds(config.staggerDelay * reverseIndex);
|
|
105
|
+
},
|
|
106
|
+
getContainerVariants(style) {
|
|
107
|
+
const config = getMotionStyle(style);
|
|
108
|
+
return {
|
|
109
|
+
hidden: { opacity: 0 },
|
|
110
|
+
visible: {
|
|
111
|
+
opacity: 1,
|
|
112
|
+
transition: {
|
|
113
|
+
staggerChildren: msToSeconds(config.staggerDelay),
|
|
114
|
+
staggerDirection: -1,
|
|
115
|
+
delayChildren: msToSeconds(config.duration.fast * 0.5),
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
getItemVariants(style) {
|
|
121
|
+
const config = getMotionStyle(style);
|
|
122
|
+
return {
|
|
123
|
+
hidden: {
|
|
124
|
+
opacity: 0,
|
|
125
|
+
y: -20,
|
|
126
|
+
},
|
|
127
|
+
visible: {
|
|
128
|
+
opacity: 1,
|
|
129
|
+
y: 0,
|
|
130
|
+
transition: {
|
|
131
|
+
type: "spring",
|
|
132
|
+
stiffness: config.spring.stiffness,
|
|
133
|
+
damping: config.spring.damping,
|
|
134
|
+
mass: config.spring.mass,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Center Stagger - Items animate from center outward.
|
|
142
|
+
*
|
|
143
|
+
* Creates a radial expansion effect where the middle item(s) appear first,
|
|
144
|
+
* then items progressively reveal outward. Great for focus-based UIs.
|
|
145
|
+
*
|
|
146
|
+
* @ai-hint Use staggerCenter for hero sections, featured content, or any
|
|
147
|
+
* UI where you want to draw attention to the center element first.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```tsx
|
|
151
|
+
* import { staggerCenter } from "@enact-ui/animate";
|
|
152
|
+
*
|
|
153
|
+
* // Feature cards with center focus
|
|
154
|
+
* <motion.div
|
|
155
|
+
* className="flex gap-4"
|
|
156
|
+
* variants={staggerCenter.getContainerVariants("bold")}
|
|
157
|
+
* >
|
|
158
|
+
* {features.map((feature, i) => (
|
|
159
|
+
* <motion.div
|
|
160
|
+
* variants={staggerCenter.getItemVariants("bold")}
|
|
161
|
+
* custom={{ index: i, total: features.length }}
|
|
162
|
+
* >
|
|
163
|
+
* {feature.title}
|
|
164
|
+
* </motion.div>
|
|
165
|
+
* ))}
|
|
166
|
+
* </motion.div>
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
export const staggerCenter = {
|
|
170
|
+
name: "Center",
|
|
171
|
+
description: "Items animate from center outward",
|
|
172
|
+
useCase: ["Hero sections", "Featured content", "Pricing cards", "Centered navigation", "Focus-based reveals"],
|
|
173
|
+
getDelay(index, total, style) {
|
|
174
|
+
const config = getMotionStyle(style);
|
|
175
|
+
const centerIndex = (total - 1) / 2;
|
|
176
|
+
const distanceFromCenter = Math.abs(index - centerIndex);
|
|
177
|
+
return msToSeconds(config.staggerDelay * distanceFromCenter);
|
|
178
|
+
},
|
|
179
|
+
getContainerVariants(style) {
|
|
180
|
+
const config = getMotionStyle(style);
|
|
181
|
+
return {
|
|
182
|
+
hidden: { opacity: 0 },
|
|
183
|
+
visible: {
|
|
184
|
+
opacity: 1,
|
|
185
|
+
transition: {
|
|
186
|
+
staggerChildren: msToSeconds(config.staggerDelay),
|
|
187
|
+
delayChildren: msToSeconds(config.duration.fast * 0.5),
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
getItemVariants(style) {
|
|
193
|
+
const config = getMotionStyle(style);
|
|
194
|
+
return {
|
|
195
|
+
hidden: {
|
|
196
|
+
opacity: 0,
|
|
197
|
+
scale: 0.8,
|
|
198
|
+
},
|
|
199
|
+
visible: {
|
|
200
|
+
opacity: 1,
|
|
201
|
+
scale: 1,
|
|
202
|
+
transition: {
|
|
203
|
+
type: "spring",
|
|
204
|
+
stiffness: config.spring.stiffness,
|
|
205
|
+
damping: config.spring.damping,
|
|
206
|
+
mass: config.spring.mass,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Random Stagger - Items animate in random order.
|
|
214
|
+
*
|
|
215
|
+
* Creates an organic, unpredictable animation pattern. Each render
|
|
216
|
+
* produces the same "random" order using a seeded approach based on index.
|
|
217
|
+
*
|
|
218
|
+
* @ai-hint Use staggerRandom for photo galleries, tag clouds, or creative
|
|
219
|
+
* UIs where a playful, organic feel is desired. Avoid for data-heavy UIs.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```tsx
|
|
223
|
+
* import { staggerRandom } from "@enact-ui/animate";
|
|
224
|
+
*
|
|
225
|
+
* // Photo gallery with organic reveal
|
|
226
|
+
* <motion.div
|
|
227
|
+
* className="grid grid-cols-3"
|
|
228
|
+
* variants={staggerRandom.getContainerVariants("playful")}
|
|
229
|
+
* >
|
|
230
|
+
* {photos.map((photo) => (
|
|
231
|
+
* <motion.img
|
|
232
|
+
* src={photo.url}
|
|
233
|
+
* variants={staggerRandom.getItemVariants("playful")}
|
|
234
|
+
* />
|
|
235
|
+
* ))}
|
|
236
|
+
* </motion.div>
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
export const staggerRandom = {
|
|
240
|
+
name: "Random",
|
|
241
|
+
description: "Items animate in random order",
|
|
242
|
+
useCase: ["Photo galleries", "Tag clouds", "Creative portfolios", "Playful interfaces", "Organic reveals"],
|
|
243
|
+
getDelay(index, total, style) {
|
|
244
|
+
const config = getMotionStyle(style);
|
|
245
|
+
// Use a deterministic pseudo-random based on index for consistency
|
|
246
|
+
const seed = ((index * 7919) % total) / total;
|
|
247
|
+
const maxDelay = config.staggerDelay * total;
|
|
248
|
+
return msToSeconds(seed * maxDelay);
|
|
249
|
+
},
|
|
250
|
+
getContainerVariants(style) {
|
|
251
|
+
const config = getMotionStyle(style);
|
|
252
|
+
return {
|
|
253
|
+
hidden: { opacity: 0 },
|
|
254
|
+
visible: {
|
|
255
|
+
opacity: 1,
|
|
256
|
+
transition: {
|
|
257
|
+
staggerChildren: msToSeconds(config.staggerDelay * 0.3),
|
|
258
|
+
delayChildren: msToSeconds(config.duration.fast * 0.5),
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
},
|
|
263
|
+
getItemVariants(style) {
|
|
264
|
+
const config = getMotionStyle(style);
|
|
265
|
+
return {
|
|
266
|
+
hidden: {
|
|
267
|
+
opacity: 0,
|
|
268
|
+
scale: 0.9,
|
|
269
|
+
rotate: -5,
|
|
270
|
+
},
|
|
271
|
+
visible: {
|
|
272
|
+
opacity: 1,
|
|
273
|
+
scale: 1,
|
|
274
|
+
rotate: 0,
|
|
275
|
+
transition: {
|
|
276
|
+
type: "spring",
|
|
277
|
+
stiffness: config.spring.stiffness,
|
|
278
|
+
damping: config.spring.damping,
|
|
279
|
+
mass: config.spring.mass,
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* Grid Stagger - 2D diagonal wave pattern for grid layouts.
|
|
287
|
+
*
|
|
288
|
+
* Creates a diagonal wave effect where items animate based on their
|
|
289
|
+
* row + column position. Perfect for image grids and card layouts.
|
|
290
|
+
*
|
|
291
|
+
* @ai-hint Use staggerGrid for 2D layouts like image galleries, card grids,
|
|
292
|
+
* or dashboards. Pass columns count for accurate diagonal calculation.
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* ```tsx
|
|
296
|
+
* import { staggerGrid } from "@enact-ui/animate";
|
|
297
|
+
*
|
|
298
|
+
* const COLUMNS = 4;
|
|
299
|
+
*
|
|
300
|
+
* // Image grid with diagonal wave
|
|
301
|
+
* <motion.div
|
|
302
|
+
* className="grid grid-cols-4"
|
|
303
|
+
* variants={staggerGrid.getContainerVariants("standard")}
|
|
304
|
+
* >
|
|
305
|
+
* {images.map((image, index) => (
|
|
306
|
+
* <motion.div
|
|
307
|
+
* key={image.id}
|
|
308
|
+
* variants={staggerGrid.getItemVariants("standard")}
|
|
309
|
+
* style={{
|
|
310
|
+
* // Custom delay based on grid position
|
|
311
|
+
* transitionDelay: `${staggerGrid.getDelay(
|
|
312
|
+
* index,
|
|
313
|
+
* images.length,
|
|
314
|
+
* "standard"
|
|
315
|
+
* )}s`,
|
|
316
|
+
* }}
|
|
317
|
+
* >
|
|
318
|
+
* <img src={image.url} alt={image.alt} />
|
|
319
|
+
* </motion.div>
|
|
320
|
+
* ))}
|
|
321
|
+
* </motion.div>
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
324
|
+
export const staggerGrid = {
|
|
325
|
+
name: "Grid",
|
|
326
|
+
description: "2D diagonal wave pattern for grid layouts",
|
|
327
|
+
useCase: ["Image galleries", "Card grids", "Dashboard widgets", "Product catalogs", "Portfolio items"],
|
|
328
|
+
getDelay(index, _total, style, columns = 4) {
|
|
329
|
+
const config = getMotionStyle(style);
|
|
330
|
+
const row = Math.floor(index / columns);
|
|
331
|
+
const col = index % columns;
|
|
332
|
+
// Diagonal wave: items with same row+col sum animate together
|
|
333
|
+
const diagonalIndex = row + col;
|
|
334
|
+
return msToSeconds(config.staggerDelay * diagonalIndex);
|
|
335
|
+
},
|
|
336
|
+
getContainerVariants(style) {
|
|
337
|
+
const config = getMotionStyle(style);
|
|
338
|
+
return {
|
|
339
|
+
hidden: { opacity: 0 },
|
|
340
|
+
visible: {
|
|
341
|
+
opacity: 1,
|
|
342
|
+
transition: {
|
|
343
|
+
staggerChildren: msToSeconds(config.staggerDelay * 0.8),
|
|
344
|
+
delayChildren: msToSeconds(config.duration.fast * 0.5),
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
getItemVariants(style) {
|
|
350
|
+
const config = getMotionStyle(style);
|
|
351
|
+
return {
|
|
352
|
+
hidden: {
|
|
353
|
+
opacity: 0,
|
|
354
|
+
scale: 0.9,
|
|
355
|
+
y: 10,
|
|
356
|
+
},
|
|
357
|
+
visible: {
|
|
358
|
+
opacity: 1,
|
|
359
|
+
scale: 1,
|
|
360
|
+
y: 0,
|
|
361
|
+
transition: {
|
|
362
|
+
type: "spring",
|
|
363
|
+
stiffness: config.spring.stiffness,
|
|
364
|
+
damping: config.spring.damping,
|
|
365
|
+
mass: config.spring.mass,
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
};
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Wave Stagger - Sine-wave based stagger pattern.
|
|
373
|
+
*
|
|
374
|
+
* Creates an organic wave effect using sinusoidal timing. Items
|
|
375
|
+
* animate in a flowing pattern that feels natural and rhythmic.
|
|
376
|
+
*
|
|
377
|
+
* @ai-hint Use staggerWave for music/audio UIs, timeline visualizations,
|
|
378
|
+
* or any interface that benefits from organic, flowing motion.
|
|
379
|
+
*
|
|
380
|
+
* @example
|
|
381
|
+
* ```tsx
|
|
382
|
+
* import { staggerWave } from "@enact-ui/animate";
|
|
383
|
+
*
|
|
384
|
+
* // Audio equalizer bars
|
|
385
|
+
* <motion.div
|
|
386
|
+
* className="flex items-end gap-1"
|
|
387
|
+
* variants={staggerWave.getContainerVariants("playful")}
|
|
388
|
+
* >
|
|
389
|
+
* {bars.map((bar, index) => (
|
|
390
|
+
* <motion.div
|
|
391
|
+
* key={index}
|
|
392
|
+
* className="bg-primary"
|
|
393
|
+
* style={{ height: bar.height }}
|
|
394
|
+
* variants={staggerWave.getItemVariants("playful")}
|
|
395
|
+
* />
|
|
396
|
+
* ))}
|
|
397
|
+
* </motion.div>
|
|
398
|
+
* ```
|
|
399
|
+
*/
|
|
400
|
+
export const staggerWave = {
|
|
401
|
+
name: "Wave",
|
|
402
|
+
description: "Sine-wave based stagger pattern for organic motion",
|
|
403
|
+
useCase: ["Audio visualizers", "Timeline animations", "Organic reveals", "Music interfaces", "Flowing sequences"],
|
|
404
|
+
getDelay(index, total, style) {
|
|
405
|
+
const config = getMotionStyle(style);
|
|
406
|
+
// Create a sine wave pattern across all items
|
|
407
|
+
const wavePosition = (index / total) * Math.PI * 2;
|
|
408
|
+
const waveOffset = (Math.sin(wavePosition) + 1) / 2; // Normalize to 0-1
|
|
409
|
+
const baseDelay = config.staggerDelay * index;
|
|
410
|
+
const waveDelay = config.staggerDelay * waveOffset * 2;
|
|
411
|
+
return msToSeconds(baseDelay + waveDelay);
|
|
412
|
+
},
|
|
413
|
+
getContainerVariants(style) {
|
|
414
|
+
const config = getMotionStyle(style);
|
|
415
|
+
return {
|
|
416
|
+
hidden: { opacity: 0 },
|
|
417
|
+
visible: {
|
|
418
|
+
opacity: 1,
|
|
419
|
+
transition: {
|
|
420
|
+
staggerChildren: msToSeconds(config.staggerDelay * 0.6),
|
|
421
|
+
delayChildren: msToSeconds(config.duration.fast * 0.5),
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
};
|
|
425
|
+
},
|
|
426
|
+
getItemVariants(style) {
|
|
427
|
+
const config = getMotionStyle(style);
|
|
428
|
+
return {
|
|
429
|
+
hidden: {
|
|
430
|
+
opacity: 0,
|
|
431
|
+
y: 15,
|
|
432
|
+
x: -5,
|
|
433
|
+
},
|
|
434
|
+
visible: {
|
|
435
|
+
opacity: 1,
|
|
436
|
+
y: 0,
|
|
437
|
+
x: 0,
|
|
438
|
+
transition: {
|
|
439
|
+
type: "spring",
|
|
440
|
+
stiffness: config.spring.stiffness,
|
|
441
|
+
damping: config.spring.damping,
|
|
442
|
+
mass: config.spring.mass,
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
};
|
|
446
|
+
},
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* Cascade Stagger - Fast initial items, progressively slower.
|
|
450
|
+
*
|
|
451
|
+
* Creates an accelerating cascade effect where early items appear quickly
|
|
452
|
+
* and later items take longer. Great for emphasizing quantity.
|
|
453
|
+
*
|
|
454
|
+
* @ai-hint Use staggerCascade for long lists, data tables, or anywhere
|
|
455
|
+
* you want to convey "there's more" by slowing down the reveal.
|
|
456
|
+
*
|
|
457
|
+
* @example
|
|
458
|
+
* ```tsx
|
|
459
|
+
* import { staggerCascade } from "@enact-ui/animate";
|
|
460
|
+
*
|
|
461
|
+
* // Long data table rows
|
|
462
|
+
* <motion.tbody variants={staggerCascade.getContainerVariants("subtle")}>
|
|
463
|
+
* {rows.map((row) => (
|
|
464
|
+
* <motion.tr
|
|
465
|
+
* key={row.id}
|
|
466
|
+
* variants={staggerCascade.getItemVariants("subtle")}
|
|
467
|
+
* >
|
|
468
|
+
* {row.cells.map((cell) => (
|
|
469
|
+
* <td key={cell.id}>{cell.value}</td>
|
|
470
|
+
* ))}
|
|
471
|
+
* </motion.tr>
|
|
472
|
+
* ))}
|
|
473
|
+
* </motion.tbody>
|
|
474
|
+
* ```
|
|
475
|
+
*/
|
|
476
|
+
export const staggerCascade = {
|
|
477
|
+
name: "Cascade",
|
|
478
|
+
description: "Fast initial items, progressively slower later ones",
|
|
479
|
+
useCase: ["Long lists", "Data tables", "Search results", "Infinite scroll content", "Progressive reveals"],
|
|
480
|
+
getDelay(index, total, style) {
|
|
481
|
+
const config = getMotionStyle(style);
|
|
482
|
+
// Exponential slowdown: sqrt creates the cascade effect
|
|
483
|
+
const normalizedIndex = index / Math.max(total - 1, 1);
|
|
484
|
+
const cascadeFactor = Math.sqrt(normalizedIndex);
|
|
485
|
+
const maxDuration = config.staggerDelay * total;
|
|
486
|
+
return msToSeconds(cascadeFactor * maxDuration);
|
|
487
|
+
},
|
|
488
|
+
getContainerVariants(style) {
|
|
489
|
+
const config = getMotionStyle(style);
|
|
490
|
+
return {
|
|
491
|
+
hidden: { opacity: 0 },
|
|
492
|
+
visible: {
|
|
493
|
+
opacity: 1,
|
|
494
|
+
transition: {
|
|
495
|
+
staggerChildren: msToSeconds(config.staggerDelay * 0.4),
|
|
496
|
+
delayChildren: msToSeconds(config.duration.fast * 0.3),
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
};
|
|
500
|
+
},
|
|
501
|
+
getItemVariants(style) {
|
|
502
|
+
const config = getMotionStyle(style);
|
|
503
|
+
return {
|
|
504
|
+
hidden: {
|
|
505
|
+
opacity: 0,
|
|
506
|
+
x: -10,
|
|
507
|
+
},
|
|
508
|
+
visible: {
|
|
509
|
+
opacity: 1,
|
|
510
|
+
x: 0,
|
|
511
|
+
transition: {
|
|
512
|
+
type: "spring",
|
|
513
|
+
stiffness: config.spring.stiffness + 50, // Slightly snappier
|
|
514
|
+
damping: config.spring.damping + 5,
|
|
515
|
+
mass: config.spring.mass * 0.9,
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
};
|
|
519
|
+
},
|
|
520
|
+
};
|
|
521
|
+
/**
|
|
522
|
+
* All stagger presets indexed by name.
|
|
523
|
+
*
|
|
524
|
+
* @ai-hint Use this map to dynamically select stagger presets based on
|
|
525
|
+
* user preferences or component configuration.
|
|
526
|
+
*/
|
|
527
|
+
export const staggerPresets = {
|
|
528
|
+
sequential: staggerSequential,
|
|
529
|
+
reverse: staggerReverse,
|
|
530
|
+
center: staggerCenter,
|
|
531
|
+
random: staggerRandom,
|
|
532
|
+
grid: staggerGrid,
|
|
533
|
+
wave: staggerWave,
|
|
534
|
+
cascade: staggerCascade,
|
|
535
|
+
};
|
|
536
|
+
/**
|
|
537
|
+
* Gets a stagger preset by name.
|
|
538
|
+
*
|
|
539
|
+
* @param name - The preset name to retrieve
|
|
540
|
+
* @returns The stagger preset configuration
|
|
541
|
+
* @throws Error if preset name is not found
|
|
542
|
+
*
|
|
543
|
+
* @example
|
|
544
|
+
* ```ts
|
|
545
|
+
* const preset = getStaggerPreset("center");
|
|
546
|
+
* const containerVariants = preset.getContainerVariants("standard");
|
|
547
|
+
* ```
|
|
548
|
+
*/
|
|
549
|
+
export function getStaggerPreset(name) {
|
|
550
|
+
const preset = staggerPresets[name];
|
|
551
|
+
if (!preset) {
|
|
552
|
+
throw new Error(`Unknown stagger preset: ${name}. Available: ${Object.keys(staggerPresets).join(", ")}`);
|
|
553
|
+
}
|
|
554
|
+
return preset;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Creates custom delay values for a list of items using a specific preset.
|
|
558
|
+
*
|
|
559
|
+
* Useful when you need to calculate delays outside of Motion's variants
|
|
560
|
+
* system, such as for CSS animations or manual timing control.
|
|
561
|
+
*
|
|
562
|
+
* @param preset - The stagger preset to use
|
|
563
|
+
* @param total - Total number of items
|
|
564
|
+
* @param style - The motion style for timing
|
|
565
|
+
* @returns Array of delay values in seconds for each item
|
|
566
|
+
*
|
|
567
|
+
* @example
|
|
568
|
+
* ```ts
|
|
569
|
+
* const delays = calculateStaggerDelays("cascade", 10, "standard");
|
|
570
|
+
* // Returns: [0, 0.05, 0.071, 0.087, 0.1, ...]
|
|
571
|
+
*
|
|
572
|
+
* // Use with CSS custom properties
|
|
573
|
+
* items.forEach((item, index) => {
|
|
574
|
+
* item.style.setProperty("--delay", `${delays[index]}s`);
|
|
575
|
+
* });
|
|
576
|
+
* ```
|
|
577
|
+
*/
|
|
578
|
+
export function calculateStaggerDelays(preset, total, style) {
|
|
579
|
+
const staggerPreset = getStaggerPreset(preset);
|
|
580
|
+
return Array.from({ length: total }, (_, index) => staggerPreset.getDelay(index, total, style));
|
|
581
|
+
}
|
|
582
|
+
//# sourceMappingURL=stagger-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stagger-presets.js","sourceRoot":"","sources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AgB,CAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Demonstrates all four motion styles with the same animation.
|
|
3
|
+
*/
|
|
4
|
+
export declare const MotionStylesShowcase: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* Demonstrates all component animation presets.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ComponentPresetsShowcase: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Demonstrates staggered list animations.
|
|
11
|
+
*/
|
|
12
|
+
export declare const StaggerShowcase: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Demonstrates micro-interaction presets.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MicroInteractionsShowcase: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Demonstrates how animations respect reduced motion preferences.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ReducedMotionDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* A comprehensive showcase of all motion preset features.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MotionPresetsPlayground: () => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=motion-presets.demo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion-presets.demo.d.ts","sourceRoot":"","sources":["../../src/showcase/motion-presets.demo.tsx"],"names":[],"mappings":"AAyBA;;GAEG;AACH,eAAO,MAAM,oBAAoB,+CA0BhC,CAAC;AA+BF;;GAEG;AACH,eAAO,MAAM,wBAAwB,+CA0EpC,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,eAAe,+CAiE3B,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,yBAAyB,+CA8ErC,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,iBAAiB,+CA0B7B,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,uBAAuB,+CA6BnC,CAAC"}
|