@umituz/react-native-design-system 1.0.0 → 1.0.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,9 +1,14 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Universal design system for React Native apps - Domain-Driven Design architecture with Material Design 3 components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
7
+ "scripts": {
8
+ "version:patch": "npm version patch -m 'chore: release v%s'",
9
+ "version:minor": "npm version minor -m 'chore: release v%s'",
10
+ "version:major": "npm version major -m 'chore: release v%s'"
11
+ },
7
12
  "keywords": [
8
13
  "react-native",
9
14
  "design-system",
@@ -13,19 +18,20 @@
13
18
  "ddd",
14
19
  "domain-driven-design"
15
20
  ],
16
- "author": "Umit Uz",
21
+ "author": "Ümit UZ <umit@umituz.com>",
17
22
  "license": "MIT",
18
23
  "repository": {
19
24
  "type": "git",
20
25
  "url": "https://github.com/umituz/react-native-design-system"
21
26
  },
22
27
  "peerDependencies": {
23
- "react": "18.3.1",
24
- "react-native": "0.76.3",
28
+ "react": ">=18.2.0",
29
+ "react-native": ">=0.74.0",
25
30
  "react-native-paper": "^5.12.5",
26
31
  "react-native-reanimated": "~3.10.1",
27
32
  "@react-native-community/datetimepicker": "8.0.1",
28
- "@expo/vector-icons": "^14.0.0"
33
+ "@expo/vector-icons": "^14.0.0",
34
+ "lucide-react-native": "^0.468.0"
29
35
  },
