@sigmela/router 0.0.11 → 0.0.13

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/src/types.ts DELETED
@@ -1,272 +0,0 @@
1
- import type { ColorValue, StyleProp, ViewStyle, TextStyle } from 'react-native';
2
- import type {
3
- BottomTabsScreenAppearance,
4
- BottomTabsScreenProps,
5
- ScreenProps as RNSScreenProps,
6
- ScreenStackHeaderConfigProps,
7
- TabBarItemLabelVisibilityMode,
8
- TabBarMinimizeBehavior,
9
- } from 'react-native-screens';
10
-
11
- export type TabItem = Omit<BottomTabsScreenProps, 'isFocused' | 'children'>;
12
-
13
- export type NavigationState<Route extends TabItem> = {
14
- index: number;
15
- routes: Route[];
16
- };
17
-
18
- // Navigation core types
19
- export type Scope = 'global' | 'tab' | 'root';
20
-
21
- // Map ScreenOptions to native ScreenStackItem props
22
- export type ScreenOptions = Partial<RNSScreenProps> & {
23
- header?: ScreenStackHeaderConfigProps;
24
- };
25
-
26
- export type HistoryItem = {
27
- key: string;
28
- scope: Scope;
29
- routeId: string;
30
- component: React.ComponentType<any>;
31
- options?: ScreenOptions;
32
- params?: Record<string, unknown>;
33
- query?: Record<string, unknown>;
34
- passProps?: any; // Props passed from controller to component
35
- tabIndex?: number;
36
- stackId?: string;
37
- pattern?: string;
38
- path?: string;
39
- };
40
-
41
- export type VisibleRoute = {
42
- routeId: string;
43
- stackId?: string;
44
- tabIndex?: number;
45
- scope: Scope;
46
- path?: string;
47
- params?: Record<string, unknown>;
48
- query?: Record<string, unknown>;
49
- } | null;
50
-
51
- export type CompiledRoute = {
52
- routeId: string;
53
- scope: Scope;
54
- path: string;
55
- match: (path: string) => false | { params: Record<string, any> };
56
- component: React.ComponentType<any>;
57
- controller?: import('./createController').Controller<any, any>;
58
- options?: ScreenOptions;
59
- tabIndex?: number;
60
- stackId?: string;
61
- };
62
-
63
- export type TabBarConfig = {
64
- /**
65
- * @summary Specifies the minimize behavior for the tab bar.
66
- *
67
- * Available starting from iOS 26.
68
- *
69
- * The following values are currently supported:
70
- *
71
- * - `automatic` - resolves to the system default minimize behavior
72
- * - `never` - the tab bar does not minimize
73
- * - `onScrollDown` - the tab bar minimizes when scrolling down and
74
- * expands when scrolling back up
75
- * - `onScrollUp` - the tab bar minimizes when scrolling up and expands
76
- * when scrolling back down
77
- *
78
- * The supported values correspond to the official UIKit documentation:
79
- * @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior|UITabBarController.MinimizeBehavior}
80
- *
81
- * @default Defaults to `automatic`.
82
- *
83
- * @platform ios
84
- * @supported iOS 26 or higher
85
- */
86
- tabBarMinimizeBehavior?: TabBarMinimizeBehavior;
87
- // #endregion iOS-only appearance
88
- };
89
-
90
- // BottomTabsScreenAppearance
91
- export interface NavigationAppearance {
92
- tabBar?: {
93
- // #region iOS-only appearance
94
- /**
95
- * @summary Specifies the standard tab bar appearance.
96
- *
97
- * Allows to customize the appearance depending on the tab bar item layout (stacked,
98
- * inline, compact inline) and state (normal, selected, focused, disabled).
99
- *
100
- * @platform ios
101
- */
102
- standardAppearance?: BottomTabsScreenAppearance;
103
- /**
104
- * @summary Specifies the tab bar appearace when edge of scrollable content aligns
105
- * with the edge of the tab bar.
106
- *
107
- * Allows to customize the appearance depending on the tab bar item layout (stacked,
108
- * inline, compact inline) and state (normal, selected, focused, disabled).
109
- *
110
- * If this property is `undefined`, UIKit uses `standardAppearance`, modified to
111
- * have a transparent background.
112
- *
113
- * @platform ios
114
- */
115
- scrollEdgeAppearance?: BottomTabsScreenAppearance;
116
-
117
- // #endregion Events
118
-
119
- // #region Android-only appearance
120
- /**
121
- * @summary Specifies the background color for the entire tab bar.
122
- *
123
- * @platform android
124
- */
125
- backgroundColor?: ColorValue;
126
- tabBarItemStyle?: {
127
- /**
128
- * @summary Specifies the font family used for the title of each tab bar item.
129
- *
130
- * @platform android
131
- */
132
- titleFontFamily?: TextStyle['fontFamily'];
133
- /**
134
- * @summary Specifies the font size used for the title of each tab bar item.
135
- *
136
- * The size is represented in scale-independent pixels (sp).
137
- *
138
- * @platform android
139
- */
140
- titleFontSize?: TextStyle['fontSize'];
141
- /**
142
- * @summary Specifies the font size used for the title of each tab bar item in active state.
143
- *
144
- * The size is represented in scale-independent pixels (sp).
145
- *
146
- * @platform android
147
- */
148
- titleFontSizeActive?: TextStyle['fontSize'];
149
- /**
150
- * @summary Specifies the font weight used for the title of each tab bar item.
151
- *
152
- * @platform android
153
- */
154
- titleFontWeight?: TextStyle['fontWeight'];
155
- /**
156
- * @summary Specifies the font style used for the title of each tab bar item.
157
- *
158
- * @platform android
159
- */
160
- titleFontStyle?: TextStyle['fontStyle'];
161
- /**
162
- * @summary Specifies the font color used for the title of each tab bar item.
163
- *
164
- * @platform android
165
- */
166
- titleFontColor?: TextStyle['color'];
167
- /**
168
- * @summary Specifies the font color used for the title of each tab bar item in active state.
169
- *
170
- * If not provided, `tabBarItemTitleFontColor` is used.
171
- *
172
- * @platform android
173
- */
174
- titleFontColorActive?: TextStyle['color'];
175
- /**
176
- * @summary Specifies the icon color for each tab bar item.
177
- *
178
- * @platform android
179
- */
180
- iconColor?: ColorValue;
181
- /**
182
- * @summary Specifies the icon color for each tab bar item in active state.
183
- *
184
- * If not provided, `tabBarItemIconColor` is used.
185
- *
186
- * @platform android
187
- */
188
- iconColorActive?: ColorValue;
189
- /**
190
- * @summary Specifies the background color of the active indicator.
191
- *
192
- * @platform android
193
- */
194
- activeIndicatorColor?: ColorValue;
195
- /**
196
- * @summary Specifies if the active indicator should be used.
197
- *
198
- * @default true
199
- *
200
- * @platform android
201
- */
202
- activeIndicatorEnabled?: boolean;
203
- /**
204
- * @summary Specifies the color of each tab bar item's ripple effect.
205
- *
206
- * @platform android
207
- */
208
- rippleColor?: ColorValue;
209
- /**
210
- * @summary Specifies the label visibility mode.
211
- *
212
- * The label visibility mode defines when the labels of each item bar should be displayed.
213
- *
214
- * The following values are available:
215
- * - `auto` - the label behaves as in “labeled” mode when there are 3 items or less, or as in “selected” mode when there are 4 items or more
216
- * - `selected` - the label is only shown on the selected navigation item
217
- * - `labeled` - the label is shown on all navigation items
218
- * - `unlabeled` - the label is hidden for all navigation items
219
- *
220
- * The supported values correspond to the official Material Components documentation:
221
- * @see {@link https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible|Material Components documentation}
222
- *
223
- * @default auto
224
- * @platform android
225
- */
226
- labelVisibilityMode?: TabBarItemLabelVisibilityMode;
227
- };
228
-
229
- // #endregion Android-only appearance
230
-
231
- // #region iOS-only appearance
232
- /**
233
- * @summary Specifies the color used for selected tab's text and icon color.
234
- *
235
- * Starting from iOS 26, it also impacts glow of Liquid Glass tab
236
- * selection view.
237
- *
238
- * `tabBarItemTitleFontColor` and `tabBarItemIconColor` defined on
239
- * BottomTabsScreen component override this color.
240
- *
241
- * @platform ios
242
- */
243
- tintColor?: ColorValue;
244
- // #region Experimental support
245
- /**
246
- * @summary Experimental prop for changing container control.
247
- *
248
- * If set to true, tab screen changes need to be handled by JS using
249
- * onNativeFocusChange callback (controlled/programatically-driven).
250
- *
251
- * If set to false, tab screen change will not be prevented by the
252
- * native side (managed/natively-driven).
253
- *
254
- * On iOS, some features are not fully implemented for managed tabs
255
- * (e.g. overrideScrollViewContentInsetAdjustmentBehavior).
256
- *
257
- * On Android, only controlled tabs are currently supported.
258
- *
259
- * @default Defaults to `false`.
260
- *
261
- * @platform android, ios
262
- */
263
- experimentalControlNavigationStateInJS?: boolean;
264
- // #endregion Experimental support
265
- };
266
- screenStyle?: StyleProp<ViewStyle>;
267
- /**
268
- * Global header appearance applied to all screens with visible headers.
269
- * Per-screen header options override these.
270
- */
271
- header?: ScreenStackHeaderConfigProps;
272
- }