@umituz/react-native-auth 3.4.33 → 3.4.34

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.
@@ -1,117 +1,279 @@
1
- # Auth Components
1
+ # Presentation Components
2
2
 
3
- React Native Auth paketi için UI component'leri koleksiyonu. Bu component'ler authentication ekranları ve formları için kullanılır.
3
+ Pre-built UI components for authentication flows.
4
4
 
5
- ## Mevcut Component'ler
5
+ ---
6
6
 
7
- ### Layout & Container Components
8
- - **[`AuthContainer`](./AuthContainer.tsx)** - Ana auth layout container
9
- - **[`AuthHeader`](./AuthHeader.tsx)** - Auth ekranları için header
10
- - **[`AuthFormCard`](./AuthFormCard.tsx)** - Form kartı container
7
+ ## Strategy
11
8
 
12
- ### Form Components
13
- - **[`LoginForm`](./LoginForm.tsx)** - Giriş formu
14
- - **[`RegisterForm`](./RegisterForm.tsx)** - Kayıt formu
15
- - **[`EditProfileForm`](./EditProfileForm.tsx)** - Profil düzenleme formu
16
- - **[`EditProfileAvatar`](./EditProfileAvatar.tsx)** - Profil fotoğrafı düzenleme
9
+ **Purpose**: Provides ready-to-use authentication components with built-in validation, error handling, and design system integration.
17
10
 
18
- ### Password Indicators
19
- - **[`PasswordStrengthIndicator`](./PasswordStrengthIndicator.tsx)** - Şifre güç göstergesi
20
- - **[`PasswordMatchIndicator`](./PasswordMatchIndicator.tsx)** - Şifre eşleşme göstergesi
11
+ **When to Use**:
12
+ - Building authentication UI
13
+ - Need pre-built auth forms
14
+ - Want consistent auth experience
15
+ - Rapid development
21
16
 
22
- ### Social Login Components
23
- - **[`SocialLoginButtons`](./SocialLoginButtons.tsx)** - Social login button'ları
24
- - **[`AuthBottomSheet`](./AuthBottomSheet.tsx)** - Bottom sheet auth modal
17
+ **Location**: `src/presentation/components/`
25
18
 
26
- ### Profile & Account Components
27
- - **[`ProfileSection`](./ProfileSection.tsx)** - Profil bölümü
28
- - **[`AccountActions`](./AccountActions.tsx)** - Hesap işlemleri
29
- - **[`EditProfileActions`](./EditProfileActions.tsx)** - Profil düzenleme işlemleri
19
+ ---
30
20
 
31
- ### UI Helper Components
32
- - **[`AuthLegalLinks`](./AuthLegalLinks.tsx)** - KVKK/Kullanım şartları linkleri
33
- - **[`AuthDivider`](./AuthDivider.tsx)** - Ayırıcı çizgi
34
- - **[`AuthLink`](./AuthLink.tsx)** - Navigasyon link'i
35
- - **[`AuthErrorDisplay`](./AuthErrorDisplay.tsx)** - Hata gösterme
36
- - **[`AuthBackground`](./AuthBackground.tsx)** - Standart arkaplan
21
+ ## Form Components
37
22
 
38
- ### Icons
39
- - **[`GoogleIconSvg`](./icons/GoogleIconSvg.tsx)** - Google ikonu
40
- - **[`AppleIconSvg`](./icons/AppleIconSvg.tsx)** - Apple ikonu
23
+ ### LoginForm
41
24
 
42
- ## Kullanım
25
+ **Purpose**: Email and password login form
43
26
 
27
+ **When to Use**:
28
+ - Standard login screen
29
+ - Email/password authentication
30
+ - Need built-in validation
31
+
32
+ **Import Path**:
44
33
  ```typescript
45
- import {
46
- AuthContainer,
47
- AuthHeader,
48
- LoginForm,
49
- SocialLoginButtons,
50
- PasswordStrengthIndicator,
51
- } from '@umituz/react-native-auth';
52
-
53
- function LoginScreen() {
54
- return (
55
- <AuthContainer>
56
- <AuthHeader title="Giriş Yap" />
57
- <LoginForm />
58
- <SocialLoginButtons />
59
- <AuthLegalLinks />
60
- </AuthContainer>
61
- );
62
- }
34
+ import { LoginForm } from '@umituz/react-native-auth';
63
35
  ```
64
36
 
65
- ## Component Detaylı Dokümantasyon
37
+ **File**: `LoginForm.tsx`
66
38
 
