@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,421 @@
1
+ # AtomicFab
2
+
3
+ AtomicFab (Floating Action Button), Material Design 3 uyumlu bir yüzen aksiyon butonudur. Ekranın sağ alt köşesinde bulunur ve bir ekrandaki birincil eylemi temsil eder.
4
+
5
+ ## Özellikler
6
+
7
+ - 🎯 **Primary Action**: Ana eylem için buton
8
+ - 📏 **3 Size**: Small (40px), Medium (56px), Large (72px)
9
+ - 🎨 **3 Variant**: Primary, Secondary, Surface
10
+ - 📍 **Responsive**: Otomatik pozisyonlama
11
+ - 🔝 **Safe Area**: Tab bar ve safe area uyumlu
12
+ - ♿ **Erişilebilir**: Tam erişilebilirlik desteği
13
+
14
+ ## Önemli Not
15
+
16
+ ⚠️ **FAB mutlaka ScreenLayout seviyesinde kullanılmalı, ScrollView içinde kullanılmamalıdır!**
17
+
18
+ ## Kurulum
19
+
20
+ ```tsx
21
+ import { AtomicFab } from 'react-native-design-system';
22
+ ```
23
+
24
+ ## Temel Kullanım
25
+
26
+ ```tsx
27
+ import React from 'react';
28
+ import { View, ScrollView } from 'react-native';
29
+ import { AtomicFab, ScreenLayout } from 'react-native-design-system';
30
+
31
+ export const BasicExample = () => {
32
+ const handleAdd = () => {
33
+ console.log('Yeni öğe ekle');
34
+ };
35
+
36
+ return (
37
+ <ScreenLayout>
38
+ <ScrollView>
39
+ {/* İçerik */}
40
+ </ScrollView>
41
+
42
+ <AtomicFab
43
+ icon="add"
44
+ onPress={handleAdd}
45
+ />
46
+ </ScreenLayout>
47
+ );
48
+ };
49
+ ```
50
+
51
+ ## Variant'lar
52
+
53
+ ```tsx
54
+ <View style={{ gap: 16 }}>
55
+ {/* Primary (Varsayılan) */}
56
+ <AtomicFab
57
+ icon="add"
58
+ variant="primary"
59
+ onPress={() => {}}
60
+ />
61
+
62
+ {/* Secondary */}
63
+ <AtomicFab
64
+ icon="create"
65
+ variant="secondary"
66
+ onPress={() => {}}
67
+ />
68
+
69
+ {/* Surface */}
70
+ <AtomicFab
71
+ icon="share"
72
+ variant="surface"
73
+ onPress={() => {}}
74
+ />
75
+ </View>
76
+ ```
77
+
78
+ ## Boyutlar
79
+
80
+ ```tsx
81
+ <View style={{ gap: 16 }}>
82
+ {/* Small */}
83
+ <AtomicFab
84
+ icon="add"
85
+ size="sm"
86
+ onPress={() => {}}
87
+ />
88
+
89
+ {/* Medium (Varsayılan) */}
90
+ <AtomicFab
91
+ icon="add"
92
+ size="md"
93
+ onPress={() => {}}
94
+ />
95
+
96
+ {/* Large */}
97
+ <AtomicFab
98
+ icon="add"
99
+ size="lg"
100
+ onPress={() => {}}
101
+ />
102
+ </View>
103
+ ```
104
+
105
+ ## Disabled State
106
+
107
+ ```tsx
108
+ <AtomicFab
109
+ icon="add"
110
+ disabled
111
+ onPress={() => {}}
112
+ />
113
+ ```
114
+
115
+ ## Custom Style
116
+
117
+ ```tsx
118
+ <AtomicFab
119
+ icon="add"
120
+ onPress={handleAdd}
121
+ style={{
122
+ bottom: 100,
123
+ right: 20,
124
+ }}
125
+ />
126
+ ```
127
+
128
+ ## Örnek Kullanımlar
129
+
130
+ ### Yeni Öğe Ekleme
131
+
132
+ ```tsx
133
+ export const ItemList = () => {
134
+ const navigation = useNavigation();
135
+
136
+ return (
137
+ <ScreenLayout>
138
+ <FlatList
139
+ data={items}
140
+ keyExtractor={(item) => item.id}
141
+ renderItem={({ item }) => <ItemCard item={item} />}
142
+ />
143
+
144
+ <AtomicFab
145
+ icon="add"
146
+ onPress={() => navigation.navigate('AddItem')}
147
+ accessibilityLabel="Yeni öğe ekle"
148
+ />
149
+ </ScreenLayout>
150
+ );
151
+ };
152
+ ```
153
+
154
+ ### Mesaj Oluşturma
155
+
156
+ ```tsx
157
+ export const ChatList = () => {
158
+ return (
159
+ <ScreenLayout>
160
+ <FlatList
161
+ data={conversations}
162
+ keyExtractor={(item) => item.id}
163
+ renderItem={({ item }) => <ConversationCard item={item} />}
164
+ />
165
+
166
+ <AtomicFab
167
+ icon="chatbubble-outline"
168
+ onPress={() => console.log('Yeni mesaj')}
169
+ accessibilityLabel="Yeni mesaj"
170
+ />
171
+ </ScreenLayout>
172
+ );
173
+ };
174
+ ```
175
+
176
+ ### Fotoğraf Çekme
177
+
178
+ ```tsx
179
+ export const PhotoGallery = () => {
180
+ const handleTakePhoto = () => {
181
+ launchCamera();
182
+ };
183
+
184
+ return (
185
+ <ScreenLayout>
186
+ <FlatList
187
+ data={photos}
188
+ numColumns={3}
189
+ renderItem={({ item }) => <PhotoItem photo={item} />}
190
+ />
191
+
192
+ <AtomicFab
193
+ icon="camera-outline"
194
+ onPress={handleTakePhoto}
195
+ accessibilityLabel="Fotoğraf çek"
196
+ />
197
+ </ScreenLayout>
198
+ );
199
+ };
200
+ ```
201
+
202
+ ### Konum Oluşturma
203
+
204
+ ```tsx
205
+ export const MapScreen = () => {
206
+ const handleAddLocation = () => {
207
+ console.log('Konum ekle');
208
+ };
209
+
210
+ return (
211
+ <ScreenLayout>
212
+ <MapView style={{ flex: 1 }} />
213
+
214
+ <AtomicFab
215
+ icon="location-outline"
216
+ variant="secondary"
217
+ onPress={handleAddLocation}
218
+ accessibilityLabel="Konum ekle"
219
+ />
220
+ </ScreenLayout>
221
+ );
222
+ };
223
+ ```
224
+
225
+ ### Arama
226
+
227
+ ```tsx
228
+ export const ContactList = () => {
229
+ const handleCall = () => {
230
+ console.log('Ara');
231
+ };
232
+
233
+ return (
234
+ <ScreenLayout>
235
+ <FlatList
236
+ data={contacts}
237
+ keyExtractor={(item) => item.id}
238
+ renderItem={({ item }) => <ContactCard contact={item} />}
239
+ />
240
+
241
+ <AtomicFab
242
+ icon="call-outline"
243
+ variant="surface"
244
+ onPress={handleCall}
245
+ accessibilityLabel="Ara"
246
+ />
247
+ </ScreenLayout>
248
+ );
249
+ };
250
+ ```
251
+
252
+ ### Farklı Eylemler
253
+
254
+ ```tsx
255
+ export const Dashboard = () => {
256
+ return (
257
+ <ScreenLayout>
258
+ <ScrollView contentContainerStyle={{ padding: 16 }}>
259
+ <DashboardCards />
260
+ </ScrollView>
261
+
262
+ {/* İlk FAB - Ana eylem */}
263
+ <AtomicFab
264
+ icon="add"
265
+ onPress={() => console.log('Ana eylem')}
266
+ style={{ right: 80 }}
267
+ />
268
+
269
+ {/* İkinci FAB - İkincil eylem */}
270
+ <AtomicFab
271
+ icon="settings-outline"
272
+ variant="secondary"
273
+ size="sm"
274
+ onPress={() => console.log('İkincil eylem')}
275
+ />
276
+ </ScreenLayout>
277
+ );
278
+ };
279
+ ```
280
+
281
+ ## Props
282
+
283
+ ### AtomicFabProps
284
+
285
+ | Prop | Tip | Varsayılan | Açıklama |
286
+ |------|-----|------------|----------|
287
+ | `icon` | `string` | - **(Zorunlu)** | İkon ismi (Ionicons) |
288
+ | `onPress` | `() => void` | - **(Zorunlu)** | Tıklama olayı |
289
+ | `variant` | `FabVariant` | `'primary'` | FAB variant'ı |
290
+ | `size` | `FabSize` | `'md'` | FAB boyutu |
291
+ | `disabled` | `boolean` | `false` | Devre dışı |
292
+ | `activeOpacity` | `number` | `0.7` | Tıklama opaklığı |
293
+ | `accessibilityLabel` | `string` | - | Erişilebilirlik etiketi |
294
+ | `style` | `StyleProp<ViewStyle>` | - | Özel stil |
295
+ | `testID` | `string` | - | Test ID'si |
296
+
297
+ ### FabVariant
298
+
299
+ ```typescript
300
+ type FabVariant =
301
+ | 'primary' // Ana eylem (varsayılan)
302
+ | 'secondary' // İkincil eylem
303
+ | 'surface'; // Yüzey eylemi
304
+ ```
305
+
306
+ ### FabSize
307
+
308
+ ```typescript
309
+ type FabSize =
310
+ | 'sm' // Small (40px)
311
+ | 'md' // Medium (56px, varsayılan)
312
+ | 'lg'; // Large (72px)
313
+ ```
314
+
315
+ ## Best Practices
316
+
317
+ ### 1. Doğru Kullanım
318
+
319
+ ```tsx
320
+ // ✅ DOĞRU - ScreenLayout seviyesinde
321
+ <ScreenLayout>
322
+ <ScrollView>
323
+ {/* İçerik */}
324
+ </ScrollView>
325
+ <AtomicFab icon="add" onPress={handleAdd} />
326
+ </ScreenLayout>
327
+
328
+ // ❌ YANLIŞ - ScrollView içinde
329
+ <ScrollView>
330
+ <AtomicFab icon="add" onPress={handleAdd} />
331
+ </ScrollView>
332
+ ```
333
+
334
+ ### 2. İkon Seçimi
335
+
336
+ ```tsx
337
+ // Ekleme işlemi
338
+ <AtomicFab icon="add" />
339
+
340
+ // Düzenleme
341
+ <AtomicFab icon="create" />
342
+
343
+ // Mesajlaşma
344
+ <AtomicFab icon="chatbubble-outline" />
345
+
346
+ // Paylaşım
347
+ <AtomicFab icon="share-outline" />
348
+
349
+ // Arama
350
+ <AtomicFab icon="call-outline" />
351
+ ```
352
+
353
+ ### 3. Variant Seçimi
354
+
355
+ ```tsx
356
+ // Ana eylem
357
+ <AtomicFab variant="primary" icon="add" />
358
+
359
+ // İkincil eylem
360
+ <AtomicFab variant="secondary" icon="create" />
361
+
362
+ // Alternatif eylem
363
+ <AtomicFab variant="surface" icon="share" />
364
+ ```
365
+
366
+ ## Erişilebilirlik
367
+
368
+ AtomicFab, tam erişilebilirlik desteği sunar:
369
+
370
+ - ✅ Touch uygun boyut (minimum 40x40)
371
+ - ✅ Screen reader desteği
372
+ - ✅ Accessibility label
373
+ - ✅ Semantic role (button)
374
+ - ✅ Test ID desteği
375
+
376
+ ## Performans İpuçları
377
+
378
+ 1. **OnPress Stabilization**: `onPress` callback'ini `useCallback` ile sarın
379
+ 2. **Avoid Re-renders**: FAB'ı gereksiz yere yeniden render etmeyin
380
+ 3. **Single FAB**: Genellikle bir ekranda tek FAB olmalıdır
381
+
382
+ ## Material Design 3 Uyumluluğu
383
+
384
+ Bu bileşen Material Design 3 spesifikasyonlarına uygun olarak tasarlanmıştır:
385
+
386
+ - ✅ Standart boyutlar (40px, 56px, 72px)
387
+ - ✅ Variant renkleri
388
+ - ✅ Border ile derinlik (gölge yok)
389
+ - ✅ Responsive pozisyonlama
390
+ - ✅ Safe area desteği
391
+
392
+ ## İlgili Bileşenler
393
+
394
+ - [`AtomicButton`](./button/README.md) - Normal buton
395
+ - [`AtomicIcon`](./AtomicIcon/README.md) - İkon bileşeni
396
+ - [`ScreenLayout`](../layouts/ScreenLayout/README.md) - Ekran düzeni
397
+
398
+ ## Önemli Bilgiler
399
+
400
+ ### FAB Kullanımı
401
+
402
+ 1. **Birincil Eylem**: FAB, ekrandaki en önemli eylem olmalıdır
403
+ 2. **Sınırlı Sayı**: Bir ekranda genellikle tek FAB bulunur
404
+ 3. **Pozisyon**: Sağ alt köşededir
405
+ 4. **Scroll**: İçerik scroll olduğunda sabit kalır
406
+
407
+ ### FAB vs Extended FAB
408
+
409
+ Standart FAB (bu bileşen):
410
+ - Dairesel şekil
411
+ - Sadece ikon
412
+ - Compact tasarım
413
+
414
+ Extended FAB (farklı bileşen):
415
+ - Dikdörtgen/Pill şekil
416
+ - İkon + metin
417
+ - Daha fazla yer kaplar
418
+
419
+ ## Lisans
420
+
421
+ MIT