@umituz/react-native-design-system 2.6.86 → 2.6.87
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 -1
- 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/AtomicSpinner.README.md +433 -0
- package/src/atoms/AtomicText.README.md +470 -0
- package/src/atoms/AtomicTextArea.README.md +352 -0
- package/src/molecules/ListItem.README.md +402 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
# AtomicTextArea
|
|
2
|
+
|
|
3
|
+
AtomicTextArea, çok satırlı metin girişi için optimize edilmiş bir bileşendir. AtomicInput ile tutarlıdır ancak uzun metinler için özel olarak tasarlanmıştır.
|
|
4
|
+
|
|
5
|
+
## Özellikler
|
|
6
|
+
|
|
7
|
+
- 📝 **Multiline**: Çok satırlı metin girişi
|
|
8
|
+
- 🏷️ **Label Desteği**: Etiket gösterimi
|
|
9
|
+
- ❌ **Error State**: Hata durumu
|
|
10
|
+
- ℹ️ **Helper Text**: Yardımcı metin
|
|
11
|
+
- 🔢 **Character Counter**: Karakter sayacı
|
|
12
|
+
- ⚙️ **Özelleştirilebilir**: Satır sayısı, min yükseklik
|
|
13
|
+
- ♿ **Erişilebilir**: Tam erişilebilirlik desteği
|
|
14
|
+
|
|
15
|
+
## Kurulum
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { AtomicTextArea } 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 { AtomicTextArea } from 'react-native-design-system';
|
|
27
|
+
|
|
28
|
+
export const BasicExample = () => {
|
|
29
|
+
const [value, setValue] = useState('');
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<View style={{ padding: 16 }}>
|
|
33
|
+
<AtomicTextArea
|
|
34
|
+
label="Açıklama"
|
|
35
|
+
value={value}
|
|
36
|
+
onChangeText={setValue}
|
|
37
|
+
placeholder="Açıklamanızı girin..."
|
|
38
|
+
rows={4}
|
|
39
|
+
/>
|
|
40
|
+
</View>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Basic TextArea
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
<AtomicTextArea
|
|
49
|
+
value={value}
|
|
50
|
+
onChangeText={setValue}
|
|
51
|
+
placeholder="Metninizi buraya yazın..."
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Label ile
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<AtomicTextArea
|
|
59
|
+
label="Hakkımda"
|
|
60
|
+
value={value}
|
|
61
|
+
onChangeText={setValue}
|
|
62
|
+
placeholder="Kendinizden bahsedin"
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Satır Sayısı
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
<View style={{ gap: 16 }}>
|
|
70
|
+
{/* 2 satır */}
|
|
71
|
+
<AtomicTextArea
|
|
72
|
+
rows={2}
|
|
73
|
+
placeholder="Kısa metin"
|
|
74
|
+
/>
|
|
75
|
+
|
|
76
|
+
{/* 4 satır (varsayılan) */}
|
|
77
|
+
<AtomicTextArea
|
|
78
|
+
rows={4}
|
|
79
|
+
placeholder="Normal metin"
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
{/* 8 satır */}
|
|
83
|
+
<AtomicTextArea
|
|
84
|
+
rows={8}
|
|
85
|
+
placeholder="Uzun metin"
|
|
86
|
+
/>
|
|
87
|
+
</View>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Character Limit
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<AtomicTextArea
|
|
94
|
+
value={value}
|
|
95
|
+
onChangeText={setValue}
|
|
96
|
+
maxLength={200}
|
|
97
|
+
placeholder="En az 200 karakter"
|
|
98
|
+
/>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Error State
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
<AtomicTextArea
|
|
105
|
+
label="Açıklama"
|
|
106
|
+
value={value}
|
|
107
|
+
onChangeText={setValue}
|
|
108
|
+
errorText="Bu alan zorunludur"
|
|
109
|
+
/>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Helper Text
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
<AtomicTextArea
|
|
116
|
+
label="Ürün Açıklaması"
|
|
117
|
+
value={value}
|
|
118
|
+
onChangeText={setValue}
|
|
119
|
+
helperText="Ürününüzü detaylı açıklayın"
|
|
120
|
+
placeholder="Ürün özellikleri, kullanım alanları vb."
|
|
121
|
+
/>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Disabled
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
<AtomicTextArea
|
|
128
|
+
label="Notlar"
|
|
129
|
+
value="Bu alan düzenlenemez"
|
|
130
|
+
disabled
|
|
131
|
+
/>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Min Height
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
<AtomicTextArea
|
|
138
|
+
value={value}
|
|
139
|
+
onChangeText={setValue}
|
|
140
|
+
minHeight={120}
|
|
141
|
+
placeholder="Min 120px yükseklik"
|
|
142
|
+
/>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Örnek Kullanımlar
|
|
146
|
+
|
|
147
|
+
### Form Alanı
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
export const ProductForm = () => {
|
|
151
|
+
const [description, setDescription] = useState('');
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<View style={{ padding: 16 }}>
|
|
155
|
+
<AtomicTextArea
|
|
156
|
+
label="Ürün Açıklaması"
|
|
157
|
+
value={description}
|
|
158
|
+
onChangeText={setDescription}
|
|
159
|
+
placeholder="Ürününüzü detaylı açıklayın..."
|
|
160
|
+
rows={6}
|
|
161
|
+
maxLength={500}
|
|
162
|
+
helperText="En az 50 karakter"
|
|
163
|
+
/>
|
|
164
|
+
</View>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Yorum Formu
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
export const CommentForm = () => {
|
|
173
|
+
const [comment, setComment] = useState('');
|
|
174
|
+
const [error, setError] = useState('');
|
|
175
|
+
|
|
176
|
+
const handleSubmit = () => {
|
|
177
|
+
if (comment.length < 10) {
|
|
178
|
+
setError('Yorum en az 10 karakter olmalıdır');
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
// Submit logic
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<View style={{ padding: 16 }}>
|
|
186
|
+
<AtomicTextArea
|
|
187
|
+
label="Yorumunuz"
|
|
188
|
+
value={comment}
|
|
189
|
+
onChangeText={setComment}
|
|
190
|
+
placeholder=" düşüncelerinizi paylaşın..."
|
|
191
|
+
rows={5}
|
|
192
|
+
maxLength={500}
|
|
193
|
+
errorText={error}
|
|
194
|
+
/>
|
|
195
|
+
|
|
196
|
+
<Button title="Gönder" onPress={handleSubmit} />
|
|
197
|
+
</View>
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Not Alma
|
|
203
|
+
|
|
204
|
+
```tsx
|
|
205
|
+
export const NotesForm = () => {
|
|
206
|
+
const [notes, setNotes] = useState('');
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<View style={{ padding: 16 }}>
|
|
210
|
+
<AtomicTextArea
|
|
211
|
+
label="Notlar"
|
|
212
|
+
value={notes}
|
|
213
|
+
onChangeText={setNotes}
|
|
214
|
+
placeholder="Notlarınızı buraya yazın..."
|
|
215
|
+
rows={10}
|
|
216
|
+
helperText="Kişisel notlarınız"
|
|
217
|
+
/>
|
|
218
|
+
</View>
|
|
219
|
+
);
|
|
220
|
+
};
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Bio Formu
|
|
224
|
+
|
|
225
|
+
```tsx
|
|
226
|
+
export const BioForm = () => {
|
|
227
|
+
const [bio, setBio] = useState('');
|
|
228
|
+
|
|
229
|
+
return (
|
|
230
|
+
<View style={{ padding: 16 }}>
|
|
231
|
+
<AtomicTextArea
|
|
232
|
+
label="Hakkımda"
|
|
233
|
+
value={bio}
|
|
234
|
+
onChangeText={setBio}
|
|
235
|
+
placeholder="Kendinizden bahsedin..."
|
|
236
|
+
rows={4}
|
|
237
|
+
maxLength={150}
|
|
238
|
+
helperText="Maksimum 150 karakter"
|
|
239
|
+
/>
|
|
240
|
+
|
|
241
|
+
{bio.length > 0 && (
|
|
242
|
+
<AtomicText type="bodySmall" color="textSecondary">
|
|
243
|
+
{bio.length}/150 karakter
|
|
244
|
+
</AtomicText>
|
|
245
|
+
)}
|
|
246
|
+
</View>
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Geri Bildirim
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
export const FeedbackForm = () => {
|
|
255
|
+
const [feedback, setFeedback] = useState('');
|
|
256
|
+
|
|
257
|
+
return (
|
|
258
|
+
<View style={{ padding: 16 }}>
|
|
259
|
+
<AtomicTextArea
|
|
260
|
+
label="Geri Bildirim"
|
|
261
|
+
value={feedback}
|
|
262
|
+
onChangeText={setFeedback}
|
|
263
|
+
placeholder="Deneyiminiz hakkında bilgi verin..."
|
|
264
|
+
rows={6}
|
|
265
|
+
maxLength={1000}
|
|
266
|
+
helperText="Geribildiriminiz bizim için değerli"
|
|
267
|
+
/>
|
|
268
|
+
</View>
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Props
|
|
274
|
+
|
|
275
|
+
### AtomicTextAreaProps
|
|
276
|
+
|
|
277
|
+
| Prop | Tip | Varsayılan | Açıklama |
|
|
278
|
+
|------|-----|------------|----------|
|
|
279
|
+
| `label` | `string` | - | Etiket metni |
|
|
280
|
+
| `value` | `string` | - | Textarea değeri |
|
|
281
|
+
| `onChangeText` | `(text: string) => void` | - | Değişiklik olayı |
|
|
282
|
+
| `placeholder` | `string` | - | Placeholder metni |
|
|
283
|
+
| `helperText` | `string` | - | Yardımcı metin |
|
|
284
|
+
| `errorText` | `string` | - | Hata mesajı |
|
|
285
|
+
| `maxLength` | `number` | - | Maksimum karakter |
|
|
286
|
+
| `numberOfLines` | `number` | - | Satır sayısı (alternatif) |
|
|
287
|
+
| `rows` | `number` | `4` | Satır sayısı |
|
|
288
|
+
| `minHeight` | `number` | - | Minimum yükseklik |
|
|
289
|
+
| `disabled` | `boolean` | `false` | Devre dışı |
|
|
290
|
+
| `autoFocus` | `boolean` | - | Otomatik odak |
|
|
291
|
+
| `returnKeyType` | `ReturnKeyType` | - | Return tuşu |
|
|
292
|
+
| `onSubmitEditing` | `() => void` | - | Submit olayı |
|
|
293
|
+
| `blurOnSubmit` | `boolean` | - | Submit'te blur |
|
|
294
|
+
| `style` | `StyleProp<ViewStyle>` | - | Container stil |
|
|
295
|
+
| `inputStyle` | `StyleProp<TextStyle>` | - | Input stil |
|
|
296
|
+
| `testID` | `string` | - | Test ID'si |
|
|
297
|
+
|
|
298
|
+
## Best Practices
|
|
299
|
+
|
|
300
|
+
### 1. Satır Sayısı
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
// Kısa metinler için
|
|
304
|
+
<AtomicTextArea rows={2} />
|
|
305
|
+
|
|
306
|
+
// Normal kullanım
|
|
307
|
+
<AtomicTextArea rows={4} />
|
|
308
|
+
|
|
309
|
+
// Uzun metinler için
|
|
310
|
+
<AtomicTextArea rows={8} />
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### 2. Character Limit
|
|
314
|
+
|
|
315
|
+
```tsx
|
|
316
|
+
// Kısa limit
|
|
317
|
+
<AtomicTextArea maxLength={100} />
|
|
318
|
+
|
|
319
|
+
// Orta limit
|
|
320
|
+
<AtomicTextArea maxLength={500} />
|
|
321
|
+
|
|
322
|
+
// Uzun limit
|
|
323
|
+
<AtomicTextArea maxLength={1000} />
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### 3. Helper Text
|
|
327
|
+
|
|
328
|
+
```tsx
|
|
329
|
+
// Kullanıcıya rehberlik edin
|
|
330
|
+
<AtomicTextArea
|
|
331
|
+
helperText="En az 50 karakter"
|
|
332
|
+
/>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Erişilebilirlik
|
|
336
|
+
|
|
337
|
+
AtomicTextArea, tam erişilebilirlik desteği sunar:
|
|
338
|
+
|
|
339
|
+
- ✅ Label ilişkilendirmesi
|
|
340
|
+
- ✅ Error state anonsu
|
|
341
|
+
- ✅ Character counter
|
|
342
|
+
- ✅ Screen reader desteği
|
|
343
|
+
|
|
344
|
+
## İlgili Bileşenler
|
|
345
|
+
|
|
346
|
+
- [`AtomicInput`](./input/README.md) - Tek satırlı input
|
|
347
|
+
- [`FormField`](../../molecules/FormField/README.md) - Form alanı
|
|
348
|
+
- [`AtomicText`](./AtomicText/README.md) - Metin bileşeni
|
|
349
|
+
|
|
350
|
+
## Lisans
|
|
351
|
+
|
|
352
|
+
MIT
|