@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.
Files changed (45) hide show
  1. package/package.json +1 -1
  2. package/src/atoms/AtomicAvatar.README.md +284 -397
  3. package/src/atoms/AtomicBadge.README.md +123 -358
  4. package/src/atoms/AtomicCard.README.md +358 -247
  5. package/src/atoms/AtomicDatePicker.README.md +127 -332
  6. package/src/atoms/AtomicFab.README.md +194 -352
  7. package/src/atoms/AtomicIcon.README.md +241 -274
  8. package/src/atoms/AtomicProgress.README.md +100 -338
  9. package/src/atoms/AtomicSpinner.README.md +304 -337
  10. package/src/atoms/AtomicText.README.md +153 -389
  11. package/src/atoms/AtomicTextArea.README.md +267 -268
  12. package/src/atoms/EmptyState.README.md +247 -292
  13. package/src/atoms/GlassView/README.md +313 -444
  14. package/src/atoms/button/README.md +186 -297
  15. package/src/atoms/button/STRATEGY.md +252 -0
  16. package/src/atoms/chip/README.md +242 -290
  17. package/src/atoms/input/README.md +296 -290
  18. package/src/atoms/picker/README.md +278 -309
  19. package/src/atoms/skeleton/AtomicSkeleton.README.md +394 -252
  20. package/src/exports/theme.ts +0 -1
  21. package/src/molecules/BaseModal/README.md +356 -0
  22. package/src/molecules/BaseModal.README.md +324 -200
  23. package/src/molecules/ConfirmationModal.README.md +349 -302
  24. package/src/molecules/Divider/README.md +293 -376
  25. package/src/molecules/FormField.README.md +321 -534
  26. package/src/molecules/GlowingCard/GlowingCard.tsx +1 -1
  27. package/src/molecules/GlowingCard/README.md +230 -372
  28. package/src/molecules/IconContainer.tsx +1 -1
  29. package/src/molecules/List/README.md +281 -488
  30. package/src/molecules/ListItem.README.md +320 -315
  31. package/src/molecules/SearchBar/README.md +332 -430
  32. package/src/molecules/StepHeader/README.md +311 -411
  33. package/src/molecules/StepProgress/README.md +281 -448
  34. package/src/molecules/alerts/README.md +272 -355
  35. package/src/molecules/avatar/README.md +295 -356
  36. package/src/molecules/bottom-sheet/README.md +303 -340
  37. package/src/molecules/calendar/README.md +301 -265
  38. package/src/molecules/countdown/README.md +347 -456
  39. package/src/molecules/emoji/README.md +281 -514
  40. package/src/molecules/listitem/README.md +307 -399
  41. package/src/molecules/media-card/MediaCard.tsx +31 -34
  42. package/src/molecules/media-card/README.md +217 -319
  43. package/src/molecules/navigation/README.md +263 -284
  44. package/src/molecules/splash/README.md +76 -92
  45. package/src/molecules/swipe-actions/README.md +376 -588
@@ -1,363 +1,252 @@
1
- # AtomicButton
1
+ # Button
2
2
 
3
- AtomicButton, React Native için güçlü ve özelleştirilebilir bir buton bileşenidir. Material Design 3 prensiplerine uygun olarak tasarlanmış ve tamamen özelleştirilebilir.
3
+ Clickable button component with multiple variants and sizes for React Native applications.
4
4
 
5
- ## Özellikler
5
+ ## Import & Usage
6
6
 
7
- - ✨ **6 Variant**: Primary, Secondary, Tertiary, Surface, Outline, Ghost
8
- - 📏 **3 Size**: Small, Medium, Large
9
- - 🎨 **Tam Özelleştirilebilir**: Stil ve metin özelleştirmesi
10
- - 🔄 **Loading State**: Yükleme durumu
11
- - 🎭 **İkon Desteği**: Sol veya sağ ikon
12
- - 📐 **Full Width**: Tam genişlik desteği
13
- - ♿ **Erişilebilirlik**: Tam erişilebilirlik desteği
7
+ ```typescript
8
+ import { Button } from 'react-native-design-system/src/atoms/button';
9
+ ```
10
+
11
+ **Location:** `src/atoms/button/Button.tsx`
14
12
 
15
- ## Kurulum
13
+ ## Basic Usage
16
14
 
17
15
  ```tsx
18
- import { AtomicButton } from 'react-native-design-system';
16
+ <Button title="Click me" onPress={handlePress} />
19
17
  ```
