@umituz/react-native-design-system 2.6.85 → 2.6.86
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 -3
- package/src/atoms/AtomicCard.README.md +337 -0
- package/src/atoms/AtomicIcon.README.md +349 -0
- package/src/atoms/GlassView/GlassView.tsx +28 -17
- package/src/atoms/GlassView/README.md +521 -0
- package/src/atoms/button/README.md +363 -0
- package/src/atoms/chip/README.md +376 -0
- package/src/atoms/input/README.md +342 -0
- package/src/atoms/picker/README.md +412 -0
- package/src/molecules/BaseModal.README.md +435 -0
- package/src/molecules/FormField.README.md +486 -0
- package/src/molecules/GlowingCard/README.md +448 -0
- package/src/molecules/SearchBar/README.md +533 -0
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
# AtomicChip
|
|
2
|
+
|
|
3
|
+
AtomicChip, React Native için küçük, etiket benzeri bileşenlerdir. Kategorileri, durumları veya seçilebilir öğeleri göstermek için idealdir.
|
|
4
|
+
|
|
5
|
+
## Özellikler
|
|
6
|
+
|
|
7
|
+
- 🎨 **3 Variant**: Filled, Outlined, Ghost
|
|
8
|
+
- 📏 **3 Size**: Small, Medium, Large
|
|
9
|
+
- 🌈 **7 Renk**: Primary, Secondary, Success, Warning, Error, Info, Surface
|
|
10
|
+
- 🎭 **İkon Desteği**: Leading ve trailing ikonlar
|
|
11
|
+
- 👆 **Clickble**: Tıklanabilir chip'ler
|
|
12
|
+
- ✅ **Selected**: Seçim durumu
|
|
13
|
+
- ♿ **Erişilebilir**: Tam erişilebilirlik desteği
|
|
14
|
+
|
|
15
|
+
## Kurulum
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { AtomicChip } from 'react-native-design-system';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Temel Kullanım
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import { View } from 'react-native';
|
|
26
|
+
import { AtomicChip } from 'react-native-design-system';
|
|
27
|
+
|
|
28
|
+
export const BasicExample = () => {
|
|
29
|
+
return (
|
|
30
|
+
<View style={{ padding: 16, flexDirection: 'row', gap: 8 }}>
|
|
31
|
+
<AtomicChip>React Native</AtomicChip>
|
|
32
|
+
<AtomicChip>TypeScript</AtomicChip>
|
|
33
|
+
<AtomicChip>Material Design</AtomicChip>
|
|
34
|
+
</View>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Variant'lar
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
43
|
+
{/* Filled (Varsayılan) */}
|
|
44
|
+
<AtomicChip variant="filled">Filled</AtomicChip>
|
|
45
|
+
|
|
46
|
+
{/* Outlined */}
|
|
47
|
+
<AtomicChip variant="outlined">Outlined</AtomicChip>
|
|
48
|
+
|
|
49
|
+
{/* Ghost */}
|
|
50
|
+
<AtomicChip variant="ghost">Ghost</AtomicChip>
|
|
51
|
+
</View>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Renkler
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
58
|
+
<AtomicChip color="primary">Primary</AtomicChip>
|
|
59
|
+
<AtomicChip color="secondary">Secondary</AtomicChip>
|
|
60
|
+
<AtomicChip color="success">Success</AtomicChip>
|
|
61
|
+
<AtomicChip color="warning">Warning</AtomicChip>
|
|
62
|
+
<AtomicChip color="error">Error</AtomicChip>
|
|
63
|
+
<AtomicChip color="info">Info</AtomicChip>
|
|
64
|
+
<AtomicChip color="surface">Surface</AtomicChip>
|
|
65
|
+
</View>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Boyutlar
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
72
|
+
{/* Small */}
|
|
73
|
+
<AtomicChip size="sm">Small</AtomicChip>
|
|
74
|
+
|
|
75
|
+
{/* Medium (Varsayılan) */}
|
|
76
|
+
<AtomicChip size="md">Medium</AtomicChip>
|
|
77
|
+
|
|
78
|
+
{/* Large */}
|
|
79
|
+
<AtomicChip size="lg">Large</AtomicChip>
|
|
80
|
+
</View>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## İkonlu Chip'ler
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
87
|
+
{/* Leading Icon */}
|
|
88
|
+
<AtomicChip
|
|
89
|
+
leadingIcon="checkmark-circle"
|
|
90
|
+
color="success"
|
|
91
|
+
>
|
|
92
|
+
Onaylandı
|
|
93
|
+
</AtomicChip>
|
|
94
|
+
|
|
95
|
+
{/* Trailing Icon */}
|
|
96
|
+
<AtomicChip
|
|
97
|
+
trailingIcon="close-outline"
|
|
98
|
+
color="error"
|
|
99
|
+
>
|
|
100
|
+
İptal
|
|
101
|
+
</AtomicChip>
|
|
102
|
+
|
|
103
|
+
{/* Both Icons */}
|
|
104
|
+
<AtomicChip
|
|
105
|
+
leadingIcon="person-outline"
|
|
106
|
+
trailingIcon="chevron-down"
|
|
107
|
+
>
|
|
108
|
+
Kullanıcı
|
|
109
|
+
</AtomicChip>
|
|
110
|
+
</View>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Tıklanabilir Chip'ler
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
const [selected, setSelected] = useState(false);
|
|
117
|
+
|
|
118
|
+
<AtomicChip
|
|
119
|
+
clickable
|
|
120
|
+
selected={selected}
|
|
121
|
+
onPress={() => setSelected(!selected)}
|
|
122
|
+
>
|
|
123
|
+
Seçilebilir Chip
|
|
124
|
+
</AtomicChip>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Custom Renkler
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
<AtomicChip
|
|
131
|
+
variant="filled"
|
|
132
|
+
backgroundColor="#6366f1"
|
|
133
|
+
textColor="#ffffff"
|
|
134
|
+
borderColor="#6366f1"
|
|
135
|
+
>
|
|
136
|
+
Custom Color
|
|
137
|
+
</AtomicChip>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Örnek Kullanımlar
|
|
141
|
+
|
|
142
|
+
### Kategori Etiketleri
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
146
|
+
<AtomicChip size="sm" variant="outlined">React Native</AtomicChip>
|
|
147
|
+
<AtomicChip size="sm" variant="outlined">TypeScript</AtomicChip>
|
|
148
|
+
<AtomicChip size="sm" variant="outlined">Node.js</AtomicChip>
|
|
149
|
+
<AtomicChip size="sm" variant="outlined">GraphQL</AtomicChip>
|
|
150
|
+
</View>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Durum Göstergeleri
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
157
|
+
<AtomicChip
|
|
158
|
+
color="success"
|
|
159
|
+
leadingIcon="checkmark-circle"
|
|
160
|
+
size="sm"
|
|
161
|
+
>
|
|
162
|
+
Aktif
|
|
163
|
+
</AtomicChip>
|
|
164
|
+
|
|
165
|
+
<AtomicChip
|
|
166
|
+
color="warning"
|
|
167
|
+
leadingIcon="time"
|
|
168
|
+
size="sm"
|
|
169
|
+
>
|
|
170
|
+
Beklemede
|
|
171
|
+
</AtomicChip>
|
|
172
|
+
|
|
173
|
+
<AtomicChip
|
|
174
|
+
color="error"
|
|
175
|
+
leadingIcon="close-circle"
|
|
176
|
+
size="sm"
|
|
177
|
+
>
|
|
178
|
+
İptal
|
|
179
|
+
</AtomicChip>
|
|
180
|
+
</View>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Filtre Seçimi
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
const [selectedFilters, setSelectedFilters] = useState<string[]>([]);
|
|
187
|
+
|
|
188
|
+
const filters = ['Tümü', 'Aktif', 'Pasif', 'Beklemede'];
|
|
189
|
+
|
|
190
|
+
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
191
|
+
{filters.map((filter) => (
|
|
192
|
+
<AtomicChip
|
|
193
|
+
key={filter}
|
|
194
|
+
clickable
|
|
195
|
+
selected={selectedFilters.includes(filter)}
|
|
196
|
+
onPress={() => {
|
|
197
|
+
if (selectedFilters.includes(filter)) {
|
|
198
|
+
setSelectedFilters(selectedFilters.filter(f => f !== filter));
|
|
199
|
+
} else {
|
|
200
|
+
setSelectedFilters([...selectedFilters, filter]);
|
|
201
|
+
}
|
|
202
|
+
}}
|
|
203
|
+
color="primary"
|
|
204
|
+
>
|
|
205
|
+
{filter}
|
|
206
|
+
</AtomicChip>
|
|
207
|
+
))}
|
|
208
|
+
</View>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Yetenek Etiketleri
|
|
212
|
+
|
|
213
|
+
```tsx
|
|
214
|
+
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
215
|
+
<AtomicChip
|
|
216
|
+
leadingIcon="code-slash"
|
|
217
|
+
color="info"
|
|
218
|
+
size="sm"
|
|
219
|
+
>
|
|
220
|
+
React
|
|
221
|
+
</AtomicChip>
|
|
222
|
+
|
|
223
|
+
<AtomicChip
|
|
224
|
+
leadingIcon="logo-javascript"
|
|
225
|
+
color="warning"
|
|
226
|
+
size="sm"
|
|
227
|
+
>
|
|
228
|
+
JavaScript
|
|
229
|
+
</AtomicChip>
|
|
230
|
+
|
|
231
|
+
<AtomicChip
|
|
232
|
+
leadingIcon="logo-python"
|
|
233
|
+
color="success"
|
|
234
|
+
size="sm"
|
|
235
|
+
>
|
|
236
|
+
Python
|
|
237
|
+
</AtomicChip>
|
|
238
|
+
</View>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Silinebilir Etiketler
|
|
242
|
+
|
|
243
|
+
```tsx
|
|
244
|
+
const [tags, setTags] = useState(['React', 'TypeScript', 'Node.js']);
|
|
245
|
+
|
|
246
|
+
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
247
|
+
{tags.map((tag, index) => (
|
|
248
|
+
<AtomicChip
|
|
249
|
+
key={index}
|
|
250
|
+
trailingIcon="close"
|
|
251
|
+
clickable
|
|
252
|
+
onPress={() => setTags(tags.filter((_, i) => i !== index))}
|
|
253
|
+
variant="outlined"
|
|
254
|
+
>
|
|
255
|
+
{tag}
|
|
256
|
+
</AtomicChip>
|
|
257
|
+
))}
|
|
258
|
+
</View>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Props
|
|
262
|
+
|
|
263
|
+
### AtomicChipProps
|
|
264
|
+
|
|
265
|
+
| Prop | Tip | Varsayılan | Açıklama |
|
|
266
|
+
|------|-----|------------|----------|
|
|
267
|
+
| `children` | `ReactNode` | - **(Zorunlu)** | Chip içeriği |
|
|
268
|
+
| `variant` | `ChipVariant` | `'filled'` | Chip görünüm stili |
|
|
269
|
+
| `size` | `ChipSize` | `'md'` | Chip boyutu |
|
|
270
|
+
| `color` | `ChipColor` | `'primary'` | Semantic renk |
|
|
271
|
+
| `backgroundColor` | `string` | - | Custom arka plan rengi |
|
|
272
|
+
| `textColor` | `string` | - | Custom metin rengi |
|
|
273
|
+
| `borderColor` | `string` | - | Custom çerçeve rengi |
|
|
274
|
+
| `leadingIcon` | `string` | - | Sol ikon ismi |
|
|
275
|
+
| `trailingIcon` | `string` | - | Sağ ikon ismi |
|
|
276
|
+
| `clickable` | `boolean` | `false` | Tıklanabilir |
|
|
277
|
+
| `onPress` | `() => void` | - | Tıklama olayı |
|
|
278
|
+
| `selected` | `boolean` | `false` | Seçili durumu |
|
|
279
|
+
| `disabled` | `boolean` | `false` | Devre dışı |
|
|
280
|
+
| `style` | `StyleProp<ViewStyle>` | - | Özel stil |
|
|
281
|
+
| `activeOpacity` | `number` | `0.7` | Tıklama opaklığı |
|
|
282
|
+
| `testID` | `string` | - | Test ID'si |
|
|
283
|
+
|
|
284
|
+
### ChipVariant
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
type ChipVariant =
|
|
288
|
+
| 'filled' // Dolgu (varsayılan)
|
|
289
|
+
| 'outlined' // Çerçeveli
|
|
290
|
+
| 'ghost'; // Hayalet
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### ChipSize
|
|
294
|
+
|
|
295
|
+
```typescript
|
|
296
|
+
type ChipSize = 'sm' | 'md' | 'lg';
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### ChipColor
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
type ChipColor =
|
|
303
|
+
| 'primary' // Ana renk
|
|
304
|
+
| 'secondary' // İkincil renk
|
|
305
|
+
| 'success' // Başarı rengi
|
|
306
|
+
| 'warning' // Uyarı rengi
|
|
307
|
+
| 'error' // Hata rengi
|
|
308
|
+
| 'info' // Bilgi rengi
|
|
309
|
+
| 'surface'; // Yüzey rengi
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Best Practices
|
|
313
|
+
|
|
314
|
+
### 1. Variant Seçimi
|
|
315
|
+
|
|
316
|
+
```tsx
|
|
317
|
+
// Ana etiketler için filled
|
|
318
|
+
<AtomicChip variant="filled">React Native</AtomicChip>
|
|
319
|
+
|
|
320
|
+
// Liste elemanları için outlined
|
|
321
|
+
<AtomicChip variant="outlined">TypeScript</AtomicChip>
|
|
322
|
+
|
|
323
|
+
// Arka plan için ghost
|
|
324
|
+
<AtomicChip variant="ghost">Node.js</AtomicChip>
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### 2. Renk Kullanımı
|
|
328
|
+
|
|
329
|
+
```tsx
|
|
330
|
+
// Başarı durumu
|
|
331
|
+
<AtomicChip color="success">Başarılı</AtomicChip>
|
|
332
|
+
|
|
333
|
+
// Hata durumu
|
|
334
|
+
<AtomicChip color="error">Hatalı</AtomicChip>
|
|
335
|
+
|
|
336
|
+
// Uyarı durumu
|
|
337
|
+
<AtomicChip color="warning">Uyarı</AtomicChip>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### 3. Boyut Seçimi
|
|
341
|
+
|
|
342
|
+
```tsx
|
|
343
|
+
// Yoğun içerik için
|
|
344
|
+
<AtomicChip size="sm">Small</AtomicChip>
|
|
345
|
+
|
|
346
|
+
// Normal kullanım
|
|
347
|
+
<AtomicChip size="md">Medium</AtomicChip>
|
|
348
|
+
|
|
349
|
+
// Vurgu için
|
|
350
|
+
<AtomicChip size="lg">Large</AtomicChip>
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## Erişilebilirlik
|
|
354
|
+
|
|
355
|
+
AtomicChip, tam erişilebilirlik desteği sunar:
|
|
356
|
+
|
|
357
|
+
- ✅ Touch uygun boyut
|
|
358
|
+
- ✅ Screen reader desteği
|
|
359
|
+
- ✅ Selected state anonsu
|
|
360
|
+
- ✅ Test ID desteği
|
|
361
|
+
|
|
362
|
+
## Performans İpuçları
|
|
363
|
+
|
|
364
|
+
1. **React.memo**: AtomicChip zaten `React.memo` ile sarılmış
|
|
365
|
+
2. **Listelerde Kullanım**: `key` prop'unu kullanmayı unutmayın
|
|
366
|
+
3. **OnPress Stabilization**: `onPress` callback'ini `useCallback` ile sarın
|
|
367
|
+
|
|
368
|
+
## İlgili Bileşenler
|
|
369
|
+
|
|
370
|
+
- [`AtomicPicker`](../picker/README.md) - Seçim bileşeni
|
|
371
|
+
- [`AtomicButton`](../button/README.md) - Buton bileşeni
|
|
372
|
+
- [`FormField`](../../molecules/FormField/README.md) - Form alanı
|
|
373
|
+
|
|
374
|
+
## Lisans
|
|
375
|
+
|
|
376
|
+
MIT
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
# AtomicInput
|
|
2
|
+
|
|
3
|
+
AtomicInput, React Native için güçlü ve özelleştirilebilir bir metin girişi bileşenidir. Material Design 3 prensiplerine uygun olarak tasarlanmış ve tamamen özelleştirilebilir.
|
|
4
|
+
|
|
5
|
+
## Özellikler
|
|
6
|
+
|
|
7
|
+
- ✨ **Pure React Native**: Harici bağımlılık yok (Paper yok)
|
|
8
|
+
- 🎨 **3 Variant**: Outlined, Filled, Flat
|
|
9
|
+
- 📱 **3 Size**: Small, Medium, Large
|
|
10
|
+
- 🎯 **Durumlar**: Default, Error, Success, Disabled, Focused
|
|
11
|
+
- 🔒 **Password Toggle**: Göster/gizle özelliği
|
|
12
|
+
- 🔢 **Character Counter**: Karakter sayacı
|
|
13
|
+
- 🎭 **İkon Desteği**: Leading ve trailing ikonlar
|
|
14
|
+
- ♿ **Erişilebilirlik**: Tam erişilebilirlik desteği
|
|
15
|
+
- ⌨️ **Klavye Türleri**: Farklı klavye türleri desteği
|
|
16
|
+
- 📝 **Multi-line**: Çok satırlı metin girişi
|
|
17
|
+
|
|
18
|
+
## Kurulum
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { AtomicInput } from 'react-native-design-system';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Temel Kullanım
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import React, { useState } from 'react';
|
|
28
|
+
import { View } from 'react-native';
|
|
29
|
+
import { AtomicInput } from 'react-native-design-system';
|
|
30
|
+
|
|
31
|
+
export const BasicExample = () => {
|
|
32
|
+
const [value, setValue] = useState('');
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<View style={{ padding: 16 }}>
|
|
36
|
+
<AtomicInput
|
|
37
|
+
label="E-posta"
|
|
38
|
+
value={value}
|
|
39
|
+
onChangeText={setValue}
|
|
40
|
+
placeholder="ornek@email.com"
|
|
41
|
+
keyboardType="email-address"
|
|
42
|
+
/>
|
|
43
|
+
</View>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Variant'lar
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
<View style={{ gap: 16 }}>
|
|
52
|
+
{/* Outlined (Varsayılan) */}
|
|
53
|
+
<AtomicInput
|
|
54
|
+
variant="outlined"
|
|
55
|
+
label="Outlined Input"
|
|
56
|
+
placeholder="Outlined variant"
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
{/* Filled */}
|
|
60
|
+
<AtomicInput
|
|
61
|
+
variant="filled"
|
|
62
|
+
label="Filled Input"
|
|
63
|
+
placeholder="Filled variant"
|
|
64
|
+
/>
|
|
65
|
+
|
|
66
|
+
{/* Flat */}
|
|
67
|
+
<AtomicInput
|
|
68
|
+
variant="flat"
|
|
69
|
+
label="Flat Input"
|
|
70
|
+
placeholder="Flat variant"
|
|
71
|
+
/>
|
|
72
|
+
</View>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Boyutlar
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<View style={{ gap: 16 }}>
|
|
79
|
+
{/* Small */}
|
|
80
|
+
<AtomicInput
|
|
81
|
+
size="sm"
|
|
82
|
+
label="Small Input"
|
|
83
|
+
placeholder="Small size"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
{/* Medium (Varsayılan) */}
|
|
87
|
+
<AtomicInput
|
|
88
|
+
size="md"
|
|
89
|
+
label="Medium Input"
|
|
90
|
+
placeholder="Medium size"
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
{/* Large */}
|
|
94
|
+
<AtomicInput
|
|
95
|
+
size="lg"
|
|
96
|
+
label="Large Input"
|
|
97
|
+
placeholder="Large size"
|
|
98
|
+
/>
|
|
99
|
+
</View>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Durumlar
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
<View style={{ gap: 16 }}>
|
|
106
|
+
{/* Default */}
|
|
107
|
+
<AtomicInput
|
|
108
|
+
state="default"
|
|
109
|
+
label="Default"
|
|
110
|
+
placeholder="Default state"
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
{/* Error */}
|
|
114
|
+
<AtomicInput
|
|
115
|
+
state="error"
|
|
116
|
+
label="Error State"
|
|
117
|
+
placeholder="Error state"
|
|
118
|
+
helperText="Bu alan hatalı"
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
{/* Success */}
|
|
122
|
+
<AtomicInput
|
|
123
|
+
state="success"
|
|
124
|
+
label="Success State"
|
|
125
|
+
placeholder="Success state"
|
|
126
|
+
helperText="Başarılı"
|
|
127
|
+
/>
|
|
128
|
+
|
|
129
|
+
{/* Disabled */}
|
|
130
|
+
<AtomicInput
|
|
131
|
+
state="disabled"
|
|
132
|
+
label="Disabled"
|
|
133
|
+
placeholder="Disabled state"
|
|
134
|
+
value="Değer girilemez"
|
|
135
|
+
disabled
|
|
136
|
+
/>
|
|
137
|
+
</View>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Password Input
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
<AtomicInput
|
|
144
|
+
label="Şifre"
|
|
145
|
+
placeholder="Şifrenizi girin"
|
|
146
|
+
secureTextEntry
|
|
147
|
+
showPasswordToggle
|
|
148
|
+
/>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## İkonlar
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
<View style={{ gap: 16 }}>
|
|
155
|
+
{/* Leading Icon */}
|
|
156
|
+
<AtomicInput
|
|
157
|
+
label="Kullanıcı Adı"
|
|
158
|
+
placeholder="Kullanıcı adınız"
|
|
159
|
+
leadingIcon="person-outline"
|
|
160
|
+
/>
|
|
161
|
+
|
|
162
|
+
{/* Trailing Icon */}
|
|
163
|
+
<AtomicInput
|
|
164
|
+
label="Arama"
|
|
165
|
+
placeholder="Arama yapın"
|
|
166
|
+
trailingIcon="search-outline"
|
|
167
|
+
onTrailingIconPress={() => console.log('Arama')}
|
|
168
|
+
/>
|
|
169
|
+
|
|
170
|
+
{/* Both Icons */}
|
|
171
|
+
<AtomicInput
|
|
172
|
+
label="Email"
|
|
173
|
+
placeholder="Email adresiniz"
|
|
174
|
+
leadingIcon="mail-outline"
|
|
175
|
+
trailingIcon="close-circle-outline"
|
|
176
|
+
onTrailingIconPress={() => console.log('Temizle')}
|
|
177
|
+
/>
|
|
178
|
+
</View>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Character Counter
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
<AtomicInput
|
|
185
|
+
label="Bio"
|
|
186
|
+
placeholder="Kendinizi tanıtın"
|
|
187
|
+
maxLength={150}
|
|
188
|
+
showCharacterCount
|
|
189
|
+
multiline
|
|
190
|
+
numberOfLines={4}
|
|
191
|
+
/>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Form Örneği
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
import React, { useState } from 'react';
|
|
198
|
+
import { View, Button } from 'react-native';
|
|
199
|
+
import { AtomicInput } from 'react-native-design-system';
|
|
200
|
+
|
|
201
|
+
export const FormExample = () => {
|
|
202
|
+
const [formData, setFormData] = useState({
|
|
203
|
+
name: '',
|
|
204
|
+
email: '',
|
|
205
|
+
password: '',
|
|
206
|
+
bio: ''
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
const handleInputChange = (field: string) => (value: string) => {
|
|
210
|
+
setFormData(prev => ({ ...prev, [field]: value }));
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<View style={{ padding: 16, gap: 16 }}>
|
|
215
|
+
<AtomicInput
|
|
216
|
+
label="Ad Soyad"
|
|
217
|
+
value={formData.name}
|
|
218
|
+
onChangeText={handleInputChange('name')}
|
|
219
|
+
placeholder="Adınız ve soyadınız"
|
|
220
|
+
leadingIcon="person-outline"
|
|
221
|
+
state="default"
|
|
222
|
+
/>
|
|
223
|
+
|
|
224
|
+
<AtomicInput
|
|
225
|
+
label="E-posta"
|
|
226
|
+
value={formData.email}
|
|
227
|
+
onChangeText={handleInputChange('email')}
|
|
228
|
+
placeholder="ornek@email.com"
|
|
229
|
+
keyboardType="email-address"
|
|
230
|
+
leadingIcon="mail-outline"
|
|
231
|
+
autoCapitalize="none"
|
|
232
|
+
/>
|
|
233
|
+
|
|
234
|
+
<AtomicInput
|
|
235
|
+
label="Şifre"
|
|
236
|
+
value={formData.password}
|
|
237
|
+
onChangeText={handleInputChange('password')}
|
|
238
|
+
placeholder="En az 8 karakter"
|
|
239
|
+
secureTextEntry
|
|
240
|
+
showPasswordToggle
|
|
241
|
+
leadingIcon="lock-closed-outline"
|
|
242
|
+
maxLength={20}
|
|
243
|
+
showCharacterCount
|
|
244
|
+
/>
|
|
245
|
+
|
|
246
|
+
<AtomicInput
|
|
247
|
+
label="Hakkınızda"
|
|
248
|
+
value={formData.bio}
|
|
249
|
+
onChangeText={handleInputChange('bio')}
|
|
250
|
+
placeholder="Kendinizden bahsedin"
|
|
251
|
+
multiline
|
|
252
|
+
numberOfLines={4}
|
|
253
|
+
maxLength={200}
|
|
254
|
+
showCharacterCount
|
|
255
|
+
/>
|
|
256
|
+
|
|
257
|
+
<Button title="Gönder" onPress={() => console.log(formData)} />
|
|
258
|
+
</View>
|
|
259
|
+
);
|
|
260
|
+
};
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Props
|
|
264
|
+
|
|
265
|
+
### AtomicInputProps
|
|
266
|
+
|
|
267
|
+
| Prop | Tip | Varsayılan | Açıklama |
|
|
268
|
+
|------|-----|------------|----------|
|
|
269
|
+
| `variant` | `'outlined' \| 'filled' \| 'flat'` | `'outlined'` | Input görünüm stili |
|
|
270
|
+
| `state` | `'default' \| 'error' \| 'success' \| 'disabled'` | `'default'` | Input durumu |
|
|
271
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Input boyutu |
|
|
272
|
+
| `label` | `string` | - | Input etiketi |
|
|
273
|
+
| `value` | `string` | `''` | Input değeri |
|
|
274
|
+
| `onChangeText` | `(text: string) => void` | - | Değişiklik olayı |
|
|
275
|
+
| `placeholder` | `string` | - | Placeholder metni |
|
|
276
|
+
| `helperText` | `string` | - | Yardımcı metin |
|
|
277
|
+
| `leadingIcon` | `string` | - | Sol ikon ismi (Ionicons) |
|
|
278
|
+
| `trailingIcon` | `string` | - | Sağ ikon ismi (Ionicons) |
|
|
279
|
+
| `onTrailingIconPress` | `() => void` | - | Sağ ikon tıklama olayı |
|
|
280
|
+
| `showPasswordToggle` | `boolean` | `false` | Şifre göster/gizle butonu |
|
|
281
|
+
| `secureTextEntry` | `boolean` | `false` | Şifre girişi |
|
|
282
|
+
| `maxLength` | `number` | - | Maksimum karakter sayısı |
|
|
283
|
+
| `showCharacterCount` | `boolean` | `false` | Karakter sayacı göster |
|
|
284
|
+
| `keyboardType` | `KeyboardType` | `'default'` | Klavye türü |
|
|
285
|
+
| `returnKeyType` | `ReturnKeyType` | - | Return tuşu türü |
|
|
286
|
+
| `onSubmitEditing` | `() => void` | - | Submit olayı |
|
|
287
|
+
| `blurOnSubmit` | `boolean` | - | Submit'te blur |
|
|
288
|
+
| `autoFocus` | `boolean` | - | Otomatik odak |
|
|
289
|
+
| `autoCapitalize` | `AutoCapitalize` | `'sentences'` | Otomatik büyük harf |
|
|
290
|
+
| `autoCorrect` | `boolean` | `true` | Otomatik düzeltme |
|
|
291
|
+
| `disabled` | `boolean` | `false` | Devre dışı |
|
|
292
|
+
| `multiline` | `boolean` | `false` | Çok satırlı |
|
|
293
|
+
| `numberOfLines` | `number` | - | Satır sayısı |
|
|
294
|
+
| `style` | `StyleProp<ViewStyle>` | - | Container stil |
|
|
295
|
+
| `inputStyle` | `StyleProp<TextStyle>` | - | Input stil |
|
|
296
|
+
| `testID` | `string` | - | Test ID'si |
|
|
297
|
+
| `onBlur` | `() => void` | - | Blur olayı |
|
|
298
|
+
| `onFocus` | `() => void` | - | Focus olayı |
|
|
299
|
+
|
|
300
|
+
## Stil Özelleştirme
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
<AtomicInput
|
|
304
|
+
label="Özel Stilli Input"
|
|
305
|
+
placeholder="Özel stil"
|
|
306
|
+
style={{
|
|
307
|
+
backgroundColor: '#f0f0f0',
|
|
308
|
+
borderRadius: 8,
|
|
309
|
+
}}
|
|
310
|
+
inputStyle={{
|
|
311
|
+
fontSize: 16,
|
|
312
|
+
fontWeight: '600',
|
|
313
|
+
}}
|
|
314
|
+
/>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Erişilebilirlik
|
|
318
|
+
|
|
319
|
+
AtomicInput, tam erişilebilirlik desteği sunar:
|
|
320
|
+
|
|
321
|
+
- ✅ Screen reader desteği
|
|
322
|
+
- ✅ Focus management
|
|
323
|
+
- ✅ Error state anonsu
|
|
324
|
+
- ✅ Label ilişkilendirmesi
|
|
325
|
+
- ✅ Test ID desteği
|
|
326
|
+
|
|
327
|
+
## Önemli Notlar
|
|
328
|
+
|
|
329
|
+
1. **Ionicons Kullanımı**: İkon isimleri Ionicons kütüphanesinden gelir
|
|
330
|
+
2. **State Management**: `value` ve `onChangeText` kullanarak controlled component olarak kullanın
|
|
331
|
+
3. **Form Validasyonu**: `FormField` molecule bileşeni ile birlikte kullanılması önerilir
|
|
332
|
+
4. **Performance**: Uzun listelerde `key` prop'unu kullanmayı unutmayın
|
|
333
|
+
|
|
334
|
+
## İlgili Bileşenler
|
|
335
|
+
|
|
336
|
+
- [`FormField`](../../molecules/FormField/README.md) - Form input bileşeni
|
|
337
|
+
- [`AtomicTextArea`](../AtomicTextArea/README.md) - Çok satırlı metin girişi
|
|
338
|
+
- [`AtomicButton`](../button/README.md) - Form butonu
|
|
339
|
+
|
|
340
|
+
## Lisans
|
|
341
|
+
|
|
342
|
+
MIT
|