react-native-puff-pop 1.0.7 â 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 +138 -1
- package/lib/module/index.js +319 -39
- package/lib/typescript/src/index.d.ts +85 -3
- package/package.json +1 -1
- package/src/index.tsx +488 -47
package/README.md
CHANGED
|
@@ -15,11 +15,13 @@ Works with both **React Native CLI** and **Expo** projects - no native dependenc
|
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- ðŽ **
|
|
18
|
+
- ðŽ **16 Animation Effects**: scale, rotate, fade, slideUp/Down/Left/Right, bounce, flip, zoom, rotateScale, shake, pulse, swing, wobble, elastic
|
|
19
19
|
- ðŊ **Exit Animations**: Different effects for enter and exit animations
|
|
20
20
|
- ð **Reverse Mode**: Reverse animation direction with a single prop
|
|
21
21
|
- ðïļ **Custom Initial Values**: Fine-tune starting opacity, scale, rotation, and position
|
|
22
22
|
- ð **Animation Intensity**: Control how dramatic your animations are (0-1)
|
|
23
|
+
- ð **Anchor Point**: Set transform origin for scale/rotate (top, bottom, corners, etc.)
|
|
24
|
+
- ð§ē **Spring Physics**: Use physics-based spring animations with customizable tension/friction
|
|
23
25
|
- ðĶī **Skeleton Mode**: Reserve space before animation or expand from zero height
|
|
24
26
|
- ⥠**Native Driver Support**: Smooth 60fps animations
|
|
25
27
|
- ðŊ **Easy to Use**: Just wrap your components with `<PuffPop>`
|
|
@@ -240,6 +242,43 @@ With `PuffPopGroup`:
|
|
|
240
242
|
</PuffPopGroup>
|
|
241
243
|
```
|
|
242
244
|
|
|
245
|
+
### Exit Stagger Animation
|
|
246
|
+
|
|
247
|
+
Stagger the exit animation of group children:
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
// Children exit one by one in reverse order (last first)
|
|
251
|
+
<PuffPopGroup
|
|
252
|
+
staggerDelay={50}
|
|
253
|
+
exitStaggerDelay={50}
|
|
254
|
+
exitStaggerDirection="reverse"
|
|
255
|
+
visible={isVisible}
|
|
256
|
+
>
|
|
257
|
+
<ListItem />
|
|
258
|
+
<ListItem />
|
|
259
|
+
<ListItem />
|
|
260
|
+
</PuffPopGroup>
|
|
261
|
+
|
|
262
|
+
// Children exit from center outward
|
|
263
|
+
<PuffPopGroup
|
|
264
|
+
exitStaggerDelay={30}
|
|
265
|
+
exitStaggerDirection="center"
|
|
266
|
+
visible={isVisible}
|
|
267
|
+
>
|
|
268
|
+
<MenuItem />
|
|
269
|
+
<MenuItem />
|
|
270
|
+
<MenuItem />
|
|
271
|
+
<MenuItem />
|
|
272
|
+
<MenuItem />
|
|
273
|
+
</PuffPopGroup>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Exit stagger directions:
|
|
277
|
+
- `forward`: First child exits first
|
|
278
|
+
- `reverse`: Last child exits first (default, LIFO)
|
|
279
|
+
- `center`: Center children exit first
|
|
280
|
+
- `edges`: Edge children exit first
|
|
281
|
+
|
|
243
282
|
### Custom Initial Values
|
|
244
283
|
|
|
245
284
|
Fine-tune the starting values of your animations:
|
|
@@ -352,6 +391,91 @@ With `PuffPopGroup`:
|
|
|
352
391
|
</PuffPopGroup>
|
|
353
392
|
```
|
|
354
393
|
|
|
394
|
+
### Anchor Point
|
|
395
|
+
|
|
396
|
+
Set the transform origin for scale/rotate animations:
|
|
397
|
+
|
|
398
|
+
```tsx
|
|
399
|
+
// Scale from top (expands downward)
|
|
400
|
+
<PuffPop effect="scale" anchorPoint="top">
|
|
401
|
+
<DropdownMenu />
|
|
402
|
+
</PuffPop>
|
|
403
|
+
|
|
404
|
+
// Scale from bottom-left corner
|
|
405
|
+
<PuffPop effect="scale" anchorPoint="bottomLeft">
|
|
406
|
+
<Tooltip />
|
|
407
|
+
</PuffPop>
|
|
408
|
+
|
|
409
|
+
// Rotate from top-left (door-opening effect)
|
|
410
|
+
<PuffPop effect="rotate" anchorPoint="topLeft">
|
|
411
|
+
<Panel />
|
|
412
|
+
</PuffPop>
|
|
413
|
+
|
|
414
|
+
// Flip from right edge
|
|
415
|
+
<PuffPop effect="flip" anchorPoint="right">
|
|
416
|
+
<Card />
|
|
417
|
+
</PuffPop>
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Available anchor points:
|
|
421
|
+
|
|
422
|
+
| Value | Description |
|
|
423
|
+
|-------|-------------|
|
|
424
|
+
| `center` | Default center point |
|
|
425
|
+
| `top` | Top center |
|
|
426
|
+
| `bottom` | Bottom center |
|
|
427
|
+
| `left` | Left center |
|
|
428
|
+
| `right` | Right center |
|
|
429
|
+
| `topLeft` | Top-left corner |
|
|
430
|
+
| `topRight` | Top-right corner |
|
|
431
|
+
| `bottomLeft` | Bottom-left corner |
|
|
432
|
+
| `bottomRight` | Bottom-right corner |
|
|
433
|
+
|
|
434
|
+
### Spring Animation
|
|
435
|
+
|
|
436
|
+
Use physics-based spring animations for more natural, bouncy effects:
|
|
437
|
+
|
|
438
|
+
```tsx
|
|
439
|
+
// Enable spring animation
|
|
440
|
+
<PuffPop effect="scale" useSpring>
|
|
441
|
+
<Card />
|
|
442
|
+
</PuffPop>
|
|
443
|
+
|
|
444
|
+
// Customize spring physics
|
|
445
|
+
<PuffPop
|
|
446
|
+
effect="slideUp"
|
|
447
|
+
useSpring
|
|
448
|
+
springConfig={{
|
|
449
|
+
tension: 150, // Higher = faster, snappier
|
|
450
|
+
friction: 8, // Higher = less bouncy
|
|
451
|
+
}}
|
|
452
|
+
>
|
|
453
|
+
<Modal />
|
|
454
|
+
</PuffPop>
|
|
455
|
+
|
|
456
|
+
// Very bouncy spring
|
|
457
|
+
<PuffPop
|
|
458
|
+
effect="scale"
|
|
459
|
+
useSpring
|
|
460
|
+
springConfig={{
|
|
461
|
+
tension: 200,
|
|
462
|
+
friction: 5,
|
|
463
|
+
bounciness: 12,
|
|
464
|
+
}}
|
|
465
|
+
>
|
|
466
|
+
<Button />
|
|
467
|
+
</PuffPop>
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Spring config options:
|
|
471
|
+
|
|
472
|
+
| Option | Default | Description |
|
|
473
|
+
|--------|---------|-------------|
|
|
474
|
+
| `tension` | `100` | Spring stiffness (higher = faster) |
|
|
475
|
+
| `friction` | `10` | Damping (higher = less oscillation) |
|
|
476
|
+
| `speed` | `12` | Animation speed multiplier |
|
|
477
|
+
| `bounciness` | `8` | Bounce amount (higher = more bouncy) |
|
|
478
|
+
|
|
355
479
|
## Props
|
|
356
480
|
|
|
357
481
|
| Prop | Type | Default | Description |
|
|
@@ -382,6 +506,9 @@ With `PuffPopGroup`:
|
|
|
382
506
|
| `initialTranslateY` | `number` | - | Custom initial Y translation in pixels |
|
|
383
507
|
| `reverse` | `boolean` | `false` | Reverse animation direction |
|
|
384
508
|
| `intensity` | `number` | `1` | Animation intensity multiplier (0-1) |
|
|
509
|
+
| `anchorPoint` | `PuffPopAnchorPoint` | `'center'` | Transform origin for scale/rotate |
|
|
510
|
+
| `useSpring` | `boolean` | `false` | Use physics-based spring animation |
|
|
511
|
+
| `springConfig` | `PuffPopSpringConfig` | - | Spring animation settings (tension, friction, etc.) |
|
|
385
512
|
|
|
386
513
|
### PuffPopGroup Props
|
|
387
514
|
|
|
@@ -415,6 +542,11 @@ With `PuffPopGroup`:
|
|
|
415
542
|
| `initialTranslateY` | `number` | - | Custom initial Y translation for all children |
|
|
416
543
|
| `reverse` | `boolean` | `false` | Reverse animation direction for all children |
|
|
417
544
|
| `intensity` | `number` | `1` | Animation intensity multiplier for all children |
|
|
545
|
+
| `anchorPoint` | `PuffPopAnchorPoint` | `'center'` | Transform origin for all children |
|
|
546
|
+
| `useSpring` | `boolean` | `false` | Use spring animation for all children |
|
|
547
|
+
| `springConfig` | `PuffPopSpringConfig` | - | Spring settings for all children |
|
|
548
|
+
| `exitStaggerDelay` | `number` | `0` | Delay between each child's exit animation |
|
|
549
|
+
| `exitStaggerDirection` | `'forward' \| 'reverse' \| 'center' \| 'edges'` | `'reverse'` | Direction of exit stagger |
|
|
418
550
|
|
|
419
551
|
### Animation Effects (`PuffPopEffect`)
|
|
420
552
|
|
|
@@ -431,6 +563,11 @@ With `PuffPopGroup`:
|
|
|
431
563
|
| `flip` | 3D flip effect |
|
|
432
564
|
| `zoom` | Zoom with slight overshoot |
|
|
433
565
|
| `rotateScale` | Rotate + Scale combined |
|
|
566
|
+
| `shake` | Shake left-right (for alerts, errors) |
|
|
567
|
+
| `pulse` | Pulse heartbeat effect (for emphasis) |
|
|
568
|
+
| `swing` | Swing like pendulum (for menus) |
|
|
569
|
+
| `wobble` | Wobble with tilt (playful entrance) |
|
|
570
|
+
| `elastic` | Elastic stretch effect (springy feel) |
|
|
434
571
|
|
|
435
572
|
### Easing Types (`PuffPopEasing`)
|
|
436
573
|
|