20
18
 
21
- ## Temel Kullanım
19
+ ## Strategy
22
20
 
23
- ```tsx
24
- import React from 'react';
25
- import { View } from 'react-native';
26
- import { AtomicButton } from 'react-native-design-system';
27
-
28
- export const BasicExample = () => {
29
- return (
30
- <View style={{ padding: 16 }}>
31
- <AtomicButton
32
- title="Buton"
33
- onPress={() => console.log('Tıklandı!')}
34
- />
35
- </View>
36
- );
37
- };
38
- ```
21
+ **Purpose**: Provide consistent, accessible, and performant button interactions throughout the application.
39
22
 
40
- ## Variant'lar
23
+ **When to Use**:
24
+ - Primary actions (submit, confirm, save)
25
+ - Secondary actions (cancel, go back)
26
+ - Destructive actions (delete, remove)
27
+ - Navigation actions (open link, go to screen)
41
28
 
42
- ```tsx
43
- <View style={{ gap: 12 }}>
44
- {/* Primary */}
45
- <AtomicButton
46
- variant="primary"
47
- title="Primary"
48
- onPress={() => {}}
49
- />
50
-
51
- {/* Secondary */}
52
- <AtomicButton
53
- variant="secondary"
54
- title="Secondary"
55
- onPress={() => {}}
56
- />
57
-
58
- {/* Tertiary */}
59
- <AtomicButton
60
- variant="tertiary"
61
- title="Tertiary"
62
- onPress={() => {}}
63
- />
64
-
65
- {/* Surface */}
66
- <AtomicButton
67
- variant="surface"
68
- title="Surface"
69
- onPress={() => {}}
70
- />
71
-
72
- {/* Outline */}
73
- <AtomicButton
74
- variant="outline"
75
- title="Outline"
76
- onPress={() => {}}
77
- />
78
-
79
- {/* Ghost */}
80
- <AtomicButton
81
- variant="ghost"
82
- title="Ghost"
83
- onPress={() => {}}
84
- />
85
- </View>
86
- ```
29
+ **When NOT to Use**:
30
+ - For navigation - use Navigation components instead
31
+ - For complex interactions - use Pressable or TouchableOpacity
32
+ - For icon-only buttons - use IconButton instead
87
33
 
88
- ## Boyutlar
34
+ ## Rules
89
35
 
90
- ```tsx
91
- <View style={{ gap: 12 }}>
92
- {/* Small */}
93
- <AtomicButton
94
- size="sm"
95
- title="Small"
96
- onPress={() => {}}
97
- />
98
-
99
- {/* Medium (Varsayılan) */}
100
- <AtomicButton
101
- size="md"
102
- title="Medium"
103
- onPress={() => {}}
104
- />
105
-
106
- {/* Large */}
107
- <AtomicButton
108
- size="lg"
109
- title="Large"
110
- onPress={() => {}}
111
- />
112
- </View>
113
- ```
36
+ ### Required
114
37
 
115
- ## İkonlu Butonlar
38
+ 1. **ALWAYS** provide a `title` prop (except for loading state)
39
+ 2. **MUST** have an `onPress` handler (unless disabled)
40
+ 3. **NEVER** nest buttons inside buttons
41
+ 4. **ALWAYS** provide accessible label for icon-only buttons
42
+ 5. **MUST** have adequate touch target size (min 44x44pt)
116
43
 
117
- ```tsx
118
- <View style={{ gap: 12 }}>
119
- {/* Sol İkon */}
120
- <AtomicButton
121
- title="Devam Et"
122
- icon="arrow-forward-outline"
123
- iconPosition="left"
124
- onPress={() => {}}
125
- />
126
-
127
- {/* Sağ İkon */}
128
- <AtomicButton
129
- title="Geri"
130
- icon="arrow-back-outline"
131
- iconPosition="right"
132
- onPress={() => {}}
133
- />
134
-
135
- {/* Sadece İkon */}
136
- <AtomicButton
137
- icon="add-outline"
138
- onPress={() => {}}
139
- />
140
- </View>
141
- ```
44
+ ### Disabled State
142
45
 
143
- ## Loading State
46
+ 1. **MUST** visually indicate disabled state
47
+ 2. **MUST NOT** respond to touch when disabled
48
+ 3. **SHOULD** provide reason for disabled state (tooltip or hint)
144
49
 
