cdslibrary 1.2.92 → 1.2.93

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.
@@ -12,7 +12,7 @@ import { useTheme } from "../context/CDSThemeContext";
12
12
 
13
13
  const AnimatedTextInput = Animated.createAnimatedComponent(TextInput);
14
14
 
15
- export const CDSInput = ({ label, type, keyboard, placeholder, value, onChangeText, animationTrigger, returnKeyType, onFocus }) => {
15
+ export const CDSInput = ({ label, type, keyboard, placeholder, value, onChangeText, animationTrigger, onBlur, onFocus }) => {
16
16
  const { theme } = useTheme();
17
17
  const [isFocused, setIsFocused] = useState(false);
18
18
 
@@ -54,13 +54,13 @@ export const CDSInput = ({ label, type, keyboard, placeholder, value, onChangeTe
54
54
  useEffect(() => {
55
55
  // ELIMINAMOS la restricción de !isReadOnly para que se anime siempre
56
56
  if (!isInternalChange.current && value) {
57
- flashValue.value = withDelay(400, withSequence(
58
- withTiming(1, { duration: 400 }),
57
+ flashValue.value = withDelay(300, withSequence(
58
+ withTiming(1, { duration: 300 }),
59
59
  withTiming(0, { duration: 600 })
60
60
  ));
61
61
 
62
62
  textHighlight.value = withSequence(
63
- withTiming(1, { duration: 400 }),
63
+ withTiming(1, { duration: 300 }),
64
64
  withTiming(0, { duration: 600 })
65
65
  );
66
66
  }
@@ -79,8 +79,7 @@ export const CDSInput = ({ label, type, keyboard, placeholder, value, onChangeTe
79
79
 
80
80
  return {
81
81
  borderColor,
82
- borderWidth: 1 + (flashValue.value * 2),
83
- transform: [{ scale: 1 + (flashValue.value * 0.02) }]
82
+ borderWidth: 1 + (flashValue.value * 3),
84
83
  };
85
84
  });
86
85
 
@@ -114,7 +113,8 @@ export const CDSInput = ({ label, type, keyboard, placeholder, value, onChangeTe
114
113
  animatedBoxStyle,
115
114
  {
116
115
  backgroundColor: isReadOnly ? theme.surface.neutral.primaryVariant : theme.surface.neutral.primary,
117
- borderRadius: theme.radius?.sm || 8,
116
+ borderRadius: theme.radius?.sm,
117
+ pointerEvents: isReadOnly ? 'none' : 'auto',
118
118
  }
119
119
  ]}>
120
120
  <AnimatedTextInput
@@ -136,7 +136,10 @@ export const CDSInput = ({ label, type, keyboard, placeholder, value, onChangeTe
136
136
  editable={!isReadOnly}
137
137
  secureTextEntry={type === "password"}
138
138
  onFocus={() => { setIsFocused(true); onFocus && onFocus(); }}
139
- onBlur={() => setIsFocused(false)}
139
+ onBlur={() => {
140
+ setIsFocused(false);
141
+ onBlur && onBlur();
142
+ }}
140
143
  underlineColorAndroid="transparent"
141
144
  />
142
145
  </Animated.View>
@@ -145,14 +148,17 @@ export const CDSInput = ({ label, type, keyboard, placeholder, value, onChangeTe
145
148
  };
146
149
 
147
150
  const styles = StyleSheet.create({
148
- container: { width: "100%", alignSelf: 'stretch' },
151
+ container: {
152
+ width: "100%", alignSelf: 'stretch',
153
+
154
+ },
149
155
  wrapper: {
150
156
  width: '100%',
151
157
  height: 48,
152
158
  flexDirection: 'row',
153
159
  alignItems: 'center',
154
- borderWidth: 1,
155
160
  overflow: 'hidden'
161
+
156
162
  },
157
- textBox: { flex: 1, height: '100%', width: '100%' },
163
+ textBox: { flex: 1, height: '100%', width: '100%', },
158
164
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdslibrary",
3
3
  "license": "0BSD",
4
- "version": "1.2.92",
4
+ "version": "1.2.93",
5
5
  "main": "index.js",
6
6
  "author": "Nat Viramontes",
7
7
  "description": "A library of components for the CDS project",