@momo-kits/stepper 0.89.5 → 0.92.1-tracking.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/StepperButton.tsx +3 -2
- package/index.tsx +7 -1
- package/package.json +1 -1
- package/types.ts +3 -0
package/StepperButton.tsx
CHANGED
|
@@ -8,7 +8,8 @@ const StepperButton: FC<StepperButtonProps> = ({
|
|
|
8
8
|
disabled = false,
|
|
9
9
|
sign = '+',
|
|
10
10
|
size = 'large',
|
|
11
|
-
onPress,
|
|
11
|
+
onPress, accessibilityID
|
|
12
|
+
|
|
12
13
|
}) => {
|
|
13
14
|
const ICON_SIZE = 12;
|
|
14
15
|
const {theme} = useContext(ApplicationContext);
|
|
@@ -21,7 +22,7 @@ const StepperButton: FC<StepperButtonProps> = ({
|
|
|
21
22
|
: theme.colors.primary;
|
|
22
23
|
|
|
23
24
|
return (
|
|
24
|
-
<TouchableOpacity disabled={disabled} onPress={onPress} style={[sizeStyle]}>
|
|
25
|
+
<TouchableOpacity {...accessibilityID} disabled={disabled} onPress={onPress} style={[sizeStyle]}>
|
|
25
26
|
<Icon size={22} color={buttonColor} source={buttonIcon} />
|
|
26
27
|
</TouchableOpacity>
|
|
27
28
|
);
|
package/index.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import StepperButton from './StepperButton';
|
|
|
4
4
|
import {DisabledStatus, StepperProps} from './types';
|
|
5
5
|
import styles from './styles';
|
|
6
6
|
import NumberView from './NumberView';
|
|
7
|
+
import {getAccessibilityID} from "@momo-kits/foundation";
|
|
7
8
|
|
|
8
9
|
const Stepper: FC<StepperProps> = ({
|
|
9
10
|
size = 'large',
|
|
@@ -70,10 +71,13 @@ const Stepper: FC<StepperProps> = ({
|
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
const viewStatus = getViewDisabledStatus();
|
|
74
|
+
const accessibilityPlusID = getAccessibilityID(`ic_stepper_${value}_plus`)
|
|
75
|
+
const accessibilitySubtractID = getAccessibilityID(`ic_stepper_${value}_subtract`)
|
|
73
76
|
|
|
74
77
|
return (
|
|
75
78
|
<View style={styles.stepper}>
|
|
76
79
|
<StepperButton
|
|
80
|
+
accessibilityID = {accessibilityPlusID}
|
|
77
81
|
onPress={onMinus}
|
|
78
82
|
sign={'-'}
|
|
79
83
|
size={size}
|
|
@@ -86,7 +90,9 @@ const Stepper: FC<StepperProps> = ({
|
|
|
86
90
|
disabled={viewStatus.number}
|
|
87
91
|
editable={editable}
|
|
88
92
|
/>
|
|
89
|
-
<StepperButton
|
|
93
|
+
<StepperButton
|
|
94
|
+
accessibilityID = {accessibilityPlusID}
|
|
95
|
+
onPress={onPlus} size={size} disabled={viewStatus.plus} />
|
|
90
96
|
</View>
|
|
91
97
|
);
|
|
92
98
|
};
|
package/package.json
CHANGED