cdslibrary 1.2.60 → 1.2.62
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.
|
@@ -77,18 +77,13 @@ const bottomSheetRender = ({
|
|
|
77
77
|
// --- 4. Efectos de Entrada/Salida ---
|
|
78
78
|
useEffect(() => {
|
|
79
79
|
if (isVisible) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
opacity.value = withTiming(1, { duration: 300 });
|
|
88
|
-
} else {
|
|
89
|
-
translation.value = withTiming(startPos, { duration: 300 });
|
|
90
|
-
opacity.value = withTiming(0, { duration: 300 });
|
|
91
|
-
}
|
|
80
|
+
// Usamos una curva Bezier suave (out-expo) que se frena al final
|
|
81
|
+
translation.value = withTiming(0, {
|
|
82
|
+
duration: 400,
|
|
83
|
+
easing: Easing.out(Easing.exp),
|
|
84
|
+
});
|
|
85
|
+
opacity.value = withTiming(1, { duration: 300 });
|
|
86
|
+
}
|
|
92
87
|
}, [isVisible]);
|
|
93
88
|
|
|
94
89
|
// --- 5. Estilos Animados ---
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
|
-
import { StyleSheet, Text, TouchableOpacity,
|
|
2
|
+
import { StyleSheet, Text, TouchableOpacity, } from "react-native";
|
|
3
3
|
import Animated, {
|
|
4
4
|
useSharedValue,
|
|
5
5
|
useAnimatedStyle,
|
|
@@ -18,17 +18,11 @@ export const CDSSnackBar = ({ message, visible, onDismiss, action }) => {
|
|
|
18
18
|
// Sincronizar visibilidad con animación
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
if (visible) {
|
|
21
|
-
translateY.value = withSpring(0, {
|
|
22
|
-
damping: 25,
|
|
23
|
-
stiffness: 90,
|
|
24
|
-
overshootClamping: true
|
|
25
|
-
});
|
|
26
|
-
opacity.value = withTiming(1, { duration: 300 });
|
|
21
|
+
translateY.value = withSpring(0, { damping: 15 });
|
|
27
22
|
} else {
|
|
28
|
-
|
|
29
|
-
opacity.value = withTiming(0, { duration: 300 });
|
|
23
|
+
translateY.value = withTiming(150);
|
|
30
24
|
}
|
|
31
|
-
}, [visible
|
|
25
|
+
}, [visible]);
|
|
32
26
|
|
|
33
27
|
// Lógica de auto-ocultado
|
|
34
28
|
useEffect(() => {
|
|
@@ -61,17 +55,9 @@ export const CDSSnackBar = ({ message, visible, onDismiss, action }) => {
|
|
|
61
55
|
}
|
|
62
56
|
});
|
|
63
57
|
|
|
64
|
-
const animatedStyle = useAnimatedStyle(() => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{ translateY: translateY.value }
|
|
68
|
-
],
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
translateY.value = withTiming(visible ? 0 : 150, { duration: 400 });
|
|
74
|
-
}, [visible]);
|
|
58
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
59
|
+
transform: [{ translateY: translateY.value }],
|
|
60
|
+
}));
|
|
75
61
|
|
|
76
62
|
if (!visible && translateY.value >= 100) return null;
|
|
77
63
|
|
|
@@ -119,8 +105,8 @@ const styles = StyleSheet.create({
|
|
|
119
105
|
flexDirection: 'row',
|
|
120
106
|
alignItems: 'center',
|
|
121
107
|
justifyContent: 'space-between',
|
|
122
|
-
bottom: 40,
|
|
123
|
-
zIndex: 9999,
|
|
108
|
+
bottom: 40,
|
|
109
|
+
zIndex: 9999,
|
|
124
110
|
elevation: 10,
|
|
125
111
|
},
|
|
126
112
|
actionButton: {
|