@umituz/react-native-design-system 1.15.0 → 2.0.1

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.
Files changed (88) hide show
  1. package/package.json +26 -19
  2. package/src/atoms/AtomicAvatar.tsx +161 -0
  3. package/src/atoms/AtomicButton.tsx +241 -0
  4. package/src/atoms/AtomicCard.tsx +84 -0
  5. package/src/atoms/AtomicChip.tsx +226 -0
  6. package/src/atoms/AtomicDatePicker.tsx +255 -0
  7. package/src/atoms/AtomicFab.tsx +99 -0
  8. package/src/atoms/AtomicIcon.tsx +149 -0
  9. package/src/atoms/AtomicInput.tsx +308 -0
  10. package/src/atoms/AtomicPicker.tsx +310 -0
  11. package/src/atoms/AtomicProgress.tsx +149 -0
  12. package/src/atoms/AtomicText.tsx +55 -0
  13. package/src/atoms/__tests__/AtomicButton.test.tsx +107 -0
  14. package/src/atoms/__tests__/AtomicIcon.test.tsx +110 -0
  15. package/src/atoms/__tests__/AtomicInput.test.tsx +195 -0
  16. package/src/atoms/datepicker/components/DatePickerButton.tsx +112 -0
  17. package/src/atoms/datepicker/components/DatePickerModal.tsx +143 -0
  18. package/src/atoms/fab/styles/fabStyles.ts +98 -0
  19. package/src/atoms/fab/types/index.ts +88 -0
  20. package/src/atoms/index.ts +70 -0
  21. package/src/atoms/input/hooks/useInputState.ts +63 -0
  22. package/src/atoms/input/styles/inputStylesHelper.ts +120 -0
  23. package/src/atoms/picker/components/PickerChips.tsx +57 -0
  24. package/src/atoms/picker/components/PickerModal.tsx +214 -0
  25. package/src/atoms/picker/styles/pickerStyles.ts +223 -0
  26. package/src/atoms/picker/types/index.ts +42 -0
  27. package/src/index.ts +133 -52
  28. package/src/molecules/ConfirmationModal.tsx +42 -0
  29. package/src/molecules/ConfirmationModalContent.tsx +87 -0
  30. package/src/molecules/ConfirmationModalMain.tsx +91 -0
  31. package/src/molecules/FormField.tsx +155 -0
  32. package/src/molecules/IconContainer.tsx +79 -0
  33. package/src/molecules/ListItem.tsx +35 -0
  34. package/src/molecules/ScreenHeader.tsx +171 -0
  35. package/src/molecules/SearchBar.tsx +198 -0
  36. package/src/molecules/confirmation-modal/components.tsx +94 -0
  37. package/src/molecules/confirmation-modal/index.ts +7 -0
  38. package/src/molecules/confirmation-modal/styles/confirmationModalStyles.ts +133 -0
  39. package/src/molecules/confirmation-modal/types/index.ts +41 -0
  40. package/src/molecules/confirmation-modal/useConfirmationModal.ts +50 -0
  41. package/src/molecules/index.ts +19 -0
  42. package/src/molecules/listitem/index.ts +6 -0
  43. package/src/molecules/listitem/styles/listItemStyles.ts +37 -0
  44. package/src/molecules/listitem/types/index.ts +21 -0
  45. package/src/organisms/AppHeader.tsx +136 -0
  46. package/src/organisms/FormContainer.tsx +169 -0
  47. package/src/organisms/ScreenLayout.tsx +183 -0
  48. package/src/organisms/index.ts +31 -0
  49. package/src/responsive/config.ts +139 -0
  50. package/src/responsive/deviceDetection.ts +155 -0
  51. package/src/responsive/gridUtils.ts +79 -0
  52. package/src/responsive/index.ts +52 -0
  53. package/src/responsive/platformConstants.ts +98 -0
  54. package/src/responsive/responsive.ts +61 -0
  55. package/src/responsive/responsiveLayout.ts +137 -0
  56. package/src/responsive/responsiveSizing.ts +134 -0
  57. package/src/responsive/useResponsive.ts +140 -0
  58. package/src/responsive/validation.ts +158 -0
  59. package/src/theme/core/BaseTokens.ts +42 -0
  60. package/src/theme/core/ColorPalette.ts +29 -0
  61. package/src/theme/core/CustomColors.ts +122 -0
  62. package/src/theme/core/NavigationTheme.ts +72 -0
  63. package/src/theme/core/TokenFactory.ts +103 -0
  64. package/src/theme/core/colors/ColorUtils.ts +53 -0
  65. package/src/theme/core/colors/DarkColors.ts +146 -0
  66. package/src/theme/core/colors/LightColors.ts +146 -0
  67. package/src/theme/core/constants/DesignConstants.ts +31 -0
  68. package/src/theme/core/themes.ts +118 -0
  69. package/src/theme/core/tokens/BaseTokens.ts +144 -0
  70. package/src/theme/core/tokens/Borders.ts +43 -0
  71. package/src/theme/core/tokens/Sizes.ts +51 -0
  72. package/src/theme/core/tokens/Spacing.ts +38 -0
  73. package/src/theme/core/tokens/Typography.ts +143 -0
  74. package/src/theme/hooks/useAppDesignTokens.ts +45 -0
  75. package/src/theme/hooks/useCommonStyles.ts +248 -0
  76. package/src/theme/hooks/useThemedStyles.ts +68 -0
  77. package/src/theme/index.ts +94 -0
  78. package/src/theme/infrastructure/globalThemeStore.ts +69 -0
  79. package/src/theme/infrastructure/storage/ThemeStorage.ts +93 -0
  80. package/src/theme/infrastructure/stores/themeStore.ts +109 -0
  81. package/src/typography/__tests__/colorValidationUtils.test.ts +180 -0
  82. package/src/typography/__tests__/textColorUtils.test.ts +185 -0
  83. package/src/typography/__tests__/textStyleUtils.test.ts +168 -0
  84. package/src/typography/domain/entities/TypographyTypes.ts +88 -0
  85. package/src/typography/index.ts +53 -0
  86. package/src/typography/presentation/utils/colorValidationUtils.ts +133 -0
  87. package/src/typography/presentation/utils/textColorUtils.ts +205 -0
  88. package/src/typography/presentation/utils/textStyleUtils.ts +159 -0
