@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.
Files changed (64) 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/application/README.md +85 -271
  19. package/src/domains/about/README.md +85 -440
  20. package/src/domains/about/presentation/hooks/README.md +93 -348
  21. package/src/domains/appearance/README.md +95 -584
  22. package/src/domains/appearance/hooks/README.md +95 -303
  23. package/src/domains/appearance/infrastructure/services/README.md +83 -397
  24. package/src/domains/appearance/presentation/components/README.md +95 -489
  25. package/src/domains/cloud-sync/README.md +73 -439
  26. package/src/domains/cloud-sync/presentation/components/README.md +95 -493
  27. package/src/domains/dev/README.md +71 -457
  28. package/src/domains/disclaimer/README.md +77 -411
  29. package/src/domains/disclaimer/presentation/components/README.md +95 -392
  30. package/src/domains/faqs/README.md +86 -574
  31. package/src/domains/feedback/README.md +79 -553
  32. package/src/domains/feedback/presentation/hooks/README.md +93 -426
  33. package/src/domains/legal/README.md +88 -537
  34. package/src/domains/rating/README.md +73 -440
  35. package/src/domains/rating/presentation/components/README.md +95 -475
  36. package/src/domains/video-tutorials/README.md +77 -470
  37. package/src/domains/video-tutorials/presentation/components/README.md +95 -431
  38. package/src/infrastructure/README.md +78 -425
  39. package/src/infrastructure/repositories/README.md +88 -420
  40. package/src/infrastructure/services/README.md +74 -460
  41. package/src/presentation/components/README.md +97 -480
  42. package/src/presentation/components/SettingsErrorBoundary/README.md +48 -436
  43. package/src/presentation/components/SettingsFooter/README.md +48 -427
  44. package/src/presentation/components/SettingsItemCard/README.md +152 -391
  45. package/src/presentation/components/SettingsItemCard/STRATEGY.md +164 -0
  46. package/src/presentation/components/SettingsSection/README.md +47 -401
  47. package/src/presentation/hooks/README.md +95 -389
  48. package/src/presentation/hooks/mutations/README.md +99 -376
  49. package/src/presentation/hooks/queries/README.md +111 -353
  50. package/src/presentation/navigation/README.md +70 -502
  51. package/src/presentation/navigation/components/README.md +70 -295
  52. package/src/presentation/navigation/hooks/README.md +75 -367
  53. package/src/presentation/navigation/utils/README.md +100 -380
  54. package/src/presentation/screens/README.md +53 -504
  55. package/src/presentation/screens/components/SettingsContent/README.md +53 -382
  56. package/src/presentation/screens/components/SettingsHeader/README.md +48 -303
  57. package/src/presentation/screens/components/sections/CustomSettingsList/README.md +47 -359
  58. package/src/presentation/screens/components/sections/FeatureSettingsSection/README.md +81 -176
  59. package/src/presentation/screens/components/sections/IdentitySettingsSection/README.md +40 -297
  60. package/src/presentation/screens/components/sections/ProfileSectionLoader/README.md +47 -451
  61. package/src/presentation/screens/components/sections/SupportSettingsSection/README.md +45 -361
  62. package/src/presentation/screens/hooks/README.md +64 -354
  63. package/src/presentation/screens/types/README.md +79 -409
  64. package/src/presentation/screens/utils/README.md +65 -255
@@ -1,322 +1,67 @@
1
1
  # Settings Header
2
2
 
3
- Header component for the settings screen with optional close button functionality.
3
+ ## Purpose
4
4
 
5
- ## Features
5
+ Header component for the settings screen with optional close button functionality for modal/presentation styles.
6
6
 
7
- - **Screen Title**: Displays localized "Settings" title
8
- - **Close Button**: Optional close button for modal/presentation
9
- - **Auto Navigation**: Automatically goes back if no custom handler
10
- - **Design System**: Uses design system tokens for styling
11
- - **Internationalization**: Supports i18n
7
+ ## File Paths
12
8
 
13
- ## Installation
9
+ - **Component**: `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/SettingsHeader/SettingsHeader.tsx`
14
10
 
15
- This component is part of `@umituz/react-native-settings`.
11
+ ## Strategy
16
12
 
17
- ## Usage
13
+ 1. **Screen Title**: Displays localized "Settings" title using translation system
14
+ 2. **Close Button**: Optional close button for modal presentation style
15
+ 3. **Auto Navigation**: Automatically goes back if no custom handler is provided
16
+ 4. **Design System**: Uses design system tokens for consistent styling
17
+ 5. **Internationalization**: Supports i18n for all text content
18
18
 
19
- ### Basic Header
19
+ ## Restrictions (Forbidden)
20
20
 
