@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,470 +1,234 @@
|
|
|
1
1
|
# AtomicText
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A theme-aware text component with Material Design 3 typography system.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Import & Usage
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- ⚙️ **Kolay Özelleştirme**: Convenience props
|
|
11
|
-
- 🎯 **Semantic Colors**: Anlamlı renk seçenekleri
|
|
12
|
-
- ♿ **Erişilebilir**: Tam erişilebilirlik desteği
|
|
7
|
+
```typescript
|
|
8
|
+
import { AtomicText } from 'react-native-design-system/src/atoms/AtomicText';
|
|
9
|
+
```
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
**Location:** `src/atoms/AtomicText.tsx`
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
15
14
|
|
|
16
15
|
```tsx
|
|
17
|
-
|
|
16
|
+
<AtomicText>Hello World</AtomicText>
|
|
18
17
|
```
|
|
19
18
|
|
|
20
|
-
##
|
|
19
|
+
## Strategy
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
import React from 'react';
|
|
24
|
-
import { View } from 'react-native';
|
|
25
|
-
import { AtomicText } from 'react-native-design-system';
|
|
26
|
-
|
|
27
|
-
export const BasicExample = () => {
|
|
28
|
-
return (
|
|
29
|
-
<View style={{ padding: 16 }}>
|
|
30
|
-
<AtomicText>Merhaba Dünya!</AtomicText>
|
|
31
|
-
</View>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
```
|
|
21
|
+
**Purpose**: Provide consistent, theme-integrated typography.
|
|
35
22
|
|
|
36
|
-
|
|
23
|
+
**When to Use**:
|
|
24
|
+
- ALL text display
|
|
25
|
+
- Headlines, titles, body text
|
|
26
|
+
- Labels, captions
|
|
27
|
+
- Any text content
|
|
37
28
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{/* Display */}
|
|
41
|
-
<AtomicText type="displayLarge">Display Large</AtomicText>
|
|
42
|
-
<AtomicText type="displayMedium">Display Medium</AtomicText>
|
|
43
|
-
<AtomicText type="displaySmall">Display Small</AtomicText>
|
|
44
|
-
|
|
45
|
-
{/* Headline */}
|
|
46
|
-
<AtomicText type="headlineLarge">Headline Large</AtomicText>
|
|
47
|
-
<AtomicText type="headlineMedium">Headline Medium</AtomicText>
|
|
48
|
-
<AtomicText type="headlineSmall">Headline Small</AtomicText>
|
|
49
|
-
|
|
50
|
-
{/* Title */}
|
|
51
|
-
<AtomicText type="titleLarge">Title Large</AtomicText>
|
|
52
|
-
<AtomicText type="titleMedium">Title Medium</AtomicText>
|
|
53
|
-
<AtomicText type="titleSmall">Title Small</AtomicText>
|
|
54
|
-
|
|
55
|
-
{/* Label */}
|
|
56
|
-
<AtomicText type="labelLarge">Label Large</AtomicText>
|
|
57
|
-
<AtomicText type="labelMedium">Label Medium</AtomicText>
|
|
58
|
-
<AtomicText type="labelSmall">Label Small</AtomicText>
|
|
59
|
-
|
|
60
|
-
{/* Body */}
|
|
61
|
-
<AtomicText type="bodyLarge">Body Large</AtomicText>
|
|
62
|
-
<AtomicText type="bodyMedium">Body Medium</AtomicText>
|
|
63
|
-
<AtomicText type="bodySmall">Body Small</AtomicText>
|
|
64
|
-
</View>
|
|
65
|
-
```
|
|
29
|
+
**When NOT to Use**:
|
|
30
|
+
- Never - use for all text display
|
|
66
31
|
|
|
67
|
-
##
|
|
32
|
+
## Rules
|
|
68
33
|
|
|
69
|
-
|
|
70
|
-
<View style={{ gap: 8 }}>
|
|
71
|
-
<AtomicText color="primary">Primary Renk</AtomicText>
|
|
72
|
-
<AtomicText color="secondary">Secondary Renk</AtomicText>
|
|
73
|
-
<AtomicText color="success">Success Renk</AtomicText>
|
|
74
|
-
<AtomicText color="warning">Warning Renk</AtomicText>
|
|
75
|
-
<AtomicText color="error">Error Renk</AtomicText>
|
|
76
|
-
<AtomicText color="info">Info Renk</AtomicText>
|
|
77
|
-
|
|
78
|
-
{/* Text colors */}
|
|
79
|
-
<AtomicText color="textPrimary">Primary Text</AtomicText>
|
|
80
|
-
<AtomicText color="textSecondary">Secondary Text</AtomicText>
|
|
81
|
-
<AtomicText color="textTertiary">Tertiary Text</AtomicText>
|
|
82
|
-
</View>
|
|
83
|
-
```
|
|
34
|
+
### Required
|
|
84
35
|
|
|
85
|
-
|
|
36
|
+
1. **MUST** use appropriate `type` for hierarchy
|
|
37
|
+
2. **ALWAYS** use semantic colors for meaning
|
|
38
|
+
3. **SHOULD** maintain consistent spacing
|
|
39
|
+
4. **MUST** be accessible (contrast, font scaling)
|
|
40
|
+
5. **ALWAYS** use convenience props for spacing
|
|
41
|
+
6. **SHOULD** follow content hierarchy
|
|
86
42
|
|
|
87
|
-
|
|
88
|
-
<View style={{ gap: 16 }}>
|
|
89
|
-
<AtomicText align="left">Sola Hizalı</AtomicText>
|
|
90
|
-
<AtomicText align="center">Ortalanmış</AtomicText>
|
|
91
|
-
<AtomicText align="right">Sağa Hizalı</AtomicText>
|
|
92
|
-
<AtomicText align="justify">İki yana yaslı</AtomicText>
|
|
93
|
-
</View>
|
|
94
|
-
```
|
|
43
|
+
### Typography Hierarchy
|
|
95
44
|
|
|
96
|
-
|
|
45
|
+
1. **Display**: Hero content (rare)
|
|
46
|
+
2. **Headline**: Page/section titles
|
|
47
|
+
3. **Title**: Card titles, list items
|
|
48
|
+
4. **Label**: Buttons, tags, fields
|
|
49
|
+
5. **Body**: Main content (default)
|
|
97
50
|
|
|
98
|
-
|
|
99
|
-
<View style={{ gap: 8 }}>
|
|
100
|
-
<AtomicText fontWeight="100">Thin (100)</AtomicText>
|
|
101
|
-
<AtomicText fontWeight="300">Light (300)</AtomicText>
|
|
102
|
-
<AtomicText fontWeight="400">Regular (400)</AtomicText>
|
|
103
|
-
<AtomicText fontWeight="500">Medium (500)</AtomicText>
|
|
104
|
-
<AtomicText fontWeight="600">Semi Bold (600)</AtomicText>
|
|
105
|
-
<AtomicText fontWeight="700">Bold (700)</AtomicText>
|
|
106
|
-
<AtomicText fontWeight="900">Black (900)</AtomicText>
|
|
107
|
-
</View>
|
|
108
|
-
```
|
|
51
|
+
### Color Semantics
|
|
109
52
|
|
|
110
|
-
|
|
53
|
+
1. **textPrimary**: Main content
|
|
54
|
+
2. **textSecondary**: Supporting content
|
|
55
|
+
3. **textTertiary**: Placeholder, disabled
|
|
56
|
+
4. **primary/secondary/success/error**: Semantic meaning
|
|
111
57
|
|
|
112
|
-
|
|
113
|
-
<View>
|
|
114
|
-
<AtomicText type="titleLarge" marginBottom="sm">
|
|
115
|
-
Başlık
|
|
116
|
-
</AtomicText>
|
|
117
|
-
|
|
118
|
-
<AtomicText marginTop="sm" marginBottom="md">
|
|
119
|
-
Açıklama metni
|
|
120
|
-
</AtomicText>
|
|
121
|
-
|
|
122
|
-
<AtomicText marginTop="lg">
|
|
123
|
-
Daha fazla içerik
|
|
124
|
-
</AtomicText>
|
|
125
|
-
</View>
|
|
126
|
-
```
|
|
58
|
+
## Forbidden
|
|
127
59
|
|
|
128
|
-
|
|
60
|
+
❌ **NEVER** do these:
|
|
129
61
|
|
|
130
62
|
```tsx
|
|
131
|
-
|
|
132
|
-
<AtomicText
|
|
133
|
-
<AtomicText color="rgba(99, 102, 241, 0.5)">RGBA Renk</AtomicText>
|
|
134
|
-
```
|
|
63
|
+
// ❌ Wrong hierarchy
|
|
64
|
+
<AtomicText type="displayLarge">Small note</AtomicText> {/* ❌ Too large */}
|
|
135
65
|
|
|
136
|
-
|
|
66
|
+
<AtomicText type="bodySmall">Main Title</AtomicText> {/* ❌ Too small */}
|
|
137
67
|
|
|
138
|
-
|
|
139
|
-
<AtomicText
|
|
140
|
-
|
|
141
|
-
style={{
|
|
142
|
-
textDecorationLine: 'underline',
|
|
143
|
-
fontStyle: 'italic',
|
|
144
|
-
letterSpacing: 1,
|
|
145
|
-
lineHeight: 28,
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
148
|
-
Özel Stilli Metin
|
|
68
|
+
// ❌ Confusing colors
|
|
69
|
+
<AtomicText type="headlineLarge" color="error">
|
|
70
|
+
Success Message {/* ❌ Confusing */}
|
|
149
71
|
</AtomicText>
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
## Örnek Kullanımlar
|
|
153
72
|
|
|
154
|
-
|
|
73
|
+
// ❌ Manual spacing
|
|
74
|
+
<AtomicText type="titleLarge">
|
|
75
|
+
Title
|
|
76
|
+
</AtomicText>
|
|
77
|
+
<View style={{ height: 16 }} /> {/* ❌ Use marginTop */}
|
|
78
|
+
<AtomicText>Content</AtomicText>
|
|
155
79
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
{title}
|
|
162
|
-
</AtomicText>
|
|
163
|
-
|
|
164
|
-
{subtitle && (
|
|
165
|
-
<AtomicText type="bodyLarge" color="textSecondary">
|
|
166
|
-
{subtitle}
|
|
167
|
-
</AtomicText>
|
|
168
|
-
)}
|
|
169
|
-
</View>
|
|
170
|
-
);
|
|
171
|
-
};
|
|
80
|
+
// ❌ Inline styles for standard props
|
|
81
|
+
<AtomicText
|
|
82
|
+
style={{ fontSize: 16, fontWeight: '600', color: 'blue' }}
|
|
83
|
+
// ❌ Should use type and color props
|
|
84
|
+
/>
|
|
172
85
|
```
|
|
173
86
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
```tsx
|
|
177
|
-
export const CardContent = ({ title, description }) => {
|
|
178
|
-
return (
|
|
179
|
-
<View style={{ padding: 16 }}>
|
|
180
|
-
<AtomicText type="titleLarge" marginBottom="xs">
|
|
181
|
-
{title}
|
|
182
|
-
</AtomicText>
|
|
183
|
-
|
|
184
|
-
<AtomicText type="bodyMedium" color="textSecondary">
|
|
185
|
-
{description}
|
|
186
|
-
</AtomicText>
|
|
187
|
-
</View>
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
```
|
|
87
|
+
## Best Practices
|
|
191
88
|
|
|
192
|
-
###
|
|
89
|
+
### Typography Hierarchy
|
|
193
90
|
|
|
91
|
+
✅ **DO**:
|
|
194
92
|
```tsx
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
{label}
|
|
200
|
-
</AtomicText>
|
|
201
|
-
|
|
202
|
-
{required && (
|
|
203
|
-
<AtomicText type="labelLarge" color="error">
|
|
204
|
-
*
|
|
205
|
-
</AtomicText>
|
|
206
|
-
)}
|
|
207
|
-
</View>
|
|
208
|
-
);
|
|
209
|
-
};
|
|
93
|
+
<AtomicText type="headlineLarge">Page Title</AtomicText>
|
|
94
|
+
<AtomicText type="titleMedium">Card Title</AtomicText>
|
|
95
|
+
<AtomicText type="bodyMedium">Body content</AtomicText>
|
|
96
|
+
<AtomicText type="labelSmall">Button text</AtomicText>
|
|
210
97
|
```
|
|
211
98
|
|
|
212
|
-
|
|
213
|
-
|
|
99
|
+
❌ **DON'T**:
|
|
214
100
|
```tsx
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
type="bodySmall"
|
|
219
|
-
color="error"
|
|
220
|
-
marginTop="xs"
|
|
221
|
-
>
|
|
222
|
-
{message}
|
|
223
|
-
</AtomicText>
|
|
224
|
-
);
|
|
225
|
-
};
|
|
101
|
+
// ❌ Wrong types
|
|
102
|
+
<AtomicText type="bodySmall">Page Title</AtomicText>
|
|
103
|
+
<AtomicText type="displayLarge">Caption</AtomicText>
|
|
226
104
|
```
|
|
227
105
|
|
|
228
|
-
###
|
|
106
|
+
### Semantic Colors
|
|
229
107
|
|
|
108
|
+
✅ **DO**:
|
|
230
109
|
```tsx
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
color="success"
|
|
236
|
-
align="center"
|
|
237
|
-
>
|
|
238
|
-
{message}
|
|
239
|
-
</AtomicText>
|
|
240
|
-
);
|
|
241
|
-
};
|
|
110
|
+
<AtomicText color="textPrimary">Main content</AtomicText>
|
|
111
|
+
<AtomicText color="textSecondary">Secondary info</AtomicText>
|
|
112
|
+
<AtomicText color="error">Error message</AtomicText>
|
|
113
|
+
<AtomicText color="success">Success message</AtomicText>
|
|
242
114
|
```
|
|
243
115
|
|
|
244
|
-
|
|
245
|
-
|
|
116
|
+
❌ **DON'T**:
|
|
246
117
|
```tsx
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
</AtomicText>
|
|
253
|
-
|
|
254
|
-
{subtitle && (
|
|
255
|
-
<AtomicText
|
|
256
|
-
type="bodyMedium"
|
|
257
|
-
color="textSecondary"
|
|
258
|
-
marginTop="xs"
|
|
259
|
-
>
|
|
260
|
-
{subtitle}
|
|
261
|
-
</AtomicText>
|
|
262
|
-
)}
|
|
263
|
-
|
|
264
|
-
{timestamp && (
|
|
265
|
-
<AtomicText
|
|
266
|
-
type="bodySmall"
|
|
267
|
-
color="textTertiary"
|
|
268
|
-
marginTop="xs"
|
|
269
|
-
>
|
|
270
|
-
{timestamp}
|
|
271
|
-
</AtomicText>
|
|
272
|
-
)}
|
|
273
|
-
</View>
|
|
274
|
-
);
|
|
275
|
-
};
|
|
118
|
+
// ❌ Hardcoded colors
|
|
119
|
+
<AtomicText style={{ color: '#FF0000' }}>Error</AtomicText>
|
|
120
|
+
|
|
121
|
+
// ❌ Confusing semantics
|
|
122
|
+
<AtomicText color="success">Error occurred</AtomicText>
|
|
276
123
|
```
|
|
277
124
|
|
|
278
|
-
###
|
|
125
|
+
### Convenience Props
|
|
279
126
|
|
|
127
|
+
✅ **DO**:
|
|
280
128
|
```tsx
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
<AtomicText
|
|
289
|
-
type="displayLarge"
|
|
290
|
-
color="primary"
|
|
291
|
-
fontWeight="700"
|
|
292
|
-
marginBottom="md"
|
|
293
|
-
>
|
|
294
|
-
${price}
|
|
295
|
-
<AtomicText type="titleMedium">/ay</AtomicText>
|
|
296
|
-
</AtomicText>
|
|
297
|
-
|
|
298
|
-
{features.map((feature, index) => (
|
|
299
|
-
<AtomicText
|
|
300
|
-
key={index}
|
|
301
|
-
type="bodyMedium"
|
|
302
|
-
align="center"
|
|
303
|
-
marginTop="sm"
|
|
304
|
-
>
|
|
305
|
-
{feature}
|
|
306
|
-
</AtomicText>
|
|
307
|
-
))}
|
|
308
|
-
</View>
|
|
309
|
-
);
|
|
310
|
-
};
|
|
129
|
+
<AtomicText type="titleLarge" marginBottom="sm">
|
|
130
|
+
Title
|
|
131
|
+
</AtomicText>
|
|
132
|
+
<AtomicText marginTop="sm">
|
|
133
|
+
Content
|
|
134
|
+
</AtomicText>
|
|
311
135
|
```
|
|
312
136
|
|
|
313
|
-
|
|
314
|
-
|
|
137
|
+
❌ **DON'T**:
|
|
315
138
|
```tsx
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
{title}
|
|
321
|
-
</AtomicText>
|
|
322
|
-
|
|
323
|
-
<View style={{ flexDirection: 'row', marginBottom: 16 }}>
|
|
324
|
-
<AtomicText type="bodySmall" color="textSecondary">
|
|
325
|
-
{author}
|
|
326
|
-
</AtomicText>
|
|
327
|
-
<AtomicText type="bodySmall" color="textTertiary">
|
|
328
|
-
• {date}
|
|
329
|
-
</AtomicText>
|
|
330
|
-
</View>
|
|
331
|
-
|
|
332
|
-
<AtomicText type="bodyMedium" lineHeight={24}>
|
|
333
|
-
{content}
|
|
334
|
-
</AtomicText>
|
|
335
|
-
</View>
|
|
336
|
-
);
|
|
337
|
-
};
|
|
139
|
+
// ❌ Manual spacing
|
|
140
|
+
<AtomicText type="titleLarge">Title</AtomicText>
|
|
141
|
+
<View style={{ height: 12 }} />
|
|
142
|
+
<AtomicText>Content</AtomicText>
|
|
338
143
|
```
|
|
339
144
|
|
|
340
|
-
##
|
|
341
|
-
|
|
342
|
-
### AtomicTextProps
|
|
343
|
-
|
|
344
|
-
| Prop | Tip | Varsayılan | Açıklama |
|
|
345
|
-
|------|-----|------------|----------|
|
|
346
|
-
| `type` | `TextStyleVariant` | `'bodyMedium'` | Tipografi stili |
|
|
347
|
-
| `color` | `ColorVariant \| string` | `'textPrimary'` | Metin rengi |
|
|
348
|
-
| `align` | `TextStyle['textAlign']` | - | Metin hizalaması |
|
|
349
|
-
| `fontWeight` | `TextStyle['fontWeight']` | - | Font kalınlığı |
|
|
350
|
-
| `marginTop` | `keyof Spacing` | - | Üst boşluk |
|
|
351
|
-
| `marginBottom` | `keyof Spacing` | - | Alt boşluk |
|
|
352
|
-
| `children` | `ReactNode` | - **(Zorunlu)** | İçerik |
|
|
353
|
-
| `style` | `StyleProp<TextStyle>` | - | Özel stil |
|
|
354
|
-
| `testID` | `string` | - | Test ID'si |
|
|
355
|
-
|
|
356
|
-
### TextStyleVariant
|
|
357
|
-
|
|
358
|
-
```typescript
|
|
359
|
-
type TextStyleVariant =
|
|
360
|
-
// Display
|
|
361
|
-
| 'displayLarge'
|
|
362
|
-
| 'displayMedium'
|
|
363
|
-
| 'displaySmall'
|
|
364
|
-
// Headline
|
|
365
|
-
| 'headlineLarge'
|
|
366
|
-
| 'headlineMedium'
|
|
367
|
-
| 'headlineSmall'
|
|
368
|
-
// Title
|
|
369
|
-
| 'titleLarge'
|
|
370
|
-
| 'titleMedium'
|
|
371
|
-
| 'titleSmall'
|
|
372
|
-
// Label
|
|
373
|
-
| 'labelLarge'
|
|
374
|
-
| 'labelMedium'
|
|
375
|
-
| 'labelSmall'
|
|
376
|
-
// Body
|
|
377
|
-
| 'bodyLarge'
|
|
378
|
-
| 'bodyMedium'
|
|
379
|
-
| 'bodySmall';
|
|
380
|
-
```
|
|
145
|
+
## AI Coding Guidelines
|
|
381
146
|
|
|
382
|
-
###
|
|
147
|
+
### For AI Agents
|
|
383
148
|
|
|
384
|
-
|
|
385
|
-
type ColorVariant =
|
|
386
|
-
| 'primary'
|
|
387
|
-
| 'secondary'
|
|
388
|
-
| 'success'
|
|
389
|
-
| 'warning'
|
|
390
|
-
| 'error'
|
|
391
|
-
| 'info'
|
|
392
|
-
| 'textPrimary'
|
|
393
|
-
| 'textSecondary'
|
|
394
|
-
| 'textTertiary'
|
|
395
|
-
| 'onPrimary'
|
|
396
|
-
| 'onSecondary'
|
|
397
|
-
| 'onSurface';
|
|
398
|
-
```
|
|
149
|
+
When generating AtomicText components, follow these rules:
|
|
399
150
|
|
|
400
|
-
|
|
151
|
+
1. **Always use appropriate type**:
|
|
152
|
+
```tsx
|
|
153
|
+
// ✅ Good - correct hierarchy
|
|
154
|
+
<AtomicText type="headlineLarge">Page Title</AtomicText>
|
|
155
|
+
<AtomicText type="bodyMedium">Content</AtomicText>
|
|
401
156
|
|
|
402
|
-
|
|
157
|
+
// ❌ Bad - wrong hierarchy
|
|
158
|
+
<AtomicText type="bodySmall">Page Title</AtomicText>
|
|
159
|
+
```
|
|
403
160
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
161
|
+
2. **Always use semantic colors**:
|
|
162
|
+
```tsx
|
|
163
|
+
// ✅ Good - semantic colors
|
|
164
|
+
<AtomicText color="textPrimary">Main</AtomicText>
|
|
165
|
+
<AtomicText color="error">Error</AtomicText>
|
|
407
166
|
|
|
408
|
-
//
|
|
409
|
-
<AtomicText
|
|
167
|
+
// ❌ Bad - hardcoded
|
|
168
|
+
<AtomicText style={{ color: '#000' }}>Text</AtomicText>
|
|
169
|
+
```
|
|
410
170
|
|
|
411
|
-
|
|
412
|
-
|
|
171
|
+
3. **Always use convenience props**:
|
|
172
|
+
```tsx
|
|
173
|
+
// ✅ Good
|
|
174
|
+
<AtomicText type="titleLarge" marginBottom="md">Title</AtomicText>
|
|
413
175
|
|
|
414
|
-
//
|
|
415
|
-
<AtomicText type="
|
|
416
|
-
```
|
|
176
|
+
// ❌ Bad
|
|
177
|
+
<AtomicText type="titleLarge" style={{ marginBottom: 16 }}>Title</AtomicText>
|
|
178
|
+
```
|
|
417
179
|
|
|
418
|
-
###
|
|
180
|
+
### Common Patterns
|
|
419
181
|
|
|
182
|
+
#### Headline
|
|
420
183
|
```tsx
|
|
421
|
-
|
|
422
|
-
<AtomicText color="textPrimary">
|
|
423
|
-
|
|
424
|
-
// İkincil içerik
|
|
425
|
-
<AtomicText color="textSecondary">
|
|
426
|
-
|
|
427
|
-
// Hata mesajı
|
|
428
|
-
<AtomicText color="error">
|
|
429
|
-
|
|
430
|
-
// Link
|
|
431
|
-
<AtomicText color="primary">
|
|
184
|
+
<AtomicText type="headlineLarge">Page Title</AtomicText>
|
|
432
185
|
```
|
|
433
186
|
|
|
434
|
-
|
|
435
|
-
|
|
187
|
+
#### Body with Color
|
|
436
188
|
```tsx
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
Başlık
|
|
189
|
+
<AtomicText type="bodyMedium" color="textSecondary">
|
|
190
|
+
Description text
|
|
440
191
|
</AtomicText>
|
|
192
|
+
```
|
|
441
193
|
|
|
442
|
-
|
|
443
|
-
|
|
194
|
+
#### With Spacing
|
|
195
|
+
```tsx
|
|
196
|
+
<AtomicText type="titleLarge" marginBottom="sm">
|
|
197
|
+
Title
|
|
444
198
|
</AtomicText>
|
|
445
199
|
```
|
|
446
200
|
|
|
447
|
-
##
|
|
201
|
+
## Props Reference
|
|
202
|
+
|
|
203
|
+
| Prop | Type | Required | Default | Description |
|
|
204
|
+
|------|------|----------|---------|-------------|
|
|
205
|
+
| `type` | `TextStyleVariant` | No | `'bodyMedium'` | Typography style |
|
|
206
|
+
| `color` | `ColorVariant \| string` | No | `'textPrimary'` | Text color |
|
|
207
|
+
| `align` | `TextAlign` | No | - | Text alignment |
|
|
208
|
+
| `fontWeight` | `TextStyle['fontWeight']` | No | - | Font weight |
|
|
209
|
+
| `marginTop` | `keyof Spacing` | No | - | Top margin |
|
|
210
|
+
| `marginBottom` | `keyof Spacing` | No | - | Bottom margin |
|
|
211
|
+
| `children` | `ReactNode` | Yes | - | Text content |
|
|
448
212
|
|
|
449
|
-
|
|
213
|
+
## Accessibility
|
|
450
214
|
|
|
451
|
-
- ✅ Screen reader
|
|
452
|
-
- ✅ Semantic
|
|
215
|
+
- ✅ Screen reader support
|
|
216
|
+
- ✅ Semantic meaning
|
|
453
217
|
- ✅ Contrast ratio
|
|
454
|
-
- ✅ Font scaling
|
|
218
|
+
- ✅ Font scaling support
|
|
455
219
|
|
|
456
|
-
##
|
|
220
|
+
## Performance Tips
|
|
457
221
|
|
|
458
|
-
1. **
|
|
459
|
-
2. **
|
|
460
|
-
3. **
|
|
222
|
+
1. **Stabilize props**: Memo text styles
|
|
223
|
+
2. **Avoid inline styles**: Use type prop
|
|
224
|
+
3. **Memo content**: Memo long text blocks
|
|
461
225
|
|
|
462
|
-
##
|
|
226
|
+
## Related Components
|
|
463
227
|
|
|
464
|
-
- [`AtomicButton`](
|
|
465
|
-
- [`FormField`](
|
|
466
|
-
- [`AtomicInput`](
|
|
228
|
+
- [`AtomicButton`](./AtomicButton.README.md) - Button component
|
|
229
|
+
- [`FormField`](../molecules/FormField) - Form wrapper
|
|
230
|
+
- [`AtomicInput`](./AtomicInput.README.md) - Input component
|
|
467
231
|
|
|
468
|
-
##
|
|
232
|
+
## License
|
|
469
233
|
|
|
470
234
|
MIT
|