@momo-kits/step 0.111.1-rc.7 → 0.112.1-beta.0
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/StepsHorizontal.tsx +21 -6
- package/StepsVertical.tsx +12 -4
- package/package.json +18 -18
- package/types.ts +2 -0
package/StepsHorizontal.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import {FlexAlignType, TouchableOpacity, View} from 'react-native';
|
|
|
4
4
|
import StepIcon from './StepIcon';
|
|
5
5
|
import styles from './styles';
|
|
6
6
|
import {Step, StepsProps} from './types';
|
|
7
|
-
import {
|
|
7
|
+
import {getStepColor, getStepTypo} from './utils';
|
|
8
8
|
|
|
9
9
|
type TextAlign = 'left' | 'right' | 'center';
|
|
10
10
|
|
|
@@ -17,6 +17,7 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
17
17
|
customIcon,
|
|
18
18
|
onPress,
|
|
19
19
|
disabled,
|
|
20
|
+
accessibilityLabel = 'steps-horizontal',
|
|
20
21
|
}) => {
|
|
21
22
|
const renderStepItem = (item: Step, index: number) => {
|
|
22
23
|
const {title, description, error, time} = item;
|
|
@@ -53,12 +54,18 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
53
54
|
marginRight: haveMarginRight ? Spacing.XS : 0,
|
|
54
55
|
}}
|
|
55
56
|
disabled={disabled || !onPress}
|
|
56
|
-
onPress={() => onPress && onPress(item, index)}
|
|
57
|
+
onPress={() => onPress && onPress(item, index)}
|
|
58
|
+
accessibilityLabel={`${accessibilityLabel}-touch-${index}`}
|
|
59
|
+
accessibilityState={{
|
|
60
|
+
disabled,
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
57
63
|
{!!time && (
|
|
58
64
|
<Text
|
|
59
65
|
style={{textAlign}}
|
|
60
66
|
color={disabled ? theme.colors.text.disable : typoStyle.time.color}
|
|
61
|
-
typography={typoStyle.time.typography}
|
|
67
|
+
typography={typoStyle.time.typography}
|
|
68
|
+
accessibilityLabel={`${accessibilityLabel}-time-${index}`}>
|
|
62
69
|
{time}
|
|
63
70
|
</Text>
|
|
64
71
|
)}
|
|
@@ -67,7 +74,8 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
67
74
|
<Text
|
|
68
75
|
style={[styles.title, {textAlign}]}
|
|
69
76
|
color={disabled ? theme.colors.text.disable : typoStyle.title.color}
|
|
70
|
-
typography={typoStyle.title.typography}
|
|
77
|
+
typography={typoStyle.title.typography}
|
|
78
|
+
accessibilityLabel={`${accessibilityLabel}-title-${index}`}>
|
|
71
79
|
{title}
|
|
72
80
|
</Text>
|
|
73
81
|
)}
|
|
@@ -77,7 +85,8 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
77
85
|
color={
|
|
78
86
|
disabled ? theme.colors.text.disable : typoStyle.description.color
|
|
79
87
|
}
|
|
80
|
-
typography={typoStyle.description.typography}
|
|
88
|
+
typography={typoStyle.description.typography}
|
|
89
|
+
accessibilityLabel={`${accessibilityLabel}-description-${index}`}>
|
|
81
90
|
{description}
|
|
82
91
|
</Text>
|
|
83
92
|
)}
|
|
@@ -93,7 +102,13 @@ const StepsHorizontal: FC<StepsProps> = ({
|
|
|
93
102
|
) => {
|
|
94
103
|
const {error} = item;
|
|
95
104
|
|
|
96
|
-
const stepStyle = getStepColor(
|
|
105
|
+
const stepStyle = getStepColor(
|
|
106
|
+
activeIndex,
|
|
107
|
+
index,
|
|
108
|
+
error,
|
|
109
|
+
steps.length,
|
|
110
|
+
disabled
|
|
111
|
+
);
|
|
97
112
|
const {backgroundColor, borderColor, lineColorRight, lineColorLeft} =
|
|
98
113
|
stepStyle;
|
|
99
114
|
|
package/StepsVertical.tsx
CHANGED
|
@@ -13,6 +13,7 @@ const StepsVertical: FC<StepsProps> = ({
|
|
|
13
13
|
useNumber = false,
|
|
14
14
|
onPress,
|
|
15
15
|
disabled,
|
|
16
|
+
accessibilityLabel = 'steps-vertical',
|
|
16
17
|
}) => {
|
|
17
18
|
const {theme} = useContext(ApplicationContext);
|
|
18
19
|
|
|
@@ -36,7 +37,8 @@ const StepsVertical: FC<StepsProps> = ({
|
|
|
36
37
|
return (
|
|
37
38
|
<Text
|
|
38
39
|
color={disabled ? theme.colors.text.disable : typoStyle.title.color}
|
|
39
|
-
typography={typoStyle.description.typography}
|
|
40
|
+
typography={typoStyle.description.typography}
|
|
41
|
+
accessibilityLabel={`${accessibilityLabel}-description-${index}`}>
|
|
40
42
|
{description}
|
|
41
43
|
</Text>
|
|
42
44
|
);
|
|
@@ -52,7 +54,11 @@ const StepsVertical: FC<StepsProps> = ({
|
|
|
52
54
|
marginBottom: Spacing.XS,
|
|
53
55
|
}}
|
|
54
56
|
disabled={disabled || !onPress}
|
|
55
|
-
onPress={() => onPress && onPress(item, index)}
|
|
57
|
+
onPress={() => onPress && onPress(item, index)}
|
|
58
|
+
accessibilityLabel={`${accessibilityLabel}-touch-${index}`}
|
|
59
|
+
accessibilityState={{
|
|
60
|
+
disabled,
|
|
61
|
+
}}>
|
|
56
62
|
<View
|
|
57
63
|
style={{
|
|
58
64
|
alignItems: 'center',
|
|
@@ -89,14 +95,16 @@ const StepsVertical: FC<StepsProps> = ({
|
|
|
89
95
|
color={
|
|
90
96
|
disabled ? theme.colors.text.disable : typoStyle.title.color
|
|
91
97
|
}
|
|
92
|
-
typography={typoStyle.title.typography}
|
|
98
|
+
typography={typoStyle.title.typography}
|
|
99
|
+
accessibilityLabel={`${accessibilityLabel}-title-${index}`}>
|
|
93
100
|
{title}
|
|
94
101
|
</Text>
|
|
95
102
|
<Text
|
|
96
103
|
color={
|
|
97
104
|
disabled ? theme.colors.text.disable : typoStyle.time.color
|
|
98
105
|
}
|
|
99
|
-
typography={typoStyle.time.typography}
|
|
106
|
+
typography={typoStyle.time.typography}
|
|
107
|
+
accessibilityLabel={`${accessibilityLabel}-time-${index}`}>
|
|
100
108
|
{time}
|
|
101
109
|
</Text>
|
|
102
110
|
</View>
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
"name": "@momo-kits/step",
|
|
3
|
+
"version": "0.112.1-beta.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "index.tsx",
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@momo-kits/foundation": "latest",
|
|
9
|
+
"prop-types": "^15.7.2",
|
|
10
|
+
"react": "16.9.0",
|
|
11
|
+
"react-native": ">=0.55"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@momo-platform/versions": "4.1.11"
|
|
15
|
+
},
|
|
16
|
+
"license": "MoMo",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
}
|
|
20
20
|
}
|
package/types.ts
CHANGED