@umituz/react-native-settings 4.20.58 → 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.
- package/.github/ISSUE_TEMPLATE/bug_report.md +51 -0
- package/.github/ISSUE_TEMPLATE/documentation.md +52 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +63 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +84 -0
- package/AI_AGENT_GUIDELINES.md +367 -0
- package/ARCHITECTURE.md +246 -0
- package/CHANGELOG.md +67 -0
- package/CODE_OF_CONDUCT.md +75 -0
- package/CONTRIBUTING.md +107 -0
- package/DOCUMENTATION_MIGRATION.md +319 -0
- package/DOCUMENTATION_TEMPLATE.md +155 -0
- package/LICENSE +21 -0
- package/README.md +321 -498
- package/SECURITY.md +98 -0
- package/SETTINGS_SCREEN_GUIDE.md +185 -0
- package/TESTING.md +358 -0
- package/package.json +13 -2
- package/src/application/README.md +85 -271
- package/src/domains/about/README.md +85 -440
- package/src/domains/about/presentation/hooks/README.md +93 -348
- package/src/domains/appearance/README.md +95 -584
- package/src/domains/appearance/hooks/README.md +95 -303
- package/src/domains/appearance/infrastructure/services/README.md +83 -397
- package/src/domains/appearance/presentation/components/README.md +95 -489
- package/src/domains/cloud-sync/README.md +73 -439
- package/src/domains/cloud-sync/presentation/components/README.md +95 -493
- package/src/domains/dev/README.md +71 -457
- package/src/domains/disclaimer/README.md +77 -411
- package/src/domains/disclaimer/presentation/components/README.md +95 -392
- package/src/domains/faqs/README.md +86 -574
- package/src/domains/feedback/README.md +79 -553
- package/src/domains/feedback/presentation/hooks/README.md +93 -426
- package/src/domains/legal/README.md +88 -537
- package/src/domains/rating/README.md +73 -440
- package/src/domains/rating/presentation/components/README.md +95 -475
- package/src/domains/video-tutorials/README.md +77 -470
- package/src/domains/video-tutorials/presentation/components/README.md +95 -431
- package/src/infrastructure/README.md +78 -425
- package/src/infrastructure/repositories/README.md +88 -420
- package/src/infrastructure/services/README.md +74 -460
- package/src/presentation/components/README.md +97 -480
- package/src/presentation/components/SettingsErrorBoundary/README.md +48 -436
- package/src/presentation/components/SettingsFooter/README.md +48 -427
- package/src/presentation/components/SettingsItemCard/README.md +152 -391
- package/src/presentation/components/SettingsItemCard/STRATEGY.md +164 -0
- package/src/presentation/components/SettingsSection/README.md +47 -401
- package/src/presentation/hooks/README.md +95 -389
- package/src/presentation/hooks/mutations/README.md +99 -376
- package/src/presentation/hooks/queries/README.md +111 -353
- package/src/presentation/navigation/README.md +70 -502
- package/src/presentation/navigation/components/README.md +70 -295
- package/src/presentation/navigation/hooks/README.md +75 -367
- package/src/presentation/navigation/utils/README.md +100 -380
- package/src/presentation/screens/README.md +53 -504
- package/src/presentation/screens/components/SettingsContent/README.md +53 -382
- package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
- package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
- package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
- package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
- package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
- package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
- package/src/presentation/screens/hooks/README.md +64 -354
- package/src/presentation/screens/types/README.md +79 -409
- package/src/presentation/screens/utils/README.md +65 -255
|
@@ -1,493 +1,99 @@
|
|
|
1
1
|
# Appearance Components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Purpose
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
### AppearanceScreen
|
|
8
|
-
|
|
9
|
-
Main screen for managing appearance settings including theme mode and custom colors.
|
|
10
|
-
|
|
11
|
-
```tsx
|
|
12
|
-
import { AppearanceScreen } from '@umituz/react-native-settings';
|
|
5
|
+
Components for theme management and appearance customization including theme selection, color picking, and live preview. Enables users to personalize their app experience with comprehensive theming options.
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
#### Props
|
|
111
|
-
|
|
112
|
-
| Prop | Type | Default | Description |
|
|
113
|
-
|------|------|---------|-------------|
|
|
114
|
-
| `colors` | `ColorPalette` | **Required** | Current color palette |
|
|
115
|
-
| `onColorsChange` | `(colors: ColorPalette) => void` | **Required** | Color change handler |
|
|
116
|
-
| `availableColors` | `string[]` | `undefined` | Predefined color options |
|
|
117
|
-
| `showPreview` | `boolean` | `true` | Show color preview |
|
|
118
|
-
| `title` | `string` | `'Colors'` | Section title |
|
|
119
|
-
|
|
120
|
-
#### Example
|
|
121
|
-
|
|
122
|
-
```tsx
|
|
123
|
-
<CustomColorsSection
|
|
124
|
-
colors={{
|
|
125
|
-
primary: '#FF5722',
|
|
126
|
-
secondary: '#2196F3',
|
|
127
|
-
accent: '#FFC107',
|
|
128
|
-
background: '#FFFFFF',
|
|
129
|
-
surface: '#F5F5F5',
|
|
130
|
-
}}
|
|
131
|
-
onColorsChange={(newColors) => {
|
|
132
|
-
setCustomColors(newColors);
|
|
133
|
-
}}
|
|
134
|
-
availableColors={[
|
|
135
|
-
'#FF5722', '#2196F3', '#4CAF50', '#FF9800',
|
|
136
|
-
'#9C27B0', '#00BCD4', '#8BC34A', '#FFC107'
|
|
137
|
-
]}
|
|
138
|
-
/>
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### AppearancePreview
|
|
142
|
-
|
|
143
|
-
Component showing live preview of theme changes.
|
|
144
|
-
|
|
145
|
-
```tsx
|
|
146
|
-
import { AppearancePreview } from '@umituz/react-native-settings';
|
|
147
|
-
|
|
148
|
-
function ThemePreview() {
|
|
149
|
-
const { themeMode, customColors } = useAppearance();
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
<AppearancePreview
|
|
153
|
-
themeMode={themeMode}
|
|
154
|
-
customColors={customColors}
|
|
155
|
-
/>
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
#### Props
|
|
161
|
-
|
|
162
|
-
| Prop | Type | Default | Description |
|
|
163
|
-
|------|------|---------|-------------|
|
|
164
|
-
| `themeMode` | `'light' \| 'dark' \| 'auto'` | **Required** | Theme mode |
|
|
165
|
-
| `customColors` | `ColorPalette` | `undefined` | Custom colors |
|
|
166
|
-
| `showSystemTheme` | `boolean` | `true` | Show system theme |
|
|
167
|
-
|
|
168
|
-
### ThemeOption
|
|
169
|
-
|
|
170
|
-
Individual theme option button/card.
|
|
171
|
-
|
|
172
|
-
```tsx
|
|
173
|
-
import { ThemeOption } from '@umituz/react-native-settings';
|
|
174
|
-
|
|
175
|
-
function ThemeOptions() {
|
|
176
|
-
return (
|
|
177
|
-
<View>
|
|
178
|
-
<ThemeOption
|
|
179
|
-
mode="light"
|
|
180
|
-
title="Light"
|
|
181
|
-
icon="sunny-outline"
|
|
182
|
-
selected={themeMode === 'light'}
|
|
183
|
-
onPress={() => setThemeMode('light')}
|
|
184
|
-
/>
|
|
185
|
-
|
|
186
|
-
<ThemeOption
|
|
187
|
-
mode="dark"
|
|
188
|
-
title="Dark"
|
|
189
|
-
icon="moon-outline"
|
|
190
|
-
selected={themeMode === 'dark'}
|
|
191
|
-
onPress={() => setThemeMode('dark')}
|
|
192
|
-
/>
|
|
193
|
-
|
|
194
|
-
<ThemeOption
|
|
195
|
-
mode="auto"
|
|
196
|
-
title="Auto"
|
|
197
|
-
icon="phone-portrait-outline"
|
|
198
|
-
selected={themeMode === 'auto'}
|
|
199
|
-
onPress={() => setThemeMode('auto')}
|
|
200
|
-
/>
|
|
201
|
-
</View>
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
#### Props
|
|
207
|
-
|
|
208
|
-
| Prop | Type | Default | Description |
|
|
209
|
-
|------|------|---------|-------------|
|
|
210
|
-
| `mode` | `'light' \| 'dark' \| 'auto'` | **Required** | Theme mode |
|
|
211
|
-
| `title` | `string` | **Required** | Theme title |
|
|
212
|
-
| `icon` | `IconName` | **Required** | Theme icon |
|
|
213
|
-
| `selected` | `boolean` | `false` | Selected state |
|
|
214
|
-
| `onPress` | `() => void` | **Required** | Press handler |
|
|
215
|
-
| `description` | `string` | `undefined` | Theme description |
|
|
216
|
-
|
|
217
|
-
### ColorPicker
|
|
218
|
-
|
|
219
|
-
Color picker component for selecting custom colors.
|
|
220
|
-
|
|
221
|
-
```tsx
|
|
222
|
-
import { ColorPicker } from '@umituz/react-native-settings';
|
|
223
|
-
|
|
224
|
-
function PrimaryColorPicker() {
|
|
225
|
-
const [color, setColor] = useState('#FF5722');
|
|
226
|
-
|
|
227
|
-
return (
|
|
228
|
-
<ColorPicker
|
|
229
|
-
label="Primary Color"
|
|
230
|
-
value={color}
|
|
231
|
-
onChange={setColor}
|
|
232
|
-
availableColors={['#FF5722', '#2196F3', '#4CAF50', '#FF9800']}
|
|
233
|
-
/>
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
#### Props
|
|
239
|
-
|
|
240
|
-
| Prop | Type | Default | Description |
|
|
241
|
-
|------|------|---------|-------------|
|
|
242
|
-
| `label` | `string` | **Required** | Color label |
|
|
243
|
-
| `value` | `string` | **Required** | Current color (hex) |
|
|
244
|
-
| `onChange` | `(color: string) => void` | **Required** | Change handler |
|
|
245
|
-
| `availableColors` | `string[]` | `undefined` | Predefined colors |
|
|
246
|
-
| `showCustomPicker` | `boolean` | `true` | Show custom color picker |
|
|
247
|
-
| `allowAlpha` | `boolean` | `false` | Allow alpha channel |
|
|
248
|
-
|
|
249
|
-
## Examples
|
|
250
|
-
|
|
251
|
-
### Complete Appearance Screen
|
|
252
|
-
|
|
253
|
-
```tsx
|
|
254
|
-
function AppearanceScreen() {
|
|
255
|
-
const { themeMode, customColors } = useAppearance();
|
|
256
|
-
const { setThemeMode, setCustomColors, resetColors } = useAppearanceActions();
|
|
257
|
-
|
|
258
|
-
return (
|
|
259
|
-
<ScrollView>
|
|
260
|
-
<AppearancePreview
|
|
261
|
-
themeMode={themeMode}
|
|
262
|
-
customColors={customColors}
|
|
263
|
-
/>
|
|
264
|
-
|
|
265
|
-
<ThemeModeSection
|
|
266
|
-
themeMode={themeMode}
|
|
267
|
-
onThemeModeChange={setThemeMode}
|
|
268
|
-
showPreview={true}
|
|
269
|
-
/>
|
|
270
|
-
|
|
271
|
-
<CustomColorsSection
|
|
272
|
-
colors={customColors || defaultColors}
|
|
273
|
-
onColorsChange={setCustomColors}
|
|
274
|
-
showPreview={true}
|
|
275
|
-
/>
|
|
276
|
-
|
|
277
|
-
<TouchableOpacity onPress={resetColors}>
|
|
278
|
-
<Text>Reset to Defaults</Text>
|
|
279
|
-
</TouchableOpacity>
|
|
280
|
-
</ScrollView>
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### Custom Color Palette
|
|
286
|
-
|
|
287
|
-
```tsx
|
|
288
|
-
function CustomThemeBuilder() {
|
|
289
|
-
const [colors, setColors] = useState(defaultColors);
|
|
290
|
-
const { setCustomColors } = useAppearanceActions();
|
|
291
|
-
|
|
292
|
-
const handleColorChange = (key: string, value: string) => {
|
|
293
|
-
setColors(prev => ({ ...prev, [key]: value }));
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
return (
|
|
297
|
-
<View>
|
|
298
|
-
<ColorPicker
|
|
299
|
-
label="Primary"
|
|
300
|
-
value={colors.primary}
|
|
301
|
-
onChange={(color) => handleColorChange('primary', color)}
|
|
302
|
-
/>
|
|
303
|
-
|
|
304
|
-
<ColorPicker
|
|
305
|
-
label="Secondary"
|
|
306
|
-
value={colors.secondary}
|
|
307
|
-
onChange={(color) => handleColorChange('secondary', color)}
|
|
308
|
-
/>
|
|
309
|
-
|
|
310
|
-
<ColorPicker
|
|
311
|
-
label="Accent"
|
|
312
|
-
value={colors.accent}
|
|
313
|
-
onChange={(color) => handleColorChange('accent', color)}
|
|
314
|
-
/>
|
|
315
|
-
|
|
316
|
-
<Button
|
|
317
|
-
onPress={() => setCustomColors(colors)}
|
|
318
|
-
title="Apply Theme"
|
|
319
|
-
/>
|
|
320
|
-
</View>
|
|
321
|
-
);
|
|
322
|
-
}
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
### Theme Switcher
|
|
326
|
-
|
|
327
|
-
```tsx
|
|
328
|
-
function QuickThemeSwitcher() {
|
|
329
|
-
const { themeMode, setThemeMode } = useAppearanceActions();
|
|
330
|
-
|
|
331
|
-
return (
|
|
332
|
-
<View style={styles.container}>
|
|
333
|
-
<TouchableOpacity
|
|
334
|
-
style={[styles.option, themeMode === 'light' && styles.selected]}
|
|
335
|
-
onPress={() => setThemeMode('light')}
|
|
336
|
-
>
|
|
337
|
-
<Ionicons name="sunny" size={24} />
|
|
338
|
-
<Text>Light</Text>
|
|
339
|
-
</TouchableOpacity>
|
|
340
|
-
|
|
341
|
-
<TouchableOpacity
|
|
342
|
-
style={[styles.option, themeMode === 'dark' && styles.selected]}
|
|
343
|
-
onPress={() => setThemeMode('dark')}
|
|
344
|
-
>
|
|
345
|
-
<Ionicons name="moon" size={24} />
|
|
346
|
-
<Text>Dark</Text>
|
|
347
|
-
</TouchableOpacity>
|
|
348
|
-
|
|
349
|
-
<TouchableOpacity
|
|
350
|
-
style={[styles.option, themeMode === 'auto' && styles.selected]}
|
|
351
|
-
onPress={() => setThemeMode('auto')}
|
|
352
|
-
>
|
|
353
|
-
<Ionicons name="phone-portrait" size={24} />
|
|
354
|
-
<Text>Auto</Text>
|
|
355
|
-
</TouchableOpacity>
|
|
356
|
-
</View>
|
|
357
|
-
);
|
|
358
|
-
}
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
### Preset Themes
|
|
362
|
-
|
|
363
|
-
```tsx
|
|
364
|
-
function ThemePresets() {
|
|
365
|
-
const { setCustomColors } = useAppearanceActions();
|
|
366
|
-
|
|
367
|
-
const presets = {
|
|
368
|
-
ocean: {
|
|
369
|
-
primary: '#2196F3',
|
|
370
|
-
secondary: '#00BCD4',
|
|
371
|
-
accent: '#4FC3F7',
|
|
372
|
-
},
|
|
373
|
-
sunset: {
|
|
374
|
-
primary: '#FF5722',
|
|
375
|
-
secondary: '#FF9800',
|
|
376
|
-
accent: '#FFC107',
|
|
377
|
-
},
|
|
378
|
-
forest: {
|
|
379
|
-
primary: '#4CAF50',
|
|
380
|
-
secondary: '#8BC34A',
|
|
381
|
-
accent: '#CDDC39',
|
|
382
|
-
},
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
return (
|
|
386
|
-
<View>
|
|
387
|
-
<Text>Choose a preset theme:</Text>
|
|
388
|
-
|
|
389
|
-
{Object.entries(presets).map(([name, colors]) => (
|
|
390
|
-
<TouchableOpacity
|
|
391
|
-
key={name}
|
|
392
|
-
onPress={() => setCustomColors(colors)}
|
|
393
|
-
>
|
|
394
|
-
<View style={{ flexDirection: 'row' }}>
|
|
395
|
-
<View style={{ backgroundColor: colors.primary, width: 20, height: 20 }} />
|
|
396
|
-
<View style={{ backgroundColor: colors.secondary, width: 20, height: 20 }} />
|
|
397
|
-
<View style={{ backgroundColor: colors.accent, width: 20, height: 20 }} />
|
|
398
|
-
<Text>{name}</Text>
|
|
399
|
-
</View>
|
|
400
|
-
</TouchableOpacity>
|
|
401
|
-
))}
|
|
402
|
-
</View>
|
|
403
|
-
);
|
|
404
|
-
}
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
## Styling
|
|
408
|
-
|
|
409
|
-
### Theme Styles
|
|
410
|
-
|
|
411
|
-
```typescript
|
|
412
|
-
const styles = StyleSheet.create({
|
|
413
|
-
container: {
|
|
414
|
-
padding: tokens.spacing.lg,
|
|
415
|
-
},
|
|
416
|
-
themeOption: {
|
|
417
|
-
flexDirection: 'row',
|
|
418
|
-
alignItems: 'center',
|
|
419
|
-
padding: tokens.spacing.md,
|
|
420
|
-
backgroundColor: tokens.colors.surface,
|
|
421
|
-
borderRadius: tokens.borderRadius.md,
|
|
422
|
-
marginBottom: tokens.spacing.sm,
|
|
423
|
-
},
|
|
424
|
-
themeOptionSelected: {
|
|
425
|
-
borderWidth: 2,
|
|
426
|
-
borderColor: tokens.colors.primary,
|
|
427
|
-
},
|
|
428
|
-
themeIcon: {
|
|
429
|
-
marginRight: tokens.spacing.md,
|
|
430
|
-
},
|
|
431
|
-
themeTitle: {
|
|
432
|
-
fontSize: tokens.typography.fontSize.base,
|
|
433
|
-
fontWeight: '600',
|
|
434
|
-
color: tokens.colors.textPrimary,
|
|
435
|
-
},
|
|
436
|
-
themeDescription: {
|
|
437
|
-
fontSize: tokens.typography.fontSize.sm,
|
|
438
|
-
color: tokens.colors.textSecondary,
|
|
439
|
-
},
|
|
440
|
-
});
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
## Color Palettes
|
|
444
|
-
|
|
445
|
-
### Light Theme Default
|
|
446
|
-
|
|
447
|
-
```typescript
|
|
448
|
-
const lightColors: ColorPalette = {
|
|
449
|
-
primary: '#2196F3',
|
|
450
|
-
secondary: '#00BCD4',
|
|
451
|
-
accent: '#FFC107',
|
|
452
|
-
background: '#FFFFFF',
|
|
453
|
-
surface: '#F5F5F5',
|
|
454
|
-
error: '#F44336',
|
|
455
|
-
success: '#4CAF50',
|
|
456
|
-
warning: '#FF9800',
|
|
457
|
-
};
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### Dark Theme Default
|
|
461
|
-
|
|
462
|
-
```typescript
|
|
463
|
-
const darkColors: ColorPalette = {
|
|
464
|
-
primary: '#2196F3',
|
|
465
|
-
secondary: '#00BCD4',
|
|
466
|
-
accent: '#FFC107',
|
|
467
|
-
background: '#121212',
|
|
468
|
-
surface: '#1E1E1E',
|
|
469
|
-
error: '#EF5350',
|
|
470
|
-
success: '#66BB6A',
|
|
471
|
-
warning: '#FFA726',
|
|
472
|
-
};
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
## Best Practices
|
|
476
|
-
|
|
477
|
-
1. **Preview**: Always show theme preview
|
|
478
|
-
2. **System Theme**: Respect system preference in auto mode
|
|
479
|
-
3. **Persistence**: Save theme changes immediately
|
|
480
|
-
4. **Validation**: Validate color hex codes
|
|
481
|
-
5. **Reset**: Provide reset to defaults
|
|
482
|
-
6. **Performance**: Use smooth transitions
|
|
483
|
-
7. **Accessibility**: Ensure sufficient contrast
|
|
484
|
-
|
|
485
|
-
## Related
|
|
486
|
-
|
|
487
|
-
- **Appearance Hooks**: Theme management hooks
|
|
488
|
-
- **Appearance Services**: System theme detection
|
|
489
|
-
- **Appearance Domain**: Appearance domain documentation
|
|
490
|
-
|
|
491
|
-
## License
|
|
492
|
-
|
|
493
|
-
MIT
|
|
7
|
+
## File Paths
|
|
8
|
+
|
|
9
|
+
- **AppearanceScreen**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/screens/AppearanceScreen.tsx`
|
|
10
|
+
- **ThemeModeSection**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/ThemeModeSection.tsx`
|
|
11
|
+
- **CustomColorsSection**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/CustomColorsSection.tsx`
|
|
12
|
+
- **AppearancePreview**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/AppearancePreview.tsx`
|
|
13
|
+
- **ThemeOption**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/ThemeOption.tsx`
|
|
14
|
+
- **ColorPicker**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/ColorPicker.tsx`
|
|
15
|
+
|
|
16
|
+
## Strategy
|
|
17
|
+
|
|
18
|
+
1. **Live Preview Implementation**: Shows real-time preview of theme changes as users make selections, providing immediate feedback and building confidence before applying changes globally.
|
|
19
|
+
|
|
20
|
+
2. **System Theme Respect**: Implements "auto" mode that automatically switches between light and dark themes based on system preferences, providing a seamless native experience.
|
|
21
|
+
|
|
22
|
+
3. **Progressive Customization**: Offers simple theme mode selection (light/dark/auto) for casual users and advanced color palette customization for power users, accommodating different user needs.
|
|
23
|
+
|
|
24
|
+
4. **Design System Integration**: Works seamlessly with design system tokens, allowing theme changes to propagate consistently across all components without manual style updates.
|
|
25
|
+
|
|
26
|
+
5. **Reset Capability**: Provides easy reset to defaults option, allowing users to quickly revert customizations if they're unsatisfied with their changes.
|
|
27
|
+
|
|
28
|
+
## Restrictions
|
|
29
|
+
|
|
30
|
+
### ❌ DO NOT
|
|
31
|
+
|
|
32
|
+
- Hardcode color values anywhere in the app
|
|
33
|
+
- Ignore system theme preference in auto mode
|
|
34
|
+
- Make theme changes without user action
|
|
35
|
+
- Break design system token dependencies
|
|
36
|
+
- Allow invalid color hex codes
|
|
37
|
+
|
|
38
|
+
### ❌ NEVER
|
|
39
|
+
|
|
40
|
+
- Remove the reset to defaults option
|
|
41
|
+
- Force a theme that violates accessibility standards
|
|
42
|
+
- Make color changes without proper validation
|
|
43
|
+
- Bypass theme persistence
|
|
44
|
+
- Use different theme scales across the app
|
|
45
|
+
|
|
46
|
+
### ❌ AVOID
|
|
47
|
+
|
|
48
|
+
- Too many preset themes (keep under 10)
|
|
49
|
+
- Clashing color combinations
|
|
50
|
+
- Overly complex color customization UI
|
|
51
|
+
- Delayed theme application
|
|
52
|
+
- Inconsistent theme transition animations
|
|
53
|
+
|
|
54
|
+
## Rules
|
|
55
|
+
|
|
56
|
+
### ✅ ALWAYS
|
|
57
|
+
|
|
58
|
+
- Show theme preview before applying changes
|
|
59
|
+
- Save theme changes immediately
|
|
60
|
+
- Respect system theme in auto mode
|
|
61
|
+
- Validate color hex codes before applying
|
|
62
|
+
- Ensure sufficient color contrast for accessibility
|
|
63
|
+
|
|
64
|
+
### ✅ MUST
|
|
65
|
+
|
|
66
|
+
- Provide light, dark, and auto theme options
|
|
67
|
+
- Support design system token integration
|
|
68
|
+
- Include reset to defaults button
|
|
69
|
+
- Test themes in different lighting conditions
|
|
70
|
+
- Maintain consistent theme across app lifecycle
|
|
71
|
+
|
|
72
|
+
### ✅ SHOULD
|
|
73
|
+
|
|
74
|
+
- Offer preset color palettes for quick selection
|
|
75
|
+
- Use smooth transitions for theme changes
|
|
76
|
+
- Show color names or hex codes for clarity
|
|
77
|
+
- Provide theme customization in dedicated screen
|
|
78
|
+
- Consider accessibility when selecting default colors
|
|
79
|
+
- Test with various color blindness types
|
|
80
|
+
|
|
81
|
+
## AI Agent Guidelines
|
|
82
|
+
|
|
83
|
+
1. **Theme Mode Implementation**: Always offer three options: Light, Dark, and Auto. In Auto mode, use useColorScheme or Appearance API to detect system preference and switch automatically. Show the active theme in preview so users understand what Auto means.
|
|
84
|
+
|
|
85
|
+
2. **Color Customization Strategy**: Provide preset color palettes (Ocean, Sunset, Forest, etc.) for users who want quick customization. For advanced users, offer individual color pickers for primary, secondary, and accent colors. Always validate hex codes and show color preview.
|
|
86
|
+
|
|
87
|
+
3. **Preview UX**: Position preview at the top of the appearance screen so users see changes immediately. Update preview in real-time as users select options. Show various UI elements in preview (cards, buttons, text) to demonstrate theme comprehensively.
|
|
88
|
+
|
|
89
|
+
4. **Persistence and Reset**: Save theme preferences to AsyncStorage immediately on change. Use keys like "theme-mode" and "custom-colors". The reset button should clear custom colors and revert to default theme mode (usually Auto or Light).
|
|
90
|
+
|
|
91
|
+
5. **Accessibility Testing**: Always test custom color themes for contrast ratios. Use tools to ensure text meets WCAG AA standards (4.5:1 for normal text, 3:1 for large text). Warn users if their custom colors don't meet accessibility standards, or prevent applying them.
|
|
92
|
+
|
|
93
|
+
## Reference
|
|
94
|
+
|
|
95
|
+
- **Main Screen**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/screens/AppearanceScreen.tsx`
|
|
96
|
+
- **Theme Components**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/presentation/components/`
|
|
97
|
+
- **Appearance Hooks**: Check for useAppearance and related hooks for state management
|
|
98
|
+
- **Appearance Services**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/appearance/services/`
|
|
99
|
+
- **Design System Tokens**: Refer to design system for color definitions and theming infrastructure
|