react-native-puff-pop 1.0.6 → 1.0.8
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/README.md +331 -1
- package/lib/module/index.js +411 -69
- package/lib/typescript/src/index.d.ts +198 -3
- package/package.json +1 -1
- package/src/index.tsx +759 -77
|
@@ -3,11 +3,42 @@ import { type StyleProp, type ViewStyle } from 'react-native';
|
|
|
3
3
|
/**
|
|
4
4
|
* Animation effect types for PuffPop
|
|
5
5
|
*/
|
|
6
|
-
export type PuffPopEffect = 'scale' | 'rotate' | 'fade' | 'slideUp' | 'slideDown' | 'slideLeft' | 'slideRight' | 'bounce' | 'flip' | 'zoom' | 'rotateScale';
|
|
6
|
+
export type PuffPopEffect = 'scale' | 'rotate' | 'fade' | 'slideUp' | 'slideDown' | 'slideLeft' | 'slideRight' | 'bounce' | 'flip' | 'zoom' | 'rotateScale' | 'shake' | 'pulse' | 'swing' | 'wobble' | 'elastic';
|
|
7
7
|
/**
|
|
8
8
|
* Easing function types
|
|
9
9
|
*/
|
|
10
10
|
export type PuffPopEasing = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | 'spring' | 'bounce';
|
|
11
|
+
/**
|
|
12
|
+
* Anchor point for scale/rotate transformations
|
|
13
|
+
* Determines the origin point of the transformation
|
|
14
|
+
*/
|
|
15
|
+
export type PuffPopAnchorPoint = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
16
|
+
/**
|
|
17
|
+
* Spring animation configuration
|
|
18
|
+
* Used when useSpring is true for physics-based animations
|
|
19
|
+
*/
|
|
20
|
+
export interface PuffPopSpringConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Controls the spring stiffness. Higher values = faster, snappier animation
|
|
23
|
+
* @default 100
|
|
24
|
+
*/
|
|
25
|
+
tension?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Controls the spring damping. Higher values = less oscillation
|
|
28
|
+
* @default 10
|
|
29
|
+
*/
|
|
30
|
+
friction?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Animation speed multiplier
|
|
33
|
+
* @default 12
|
|
34
|
+
*/
|
|
35
|
+
speed?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Controls the bounciness. Higher values = more bouncy
|
|
38
|
+
* @default 8
|
|
39
|
+
*/
|
|
40
|
+
bounciness?: number;
|
|
41
|
+
}
|
|
11
42
|
export interface PuffPopProps {
|
|
12
43
|
/**
|
|
13
44
|
* Children to animate
|
|
@@ -83,11 +114,94 @@ export interface PuffPopProps {
|
|
|
83
114
|
* Test ID for testing purposes
|
|
84
115
|
*/
|
|
85
116
|
testID?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Animation effect type when hiding (exit animation)
|
|
119
|
+
* If not specified, uses the reverse of the enter effect
|
|
120
|
+
*/
|
|
121
|
+
exitEffect?: PuffPopEffect;
|
|
122
|
+
/**
|
|
123
|
+
* Animation duration for exit animation in milliseconds
|
|
124
|
+
* If not specified, uses the same duration as enter animation
|
|
125
|
+
*/
|
|
126
|
+
exitDuration?: number;
|
|
127
|
+
/**
|
|
128
|
+
* Easing function for exit animation
|
|
129
|
+
* If not specified, uses the same easing as enter animation
|
|
130
|
+
*/
|
|
131
|
+
exitEasing?: PuffPopEasing;
|
|
132
|
+
/**
|
|
133
|
+
* Delay before exit animation starts in milliseconds
|
|
134
|
+
* @default 0
|
|
135
|
+
*/
|
|
136
|
+
exitDelay?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Custom initial opacity value (0-1)
|
|
139
|
+
* Overrides the default initial opacity for the effect
|
|
140
|
+
*/
|
|
141
|
+
initialOpacity?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Custom initial scale value
|
|
144
|
+
* Overrides the default initial scale for effects like 'scale', 'zoom', 'bounce'
|
|
145
|
+
*/
|
|
146
|
+
initialScale?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Custom initial rotation value in degrees
|
|
149
|
+
* Overrides the default initial rotation for effects like 'rotate', 'rotateScale'
|
|
150
|
+
*/
|
|
151
|
+
initialRotate?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Custom initial translateX value in pixels
|
|
154
|
+
* Overrides the default initial translateX for effects like 'slideLeft', 'slideRight'
|
|
155
|
+
*/
|
|
156
|
+
initialTranslateX?: number;
|
|
157
|
+
/**
|
|
158
|
+
* Custom initial translateY value in pixels
|
|
159
|
+
* Overrides the default initial translateY for effects like 'slideUp', 'slideDown'
|
|
160
|
+
*/
|
|
161
|
+
initialTranslateY?: number;
|
|
162
|
+
/**
|
|
163
|
+
* If true, reverses the animation direction
|
|
164
|
+
* - slideUp becomes slide from top
|
|
165
|
+
* - slideLeft becomes slide from left
|
|
166
|
+
* - rotate spins clockwise instead of counter-clockwise
|
|
167
|
+
* @default false
|
|
168
|
+
*/
|
|
169
|
+
reverse?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Animation intensity multiplier (0-1)
|
|
172
|
+
* Controls how far/much elements move during animation
|
|
173
|
+
* - 1 = full animation (default)
|
|
174
|
+
* - 0.5 = half the movement distance
|
|
175
|
+
* - 0 = no movement (instant appear)
|
|
176
|
+
* @default 1
|
|
177
|
+
*/
|
|
178
|
+
intensity?: number;
|
|
179
|
+
/**
|
|
180
|
+
* Anchor point for scale/rotate transformations
|
|
181
|
+
* Determines the origin point of the transformation
|
|
182
|
+
* - 'center' = default center point
|
|
183
|
+
* - 'top', 'bottom', 'left', 'right' = edge centers
|
|
184
|
+
* - 'topLeft', 'topRight', 'bottomLeft', 'bottomRight' = corners
|
|
185
|
+
* @default 'center'
|
|
186
|
+
*/
|
|
187
|
+
anchorPoint?: PuffPopAnchorPoint;
|
|
188
|
+
/**
|
|
189
|
+
* Use spring physics-based animation instead of timing
|
|
190
|
+
* Provides more natural, bouncy animations
|
|
191
|
+
* @default false
|
|
192
|
+
*/
|
|
193
|
+
useSpring?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Spring animation configuration
|
|
196
|
+
* Only used when useSpring is true
|
|
197
|
+
*/
|
|
198
|
+
springConfig?: PuffPopSpringConfig;
|
|
86
199
|
}
|
|
87
200
|
/**
|
|
88
201
|
* PuffPop - Animate children with beautiful entrance effects
|
|
89
202
|
*/
|
|
90
|
-
|
|
203
|
+
declare function PuffPopComponent({ children, effect, duration, delay, easing, skeleton, visible, onAnimationComplete, onAnimationStart, style, animateOnMount, loop, loopDelay, respectReduceMotion, testID, exitEffect, exitDuration, exitEasing, exitDelay, initialOpacity, initialScale, initialRotate, initialTranslateX, initialTranslateY, reverse, intensity, anchorPoint, useSpring, springConfig, }: PuffPopProps): ReactElement;
|
|
204
|
+
export declare const PuffPop: import("react").MemoExoticComponent<typeof PuffPopComponent>;
|
|
91
205
|
/**
|
|
92
206
|
* Props for PuffPopGroup component
|
|
93
207
|
*/
|
|
@@ -175,6 +289,86 @@ export interface PuffPopGroupProps {
|
|
|
175
289
|
* Gap between children (uses flexbox gap)
|
|
176
290
|
*/
|
|
177
291
|
gap?: number;
|
|
292
|
+
/**
|
|
293
|
+
* Custom initial opacity value (0-1) for all children
|
|
294
|
+
*/
|
|
295
|
+
initialOpacity?: number;
|
|
296
|
+
/**
|
|
297
|
+
* Custom initial scale value for all children
|
|
298
|
+
*/
|
|
299
|
+
initialScale?: number;
|
|
300
|
+
/**
|
|
301
|
+
* Custom initial rotation value in degrees for all children
|
|
302
|
+
*/
|
|
303
|
+
initialRotate?: number;
|
|
304
|
+
/**
|
|
305
|
+
* Custom initial translateX value in pixels for all children
|
|
306
|
+
*/
|
|
307
|
+
initialTranslateX?: number;
|
|
308
|
+
/**
|
|
309
|
+
* Custom initial translateY value in pixels for all children
|
|
310
|
+
*/
|
|
311
|
+
initialTranslateY?: number;
|
|
312
|
+
/**
|
|
313
|
+
* If true, reverses the animation direction for all children
|
|
314
|
+
* @default false
|
|
315
|
+
*/
|
|
316
|
+
reverse?: boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Animation intensity multiplier (0-1) for all children
|
|
319
|
+
* Controls how far/much elements move during animation
|
|
320
|
+
* @default 1
|
|
321
|
+
*/
|
|
322
|
+
intensity?: number;
|
|
323
|
+
/**
|
|
324
|
+
* Anchor point for scale/rotate transformations for all children
|
|
325
|
+
* @default 'center'
|
|
326
|
+
*/
|
|
327
|
+
anchorPoint?: PuffPopAnchorPoint;
|
|
328
|
+
/**
|
|
329
|
+
* Use spring physics-based animation for all children
|
|
330
|
+
* @default false
|
|
331
|
+
*/
|
|
332
|
+
useSpring?: boolean;
|
|
333
|
+
/**
|
|
334
|
+
* Spring animation configuration for all children
|
|
335
|
+
*/
|
|
336
|
+
springConfig?: PuffPopSpringConfig;
|
|
337
|
+
/**
|
|
338
|
+
* Animation effect type when hiding (exit animation) for all children
|
|
339
|
+
* If not specified, uses the reverse of the enter effect
|
|
340
|
+
*/
|
|
341
|
+
exitEffect?: PuffPopEffect;
|
|
342
|
+
/**
|
|
343
|
+
* Animation duration for exit animation in milliseconds for all children
|
|
344
|
+
* If not specified, uses the same duration as enter animation
|
|
345
|
+
*/
|
|
346
|
+
exitDuration?: number;
|
|
347
|
+
/**
|
|
348
|
+
* Easing function for exit animation for all children
|
|
349
|
+
* If not specified, uses the same easing as enter animation
|
|
350
|
+
*/
|
|
351
|
+
exitEasing?: PuffPopEasing;
|
|
352
|
+
/**
|
|
353
|
+
* Delay before exit animation starts in milliseconds
|
|
354
|
+
* @default 0
|
|
355
|
+
*/
|
|
356
|
+
exitDelay?: number;
|
|
357
|
+
/**
|
|
358
|
+
* Delay between each child's exit animation start in milliseconds
|
|
359
|
+
* If not specified, all children exit simultaneously
|
|
360
|
+
* @default 0
|
|
361
|
+
*/
|
|
362
|
+
exitStaggerDelay?: number;
|
|
363
|
+
/**
|
|
364
|
+
* Direction of exit stagger animation
|
|
365
|
+
* - 'forward': First to last child
|
|
366
|
+
* - 'reverse': Last to first child (most natural for exit)
|
|
367
|
+
* - 'center': From center outward
|
|
368
|
+
* - 'edges': From edges toward center
|
|
369
|
+
* @default 'reverse'
|
|
370
|
+
*/
|
|
371
|
+
exitStaggerDirection?: 'forward' | 'reverse' | 'center' | 'edges';
|
|
178
372
|
}
|
|
179
373
|
/**
|
|
180
374
|
* PuffPopGroup - Animate multiple children with staggered entrance effects
|
|
@@ -188,5 +382,6 @@ export interface PuffPopGroupProps {
|
|
|
188
382
|
* </PuffPopGroup>
|
|
189
383
|
* ```
|
|
190
384
|
*/
|
|
191
|
-
|
|
385
|
+
declare function PuffPopGroupComponent({ children, effect, duration, staggerDelay, initialDelay, easing, skeleton, visible, animateOnMount, onAnimationComplete, onAnimationStart, style, respectReduceMotion, testID, staggerDirection, horizontal, gap, initialOpacity, initialScale, initialRotate, initialTranslateX, initialTranslateY, reverse, intensity, anchorPoint, useSpring, springConfig, exitEffect, exitDuration, exitEasing, exitDelay, exitStaggerDelay, exitStaggerDirection, }: PuffPopGroupProps): ReactElement;
|
|
386
|
+
export declare const PuffPopGroup: import("react").MemoExoticComponent<typeof PuffPopGroupComponent>;
|
|
192
387
|
export default PuffPop;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-puff-pop",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A React Native animation library for revealing children components with beautiful puff and pop effects",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|