react-native-ui-lib 7.38.0-snapshot.6291 → 7.38.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/package.json +1 -1
- package/src/components/button/ButtonConstants.d.ts +0 -6
- package/src/components/button/ButtonConstants.js +0 -6
- package/src/components/button/index.d.ts +5 -18
- package/src/components/button/index.js +2 -16
- package/src/components/checkbox/index.d.ts +0 -1
- package/src/components/checkbox/index.js +1 -4
- package/src/components/radioButton/index.js +1 -8
package/package.json
CHANGED
|
@@ -17,10 +17,4 @@ export declare const MIN_WIDTH: {
|
|
|
17
17
|
MEDIUM: number;
|
|
18
18
|
LARGE: number;
|
|
19
19
|
};
|
|
20
|
-
export declare const SIZE_TO_VERTICAL_HITSLOP: {
|
|
21
|
-
readonly xSmall: 30;
|
|
22
|
-
readonly small: 25;
|
|
23
|
-
readonly medium: 20;
|
|
24
|
-
readonly large: 15;
|
|
25
|
-
};
|
|
26
20
|
export declare const DEFAULT_SIZE = ButtonSize.large;
|
|
@@ -17,10 +17,4 @@ export const MIN_WIDTH = {
|
|
|
17
17
|
MEDIUM: 77,
|
|
18
18
|
LARGE: 90
|
|
19
19
|
};
|
|
20
|
-
export const SIZE_TO_VERTICAL_HITSLOP = {
|
|
21
|
-
[ButtonSize.xSmall]: 30,
|
|
22
|
-
[ButtonSize.small]: 25,
|
|
23
|
-
[ButtonSize.medium]: 20,
|
|
24
|
-
[ButtonSize.large]: 15
|
|
25
|
-
};
|
|
26
20
|
export const DEFAULT_SIZE = ButtonSize.large;
|
|
@@ -11,7 +11,9 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
11
11
|
static sizes: typeof ButtonSize;
|
|
12
12
|
static animationDirection: typeof ButtonAnimationDirection;
|
|
13
13
|
constructor(props: Props);
|
|
14
|
-
state:
|
|
14
|
+
state: {
|
|
15
|
+
size: undefined;
|
|
16
|
+
};
|
|
15
17
|
styles: {
|
|
16
18
|
container: {
|
|
17
19
|
backgroundColor: string;
|
|
@@ -368,14 +370,7 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
368
370
|
getLabelColor(): string | undefined;
|
|
369
371
|
getIconColor(): string | undefined;
|
|
370
372
|
getLabelSizeStyle(): TextStyle | undefined;
|
|
371
|
-
getContainerSizeStyle():
|
|
372
|
-
height: number;
|
|
373
|
-
width: number;
|
|
374
|
-
padding: number;
|
|
375
|
-
paddingVertical: number;
|
|
376
|
-
paddingHorizontal: number;
|
|
377
|
-
minWidth: number;
|
|
378
|
-
}>;
|
|
373
|
+
getContainerSizeStyle(): any;
|
|
379
374
|
getOutlineStyle(): {
|
|
380
375
|
borderWidth: number;
|
|
381
376
|
borderColor: string;
|
|
@@ -396,18 +391,10 @@ declare class Button extends PureComponent<Props, ButtonState> {
|
|
|
396
391
|
})[] | undefined;
|
|
397
392
|
getIconStyle(): [ImageStyle, StyleProp<ImageStyle>];
|
|
398
393
|
getAnimationDirectionStyle(): {
|
|
399
|
-
|
|
400
|
-
} | {
|
|
401
|
-
readonly alignSelf: "flex-end";
|
|
394
|
+
alignSelf: string;
|
|
402
395
|
} | undefined;
|
|
403
396
|
renderIcon(): React.JSX.Element | null;
|
|
404
397
|
renderLabel(): React.JSX.Element | null;
|
|
405
|
-
getAccessibleHitSlop(): {
|
|
406
|
-
top: number;
|
|
407
|
-
bottom: number;
|
|
408
|
-
left: number;
|
|
409
|
-
right: number;
|
|
410
|
-
};
|
|
411
398
|
render(): React.JSX.Element;
|
|
412
399
|
}
|
|
413
400
|
export { Button };
|
|
@@ -7,7 +7,7 @@ import TouchableOpacity from "../touchableOpacity";
|
|
|
7
7
|
import Text from "../text";
|
|
8
8
|
import Icon from "../icon";
|
|
9
9
|
import { ButtonSize, ButtonAnimationDirection, ButtonProps, DEFAULT_PROPS } from "./types";
|
|
10
|
-
import { PADDINGS, HORIZONTAL_PADDINGS, MIN_WIDTH, DEFAULT_SIZE
|
|
10
|
+
import { PADDINGS, HORIZONTAL_PADDINGS, MIN_WIDTH, DEFAULT_SIZE } from "./ButtonConstants";
|
|
11
11
|
export { ButtonSize, ButtonAnimationDirection, ButtonProps };
|
|
12
12
|
class Button extends PureComponent {
|
|
13
13
|
static displayName = 'Button';
|
|
@@ -351,20 +351,6 @@ class Button extends PureComponent {
|
|
|
351
351
|
}
|
|
352
352
|
return null;
|
|
353
353
|
}
|
|
354
|
-
getAccessibleHitSlop() {
|
|
355
|
-
const containerStyle = this.getContainerSizeStyle();
|
|
356
|
-
const isWidthSet = containerStyle.width !== undefined || containerStyle.minWidth !== undefined;
|
|
357
|
-
const width = containerStyle.width || containerStyle.minWidth || 0;
|
|
358
|
-
const widthWithPadding = width + (containerStyle.paddingHorizontal || containerStyle.padding || 0) * 2;
|
|
359
|
-
const horizontalHitslop = isWidthSet ? Math.max(0, (48 - widthWithPadding) / 2) : 10;
|
|
360
|
-
const verticalHitslop = (containerStyle.height ? Math.max(0, 48 - containerStyle.height) : SIZE_TO_VERTICAL_HITSLOP[this.props.size || DEFAULT_SIZE]) / 2;
|
|
361
|
-
return {
|
|
362
|
-
top: verticalHitslop,
|
|
363
|
-
bottom: verticalHitslop,
|
|
364
|
-
left: horizontalHitslop,
|
|
365
|
-
right: horizontalHitslop
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
354
|
render() {
|
|
369
355
|
const {
|
|
370
356
|
onPress,
|
|
@@ -387,7 +373,7 @@ class Button extends PureComponent {
|
|
|
387
373
|
const borderRadiusStyle = this.getBorderRadiusStyle();
|
|
388
374
|
return <TouchableOpacity row centerV style={[this.styles.container, animateLayout && this.getAnimationDirectionStyle(), containerSizeStyle, this.isLink && this.styles.innerContainerLink, shadowStyle, margins, paddings, {
|
|
389
375
|
backgroundColor
|
|
390
|
-
}, borderRadiusStyle, outlineStyle, style]} activeOpacity={0.6} activeBackgroundColor={this.getActiveBackgroundColor()} onLayout={this.onLayout} onPress={onPress} disabled={disabled} testID={testID}
|
|
376
|
+
}, borderRadiusStyle, outlineStyle, style]} activeOpacity={0.6} activeBackgroundColor={this.getActiveBackgroundColor()} onLayout={this.onLayout} onPress={onPress} disabled={disabled} testID={testID} {...others} ref={forwardedRef}>
|
|
391
377
|
{this.props.children}
|
|
392
378
|
{this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}
|
|
393
379
|
{this.props.iconOnRight ? this.renderIcon() : this.renderLabel()}
|
|
@@ -117,7 +117,6 @@ declare class Checkbox extends Component<CheckboxProps, CheckboxState> {
|
|
|
117
117
|
getLabelStyle: () => {
|
|
118
118
|
color: string;
|
|
119
119
|
};
|
|
120
|
-
getAccessibleHitSlop(size: number): number;
|
|
121
120
|
renderCheckbox(): React.JSX.Element;
|
|
122
121
|
render(): React.JSX.Element;
|
|
123
122
|
validate: () => void;
|
|
@@ -144,9 +144,6 @@ 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
|
-
}
|
|
150
147
|
renderCheckbox() {
|
|
151
148
|
const {
|
|
152
149
|
selectedIcon,
|
|
@@ -159,7 +156,7 @@ class Checkbox extends Component {
|
|
|
159
156
|
} = this.props;
|
|
160
157
|
return (
|
|
161
158
|
//@ts-ignore
|
|
162
|
-
<TouchableOpacity {...this.getAccessibilityProps()} activeOpacity={1} testID={testID} {...others} style={[this.getBorderStyle(), style, !label && containerStyle]} onPress={this.onPress}
|
|
159
|
+
<TouchableOpacity {...this.getAccessibilityProps()} activeOpacity={1} testID={testID} {...others} style={[this.getBorderStyle(), style, !label && containerStyle]} onPress={this.onPress}>
|
|
163
160
|
{<Animated.View style={[this.styles.container, {
|
|
164
161
|
opacity: this.animationStyle.opacity
|
|
165
162
|
}, {
|
|
@@ -179,13 +179,6 @@ 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
|
-
}
|
|
189
182
|
render() {
|
|
190
183
|
const {
|
|
191
184
|
onPress,
|
|
@@ -197,7 +190,7 @@ class RadioButton extends PureComponent {
|
|
|
197
190
|
const Container = onPress || onValueChange ? TouchableOpacity : View;
|
|
198
191
|
return (
|
|
199
192
|
// @ts-ignore
|
|
200
|
-
<Container row centerV activeOpacity={1} {...others} style={containerStyle} onPress={this.onPress} {...this.getAccessibilityProps()}
|
|
193
|
+
<Container row centerV activeOpacity={1} {...others} style={containerStyle} onPress={this.onPress} {...this.getAccessibilityProps()}>
|
|
201
194
|
{!contentOnLeft && this.renderButton()}
|
|
202
195
|
{this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}
|
|
203
196
|
{this.props.iconOnRight ? this.renderIcon() : this.renderLabel()}
|