145
- ```tsx
146
- <AtomicButton
147
- title="Yükleniyor"
148
- loading
149
- onPress={() => {}}
150
- />
151
- ```
50
+ ### Variants
152
51
 
153
- ## Disabled State
52
+ 1. **Primary**: Single primary action per screen/section
53
+ 2. **Secondary**: Multiple secondary actions allowed
54
+ 3. **Destructive**: Reserved for destructive actions only
55
+ 4. **Ghost**: For tertiary actions or cancel buttons
154
56
 
155
- ```tsx
156
- <AtomicButton
157
- title="Devre Dışı"
158
- disabled
159
- onPress={() => {}}
160
- />
161
- ```
57
+ ## Forbidden
162
58
 
163
- ## Full Width
59
+ **NEVER** do these:
164
60
 
165
61
  ```tsx
166
- <AtomicButton
167
- title="Tam Genişlik"
168
- fullWidth
169
- onPress={() => {}}
170
- />
171
- ```
62
+ // ❌ Empty buttons
63
+ <Button />
172
64
 
173
- ## Örnek Kullanımlar
65
+ // Nested buttons
66
+ <Button onPress={action1}>
67
+ <Button onPress={action2} />
68
+ </Button>
174
69
 
175
- ### Form Gönderme
70
+ // Buttons without onPress
71
+ <Button title="Click me" />
176
72
 
177
- ```tsx
178
- <AtomicButton
179
- variant="primary"
180
- size="lg"
181
- title="Gönder"
182
- loading={isSubmitting}
183
- onPress={handleSubmit}
184
- />
185
- ```
73
+ // ❌ Inline buttons (use Link instead)
74
+ <View style={{ flexDirection: 'row' }}>
75
+ <Text>Click </Text>
76
+ <Button title="here" />
77
+ </View>
186
78
 
187
- ### Silme İşlemi
79
+ // Too many primary buttons
80
+ <View>
81
+ <Button variant="primary" title="Save" />
82
+ <Button variant="primary" title="Cancel" /> {/* ❌ Use ghost */}
83
+ </View>
188
84
 
189
- ```tsx
190
- <AtomicButton
191
- variant="outline"
192
- title="Sil"
193
- icon="trash-outline"
194
- onPress={handleDelete}
195
- />
85
+ // ❌ Hardcoded text (use i18n)
86
+ <Button title="Submit" /> {/* ❌ Use t('buttons.submit') */}
196
87
  ```
197
88
 
198
- ### İptal
89
+ ## Best Practices
199
90
 
200
- ```tsx
201
- <AtomicButton
202
- variant="ghost"
203
- title="İptal"
204
- onPress={handleCancel}
205
- />
206
- ```
91
+ ### Button Placement
207
92
 
208
- ### İkon Butonları
93
+ **DO**:
94
+ - Place primary action at bottom-right or top-right
95
+ - Group related actions together
96
+ - Use consistent button order (Cancel, OK) or (OK, Cancel)
209
97
 
210
- ```tsx
211
- <View style={{ flexDirection: 'row', gap: 8 }}>
212
- <AtomicButton
213
- variant="surface"
214
- icon="add-outline"
215
- onPress={() => {}}
216
- />
217
-
218
- <AtomicButton
219
- variant="surface"
220
- icon="create-outline"
221
- onPress={() => {}}
222
- />
223
-
224
- <AtomicButton
225
- variant="surface"
226
- icon="trash-outline"
227
- onPress={() => {}}
228
- />
229
- </View>
230
- ```
98
+ ❌ **DON'T**:
99
+ - Place primary action in middle of other actions
100
+ - Mix button order inconsistently
101
+ - Use too many buttons on one screen
231
102
 
232
- ## Props
233
-
234
- ### AtomicButtonProps
235
-
236
- | Prop | Tip | Varsayılan | Açıklama |
237
- |------|-----|------------|----------|
238
- | `title` | `string` | - | Buton metni |
239
- | `children` | `ReactNode` | - | Alternatif içerik |
240
- | `onPress` | `() => void` | - **(Zorunlu)** | Tıklama olayı |
241
- | `variant` | `ButtonVariant` | `'primary'` | Buton görünüm stili |
242
- | `size` | `ButtonSize` | `'md'` | Buton boyutu |
243
- | `disabled` | `boolean` | `false` | Devre dışı |
244
- | `loading` | `boolean` | `false` | Yükleme durumu |
245
- | `icon` | `string` | - | İkon ismi (Ionicons) |
246
- | `iconPosition` | `'left' \| 'right'` | `'left'` | İkon konumu |
247
- | `fullWidth` | `boolean` | `false` | Tam genişlik |
248
- | `style` | `StyleProp<ViewStyle>` | - | Container stil |
249
- | `textStyle` | `StyleProp<TextStyle>` | - | Metin stil |
250
- | `activeOpacity` | `number` | `0.8` | Opaklık |
251
- | `testID` | `string` | - | Test ID'si |
252
-
253
- ### ButtonVariant
103
+ ### Button Wording
254
104
 
