@umituz/react-native-design-system 2.6.87 → 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/AtomicProgress.README.md +402 -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/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,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
|