30
36
  "peerDependenciesMeta": {
31
37
  "@react-native-community/datetimepicker": {
@@ -1,43 +1,17 @@
1
1
  /**
2
- * useAppDesignTokens Hook - Dynamic Theme-Aware Design Tokens
2
+ * useAppDesignTokens Hook - Design Tokens Access
3
3
  *
4
- * ✅ ZERO DUPLICATION - Uses TokenFactory (Single Source of Truth)
5
- * ✅ DYNAMIC theme switching (light/dark)
4
+ * ✅ NPM PACKAGE VERSION - Standalone, no theme dependencies
5
+ * ✅ Returns static light theme tokens
6
6
  * ✅ Type-safe design tokens
7
- * ✅ Automatic re-render on theme change
8
- * ✅ Graceful fallback to light theme
9
- * ✅ NO CIRCULAR DEPENDENCY - Relative imports break barrel export cycle
7
+ * ✅ Zero external dependencies
10
8
  *
11
- * CRITICAL: Uses RELATIVE imports to break circular dependency!
12
- * - Relative import for useTheme (not barrel '@domains/theme')
13
- * - Relative import for TokenFactory (not barrel through AppDesignTokens)
14
- * - NOT exported from AppDesignTokens.ts (only from design-system/index.ts)
15
- *
16
- * This architecture prevents cycle:
17
- * - useAppDesignTokens → useTheme (relative, not through barrel)
18
- * - theme → design-system (through barrel, but useAppDesignTokens not in token barrel)
19
- * - No cycle detected!
20
- *
21
- * @module useAppDesignTokens
22
- */
23
-
24
- import { useMemo } from 'react';
25
- import { useTheme } from '../../../theme/infrastructure/stores/themeStore';
26
- import { createDesignTokens, STATIC_DESIGN_TOKENS, type ThemeMode } from '../tokens/core/TokenFactory';
27
-
28
- /**
29
- * 🎯 DYNAMIC DESIGN TOKENS HOOK
30
- *
31
- * USE THIS HOOK in all components for theme-aware design tokens!
32
- *
33
- * ✅ Colors are DYNAMIC (update when theme changes)
34
- * ✅ Typography, spacing, etc. are STATIC (performance optimization)
35
- * ✅ Automatic re-render on theme change
36
- * ✅ Zero duplication (uses TokenFactory)
9
+ * NOTE: This is the npm package version which returns light theme only.
10
+ * For dynamic theme switching, apps should use @domains/theme ThemeProvider.
37
11
  *
38
12
  * @example
39
13
  * ```typescript
40
- * import { useAppDesignTokens } from '@domains/design-system';
14
+ * import { useAppDesignTokens } from '@umituz/react-native-design-system';
41
15
  *
42
16
  * const MyComponent = () => {
43
17
  * const tokens = useAppDesignTokens();
@@ -53,26 +27,11 @@ import { createDesignTokens, STATIC_DESIGN_TOKENS, type ThemeMode } from '../tok
53
27
  * };
54
28
  * ```
55
29
  */
56
- export const useAppDesignTokens = () => {
57
- // ✅ Hooks must be called unconditionally at the top level
58
- const { theme, themeMode: mode } = useTheme();
59
30
 
60
- return useMemo(() => {
61
- try {
62
- // Validate theme mode
63
- const themeMode: ThemeMode = mode === 'dark' ? 'dark' : 'light';
31
+ import { STATIC_DESIGN_TOKENS } from '../tokens/core/TokenFactory';
64
32
 
65
- // Validate theme colors exist
66
- if (!theme?.colors || typeof theme.colors !== 'object' || !theme.colors.primary) {
67
- console.warn('useAppDesignTokens: Invalid theme, using light theme fallback');
68
- return STATIC_DESIGN_TOKENS; // Fallback to light theme
69
- }
70
-
71
- // ✅ Create tokens using TokenFactory (ZERO duplication!)
72
- return createDesignTokens(themeMode);
73
- } catch (error) {
74
- console.warn('useAppDesignTokens: Error accessing theme, using fallback:', error);
75
- return STATIC_DESIGN_TOKENS; // Fallback to light theme
76
- }
77
- }, [theme?.colors, mode]); // Re-compute when colors or mode changes
33
+ export const useAppDesignTokens = () => {
34
+ // NPM package version: Always return light theme
35
+ // Apps using factory generator will override this with theme-aware version
36
+ return STATIC_DESIGN_TOKENS;
78
37
  };
@@ -41,19 +41,19 @@ export const withAlpha = (hexColor: string, alpha: number): string => {
41
41
 
42
42
  export const lightColors = {
43
43
  // =============================================================================
44
- // PRIMARY BRAND COLORS (from theme template)
44
+ // PRIMARY BRAND COLORS
45
45
  // =============================================================================
46
- primary: '{{PRIMARY_COLOR}}',
47
- primaryLight: '{{PRIMARY_LIGHT_COLOR}}',
48
- primaryDark: '{{PRIMARY_DARK_COLOR}}',
46
+ primary: '#3B82F6',
47
+ primaryLight: '#60A5FA',
48
+ primaryDark: '#2563EB',
49
49
 
50
- secondary: '{{SECONDARY_COLOR}}',
51
- secondaryLight: '{{SECONDARY_LIGHT_COLOR}}',
52
- secondaryDark: '{{SECONDARY_DARK_COLOR}}',
50
+ secondary: '#8B5CF6',
51
+ secondaryLight: '#A78BFA',
52
+ secondaryDark: '#7C3AED',
53
53
 
54
- accent: '{{ACCENT_COLOR}}',
55
- accentLight: '{{ACCENT_LIGHT_COLOR}}',
56
- accentDark: '{{ACCENT_DARK_COLOR}}',
54
+ accent: '#F59E0B',
55
+ accentLight: '#FBBF24',
56
+ accentDark: '#D97706',
57
57
 
58
58
  // =============================================================================
59
59
  // MATERIAL DESIGN 3 - ON COLORS (Text on colored backgrounds)
@@ -129,43 +129,43 @@ export const lightColors = {
129
129
  gray900: '#18181B',
130
130
 
131
131
  // =============================================================================
132
- // BACKGROUND COLORS (from theme template)
132
+ // BACKGROUND COLORS
133
133
  // =============================================================================
134
- backgroundPrimary: '{{BACKGROUND_COLOR}}',
135
- backgroundSecondary: '{{BACKGROUND_SECONDARY_COLOR}}',
134
+ backgroundPrimary: '#FFFFFF',
135
+ backgroundSecondary: '#F8FAFC',
136
136
 
137
- surface: '{{SURFACE_COLOR}}',
138
- surfaceVariant: '{{SURFACE_SECONDARY_COLOR}}',
139
- surfaceSecondary: '{{SURFACE_SECONDARY_COLOR}}', // Alias
137
+ surface: '#FFFFFF',
138
+ surfaceVariant: '#F1F5F9',
139
+ surfaceSecondary: '#F1F5F9', // Alias
140
140
  surfaceDisabled: '#F4F4F5', // Disabled surface color
141
141
 
142
142
  // =============================================================================
143
- // TEXT COLORS (from theme template)
143
+ // TEXT COLORS
144
144
  // =============================================================================
145
- textPrimary: '{{TEXT_PRIMARY_COLOR}}',
146
- textSecondary: '{{TEXT_SECONDARY_COLOR}}',
147
- textTertiary: '{{TEXT_TERTIARY_COLOR}}',
148
- textDisabled: '{{TEXT_DISABLED_COLOR}}',
149
- textInverse: '{{TEXT_INVERSE_COLOR}}',
145
+ textPrimary: '#1E293B',
146
+ textSecondary: '#64748B',
147
+ textTertiary: '#94A3B8',
148
+ textDisabled: '#CBD5E1',
149
+ textInverse: '#FFFFFF',
150
150
 
151
151
  // =============================================================================
152
- // BORDER COLORS (from theme template)
152
+ // BORDER COLORS
153
153
  // =============================================================================
154
- border: '{{BORDER_COLOR}}',
155
- borderLight: '{{BORDER_LIGHT_COLOR}}',
156
- borderMedium: '{{BORDER_MEDIUM_COLOR}}',
157
- borderFocus: '{{BORDER_FOCUS_COLOR}}',
154
+ border: '#E2E8F0',
155
+ borderLight: '#F1F5F9',
156
+ borderMedium: '#CBD5E1',
157
+ borderFocus: '#3B82F6',
158
158
 
159
159
  // =============================================================================
160
160
  // COMPONENT-SPECIFIC COLORS
161
161
  // =============================================================================
162
- buttonPrimary: '{{PRIMARY_COLOR}}',
163
- buttonSecondary: '{{SECONDARY_COLOR}}',
162
+ buttonPrimary: '#3B82F6',
163
+ buttonSecondary: '#8B5CF6',
164
164
 
165
- inputBackground: '{{SURFACE_COLOR}}',
166
- inputBorder: '{{BORDER_COLOR}}',
165
+ inputBackground: '#FFFFFF',
166
+ inputBorder: '#E2E8F0',
167
167
 
168
- cardBackground: '{{SURFACE_COLOR}}',
168
+ cardBackground: '#FFFFFF',
169
169
 
170
170
  // =============================================================================
171
171
  // SPECIAL COLORS
@@ -204,7 +204,7 @@ export const lightColors = {
204
204
  // =============================================================================
205
205
  // GRADIENTS
206
206
  // =============================================================================
207
- gradient: ['{{PRIMARY_COLOR}}', '{{SECONDARY_COLOR}}'],
207
+ gradient: ['#3B82F6', '#8B5CF6'],
208
208
  };
209
209
 
210
210
  // =============================================================================
@@ -215,17 +215,17 @@ export const darkColors = {
215
215
  // =============================================================================
216
216
  // PRIMARY BRAND COLORS (dark mode specific colors)
217
217
  // =============================================================================
218
- primary: '{{PRIMARY_COLOR}}',
219
- primaryLight: '{{PRIMARY_LIGHT_COLOR}}',
220
- primaryDark: '{{PRIMARY_DARK_COLOR}}',
218
+ primary: '#3B82F6',
219
+ primaryLight: '#60A5FA',
220
+ primaryDark: '#2563EB',
221
221
 
222
- secondary: '{{SECONDARY_COLOR}}',
223
- secondaryLight: '{{SECONDARY_LIGHT_COLOR}}',
224
- secondaryDark: '{{SECONDARY_DARK_COLOR}}',
222
+ secondary: '#8B5CF6',
223
+ secondaryLight: '#A78BFA',
224
+ secondaryDark: '#7C3AED',
225
225
 
226
- accent: '{{ACCENT_COLOR}}',
227
- accentLight: '{{ACCENT_LIGHT_COLOR}}',
228
- accentDark: '{{ACCENT_DARK_COLOR}}',
226
+ accent: '#F59E0B',
227
+ accentLight: '#FBBF24',
228
+ accentDark: '#D97706',
229
229
 
230
230
  // =============================================================================
231
231
  // MATERIAL DESIGN 3 - ON COLORS (Same as light mode for type consistency)
@@ -303,41 +303,41 @@ export const darkColors = {
303
303
  // =============================================================================
304
304
  // BACKGROUND COLORS (dark mode specific colors)
305
305
  // =============================================================================
306
- backgroundPrimary: '{{BACKGROUND_COLOR}}',
307
- backgroundSecondary: '{{BACKGROUND_SECONDARY_COLOR}}',
306
+ backgroundPrimary: '#FFFFFF',
307
+ backgroundSecondary: '#F8FAFC',
308
308
 
309
- surface: '{{SURFACE_COLOR}}',
310
- surfaceVariant: '{{SURFACE_SECONDARY_COLOR}}',
311
- surfaceSecondary: '{{SURFACE_SECONDARY_COLOR}}', // Alias
309
+ surface: '#FFFFFF',
310
+ surfaceVariant: '#F1F5F9',
311
+ surfaceSecondary: '#F1F5F9', // Alias
312
312
  surfaceDisabled: '#F4F4F5', // Same as light mode for type consistency
313
313
 
314
314
  // =============================================================================
315
315
  // TEXT COLORS (same as light mode for type consistency)
316
316
  // =============================================================================
317
- textPrimary: '{{TEXT_PRIMARY_COLOR}}',
318
- textSecondary: '{{TEXT_SECONDARY_COLOR}}',
319
- textTertiary: '{{TEXT_TERTIARY_COLOR}}',
320
- textDisabled: '{{TEXT_DISABLED_COLOR}}',
321
- textInverse: '{{TEXT_INVERSE_COLOR}}',
317
+ textPrimary: '#1E293B',
318
+ textSecondary: '#64748B',
319
+ textTertiary: '#94A3B8',
320
+ textDisabled: '#CBD5E1',
321
+ textInverse: '#FFFFFF',
322
322
 
323
323
  // =============================================================================
324
324
  // BORDER COLORS (same as light mode for type consistency)
325
325
  // =============================================================================
326
- border: '{{BORDER_COLOR}}',
327
- borderLight: '{{BORDER_LIGHT_COLOR}}',
328
- borderMedium: '{{BORDER_MEDIUM_COLOR}}',
329
- borderFocus: '{{BORDER_FOCUS_COLOR}}',
326
+ border: '#E2E8F0',
327
+ borderLight: '#F1F5F9',
328
+ borderMedium: '#CBD5E1',
329
+ borderFocus: '#3B82F6',
330
330
 
331
331
  // =============================================================================
332
332
  // COMPONENT-SPECIFIC COLORS (same as light mode for type consistency)
333
333
  // =============================================================================
334
- buttonPrimary: '{{PRIMARY_COLOR}}',
335
- buttonSecondary: '{{SECONDARY_COLOR}}',
334
+ buttonPrimary: '#3B82F6',
335
+ buttonSecondary: '#8B5CF6',
336
336
 
337
- inputBackground: '{{SURFACE_COLOR}}',
338
- inputBorder: '{{BORDER_COLOR}}',
337
+ inputBackground: '#FFFFFF',
338
+ inputBorder: '#E2E8F0',
339
339
 
340
- cardBackground: '{{SURFACE_COLOR}}',
340
+ cardBackground: '#FFFFFF',
341
341
 
342
342
  // =============================================================================
343
343
  // SPECIAL COLORS
@@ -378,7 +378,7 @@ export const darkColors = {
378
378
  // =============================================================================
379
379
  // GRADIENTS (Same as light mode for type consistency)
380
380
  // =============================================================================
381
- gradient: ['{{PRIMARY_COLOR}}', '{{SECONDARY_COLOR}}'],
381
+ gradient: ['#3B82F6', '#8B5CF6'],
382
382
  };
383
383
 
384
384
  // =============================================================================