67
- Her component hakkında detaylı bilgi için ilgili component'in içindeki README.md dosyasına bakın.
39
+ **Required Props**:
40
+ - `onNavigateToRegister` - Navigation callback
68
41
 
69
- ## Tasarım Prensipleri
42
+ **Rules**:
43
+ - MUST provide navigation callback
44
+ - MUST handle errors
45
+ - MUST use in proper container
46
+ - MUST NOT override internal validation
70
47
 
71
- 1. **Reusable**: Component'ler farklı context'lerde kullanılabilir
72
- 2. **Composable**: Küçük component'ler bir araya getirilerek büyük ekranlar oluşturulur
73
- 3. **Type-Safe**: Tüm component'ler TypeScript ile yazılmıştır
74
- 4. **Accessible**: Erişilebilirlik standartlarına uygun
75
- 5. **Themeable**: Design system ile uyumlu
48
+ **Documentation**: `LoginForm.md`
76
49
 
77
- ## Konfigürasyon
50
+ ---
78
51
 
79
- ### Theme
52
+ ### RegisterForm
80
53
 
81
- Component'ler design system theme'ini kullanır:
54
+ **Purpose**: User registration form
82
55
 
83
- ```typescript
84
- import { ThemeProvider } from '@umituz/react-native-design-system-theme';
85
-
86
- function App() {
87
- return (
88
- <ThemeProvider theme={yourTheme}>
89
- <AuthContainer>
90
- {/* Auth components */}
91
- </AuthContainer>
92
- </ThemeProvider>
93
- );
94
- }
95
- ```
56
+ **When to Use**:
57
+ - User registration
58
+ - Account creation
59
+ - Password strength requirements
96
60
 
97
- ### Localization
61
+ **Required Props**:
62
+ - `onNavigateToLogin` - Navigation callback
63
+ - `termsUrl` or `onTermsPress` - Terms link
64
+ - `privacyUrl` or `onPrivacyPress` - Privacy link
98
65
 
