react-native-ui-lib 7.38.0-snapshot.6268 → 7.38.0-snapshot.6282
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/package.json
CHANGED
|
@@ -117,6 +117,7 @@ declare class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
117
117
|
getLabelStyle: () => {
|
|
118
118
|
color: string;
|
|
119
119
|
};
|
|
120
|
+
getAccessibleHitSlop(size: number): number;
|
|
120
121
|
renderCheckbox(): React.JSX.Element;
|
|
121
122
|
render(): React.JSX.Element;
|
|
122
123
|
validate: () => void;
|
|
@@ -144,6 +144,9 @@ class Checkbox extends Component {
|
|
|
144
144
|
color: this.props.disabled ? Colors.$textDisabled : this.state.showError ? Colors.$textDangerLight : Colors.$textDefault
|
|
145
145
|
};
|
|
146
146
|
};
|
|
147
|
+
getAccessibleHitSlop(size) {
|
|
148
|
+
return Math.max(0, (48 - size) / 2);
|
|
149
|
+
}
|
|
147
150
|
renderCheckbox() {
|
|
148
151
|
const {
|
|
149
152
|
selectedIcon,
|
|
@@ -156,7 +159,7 @@ class Checkbox extends Component {
|
|
|
156
159
|
} = this.props;
|
|
157
160
|
return (
|
|
158
161
|
//@ts-ignore
|
|
159
|
-
<TouchableOpacity {...this.getAccessibilityProps()} activeOpacity={1} testID={testID} {...others} style={[this.getBorderStyle(), style, !label && containerStyle]} onPress={this.onPress}>
|
|
162
|
+
<TouchableOpacity {...this.getAccessibilityProps()} activeOpacity={1} testID={testID} {...others} style={[this.getBorderStyle(), style, !label && containerStyle]} onPress={this.onPress} hitSlop={this.getAccessibleHitSlop(this.props.size || DEFAULT_SIZE)}>
|
|
160
163
|
{<Animated.View style={[this.styles.container, {
|
|
161
164
|
opacity: this.animationStyle.opacity
|
|
162
165
|
}, {
|
|
@@ -179,6 +179,13 @@ class RadioButton extends PureComponent {
|
|
|
179
179
|
}]} />
|
|
180
180
|
</View>;
|
|
181
181
|
}
|
|
182
|
+
getAccessibleHitSlop(size) {
|
|
183
|
+
const verticalPadding = Math.max(0, (48 - size) / 2);
|
|
184
|
+
return {
|
|
185
|
+
top: verticalPadding,
|
|
186
|
+
bottom: verticalPadding
|
|
187
|
+
};
|
|
188
|
+
}
|
|
182
189
|
render() {
|
|
183
190
|
const {
|
|
184
191
|
onPress,
|
|
@@ -190,7 +197,7 @@ class RadioButton extends PureComponent {
|
|
|
190
197
|
const Container = onPress || onValueChange ? TouchableOpacity : View;
|
|
191
198
|
return (
|
|
192
199
|
// @ts-ignore
|
|
193
|
-
<Container row centerV activeOpacity={1} {...others} style={containerStyle} onPress={this.onPress} {...this.getAccessibilityProps()}>
|
|
200
|
+
<Container row centerV activeOpacity={1} {...others} style={containerStyle} onPress={this.onPress} {...this.getAccessibilityProps()} hitSlop={this.getAccessibleHitSlop(this.props.size || DEFAULT_SIZE)}>
|
|
194
201
|
{!contentOnLeft && this.renderButton()}
|
|
195
202
|
{this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}
|
|
196
203
|
{this.props.iconOnRight ? this.renderIcon() : this.renderLabel()}
|