cdslibrary 1.2.57 → 1.2.59

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.
@@ -13,7 +13,7 @@ import Animated, {
13
13
  withTiming,
14
14
  runOnJS,
15
15
  interpolate,
16
- Extrapolation
16
+ Extrapolation, Easing
17
17
  } from "react-native-reanimated";
18
18
  import { GestureDetector, Gesture } from "react-native-gesture-handler";
19
19
 
@@ -77,14 +77,19 @@ const bottomSheetRender = ({
77
77
  // --- 4. Efectos de Entrada/Salida ---
78
78
  useEffect(() => {
79
79
  if (isVisible) {
80
- translation.value = withSpring(0, { damping: 19 });
80
+ // SOLUCIÓN: Aumentamos damping a 30 (frena más fuerte)
81
+ // Opcional: overshootClamping: true (prohíbe pasarse de la línea)
82
+ translation.value = withSpring(0, {
83
+ damping: 30, // <--- Antes era 15. Súbelo entre 25 y 30.
84
+ stiffness: 90,
85
+ overshootClamping: false // Ponlo en true si aun así rebota
86
+ });
81
87
  opacity.value = withTiming(1, { duration: 300 });
82
88
  } else {
83
- // Si se controla false desde fuera
84
89
  translation.value = withTiming(startPos, { duration: 300 });
85
90
  opacity.value = withTiming(0, { duration: 300 });
86
91
  }
87
- }, [isVisible, isMobile]);
92
+ }, [isVisible, isMobile]);
88
93
 
89
94
  // --- 5. Estilos Animados ---
90
95
  const animatedStyle = useAnimatedStyle(() => {
@@ -127,7 +132,7 @@ const bottomSheetRender = ({
127
132
  {
128
133
  backgroundColor: theme.surface.neutral.primary,
129
134
  // Mantenemos tu lógica exacta de padding y gaps
130
- paddingTop: (hasClose ? theme.space['2xl'] : theme.space.md),
135
+ paddingTop: (hasClose ? theme.space['2xl'] : theme.space.lg),
131
136
  gap: theme.space.md,
132
137
  ...(isMobile ? {
133
138
  borderTopLeftRadius: theme.radius.lg,
@@ -23,10 +23,12 @@ export const CDSSnackBar = ({ message, visible, onDismiss, action }) => {
23
23
  stiffness: 90,
24
24
  overshootClamping: true
25
25
  });
26
+ opacity.value = withTiming(1, { duration: 300 });
26
27
  } else {
27
- translateY.value = withTiming(150);
28
+ translation.value = withTiming(startPos, { duration: 300 });
29
+ opacity.value = withTiming(0, { duration: 300 });
28
30
  }
29
- }, [visible]);
31
+ }, [visible, isMobile]);
30
32
 
31
33
  // Lógica de auto-ocultado
32
34
  useEffect(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdslibrary",
3
3
  "license": "0BSD",
4
- "version": "1.2.57",
4
+ "version": "1.2.59",
5
5
  "main": "index.js",
6
6
  "author": "Nat Viramontes",
7
7
  "description": "A library of components for the CDS project",