@oxyhq/services 5.13.4 → 5.13.10

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 (170) hide show
  1. package/lib/commonjs/core/HttpClient.js +1 -1
  2. package/lib/commonjs/core/HttpClient.js.map +1 -1
  3. package/lib/commonjs/core/OxyServices.js +83 -30
  4. package/lib/commonjs/core/OxyServices.js.map +1 -1
  5. package/lib/commonjs/core/index.js +0 -7
  6. package/lib/commonjs/core/index.js.map +1 -1
  7. package/lib/commonjs/i18n/locales/en-US.json +222 -6
  8. package/lib/commonjs/index.js +0 -7
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/commonjs/lib/sonner.js.map +1 -1
  11. package/lib/commonjs/ui/components/GroupedItem.js +24 -22
  12. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  13. package/lib/commonjs/ui/components/OxyProvider.js +35 -14
  14. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  15. package/lib/commonjs/ui/navigation/routes.js +36 -1
  16. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  17. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +150 -5
  18. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  19. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +475 -319
  20. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  21. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +217 -0
  22. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -0
  23. package/lib/commonjs/ui/screens/FileManagementScreen.js +911 -213
  24. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  25. package/lib/commonjs/ui/screens/HelpSupportScreen.js +131 -0
  26. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -0
  27. package/lib/commonjs/ui/screens/HistoryViewScreen.js +258 -0
  28. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -0
  29. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +211 -0
  30. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -0
  31. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +0 -1
  32. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  33. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +307 -0
  34. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -0
  35. package/lib/commonjs/ui/screens/ProfileScreen.js +1 -7
  36. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  37. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +205 -0
  38. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -0
  39. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +239 -0
  40. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -0
  41. package/lib/commonjs/ui/screens/SignInScreen.js +14 -29
  42. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  43. package/lib/commonjs/utils/asyncUtils.js +1 -0
  44. package/lib/commonjs/utils/asyncUtils.js.map +1 -1
  45. package/lib/commonjs/utils/cache.js +4 -4
  46. package/lib/commonjs/utils/cache.js.map +1 -1
  47. package/lib/commonjs/utils/index.js +0 -6
  48. package/lib/commonjs/utils/index.js.map +1 -1
  49. package/lib/module/core/HttpClient.js +1 -1
  50. package/lib/module/core/HttpClient.js.map +1 -1
  51. package/lib/module/core/OxyServices.js +82 -29
  52. package/lib/module/core/OxyServices.js.map +1 -1
  53. package/lib/module/core/index.js +1 -1
  54. package/lib/module/core/index.js.map +1 -1
  55. package/lib/module/i18n/locales/en-US.json +222 -6
  56. package/lib/module/index.js +1 -1
  57. package/lib/module/index.js.map +1 -1
  58. package/lib/module/lib/sonner.js.map +1 -1
  59. package/lib/module/ui/components/GroupedItem.js +24 -22
  60. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  61. package/lib/module/ui/components/OxyProvider.js +40 -17
  62. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  63. package/lib/module/ui/navigation/routes.js +36 -1
  64. package/lib/module/ui/navigation/routes.js.map +1 -1
  65. package/lib/module/ui/screens/AccountOverviewScreen.js +151 -6
  66. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  67. package/lib/module/ui/screens/AccountSettingsScreen.js +475 -319
  68. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  69. package/lib/module/ui/screens/AccountVerificationScreen.js +212 -0
  70. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -0
  71. package/lib/module/ui/screens/FileManagementScreen.js +913 -212
  72. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  73. package/lib/module/ui/screens/HelpSupportScreen.js +126 -0
  74. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -0
  75. package/lib/module/ui/screens/HistoryViewScreen.js +253 -0
  76. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -0
  77. package/lib/module/ui/screens/LegalDocumentsScreen.js +206 -0
  78. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -0
  79. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +0 -1
  80. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  81. package/lib/module/ui/screens/PrivacySettingsScreen.js +302 -0
  82. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -0
  83. package/lib/module/ui/screens/ProfileScreen.js +1 -7
  84. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  85. package/lib/module/ui/screens/SavesCollectionsScreen.js +200 -0
  86. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -0
  87. package/lib/module/ui/screens/SearchSettingsScreen.js +234 -0
  88. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -0
  89. package/lib/module/ui/screens/SignInScreen.js +14 -29
  90. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  91. package/lib/module/utils/asyncUtils.js +1 -0
  92. package/lib/module/utils/asyncUtils.js.map +1 -1
  93. package/lib/module/utils/cache.js +3 -3
  94. package/lib/module/utils/cache.js.map +1 -1
  95. package/lib/module/utils/index.js +1 -1
  96. package/lib/module/utils/index.js.map +1 -1
  97. package/lib/typescript/core/OxyServices.d.ts +30 -24
  98. package/lib/typescript/core/OxyServices.d.ts.map +1 -1
  99. package/lib/typescript/core/index.d.ts +1 -1
  100. package/lib/typescript/core/index.d.ts.map +1 -1
  101. package/lib/typescript/index.d.ts +1 -1
  102. package/lib/typescript/index.d.ts.map +1 -1
  103. package/lib/typescript/lib/sonner.d.ts +1 -0
  104. package/lib/typescript/lib/sonner.d.ts.map +1 -1
  105. package/lib/typescript/types/expo-document-picker.d.ts +36 -0
  106. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  107. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  108. package/lib/typescript/ui/navigation/routes.d.ts +1 -1
  109. package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
  110. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  111. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  112. package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts +5 -0
  113. package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts.map +1 -0
  114. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
  115. package/lib/typescript/ui/screens/HelpSupportScreen.d.ts +5 -0
  116. package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -0
  117. package/lib/typescript/ui/screens/HistoryViewScreen.d.ts +5 -0
  118. package/lib/typescript/ui/screens/HistoryViewScreen.d.ts.map +1 -0
  119. package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts +5 -0
  120. package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts.map +1 -0
  121. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  122. package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts +5 -0
  123. package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -0
  124. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  125. package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts +5 -0
  126. package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -0
  127. package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts +5 -0
  128. package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts.map +1 -0
  129. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  130. package/lib/typescript/utils/asyncUtils.d.ts.map +1 -1
  131. package/lib/typescript/utils/cache.d.ts +3 -3
  132. package/lib/typescript/utils/cache.d.ts.map +1 -1
  133. package/lib/typescript/utils/index.d.ts +1 -1
  134. package/lib/typescript/utils/index.d.ts.map +1 -1
  135. package/package.json +1 -1
  136. package/src/core/HttpClient.ts +1 -1
  137. package/src/core/OxyServices.ts +80 -30
  138. package/src/core/index.ts +1 -1
  139. package/src/i18n/locales/en-US.json +222 -6
  140. package/src/index.ts +1 -1
  141. package/src/lib/sonner.ts +1 -0
  142. package/src/types/expo-document-picker.d.ts +36 -0
  143. package/src/ui/components/GroupedItem.tsx +23 -21
  144. package/src/ui/components/OxyProvider.tsx +33 -11
  145. package/src/ui/navigation/routes.ts +42 -0
  146. package/src/ui/screens/AccountOverviewScreen.tsx +175 -5
  147. package/src/ui/screens/AccountSettingsScreen.tsx +521 -360
  148. package/src/ui/screens/AccountVerificationScreen.tsx +235 -0
  149. package/src/ui/screens/FileManagementScreen.tsx +934 -208
  150. package/src/ui/screens/HelpSupportScreen.tsx +143 -0
  151. package/src/ui/screens/HistoryViewScreen.tsx +280 -0
  152. package/src/ui/screens/LegalDocumentsScreen.tsx +220 -0
  153. package/src/ui/screens/PremiumSubscriptionScreen.tsx +0 -1
  154. package/src/ui/screens/PrivacySettingsScreen.tsx +332 -0
  155. package/src/ui/screens/ProfileScreen.tsx +1 -8
  156. package/src/ui/screens/SavesCollectionsScreen.tsx +222 -0
  157. package/src/ui/screens/SearchSettingsScreen.tsx +219 -0
  158. package/src/ui/screens/SignInScreen.tsx +19 -35
  159. package/src/utils/asyncUtils.ts +1 -0
  160. package/src/utils/cache.ts +3 -3
  161. package/src/utils/index.ts +1 -1
  162. package/lib/commonjs/ui/components/StepBasedScreen.README.md +0 -337
  163. package/lib/commonjs/ui/components/internal/TextField.md +0 -436
  164. package/lib/commonjs/ui/styles/FONTS.md +0 -126
  165. package/lib/module/ui/components/StepBasedScreen.README.md +0 -337
  166. package/lib/module/ui/components/internal/TextField.md +0 -436
  167. package/lib/module/ui/styles/FONTS.md +0 -126
  168. package/src/ui/components/StepBasedScreen.README.md +0 -337
  169. package/src/ui/components/internal/TextField.md +0 -436
  170. package/src/ui/styles/FONTS.md +0 -126
