cdslibrary 1.2.46 → 1.2.48

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.
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from "react";
1
+ import React, { useEffect, useState, forwardRef } from "react";
2
2
  import { View, Text, Animated, Dimensions, StyleSheet, Pressable, Platform, ScrollView } from "react-native";
3
3
  import { CDSButton } from "./CDSButton";
4
4
  import { MaterialIcons } from "@expo/vector-icons";
@@ -8,7 +8,7 @@ import { LinearGradient } from 'expo-linear-gradient';
8
8
  const { height, width } = Dimensions.get("window");
9
9
  const isMobile = width <= 878;
10
10
 
11
- export const CDSBottomSheet = ({
11
+ const bottomSheetRender = ({
12
12
  type,
13
13
  isVisible,
14
14
  hasClose,
@@ -19,7 +19,7 @@ export const CDSBottomSheet = ({
19
19
  primaryButtonOnPress,
20
20
  secondaryButtonLabel,
21
21
  onFinish,
22
- }) => {
22
+ }, ref) => {
23
23
  const { theme } = useTheme();
24
24
  const [modalVisible, setModalVisible] = useState(isVisible);
25
25
  const [modalOpacity] = useState(new Animated.Value(0));
@@ -104,6 +104,7 @@ export const CDSBottomSheet = ({
104
104
 
105
105
  <View style={styles.scrollWrapper}>
106
106
  <ScrollView
107
+ ref={ref}
107
108
  style={styles.scrollArea}
108
109
  contentContainerStyle={[styles.scrollContent, { paddingBottom: theme.space.xl }]}
109
110
  showsVerticalScrollIndicator={true}
@@ -189,6 +190,7 @@ const styles = StyleSheet.create({
189
190
  },
190
191
  },
191
192
  scrollWrapper: {
193
+ overflow: 'visible',
192
194
  flex: 1,
193
195
  position: 'relative',
194
196
  width: '100%',
@@ -221,4 +223,7 @@ const styles = StyleSheet.create({
221
223
  marginTop: 'auto',
222
224
  },
223
225
  },
224
- });
226
+ });
227
+
228
+
229
+ export const CDSBottomSheet = forwardRef(bottomSheetRender);
@@ -1,5 +1,5 @@
1
1
  import { useState, useRef } from "react";
2
- import { View, Text, StyleSheet, TouchableOpacity, Platform, Animated } from "react-native";
2
+ import { View, Text, StyleSheet, TouchableOpacity, Platform, Animated, LayoutAnimation } from "react-native";
3
3
 
4
4
 
5
5
  import { MaterialIcons } from "@expo/vector-icons";
@@ -26,11 +26,20 @@ export const CDSCardFeedback = ({
26
26
  useNativeDriver: Platform.OS !== 'web'
27
27
  }).start(() => {
28
28
  // Una vez que la animación termina, ocultar el componente
29
- setIsVisible(false);
29
+ requestAnimationFrame(() => {
30
+ setIsVisible(false);
31
+ if (onClose) onClose();
32
+ });
30
33
  })
31
34
  }
32
35
  if (!isVisible) return null;
33
36
 
37
+
38
+ const maxHeight = fadeAnim.interpolate({
39
+ inputRange: [0, 1],
40
+ outputRange: [0, 1000] // 500 o un valor lo suficientemente alto para tu card
41
+ });
42
+
34
43
  const feedbackStyles = {
35
44
  success: {
36
45
  bg: theme.surface.feedback.success,
@@ -73,6 +82,8 @@ export const CDSCardFeedback = ({
73
82
  padding: theme.space.md,
74
83
  gap: theme.space.sm,
75
84
  opacity: fadeAnim,
85
+ maxHeight: maxHeight, // Esto obligará a la de abajo a subir
86
+ overflow: 'hidden',
76
87
  transform: [{
77
88
  scale: fadeAnim.interpolate({
78
89
  inputRange: [0, 1],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdslibrary",
3
3
  "license": "0BSD",
4
- "version": "1.2.46",
4
+ "version": "1.2.48",
5
5
  "main": "index.js",
6
6
  "author": "Nat Viramontes",
7
7
  "description": "A library of components for the CDS project",