@umituz/react-native-design-system 2.6.94 → 2.6.96
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/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/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/navigation/components/NavigationHeader.tsx +77 -0
- package/src/molecules/navigation/index.ts +1 -0
- package/src/molecules/splash/README.md +76 -80
- package/src/molecules/swipe-actions/README.md +376 -588
|
@@ -1,349 +1,316 @@
|
|
|
1
1
|
# AtomicIcon
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A theme-aware icon component using Ionicons with semantic sizing and colors.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Import & Usage
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- 🎭 **Background Desteği**: Dairesel arka plan
|
|
10
|
-
- 🖼️ **Custom SVG**: Özel SVG path desteği
|
|
11
|
-
- ✅ **Validation**: Geçersiz ikon kontrolü
|
|
12
|
-
- ♿ **Erişilebilir**: Tam erişilebilirlik desteği
|
|
13
|
-
|
|
14
|
-
## Kurulum
|
|
15
|
-
|
|
16
|
-
```tsx
|
|
17
|
-
import { AtomicIcon } from 'react-native-design-system';
|
|
7
|
+
```typescript
|
|
8
|
+
import { AtomicIcon } from 'react-native-design-system/src/atoms/AtomicIcon';
|
|
18
9
|
```
|
|
19
10
|
|
|
20
|
-
|
|
11
|
+
**Location:** `src/atoms/AtomicIcon.tsx`
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
21
14
|
|
|
22
15
|
```tsx
|
|
23
|
-
|
|
24
|
-
import { View } from 'react-native';
|
|
25
|
-
import { AtomicIcon } from 'react-native-design-system';
|
|
26
|
-
|
|
27
|
-
export const BasicExample = () => {
|
|
28
|
-
return (
|
|
29
|
-
<View style={{ padding: 16, flexDirection: 'row', gap: 16 }}>
|
|
30
|
-
<AtomicIcon name="heart-outline" />
|
|
31
|
-
<AtomicIcon name="star" />
|
|
32
|
-
<AtomicIcon name="settings" />
|
|
33
|
-
</View>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
16
|
+
<AtomicIcon name="heart" />
|
|
36
17
|
```
|
|
37
18
|
|
|
38
|
-
##
|
|
19
|
+
## Strategy
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
<View style={{ flexDirection: 'row', gap: 16, alignItems: 'center' }}>
|
|
42
|
-
{/* Extra Small */}
|
|
43
|
-
<AtomicIcon name="home" size="xs" />
|
|
21
|
+
**Purpose**: Provide consistent, accessible icons with theme integration.
|
|
44
22
|
|
|
45
|
-
|
|
46
|
-
|
|
23
|
+
**When to Use**:
|
|
24
|
+
- Navigation icons (tabs, headers, buttons)
|
|
25
|
+
- Action indicators (favorites, settings, search)
|
|
26
|
+
- Status indicators (success, error, warning)
|
|
27
|
+
- Decorative icons with semantic meaning
|
|
47
28
|
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
**When NOT to Use**:
|
|
30
|
+
- For images or photos (use Image component)
|
|
31
|
+
- When custom icon graphics are needed (use SVG)
|
|
32
|
+
- For non-icon graphics or illustrations
|
|
50
33
|
|
|
51
|
-
|
|
52
|
-
<AtomicIcon name="home" size="lg" />
|
|
34
|
+
## Rules
|
|
53
35
|
|
|
54
|
-
|
|
55
|
-
<AtomicIcon name="home" size="xl" />
|
|
36
|
+
### Required
|
|
56
37
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
1. **MUST** provide `name` prop (valid Ionicons name)
|
|
39
|
+
2. **ALWAYS** use appropriate size for context
|
|
40
|
+
3. **SHOULD** use semantic colors when meaningful
|
|
41
|
+
4. **MUST** provide accessibility label if not decorative
|
|
42
|
+
5. **ALWAYS** validate icon name exists
|
|
43
|
+
6. **SHOULD** use consistent sizing within context
|
|
44
|
+
7. **MUST** handle invalid icon names gracefully
|
|
61
45
|
|
|
62
|
-
|
|
46
|
+
### Size Guidelines
|
|
63
47
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<AtomicIcon name="information-circle" size="lg" color="info" />
|
|
70
|
-
<AtomicIcon name="heart" size="lg" color="primary" />
|
|
71
|
-
<AtomicIcon name="star" size="lg" color="secondary" />
|
|
72
|
-
</View>
|
|
73
|
-
```
|
|
48
|
+
1. **xs (16px)**: Inline text, tiny badges
|
|
49
|
+
2. **sm (20px)**: List items, compact buttons
|
|
50
|
+
3. **md (24px)**: Default, most use cases
|
|
51
|
+
4. **lg (28px)**: Emphasis, large buttons
|
|
52
|
+
5. **xl (32px)**: Headers, featured icons
|
|
74
53
|
|
|
75
|
-
|
|
54
|
+
### Color Semantics
|
|
76
55
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/>
|
|
83
|
-
```
|
|
56
|
+
1. **primary**: Primary actions, active states
|
|
57
|
+
2. **success**: Success states, confirmations
|
|
58
|
+
3. **warning**: Warning states, cautions
|
|
59
|
+
4. **error**: Error states, destructive actions
|
|
60
|
+
5. **secondary**: Secondary actions, inactive states
|
|
84
61
|
|
|
85
|
-
|
|
62
|
+
### Background Usage
|
|
86
63
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
name="home"
|
|
91
|
-
size="md"
|
|
92
|
-
withBackground
|
|
93
|
-
/>
|
|
94
|
-
|
|
95
|
-
<AtomicIcon
|
|
96
|
-
name="settings"
|
|
97
|
-
size="md"
|
|
98
|
-
withBackground
|
|
99
|
-
backgroundColor="#E3F2FD"
|
|
100
|
-
/>
|
|
101
|
-
|
|
102
|
-
<AtomicIcon
|
|
103
|
-
name="favorite"
|
|
104
|
-
size="lg"
|
|
105
|
-
withBackground
|
|
106
|
-
color="error"
|
|
107
|
-
/>
|
|
108
|
-
</View>
|
|
109
|
-
```
|
|
64
|
+
1. **Use for**: Floating action buttons, avatar icons
|
|
65
|
+
2. **Don't overuse**: Not every icon needs background
|
|
66
|
+
3. **Match colors**: Background should complement icon
|
|
110
67
|
|
|
111
|
-
##
|
|
68
|
+
## Forbidden
|
|
112
69
|
|
|
113
|
-
|
|
114
|
-
<AtomicIcon
|
|
115
|
-
size="md"
|
|
116
|
-
svgPath="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"
|
|
117
|
-
svgViewBox="0 0 24 24"
|
|
118
|
-
customColor="#6366f1"
|
|
119
|
-
/>
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Örnek Kullanımlar
|
|
123
|
-
|
|
124
|
-
### Navigation Icons
|
|
70
|
+
❌ **NEVER** do these:
|
|
125
71
|
|
|
126
72
|
```tsx
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<TabIcon icon="search-outline" label="Search" />
|
|
130
|
-
<TabIcon icon="person-outline" label="Profile" />
|
|
131
|
-
</TabBar>
|
|
132
|
-
```
|
|
73
|
+
// ❌ No icon name
|
|
74
|
+
<AtomicIcon /> {/* ❌ Missing required prop */}
|
|
133
75
|
|
|
134
|
-
|
|
76
|
+
// ❌ Invalid icon name
|
|
77
|
+
<AtomicIcon name="invalid-icon-name" /> {/* ❌ Shows fallback */}
|
|
135
78
|
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
<AtomicIcon
|
|
139
|
-
|
|
140
|
-
size="lg"
|
|
141
|
-
color="success"
|
|
142
|
-
withBackground
|
|
143
|
-
/>
|
|
144
|
-
|
|
145
|
-
<AtomicIcon
|
|
146
|
-
name="mail-outline"
|
|
147
|
-
size="lg"
|
|
148
|
-
color="primary"
|
|
149
|
-
withBackground
|
|
150
|
-
/>
|
|
151
|
-
|
|
152
|
-
<AtomicIcon
|
|
153
|
-
name="videocam-outline"
|
|
154
|
-
size="lg"
|
|
155
|
-
color="secondary"
|
|
156
|
-
withBackground
|
|
157
|
-
/>
|
|
158
|
-
</View>
|
|
159
|
-
```
|
|
79
|
+
// ❌ Wrong size for context
|
|
80
|
+
<Button>
|
|
81
|
+
<AtomicIcon name="add" size="xxl" /> {/* ❌ Too large */}
|
|
82
|
+
</Button>
|
|
160
83
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<
|
|
165
|
-
<AtomicIcon name="checkmark-circle" size="sm" color="success" />
|
|
166
|
-
<AtomicText>Online</AtomicText>
|
|
167
|
-
</View>
|
|
168
|
-
|
|
169
|
-
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
170
|
-
<AtomicIcon name="time" size="sm" color="warning" />
|
|
171
|
-
<AtomicText>Away</AtomicText>
|
|
172
|
-
</View>
|
|
173
|
-
|
|
174
|
-
<View style={{ flexDirection: 'row', gap: 8, alignItems: 'center' }}>
|
|
175
|
-
<AtomicIcon name="close-circle" size="sm" color="error" />
|
|
176
|
-
<AtomicText>Offline</AtomicText>
|
|
84
|
+
// ❌ Inconsistent sizes
|
|
85
|
+
<View style={{ flexDirection: 'row' }}>
|
|
86
|
+
<AtomicIcon name="home" size="xs" />
|
|
87
|
+
<AtomicIcon name="settings" size="xl" /> {/* ❌ Inconsistent */}
|
|
177
88
|
</View>
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## Props
|
|
181
|
-
|
|
182
|
-
### AtomicIconProps
|
|
183
89
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
| `color` | `IconColor` | - | Semantic renk |
|
|
190
|
-
| `customColor` | `string` | - | Özel renk |
|
|
191
|
-
| `svgPath` | `string` | - | Custom SVG path |
|
|
192
|
-
| `svgViewBox` | `string` | `'0 0 24 24'` | SVG viewBox |
|
|
193
|
-
| `withBackground` | `boolean` | `false` | Dairesel arka plan |
|
|
194
|
-
| `backgroundColor` | `string` | - | Arka plan rengi |
|
|
195
|
-
| `accessibilityLabel` | `string` | - | Erişilebilirlik etiketi |
|
|
196
|
-
| `testID` | `string` | - | Test ID'si |
|
|
197
|
-
| `style` | `StyleProp<ViewStyle>` | - | Özel stil |
|
|
198
|
-
|
|
199
|
-
### IconSize
|
|
200
|
-
|
|
201
|
-
```typescript
|
|
202
|
-
type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
203
|
-
```
|
|
90
|
+
// ❌ Decorative icon not hidden
|
|
91
|
+
<AtomicIcon
|
|
92
|
+
name="sparkles"
|
|
93
|
+
// ❌ Should have accessibilityElementsHidden
|
|
94
|
+
/>
|
|
204
95
|
|
|
205
|
-
|
|
96
|
+
// ❌ Confusing color semantics
|
|
97
|
+
<AtomicIcon
|
|
98
|
+
name="trash"
|
|
99
|
+
color="success" {/* ❌ Trash should be error/danger */}
|
|
100
|
+
/>
|
|
206
101
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
| 'warning' // Uyarı rengi
|
|
213
|
-
| 'error' // Hata rengi
|
|
214
|
-
| 'info' // Bilgi rengi
|
|
215
|
-
| 'onSurface' // Yüzey üzerindeki metin
|
|
216
|
-
| 'surfaceVariant' // Yüzey variant rengi
|
|
217
|
-
| 'onPrimary' // Ana renk üzerindeki metin
|
|
218
|
-
| 'onSecondary' // İkincil renk üzerindeki metin
|
|
219
|
-
| 'textInverse' // Ters metin rengi
|
|
220
|
-
| 'textPrimary' // Birincil metin rengi
|
|
221
|
-
| 'textSecondary' // İkincil metin rengi
|
|
222
|
-
| 'textTertiary' // Üçüncül metin rengi
|
|
223
|
-
| 'onSurfaceVariant'; // Yüzey variant üzerindeki metin
|
|
102
|
+
// ❌ Background for every icon
|
|
103
|
+
<AtomicIcon
|
|
104
|
+
name="home"
|
|
105
|
+
withBackground {/* ❌ Unnecessary */}
|
|
106
|
+
/>
|
|
224
107
|
```
|
|
225
108
|
|
|
226
|
-
## Icon Name Listesi
|
|
227
|
-
|
|
228
|
-
Ionicons kütüphanesinden popüler ikonlar:
|
|
229
|
-
|
|
230
|
-
### Navigation
|
|
231
|
-
- `home`, `home-outline`
|
|
232
|
-
- `search`, `search-outline`
|
|
233
|
-
- `settings`, `settings-outline`
|
|
234
|
-
- `menu`, `menu-outline`
|
|
235
|
-
- `arrow-back`, `arrow-forward`
|
|
236
|
-
- `chevron-back`, `chevron-forward`
|
|
237
|
-
|
|
238
|
-
### Action
|
|
239
|
-
- `add`, `add-outline`
|
|
240
|
-
- `checkmark`, `checkmark-circle`
|
|
241
|
-
- `close`, `close-circle`
|
|
242
|
-
- `trash`, `trash-outline`
|
|
243
|
-
- `create`, `create-outline`
|
|
244
|
-
- `heart`, `heart-outline`
|
|
245
|
-
|
|
246
|
-
### Communication
|
|
247
|
-
- `mail`, `mail-outline`
|
|
248
|
-
- `call`, `call-outline`
|
|
249
|
-
- `chatbubbles`, `chatbubbles-outline`
|
|
250
|
-
- `videocam`, `videocam-outline`
|
|
251
|
-
|
|
252
|
-
### Media
|
|
253
|
-
- `image`, `image-outline`
|
|
254
|
-
- `musical-note`, `musical-notes`
|
|
255
|
-
- `camera`, `camera-outline`
|
|
256
|
-
- `mic`, `mic-outline`
|
|
257
|
-
|
|
258
|
-
### Status
|
|
259
|
-
- `checkmark-circle`, `checkmark-circle-outline`
|
|
260
|
-
- `warning`, `warning-outline`
|
|
261
|
-
- `information-circle`, `information-circle-outline`
|
|
262
|
-
- `close-circle`, `close-circle-outline`
|
|
263
|
-
|
|
264
|
-
Daha fazla ikon için: [Ionicons Documentation](https://ionic.io/ionicons)
|
|
265
|
-
|
|
266
109
|
## Best Practices
|
|
267
110
|
|
|
268
|
-
###
|
|
111
|
+
### Size Selection
|
|
269
112
|
|
|
113
|
+
✅ **DO**:
|
|
270
114
|
```tsx
|
|
271
|
-
//
|
|
272
|
-
<
|
|
115
|
+
// ✅ Inline with text
|
|
116
|
+
<AtomicText>
|
|
117
|
+
<AtomicIcon name="star" size="xs" /> Featured
|
|
118
|
+
</AtomicText>
|
|
273
119
|
|
|
274
|
-
//
|
|
275
|
-
<
|
|
120
|
+
// ✅ Button icons
|
|
121
|
+
<Button>
|
|
122
|
+
<AtomicIcon name="add" size="sm" />
|
|
123
|
+
</Button>
|
|
276
124
|
|
|
277
|
-
//
|
|
278
|
-
<
|
|
125
|
+
// ✅ Tab icons
|
|
126
|
+
<TabBar>
|
|
127
|
+
<TabIcon icon="home" size="md" />
|
|
128
|
+
</TabBar>
|
|
279
129
|
```
|
|
280
130
|
|
|
281
|
-
|
|
282
|
-
|
|
131
|
+
❌ **DON'T**:
|
|
283
132
|
```tsx
|
|
284
|
-
//
|
|
285
|
-
<
|
|
133
|
+
// ❌ Wrong sizes
|
|
134
|
+
<Button>
|
|
135
|
+
<AtomicIcon name="add" size="xl" /> {/* Too large */}
|
|
136
|
+
</Button>
|
|
137
|
+
|
|
138
|
+
<AtomicText>
|
|
139
|
+
<AtomicIcon name="star" size="xl" /> Featured {/* Too large */}
|
|
140
|
+
</AtomicText>
|
|
141
|
+
```
|
|
286
142
|
|
|
287
|
-
|
|
288
|
-
<AtomicIcon name="checkmark" color="success" />
|
|
143
|
+
### Semantic Colors
|
|
289
144
|
|
|
290
|
-
|
|
291
|
-
|
|
145
|
+
✅ **DO**:
|
|
146
|
+
```tsx
|
|
147
|
+
// ✅ Meaningful colors
|
|
148
|
+
<AtomicIcon name="checkmark-circle" color="success" />
|
|
149
|
+
<AtomicIcon name="warning" color="warning" />
|
|
150
|
+
<AtomicIcon name="close-circle" color="error" />
|
|
151
|
+
<AtomicIcon name="heart" color="primary" />
|
|
152
|
+
```
|
|
292
153
|
|
|
293
|
-
|
|
294
|
-
|
|
154
|
+
❌ **DON'T**:
|
|
155
|
+
```tsx
|
|
156
|
+
// ❌ Confusing colors
|
|
157
|
+
<AtomicIcon name="trash" color="success" />
|
|
158
|
+
<AtomicIcon name="checkmark" color="error" />
|
|
295
159
|
```
|
|
296
160
|
|
|
297
|
-
###
|
|
161
|
+
### Background Usage
|
|
298
162
|
|
|
163
|
+
✅ **DO**:
|
|
299
164
|
```tsx
|
|
300
|
-
//
|
|
165
|
+
// ✅ FAB icons
|
|
301
166
|
<AtomicIcon
|
|
302
167
|
name="add"
|
|
168
|
+
size="md"
|
|
303
169
|
withBackground
|
|
304
170
|
color="primary"
|
|
305
171
|
/>
|
|
306
172
|
|
|
307
|
-
//
|
|
173
|
+
// ✅ Status icons
|
|
308
174
|
<AtomicIcon
|
|
309
|
-
name="
|
|
310
|
-
size="
|
|
175
|
+
name="checkmark"
|
|
176
|
+
size="sm"
|
|
311
177
|
withBackground
|
|
312
|
-
|
|
178
|
+
color="success"
|
|
179
|
+
backgroundColor="#d4edda"
|
|
313
180
|
/>
|
|
314
181
|
```
|
|
315
182
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
183
|
+
❌ **DON'T**:
|
|
184
|
+
```tsx
|
|
185
|
+
// ❌ Unnecessary background
|
|
186
|
+
<AtomicIcon
|
|
187
|
+
name="home"
|
|
188
|
+
withBackground {/* Not needed */}
|
|
189
|
+
/>
|
|
190
|
+
```
|
|
319
191
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
192
|
+
## AI Coding Guidelines
|
|
193
|
+
|
|
194
|
+
### For AI Agents
|
|
195
|
+
|
|
196
|
+
When generating AtomicIcon components, follow these rules:
|
|
197
|
+
|
|
198
|
+
1. **Always provide valid icon name**:
|
|
199
|
+
```tsx
|
|
200
|
+
// ✅ Good - valid Ionicons
|
|
201
|
+
<AtomicIcon name="home" />
|
|
202
|
+
<AtomicIcon name="settings-outline" />
|
|
203
|
+
<AtomicIcon name="chevron-forward" />
|
|
204
|
+
|
|
205
|
+
// ❌ Bad - invalid names
|
|
206
|
+
<AtomicIcon name="invalid-icon" />
|
|
207
|
+
<AtomicIcon name="home_icon" />
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
2. **Always use appropriate size**:
|
|
211
|
+
```tsx
|
|
212
|
+
// ✅ Good - size matches context
|
|
213
|
+
<Button>
|
|
214
|
+
<AtomicIcon name="add" size="sm" />
|
|
215
|
+
</Button>
|
|
216
|
+
<TabIcon icon="home" size="md" />
|
|
217
|
+
|
|
218
|
+
// ❌ Bad - wrong size
|
|
219
|
+
<Button>
|
|
220
|
+
<AtomicIcon name="add" size="xl" />
|
|
221
|
+
</Button>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
3. **Always use semantic colors meaningfully**:
|
|
225
|
+
```tsx
|
|
226
|
+
// ✅ Good - meaningful colors
|
|
227
|
+
<AtomicIcon name="checkmark" color="success" />
|
|
228
|
+
<AtomicIcon name="warning" color="warning" />
|
|
229
|
+
<AtomicIcon name="trash" color="error" />
|
|
230
|
+
|
|
231
|
+
// ❌ Bad - confusing colors
|
|
232
|
+
<AtomicIcon name="trash" color="success" />
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
4. **Always provide accessibility context**:
|
|
236
|
+
```tsx
|
|
237
|
+
// ✅ Good - accessible
|
|
238
|
+
<AtomicIcon
|
|
239
|
+
name="menu"
|
|
240
|
+
accessibilityLabel="Open menu"
|
|
241
|
+
accessibilityRole="button"
|
|
242
|
+
/>
|
|
243
|
+
|
|
244
|
+
// ❌ Bad - not accessible
|
|
245
|
+
<AtomicIcon name="menu" />
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Common Patterns
|
|
249
|
+
|
|
250
|
+
#### Basic Icon
|
|
251
|
+
```tsx
|
|
252
|
+
<AtomicIcon name="heart" />
|
|
253
|
+
```
|
|
324
254
|
|
|
325
|
-
|
|
255
|
+
#### With Text
|
|
256
|
+
```tsx
|
|
257
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
258
|
+
<AtomicIcon name="star" size="sm" color="warning" />
|
|
259
|
+
<AtomicText>Featured</AtomicText>
|
|
260
|
+
</View>
|
|
261
|
+
```
|
|
326
262
|
|
|
327
|
-
|
|
263
|
+
#### Button Icon
|
|
264
|
+
```tsx
|
|
265
|
+
<Button onPress={handleAction}>
|
|
266
|
+
<AtomicIcon name="add" size="sm" color="white" />
|
|
267
|
+
</Button>
|
|
268
|
+
```
|
|
328
269
|
|
|
270
|
+
#### Status Icon
|
|
329
271
|
```tsx
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
272
|
+
<AtomicIcon
|
|
273
|
+
name="checkmark-circle"
|
|
274
|
+
size="lg"
|
|
275
|
+
color="success"
|
|
276
|
+
accessibilityLabel="Completed"
|
|
277
|
+
/>
|
|
333
278
|
```
|
|
334
279
|
|
|
335
|
-
##
|
|
280
|
+
## Props Reference
|
|
281
|
+
|
|
282
|
+
| Prop | Type | Required | Default | Description |
|
|
283
|
+
|------|------|----------|---------|-------------|
|
|
284
|
+
| `name` | `IconName` | Yes | - | Ionicons icon name |
|
|
285
|
+
| `size` | `IconSize` | No | `'md'` | Icon size |
|
|
286
|
+
| `customSize` | `number` | No | - | Custom size (px) |
|
|
287
|
+
| `color` | `IconColor` | No | - | Semantic color |
|
|
288
|
+
| `customColor` | `string` | No | - | Custom color |
|
|
289
|
+
| `svgPath` | `string` | No | - | Custom SVG path |
|
|
290
|
+
| `svgViewBox` | `string` | No | `'0 0 24 24'` | SVG viewBox |
|
|
291
|
+
| `withBackground` | `boolean` | No | `false` | Circular background |
|
|
292
|
+
| `backgroundColor` | `string` | No | - | Background color |
|
|
293
|
+
| `accessibilityLabel` | `string` | No | - | Accessibility label |
|
|
294
|
+
|
|
295
|
+
## Accessibility
|
|
296
|
+
|
|
297
|
+
- ✅ Screen reader support
|
|
298
|
+
- ✅ Accessibility label
|
|
299
|
+
- ✅ Semantic role
|
|
300
|
+
- ✅ Test ID support
|
|
301
|
+
|
|
302
|
+
## Performance Tips
|
|
336
303
|
|
|
337
|
-
1. **React.memo**:
|
|
338
|
-
2. **Static
|
|
339
|
-
3. **Avoid
|
|
304
|
+
1. **React.memo**: Component is already memoized
|
|
305
|
+
2. **Static names**: Use constant icon names
|
|
306
|
+
3. **Avoid re-renders**: Stabilize icon props
|
|
340
307
|
|
|
341
|
-
##
|
|
308
|
+
## Related Components
|
|
342
309
|
|
|
343
|
-
- [`AtomicButton`](
|
|
344
|
-
- [`AtomicChip`](
|
|
345
|
-
- [`
|
|
310
|
+
- [`AtomicButton`](./AtomicButton.README.md) - Button component
|
|
311
|
+
- [`AtomicChip`](./AtomicChip.README.md) - Chip component
|
|
312
|
+
- [`AtomicText`](./AtomicText.README.md) - Text component
|
|
346
313
|
|
|
347
|
-
##
|
|
314
|
+
## License
|
|
348
315
|
|
|
349
316
|
MIT
|