@momo-kits/tab-view 0.112.1-beta.4 → 0.112.1-beta.5

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
@@ -31,8 +31,6 @@ const TabComponent: ForwardRefRenderFunction<TabViewRef, TabViewProps> = (
31
31
  selectedColor,
32
32
  unselectedColor,
33
33
  style,
34
- accessibilityLabel,
35
- accessibilityLabelForSelectedCard,
36
34
  },
37
35
  ref
38
36
  ) => {
@@ -95,10 +93,7 @@ const TabComponent: ForwardRefRenderFunction<TabViewRef, TabViewProps> = (
95
93
  }));
96
94
 
97
95
  return (
98
- <View
99
- onLayout={onLayout}
100
- style={[styles.tabView, {flex: 1}]}
101
- accessibilityLabel={accessibilityLabel}>
96
+ <View onLayout={onLayout} style={[styles.tabView, {flex: 1}]}>
102
97
  <Animated.View style={style}>
103
98
  <TabBarComponent
104
99
  onPressTabItem={_onPressTabItem}
@@ -109,7 +104,6 @@ const TabComponent: ForwardRefRenderFunction<TabViewRef, TabViewProps> = (
109
104
  direction={direction}
110
105
  selectedColor={selectedColor ?? theme.colors.primary}
111
106
  unselectedColor={unselectedColor ?? theme.colors.text.default}
112
- accessibilityLabelForSelectedCard={accessibilityLabelForSelectedCard}
113
107
  />
114
108
  </Animated.View>
115
109
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/tab-view",
3
- "version": "0.112.1-beta.4",
3
+ "version": "0.112.1-beta.5",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},
@@ -22,7 +22,6 @@ const CardTabBar: FC<TabBarProps> = ({
22
22
  selectedIndex,
23
23
  selectedColor,
24
24
  unselectedColor,
25
- accessibilityLabelForSelectedCard,
26
25
  }) => {
27
26
  const {theme} = useContext(ApplicationContext);
28
27
  const itemWidth = containerWidth / tabs.length;
@@ -59,10 +58,7 @@ const CardTabBar: FC<TabBarProps> = ({
59
58
  <PathSvg style={{transform: [{rotateY: '180deg'}], left: 8}} />
60
59
  )}
61
60
  <View
62
- accessibilityLabel={
63
- accessibilityLabelForSelectedCard ??
64
- tabs[selectedIndex]?.accessibilityLabel
65
- }
61
+ accessibilityLabel={tabs[selectedIndex]?.accessibilityLabel}
66
62
  style={[
67
63
  styles.overlayTextWrapper,
68
64
  {
@@ -20,8 +20,6 @@ const CardTabItem: FC<TabItemProps> = ({
20
20
  dotSize = 'small',
21
21
  badgeValue,
22
22
  accessibilityLabel,
23
- accessibilityLabelBadge,
24
- accessibilityLabelText,
25
23
  } = tab;
26
24
  const color = active ? selectedColor : unselectedColor;
27
25
 
@@ -29,8 +27,7 @@ const CardTabItem: FC<TabItemProps> = ({
29
27
  <TouchableOpacity
30
28
  onPress={onPressTabItem}
31
29
  style={[styles.cardTabItem, {width}]}
32
- accessibilityLabel={accessibilityLabel}
33
- accessibilityState={{checked: active}}>
30
+ accessibilityLabel={accessibilityLabel}>
34
31
  {renderIcon &&
35
32
  !['string', 'boolean', 'number'].includes(typeof renderIcon) && (
36
33
  <View
@@ -48,8 +45,7 @@ const CardTabItem: FC<TabItemProps> = ({
48
45
  <Text
49
46
  numberOfLines={1}
50
47
  style={[styles.textCenter, {flexShrink: 1}]}
51
- typography={'body_default_regular'}
52
- accessibilityLabel={accessibilityLabelText}>
48
+ typography={'body_default_regular'}>
53
49
  {title}
54
50
  </Text>
55
51
  {showDot && (
@@ -62,11 +58,7 @@ const CardTabItem: FC<TabItemProps> = ({
62
58
  )}
63
59
  {!showDot && badgeValue && (
64
60
  <View>
65
- <Badge
66
- label={badgeValue}
67
- style={{marginLeft: Spacing.XS}}
68
- accessibilityLabel={accessibilityLabelBadge}
69
- />
61
+ <Badge label={badgeValue} style={{marginLeft: Spacing.XS}} />
70
62
  </View>
71
63
  )}
72
64
  </TouchableOpacity>
@@ -29,8 +29,6 @@ const TabItem: FC<TabItemProps> = ({
29
29
  badgeValue,
30
30
  renderIcon,
31
31
  accessibilityLabel,
32
- accessibilityLabelText,
33
- accessibilityLabelBadge,
34
32
  } = tab;
35
33
  const typography: Typography = active
36
34
  ? 'header_s_semibold'
@@ -42,7 +40,6 @@ const TabItem: FC<TabItemProps> = ({
42
40
  return (
43
41
  <TouchableOpacity
44
42
  accessibilityLabel={accessibilityLabel}
45
- accessibilityState={{checked: active}}
46
43
  style={[
47
44
  styles.tabItem,
48
45
  {
@@ -72,8 +69,7 @@ const TabItem: FC<TabItemProps> = ({
72
69
  numberOfLines={1}
73
70
  typography={typography}
74
71
  color={color}
75
- style={{flexShrink: 1}}
76
- accessibilityLabel={accessibilityLabelText}>
72
+ style={{flexShrink: 1}}>
77
73
  {title}
78
74
  </Text>
79
75
  {showDot && (
@@ -81,11 +77,7 @@ const TabItem: FC<TabItemProps> = ({
81
77
  )}
82
78
  {!showDot && badgeValue && (
83
79
  <View>
84
- <Badge
85
- label={badgeValue}
86
- style={{marginLeft: Spacing.XS}}
87
- accessibilityLabel={accessibilityLabelBadge}
88
- />
80
+ <Badge label={badgeValue} style={{marginLeft: Spacing.XS}} />
89
81
  </View>
90
82
  )}
91
83
  </TouchableOpacity>
@@ -136,18 +128,10 @@ const TabItem: FC<TabItemProps> = ({
136
128
  <BadgeDot style={dotStyle} size={dotSize} />
137
129
  )}
138
130
  {(renderIcon || !!icon) && !showDot && badgeValue && (
139
- <Badge
140
- label={badgeValue}
141
- style={styles.badge}
142
- accessibilityLabel={accessibilityLabelBadge}
143
- />
131
+ <Badge label={badgeValue} style={styles.badge} />
144
132
  )}
145
133
  </View>
146
- <Text
147
- numberOfLines={1}
148
- typography={typography}
149
- color={color}
150
- accessibilityLabel={accessibilityLabelText}>
134
+ <Text numberOfLines={1} typography={typography} color={color}>
151
135
  {title}
152
136
  </Text>
153
137
  </TouchableOpacity>
package/types.ts CHANGED
@@ -33,10 +33,6 @@ export type Tab = {
33
33
  badgeValue?: string | number;
34
34
 
35
35
  accessibilityLabel?: string;
36
-
37
- accessibilityLabelText?: string;
38
-
39
- accessibilityLabelBadge?: string;
40
36
  };
41
37
 
42
38
  export type TabItemProps = {
@@ -111,16 +107,6 @@ export type TabViewProps = {
111
107
  unselectedColor?: string;
112
108
 
113
109
  style?: ViewStyle;
114
-
115
- /**
116
- * Optional. Assigns an accessibility label to the tab view for automated testing.
117
- */
118
- accessibilityLabel?: string;
119
-
120
- /**
121
- * Optional. Assigns an accessibility label to the tab view for automated testing.
122
- */
123
- accessibilityLabelForSelectedCard?: string;
124
110
  };
125
111
 
126
112
  /**
@@ -160,8 +146,6 @@ export type TabBarProps = {
160
146
  selectedColor?: string;
161
147
 
162
148
  unselectedColor?: string;
163
-
164
- accessibilityLabelForSelectedCard?: string;
165
149
  };
166
150
 
167
151
  export type TabViewRef = {