cdslibrary 1.2.65 → 1.2.67

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.
@@ -6,11 +6,11 @@ import { useTheme } from "../context/CDSThemeContext";
6
6
  import { LinearGradient } from 'expo-linear-gradient';
7
7
 
8
8
  // --- NUEVO: Imports de Reanimated y Gesture Handler ---
9
- import Animated, {
10
- useSharedValue,
11
- useAnimatedStyle,
12
- withSpring,
13
- withTiming,
9
+ import Animated, {
10
+ useSharedValue,
11
+ useAnimatedStyle,
12
+ withSpring,
13
+ withTiming,
14
14
  runOnJS,
15
15
  interpolate,
16
16
  Extrapolation, Easing
@@ -69,30 +69,32 @@ const bottomSheetRender = ({
69
69
  if (event.translationY > 200 || event.velocityY > 2000) {
70
70
  handleClose();
71
71
  } else {
72
- // Si no, rebota a posición original
73
- translation.value = withSpring(0, { damping: 15, stiffness: 100 });
72
+ translation.value = withTiming(0, {
73
+ duration: 300,
74
+ easing: Easing.out(Easing.exp),
75
+ });
74
76
  }
75
77
  });
76
78
 
77
79
  // --- 4. Efectos de Entrada/Salida ---
78
80
  useEffect(() => {
79
81
  if (isVisible) {
80
- // Usamos una curva Bezier suave (out-expo) que se frena al final
81
- translation.value = withTiming(0, {
82
+ // Usamos una curva Bezier suave (out-expo) que se frena al final
83
+ translation.value = withTiming(0, {
82
84
  duration: 300,
83
- easing: Easing.out(Easing.exp),
84
- });
85
- opacity.value = withTiming(1, { duration: 200 });
86
- }
87
- }, [isVisible]);
85
+ easing: Easing.out(Easing.exp),
86
+ });
87
+ opacity.value = withTiming(1, { duration: 200 });
88
+ }
89
+ }, [isVisible]);
88
90
 
89
91
  // --- 5. Estilos Animados ---
90
92
  const animatedStyle = useAnimatedStyle(() => {
91
93
  return {
92
94
  opacity: opacity.value,
93
95
  transform: [
94
- isMobile
95
- ? { translateY: translation.value }
96
+ isMobile
97
+ ? { translateY: translation.value }
96
98
  : { translateX: translation.value }
97
99
  ],
98
100
  };
@@ -144,7 +146,7 @@ const bottomSheetRender = ({
144
146
  Se agrega position absolute para NO afectar tus paddings/espacios originales */}
145
147
  {isMobile && (
146
148
  <View style={styles.handleBarContainer}>
147
- <View style={[styles.handleBarLine, { backgroundColor: theme.outline.neutral.tertiary }]} />
149
+ <View style={[styles.handleBarLine, { backgroundColor: theme.outline.neutral.tertiary }]} />
148
150
  </View>
149
151
  )}
150
152
 
@@ -154,14 +156,14 @@ const bottomSheetRender = ({
154
156
  size={theme.typography.icon.lg}
155
157
  color={theme.text.neutral.primary}
156
158
  // Usamos runOnJS porque onPress espera una función normal
157
- onPress={() => runOnJS(handleClose)()}
159
+ onPress={() => runOnJS(handleClose)()}
158
160
  style={{ position: "absolute", right: theme.space.md, top: theme.space.md, zIndex: 10 }}
159
161
  />
160
162
  )}
161
163
 
162
- {!!title && <Text style={[theme.typography.h3, {marginHorizontal: theme.space.md}]}>{title}</Text>}
164
+ {!!title && <Text style={[theme.typography.h3, { marginHorizontal: theme.space.md }]}>{title}</Text>}
163
165
 
164
- <View style={[styles.scrollWrapper, ]}>
166
+ <View style={[styles.scrollWrapper,]}>
165
167
  <ScrollView
166
168
  ref={ref}
167
169
  style={styles.scrollArea}
@@ -186,7 +188,7 @@ const bottomSheetRender = ({
186
188
  </View>
187
189
 
188
190
  {type !== "informative" && (
189
- <View style={[isMobile ? styles.actionsContainer.typeBottomSheet : styles.actionsContainer.typeDrawer, {paddingHorizontal: theme.space.md, paddingVertical: theme.space.lg}]}>
191
+ <View style={[isMobile ? styles.actionsContainer.typeBottomSheet : styles.actionsContainer.typeDrawer, { paddingHorizontal: theme.space.md, paddingVertical: theme.space.lg }]}>
190
192
  <CDSButton
191
193
  label={primaryButtonLabel}
192
194
  onPress={() => runOnJS(handleClose)()}
@@ -33,7 +33,6 @@ export const CDSImageButtonGroup = ({ array, onSelect, isCentered }) => {
33
33
  }),
34
34
  opacity: animatedValue,
35
35
  };
36
- console.log(array.length)
37
36
 
38
37
  return (
39
38
  <Animated.View style={[
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdslibrary",
3
3
  "license": "0BSD",
4
- "version": "1.2.65",
4
+ "version": "1.2.67",
5
5
  "main": "index.js",
6
6
  "author": "Nat Viramontes",
7
7
  "description": "A library of components for the CDS project",