@@ -0,0 +1,38 @@
1
+ /**
2
+ * SPACING TOKENS
3
+ *
4
+ * Spacing scale and semantic spacing values
5
+ */
6
+
7
+ import type { Spacing } from './BaseTokens';
8
+
9
+ export const spacing: Spacing = {
10
+ // Base Spacing Scale (4px base unit)
11
+ xs: 4,
12
+ sm: 8,
13
+ md: 16,
14
+ lg: 24,
15
+ xl: 32,
16
+ xxl: 48,
17
+ xxxl: 64,
18
+
19
+ // Semantic Spacing
20
+ screenPadding: 20,
21
+ cardPadding: 16,
22
+ buttonPadding: 16,
23
+ inputPadding: 12,
24
+ sectionSpacing: 24,
25
+
26
+ // Icon Sizes
27
+ iconSizeSmall: 16,
28
+ iconSizeMedium: 20,
29
+ iconSizeLarge: 24,
30
+ iconSizeXLarge: 32,
31
+ iconSizeHero: 64,
32
+
33
+ // Component Heights
34
+ buttonHeight: 48,
35
+ inputHeight: 48,
36
+ appBarHeight: 56,
37
+ tabBarHeight: 60,
38
+ };
@@ -0,0 +1,143 @@
1
+ /**
2
+ * TYPOGRAPHY TOKENS
3
+ *
4
+ * Typography scale and text styles following Material Design 3
5
+ */
6
+
7
+ import type { TextStyle } from 'react-native';
8
+ import type { Typography } from './BaseTokens';
9
+
10
+ export const typography: Typography = {
11
+ displayLarge: {
12
+ fontSize: 57,
13
+ fontWeight: '400',
14
+ lineHeight: 64,
15
+ letterSpacing: -0.25,
16
+ } as TextStyle,
17
+ displayMedium: {
18
+ fontSize: 45,
19
+ fontWeight: '400',
20
+ lineHeight: 52,
21
+ letterSpacing: 0,
22
+ } as TextStyle,
23
+ displaySmall: {
24
+ fontSize: 36,
25
+ fontWeight: '400',
26
+ lineHeight: 44,
27
+ letterSpacing: 0,
28
+ } as TextStyle,
29
+ headlineLarge: {
30
+ fontSize: 32,
31
+ fontWeight: '400',
32
+ lineHeight: 40,
33
+ letterSpacing: 0,
34
+ } as TextStyle,
35
+ headlineMedium: {
36
+ fontSize: 28,
37
+ fontWeight: '400',
38
+ lineHeight: 36,
39
+ letterSpacing: 0,
40
+ } as TextStyle,
41
+ headlineSmall: {
42
+ fontSize: 24,
43
+ fontWeight: '400',
44
+ lineHeight: 32,
45
+ letterSpacing: 0,
46
+ } as TextStyle,
47
+ titleLarge: {
48
+ fontSize: 22,
49
+ fontWeight: '500',
50
+ lineHeight: 28,
51
+ letterSpacing: 0,
52
+ } as TextStyle,
53
+ titleMedium: {
54
+ fontSize: 16,
55
+ fontWeight: '500',
56
+ lineHeight: 24,
57
+ letterSpacing: 0.15,
58
+ } as TextStyle,
59
+ titleSmall: {
60
+ fontSize: 14,
61
+ fontWeight: '500',
62
+ lineHeight: 20,
63
+ letterSpacing: 0.1,
64
+ } as TextStyle,
65
+ bodyLarge: {
66
+ fontSize: 16,
67
+ fontWeight: '400',
68
+ lineHeight: 24,
69
+ letterSpacing: 0.5,
70
+ } as TextStyle,
71
+ bodyMedium: {
72
+ fontSize: 14,
73
+ fontWeight: '400',
74
+ lineHeight: 20,
75
+ letterSpacing: 0.25,
76
+ } as TextStyle,
77
+ bodySmall: {
78
+ fontSize: 12,
79
+ fontWeight: '400',
80
+ lineHeight: 16,
81
+ letterSpacing: 0.4,
82
+ } as TextStyle,
83
+ labelLarge: {
84
+ fontSize: 14,
85
+ fontWeight: '500',
86
+ lineHeight: 20,
87
+ letterSpacing: 0.1,
88
+ } as TextStyle,
89
+ labelMedium: {
90
+ fontSize: 12,
91
+ fontWeight: '500',
92
+ lineHeight: 16,
93
+ letterSpacing: 0.5,
94
+ } as TextStyle,
95
+ labelSmall: {
96
+ fontSize: 11,
97
+ fontWeight: '500',
98
+ lineHeight: 16,
99
+ letterSpacing: 0.5,
100
+ } as TextStyle,
101
+ button: {
102
+ fontSize: 14,
103
+ fontWeight: '500',
104
+ lineHeight: 20,
105
+ letterSpacing: 0.1,
106
+ } as TextStyle,
107
+ caption: {
108
+ fontSize: 12,
109
+ fontWeight: '400',
110
+ lineHeight: 16,
111
+ letterSpacing: 0.4,
112
+ } as TextStyle,
113
+ overline: {
114
+ fontSize: 10,
115
+ fontWeight: '500',
116
+ lineHeight: 16,
117
+ letterSpacing: 1.5,
118
+ textTransform: 'uppercase',
119
+ } as TextStyle,
120
+ // Legacy compatibility aliases
121
+ headingLarge: {
122
+ fontSize: 32,
123
+ fontWeight: '700',
124
+ lineHeight: 40,
125
+ letterSpacing: 0,
126
+ } as TextStyle,
127
+ headingMedium: {
128
+ fontSize: 24,
129
+ fontWeight: '600',
130
+ lineHeight: 32,
131
+ letterSpacing: 0,
132
+ } as TextStyle,
133
+ headingSmall: {
134
+ fontSize: 20,
135
+ fontWeight: '600',
136
+ lineHeight: 28,
137
+ letterSpacing: 0,
138
+ } as TextStyle,
139
+ // Font weight helpers (for inline fontWeight usage)
140
+ semibold: '600' as const,
141
+ medium: '500' as const,
142
+ bold: '700' as const,
143
+ };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * useAppDesignTokens Hook - Theme-Aware Design Tokens
3
+ *
4
+ * ✅ Automatically reads theme from global store
5
+ * ✅ No parameters needed - fully automatic!
6
+ * ✅ Returns tokens for current theme (light/dark)
7
+ * ✅ Single source of truth
8
+ *
9
+ * @example Usage (fully automatic theme-aware)
10
+ * ```typescript
11
+ * import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
12
+ *
13
+ * const MyComponent = () => {
14
+ * const tokens = useAppDesignTokens(); // Automatically uses current theme!
15
+ * return (
16
+ * <View style={{
17
+ * backgroundColor: tokens.colors.primary,
18
+ * padding: tokens.spacing.md
19
+ * }}>
20
+ * <Text style={tokens.typography.bodyLarge}>Hello!</Text>
21
+ * </View>
22
+ * );
23
+ * };
24
+ * ```
25
+ *
26
+ * How it works:
27
+ * - Reads themeMode from global store (useDesignSystemTheme)
28
+ * - App's theme store syncs to global store automatically
29
+ * - All components get correct tokens without prop drilling
30
+ * - Change theme once, everything updates!
31
+ */
32
+
33
+ import { useMemo } from 'react';
34
+ import { createDesignTokens, type DesignTokens } from '../core/TokenFactory';
35
+ import { useDesignSystemTheme } from '../infrastructure/globalThemeStore';
36
+
37
+ export const useAppDesignTokens = (): DesignTokens => {
38
+ const { themeMode, customColors } = useDesignSystemTheme();
39
+
40
+ return useMemo(() => {
41
+ const mode = themeMode === 'dark' ? 'dark' : 'light';
42
+ return createDesignTokens(mode, customColors);
43
+ }, [themeMode, customColors]);
44
+ };
45
+
@@ -0,0 +1,248 @@
1
+ /**
2
+ * Common Styles - Reusable Style Patterns
3
+ *
4
+ * Centralized style utilities to reduce duplication across screens.
5
+ * These styles are composable and follow DRY principles.
6
+ *
7
+ * Usage:
8
+ * ```typescript
9
+ * import { useCommonStyles } from '@umituz/react-native-design-system-theme';
10
+ *
11
+ * const MyComponent = () => {
12
+ * const commonStyles = useCommonStyles();
13
+ * return <View style={commonStyles.screenContainer}>...</View>;
14
+ * };
15
+ * ```
16
+ */
17
+
18
+ import { useMemo } from 'react';
19
+ import type { ViewStyle, TextStyle } from 'react-native';
20
+ import { useAppDesignTokens } from './useAppDesignTokens';
21
+
22
+ /**
23
+ * Hook to get common styles with dynamic theme support
24
+ * Memoized to prevent unnecessary re-renders
25
+ */
26
+ export const useCommonStyles = () => {
27
+ const tokens = useAppDesignTokens();
28
+
29
+ return useMemo(() => ({
30
+ // ========================================================================
31
+ // SCREEN CONTAINERS
32
+ // ========================================================================
33
+ /**
34
+ * Standard full-screen container
35
+ * Most common pattern: flex: 1 with background color
36
+ */
37
+ screenContainer: {
38
+ flex: 1,
39
+ backgroundColor: tokens.colors.backgroundPrimary,
40
+ } as ViewStyle,
41
+
42
+ /**
43
+ * Basic flex container without background
44
+ * Use when background is set elsewhere or not needed
45
+ */
46
+ flexContainer: {
47
+ flex: 1,
48
+ } as ViewStyle,
49
+
50
+ /**
51
+ * Screen container with secondary background
52
+ */
53
+ screenContainerSecondary: {
54
+ flex: 1,
55
+ backgroundColor: tokens.colors.backgroundSecondary,
56
+ } as ViewStyle,
57
+
58
+ // ========================================================================
59
+ // SCROLL CONTAINERS
60
+ // ========================================================================
61
+ /**
62
+ * Standard ScrollView wrapper
63
+ */
64
+ scrollView: {
65
+ flex: 1,
66
+ } as ViewStyle,
67
+
68
+ /**
69
+ * ScrollView content container with standard padding
70
+ */
71
+ scrollContent: {
72
+ paddingHorizontal: tokens.spacing.lg,
73
+ paddingBottom: tokens.spacing.xl,
74
+ } as ViewStyle,
75
+
76
+ /**
77
+ * ScrollView content that grows to fill available space
78
+ */
79
+ scrollContentGrow: {
80
+ flexGrow: 1,
81
+ padding: tokens.spacing.lg,
82
+ } as ViewStyle,
83
+
84
+ /**
85
+ * Centered scroll content (for forms, onboarding screens)
86
+ */
87
+ scrollContentCentered: {
88
+ flexGrow: 1,
89
+ padding: tokens.spacing.lg,
90
+ justifyContent: 'center',
91
+ } as ViewStyle,
92
+
93
+ // ========================================================================
94
+ // LAYOUT UTILITIES
95
+ // ========================================================================
96
+ /**
97
+ * Centered container - both horizontal and vertical
98
+ * Perfect for empty states, splash screens
99
+ */
100
+ centerContainer: {
101
+ flex: 1,
102
+ justifyContent: 'center',
103
+ alignItems: 'center',
104
+ } as ViewStyle,
105
+
106
+ /**
107
+ * Centered container with padding
108
+ */
109
+ centerContainerPadded: {
110
+ flex: 1,
111
+ justifyContent: 'center',
112
+ alignItems: 'center',
113
+ paddingHorizontal: tokens.spacing.xl,
114
+ } as ViewStyle,
115
+
116
+ /**
117
+ * Horizontal row layout
118
+ */
119
+ row: {
120
+ flexDirection: 'row',
121
+ alignItems: 'center',
122
+ } as ViewStyle,
123
+
124
+ /**
125
+ * Horizontal row with space between
126
+ */
127
+ rowBetween: {
128
+ flexDirection: 'row',
129
+ alignItems: 'center',
130
+ justifyContent: 'space-between',
131
+ } as ViewStyle,
132
+
133
+ /**
134
+ * Horizontal row centered
135
+ */
136
+ rowCenter: {
137
+ flexDirection: 'row',
138
+ alignItems: 'center',
139
+ justifyContent: 'center',
140
+ } as ViewStyle,
141
+
142
+ // ========================================================================
143
+ // PADDING UTILITIES
144
+ // ========================================================================
145
+ /**
146
+ * Standard horizontal padding
147
+ */
148
+ paddedHorizontal: {
149
+ paddingHorizontal: tokens.spacing.lg,
150
+ } as ViewStyle,
151
+
152
+ /**
153
+ * Standard vertical padding
154
+ */
155
+ paddedVertical: {
156
+ paddingVertical: tokens.spacing.lg,
157
+ } as ViewStyle,
158
+
159
+ /**
160
+ * Standard padding all sides
161
+ */
162
+ padded: {
163
+ padding: tokens.spacing.lg,
164
+ } as ViewStyle,
165
+
166
+ // ========================================================================
167
+ // SECTION STYLES
168
+ // ========================================================================
169
+ /**
170
+ * Standard section container
171
+ */
172
+ section: {
173
+ marginBottom: tokens.spacing.xl,
174
+ } as ViewStyle,
175
+
176
+ /**
177
+ * Section with padding
178
+ */
179
+ sectionPadded: {
180
+ marginBottom: tokens.spacing.xl,
181
+ paddingHorizontal: tokens.spacing.lg,
182
+ } as ViewStyle,
183
+
184
+ // ========================================================================
185
+ // TEXT STYLES
186
+ // ========================================================================
187
+ /**
188
+ * Screen title - primary heading
189
+ */
190
+ screenTitle: {
191
+ ...tokens.typography.headingLarge,
192
+ color: tokens.colors.textPrimary,
193
+ marginBottom: tokens.spacing.sm,
194
+ } as TextStyle,
195
+
196
+ /**
197
+ * Section title
198
+ */
199
+ sectionTitle: {
200
+ ...tokens.typography.headingMedium,
201
+ color: tokens.colors.textPrimary,
202
+ marginBottom: tokens.spacing.md,
203
+ } as TextStyle,
204
+
205
+ /**
206
+ * Subtitle/description text
207
+ */
208
+ subtitle: {
209
+ ...tokens.typography.bodyMedium,
210
+ color: tokens.colors.textSecondary,
211
+ textAlign: 'center',
212
+ } as TextStyle,
213
+
214
+ /**
215
+ * Body text
216
+ */
217
+ bodyText: {
218
+ ...tokens.typography.bodyMedium,
219
+ color: tokens.colors.textPrimary,
220
+ } as TextStyle,
221
+
222
+ /**
223
+ * Secondary text (muted)
224
+ */
225
+ secondaryText: {
226
+ ...tokens.typography.bodySmall,
227
+ color: tokens.colors.textSecondary,
228
+ } as TextStyle,
229
+
230
+ // ========================================================================
231
+ // FORM STYLES
232
+ // ========================================================================
233
+ /**
234
+ * Form container
235
+ */
236
+ form: {
237
+ width: '100%',
238
+ } as ViewStyle,
239
+
240
+ /**
241
+ * Form header section
242
+ */
243
+ formHeader: {
244
+ alignItems: 'center',
245
+ marginBottom: tokens.spacing.xl,
246
+ } as ViewStyle,
247
+ }), [tokens]);
248
+ };
@@ -0,0 +1,68 @@
1
+ /**
2
+ * useThemedStyles Hook
3
+ * Helper hook for creating StyleSheets with theme support
4
+ *
5
+ * Usage:
6
+ * ```typescript
7
+ * const createStyles = (theme: Theme) => StyleSheet.create({
8
+ * container: {
9
+ * backgroundColor: theme.colors.backgroundPrimary,
10
+ * }
11
+ * });
12
+ *
13
+ * const Component = () => {
14
+ * const styles = useThemedStyles(createStyles);
15
+ * return <View style={styles.container} />;
16
+ * };
17
+ * ```
18
+ */
19
+
20
+ import { useMemo } from 'react';
21
+ import { StyleSheet } from 'react-native';
22
+ import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
23
+ import { useTheme } from '../infrastructure/stores/themeStore';
24
+ import type { Theme } from '../core/themes';
25
+
26
+ type NamedStyles<T> = {
27
+ [P in keyof T]: ViewStyle | TextStyle | ImageStyle;
28
+ };
29
+
30
+ /**
31
+ * Hook for creating themed styles
32
+ * Returns memoized styles that update when theme changes
33
+ */
34
+ export function useThemedStyles<T extends NamedStyles<T>>(
35
+ createStyles: (theme: Theme) => T,
36
+ ): T {
37
+ const { theme } = useTheme();
38
+
39
+ return useMemo(() => createStyles(theme), [theme, createStyles]);
40
+ }
41
+
42
+ /**
43
+ * Alternative: Direct StyleSheet creation with theme
44
+ * Returns memoized styles that update when theme changes
45
+ */
46
+ export function useThemedStyleSheet<T extends NamedStyles<T>>(
47
+ styleFactory: (theme: Theme) => T,
48
+ ): T {
49
+ const { theme } = useTheme();
50
+
51
+ return useMemo(
52
+ () => StyleSheet.create(styleFactory(theme)),
53
+ [theme, styleFactory],
54
+ );
55
+ }
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @umituz/react-native-design-system-theme - Public API
3
+ *
4
+ * Theme management system for React Native apps
5
+ * Provides colors, design tokens, and theme state management
6
+ *
7
+ * Usage:
8
+ * import { useAppDesignTokens, useDesignSystemTheme, lightColors, darkColors } from '@umituz/react-native-design-system-theme';
9
+ */
10
+
11
+ // =============================================================================
12
+ // COLOR PALETTE
13
+ // =============================================================================
14
+
15
+ export {
16
+ lightColors,
17
+ darkColors,
18
+ getColorPalette,
19
+ withAlpha,
20
+ type ColorPalette,
21
+ type ThemeMode,
22
+ } from './core/ColorPalette';
23
+
24
+ export {
25
+ applyCustomColors,
26
+ type CustomThemeColors,
27
+ } from './core/CustomColors';
28
+
29
+ // =============================================================================
30
+ // BASE TOKENS - Static Design Tokens
31
+ // =============================================================================
32
+
33
+ export {
34
+ BASE_TOKENS,
35
+ BASE_TOKENS as STATIC_TOKENS,
36
+ spacing,
37
+ typography,
38
+ borders,
39
+ type Spacing,
40
+ type Typography,
41
+ type Borders,
42
+ type BaseTokens,
43
+ type IconSizes,
44
+ type Opacity,
45
+ type AvatarSizes,
46
+ type ComponentSizes,
47
+ } from './core/BaseTokens';
48
+
49
+ // =============================================================================
50
+ // TOKEN FACTORY
51
+ // =============================================================================
52
+
53
+ export {
54
+ createDesignTokens,
55
+ type DesignTokens,
56
+ } from './core/TokenFactory';
57
+
58
+ // =============================================================================
59
+ // HOOKS
60
+ // =============================================================================
61
+
62
+ export { useAppDesignTokens } from './hooks/useAppDesignTokens';
63
+ export { useDesignSystemTheme } from './infrastructure/globalThemeStore';
64
+ export { useTheme } from './infrastructure/stores/themeStore';
65
+ export { useThemedStyles, useThemedStyleSheet } from './hooks/useThemedStyles';
66
+ export { useCommonStyles } from './hooks/useCommonStyles';
67
+
68
+ // =============================================================================
69
+ // THEME OBJECTS
70
+ // =============================================================================
71
+
72
+ export {
73
+ lightTheme,
74
+ darkTheme,
75
+ createResponsiveValue,
76
+ type Theme,
77
+ type ExtendedColorPalette,
78
+ } from './core/themes';
79
+
80
+ // =============================================================================
81
+ // STORAGE
82
+ // =============================================================================
83
+
84
+ export { ThemeStorage } from './infrastructure/storage/ThemeStorage';
85
+
86
+ // =============================================================================
87
+ // NAVIGATION THEME
88
+ // =============================================================================
89
+
90
+ export {
91
+ createNavigationTheme,
92
+ type NavigationTheme,
93
+ } from './core/NavigationTheme';
94
+
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Global Theme Store for Design System
3
+ *
4
+ * Minimal Zustand store for theme state management.
5
+ * Apps can sync their theme state with this global store.
6
+ *
7
+ * WHY THIS EXISTS:
8
+ * - ScreenLayout needs to know current theme mode
9
+ * - Without prop drilling or Context API
10
+ * - Single source of truth for design system components
11
+ * - Apps control theme, design system reacts
12
+ *
13
+ * USAGE IN APP:
14
+ * ```typescript
15
+ * import { useDesignSystemTheme } from '@umituz/react-native-design-system-theme';
16
+ * import { useTheme } from '@domains/theme';
17
+ *
18
+ * // Sync app theme with design system
19
+ * const { themeMode } = useTheme();
20
+ * const { setThemeMode } = useDesignSystemTheme();
21
+ *
22
+ * useEffect(() => {
23
+ * setThemeMode(themeMode);
24
+ * }, [themeMode]);
25
+ * ```
26
+ */
27
+
28
+ import { create } from 'zustand';
29
+ import type { ThemeMode } from '../core/ColorPalette';
30
+ import type { CustomThemeColors } from '../core/CustomColors';
31
+
32
+ interface GlobalThemeStore {
33
+ /** Current theme mode */
34
+ themeMode: ThemeMode;
35
+
36
+ /** Custom theme colors override */
37
+ customColors?: CustomThemeColors;
38
+
39
+ /** Update theme mode (called by app when theme changes) */
40
+ setThemeMode: (mode: ThemeMode) => void;
41
+
42
+ /** Set custom theme colors (called by app when custom colors change) */
43
+ setCustomColors: (colors?: CustomThemeColors) => void;
44
+ }
45
+
46
+ /**
47
+ * Global theme store for design system components
48
+ *
49
+ * This is a MINIMAL store - app has the real theme logic.
50
+ * Design system just mirrors the current theme for its components.
51
+ */
52
+ export const useDesignSystemTheme = create<GlobalThemeStore>()((set: any, get: any) => ({
53
+ themeMode: 'dark',
54
+ customColors: undefined,
55
+ setThemeMode: (mode: ThemeMode) => {
56
+ // Only update if mode actually changed to prevent unnecessary re-renders
57
+ const currentMode = get().themeMode;
58
+ if (currentMode !== mode) {
59
+ set({ themeMode: mode });
60
+ }
61
+ },
62
+ setCustomColors: (colors?: CustomThemeColors) => {
63
+ set({ customColors: colors });
64
+ },
65
+ }));
66
+
67
+ // Re-export ThemeMode for backward compatibility
68
+ export type { ThemeMode };
69
+