ikualo-ui-kit-mobile 2.1.15 → 2.1.17

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.
package/app.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "ikualo-app-2.0",
4
4
  "slug": "ikualo-app-20",
5
5
  "owner": "ikualo",
6
- "version": "2.1.15",
6
+ "version": "2.1.17",
7
7
  "orientation": "portrait",
8
8
  "icon": "./assets/icon.png",
9
9
  "userInterfaceStyle": "automatic",
@@ -140,6 +140,7 @@ const getStylesBtnLightSmall = (theme: ITheme) =>
140
140
  },
141
141
  'btn-light-small__container-main': { alignItems: 'center', width: 'auto' },
142
142
  'btn-light-small__text': { textAlign: 'center', width: 'auto', marginTop: 5 },
143
+ 'btn-light-small__text--disabled': { opacity: 0.25 },
143
144
  'btn-light-small--transparent': {
144
145
  backgroundColor: theme.colors.transparent,
145
146
  borderColor: theme.colors.icon,
@@ -158,9 +159,9 @@ const getStylesBtnLightSmall = (theme: ITheme) =>
158
159
  fontSize: 24,
159
160
  },
160
161
  'btn-light-small--disabled': {
161
- backgroundColor: theme.colors.background_btn_disabled,
162
- borderColor: theme.colors.icon_disabled,
163
- borderRadius: 8,
162
+ backgroundColor: theme.colors.background_focus,
163
+ borderColor: theme.colors.icon,
164
+ opacity: 0.25,
164
165
  borderWidth: 1,
165
166
  maxWidth: 50,
166
167
  minWidth: 50,
@@ -251,10 +252,10 @@ const getStylesButtonActionCircle = (theme: ITheme) =>
251
252
  });
252
253
 
