@umituz/react-native-design-system 2.0.3 → 2.0.5
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/package.json +5 -4
- package/src/atoms/AtomicChip.tsx +1 -1
- package/src/atoms/AtomicDatePicker.tsx +0 -1
- package/src/atoms/AtomicInput.tsx +2 -2
- package/src/atoms/AtomicPicker.tsx +2 -3
- package/src/atoms/datepicker/components/DatePickerModal.tsx +0 -1
- package/src/atoms/input/styles/inputStylesHelper.ts +1 -1
- package/src/atoms/picker/components/PickerModal.tsx +0 -1
- package/src/atoms/picker/styles/pickerStyles.ts +1 -1
- package/src/typography/presentation/utils/colorValidationUtils.ts +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -78,13 +78,14 @@
|
|
|
78
78
|
"@eslint/js": "^9.39.2",
|
|
79
79
|
"@expo/vector-icons": "^15.0.0",
|
|
80
80
|
"@gorhom/bottom-sheet": "^5.0.0",
|
|
81
|
-
"@react-native-async-storage/async-storage": "2.2.0",
|
|
82
|
-
"@react-native-community/datetimepicker": "^8.
|
|
81
|
+
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
82
|
+
"@react-native-community/datetimepicker": "^8.5.1",
|
|
83
83
|
"@react-navigation/native": "^6.0.0",
|
|
84
|
+
"@types/jest": "^30.0.0",
|
|
84
85
|
"@types/react": "~19.1.0",
|
|
85
86
|
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
86
87
|
"@typescript-eslint/parser": "^8.50.0",
|
|
87
|
-
"@umituz/react-native-icons": "
|
|
88
|
+
"@umituz/react-native-icons": "^1.1.2",
|
|
88
89
|
"eslint": "^9.39.2",
|
|
89
90
|
"eslint-plugin-react": "^7.37.5",
|
|
90
91
|
"eslint-plugin-react-hooks": "^7.0.1",
|
package/src/atoms/AtomicChip.tsx
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import React from 'react';
|
|
19
|
-
import { View,
|
|
19
|
+
import { View, ViewStyle, TouchableOpacity } from 'react-native';
|
|
20
20
|
import { AtomicText } from './AtomicText';
|
|
21
21
|
import { AtomicIcon } from './AtomicIcon';
|
|
22
22
|
import { useAppDesignTokens } from '../theme';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { View, TextInput, Pressable, StyleSheet, StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
3
|
import { useAppDesignTokens } from '../theme';
|
|
4
4
|
import { AtomicIcon } from './AtomicIcon';
|
|
@@ -107,7 +107,7 @@ export const AtomicInput: React.FC<AtomicInputProps> = ({
|
|
|
107
107
|
isFocused,
|
|
108
108
|
isPasswordVisible,
|
|
109
109
|
characterCount,
|
|
110
|
-
isAtMaxLength,
|
|
110
|
+
isAtMaxLength: _isAtMaxLength,
|
|
111
111
|
setIsFocused,
|
|
112
112
|
handleTextChange,
|
|
113
113
|
togglePasswordVisibility,
|
|
@@ -80,7 +80,7 @@ export const AtomicPicker: React.FC<AtomicPickerProps> = ({
|
|
|
80
80
|
searchable = false,
|
|
81
81
|
clearable = false,
|
|
82
82
|
autoClose = true,
|
|
83
|
-
color = 'primary',
|
|
83
|
+
color: _color = 'primary',
|
|
84
84
|
size = 'md',
|
|
85
85
|
modalTitle,
|
|
86
86
|
emptyMessage = 'No options available',
|
|
@@ -143,10 +143,9 @@ export const AtomicPicker: React.FC<AtomicPickerProps> = ({
|
|
|
143
143
|
|
|
144
144
|
if (multiple) {
|
|
145
145
|
return selectedOptions.length === 1
|
|
146
|
-
? selectedOptions[0]
|
|
146
|
+
? selectedOptions[0]?.label || placeholder
|
|
147
147
|
: `${selectedOptions.length} selected`;
|
|
148
148
|
}
|
|
149
|
-
|
|
150
149
|
return selectedOptions[0]?.label || placeholder;
|
|
151
150
|
}, [selectedOptions, placeholder, multiple]);
|
|
152
151
|
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
17
17
|
import DateTimePicker, { DateTimePickerEvent } from '@react-native-community/datetimepicker';
|
|
18
18
|
import { useAppDesignTokens } from '../../../theme';
|
|
19
|
-
import { AtomicIcon } from '../../AtomicIcon';
|
|
20
19
|
import { AtomicText } from '../../AtomicText';
|
|
21
20
|
|
|
22
21
|
interface DatePickerModalProps {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Extracted from AtomicInput for better separation of concerns.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { ViewStyle
|
|
8
|
+
import { ViewStyle } from 'react-native';
|
|
9
9
|
import { useAppDesignTokens } from '../../../theme';
|
|
10
10
|
import type { AtomicInputVariant, AtomicInputSize } from '../../AtomicInput';
|
|
11
11
|
|
|
@@ -110,7 +110,7 @@ export const getPickerErrorStyles = (tokens: DesignTokens): TextStyle => ({
|
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
// Modal styles
|
|
113
|
-
export const getModalOverlayStyles = (
|
|
113
|
+
export const getModalOverlayStyles = (_tokens: DesignTokens): ViewStyle => ({
|
|
114
114
|
flex: 1,
|
|
115
115
|
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
116
116
|
justifyContent: 'flex-end',
|
|
@@ -44,12 +44,12 @@ export function isValidRgbColor(color: string): boolean {
|
|
|
44
44
|
if (!COLOR_PATTERNS.rgb.test(color)) {
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
// Additional validation for RGB values
|
|
49
49
|
const match = color.match(/\d+/g);
|
|
50
50
|
if (!match || match.length < 3) return false;
|
|
51
|
-
|
|
52
|
-
const [r, g, b] = match.map(Number);
|
|
51
|
+
|
|
52
|
+
const [r = 0, g = 0, b = 0] = match.map(Number);
|
|
53
53
|
return r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -63,12 +63,12 @@ export function isValidHslColor(color: string): boolean {
|
|
|
63
63
|
if (!COLOR_PATTERNS.hsl.test(color)) {
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
// Additional validation for HSL values
|
|
68
68
|
const match = color.match(/\d+/g);
|
|
69
69
|
if (!match || match.length < 3) return false;
|
|
70
|
-
|
|
71
|
-
const [h, s, l] = match.map(Number);
|
|
70
|
+
|
|
71
|
+
const [h = 0, s = 0, l = 0] = match.map(Number);
|
|
72
72
|
return h >= 0 && h <= 360 && s >= 0 && s <= 100 && l >= 0 && l <= 100;
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -89,10 +89,10 @@ export function isValidNamedColor(color: string): boolean {
|
|
|
89
89
|
* @returns True if valid color in any format
|
|
90
90
|
*/
|
|
91
91
|
export function isValidColor(color: string): boolean {
|
|
92
|
-
return isValidHexColor(color) ||
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
return isValidHexColor(color) ||
|
|
93
|
+
isValidRgbColor(color) ||
|
|
94
|
+
isValidHslColor(color) ||
|
|
95
|
+
isValidNamedColor(color);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/**
|