@umituz/react-native-design-system 2.6.86 → 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,433 @@
1
+ # AtomicSpinner
2
+
3
+ AtomicSpinner, React Native için çok yönlü bir yükleme göstergesi bileşenidir. ActivityIndicator wrapper'ı olarak çalışır ve geniş özelleştirme seçenekleri sunar.
4
+
5
+ ## Özellikler
6
+
7
+ - ⏳ **4 Size**: Small, Medium, Large, Extra Large
8
+ - 🎨 **6 Renk**: Primary, Secondary, Success, Error, Warning, White
9
+ - 📝 **Metin Desteği**: Yükleme metni gösterimi
10
+ - 🖼️ **Overlay**: Tam ekran overlay desteği
11
+ - 📦 **Full Container**: Parent container'ı doldurma
12
+ - ♿ **Erişilebilir**: Tam erişilebilirlik desteği
13
+
14
+ ## Kurulum
15
+
16
+ ```tsx
17
+ import { AtomicSpinner } 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 { AtomicSpinner } from 'react-native-design-system';
26
+
27
+ export const BasicExample = () => {
28
+ return (
29
+ <View style={{ padding: 16 }}>
30
+ <AtomicSpinner />
31
+ </View>
32
+ );
33
+ };
34
+ ```
35
+
36
+ ## Boyutlar
37
+
38
+ ```tsx
39
+ <View style={{ gap: 16 }}>
40
+ {/* Small */}
41
+ <AtomicSpinner size="sm" />
42
+
43
+ {/* Medium (Varsayılan) */}
44
+ <AtomicSpinner size="md" />
45
+
46
+ {/* Large */}
47
+ <AtomicSpinner size="lg" />
48
+
49
+ {/* Extra Large */}
50
+ <AtomicSpinner size="xl" />
51
+ </View>
52
+ ```
53
+
54
+ ## Renkler
55
+
56
+ ```tsx
57
+ <View style={{ flexDirection: 'row', gap: 16 }}>
58
+ <AtomicSpinner color="primary" />
59
+ <AtomicSpinner color="secondary" />
60
+ <AtomicSpinner color="success" />
61
+ <AtomicSpinner color="warning" />
62
+ <AtomicSpinner color="error" />
63
+ <AtomicSpinner color="white" />
64
+ </View>
65
+ ```
66
+
67
+ ## Custom Renk
68
+
69
+ ```tsx
70
+ <AtomicSpinner color="#6366f1" />
71
+ <AtomicSpinner color="rgb(99, 102, 241)" />
72
+ ```
73
+
74
+ ## Metin ile
75
+
76
+ ```tsx
77
+ {/* Metin aşağıda (varsayılan) */}
78
+ <AtomicSpinner
79
+ text="Yükleniyor..."
80
+ textPosition="bottom"
81
+ />
82
+
83
+ {/* Metin sağda */}
84
+ <AtomicSpinner
85
+ text="Yükleniyor..."
86
+ textPosition="right"
87
+ />
88
+ ```
89
+
90
+ ## Full Container
91
+
92
+ ```tsx
93
+ <View style={{ height: 200 }}>
94
+ <AtomicSpinner fullContainer />
95
+ </View>
96
+ ```
97
+
98
+ ## Overlay
99
+
100
+ ```tsx
101
+ <View style={{ height: 200 }}>
102
+ {/* Overlay varsayılan renk */}
103
+ <AtomicSpinner overlay text="Yükleniyor..." />
104
+
105
+ {/* Custom overlay rengi */}
106
+ <AtomicSpinner
107
+ overlay
108
+ overlayColor="rgba(0, 0, 0, 0.7)"
109
+ text="Lütfen bekleyin..."
110
+ color="white"
111
+ />
112
+ </View>
113
+ ```
114
+
115
+ ## Custom Size
116
+
117
+ ```tsx
118
+ <AtomicSpinner size={32} />
119
+ <AtomicSpinner size={48} />
120
+ <AtomicSpinner size={64} />
121
+ ```
122
+
123
+ ## Örnek Kullanımlar
124
+
125
+ ### Sayfa Yükleniyor
126
+
127
+ ```tsx
128
+ export const PageLoading = () => {
129
+ return (
130
+ <View style={{ flex: 1 }}>
131
+ <AtomicSpinner
132
+ fullContainer
133
+ size="lg"
134
+ text="Sayfa yükleniyor..."
135
+ />
136
+ </View>
137
+ );
138
+ };
139
+ ```
140
+
141
+ ### Button Loading
142
+
143
+ ```tsx
144
+ export const LoadingButton = ({ loading, onPress, children }) => {
145
+ return (
146
+ <Pressable onPress={onPress} disabled={loading}>
147
+ <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
148
+ {loading ? (
149
+ <>
150
+ <AtomicSpinner size="sm" color="white" />
151
+ <AtomicText style={{ marginLeft: 8 }}>Yükleniyor...</AtomicText>
152
+ </>
153
+ ) : (
154
+ children
155
+ )}
156
+ </View>
157
+ </Pressable>
158
+ );
159
+ };
160
+ ```
161
+
162
+ ### Veri Çekme
163
+
164
+ ```tsx
165
+ export const DataLoading = ({ isLoading, children }) => {
166
+ if (isLoading) {
167
+ return (
168
+ <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
169
+ <AtomicSpinner
170
+ size="lg"
171
+ text="Veriler çekiliyor..."
172
+ />
173
+ </View>
174
+ );
175
+ }
176
+
177
+ return children;
178
+ };
179
+ ```
180
+
181
+ ### Form Submit
182
+
183
+ ```tsx
184
+ export const FormLoading = ({ isSubmitting }) => {
185
+ return (
186
+ <View style={{ padding: 24 }}>
187
+ {isSubmitting ? (
188
+ <View style={{ alignItems: 'center' }}>
189
+ <AtomicSpinner
190
+ size="md"
191
+ text="Form gönderiliyor..."
192
+ textPosition="bottom"
193
+ />
194
+ </View>
195
+ ) : (
196
+ <AtomicText>Form hazır</AtomicText>
197
+ )}
198
+ </View>
199
+ );
200
+ };
201
+ ```
202
+
203
+ ### İçerik Yenileme
204
+
205
+ ```tsx
206
+ export const RefreshContent = ({ isRefreshing }) => {
207
+ return (
208
+ <View style={{ padding: 16, alignItems: 'center' }}>
209
+ {isRefreshing && (
210
+ <AtomicSpinner
211
+ size="sm"
212
+ text="Yenileniyor..."
213
+ textPosition="right"
214
+ />
215
+ )}
216
+ </View>
217
+ );
218
+ };
219
+ ```
220
+
221
+ ### Modal Loading
222
+
223
+ ```tsx
224
+ export const LoadingModal = ({ visible }) => {
225
+ return (
226
+ <Modal visible={visible} transparent>
227
+ <AtomicSpinner
228
+ overlay
229
+ overlayColor="rgba(0, 0, 0, 0.7)"
230
+ size="lg"
231
+ text="Lütfen bekleyin..."
232
+ color="white"
233
+ />
234
+ </Modal>
235
+ );
236
+ };
237
+ ```
238
+
239
+ ### Liste Yükleme
240
+
241
+ ```tsx
242
+ export const ListLoading = () => {
243
+ return (
244
+ <View style={{ padding: 24 }}>
245
+ <AtomicSpinner
246
+ size="md"
247
+ text="Öğeler yükleniyor..."
248
+ />
249
+ </View>
250
+ );
251
+ };
252
+ ```
253
+
254
+ ### Görsel Yükleme
255
+
256
+ ```tsx
257
+ export const ImageLoading = ({ isLoading, children }) => {
258
+ return (
259
+ <View style={{ width: 200, height: 200 }}>
260
+ {isLoading ? (
261
+ <AtomicSpinner
262
+ fullContainer
263
+ text="Görsel yükleniyor..."
264
+ color="primary"
265
+ />
266
+ ) : (
267
+ children
268
+ )}
269
+ </View>
270
+ );
271
+ };
272
+ ```
273
+
274
+ ### Async Operasyon
275
+
276
+ ```tsx
277
+ export const AsyncOperation = () => {
278
+ const [isProcessing, setIsProcessing] = useState(false);
279
+
280
+ const handleProcess = async () => {
281
+ setIsProcessing(true);
282
+ try {
283
+ await performAsyncOperation();
284
+ } finally {
285
+ setIsProcessing(false);
286
+ }
287
+ };
288
+
289
+ return (
290
+ <View>
291
+ {isProcessing ? (
292
+ <AtomicSpinner
293
+ size="md"
294
+ text="İşleniyor..."
295
+ textPosition="right"
296
+ />
297
+ ) : (
298
+ <Button title="İşle" onPress={handleProcess} />
299
+ )}
300
+ </View>
301
+ );
302
+ };
303
+ ```
304
+
305
+ ### Infinity Scroll Yükleme
306
+
307
+ ```tsx
308
+ export const InfiniteScrollLoading = ({ isLoading }) => {
309
+ if (!isLoading) return null;
310
+
311
+ return (
312
+ <View style={{ padding: 16 }}>
313
+ <AtomicSpinner
314
+ size="sm"
315
+ text="Daha fazla yükleniyor..."
316
+ textPosition="right"
317
+ />
318
+ </View>
319
+ );
320
+ };
321
+ ```
322
+
323
+ ## Props
324
+
325
+ ### AtomicSpinnerProps
326
+
327
+ | Prop | Tip | Varsayılan | Açıklama |
328
+ |------|-----|------------|----------|
329
+ | `size` | `SpinnerSize \| number` | `'md'` | Spinner boyutu |
330
+ | `color` | `SpinnerColor \| string` | `'primary'` | Spinner rengi |
331
+ | `text` | `string` | - | Yükleme metni |
332
+ | `textPosition` | `'bottom' \| 'right'` | `'bottom'` | Metin konumu |
333
+ | `fullContainer` | `boolean` | `false` | Container'ı doldur |
334
+ | `overlay` | `boolean` | `false` | Overlay göster |
335
+ | `overlayColor` | `string` | `'rgba(0, 0, 0, 0.5)'` | Overlay rengi |
336
+ | `style` | `ViewStyle \| ViewStyle[]` | - | Özel stil |
337
+ | `testID` | `string` | - | Test ID'si |
338
+
339
+ ### SpinnerSize
340
+
341
+ ```typescript
342
+ type SpinnerSize =
343
+ | 'sm' // Small (16px)
344
+ | 'md' // Medium (24px, varsayılan)
345
+ | 'lg' // Large (36px)
346
+ | 'xl'; // Extra Large (48px)
347
+ ```
348
+
349
+ ### SpinnerColor
350
+
351
+ ```typescript
352
+ type SpinnerColor =
353
+ | 'primary' // Ana renk
354
+ | 'secondary' // İkincil renk
355
+ | 'success' // Başarı rengi
356
+ | 'error' // Hata rengi
357
+ | 'warning' // Uyarı rengi
358
+ | 'white'; // Beyaz
359
+ ```
360
+
361
+ ## Best Practices
362
+
363
+ ### 1. Boyut Seçimi
364
+
365
+ ```tsx
366
+ // Küçük alanlar için
367
+ <AtomicSpinner size="sm" />
368
+
369
+ // Normal kullanım
370
+ <AtomicSpinner size="md" />
371
+
372
+ // Vurgu için
373
+ <AtomicSpinner size="lg" />
374
+
375
+ // Tam ekran
376
+ <AtomicSpinner size="xl" fullContainer />
377
+ ```
378
+
379
+ ### 2. Overlay Kullanımı
380
+
381
+ ```tsx
382
+ // Tam ekran yükleme
383
+ <AtomicSpinner overlay text="Yükleniyor..." />
384
+
385
+ // Custom overlay
386
+ <AtomicSpinner
387
+ overlay
388
+ overlayColor="rgba(255, 255, 255, 0.9)"
389
+ color="primary"
390
+ />
391
+ ```
392
+
393
+ ### 3. Metin Kullanımı
394
+
395
+ ```tsx
396
+ // Açıklayıcı metin
397
+ <AtomicSpinner text="Veriler yükleniyor..." />
398
+
399
+ // Kısa metin
400
+ <AtomicSpinner text="Yükleniyor..." />
401
+
402
+ // Sağda metin (horizontal layout)
403
+ <AtomicSpinner
404
+ text="İşleniyor..."
405
+ textPosition="right"
406
+ />
407
+ ```
408
+
409
+ ## Erişilebilirlik
410
+
411
+ AtomicSpinner, tam erişilebilirlik desteği sunar:
412
+
413
+ - ✅ Screen reader desteği
414
+ - ✅ Accessibility label
415
+ - ✅ Progress bar role
416
+ - ✅ Live region anonsu
417
+ - ✅ Test ID desteği
418
+
419
+ ## Performans İpuçları
420
+
421
+ 1. **Conditional Rendering**: Gereksiz render'lardan kaçının
422
+ 2. **Size Selection**: Uygun boyutu seçin
423
+ 3. **Avoid Re-renders**: Spinner'ı stabilize edin
424
+
425
+ ## İlgili Bileşenler
426
+
427
+ - [`AtomicProgress`](./AtomicProgress/README.md) - İlerleme çubuğu
428
+ - [`AtomicSkeleton`](./skeleton/AtomicSkeleton/README.md) - Skeleton loading
429
+ - [`EmptyState`](./EmptyState/README.md) - Boş durum
430
+
431
+ ## Lisans
432
+
433
+ MIT