21
- ```tsx
22
- import { SettingsHeader } from '@umituz/react-native-settings';
21
+ ### DO NOT
22
+ - DO NOT use SettingsHeader in non-modal presentations (let React Navigation handle header)
23
+ - ❌ DO NOT override the title text (use translation system)
24
+ - ❌ DO NOT add custom actions to the header
23
25
 
24
- function MySettingsScreen() {
25
- return (
26
- <>
27
- <SettingsHeader />
28
- {/* Rest of screen content */}
29
- </>
30
- );
31
- }
32
- ```
26
+ ### NEVER
27
+ - ❌ NEVER use SettingsHeader with card-style stack navigation
28
+ - ❌ NEVER remove or hide the close button in modal presentation
29
+ - ❌ NEVER hardcode title text (must use translations)
33
30
 
34
- ### With Close Button
31
+ ### AVOID
32
+ - ❌ AVOID adding additional buttons or actions to the header
33
+ - ❌ AVOID custom styling that breaks design system consistency
34
+ - ❌ AVOID using SettingsHeader outside of modal presentation context
35
35
 
36
- ```tsx
37
- function ModalSettingsScreen() {
38
- const handleClose = () => {
39
- navigation.goBack();
40
- };
36
+ ## Rules (Mandatory)
41
37
 
42
- return (
43
- <>
44
- <SettingsHeader
45
- showCloseButton={true}
46
- onClose={handleClose}
47
- />
48
- {/* Settings content */}
49
- </>
50
- );
51
- }
52
- ```
38
+ ### ALWAYS
39
+ - ✅ ALWAYS use close button in modal presentation (`presentation: 'modal'`)
40
+ - ✅ ALWAYS provide custom close handler when needed
41
+ - ✅ ALWAYS use translation keys for all text
42
+ - ✅ MUST set `headerShown: false` in screen options when using SettingsHeader
53
43
 
54
- ## Props
44
+ ### MUST
45
+ - ✅ MUST ensure close button is easily tappable (44x44 minimum)
46
+ - ✅ MUST provide confirmation if there are unsaved changes
47
+ - ✅ MUST use proper navigation.goBack() as default close behavior
55
48
 
56
- ### SettingsHeaderProps
49
+ ### SHOULD
50
+ - ✅ SHOULD use custom close handler for special actions (e.g., save before close)
51
+ - ✅ SHOULD test close button in both iOS and Android
52
+ - ✅ SHOULD ensure proper hit area for close button (hitSlop)
57
53
 
58
- | Prop | Type | Default | Description |
59
- |------|------|---------|-------------|
60
- | `showCloseButton` | `boolean` | `false` | Show close button |
61
- | `onClose` | `() => void` | `undefined` | Custom close handler |
54
+ ## AI Agent Guidelines
62
55
 
63
- ## Behavior
56
+ 1. **File Reference**: When modifying header behavior, refer to `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/presentation/screens/components/SettingsHeader/SettingsHeader.tsx`
57
+ 2. **Modal Setup**: Always set `presentation: 'modal'` and `headerShown: false` in screen options
58
+ 3. **Close Handler**: If custom close logic is needed (save, confirm), provide via `onClose` prop
59
+ 4. **Navigation**: Default behavior calls `navigation.goBack()` when no `onClose` is provided
60
+ 5. **Accessibility**: Ensure close button has proper accessibility label
64
61
 
65
- ### Close Button
62
+ ## Component Reference
66
63
 
