@momo-kits/tab-view 0.168.1-rn862.1 → 0.169.1
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/assets/Path.tsx +3 -4
- package/index.tsx +1 -1
- package/package.json +7 -7
- package/styles.ts +16 -0
- package/tabBar/CardTabBar.tsx +1 -1
- package/tabBar/SrollableTabBar.tsx +2 -2
- package/tabItem/CardTabItem.tsx +1 -3
- package/tabItem/TabItem.tsx +3 -9
package/assets/Path.tsx
CHANGED
|
@@ -7,15 +7,14 @@ interface PathSvgProps extends ViewProps {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const PathSvg: FC<PathSvgProps> = ({style, pathWidth}) => {
|
|
10
|
-
const width = pathWidth;
|
|
11
10
|
const height = 44;
|
|
12
|
-
const viewBox = `0 0 ${width} ${height}`;
|
|
13
11
|
|
|
14
12
|
return (
|
|
15
13
|
<Svg
|
|
16
|
-
width={
|
|
14
|
+
width={pathWidth}
|
|
17
15
|
height={height}
|
|
18
|
-
viewBox={
|
|
16
|
+
viewBox={`0 0 28 ${height}`}
|
|
17
|
+
preserveAspectRatio="none"
|
|
19
18
|
fill="none"
|
|
20
19
|
style={style}>
|
|
21
20
|
<Path
|
package/index.tsx
CHANGED
|
@@ -141,7 +141,7 @@ const TabComponent: ForwardRefRenderFunction<TabViewRef, TabViewProps> = (
|
|
|
141
141
|
return (
|
|
142
142
|
<View
|
|
143
143
|
onLayout={onLayout}
|
|
144
|
-
style={[styles.tabView, fitContent
|
|
144
|
+
style={[styles.tabView, !fitContent && styles.flex1]}
|
|
145
145
|
accessibilityLabel={componentId}
|
|
146
146
|
>
|
|
147
147
|
<Animated.View style={style}>
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/tab-view",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.169.1",
|
|
4
4
|
"private": false,
|
|
5
|
-
"license": "MoMo",
|
|
6
5
|
"main": "index.tsx",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"registry": "https://registry.npmjs.org/"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {},
|
|
11
6
|
"peerDependencies": {
|
|
12
7
|
"@momo-kits/foundation": "latest",
|
|
13
8
|
"react": "*",
|
|
14
9
|
"react-native": "*"
|
|
15
|
-
}
|
|
10
|
+
},
|
|
11
|
+
"license": "MoMo",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "https://registry.npmjs.org/"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {}
|
|
16
16
|
}
|
package/styles.ts
CHANGED
|
@@ -93,4 +93,20 @@ export default StyleSheet.create({
|
|
|
93
93
|
left: Spacing.S,
|
|
94
94
|
zIndex: 2,
|
|
95
95
|
},
|
|
96
|
+
flex1: { flex: 1 },
|
|
97
|
+
shrink: { flexShrink: 1 },
|
|
98
|
+
relative: { position: 'relative' },
|
|
99
|
+
relativeRow: { position: 'relative', flexDirection: 'row' },
|
|
100
|
+
tabItemRow: {
|
|
101
|
+
flexDirection: 'row',
|
|
102
|
+
overflow: 'hidden',
|
|
103
|
+
paddingVertical: Spacing.M,
|
|
104
|
+
paddingHorizontal: Spacing.M,
|
|
105
|
+
},
|
|
106
|
+
tabItemColumn: {
|
|
107
|
+
flexDirection: 'column',
|
|
108
|
+
overflow: 'hidden',
|
|
109
|
+
paddingHorizontal: Spacing.M,
|
|
110
|
+
paddingVertical: Spacing.M,
|
|
111
|
+
},
|
|
96
112
|
});
|
package/tabBar/CardTabBar.tsx
CHANGED
|
@@ -112,7 +112,7 @@ const CardTabBar: FC<TabBarProps> = ({
|
|
|
112
112
|
<Text
|
|
113
113
|
color={selectedColor}
|
|
114
114
|
numberOfLines={1}
|
|
115
|
-
style={[styles.textCenter,
|
|
115
|
+
style={[styles.textCenter, styles.shrink]}
|
|
116
116
|
typography={'header_s_semibold'}>
|
|
117
117
|
{tabs[selectedIndex]?.title || ''}
|
|
118
118
|
</Text>
|
|
@@ -185,7 +185,7 @@ const ScrollableTabBar: FC<TabBarProps> = ({
|
|
|
185
185
|
ref={scrollViewRef}
|
|
186
186
|
horizontal
|
|
187
187
|
showsHorizontalScrollIndicator={false}
|
|
188
|
-
contentContainerStyle={
|
|
188
|
+
contentContainerStyle={styles.relative}
|
|
189
189
|
style={[
|
|
190
190
|
styles.tabBar,
|
|
191
191
|
{
|
|
@@ -197,7 +197,7 @@ const ScrollableTabBar: FC<TabBarProps> = ({
|
|
|
197
197
|
<View
|
|
198
198
|
ref={contentRef}
|
|
199
199
|
collapsable={false}
|
|
200
|
-
style={
|
|
200
|
+
style={styles.relativeRow}
|
|
201
201
|
>
|
|
202
202
|
{tabs.map((item, index) => renderItem({ item, index }))}
|
|
203
203
|
<Animated.View
|
package/tabItem/CardTabItem.tsx
CHANGED
|
@@ -5,13 +5,11 @@ import styles from '../styles';
|
|
|
5
5
|
import {
|
|
6
6
|
Badge,
|
|
7
7
|
BadgeDot,
|
|
8
|
-
Colors,
|
|
9
8
|
Icon,
|
|
10
9
|
MiniAppContext,
|
|
11
10
|
ScreenContext,
|
|
12
11
|
Spacing,
|
|
13
12
|
Text,
|
|
14
|
-
useScaleSize,
|
|
15
13
|
} from '@momo-kits/foundation';
|
|
16
14
|
|
|
17
15
|
const CardTabItem: FC<TabItemProps> = ({
|
|
@@ -87,7 +85,7 @@ const CardTabItem: FC<TabItemProps> = ({
|
|
|
87
85
|
{renderIconTabItem()}
|
|
88
86
|
<Text
|
|
89
87
|
numberOfLines={1}
|
|
90
|
-
style={[styles.textCenter,
|
|
88
|
+
style={[styles.textCenter, styles.shrink]}
|
|
91
89
|
typography={'body_default_regular'}
|
|
92
90
|
accessibilityLabel={`${componentId}|text`}
|
|
93
91
|
>
|
package/tabItem/TabItem.tsx
CHANGED
|
@@ -60,13 +60,10 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
60
60
|
accessibilityState={{ checked: active }}
|
|
61
61
|
style={[
|
|
62
62
|
styles.tabItem,
|
|
63
|
+
styles.tabItemRow,
|
|
63
64
|
{
|
|
64
65
|
width,
|
|
65
66
|
height: size48,
|
|
66
|
-
flexDirection: 'row',
|
|
67
|
-
overflow: 'hidden',
|
|
68
|
-
paddingVertical: Spacing.M,
|
|
69
|
-
paddingHorizontal: Spacing.M,
|
|
70
67
|
},
|
|
71
68
|
]}
|
|
72
69
|
onPress={onPressTabItem}
|
|
@@ -89,7 +86,7 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
89
86
|
numberOfLines={1}
|
|
90
87
|
typography={typography}
|
|
91
88
|
color={color}
|
|
92
|
-
style={
|
|
89
|
+
style={styles.shrink}
|
|
93
90
|
accessibilityLabel={`${componentId}|text`}
|
|
94
91
|
>
|
|
95
92
|
{title}
|
|
@@ -115,13 +112,10 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
115
112
|
<TouchableOpacity
|
|
116
113
|
style={[
|
|
117
114
|
styles.tabItem,
|
|
115
|
+
styles.tabItemColumn,
|
|
118
116
|
{
|
|
119
117
|
width,
|
|
120
118
|
height: scaledHeight,
|
|
121
|
-
flexDirection: 'column',
|
|
122
|
-
overflow: 'hidden',
|
|
123
|
-
paddingHorizontal: Spacing.M,
|
|
124
|
-
paddingVertical: Spacing.M,
|
|
125
119
|
},
|
|
126
120
|
]}
|
|
127
121
|
onPress={onPressTabItem}
|