@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,399 @@
|
|
|
1
|
+
# AtomicDatePicker
|
|
2
|
+
|
|
3
|
+
AtomicDatePicker, platforma özel native tarih/saat seçici bileşenidir. iOS ve Android'de tutarlı bir deneyim sunar.
|
|
4
|
+
|
|
5
|
+
## Özellikler
|
|
6
|
+
|
|
7
|
+
- 📅 **Tarih Seçimi**: Native tarih picker
|
|
8
|
+
- ⏰ **Saat Seçimi**: Native saat picker
|
|
9
|
+
- 🌍 **Locale Desteği**: Otomatik dil entegrasyonu
|
|
10
|
+
- 🎨 **Tema Bilinci**: Tema entegrasyonu
|
|
11
|
+
- 📱 **Platform Spesifik**: iOS wheel, Android dialog
|
|
12
|
+
- ⚙️ **Kısıtlamalar**: Min/Maks tarih
|
|
13
|
+
- ♿ **Erişilebilir**: Tam erişilebilirlik desteği
|
|
14
|
+
|
|
15
|
+
## Kurulum
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { AtomicDatePicker } from 'react-native-design-system';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Temel Kullanım
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import React, { useState } from 'react';
|
|
25
|
+
import { View } from 'react-native';
|
|
26
|
+
import { AtomicDatePicker } from 'react-native-design-system';
|
|
27
|
+
|
|
28
|
+
export const BasicExample = () => {
|
|
29
|
+
const [selectedDate, setSelectedDate] = useState<Date | null>(null);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<View style={{ padding: 16 }}>
|
|
33
|
+
<AtomicDatePicker
|
|
34
|
+
value={selectedDate}
|
|
35
|
+
onChange={setSelectedDate}
|
|
36
|
+
label="Doğum Tarihi"
|
|
37
|
+
placeholder="Tarih seçin"
|
|
38
|
+
/>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Date Picker
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
const [date, setDate] = useState<Date | null>(null);
|
|
48
|
+
|
|
49
|
+
<AtomicDatePicker
|
|
50
|
+
value={date}
|
|
51
|
+
onChange={setDate}
|
|
52
|
+
mode="date"
|
|
53
|
+
label="Tarih"
|
|
54
|
+
placeholder="Tarih seçin"
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Time Picker
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
const [time, setTime] = useState<Date | null>(null);
|
|
62
|
+
|
|
63
|
+
<AtomicDatePicker
|
|
64
|
+
value={time}
|
|
65
|
+
onChange={setTime}
|
|
66
|
+
mode="time"
|
|
67
|
+
label="Saat"
|
|
68
|
+
placeholder="Saat seçin"
|
|
69
|
+
/>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## DateTime Picker (Sadece iOS)
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
const [dateTime, setDateTime] = useState<Date | null>(null);
|
|
76
|
+
|
|
77
|
+
<AtomicDatePicker
|
|
78
|
+
value={dateTime}
|
|
79
|
+
onChange={setDateTime}
|
|
80
|
+
mode="datetime"
|
|
81
|
+
label="Tarih ve Saat"
|
|
82
|
+
placeholder="Tarih ve saat seçin"
|
|
83
|
+
/>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Min/Max Date
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<AtomicDatePicker
|
|
90
|
+
value={birthDate}
|
|
91
|
+
onChange={setBirthDate}
|
|
92
|
+
label="Doğum Tarihi"
|
|
93
|
+
minimumDate={new Date(1900, 0, 1)}
|
|
94
|
+
maximumDate={new Date()}
|
|
95
|
+
/>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Error State
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
<AtomicDatePicker
|
|
102
|
+
value={date}
|
|
103
|
+
onChange={setDate}
|
|
104
|
+
label="Tarih"
|
|
105
|
+
error="Lütfen geçerli bir tarih seçin"
|
|
106
|
+
/>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Disabled
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
<AtomicDatePicker
|
|
113
|
+
value={date}
|
|
114
|
+
onChange={setDate}
|
|
115
|
+
label="Tarih"
|
|
116
|
+
disabled
|
|
117
|
+
/>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Örnek Kullanımlar
|
|
121
|
+
|
|
122
|
+
### Doğum Tarihi
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
export const BirthDateForm = () => {
|
|
126
|
+
const [birthDate, setBirthDate] = useState<Date | null>(null);
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<View style={{ padding: 16 }}>
|
|
130
|
+
<AtomicDatePicker
|
|
131
|
+
value={birthDate}
|
|
132
|
+
onChange={setBirthDate}
|
|
133
|
+
label="Doğum Tarihi"
|
|
134
|
+
placeholder="Doğum tarihinizi seçin"
|
|
135
|
+
minimumDate={new Date(1900, 0, 1)}
|
|
136
|
+
maximumDate={new Date()}
|
|
137
|
+
mode="date"
|
|
138
|
+
/>
|
|
139
|
+
|
|
140
|
+
{birthDate && (
|
|
141
|
+
<AtomicText type="bodyMedium" marginTop="sm">
|
|
142
|
+
Seçilen Tarih: {birthDate.toLocaleDateString('tr-TR')}
|
|
143
|
+
</AtomicText>
|
|
144
|
+
)}
|
|
145
|
+
</View>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Randevu Tarihi
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
export const AppointmentForm = () => {
|
|
154
|
+
const [appointmentDate, setAppointmentDate] = useState<Date | null>(null);
|
|
155
|
+
const [error, setError] = useState('');
|
|
156
|
+
|
|
157
|
+
const handleDateChange = (date: Date) => {
|
|
158
|
+
const today = new Date();
|
|
159
|
+
today.setHours(0, 0, 0, 0);
|
|
160
|
+
|
|
161
|
+
if (date < today) {
|
|
162
|
+
setError('Geçmiş tarih seçemezsiniz');
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
setError('');
|
|
167
|
+
setAppointmentDate(date);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<View style={{ padding: 16 }}>
|
|
172
|
+
<AtomicDatePicker
|
|
173
|
+
value={appointmentDate}
|
|
174
|
+
onChange={handleDateChange}
|
|
175
|
+
label="Randevu Tarihi"
|
|
176
|
+
placeholder="Randevu tarihi seçin"
|
|
177
|
+
minimumDate={new Date()}
|
|
178
|
+
error={error}
|
|
179
|
+
mode="date"
|
|
180
|
+
/>
|
|
181
|
+
</View>
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Etkinlik Tarihi ve Saati
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
export const EventForm = () => {
|
|
190
|
+
const [eventDateTime, setEventDateTime] = useState<Date | null>(null);
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<View style={{ padding: 16 }}>
|
|
194
|
+
<AtomicDatePicker
|
|
195
|
+
value={eventDateTime}
|
|
196
|
+
onChange={setEventDateTime}
|
|
197
|
+
label="Etkinlik Tarihi ve Saati"
|
|
198
|
+
placeholder="Tarih ve saat seçin"
|
|
199
|
+
minimumDate={new Date()}
|
|
200
|
+
mode="datetime"
|
|
201
|
+
/>
|
|
202
|
+
|
|
203
|
+
{eventDateTime && (
|
|
204
|
+
<AtomicText type="bodyMedium" marginTop="sm">
|
|
205
|
+
{eventDateTime.toLocaleString('tr-TR')}
|
|
206
|
+
</AtomicText>
|
|
207
|
+
)}
|
|
208
|
+
</View>
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Hatırlatıcı Saati
|
|
214
|
+
|
|
215
|
+
```tsx
|
|
216
|
+
export const ReminderForm = () => {
|
|
217
|
+
const [reminderTime, setReminderTime] = useState<Date | null>(null);
|
|
218
|
+
|
|
219
|
+
return (
|
|
220
|
+
<View style={{ padding: 16 }}>
|
|
221
|
+
<AtomicDatePicker
|
|
222
|
+
value={reminderTime}
|
|
223
|
+
onChange={setReminderTime}
|
|
224
|
+
label="Hatırlatıcı Saati"
|
|
225
|
+
placeholder="Saat seçin"
|
|
226
|
+
mode="time"
|
|
227
|
+
/>
|
|
228
|
+
|
|
229
|
+
{reminderTime && (
|
|
230
|
+
<AtomicText type="bodyMedium" marginTop="sm">
|
|
231
|
+
{reminderTime.toLocaleTimeString('tr-TR', {
|
|
232
|
+
hour: '2-digit',
|
|
233
|
+
minute: '2-digit',
|
|
234
|
+
})}
|
|
235
|
+
</AtomicText>
|
|
236
|
+
)}
|
|
237
|
+
</View>
|
|
238
|
+
);
|
|
239
|
+
};
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Geçerlilik Tarihi
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
export const ExpiryForm = () => {
|
|
246
|
+
const [expiryDate, setExpiryDate] = useState<Date | null>(null);
|
|
247
|
+
|
|
248
|
+
const today = new Date();
|
|
249
|
+
const nextYear = new Date();
|
|
250
|
+
nextYear.setFullYear(today.getFullYear() + 1);
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<View style={{ padding: 16 }}>
|
|
254
|
+
<AtomicDatePicker
|
|
255
|
+
value={expiryDate}
|
|
256
|
+
onChange={setExpiryDate}
|
|
257
|
+
label="Geçerlilik Tarihi"
|
|
258
|
+
placeholder="Son kullanma tarihi"
|
|
259
|
+
minimumDate={today}
|
|
260
|
+
maximumDate={nextYear}
|
|
261
|
+
mode="date"
|
|
262
|
+
/>
|
|
263
|
+
</View>
|
|
264
|
+
);
|
|
265
|
+
};
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Tarih Aralığı
|
|
269
|
+
|
|
270
|
+
```tsx
|
|
271
|
+
export const DateRangeForm = () => {
|
|
272
|
+
const [startDate, setStartDate] = useState<Date | null>(null);
|
|
273
|
+
const [endDate, setEndDate] = useState<Date | null>(null);
|
|
274
|
+
|
|
275
|
+
return (
|
|
276
|
+
<View style={{ padding: 16 }}>
|
|
277
|
+
<AtomicDatePicker
|
|
278
|
+
value={startDate}
|
|
279
|
+
onChange={(date) => {
|
|
280
|
+
setStartDate(date);
|
|
281
|
+
if (endDate && date > endDate) {
|
|
282
|
+
setEndDate(null);
|
|
283
|
+
}
|
|
284
|
+
}}
|
|
285
|
+
label="Başlangıç Tarihi"
|
|
286
|
+
placeholder="Başlangıç tarihi"
|
|
287
|
+
mode="date"
|
|
288
|
+
/>
|
|
289
|
+
|
|
290
|
+
<AtomicDatePicker
|
|
291
|
+
value={endDate}
|
|
292
|
+
onChange={setEndDate}
|
|
293
|
+
label="Bitiş Tarihi"
|
|
294
|
+
placeholder="Bitiş tarihi"
|
|
295
|
+
minimumDate={startDate || undefined}
|
|
296
|
+
mode="date"
|
|
297
|
+
style={{ marginTop: 16 }}
|
|
298
|
+
/>
|
|
299
|
+
</View>
|
|
300
|
+
);
|
|
301
|
+
};
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Props
|
|
305
|
+
|
|
306
|
+
### AtomicDatePickerProps
|
|
307
|
+
|
|
308
|
+
| Prop | Tip | Varsayılan | Açıklama |
|
|
309
|
+
|------|-----|------------|----------|
|
|
310
|
+
| `value` | `Date \| null` | - **(Zorunlu)** | Seçili tarih |
|
|
311
|
+
| `onChange` | `(date: Date) => void` | - **(Zorunlu)** | Değişiklik olayı |
|
|
312
|
+
| `label` | `string` | - | Etiket metni |
|
|
313
|
+
| `error` | `string` | - | Hata mesajı |
|
|
314
|
+
| `disabled` | `boolean` | `false` | Devre dışı |
|
|
315
|
+
| `minimumDate` | `Date` | - | Minimum tarih |
|
|
316
|
+
| `maximumDate` | `Date` | - | Maksimum tarih |
|
|
317
|
+
| `mode` | `'date' \| 'time' \| 'datetime'` | `'date'` | Picker modu |
|
|
318
|
+
| `placeholder` | `string` | `'Select date'` | Placeholder metni |
|
|
319
|
+
| `style` | `StyleProp<ViewStyle>` | - | Özel stil |
|
|
320
|
+
| `testID` | `string` | - | Test ID'si |
|
|
321
|
+
|
|
322
|
+
## Platform Davranışı
|
|
323
|
+
|
|
324
|
+
### iOS
|
|
325
|
+
- ✨ Bottom sheet modal açılır
|
|
326
|
+
- 🎡 Wheel picker gösterir
|
|
327
|
+
- ✅ "Done" butonu ile onaylar
|
|
328
|
+
- 👆 Swipe down ile kapatılır
|
|
329
|
+
|
|
330
|
+
### Android
|
|
331
|
+
- 📱 Dialog açılır
|
|
332
|
+
- 📅 Takvim view gösterir
|
|
333
|
+
- ✅ Seçimde otomatik kapanır
|
|
334
|
+
|
|
335
|
+
## Best Practices
|
|
336
|
+
|
|
337
|
+
### 1. Mode Seçimi
|
|
338
|
+
|
|
339
|
+
```tsx
|
|
340
|
+
// Sadece tarih
|
|
341
|
+
<AtomicDatePicker mode="date" />
|
|
342
|
+
|
|
343
|
+
// Sadece saat
|
|
344
|
+
<AtomicDatePicker mode="time" />
|
|
345
|
+
|
|
346
|
+
// Tarih ve saat (sadece iOS)
|
|
347
|
+
<AtomicDatePicker mode="datetime" />
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### 2. Tarih Kısıtlamaları
|
|
351
|
+
|
|
352
|
+
```tsx
|
|
353
|
+
// Geçmiş tarih için
|
|
354
|
+
<AtomicDatePicker
|
|
355
|
+
maximumDate={new Date()}
|
|
356
|
+
/>
|
|
357
|
+
|
|
358
|
+
// Gelecek tarih için
|
|
359
|
+
<AtomicDatePicker
|
|
360
|
+
minimumDate={new Date()}
|
|
361
|
+
/>
|
|
362
|
+
|
|
363
|
+
// Belirli aralık
|
|
364
|
+
<AtomicDatePicker
|
|
365
|
+
minimumDate={new Date(2024, 0, 1)}
|
|
366
|
+
maximumDate={new Date(2024, 11, 31)}
|
|
367
|
+
/>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### 3. Error Handling
|
|
371
|
+
|
|
372
|
+
```tsx
|
|
373
|
+
const validateDate = (date: Date) => {
|
|
374
|
+
const today = new Date();
|
|
375
|
+
if (date < today) {
|
|
376
|
+
return 'Geçmiş tarih seçemezsiniz';
|
|
377
|
+
}
|
|
378
|
+
return '';
|
|
379
|
+
};
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## Erişilebilirlik
|
|
383
|
+
|
|
384
|
+
AtomicDatePicker, tam erişilebilirlik desteği sunar:
|
|
385
|
+
|
|
386
|
+
- ✅ Screen reader desteği
|
|
387
|
+
- ✅ Native picker erişilebilirliği
|
|
388
|
+
- ✅ Error state anonsu
|
|
389
|
+
- ✅ Test ID desteği
|
|
390
|
+
|
|
391
|
+
## İlgili Bileşenler
|
|
392
|
+
|
|
393
|
+
- [`AtomicInput`](./input/README.md) - Input bileşeni
|
|
394
|
+
- [`FormField`](../../molecules/FormField/README.md) - Form alanı
|
|
395
|
+
- [`AtomicPicker`](./picker/README.md) - Seçim bileşeni
|
|
396
|
+
|
|
397
|
+
## Lisans
|
|
398
|
+
|
|
399
|
+
MIT
|