@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.
- package/package.json +1 -6
- package/src/atoms/AtomicAvatar.README.md +483 -0
- package/src/atoms/AtomicBadge.README.md +423 -0
- package/src/atoms/AtomicDatePicker.README.md +399 -0
- package/src/atoms/AtomicFab.README.md +421 -0
- package/src/atoms/AtomicProgress.README.md +402 -0
- package/src/atoms/AtomicSpinner.README.md +433 -0
- package/src/atoms/AtomicText.README.md +470 -0
- package/src/atoms/AtomicTextArea.README.md +352 -0
- package/src/atoms/EmptyState.README.md +372 -0
- package/src/atoms/skeleton/AtomicSkeleton.README.md +339 -0
- package/src/molecules/ConfirmationModal.README.md +370 -0
- package/src/molecules/Divider/README.md +470 -0
- package/src/molecules/ListItem.README.md +402 -0
- package/src/molecules/StepHeader/README.md +487 -0
- package/src/molecules/alerts/README.md +471 -0
- package/src/molecules/avatar/README.md +431 -0
- package/src/molecules/bottom-sheet/README.md +413 -0
- package/src/molecules/calendar/README.md +339 -0
- package/src/molecules/countdown/README.md +558 -0
- package/src/molecules/media-card/README.md +384 -0
- package/src/molecules/navigation/README.md +377 -0
- package/src/molecules/splash/README.md +474 -0
- package/src/molecules/splash/components/SplashScreen.tsx +0 -14
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
# AtomicSkeleton
|
|
2
|
+
|
|
3
|
+
AtomicSkeleton, içerik yüklenirken gösterilen placeholder bileşenidir. Farklı pattern'ler ile liste, kart veya custom skeleton yüklemeleri sağlar.
|
|
4
|
+
|
|
5
|
+
## Özellikler
|
|
6
|
+
|
|
7
|
+
- 📋 **Pattern'ler**: List, Card, Avatar, Text, Custom
|
|
8
|
+
- 🔢 **Çoklu Render**: Count parametresi ile tekrar
|
|
9
|
+
- 🎨 **Tema Bilinci**: Otomatik renk uyumu
|
|
10
|
+
- ⚙️ **Özelleştirilebilir**: Custom skeleton yapılandırması
|
|
11
|
+
- ♿ **Erişilebilir**: Screen reader için gizli
|
|
12
|
+
|
|
13
|
+
## Kurulum
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { AtomicSkeleton } 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 { AtomicSkeleton } from 'react-native-design-system';
|
|
25
|
+
|
|
26
|
+
export const BasicExample = () => {
|
|
27
|
+
return (
|
|
28
|
+
<View style={{ padding: 16 }}>
|
|
29
|
+
<AtomicSkeleton pattern="list" count={3} />
|
|
30
|
+
</View>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## List Pattern
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
{/* 3 liste öğesi */}
|
|
39
|
+
<AtomicSkeleton pattern="list" count={3} />
|
|
40
|
+
|
|
41
|
+
{/* 5 liste öğesi */}
|
|
42
|
+
<AtomicSkeleton pattern="list" count={5} />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Card Pattern
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
{/* 1 kart */}
|
|
49
|
+
<AtomicSkeleton pattern="card" />
|
|
50
|
+
|
|
51
|
+
{/* 3 kart */}
|
|
52
|
+
<AtomicSkeleton pattern="card" count={3} />
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Avatar Pattern
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<AtomicSkeleton pattern="avatar" count={5} />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Text Pattern
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<AtomicSkeleton pattern="text" count={3} />
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Custom Pattern
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
<AtomicSkeleton
|
|
71
|
+
pattern="custom"
|
|
72
|
+
custom={[
|
|
73
|
+
{ width: '100%', height: 200, borderRadius: 12 },
|
|
74
|
+
{ width: '80%', height: 20, borderRadius: 4, marginBottom: 12 },
|
|
75
|
+
{ width: '60%', height: 20, borderRadius: 4 },
|
|
76
|
+
]}
|
|
77
|
+
/>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Örnek Kullanımlar
|
|
81
|
+
|
|
82
|
+
### Liste Yükleniyor
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
export const ListSkeleton = () => {
|
|
86
|
+
return (
|
|
87
|
+
<View style={{ padding: 16 }}>
|
|
88
|
+
<AtomicSkeleton pattern="list" count={5} />
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Kart Yükleniyor
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
export const CardSkeleton = () => {
|
|
98
|
+
return (
|
|
99
|
+
<View style={{ padding: 16 }}>
|
|
100
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 16 }}>
|
|
101
|
+
<AtomicSkeleton pattern="card" count={6} />
|
|
102
|
+
</View>
|
|
103
|
+
</View>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Profil Yükleniyor
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
export const ProfileSkeleton = () => {
|
|
112
|
+
return (
|
|
113
|
+
<View style={{ padding: 16, alignItems: 'center' }}>
|
|
114
|
+
<AtomicSkeleton
|
|
115
|
+
pattern="custom"
|
|
116
|
+
custom={[
|
|
117
|
+
{ width: 120, height: 120, borderRadius: 60, marginBottom: 16 },
|
|
118
|
+
{ width: 200, height: 24, borderRadius: 4, marginBottom: 8 },
|
|
119
|
+
{ width: 150, height: 16, borderRadius: 4 },
|
|
120
|
+
]}
|
|
121
|
+
/>
|
|
122
|
+
</View>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Detay Yükleniyor
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
export const DetailSkeleton = () => {
|
|
131
|
+
return (
|
|
132
|
+
<View style={{ padding: 16 }}>
|
|
133
|
+
<AtomicSkeleton
|
|
134
|
+
pattern="custom"
|
|
135
|
+
custom={[
|
|
136
|
+
{ width: '100%', height: 200, borderRadius: 12, marginBottom: 16 },
|
|
137
|
+
{ width: '60%', height: 28, borderRadius: 4, marginBottom: 12 },
|
|
138
|
+
{ width: '100%', height: 16, borderRadius: 4, marginBottom: 8 },
|
|
139
|
+
{ width: '100%', height: 16, borderRadius: 4, marginBottom: 8 },
|
|
140
|
+
{ width: '80%', height: 16, borderRadius: 4, marginBottom: 24 },
|
|
141
|
+
{ width: 120, height: 40, borderRadius: 8 },
|
|
142
|
+
]}
|
|
143
|
+
/>
|
|
144
|
+
</View>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Feed Yükleniyor
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
export const FeedSkeleton = () => {
|
|
153
|
+
return (
|
|
154
|
+
<View style={{ padding: 16 }}>
|
|
155
|
+
{Array.from({ length: 3 }).map((_, index) => (
|
|
156
|
+
<View key={index} style={{ marginBottom: 24 }}>
|
|
157
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 12 }}>
|
|
158
|
+
<View style={{ width: 40, height: 40, borderRadius: 20, backgroundColor: '#e0e0e0', marginRight: 12 }} />
|
|
159
|
+
<View>
|
|
160
|
+
<View style={{ width: 120, height: 16, borderRadius: 4, marginBottom: 4, backgroundColor: '#e0e0e0' }} />
|
|
161
|
+
<View style={{ width: 80, height: 12, borderRadius: 4, backgroundColor: '#f0f0f0' }} />
|
|
162
|
+
</View>
|
|
163
|
+
</View>
|
|
164
|
+
<View style={{ width: '100%', height: 200, borderRadius: 12, marginBottom: 12, backgroundColor: '#e0e0e0' }} />
|
|
165
|
+
<View style={{ width: '100%', height: 16, borderRadius: 4, marginBottom: 8, backgroundColor: '#e0e0e0' }} />
|
|
166
|
+
<View style={{ width: '80%', height: 16, borderRadius: 4, backgroundColor: '#f0f0f0' }} />
|
|
167
|
+
</View>
|
|
168
|
+
))}
|
|
169
|
+
</View>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Tablo Yükleniyor
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
export const TableSkeleton = ({ rows = 5 }) => {
|
|
178
|
+
return (
|
|
179
|
+
<View style={{ padding: 16 }}>
|
|
180
|
+
{/* Başlık */}
|
|
181
|
+
<View style={{ flexDirection: 'row', marginBottom: 12 }}>
|
|
182
|
+
{[1, 2, 3, 4].map((_, index) => (
|
|
183
|
+
<View key={index} style={{ flex: 1, marginRight: 8 }}>
|
|
184
|
+
<View style={{ width: '100%', height: 20, borderRadius: 4, backgroundColor: '#e0e0e0' }} />
|
|
185
|
+
</View>
|
|
186
|
+
))}
|
|
187
|
+
</View>
|
|
188
|
+
|
|
189
|
+
{/* Satırlar */}
|
|
190
|
+
{Array.from({ length: rows }).map((_, rowIndex) => (
|
|
191
|
+
<View key={rowIndex} style={{ flexDirection: 'row', marginBottom: 8 }}>
|
|
192
|
+
{[1, 2, 3, 4].map((_, colIndex) => (
|
|
193
|
+
<View key={colIndex} style={{ flex: 1, marginRight: 8 }}>
|
|
194
|
+
<View style={{ width: '100%', height: 16, borderRadius: 4, backgroundColor: '#f0f0f0' }} />
|
|
195
|
+
</View>
|
|
196
|
+
))}
|
|
197
|
+
</View>
|
|
198
|
+
))}
|
|
199
|
+
</View>
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Arama Sonucu Yükleniyor
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
export const SearchResultsSkeleton = () => {
|
|
208
|
+
return (
|
|
209
|
+
<View style={{ padding: 16 }}>
|
|
210
|
+
<AtomicSkeleton pattern="list" count={3} />
|
|
211
|
+
|
|
212
|
+
<View style={{ alignItems: 'center', marginTop: 24 }}>
|
|
213
|
+
<AtomicSkeleton
|
|
214
|
+
pattern="custom"
|
|
215
|
+
custom={[
|
|
216
|
+
{ width: 80, height: 16, borderRadius: 4, marginBottom: 8 },
|
|
217
|
+
{ width: 120, height: 12, borderRadius: 4 },
|
|
218
|
+
]}
|
|
219
|
+
/>
|
|
220
|
+
</View>
|
|
221
|
+
</View>
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Form Yükleniyor
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
export const FormSkeleton = () => {
|
|
230
|
+
return (
|
|
231
|
+
<View style={{ padding: 16 }}>
|
|
232
|
+
{Array.from({ length: 4 }).map((_, index) => (
|
|
233
|
+
<View key={index} style={{ marginBottom: 24 }}>
|
|
234
|
+
<View style={{ width: 100, height: 16, borderRadius: 4, marginBottom: 8, backgroundColor: '#e0e0e0' }} />
|
|
235
|
+
<View style={{ width: '100%', height: 48, borderRadius: 8, backgroundColor: '#f0f0f0' }} />
|
|
236
|
+
</View>
|
|
237
|
+
))}
|
|
238
|
+
|
|
239
|
+
<View style={{ width: 120, height: 48, borderRadius: 8, backgroundColor: '#e0e0e0' }} />
|
|
240
|
+
</View>
|
|
241
|
+
);
|
|
242
|
+
};
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Props
|
|
246
|
+
|
|
247
|
+
### AtomicSkeletonProps
|
|
248
|
+
|
|
249
|
+
| Prop | Tip | Varsayılan | Açıklama |
|
|
250
|
+
|------|-----|------------|----------|
|
|
251
|
+
| `pattern` | `SkeletonPattern` | `'list'` | Skeleton pattern'i |
|
|
252
|
+
| `custom` | `SkeletonConfig[]` | - | Custom yapılandırma |
|
|
253
|
+
| `count` | `number` | `1` | Skeleton sayısı |
|
|
254
|
+
| `style` | `StyleProp<ViewStyle>` | - | Özel stil |
|
|
255
|
+
| `testID` | `string` | - | Test ID'si |
|
|
256
|
+
|
|
257
|
+
### SkeletonPattern
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
type SkeletonPattern =
|
|
261
|
+
| 'list' // Liste öğesi
|
|
262
|
+
| 'card' // Kart
|
|
263
|
+
| 'avatar' // Avatar
|
|
264
|
+
| 'text' // Metin
|
|
265
|
+
| 'custom'; // Özel
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### SkeletonConfig
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
interface SkeletonConfig {
|
|
272
|
+
width: number | string; // Genişlik
|
|
273
|
+
height?: number; // Yükseklik
|
|
274
|
+
borderRadius?: number; // Köşe yarıçapı
|
|
275
|
+
marginBottom?: number; // Alt boşluk
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Best Practices
|
|
280
|
+
|
|
281
|
+
### 1. Pattern Seçimi
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
// Liste için
|
|
285
|
+
<AtomicSkeleton pattern="list" />
|
|
286
|
+
|
|
287
|
+
// Kart için
|
|
288
|
+
<AtomicSkeleton pattern="card" />
|
|
289
|
+
|
|
290
|
+
// Avatar için
|
|
291
|
+
<AtomicSkeleton pattern="avatar" />
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### 2. Count Kullanımı
|
|
295
|
+
|
|
296
|
+
```tsx
|
|
297
|
+
// Uzun liste
|
|
298
|
+
<AtomicSkeleton pattern="list" count={10} />
|
|
299
|
+
|
|
300
|
+
// Kısa liste
|
|
301
|
+
<AtomicSkeleton pattern="list" count={3} />
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### 3. Custom Skeleton
|
|
305
|
+
|
|
306
|
+
```tsx
|
|
307
|
+
// Özel tasarım
|
|
308
|
+
<AtomicSkeleton
|
|
309
|
+
pattern="custom"
|
|
310
|
+
custom={[
|
|
311
|
+
{ width: '100%', height: 200, borderRadius: 12 },
|
|
312
|
+
{ width: '80%', height: 20, borderRadius: 4 },
|
|
313
|
+
]}
|
|
314
|
+
/>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Erişilebilirlik
|
|
318
|
+
|
|
319
|
+
AtomicSkeleton, tam erişilebilirlik desteği sunar:
|
|
320
|
+
|
|
321
|
+
- ✅ Screen reader'da gizli
|
|
322
|
+
- ✅ Loading state anonsu
|
|
323
|
+
- ✅ Accessibility özellikleri
|
|
324
|
+
|
|
325
|
+
## Performans İpuçları
|
|
326
|
+
|
|
327
|
+
1. **Minimal Count**: Gerektiği kadar skeleton gösterin
|
|
328
|
+
2. **Simple Patterns**: Basit pattern'ler daha performanslıdır
|
|
329
|
+
3. **Unload**: Veri geldiğinde skeleton'ı kaldırın
|
|
330
|
+
|
|
331
|
+
## İlgili Bileşenler
|
|
332
|
+
|
|
333
|
+
- [`AtomicSpinner`](../AtomicSpinner/README.md) - Spinner yükleniyor
|
|
334
|
+
- [`EmptyState`](../EmptyState/README.md) - Boş durum
|
|
335
|
+
- [`AtomicProgress`](../AtomicProgress/README.md) - İlerleme çubuğu
|
|
336
|
+
|
|
337
|
+
## Lisans
|
|
338
|
+
|
|
339
|
+
MIT
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
# ConfirmationModal
|
|
2
|
+
|
|
3
|
+
ConfirmationModal, kritik işlemlerden önce kullanıcı onayı almak için kullanılan modal bileşenidir. Silme, kaydetme veya önemli değişiklikler için idealdir.
|
|
4
|
+
|
|
5
|
+
## Özellikler
|
|
6
|
+
|
|
7
|
+
- ✅ **Onay Dialog'u**: Kritik işlemler için onay
|
|
8
|
+
- 🎨 **Variant'lar**: Default, Danger, Warning, Info
|
|
9
|
+
- 🎭 **İkon Desteği**: Görsel ikon gösterimi
|
|
10
|
+
- ⬛ **Backdrop**: Opsiyonel backdrop
|
|
11
|
+
- 🎯 **Customizable**: Buton metinleri ve stil
|
|
12
|
+
- ♿ **Erişilebilir**: Tam erişilebilirlik desteği
|
|
13
|
+
|
|
14
|
+
## Kurulum
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { ConfirmationModal } from 'react-native-design-system';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Temel Kullanım
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import React, { useState } from 'react';
|
|
24
|
+
import { View, Button } from 'react-native';
|
|
25
|
+
import { ConfirmationModal } from 'react-native-design-system';
|
|
26
|
+
|
|
27
|
+
export const BasicExample = () => {
|
|
28
|
+
const [visible, setVisible] = useState(false);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={{ flex: 1, justifyContent: 'center' }}>
|
|
32
|
+
<Button title="Modalı Aç" onPress={() => setVisible(true)} />
|
|
33
|
+
|
|
34
|
+
<ConfirmationModal
|
|
35
|
+
visible={visible}
|
|
36
|
+
title="Emin misiniz?"
|
|
37
|
+
message="Bu işlem geri alınamaz"
|
|
38
|
+
confirmText="Onayla"
|
|
39
|
+
cancelText="İptal"
|
|
40
|
+
onConfirm={() => {
|
|
41
|
+
console.log('Onaylandı');
|
|
42
|
+
setVisible(false);
|
|
43
|
+
}}
|
|
44
|
+
onCancel={() => setVisible(false)}
|
|
45
|
+
/>
|
|
46
|
+
</View>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Variant'lar
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
{/* Default (Info) */}
|
|
55
|
+
<ConfirmationModal
|
|
56
|
+
visible={visible}
|
|
57
|
+
variant="default"
|
|
58
|
+
title="Bilgilendirme"
|
|
59
|
+
message="Devam etmek istiyor musunuz?"
|
|
60
|
+
onConfirm={handleConfirm}
|
|
61
|
+
onCancel={handleCancel}
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
{/* Danger */}
|
|
65
|
+
<ConfirmationModal
|
|
66
|
+
visible={visible}
|
|
67
|
+
variant="danger"
|
|
68
|
+
title="Öğeyi Sil"
|
|
69
|
+
message="Bu öğeyi silmek istediğinizden emin misiniz?"
|
|
70
|
+
confirmText="Sil"
|
|
71
|
+
cancelText="İptal"
|
|
72
|
+
onConfirm={handleDelete}
|
|
73
|
+
onCancel={handleCancel}
|
|
74
|
+
/>
|
|
75
|
+
|
|
76
|
+
{/* Warning */}
|
|
77
|
+
<ConfirmationModal
|
|
78
|
+
visible={visible}
|
|
79
|
+
variant="warning"
|
|
80
|
+
title="Uyarı"
|
|
81
|
+
message="Bu işlem veri kaybına neden olabilir"
|
|
82
|
+
confirmText="Devam Et"
|
|
83
|
+
cancelText="Geri Dön"
|
|
84
|
+
onConfirm={handleProceed}
|
|
85
|
+
onCancel={handleCancel}
|
|
86
|
+
/>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## İkonlu
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
<ConfirmationModal
|
|
93
|
+
visible={visible}
|
|
94
|
+
variant="danger"
|
|
95
|
+
icon="warning"
|
|
96
|
+
title="Dikkat"
|
|
97
|
+
message="Bu işlem geri alınamaz"
|
|
98
|
+
onConfirm={handleConfirm}
|
|
99
|
+
onCancel={handleCancel}
|
|
100
|
+
/>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Backdrop Gizle
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<ConfirmationModal
|
|
107
|
+
visible={visible}
|
|
108
|
+
showBackdrop={false}
|
|
109
|
+
title="Modal"
|
|
110
|
+
message="Backdrop yok"
|
|
111
|
+
onConfirm={handleConfirm}
|
|
112
|
+
onCancel={handleCancel}
|
|
113
|
+
/>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Backdrop Dismissible Değil
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
<ConfirmationModal
|
|
120
|
+
visible={visible}
|
|
121
|
+
backdropDismissible={false}
|
|
122
|
+
title="Onay Gerekli"
|
|
123
|
+
message="Lütfen onaylayın"
|
|
124
|
+
onConfirm={handleConfirm}
|
|
125
|
+
onCancel={handleCancel}
|
|
126
|
+
/>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Örnek Kullanımlar
|
|
130
|
+
|
|
131
|
+
### Silme Onayı
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
export const DeleteConfirmation = ({ item, onDelete }) => {
|
|
135
|
+
const [visible, setVisible] = useState(false);
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
<>
|
|
139
|
+
<Button title="Sil" onPress={() => setVisible(true)} />
|
|
140
|
+
|
|
141
|
+
<ConfirmationModal
|
|
142
|
+
visible={visible}
|
|
143
|
+
variant="danger"
|
|
144
|
+
icon="trash-outline"
|
|
145
|
+
title="Öğeyi Sil"
|
|
146
|
+
message={`${item.title} öğesini silmek istediğinizden emin misiniz? Bu işlem geri alınamaz.`}
|
|
147
|
+
confirmText="Sil"
|
|
148
|
+
cancelText="İptal"
|
|
149
|
+
onConfirm={() => {
|
|
150
|
+
onDelete(item.id);
|
|
151
|
+
setVisible(false);
|
|
152
|
+
}}
|
|
153
|
+
onCancel={() => setVisible(false)}
|
|
154
|
+
/>
|
|
155
|
+
</>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Çıkış Onayı
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
export const LogoutConfirmation = () => {
|
|
164
|
+
const [visible, setVisible] = useState(false);
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
<>
|
|
168
|
+
<Button title="Çıkış Yap" onPress={() => setVisible(true)} />
|
|
169
|
+
|
|
170
|
+
<ConfirmationModal
|
|
171
|
+
visible={visible}
|
|
172
|
+
variant="warning"
|
|
173
|
+
icon="log-out-outline"
|
|
174
|
+
title="Çıkış Yap"
|
|
175
|
+
message="Oturumunuzu sonlandırmak istediğinizden emin misiniz?"
|
|
176
|
+
confirmText="Çıkış"
|
|
177
|
+
cancelText="İptal"
|
|
178
|
+
onConfirm={() => {
|
|
179
|
+
logout();
|
|
180
|
+
setVisible(false);
|
|
181
|
+
}}
|
|
182
|
+
onCancel={() => setVisible(false)}
|
|
183
|
+
/>
|
|
184
|
+
</>
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Değişiklik Kaydetme
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
export const UnsavedChangesModal = ({ onSave, onDiscard }) => {
|
|
193
|
+
const [visible, setVisible] = useState(false);
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<ConfirmationModal
|
|
197
|
+
visible={visible}
|
|
198
|
+
variant="warning"
|
|
199
|
+
icon="save-outline"
|
|
200
|
+
title="Kaydedilmemiş Değişiklikler"
|
|
201
|
+
message="Yaptığınız değişiklikleri kaydetmediniz. Ne yapmak istersiniz?"
|
|
202
|
+
confirmText="Kaydet"
|
|
203
|
+
cancelText="İptal"
|
|
204
|
+
onConfirm={() => {
|
|
205
|
+
onSave();
|
|
206
|
+
setVisible(false);
|
|
207
|
+
}}
|
|
208
|
+
onCancel={() => {
|
|
209
|
+
onDiscard();
|
|
210
|
+
setVisible(false);
|
|
211
|
+
}}
|
|
212
|
+
/>
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Formu Terk Etme
|
|
218
|
+
|
|
219
|
+
```tsx
|
|
220
|
+
export const LeaveFormModal = () => {
|
|
221
|
+
return (
|
|
222
|
+
<ConfirmationModal
|
|
223
|
+
visible={visible}
|
|
224
|
+
icon="warning"
|
|
225
|
+
title="Formu Terk Et"
|
|
226
|
+
message="Girdiğiniz bilgiler kaybolacak. Emin misiniz?"
|
|
227
|
+
confirmText="Terk Et"
|
|
228
|
+
cancelText="Formda Kal"
|
|
229
|
+
onConfirm={() => navigation.goBack()}
|
|
230
|
+
onCancel={() => setVisible(false)}
|
|
231
|
+
/>
|
|
232
|
+
);
|
|
233
|
+
};
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### İptal Edilebilir İşlem
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
export const CancelOperationModal = ({ operation }) => {
|
|
240
|
+
return (
|
|
241
|
+
<ConfirmationModal
|
|
242
|
+
visible={visible}
|
|
243
|
+
variant="warning"
|
|
244
|
+
icon="close-circle-outline"
|
|
245
|
+
title="İşlem İptal Edilsin"
|
|
246
|
+
message="Bu işlemi iptal etmek istediğinizden emin misiniz?"
|
|
247
|
+
confirmText="İptal Et"
|
|
248
|
+
cancelText="Devam Et"
|
|
249
|
+
onConfirm={() => {
|
|
250
|
+
cancelOperation();
|
|
251
|
+
setVisible(false);
|
|
252
|
+
}}
|
|
253
|
+
onCancel={() => setVisible(false)}
|
|
254
|
+
/>
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Abonelik İptali
|
|
260
|
+
|
|
261
|
+
```tsx
|
|
262
|
+
export const CancelSubscriptionModal = () => {
|
|
263
|
+
return (
|
|
264
|
+
<ConfirmationModal
|
|
265
|
+
visible={visible}
|
|
266
|
+
variant="danger"
|
|
267
|
+
icon="alert-circle-outline"
|
|
268
|
+
title="Aboneliği İptal Et"
|
|
269
|
+
message="Aboneliğinizi iptal ederseniz tüm özelliklere erişimi kaybedeceksiniz. Devam etmek istiyor musunuz?"
|
|
270
|
+
confirmText="İptal Et"
|
|
271
|
+
cancelText="Geri Dön"
|
|
272
|
+
onConfirm={handleCancelSubscription}
|
|
273
|
+
onCancel={() => setVisible(false)}
|
|
274
|
+
/>
|
|
275
|
+
);
|
|
276
|
+
};
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Kullanıcı Silme
|
|
280
|
+
|
|
281
|
+
```tsx
|
|
282
|
+
export const DeleteAccountModal = () => {
|
|
283
|
+
return (
|
|
284
|
+
<ConfirmationModal
|
|
285
|
+
visible={visible}
|
|
286
|
+
variant="danger"
|
|
287
|
+
icon="person-remove-outline"
|
|
288
|
+
title="Hesabı Sil"
|
|
289
|
+
message="Hesabınızı silmek istediğinizden emin misiniz? Tüm verileriniz kalıcı olarak silinecek ve bu işlem geri alınamaz."
|
|
290
|
+
confirmText="Hesabı Sil"
|
|
291
|
+
cancelText="Vazgeç"
|
|
292
|
+
onConfirm={handleDeleteAccount}
|
|
293
|
+
onCancel={() => setVisible(false)}
|
|
294
|
+
/>
|
|
295
|
+
);
|
|
296
|
+
};
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Props
|
|
300
|
+
|
|
301
|
+
### ConfirmationModalProps
|
|
302
|
+
|
|
303
|
+
| Prop | Tip | Varsayılan | Açıklama |
|
|
304
|
+
|------|-----|------------|----------|
|
|
305
|
+
| `visible` | `boolean` | - **(Zorunlu)** | Modal görünürlüğü |
|
|
306
|
+
| `title` | `string` | - | Modal başlığı |
|
|
307
|
+
| `message` | `string` | - | Modal mesajı |
|
|
308
|
+
| `variant` | `'default' \| 'danger' \| 'warning' \| 'info'` | `'default'` | Modal variant'ı |
|
|
309
|
+
| `confirmText` | `string` | `'Confirm'` | Onay butonu metni |
|
|
310
|
+
| `cancelText` | `string` | `'Cancel'` | İptal butonu metni |
|
|
311
|
+
| `icon` | `string` | - | İkon ismi |
|
|
312
|
+
| `onConfirm` | `() => void` | - | Onay callback'i |
|
|
313
|
+
| `onCancel` | `() => void` | - | İptal callback'i |
|
|
314
|
+
| `showBackdrop` | `boolean` | `true` | Backdrop göster |
|
|
315
|
+
| `backdropDismissible` | `boolean` | `true` | Backdrop tıklama ile kapat |
|
|
316
|
+
| `style` | `ViewStyle` | - | Özel stil |
|
|
317
|
+
| `testID` | `string` | - | Test ID'si |
|
|
318
|
+
|
|
319
|
+
## Best Practices
|
|
320
|
+
|
|
321
|
+
### 1. Variant Seçimi
|
|
322
|
+
|
|
323
|
+
```tsx
|
|
324
|
+
// Kritik/Silme işlemleri
|
|
325
|
+
variant="danger"
|
|
326
|
+
|
|
327
|
+
// Uyarılar
|
|
328
|
+
variant="warning"
|
|
329
|
+
|
|
330
|
+
// Bilgilendirme
|
|
331
|
+
variant="default" veya "info"
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### 2. Açık Mesaj
|
|
335
|
+
|
|
336
|
+
```tsx
|
|
337
|
+
// İyi
|
|
338
|
+
message="Bu öğeyi silmek istediğinizden emin misiniz? Bu işlem geri alınamaz."
|
|
339
|
+
|
|
340
|
+
// Kötü
|
|
341
|
+
message="Emin misiniz?"
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### 3. Buton Metinleri
|
|
345
|
+
|
|
346
|
+
```tsx
|
|
347
|
+
// Açık ve eylem odaklı
|
|
348
|
+
confirmText="Öğeyi Sil"
|
|
349
|
+
cancelText="İptal"
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
## Erişilebilirlik
|
|
353
|
+
|
|
354
|
+
ConfirmationModal, tam erişilebilirlik desteği sunar:
|
|
355
|
+
|
|
356
|
+
- ✅ Screen reader desteği
|
|
357
|
+
- ✅ Focus trap
|
|
358
|
+
- ✅ Keyboard navigation
|
|
359
|
+
- ✅ Semantic role
|
|
360
|
+
- ✅ Escape key desteği
|
|
361
|
+
|
|
362
|
+
## İlgili Bileşenler
|
|
363
|
+
|
|
364
|
+
- [`BaseModal`](../BaseModal/README.md) - Base modal
|
|
365
|
+
- [`AlertModal`](./alerts/README.md) - Alert modal
|
|
366
|
+
- [`AtomicButton`](../../atoms/button/README.md) - Buton bileşeni
|
|
367
|
+
|
|
368
|
+
## Lisans
|
|
369
|
+
|
|
370
|
+
MIT
|