@hoddy-ui/next 2.5.72 → 2.5.73
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 +547 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +582 -9
- package/dist/index.mjs.map +1 -1
- package/index.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var next_exports = {};
|
|
|
32
32
|
__export(next_exports, {
|
|
33
33
|
AdaptiveStatusBar: () => AdaptiveStatusBarNext_default,
|
|
34
34
|
AlertX: () => AlertX_default,
|
|
35
|
+
Animator: () => Animator,
|
|
35
36
|
Avatar: () => Avatar_default,
|
|
36
37
|
Button: () => Button_default,
|
|
37
38
|
CheckBox: () => CheckBox,
|
|
@@ -59,10 +60,18 @@ __export(next_exports, {
|
|
|
59
60
|
getPredictionsFromCoords: () => getPredictionsFromCoords,
|
|
60
61
|
getPredictionsFromQuery: () => getPredictionsFromQuery,
|
|
61
62
|
showFlashMessage: () => showFlashMessage,
|
|
63
|
+
useAppState: () => useAppState_default,
|
|
64
|
+
useBlinkAnimation: () => useBlinkAnimation,
|
|
62
65
|
useColors: () => useColors,
|
|
66
|
+
useFadeAnimation: () => useFadeAnimation,
|
|
67
|
+
useFloatAnimation: () => useFloatAnimation,
|
|
68
|
+
useGrowAnimation: () => useGrowAnimation,
|
|
63
69
|
useNavScreenOptions: () => useNavScreenOptions,
|
|
70
|
+
useRollAnimation: () => useRollAnimation,
|
|
71
|
+
useSlideAnimation: () => useSlideAnimation,
|
|
64
72
|
useTheme: () => useTheme,
|
|
65
|
-
useThemeContext: () => useThemeContext
|
|
73
|
+
useThemeContext: () => useThemeContext,
|
|
74
|
+
useThrownUpAnimation: () => useThrownUpAnimation
|
|
66
75
|
});
|
|
67
76
|
module.exports = __toCommonJS(next_exports);
|
|
68
77
|
|
|
@@ -1549,9 +1558,9 @@ var TextField = ({
|
|
|
1549
1558
|
}) => {
|
|
1550
1559
|
const colors2 = useColors();
|
|
1551
1560
|
const [focused, setFocused] = (0, import_react16.useState)(false);
|
|
1552
|
-
const
|
|
1561
|
+
const height2 = (0, import_react_native_size_matters13.moderateScale)(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1);
|
|
1553
1562
|
const labelAnim = (0, import_react16.useRef)(
|
|
1554
|
-
new import_react_native16.Animated.Value(
|
|
1563
|
+
new import_react_native16.Animated.Value(height2 / (0, import_react_native_size_matters13.moderateScale)(variant === "text" ? 2.5 : 3.2))
|
|
1555
1564
|
).current;
|
|
1556
1565
|
import_react16.default.useEffect(() => {
|
|
1557
1566
|
if (focused || value) {
|
|
@@ -1562,7 +1571,7 @@ var TextField = ({
|
|
|
1562
1571
|
}).start();
|
|
1563
1572
|
} else {
|
|
1564
1573
|
import_react_native16.Animated.timing(labelAnim, {
|
|
1565
|
-
toValue:
|
|
1574
|
+
toValue: height2 / (0, import_react_native_size_matters13.moderateScale)(variant === "text" ? 2.5 : 3.2),
|
|
1566
1575
|
duration: 300,
|
|
1567
1576
|
useNativeDriver: false
|
|
1568
1577
|
}).start();
|
|
@@ -1575,7 +1584,7 @@ var TextField = ({
|
|
|
1575
1584
|
...style
|
|
1576
1585
|
},
|
|
1577
1586
|
container: {
|
|
1578
|
-
height,
|
|
1587
|
+
height: height2,
|
|
1579
1588
|
overflow: "hidden",
|
|
1580
1589
|
backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[3] : colors2.white[4],
|
|
1581
1590
|
flexDirection: "row",
|
|
@@ -1779,7 +1788,7 @@ var TextField2 = import_react16.default.forwardRef(
|
|
|
1779
1788
|
const colors2 = useColors();
|
|
1780
1789
|
const [focused, _setFocused] = (0, import_react16.useState)(false);
|
|
1781
1790
|
const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
|
|
1782
|
-
const
|
|
1791
|
+
const height2 = (0, import_react_native_size_matters13.moderateScale)(
|
|
1783
1792
|
multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1784
1793
|
);
|
|
1785
1794
|
const setFocused = (value2) => {
|
|
@@ -1798,7 +1807,7 @@ var TextField2 = import_react16.default.forwardRef(
|
|
|
1798
1807
|
...style
|
|
1799
1808
|
},
|
|
1800
1809
|
container: {
|
|
1801
|
-
height,
|
|
1810
|
+
height: height2,
|
|
1802
1811
|
overflow: "hidden",
|
|
1803
1812
|
flexDirection: "row",
|
|
1804
1813
|
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[4],
|
|
@@ -2191,7 +2200,7 @@ var import_react19 = __toESM(require("react"));
|
|
|
2191
2200
|
var import_react_native19 = require("react-native");
|
|
2192
2201
|
var import_react_native_size_matters15 = require("react-native-size-matters");
|
|
2193
2202
|
var Divider = ({
|
|
2194
|
-
height = 1,
|
|
2203
|
+
height: height2 = 1,
|
|
2195
2204
|
color = "textSecondary",
|
|
2196
2205
|
gutterBottom = 0,
|
|
2197
2206
|
style
|
|
@@ -2199,7 +2208,7 @@ var Divider = ({
|
|
|
2199
2208
|
const colors2 = useColors();
|
|
2200
2209
|
const styles = import_react_native_size_matters15.ScaledSheet.create({
|
|
2201
2210
|
root: {
|
|
2202
|
-
height,
|
|
2211
|
+
height: height2,
|
|
2203
2212
|
backgroundColor: colors2[color].main,
|
|
2204
2213
|
marginBottom: (0, import_react_native_size_matters15.ms)(gutterBottom),
|
|
2205
2214
|
...style
|
|
@@ -2327,6 +2336,525 @@ var OTPInput = ({
|
|
|
2327
2336
|
))));
|
|
2328
2337
|
};
|
|
2329
2338
|
|
|
2339
|
+
// ../src/Components/Animators/hooks/useAppState.ts
|
|
2340
|
+
var import_react22 = require("react");
|
|
2341
|
+
var import_react_native22 = require("react-native");
|
|
2342
|
+
var useAppState = () => {
|
|
2343
|
+
const [isActive, setIsActive] = (0, import_react22.useState)(import_react_native22.AppState.currentState === "active");
|
|
2344
|
+
(0, import_react22.useEffect)(() => {
|
|
2345
|
+
const handleAppStateChange = (nextAppState) => {
|
|
2346
|
+
setIsActive(nextAppState === "active");
|
|
2347
|
+
};
|
|
2348
|
+
let subscription;
|
|
2349
|
+
if (import_react_native22.Platform.OS === "android") {
|
|
2350
|
+
subscription = import_react_native22.AppState.addEventListener("change", handleAppStateChange);
|
|
2351
|
+
} else {
|
|
2352
|
+
subscription = import_react_native22.AppState.addEventListener("change", handleAppStateChange);
|
|
2353
|
+
}
|
|
2354
|
+
return () => {
|
|
2355
|
+
subscription?.remove();
|
|
2356
|
+
};
|
|
2357
|
+
}, []);
|
|
2358
|
+
return { isActive };
|
|
2359
|
+
};
|
|
2360
|
+
var useAppState_default = useAppState;
|
|
2361
|
+
|
|
2362
|
+
// ../src/Components/Animators/hooks/useBlinkAnimation.ts
|
|
2363
|
+
var import_react23 = require("react");
|
|
2364
|
+
var import_react_native23 = require("react-native");
|
|
2365
|
+
var import_react_native_reanimated3 = require("react-native-reanimated");
|
|
2366
|
+
var useBlinkAnimation = ({
|
|
2367
|
+
delay = 0,
|
|
2368
|
+
blinkDuration = 2e3,
|
|
2369
|
+
minOpacity = 0.5,
|
|
2370
|
+
maxOpacity = 1
|
|
2371
|
+
} = {}) => {
|
|
2372
|
+
const opacity = (0, import_react_native_reanimated3.useSharedValue)(maxOpacity);
|
|
2373
|
+
const { isActive } = useAppState_default();
|
|
2374
|
+
const animatedStyle = (0, import_react_native_reanimated3.useAnimatedStyle)(() => {
|
|
2375
|
+
return {
|
|
2376
|
+
opacity: opacity.value
|
|
2377
|
+
};
|
|
2378
|
+
});
|
|
2379
|
+
const startBlinking = () => {
|
|
2380
|
+
opacity.value = (0, import_react_native_reanimated3.withRepeat)(
|
|
2381
|
+
(0, import_react_native_reanimated3.withSequence)(
|
|
2382
|
+
(0, import_react_native_reanimated3.withTiming)(minOpacity, {
|
|
2383
|
+
duration: blinkDuration / 2,
|
|
2384
|
+
easing: import_react_native_reanimated3.Easing.inOut(import_react_native_reanimated3.Easing.quad)
|
|
2385
|
+
}),
|
|
2386
|
+
(0, import_react_native_reanimated3.withTiming)(maxOpacity, {
|
|
2387
|
+
duration: blinkDuration / 2,
|
|
2388
|
+
easing: import_react_native_reanimated3.Easing.inOut(import_react_native_reanimated3.Easing.quad)
|
|
2389
|
+
})
|
|
2390
|
+
),
|
|
2391
|
+
-1,
|
|
2392
|
+
false
|
|
2393
|
+
);
|
|
2394
|
+
};
|
|
2395
|
+
(0, import_react23.useEffect)(() => {
|
|
2396
|
+
if (!isActive && import_react_native23.Platform.OS === "ios") {
|
|
2397
|
+
opacity.value = maxOpacity;
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2400
|
+
if (delay > 0) {
|
|
2401
|
+
const timer = setTimeout(() => {
|
|
2402
|
+
startBlinking();
|
|
2403
|
+
}, delay);
|
|
2404
|
+
return () => {
|
|
2405
|
+
clearTimeout(timer);
|
|
2406
|
+
opacity.value = maxOpacity;
|
|
2407
|
+
};
|
|
2408
|
+
} else {
|
|
2409
|
+
startBlinking();
|
|
2410
|
+
}
|
|
2411
|
+
return () => {
|
|
2412
|
+
opacity.value = maxOpacity;
|
|
2413
|
+
};
|
|
2414
|
+
}, [delay, blinkDuration, minOpacity, maxOpacity, isActive]);
|
|
2415
|
+
return {
|
|
2416
|
+
animatedStyle
|
|
2417
|
+
};
|
|
2418
|
+
};
|
|
2419
|
+
|
|
2420
|
+
// ../src/Components/Animators/hooks/useFadeAnimation.ts
|
|
2421
|
+
var import_react24 = require("react");
|
|
2422
|
+
var import_react_native24 = require("react-native");
|
|
2423
|
+
var import_react_native_reanimated4 = require("react-native-reanimated");
|
|
2424
|
+
var useFadeAnimation = ({
|
|
2425
|
+
duration = 1e3,
|
|
2426
|
+
delay = 0,
|
|
2427
|
+
closeAfter = null
|
|
2428
|
+
} = {}) => {
|
|
2429
|
+
const opacity = (0, import_react_native_reanimated4.useSharedValue)(0);
|
|
2430
|
+
const { isActive } = useAppState_default();
|
|
2431
|
+
const animatedStyle = (0, import_react_native_reanimated4.useAnimatedStyle)(() => {
|
|
2432
|
+
return {
|
|
2433
|
+
opacity: opacity.value
|
|
2434
|
+
};
|
|
2435
|
+
});
|
|
2436
|
+
(0, import_react24.useEffect)(() => {
|
|
2437
|
+
if (!isActive && import_react_native24.Platform.OS === "ios") {
|
|
2438
|
+
opacity.value = 0;
|
|
2439
|
+
return;
|
|
2440
|
+
}
|
|
2441
|
+
opacity.value = (0, import_react_native_reanimated4.withDelay)(
|
|
2442
|
+
delay,
|
|
2443
|
+
(0, import_react_native_reanimated4.withTiming)(1, { duration }, () => {
|
|
2444
|
+
if (closeAfter) {
|
|
2445
|
+
opacity.value = (0, import_react_native_reanimated4.withDelay)(closeAfter, (0, import_react_native_reanimated4.withTiming)(0, { duration }));
|
|
2446
|
+
}
|
|
2447
|
+
})
|
|
2448
|
+
);
|
|
2449
|
+
}, [opacity, duration, delay, closeAfter, isActive]);
|
|
2450
|
+
return {
|
|
2451
|
+
animatedStyle
|
|
2452
|
+
};
|
|
2453
|
+
};
|
|
2454
|
+
|
|
2455
|
+
// ../src/Components/Animators/hooks/useFloatAnimation.ts
|
|
2456
|
+
var import_react25 = require("react");
|
|
2457
|
+
var import_react_native25 = require("react-native");
|
|
2458
|
+
var import_react_native_reanimated5 = require("react-native-reanimated");
|
|
2459
|
+
var useFloatAnimation = ({
|
|
2460
|
+
duration = 800,
|
|
2461
|
+
delay = 0,
|
|
2462
|
+
closeAfter = null,
|
|
2463
|
+
closeDuration = 600,
|
|
2464
|
+
floatDistance = 10,
|
|
2465
|
+
floatDuration = 1200
|
|
2466
|
+
} = {}) => {
|
|
2467
|
+
const opacity = (0, import_react_native_reanimated5.useSharedValue)(0);
|
|
2468
|
+
const translateY = (0, import_react_native_reanimated5.useSharedValue)(0);
|
|
2469
|
+
const { isActive } = useAppState_default();
|
|
2470
|
+
const isFloating = (0, import_react25.useRef)(false);
|
|
2471
|
+
const animatedStyle = (0, import_react_native_reanimated5.useAnimatedStyle)(() => {
|
|
2472
|
+
return {
|
|
2473
|
+
opacity: opacity.value,
|
|
2474
|
+
transform: [{ translateY: translateY.value }]
|
|
2475
|
+
};
|
|
2476
|
+
});
|
|
2477
|
+
const startFloating = () => {
|
|
2478
|
+
if (!isFloating.current) {
|
|
2479
|
+
isFloating.current = true;
|
|
2480
|
+
translateY.value = (0, import_react_native_reanimated5.withRepeat)(
|
|
2481
|
+
(0, import_react_native_reanimated5.withSequence)(
|
|
2482
|
+
(0, import_react_native_reanimated5.withTiming)(-floatDistance, {
|
|
2483
|
+
duration: floatDuration / 2,
|
|
2484
|
+
easing: import_react_native_reanimated5.Easing.inOut(import_react_native_reanimated5.Easing.quad)
|
|
2485
|
+
}),
|
|
2486
|
+
(0, import_react_native_reanimated5.withTiming)(floatDistance, {
|
|
2487
|
+
duration: floatDuration,
|
|
2488
|
+
easing: import_react_native_reanimated5.Easing.inOut(import_react_native_reanimated5.Easing.quad)
|
|
2489
|
+
}),
|
|
2490
|
+
(0, import_react_native_reanimated5.withTiming)(0, {
|
|
2491
|
+
duration: floatDuration / 2,
|
|
2492
|
+
easing: import_react_native_reanimated5.Easing.inOut(import_react_native_reanimated5.Easing.quad)
|
|
2493
|
+
})
|
|
2494
|
+
),
|
|
2495
|
+
-1,
|
|
2496
|
+
false
|
|
2497
|
+
);
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
(0, import_react25.useEffect)(() => {
|
|
2501
|
+
if (!isActive && import_react_native25.Platform.OS === "ios") {
|
|
2502
|
+
opacity.value = 0;
|
|
2503
|
+
translateY.value = 0;
|
|
2504
|
+
isFloating.current = false;
|
|
2505
|
+
return;
|
|
2506
|
+
}
|
|
2507
|
+
opacity.value = (0, import_react_native_reanimated5.withDelay)(
|
|
2508
|
+
delay,
|
|
2509
|
+
(0, import_react_native_reanimated5.withTiming)(1, { duration }, () => {
|
|
2510
|
+
startFloating();
|
|
2511
|
+
if (closeAfter) {
|
|
2512
|
+
opacity.value = (0, import_react_native_reanimated5.withDelay)(
|
|
2513
|
+
closeAfter,
|
|
2514
|
+
(0, import_react_native_reanimated5.withTiming)(0, { duration: closeDuration })
|
|
2515
|
+
);
|
|
2516
|
+
translateY.value = (0, import_react_native_reanimated5.withDelay)(
|
|
2517
|
+
closeAfter,
|
|
2518
|
+
(0, import_react_native_reanimated5.withTiming)(0, { duration: closeDuration })
|
|
2519
|
+
);
|
|
2520
|
+
isFloating.current = false;
|
|
2521
|
+
}
|
|
2522
|
+
})
|
|
2523
|
+
);
|
|
2524
|
+
return () => {
|
|
2525
|
+
opacity.value = 0;
|
|
2526
|
+
translateY.value = 0;
|
|
2527
|
+
isFloating.current = false;
|
|
2528
|
+
};
|
|
2529
|
+
}, [
|
|
2530
|
+
duration,
|
|
2531
|
+
delay,
|
|
2532
|
+
closeAfter,
|
|
2533
|
+
closeDuration,
|
|
2534
|
+
floatDistance,
|
|
2535
|
+
floatDuration,
|
|
2536
|
+
isActive
|
|
2537
|
+
]);
|
|
2538
|
+
return {
|
|
2539
|
+
animatedStyle
|
|
2540
|
+
};
|
|
2541
|
+
};
|
|
2542
|
+
|
|
2543
|
+
// ../src/Components/Animators/hooks/useGrowAnimation.ts
|
|
2544
|
+
var import_react26 = require("react");
|
|
2545
|
+
var import_react_native26 = require("react-native");
|
|
2546
|
+
var import_react_native_reanimated6 = require("react-native-reanimated");
|
|
2547
|
+
var useGrowAnimation = ({
|
|
2548
|
+
duration = 500,
|
|
2549
|
+
delay = 0,
|
|
2550
|
+
closeAfter = null,
|
|
2551
|
+
initialScale = 0
|
|
2552
|
+
} = {}) => {
|
|
2553
|
+
const scale = (0, import_react_native_reanimated6.useSharedValue)(initialScale);
|
|
2554
|
+
const { isActive } = useAppState_default();
|
|
2555
|
+
const animatedStyle = (0, import_react_native_reanimated6.useAnimatedStyle)(() => {
|
|
2556
|
+
return {
|
|
2557
|
+
transform: [{ scale: scale.value }]
|
|
2558
|
+
};
|
|
2559
|
+
});
|
|
2560
|
+
(0, import_react26.useEffect)(() => {
|
|
2561
|
+
if (!isActive && import_react_native26.Platform.OS === "ios") {
|
|
2562
|
+
scale.value = initialScale;
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
scale.value = (0, import_react_native_reanimated6.withDelay)(
|
|
2566
|
+
delay,
|
|
2567
|
+
(0, import_react_native_reanimated6.withTiming)(
|
|
2568
|
+
1,
|
|
2569
|
+
{
|
|
2570
|
+
duration,
|
|
2571
|
+
easing: import_react_native_reanimated6.Easing.out(import_react_native_reanimated6.Easing.ease)
|
|
2572
|
+
},
|
|
2573
|
+
() => {
|
|
2574
|
+
if (closeAfter) {
|
|
2575
|
+
scale.value = (0, import_react_native_reanimated6.withDelay)(
|
|
2576
|
+
closeAfter,
|
|
2577
|
+
(0, import_react_native_reanimated6.withTiming)(initialScale, {
|
|
2578
|
+
duration,
|
|
2579
|
+
easing: import_react_native_reanimated6.Easing.out(import_react_native_reanimated6.Easing.ease)
|
|
2580
|
+
})
|
|
2581
|
+
);
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
)
|
|
2585
|
+
);
|
|
2586
|
+
}, [scale, duration, delay, closeAfter, initialScale, isActive]);
|
|
2587
|
+
return {
|
|
2588
|
+
animatedStyle
|
|
2589
|
+
};
|
|
2590
|
+
};
|
|
2591
|
+
|
|
2592
|
+
// ../src/Components/Animators/hooks/useRollAnimation.ts
|
|
2593
|
+
var import_react27 = require("react");
|
|
2594
|
+
var import_react_native27 = require("react-native");
|
|
2595
|
+
var import_react_native_reanimated7 = require("react-native-reanimated");
|
|
2596
|
+
var useRollAnimation = ({
|
|
2597
|
+
duration = 500,
|
|
2598
|
+
delay = 0,
|
|
2599
|
+
closeAfter = null,
|
|
2600
|
+
initialTranslateY = 100,
|
|
2601
|
+
initialRotate = "0deg"
|
|
2602
|
+
} = {}) => {
|
|
2603
|
+
const translateY = (0, import_react_native_reanimated7.useSharedValue)(initialTranslateY);
|
|
2604
|
+
const rotate = (0, import_react_native_reanimated7.useSharedValue)(0);
|
|
2605
|
+
const { isActive } = useAppState_default();
|
|
2606
|
+
const animatedStyle = (0, import_react_native_reanimated7.useAnimatedStyle)(() => {
|
|
2607
|
+
const rotateInterpolated = (0, import_react_native_reanimated7.interpolate)(
|
|
2608
|
+
rotate.value,
|
|
2609
|
+
[0, 1],
|
|
2610
|
+
[parseFloat(initialRotate.replace("deg", "")), 360]
|
|
2611
|
+
);
|
|
2612
|
+
return {
|
|
2613
|
+
transform: [
|
|
2614
|
+
{ translateY: translateY.value },
|
|
2615
|
+
{ rotate: `${rotateInterpolated}deg` }
|
|
2616
|
+
]
|
|
2617
|
+
};
|
|
2618
|
+
});
|
|
2619
|
+
(0, import_react27.useEffect)(() => {
|
|
2620
|
+
if (!isActive && import_react_native27.Platform.OS === "ios") {
|
|
2621
|
+
translateY.value = initialTranslateY;
|
|
2622
|
+
rotate.value = 0;
|
|
2623
|
+
return;
|
|
2624
|
+
}
|
|
2625
|
+
translateY.value = (0, import_react_native_reanimated7.withDelay)(
|
|
2626
|
+
delay,
|
|
2627
|
+
(0, import_react_native_reanimated7.withTiming)(0, {
|
|
2628
|
+
duration,
|
|
2629
|
+
easing: import_react_native_reanimated7.Easing.out(import_react_native_reanimated7.Easing.ease)
|
|
2630
|
+
})
|
|
2631
|
+
);
|
|
2632
|
+
rotate.value = (0, import_react_native_reanimated7.withDelay)(
|
|
2633
|
+
delay,
|
|
2634
|
+
(0, import_react_native_reanimated7.withTiming)(
|
|
2635
|
+
1,
|
|
2636
|
+
{
|
|
2637
|
+
duration,
|
|
2638
|
+
easing: import_react_native_reanimated7.Easing.out(import_react_native_reanimated7.Easing.ease)
|
|
2639
|
+
},
|
|
2640
|
+
() => {
|
|
2641
|
+
if (closeAfter) {
|
|
2642
|
+
translateY.value = (0, import_react_native_reanimated7.withDelay)(
|
|
2643
|
+
closeAfter,
|
|
2644
|
+
(0, import_react_native_reanimated7.withTiming)(initialTranslateY, {
|
|
2645
|
+
duration,
|
|
2646
|
+
easing: import_react_native_reanimated7.Easing.out(import_react_native_reanimated7.Easing.ease)
|
|
2647
|
+
})
|
|
2648
|
+
);
|
|
2649
|
+
rotate.value = (0, import_react_native_reanimated7.withDelay)(
|
|
2650
|
+
closeAfter,
|
|
2651
|
+
(0, import_react_native_reanimated7.withTiming)(0, {
|
|
2652
|
+
duration,
|
|
2653
|
+
easing: import_react_native_reanimated7.Easing.out(import_react_native_reanimated7.Easing.ease)
|
|
2654
|
+
})
|
|
2655
|
+
);
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
)
|
|
2659
|
+
);
|
|
2660
|
+
}, [
|
|
2661
|
+
translateY,
|
|
2662
|
+
rotate,
|
|
2663
|
+
duration,
|
|
2664
|
+
delay,
|
|
2665
|
+
closeAfter,
|
|
2666
|
+
initialTranslateY,
|
|
2667
|
+
initialRotate,
|
|
2668
|
+
isActive
|
|
2669
|
+
]);
|
|
2670
|
+
return {
|
|
2671
|
+
animatedStyle
|
|
2672
|
+
};
|
|
2673
|
+
};
|
|
2674
|
+
|
|
2675
|
+
// ../src/Components/Animators/hooks/useSlideAnimation.ts
|
|
2676
|
+
var import_react28 = require("react");
|
|
2677
|
+
var import_react_native28 = require("react-native");
|
|
2678
|
+
var import_react_native_reanimated8 = require("react-native-reanimated");
|
|
2679
|
+
var { width, height } = import_react_native28.Dimensions.get("window");
|
|
2680
|
+
var getInitialPosition = (direction) => {
|
|
2681
|
+
switch (direction) {
|
|
2682
|
+
case "up":
|
|
2683
|
+
return height;
|
|
2684
|
+
case "down":
|
|
2685
|
+
return -height;
|
|
2686
|
+
case "left":
|
|
2687
|
+
return width;
|
|
2688
|
+
case "right":
|
|
2689
|
+
return -width;
|
|
2690
|
+
default:
|
|
2691
|
+
return 0;
|
|
2692
|
+
}
|
|
2693
|
+
};
|
|
2694
|
+
var useSlideAnimation = ({
|
|
2695
|
+
duration = 1e3,
|
|
2696
|
+
delay = 0,
|
|
2697
|
+
direction = "up",
|
|
2698
|
+
closeAfter,
|
|
2699
|
+
initialValue
|
|
2700
|
+
} = {}) => {
|
|
2701
|
+
const translateValue = (0, import_react_native_reanimated8.useSharedValue)(0);
|
|
2702
|
+
const { isActive } = useAppState_default();
|
|
2703
|
+
const animatedStyle = (0, import_react_native_reanimated8.useAnimatedStyle)(() => {
|
|
2704
|
+
const slideStyle = direction === "up" || direction === "down" ? { transform: [{ translateY: translateValue.value }] } : { transform: [{ translateX: translateValue.value }] };
|
|
2705
|
+
return slideStyle;
|
|
2706
|
+
});
|
|
2707
|
+
(0, import_react28.useEffect)(() => {
|
|
2708
|
+
if (!isActive && import_react_native28.Platform.OS === "ios") {
|
|
2709
|
+
const initialPosition2 = initialValue || getInitialPosition(direction);
|
|
2710
|
+
translateValue.value = initialPosition2;
|
|
2711
|
+
return;
|
|
2712
|
+
}
|
|
2713
|
+
const initialPosition = initialValue || getInitialPosition(direction);
|
|
2714
|
+
translateValue.value = initialPosition;
|
|
2715
|
+
translateValue.value = (0, import_react_native_reanimated8.withDelay)(
|
|
2716
|
+
delay,
|
|
2717
|
+
(0, import_react_native_reanimated8.withTiming)(0, {
|
|
2718
|
+
duration,
|
|
2719
|
+
easing: import_react_native_reanimated8.Easing.out(import_react_native_reanimated8.Easing.ease)
|
|
2720
|
+
})
|
|
2721
|
+
);
|
|
2722
|
+
if (closeAfter) {
|
|
2723
|
+
translateValue.value = (0, import_react_native_reanimated8.withDelay)(
|
|
2724
|
+
closeAfter + duration + delay,
|
|
2725
|
+
(0, import_react_native_reanimated8.withTiming)(initialPosition, {
|
|
2726
|
+
duration,
|
|
2727
|
+
easing: import_react_native_reanimated8.Easing.out(import_react_native_reanimated8.Easing.ease)
|
|
2728
|
+
})
|
|
2729
|
+
);
|
|
2730
|
+
}
|
|
2731
|
+
}, [
|
|
2732
|
+
translateValue,
|
|
2733
|
+
duration,
|
|
2734
|
+
delay,
|
|
2735
|
+
direction,
|
|
2736
|
+
closeAfter,
|
|
2737
|
+
initialValue,
|
|
2738
|
+
isActive
|
|
2739
|
+
]);
|
|
2740
|
+
return {
|
|
2741
|
+
animatedStyle
|
|
2742
|
+
};
|
|
2743
|
+
};
|
|
2744
|
+
|
|
2745
|
+
// ../src/Components/Animators/hooks/useThrownUpAnimation.ts
|
|
2746
|
+
var import_react29 = require("react");
|
|
2747
|
+
var import_react_native29 = require("react-native");
|
|
2748
|
+
var import_react_native_reanimated9 = require("react-native-reanimated");
|
|
2749
|
+
var useThrownUpAnimation = ({
|
|
2750
|
+
delay = 0,
|
|
2751
|
+
closeAfter = null
|
|
2752
|
+
} = {}) => {
|
|
2753
|
+
const translateY = (0, import_react_native_reanimated9.useSharedValue)(600);
|
|
2754
|
+
const opacity = (0, import_react_native_reanimated9.useSharedValue)(0);
|
|
2755
|
+
const isUnmounting = (0, import_react29.useRef)(false);
|
|
2756
|
+
const { isActive } = useAppState_default();
|
|
2757
|
+
const animatedStyle = (0, import_react_native_reanimated9.useAnimatedStyle)(() => {
|
|
2758
|
+
return {
|
|
2759
|
+
transform: [{ translateY: translateY.value }],
|
|
2760
|
+
opacity: opacity.value
|
|
2761
|
+
};
|
|
2762
|
+
});
|
|
2763
|
+
(0, import_react29.useEffect)(() => {
|
|
2764
|
+
if (!isActive && import_react_native29.Platform.OS === "ios") {
|
|
2765
|
+
translateY.value = 600;
|
|
2766
|
+
opacity.value = 0;
|
|
2767
|
+
return;
|
|
2768
|
+
}
|
|
2769
|
+
translateY.value = (0, import_react_native_reanimated9.withDelay)(
|
|
2770
|
+
delay,
|
|
2771
|
+
(0, import_react_native_reanimated9.withSpring)(0, {
|
|
2772
|
+
velocity: 1,
|
|
2773
|
+
stiffness: 100,
|
|
2774
|
+
damping: 15
|
|
2775
|
+
})
|
|
2776
|
+
);
|
|
2777
|
+
opacity.value = (0, import_react_native_reanimated9.withDelay)(delay, (0, import_react_native_reanimated9.withTiming)(1, { duration: 500 }));
|
|
2778
|
+
if (closeAfter) {
|
|
2779
|
+
translateY.value = (0, import_react_native_reanimated9.withDelay)(
|
|
2780
|
+
closeAfter,
|
|
2781
|
+
(0, import_react_native_reanimated9.withSpring)(800, {
|
|
2782
|
+
velocity: 1,
|
|
2783
|
+
stiffness: 200,
|
|
2784
|
+
damping: 20
|
|
2785
|
+
})
|
|
2786
|
+
);
|
|
2787
|
+
opacity.value = (0, import_react_native_reanimated9.withDelay)(closeAfter, (0, import_react_native_reanimated9.withTiming)(0, { duration: 500 }));
|
|
2788
|
+
}
|
|
2789
|
+
return () => {
|
|
2790
|
+
translateY.value = 600;
|
|
2791
|
+
opacity.value = 0;
|
|
2792
|
+
isUnmounting.current = true;
|
|
2793
|
+
};
|
|
2794
|
+
}, [translateY, opacity, delay, closeAfter, isActive]);
|
|
2795
|
+
return {
|
|
2796
|
+
animatedStyle
|
|
2797
|
+
};
|
|
2798
|
+
};
|
|
2799
|
+
|
|
2800
|
+
// ../src/Components/Animators/Animator.tsx
|
|
2801
|
+
var import_react30 = __toESM(require("react"));
|
|
2802
|
+
var import_react_native_reanimated10 = __toESM(require("react-native-reanimated"));
|
|
2803
|
+
var Animator = (props) => {
|
|
2804
|
+
const { children, type, duration, delay, closeAfter, style = {} } = props;
|
|
2805
|
+
const getAnimationStyle = () => {
|
|
2806
|
+
switch (type) {
|
|
2807
|
+
case "fade":
|
|
2808
|
+
return useFadeAnimation({ duration, delay, closeAfter });
|
|
2809
|
+
case "grow":
|
|
2810
|
+
return useGrowAnimation({
|
|
2811
|
+
duration,
|
|
2812
|
+
delay,
|
|
2813
|
+
closeAfter,
|
|
2814
|
+
initialScale: props.initialScale
|
|
2815
|
+
});
|
|
2816
|
+
case "slide":
|
|
2817
|
+
return useSlideAnimation({
|
|
2818
|
+
duration,
|
|
2819
|
+
delay,
|
|
2820
|
+
direction: props.direction,
|
|
2821
|
+
closeAfter,
|
|
2822
|
+
initialValue: props.initialValue
|
|
2823
|
+
});
|
|
2824
|
+
case "blink":
|
|
2825
|
+
return useBlinkAnimation({
|
|
2826
|
+
delay,
|
|
2827
|
+
blinkDuration: props.blinkDuration,
|
|
2828
|
+
minOpacity: props.minOpacity,
|
|
2829
|
+
maxOpacity: props.maxOpacity
|
|
2830
|
+
});
|
|
2831
|
+
case "float":
|
|
2832
|
+
return useFloatAnimation({
|
|
2833
|
+
duration,
|
|
2834
|
+
delay,
|
|
2835
|
+
closeAfter,
|
|
2836
|
+
closeDuration: props.closeDuration,
|
|
2837
|
+
floatDistance: props.floatDistance,
|
|
2838
|
+
floatDuration: props.floatDuration
|
|
2839
|
+
});
|
|
2840
|
+
case "roll":
|
|
2841
|
+
return useRollAnimation({
|
|
2842
|
+
duration,
|
|
2843
|
+
delay,
|
|
2844
|
+
closeAfter,
|
|
2845
|
+
initialTranslateY: props.initialTranslateY,
|
|
2846
|
+
initialRotate: props.initialRotate
|
|
2847
|
+
});
|
|
2848
|
+
case "thrownup":
|
|
2849
|
+
return useThrownUpAnimation({ delay, closeAfter });
|
|
2850
|
+
default:
|
|
2851
|
+
return { animatedStyle: {} };
|
|
2852
|
+
}
|
|
2853
|
+
};
|
|
2854
|
+
const { animatedStyle } = getAnimationStyle();
|
|
2855
|
+
return /* @__PURE__ */ import_react30.default.createElement(import_react_native_reanimated10.default.View, { style: [style, animatedStyle] }, children);
|
|
2856
|
+
};
|
|
2857
|
+
|
|
2330
2858
|
// index.ts
|
|
2331
2859
|
var HoddyUI = {
|
|
2332
2860
|
initialize
|
|
@@ -2336,6 +2864,7 @@ var next_default = HoddyUI;
|
|
|
2336
2864
|
0 && (module.exports = {
|
|
2337
2865
|
AdaptiveStatusBar,
|
|
2338
2866
|
AlertX,
|
|
2867
|
+
Animator,
|
|
2339
2868
|
Avatar,
|
|
2340
2869
|
Button,
|
|
2341
2870
|
CheckBox,
|
|
@@ -2362,9 +2891,17 @@ var next_default = HoddyUI;
|
|
|
2362
2891
|
getPredictionsFromCoords,
|
|
2363
2892
|
getPredictionsFromQuery,
|
|
2364
2893
|
showFlashMessage,
|
|
2894
|
+
useAppState,
|
|
2895
|
+
useBlinkAnimation,
|
|
2365
2896
|
useColors,
|
|
2897
|
+
useFadeAnimation,
|
|
2898
|
+
useFloatAnimation,
|
|
2899
|
+
useGrowAnimation,
|
|
2366
2900
|
useNavScreenOptions,
|
|
2901
|
+
useRollAnimation,
|
|
2902
|
+
useSlideAnimation,
|
|
2367
2903
|
useTheme,
|
|
2368
|
-
useThemeContext
|
|
2904
|
+
useThemeContext,
|
|
2905
|
+
useThrownUpAnimation
|
|
2369
2906
|
});
|
|
2370
2907
|
//# sourceMappingURL=index.js.map
|