@umituz/react-native-design-system 2.6.87 → 2.6.88
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 -6
- package/src/atoms/AtomicProgress.README.md +402 -0
- package/src/atoms/EmptyState.README.md +372 -0
- package/src/atoms/skeleton/AtomicSkeleton.README.md +339 -0
- package/src/molecules/ConfirmationModal.README.md +370 -0
- package/src/molecules/Divider/README.md +470 -0
- package/src/molecules/StepHeader/README.md +487 -0
- package/src/molecules/alerts/README.md +471 -0
- package/src/molecules/avatar/README.md +431 -0
- package/src/molecules/bottom-sheet/README.md +413 -0
- package/src/molecules/calendar/README.md +339 -0
- package/src/molecules/countdown/README.md +558 -0
- package/src/molecules/media-card/README.md +384 -0
- package/src/molecules/navigation/README.md +377 -0
- package/src/molecules/splash/README.md +474 -0
- package/src/molecules/splash/components/SplashScreen.tsx +0 -14
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
# Navigation System
|
|
2
|
+
|
|
3
|
+
React Native Design System, React Navigation ile entegre çalışan hazır navigator bileşenleri sunar. Tema bilinci ve özelleştirilebilir navigasyon çözümleri sağlar.
|
|
4
|
+
|
|
5
|
+
## Navigation Bileşenleri
|
|
6
|
+
|
|
7
|
+
- **TabsNavigator** - Bottom tab navigasyonu
|
|
8
|
+
- **StackNavigator** - Stack tabanlı navigasyon
|
|
9
|
+
- **FabButton** - Navigation ile entegre FAB
|
|
10
|
+
|
|
11
|
+
## Kurulum
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import {
|
|
15
|
+
TabsNavigator,
|
|
16
|
+
StackNavigator
|
|
17
|
+
} from 'react-native-design-system';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## TabsNavigator
|
|
21
|
+
|
|
22
|
+
Bottom tab navigasyonu için kullanılır. Material Design 3 uyumlu, tema bilinci bir tab bar sağlar.
|
|
23
|
+
|
|
24
|
+
### Temel Kullanım
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { TabsNavigator } from 'react-native-design-system';
|
|
28
|
+
import { HomeScreen } from './HomeScreen';
|
|
29
|
+
import { ProfileScreen } from './ProfileScreen';
|
|
30
|
+
import { SettingsScreen } from './SettingsScreen';
|
|
31
|
+
|
|
32
|
+
export const MainTabs = () => {
|
|
33
|
+
const tabConfig = {
|
|
34
|
+
id: 'main-tabs',
|
|
35
|
+
initialRouteName: 'Home',
|
|
36
|
+
screens: [
|
|
37
|
+
{
|
|
38
|
+
name: 'Home',
|
|
39
|
+
component: HomeScreen,
|
|
40
|
+
options: {
|
|
41
|
+
tabBarLabel: 'Ana Sayfa',
|
|
42
|
+
tabBarIcon: 'home-outline',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Profile',
|
|
47
|
+
component: ProfileScreen,
|
|
48
|
+
options: {
|
|
49
|
+
tabBarLabel: 'Profil',
|
|
50
|
+
tabBarIcon: 'person-outline',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Settings',
|
|
55
|
+
component: SettingsScreen,
|
|
56
|
+
options: {
|
|
57
|
+
tabBarLabel: 'Ayarlar',
|
|
58
|
+
tabBarIcon: 'settings-outline',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return <TabsNavigator config={tabConfig} />;
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Badge Gösterimi
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const tabConfig = {
|
|
72
|
+
id: 'main-tabs',
|
|
73
|
+
initialRouteName: 'Home',
|
|
74
|
+
screens: [
|
|
75
|
+
{
|
|
76
|
+
name: 'Home',
|
|
77
|
+
component: HomeScreen,
|
|
78
|
+
options: {
|
|
79
|
+
tabBarLabel: 'Ana Sayfa',
|
|
80
|
+
tabBarIcon: 'home-outline',
|
|
81
|
+
tabBarBadge: 3, // Badge sayısı
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
// ...
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Gizli Tab
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
screens: [
|
|
93
|
+
{
|
|
94
|
+
name: 'Home',
|
|
95
|
+
component: HomeScreen,
|
|
96
|
+
options: {
|
|
97
|
+
tabBarLabel: 'Ana Sayfa',
|
|
98
|
+
tabBarIcon: 'home-outline',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'Admin',
|
|
103
|
+
component: AdminScreen,
|
|
104
|
+
visible: false, // Gizli tab
|
|
105
|
+
},
|
|
106
|
+
]
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Custom Screen Options
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
const tabConfig = {
|
|
113
|
+
id: 'main-tabs',
|
|
114
|
+
initialRouteName: 'Home',
|
|
115
|
+
screenOptions: {
|
|
116
|
+
headerShown: false,
|
|
117
|
+
},
|
|
118
|
+
screens: [
|
|
119
|
+
// ...
|
|
120
|
+
],
|
|
121
|
+
};
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## StackNavigator
|
|
125
|
+
|
|
126
|
+
Screen'ler arası geçiş için kullanılır. Push/pop animasyonları ve header yönetimi sağlar.
|
|
127
|
+
|
|
128
|
+
### Temel Kullanım
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import { StackNavigator } from 'react-native-design-system';
|
|
132
|
+
import { HomeScreen } from './HomeScreen';
|
|
133
|
+
import { DetailsScreen } from './DetailsScreen';
|
|
134
|
+
|
|
135
|
+
export const AppStack = () => {
|
|
136
|
+
const stackConfig = {
|
|
137
|
+
id: 'app-stack',
|
|
138
|
+
initialRouteName: 'Home',
|
|
139
|
+
screens: [
|
|
140
|
+
{
|
|
141
|
+
name: 'Home',
|
|
142
|
+
component: HomeScreen,
|
|
143
|
+
options: {
|
|
144
|
+
title: 'Ana Sayfa',
|
|
145
|
+
headerShown: true,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'Details',
|
|
150
|
+
component: DetailsScreen,
|
|
151
|
+
options: {
|
|
152
|
+
title: 'Detaylar',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return <StackNavigator config={stackConfig} />;
|
|
159
|
+
};
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Header Gizle
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
screens: [
|
|
166
|
+
{
|
|
167
|
+
name: 'Home',
|
|
168
|
+
component: HomeScreen,
|
|
169
|
+
options: {
|
|
170
|
+
headerShown: false,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
]
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Custom Header
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
screens: [
|
|
180
|
+
{
|
|
181
|
+
name: 'Home',
|
|
182
|
+
component: HomeScreen,
|
|
183
|
+
options: {
|
|
184
|
+
headerTitle: () => <CustomHeader />,
|
|
185
|
+
headerStyle: {
|
|
186
|
+
backgroundColor: '#6366f1',
|
|
187
|
+
},
|
|
188
|
+
headerTintColor: '#ffffff',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Header Right
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
screens: [
|
|
198
|
+
{
|
|
199
|
+
name: 'Profile',
|
|
200
|
+
component: ProfileScreen,
|
|
201
|
+
options: {
|
|
202
|
+
title: 'Profil',
|
|
203
|
+
headerRight: () => (
|
|
204
|
+
<Pressable onPress={handleSettings}>
|
|
205
|
+
<AtomicIcon name="settings-outline" size="md" />
|
|
206
|
+
</Pressable>
|
|
207
|
+
),
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
]
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Örnek Kullanımlar
|
|
214
|
+
|
|
215
|
+
### Ana Navigasyon Yapısı
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
export const AppNavigation = () => {
|
|
219
|
+
return (
|
|
220
|
+
<NavigationContainer>
|
|
221
|
+
<Stacks />
|
|
222
|
+
</NavigationContainer>
|
|
223
|
+
);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const Stacks = () => {
|
|
227
|
+
return (
|
|
228
|
+
<TabsNavigator config={mainTabConfig} />
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### İç içe Navigasyon
|
|
234
|
+
|
|
235
|
+
```tsx
|
|
236
|
+
export const NestedNavigation = () => {
|
|
237
|
+
return (
|
|
238
|
+
<TabsNavigator config={mainTabConfig}>
|
|
239
|
+
{/* Her tab içinde kendi stack'i olabilir */}
|
|
240
|
+
</TabsNavigator>
|
|
241
|
+
);
|
|
242
|
+
};
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Auth Flow
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
export const AuthNavigation = () => {
|
|
249
|
+
return (
|
|
250
|
+
<Stack.Navigator screenOptions={{ headerShown: false }}>
|
|
251
|
+
<Stack.Screen name="Login" component={LoginScreen} />
|
|
252
|
+
<Stack.Screen name="Register" component={RegisterScreen} />
|
|
253
|
+
<Stack.Screen name="ForgotPassword" component={ForgotPasswordScreen} />
|
|
254
|
+
</Stack.Navigator>
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Modal Stack
|
|
260
|
+
|
|
261
|
+
```tsx
|
|
262
|
+
export const MainStack = () => {
|
|
263
|
+
return (
|
|
264
|
+
<Stack.Navigator>
|
|
265
|
+
<Stack.Screen name="Home" component={HomeScreen} />
|
|
266
|
+
<Stack.Screen
|
|
267
|
+
name="Details"
|
|
268
|
+
component={DetailsScreen}
|
|
269
|
+
options={{ presentation: 'modal' }}
|
|
270
|
+
/>
|
|
271
|
+
</Stack.Navigator>
|
|
272
|
+
);
|
|
273
|
+
};
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Konfigürasyon
|
|
277
|
+
|
|
278
|
+
### TabScreenConfig
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
interface TabScreenConfig {
|
|
282
|
+
name: string; // Screen adı (zorunlu)
|
|
283
|
+
component: React.ComponentType; // Component (zorunlu)
|
|
284
|
+
options?: {
|
|
285
|
+
tabBarLabel?: string; // Tab label
|
|
286
|
+
tabBarIcon?: string; // İkon ismi (Ionicons)
|
|
287
|
+
tabBarBadge?: string | number; // Badge
|
|
288
|
+
title?: string; // Header başlığı
|
|
289
|
+
headerShown?: boolean; // Header göster/gizle
|
|
290
|
+
};
|
|
291
|
+
visible?: boolean; // Görünürlük
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### StackScreenConfig
|
|
296
|
+
|
|
297
|
+
```typescript
|
|
298
|
+
interface StackScreenConfig {
|
|
299
|
+
name: string;
|
|
300
|
+
component: React.ComponentType;
|
|
301
|
+
options?: {
|
|
302
|
+
title?: string;
|
|
303
|
+
headerShown?: boolean;
|
|
304
|
+
headerLeft?: React.ReactNode;
|
|
305
|
+
headerRight?: React.ReactNode;
|
|
306
|
+
headerStyle?: any;
|
|
307
|
+
headerTitleStyle?: any;
|
|
308
|
+
headerTintColor?: string;
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Best Practices
|
|
314
|
+
|
|
315
|
+
### 1. Navigasyon Yapısı
|
|
316
|
+
|
|
317
|
+
```tsx
|
|
318
|
+
// Ana tab navigasyonu
|
|
319
|
+
<TabsNavigator config={mainTabs} />
|
|
320
|
+
|
|
321
|
+
// Her tab içinde stack
|
|
322
|
+
<StackNavigator config={homeStack} />
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### 2. Screen Options
|
|
326
|
+
|
|
327
|
+
```tsx
|
|
328
|
+
// Header göster
|
|
329
|
+
options: { headerShown: true }
|
|
330
|
+
|
|
331
|
+
// Header gizle
|
|
332
|
+
options: { headerShown: false }
|
|
333
|
+
|
|
334
|
+
// Custom başlık
|
|
335
|
+
options: { title: 'Başlık' }
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### 3. İkon Seçimi
|
|
339
|
+
|
|
340
|
+
```tsx
|
|
341
|
+
// İkon isimleri (Ionicons)
|
|
342
|
+
options: {
|
|
343
|
+
tabBarIcon: 'home-outline',
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Erişilebilirlik
|
|
348
|
+
|
|
349
|
+
Navigation bileşenleri, tam erişilebilirlik desteği sunar:
|
|
350
|
+
|
|
351
|
+
- ✅ Screen reader desteği
|
|
352
|
+
- ✅ Tab label anonsu
|
|
353
|
+
- ✅ Focus management
|
|
354
|
+
- ✅ Keyboard navigation
|
|
355
|
+
- ✅ Semantic anlamlar
|
|
356
|
+
|
|
357
|
+
## Performans İpuçları
|
|
358
|
+
|
|
359
|
+
1. **Lazy Loading**: Screen'leri lazy load edin
|
|
360
|
+
2. **Memoization**: Screen options'ı memo edin
|
|
361
|
+
3. **Unmount**: Kullanılmayan screen'leri unmount edin
|
|
362
|
+
|
|
363
|
+
## İlgili Bileşenler
|
|
364
|
+
|
|
365
|
+
- [`AtomicFab`](../../atoms/AtomicFab/README.md) - Floating action button
|
|
366
|
+
- [`AtomicIcon`](../../atoms/AtomicIcon/README.md) - İkon bileşeni
|
|
367
|
+
- [`BaseModal`](../BaseModal/README.md) - Modal bileşeni
|
|
368
|
+
|
|
369
|
+
## React Navigation Dokümantasyonu
|
|
370
|
+
|
|
371
|
+
Detaylı bilgi için:
|
|
372
|
+
- [Bottom Tabs](https://reactnavigation.org/docs/bottom-tab-navigator/)
|
|
373
|
+
- [Stack Navigator](https://reactnavigation.org/docs/stack-navigator/)
|
|
374
|
+
|
|
375
|
+
## Lisans
|
|
376
|
+
|
|
377
|
+
MIT
|