@hoddy-ui/next 2.5.72 → 2.5.74
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/dist/index.d.mts +149 -1
- package/dist/index.d.ts +149 -1
- package/dist/index.js +548 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +584 -9
- package/dist/index.mjs.map +1 -1
- package/index.ts +3 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1524,9 +1524,9 @@ var TextField = ({
|
|
|
1524
1524
|
}) => {
|
|
1525
1525
|
const colors2 = useColors();
|
|
1526
1526
|
const [focused, setFocused] = useState7(false);
|
|
1527
|
-
const
|
|
1527
|
+
const height2 = moderateScale2(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
|
|
1528
1528
|
const labelAnim = useRef2(
|
|
1529
|
-
new Animated3.Value(
|
|
1529
|
+
new Animated3.Value(height2 / moderateScale2(variant === "text" ? 2.5 : 3.2))
|
|
1530
1530
|
).current;
|
|
1531
1531
|
React15.useEffect(() => {
|
|
1532
1532
|
if (focused || value) {
|
|
@@ -1537,7 +1537,7 @@ var TextField = ({
|
|
|
1537
1537
|
}).start();
|
|
1538
1538
|
} else {
|
|
1539
1539
|
Animated3.timing(labelAnim, {
|
|
1540
|
-
toValue:
|
|
1540
|
+
toValue: height2 / moderateScale2(variant === "text" ? 2.5 : 3.2),
|
|
1541
1541
|
duration: 300,
|
|
1542
1542
|
useNativeDriver: false
|
|
1543
1543
|
}).start();
|
|
@@ -1550,7 +1550,7 @@ var TextField = ({
|
|
|
1550
1550
|
...style
|
|
1551
1551
|
},
|
|
1552
1552
|
container: {
|
|
1553
|
-
height,
|
|
1553
|
+
height: height2,
|
|
1554
1554
|
overflow: "hidden",
|
|
1555
1555
|
backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[3] : colors2.white[4],
|
|
1556
1556
|
flexDirection: "row",
|
|
@@ -1754,7 +1754,7 @@ var TextField2 = React15.forwardRef(
|
|
|
1754
1754
|
const colors2 = useColors();
|
|
1755
1755
|
const [focused, _setFocused] = useState7(false);
|
|
1756
1756
|
const [showPassword, setShowPassword] = useState7(false);
|
|
1757
|
-
const
|
|
1757
|
+
const height2 = moderateScale2(
|
|
1758
1758
|
multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1759
1759
|
);
|
|
1760
1760
|
const setFocused = (value2) => {
|
|
@@ -1773,7 +1773,7 @@ var TextField2 = React15.forwardRef(
|
|
|
1773
1773
|
...style
|
|
1774
1774
|
},
|
|
1775
1775
|
container: {
|
|
1776
|
-
height,
|
|
1776
|
+
height: height2,
|
|
1777
1777
|
overflow: "hidden",
|
|
1778
1778
|
flexDirection: "row",
|
|
1779
1779
|
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[4],
|
|
@@ -2166,7 +2166,7 @@ import React18 from "react";
|
|
|
2166
2166
|
import { View as View13 } from "react-native";
|
|
2167
2167
|
import { ScaledSheet as ScaledSheet14, ms as ms8 } from "react-native-size-matters";
|
|
2168
2168
|
var Divider = ({
|
|
2169
|
-
height = 1,
|
|
2169
|
+
height: height2 = 1,
|
|
2170
2170
|
color = "textSecondary",
|
|
2171
2171
|
gutterBottom = 0,
|
|
2172
2172
|
style
|
|
@@ -2174,7 +2174,7 @@ var Divider = ({
|
|
|
2174
2174
|
const colors2 = useColors();
|
|
2175
2175
|
const styles = ScaledSheet14.create({
|
|
2176
2176
|
root: {
|
|
2177
|
-
height,
|
|
2177
|
+
height: height2,
|
|
2178
2178
|
backgroundColor: colors2[color].main,
|
|
2179
2179
|
marginBottom: ms8(gutterBottom),
|
|
2180
2180
|
...style
|
|
@@ -2305,6 +2305,572 @@ var OTPInput = ({
|
|
|
2305
2305
|
))));
|
|
2306
2306
|
};
|
|
2307
2307
|
|
|
2308
|
+
// ../src/Components/Animators/hooks/useAppState.ts
|
|
2309
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
2310
|
+
import { AppState, Platform as Platform6 } from "react-native";
|
|
2311
|
+
var useAppState = () => {
|
|
2312
|
+
const [isActive, setIsActive] = useState9(AppState.currentState === "active");
|
|
2313
|
+
useEffect6(() => {
|
|
2314
|
+
const handleAppStateChange = (nextAppState) => {
|
|
2315
|
+
setIsActive(nextAppState === "active");
|
|
2316
|
+
};
|
|
2317
|
+
let subscription;
|
|
2318
|
+
if (Platform6.OS === "android") {
|
|
2319
|
+
subscription = AppState.addEventListener("change", handleAppStateChange);
|
|
2320
|
+
} else {
|
|
2321
|
+
subscription = AppState.addEventListener("change", handleAppStateChange);
|
|
2322
|
+
}
|
|
2323
|
+
return () => {
|
|
2324
|
+
subscription?.remove();
|
|
2325
|
+
};
|
|
2326
|
+
}, []);
|
|
2327
|
+
return { isActive };
|
|
2328
|
+
};
|
|
2329
|
+
var useAppState_default = useAppState;
|
|
2330
|
+
|
|
2331
|
+
// ../src/Components/Animators/hooks/useBlinkAnimation.ts
|
|
2332
|
+
import { useEffect as useEffect7 } from "react";
|
|
2333
|
+
import { Platform as Platform7 } from "react-native";
|
|
2334
|
+
import {
|
|
2335
|
+
Easing,
|
|
2336
|
+
useAnimatedStyle as useAnimatedStyle3,
|
|
2337
|
+
useSharedValue as useSharedValue3,
|
|
2338
|
+
withRepeat,
|
|
2339
|
+
withSequence,
|
|
2340
|
+
withTiming as withTiming3
|
|
2341
|
+
} from "react-native-reanimated";
|
|
2342
|
+
var useBlinkAnimation = ({
|
|
2343
|
+
delay = 0,
|
|
2344
|
+
blinkDuration = 2e3,
|
|
2345
|
+
minOpacity = 0.5,
|
|
2346
|
+
maxOpacity = 1
|
|
2347
|
+
} = {}) => {
|
|
2348
|
+
const opacity = useSharedValue3(maxOpacity);
|
|
2349
|
+
const { isActive } = useAppState_default();
|
|
2350
|
+
const animatedStyle = useAnimatedStyle3(() => {
|
|
2351
|
+
return {
|
|
2352
|
+
opacity: opacity.value
|
|
2353
|
+
};
|
|
2354
|
+
});
|
|
2355
|
+
const startBlinking = () => {
|
|
2356
|
+
opacity.value = withRepeat(
|
|
2357
|
+
withSequence(
|
|
2358
|
+
withTiming3(minOpacity, {
|
|
2359
|
+
duration: blinkDuration / 2,
|
|
2360
|
+
easing: Easing.inOut(Easing.quad)
|
|
2361
|
+
}),
|
|
2362
|
+
withTiming3(maxOpacity, {
|
|
2363
|
+
duration: blinkDuration / 2,
|
|
2364
|
+
easing: Easing.inOut(Easing.quad)
|
|
2365
|
+
})
|
|
2366
|
+
),
|
|
2367
|
+
-1,
|
|
2368
|
+
false
|
|
2369
|
+
);
|
|
2370
|
+
};
|
|
2371
|
+
useEffect7(() => {
|
|
2372
|
+
if (!isActive && Platform7.OS === "ios") {
|
|
2373
|
+
opacity.value = maxOpacity;
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2376
|
+
if (delay > 0) {
|
|
2377
|
+
const timer = setTimeout(() => {
|
|
2378
|
+
startBlinking();
|
|
2379
|
+
}, delay);
|
|
2380
|
+
return () => {
|
|
2381
|
+
clearTimeout(timer);
|
|
2382
|
+
opacity.value = maxOpacity;
|
|
2383
|
+
};
|
|
2384
|
+
} else {
|
|
2385
|
+
startBlinking();
|
|
2386
|
+
}
|
|
2387
|
+
return () => {
|
|
2388
|
+
opacity.value = maxOpacity;
|
|
2389
|
+
};
|
|
2390
|
+
}, [delay, blinkDuration, minOpacity, maxOpacity, isActive]);
|
|
2391
|
+
return {
|
|
2392
|
+
animatedStyle
|
|
2393
|
+
};
|
|
2394
|
+
};
|
|
2395
|
+
|
|
2396
|
+
// ../src/Components/Animators/hooks/useFadeAnimation.ts
|
|
2397
|
+
import { useEffect as useEffect8 } from "react";
|
|
2398
|
+
import { Platform as Platform8 } from "react-native";
|
|
2399
|
+
import {
|
|
2400
|
+
useAnimatedStyle as useAnimatedStyle4,
|
|
2401
|
+
useSharedValue as useSharedValue4,
|
|
2402
|
+
withDelay,
|
|
2403
|
+
withTiming as withTiming4
|
|
2404
|
+
} from "react-native-reanimated";
|
|
2405
|
+
var useFadeAnimation = ({
|
|
2406
|
+
duration = 1e3,
|
|
2407
|
+
delay = 0,
|
|
2408
|
+
closeAfter = null
|
|
2409
|
+
} = {}) => {
|
|
2410
|
+
const opacity = useSharedValue4(0);
|
|
2411
|
+
const { isActive } = useAppState_default();
|
|
2412
|
+
const animatedStyle = useAnimatedStyle4(() => {
|
|
2413
|
+
return {
|
|
2414
|
+
opacity: opacity.value
|
|
2415
|
+
};
|
|
2416
|
+
});
|
|
2417
|
+
useEffect8(() => {
|
|
2418
|
+
if (!isActive && Platform8.OS === "ios") {
|
|
2419
|
+
opacity.value = 0;
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
2422
|
+
opacity.value = withDelay(
|
|
2423
|
+
delay,
|
|
2424
|
+
withTiming4(1, { duration }, () => {
|
|
2425
|
+
if (closeAfter) {
|
|
2426
|
+
opacity.value = withDelay(closeAfter, withTiming4(0, { duration }));
|
|
2427
|
+
}
|
|
2428
|
+
})
|
|
2429
|
+
);
|
|
2430
|
+
}, [opacity, duration, delay, closeAfter, isActive]);
|
|
2431
|
+
return {
|
|
2432
|
+
animatedStyle
|
|
2433
|
+
};
|
|
2434
|
+
};
|
|
2435
|
+
|
|
2436
|
+
// ../src/Components/Animators/hooks/useFloatAnimation.ts
|
|
2437
|
+
import { useEffect as useEffect9, useRef as useRef3 } from "react";
|
|
2438
|
+
import { Platform as Platform9 } from "react-native";
|
|
2439
|
+
import {
|
|
2440
|
+
Easing as Easing2,
|
|
2441
|
+
runOnJS as runOnJS3,
|
|
2442
|
+
useAnimatedStyle as useAnimatedStyle5,
|
|
2443
|
+
useSharedValue as useSharedValue5,
|
|
2444
|
+
withDelay as withDelay2,
|
|
2445
|
+
withRepeat as withRepeat2,
|
|
2446
|
+
withSequence as withSequence2,
|
|
2447
|
+
withTiming as withTiming5
|
|
2448
|
+
} from "react-native-reanimated";
|
|
2449
|
+
var useFloatAnimation = ({
|
|
2450
|
+
duration = 800,
|
|
2451
|
+
delay = 0,
|
|
2452
|
+
closeAfter = null,
|
|
2453
|
+
closeDuration = 600,
|
|
2454
|
+
floatDistance = 10,
|
|
2455
|
+
floatDuration = 1200
|
|
2456
|
+
} = {}) => {
|
|
2457
|
+
const opacity = useSharedValue5(0);
|
|
2458
|
+
const translateY = useSharedValue5(0);
|
|
2459
|
+
const { isActive } = useAppState_default();
|
|
2460
|
+
const isFloating = useRef3(false);
|
|
2461
|
+
const animatedStyle = useAnimatedStyle5(() => {
|
|
2462
|
+
return {
|
|
2463
|
+
opacity: opacity.value,
|
|
2464
|
+
transform: [{ translateY: translateY.value }]
|
|
2465
|
+
};
|
|
2466
|
+
});
|
|
2467
|
+
const startFloating = () => {
|
|
2468
|
+
if (!isFloating.current) {
|
|
2469
|
+
isFloating.current = true;
|
|
2470
|
+
translateY.value = withRepeat2(
|
|
2471
|
+
withSequence2(
|
|
2472
|
+
withTiming5(-floatDistance, {
|
|
2473
|
+
duration: floatDuration / 2,
|
|
2474
|
+
easing: Easing2.inOut(Easing2.quad)
|
|
2475
|
+
}),
|
|
2476
|
+
withTiming5(floatDistance, {
|
|
2477
|
+
duration: floatDuration,
|
|
2478
|
+
easing: Easing2.inOut(Easing2.quad)
|
|
2479
|
+
}),
|
|
2480
|
+
withTiming5(0, {
|
|
2481
|
+
duration: floatDuration / 2,
|
|
2482
|
+
easing: Easing2.inOut(Easing2.quad)
|
|
2483
|
+
})
|
|
2484
|
+
),
|
|
2485
|
+
-1,
|
|
2486
|
+
false
|
|
2487
|
+
);
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
useEffect9(() => {
|
|
2491
|
+
if (!isActive && Platform9.OS === "ios") {
|
|
2492
|
+
opacity.value = 0;
|
|
2493
|
+
translateY.value = 0;
|
|
2494
|
+
isFloating.current = false;
|
|
2495
|
+
return;
|
|
2496
|
+
}
|
|
2497
|
+
opacity.value = withDelay2(
|
|
2498
|
+
delay,
|
|
2499
|
+
withTiming5(1, { duration }, () => {
|
|
2500
|
+
"worklet";
|
|
2501
|
+
runOnJS3(startFloating)();
|
|
2502
|
+
})
|
|
2503
|
+
);
|
|
2504
|
+
if (closeAfter) {
|
|
2505
|
+
const totalDelay = delay + duration + closeAfter;
|
|
2506
|
+
opacity.value = withDelay2(
|
|
2507
|
+
totalDelay,
|
|
2508
|
+
withTiming5(0, { duration: closeDuration })
|
|
2509
|
+
);
|
|
2510
|
+
translateY.value = withDelay2(
|
|
2511
|
+
totalDelay,
|
|
2512
|
+
withTiming5(0, { duration: closeDuration })
|
|
2513
|
+
);
|
|
2514
|
+
}
|
|
2515
|
+
return () => {
|
|
2516
|
+
opacity.value = 0;
|
|
2517
|
+
translateY.value = 0;
|
|
2518
|
+
isFloating.current = false;
|
|
2519
|
+
};
|
|
2520
|
+
}, [
|
|
2521
|
+
duration,
|
|
2522
|
+
delay,
|
|
2523
|
+
closeAfter,
|
|
2524
|
+
closeDuration,
|
|
2525
|
+
floatDistance,
|
|
2526
|
+
floatDuration,
|
|
2527
|
+
isActive
|
|
2528
|
+
]);
|
|
2529
|
+
return {
|
|
2530
|
+
animatedStyle
|
|
2531
|
+
};
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2534
|
+
// ../src/Components/Animators/hooks/useGrowAnimation.ts
|
|
2535
|
+
import { useEffect as useEffect10 } from "react";
|
|
2536
|
+
import { Platform as Platform10 } from "react-native";
|
|
2537
|
+
import {
|
|
2538
|
+
Easing as Easing3,
|
|
2539
|
+
useAnimatedStyle as useAnimatedStyle6,
|
|
2540
|
+
useSharedValue as useSharedValue6,
|
|
2541
|
+
withDelay as withDelay3,
|
|
2542
|
+
withTiming as withTiming6
|
|
2543
|
+
} from "react-native-reanimated";
|
|
2544
|
+
var useGrowAnimation = ({
|
|
2545
|
+
duration = 500,
|
|
2546
|
+
delay = 0,
|
|
2547
|
+
closeAfter = null,
|
|
2548
|
+
initialScale = 0
|
|
2549
|
+
} = {}) => {
|
|
2550
|
+
const scale = useSharedValue6(initialScale);
|
|
2551
|
+
const { isActive } = useAppState_default();
|
|
2552
|
+
const animatedStyle = useAnimatedStyle6(() => {
|
|
2553
|
+
return {
|
|
2554
|
+
transform: [{ scale: scale.value }]
|
|
2555
|
+
};
|
|
2556
|
+
});
|
|
2557
|
+
useEffect10(() => {
|
|
2558
|
+
if (!isActive && Platform10.OS === "ios") {
|
|
2559
|
+
scale.value = initialScale;
|
|
2560
|
+
return;
|
|
2561
|
+
}
|
|
2562
|
+
scale.value = withDelay3(
|
|
2563
|
+
delay,
|
|
2564
|
+
withTiming6(
|
|
2565
|
+
1,
|
|
2566
|
+
{
|
|
2567
|
+
duration,
|
|
2568
|
+
easing: Easing3.out(Easing3.ease)
|
|
2569
|
+
},
|
|
2570
|
+
() => {
|
|
2571
|
+
if (closeAfter) {
|
|
2572
|
+
scale.value = withDelay3(
|
|
2573
|
+
closeAfter,
|
|
2574
|
+
withTiming6(initialScale, {
|
|
2575
|
+
duration,
|
|
2576
|
+
easing: Easing3.out(Easing3.ease)
|
|
2577
|
+
})
|
|
2578
|
+
);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
)
|
|
2582
|
+
);
|
|
2583
|
+
}, [scale, duration, delay, closeAfter, initialScale, isActive]);
|
|
2584
|
+
return {
|
|
2585
|
+
animatedStyle
|
|
2586
|
+
};
|
|
2587
|
+
};
|
|
2588
|
+
|
|
2589
|
+
// ../src/Components/Animators/hooks/useRollAnimation.ts
|
|
2590
|
+
import { useEffect as useEffect11 } from "react";
|
|
2591
|
+
import { Platform as Platform11 } from "react-native";
|
|
2592
|
+
import {
|
|
2593
|
+
Easing as Easing4,
|
|
2594
|
+
interpolate,
|
|
2595
|
+
useAnimatedStyle as useAnimatedStyle7,
|
|
2596
|
+
useSharedValue as useSharedValue7,
|
|
2597
|
+
withDelay as withDelay4,
|
|
2598
|
+
withTiming as withTiming7
|
|
2599
|
+
} from "react-native-reanimated";
|
|
2600
|
+
var useRollAnimation = ({
|
|
2601
|
+
duration = 500,
|
|
2602
|
+
delay = 0,
|
|
2603
|
+
closeAfter = null,
|
|
2604
|
+
initialTranslateY = 100,
|
|
2605
|
+
initialRotate = "0deg"
|
|
2606
|
+
} = {}) => {
|
|
2607
|
+
const translateY = useSharedValue7(initialTranslateY);
|
|
2608
|
+
const rotate = useSharedValue7(0);
|
|
2609
|
+
const { isActive } = useAppState_default();
|
|
2610
|
+
const animatedStyle = useAnimatedStyle7(() => {
|
|
2611
|
+
const rotateInterpolated = interpolate(
|
|
2612
|
+
rotate.value,
|
|
2613
|
+
[0, 1],
|
|
2614
|
+
[parseFloat(initialRotate.replace("deg", "")), 360]
|
|
2615
|
+
);
|
|
2616
|
+
return {
|
|
2617
|
+
transform: [
|
|
2618
|
+
{ translateY: translateY.value },
|
|
2619
|
+
{ rotate: `${rotateInterpolated}deg` }
|
|
2620
|
+
]
|
|
2621
|
+
};
|
|
2622
|
+
});
|
|
2623
|
+
useEffect11(() => {
|
|
2624
|
+
if (!isActive && Platform11.OS === "ios") {
|
|
2625
|
+
translateY.value = initialTranslateY;
|
|
2626
|
+
rotate.value = 0;
|
|
2627
|
+
return;
|
|
2628
|
+
}
|
|
2629
|
+
translateY.value = withDelay4(
|
|
2630
|
+
delay,
|
|
2631
|
+
withTiming7(0, {
|
|
2632
|
+
duration,
|
|
2633
|
+
easing: Easing4.out(Easing4.ease)
|
|
2634
|
+
})
|
|
2635
|
+
);
|
|
2636
|
+
rotate.value = withDelay4(
|
|
2637
|
+
delay,
|
|
2638
|
+
withTiming7(
|
|
2639
|
+
1,
|
|
2640
|
+
{
|
|
2641
|
+
duration,
|
|
2642
|
+
easing: Easing4.out(Easing4.ease)
|
|
2643
|
+
},
|
|
2644
|
+
() => {
|
|
2645
|
+
if (closeAfter) {
|
|
2646
|
+
translateY.value = withDelay4(
|
|
2647
|
+
closeAfter,
|
|
2648
|
+
withTiming7(initialTranslateY, {
|
|
2649
|
+
duration,
|
|
2650
|
+
easing: Easing4.out(Easing4.ease)
|
|
2651
|
+
})
|
|
2652
|
+
);
|
|
2653
|
+
rotate.value = withDelay4(
|
|
2654
|
+
closeAfter,
|
|
2655
|
+
withTiming7(0, {
|
|
2656
|
+
duration,
|
|
2657
|
+
easing: Easing4.out(Easing4.ease)
|
|
2658
|
+
})
|
|
2659
|
+
);
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
)
|
|
2663
|
+
);
|
|
2664
|
+
}, [
|
|
2665
|
+
translateY,
|
|
2666
|
+
rotate,
|
|
2667
|
+
duration,
|
|
2668
|
+
delay,
|
|
2669
|
+
closeAfter,
|
|
2670
|
+
initialTranslateY,
|
|
2671
|
+
initialRotate,
|
|
2672
|
+
isActive
|
|
2673
|
+
]);
|
|
2674
|
+
return {
|
|
2675
|
+
animatedStyle
|
|
2676
|
+
};
|
|
2677
|
+
};
|
|
2678
|
+
|
|
2679
|
+
// ../src/Components/Animators/hooks/useSlideAnimation.ts
|
|
2680
|
+
import { useEffect as useEffect12 } from "react";
|
|
2681
|
+
import { Dimensions as Dimensions3, Platform as Platform12 } from "react-native";
|
|
2682
|
+
import {
|
|
2683
|
+
Easing as Easing5,
|
|
2684
|
+
useAnimatedStyle as useAnimatedStyle8,
|
|
2685
|
+
useSharedValue as useSharedValue8,
|
|
2686
|
+
withDelay as withDelay5,
|
|
2687
|
+
withTiming as withTiming8
|
|
2688
|
+
} from "react-native-reanimated";
|
|
2689
|
+
var { width, height } = Dimensions3.get("window");
|
|
2690
|
+
var getInitialPosition = (direction) => {
|
|
2691
|
+
switch (direction) {
|
|
2692
|
+
case "up":
|
|
2693
|
+
return height;
|
|
2694
|
+
case "down":
|
|
2695
|
+
return -height;
|
|
2696
|
+
case "left":
|
|
2697
|
+
return width;
|
|
2698
|
+
case "right":
|
|
2699
|
+
return -width;
|
|
2700
|
+
default:
|
|
2701
|
+
return 0;
|
|
2702
|
+
}
|
|
2703
|
+
};
|
|
2704
|
+
var useSlideAnimation = ({
|
|
2705
|
+
duration = 1e3,
|
|
2706
|
+
delay = 0,
|
|
2707
|
+
direction = "up",
|
|
2708
|
+
closeAfter,
|
|
2709
|
+
initialValue
|
|
2710
|
+
} = {}) => {
|
|
2711
|
+
const translateValue = useSharedValue8(0);
|
|
2712
|
+
const { isActive } = useAppState_default();
|
|
2713
|
+
const animatedStyle = useAnimatedStyle8(() => {
|
|
2714
|
+
const slideStyle = direction === "up" || direction === "down" ? { transform: [{ translateY: translateValue.value }] } : { transform: [{ translateX: translateValue.value }] };
|
|
2715
|
+
return slideStyle;
|
|
2716
|
+
});
|
|
2717
|
+
useEffect12(() => {
|
|
2718
|
+
if (!isActive && Platform12.OS === "ios") {
|
|
2719
|
+
const initialPosition2 = initialValue || getInitialPosition(direction);
|
|
2720
|
+
translateValue.value = initialPosition2;
|
|
2721
|
+
return;
|
|
2722
|
+
}
|
|
2723
|
+
const initialPosition = initialValue || getInitialPosition(direction);
|
|
2724
|
+
translateValue.value = initialPosition;
|
|
2725
|
+
translateValue.value = withDelay5(
|
|
2726
|
+
delay,
|
|
2727
|
+
withTiming8(0, {
|
|
2728
|
+
duration,
|
|
2729
|
+
easing: Easing5.out(Easing5.ease)
|
|
2730
|
+
})
|
|
2731
|
+
);
|
|
2732
|
+
if (closeAfter) {
|
|
2733
|
+
translateValue.value = withDelay5(
|
|
2734
|
+
closeAfter + duration + delay,
|
|
2735
|
+
withTiming8(initialPosition, {
|
|
2736
|
+
duration,
|
|
2737
|
+
easing: Easing5.out(Easing5.ease)
|
|
2738
|
+
})
|
|
2739
|
+
);
|
|
2740
|
+
}
|
|
2741
|
+
}, [
|
|
2742
|
+
translateValue,
|
|
2743
|
+
duration,
|
|
2744
|
+
delay,
|
|
2745
|
+
direction,
|
|
2746
|
+
closeAfter,
|
|
2747
|
+
initialValue,
|
|
2748
|
+
isActive
|
|
2749
|
+
]);
|
|
2750
|
+
return {
|
|
2751
|
+
animatedStyle
|
|
2752
|
+
};
|
|
2753
|
+
};
|
|
2754
|
+
|
|
2755
|
+
// ../src/Components/Animators/hooks/useThrownUpAnimation.ts
|
|
2756
|
+
import { useEffect as useEffect13, useRef as useRef4 } from "react";
|
|
2757
|
+
import { Platform as Platform13 } from "react-native";
|
|
2758
|
+
import {
|
|
2759
|
+
useAnimatedStyle as useAnimatedStyle9,
|
|
2760
|
+
useSharedValue as useSharedValue9,
|
|
2761
|
+
withDelay as withDelay6,
|
|
2762
|
+
withSpring,
|
|
2763
|
+
withTiming as withTiming9
|
|
2764
|
+
} from "react-native-reanimated";
|
|
2765
|
+
var useThrownUpAnimation = ({
|
|
2766
|
+
delay = 0,
|
|
2767
|
+
closeAfter = null
|
|
2768
|
+
} = {}) => {
|
|
2769
|
+
const translateY = useSharedValue9(600);
|
|
2770
|
+
const opacity = useSharedValue9(0);
|
|
2771
|
+
const isUnmounting = useRef4(false);
|
|
2772
|
+
const { isActive } = useAppState_default();
|
|
2773
|
+
const animatedStyle = useAnimatedStyle9(() => {
|
|
2774
|
+
return {
|
|
2775
|
+
transform: [{ translateY: translateY.value }],
|
|
2776
|
+
opacity: opacity.value
|
|
2777
|
+
};
|
|
2778
|
+
});
|
|
2779
|
+
useEffect13(() => {
|
|
2780
|
+
if (!isActive && Platform13.OS === "ios") {
|
|
2781
|
+
translateY.value = 600;
|
|
2782
|
+
opacity.value = 0;
|
|
2783
|
+
return;
|
|
2784
|
+
}
|
|
2785
|
+
translateY.value = withDelay6(
|
|
2786
|
+
delay,
|
|
2787
|
+
withSpring(0, {
|
|
2788
|
+
velocity: 1,
|
|
2789
|
+
stiffness: 100,
|
|
2790
|
+
damping: 15
|
|
2791
|
+
})
|
|
2792
|
+
);
|
|
2793
|
+
opacity.value = withDelay6(delay, withTiming9(1, { duration: 500 }));
|
|
2794
|
+
if (closeAfter) {
|
|
2795
|
+
translateY.value = withDelay6(
|
|
2796
|
+
closeAfter,
|
|
2797
|
+
withSpring(800, {
|
|
2798
|
+
velocity: 1,
|
|
2799
|
+
stiffness: 200,
|
|
2800
|
+
damping: 20
|
|
2801
|
+
})
|
|
2802
|
+
);
|
|
2803
|
+
opacity.value = withDelay6(closeAfter, withTiming9(0, { duration: 500 }));
|
|
2804
|
+
}
|
|
2805
|
+
return () => {
|
|
2806
|
+
translateY.value = 600;
|
|
2807
|
+
opacity.value = 0;
|
|
2808
|
+
isUnmounting.current = true;
|
|
2809
|
+
};
|
|
2810
|
+
}, [translateY, opacity, delay, closeAfter, isActive]);
|
|
2811
|
+
return {
|
|
2812
|
+
animatedStyle
|
|
2813
|
+
};
|
|
2814
|
+
};
|
|
2815
|
+
|
|
2816
|
+
// ../src/Components/Animators/Animator.tsx
|
|
2817
|
+
import React21 from "react";
|
|
2818
|
+
import Animated4 from "react-native-reanimated";
|
|
2819
|
+
var Animator = (props) => {
|
|
2820
|
+
const { children, type, duration, delay, closeAfter, style = {} } = props;
|
|
2821
|
+
const getAnimationStyle = () => {
|
|
2822
|
+
switch (type) {
|
|
2823
|
+
case "fade":
|
|
2824
|
+
return useFadeAnimation({ duration, delay, closeAfter });
|
|
2825
|
+
case "grow":
|
|
2826
|
+
return useGrowAnimation({
|
|
2827
|
+
duration,
|
|
2828
|
+
delay,
|
|
2829
|
+
closeAfter,
|
|
2830
|
+
initialScale: props.initialScale
|
|
2831
|
+
});
|
|
2832
|
+
case "slide":
|
|
2833
|
+
return useSlideAnimation({
|
|
2834
|
+
duration,
|
|
2835
|
+
delay,
|
|
2836
|
+
direction: props.direction,
|
|
2837
|
+
closeAfter,
|
|
2838
|
+
initialValue: props.initialValue
|
|
2839
|
+
});
|
|
2840
|
+
case "blink":
|
|
2841
|
+
return useBlinkAnimation({
|
|
2842
|
+
delay,
|
|
2843
|
+
blinkDuration: props.blinkDuration,
|
|
2844
|
+
minOpacity: props.minOpacity,
|
|
2845
|
+
maxOpacity: props.maxOpacity
|
|
2846
|
+
});
|
|
2847
|
+
case "float":
|
|
2848
|
+
return useFloatAnimation({
|
|
2849
|
+
duration,
|
|
2850
|
+
delay,
|
|
2851
|
+
closeAfter,
|
|
2852
|
+
closeDuration: props.closeDuration,
|
|
2853
|
+
floatDistance: props.floatDistance,
|
|
2854
|
+
floatDuration: props.floatDuration
|
|
2855
|
+
});
|
|
2856
|
+
case "roll":
|
|
2857
|
+
return useRollAnimation({
|
|
2858
|
+
duration,
|
|
2859
|
+
delay,
|
|
2860
|
+
closeAfter,
|
|
2861
|
+
initialTranslateY: props.initialTranslateY,
|
|
2862
|
+
initialRotate: props.initialRotate
|
|
2863
|
+
});
|
|
2864
|
+
case "thrownup":
|
|
2865
|
+
return useThrownUpAnimation({ delay, closeAfter });
|
|
2866
|
+
default:
|
|
2867
|
+
return { animatedStyle: {} };
|
|
2868
|
+
}
|
|
2869
|
+
};
|
|
2870
|
+
const { animatedStyle } = getAnimationStyle();
|
|
2871
|
+
return /* @__PURE__ */ React21.createElement(Animated4.View, { style: [style, animatedStyle] }, children);
|
|
2872
|
+
};
|
|
2873
|
+
|
|
2308
2874
|
// index.ts
|
|
2309
2875
|
var HoddyUI = {
|
|
2310
2876
|
initialize
|
|
@@ -2313,6 +2879,7 @@ var next_default = HoddyUI;
|
|
|
2313
2879
|
export {
|
|
2314
2880
|
AdaptiveStatusBarNext_default as AdaptiveStatusBar,
|
|
2315
2881
|
AlertX_default as AlertX,
|
|
2882
|
+
Animator,
|
|
2316
2883
|
Avatar_default as Avatar,
|
|
2317
2884
|
Button_default as Button,
|
|
2318
2885
|
CheckBox,
|
|
@@ -2340,9 +2907,17 @@ export {
|
|
|
2340
2907
|
getPredictionsFromCoords,
|
|
2341
2908
|
getPredictionsFromQuery,
|
|
2342
2909
|
showFlashMessage,
|
|
2910
|
+
useAppState_default as useAppState,
|
|
2911
|
+
useBlinkAnimation,
|
|
2343
2912
|
useColors,
|
|
2913
|
+
useFadeAnimation,
|
|
2914
|
+
useFloatAnimation,
|
|
2915
|
+
useGrowAnimation,
|
|
2344
2916
|
useNavScreenOptions,
|
|
2917
|
+
useRollAnimation,
|
|
2918
|
+
useSlideAnimation,
|
|
2345
2919
|
useTheme,
|
|
2346
|
-
useThemeContext
|
|
2920
|
+
useThemeContext,
|
|
2921
|
+
useThrownUpAnimation
|
|
2347
2922
|
};
|
|
2348
2923
|
//# sourceMappingURL=index.mjs.map
|