@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,419 +1,85 @@
1
1
  # Disclaimer Domain
2
2
 
3
- The Disclaimer domain provides components for displaying legal notices, warnings, and important information to users in your React Native app through cards, modals, and dedicated screens.
4
-
5
- ## Features
6
-
7
- - **Disclaimer Card**: Compact card component for displaying disclaimer summary
8
- - **Disclaimer Modal**: Full-screen modal with scrollable content
9
- - **Disclaimer Setting**: Integrated card + modal component
10
- - **Disclaimer Screen**: Dedicated screen for comprehensive disclaimers
11
- - **Internationalization**: Full i18n support with translation keys
12
- - **Customizable Icons**: Custom icons and colors for different warning levels
13
- - **Cross-Platform**: Universal design for iOS, Android, and Web
14
-
15
- ## Installation
16
-
17
- This domain is part of `@umituz/react-native-settings`. Install the package to use it:
18
-
19
- ```bash
20
- npm install @umituz/react-native-settings
21
- ```
22
-
23
- ## Components
24
-
25
- ### DisclaimerSetting
26
-
27
- The main component that displays a disclaimer card and opens a modal when tapped.
28
-
29
- ```tsx
30
- import { DisclaimerSetting } from '@umituz/react-native-settings';
31
-
32
- function MySettingsScreen() {
33
- return (
34
- <View>
35
- <DisclaimerSetting />
36
- </View>
37
- );
38
- }
39
- ```
40
-
41
- #### Props
42
-
43
- | Prop | Type | Default | Description |
44
- |------|------|---------|-------------|
45
- | `titleKey` | `string` | `'settings.disclaimer.title'` | Translation key for title |
46
- | `messageKey` | `string` | `'settings.disclaimer.message'` | Translation key for full message |
47
- | `shortMessageKey` | `string` | `'settings.disclaimer.shortMessage'` | Translation key for short message |
48
- | `iconName` | `string` | `'alert-triangle'` | Icon name from design system |
49
- | `iconColor` | `string` | `tokens.colors.warning` | Custom icon color |
50
- | `backgroundColor` | `string` | `withAlpha(iconColor, 0.1)` | Custom background color |
51
- | `modalTitle` | `string` | `undefined` | Override modal title (bypasses i18n) |
52
- | `modalContent` | `string` | `undefined` | Override modal content (bypasses i18n) |
53
-
54
- #### Example with Custom Content
55
-
56
- ```tsx
57
- import { DisclaimerSetting } from '@umituz/react-native-settings';
58
-
59
- function CustomDisclaimer() {
60
- return (
61
- <DisclaimerSetting
62
- modalTitle="Beta Version Notice"
63
- modalContent="This is a beta version of the app. Features may change and bugs may occur. Use at your own risk."
64
- iconName="flask"
65
- iconColor="#9333EA"
66
- />
67
- );
68
- }
69
- ```
70
-
71
- ### DisclaimerCard
72
-
73
- A compact card displaying disclaimer summary with icon and message.
74
-
75
- ```tsx
76
- import { DisclaimerCard } from '@umituz/react-native-settings';
77
-
78
- function DisclaimerCardExample() {
79
- return (
80
- <DisclaimerCard
81
- title="Warning"
82
- shortMessage="This is an important notice"
83
- iconName="alert-triangle"
84
- iconColor="#F59E0B"
85
- backgroundColor="rgba(245, 158, 11, 0.1)"
86
- onPress={() => console.log('Card pressed')}
87
- />
88
- );
89
- }
90
- ```
91
-
92
- #### Props
93
-
94
- | Prop | Type | Default | Description |
95
- |------|------|---------|-------------|
96
- | `title` | `string` | **Required** | Card title |
97
- | `shortMessage` | `string` | **Required** | Short message text |
98
- | `iconName` | `string` | **Required** | Icon name |
99
- | `iconColor` | `string` | **Required** | Icon color |
100
- | `backgroundColor` | `string` | **Required** | Background color |
101
- | `onPress` | `() => void` | **Required** | Press handler |
102
-
103
- ### DisclaimerModal
104
-
105
- Full-screen modal with scrollable disclaimer content.
106
-
107
- ```tsx
108
- import { DisclaimerModal } from '@umituz/react-native-settings';
109
-
110
- function DisclaimerModalExample() {
111
- const [visible, setVisible] = useState(false);
112
-
113
- return (
114
- <DisclaimerModal
115
- visible={visible}
116
- title="Legal Disclaimer"
117
- content="Full disclaimer content goes here..."
118
- onClose={() => setVisible(false)}
119
- />
120
- );
121
- }
122
- ```
123
-
124
- #### Props
125
-
126
- | Prop | Type | Default | Description |
127
- |------|------|---------|-------------|
128
- | `visible` | `boolean` | **Required** | Modal visibility |
129
- | `title` | `string` | **Required** | Modal title |
130
- | `content` | `string` | **Required** | Modal content |
131
- | `onClose` | `() => void` | **Required** | Close handler |
132
-
133
- ### DisclaimerScreen
134
-
135
- A dedicated screen for displaying comprehensive disclaimer information.
136
-
137
- ```tsx
138
- import { DisclaimerScreen } from '@umituz/react-native-settings';
139
-
140
- function DisclaimerScreenExample() {
141
- return (
142
- <DisclaimerScreen
143
- title="Disclaimer"
144
- content="This is the full disclaimer text..."
145
- iconName="alert-circle"
146
- iconColor="#DC2626"
147
- />
148
- );
149
- }
150
- ```
151
-
152
- #### Props
153
-
154
- | Prop | Type | Default | Description |
155
- |------|------|---------|-------------|
156
- | `title` | `string` | **Required** | Screen title |
157
- | `content` | `string` | **Required** | Disclaimer content |
158
- | `iconName` | `string` | `undefined` | Custom icon name |
159
- | `iconColor` | `string` | `undefined` | Custom icon color |
160
-
161
- ## Examples
162
-
163
- ### Basic Usage with i18n
164
-
165
- ```tsx
166
- import { DisclaimerSetting } from '@umituz/react-native-settings';
167
-
168
- function SettingsScreen() {
169
- return (
170
- <ScrollView>
171
- {/* Other settings */}
172
-
173
- <DisclaimerSetting />
174
- </ScrollView>
175
- );
176
- }
177
-
178
- // In your localization files:
179
- // en.json:
180
- // {
181
- // "settings": {
182
- // "disclaimer": {
183
- // "title": "Disclaimer",
184
- // "message": "This is the full disclaimer content...",
185
- // "shortMessage": "Important legal information"
186
- // }
187
- // }
188
- // }
189
- ```
190
-
191
- ### Custom Medical Disclaimer
192
-
193
- ```tsx
194
- import { DisclaimerSetting } from '@umituz/react-native-settings';
195
-
196
- function MedicalAppSettings() {
197
- return (
198
- <DisclaimerSetting
199
- modalTitle="Medical Disclaimer"
200
- modalContent="This app is for informational purposes only and is not a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition."
201
- iconName="heart-pulse"
202
- iconColor="#DC2626"
203
- />
204
- );
205
- }
206
- ```
207
-
208
- ### Financial Warning
209
-
210
- ```tsx
211
- import { DisclaimerSetting } from '@umituz/react-native-settings';
212
-
213
- function FinancialAppSettings() {
214
- return (
215
- <DisclaimerSetting
216
- modalTitle="Risk Warning"
217
- modalContent="Trading financial instruments carries a high level of risk and may not be suitable for all investors. You could lose all of your invested capital. Past performance is not indicative of future results."
218
- iconName="trending-down"
219
- iconColor="#7C3AED"
220
- />
221
- );
222
- }
223
- ```
224
-
225
- ### Beta Software Notice
226
-
227
- ```tsx
228
- import { DisclaimerSetting } from '@umituz/react-native-settings';
229
-
230
- function BetaAppSettings() {
231
- return (
232
- <DisclaimerSetting
233
- modalTitle="Beta Software Notice"
234
- modalContent="This is pre-release software. Features may be incomplete or change before final release. Data may be lost. Please back up your important data before using."
235
- iconName="flask"
236
- iconColor="#0891B2"
237
- />
238
- );
239
- }
240
- ```
241
-
242
- ### Custom Card without Modal
243
-
244
- ```tsx
245
- import { DisclaimerCard } from '@umituz/react-native-settings';
246
-
247
- function CustomDisclaimerCard() {
248
- return (
249
- <DisclaimerCard
250
- title="Age Restriction"
251
- shortMessage="You must be 18+ to use this app"
252
- iconName="shield"
253
- iconColor="#059669"
254
- backgroundColor="rgba(5, 150, 105, 0.1)"
255
- onPress={() => {
256
- // Navigate to verification screen
257
- navigation.navigate('AgeVerification');
258
- }}
259
- />
260
- );
261
- }
262
- ```
263
-
264
- ### Standalone Modal
265
-
266
- ```tsx
267
- import { DisclaimerModal, useState } from '@umituz/react-native-settings';
268
-
269
- function TermsModal() {
270
- const [visible, setVisible] = useState(false);
271
-
272
- return (
273
- <View>
274
- <Button
275
- title="Show Disclaimer"
276
- onPress={() => setVisible(true)}
277
- />
278
-
279
- <DisclaimerModal
280
- visible={visible}
281
- title="Terms & Conditions"
282
- content="By using this app, you agree to our terms..."
283
- onClose={() => setVisible(false)}
284
- />
285
- </View>
286
- );
287
- }
288
- ```
289
-
290
- ### Custom Disclaimer Screen
291
-
292
- ```tsx
293
- import { DisclaimerScreen } from '@umituz/react-native-settings';
294
-
295
- function LegalDisclaimerStack() {
296
- return (
297
- <Stack.Navigator>
298
- <Stack.Screen
299
- name="Disclaimer"
300
- component={DisclaimerScreen}
301
- initialParams={{
302
- title: 'Legal Disclaimer',
303
- content: 'Full legal disclaimer text...',
304
- iconName: 'gavel',
305
- iconColor: '#DC2626',
306
- }}
307
- />
308
- </Stack.Navigator>
309
- );
310
- }
311
- ```
312
-
313
- ## Translation Keys
314
-
315
- The default DisclaimerSetting uses these translation keys. Make sure to include them in your localization files:
316
-
317
- ```json
318
- {
319
- "settings": {
320
- "disclaimer": {
321
- "title": "Disclaimer",
322
- "message": "Full disclaimer text that appears in the modal...",
323
- "shortMessage": "Important notice - tap to read more"
324
- }
325
- }
326
- }
327
- ```
328
-
329
- ## Styling
330
-
331
- The disclaimer components use the design system tokens for consistent styling:
332
-
333
- - **Icon Size**: Medium (24px)
334
- - **Card Background**: Semi-transparent version of icon color
335
- - **Modal Animation**: Slide from bottom (iOS) / Fade (Android)
336
- - **Text**: Uses design system typography tokens
337
-
338
- Custom colors are supported through props:
339
-
340
- ```tsx
341
- <DisclaimerSetting
342
- iconColor="#DC2626" // Red for critical
343
- iconColor="#F59E0B" // Amber for warning
344
- iconColor="#3B82F6" // Blue for info
345
- iconColor="#10B981" // Emerald for success
346
- />
347
- ```
348
-
349
- ## Architecture
350
-
351
- ```
352
- src/domains/disclaimer/
353
- ├── presentation/
354
- │ ├── screens/
355
- │ │ └── DisclaimerScreen.tsx
356
- │ ├── components/
357
- │ │ ├── DisclaimerSetting.tsx # Main component
358
- │ │ ├── DisclaimerCard.tsx # Card component
359
- │ │ └── DisclaimerModal.tsx # Modal component
360
- │ └── components/__tests__/ # Component tests
361
- └── index.ts # Public API exports
362
- ```
363
-
364
- ## Best Practices
365
-
366
- 1. **Keep Messages Clear**: Use simple, non-technical language
367
- 2. **Be Specific**: Clearly state what the disclaimer covers
368
- 3. **Short + Full**: Use short message on card, full content in modal
369
- 4. **Color Coding**: Use appropriate colors for warning levels:
370
- - Red: Critical/legal warnings
371
- - Amber: Cautionary notices
372
- - Blue: Informational
373
- - Emerald: Confirmations
374
- 5. **Test Translations**: Ensure all languages have proper translations
375
- 6. **Accessibility**: Icons should have proper accessibility labels
376
- 7. **Cross-Platform**: Test on iOS, Android, and Web
377
-
378
- ## Testing
379
-
380
- ```tsx
381
- import { render, fireEvent } from '@testing-library/react-native';
382
- import { DisclaimerSetting } from '@umituz/react-native-settings';
383
-
384
- describe('DisclaimerSetting', () => {
385
- it('renders disclaimer card', () => {
386
- const { getByText } = render(<DisclaimerSetting />);
387
- expect(getByText(/disclaimer/i)).toBeTruthy();
388
- });
389
-
390
- it('opens modal on card press', () => {
391
- const { getByText, getByTestId } = render(<DisclaimerSetting />);
392
-
393
- fireEvent.press(getByText(/disclaimer/i));
394
- expect(getByTestId('close-disclaimer-modal')).toBeTruthy();
395
- });
396
-
397
- it('closes modal on close button press', () => {
398
- const { getByText, getByTestId, queryByTestId } = render(
399
- <DisclaimerSetting />
400
- );
401
-
402
- // Open modal
403
- fireEvent.press(getByText(/disclaimer/i));
404
-
405
- // Close modal
406
- fireEvent.press(getByTestId('close-disclaimer-modal'));
407
-
408
- expect(queryByTestId('close-disclaimer-modal')).toBeNull();
409
- });
410
- });
411
- ```
3
+ ## Purpose
4
+
5
+ Provides components for displaying legal notices, warnings, and important information through cards, modals, and dedicated screens with full i18n support.
6
+
7
+ ## File Paths
8
+
9
+ **Screens:**
10
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/screens/DisclaimerScreen.tsx`
11
+
12
+ **Components:**
13
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerSetting.tsx`
14
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerCard.tsx`
15
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/presentation/components/DisclaimerModal.tsx`
16
+
17
+ **Index:**
18
+ - `/Users/umituz/Desktop/github/umituz/apps/artificial_intelligence/npm-packages/react-native-settings/src/domains/disclaimer/index.ts`
19
+
20
+ ## Strategy
21
+
22
+ 1. **Internationalization First**: Use translation keys for all text content with support for i18n
23
+ 2. **Modular Design**: Compose disclaimers from card and modal components for flexibility
24
+ 3. **Color Coding**: Use appropriate colors for different warning levels (red for critical, amber for caution, blue for info)
25
+ 4. **Card + Modal Pattern**: Display summary in card, full content in modal for better UX
26
+ 5. **Icon Integration**: Use design system icons with customizable colors for visual hierarchy
27
+
28
+ ## Restrictions (Forbidden)
29
+
30
+ ### DO NOT
31
+ - ❌ DO NOT use DisclaimerSetting without proper translation keys in i18n configuration
32
+ - DO NOT hardcode disclaimer text - always use translation keys or modalContent prop
33
+ - ❌ DO NOT use DisclaimerCard without providing all required props (title, shortMessage, iconName, iconColor, backgroundColor, onPress)
34
+ - ❌ DO NOT bypass the card + modal pattern for displaying disclaimers
35
+
36
+ ### NEVER
37
+ - ❌ NEVER use DisclaimerSetting in production without verifying i18n keys exist
38
+ - ❌ NEVER show modal without a proper close mechanism
39
+ - ❌ NEVER use inappropriate colors for warning levels (e.g., green for critical warnings)
40
+ - ❌ NEVER mix disclaimer content with business logic
41
+
42
+ ### AVOID
43
+ - AVOID creating custom disclaimer components when existing ones can be configured
44
+ - ❌ AVOID using long text in DisclaimerCard - use modal for full content
45
+ - AVOID using DisclaimerSetting for critical legal notices that require explicit acceptance
46
+ - AVOID hardcoding colors - use design system tokens or semantic color names
47
+
48
+ ## Rules
49
+
50
+ ### ALWAYS
51
+ - ALWAYS provide translation keys for DisclaimerSetting (titleKey, messageKey, shortMessageKey)
52
+ - ALWAYS provide all required props to DisclaimerCard (title, shortMessage, iconName, iconColor, backgroundColor, onPress)
53
+ - ✅ ALWAYS use modalTitle and modalContent props for custom content that bypasses i18n
54
+ - ALWAYS ensure modal can be closed with a clear close button
55
+ - ✅ ALWAYS use appropriate colors for warning levels
56
+
57
+ ### MUST
58
+ - ✅ MUST include translation keys in all language files before using DisclaimerSetting
59
+ - MUST provide custom modalTitle and modalContent when bypassing i18n
60
+ - ✅ MUST ensure disclaimer text is clear and non-technical
61
+ - ✅ MUST test disclaimer rendering on all platforms (iOS, Android, Web)
62
+ - MUST ensure modal content is scrollable for long disclaimers
63
+
64
+ ### SHOULD
65
+ - ✅ SHOULD use red/amber colors for critical warnings, blue for informational
66
+ - ✅ SHOULD keep card messages short and concise
67
+ - ✅ SHOULD provide specific icons for different warning types (alert-triangle, flask, heart-pulse)
68
+ - ✅ SHOULD ensure disclaimer modals are accessible with proper labels
69
+ - ✅ SHOULD test disclaimer components with different screen sizes
70
+
71
+ ## AI Agent Guidelines
72
+
73
+ 1. **Component Selection**: Use DisclaimerSetting for settings integration (card + modal), DisclaimerCard for custom cards, DisclaimerModal for standalone modals, DisclaimerScreen for dedicated screens
74
+ 2. **i18n Usage**: Always use translation keys with DisclaimerSetting - only use modalTitle/modalContent for truly static content
75
+ 3. **Color Guidelines**: Always match colors to warning severity - red for critical/legal, amber for caution, blue for informational, emerald for confirmations
76
+ 4. **Content Structure**: Always keep card messages short (1-2 lines) with full content in modal
77
+ 5. **Platform Testing**: Always test disclaimer rendering on iOS, Android, and Web platforms
412
78
 
413
79
  ## Related
414
80
 
415
- - **Legal Domain**: Privacy policy, terms of service
416
- - **Settings Domain**: Main settings management
81
+ - **Legal**: Privacy policy, terms of service
82
+ - **Settings**: Main settings management
417
83
  - **Design System**: Icons, colors, and typography
418
84
 
419
85
  ## License