@hoddy-ui/core 2.5.10 → 2.5.12
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/next/dist/index.js +15 -21
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +15 -21
- package/next/dist/index.mjs.map +1 -1
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/Animators/hooks/useFadeAnimation.ts +1 -3
- package/src/Components/Animators/hooks/useFloatAnimation.ts +9 -9
- package/src/Components/Animators/hooks/useGrowAnimation.ts +5 -4
- package/src/Components/Animators/hooks/useRollAnimation.ts +10 -6
- package/src/Components/Animators/hooks/useSlideAnimation.ts +5 -8
- package/src/Components/Animators/hooks/useThrownUpAnimation.ts +9 -12
- package/src/Components/Popup.tsx +13 -9
- package/src/Components/SafeAreaView.tsx +5 -2
package/next/package.json
CHANGED
package/package.json
CHANGED
|
@@ -40,9 +40,7 @@ export const useFadeAnimation = ({
|
|
|
40
40
|
withTiming(1, { duration }, () => {
|
|
41
41
|
if (closeAfter) {
|
|
42
42
|
// Schedule fade-out after closeAfter duration
|
|
43
|
-
|
|
44
|
-
opacity.value = withTiming(0, { duration });
|
|
45
|
-
}, closeAfter);
|
|
43
|
+
opacity.value = withDelay(closeAfter, withTiming(0, { duration }));
|
|
46
44
|
}
|
|
47
45
|
})
|
|
48
46
|
);
|
|
@@ -64,11 +64,6 @@ export const useFloatAnimation = ({
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
const stopFloating = () => {
|
|
68
|
-
isFloating.current = false;
|
|
69
|
-
translateY.value = withTiming(0, { duration: 200 });
|
|
70
|
-
};
|
|
71
|
-
|
|
72
67
|
useEffect(() => {
|
|
73
68
|
if (!isActive && Platform.OS === "ios") {
|
|
74
69
|
opacity.value = 0;
|
|
@@ -84,10 +79,15 @@ export const useFloatAnimation = ({
|
|
|
84
79
|
startFloating();
|
|
85
80
|
|
|
86
81
|
if (closeAfter) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
opacity.value = withDelay(
|
|
83
|
+
closeAfter,
|
|
84
|
+
withTiming(0, { duration: closeDuration })
|
|
85
|
+
);
|
|
86
|
+
translateY.value = withDelay(
|
|
87
|
+
closeAfter,
|
|
88
|
+
withTiming(0, { duration: closeDuration })
|
|
89
|
+
);
|
|
90
|
+
isFloating.current = false;
|
|
91
91
|
}
|
|
92
92
|
})
|
|
93
93
|
);
|
|
@@ -48,12 +48,13 @@ export const useGrowAnimation = ({
|
|
|
48
48
|
},
|
|
49
49
|
() => {
|
|
50
50
|
if (closeAfter) {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
scale.value = withDelay(
|
|
52
|
+
closeAfter,
|
|
53
|
+
withTiming(initialScale, {
|
|
53
54
|
duration,
|
|
54
55
|
easing: Easing.out(Easing.ease),
|
|
55
|
-
})
|
|
56
|
-
|
|
56
|
+
})
|
|
57
|
+
);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
)
|
|
@@ -71,16 +71,20 @@ export const useRollAnimation = ({
|
|
|
71
71
|
},
|
|
72
72
|
() => {
|
|
73
73
|
if (closeAfter) {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
translateY.value = withDelay(
|
|
75
|
+
closeAfter,
|
|
76
|
+
withTiming(initialTranslateY, {
|
|
76
77
|
duration,
|
|
77
78
|
easing: Easing.out(Easing.ease),
|
|
78
|
-
})
|
|
79
|
-
|
|
79
|
+
})
|
|
80
|
+
);
|
|
81
|
+
rotate.value = withDelay(
|
|
82
|
+
closeAfter,
|
|
83
|
+
withTiming(0, {
|
|
80
84
|
duration,
|
|
81
85
|
easing: Easing.out(Easing.ease),
|
|
82
|
-
})
|
|
83
|
-
|
|
86
|
+
})
|
|
87
|
+
);
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
)
|
|
@@ -73,16 +73,13 @@ export const useSlideAnimation = ({
|
|
|
73
73
|
);
|
|
74
74
|
|
|
75
75
|
if (closeAfter) {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
translateValue.value = withDelay(
|
|
77
|
+
closeAfter + duration + delay,
|
|
78
|
+
withTiming(initialPosition, {
|
|
78
79
|
duration,
|
|
79
80
|
easing: Easing.out(Easing.ease),
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return () => {
|
|
84
|
-
clearTimeout(timer);
|
|
85
|
-
};
|
|
81
|
+
})
|
|
82
|
+
);
|
|
86
83
|
}
|
|
87
84
|
}, [
|
|
88
85
|
translateValue,
|
|
@@ -50,22 +50,19 @@ export const useThrownUpAnimation = ({
|
|
|
50
50
|
opacity.value = withDelay(delay, withTiming(1, { duration: 500 }));
|
|
51
51
|
|
|
52
52
|
// Start timer to animate out after duration
|
|
53
|
-
let timer: NodeJS.Timeout | null = null;
|
|
54
53
|
if (closeAfter) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, closeAfter);
|
|
54
|
+
translateY.value = withDelay(
|
|
55
|
+
closeAfter,
|
|
56
|
+
withSpring(800, {
|
|
57
|
+
velocity: 1,
|
|
58
|
+
stiffness: 200,
|
|
59
|
+
damping: 20,
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
opacity.value = withDelay(closeAfter, withTiming(0, { duration: 500 }));
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
return () => {
|
|
68
|
-
if (timer) clearTimeout(timer);
|
|
69
66
|
translateY.value = 600;
|
|
70
67
|
opacity.value = 0;
|
|
71
68
|
isUnmounting.current = true;
|
package/src/Components/Popup.tsx
CHANGED
|
@@ -11,8 +11,10 @@ import {
|
|
|
11
11
|
|
|
12
12
|
import React, { useEffect, useState } from "react";
|
|
13
13
|
import Animated, {
|
|
14
|
+
CurvedTransition,
|
|
14
15
|
LinearTransition,
|
|
15
16
|
runOnJS,
|
|
17
|
+
SequencedTransition,
|
|
16
18
|
useAnimatedStyle,
|
|
17
19
|
useSharedValue,
|
|
18
20
|
withTiming,
|
|
@@ -48,7 +50,8 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
48
50
|
const contentTranslateY = useSharedValue(1000);
|
|
49
51
|
|
|
50
52
|
// Memoized keyboard vertical offset based on platform and keyboard state
|
|
51
|
-
const keyboardVerticalOffsetValue =
|
|
53
|
+
const keyboardVerticalOffsetValue =
|
|
54
|
+
Platform.OS === "ios" ? -bottom : -bottom * 2;
|
|
52
55
|
|
|
53
56
|
// Keyboard event listeners
|
|
54
57
|
useEffect(() => {
|
|
@@ -111,11 +114,12 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
111
114
|
},
|
|
112
115
|
keyboardView: {
|
|
113
116
|
flex: 1,
|
|
117
|
+
zIndex: 1000,
|
|
114
118
|
},
|
|
115
119
|
avoidingView: {
|
|
120
|
+
zIndex: 2,
|
|
116
121
|
minHeight: typeof sheet === "number" ? sheet : undefined,
|
|
117
122
|
maxHeight: "90%",
|
|
118
|
-
zIndex: 1000,
|
|
119
123
|
alignSelf: "center",
|
|
120
124
|
maxWidth: sheet ? undefined : "90%",
|
|
121
125
|
width: sheet ? "100%" : undefined,
|
|
@@ -167,6 +171,7 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
167
171
|
onRequestClose={closeAction}
|
|
168
172
|
>
|
|
169
173
|
<UIThemeProvider>
|
|
174
|
+
<Animated.View style={[styles.backdrop, backdropAnimatedStyle]} />
|
|
170
175
|
<KeyboardAvoidingView
|
|
171
176
|
style={styles.keyboardView}
|
|
172
177
|
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
@@ -176,22 +181,21 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
176
181
|
>
|
|
177
182
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
178
183
|
<View style={styles.root}>
|
|
179
|
-
<Animated.View style={[styles.backdrop, backdropAnimatedStyle]} />
|
|
180
184
|
{open && (
|
|
181
185
|
<Pressable
|
|
182
|
-
style={[StyleSheet.absoluteFill, { zIndex:
|
|
186
|
+
style={[StyleSheet.absoluteFill, { zIndex: 1 }]}
|
|
183
187
|
onPress={closeAction}
|
|
184
188
|
/>
|
|
185
189
|
)}
|
|
186
190
|
|
|
187
191
|
<Animated.View
|
|
188
192
|
style={[styles.avoidingView, contentAnimatedStyle]}
|
|
189
|
-
layout={LinearTransition.springify(
|
|
193
|
+
layout={LinearTransition.springify()
|
|
194
|
+
.stiffness(200)
|
|
195
|
+
.mass(0.5)
|
|
196
|
+
.damping(100)}
|
|
190
197
|
>
|
|
191
|
-
<View
|
|
192
|
-
// layout={LinearTransition}
|
|
193
|
-
style={styles.container}
|
|
194
|
-
>
|
|
198
|
+
<View style={styles.container}>
|
|
195
199
|
{!bare && (
|
|
196
200
|
<View style={styles.title}>
|
|
197
201
|
<View style={styles.titleIcon}>
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { SafeAreaView as Safe } from "react-native";
|
|
1
|
+
import { SafeAreaView as Safe } from "react-native-safe-area-context";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
import { Platform, StyleSheet } from "react-native";
|
|
5
5
|
import { moderateScale } from "react-native-size-matters";
|
|
6
6
|
import { SafeAreaViewProps } from "../types";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated This component is deprecated. Please use the SafeAreaView from react-native-safe-area-context instead.
|
|
10
|
+
*/
|
|
11
|
+
|
|
8
12
|
const styles = StyleSheet.create({
|
|
9
13
|
droidSafeArea: {
|
|
10
14
|
flex: 1,
|
|
11
|
-
paddingTop: Platform.OS === "android" ? moderateScale(35) : 0,
|
|
12
15
|
},
|
|
13
16
|
});
|
|
14
17
|
|