@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,402 @@
1
+ # ListItem
2
+
3
+ ListItem, liste elemanlarını göstermek için basit ve özelleştirilebilir bir molekül bileşenidir.
4
+
5
+ ## Özellikler
6
+
7
+ - 📝 **Title & Subtitle**: Ana başlık ve alt başlık desteği
8
+ - 🎭 **İkon Desteği**: Sol ve sağ ikonlar
9
+ - 👆 **Pressable**: Tıklanabilir öğeler
10
+ - ♿ **Erişilebilir**: Tam erişilebilirlik desteği
11
+ - 🎨 **Tema Bilinci**: Otomatik tema uyumu
12
+
13
+ ## Kurulum
14
+
15
+ ```tsx
16
+ import { ListItem } from 'react-native-design-system';
17
+ ```
18
+
19
+ ## Temel Kullanım
20
+
21
+ ```tsx
22
+ import React from 'react';
23
+ import { View } from 'react-native';
24
+ import { ListItem } from 'react-native-design-system';
25
+
26
+ export const BasicExample = () => {
27
+ return (
28
+ <View>
29
+ <ListItem
30
+ title="Başlık"
31
+ subtitle="Alt başlık"
32
+ />
33
+ </View>
34
+ );
35
+ };
36
+ ```
37
+
38
+ ## Basic Item
39
+
40
+ ```tsx
41
+ <ListItem
42
+ title="Öğe Başlığı"
43
+ />
44
+ ```
45
+
46
+ ## Subtitle ile
47
+
48
+ ```tsx
49
+ <ListItem
50
+ title="Başlık"
51
+ subtitle="Bu bir alt başlıktır"
52
+ />
53
+ ```
54
+
55
+ ## İkonlu
56
+
57
+ ```tsx
58
+ <ListItem
59
+ title="Ayarlar"
60
+ subtitle="Uygulama ayarlarını yönetin"
61
+ leftIcon="settings-outline"
62
+ rightIcon="chevron-forward"
63
+ onPress={() => console.log('Ayarlar')}
64
+ />
65
+ ```
66
+
67
+ ## Pressable
68
+
69
+ ```tsx
70
+ <ListItem
71
+ title="Profil"
72
+ subtitle="Profil bilgilerinizi görüntüleyin"
73
+ leftIcon="person-outline"
74
+ rightIcon="chevron-forward"
75
+ onPress={() => navigation.navigate('Profile')}
76
+ />
77
+ ```
78
+
79
+ ## Disabled
80
+
81
+ ```tsx
82
+ <ListItem
83
+ title="Devre Dışı Öğe"
84
+ subtitle="Bu öğe tıklanamaz"
85
+ leftIcon="lock-closed-outline"
86
+ disabled
87
+ />
88
+ ```
89
+
90
+ ## Örnek Kullanımlar
91
+
92
+ ### Ayarlar Listesi
93
+
94
+ ```tsx
95
+ export const SettingsList = () => {
96
+ const settings = [
97
+ {
98
+ id: '1',
99
+ title: 'Profil',
100
+ subtitle: 'Profil bilgilerinizi yönetin',
101
+ icon: 'person-outline',
102
+ onPress: () => navigation.navigate('Profile'),
103
+ },
104
+ {
105
+ id: '2',
106
+ title: 'Bildirimler',
107
+ subtitle: 'Bildirim tercihlerinizi ayarlayın',
108
+ icon: 'notifications-outline',
109
+ onPress: () => navigation.navigate('Notifications'),
110
+ },
111
+ {
112
+ id: '3',
113
+ title: 'Gizlilik',
114
+ subtitle: 'Gizlilik ayarlarınızı yönetin',
115
+ icon: 'lock-closed-outline',
116
+ onPress: () => navigation.navigate('Privacy'),
117
+ },
118
+ ];
119
+
120
+ return (
121
+ <View>
122
+ {settings.map((setting) => (
123
+ <ListItem
124
+ key={setting.id}
125
+ title={setting.title}
126
+ subtitle={setting.subtitle}
127
+ leftIcon={setting.icon}
128
+ rightIcon="chevron-forward"
129
+ onPress={setting.onPress}
130
+ />
131
+ ))}
132
+ </View>
133
+ );
134
+ };
135
+ ```
136
+
137
+ ### Menü Listesi
138
+
139
+ ```tsx
140
+ export const MenuList = () => {
141
+ return (
142
+ <View>
143
+ <ListItem
144
+ title="Ana Sayfa"
145
+ leftIcon="home-outline"
146
+ onPress={() => navigation.navigate('Home')}
147
+ />
148
+
149
+ <ListItem
150
+ title="Arama"
151
+ leftIcon="search-outline"
152
+ onPress={() => navigation.navigate('Search')}
153
+ />
154
+
155
+ <ListItem
156
+ title="Profilim"
157
+ leftIcon="person-outline"
158
+ onPress={() => navigation.navigate('Profile')}
159
+ />
160
+
161
+ <ListItem
162
+ title="Ayarlar"
163
+ leftIcon="settings-outline"
164
+ onPress={() => navigation.navigate('Settings')}
165
+ />
166
+ </View>
167
+ );
168
+ };
169
+ ```
170
+
171
+ ### Kullanıcı Listesi
172
+
173
+ ```tsx
174
+ export const UserList = ({ users }) => {
175
+ return (
176
+ <FlatList
177
+ data={users}
178
+ keyExtractor={(item) => item.id}
179
+ renderItem={({ item }) => (
180
+ <ListItem
181
+ title={item.name}
182
+ subtitle={item.email}
183
+ leftIcon="person-outline"
184
+ onPress={() => navigation.navigate('UserDetail', { userId: item.id })}
185
+ />
186
+ )}
187
+ />
188
+ );
189
+ };
190
+ ```
191
+
192
+ ### Seçim Listesi
193
+
194
+ ```tsx
195
+ export const SelectionList = ({ options, selectedOption, onSelect }) => {
196
+ return (
197
+ <View>
198
+ {options.map((option) => (
199
+ <ListItem
200
+ key={option.id}
201
+ title={option.title}
202
+ subtitle={option.description}
203
+ leftIcon={selectedOption === option.id ? 'checkmark-circle' : 'ellipse-outline'}
204
+ onPress={() => onSelect(option.id)}
205
+ />
206
+ ))}
207
+ </View>
208
+ );
209
+ };
210
+ ```
211
+
212
+ ### Navigasyon Listesi
213
+
214
+ ```tsx
215
+ export const NavigationList = () => {
216
+ const routes = [
217
+ { id: '1', title: 'Dashboard', icon: 'grid-outline', screen: 'Dashboard' },
218
+ { id: '2', title: 'Products', icon: 'cube-outline', screen: 'Products' },
219
+ { id: '3', title: 'Orders', icon: 'cart-outline', screen: 'Orders' },
220
+ { id: '4', title: 'Customers', icon: 'people-outline', screen: 'Customers' },
221
+ ];
222
+
223
+ return (
224
+ <View>
225
+ {routes.map((route) => (
226
+ <ListItem
227
+ key={route.id}
228
+ title={route.title}
229
+ leftIcon={route.icon}
230
+ rightIcon="chevron-forward"
231
+ onPress={() => navigation.navigate(route.screen)}
232
+ />
233
+ ))}
234
+ </View>
235
+ );
236
+ };
237
+ ```
238
+
239
+ ### Action Listesi
240
+
241
+ ```tsx
242
+ export const ActionList = () => {
243
+ return (
244
+ <View>
245
+ <ListItem
246
+ title="Yeni Ekle"
247
+ subtitle="Yeni bir öğe oluşturun"
248
+ leftIcon="add-circle-outline"
249
+ onPress={() => console.log('Add')}
250
+ />
251
+
252
+ <ListItem
253
+ title="Düzenle"
254
+ subtitle="Öğeyi düzenleyin"
255
+ leftIcon="create-outline"
256
+ onPress={() => console.log('Edit')}
257
+ />
258
+
259
+ <ListItem
260
+ title="Sil"
261
+ subtitle="Öğeyi silin"
262
+ leftIcon="trash-outline"
263
+ onPress={() => console.log('Delete')}
264
+ />
265
+
266
+ <ListItem
267
+ title="Paylaş"
268
+ subtitle="Öğeyi paylaşın"
269
+ leftIcon="share-outline"
270
+ onPress={() => console.log('Share')}
271
+ />
272
+ </View>
273
+ );
274
+ };
275
+ ```
276
+
277
+ ### Bağlantı Listesi
278
+
279
+ ```tsx
280
+ export const LinkList = ({ links }) => {
281
+ return (
282
+ <View>
283
+ <ListItem
284
+ title="Web Sitesi"
285
+ subtitle="www.example.com"
286
+ leftIcon="globe-outline"
287
+ rightIcon="open-outline"
288
+ onPress={() => Linking.openURL('https://www.example.com')}
289
+ />
290
+
291
+ <ListItem
292
+ title="Twitter"
293
+ subtitle="@example"
294
+ leftIcon="logo-twitter"
295
+ rightIcon="open-outline"
296
+ onPress={() => Linking.openURL('https://twitter.com/example')}
297
+ />
298
+
299
+ <ListItem
300
+ title="GitHub"
301
+ subtitle="github.com/example"
302
+ leftIcon="logo-github"
303
+ rightIcon="open-outline"
304
+ onPress={() => Linking.openURL('https://github.com/example')}
305
+ />
306
+ </View>
307
+ );
308
+ };
309
+ ```
310
+
311
+ ## Props
312
+
313
+ ### ListItemProps
314
+
315
+ | Prop | Tip | Varsayılan | Açıklama |
316
+ |------|-----|------------|----------|
317
+ | `title` | `string` | - **(Zorunlu)** | Başlık metni |
318
+ | `subtitle` | `string` | - | Alt başlık metni |
319
+ | `leftIcon` | `string` | - | Sol ikon ismi |
320
+ | `rightIcon` | `string` | - | Sağ ikon ismi |
321
+ | `onPress` | `() => void` | - | Tıklama olayı |
322
+ | `disabled` | `boolean` | `false` | Devre dışı |
323
+ | `style` | `ViewStyle` | - | Özel stil |
324
+ | `testID` | `string` | - | Test ID'si |
325
+
326
+ ## Best Practices
327
+
328
+ ### 1. İkon Seçimi
329
+
330
+ ```tsx
331
+ // Navigasyon için
332
+ <ListItem
333
+ leftIcon="chevron-forward"
334
+ rightIcon="chevron-back"
335
+ />
336
+
337
+ // Aksiyon için
338
+ <ListItem
339
+ leftIcon="add-circle"
340
+ />
341
+
342
+ // Bilgi için
343
+ <ListItem
344
+ leftIcon="information-circle"
345
+ />
346
+ ```
347
+
348
+ ### 2. Subtitle Kullanımı
349
+
350
+ ```tsx
351
+ // Açıklama için
352
+ <ListItem
353
+ title="Başlık"
354
+ subtitle="Detaylı açıklama"
355
+ />
356
+
357
+ // Ek bilgi için
358
+ <ListItem
359
+ title="Kullanıcı Adı"
360
+ subtitle="@username"
361
+ />
362
+ ```
363
+
364
+ ### 3. Pressable Kullanımı
365
+
366
+ ```tsx
367
+ // Navigasyon
368
+ <ListItem
369
+ onPress={() => navigation.navigate('Screen')}
370
+ />
371
+
372
+ // Aksiyon
373
+ <ListItem
374
+ onPress={() => handleAction()}
375
+ />
376
+ ```
377
+
378
+ ## Erişilebilirlik
379
+
380
+ ListItem, tam erişilebilirlik desteği sunar:
381
+
382
+ - ✅ Touch uygun boyut
383
+ - ✅ Screen reader desteği
384
+ - ✅ Disabled state
385
+ - ✅ Active opacity
386
+ - ✅ Test ID desteği
387
+
388
+ ## Performans İpuçları
389
+
390
+ 1. **FlatList ile**: Uzun listelerde `FlatList` kullanın
391
+ 2. **Key Prop**: `key` prop'unu unutmayın
392
+ 3. **OnPress Stabilization**: `onPress`'i `useCallback` ile sarın
393
+
394
+ ## İlgili Bileşenler
395
+
396
+ - [`List`](../List/README.md) - Liste bileşeni
397
+ - [`AtomicIcon`](../atoms/AtomicIcon/README.md) - İkon bileşeni
398
+ - [`AtomicText`](../atoms/AtomicText/README.md) - Metin bileşeni
399
+
400
+ ## Lisans
401
+
402
+ MIT