cdslibrary 1.2.81 → 1.2.82

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, { useState, useRef } from "react";
1
+ import React, { useState, useRef, useEffect } from "react";
2
2
  import { View, Text, StyleSheet, TouchableOpacity, Animated } from "react-native";
3
3
  import { MaterialIcons } from "@expo/vector-icons";
4
4
  import { useTheme } from "../context/CDSThemeContext";
@@ -14,7 +14,16 @@ export const CDSCardFeedback = ({
14
14
  }) => {
15
15
  const { theme } = useTheme();
16
16
  const [isVisible, setIsVisible] = useState(true);
17
- const fadeAnim = useRef(new Animated.Value(1)).current;
17
+
18
+ const fadeAnim = useRef(new Animated.Value(0)).current;
19
+
20
+ useEffect(() => {
21
+ Animated.timing(fadeAnim, {
22
+ toValue: 1,
23
+ duration: 400, // Un poco más lento que la salida se siente mejor
24
+ useNativeDriver: false,
25
+ }).start();
26
+ }, []);
18
27
 
19
28
  const handleClose = () => {
20
29
  // IMPORTANTE: useNativeDriver debe ser false para animar maxHeight y padding
@@ -40,14 +49,12 @@ export const CDSCardFeedback = ({
40
49
 
41
50
  const currentStyle = feedbackStyles[style] || feedbackStyles.info;
42
51
 
43
- // Interpolamos todos los valores físicos para que colapsen a 0
44
- const animatedLayout = {
52
+ const animatedLayout = {
53
+ opacity: fadeAnim,
45
54
  maxHeight: fadeAnim.interpolate({
46
55
  inputRange: [0, 1],
47
- outputRange: [0, 600] // Suficiente para el contenido
56
+ outputRange: [0, 600]
48
57
  }),
49
- opacity: fadeAnim,
50
- // Animamos el padding y el margen para que no queden espacios vacíos al cerrar
51
58
  paddingVertical: fadeAnim.interpolate({
52
59
  inputRange: [0, 1],
53
60
  outputRange: [0, theme.space.md]
@@ -56,8 +63,13 @@ export const CDSCardFeedback = ({
56
63
  inputRange: [0, 1],
57
64
  outputRange: [0, theme.space.sm]
58
65
  }),
59
- borderWidth: 1,
60
-
66
+ // También animamos la escala para un efecto más premium
67
+ transform: [{
68
+ scale: fadeAnim.interpolate({
69
+ inputRange: [0, 1],
70
+ outputRange: [0.95, 1]
71
+ })
72
+ }]
61
73
  };
62
74
 
63
75
  return (
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdslibrary",
3
3
  "license": "0BSD",
4
- "version": "1.2.81",
4
+ "version": "1.2.82",
5
5
  "main": "index.js",
6
6
  "author": "Nat Viramontes",
7
7
  "description": "A library of components for the CDS project",