253
254
  export {
255
+ getStylesBtnLightSmall,
256
+ getStylesButtonActionCircle,
257
+ getStylesButtonCircle,
254
258
  getStylesButtonContained,
255
259
  getStylesButtonOutlined,
256
260
  getStylesButtonText,
257
- getStylesBtnLightSmall,
258
- getStylesButtonCircle,
259
- getStylesButtonActionCircle,
260
261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ikualo-ui-kit-mobile",
3
- "version": "2.1.15",
3
+ "version": "2.1.17",
4
4
  "main": "src/index.ts",
5
5
  "scripts": {
6
6
  "start": "expo start",
@@ -1,11 +1,10 @@
1
+ import React, { cloneElement } from 'react';
2
+ import { View } from 'react-native';
1
3
  import { ActivityIndicator, Button } from 'react-native-paper';
4
+ import { Text } from '../../';
2
5
  import { getStylesBtnLightSmall } from '../../../assets/styles/elements/buttons';
3
- import { View } from 'react-native';
4
- import { cloneElement } from 'react';
5
- import useStore from '../../store';
6
6
  import { IBtnLightSmall } from '../../models';
7
- import React from 'react';
8
- import { Text } from '../../';
7
+ import useStore from '../../store';
9
8
 
10
9
  export const BtnLightSmall = (props: IBtnLightSmall) => {
11
10
  const theme = useStore().theme;
@@ -14,8 +13,6 @@ export const BtnLightSmall = (props: IBtnLightSmall) => {
14
13
  const { onPress, icon, disabled = false, active, isLoading, text, transparent, maxWidth, iconSize } = props;
15
14
  const color = active
16
15
  ? stylesBtnLightSmall['btn-light-small--active'].borderColor
17
- : disabled
18
- ? theme.colors.border_disabled
19
16
  : stylesBtnLightSmall['btn-light-small--primary'].borderColor;
20
17
 
21
18
  const colorBtnText = active ? theme.colors.freezed : theme.colors.text_p;
@@ -56,7 +53,11 @@ export const BtnLightSmall = (props: IBtnLightSmall) => {
56
53
  </Button>
57
54
  {text && (
58
55
  <Text
59
- style={[stylesBtnLightSmall['btn-light-small__text'], { maxWidth: maxWidth || 'auto' }]}
56
+ style={[
57
+ stylesBtnLightSmall['btn-light-small__text'],
58
+ { maxWidth: maxWidth || 'auto' },
59
+ disabled && stylesBtnLightSmall['btn-light-small__text--disabled'],
60
+ ]}
60
61
  color={colorBtnText}
61
62
  lineHeight={15}
62
63
  fontWeight="MontserratSemiBold600"
@@ -1,6 +1,6 @@
1
1
  import { HelperText, TextInput, Text } from 'react-native-paper';
2
2
  import { getStyleInput } from '../../../assets/styles/elements/inputs';
3
- import { useState, useCallback, useEffect, useRef } from 'react';
3
+ import { useState } from 'react';
4
4
  import { View } from 'react-native';
5
5
  import React from 'react';
6
6
  import useStore from '../../store';
@@ -43,64 +43,25 @@ export const Input = (props: IInputText) => {
43
43
  const patternNumber = /^[0-9]*$/;
44
44
  const patternAlphanumeric = /^[a-zA-Z0-9]*$/;
45
45
  const patternLettersWithAccentsAndSpaces = /^[a-zA-ZáéíóúÁÉÍÓÚñÑ\s]*$/;
46
-
47
- // Normalizar el valor para asegurar que siempre sea una cadena
48
- const normalizedValue = value ?? '';
49
- const stringValue = typeof normalizedValue === 'string' ? normalizedValue : String(normalizedValue);
50
-
51
- // Estado local para controlar el valor del input
52
- const [localValue, setLocalValue] = useState<string>(stringValue);
53
- const isUserTypingRef = useRef<boolean>(false);
54
- const lastPropValueRef = useRef<string>(stringValue);
55
-
56
- // Sincronizar el estado local con el prop value cuando cambia desde fuera
57
- // Solo si el usuario no está escribiendo
58
- useEffect(() => {
59
- if (!isUserTypingRef.current && stringValue !== lastPropValueRef.current) {
60
- lastPropValueRef.current = stringValue;
61
- setLocalValue(stringValue);
46
+ const onChangeText = (text: string) => {
47
+ onChange(text);
48
+ setErrorRequired(false);
49
+ if (type === 'number' && !patternNumber.test(text)) {
50
+ onInvalid && onInvalid();
51
+ } else if (type === 'alphanumeric' && !patternAlphanumeric.test(text)) {
52
+ onInvalid && onInvalid();
53
+ } else if (type === 'text' && !patternLettersWithAccentsAndSpaces.test(text)) {
54
+ onInvalid && onInvalid();
55
+ } else if (pattern && !pattern.test(text)) {
56
+ onInvalid && onInvalid();
62
57
  }
63
- }, [stringValue]);
64
-
65
- const onChangeText = useCallback(
66
- (text: string) => {
67
- // Asegurar que el texto sea una cadena
68
- const cleanText = typeof text === 'string' ? text : String(text);
69
-
70
- // Marcar que el usuario está escribiendo
71
- isUserTypingRef.current = true;
72
-
73
- // Actualizar el estado local inmediatamente
74
- setLocalValue(cleanText);
75
- lastPropValueRef.current = cleanText;
76
-
77
- // Pasar el texto directamente al onChange
78
- onChange(cleanText);
79
-
80
- // Resetear el flag después de un breve delay
81
- setTimeout(() => {
82
- isUserTypingRef.current = false;
83
- }, 50);
84
-
85
- setErrorRequired(false);
86
- if (type === 'number' && !patternNumber.test(cleanText)) {
87
- onInvalid && onInvalid();
88
- } else if (type === 'alphanumeric' && !patternAlphanumeric.test(cleanText)) {
89
- onInvalid && onInvalid();
90
- } else if (type === 'text' && !patternLettersWithAccentsAndSpaces.test(cleanText)) {
91
- onInvalid && onInvalid();
92
- } else if (pattern && !pattern.test(cleanText)) {
93
- onInvalid && onInvalid();
94
- }
95
- },
96
- [onChange, type, pattern, onInvalid]
97
- );
58
+ };
98
59
  return (
99
60
  <View>
100
61
  <TextInput
101
- label={!isFocus && placeholder && (!value || value.trim() === '') ? placeholder : label}
62
+ label={!isFocus && placeholder && value?.trim() === '' ? placeholder : label}
102
63
  mode={mode ?? 'flat'}
103
- value={localValue}
64
+ value={value}
104
65
  onChangeText={onChangeText}
105
66
  maxLength={maxLength}
106
67
  selectionColor={
@@ -134,7 +95,7 @@ export const Input = (props: IInputText) => {
134
95
  isFocus && isValid && !errorRequired && { backgroundColor: 'transparent' },
135
96
  style ?? [],
136
97
  ]}
137
- contentStyle={[styleInput['input-txt'], contentStyle ?? []]}
98
+ contentStyle={[styleInput['input-txt'], contentStyle ?? {}]}
138
99
  underlineColor={
139
100
  underlineColor
140
101
  ? underlineColor
@@ -145,7 +106,7 @@ export const Input = (props: IInputText) => {
145
106
  activeUnderlineColor={
146
107
  activeUnderlineColor
147
108
  ? activeUnderlineColor
148
- : !isValid && value && value.trim() !== ''
109
+ : !isValid && value?.trim() !== ''
149
110
  ? styleInput['input-text--activeUnderline'].color
150
111
  : errorRequired
151
112
  ? styleInput['input-txt-error'].color
@@ -153,14 +114,9 @@ export const Input = (props: IInputText) => {
153
114
  }
154
115
  underlineStyle={{ height: isFocus ? 1.5 : 2 }}
155
116
  keyboardType={type === 'number' ? 'numeric' : 'default'}
156
- autoCorrect={false}
157
- autoCapitalize="none"
158
- autoComplete="off"
159
- textContentType="none"
160
- spellCheck={false}
161
117
  right={icon && <TextInput.Icon color={theme.colors.icon} icon={icon ?? ''} />}
162
- disabled={isDisabled}
163
- readOnly={readonly}
118
+ readOnly={isDisabled || readonly}
119
+ selection={selection}
164
120
  />
165
121
  {!isDisabled && (
166
122
  <>