67
- When `showCloseButton` is `true`:
68
-
69
- - If `onClose` provided: Calls `onClose()`
70
- - If no `onClose`: Calls `navigation.goBack()`
71
-
72
- ### Close Handler
73
-
74
- ```typescript
75
- const handleClose = () => {
76
- if (onClose) {
77
- onClose(); // Use custom handler
78
- } else {
79
- navigation.goBack(); // Default navigation
80
- }
81
- };
82
- ```
83
-
84
- ## Examples
85
-
86
- ### Modal Settings
87
-
88
- ```tsx
89
- import { SettingsHeader } from '@umituz/react-native-settings';
90
- import { Modal } from 'react-native';
91
-
92
- function SettingsModal({ visible, onClose }) {
93
- return (
94
- <Modal visible={visible} animationType="slide">
95
- <SettingsHeader
96
- showCloseButton={true}
97
- onClose={onClose}
98
- />
99
- <SettingsContent />
100
- </Modal>
101
- );
102
- }
103
- ```
104
-
105
- ### Presentation Style
106
-
107
- ```tsx
108
- import { SettingsHeader } from '@umituz/react-native-settings';
109
-
110
- function PresentationSettings() {
111
- const navigation = useNavigation();
112
-
113
- return (
114
- <Stack.Screen
115
- name="Settings"
116
- options={{
117
- presentation: 'modal',
118
- headerShown: false,
119
- }}
120
- >
121
- {() => (
122
- <View>
123
- <SettingsHeader
124
- showCloseButton={true}
125
- onClose={() => navigation.goBack()}
126
- />
127
- <SettingsContent />
128
- </View>
129
- )}
130
- </Stack.Screen>
131
- );
132
- }
133
- ```
134
-
135
- ### Custom Close Action
136
-
137
- ```tsx
138
- function SettingsWithCustomClose() {
139
- const handleClose = () => {
140
- // Custom logic before closing
141
- saveDraftChanges();
142
- navigation.goBack();
143
- };
144
-
145
- return (
146
- <SettingsHeader
147
- showCloseButton={true}
148
- onClose={handleClose}
149
- />
150
- );
151
- }
152
- ```
153
-
154
- ### Close with Confirmation
155
-
156
- ```tsx
157
- function SettingsWithConfirmation() {
158
- const handleClose = () => {
159
- Alert.alert(
160
- 'Discard Changes?',
161
- 'You have unsaved changes',
162
- [
163
- { text: 'Keep Editing', style: 'cancel' },
164
- {
165
- text: 'Discard',
166
- style: 'destructive',
167
- onPress: () => navigation.goBack(),
168
- },
169
- ]
170
- );
171
- };
172
-
173
- return (
174
- <SettingsHeader
175
- showCloseButton={true}
176
- onClose={handleClose}
177
- />
178
- );
179
- }
180
- ```
181
-
182
- ## Styling
183
-
184
- ### Layout
185
-
186
- ```typescript
187
- const styles = StyleSheet.create({
188
- container: {
189
- flexDirection: 'row',
190
- justifyContent: 'space-between',
191
- alignItems: 'center',
192
- padding: tokens.spacing.lg, // 16px
193
- },
194
- closeButton: {
195
- width: 44,
196
- height: 44,
197
- justifyContent: 'center',
198
- alignItems: 'center',
199
- },
200
- });
201
- ```
202
-
203
- ### Pressable Style
204
-
205
- The close button uses Pressable with pressed state:
206
-
207
- ```typescript
208
- style={({ pressed }) => [
209
- styles.closeButton,
210
- {
211
- backgroundColor: pressed
212
- ? tokens.colors.surfaceVariant
213
- : tokens.colors.surface,
214
- borderRadius: tokens.borderRadius.full,
215
- },
216
- ]
217
- ```
218
-
219
- ## Internationalization
220
-
221
- Uses translation key for title:
222
-
223
- ```typescript
224
- t('settings.title')
225
- ```
226
-
227
- ## Design System Integration
228
-
229
- - **Typography**: `tokens.typography.headingLarge` for title
230
- - **Colors**: `tokens.colors.textPrimary` for close icon
231
- - **Spacing**: `tokens.spacing.lg` for padding
232
- - **Border Radius**: `tokens.borderRadius.full` for button
233
- - **Icons**: `AtomicIcon` from design system
234
-
235
- ## Accessibility
236
-
237
- ### Hit Slop
238
-
239
- Close button has increased hit area:
240
-
241
- ```typescript
242
- hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
243
- ```
244
-
245
- ### Icon
246
-
247
- Uses `close-outline` icon from Ionicons:
248
-
249
- ```typescript
250
- <AtomicIcon name="close-outline" size="lg" color="textPrimary" />
251
- ```
252
-
253
- ## Best Practices
254
-
255
- 1. **Modal Screens**: Always use close button in modal presentation
256
- 2. **Custom Handler**: Provide custom close handler when needed
257
- 3. **Confirmation**: Ask for confirmation if there are unsaved changes
258
- 4. **Consistent Position**: Keep header at top of screen
259
- 5. **Padding**: Use design system spacing for consistency
260
- 6. **Accessibility**: Ensure close button is easily tappable
261
-
262
- ## Use Cases
263
-
264
- ### Modal Presentation
265
-
266
- ```tsx
267
- <Stack.Screen
268
- name="Settings"
269
- options={{
270
- presentation: 'modal',
271
- headerShown: false,
272
- }}
273
- >
274
- {() => (
275
- <View>
276
- <SettingsHeader showCloseButton={true} />
277
- <SettingsContent />
278
- </View>
279
- )}
280
- </Stack.Screen>
281
- ```
282
-
283
- ### Full Screen with Close
284
-
285
- ```tsx
286
- function FullScreenSettings() {
287
- return (
288
- <ScreenLayout
289
- header={<SettingsHeader showCloseButton={true} />}
290
- >
291
- <SettingsContent />
292
- </ScreenLayout>
293
- );
294
- }
295
- ```
296
-
297
- ### No Close Button (Default)
298
-
299
- ```tsx
300
- function RegularSettingsScreen() {
301
- return (
302
- <Stack.Screen name="Settings">
303
- {() => (
304
- <View>
305
- <SettingsHeader />
306
- <SettingsContent />
307
- </View>
308
- )}
309
- </Stack.Screen>
310
- );
311
- }
312
- ```
313
-
314
- ## Related
315
-
316
- - **SettingsScreen**: Main screen component
317
- - **SettingsContent**: Content component
318
- - **Design System**: Styling and theming
319
-
320
- ## License
321
-
322
- MIT
64
+ Related components:
65
+ - **SettingsScreen**: Main screen component that uses SettingsHeader
66
+ - **SettingsContent**: Content component that appears below header
67
+ - **Design System**: Styling and theming tokens