@@ -1,436 +0,0 @@
1
- # TextField Component
2
-
3
- A comprehensive, production-ready text input component with advanced features, validation, and accessibility support.
4
-
5
- ## Features
6
-
7
- ### ✨ Core Features
8
- - **Floating Labels**: Animated labels that float above the input when focused or filled
9
- - **Material Design**: Follows Material Design principles with outlined and filled variants
10
- - **Cross-Platform**: Optimized for both React Native and Web platforms
11
- - **Accessibility**: Full accessibility support with proper labels, hints, and roles
12
- - **Customizable**: Extensive theming and styling options
13
-
14
- ### 🎯 Advanced Features
15
- - **Input Masking**: Built-in masks for phone numbers, credit cards, and currency
16
- - **Password Strength**: Real-time password strength indicator
17
- - **Character Counting**: Optional character count display
18
- - **Debounced Validation**: Configurable debounced validation with loading states
19
- - **Clear Button**: Optional clear button for easy input clearing
20
- - **Custom Components**: Support for custom left and right components
21
- - **Disabled State**: Full disabled state support
22
- - **Helper Text**: Optional helper text below inputs
23
- - **Validation States**: Error, success, and loading states with visual indicators
24
-
25
- ### 🔧 Technical Features
26
- - **TypeScript**: Full TypeScript support with comprehensive type definitions
27
- - **Performance**: Optimized with proper memoization and debouncing
28
- - **Ref Forwarding**: Proper ref forwarding for focus management
29
- - **Event Handling**: Comprehensive event handling with proper cleanup
30
- - **State Management**: Robust internal state management
31
-
32
- ## Props
33
-
34
- ### Basic Props
35
- | Prop | Type | Default | Description |
36
- |------|------|---------|-------------|
37
- | `label` | `string` | - | The label text for the input |
38
- | `icon` | `string` | - | Ionicons icon name |
39
- | `iconColor` | `string` | - | Custom icon color |
40
- | `error` | `string` | - | Error message to display |
41
- | `success` | `boolean` | `false` | Whether to show success state |
42
- | `loading` | `boolean` | `false` | Whether to show loading state |
43
- | `variant` | `'outlined' \| 'filled'` | `'outlined'` | Input variant style |
44
- | `disabled` | `boolean` | `false` | Whether the input is disabled |
45
-
46
- ### Enhanced Features
47
- | Prop | Type | Default | Description |
48
- |------|------|---------|-------------|
49
- | `helperText` | `string` | - | Helper text displayed below input |
50
- | `maxLength` | `number` | - | Maximum character limit |
51
- | `showCharacterCount` | `boolean` | `false` | Show character count |
52
- | `inputMask` | `'phone' \| 'creditCard' \| 'currency' \| 'custom'` | - | Input masking type |
53
- | `customMask` | `(value: string) => string` | - | Custom masking function |
54
- | `formatValue` | `(value: string) => string` | - | Custom value formatting |
55
- | `validateOnChange` | `boolean` | `false` | Enable real-time validation |
56
- | `debounceMs` | `number` | `300` | Debounce delay for validation |
57
- | `passwordStrength` | `boolean` | `false` | Show password strength indicator |
58
- | `clearable` | `boolean` | `false` | Show clear button |
59
-
60
- ### Accessibility Props
61
- | Prop | Type | Default | Description |
62
- |------|------|---------|-------------|
63
- | `accessibilityLabel` | `string` | - | Accessibility label |
64
- | `accessibilityHint` | `string` | - | Accessibility hint |
65
- | `accessibilityRole` | `string` | `'text'` | Accessibility role |
66
-
67
- ### Advanced Props
68
- | Prop | Type | Default | Description |
69
- |------|------|---------|-------------|
70
- | `onValidationChange` | `(isValid: boolean, value: string) => void` | - | Validation change callback |
71
- | `onClear` | `() => void` | - | Clear button callback |
72
- | `autoFocus` | `boolean` | `false` | Auto focus on mount |
73
- | `returnKeyType` | `'done' \| 'go' \| 'next' \| 'search' \| 'send'` | - | Return key type |
74
- | `blurOnSubmit` | `boolean` | - | Blur on submit |
75
- | `keyboardType` | `KeyboardTypeOptions` | - | Keyboard type |
76
-
77
- ### Styling Props
78
- | Prop | Type | Default | Description |
79
- |------|------|---------|-------------|
80
- | `colors` | `object` | - | Color theme object |
81
- | `containerStyle` | `StyleProp<ViewStyle>` | - | Container style |
82
- | `inputStyle` | `StyleProp<TextStyle>` | - | Input style |
83
- | `labelStyle` | `StyleProp<TextStyle>` | - | Label style |
84
- | `errorStyle` | `StyleProp<ViewStyle>` | - | Error container style |
85
-
86
- ### Component Props
87
- | Prop | Type | Default | Description |
88
- |------|------|---------|-------------|
89
- | `leftComponent` | `ReactNode` | - | Custom left component |
90
- | `rightComponent` | `ReactNode` | - | Custom right component |
91
-
92
- ## Color Theme Object
93
-
94
- ```typescript
95
- interface ColorTheme {
96
- primary: string; // Primary color for focus states
97
- secondaryText: string; // Secondary text color
98
- text: string; // Main text color
99
- error: string; // Error color
100
- success: string; // Success color
101
- border: string; // Border color
102
- inputBackground: string; // Input background color
103
- disabled: string; // Disabled text color
104
- disabledBackground: string; // Disabled background color
105
- }
106
- ```
107
-
108
- ## Usage Examples
109
-
110
- ### Basic Usage
111
- ```tsx
112
- import TextField from './TextField';
113
-
114
- <TextField
115
- label="Username"
116
- value={username}
117
- onChangeText={setUsername}
118
- colors={colors}
119
- />
120
- ```
121
-
122
- ### With Icon and Validation
123
- ```tsx
124
- <TextField
125
- label="Email"
126
- icon="mail-outline"
127
- value={email}
128
- onChangeText={setEmail}
129
- error={emailError}
130
- success={isEmailValid}
131
- colors={colors}
132
- variant="filled"
133
- />
134
- ```
135
-
136
- ### Password with Strength Indicator
137
- ```tsx
138
- <TextField
139
- label="Password"
140
- icon="lock-closed-outline"
141
- value={password}
142
- onChangeText={setPassword}
143
- secureTextEntry={true}
144
- passwordStrength={true}
145
- colors={colors}
146
- helperText="Enter a strong password"
147
- />
148
- ```
149
-
150
- ### Phone Number with Mask
151
- ```tsx
152
- <TextField
153
- label="Phone Number"
154
- icon="call-outline"
155
- value={phone}
156
- onChangeText={setPhone}
157
- inputMask="phone"
158
- keyboardType="phone-pad"
159
- colors={colors}
160
- />
161
- ```
162
-
163
- ### Credit Card with Character Count
164
- ```tsx
165
- <TextField
166
- label="Credit Card"
167
- icon="card-outline"
168
- value={creditCard}
169
- onChangeText={setCreditCard}
170
- inputMask="creditCard"
171
- keyboardType="numeric"
172
- maxLength={19}
173
- showCharacterCount={true}
174
- colors={colors}
175
- />
176
- ```
177
-
178
- ### Real-time Validation
179
- ```tsx
180
- <TextField
181
- label="Username"
182
- icon="person-outline"
183
- value={username}
184
- onChangeText={setUsername}
185
- error={usernameError}
186
- success={isUsernameValid}
187
- loading={isValidating}
188
- validateOnChange={true}
189
- debounceMs={500}
190
- onValidationChange={(isValid, value) => {
191
- // Handle validation result
192
- }}
193
- colors={colors}
194
- />
195
- ```
196
-
197
- ### Disabled State
198
- ```tsx
199
- <TextField
200
- label="Disabled Field"
201
- value="This field is disabled"
202
- onChangeText={() => {}}
203
- disabled={true}
204
- colors={colors}
205
- helperText="This field cannot be edited"
206
- />
207
- ```
208
-
209
- ### Custom Right Component
210
- ```tsx
211
- <TextField
212
- label="With Custom Button"
213
- icon="add-circle-outline"
214
- value={value}
215
- onChangeText={setValue}
216
- colors={colors}
217
- rightComponent={
218
- <TouchableOpacity
219
- style={styles.customButton}
220
- onPress={handleCustomAction}
221
- >
222
- <Text style={styles.customButtonText}>Add</Text>
223
- </TouchableOpacity>
224
- }
225
- />
226
- ```
227
-
228
- ### Multiline Input
229
- ```tsx
230
- <TextField
231
- label="Bio"
232
- icon="document-text-outline"
233
- value={bio}
234
- onChangeText={setBio}
235
- multiline={true}
236
- numberOfLines={4}
237
- maxLength={500}
238
- showCharacterCount={true}
239
- colors={colors}
240
- helperText="Tell us about yourself"
241
- />
242
- ```
243
-
244
- ## Input Masks
245
-
246
- ### Built-in Masks
247
-
248
- #### Phone Number
249
- ```tsx
250
- inputMask="phone"
251
- // Input: 1234567890
252
- // Output: (123) 456-7890
253
- ```
254
-
255
- #### Credit Card
256
- ```tsx
257
- inputMask="creditCard"
258
- // Input: 1234567890123456
259
- // Output: 1234 5678 9012 3456
260
- ```
261
-
262
- #### Currency
263
- ```tsx
264
- inputMask="currency"
265
- // Input: 123.45
266
- // Output: $123.45
267
- ```
268
-
269
- ### Custom Mask
270
- ```tsx
271
- const customMask = (value: string) => {
272
- // Your custom formatting logic
273
- return formattedValue;
274
- };
275
-
276
- <TextField
277
- inputMask="custom"
278
- customMask={customMask}
279
- // ... other props
280
- />
281
- ```
282
-
283
- ## Password Strength
284
-
285
- The password strength indicator provides real-time feedback on password strength:
286
-
287
- - **Weak (0-25%)**: Red
288
- - **Fair (26-50%)**: Orange
289
- - **Good (51-75%)**: Blue
290
- - **Strong (76-100%)**: Green
291
-
292
- ```tsx
293
- <TextField
294
- label="Password"
295
- secureTextEntry={true}
296
- passwordStrength={true}
297
- // ... other props
298
- />
299
- ```
300
-
301
- ## Validation
302
-
303
- ### Real-time Validation
304
- ```tsx
305
- const [emailError, setEmailError] = useState('');
306
- const [isEmailValid, setIsEmailValid] = useState(false);
307
-
308
- <TextField
309
- label="Email"
310
- value={email}
311
- onChangeText={setEmail}
312
- error={emailError}
313
- success={isEmailValid}
314
- validateOnChange={true}
315
- debounceMs={500}
316
- onValidationChange={(isValid, value) => {
317
- if (isValid) {
318
- setIsEmailValid(true);
319
- setEmailError('');
320
- } else {
321
- setIsEmailValid(false);
322
- setEmailError('Please enter a valid email address');
323
- }
324
- }}
325
- />
326
- ```
327
-
328
- ## Accessibility
329
-
330
- The component includes comprehensive accessibility support:
331
-
332
- - Proper accessibility labels and hints
333
- - Keyboard navigation support
334
- - Screen reader compatibility
335
- - Focus management
336
- - Disabled state handling
337
-
338
- ```tsx
339
- <TextField
340
- label="Username"
341
- accessibilityLabel="Enter your username"
342
- accessibilityHint="Username must be at least 3 characters long"
343
- accessibilityRole="text"
344
- // ... other props
345
- />
346
- ```
347
-
348
- ## Focus Management
349
-
350
- ```tsx
351
- const inputRef = useRef<TextInput>(null);
352
-
353
- <TextField
354
- ref={inputRef}
355
- label="Username"
356
- // ... other props
357
- />
358
-
359
- // Focus the input
360
- inputRef.current?.focus();
361
- ```
362
-
363
- ## Styling
364
-
365
- ### Custom Colors
366
- ```tsx
367
- const colors = {
368
- primary: '#d169e5',
369
- secondaryText: '#666666',
370
- text: '#000000',
371
- error: '#D32F2F',
372
- success: '#2E7D32',
373
- border: '#E0E0E0',
374
- inputBackground: '#F5F5F5',
375
- disabled: '#E0E0E0',
376
- disabledBackground: '#F5F5F5',
377
- };
378
-
379
- <TextField
380
- colors={colors}
381
- // ... other props
382
- />
383
- ```
384
-
385
- ### Custom Styles
386
- ```tsx
387
- <TextField
388
- containerStyle={{ marginBottom: 20 }}
389
- inputStyle={{ fontSize: 18 }}
390
- labelStyle={{ fontWeight: 'bold' }}
391
- errorStyle={{ backgroundColor: '#ffebee' }}
392
- // ... other props
393
- />
394
- ```
395
-
396
- ## Best Practices
397
-
398
- 1. **Always provide labels** for accessibility
399
- 2. **Use appropriate keyboard types** for different input types
400
- 3. **Implement proper validation** with user-friendly error messages
401
- 4. **Use debouncing** for real-time validation to avoid performance issues
402
- 5. **Provide helper text** for complex inputs
403
- 6. **Handle disabled states** appropriately
404
- 7. **Use consistent color themes** across your app
405
- 8. **Test accessibility** with screen readers
406
-
407
- ## Performance Considerations
408
-
409
- - The component uses `useCallback` and `useMemo` for performance optimization
410
- - Debouncing is built-in for validation to prevent excessive re-renders
411
- - Proper cleanup of timers and animations
412
- - Efficient state management to minimize re-renders
413
-
414
- ## Browser Support
415
-
416
- - React Native: All supported platforms
417
- - Web: Modern browsers with React Native Web support
418
- - Mobile: iOS and Android with proper keyboard handling
419
-
420
- ## Dependencies
421
-
422
- - React Native
423
- - @expo/vector-icons (for icons)
424
- - react-native-svg (for border rendering)
425
-
426
- ## Migration from Previous Version
427
-
428
- The improved TextField component is mostly backward compatible. Key changes:
429
-
430
- 1. **New props**: Added many new features while maintaining existing API
431
- 2. **Better TypeScript**: Improved type definitions
432
- 3. **Enhanced accessibility**: Better accessibility support
433
- 4. **Performance improvements**: Optimized rendering and state management
434
- 5. **Removed web-specific code**: Unified implementation for all platforms
435
-
436
- Existing code should continue to work with minimal changes.
@@ -1,126 +0,0 @@
1
- # Font Implementation Guide
2
-
3
- ## Overview
4
- This document explains how custom fonts are implemented in the OxyProvider UI components.
5
-
6
- ## Implementation Details
7
-
8
- ### Fonts Used
9
- - **Phudu Font Family**: Used for all big titles in the application for a consistent brand experience.
10
- - File location: `src/assets/fonts/Phudu/` directory containing:
11
- - Phudu-Light.ttf (weight: 300)
12
- - Phudu-Regular.ttf (weight: 400)
13
- - Phudu-Medium.ttf (weight: 500)
14
- - Phudu-SemiBold.ttf (weight: 600)
15
- - Phudu-Bold.ttf (weight: 700)
16
- - Phudu-ExtraBold.ttf (weight: 800)
17
- - Phudu-Black.ttf (weight: 900)
18
-
19
- ### How to Use
20
- The font system has been implemented across all UI components. To use the fonts in your custom components:
21
-
22
- ```javascript
23
- // Import the font styles
24
- import { fontStyles, fontFamilies } from '@oxyhq/services';
25
-
26
- // Use in your component styles
27
- const styles = StyleSheet.create({
28
- myTitle: {
29
- ...fontStyles.titleLarge,
30
- color: '#333333',
31
- },
32
- myCustomHeading: {
33
- fontFamily: fontFamilies.phudu,
34
- fontSize: 28,
35
- fontWeight: '600',
36
- }
37
- });
38
- ```
39
-
40
- ### Available Font Styles
41
- - `titleLarge`: 34px, bold - For main screen titles
42
- - `titleMedium`: 24px, bold - For section headings
43
- - `titleSmall`: 20px, bold - For subsection headings
44
-
45
- ### Font Loading
46
- The OxyProvider component automatically handles font loading using the FontLoader component.
47
-
48
- #### For Expo projects
49
- Fonts are loaded automatically via `expo-font` when you use the `OxyProvider` component.
50
-
51
- #### For React Native projects (non-Expo)
52
- Call the `setupFonts` function at your app's entry point:
53
-
54
- ```javascript
55
- import { setupFonts } from '@oxyhq/services';
56
-
57
- // Call this before rendering your app
58
- setupFonts();
59
-
60
- // Then render your app with OxyProvider
61
- const App = () => (
62
- <OxyProvider>
63
- {/* Your app content */}
64
- </OxyProvider>
65
- );
66
- ```
67
-
68
- Also ensure the font files are properly linked in your native projects:
69
- - For iOS: Add the font file to Xcode project and add entry to Info.plist
70
- - For Android: Place the font in android/app/src/main/assets/fonts/
71
-
72
- #### For Web projects
73
- The `setupFonts` function will dynamically add the necessary @font-face CSS to load the Phudu font.
74
- The font will be automatically located if you use a bundler that supports asset imports.
75
-
76
- If automatic resolution fails, the library will look for the font files in the `/assets/fonts/Phudu/` directory in your web build.
77
-
78
- To customize the font paths for web, modify the `setupFonts` function in your own implementation:
79
-
80
- ```javascript
81
- // Custom implementation
82
- import { setupFonts as originalSetupFonts } from '@oxyhq/services';
83
-
84
- export const setupFonts = () => {
85
- // Your custom font loading logic for web
86
- if (typeof document !== 'undefined') {
87
- const style = document.createElement('style');
88
-
89
- // Add custom @font-face rules with your own font paths
90
- const customFontPathBase = '/path/to/your/fonts/Phudu/';
91
-
92
- style.textContent = `
93
- @font-face {
94
- font-family: 'Phudu';
95
- src: url('${customFontPathBase}Phudu-Regular.ttf') format('truetype');
96
- font-weight: 400;
97
- font-style: normal;
98
- }
99
- @font-face {
100
- font-family: 'Phudu';
101
- src: url('${customFontPathBase}Phudu-Bold.ttf') format('truetype');
102
- font-weight: 700;
103
- font-style: normal;
104
- }
105
- /* Add other weights as needed */
106
- `;
107
-
108
- document.head.appendChild(style);
109
- } else {
110
- // Use the original implementation for native platforms
111
- originalSetupFonts();
112
- }
113
- };
114
- ```
115
-
116
- ### Platform Support
117
- - **iOS/Android**: Loaded as individual font files ('Phudu-Regular', 'Phudu-Bold', etc.)
118
- - **Web**: Uses the font name 'Phudu' with specific weights via CSS weight property
119
-
120
- ### Custom Font Implementation
121
- If you want to add additional fonts:
122
-
123
- 1. Add the font file to `src/assets/fonts/`
124
- 2. Update the `fontFamilies` object in `src/ui/styles/fonts.ts`
125
- 3. Update the `FontLoader` component in `src/ui/components/FontLoader.tsx`
126
- 4. For web support, include the font in your web project's CSS