@react-native-segmented-control/segmented-control 2.4.3 → 2.5.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/README.md
CHANGED
|
@@ -6,8 +6,6 @@ React Native SegmentedControl library. Use SegmentedControl to render a UISegmen
|
|
|
6
6
|
|
|
7
7
|
For Android and Web, it has a js implementation that mocks iOS 13 style of UISegmentedControl.
|
|
8
8
|
|
|
9
|
-
**For Expo Users:** Expo SDK 38 or later is required for this package.
|
|
10
|
-
|
|
11
9
|
| iOS | Android | Web |
|
|
12
10
|
| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
13
11
|
| <img src="https://user-images.githubusercontent.com/6936373/71608757-dc6ef680-2bc6-11ea-85be-aa31f25ecf36.png" width="320" /> | <img src="https://user-images.githubusercontent.com/6936373/79550655-9edd9d00-80d3-11ea-98bf-8b7c0b0798d3.png" width="320" /> | <img src="https://user-images.githubusercontent.com/6936373/79590620-3f52b200-8112-11ea-863b-236c4465fba6.png" width="640"/> |
|
package/js/SegmentedControl.js
CHANGED
|
@@ -36,6 +36,7 @@ const SegmentedControl = ({
|
|
|
36
36
|
fontStyle,
|
|
37
37
|
activeFontStyle,
|
|
38
38
|
appearance,
|
|
39
|
+
accessibilityHintSeperator = 'out of',
|
|
39
40
|
}: SegmentedControlProps): React.Node => {
|
|
40
41
|
const colorSchemeHook = useColorScheme();
|
|
41
42
|
const colorScheme = appearance || colorSchemeHook;
|
|
@@ -99,6 +100,9 @@ const SegmentedControl = ({
|
|
|
99
100
|
<SegmentedControlTab
|
|
100
101
|
enabled={enabled}
|
|
101
102
|
selected={selectedIndex === index}
|
|
103
|
+
accessibilityHint={`${
|
|
104
|
+
index + 1
|
|
105
|
+
} ${accessibilityHintSeperator} ${values.length}`}
|
|
102
106
|
key={index}
|
|
103
107
|
value={value}
|
|
104
108
|
tintColor={tintColor}
|
|
@@ -120,6 +124,7 @@ const SegmentedControl = ({
|
|
|
120
124
|
{
|
|
121
125
|
transform: [{translateX: animation}],
|
|
122
126
|
width: segmentWidth - 4,
|
|
127
|
+
zIndex: -1,
|
|
123
128
|
backgroundColor:
|
|
124
129
|
tintColor || (colorScheme === 'dark' ? '#636366' : 'white'),
|
|
125
130
|
},
|
|
@@ -27,6 +27,7 @@ type Props = $ReadOnly<{|
|
|
|
27
27
|
activeFontStyle?: FontStyle,
|
|
28
28
|
tabStyle?: ViewStyle,
|
|
29
29
|
appearance?: 'dark' | 'light' | null,
|
|
30
|
+
accessibilityHint?: string,
|
|
30
31
|
|}>;
|
|
31
32
|
|
|
32
33
|
function isBase64(str) {
|
|
@@ -45,6 +46,7 @@ export const SegmentedControlTab = ({
|
|
|
45
46
|
activeFontStyle = {},
|
|
46
47
|
appearance,
|
|
47
48
|
tabStyle,
|
|
49
|
+
accessibilityHint,
|
|
48
50
|
}: Props): React.Node => {
|
|
49
51
|
const colorSchemeHook = useColorScheme();
|
|
50
52
|
const colorScheme = appearance || colorSchemeHook;
|
|
@@ -88,6 +90,8 @@ export const SegmentedControlTab = ({
|
|
|
88
90
|
style={[styles.container, tabStyle]}
|
|
89
91
|
disabled={!enabled}
|
|
90
92
|
onPress={onSelect}
|
|
93
|
+
accessibilityHint={accessibilityHint}
|
|
94
|
+
accessibilityRole="button"
|
|
91
95
|
accessibilityState={{selected: selected, disabled: !enabled}}>
|
|
92
96
|
<View style={styles.default}>
|
|
93
97
|
{typeof value === 'number' || typeof value === 'object' ? (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-segmented-control/segmented-control",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "React Native SegmentedControlIOS library",
|
|
5
5
|
"main": "js/index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-native-web": "^0.14.10",
|
|
52
52
|
"react-test-renderer": "17.0.2",
|
|
53
53
|
"rimraf": "^3.0.2",
|
|
54
|
-
"semantic-release": "^
|
|
54
|
+
"semantic-release": "^23.0.6",
|
|
55
55
|
"typescript": "^4"
|
|
56
56
|
},
|
|
57
57
|
"resolutions": {
|
|
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
|
|
11
11
|
s.authors = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.
|
|
13
|
+
s.platforms = { :ios => "9.0", :visionos => "1.0" }
|
|
14
14
|
|
|
15
15
|
s.source = { :git => "https://github.com/react-native-segmented-control/segmented-control.git", :tag => "#{s.version}" }
|
|
16
16
|
s.source_files = "ios/**/*.{h,m}"
|