@umituz/react-native-design-system 2.0.3 → 2.0.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
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",
@@ -81,6 +81,7 @@
81
81
  "@react-native-async-storage/async-storage": "2.2.0",
82
82
  "@react-native-community/datetimepicker": "^8.4.4",
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",
@@ -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
- isValidRgbColor(color) ||
94
- isValidHslColor(color) ||
95
- isValidNamedColor(color);
92
+ return isValidHexColor(color) ||
93
+ isValidRgbColor(color) ||
94
+ isValidHslColor(color) ||
95
+ isValidNamedColor(color);
96
96
  }
97
97
 
98
98
  /**