@umituz/react-native-design-system 2.6.93 → 2.6.95
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 +284 -397
- package/src/atoms/AtomicBadge.README.md +123 -358
- package/src/atoms/AtomicCard.README.md +358 -247
- package/src/atoms/AtomicDatePicker.README.md +127 -332
- package/src/atoms/AtomicFab.README.md +194 -352
- package/src/atoms/AtomicIcon.README.md +241 -274
- package/src/atoms/AtomicProgress.README.md +100 -338
- package/src/atoms/AtomicSpinner.README.md +304 -337
- package/src/atoms/AtomicText.README.md +153 -389
- package/src/atoms/AtomicTextArea.README.md +267 -268
- package/src/atoms/EmptyState.README.md +247 -292
- package/src/atoms/GlassView/README.md +313 -444
- package/src/atoms/button/README.md +186 -297
- package/src/atoms/button/STRATEGY.md +252 -0
- package/src/atoms/chip/README.md +242 -290
- package/src/atoms/input/README.md +296 -290
- package/src/atoms/picker/README.md +278 -309
- package/src/atoms/skeleton/AtomicSkeleton.README.md +394 -252
- package/src/exports/theme.ts +0 -1
- package/src/molecules/BaseModal/README.md +356 -0
- package/src/molecules/BaseModal.README.md +324 -200
- package/src/molecules/ConfirmationModal.README.md +349 -302
- package/src/molecules/Divider/README.md +293 -376
- package/src/molecules/FormField.README.md +321 -534
- package/src/molecules/GlowingCard/GlowingCard.tsx +1 -1
- package/src/molecules/GlowingCard/README.md +230 -372
- package/src/molecules/IconContainer.tsx +1 -1
- package/src/molecules/List/README.md +281 -488
- package/src/molecules/ListItem.README.md +320 -315
- package/src/molecules/SearchBar/README.md +332 -430
- package/src/molecules/StepHeader/README.md +311 -411
- package/src/molecules/StepProgress/README.md +281 -448
- package/src/molecules/alerts/README.md +272 -355
- package/src/molecules/avatar/README.md +295 -356
- package/src/molecules/bottom-sheet/README.md +303 -340
- package/src/molecules/calendar/README.md +301 -265
- package/src/molecules/countdown/README.md +347 -456
- package/src/molecules/emoji/README.md +281 -514
- package/src/molecules/listitem/README.md +307 -399
- package/src/molecules/media-card/MediaCard.tsx +31 -34
- package/src/molecules/media-card/README.md +217 -319
- package/src/molecules/navigation/README.md +263 -284
- package/src/molecules/splash/README.md +76 -92
- package/src/molecules/swipe-actions/README.md +376 -588
|
@@ -1,352 +1,351 @@
|
|
|
1
1
|
# AtomicTextArea
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A multi-line text input component optimized for longer content.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Import & Usage
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
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';
|
|
7
|
+
```typescript
|
|
8
|
+
import { AtomicTextArea } from 'react-native-design-system/src/atoms/AtomicTextArea';
|
|
19
9
|
```
|
|
20
10
|
|
|
21
|
-
|
|
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
|
-
```
|
|
11
|
+
**Location:** `src/atoms/AtomicTextArea.tsx`
|
|
44
12
|
|
|
45
|
-
## Basic
|
|
13
|
+
## Basic Usage
|
|
46
14
|
|
|
47
15
|
```tsx
|
|
48
16
|
<AtomicTextArea
|
|
17
|
+
label="Description"
|
|
49
18
|
value={value}
|
|
50
19
|
onChangeText={setValue}
|
|
51
|
-
placeholder="
|
|
20
|
+
placeholder="Enter description"
|
|
21
|
+
rows={4}
|
|
52
22
|
/>
|
|
53
23
|
```
|
|
54
24
|
|
|
55
|
-
##
|
|
25
|
+
## Strategy
|
|
56
26
|
|
|
57
|
-
|
|
58
|
-
<AtomicTextArea
|
|
59
|
-
label="Hakkımda"
|
|
60
|
-
value={value}
|
|
61
|
-
onChangeText={setValue}
|
|
62
|
-
placeholder="Kendinizden bahsedin"
|
|
63
|
-
/>
|
|
64
|
-
```
|
|
27
|
+
**Purpose**: Provide accessible multi-line text input for longer content.
|
|
65
28
|
|
|
66
|
-
|
|
29
|
+
**When to Use**:
|
|
30
|
+
- Descriptions, comments, feedback
|
|
31
|
+
- Addresses, bio information
|
|
32
|
+
- Any text input needing multiple lines
|
|
33
|
+
- Content exceeding single-line capacity
|
|
67
34
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
35
|
+
**When NOT to Use**:
|
|
36
|
+
- For single-line inputs (use AtomicInput instead)
|
|
37
|
+
- For numeric input (use numeric keyboard input)
|
|
38
|
+
- For passwords (use secure text entry on AtomicInput)
|
|
39
|
+
|
|
40
|
+
## Rules
|
|
41
|
+
|
|
42
|
+
### Required
|
|
43
|
+
|
|
44
|
+
1. **MUST** provide `value` and `onChangeText` (controlled input)
|
|
45
|
+
2. **SHOULD** provide `label` for accessibility
|
|
46
|
+
3. **MUST** show error messages clearly
|
|
47
|
+
4. **ALWAYS** provide helpful placeholder text
|
|
48
|
+
5. **SHOULD** set appropriate `rows` for content
|
|
49
|
+
6. **MUST** clear errors when user starts typing
|
|
50
|
+
7. **ALWAYS** use `helperText` for format requirements
|
|
51
|
+
|
|
52
|
+
### Validation Rules
|
|
53
|
+
|
|
54
|
+
1. **Validate on blur**: Check validity when user leaves field
|
|
55
|
+
2. **Clear on type**: Remove error when user starts typing
|
|
56
|
+
3. **Show inline errors**: Display errors below textarea
|
|
57
|
+
4. **Helper text**: Show format requirements
|
|
58
|
+
|
|
59
|
+
### Character Limits
|
|
60
|
+
|
|
61
|
+
1. **Set maxLength**: When there's a maximum
|
|
62
|
+
2. **Show counter**: Display remaining characters
|
|
63
|
+
3. **Enforce limits**: Prevent exceeding maximum
|
|
64
|
+
|
|
65
|
+
## Forbidden
|
|
89
66
|
|
|
90
|
-
|
|
67
|
+
❌ **NEVER** do these:
|
|
91
68
|
|
|
92
69
|
```tsx
|
|
70
|
+
// ❌ Uncontrolled input
|
|
93
71
|
<AtomicTextArea
|
|
94
|
-
|
|
95
|
-
onChangeText
|
|
96
|
-
maxLength={200}
|
|
97
|
-
placeholder="En az 200 karakter"
|
|
72
|
+
placeholder="Enter text"
|
|
73
|
+
// ❌ Missing value and onChangeText
|
|
98
74
|
/>
|
|
99
|
-
```
|
|
100
75
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
```tsx
|
|
76
|
+
// ❌ No label
|
|
104
77
|
<AtomicTextArea
|
|
105
|
-
label="Açıklama"
|
|
106
78
|
value={value}
|
|
107
79
|
onChangeText={setValue}
|
|
108
|
-
|
|
80
|
+
placeholder="Description" {/* ❌ Placeholder is not a label */}
|
|
109
81
|
/>
|
|
110
|
-
```
|
|
111
82
|
|
|
112
|
-
|
|
83
|
+
// ❌ Generic error message
|
|
84
|
+
<AtomicTextArea
|
|
85
|
+
error="Invalid" {/* ❌ Not actionable */}
|
|
86
|
+
/>
|
|
113
87
|
|
|
114
|
-
|
|
88
|
+
// ❌ Error persists after correction
|
|
115
89
|
<AtomicTextArea
|
|
116
|
-
label="Ürün Açıklaması"
|
|
117
90
|
value={value}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
placeholder="Ürün özellikleri, kullanım alanları vb."
|
|
91
|
+
error={error}
|
|
92
|
+
onChangeText={setValue} {/* ❌ Error still shows when typing */}
|
|
121
93
|
/>
|
|
122
|
-
```
|
|
123
94
|
|
|
124
|
-
|
|
95
|
+
// ❌ Wrong number of rows
|
|
96
|
+
<AtomicTextArea
|
|
97
|
+
rows={20} {/* ❌ Too many rows, use 2-8 */}
|
|
98
|
+
/>
|
|
125
99
|
|
|
126
|
-
|
|
100
|
+
// ❌ Missing helper text for requirements
|
|
127
101
|
<AtomicTextArea
|
|
128
|
-
label="
|
|
129
|
-
|
|
130
|
-
|
|
102
|
+
label="Bio"
|
|
103
|
+
maxLength={150}
|
|
104
|
+
// ❌ Should show character limit
|
|
131
105
|
/>
|
|
132
106
|
```
|
|
133
107
|
|
|
134
|
-
##
|
|
108
|
+
## Best Practices
|
|
109
|
+
|
|
110
|
+
### Controlled Input
|
|
135
111
|
|
|
112
|
+
✅ **DO**:
|
|
136
113
|
```tsx
|
|
114
|
+
const [value, setValue] = useState('');
|
|
115
|
+
|
|
137
116
|
<AtomicTextArea
|
|
117
|
+
label="Description"
|
|
138
118
|
value={value}
|
|
139
119
|
onChangeText={setValue}
|
|
140
|
-
|
|
141
|
-
|
|
120
|
+
placeholder="Enter description"
|
|
121
|
+
rows={4}
|
|
142
122
|
/>
|
|
143
123
|
```
|
|
144
124
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
### Form Alanı
|
|
148
|
-
|
|
125
|
+
❌ **DON'T**:
|
|
149
126
|
```tsx
|
|
150
|
-
|
|
151
|
-
|
|
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
|
|
127
|
+
// ❌ Uncontrolled
|
|
128
|
+
<AtomicTextArea placeholder="Enter text" />
|
|
170
129
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
};
|
|
130
|
+
// ❌ Missing handler
|
|
131
|
+
<AtomicTextArea
|
|
132
|
+
value={value}
|
|
133
|
+
placeholder="Text" {/* No onChangeText */}
|
|
134
|
+
/>
|
|
200
135
|
```
|
|
201
136
|
|
|
202
|
-
###
|
|
137
|
+
### Error Handling
|
|
203
138
|
|
|
139
|
+
✅ **DO**:
|
|
204
140
|
```tsx
|
|
205
|
-
|
|
206
|
-
|
|
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
|
|
141
|
+
const [value, setValue] = useState('');
|
|
142
|
+
const [error, setError] = useState('');
|
|
224
143
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
);
|
|
144
|
+
const handleChange = (text) => {
|
|
145
|
+
setValue(text);
|
|
146
|
+
if (error) setError(''); // Clear error on type
|
|
248
147
|
};
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
### Geri Bildirim
|
|
252
148
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
-
);
|
|
149
|
+
const handleBlur = () => {
|
|
150
|
+
if (!value) setError('Description is required');
|
|
151
|
+
else if (value.length < 10) setError('Minimum 10 characters');
|
|
270
152
|
};
|
|
153
|
+
|
|
154
|
+
<AtomicTextArea
|
|
155
|
+
label="Description"
|
|
156
|
+
value={value}
|
|
157
|
+
onChangeText={handleChange}
|
|
158
|
+
onBlur={handleBlur}
|
|
159
|
+
error={error}
|
|
160
|
+
rows={4}
|
|
161
|
+
/>
|
|
271
162
|
```
|
|
272
163
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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 |
|
|
164
|
+
❌ **DON'T**:
|
|
165
|
+
```tsx
|
|
166
|
+
// ❌ Generic error
|
|
167
|
+
<AtomicTextArea error="Invalid" />
|
|
297
168
|
|
|
298
|
-
|
|
169
|
+
// ❌ Error persists
|
|
170
|
+
<AtomicTextArea
|
|
171
|
+
value={value}
|
|
172
|
+
error={error}
|
|
173
|
+
onChangeText={setValue} {/* Error doesn't clear */}
|
|
174
|
+
/>
|
|
175
|
+
```
|
|
299
176
|
|
|
300
|
-
###
|
|
177
|
+
### Character Limits
|
|
301
178
|
|
|
179
|
+
✅ **DO**:
|
|
302
180
|
```tsx
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
181
|
+
<AtomicTextArea
|
|
182
|
+
label="Bio"
|
|
183
|
+
value={value}
|
|
184
|
+
onChangeText={setValue}
|
|
185
|
+
maxLength={150}
|
|
186
|
+
rows={3}
|
|
187
|
+
helperText="Maximum 150 characters"
|
|
188
|
+
/>
|
|
308
189
|
|
|
309
|
-
|
|
310
|
-
<
|
|
190
|
+
{value.length > 0 && (
|
|
191
|
+
<AtomicText type="bodySmall" color="textSecondary">
|
|
192
|
+
{value.length}/150 characters
|
|
193
|
+
</AtomicText>
|
|
194
|
+
)}
|
|
311
195
|
```
|
|
312
196
|
|
|
313
|
-
|
|
197
|
+
❌ **DON'T**:
|
|
198
|
+
```tsx
|
|
199
|
+
// ❌ No indication of limit
|
|
200
|
+
<AtomicTextArea
|
|
201
|
+
maxLength={150}
|
|
202
|
+
// ❌ User doesn't know limit exists
|
|
203
|
+
/>
|
|
204
|
+
```
|
|
314
205
|
|
|
206
|
+
## AI Coding Guidelines
|
|
207
|
+
|
|
208
|
+
### For AI Agents
|
|
209
|
+
|
|
210
|
+
When generating AtomicTextArea components, follow these rules:
|
|
211
|
+
|
|
212
|
+
1. **Always use controlled input**:
|
|
213
|
+
```tsx
|
|
214
|
+
// ✅ Good
|
|
215
|
+
const [value, setValue] = useState('');
|
|
216
|
+
<AtomicTextArea
|
|
217
|
+
value={value}
|
|
218
|
+
onChangeText={setValue}
|
|
219
|
+
label="Description"
|
|
220
|
+
/>
|
|
221
|
+
|
|
222
|
+
// ❌ Bad
|
|
223
|
+
<AtomicTextArea placeholder="Enter text" />
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
2. **Always provide label**:
|
|
227
|
+
```tsx
|
|
228
|
+
// ✅ Good
|
|
229
|
+
<AtomicTextArea
|
|
230
|
+
label="Description"
|
|
231
|
+
value={value}
|
|
232
|
+
onChangeText={setValue}
|
|
233
|
+
/>
|
|
234
|
+
|
|
235
|
+
// ❌ Bad
|
|
236
|
+
<AtomicTextArea
|
|
237
|
+
value={value}
|
|
238
|
+
onChangeText={setValue}
|
|
239
|
+
placeholder="Description" // Not a label
|
|
240
|
+
/>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
3. **Always handle errors properly**:
|
|
244
|
+
```tsx
|
|
245
|
+
// ✅ Good - clears error
|
|
246
|
+
const handleChange = (text) => {
|
|
247
|
+
setValue(text);
|
|
248
|
+
if (error) setError('');
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// ❌ Bad - error persists
|
|
252
|
+
const handleChange = (text) => {
|
|
253
|
+
setValue(text);
|
|
254
|
+
};
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
4. **Always use appropriate row count**:
|
|
258
|
+
```tsx
|
|
259
|
+
// ✅ Good - reasonable rows
|
|
260
|
+
<AtomicTextArea rows={2} /> // Short input
|
|
261
|
+
<AtomicTextArea rows={4} /> // Normal
|
|
262
|
+
<AtomicTextArea rows={8} /> // Long content
|
|
263
|
+
|
|
264
|
+
// ❌ Bad - too many
|
|
265
|
+
<AtomicTextArea rows={20} />
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Common Patterns
|
|
269
|
+
|
|
270
|
+
#### Basic TextArea
|
|
315
271
|
```tsx
|
|
316
|
-
|
|
317
|
-
|
|
272
|
+
<AtomicTextArea
|
|
273
|
+
label="Description"
|
|
274
|
+
value={value}
|
|
275
|
+
onChangeText={setValue}
|
|
276
|
+
placeholder="Enter description"
|
|
277
|
+
rows={4}
|
|
278
|
+
/>
|
|
279
|
+
```
|
|
318
280
|
|
|
319
|
-
|
|
320
|
-
|
|
281
|
+
#### With Validation
|
|
282
|
+
```tsx
|
|
283
|
+
const [value, setValue] = useState('');
|
|
284
|
+
const [error, setError] = useState('');
|
|
321
285
|
|
|
322
|
-
|
|
323
|
-
|
|
286
|
+
<AtomicTextArea
|
|
287
|
+
label="Description"
|
|
288
|
+
value={value}
|
|
289
|
+
onChangeText={(text) => {
|
|
290
|
+
setValue(text);
|
|
291
|
+
if (error) setError('');
|
|
292
|
+
}}
|
|
293
|
+
onBlur={() => {
|
|
294
|
+
if (!value) setError('Required');
|
|
295
|
+
}}
|
|
296
|
+
error={error}
|
|
297
|
+
rows={4}
|
|
298
|
+
/>
|
|
324
299
|
```
|
|
325
300
|
|
|
326
|
-
|
|
327
|
-
|
|
301
|
+
#### With Character Limit
|
|
328
302
|
```tsx
|
|
329
|
-
// Kullanıcıya rehberlik edin
|
|
330
303
|
<AtomicTextArea
|
|
331
|
-
|
|
304
|
+
label="Bio"
|
|
305
|
+
value={value}
|
|
306
|
+
onChangeText={setValue}
|
|
307
|
+
maxLength={150}
|
|
308
|
+
rows={3}
|
|
309
|
+
helperText="Maximum 150 characters"
|
|
332
310
|
/>
|
|
333
311
|
```
|
|
334
312
|
|
|
335
|
-
##
|
|
313
|
+
## Props Reference
|
|
314
|
+
|
|
315
|
+
| Prop | Type | Required | Default | Description |
|
|
316
|
+
|------|------|----------|---------|-------------|
|
|
317
|
+
| `label` | `string` | No | - | Field label |
|
|
318
|
+
| `value` | `string` | Yes | - | Input value |
|
|
319
|
+
| `onChangeText` | `(text: string) => void` | Yes | - | Change callback |
|
|
320
|
+
| `placeholder` | `string` | No | - | Placeholder text |
|
|
321
|
+
| `helperText` | `string` | No | - | Helper text |
|
|
322
|
+
| `error` | `string` | No | - | Error message |
|
|
323
|
+
| `maxLength` | `number` | No | - | Maximum characters |
|
|
324
|
+
| `rows` | `number` | No | `4` | Number of rows |
|
|
325
|
+
| `minHeight` | `number` | No | - | Minimum height |
|
|
326
|
+
| `disabled` | `boolean` | No | `false` | Disabled state |
|
|
327
|
+
| `autoFocus` | `boolean` | No | - | Auto focus |
|
|
328
|
+
| `testID` | `string` | No | - | Test identifier |
|
|
329
|
+
|
|
330
|
+
## Accessibility
|
|
331
|
+
|
|
332
|
+
- ✅ Label association
|
|
333
|
+
- ✅ Error state announcement
|
|
334
|
+
- ✅ Character counter
|
|
335
|
+
- ✅ Screen reader support
|
|
336
336
|
|
|
337
|
-
|
|
337
|
+
## Performance Tips
|
|
338
338
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
- ✅ Screen reader desteği
|
|
339
|
+
1. **Controlled inputs**: Always use state
|
|
340
|
+
2. **Memoization**: Memo validation functions
|
|
341
|
+
3. **Debounce**: Debounce validation for better UX
|
|
343
342
|
|
|
344
|
-
##
|
|
343
|
+
## Related Components
|
|
345
344
|
|
|
346
|
-
- [`AtomicInput`](./
|
|
347
|
-
- [`FormField`](
|
|
348
|
-
- [`AtomicText`](./AtomicText
|
|
345
|
+
- [`AtomicInput`](./AtomicInput.README.md) - Single-line input
|
|
346
|
+
- [`FormField`](../molecules/FormField) - Form field wrapper
|
|
347
|
+
- [`AtomicText`](./AtomicText.README.md) - Text component
|
|
349
348
|
|
|
350
|
-
##
|
|
349
|
+
## License
|
|
351
350
|
|
|
352
351
|
MIT
|