255
- ```typescript
256
- type ButtonVariant =
257
- | 'primary' // Ana buton
258
- | 'secondary' // İkincil buton
259
- | 'tertiary' // Üçüncül buton
260
- | 'surface' // Yüzey butonu
261
- | 'outline' // Çerçeveli buton
262
- | 'ghost'; // Hayalet buton
263
- ```
105
+ ✅ **DO**:
106
+ - Use action verbs (Save, Delete, Cancel)
107
+ - Be specific (Save Draft vs Save)
108
+ - Use sentence case
109
+ - Keep short (1-3 words)
264
110
 
265
- ### ButtonSize
111
+ **DON'T**:
112
+ - Use ambiguous text (OK, Sure, Submit)
113
+ - Use long text (I agree to the terms and conditions)
114
+ - Use all caps (CLICK HERE)
266
115
 
267
- ```typescript
268
- type ButtonSize = 'sm' | 'md' | 'lg';
269
- ```
116
+ ### Loading State
270
117
 
271
- ## Stil Özelleştirme
118
+ **DO**:
119
+ ```tsx
120
+ <Button loading={isLoading} onPress={handleSubmit}>
121
+ {isLoading ? 'Saving...' : 'Save'}
122
+ </Button>
123
+ ```
272
124
 
125
+ ❌ **DON'T**:
273
126
  ```tsx
274
- <AtomicButton
275
- title="Özel Buton"
276
- onPress={() => {}}
277
- style={{
278
- backgroundColor: '#6366f1',
279
- borderRadius: 8,
280
- shadowColor: '#6366f1',
281
- shadowOffset: { width: 0, height: 4 },
282
- shadowOpacity: 0.3,
283
- shadowRadius: 8,
284
- elevation: 8,
285
- }}
286
- textStyle={{
287
- color: '#ffffff',
288
- fontSize: 16,
289
- fontWeight: '700',
290
- }}
291
- />
127
+ // Don't disable entire form during load
128
+ <Button disabled={isLoading} />
292
129
  ```
293
130
 
294
- ## Best Practices
131
+ ## AI Coding Guidelines
295
132
 
296
- ### 1. Buton Hiyerarşisi
133
+ ### For AI Agents
297
134
 
298
- ```tsx
299
- // Ana eylem
300
- <AtomicButton variant="primary" title="Kaydet" onPress={save} />
135
+ When generating Button components, follow these rules:
301
136
 
302
- // İkincil eylem
303
- <AtomicButton variant="secondary" title="İptal" onPress={cancel} />
137
+ 1. **Always import from correct path**:
138
+ ```typescript
139
+ import { Button } from 'react-native-design-system/src/atoms/button';
140
+ ```
304
141
 
305
- // Tehlikeli eylem
306
- <AtomicButton variant="outline" title="Sil" onPress={delete} />
307
- ```
142
+ 2. **Always provide required props**:
143
+ ```tsx
144
+ <Button
145
+ title="明确且简洁的标题"
146
+ onPress={具体的处理函数}
147
+ variant="根据上下文选择合适的变体"
148
+ />
149
+ ```
150
+
151
+ 3. **Always handle loading state**:
152
+ ```tsx
153
+ const [loading, setLoading] = useState(false);
308
154
 
309
- ### 2. İkon Kullanımı
155
+ <Button
156
+ loading={loading}
157
+ onPress={async () => {
158
+ setLoading(true);
159
+ await handleAction();
160
+ setLoading(false);
161
+ }}
162
+ />
163
+ ```
310
164
 
