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

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,337 @@
1
+ # AtomicCard
2
+
3
+ AtomicCard, React Native için basit ve özelleştirilebilir bir kart container bileşenidir. Material Design 3 prensiplerine uygun olarak tasarlanmıştır.
4
+
5
+ ## Özellikler
6
+
7
+ - 🎨 **3 Variant**: Elevated, Outlined, Filled
8
+ - 📦 **4 Padding Seçeneği**: None, Small, Medium, Large
9
+ - 👆 **Pressable**: Tıklanabilir kart desteği
10
+ - 🎯 **Flexible**: İçerik için esnek yapı
11
+ - ♿ **Erişilebilir**: Tam erişilebilirlik desteği
12
+
13
+ ## Kurulum
14
+
15
+ ```tsx
16
+ import { AtomicCard } from 'react-native-design-system';
17
+ ```
18
+
19
+ ## Temel Kullanım
20
+
21
+ ```tsx
22
+ import React from 'react';
23
+ import { View, Text } from 'react-native';
24
+ import { AtomicCard } from 'react-native-design-system';
25
+
26
+ export const BasicExample = () => {
27
+ return (
28
+ <View style={{ padding: 16 }}>
29
+ <AtomicCard>
30
+ <Text>Bu bir kart içeriği</Text>
31
+ </AtomicCard>
32
+ </View>
33
+ );
34
+ };
35
+ ```
36
+
37
+ ## Variant'lar
38
+
39
+ ```tsx
40
+ <View style={{ gap: 16 }}>
41
+ {/* Elevated (Varsayılan) */}
42
+ <AtomicCard variant="elevated">
43
+ <Text>Elevated Card - Gölge efekti</Text>
44
+ </AtomicCard>
45
+
46
+ {/* Outlined */}
47
+ <AtomicCard variant="outlined">
48
+ <Text>Outlined Card - Çerçeve efekti</Text>
49
+ </AtomicCard>
50
+
51
+ {/* Filled */}
52
+ <AtomicCard variant="filled">
53
+ <Text>Filled Card - Dolgu efekti</Text>
54
+ </AtomicCard>
55
+ </View>
56
+ ```
57
+
58
+ ## Padding Seçenekleri
59
+
60
+ ```tsx
61
+ <View style={{ gap: 16 }}>
62
+ {/* No Padding */}
63
+ <AtomicCard padding="none">
64
+ <Text>Padding yok</Text>
65
+ </AtomicCard>
66
+
67
+ {/* Small */}
68
+ <AtomicCard padding="sm">
69
+ <Text>Small padding</Text>
70
+ </AtomicCard>
71
+
72
+ {/* Medium (Varsayılan) */}
73
+ <AtomicCard padding="md">
74
+ <Text>Medium padding</Text>
75
+ </AtomicCard>
76
+
77
+ {/* Large */}
78
+ <AtomicCard padding="lg">
79
+ <Text>Large padding</Text>
80
+ </AtomicCard>
81
+ </View>
82
+ ```
83
+
84
+ ## Pressable Card
85
+
86
+ ```tsx
87
+ <AtomicCard
88
+ onPress={() => console.log('Kart tıklandı!')}
89
+ padding="md"
90
+ >
91
+ <Text>Tıklanabilir Kart</Text>
92
+ <Text>Tıklamayı dene</Text>
93
+ </AtomicCard>
94
+ ```
95
+
96
+ ## Örnek Kullanımlar
97
+
98
+ ### Profil Kartı
99
+
100
+ ```tsx
101
+ <AtomicCard variant="elevated" padding="md">
102
+ <View style={{ alignItems: 'center' }}>
103
+ <Text style={{ fontSize: 20, fontWeight: 'bold' }}>Ahmet Yılmaz</Text>
104
+ <Text style={{ color: 'gray' }}>Frontend Developer</Text>
105
+ </View>
106
+ </AtomicCard>
107
+ ```
108
+
109
+ ### Ürün Kartı
110
+
111
+ ```tsx
112
+ <AtomicCard
113
+ variant="outlined"
114
+ padding="md"
115
+ onPress={() => navigate('ProductDetail')}
116
+ >
117
+ <Text style={{ fontSize: 16, fontWeight: '600' }}>Ürün Adı</Text>
118
+ <Text style={{ marginTop: 8 }}>Ürün açıklaması</Text>
119
+ <Text style={{ marginTop: 16, fontSize: 18, fontWeight: 'bold' }}>$99.99</Text>
120
+ </AtomicCard>
121
+ ```
122
+
123
+ ### Bilgi Kartı
124
+
125
+ ```tsx
126
+ <AtomicCard variant="filled" padding="lg">
127
+ <Text style={{ fontSize: 18, fontWeight: 'bold', marginBottom: 8 }}>
128
+ Önemli Bilgi
129
+ </Text>
130
+ <Text style={{ lineHeight: 22 }}>
131
+ Bu kart önemli bilgileri içermektedir.
132
+ Lütfen dikkatlice okuyunuz.
133
+ </Text>
134
+ </AtomicCard>
135
+ ```
136
+
137
+ ### Liste Elemanı
138
+
139
+ ```tsx
140
+ {items.map((item) => (
141
+ <AtomicCard
142
+ key={item.id}
143
+ variant="outlined"
144
+ padding="sm"
145
+ onPress={() => handleItemPress(item)}
146
+ style={{ marginBottom: 12 }}
147
+ >
148
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
149
+ <Text>{item.title}</Text>
150
+ <Text>{item.date}</Text>
151
+ </View>
152
+ </AtomicCard>
153
+ ))}
154
+ ```
155
+
156
+ ## Props
157
+
158
+ ### AtomicCardProps
159
+
160
+ | Prop | Tip | Varsayılan | Açıklama |
161
+ |------|-----|------------|----------|
162
+ | `children` | `ReactNode` | - **(Zorunlu)** | Kart içeriği |
163
+ | `variant` | `AtomicCardVariant` | `'elevated'` | Kart görünüm stili |
164
+ | `padding` | `AtomicCardPadding` | `'md'` | İç boşluk miktarı |
165
+ | `onPress` | `(event: GestureResponderEvent) => void` | - | Tıklama olayı |
166
+ | `disabled` | `boolean` | `false` | Devre dışı |
167
+ | `style` | `StyleProp<ViewStyle>` | - | Özel stil |
168
+ | `testID` | `string` | - | Test ID'si |
169
+
170
+ ### AtomicCardVariant
171
+
172
+ ```typescript
173
+ type AtomicCardVariant =
174
+ | 'elevated' // Gölge efekti (varsayılan)
175
+ | 'outlined' // Çerçeve efekti
176
+ | 'filled'; // Dolgu efekti
177
+ ```
178
+
179
+ ### AtomicCardPadding
180
+
181
+ ```typescript
182
+ type AtomicCardPadding =
183
+ | 'none' // İç boşluk yok
184
+ | 'sm' // Küçük iç boşluk
185
+ | 'md' // Orta iç boşluk (varsayılan)
186
+ | 'lg'; // Büyük iç boşluk
187
+ ```
188
+
189
+ ## Stil Özelleştirme
190
+
191
+ ```tsx
192
+ <AtomicCard
193
+ variant="elevated"
194
+ padding="md"
195
+ style={{
196
+ backgroundColor: '#f8f9fa',
197
+ borderRadius: 16,
198
+ borderWidth: 2,
199
+ borderColor: '#e9ecef',
200
+ shadowColor: '#000',
201
+ shadowOffset: { width: 0, height: 2 },
202
+ shadowOpacity: 0.1,
203
+ shadowRadius: 4,
204
+ elevation: 3,
205
+ }}
206
+ >
207
+ <Text>Özel Stilli Kart</Text>
208
+ </AtomicCard>
209
+ ```
210
+
211
+ ## Best Practices
212
+
213
+ ### 1. Variant Seçimi
214
+
215
+ ```tsx
216
+ // Ana içerik için elevated
217
+ <AtomicCard variant="elevated">
218
+ <ImportantContent />
219
+ </AtomicCard>
220
+
221
+ // Liste elemanları için outlined
222
+ <FlatList
223
+ data={items}
224
+ renderItem={({ item }) => (
225
+ <AtomicCard variant="outlined" padding="sm">
226
+ {item.content}
227
+ </AtomicCard>
228
+ )}
229
+ />
230
+
231
+ // Arka plan için filled
232
+ <AtomicCard variant="filled">
233
+ <BackgroundContent />
234
+ </AtomicCard>
235
+ ```
236
+
237
+ ### 2. Padding Kullanımı
238
+
239
+ ```tsx
240
+ // Yoğun içerik için az padding
241
+ <AtomicCard padding="sm">
242
+ <DenseContent />
243
+ </AtomicCard>
244
+
245
+ // Boş içerik için fazla padding
246
+ <AtomicCard padding="lg">
247
+ <SparseContent />
248
+ </AtomicCard>
249
+ ```
250
+
251
+ ### 3. Pressable Kullanım
252
+
253
+ ```tsx
254
+ // Tıklanabilir öğeler
255
+ <AtomicCard
256
+ onPress={handlePress}
257
+ style={{ marginBottom: 8 }}
258
+ >
259
+ <CardHeader />
260
+ <CardContent />
261
+ <CardFooter />
262
+ </AtomicCard>
263
+ ```
264
+
265
+ ## Erişilebilirlik
266
+
267
+ AtomicCard, tam erişilebilirlik desteği sunar:
268
+
269
+ - ✅ Touch uygun boyut
270
+ - ✅ Screen reader desteği
271
+ - ✅ Disabled state anonsu
272
+ - ✅ Test ID desteği
273
+
274
+ ## Performans İpuçları
275
+
276
+ 1. **FlatList ile Kullanım**: Listelerde `key` prop'unu kullanın
277
+ 2. **Inline Styles**: Mümkün olduğunca theme kullanın
278
+ 3. **Re-renders**: Kart içeriğini `React.memo` ile sarın
279
+
280
+ ## İlgili Bileşenler
281
+
282
+ - [`MediaCard`](../../molecules/media-card/README.md) - Medya kartı
283
+ - [`GlowingCard`](../../molecules/GlowingCard/README.md) - Parlak kart
284
+ - [`FormField`](../../molecules/FormField/README.md) - Form alanı
285
+
286
+ ## Örnek Proje
287
+
288
+ ```tsx
289
+ import React from 'react';
290
+ import { View, ScrollView, Text, Image } from 'react-native';
291
+ import { AtomicCard } from 'react-native-design-system';
292
+
293
+ export const CardGallery = () => {
294
+ return (
295
+ <ScrollView style={{ padding: 16 }}>
296
+ {/* Basit Kart */}
297
+ <AtomicCard variant="elevated" padding="md" style={{ marginBottom: 16 }}>
298
+ <Text style={{ fontSize: 18, fontWeight: 'bold' }}>
299
+ Basit Kart
300
+ </Text>
301
+ <Text style={{ marginTop: 8 }}>
302
+ Bu basit bir kart örneğidir.
303
+ </Text>
304
+ </AtomicCard>
305
+
306
+ {/* Tıklanabilir Kart */}
307
+ <AtomicCard
308
+ variant="outlined"
309
+ padding="md"
310
+ onPress={() => console.log('Tıklandı!')}
311
+ style={{ marginBottom: 16 }}
312
+ >
313
+ <Text style={{ fontSize: 18, fontWeight: 'bold' }}>
314
+ Tıklanabilir Kart
315
+ </Text>
316
+ <Text style={{ marginTop: 8, color: '#6366f1' }}>
317
+ Tıkla ve gör
318
+ </Text>
319
+ </AtomicCard>
320
+
321
+ {/* Filled Kart */}
322
+ <AtomicCard variant="filled" padding="lg" style={{ marginBottom: 16 }}>
323
+ <Text style={{ fontSize: 18, fontWeight: 'bold' }}>
324
+ Filled Kart
325
+ </Text>
326
+ <Text style={{ marginTop: 8, lineHeight: 22 }}>
327
+ Bu kartın dolgu efekti vardır.
328
+ </Text>
329
+ </AtomicCard>
330
+ </ScrollView>
331
+ );
332
+ };
333
+ ```
334
+
335
+ ## Lisans
336
+
337
+ MIT