@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,337 +1,448 @@
|
|
|
1
1
|
# AtomicCard
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A simple and customizable card container component for React Native. Designed following Material Design 3 principles.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Import & Usage
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
```typescript
|
|
8
|
+
import { AtomicCard } from 'react-native-design-system/src/atoms/AtomicCard';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Location:** `src/atoms/AtomicCard.tsx`
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Basic Usage
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
|
-
|
|
16
|
+
<AtomicCard>
|
|
17
|
+
<AtomicText>Card content</AtomicText>
|
|
18
|
+
</AtomicCard>
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
##
|
|
21
|
+
## Strategy
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import { View, Text } from 'react-native';
|
|
24
|
-
import { AtomicCard } from 'react-native-design-system';
|
|
25
|
-
|
|
26
|
-
export const BasicExample = () => {
|
|
27
|
-
return (
|
|
28
|
-
<View style={{ padding: 16 }}>
|
|
29
|
-
<AtomicCard>
|
|
30
|
-
<Text>Bu bir kart içeriği</Text>
|
|
31
|
-
</AtomicCard>
|
|
32
|
-
</View>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
```
|
|
23
|
+
**Purpose**: Provide a flexible container component for grouping related content with visual separation.
|
|
36
24
|
|
|
37
|
-
|
|
25
|
+
**When to Use**:
|
|
26
|
+
- Grouping related content (product details, user profiles, settings)
|
|
27
|
+
- Creating clickable list items
|
|
28
|
+
- Displaying information cards (stats, summaries)
|
|
29
|
+
- Building card-based layouts (dashboards, feeds)
|
|
30
|
+
- Highlighting important content sections
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</AtomicCard>
|
|
32
|
+
**When NOT to Use**:
|
|
33
|
+
- For full-page layouts (use ScreenLayout instead)
|
|
34
|
+
- For simple dividers or borders (use separators)
|
|
35
|
+
- As a replacement for proper modal or sheet components
|
|
36
|
+
- When you need complex card features (actions, menus) - use molecule cards instead
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
<AtomicCard variant="outlined">
|
|
48
|
-
<Text>Outlined Card - Çerçeve efekti</Text>
|
|
49
|
-
</AtomicCard>
|
|
38
|
+
## Rules
|
|
50
39
|
|
|
51
|
-
|
|
52
|
-
<AtomicCard variant="filled">
|
|
53
|
-
<Text>Filled Card - Dolgu efekti</Text>
|
|
54
|
-
</AtomicCard>
|
|
55
|
-
</View>
|
|
56
|
-
```
|
|
40
|
+
### Required
|
|
57
41
|
|
|
58
|
-
|
|
42
|
+
1. **MUST** have meaningful content inside the card
|
|
43
|
+
2. **ALWAYS** provide padding for content (don't rely on card padding alone)
|
|
44
|
+
3. **SHOULD** use appropriate variant for the context
|
|
45
|
+
4. **MUST** have touch feedback if pressable
|
|
46
|
+
5. **ALWAYS** provide accessibility context if interactive
|
|
47
|
+
6. **SHOULD** maintain consistent spacing within card
|
|
48
|
+
7. **MUST** not nest cards unnecessarily (max 2 levels)
|
|
59
49
|
|
|
60
|
-
|
|
61
|
-
<View style={{ gap: 16 }}>
|
|
62
|
-
{/* No Padding */}
|
|
63
|
-
<AtomicCard padding="none">
|
|
64
|
-
<Text>Padding yok</Text>
|
|
65
|
-
</AtomicCard>
|
|
50
|
+
### Variant Selection
|
|
66
51
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</AtomicCard>
|
|
52
|
+
1. **Elevated**: Default, for most cards with depth
|
|
53
|
+
2. **Outlined**: For less emphasis, grouping content
|
|
54
|
+
3. **Filled**: For highest emphasis or contrasting backgrounds
|
|
71
55
|
|
|
72
|
-
|
|
73
|
-
<AtomicCard padding="md">
|
|
74
|
-
<Text>Medium padding</Text>
|
|
75
|
-
</AtomicCard>
|
|
56
|
+
### Padding Guidelines
|
|
76
57
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
58
|
+
1. **None**: When content has its own padding or is full-width
|
|
59
|
+
2. **Small (sm)**: For dense content or compact cards
|
|
60
|
+
3. **Medium (md)**: Default for most cards
|
|
61
|
+
4. **Large (lg)**: For spacious cards with minimal content
|
|
62
|
+
|
|
63
|
+
### Pressable Cards
|
|
64
|
+
|
|
65
|
+
1. **MUST** provide `onPress` callback
|
|
66
|
+
2. **SHOULD** have visual feedback
|
|
67
|
+
3. **MUST** announce interactivity to screen readers
|
|
68
|
+
4. **SHOULD** have clear affordance (icon, chevron, etc.)
|
|
69
|
+
|
|
70
|
+
## Forbidden
|
|
83
71
|
|
|
84
|
-
|
|
72
|
+
❌ **NEVER** do these:
|
|
85
73
|
|
|
86
74
|
```tsx
|
|
75
|
+
// ❌ Empty card
|
|
76
|
+
<AtomicCard /> {/* ❌ No content */}
|
|
77
|
+
|
|
78
|
+
// ❌ Wrong variant for emphasis
|
|
79
|
+
<AtomicCard variant="elevated"> {/* ❌ Too much emphasis */}
|
|
80
|
+
<AtomicText type="bodySmall">Small hint</AtomicText>
|
|
81
|
+
</AtomicCard>
|
|
82
|
+
|
|
83
|
+
// ❌ Pressable without callback
|
|
87
84
|
<AtomicCard
|
|
88
|
-
onPress
|
|
89
|
-
padding="md"
|
|
85
|
+
onPress {/* ❌ Missing handler */}
|
|
90
86
|
>
|
|
91
|
-
<
|
|
92
|
-
<Text>Tıklamayı dene</Text>
|
|
87
|
+
<AtomicText>Click me</AtomicText>
|
|
93
88
|
</AtomicCard>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Örnek Kullanımlar
|
|
97
89
|
|
|
98
|
-
|
|
90
|
+
// ❌ Deep nesting
|
|
91
|
+
<AtomicCard>
|
|
92
|
+
<AtomicCard>
|
|
93
|
+
<AtomicCard> {/* ❌ Too nested */}
|
|
94
|
+
<Content />
|
|
95
|
+
</AtomicCard>
|
|
96
|
+
</AtomicCard>
|
|
97
|
+
</AtomicCard>
|
|
99
98
|
|
|
100
|
-
|
|
101
|
-
<AtomicCard
|
|
102
|
-
<View style={{
|
|
103
|
-
<
|
|
104
|
-
<Text style={{ color: 'gray' }}>Frontend Developer</Text>
|
|
99
|
+
// ❌ Inconsistent padding
|
|
100
|
+
<AtomicCard padding="none">
|
|
101
|
+
<View style={{ padding: 20 }}> {/* ❌ Manual padding */}
|
|
102
|
+
<Content />
|
|
105
103
|
</View>
|
|
106
104
|
</AtomicCard>
|
|
107
|
-
```
|
|
108
105
|
|
|
109
|
-
|
|
106
|
+
// ❌ Card for simple border
|
|
107
|
+
<AtomicCard variant="outlined">
|
|
108
|
+
<Content />
|
|
109
|
+
</AtomicCard>
|
|
110
|
+
// ❌ Should use View with borderStyle instead
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
<AtomicCard
|
|
113
|
-
|
|
114
|
-
padding="md"
|
|
115
|
-
onPress={() => navigate('ProductDetail')}
|
|
116
|
-
>
|
|
117
|
-
<Text style={{ fontSize: 16, fontWeight: '600' }}>Ürün Adı</Text>
|
|
118
|
-
<Text style={{ marginTop: 8 }}>Ürün açıklaması</Text>
|
|
119
|
-
<Text style={{ marginTop: 16, fontSize: 18, fontWeight: 'bold' }}>$99.99</Text>
|
|
112
|
+
// ❌ Pressable card without accessibility context
|
|
113
|
+
<AtomicCard onPress={handleAction}>
|
|
114
|
+
<AtomicText>Click</AtomicText>
|
|
120
115
|
</AtomicCard>
|
|
116
|
+
// ❌ No accessibilityLabel or hint
|
|
121
117
|
```
|
|
122
118
|
|
|
123
|
-
|
|
119
|
+
## Best Practices
|
|
120
|
+
|
|
121
|
+
### Variant Selection
|
|
124
122
|
|
|
123
|
+
✅ **DO**:
|
|
125
124
|
```tsx
|
|
125
|
+
// ✅ Default elevated card
|
|
126
|
+
<AtomicCard variant="elevated">
|
|
127
|
+
<ProductDetails />
|
|
128
|
+
</AtomicCard>
|
|
129
|
+
|
|
130
|
+
// ✅ List item with outline
|
|
131
|
+
<FlatList
|
|
132
|
+
data={items}
|
|
133
|
+
renderItem={({ item }) => (
|
|
134
|
+
<AtomicCard variant="outlined" padding="sm">
|
|
135
|
+
<ListItemContent item={item} />
|
|
136
|
+
</AtomicCard>
|
|
137
|
+
)}
|
|
138
|
+
/>
|
|
139
|
+
|
|
140
|
+
// ✅ Highlighted section with filled
|
|
126
141
|
<AtomicCard variant="filled" padding="lg">
|
|
127
|
-
<
|
|
128
|
-
Önemli Bilgi
|
|
129
|
-
</Text>
|
|
130
|
-
<Text style={{ lineHeight: 22 }}>
|
|
131
|
-
Bu kart önemli bilgileri içermektedir.
|
|
132
|
-
Lütfen dikkatlice okuyunuz.
|
|
133
|
-
</Text>
|
|
142
|
+
<FeaturedContent />
|
|
134
143
|
</AtomicCard>
|
|
135
144
|
```
|
|
136
145
|
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
❌ **DON'T**:
|
|
139
147
|
```tsx
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
padding="sm"
|
|
145
|
-
onPress={() => handleItemPress(item)}
|
|
146
|
-
style={{ marginBottom: 12 }}
|
|
147
|
-
>
|
|
148
|
-
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
149
|
-
<Text>{item.title}</Text>
|
|
150
|
-
<Text>{item.date}</Text>
|
|
151
|
-
</View>
|
|
152
|
-
</AtomicCard>
|
|
153
|
-
))}
|
|
154
|
-
```
|
|
148
|
+
// ❌ Over-emphasizing minor content
|
|
149
|
+
<AtomicCard variant="elevated">
|
|
150
|
+
<AtomicText type="bodySmall">Tip</AtomicText>
|
|
151
|
+
</AtomicCard>
|
|
155
152
|
|
|
156
|
-
|
|
153
|
+
// ❌ Under-emphasizing important content
|
|
154
|
+
<AtomicCard variant="outlined">
|
|
155
|
+
<AtomicText type="headlineLarge">Critical Alert</AtomicText>
|
|
156
|
+
</AtomicCard>
|
|
157
|
+
```
|
|
157
158
|
|
|
158
|
-
###
|
|
159
|
+
### Padding Usage
|
|
159
160
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
| `disabled` | `boolean` | `false` | Devre dışı |
|
|
167
|
-
| `style` | `StyleProp<ViewStyle>` | - | Özel stil |
|
|
168
|
-
| `testID` | `string` | - | Test ID'si |
|
|
161
|
+
✅ **DO**:
|
|
162
|
+
```tsx
|
|
163
|
+
// ✅ Dense content
|
|
164
|
+
<AtomicCard variant="outlined" padding="sm">
|
|
165
|
+
<DenseListItems />
|
|
166
|
+
</AtomicCard>
|
|
169
167
|
|
|
170
|
-
|
|
168
|
+
// ✅ Normal content
|
|
169
|
+
<AtomicCard padding="md">
|
|
170
|
+
<CardContent />
|
|
171
|
+
</AtomicCard>
|
|
171
172
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
| 'filled'; // Dolgu efekti
|
|
173
|
+
// ✅ Minimal content
|
|
174
|
+
<AtomicCard padding="lg">
|
|
175
|
+
<AtomicText align="center">Empty State</AtomicText>
|
|
176
|
+
</AtomicCard>
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
❌ **DON'T**:
|
|
180
|
+
```tsx
|
|
181
|
+
// ❌ No padding with unpadded content
|
|
182
|
+
<AtomicCard padding="none">
|
|
183
|
+
<AtomicText>No breathing room</AtomicText>
|
|
184
|
+
</AtomicCard>
|
|
180
185
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
| 'md' // Orta iç boşluk (varsayılan)
|
|
186
|
-
| 'lg'; // Büyük iç boşluk
|
|
186
|
+
// ❌ Too much padding
|
|
187
|
+
<AtomicCard padding="lg">
|
|
188
|
+
<DenseContent />
|
|
189
|
+
</AtomicCard>
|
|
187
190
|
```
|
|
188
191
|
|
|
189
|
-
|
|
192
|
+
### Pressable Cards
|
|
190
193
|
|
|
194
|
+
✅ **DO**:
|
|
191
195
|
```tsx
|
|
196
|
+
// ✅ Interactive card
|
|
192
197
|
<AtomicCard
|
|
193
|
-
|
|
198
|
+
onPress={() => navigate('Detail', { id })}
|
|
194
199
|
padding="md"
|
|
195
|
-
style={{
|
|
196
|
-
backgroundColor: '#f8f9fa',
|
|
197
|
-
borderRadius: 16,
|
|
198
|
-
borderWidth: 2,
|
|
199
|
-
borderColor: '#e9ecef',
|
|
200
|
-
shadowColor: '#000',
|
|
201
|
-
shadowOffset: { width: 0, height: 2 },
|
|
202
|
-
shadowOpacity: 0.1,
|
|
203
|
-
shadowRadius: 4,
|
|
204
|
-
elevation: 3,
|
|
205
|
-
}}
|
|
206
200
|
>
|
|
207
|
-
<
|
|
201
|
+
<View style={{ flexDirection: 'row' }}>
|
|
202
|
+
<View style={{ flex: 1 }}>
|
|
203
|
+
<AtomicText fontWeight="600">Title</AtomicText>
|
|
204
|
+
<AtomicText type="bodySmall" color="textSecondary">
|
|
205
|
+
Description
|
|
206
|
+
</AtomicText>
|
|
207
|
+
</View>
|
|
208
|
+
<AtomicIcon name="chevron-forward" />
|
|
209
|
+
</View>
|
|
208
210
|
</AtomicCard>
|
|
209
211
|
```
|
|
210
212
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
### 1. Variant Seçimi
|
|
214
|
-
|
|
213
|
+
❌ **DON'T**:
|
|
215
214
|
```tsx
|
|
216
|
-
//
|
|
217
|
-
<AtomicCard
|
|
218
|
-
<
|
|
215
|
+
// ❌ Pressable without clear affordance
|
|
216
|
+
<AtomicCard onPress={handleAction}>
|
|
217
|
+
<AtomicText>Click me somehow</AtomicText>
|
|
219
218
|
</AtomicCard>
|
|
220
219
|
|
|
221
|
-
//
|
|
222
|
-
<
|
|
223
|
-
|
|
224
|
-
renderItem={({ item }) => (
|
|
225
|
-
<AtomicCard variant="outlined" padding="sm">
|
|
226
|
-
{item.content}
|
|
227
|
-
</AtomicCard>
|
|
228
|
-
)}
|
|
229
|
-
/>
|
|
230
|
-
|
|
231
|
-
// Arka plan için filled
|
|
232
|
-
<AtomicCard variant="filled">
|
|
233
|
-
<BackgroundContent />
|
|
220
|
+
// ❌ Missing accessibility
|
|
221
|
+
<AtomicCard onPress={handleAction}>
|
|
222
|
+
<Content />
|
|
234
223
|
</AtomicCard>
|
|
235
224
|
```
|
|
236
225
|
|
|
237
|
-
###
|
|
226
|
+
### Content Organization
|
|
238
227
|
|
|
228
|
+
✅ **DO**:
|
|
239
229
|
```tsx
|
|
240
|
-
//
|
|
241
|
-
<AtomicCard padding="
|
|
242
|
-
<
|
|
230
|
+
// ✅ Structured card content
|
|
231
|
+
<AtomicCard padding="md">
|
|
232
|
+
<View style={{ marginBottom: 12 }}>
|
|
233
|
+
<AtomicText type="titleMedium">Title</AtomicText>
|
|
234
|
+
</View>
|
|
235
|
+
<View style={{ marginBottom: 12 }}>
|
|
236
|
+
<AtomicText type="bodyMedium">Description</AtomicText>
|
|
237
|
+
</View>
|
|
238
|
+
<View>
|
|
239
|
+
<AtomicText type="bodySmall" color="textSecondary">
|
|
240
|
+
Metadata
|
|
241
|
+
</AtomicText>
|
|
242
|
+
</View>
|
|
243
243
|
</AtomicCard>
|
|
244
|
+
```
|
|
244
245
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
❌ **DON'T**:
|
|
247
|
+
```tsx
|
|
248
|
+
// ❌ Unstructured content
|
|
249
|
+
<AtomicCard>
|
|
250
|
+
<AtomicText>Title</AtomicText>
|
|
251
|
+
<AtomicText>Description</AtomicText>
|
|
252
|
+
<AtomicText>More</AtomicText>
|
|
253
|
+
<AtomicText>Even more</AtomicText>
|
|
254
|
+
{/* No spacing or hierarchy */}
|
|
248
255
|
</AtomicCard>
|
|
249
256
|
```
|
|
250
257
|
|
|
251
|
-
|
|
258
|
+
## AI Coding Guidelines
|
|
259
|
+
|
|
260
|
+
### For AI Agents
|
|
261
|
+
|
|
262
|
+
When generating AtomicCard components, follow these rules:
|
|
263
|
+
|
|
264
|
+
1. **Always import from correct path**:
|
|
265
|
+
```typescript
|
|
266
|
+
import { AtomicCard } from 'react-native-design-system/src/atoms/AtomicCard';
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
2. **Always choose appropriate variant**:
|
|
270
|
+
```tsx
|
|
271
|
+
// ✅ Good - variant matches emphasis
|
|
272
|
+
<AtomicCard variant="elevated">
|
|
273
|
+
<ImportantContent />
|
|
274
|
+
</AtomicCard>
|
|
275
|
+
<AtomicCard variant="outlined">
|
|
276
|
+
<SecondaryContent />
|
|
277
|
+
</AtomicCard>
|
|
278
|
+
|
|
279
|
+
// ❌ Bad - wrong variant
|
|
280
|
+
<AtomicCard variant="elevated">
|
|
281
|
+
<MinorHint />
|
|
282
|
+
</AtomicCard>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
3. **Always use padding appropriately**:
|
|
286
|
+
```tsx
|
|
287
|
+
// ✅ Good - padding matches content density
|
|
288
|
+
<AtomicCard padding="sm">
|
|
289
|
+
<DenseContent />
|
|
290
|
+
</AtomicCard>
|
|
291
|
+
<AtomicCard padding="lg">
|
|
292
|
+
<MinimalContent />
|
|
293
|
+
</AtomicCard>
|
|
294
|
+
|
|
295
|
+
// ❌ Bad - wrong padding
|
|
296
|
+
<AtomicCard padding="none">
|
|
297
|
+
<ContentWithoutSpacing />
|
|
298
|
+
</AtomicCard>
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
4. **Always handle pressable cards properly**:
|
|
302
|
+
```tsx
|
|
303
|
+
// ✅ Good - pressable with affordance
|
|
304
|
+
<AtomicCard
|
|
305
|
+
onPress={() => navigate('Detail')}
|
|
306
|
+
accessibilityLabel="View details"
|
|
307
|
+
accessibilityRole="button"
|
|
308
|
+
>
|
|
309
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
310
|
+
<View style={{ flex: 1 }}>
|
|
311
|
+
<AtomicText fontWeight="600">Title</AtomicText>
|
|
312
|
+
</View>
|
|
313
|
+
<AtomicIcon name="chevron-forward" />
|
|
314
|
+
</View>
|
|
315
|
+
</AtomicCard>
|
|
316
|
+
|
|
317
|
+
// ❌ Bad - pressable without affordance
|
|
318
|
+
<AtomicCard onPress={handleAction}>
|
|
319
|
+
<AtomicText>Click me</AtomicText>
|
|
320
|
+
</AtomicCard>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
5. **Always structure card content**:
|
|
324
|
+
```tsx
|
|
325
|
+
// ✅ Good - clear structure
|
|
326
|
+
<AtomicCard padding="md">
|
|
327
|
+
<View style={{ marginBottom: 12 }}>
|
|
328
|
+
<AtomicText type="titleMedium">Title</AtomicText>
|
|
329
|
+
</View>
|
|
330
|
+
<View>
|
|
331
|
+
<AtomicText type="bodyMedium">Content</AtomicText>
|
|
332
|
+
</View>
|
|
333
|
+
</AtomicCard>
|
|
334
|
+
|
|
335
|
+
// ❌ Bad - no structure
|
|
336
|
+
<AtomicCard>
|
|
337
|
+
<AtomicText>Title</AtomicText>
|
|
338
|
+
<AtomicText>Content</AtomicText>
|
|
339
|
+
</AtomicCard>
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Common Patterns
|
|
343
|
+
|
|
344
|
+
#### Basic Card
|
|
345
|
+
```tsx
|
|
346
|
+
<AtomicCard padding="md">
|
|
347
|
+
<AtomicText>Card content</AtomicText>
|
|
348
|
+
</AtomicCard>
|
|
349
|
+
```
|
|
252
350
|
|
|
351
|
+
#### Clickable Card
|
|
253
352
|
```tsx
|
|
254
|
-
// Tıklanabilir öğeler
|
|
255
353
|
<AtomicCard
|
|
256
|
-
onPress={
|
|
257
|
-
|
|
354
|
+
onPress={() => navigate('Detail')}
|
|
355
|
+
padding="md"
|
|
356
|
+
accessibilityLabel="View details"
|
|
258
357
|
>
|
|
259
|
-
<
|
|
260
|
-
<CardContent />
|
|
261
|
-
<CardFooter />
|
|
358
|
+
<Content />
|
|
262
359
|
</AtomicCard>
|
|
263
360
|
```
|
|
264
361
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
362
|
+
#### List Item Card
|
|
363
|
+
```tsx
|
|
364
|
+
<FlatList
|
|
365
|
+
data={items}
|
|
366
|
+
renderItem={({ item }) => (
|
|
367
|
+
<AtomicCard
|
|
368
|
+
key={item.id}
|
|
369
|
+
variant="outlined"
|
|
370
|
+
padding="sm"
|
|
371
|
+
onPress={() => handleItemPress(item)}
|
|
372
|
+
style={{ marginBottom: 12 }}
|
|
373
|
+
>
|
|
374
|
+
<ListItemContent item={item} />
|
|
375
|
+
</AtomicCard>
|
|
376
|
+
)}
|
|
377
|
+
/>
|
|
378
|
+
```
|
|
268
379
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
380
|
+
#### Product Card
|
|
381
|
+
```tsx
|
|
382
|
+
<AtomicCard variant="elevated" padding="md">
|
|
383
|
+
<AtomicText type="titleMedium" fontWeight="600">
|
|
384
|
+
{product.name}
|
|
385
|
+
</AtomicText>
|
|
386
|
+
<AtomicText type="bodyMedium" color="textSecondary" marginTop="sm">
|
|
387
|
+
{product.description}
|
|
388
|
+
</AtomicText>
|
|
389
|
+
<AtomicText type="titleLarge" color="primary" marginTop="md">
|
|
390
|
+
${product.price}
|
|
391
|
+
</AtomicText>
|
|
392
|
+
</AtomicCard>
|
|
393
|
+
```
|
|
273
394
|
|
|
274
|
-
##
|
|
395
|
+
## Props Reference
|
|
275
396
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
397
|
+
| Prop | Type | Required | Default | Description |
|
|
398
|
+
|------|------|----------|---------|-------------|
|
|
399
|
+
| `children` | `ReactNode` | Yes | - | Card content |
|
|
400
|
+
| `variant` | `'elevated' \| 'outlined' \| 'filled'` | No | `'elevated'` | Card visual style |
|
|
401
|
+
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg'` | No | `'md'` | Internal padding |
|
|
402
|
+
| `onPress` | `(event: GestureResponderEvent) => void` | No | - | Press callback |
|
|
403
|
+
| `disabled` | `boolean` | No | `false` | Disable press |
|
|
404
|
+
| `style` | `ViewStyle` | No | - | Custom style |
|
|
405
|
+
| `testID` | `string` | No | - | Test identifier |
|
|
279
406
|
|
|
280
|
-
|
|
407
|
+
### AtomicCardVariant
|
|
281
408
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
409
|
+
```typescript
|
|
410
|
+
type AtomicCardVariant =
|
|
411
|
+
| 'elevated' // Shadow effect (default)
|
|
412
|
+
| 'outlined' // Border effect
|
|
413
|
+
| 'filled'; // Background fill effect
|
|
414
|
+
```
|
|
285
415
|
|
|
286
|
-
|
|
416
|
+
### AtomicCardPadding
|
|
287
417
|
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return (
|
|
295
|
-
<ScrollView style={{ padding: 16 }}>
|
|
296
|
-
{/* Basit Kart */}
|
|
297
|
-
<AtomicCard variant="elevated" padding="md" style={{ marginBottom: 16 }}>
|
|
298
|
-
<Text style={{ fontSize: 18, fontWeight: 'bold' }}>
|
|
299
|
-
Basit Kart
|
|
300
|
-
</Text>
|
|
301
|
-
<Text style={{ marginTop: 8 }}>
|
|
302
|
-
Bu basit bir kart örneğidir.
|
|
303
|
-
</Text>
|
|
304
|
-
</AtomicCard>
|
|
305
|
-
|
|
306
|
-
{/* Tıklanabilir Kart */}
|
|
307
|
-
<AtomicCard
|
|
308
|
-
variant="outlined"
|
|
309
|
-
padding="md"
|
|
310
|
-
onPress={() => console.log('Tıklandı!')}
|
|
311
|
-
style={{ marginBottom: 16 }}
|
|
312
|
-
>
|
|
313
|
-
<Text style={{ fontSize: 18, fontWeight: 'bold' }}>
|
|
314
|
-
Tıklanabilir Kart
|
|
315
|
-
</Text>
|
|
316
|
-
<Text style={{ marginTop: 8, color: '#6366f1' }}>
|
|
317
|
-
Tıkla ve gör
|
|
318
|
-
</Text>
|
|
319
|
-
</AtomicCard>
|
|
320
|
-
|
|
321
|
-
{/* Filled Kart */}
|
|
322
|
-
<AtomicCard variant="filled" padding="lg" style={{ marginBottom: 16 }}>
|
|
323
|
-
<Text style={{ fontSize: 18, fontWeight: 'bold' }}>
|
|
324
|
-
Filled Kart
|
|
325
|
-
</Text>
|
|
326
|
-
<Text style={{ marginTop: 8, lineHeight: 22 }}>
|
|
327
|
-
Bu kartın dolgu efekti vardır.
|
|
328
|
-
</Text>
|
|
329
|
-
</AtomicCard>
|
|
330
|
-
</ScrollView>
|
|
331
|
-
);
|
|
332
|
-
};
|
|
418
|
+
```typescript
|
|
419
|
+
type AtomicCardPadding =
|
|
420
|
+
| 'none' // No padding
|
|
421
|
+
| 'sm' // Small padding
|
|
422
|
+
| 'md' // Medium padding (default)
|
|
423
|
+
| 'lg'; // Large padding
|
|
333
424
|
```
|
|
334
425
|
|
|
335
|
-
##
|
|
426
|
+
## Accessibility
|
|
427
|
+
|
|
428
|
+
- ✅ Touch target size maintained (min 44x44pt)
|
|
429
|
+
- ✅ Screen reader support for pressable cards
|
|
430
|
+
- ✅ Disabled state announced
|
|
431
|
+
- ✅ Test ID support for testing
|
|
432
|
+
|
|
433
|
+
## Performance Tips
|
|
434
|
+
|
|
435
|
+
1. **FlatList optimization**: Provide `key` prop for list items
|
|
436
|
+
2. **Avoid inline styles**: Use theme tokens or StyleSheet
|
|
437
|
+
3. **Memoization**: Memo card content if complex
|
|
438
|
+
4. **Limit nesting**: Don't nest cards more than 2 levels
|
|
439
|
+
|
|
440
|
+
## Related Components
|
|
441
|
+
|
|
442
|
+
- [`MediaCard`](../molecules/media-card) - Media card with image
|
|
443
|
+
- [`GlowingCard`](../molecules/GlowingCard) - Glowing effect card
|
|
444
|
+
- [`FormField`](../molecules/FormField) - Form field component
|
|
445
|
+
|
|
446
|
+
## License
|
|
336
447
|
|
|
337
448
|
MIT
|