@umituz/react-native-design-system 2.11.0 → 2.11.2
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.11.
|
|
3
|
+
"version": "2.11.2",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -14,10 +14,6 @@ export const getVariantStyles = (
|
|
|
14
14
|
borderWidth: 0,
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const baseTextStyle = {
|
|
18
|
-
color: tokens.colors.textInverse,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
17
|
switch (variant) {
|
|
22
18
|
case 'primary':
|
|
23
19
|
return {
|
|
@@ -26,8 +22,7 @@ export const getVariantStyles = (
|
|
|
26
22
|
backgroundColor: tokens.colors.primary,
|
|
27
23
|
},
|
|
28
24
|
text: {
|
|
29
|
-
|
|
30
|
-
color: tokens.colors.textInverse,
|
|
25
|
+
color: tokens.colors.onPrimary,
|
|
31
26
|
},
|
|
32
27
|
};
|
|
33
28
|
|
|
@@ -38,7 +33,6 @@ export const getVariantStyles = (
|
|
|
38
33
|
backgroundColor: tokens.colors.surfaceSecondary,
|
|
39
34
|
},
|
|
40
35
|
text: {
|
|
41
|
-
...baseTextStyle,
|
|
42
36
|
color: tokens.colors.textPrimary,
|
|
43
37
|
},
|
|
44
38
|
};
|
|
@@ -51,7 +45,6 @@ export const getVariantStyles = (
|
|
|
51
45
|
borderColor: tokens.colors.border,
|
|
52
46
|
},
|
|
53
47
|
text: {
|
|
54
|
-
...baseTextStyle,
|
|
55
48
|
color: tokens.colors.textPrimary,
|
|
56
49
|
},
|
|
57
50
|
};
|
|
@@ -62,7 +55,6 @@ export const getVariantStyles = (
|
|
|
62
55
|
backgroundColor: undefined,
|
|
63
56
|
},
|
|
64
57
|
text: {
|
|
65
|
-
...baseTextStyle,
|
|
66
58
|
color: tokens.colors.primary,
|
|
67
59
|
},
|
|
68
60
|
};
|
|
@@ -74,15 +66,16 @@ export const getVariantStyles = (
|
|
|
74
66
|
backgroundColor: tokens.colors.error,
|
|
75
67
|
},
|
|
76
68
|
text: {
|
|
77
|
-
|
|
78
|
-
color: tokens.colors.textInverse,
|
|
69
|
+
color: tokens.colors.onError,
|
|
79
70
|
},
|
|
80
71
|
};
|
|
81
72
|
|
|
82
73
|
default:
|
|
83
74
|
return {
|
|
84
75
|
container: baseStyle,
|
|
85
|
-
text:
|
|
76
|
+
text: {
|
|
77
|
+
color: tokens.colors.onPrimary,
|
|
78
|
+
},
|
|
86
79
|
};
|
|
87
80
|
}
|
|
88
81
|
};
|
|
@@ -92,6 +92,24 @@ export const DesignSystemProvider: React.FC<DesignSystemProviderProps> = ({
|
|
|
92
92
|
const setGlobalThemeMode = useDesignSystemTheme((state) => state.setThemeMode);
|
|
93
93
|
|
|
94
94
|
useEffect(() => {
|
|
95
|
+
// WARN: customColors is required for proper theming
|
|
96
|
+
if (__DEV__ && !customColors) {
|
|
97
|
+
console.warn(
|
|
98
|
+
'[DesignSystem] ⚠️ customColors is REQUIRED!\n' +
|
|
99
|
+
'Your app must provide theme colors to DesignSystemProvider.\n' +
|
|
100
|
+
'Example:\n' +
|
|
101
|
+
'<DesignSystemProvider\n' +
|
|
102
|
+
' customColors={{\n' +
|
|
103
|
+
' primary: "#FF6B6B",\n' +
|
|
104
|
+
' onPrimary: "#FFFFFF",\n' +
|
|
105
|
+
' backgroundPrimary: "#FFFFFF",\n' +
|
|
106
|
+
' textPrimary: "#1A1A1A",\n' +
|
|
107
|
+
' }}\n' +
|
|
108
|
+
' initialThemeMode="light"\n' +
|
|
109
|
+
'>'
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
95
113
|
// Apply custom colors if provided
|
|
96
114
|
if (customColors) {
|
|
97
115
|
setCustomColors(customColors);
|
|
@@ -104,7 +122,6 @@ export const DesignSystemProvider: React.FC<DesignSystemProviderProps> = ({
|
|
|
104
122
|
initialize()
|
|
105
123
|
.then(async () => {
|
|
106
124
|
// After initialization, set the theme mode from app config
|
|
107
|
-
// This overrides any persisted theme mode if app explicitly sets one
|
|
108
125
|
await setThemeMode(initialThemeMode);
|
|
109
126
|
setIsInitialized(true);
|
|
110
127
|
})
|