@xsolla/xui-tab-bar-web 0.64.0-pr56.1768348754
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/index.d.mts +81 -0
- package/index.d.ts +81 -0
- package/index.js +649 -0
- package/index.js.map +1 -0
- package/index.mjs +611 -0
- package/index.mjs.map +1 -0
- package/package.json +24 -0
package/index.d.mts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type TabBarLabelPosition = "beside-icon" | "below-icon";
|
|
4
|
+
interface TabBarProps {
|
|
5
|
+
/**
|
|
6
|
+
* React Navigation state
|
|
7
|
+
*/
|
|
8
|
+
state: {
|
|
9
|
+
index: number;
|
|
10
|
+
routes: {
|
|
11
|
+
key: string;
|
|
12
|
+
name: string;
|
|
13
|
+
params?: object;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* React Navigation descriptors
|
|
18
|
+
*/
|
|
19
|
+
descriptors: Record<string, {
|
|
20
|
+
options: {
|
|
21
|
+
tabBarLabel?: string | ((props: {
|
|
22
|
+
focused: boolean;
|
|
23
|
+
color: string;
|
|
24
|
+
position: TabBarLabelPosition;
|
|
25
|
+
}) => ReactNode);
|
|
26
|
+
title?: string;
|
|
27
|
+
tabBarIcon?: (props: {
|
|
28
|
+
focused: boolean;
|
|
29
|
+
color: string;
|
|
30
|
+
size: number;
|
|
31
|
+
}) => ReactNode;
|
|
32
|
+
tabBarBadge?: string | number;
|
|
33
|
+
tabBarBadgeStyle?: any;
|
|
34
|
+
tabBarShowLabel?: boolean;
|
|
35
|
+
tabBarAccessibilityLabel?: string;
|
|
36
|
+
tabBarTestID?: string;
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* React Navigation navigation object
|
|
42
|
+
*/
|
|
43
|
+
navigation: {
|
|
44
|
+
navigate: (name: string, params?: object) => void;
|
|
45
|
+
emit: (options: {
|
|
46
|
+
type: string;
|
|
47
|
+
target?: string;
|
|
48
|
+
canPreventDefault?: boolean;
|
|
49
|
+
}) => any;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Position of the label relative to the icon
|
|
53
|
+
* @default 'below-icon'
|
|
54
|
+
*/
|
|
55
|
+
labelPosition?: TabBarLabelPosition;
|
|
56
|
+
/**
|
|
57
|
+
* Custom background color for the tab bar
|
|
58
|
+
*/
|
|
59
|
+
backgroundColor?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Test ID for testing frameworks
|
|
62
|
+
*/
|
|
63
|
+
testID?: string;
|
|
64
|
+
}
|
|
65
|
+
interface TabBarItemProps {
|
|
66
|
+
label: string | ReactNode;
|
|
67
|
+
icon?: ReactNode;
|
|
68
|
+
badge?: string | number;
|
|
69
|
+
focused: boolean;
|
|
70
|
+
onPress: () => void;
|
|
71
|
+
onLongPress: () => void;
|
|
72
|
+
labelPosition: TabBarLabelPosition;
|
|
73
|
+
accessibilityLabel?: string;
|
|
74
|
+
testID?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare const TabBar: React.FC<TabBarProps>;
|
|
78
|
+
|
|
79
|
+
declare const TabBarItem: React.FC<TabBarItemProps>;
|
|
80
|
+
|
|
81
|
+
export { TabBar, TabBarItem, type TabBarItemProps, type TabBarLabelPosition, type TabBarProps };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type TabBarLabelPosition = "beside-icon" | "below-icon";
|
|
4
|
+
interface TabBarProps {
|
|
5
|
+
/**
|
|
6
|
+
* React Navigation state
|
|
7
|
+
*/
|
|
8
|
+
state: {
|
|
9
|
+
index: number;
|
|
10
|
+
routes: {
|
|
11
|
+
key: string;
|
|
12
|
+
name: string;
|
|
13
|
+
params?: object;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* React Navigation descriptors
|
|
18
|
+
*/
|
|
19
|
+
descriptors: Record<string, {
|
|
20
|
+
options: {
|
|
21
|
+
tabBarLabel?: string | ((props: {
|
|
22
|
+
focused: boolean;
|
|
23
|
+
color: string;
|
|
24
|
+
position: TabBarLabelPosition;
|
|
25
|
+
}) => ReactNode);
|
|
26
|
+
title?: string;
|
|
27
|
+
tabBarIcon?: (props: {
|
|
28
|
+
focused: boolean;
|
|
29
|
+
color: string;
|
|
30
|
+
size: number;
|
|
31
|
+
}) => ReactNode;
|
|
32
|
+
tabBarBadge?: string | number;
|
|
33
|
+
tabBarBadgeStyle?: any;
|
|
34
|
+
tabBarShowLabel?: boolean;
|
|
35
|
+
tabBarAccessibilityLabel?: string;
|
|
36
|
+
tabBarTestID?: string;
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* React Navigation navigation object
|
|
42
|
+
*/
|
|
43
|
+
navigation: {
|
|
44
|
+
navigate: (name: string, params?: object) => void;
|
|
45
|
+
emit: (options: {
|
|
46
|
+
type: string;
|
|
47
|
+
target?: string;
|
|
48
|
+
canPreventDefault?: boolean;
|
|
49
|
+
}) => any;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Position of the label relative to the icon
|
|
53
|
+
* @default 'below-icon'
|
|
54
|
+
*/
|
|
55
|
+
labelPosition?: TabBarLabelPosition;
|
|
56
|
+
/**
|
|
57
|
+
* Custom background color for the tab bar
|
|
58
|
+
*/
|
|
59
|
+
backgroundColor?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Test ID for testing frameworks
|
|
62
|
+
*/
|
|
63
|
+
testID?: string;
|
|
64
|
+
}
|
|
65
|
+
interface TabBarItemProps {
|
|
66
|
+
label: string | ReactNode;
|
|
67
|
+
icon?: ReactNode;
|
|
68
|
+
badge?: string | number;
|
|
69
|
+
focused: boolean;
|
|
70
|
+
onPress: () => void;
|
|
71
|
+
onLongPress: () => void;
|
|
72
|
+
labelPosition: TabBarLabelPosition;
|
|
73
|
+
accessibilityLabel?: string;
|
|
74
|
+
testID?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare const TabBar: React.FC<TabBarProps>;
|
|
78
|
+
|
|
79
|
+
declare const TabBarItem: React.FC<TabBarItemProps>;
|
|
80
|
+
|
|
81
|
+
export { TabBar, TabBarItem, type TabBarItemProps, type TabBarLabelPosition, type TabBarProps };
|