@xsolla/xui-tab-bar 0.74.0 → 0.76.0
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/native/index.js.flow +213 -0
- package/package.json +4 -4
- package/web/index.js.flow +213 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for index
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.21.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React$1, { Node } from "react";
|
|
9
|
+
declare type TabBarLabelPosition = "beside-icon" | "below-icon";
|
|
10
|
+
declare interface TabBarProps {
|
|
11
|
+
/**
|
|
12
|
+
* React Navigation state
|
|
13
|
+
*/
|
|
14
|
+
state: {
|
|
15
|
+
index: number,
|
|
16
|
+
routes: {
|
|
17
|
+
key: string,
|
|
18
|
+
name: string,
|
|
19
|
+
params?: { [key: string]: any },
|
|
20
|
+
...
|
|
21
|
+
}[],
|
|
22
|
+
...
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* React Navigation descriptors
|
|
27
|
+
*/
|
|
28
|
+
descriptors: {
|
|
29
|
+
[key: string]: {
|
|
30
|
+
options: {
|
|
31
|
+
tabBarLabel?:
|
|
32
|
+
| string
|
|
33
|
+
| ((props: {
|
|
34
|
+
focused: boolean,
|
|
35
|
+
color: string,
|
|
36
|
+
position: TabBarLabelPosition,
|
|
37
|
+
...
|
|
38
|
+
}) => Node),
|
|
39
|
+
title?: string,
|
|
40
|
+
tabBarIcon?: (props: {
|
|
41
|
+
focused: boolean,
|
|
42
|
+
color: string,
|
|
43
|
+
size: number,
|
|
44
|
+
...
|
|
45
|
+
}) => Node,
|
|
46
|
+
tabBarBadge?: string | number,
|
|
47
|
+
tabBarBadgeStyle?: any,
|
|
48
|
+
tabBarShowLabel?: boolean,
|
|
49
|
+
tabBarAccessibilityLabel?: string,
|
|
50
|
+
tabBarTestID?: string,
|
|
51
|
+
[key: string]: any,
|
|
52
|
+
},
|
|
53
|
+
...
|
|
54
|
+
},
|
|
55
|
+
...
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* React Navigation navigation object
|
|
60
|
+
*/
|
|
61
|
+
navigation: {
|
|
62
|
+
navigate: (name: string, params?: { [key: string]: any }) => void,
|
|
63
|
+
emit: (options: {
|
|
64
|
+
type: string,
|
|
65
|
+
target?: string,
|
|
66
|
+
canPreventDefault?: boolean,
|
|
67
|
+
...
|
|
68
|
+
}) => any,
|
|
69
|
+
...
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Position of the label relative to the icon
|
|
74
|
+
* @default 'below-icon'
|
|
75
|
+
*/
|
|
76
|
+
labelPosition?: TabBarLabelPosition;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Custom background color for the tab bar
|
|
80
|
+
*/
|
|
81
|
+
backgroundColor?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Test ID for testing frameworks
|
|
85
|
+
*/
|
|
86
|
+
testID?: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Accessible label for the tab bar navigation
|
|
90
|
+
* Used by screen readers to identify the navigation region
|
|
91
|
+
*/
|
|
92
|
+
"aria-label"?: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* ID of element that labels this tab bar
|
|
96
|
+
*/
|
|
97
|
+
"aria-labelledby"?: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* HTML id attribute for the tab bar container
|
|
101
|
+
* Used to generate unique IDs for tabs and panels
|
|
102
|
+
*/
|
|
103
|
+
id?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Whether keyboard navigation should automatically activate tabs
|
|
107
|
+
* When true (default), arrow keys both focus and activate tabs
|
|
108
|
+
* When false, arrow keys only focus, Enter/Space activates
|
|
109
|
+
* @default true
|
|
110
|
+
*/
|
|
111
|
+
activateOnFocus?: boolean;
|
|
112
|
+
}
|
|
113
|
+
declare interface TabBarItemProps {
|
|
114
|
+
/**
|
|
115
|
+
* Display label for the tab
|
|
116
|
+
*/
|
|
117
|
+
label: string | Node;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Icon to display in the tab
|
|
121
|
+
*/
|
|
122
|
+
icon?: Node;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Badge content to display on the tab
|
|
126
|
+
*/
|
|
127
|
+
badge?: string | number;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Whether this tab is currently focused/selected
|
|
131
|
+
*/
|
|
132
|
+
focused: boolean;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Callback when tab is pressed
|
|
136
|
+
*/
|
|
137
|
+
onPress: () => void;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Callback when tab is long pressed
|
|
141
|
+
*/
|
|
142
|
+
onLongPress: () => void;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Position of the label relative to the icon
|
|
146
|
+
*/
|
|
147
|
+
labelPosition: TabBarLabelPosition;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Accessible label for screen readers
|
|
151
|
+
*/
|
|
152
|
+
accessibilityLabel?: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Test ID for testing frameworks
|
|
156
|
+
*/
|
|
157
|
+
testID?: string;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Unique ID for the tab element
|
|
161
|
+
*/
|
|
162
|
+
id?: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Index of the tab in the tab list
|
|
166
|
+
*/
|
|
167
|
+
index: number;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Total number of tabs
|
|
171
|
+
*/
|
|
172
|
+
tabCount: number;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Callback for keyboard navigation
|
|
176
|
+
*/
|
|
177
|
+
onKeyDown?: (e: React$KeyboardEvent<>, index: number) => void;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Ref callback for focus management
|
|
181
|
+
*/
|
|
182
|
+
tabRef?: (el: HTMLElement | null) => void;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* TabBar - An accessible tab bar navigation component
|
|
186
|
+
*
|
|
187
|
+
* Implements WAI-ARIA Tabs pattern with proper keyboard navigation:
|
|
188
|
+
* - Arrow Left/Right: Navigate between tabs
|
|
189
|
+
* - Home: Jump to first tab
|
|
190
|
+
* - End: Jump to last tab
|
|
191
|
+
* - Enter/Space: Activate focused tab (when activateOnFocus is false)
|
|
192
|
+
* @example ```tsx
|
|
193
|
+
* <TabBar
|
|
194
|
+
* state={navigationState}
|
|
195
|
+
* descriptors={descriptors}
|
|
196
|
+
* navigation={navigation}
|
|
197
|
+
* aria-label="Main navigation"
|
|
198
|
+
* />
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
declare var TabBar: React$1.FC<TabBarProps>;
|
|
202
|
+
/**
|
|
203
|
+
* TabBarItem - An accessible tab item component
|
|
204
|
+
*
|
|
205
|
+
* Implements WAI-ARIA tab role with proper semantics:
|
|
206
|
+
* - role="tab" for tab semantics
|
|
207
|
+
* - aria-selected to indicate active state
|
|
208
|
+
* - tabIndex management for roving tabindex pattern
|
|
209
|
+
* - Keyboard navigation support
|
|
210
|
+
*/
|
|
211
|
+
declare var TabBarItem: React$1.FC<TabBarItemProps>;
|
|
212
|
+
export type { TabBarItemProps, TabBarLabelPosition, TabBarProps };
|
|
213
|
+
declare export { TabBar, TabBarItem };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-tab-bar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.76.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-badge": "0.
|
|
17
|
-
"@xsolla/xui-core": "0.
|
|
18
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-badge": "0.76.0",
|
|
17
|
+
"@xsolla/xui-core": "0.76.0",
|
|
18
|
+
"@xsolla/xui-primitives-core": "0.76.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": ">=16.8.0"
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for index
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.21.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React$1, { Node } from "react";
|
|
9
|
+
declare type TabBarLabelPosition = "beside-icon" | "below-icon";
|
|
10
|
+
declare interface TabBarProps {
|
|
11
|
+
/**
|
|
12
|
+
* React Navigation state
|
|
13
|
+
*/
|
|
14
|
+
state: {
|
|
15
|
+
index: number,
|
|
16
|
+
routes: {
|
|
17
|
+
key: string,
|
|
18
|
+
name: string,
|
|
19
|
+
params?: { [key: string]: any },
|
|
20
|
+
...
|
|
21
|
+
}[],
|
|
22
|
+
...
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* React Navigation descriptors
|
|
27
|
+
*/
|
|
28
|
+
descriptors: {
|
|
29
|
+
[key: string]: {
|
|
30
|
+
options: {
|
|
31
|
+
tabBarLabel?:
|
|
32
|
+
| string
|
|
33
|
+
| ((props: {
|
|
34
|
+
focused: boolean,
|
|
35
|
+
color: string,
|
|
36
|
+
position: TabBarLabelPosition,
|
|
37
|
+
...
|
|
38
|
+
}) => Node),
|
|
39
|
+
title?: string,
|
|
40
|
+
tabBarIcon?: (props: {
|
|
41
|
+
focused: boolean,
|
|
42
|
+
color: string,
|
|
43
|
+
size: number,
|
|
44
|
+
...
|
|
45
|
+
}) => Node,
|
|
46
|
+
tabBarBadge?: string | number,
|
|
47
|
+
tabBarBadgeStyle?: any,
|
|
48
|
+
tabBarShowLabel?: boolean,
|
|
49
|
+
tabBarAccessibilityLabel?: string,
|
|
50
|
+
tabBarTestID?: string,
|
|
51
|
+
[key: string]: any,
|
|
52
|
+
},
|
|
53
|
+
...
|
|
54
|
+
},
|
|
55
|
+
...
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* React Navigation navigation object
|
|
60
|
+
*/
|
|
61
|
+
navigation: {
|
|
62
|
+
navigate: (name: string, params?: { [key: string]: any }) => void,
|
|
63
|
+
emit: (options: {
|
|
64
|
+
type: string,
|
|
65
|
+
target?: string,
|
|
66
|
+
canPreventDefault?: boolean,
|
|
67
|
+
...
|
|
68
|
+
}) => any,
|
|
69
|
+
...
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Position of the label relative to the icon
|
|
74
|
+
* @default 'below-icon'
|
|
75
|
+
*/
|
|
76
|
+
labelPosition?: TabBarLabelPosition;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Custom background color for the tab bar
|
|
80
|
+
*/
|
|
81
|
+
backgroundColor?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Test ID for testing frameworks
|
|
85
|
+
*/
|
|
86
|
+
testID?: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Accessible label for the tab bar navigation
|
|
90
|
+
* Used by screen readers to identify the navigation region
|
|
91
|
+
*/
|
|
92
|
+
"aria-label"?: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* ID of element that labels this tab bar
|
|
96
|
+
*/
|
|
97
|
+
"aria-labelledby"?: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* HTML id attribute for the tab bar container
|
|
101
|
+
* Used to generate unique IDs for tabs and panels
|
|
102
|
+
*/
|
|
103
|
+
id?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Whether keyboard navigation should automatically activate tabs
|
|
107
|
+
* When true (default), arrow keys both focus and activate tabs
|
|
108
|
+
* When false, arrow keys only focus, Enter/Space activates
|
|
109
|
+
* @default true
|
|
110
|
+
*/
|
|
111
|
+
activateOnFocus?: boolean;
|
|
112
|
+
}
|
|
113
|
+
declare interface TabBarItemProps {
|
|
114
|
+
/**
|
|
115
|
+
* Display label for the tab
|
|
116
|
+
*/
|
|
117
|
+
label: string | Node;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Icon to display in the tab
|
|
121
|
+
*/
|
|
122
|
+
icon?: Node;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Badge content to display on the tab
|
|
126
|
+
*/
|
|
127
|
+
badge?: string | number;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Whether this tab is currently focused/selected
|
|
131
|
+
*/
|
|
132
|
+
focused: boolean;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Callback when tab is pressed
|
|
136
|
+
*/
|
|
137
|
+
onPress: () => void;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Callback when tab is long pressed
|
|
141
|
+
*/
|
|
142
|
+
onLongPress: () => void;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Position of the label relative to the icon
|
|
146
|
+
*/
|
|
147
|
+
labelPosition: TabBarLabelPosition;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Accessible label for screen readers
|
|
151
|
+
*/
|
|
152
|
+
accessibilityLabel?: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Test ID for testing frameworks
|
|
156
|
+
*/
|
|
157
|
+
testID?: string;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Unique ID for the tab element
|
|
161
|
+
*/
|
|
162
|
+
id?: string;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Index of the tab in the tab list
|
|
166
|
+
*/
|
|
167
|
+
index: number;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Total number of tabs
|
|
171
|
+
*/
|
|
172
|
+
tabCount: number;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Callback for keyboard navigation
|
|
176
|
+
*/
|
|
177
|
+
onKeyDown?: (e: React$KeyboardEvent<>, index: number) => void;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Ref callback for focus management
|
|
181
|
+
*/
|
|
182
|
+
tabRef?: (el: HTMLElement | null) => void;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* TabBar - An accessible tab bar navigation component
|
|
186
|
+
*
|
|
187
|
+
* Implements WAI-ARIA Tabs pattern with proper keyboard navigation:
|
|
188
|
+
* - Arrow Left/Right: Navigate between tabs
|
|
189
|
+
* - Home: Jump to first tab
|
|
190
|
+
* - End: Jump to last tab
|
|
191
|
+
* - Enter/Space: Activate focused tab (when activateOnFocus is false)
|
|
192
|
+
* @example ```tsx
|
|
193
|
+
* <TabBar
|
|
194
|
+
* state={navigationState}
|
|
195
|
+
* descriptors={descriptors}
|
|
196
|
+
* navigation={navigation}
|
|
197
|
+
* aria-label="Main navigation"
|
|
198
|
+
* />
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
declare var TabBar: React$1.FC<TabBarProps>;
|
|
202
|
+
/**
|
|
203
|
+
* TabBarItem - An accessible tab item component
|
|
204
|
+
*
|
|
205
|
+
* Implements WAI-ARIA tab role with proper semantics:
|
|
206
|
+
* - role="tab" for tab semantics
|
|
207
|
+
* - aria-selected to indicate active state
|
|
208
|
+
* - tabIndex management for roving tabindex pattern
|
|
209
|
+
* - Keyboard navigation support
|
|
210
|
+
*/
|
|
211
|
+
declare var TabBarItem: React$1.FC<TabBarItemProps>;
|
|
212
|
+
export type { TabBarItemProps, TabBarLabelPosition, TabBarProps };
|
|
213
|
+
declare export { TabBar, TabBarItem };
|