@momo-kits/chip 0.112.1-beta.5 → 0.112.1-beta.6
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 +14 -3
- package/package.json +1 -1
- package/types.ts +15 -1
package/index.tsx
CHANGED
|
@@ -23,6 +23,9 @@ const Chip: FC<ChipProps> = ({
|
|
|
23
23
|
iconRightColor,
|
|
24
24
|
itemContainerStyle,
|
|
25
25
|
accessibilityLabel,
|
|
26
|
+
accessibilityLabelTouchable,
|
|
27
|
+
accessibilityLabelText,
|
|
28
|
+
accessibilityState,
|
|
26
29
|
}) => {
|
|
27
30
|
const {theme} = useContext(ApplicationContext);
|
|
28
31
|
let textColor = theme.colors.text.default;
|
|
@@ -60,7 +63,10 @@ const Chip: FC<ChipProps> = ({
|
|
|
60
63
|
};
|
|
61
64
|
|
|
62
65
|
return (
|
|
63
|
-
<View
|
|
66
|
+
<View
|
|
67
|
+
accessibilityLabel={accessibilityLabel}
|
|
68
|
+
style={[style, styles.wrapper]}
|
|
69
|
+
accessibilityState={accessibilityState}>
|
|
64
70
|
<TouchableOpacity
|
|
65
71
|
onPress={onPress}
|
|
66
72
|
style={[
|
|
@@ -69,7 +75,9 @@ const Chip: FC<ChipProps> = ({
|
|
|
69
75
|
{
|
|
70
76
|
backgroundColor,
|
|
71
77
|
},
|
|
72
|
-
]}
|
|
78
|
+
]}
|
|
79
|
+
accessibilityLabel={accessibilityLabelTouchable}
|
|
80
|
+
accessibilityState={accessibilityState}>
|
|
73
81
|
{!!iconLeft && (
|
|
74
82
|
<Icon
|
|
75
83
|
source={iconLeft}
|
|
@@ -79,7 +87,10 @@ const Chip: FC<ChipProps> = ({
|
|
|
79
87
|
/>
|
|
80
88
|
)}
|
|
81
89
|
{label && (
|
|
82
|
-
<Text
|
|
90
|
+
<Text
|
|
91
|
+
typography={typo}
|
|
92
|
+
color={textColor}
|
|
93
|
+
accessibilityLabel={accessibilityLabelText}>
|
|
83
94
|
{label}
|
|
84
95
|
</Text>
|
|
85
96
|
)}
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ViewStyle} from 'react-native';
|
|
1
|
+
import {AccessibilityState, ViewStyle} from 'react-native';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Props for the Chip component. A Chip is a compact element that represents an input, attribute, or action.
|
|
@@ -59,4 +59,18 @@ export type ChipProps = {
|
|
|
59
59
|
* Optional. Assign accessibility label to the chip for automated testing.
|
|
60
60
|
*/
|
|
61
61
|
accessibilityLabel?: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Optional. Assign accessibility label to the chip for automated testing.
|
|
65
|
+
* */
|
|
66
|
+
accessibilityLabelText?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Optional. Assign accessibility label to the chip for automated testing.
|
|
69
|
+
* */
|
|
70
|
+
accessibilityLabelTouchable?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Optional. Accessibility state for the chip.
|
|
74
|
+
*/
|
|
75
|
+
accessibilityState?: AccessibilityState;
|
|
62
76
|
};
|