@umituz/react-native-design-system 1.5.0 → 1.5.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.
Files changed (209) hide show
  1. package/lib/index.d.ts +4 -4
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +13 -11
  4. package/lib/index.js.map +1 -1
  5. package/lib/presentation/atoms/AtomicAvatar.js +1 -1
  6. package/lib/presentation/atoms/AtomicAvatar.js.map +1 -1
  7. package/lib/presentation/atoms/AtomicAvatarGroup.js +1 -1
  8. package/lib/presentation/atoms/AtomicAvatarGroup.js.map +1 -1
  9. package/lib/presentation/atoms/AtomicBadge.js +1 -1
  10. package/lib/presentation/atoms/AtomicBadge.js.map +1 -1
  11. package/lib/presentation/atoms/AtomicButton.d.ts +1 -1
  12. package/lib/presentation/atoms/AtomicButton.d.ts.map +1 -1
  13. package/lib/presentation/atoms/AtomicButton.js +2 -2
  14. package/lib/presentation/atoms/AtomicButton.js.map +1 -1
  15. package/lib/presentation/atoms/AtomicCard.js +1 -1
  16. package/lib/presentation/atoms/AtomicCard.js.map +1 -1
  17. package/lib/presentation/atoms/AtomicChip.js +1 -1
  18. package/lib/presentation/atoms/AtomicChip.js.map +1 -1
  19. package/lib/presentation/atoms/AtomicDatePicker.js +1 -1
  20. package/lib/presentation/atoms/AtomicDatePicker.js.map +1 -1
  21. package/lib/presentation/atoms/AtomicDivider.js +1 -1
  22. package/lib/presentation/atoms/AtomicDivider.js.map +1 -1
  23. package/lib/presentation/atoms/AtomicFab.js +1 -1
  24. package/lib/presentation/atoms/AtomicFab.js.map +1 -1
  25. package/lib/presentation/atoms/AtomicFilter.js +1 -1
  26. package/lib/presentation/atoms/AtomicFilter.js.map +1 -1
  27. package/lib/presentation/atoms/AtomicFormError.js +2 -2
  28. package/lib/presentation/atoms/AtomicFormError.js.map +1 -1
  29. package/lib/presentation/atoms/AtomicIcon.d.ts +2 -3
  30. package/lib/presentation/atoms/AtomicIcon.d.ts.map +1 -1
  31. package/lib/presentation/atoms/AtomicIcon.js +1 -1
  32. package/lib/presentation/atoms/AtomicIcon.js.map +1 -1
  33. package/lib/presentation/atoms/AtomicImage.js +1 -1
  34. package/lib/presentation/atoms/AtomicImage.js.map +1 -1
  35. package/lib/presentation/atoms/AtomicInput.js +1 -1
  36. package/lib/presentation/atoms/AtomicInput.js.map +1 -1
  37. package/lib/presentation/atoms/AtomicPicker.js +1 -1
  38. package/lib/presentation/atoms/AtomicPicker.js.map +1 -1
  39. package/lib/presentation/atoms/AtomicProgress.js +1 -1
  40. package/lib/presentation/atoms/AtomicProgress.js.map +1 -1
  41. package/lib/presentation/atoms/AtomicSearchBar.js +1 -1
  42. package/lib/presentation/atoms/AtomicSearchBar.js.map +1 -1
  43. package/lib/presentation/atoms/AtomicSort.js +1 -1
  44. package/lib/presentation/atoms/AtomicSort.js.map +1 -1
  45. package/lib/presentation/atoms/AtomicSwitch.js +1 -1
  46. package/lib/presentation/atoms/AtomicSwitch.js.map +1 -1
  47. package/lib/presentation/atoms/AtomicText.d.ts +21 -1
  48. package/lib/presentation/atoms/AtomicText.d.ts.map +1 -1
  49. package/lib/presentation/atoms/AtomicText.js +33 -10
  50. package/lib/presentation/atoms/AtomicText.js.map +1 -1
  51. package/lib/presentation/atoms/AtomicTextArea.js +1 -1
  52. package/lib/presentation/atoms/AtomicTextArea.js.map +1 -1
  53. package/lib/presentation/atoms/AtomicTouchable.js +1 -1
  54. package/lib/presentation/atoms/AtomicTouchable.js.map +1 -1
  55. package/lib/presentation/atoms/fab/styles/fabStyles.d.ts +1 -1
  56. package/lib/presentation/atoms/fab/styles/fabStyles.d.ts.map +1 -1
  57. package/lib/presentation/atoms/index.d.ts +1 -1
  58. package/lib/presentation/atoms/input/styles/inputStyles.d.ts +1 -1
  59. package/lib/presentation/atoms/input/styles/inputStyles.d.ts.map +1 -1
  60. package/lib/presentation/atoms/picker/styles/pickerStyles.d.ts +12 -23
  61. package/lib/presentation/atoms/picker/styles/pickerStyles.d.ts.map +1 -1
  62. package/lib/presentation/atoms/picker/styles/pickerStyles.js.map +1 -1
  63. package/lib/presentation/molecules/AtomicConfirmationModal.js +1 -1
  64. package/lib/presentation/molecules/AtomicConfirmationModal.js.map +1 -1
  65. package/lib/presentation/molecules/EmptyState.js +1 -1
  66. package/lib/presentation/molecules/EmptyState.js.map +1 -1
  67. package/lib/presentation/molecules/FormField.js +1 -1
  68. package/lib/presentation/molecules/FormField.js.map +1 -1
  69. package/lib/presentation/molecules/IconContainer.js +1 -1
  70. package/lib/presentation/molecules/IconContainer.js.map +1 -1
  71. package/lib/presentation/molecules/ListItem.js +1 -1
  72. package/lib/presentation/molecules/ListItem.js.map +1 -1
  73. package/lib/presentation/molecules/ScreenHeader.js +1 -1
  74. package/lib/presentation/molecules/ScreenHeader.js.map +1 -1
  75. package/lib/presentation/molecules/SearchBar.js +1 -1
  76. package/lib/presentation/molecules/SearchBar.js.map +1 -1
  77. package/lib/presentation/molecules/SectionCard.js +1 -1
  78. package/lib/presentation/molecules/SectionCard.js.map +1 -1
  79. package/lib/presentation/molecules/SectionContainer.js +1 -1
  80. package/lib/presentation/molecules/SectionContainer.js.map +1 -1
  81. package/lib/presentation/molecules/SectionHeader.js +1 -1
  82. package/lib/presentation/molecules/SectionHeader.js.map +1 -1
  83. package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts +1 -1
  84. package/lib/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts.map +1 -1
  85. package/lib/presentation/molecules/listitem/styles/listItemStyles.d.ts +1 -1
  86. package/lib/presentation/molecules/listitem/styles/listItemStyles.d.ts.map +1 -1
  87. package/lib/presentation/organisms/AppHeader.d.ts +3 -2
  88. package/lib/presentation/organisms/AppHeader.d.ts.map +1 -1
  89. package/lib/presentation/organisms/AppHeader.js +1 -1
  90. package/lib/presentation/organisms/AppHeader.js.map +1 -1
  91. package/lib/presentation/organisms/FormContainer.js +1 -1
  92. package/lib/presentation/organisms/FormContainer.js.map +1 -1
  93. package/lib/presentation/organisms/ScreenLayout.js +1 -1
  94. package/lib/presentation/organisms/ScreenLayout.js.map +1 -1
  95. package/lib/presentation/tokens/commonStyles.js +1 -1
  96. package/lib/presentation/tokens/commonStyles.js.map +1 -1
  97. package/package.json +1 -1
  98. package/src/index.ts +16 -16
  99. package/src/presentation/atoms/AtomicAvatar.tsx +1 -1
  100. package/src/presentation/atoms/AtomicAvatarGroup.tsx +1 -1
  101. package/src/presentation/atoms/AtomicBadge.tsx +2 -2
  102. package/src/presentation/atoms/AtomicButton.tsx +3 -3
  103. package/src/presentation/atoms/AtomicCard.tsx +1 -1
  104. package/src/presentation/atoms/AtomicChip.tsx +1 -1
  105. package/src/presentation/atoms/AtomicDatePicker.tsx +1 -1
  106. package/src/presentation/atoms/AtomicDivider.tsx +1 -1
  107. package/src/presentation/atoms/AtomicFab.tsx +1 -1
  108. package/src/presentation/atoms/AtomicFilter.tsx +1 -1
  109. package/src/presentation/atoms/AtomicFormError.tsx +2 -2
  110. package/src/presentation/atoms/AtomicIcon.tsx +3 -4
  111. package/src/presentation/atoms/AtomicImage.tsx +1 -1
  112. package/src/presentation/atoms/AtomicInput.tsx +1 -1
  113. package/src/presentation/atoms/AtomicPicker.tsx +1 -1
  114. package/src/presentation/atoms/AtomicProgress.tsx +1 -1
  115. package/src/presentation/atoms/AtomicSearchBar.tsx +1 -1
  116. package/src/presentation/atoms/AtomicSort.tsx +1 -1
  117. package/src/presentation/atoms/AtomicSwitch.tsx +1 -1
  118. package/src/presentation/atoms/AtomicText.tsx +83 -13
  119. package/src/presentation/atoms/AtomicTextArea.tsx +1 -1
  120. package/src/presentation/atoms/AtomicTouchable.tsx +1 -1
  121. package/src/presentation/atoms/fab/styles/fabStyles.ts +1 -1
  122. package/src/presentation/atoms/input/styles/inputStyles.ts +1 -1
  123. package/src/presentation/atoms/picker/styles/pickerStyles.ts +13 -6
  124. package/src/presentation/molecules/AtomicConfirmationModal.tsx +1 -1
  125. package/src/presentation/molecules/EmptyState.tsx +1 -1
  126. package/src/presentation/molecules/FormField.tsx +1 -1
  127. package/src/presentation/molecules/IconContainer.tsx +1 -1
  128. package/src/presentation/molecules/ListItem.tsx +1 -1
  129. package/src/presentation/molecules/ScreenHeader.tsx +1 -1
  130. package/src/presentation/molecules/SearchBar.tsx +1 -1
  131. package/src/presentation/molecules/SectionCard.tsx +1 -1
  132. package/src/presentation/molecules/SectionContainer.tsx +1 -1
  133. package/src/presentation/molecules/SectionHeader.tsx +1 -1
  134. package/src/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.ts +1 -1
  135. package/src/presentation/molecules/listitem/styles/listItemStyles.ts +1 -1
  136. package/src/presentation/organisms/AppHeader.tsx +4 -3
  137. package/src/presentation/organisms/FormContainer.tsx +1 -1
  138. package/src/presentation/organisms/ScreenLayout.tsx +1 -1
  139. package/src/presentation/tokens/commonStyles.ts +1 -1
  140. package/lib/domains/icons/domain/config/IconLibraryConfig.d.ts +0 -91
  141. package/lib/domains/icons/domain/config/IconLibraryConfig.d.ts.map +0 -1
  142. package/lib/domains/icons/domain/config/IconLibraryConfig.js +0 -85
  143. package/lib/domains/icons/domain/config/IconLibraryConfig.js.map +0 -1
  144. package/lib/domains/icons/domain/entities/Icon.d.ts +0 -111
  145. package/lib/domains/icons/domain/entities/Icon.d.ts.map +0 -1
  146. package/lib/domains/icons/domain/entities/Icon.js +0 -87
  147. package/lib/domains/icons/domain/entities/Icon.js.map +0 -1
  148. package/lib/domains/icons/domain/interfaces/IIconAdapter.d.ts +0 -114
  149. package/lib/domains/icons/domain/interfaces/IIconAdapter.d.ts.map +0 -1
  150. package/lib/domains/icons/domain/interfaces/IIconAdapter.js +0 -17
  151. package/lib/domains/icons/domain/interfaces/IIconAdapter.js.map +0 -1
  152. package/lib/domains/icons/index.d.ts +0 -84
  153. package/lib/domains/icons/index.d.ts.map +0 -1
  154. package/lib/domains/icons/index.js +0 -89
  155. package/lib/domains/icons/index.js.map +0 -1
  156. package/lib/domains/icons/infrastructure/adapters/LucideAdapter.d.ts +0 -24
  157. package/lib/domains/icons/infrastructure/adapters/LucideAdapter.d.ts.map +0 -1
  158. package/lib/domains/icons/infrastructure/adapters/LucideAdapter.js +0 -85
  159. package/lib/domains/icons/infrastructure/adapters/LucideAdapter.js.map +0 -1
  160. package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.d.ts +0 -23
  161. package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.d.ts.map +0 -1
  162. package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.js +0 -178
  163. package/lib/domains/icons/infrastructure/registries/ExpoIconRegistry.js.map +0 -1
  164. package/lib/domains/icons/presentation/components/Icon.d.ts +0 -42
  165. package/lib/domains/icons/presentation/components/Icon.d.ts.map +0 -1
  166. package/lib/domains/icons/presentation/components/Icon.js +0 -86
  167. package/lib/domains/icons/presentation/components/Icon.js.map +0 -1
  168. package/lib/domains/icons/presentation/hooks/useIconLibrary.d.ts +0 -38
  169. package/lib/domains/icons/presentation/hooks/useIconLibrary.d.ts.map +0 -1
  170. package/lib/domains/icons/presentation/hooks/useIconLibrary.js +0 -114
  171. package/lib/domains/icons/presentation/hooks/useIconLibrary.js.map +0 -1
  172. package/lib/infrastructure/theme/globalThemeStore.d.ts +0 -42
  173. package/lib/infrastructure/theme/globalThemeStore.d.ts.map +0 -1
  174. package/lib/infrastructure/theme/globalThemeStore.js +0 -38
  175. package/lib/infrastructure/theme/globalThemeStore.js.map +0 -1
  176. package/lib/presentation/hooks/useAppDesignTokens.d.ts +0 -34
  177. package/lib/presentation/hooks/useAppDesignTokens.d.ts.map +0 -1
  178. package/lib/presentation/hooks/useAppDesignTokens.js +0 -39
  179. package/lib/presentation/hooks/useAppDesignTokens.js.map +0 -1
  180. package/lib/presentation/tokens/AppDesignTokens.d.ts +0 -14
  181. package/lib/presentation/tokens/AppDesignTokens.d.ts.map +0 -1
  182. package/lib/presentation/tokens/AppDesignTokens.js +0 -23
  183. package/lib/presentation/tokens/AppDesignTokens.js.map +0 -1
  184. package/lib/presentation/tokens/core/BaseTokens.d.ts +0 -312
  185. package/lib/presentation/tokens/core/BaseTokens.d.ts.map +0 -1
  186. package/lib/presentation/tokens/core/BaseTokens.js +0 -304
  187. package/lib/presentation/tokens/core/BaseTokens.js.map +0 -1
  188. package/lib/presentation/tokens/core/ColorPalette.d.ts +0 -216
  189. package/lib/presentation/tokens/core/ColorPalette.d.ts.map +0 -1
  190. package/lib/presentation/tokens/core/ColorPalette.js +0 -330
  191. package/lib/presentation/tokens/core/ColorPalette.js.map +0 -1
  192. package/lib/presentation/tokens/core/TokenFactory.d.ts +0 -216
  193. package/lib/presentation/tokens/core/TokenFactory.d.ts.map +0 -1
  194. package/lib/presentation/tokens/core/TokenFactory.js +0 -86
  195. package/lib/presentation/tokens/core/TokenFactory.js.map +0 -1
  196. package/src/domains/icons/domain/config/IconLibraryConfig.ts +0 -93
  197. package/src/domains/icons/domain/entities/Icon.ts +0 -143
  198. package/src/domains/icons/domain/interfaces/IIconAdapter.ts +0 -147
  199. package/src/domains/icons/index.ts +0 -109
  200. package/src/domains/icons/infrastructure/adapters/LucideAdapter.ts +0 -100
  201. package/src/domains/icons/infrastructure/registries/ExpoIconRegistry.ts +0 -191
  202. package/src/domains/icons/presentation/components/Icon.tsx +0 -132
  203. package/src/domains/icons/presentation/hooks/useIconLibrary.ts +0 -141
  204. package/src/infrastructure/theme/globalThemeStore.ts +0 -51
  205. package/src/presentation/hooks/useAppDesignTokens.ts +0 -40
  206. package/src/presentation/tokens/AppDesignTokens.ts +0 -55
  207. package/src/presentation/tokens/core/BaseTokens.ts +0 -372
  208. package/src/presentation/tokens/core/ColorPalette.ts +0 -400
  209. package/src/presentation/tokens/core/TokenFactory.ts +0 -118
