@umituz/react-native-design-system 1.4.3 → 1.7.0
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/README.md +0 -1
- package/lib/index.d.ts +2 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -22
- package/lib/index.js.map +1 -1
- package/lib/presentation/atoms/AtomicButton.d.ts +1 -1
- package/lib/presentation/atoms/AtomicButton.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicButton.js +1 -1
- package/lib/presentation/atoms/AtomicButton.js.map +1 -1
- package/lib/presentation/atoms/AtomicFormError.js +1 -1
- package/lib/presentation/atoms/AtomicFormError.js.map +1 -1
- package/lib/presentation/atoms/AtomicIcon.d.ts +2 -3
- package/lib/presentation/atoms/AtomicIcon.d.ts.map +1 -1
- package/lib/presentation/atoms/AtomicIcon.js +1 -1
- package/lib/presentation/atoms/AtomicIcon.js.map +1 -1
- package/lib/presentation/atoms/AtomicTouchable.js.map +1 -1
- package/lib/presentation/atoms/fab/styles/fabStyles.d.ts +1 -1
- package/lib/presentation/atoms/fab/styles/fabStyles.d.ts.map +1 -1
- package/lib/presentation/atoms/index.d.ts +1 -1
- package/lib/presentation/atoms/picker/styles/pickerStyles.d.ts +4 -15
- package/lib/presentation/atoms/picker/styles/pickerStyles.d.ts.map +1 -1
- package/lib/presentation/atoms/picker/styles/pickerStyles.js.map +1 -1
- package/lib/presentation/hooks/useAppDesignTokens.d.ts +6 -27
- package/lib/presentation/hooks/useAppDesignTokens.d.ts.map +1 -1
- package/lib/presentation/hooks/useAppDesignTokens.js +6 -32
- package/lib/presentation/hooks/useAppDesignTokens.js.map +1 -1
- package/lib/presentation/molecules/AtomicConfirmationModal.d.ts +2 -2
- package/lib/presentation/molecules/AtomicConfirmationModal.d.ts.map +1 -1
- package/lib/presentation/molecules/AtomicConfirmationModal.js +2 -21
- package/lib/presentation/molecules/AtomicConfirmationModal.js.map +1 -1
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts +1 -1
- package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts.map +1 -1
- package/lib/presentation/molecules/confirmation-modal/types/index.d.ts +4 -6
- package/lib/presentation/molecules/confirmation-modal/types/index.d.ts.map +1 -1
- package/lib/presentation/molecules/index.d.ts +0 -1
- package/lib/presentation/molecules/index.d.ts.map +1 -1
- package/lib/presentation/molecules/index.js +0 -1
- package/lib/presentation/molecules/index.js.map +1 -1
- package/lib/presentation/organisms/AppHeader.d.ts +3 -2
- package/lib/presentation/organisms/AppHeader.d.ts.map +1 -1
- package/lib/presentation/organisms/AppHeader.js.map +1 -1
- package/lib/presentation/tokens/commonStyles.d.ts +1 -1
- package/lib/presentation/tokens/commonStyles.js +1 -1
- package/package.json +11 -5
- package/src/index.ts +35 -39
- package/src/presentation/atoms/AtomicBadge.tsx +1 -1
- package/src/presentation/atoms/AtomicButton.tsx +2 -2
- package/src/presentation/atoms/AtomicFormError.tsx +1 -1
- package/src/presentation/atoms/AtomicIcon.tsx +3 -4
- package/src/presentation/atoms/AtomicTouchable.tsx +1 -1
- package/src/presentation/atoms/fab/styles/fabStyles.ts +1 -1
- package/src/presentation/atoms/picker/styles/pickerStyles.ts +25 -5
- package/src/presentation/hooks/useAppDesignTokens.ts +6 -33
- package/src/presentation/molecules/AtomicConfirmationModal.tsx +4 -25
- package/src/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.ts +1 -1
- package/src/presentation/molecules/confirmation-modal/types/index.ts +4 -6
- package/src/presentation/molecules/index.ts +0 -1
- package/src/presentation/organisms/AppHeader.tsx +3 -2
- package/src/presentation/tokens/commonStyles.ts +1 -1
- package/lib/domains/icons/domain/config/IconLibraryConfig.d.ts +0 -91
- package/lib/domains/icons/domain/config/IconLibraryConfig.d.ts.map +0 -1
- package/lib/domains/icons/domain/config/IconLibraryConfig.js +0 -85
- package/lib/domains/icons/domain/config/IconLibraryConfig.js.map +0 -1
- package/lib/domains/icons/domain/entities/Icon.d.ts +0 -111
- package/lib/domains/icons/domain/entities/Icon.d.ts.map +0 -1
- package/lib/domains/icons/domain/entities/Icon.js +0 -87
- package/lib/domains/icons/domain/entities/Icon.js.map +0 -1
- package/lib/domains/icons/domain/interfaces/IIconAdapter.d.ts +0 -114
- package/lib/domains/icons/domain/interfaces/IIconAdapter.d.ts.map +0 -1
- package/lib/domains/icons/domain/interfaces/IIconAdapter.js +0 -17
- package/lib/domains/icons/domain/interfaces/IIconAdapter.js.map +0 -1
- package/lib/domains/icons/index.d.ts +0 -84
- package/lib/domains/icons/index.d.ts.map +0 -1
- package/lib/domains/icons/index.js +0 -89
- package/lib/domains/icons/index.js.map +0 -1
- package/lib/domains/icons/infrastructure/adapters/LucideAdapter.d.ts +0 -24
- package/lib/domains/icons/infrastructure/adapters/LucideAdapter.d.ts.map +0 -1
- package/lib/domains/icons/infrastructure/adapters/LucideAdapter.js +0 -85
- package/lib/domains/icons/infrastructure/adapters/LucideAdapter.js.map +0 -1
- package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.d.ts +0 -23
- package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.d.ts.map +0 -1
- package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.js +0 -178
- package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.js.map +0 -1
- package/lib/domains/icons/presentation/components/Icon.d.ts +0 -42
- package/lib/domains/icons/presentation/components/Icon.d.ts.map +0 -1
- package/lib/domains/icons/presentation/components/Icon.js +0 -86
- package/lib/domains/icons/presentation/components/Icon.js.map +0 -1
- package/lib/domains/icons/presentation/hooks/useIconLibrary.d.ts +0 -38
- package/lib/domains/icons/presentation/hooks/useIconLibrary.d.ts.map +0 -1
- package/lib/domains/icons/presentation/hooks/useIconLibrary.js +0 -114
- package/lib/domains/icons/presentation/hooks/useIconLibrary.js.map +0 -1
- package/lib/infrastructure/theme/globalThemeStore.d.ts +0 -42
- package/lib/infrastructure/theme/globalThemeStore.d.ts.map +0 -1
- package/lib/infrastructure/theme/globalThemeStore.js +0 -38
- package/lib/infrastructure/theme/globalThemeStore.js.map +0 -1
- package/lib/presentation/molecules/LanguageSwitcher.d.ts +0 -10
- package/lib/presentation/molecules/LanguageSwitcher.d.ts.map +0 -1
- package/lib/presentation/molecules/LanguageSwitcher.js +0 -24
- package/lib/presentation/molecules/LanguageSwitcher.js.map +0 -1
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.d.ts +0 -11
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.d.ts.map +0 -1
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.js +0 -6
- package/lib/presentation/molecules/languageswitcher/config/languageSwitcherConfig.js.map +0 -1
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.d.ts +0 -5
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.d.ts.map +0 -1
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.js +0 -14
- package/lib/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.js.map +0 -1
- package/lib/presentation/tokens/AppDesignTokens.d.ts +0 -14
- package/lib/presentation/tokens/AppDesignTokens.d.ts.map +0 -1
- package/lib/presentation/tokens/AppDesignTokens.js +0 -23
- package/lib/presentation/tokens/AppDesignTokens.js.map +0 -1
- package/lib/presentation/tokens/core/BaseTokens.d.ts +0 -312
- package/lib/presentation/tokens/core/BaseTokens.d.ts.map +0 -1
- package/lib/presentation/tokens/core/BaseTokens.js +0 -307
- package/lib/presentation/tokens/core/BaseTokens.js.map +0 -1
- package/lib/presentation/tokens/core/ColorPalette.d.ts +0 -216
- package/lib/presentation/tokens/core/ColorPalette.d.ts.map +0 -1
- package/lib/presentation/tokens/core/ColorPalette.js +0 -330
- package/lib/presentation/tokens/core/ColorPalette.js.map +0 -1
- package/lib/presentation/tokens/core/TokenFactory.d.ts +0 -216
- package/lib/presentation/tokens/core/TokenFactory.d.ts.map +0 -1
- package/lib/presentation/tokens/core/TokenFactory.js +0 -86
- package/lib/presentation/tokens/core/TokenFactory.js.map +0 -1
- package/src/domains/icons/domain/config/IconLibraryConfig.ts +0 -93
- package/src/domains/icons/domain/entities/Icon.ts +0 -143
- package/src/domains/icons/domain/interfaces/IIconAdapter.ts +0 -147
- package/src/domains/icons/index.ts +0 -109
- package/src/domains/icons/infrastructure/adapters/LucideAdapter.ts +0 -100
- package/src/domains/icons/infrastructure/registries/ExpoIconRegistry.ts +0 -191
- package/src/domains/icons/presentation/components/Icon.tsx +0 -132
- package/src/domains/icons/presentation/hooks/useIconLibrary.ts +0 -141
- package/src/infrastructure/theme/globalThemeStore.ts +0 -51
- package/src/presentation/molecules/LanguageSwitcher.tsx +0 -42
- package/src/presentation/molecules/languageswitcher/config/languageSwitcherConfig.ts +0 -5
- package/src/presentation/molecules/languageswitcher/hooks/useLanguageNavigation.ts +0 -16
- package/src/presentation/tokens/AppDesignTokens.ts +0 -55
- package/src/presentation/tokens/core/BaseTokens.ts +0 -376
- package/src/presentation/tokens/core/ColorPalette.ts +0 -400
- package/src/presentation/tokens/core/TokenFactory.ts +0 -118
|
@@ -1,400 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* COLOR PALETTE - THEME-SPECIFIC COLORS
|
|
3
|
-
*
|
|
4
|
-
* ✅ Light and Dark theme color definitions
|
|
5
|
-
* ✅ Semantic color naming for clarity
|
|
6
|
-
* ✅ Template placeholders for factory generation
|
|
7
|
-
* ✅ Type-safe color definitions
|
|
8
|
-
*
|
|
9
|
-
* @module ColorPalette
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
// =============================================================================
|
|
13
|
-
// COLOR UTILITIES
|
|
14
|
-
// =============================================================================
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Add alpha transparency to hex color
|
|
18
|
-
* @param hexColor - Hex color string (#RRGGBB or #RGB)
|
|
19
|
-
* @param alpha - Alpha value 0-1
|
|
20
|
-
* @returns Hex color with alpha (#RRGGBBAA)
|
|
21
|
-
*/
|
|
22
|
-
export const withAlpha = (hexColor: string, alpha: number): string => {
|
|
23
|
-
if (!hexColor.startsWith('#') || (hexColor.length !== 7 && hexColor.length !== 4)) {
|
|
24
|
-
return hexColor;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (alpha < 0 || alpha > 1) {
|
|
28
|
-
return hexColor;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const alphaHex = Math.round(alpha * 255)
|
|
32
|
-
.toString(16)
|
|
33
|
-
.padStart(2, '0');
|
|
34
|
-
|
|
35
|
-
return hexColor + alphaHex;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// =============================================================================
|
|
39
|
-
// LIGHT THEME COLORS
|
|
40
|
-
// =============================================================================
|
|
41
|
-
|
|
42
|
-
export const lightColors = {
|
|
43
|
-
// =============================================================================
|
|
44
|
-
// PRIMARY BRAND COLORS
|
|
45
|
-
// =============================================================================
|
|
46
|
-
primary: '#3B82F6',
|
|
47
|
-
primaryLight: '#60A5FA',
|
|
48
|
-
primaryDark: '#2563EB',
|
|
49
|
-
|
|
50
|
-
secondary: '#8B5CF6',
|
|
51
|
-
secondaryLight: '#A78BFA',
|
|
52
|
-
secondaryDark: '#7C3AED',
|
|
53
|
-
|
|
54
|
-
accent: '#F59E0B',
|
|
55
|
-
accentLight: '#FBBF24',
|
|
56
|
-
accentDark: '#D97706',
|
|
57
|
-
|
|
58
|
-
// =============================================================================
|
|
59
|
-
// MATERIAL DESIGN 3 - ON COLORS (Text on colored backgrounds)
|
|
60
|
-
// =============================================================================
|
|
61
|
-
onPrimary: '#FFFFFF', // Text on primary background
|
|
62
|
-
onSecondary: '#FFFFFF', // Text on secondary background
|
|
63
|
-
onSuccess: '#FFFFFF', // Text on success background
|
|
64
|
-
onError: '#FFFFFF', // Text on error background
|
|
65
|
-
onWarning: '#000000', // Text on warning background
|
|
66
|
-
onInfo: '#FFFFFF', // Text on info background
|
|
67
|
-
onSurface: '#1E293B', // Text on surface
|
|
68
|
-
onBackground: '#1E293B', // Text on background
|
|
69
|
-
onSurfaceDisabled: '#CBD5E1', // Disabled text color
|
|
70
|
-
|
|
71
|
-
// =============================================================================
|
|
72
|
-
// MATERIAL DESIGN 3 - CONTAINER COLORS (Lighter versions for containers)
|
|
73
|
-
// =============================================================================
|
|
74
|
-
primaryContainer: '#DBEAFE', // Light container using primary
|
|
75
|
-
onPrimaryContainer: '#1E40AF', // Text on primary container
|
|
76
|
-
secondaryContainer: '#E0E7FF', // Light container using secondary
|
|
77
|
-
onSecondaryContainer: '#3730A3', // Text on secondary container
|
|
78
|
-
errorContainer: '#FEE2E2', // Light container using error
|
|
79
|
-
onErrorContainer: '#991B1B', // Text on error container
|
|
80
|
-
|
|
81
|
-
// =============================================================================
|
|
82
|
-
// MATERIAL DESIGN 3 - OUTLINE
|
|
83
|
-
// =============================================================================
|
|
84
|
-
outline: '#CBD5E1', // Default outline color
|
|
85
|
-
outlineVariant: '#E2E8F0', // Lighter outline variant
|
|
86
|
-
outlineDisabled: '#E2E8F0', // Disabled outline color
|
|
87
|
-
|
|
88
|
-
// =============================================================================
|
|
89
|
-
// SEMANTIC UI COLORS
|
|
90
|
-
// =============================================================================
|
|
91
|
-
success: '#10B981',
|
|
92
|
-
successLight: '#34D399',
|
|
93
|
-
successDark: '#059669',
|
|
94
|
-
|
|
95
|
-
error: '#EF4444',
|
|
96
|
-
errorLight: '#F87171',
|
|
97
|
-
errorDark: '#DC2626',
|
|
98
|
-
|
|
99
|
-
warning: '#F59E0B',
|
|
100
|
-
warningLight: '#FBBF24',
|
|
101
|
-
warningDark: '#D97706',
|
|
102
|
-
|
|
103
|
-
info: '#3B82F6',
|
|
104
|
-
infoLight: '#60A5FA',
|
|
105
|
-
infoDark: '#2563EB',
|
|
106
|
-
|
|
107
|
-
// =============================================================================
|
|
108
|
-
// SEMANTIC CONTAINER COLORS (Light mode)
|
|
109
|
-
// =============================================================================
|
|
110
|
-
successContainer: '#D1FAE5', // Light container for success states
|
|
111
|
-
onSuccessContainer: '#065F46', // Text on success container
|
|
112
|
-
warningContainer: '#FEF3C7', // Light container for warning states
|
|
113
|
-
onWarningContainer: '#92400E', // Text on warning container
|
|
114
|
-
infoContainer: '#DBEAFE', // Light container for info states
|
|
115
|
-
onInfoContainer: '#1E40AF', // Text on info container
|
|
116
|
-
|
|
117
|
-
// =============================================================================
|
|
118
|
-
// GRAYSCALE PALETTE
|
|
119
|
-
// =============================================================================
|
|
120
|
-
gray50: '#FAFAFA',
|
|
121
|
-
gray100: '#F4F4F5',
|
|
122
|
-
gray200: '#E4E4E7',
|
|
123
|
-
gray300: '#D4D4D8',
|
|
124
|
-
gray400: '#A1A1AA',
|
|
125
|
-
gray500: '#71717A',
|
|
126
|
-
gray600: '#52525B',
|
|
127
|
-
gray700: '#3F3F46',
|
|
128
|
-
gray800: '#27272A',
|
|
129
|
-
gray900: '#18181B',
|
|
130
|
-
|
|
131
|
-
// =============================================================================
|
|
132
|
-
// BACKGROUND COLORS
|
|
133
|
-
// =============================================================================
|
|
134
|
-
backgroundPrimary: '#FFFFFF',
|
|
135
|
-
backgroundSecondary: '#F8FAFC',
|
|
136
|
-
|
|
137
|
-
surface: '#FFFFFF',
|
|
138
|
-
surfaceVariant: '#F1F5F9',
|
|
139
|
-
surfaceSecondary: '#F1F5F9', // Alias
|
|
140
|
-
surfaceDisabled: '#F4F4F5', // Disabled surface color
|
|
141
|
-
|
|
142
|
-
// =============================================================================
|
|
143
|
-
// TEXT COLORS
|
|
144
|
-
// =============================================================================
|
|
145
|
-
textPrimary: '#1E293B',
|
|
146
|
-
textSecondary: '#64748B',
|
|
147
|
-
textTertiary: '#94A3B8',
|
|
148
|
-
textDisabled: '#CBD5E1',
|
|
149
|
-
textInverse: '#FFFFFF',
|
|
150
|
-
|
|
151
|
-
// =============================================================================
|
|
152
|
-
// BORDER COLORS
|
|
153
|
-
// =============================================================================
|
|
154
|
-
border: '#E2E8F0',
|
|
155
|
-
borderLight: '#F1F5F9',
|
|
156
|
-
borderMedium: '#CBD5E1',
|
|
157
|
-
borderFocus: '#3B82F6',
|
|
158
|
-
borderDisabled: '#F1F5F9',
|
|
159
|
-
|
|
160
|
-
// =============================================================================
|
|
161
|
-
// COMPONENT-SPECIFIC COLORS
|
|
162
|
-
// =============================================================================
|
|
163
|
-
buttonPrimary: '#3B82F6',
|
|
164
|
-
buttonSecondary: '#8B5CF6',
|
|
165
|
-
|
|
166
|
-
inputBackground: '#FFFFFF',
|
|
167
|
-
inputBorder: '#E2E8F0',
|
|
168
|
-
|
|
169
|
-
cardBackground: '#FFFFFF',
|
|
170
|
-
|
|
171
|
-
// =============================================================================
|
|
172
|
-
// SPECIAL COLORS
|
|
173
|
-
// =============================================================================
|
|
174
|
-
transparent: 'transparent',
|
|
175
|
-
black: '#000000',
|
|
176
|
-
white: '#FFFFFF',
|
|
177
|
-
|
|
178
|
-
// =============================================================================
|
|
179
|
-
// RGBA OVERLAY COLORS (for modals, cards, etc.)
|
|
180
|
-
// =============================================================================
|
|
181
|
-
modalOverlay: 'rgba(0, 0, 0, 0.5)',
|
|
182
|
-
overlaySubtle: 'rgba(0, 0, 0, 0.05)',
|
|
183
|
-
overlayLight: 'rgba(0, 0, 0, 0.1)',
|
|
184
|
-
overlayMedium: 'rgba(0, 0, 0, 0.3)',
|
|
185
|
-
overlayBackground: 'rgba(0, 0, 0, 0.05)',
|
|
186
|
-
|
|
187
|
-
whiteOverlay: 'rgba(255, 255, 255, 0.2)',
|
|
188
|
-
whiteOverlayStrong: 'rgba(255, 255, 255, 0.95)',
|
|
189
|
-
whiteOverlayBorder: 'rgba(255, 255, 255, 0.5)',
|
|
190
|
-
|
|
191
|
-
textWhiteOpacity: 'rgba(255, 255, 255, 0.8)',
|
|
192
|
-
|
|
193
|
-
errorBackground: 'rgba(239, 68, 68, 0.1)',
|
|
194
|
-
primaryBackground: 'rgba(99, 102, 241, 0.1)',
|
|
195
|
-
|
|
196
|
-
cardOverlay: 'rgba(0, 0, 0, 0.15)',
|
|
197
|
-
|
|
198
|
-
inputBackground_RGBA: 'rgba(248, 250, 252, 0.9)',
|
|
199
|
-
|
|
200
|
-
// =============================================================================
|
|
201
|
-
// SHADOW COLORS - REMOVED (React Native Web incompatibility)
|
|
202
|
-
// NOTE: Use borders and background colors for depth instead
|
|
203
|
-
// =============================================================================
|
|
204
|
-
|
|
205
|
-
// =============================================================================
|
|
206
|
-
// GRADIENTS
|
|
207
|
-
// =============================================================================
|
|
208
|
-
gradient: ['#3B82F6', '#8B5CF6'],
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
// =============================================================================
|
|
212
|
-
// DARK THEME COLORS
|
|
213
|
-
// =============================================================================
|
|
214
|
-
|
|
215
|
-
export const darkColors = {
|
|
216
|
-
// =============================================================================
|
|
217
|
-
// PRIMARY BRAND COLORS (darker versions for dark mode)
|
|
218
|
-
// =============================================================================
|
|
219
|
-
primary: '#60A5FA', // Lighter blue for dark backgrounds
|
|
220
|
-
primaryLight: '#93C5FD',
|
|
221
|
-
primaryDark: '#3B82F6',
|
|
222
|
-
|
|
223
|
-
secondary: '#A78BFA', // Lighter purple for dark backgrounds
|
|
224
|
-
secondaryLight: '#C4B5FD',
|
|
225
|
-
secondaryDark: '#8B5CF6',
|
|
226
|
-
|
|
227
|
-
accent: '#FBBF24', // Lighter amber for dark backgrounds
|
|
228
|
-
accentLight: '#FCD34D',
|
|
229
|
-
accentDark: '#F59E0B',
|
|
230
|
-
|
|
231
|
-
// =============================================================================
|
|
232
|
-
// MATERIAL DESIGN 3 - ON COLORS (Dark mode text colors)
|
|
233
|
-
// =============================================================================
|
|
234
|
-
onPrimary: '#000000', // Dark text on light primary
|
|
235
|
-
onSecondary: '#000000', // Dark text on light secondary
|
|
236
|
-
onSuccess: '#000000', // Dark text on light success
|
|
237
|
-
onError: '#FFFFFF', // Light text on dark error
|
|
238
|
-
onWarning: '#000000', // Dark text on light warning
|
|
239
|
-
onInfo: '#000000', // Dark text on light info
|
|
240
|
-
onSurface: '#E2E8F0', // Light text on dark surface
|
|
241
|
-
onBackground: '#F1F5F9', // Light text on dark background
|
|
242
|
-
onSurfaceDisabled: '#64748B', // Disabled dark mode text
|
|
243
|
-
|
|
244
|
-
// =============================================================================
|
|
245
|
-
// MATERIAL DESIGN 3 - CONTAINER COLORS (Dark mode containers)
|
|
246
|
-
// =============================================================================
|
|
247
|
-
primaryContainer: '#1E3A8A', // Dark blue container
|
|
248
|
-
onPrimaryContainer: '#DBEAFE', // Light text on dark primary container
|
|
249
|
-
secondaryContainer: '#4C1D95', // Dark purple container
|
|
250
|
-
onSecondaryContainer: '#E0E7FF', // Light text on dark secondary container
|
|
251
|
-
errorContainer: '#7F1D1D', // Dark red container
|
|
252
|
-
onErrorContainer: '#FEE2E2', // Light text on dark error container
|
|
253
|
-
|
|
254
|
-
// =============================================================================
|
|
255
|
-
// MATERIAL DESIGN 3 - OUTLINE (Dark mode outlines)
|
|
256
|
-
// =============================================================================
|
|
257
|
-
outline: '#475569', // Medium gray outline for dark mode
|
|
258
|
-
outlineVariant: '#334155', // Darker outline variant
|
|
259
|
-
outlineDisabled: '#334155', // Disabled outline
|
|
260
|
-
|
|
261
|
-
// =============================================================================
|
|
262
|
-
// SEMANTIC UI COLORS (slightly lighter for dark backgrounds)
|
|
263
|
-
// =============================================================================
|
|
264
|
-
success: '#34D399', // Lighter green for dark mode
|
|
265
|
-
successLight: '#34D399',
|
|
266
|
-
successDark: '#059669',
|
|
267
|
-
|
|
268
|
-
error: '#EF4444',
|
|
269
|
-
errorLight: '#F87171',
|
|
270
|
-
errorDark: '#DC2626',
|
|
271
|
-
|
|
272
|
-
warning: '#F59E0B',
|
|
273
|
-
warningLight: '#FBBF24',
|
|
274
|
-
warningDark: '#D97706',
|
|
275
|
-
|
|
276
|
-
info: '#3B82F6',
|
|
277
|
-
infoLight: '#60A5FA',
|
|
278
|
-
infoDark: '#2563EB',
|
|
279
|
-
|
|
280
|
-
// =============================================================================
|
|
281
|
-
// SEMANTIC CONTAINER COLORS (Same as light mode for type consistency)
|
|
282
|
-
// =============================================================================
|
|
283
|
-
successContainer: '#D1FAE5', // Same as light mode for type consistency
|
|
284
|
-
onSuccessContainer: '#065F46', // Same as light mode for type consistency
|
|
285
|
-
warningContainer: '#FEF3C7', // Same as light mode for type consistency
|
|
286
|
-
onWarningContainer: '#92400E', // Same as light mode for type consistency
|
|
287
|
-
infoContainer: '#DBEAFE', // Same as light mode for type consistency
|
|
288
|
-
onInfoContainer: '#1E40AF', // Same as light mode for type consistency
|
|
289
|
-
|
|
290
|
-
// =============================================================================
|
|
291
|
-
// GRAYSCALE PALETTE (Same as light mode for type consistency)
|
|
292
|
-
// =============================================================================
|
|
293
|
-
gray50: '#FAFAFA',
|
|
294
|
-
gray100: '#F4F4F5',
|
|
295
|
-
gray200: '#E4E4E7',
|
|
296
|
-
gray300: '#D4D4D8',
|
|
297
|
-
gray400: '#A1A1AA',
|
|
298
|
-
gray500: '#71717A',
|
|
299
|
-
gray600: '#52525B',
|
|
300
|
-
gray700: '#3F3F46',
|
|
301
|
-
gray800: '#27272A',
|
|
302
|
-
gray900: '#18181B',
|
|
303
|
-
|
|
304
|
-
// =============================================================================
|
|
305
|
-
// BACKGROUND COLORS (dark mode - true dark backgrounds)
|
|
306
|
-
// =============================================================================
|
|
307
|
-
backgroundPrimary: '#0F172A', // Slate 900 - Deep dark background
|
|
308
|
-
backgroundSecondary: '#1E293B', // Slate 800 - Slightly lighter
|
|
309
|
-
|
|
310
|
-
surface: '#1E293B', // Slate 800 - Card/surface backgrounds
|
|
311
|
-
surfaceVariant: '#334155', // Slate 700 - Variant surfaces
|
|
312
|
-
surfaceSecondary: '#334155', // Alias for surfaceVariant
|
|
313
|
-
surfaceDisabled: '#475569', // Slate 600 - Disabled surfaces
|
|
314
|
-
|
|
315
|
-
// =============================================================================
|
|
316
|
-
// TEXT COLORS (dark mode - light text on dark backgrounds)
|
|
317
|
-
// =============================================================================
|
|
318
|
-
textPrimary: '#F1F5F9', // Slate 100 - Primary text (very light)
|
|
319
|
-
textSecondary: '#CBD5E1', // Slate 300 - Secondary text
|
|
320
|
-
textTertiary: '#94A3B8', // Slate 400 - Tertiary text
|
|
321
|
-
textDisabled: '#64748B', // Slate 500 - Disabled text
|
|
322
|
-
textInverse: '#0F172A', // Dark text for light backgrounds
|
|
323
|
-
|
|
324
|
-
// =============================================================================
|
|
325
|
-
// BORDER COLORS (dark mode - subtle borders)
|
|
326
|
-
// =============================================================================
|
|
327
|
-
border: '#334155', // Slate 700 - Default border
|
|
328
|
-
borderLight: '#475569', // Slate 600 - Light border
|
|
329
|
-
borderMedium: '#64748B', // Slate 500 - Medium border
|
|
330
|
-
borderFocus: '#60A5FA', // Blue 400 - Focus border (lighter)
|
|
331
|
-
borderDisabled: '#475569', // Slate 600 - Disabled border
|
|
332
|
-
|
|
333
|
-
// =============================================================================
|
|
334
|
-
// COMPONENT-SPECIFIC COLORS (dark mode specific)
|
|
335
|
-
// =============================================================================
|
|
336
|
-
buttonPrimary: '#60A5FA', // Lighter blue for dark mode
|
|
337
|
-
buttonSecondary: '#A78BFA', // Lighter purple for dark mode
|
|
338
|
-
|
|
339
|
-
inputBackground: '#1E293B', // Dark input background
|
|
340
|
-
inputBorder: '#475569', // Subtle input border
|
|
341
|
-
|
|
342
|
-
cardBackground: '#1E293B', // Dark card background
|
|
343
|
-
|
|
344
|
-
// =============================================================================
|
|
345
|
-
// SPECIAL COLORS
|
|
346
|
-
// =============================================================================
|
|
347
|
-
transparent: 'transparent',
|
|
348
|
-
black: '#000000',
|
|
349
|
-
white: '#FFFFFF',
|
|
350
|
-
|
|
351
|
-
// =============================================================================
|
|
352
|
-
// RGBA OVERLAY COLORS (Same as light mode for type consistency)
|
|
353
|
-
// =============================================================================
|
|
354
|
-
modalOverlay: 'rgba(0, 0, 0, 0.5)',
|
|
355
|
-
overlaySubtle: 'rgba(0, 0, 0, 0.05)',
|
|
356
|
-
overlayLight: 'rgba(0, 0, 0, 0.1)',
|
|
357
|
-
overlayMedium: 'rgba(0, 0, 0, 0.3)',
|
|
358
|
-
overlayBackground: 'rgba(0, 0, 0, 0.05)',
|
|
359
|
-
|
|
360
|
-
whiteOverlay: 'rgba(255, 255, 255, 0.2)',
|
|
361
|
-
whiteOverlayStrong: 'rgba(255, 255, 255, 0.95)',
|
|
362
|
-
whiteOverlayBorder: 'rgba(255, 255, 255, 0.5)',
|
|
363
|
-
|
|
364
|
-
textWhiteOpacity: 'rgba(255, 255, 255, 0.8)',
|
|
365
|
-
|
|
366
|
-
errorBackground: 'rgba(239, 68, 68, 0.1)',
|
|
367
|
-
primaryBackground: 'rgba(99, 102, 241, 0.1)',
|
|
368
|
-
|
|
369
|
-
cardOverlay: 'rgba(0, 0, 0, 0.15)',
|
|
370
|
-
|
|
371
|
-
inputBackground_RGBA: 'rgba(248, 250, 252, 0.9)',
|
|
372
|
-
|
|
373
|
-
// =============================================================================
|
|
374
|
-
// SHADOW COLORS (Same as light mode for type consistency)
|
|
375
|
-
// =============================================================================
|
|
376
|
-
// SHADOW COLORS - REMOVED (React Native Web incompatibility)
|
|
377
|
-
// NOTE: Use borders and background colors for depth instead
|
|
378
|
-
// =============================================================================
|
|
379
|
-
|
|
380
|
-
// =============================================================================
|
|
381
|
-
// GRADIENTS (Same as light mode for type consistency)
|
|
382
|
-
// =============================================================================
|
|
383
|
-
gradient: ['#3B82F6', '#8B5CF6'],
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
// =============================================================================
|
|
387
|
-
// TYPE EXPORTS
|
|
388
|
-
// =============================================================================
|
|
389
|
-
|
|
390
|
-
export type ColorPalette = typeof lightColors;
|
|
391
|
-
export type ThemeMode = 'light' | 'dark';
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Get color palette for specific theme mode
|
|
395
|
-
* @param mode - 'light' or 'dark'
|
|
396
|
-
* @returns Color palette object
|
|
397
|
-
*/
|
|
398
|
-
export const getColorPalette = (mode: ThemeMode): ColorPalette => {
|
|
399
|
-
return mode === 'dark' ? darkColors : lightColors;
|
|
400
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TOKEN FACTORY - THEME INJECTION LOGIC
|
|
3
|
-
*
|
|
4
|
-
* ✅ Factory Pattern for creating complete design tokens
|
|
5
|
-
* ✅ Combines static tokens (BaseTokens) + dynamic colors (ColorPalette)
|
|
6
|
-
* ✅ Type-safe token generation
|
|
7
|
-
* ✅ Zero duplication - SINGLE SOURCE OF TRUTH
|
|
8
|
-
*
|
|
9
|
-
* @module TokenFactory
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { BASE_TOKENS } from './BaseTokens';
|
|
13
|
-
import { getColorPalette, withAlpha, type ThemeMode, type ColorPalette } from './ColorPalette';
|
|
14
|
-
|
|
15
|
-
// =============================================================================
|
|
16
|
-
// DESIGN TOKENS TYPE
|
|
17
|
-
// =============================================================================
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Complete design tokens shape
|
|
21
|
-
* Combines static tokens (spacing, typography, borders) + dynamic colors
|
|
22
|
-
*/
|
|
23
|
-
export type DesignTokens = {
|
|
24
|
-
colors: ColorPalette;
|
|
25
|
-
spacing: typeof BASE_TOKENS.spacing;
|
|
26
|
-
typography: typeof BASE_TOKENS.typography;
|
|
27
|
-
iconSizes: typeof BASE_TOKENS.iconSizes;
|
|
28
|
-
opacity: typeof BASE_TOKENS.opacity;
|
|
29
|
-
avatarSizes: typeof BASE_TOKENS.avatarSizes;
|
|
30
|
-
borders: typeof BASE_TOKENS.borders & {
|
|
31
|
-
card: typeof BASE_TOKENS.borders.card & { borderColor: string };
|
|
32
|
-
input: typeof BASE_TOKENS.borders.input & { borderColor: string };
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// =============================================================================
|
|
37
|
-
// TOKEN FACTORY FUNCTION
|
|
38
|
-
// =============================================================================
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Create complete design tokens for a specific theme mode
|
|
42
|
-
*
|
|
43
|
-
* @param mode - Theme mode ('light' or 'dark')
|
|
44
|
-
* @returns Complete design tokens object
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* const lightTokens = createDesignTokens('light');
|
|
49
|
-
* const darkTokens = createDesignTokens('dark');
|
|
50
|
-
*
|
|
51
|
-
* // Use in components
|
|
52
|
-
* <View style={{ backgroundColor: lightTokens.colors.primary }}>
|
|
53
|
-
* <Text style={lightTokens.typography.bodyLarge}>Hello!</Text>
|
|
54
|
-
* </View>
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export const createDesignTokens = (mode: ThemeMode): DesignTokens => {
|
|
58
|
-
// Get color palette for theme mode
|
|
59
|
-
const colors = getColorPalette(mode);
|
|
60
|
-
|
|
61
|
-
// Combine static tokens + dynamic colors
|
|
62
|
-
return {
|
|
63
|
-
// ✅ DYNAMIC: Colors from theme mode
|
|
64
|
-
colors,
|
|
65
|
-
|
|
66
|
-
// ✅ STATIC: These don't change with theme
|
|
67
|
-
spacing: BASE_TOKENS.spacing,
|
|
68
|
-
typography: BASE_TOKENS.typography,
|
|
69
|
-
iconSizes: BASE_TOKENS.iconSizes,
|
|
70
|
-
opacity: BASE_TOKENS.opacity,
|
|
71
|
-
avatarSizes: BASE_TOKENS.avatarSizes,
|
|
72
|
-
|
|
73
|
-
// ✅ BORDERS: Static + injected border colors from theme
|
|
74
|
-
borders: {
|
|
75
|
-
...BASE_TOKENS.borders,
|
|
76
|
-
card: {
|
|
77
|
-
...BASE_TOKENS.borders.card,
|
|
78
|
-
borderColor: colors.border,
|
|
79
|
-
},
|
|
80
|
-
input: {
|
|
81
|
-
...BASE_TOKENS.borders.input,
|
|
82
|
-
borderColor: colors.border,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// =============================================================================
|
|
89
|
-
// STATIC TOKEN INSTANCES (for non-React contexts)
|
|
90
|
-
// =============================================================================
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* STATIC DESIGN TOKENS - LIGHT THEME ONLY
|
|
94
|
-
*
|
|
95
|
-
* ⚠️ WARNING: These are STATIC and use light theme colors only!
|
|
96
|
-
* ⚠️ DO NOT USE in React components - use useAppDesignTokens() hook instead
|
|
97
|
-
*
|
|
98
|
-
* Only use these in:
|
|
99
|
-
* - Utility functions
|
|
100
|
-
* - Constants files
|
|
101
|
-
* - Non-React JavaScript code
|
|
102
|
-
*
|
|
103
|
-
* @deprecated Use useAppDesignTokens() hook in React components
|
|
104
|
-
*/
|
|
105
|
-
export const STATIC_DESIGN_TOKENS = createDesignTokens('light');
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* STATIC TOKENS (spacing, typography, borders)
|
|
109
|
-
* These DON'T change with theme - safe to use anywhere
|
|
110
|
-
*/
|
|
111
|
-
export const STATIC_TOKENS = BASE_TOKENS;
|
|
112
|
-
|
|
113
|
-
// =============================================================================
|
|
114
|
-
// UTILITY EXPORTS
|
|
115
|
-
// =============================================================================
|
|
116
|
-
|
|
117
|
-
export { withAlpha };
|
|
118
|
-
export type { ThemeMode, ColorPalette };
|