@umituz/react-native-settings 4.20.57 → 4.20.59

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 (65) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +51 -0
  2. package/.github/ISSUE_TEMPLATE/documentation.md +52 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.md +63 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +84 -0
  5. package/AI_AGENT_GUIDELINES.md +367 -0
  6. package/ARCHITECTURE.md +246 -0
  7. package/CHANGELOG.md +67 -0
  8. package/CODE_OF_CONDUCT.md +75 -0
  9. package/CONTRIBUTING.md +107 -0
  10. package/DOCUMENTATION_MIGRATION.md +319 -0
  11. package/DOCUMENTATION_TEMPLATE.md +155 -0
  12. package/LICENSE +21 -0
  13. package/README.md +321 -498
  14. package/SECURITY.md +98 -0
  15. package/SETTINGS_SCREEN_GUIDE.md +185 -0
  16. package/TESTING.md +358 -0
  17. package/package.json +13 -2
  18. package/src/__tests__/setup.ts +1 -4
  19. package/src/application/README.md +85 -271
  20. package/src/domains/about/README.md +85 -440
  21. package/src/domains/about/presentation/hooks/README.md +93 -348
  22. package/src/domains/appearance/README.md +95 -584
  23. package/src/domains/appearance/hooks/README.md +95 -303
  24. package/src/domains/appearance/infrastructure/services/README.md +83 -397
  25. package/src/domains/appearance/presentation/components/README.md +99 -0
  26. package/src/domains/cloud-sync/README.md +73 -439
  27. package/src/domains/cloud-sync/presentation/components/README.md +95 -493
  28. package/src/domains/dev/README.md +71 -457
  29. package/src/domains/disclaimer/README.md +77 -411
  30. package/src/domains/disclaimer/presentation/components/README.md +95 -392
  31. package/src/domains/faqs/README.md +86 -574
  32. package/src/domains/feedback/README.md +79 -553
  33. package/src/domains/feedback/presentation/hooks/README.md +93 -426
  34. package/src/domains/legal/README.md +88 -537
  35. package/src/domains/rating/README.md +73 -440
  36. package/src/domains/rating/presentation/components/README.md +95 -475
  37. package/src/domains/video-tutorials/README.md +77 -470
  38. package/src/domains/video-tutorials/presentation/components/README.md +95 -431
  39. package/src/infrastructure/README.md +78 -425
  40. package/src/infrastructure/repositories/README.md +88 -420
  41. package/src/infrastructure/services/README.md +74 -460
  42. package/src/presentation/components/README.md +97 -480
  43. package/src/presentation/components/SettingsErrorBoundary/README.md +48 -442
  44. package/src/presentation/components/SettingsFooter/README.md +48 -427
  45. package/src/presentation/components/SettingsItemCard/README.md +153 -392
  46. package/src/presentation/components/SettingsItemCard/STRATEGY.md +164 -0
  47. package/src/presentation/components/SettingsSection/README.md +47 -401
  48. package/src/presentation/hooks/README.md +95 -389
  49. package/src/presentation/hooks/mutations/README.md +99 -376
  50. package/src/presentation/hooks/queries/README.md +111 -353
  51. package/src/presentation/navigation/README.md +70 -502
  52. package/src/presentation/navigation/components/README.md +70 -295
  53. package/src/presentation/navigation/hooks/README.md +75 -367
  54. package/src/presentation/navigation/utils/README.md +100 -380
  55. package/src/presentation/screens/README.md +53 -504
  56. package/src/presentation/screens/components/SettingsContent/README.md +53 -382
  57. package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
  58. package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
  59. package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
  60. package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
  61. package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
  62. package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
  63. package/src/presentation/screens/hooks/README.md +64 -354
  64. package/src/presentation/screens/types/README.md +79 -409
  65. package/src/presentation/screens/utils/README.md +65 -255
@@ -1,589 +1,100 @@
1
1
  # Appearance Domain
2
2
 