@@ -1,191 +0,0 @@
1
- /**
2
- * Icons Domain - Expo Vector Icons Registry
3
- *
4
- * Registry for @expo/vector-icons (Material, FontAwesome, Ionicons).
5
- * Provides metadata and search capabilities for 1000+ icons.
6
- *
7
- * @domain icons
8
- * @layer infrastructure
9
- */
10
-
11
- import type { IIconRegistry, IconMetadata } from '@domains/icons/domain/entities/Icon';
12
- import { IconLibrary, IconCategory } from '@domains/icons/domain/entities/Icon';
13
-
14
- /**
15
- * Expo vector icons registry
16
- * Maps common Material Design, FontAwesome, and Ionicons
17
- */
18
- export class ExpoIconRegistry implements IIconRegistry {
19
- private icons: IconMetadata[] = [
20
- // Navigation icons (Material Design)
21
- {
22
- name: 'home',
23
- library: IconLibrary.MATERIAL,
24
- category: IconCategory.NAVIGATION,
25
- tags: ['house', 'main', 'start'],
26
- searchTerms: ['home', 'house', 'main', 'dashboard'],
27
- },
28
- {
29
- name: 'arrow-back',
30
- library: IconLibrary.MATERIAL,
31
- category: IconCategory.NAVIGATION,
32
- tags: ['back', 'previous', 'return'],
33
- searchTerms: ['arrow', 'back', 'previous', 'navigate'],
34
- },
35
- {
36
- name: 'menu',
37
- library: IconLibrary.MATERIAL,
38
- category: IconCategory.NAVIGATION,
39
- tags: ['hamburger', 'drawer', 'navigation'],
40
- searchTerms: ['menu', 'hamburger', 'navigation', 'drawer'],
41
- },
42
- {
43
- name: 'search',
44
- library: IconLibrary.MATERIAL,
45
- category: IconCategory.ACTION,
46
- tags: ['find', 'lookup', 'query'],
47
- searchTerms: ['search', 'find', 'lookup', 'magnify'],
48
- },
49
-
50
- // Action icons (Material Design)
51
- {
52
- name: 'add',
53
- library: IconLibrary.MATERIAL,
54
- category: IconCategory.ACTION,
55
- tags: ['plus', 'create', 'new'],
56
- searchTerms: ['add', 'plus', 'create', 'new'],
57
- },
58
- {
59
- name: 'delete',
60
- library: IconLibrary.MATERIAL,
61
- category: IconCategory.ACTION,
62
- tags: ['remove', 'trash', 'bin'],
63
- searchTerms: ['delete', 'remove', 'trash', 'garbage'],
64
- },
65
- {
66
- name: 'edit',
67
- library: IconLibrary.MATERIAL,
68
- category: IconCategory.ACTION,
69
- tags: ['pencil', 'modify', 'update'],
70
- searchTerms: ['edit', 'pencil', 'modify', 'write'],
71
- },
72
- {
73
- name: 'settings',
74
- library: IconLibrary.MATERIAL,
75
- category: IconCategory.ACTION,
76
- tags: ['gear', 'preferences', 'config'],
77
- searchTerms: ['settings', 'gear', 'preferences', 'options'],
78
- },
79
- {
80
- name: 'favorite',
81
- library: IconLibrary.MATERIAL,
82
- category: IconCategory.ACTION,
83
- tags: ['heart', 'like', 'love'],
84
- searchTerms: ['favorite', 'heart', 'like', 'love'],
85
- },
86
-
87
- // Social icons (FontAwesome)
88
- {
89
- name: 'facebook',
90
- library: IconLibrary.FONTAWESOME,
91
- category: IconCategory.SOCIAL,
92
- tags: ['fb', 'social', 'network'],
93
- searchTerms: ['facebook', 'fb', 'social', 'meta'],
94
- },
95
- {
96
- name: 'twitter',
97
- library: IconLibrary.FONTAWESOME,
98
- category: IconCategory.SOCIAL,
99
- tags: ['x', 'social', 'tweet'],
100
- searchTerms: ['twitter', 'x', 'social', 'tweet'],
101
- },
102
- {
103
- name: 'instagram',
104
- library: IconLibrary.FONTAWESOME,
105
- category: IconCategory.SOCIAL,
106
- tags: ['ig', 'social', 'photo'],
107
- searchTerms: ['instagram', 'ig', 'social', 'photo'],
108
- },
109
-
110
- // Communication icons (Ionicons)
111
- {
112
- name: 'mail',
113
- library: IconLibrary.IONICONS,
114
- category: IconCategory.COMMUNICATION,
115
- tags: ['email', 'message', 'envelope'],
116
- searchTerms: ['mail', 'email', 'message', 'contact'],
117
- },
118
- {
119
- name: 'call',
120
- library: IconLibrary.IONICONS,
121
- category: IconCategory.COMMUNICATION,
122
- tags: ['phone', 'telephone', 'dial'],
123
- searchTerms: ['call', 'phone', 'telephone', 'dial'],
124
- },
125
- {
126
- name: 'notifications',
127
- library: IconLibrary.IONICONS,
128
- category: IconCategory.COMMUNICATION,
129
- tags: ['bell', 'alert', 'reminder'],
130
- searchTerms: ['notifications', 'bell', 'alert', 'reminder'],
131
- },
132
-
133
- // Media icons (Material Design)
134
- {
135
- name: 'camera',
136
- library: IconLibrary.MATERIAL,
137
- category: IconCategory.MEDIA,
138
- tags: ['photo', 'picture', 'snapshot'],
139
- searchTerms: ['camera', 'photo', 'picture', 'image'],
140
- },
141
- {
142
- name: 'image',
143
- library: IconLibrary.MATERIAL,
144
- category: IconCategory.MEDIA,
145
- tags: ['photo', 'picture', 'gallery'],
146
- searchTerms: ['image', 'photo', 'picture', 'gallery'],
147
- },
148
- {
149
- name: 'videocam',
150
- library: IconLibrary.MATERIAL,
151
- category: IconCategory.MEDIA,
152
- tags: ['video', 'camera', 'record'],
153
- searchTerms: ['video', 'camera', 'record', 'film'],
154
- },
155
- ];
156
-
157
- getAllIcons(): IconMetadata[] {
158
- return this.icons;
159
- }
160
-
161
- getIconsByCategory(category: IconCategory): IconMetadata[] {
162
- if (category === IconCategory.ALL) {
163
- return this.icons;
164
- }
165
- return this.icons.filter(icon => icon.category === category);
166
- }
167
-
168
- searchIcons(query: string): IconMetadata[] {
169
- if (!query.trim()) {
170
- return this.icons;
171
- }
172
-
173
- const normalizedQuery = query.toLowerCase().replace(/[^a-z0-9]/g, '');
174
-
175
- return this.icons.filter(icon => {
176
- const normalizedName = icon.name.toLowerCase().replace(/[^a-z0-9]/g, '');
177
- const normalizedTags = icon.tags.map(tag => tag.toLowerCase().replace(/[^a-z0-9]/g, ''));
178
- const normalizedTerms = icon.searchTerms.map(term => term.toLowerCase().replace(/[^a-z0-9]/g, ''));
179
-
180
- return (
181
- normalizedName.includes(normalizedQuery) ||
182
- normalizedTags.some(tag => tag.includes(normalizedQuery)) ||
183
- normalizedTerms.some(term => term.includes(normalizedQuery))
184
- );
185
- });
186
- }
187
-
188
- getIconMetadata(name: string): IconMetadata | null {
189
- return this.icons.find(icon => icon.name === name) || null;
190
- }
191
- }
@@ -1,132 +0,0 @@
1
- /**
2
- * Universal Icon Component
3
- *
4
- * 🎯 SINGLE ICON COMPONENT FOR ALL APPS
5
- *
6
- * Automatically uses the icon library configured in IconLibraryConfig.
7
- * Change library = change config, no code changes needed!
8
- *
9
- * @example
10
- * ```tsx
11
- * import { Icon } from '@domains/icons';
12
- *
13
- * // Basic usage
14
- * <Icon name="Settings" size="md" color="primary" />
15
- *
16
- * // Custom size and color
17
- * <Icon name="Heart" customSize={32} customColor="#FF0000" />
18
- *
19
- * // With background
20
- * <Icon name="Info" size="lg" withBackground backgroundColor="#667eea" />
21
- * ```
22
- *
23
- * 🔧 To change icon library:
24
- * 1. Update CURRENT_LIBRARY in domain/config/IconLibraryConfig.ts
25
- * 2. Done! All apps use new library automatically
26
- */
27
-
28
- import React from 'react';
29
- import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
30
- import { useAppDesignTokens } from '../../../../presentation/hooks/useAppDesignTokens';
31
- import { CURRENT_LIBRARY } from '../../domain/config/IconLibraryConfig';
32
- import { LucideAdapter } from '../../infrastructure/adapters/LucideAdapter';
33
- import type { IconProps, IconSize, IconColor } from '../../domain/interfaces/IIconAdapter';
34
-
35
- /**
36
- * Get adapter based on current library configuration
37
- */
38
- const getAdapter = () => {
39
- switch (CURRENT_LIBRARY) {
40
- case 'lucide':
41
- return LucideAdapter;
42
- // Future: Add more adapters here
43
- // case 'material':
44
- // return MaterialAdapter;
45
- // case 'fontawesome':
46
- // return FontAwesomeAdapter;
47
- default:
48
- return LucideAdapter;
49
- }
50
- };
51
-
52
- /**
53
- * Universal Icon Component
54
- */
55
- export const Icon: React.FC<IconProps> = ({
56
- name,
57
- size = 'md',
58
- customSize,
59
- color = 'onSurface',
60
- customColor,
61
- strokeWidth,
62
- withBackground = false,
63
- backgroundColor,
64
- accessibilityLabel,
65
- testID,
66
- style,
67
- }) => {
68
- const tokens = useAppDesignTokens();
69
- const adapter = getAdapter();
70
-
71
- // Get icon component from adapter
72
- const IconComponent = adapter.getIconComponent(name);
73
-
74
- if (!IconComponent) {
75
- return null;
76
- }
77
-
78
- // Calculate icon size
79
- const iconSize = adapter.getIconSize(size as IconSize, customSize);
80
-
81
- // Get icon color from theme
82
- const iconColor = adapter.getIconColor(color as IconColor, tokens, customColor);
83
-
84
- // Get stroke width (for outline icons)
85
- const iconStrokeWidth = strokeWidth || adapter.getStrokeWidth?.() || 2;
86
-
87
- // Container size (slightly larger than icon)
88
- const containerSize = iconSize + 8;
89
-
90
- const containerStyles: StyleProp<ViewStyle> = [
91
- withBackground && {
92
- width: containerSize,
93
- height: containerSize,
94
- borderRadius: containerSize / 2,
95
- backgroundColor: backgroundColor || tokens.colors.surfaceVariant,
96
- justifyContent: 'center',
97
- alignItems: 'center',
98
- },
99
- style,
100
- ];
101
-
102
- const IconElement = (
103
- <IconComponent
104
- size={iconSize}
105
- color={iconColor}
106
- strokeWidth={iconStrokeWidth}
107
- accessibilityLabel={accessibilityLabel || `${name} icon`}
108
- testID={testID}
109
- />
110
- );
111
-
112
- if (withBackground) {
113
- return (
114
- <View style={containerStyles} testID={`${testID}-container`}>
115
- {IconElement}
116
- </View>
117
- );
118
- }
119
-
120
- return IconElement;
121
- };
122
-
123
- /**
124
- * Export icon types for convenience
125
- */
126
- export type { IconProps } from '../../domain/interfaces/IIconAdapter';
127
- export { type IconSize, type IconColor } from '../../domain/interfaces/IIconAdapter';
128
-
129
- /**
130
- * Export current library's icon names for TypeScript autocomplete
131
- */
132
- export type { LucideIconName as IconName } from '../../infrastructure/adapters/LucideAdapter';
@@ -1,141 +0,0 @@
1
- /**
2
- * Icons Domain - useIconLibrary Hook
3
- *
4
- * React hook for accessing icon libraries (Lucide + Expo vector icons).
5
- * Provides search, filter, and metadata access for all available icons.
6
- *
7
- * @domain icons
8
- * @layer presentation
9
- */
10
-
11
- import { useMemo, useState, useCallback } from 'react';
12
- import type { IconMetadata } from '@domains/icons/domain/entities/Icon';
13
- import { IconLibrary, IconCategory, IconUtils, ICON_CONSTANTS } from '@domains/icons/domain/entities/Icon';
14
- import { ExpoIconRegistry } from '@domains/icons/infrastructure/registries/ExpoIconRegistry';
15
-
16
- /**
17
- * Hook for icon library access and search
18
- *
19
- * @example
20
- * const { icons, searchIcons, filterByCategory } = useIconLibrary();
21
- *
22
- * // Search icons
23
- * const results = searchIcons('home');
24
- *
25
- * // Filter by category
26
- * const navIcons = filterByCategory(IconCategory.NAVIGATION);
27
- */
28
- export const useIconLibrary = (defaultLibrary: IconLibrary = ICON_CONSTANTS.DEFAULT_LIBRARY) => {
29
- const [selectedLibrary, setSelectedLibrary] = useState<IconLibrary>(defaultLibrary);
30
- const [selectedCategory, setSelectedCategory] = useState<IconCategory>(IconCategory.ALL);
31
-
32
- // Initialize registry
33
- const registry = useMemo(() => new ExpoIconRegistry(), []);
34
-
35
- /**
36
- * Get all icons from the selected library
37
- */
38
- const icons = useMemo(() => {
39
- const allIcons = registry.getAllIcons();
40
- return selectedLibrary === IconLibrary.LUCIDE
41
- ? [] // Lucide icons are in design-system/AtomicIcon
42
- : allIcons.filter(icon => icon.library === selectedLibrary);
43
- }, [registry, selectedLibrary]);
44
-
45
- /**
46
- * Get icons filtered by category
47
- */
48
- const iconsByCategory = useMemo(() => {
49
- return IconUtils.filterByCategory(icons, selectedCategory);
50
- }, [icons, selectedCategory]);
51
-
52
- /**
53
- * Search icons by query
54
- */
55
- const searchIcons = useCallback(
56
- (query: string): IconMetadata[] => {
57
- if (!query.trim()) {
58
- return iconsByCategory;
59
- }
60
-
61
- const results = registry.searchIcons(query);
62
- const filteredResults = selectedLibrary === IconLibrary.LUCIDE
63
- ? results
64
- : results.filter(icon => icon.library === selectedLibrary);
65
-
66
- return IconUtils.filterByCategory(filteredResults, selectedCategory)
67
- .slice(0, ICON_CONSTANTS.MAX_SEARCH_RESULTS);
68
- },
69
- [registry, selectedLibrary, selectedCategory, iconsByCategory]
70
- );
71
-
72
- /**
73
- * Filter icons by category
74
- */
75
- const filterByCategory = useCallback(
76
- (category: IconCategory): IconMetadata[] => {
77
- return IconUtils.filterByCategory(icons, category);
78
- },
79
- [icons]
80
- );
81
-
82
- /**
83
- * Get icon metadata by name
84
- */
85
- const getIconMetadata = useCallback(
86
- (name: string): IconMetadata | null => {
87
- return registry.getIconMetadata(name);
88
- },
89
- [registry]
90
- );
91
-
92
- /**
93
- * Get all available categories
94
- */
95
- const availableCategories = useMemo(() => {
96
- return Object.values(IconCategory);
97
- }, []);
98
-
99
- /**
100
- * Get all available libraries
101
- */
102
- const availableLibraries = useMemo(() => {
103
- return Object.values(IconLibrary);
104
- }, []);
105
-
106
- /**
107
- * Switch library
108
- */
109
- const switchLibrary = useCallback((library: IconLibrary) => {
110
- setSelectedLibrary(library);
111
- }, []);
112
-
113
- /**
114
- * Switch category
115
- */
116
- const switchCategory = useCallback((category: IconCategory) => {
117
- setSelectedCategory(category);
118
- }, []);
119
-
120
- return {
121
- // Current state
122
- selectedLibrary,
123
- selectedCategory,
124
- icons: iconsByCategory,
125
-
126
- // Search & filter
127
- searchIcons,
128
- filterByCategory,
129
- getIconMetadata,
130
-
131
- // Library & category management
132
- switchLibrary,
133
- switchCategory,
134
- availableCategories,
135
- availableLibraries,
136
-
137
- // Constants
138
- IconLibrary,
139
- IconCategory,
140
- };
141
- };
@@ -1,51 +0,0 @@
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';
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 '../../presentation/tokens/core/ColorPalette';
30
-
31
- interface GlobalThemeStore {
32
- /** Current theme mode */
33
- themeMode: ThemeMode;
34
-
35
- /** Update theme mode (called by app when theme changes) */
36
- setThemeMode: (mode: ThemeMode) => void;
37
- }
38
-
39
- /**
40
- * Global theme store for design system components
41
- *
42
- * This is a MINIMAL store - app has the real theme logic.
43
- * Design system just mirrors the current theme for its components.
44
- */
45
- export const useDesignSystemTheme = create<GlobalThemeStore>((set) => ({
46
- themeMode: 'light',
47
- setThemeMode: (mode: ThemeMode) => set({ themeMode: mode }),
48
- }));
49
-
50
- // Re-export ThemeMode for backward compatibility
51
- export type { ThemeMode };
@@ -1,40 +0,0 @@
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';
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 '../tokens/core/TokenFactory';
35
- import { useDesignSystemTheme } from '../../infrastructure/theme/globalThemeStore';
36
-
37
- export const useAppDesignTokens = (): DesignTokens => {
38
- const { themeMode } = useDesignSystemTheme();
39
- return useMemo(() => createDesignTokens(themeMode), [themeMode]);
40
- };
@@ -1,55 +0,0 @@
1
- /**
2
- * DESIGN TOKENS - PUBLIC API
3
- *
4
- * ✅ CLEAN BARREL EXPORT - Single source of truth
5
- * ✅ ZERO DUPLICATION - All tokens from TokenFactory
6
- * ✅ TYPE-SAFE - Full TypeScript support
7
- * ✅ FACTORY-FIRST - Benefits all 100+ generated apps
8
- *
9
- * @module AppDesignTokens
10
- */
11
-
12
- // =============================================================================
13
- // CORE EXPORTS (from TokenFactory)
14
- // =============================================================================
15
-
16
- export {
17
- createDesignTokens,
18
- STATIC_DESIGN_TOKENS,
19
- STATIC_TOKENS,
20
- withAlpha,
21
- type DesignTokens,
22
- type ThemeMode,
23
- type ColorPalette,
24
- } from './core/TokenFactory';
25
-
26
- // =============================================================================
27
- // BASE TOKEN EXPORTS
28
- // =============================================================================
29
-
30
- export {
31
- BASE_TOKENS,
32
- spacing,
33
- typography,
34
- borders,
35
- iconSizes,
36
- opacity,
37
- avatarSizes,
38
- type Spacing,
39
- type Typography,
40
- type Borders,
41
- type IconSizes,
42
- type Opacity,
43
- type AvatarSizes,
44
- type BaseTokens,
45
- } from './core/BaseTokens';
46
-
47
- // =============================================================================
48
- // COLOR PALETTE EXPORTS
49
- // =============================================================================
50
-
51
- export {
52
- lightColors,
53
- darkColors,
54
- getColorPalette,
55
- } from './core/ColorPalette';