99
- ```typescript
100
- import { LocalizationProvider } from '@umituz/react-native-localization';
101
-
102
- function App() {
103
- return (
104
- <LocalizationProvider locale="tr">
105
- <AuthContainer>
106
- {/* Auth components will use Turkish */}
107
- </AuthContainer>
108
- </LocalizationProvider>
109
- );
110
- }
111
- ```
66
+ **Rules**:
67
+ - MUST provide all required props
68
+ - MUST handle terms acceptance
69
+ - MUST show password validation
70
+ - MUST NOT allow submission without acceptance
71
+
72
+ **Documentation**: `LoginForm.md` (same file)
73
+
74
+ ---
75
+
76
+ ## Validation Components
77
+
78
+ ### PasswordStrengthIndicator
79
+
80
+ **Purpose**: Visual password requirements display
81
+
82
+ **When to Use**:
83
+ - Registration forms
84
+ - Password change forms
85
+ - Password creation
86
+
87
+ **Required Props**:
88
+ - `requirements` - PasswordRequirements object
89
+
90
+ **Rules**:
91
+ - MUST calculate requirements object
92
+ - MUST update on password change
93
+ - MUST show before user types
94
+ - MUST not hide requirements
95
+
96
+ **Documentation**: `PasswordIndicators.md`
97
+
98
+ ---
99
+
100
+ ### PasswordMatchIndicator
101
+
102
+ **Purpose**: Password confirmation feedback
103
+
104
+ **When to Use**:
105
+ - Registration forms
106
+ - Password change forms
107
+ - Confirmation required
108
+
109
+ **Required Props**:
110
+ - `isMatch` - Match status boolean
111
+
112
+ **Rules**:
113
+ - MUST only show when confirm field has input
114
+ - MUST update in real-time
115
+ - MUST use clear visual feedback
116
+ - MUST not use ambiguous colors
117
+
118
+ **Documentation**: `PasswordIndicators.md`
119
+
120
+ ---
121
+
122
+ ## Social Authentication
123
+
124
+ ### SocialLoginButtons
125
+
126
+ **Purpose**: Google and Apple authentication buttons
127
+
128
+ **When to Use**:
129
+ - Adding social login
130
+ - Multiple provider support
131
+ - Consistent social UI
132
+
133
+ **Required Props**:
134
+ - `enabledProviders` - Provider array
135
+ - `onGooglePress` - Google handler
136
+ - `onApplePress` - Apple handler
137
+
138
+ **Optional Props**:
139
+ - `googleLoading` - Loading state
140
+ - `appleLoading` - Loading state
141
+ - `disabled` - Disable all buttons
142
+
143
+ **Rules**:
144
+ - MUST check provider availability
145
+ - MUST handle platform differences
146
+ - MUST respect Apple guidelines
147
+ - MUST not show unavailable providers
148
+
149
+ **Platform Behavior**:
150
+ - iOS: Google + Apple
151
+ - Android: Google only
152
+ - Web: Google only
153
+
154
+ **Documentation**: `SocialLoginButtons.md`
155
+
156
+ ---
157
+
158
+ ## Profile Components
159
+
160
+ ### ProfileSection
161
+
162
+ **Purpose**: Display user profile information
163
+
164
+ **When to Use**:
165
+ - Settings screens
166
+ - Profile headers
167
+ - User identification
168
+ - Account management
169
+
170
+ **Required Props**:
171
+ - `profile` - ProfileSectionConfig object
172
+
173
+ **Optional Props**:
174
+ - `onPress` - Press handler (authenticated)
175
+ - `onSignIn` - Sign-in handler (anonymous)
176
+
177
+ **Rules**:
178
+ - MUST handle authenticated vs anonymous
179
+ - MUST show avatar fallback
180
+ - MUST indicate anonymous status
181
+ - MUST not expose sensitive info
182
+
183
+ **Documentation**: `ProfileComponents.md`
184
+
185
+ ---
186
+
187
+ ### AccountActions
188
+
189
+ **Purpose**: Account management buttons
190
+
191
+ **When to Use**:
192
+ - Account settings
193
+ - Logout functionality
194
+ - Account deletion
195
+ - Password changes
196
+
197
+ **Required Props**:
198
+ - `config` - AccountActionsConfig object
199
+
200
+ **Rules**:
201
+ - MUST confirm before sign out
202
+ - MUST double-confirm deletion
203
+ - MUST require re-authentication for deletion
204
+ - MUST hide for anonymous users
205
+
206
+ **Documentation**: `ProfileComponents.md`
207
+
208
+ ---
209
+
210
+ ## Component Guidelines
211
+
212
+ ### Design System Integration
213
+
214
+ **RULES**:
215
+ - MUST use design system tokens
216
+ - MUST follow design system spacing
217
+ - MUST use design system typography
218
+ - MUST support design system dark mode
219
+
220
+ **MUST NOT**:
221
+ - Hardcode colors or sizes
222
+ - Use custom styles
223
+ - Override design system
224
+
225
+ ---
226
+
227
+ ### Accessibility
228
+
229
+ **RULES**:
230
+ - MUST provide accessibility labels
231
+ - MUST support screen readers
232
+ - MUST handle keyboard navigation
233
+ - MUST maintain proper focus order
234
+
235
+ **MUST NOT**:
236
+ - Rely on color alone
237
+ - Use placeholder as label
238
+ - Break accessibility
239
+
240
+ ---
241
+
242
+ ### Validation
243
+
244
+ **RULES**:
245
+ - MUST validate all inputs
246
+ - MUST show field-level errors
247
+ - MUST prevent invalid submissions
248
+ - MUST provide clear messages
249
+
250
+ **Constraints**:
251
+ - Email validation required
252
+ - Password complexity validation required
253
+ - Display name required for registration
254
+ - Password match required for confirmation
255
+
256
+ ---
257
+
258
+ ## Styling
259
+
260
+ ### Design Tokens
261
+
262
+ **COMPONENTS USE**:
263
+ - `tokens.colors` - Color system
264
+ - `tokens.spacing` - Spacing scale
265
+ - `tokens.typography` - Fonts
266
+ - `tokens.radius` - Border radius
267
+
268
+ **RULES**:
269
+ - MUST reference tokens, not values
270
+ - MUST support light/dark modes
271
+ - MUST respect design system
272
+
273
+ ---
112
274
 
113
- ## İlgili Modüller
275
+ ## Related Documentation
114
276
 
115
- - **[Hooks](../hooks/README.md)** - Auth hook'ları
116
- - **[Screens](../screens/)** - Auth ekranları
117
- - **[Navigation](../navigation/)** - Auth navigasyonu
277
+ - **Hooks**: `../hooks/README.md`
278
+ - **Screens**: `../screens/README.md`
279
+ - **Stores**: `../stores/authModalStore.ts`