@momo-kits/tab-view 0.92.21-beta.0 → 0.92.21-beta.2

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.tsx CHANGED
@@ -25,7 +25,7 @@ const TabView: FC<TabViewProps> = ({
25
25
  const [tabBarWidth, setTabBarWidth] = useState(0);
26
26
  const isCardTab = type === 'card';
27
27
  const pagerRef = useRef<PagerView>(null);
28
- const scrollX = useRef(new Animated.Value(0));
28
+ const scrollX = useRef(new Animated.Value(startPage));
29
29
  const lazy = useRef([selectedIndex]).current;
30
30
  const {theme} = useContext(ApplicationContext);
31
31
  const _onPressTabItem = (index: number) => {
@@ -66,7 +66,7 @@ const TabView: FC<TabViewProps> = ({
66
66
  if (!lazy.includes(index)) return <View />;
67
67
  return <View>{tab.component}</View>;
68
68
  },
69
- [tabs],
69
+ [tabs]
70
70
  );
71
71
 
72
72
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/tab-view",
3
- "version": "0.92.21-beta.0",
3
+ "version": "0.92.21-beta.2",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},
@@ -14,4 +14,4 @@
14
14
  "@momo-platform/versions": "4.1.11"
15
15
  },
16
16
  "license": "MoMo"
17
- }
17
+ }
package/publish.sh CHANGED
@@ -7,16 +7,16 @@ rsync -r --exclude=/dist ./* dist
7
7
  cd dist
8
8
 
9
9
  if [ "$1" == "stable" ]; then
10
- #npm version $(npm view @momo-kits/tab-view@stable version)
11
- #npm version patch
10
+ npm version $(npm view @momo-kits/tab-view@stable version)
11
+ npm version patch
12
12
  npm publish --tag stable --access=public
13
13
  elif [ "$1" == "latest" ]; then
14
- #npm version $(npm view @momo-kits/foundation@latest version)
15
- #npm version prerelease --preid=rc
14
+ npm version $(npm view @momo-kits/foundation@latest version)
15
+ npm version prerelease --preid=rc
16
16
  npm publish --tag latest --access=public
17
17
  else
18
- #npm version $(npm view @momo-kits/tab-view@beta version)
19
- #npm version prerelease --preid=beta
18
+ npm version $(npm view @momo-kits/tab-view@beta version)
19
+ npm version prerelease --preid=beta
20
20
  npm publish --tag beta --access=public
21
21
  fi
22
22
 
@@ -58,6 +58,7 @@ const CardTabBar: FC<TabBarProps> = ({
58
58
  <PathSvg style={{transform: [{rotateY: '180deg'}], left: 8}} />
59
59
  )}
60
60
  <View
61
+ accessibilityLabel={tabs[selectedIndex]?.accessibilityLabel}
61
62
  style={[
62
63
  styles.overlayTextWrapper,
63
64
  {
@@ -19,13 +19,15 @@ const CardTabItem: FC<TabItemProps> = ({
19
19
  showDot = false,
20
20
  dotSize = 'small',
21
21
  badgeValue,
22
+ accessibilityLabel,
22
23
  } = tab;
23
24
  const color = active ? selectedColor : unselectedColor;
24
25
 
25
26
  return (
26
27
  <TouchableOpacity
27
28
  onPress={onPressTabItem}
28
- style={[styles.cardTabItem, {width}]}>
29
+ style={[styles.cardTabItem, {width}]}
30
+ accessibilityLabel={accessibilityLabel}>
29
31
  {renderIcon &&
30
32
  !['string', 'boolean', 'number'].includes(typeof renderIcon) && (
31
33
  <View
@@ -28,6 +28,7 @@ const TabItem: FC<TabItemProps> = ({
28
28
  dotSize = 'small',
29
29
  badgeValue,
30
30
  renderIcon,
31
+ accessibilityLabel,
31
32
  } = tab;
32
33
  const typography: Typography = active
33
34
  ? 'header_s_semibold'
@@ -38,6 +39,7 @@ const TabItem: FC<TabItemProps> = ({
38
39
  const renderRowItem = () => {
39
40
  return (
40
41
  <TouchableOpacity
42
+ accessibilityLabel={accessibilityLabel}
41
43
  style={[
42
44
  styles.tabItem,
43
45
  {
@@ -96,7 +98,8 @@ const TabItem: FC<TabItemProps> = ({
96
98
  paddingVertical: Spacing.M,
97
99
  },
98
100
  ]}
99
- onPress={onPressTabItem}>
101
+ onPress={onPressTabItem}
102
+ accessibilityLabel={accessibilityLabel}>
100
103
  <View>
101
104
  {renderIcon && typeof renderIcon === 'function' && (
102
105
  <View
package/types.ts CHANGED
@@ -31,6 +31,8 @@ export type Tab = {
31
31
  dotSize?: 'small' | 'large';
32
32
 
33
33
  badgeValue?: string | number;
34
+
35
+ accessibilityLabel?: string;
34
36
  };
35
37
 
36
38
  export type TabItemProps = {