@umituz/react-native-design-system 2.6.84 → 2.6.86

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,363 @@
1
+ # AtomicButton
2
+
3
+ AtomicButton, React Native için güçlü ve özelleştirilebilir bir buton bileşenidir. Material Design 3 prensiplerine uygun olarak tasarlanmış ve tamamen özelleştirilebilir.
4
+
5
+ ## Özellikler
6
+
7
+ - ✨ **6 Variant**: Primary, Secondary, Tertiary, Surface, Outline, Ghost
8
+ - 📏 **3 Size**: Small, Medium, Large
9
+ - 🎨 **Tam Özelleştirilebilir**: Stil ve metin özelleştirmesi
10
+ - 🔄 **Loading State**: Yükleme durumu
11
+ - 🎭 **İkon Desteği**: Sol veya sağ ikon
12
+ - 📐 **Full Width**: Tam genişlik desteği
13
+ - ♿ **Erişilebilirlik**: Tam erişilebilirlik desteği
14
+
15
+ ## Kurulum
16
+
17
+ ```tsx
18
+ import { AtomicButton } from 'react-native-design-system';
19
+ ```
20
+
21
+ ## Temel Kullanım
22
+
23
+ ```tsx
24
+ import React from 'react';
25
+ import { View } from 'react-native';
26
+ import { AtomicButton } from 'react-native-design-system';
27
+
28
+ export const BasicExample = () => {
29
+ return (
30
+ <View style={{ padding: 16 }}>
31
+ <AtomicButton
32
+ title="Buton"
33
+ onPress={() => console.log('Tıklandı!')}
34
+ />
35
+ </View>
36
+ );
37
+ };
38
+ ```
39
+
40
+ ## Variant'lar
41
+
42
+ ```tsx
43
+ <View style={{ gap: 12 }}>
44
+ {/* Primary */}
45
+ <AtomicButton
46
+ variant="primary"
47
+ title="Primary"
48
+ onPress={() => {}}
49
+ />
50
+
51
+ {/* Secondary */}
52
+ <AtomicButton
53
+ variant="secondary"
54
+ title="Secondary"
55
+ onPress={() => {}}
56
+ />
57
+
58
+ {/* Tertiary */}
59
+ <AtomicButton
60
+ variant="tertiary"
61
+ title="Tertiary"
62
+ onPress={() => {}}
63
+ />
64
+
65
+ {/* Surface */}
66
+ <AtomicButton
67
+ variant="surface"
68
+ title="Surface"
69
+ onPress={() => {}}
70
+ />
71
+
72
+ {/* Outline */}
73
+ <AtomicButton
74
+ variant="outline"
75
+ title="Outline"
76
+ onPress={() => {}}
77
+ />
78
+
79
+ {/* Ghost */}
80
+ <AtomicButton
81
+ variant="ghost"
82
+ title="Ghost"
83
+ onPress={() => {}}
84
+ />
85
+ </View>
86
+ ```
87
+
88
+ ## Boyutlar
89
+
90
+ ```tsx
91
+ <View style={{ gap: 12 }}>
92
+ {/* Small */}
93
+ <AtomicButton
94
+ size="sm"
95
+ title="Small"
96
+ onPress={() => {}}
97
+ />
98
+
99
+ {/* Medium (Varsayılan) */}
100
+ <AtomicButton
101
+ size="md"
102
+ title="Medium"
103
+ onPress={() => {}}
104
+ />
105
+
106
+ {/* Large */}
107
+ <AtomicButton
108
+ size="lg"
109
+ title="Large"
110
+ onPress={() => {}}
111
+ />
112
+ </View>
113
+ ```
114
+
115
+ ## İkonlu Butonlar
116
+
117
+ ```tsx
118
+ <View style={{ gap: 12 }}>
119
+ {/* Sol İkon */}
120
+ <AtomicButton
121
+ title="Devam Et"
122
+ icon="arrow-forward-outline"
123
+ iconPosition="left"
124
+ onPress={() => {}}
125
+ />
126
+
127
+ {/* Sağ İkon */}
128
+ <AtomicButton
129
+ title="Geri"
130
+ icon="arrow-back-outline"
131
+ iconPosition="right"
132
+ onPress={() => {}}
133
+ />
134
+
135
+ {/* Sadece İkon */}
136
+ <AtomicButton
137
+ icon="add-outline"
138
+ onPress={() => {}}
139
+ />
140
+ </View>
141
+ ```
142
+
143
+ ## Loading State
144
+
145
+ ```tsx
146
+ <AtomicButton
147
+ title="Yükleniyor"
148
+ loading
149
+ onPress={() => {}}
150
+ />
151
+ ```
152
+
153
+ ## Disabled State
154
+
155
+ ```tsx
156
+ <AtomicButton
157
+ title="Devre Dışı"
158
+ disabled
159
+ onPress={() => {}}
160
+ />
161
+ ```
162
+
163
+ ## Full Width
164
+
165
+ ```tsx
166
+ <AtomicButton
167
+ title="Tam Genişlik"
168
+ fullWidth
169
+ onPress={() => {}}
170
+ />
171
+ ```
172
+
173
+ ## Örnek Kullanımlar
174
+
175
+ ### Form Gönderme
176
+
177
+ ```tsx
178
+ <AtomicButton
179
+ variant="primary"
180
+ size="lg"
181
+ title="Gönder"
182
+ loading={isSubmitting}
183
+ onPress={handleSubmit}
184
+ />
185
+ ```
186
+
187
+ ### Silme İşlemi
188
+
189
+ ```tsx
190
+ <AtomicButton
191
+ variant="outline"
192
+ title="Sil"
193
+ icon="trash-outline"
194
+ onPress={handleDelete}
195
+ />
196
+ ```
197
+
198
+ ### İptal
199
+
200
+ ```tsx
201
+ <AtomicButton
202
+ variant="ghost"
203
+ title="İptal"
204
+ onPress={handleCancel}
205
+ />
206
+ ```
207
+
208
+ ### İkon Butonları
209
+
210
+ ```tsx
211
+ <View style={{ flexDirection: 'row', gap: 8 }}>
212
+ <AtomicButton
213
+ variant="surface"
214
+ icon="add-outline"
215
+ onPress={() => {}}
216
+ />
217
+
218
+ <AtomicButton
219
+ variant="surface"
220
+ icon="create-outline"
221
+ onPress={() => {}}
222
+ />
223
+
224
+ <AtomicButton
225
+ variant="surface"
226
+ icon="trash-outline"
227
+ onPress={() => {}}
228
+ />
229
+ </View>
230
+ ```
231
+
232
+ ## Props
233
+
234
+ ### AtomicButtonProps
235
+
236
+ | Prop | Tip | Varsayılan | Açıklama |
237
+ |------|-----|------------|----------|
238
+ | `title` | `string` | - | Buton metni |
239
+ | `children` | `ReactNode` | - | Alternatif içerik |
240
+ | `onPress` | `() => void` | - **(Zorunlu)** | Tıklama olayı |
241
+ | `variant` | `ButtonVariant` | `'primary'` | Buton görünüm stili |
242
+ | `size` | `ButtonSize` | `'md'` | Buton boyutu |
243
+ | `disabled` | `boolean` | `false` | Devre dışı |
244
+ | `loading` | `boolean` | `false` | Yükleme durumu |
245
+ | `icon` | `string` | - | İkon ismi (Ionicons) |
246
+ | `iconPosition` | `'left' \| 'right'` | `'left'` | İkon konumu |
247
+ | `fullWidth` | `boolean` | `false` | Tam genişlik |
248
+ | `style` | `StyleProp<ViewStyle>` | - | Container stil |
249
+ | `textStyle` | `StyleProp<TextStyle>` | - | Metin stil |
250
+ | `activeOpacity` | `number` | `0.8` | Opaklık |
251
+ | `testID` | `string` | - | Test ID'si |
252
+
253
+ ### ButtonVariant
254
+
255
+ ```typescript
256
+ type ButtonVariant =
257
+ | 'primary' // Ana buton
258
+ | 'secondary' // İkincil buton
259
+ | 'tertiary' // Üçüncül buton
260
+ | 'surface' // Yüzey butonu
261
+ | 'outline' // Çerçeveli buton
262
+ | 'ghost'; // Hayalet buton
263
+ ```
264
+
265
+ ### ButtonSize
266
+
267
+ ```typescript
268
+ type ButtonSize = 'sm' | 'md' | 'lg';
269
+ ```
270
+
271
+ ## Stil Özelleştirme
272
+
273
+ ```tsx
274
+ <AtomicButton
275
+ title="Özel Buton"
276
+ onPress={() => {}}
277
+ style={{
278
+ backgroundColor: '#6366f1',
279
+ borderRadius: 8,
280
+ shadowColor: '#6366f1',
281
+ shadowOffset: { width: 0, height: 4 },
282
+ shadowOpacity: 0.3,
283
+ shadowRadius: 8,
284
+ elevation: 8,
285
+ }}
286
+ textStyle={{
287
+ color: '#ffffff',
288
+ fontSize: 16,
289
+ fontWeight: '700',
290
+ }}
291
+ />
292
+ ```
293
+
294
+ ## Best Practices
295
+
296
+ ### 1. Buton Hiyerarşisi
297
+
298
+ ```tsx
299
+ // Ana eylem
300
+ <AtomicButton variant="primary" title="Kaydet" onPress={save} />
301
+
302
+ // İkincil eylem
303
+ <AtomicButton variant="secondary" title="İptal" onPress={cancel} />
304
+
305
+ // Tehlikeli eylem
306
+ <AtomicButton variant="outline" title="Sil" onPress={delete} />
307
+ ```
308
+
309
+ ### 2. İkon Kullanımı
310
+
311
+ ```tsx
312
+ // İlerle - sağ ikon
313
+ <AtomicButton
314
+ title="İlerle"
315
+ icon="arrow-forward"
316
+ iconPosition="right"
317
+ onPress={next}
318
+ />
319
+
320
+ // Geri - sol ikon
321
+ <AtomicButton
322
+ title="Geri"
323
+ icon="arrow-back"
324
+ iconPosition="left"
325
+ onPress={back}
326
+ />
327
+ ```
328
+
329
+ ### 3. Loading State
330
+
331
+ ```tsx
332
+ <AtomicButton
333
+ title="Gönder"
334
+ loading={isLoading}
335
+ onPress={handleSubmit}
336
+ disabled={isLoading}
337
+ />
338
+ ```
339
+
340
+ ## Erişilebilirlik
341
+
342
+ AtomicButton, tam erişilebilirlik desteği sunar:
343
+
344
+ - ✅ Touch uygun boyut (minimum 44x44)
345
+ - ✅ Screen reader desteği
346
+ - ✅ Disabled state anonsu
347
+ - ✅ Test ID desteği
348
+
349
+ ## Performans İpuçları
350
+
351
+ 1. **React.memo**: AtomicButton zaten `React.memo` ile sarılmış
352
+ 2. **Inline Styles**: Inline stil kullanmaktan kaçının, bunun yerine theme kullanın
353
+ 3. **Re-renders**: Prop'ları stabilize edin (useCallback, useMemo)
354
+
355
+ ## İlgili Bileşenler
356
+
357
+ - [`AtomicIcon`](../AtomicIcon/README.md) - İkon bileşeni
358
+ - [`AtomicSpinner`](../AtomicSpinner/README.md) - Yükleme göstergesi
359
+ - [`AtomicText`](../AtomicText/README.md) - Metin bileşeni
360
+
361
+ ## Lisans
362
+
363
+ MIT