3
- The Appearance domain provides comprehensive theme management and customization capabilities for your React Native app, including light/dark mode switching and custom color schemes.
4
-
5
- ## Features
6
-
7
- - **Theme Mode Switching**: Toggle between light and dark themes
8
- - **Custom Color Schemes**: Define and apply custom color palettes
9
- - **Live Preview**: See theme changes in real-time
10
- - **Persistent Settings**: Theme preferences are saved automatically
11
- - **System Theme Detection**: Respect device theme preferences
12
- - **Type-Safe**: Full TypeScript support
13
-
14
- ## Installation
15
-
16
- This domain is part of `@umituz/react-native-settings`. Install the package to use it:
17
-
18
- ```bash
19
- npm install @umituz/react-native-settings
20
- ```
21
-
22
- ## Components
23
-
24
- ### AppearanceScreen
25
-
26
- The main screen for managing appearance settings including theme mode and custom colors.
27
-
28
- ```tsx
29
- import { AppearanceScreen } from '@umituz/react-native-settings';
30
-
31
- function MyAppearanceScreen() {
32
- return <AppearanceScreen />;
33
- }
34
- ```
35
-
36
- #### Props
37
-
38
- | Prop | Type | Default | Description |
39
- |------|------|---------|-------------|
40
- | `texts` | `AppearanceTexts` | `undefined` | Custom text labels |
41
- | `headerComponent` | `ReactNode` | `undefined` | Custom header component |
42
- | `showThemeSection` | `boolean` | `true` | Show theme mode section |
43
- | `showColorsSection` | `boolean` | `true` | Show custom colors section |
44
- | `showPreviewSection` | `boolean` | `true` | Show preview section |
45
-
46
- #### Example with Custom Texts
47
-
48
- ```tsx
49
- import { AppearanceScreen } from '@umituz/react-native-settings';
50
-
51
- function LocalizedAppearanceScreen() {
52
- const texts = {
53
- title: 'Appearance',
54
- subtitle: 'Customize your app experience',
55
- themeSectionTitle: 'Theme',
56
- themeSectionDescription: 'Choose your preferred theme mode',
57
- featuresSectionTitle: 'Features',
58
- colorsSectionTitle: 'Custom Colors',
59
- colorsSectionDescription: 'Personalize your color scheme',
60
- previewSectionTitle: 'Preview',
61
- previewSectionDescription: 'See how your changes look',
62
- resetButtonText: 'Reset to Default',
63
- lightMode: {
64
- title: 'Light Mode',
65
- subtitle: 'Bright and clean',
66
- description: 'Perfect for daytime use',
67
- features: ['Easy on the eyes', 'Better visibility', 'Classic look'],
68
- },
69
- darkMode: {
70
- title: 'Dark Mode',
71
- subtitle: 'Easy on the eyes',
72
- description: 'Great for low-light environments',
73
- features: ['Reduces eye strain', 'Saves battery', 'Modern look'],
74
- },
75
- };
76
-
77
- return <AppearanceScreen texts={texts} />;
78
- }
79
- ```
80
-
81
- ### ThemeModeSection
82
-
83
- Section for selecting between light and dark theme modes.
84
-
85
- ```tsx
86
- import { ThemeModeSection } from '@umituz/react-native-settings';
87
-
88
- function ThemeSection() {
89
- const themes = [
90
- {
91
- mode: 'light',
92
- title: 'Light Mode',
93
- subtitle: 'Bright and clean',
94
- description: 'Perfect for daytime use',
95
- features: ['Easy on the eyes', 'Better visibility'],
96
- },
97
- {
98
- mode: 'dark',
99
- title: 'Dark Mode',
100
- subtitle: 'Easy on the eyes',
101
- description: 'Great for low-light environments',
102
- features: ['Reduces eye strain', 'Saves battery'],
103
- },
104
- ];
105
-
106
- return (
107
- <ThemeModeSection
108
- themeMode="dark"
109
- onThemeSelect={(mode) => console.log('Selected:', mode)}
110
- title="Choose Theme"
111
- description="Select your preferred theme"
112
- themes={themes}
113
- />
114
- );
115
- }
116
- ```
117
-
118
- #### Props
119
-
120
- | Prop | Type | Default | Description |
121
- |------|------|---------|-------------|
122
- | `tokens` | `DesignTokens` | **Required** | Design tokens from design system |
123
- | `themeMode` | `ThemeMode` | **Required** | Current theme mode |
124
- | `onThemeSelect` | `(mode) => void` | **Required** | Theme change handler |
125
- | `title` | `string` | `undefined` | Section title |
126
- | `description` | `string` | `undefined` | Section description |
127
- | `themes` | `ThemeOptionConfig[]` | **Required** | Available theme options |
128
-
129
- ### CustomColorsSection
130
-
131
- Section for customizing app colors.
132
-
133
- ```tsx
134
- import { CustomColorsSection } from '@umituz/react-native-settings';
135
-
136
- function ColorsSection() {
137
- const customColors = {
138
- primary: '#007AFF',
139
- secondary: '#5856D6',
140
- accent: '#FF9500',
141
- };
142
-
143
- return (
144
- <CustomColorsSection
145
- localCustomColors={customColors}
146
- onColorChange={(key, color) => console.log(`${key}: ${color}`)}
147
- onResetColors={() => console.log('Reset colors')}
148
- title="Custom Colors"
149
- description="Personalize your color scheme"
150
- resetButtonText="Reset"
151
- />
152
- );
153
- }
154
- ```
155
-
156
- #### Props
157
-
158
- | Prop | Type | Default | Description |
159
- |------|------|---------|-------------|
160
- | `tokens` | `DesignTokens` | **Required** | Design tokens from design system |
161
- | `localCustomColors` | `CustomThemeColors` | **Required** | Current custom colors |
162
- | `onColorChange` | `(key, color) => void` | **Required** | Color change handler |
163
- | `onResetColors` | `() => void` | **Required** | Reset handler |
164
- | `title` | `string` | `undefined` | Section title |
165
- | `description` | `string` | `undefined` | Section description |
166
- | `resetButtonText` | `string` | `undefined` | Reset button text |
167
-
168
- ### AppearancePreview
169
-
170
- Live preview component showing how theme changes look.
171
-
172
- ```tsx
173
- import { AppearancePreview } from '@umituz/react-native-settings';
174
-
175
- function PreviewSection() {
176
- const customColors = {
177
- primary: '#007AFF',
178
- secondary: '#5856D6',
179
- };
180
-
181
- return (
182
- <AppearancePreview
183
- localCustomColors={customColors}
184
- title="Preview"
185
- description="See how your changes look in real-time"
186
- />
187
- );
188
- }
189
- ```
190
-
191
- #### Props
192
-
193
- | Prop | Type | Default | Description |
194
- |------|------|---------|-------------|
195
- | `tokens` | `DesignTokens` | **Required** | Design tokens from design system |
196
- | `localCustomColors` | `CustomThemeColors` | **Required** | Custom colors to preview |
197
- | `title` | `string` | `undefined` | Section title |
198
- | `description` | `string` | `undefined` | Section description |
199
-
200
- ### ColorPicker
201
-
202
- Color picker component for selecting custom colors.
203
-
204
- ```tsx
205
- import { ColorPicker } from '@umituz/react-native-settings';
206
-
207
- function MyColorPicker() {
208
- return (
209
- <ColorPicker
210
- label="Primary Color"
211
- value="#007AFF"
212
- onChange={(color) => console.log('Color:', color)}
213
- />
214
- );
215
- }
216
- ```
217
-
218
- ### AppearanceHeader
219
-
220
- Header component for the appearance screen.
221
-
222
- ```tsx
223
- import { AppearanceHeader } from '@umituz/react-native-settings';
224
-
225
- function MyAppearanceHeader() {
226
- const tokens = useAppDesignTokens();
227
-
228
- return (
229
- <AppearanceHeader
230
- tokens={tokens}
231
- title="Appearance"
232
- subtitle="Customize your app"
233
- />
234
- );
235
- }
236
- ```
237
-
238
- #### Props
239
-
240
- | Prop | Type | Default | Description |
241
- |------|------|---------|-------------|
242
- | `tokens` | `DesignTokens` | **Required** | Design tokens |
243
- | `title` | `string` | `undefined` | Header title |
244
- | `subtitle` | `string` | `undefined` | Header subtitle |
245
-
246
- ## Hooks
247
-
248
- ### useAppearance
249
-
250
- Main hook for accessing and managing appearance settings.
251
-
252
- ```tsx
253
- import { useAppearance } from '@umituz/react-native-settings';
254
-
255
- function MyComponent() {
256
- const {
257
- themeMode,
258
- customColors,
259
- isLoading,
260
- setThemeMode,
261
- setCustomColors,
262
- reset,
263
- } = useAppearance();
264
-
265
- return (
266
- <View>
267
- <Text>Current theme: {themeMode}</Text>
268
- <Button title="Switch to Dark" onPress={() => setThemeMode('dark')} />
269
- <Button title="Reset" onPress={reset} />
270
- </View>
271
- );
272
- }
273
- ```
274
-
275
- #### Return Value
276
-
277
- | Property | Type | Description |
278
- |----------|------|-------------|
279
- | `themeMode` | `ThemeMode` | Current theme mode (`'light'` or `'dark'`) |
280
- | `customColors` | `CustomThemeColors \| undefined` | Custom color scheme |
281
- | `isLoading` | `boolean` | Loading state |
282
- | `setThemeMode` | `(mode) => void` | Function to set theme mode |
283
- | `setCustomColors` | `(colors) => void` | Function to set custom colors |
284
- | `reset` | `() => void` | Reset to default appearance |
285
-
286
- ### useAppearanceActions
287
-
288
- Hook for appearance-related actions and handlers.
289
-
290
- ```tsx
291
- import { useAppearanceActions } from '@umituz/react-native-settings';
292
-
293
- function AppearanceActions() {
294
- const {
295
- localCustomColors,
296
- handleThemeSelect,
297
- handleColorChange,
298
- handleResetColors,
299
- } = useAppearanceActions();
300
-
301
- return (
302
- <View>
303
- <Button
304
- title="Select Dark Theme"
305
- onPress={() => handleThemeSelect('dark')}
306
- />
307
- <Button
308
- title="Change Primary Color"
309
- onPress={() => handleColorChange('primary', '#FF0000')}
310
- />
311
- <Button title="Reset Colors" onPress={handleResetColors} />
312
- </View>
313
- );
314
- }
315
- ```
316
-
317
- #### Return Value
318
-
319
- | Property | Type | Description |
320
- |----------|------|-------------|
321
- | `localCustomColors` | `CustomThemeColors` | Current custom colors |
322
- | `handleThemeSelect` | `(mode) => void` | Handle theme selection |
323
- | `handleColorChange` | `(key, color) => void` | Handle color change |
324
- | `handleResetColors` | `() => void` | Handle color reset |
325
-
326
- ## Types
327
-
328
- ### ThemeMode
329
-
330
- ```typescript
331
- type ThemeMode = 'light' | 'dark';
332
- ```
333
-
334
- ### CustomThemeColors
335
-
336
- ```typescript
337
- interface CustomThemeColors {
338
- primary?: string;
339
- secondary?: string;
340
- accent?: string;
341
- background?: string;
342
- surface?: string;
343
- // ... more color options
344
- }
345
- ```
346
-
347
- ### AppearanceSettings
348
-
349
- ```typescript
350
- interface AppearanceSettings {
351
- themeMode: ThemeMode;
352
- customColors?: CustomThemeColors;
353
- }
354
- ```
355
-
356
- ### AppearanceTexts
357
-
358
- ```typescript
359
- interface AppearanceTexts {
360
- title?: string;
361
- subtitle?: string;
362
- themeSectionTitle?: string;
363
- themeSectionDescription?: string;
364
- featuresSectionTitle?: string;
365
- colorsSectionTitle?: string;
366
- colorsSectionDescription?: string;
367
- previewSectionTitle?: string;
368
- previewSectionDescription?: string;
369
- resetButtonText?: string;
370
- lightMode?: ThemeModeTextConfig;
371
- darkMode?: ThemeModeTextConfig;
372
- }
373
- ```
374
-
375
- ### ThemeModeTextConfig
376
-
377
- ```typescript
378
- interface ThemeModeTextConfig {
379
- title: string;
380
- subtitle?: string;
381
- description?: string;
382
- features: string[];
383
- }
384
- ```
385
-
386
- ### ThemeOptionConfig
387
-
388
- ```typescript
389
- interface ThemeOptionConfig {
390
- mode: ThemeMode;
391
- title: string;
392
- subtitle?: string;
393
- description?: string;
394
- features?: string[];
395
- featuresTitle?: string;
396
- }
397
- ```
398
-
399
- ## Examples
400
-
401
- ### Basic Usage
402
-
403
- ```tsx
404
- import React from 'react';
405
- import { View } from 'react-native';
406
- import { AppearanceScreen } from '@umituz/react-native-settings';
407
-
408
- export default function App() {
409
- return (
410
- <View style={{ flex: 1 }}>
411
- <AppearanceScreen />
412
- </View>
413
- );
414
- }
415
- ```
416
-
417
- ### Custom Sections
418
-
419
- ```tsx
420
- import { AppearanceScreen } from '@umituz/react-native-settings';
421
-
422
- function CustomAppearanceScreen() {
423
- return (
424
- <AppearanceScreen
425
- showThemeSection={true}
426
- showColorsSection={false} // Hide color customization
427
- showPreviewSection={true}
428
- />
429
- );
430
- }
431
- ```
432
-
433
- ### Using the Hook
434
-
435
- ```tsx
436
- import { useAppearance } from '@umituz/react-native-settings';
437
-
438
- function ThemeToggle() {
439
- const { themeMode, setThemeMode } = useAppearance();
440
-
441
- return (
442
- <View>
443
- <Text>Current: {themeMode}</Text>
444
- <Button
445
- title="Toggle Theme"
446
- onPress={() => setThemeMode(themeMode === 'light' ? 'dark' : 'light')}
447
- />
448
- </View>
449
- );
450
- }
451
- ```
452
-
453
- ### Custom Colors
454
-
455
- ```tsx
456
- import { useAppearance } from '@umituz/react-native-settings';
457
-
458
- function ColorCustomizer() {
459
- const { customColors, setCustomColors } = useAppearance();
460
-
461
- const applyCustomTheme = () => {
462
- setCustomColors({
463
- primary: '#FF6B6B',
464
- secondary: '#4ECDC4',
465
- accent: '#FFE66D',
466
- });
467
- };
468
-
469
- return (
470
- <View>
471
- <Text>Primary: {customColors?.primary}</Text>
472
- <Button title="Apply Custom Theme" onPress={applyCustomTheme} />
473
- </View>
474
- );
475
- }
476
- ```
477
-
478
- ### Complete Customization
479
-
480
- ```tsx
481
- import { AppearanceScreen } from '@umituz/react-native-settings';
482
-
483
- function FullyCustomizedScreen() {
484
- const texts = {
485
- title: 'Personalization',
486
- subtitle: 'Make it yours',
487
- themeSectionTitle: 'Theme Mode',
488
- colorsSectionTitle: 'Color Palette',
489
- resetButtonText: 'Reset Everything',
490
- lightMode: {
491
- title: 'Light',
492
- features: ['Clean look', 'Better readability'],
493
- },
494
- darkMode: {
495
- title: 'Dark',
496
- features: ['Easy on eyes', 'Saves battery'],
497
- },
498
- };
499
-
500
- const customHeader = (
501
- <View style={{ padding: 20 }}>
502
- <Text style={{ fontSize: 24, fontWeight: 'bold' }}>
503
- App Settings
504
- </Text>
505
- </View>
506
- );
507
-
508
- return (
509
- <AppearanceScreen
510
- texts={texts}
511
- headerComponent={customHeader}
512
- showPreviewSection={false}
513
- />
514
- );
515
- }
516
- ```
517
-
518
- ## Architecture
519
-
520
- The Appearance domain follows a clean architecture pattern:
521
-
522
- ```
523
- src/domains/appearance/
524
- ├── application/ # Application logic
525
- │ └── ports/ # Repository interfaces
526
- ├── infrastructure/ # Implementation
527
- │ ├── repositories/ # Data persistence
528
- │ └── services/ # System theme detection, validation
529
- ├── presentation/ # UI components
530
- │ ├── screens/ # AppearanceScreen
531
- │ ├── components/ # ThemeModeSection, CustomColorsSection, etc.
532
- │ └── hooks/ # useAppearance, useAppearanceActions
533
- ├── data/ # Color palettes and constants
534
- └── types/ # TypeScript definitions
535
- ```
536
-
537
- ## Best Practices
538
-
539
- 1. **Respect System Theme**: Detect and respect the user's device theme preference
540
- 2. **Provide Preview**: Always show users how changes look before applying
541
- 3. **Smooth Transitions**: Animate theme changes for a polished experience
542
- 4. **Persist Choices**: Save theme preferences automatically
543
- 5. **Accessibility First**: Ensure good contrast ratios in both themes
544
- 6. **Test Both Themes**: Verify your UI looks good in light and dark modes
545
-
546
- ## Testing
547
-
548
- ```tsx
549
- import { render, fireEvent } from '@testing-library/react-native';
550
- import { AppearanceScreen } from '@umituz/react-native-settings';
551
-
552
- describe('AppearanceScreen', () => {
553
- it('displays theme options', () => {
554
- const { getByText } = render(<AppearanceScreen />);
555
-
556
- expect(getByText(/light/i)).toBeTruthy();
557
- expect(getByText(/dark/i)).toBeTruthy();
558
- });
559
-
560
- it('handles theme selection', () => {
561
- const { getByText } = render(<AppearanceScreen />);
562
-
563
- const darkButton = getByText(/dark/i);
564
- fireEvent.press(darkButton);
565
-
566
- // Assert theme changed
567
- });
568
- });
569
- ```
570
-
571
- ## Integration with Design System
572
-
573
- This domain integrates seamlessly with `@umituz/react-native-design-system`:
574
-
575
- ```tsx
576
- import { useAppDesignTokens, ThemeProvider } from '@umituz/react-native-design-system';
577
- import { AppearanceScreen } from '@umituz/react-native-settings';
578
-
579
- function App() {
580
- return (
581
- <ThemeProvider>
582
- <AppearanceScreen />
583
- </ThemeProvider>
584
- );
585
- }
586
- ```
3
+ ## Purpose
4
+
5
+ Provides comprehensive theme management and customization capabilities including light/dark mode switching and custom color schemes.
6
+
7
+ ## File Paths
8
+
9
+ **Screens:**
10
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/screens/AppearanceScreen.tsx`
11
+
12
+ **Components:**
13
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/ThemeModeSection.tsx`
14
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/CustomColorsSection.tsx`
15
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/AppearancePreview.tsx`
16
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/AppearanceHeader.tsx`
17
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/ColorPicker.tsx`
18
+
19
+ **Hooks:**
20
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/hooks/useAppearance.ts`
21
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/hooks/useAppearanceActions.ts`
22
+
23
+ **Application Layer:**
24
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/application/ports/IAppearanceRepository.ts`
25
+
26
+ **Infrastructure:**
27
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/infrastructure/repositories/AppearanceRepository.ts`
28
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/infrastructure/services/AppearanceValidationService.ts`
29
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/infrastructure/services/SystemThemeService.ts`
30
+
31
+ **Data:**
32
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/data/colorPalettes.ts`
33
+
34
+ **Types:**
35
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/types/index.ts`
36
+
37
+ **Index:**
38
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/index.ts`
39
+
40
+ ## Strategy
41
+
42
+ 1. **System Theme Detection**: Automatically detect and respect device theme preferences with SystemThemeService
43
+ 2. **Repository Pattern**: Use IAppearanceRepository for abstracted theme data access and persistence
44
+ 3. **Design System Integration**: Integrate with `@umituz/react-native-design-system` for consistent theming
45
+ 4. **Color Validation**: Validate custom colors through AppearanceValidationService before applying
46
+ 5. **Hook-Based State Management**: Use useAppearance and useAppearanceActions for theme state and actions
47
+
48
+ ## Restrictions (Forbidden)
49
+
50
+ ### DO NOT
51
+ - DO NOT bypass the repository pattern when accessing or updating theme data
52
+ - DO NOT apply custom colors without validation through AppearanceValidationService
53
+ - ❌ DO NOT use Appearance components without providing design tokens
54
+ - DO NOT hardcode theme values - always use the repository and hooks
55
+
56
+ ### NEVER
57
+ - ❌ NEVER use theme values directly from storage without going through the repository
58
+ - ❌ NEVER apply colors that don't meet accessibility standards (contrast ratios)
59
+ - NEVER mutate theme state directly without using the provided hooks
60
+ - ❌ NEVER use AppearanceScreen without a ThemeProvider from the design system
61
+
62
+ ### AVOID
63
+ - ❌ AVOID creating custom theme management solutions when the domain provides everything needed
64
+ - AVOID applying theme changes without smooth transitions
65
+ - AVOID storing invalid color values in the repository
66
+ - AVOID mixing theme logic with business logic in components
67
+
68
+ ## Rules
69
+
70
+ ### ALWAYS
71
+ - ALWAYS use useAppearance hook for theme state management
72
+ - ALWAYS validate custom colors before applying them
73
+ - ALWAYS provide design tokens to Appearance components
74
+ - ✅ ALWAYS wrap Appearance components in ThemeProvider from design system
75
+ - ✅ ALWAYS handle loading states when theme is being initialized
76
+
77
+ ### MUST
78
+ - ✅ MUST use IAppearanceRepository interface for theme data access
79
+ - ✅ MUST persist theme changes immediately for next app launch
80
+ - ✅ MUST respect system theme when user hasn't set a preference
81
+ - ✅ MUST provide fallback colors when custom colors fail validation
82
+ - ✅ MUST test UI in both light and dark themes
83
+
84
+ ### SHOULD
85
+ - ✅ SHOULD provide smooth transitions when theme changes
86
+ - SHOULD show preview of theme changes before applying
87
+ - ✅ SHOULD allow users to easily reset to default theme
88
+ - SHOULD implement theme changes with minimal re-renders
89
+ - SHOULD ensure good contrast ratios in both themes
90
+
91
+ ## AI Agent Guidelines
92
+
93
+ 1. **Design System Integration**: Always integrate Appearance components with ThemeProvider from `@umituz/react-native-design-system`
94
+ 2. **Hook Usage**: Always use useAppearance for theme state and useAppearanceActions for theme operations
95
+ 3. **Repository Access**: Always use IAppearanceRepository interface - never access storage directly
96
+ 4. **Validation**: Always validate custom colors through AppearanceValidationService before applying
97
+ 5. **Testing**: Always test appearance changes in both light and dark modes to ensure proper rendering
587
98
 
588
99
  ## Related
589
100