165
+ 4. **Always use i18n for text**:
166
+ ```tsx
167
+ <Button title={t('common.save')} onPress={handleSave} />
168
+ ```
169
+
170
+ 5. **Never disable without reason**:
171
+ ```tsx
172
+ // ❌ Bad
173
+ <Button disabled={true} />
174
+
175
+ // ✅ Good
176
+ <Button disabled={!form.isValid} title={form.error || 'Complete form'} />
177
+ ```
178
+
179
+ ### Common Patterns
180
+
181
+ #### Form Submit Button
311
182
  ```tsx
312
- // İlerle - sağ ikon
313
- <AtomicButton
314
- title="İlerle"
315
- icon="arrow-forward"
316
- iconPosition="right"
317
- onPress={next}
183
+ <Button
184
+ variant="primary"
185
+ title={t('form.submit')}
186
+ onPress={handleSubmit}
187
+ disabled={!isFormValid}
188
+ loading={isSubmitting}
318
189
  />
190
+ ```
319
191
 
320
- // Geri - sol ikon
321
- <AtomicButton
322
- title="Geri"
323
- icon="arrow-back"
324
- iconPosition="left"
325
- onPress={back}
192
+ #### Destructive Action
193
+ ```tsx
194
+ <Button
195
+ variant="destructive"
196
+ title={t('common.delete')}
197
+ onPress={handleDelete}
198
+ confirmRequired={true}
326
199
  />
327
200
  ```
328
201
 
329
- ### 3. Loading State
330
-
202
+ #### Cancel Action
331
203
  ```tsx
332
- <AtomicButton
333
- title="Gönder"
334
- loading={isLoading}
335
- onPress={handleSubmit}
336
- disabled={isLoading}
204
+ <Button
205
+ variant="ghost"
206
+ title={t('common.cancel')}
207
+ onPress={handleCancel}
337
208
  />
338
209
  ```
339
210
 
340
- ## Erişilebilirlik
211
+ ## Props Reference
212
+
213
+ | Prop | Type | Required | Default | Description |
214
+ |------|------|----------|---------|-------------|
215
+ | `title` | `string` | Yes* | - | Button text (*not required for loading) |
216
+ | `onPress` | `() => void` | Yes | - | Press handler |
217
+ | `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'destructive'` | No | `'primary'` | Visual style |
218
+ | `size` | `'small' \| 'medium' \| 'large'` | No | `'medium'` | Button size |
219
+ | `disabled` | `boolean` | No | `false` | Disable button |
220
+ | `loading` | `boolean` | No | `false` | Show loading indicator |
221
+ | `fullWidth` | `boolean` | No | `false` | Expand to full width |
222
+ | `icon` | `string` | No | - | Icon name (Ionicons) |
223
+
224
+ ## Accessibility
225
+
226
+ - ✅ Screen reader announces button title
227
+ - ✅ Minimum touch target: 44x44pt
228
+ - ✅ Focus visible on keyboard navigation
229
+ - ✅ Disabled state announced to screen readers
230
+ - ✅ Loading state announced to screen readers
341
231
 
342
- AtomicButton, tam erişilebilirlik desteği sunar:
232
+ ## Performance
343
233
 
344
- - Touch uygun boyut (minimum 44x44)
345
- - Screen reader desteği
346
- - Disabled state anonsu
347
- - ✅ Test ID desteği
234
+ 1. **Memo handlers**: Use `useCallback` for onPress handlers
235
+ 2. **Avoid inline functions**: Don't create functions in render
236
+ 3. **Conditional rendering**: Don't render disabled buttons if action unavailable
348
237
 
349
- ## Performans İpuçları
238
+ ## Related Components
350
239
 
351
- 1. **React.memo**: AtomicButton zaten `React.memo` ile sarılmış
352
- 2. **Inline Styles**: Inline stil kullanmaktan kaçının, bunun yerine theme kullanın
353
- 3. **Re-renders**: Prop'ları stabilize edin (useCallback, useMemo)
240
+ - [`IconButton`](./icon-button/README.md) - Icon-only buttons
241
+ - [`Link`](./link/README.md) - Navigation links
242
+ - [`Pressable`](../pressable/README.md) - Custom pressable components
354
243
 
355
- ## İlgili Bileşenler
244
+ ## Version History
356
245
 
357
- - [`AtomicIcon`](../AtomicIcon/README.md) - İkon bileşeni
358
- - [`AtomicSpinner`](../AtomicSpinner/README.md) - Yükleme göstergesi
359
- - [`AtomicText`](../AtomicText/README.md) - Metin bileşeni
246
+ - **2.6.0**: Added loading prop
247
+ - **2.5.0**: Added fullWidth support
248
+ - **2.0.0**: Initial release with 4 variants
360
249
 
361
- ## Lisans
250
+ ## License
362
251
 
363
252
  MIT