@umituz/react-native-design-system 2.6.87 → 2.6.88

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.
@@ -0,0 +1,487 @@
1
+ # StepHeader
2
+
3
+ StepHeader, adım adım ilerleyen iş akışları (onboarding, kayıt, wizard vb.) için kullanılan başlık bileşenidir. Adım göstergesi, başlık ve alt başlık içerir.
4
+
5
+ ## Özellikler
6
+
7
+ - 📊 **Step Indicator**: Adım göstergesi (dot sistemi)
8
+ - 📝 **Title & Subtitle**: Başlık ve açıklama metni
9
+ - 🎯 **Hizalama**: Sol, orta, sağ hizalama seçenekleri
10
+ - 🎨 **Özelleştirilebilir**: Font boyutu, boşluk ayarları
11
+ - 🎭 **Tema Bilinci**: Design token uyumlu
12
+ - ♿ **Erişilebilir**: Screen reader desteği
13
+
14
+ ## Kurulum
15
+
16
+ ```tsx
17
+ import { StepHeader } from 'react-native-design-system';
18
+ ```
19
+
20
+ ## Temel Kullanım
21
+
22
+ ```tsx
23
+ import React from 'react';
24
+ import { View } from 'react-native';
25
+ import { StepHeader } from 'react-native-design-system';
26
+
27
+ export const BasicExample = () => {
28
+ return (
29
+ <View>
30
+ <StepHeader
31
+ title="Hoş Geldiniz"
32
+ subtitle="Hesabınızı oluşturmak için birkaç adım"
33
+ />
34
+ </View>
35
+ );
36
+ };
37
+ ```
38
+
39
+ ## Step Indicator ile
40
+
41
+ ```tsx
42
+ <StepHeader
43
+ title="Profil Bilgileri"
44
+ subtitle="Lütfen kişisel bilgilerinizi girin"
45
+ config={{
46
+ showStepIndicator: true,
47
+ currentStep: 2,
48
+ totalSteps: 4,
49
+ }}
50
+ />
51
+ ```
52
+
53
+ ## Adım Göstergesi
54
+
55
+ ```tsx
56
+ <View>
57
+ {/* 1. Adım */}
58
+ <StepHeader
59
+ title="Adım 1"
60
+ config={{
61
+ showStepIndicator: true,
62
+ currentStep: 1,
63
+ totalSteps: 3,
64
+ }}
65
+ />
66
+
67
+ {/* 2. Adım */}
68
+ <StepHeader
69
+ title="Adım 2"
70
+ config={{
71
+ showStepIndicator: true,
72
+ currentStep: 2,
73
+ totalSteps: 3,
74
+ }}
75
+ />
76
+
77
+ {/* 3. Adım */}
78
+ <StepHeader
79
+ title="Adım 3"
80
+ config={{
81
+ showStepIndicator: true,
82
+ currentStep: 3,
83
+ totalSteps: 3,
84
+ }}
85
+ />
86
+ </View>
87
+ ```
88
+
89
+ ## Hizalama Seçenekleri
90
+
91
+ ```tsx
92
+ <View>
93
+ {/* Sol hizalı (varsayılan) */}
94
+ <StepHeader
95
+ title="Sol Hizalı"
96
+ subtitle="Solaya hizalı başlık"
97
+ config={{
98
+ titleAlignment: 'left',
99
+ }}
100
+ />
101
+
102
+ {/* Ortalanmış */}
103
+ <StepHeader
104
+ title="Ortada"
105
+ subtitle="Ortalanmış başlık"
106
+ config={{
107
+ titleAlignment: 'center',
108
+ }}
109
+ />
110
+
111
+ {/* Sağ hizalı */}
112
+ <StepHeader
113
+ title="Sağ Hizalı"
114
+ subtitle="Sağa hizalı başlık"
115
+ config={{
116
+ titleAlignment: 'right',
117
+ }}
118
+ />
119
+ </View>
120
+ ```
121
+
122
+ ## Custom Font Boyutu
123
+
124
+ ```tsx
125
+ <StepHeader
126
+ title="Büyük Başlık"
127
+ subtitle="Alt başlık"
128
+ config={{
129
+ titleFontSize: 32,
130
+ subtitleFontSize: 18,
131
+ }}
132
+ />
133
+ ```
134
+
135
+ ## Custom Boşluk
136
+
137
+ ```tsx
138
+ <StepHeader
139
+ title="Özel Boşluk"
140
+ subtitle="Özel padding ve margin"
141
+ config={{
142
+ spacing: {
143
+ marginBottom: 48,
144
+ paddingHorizontal: 32,
145
+ },
146
+ }}
147
+ />
148
+ ```
149
+
150
+ ## Örnek Kullanımlar
151
+
152
+ ### Onboarding Flow
153
+
154
+ ```tsx
155
+ export const OnboardingFlow = () => {
156
+ const [currentStep, setCurrentStep] = useState(1);
157
+ const steps = [
158
+ {
159
+ title: 'Hoş Geldiniz 👋',
160
+ subtitle: 'Uygulamamıza hoş geldiniz',
161
+ },
162
+ {
163
+ title: 'Profil Oluştur',
164
+ subtitle: 'Kendiniz hakkında bilgi verin',
165
+ },
166
+ {
167
+ title: 'İlgi Alanları',
168
+ subtitle: 'İlgi alanlarınızı seçin',
169
+ },
170
+ {
171
+ title: 'Hazır! 🎉',
172
+ subtitle: 'Uygulamayı kullanmaya başlayın',
173
+ },
174
+ ];
175
+
176
+ const currentStepData = steps[currentStep - 1];
177
+
178
+ return (
179
+ <ScreenLayout>
180
+ <StepHeader
181
+ title={currentStepData.title}
182
+ subtitle={currentStepData.subtitle}
183
+ config={{
184
+ showStepIndicator: true,
185
+ currentStep,
186
+ totalSteps: steps.length,
187
+ titleAlignment: 'center',
188
+ }}
189
+ />
190
+
191
+ {/* Step content */}
192
+
193
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
194
+ <Button
195
+ title="Geri"
196
+ disabled={currentStep === 1}
197
+ onPress={() => setCurrentStep(currentStep - 1)}
198
+ />
199
+ <Button
200
+ title={currentStep === steps.length ? 'Bitir' : 'İleri'}
201
+ onPress={() => {
202
+ if (currentStep < steps.length) {
203
+ setCurrentStep(currentStep + 1);
204
+ } else {
205
+ // Finish onboarding
206
+ }
207
+ }}
208
+ />
209
+ </View>
210
+ </ScreenLayout>
211
+ );
212
+ };
213
+ ```
214
+
215
+ ### Kayıt Formu
216
+
217
+ ```tsx
218
+ export const RegistrationForm = () => {
219
+ const [step, setStep] = useState(1);
220
+
221
+ return (
222
+ <ScreenLayout>
223
+ {step === 1 && (
224
+ <>
225
+ <StepHeader
226
+ title="Hesap Oluştur"
227
+ subtitle="E-posta adresiniz ve şifreniz ile başlayın"
228
+ config={{
229
+ showStepIndicator: true,
230
+ currentStep: 1,
231
+ totalSteps: 3,
232
+ }}
233
+ />
234
+ {/* Email & password fields */}
235
+ </>
236
+ )}
237
+
238
+ {step === 2 && (
239
+ <>
240
+ <StepHeader
241
+ title="Profil Bilgileri"
242
+ subtitle="Adınızı ve profil fotoğrafınızı ekleyin"
243
+ config={{
244
+ showStepIndicator: true,
245
+ currentStep: 2,
246
+ totalSteps: 3,
247
+ }}
248
+ />
249
+ {/* Profile fields */}
250
+ </>
251
+ )}
252
+
253
+ {step === 3 && (
254
+ <>
255
+ <StepHeader
256
+ title="Onayla"
257
+ subtitle="Bilgilerinizi kontrol edin"
258
+ config={{
259
+ showStepIndicator: true,
260
+ currentStep: 3,
261
+ totalSteps: 3,
262
+ }}
263
+ />
264
+ {/* Confirmation */}
265
+ </>
266
+ )}
267
+ </ScreenLayout>
268
+ );
269
+ };
270
+ ```
271
+
272
+ ### Checkout Wizard
273
+
274
+ ```tsx
275
+ export const CheckoutWizard = () => {
276
+ const [currentStep, setCurrentStep] = useState(1);
277
+
278
+ const steps = [
279
+ { id: 1, title: 'Teslimat', subtitle: 'Teslimat adresini seçin' },
280
+ { id: 2, title: 'Ödeme', subtitle: 'Ödeme yöntemini seçin' },
281
+ { id: 3, title: 'Onay', subtitle: 'Siparişi onaylayın' },
282
+ ];
283
+
284
+ return (
285
+ <ScreenLayout>
286
+ <StepHeader
287
+ title={steps[currentStep - 1].title}
288
+ subtitle={steps[currentStep - 1].subtitle}
289
+ config={{
290
+ showStepIndicator: true,
291
+ currentStep,
292
+ totalSteps: steps.length,
293
+ }}
294
+ />
295
+
296
+ {/* Step content */}
297
+ </ScreenLayout>
298
+ );
299
+ };
300
+ ```
301
+
302
+ ### Profil Tamamlama
303
+
304
+ ```tsx
305
+ export const ProfileCompletion = ({ completionPercentage }) => {
306
+ const totalSteps = 5;
307
+ const currentStep = Math.ceil((completionPercentage / 100) * totalSteps);
308
+
309
+ return (
310
+ <View>
311
+ <StepHeader
312
+ title="Profilinizi Tamamlayın"
313
+ subtitle={`${completionPercentage}% tamamlandı`}
314
+ config={{
315
+ showStepIndicator: true,
316
+ currentStep,
317
+ totalSteps,
318
+ titleAlignment: 'center',
319
+ }}
320
+ />
321
+ </View>
322
+ );
323
+ };
324
+ ```
325
+
326
+ ### Setup Assistant
327
+
328
+ ```tsx
329
+ export const SetupAssistant = () => {
330
+ const [setupStep, setSetupStep] = useState(1);
331
+
332
+ const setupSteps = [
333
+ { title: 'Dil Seçin', subtitle: 'Tercih ettiğiniz dili seçin' },
334
+ { title: 'Bildirimler', subtitle: 'Bildirim tercihlerinizi ayarlayın' },
335
+ { title: 'Gizlilik', subtitle: 'Gizlilik ayarlarınızı yapılandırın' },
336
+ { title: 'Tema', subtitle: 'Uygulama temasını özelleştirin' },
337
+ ];
338
+
339
+ return (
340
+ <ScreenLayout>
341
+ <StepHeader
342
+ title={setupSteps[setupStep - 1].title}
343
+ subtitle={setupSteps[setupStep - 1].subtitle}
344
+ config={{
345
+ showStepIndicator: true,
346
+ currentStep: setupStep,
347
+ totalSteps: setupSteps.length,
348
+ titleFontSize: 24,
349
+ subtitleFontSize: 14,
350
+ }}
351
+ />
352
+
353
+ {/* Setup content */}
354
+ </ScreenLayout>
355
+ );
356
+ };
357
+ ```
358
+
359
+ ### Questionnaire
360
+
361
+ ```tsx
362
+ export const Questionnaire = () => {
363
+ const [questionIndex, setQuestionIndex] = useState(0);
364
+ const questions = [
365
+ { title: 'Soru 1', subtitle: 'Yaşınız nedir?' },
366
+ { title: 'Soru 2', subtitle: 'Mesleğiniz nedir?' },
367
+ { title: 'Soru 3', subtitle: 'İlgi alanlarınız nelerdir?' },
368
+ ];
369
+
370
+ return (
371
+ <View>
372
+ <StepHeader
373
+ title={questions[questionIndex].title}
374
+ subtitle={questions[questionIndex].subtitle}
375
+ config={{
376
+ showStepIndicator: true,
377
+ currentStep: questionIndex + 1,
378
+ totalSteps: questions.length,
379
+ titleAlignment: 'center',
380
+ spacing: {
381
+ marginBottom: 24,
382
+ paddingHorizontal: 16,
383
+ },
384
+ }}
385
+ />
386
+
387
+ {/* Question content */}
388
+ </View>
389
+ );
390
+ };
391
+ ```
392
+
393
+ ## Props
394
+
395
+ ### StepHeaderProps
396
+
397
+ | Prop | Tip | Varsayılan | Açıklama |
398
+ |------|-----|------------|----------|
399
+ | `title` | `string` | - **(Zorunlu)** | Ana başlık |
400
+ | `subtitle` | `string` | - | Alt başlık |
401
+ | `config` | `StepHeaderConfig` | `{}` | Konfigürasyon |
402
+ | `style` | `ViewStyle` | - | Özel stil |
403
+
404
+ ### StepHeaderConfig
405
+
406
+ | Prop | Tip | Varsayılan | Açıklama |
407
+ |------|-----|------------|----------|
408
+ | `showStepIndicator` | `boolean` | `false` | Adım göstergesi göster |
409
+ | `currentStep` | `number` | - | Mevcut adım |
410
+ | `totalSteps` | `number` | - | Toplam adım sayısı |
411
+ | `titleAlignment` | `'left' \| 'center' \| 'right'` | `'left'` | Başlık hizalaması |
412
+ | `titleFontSize` | `number` | `28` | Başlık font boyutu |
413
+ | `subtitleFontSize` | `number` | `16` | Alt başlık font boyutu |
414
+ | `spacing` | `object` | - | Boşluk ayarları |
415
+ | `spacing.marginBottom` | `number` | `32` | Alt boşluk |
416
+ | `spacing.paddingHorizontal` | `number` | `24` | Yatay boşluk |
417
+
418
+ ## Best Practices
419
+
420
+ ### 1. Step Indicator Kullanımı
421
+
422
+ ```tsx
423
+ // Çok adımlı iş akışlarında
424
+ config={{
425
+ showStepIndicator: true,
426
+ currentStep: 2,
427
+ totalSteps: 5,
428
+ }}
429
+ ```
430
+
431
+ ### 2. Hizalama Seçimi
432
+
433
+ ```tsx
434
+ // Form için
435
+ titleAlignment: 'left'
436
+
437
+ // Onboarding için
438
+ titleAlignment: 'center'
439
+
440
+ // RTL diller için
441
+ titleAlignment: 'right'
442
+ ```
443
+
444
+ ### 3. Adım Sayısı
445
+
446
+ ```tsx
447
+ // İdeal: 3-5 adım
448
+ totalSteps: 4
449
+
450
+ // Çok fazla adımdan kaçının
451
+ totalSteps: 10 // ❌ Kötü
452
+ ```
453
+
454
+ ### 4. Başlık Uzunluğu
455
+
456
+ ```tsx
457
+ // Kısa ve öz
458
+ title="Profil Oluştur" // ✅ İyi
459
+
460
+ // Çok uzun
461
+ title="Lütfen kişisel profil bilgilerinizi buraya girin" // ❌ Kötü
462
+ ```
463
+
464
+ ## Erişilebilirlik
465
+
466
+ StepHeader, tam erişilebilirlik desteği sunar:
467
+
468
+ - ✅ Screen reader desteği
469
+ - ✅ Semantic heading yapısı
470
+ - ✅ Focus management
471
+ - ✅ Yeterli dokunma alanı
472
+
473
+ ## Performans İpuçları
474
+
475
+ 1. **Memoization**: Step header'ı memo edin
476
+ 2. **Optimized Re-renders**: Sadece gerekli olduğunda güncelleyin
477
+ 3. **Minimal Props**: Gereksiz props'tan kaçının
478
+
479
+ ## İlgili Bileşenler
480
+
481
+ - [`AtomicText`](../../atoms/AtomicText/README.md) - Metin bileşeni
482
+ - [`BaseModal`](../BaseModal/README.md) - Modal bileşeni
483
+ - [`FormField`](../FormField/README.md) - Form alanı
484
+
485
+ ## Lisans
486
+
487
+ MIT