@ovotech/element-native 4.1.0 → 4.1.1-canary-20993f2-269
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/dist/components/ActionList/ActionList.js +2 -2
- package/dist/components/CTAButton/CTAButton.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Heading1/Heading1.js +1 -1
- package/dist/components/Heading2/Heading2.js +1 -1
- package/dist/components/Heading3/Heading3.js +1 -1
- package/dist/components/Heading4/Heading4.js +1 -1
- package/dist/components/PasswordInput/PasswordVisibilityToggle.js +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/Radio/RadioField.js +1 -1
- package/dist/components/RadioCard/RadioCard.js +1 -1
- package/dist/components/SegmentedControls/SegmentedControls.js +1 -1
- package/dist/components/SegmentedControls/components/SegmentButton.d.ts +2 -1
- package/dist/components/SegmentedControls/components/SegmentButton.js +8 -4
- package/dist/components/SelectField/Select.js +1 -1
- package/dist/components/SkeletonAnimation/SkeletonAnimation.js +1 -1
- package/dist/components/Tabs/Tab.js +1 -1
- package/dist/components/Tabs/TabList.js +1 -1
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +4 -4
- package/dist/components/Toggle/styles.d.ts +1 -0
- package/dist/components/Toggle/styles.js +2 -2
- package/dist/esm/components/ActionList/ActionList.js +2 -2
- package/dist/esm/components/CTAButton/CTAButton.js +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/components/Heading1/Heading1.js +1 -1
- package/dist/esm/components/Heading2/Heading2.js +1 -1
- package/dist/esm/components/Heading3/Heading3.js +1 -1
- package/dist/esm/components/Heading4/Heading4.js +1 -1
- package/dist/esm/components/PasswordInput/PasswordVisibilityToggle.js +1 -1
- package/dist/esm/components/Radio/Radio.js +1 -1
- package/dist/esm/components/Radio/RadioField.js +1 -1
- package/dist/esm/components/RadioCard/RadioCard.js +1 -1
- package/dist/esm/components/SegmentedControls/SegmentedControls.js +1 -1
- package/dist/esm/components/SegmentedControls/components/SegmentButton.js +8 -4
- package/dist/esm/components/SelectField/Select.js +1 -1
- package/dist/esm/components/SkeletonAnimation/SkeletonAnimation.js +1 -1
- package/dist/esm/components/Tabs/Tab.js +1 -1
- package/dist/esm/components/Tabs/TabList.js +1 -1
- package/dist/esm/components/Toggle/Toggle.js +4 -4
- package/dist/esm/components/Toggle/styles.js +2 -2
- package/package.json +3 -3
|
@@ -48,11 +48,11 @@ var ActionList = function (_a) {
|
|
|
48
48
|
exports.ActionList = ActionList;
|
|
49
49
|
var ActionWrapper = (0, react_1.forwardRef)(function (_a, ref) {
|
|
50
50
|
var children = _a.children, accessibilityRole = _a.accessibilityRole, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.75 : _b, fullWidth = _a.fullWidth, _c = _a.hasBorder, hasBorder = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, _e = _a.inline, inline = _e === void 0 ? false : _e, inList = _a.inList, onPress = _a.onPress, testID = _a.testID, rest = __rest(_a, ["children", "accessibilityRole", "activeOpacity", "fullWidth", "hasBorder", "inverted", "inline", "inList", "onPress", "testID"]);
|
|
51
|
-
return ((0, jsx_runtime_1.jsx)(styled_1.StyledActionWrapper, __assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID }, rest, { children: (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { hitSlop: inline ? 24 : null, activeOpacity: activeOpacity, accessibilityRole: accessibilityRole, onPress: onPress, children: (0, jsx_runtime_1.jsx)(styled_1.StyledActionInner, { fullWidth: fullWidth, inList: inList, inline: inline, children: children }) }) })));
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(styled_1.StyledActionWrapper, __assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID }, rest, { children: (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { hitSlop: inline ? 24 : null, activeOpacity: activeOpacity, accessible: true, accessibilityRole: accessibilityRole, onPress: onPress, children: (0, jsx_runtime_1.jsx)(styled_1.StyledActionInner, { fullWidth: fullWidth, inList: inList, inline: inline, children: children }) }) })));
|
|
52
52
|
});
|
|
53
53
|
var Action = (0, react_1.forwardRef)(function (_a, ref) {
|
|
54
54
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'link' : _b, children = _a.children, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, _e = _a.inline, inline = _e === void 0 ? false : _e, onPress = _a.onPress, testID = _a.testID, iconLeft = _a.iconLeft, iconRight = _a.iconRight, rest = __rest(_a, ["accessibilityRole", "children", "fullWidth", "inverted", "inline", "onPress", "testID", "iconLeft", "iconRight"]);
|
|
55
55
|
var smallAndUp = (0, hooks_1.useBreakpoint)().smallAndUp;
|
|
56
|
-
return ((0, jsx_runtime_1.jsxs)(ActionWrapper, __assign({ ref: ref, accessibilityRole: accessibilityRole, fullWidth: fullWidth, inverted: inverted, inline: inline, onPress: onPress, testID: testID }, rest, { children: [iconLeft ? ((0, jsx_runtime_1.jsx)(styled_1.StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, typeof children === 'string' ? ((0, jsx_runtime_1.jsx)(styled_1.StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, inList: rest === null || rest === void 0 ? void 0 : rest.inList, children: children })) : ((0, jsx_runtime_1.jsx)(styled_1.StyledActionNodeWrapper, { children: children })), iconRight ? ((0, jsx_runtime_1.jsx)(styled_1.StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
|
|
56
|
+
return ((0, jsx_runtime_1.jsxs)(ActionWrapper, __assign({ ref: ref, accessible: true, accessibilityRole: accessibilityRole, fullWidth: fullWidth, inverted: inverted, inline: inline, onPress: onPress, testID: testID }, rest, { children: [iconLeft ? ((0, jsx_runtime_1.jsx)(styled_1.StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, typeof children === 'string' ? ((0, jsx_runtime_1.jsx)(styled_1.StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, inList: rest === null || rest === void 0 ? void 0 : rest.inList, children: children })) : ((0, jsx_runtime_1.jsx)(styled_1.StyledActionNodeWrapper, { children: children })), iconRight ? ((0, jsx_runtime_1.jsx)(styled_1.StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
|
|
57
57
|
});
|
|
58
58
|
exports.Action = Action;
|
|
@@ -59,7 +59,7 @@ var Icon_1 = require("../Icon/Icon");
|
|
|
59
59
|
var StyledCTAWrapper = styled_native_1.default.TouchableOpacity(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-self: flex-start;\n flex-direction: row;\n align-items: flex-start;\n"], ["\n align-self: flex-start;\n flex-direction: row;\n align-items: flex-start;\n"])));
|
|
60
60
|
var CTAButtonWrapper = function (_a) {
|
|
61
61
|
var children = _a.children, _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'button' : _b, _c = _a.activeOpacity, activeOpacity = _c === void 0 ? 0.8 : _c, rest = __rest(_a, ["children", "accessibilityRole", "activeOpacity"]);
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)(StyledCTAWrapper, __assign({ accessibilityRole: accessibilityRole, activeOpacity: activeOpacity }, rest, { children: children })));
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(StyledCTAWrapper, __assign({ accessible: true, accessibilityRole: accessibilityRole, activeOpacity: activeOpacity }, rest, { children: children })));
|
|
63
63
|
};
|
|
64
64
|
var StyledInner = styled_native_1.default.View(function (_a) {
|
|
65
65
|
var _b = _a.theme, core = _b.core, component = _b.component, fullWidth = _a.fullWidth, variant = _a.variant, inverted = _a.inverted;
|
|
@@ -74,7 +74,7 @@ var StyledWrapper = styled_native_1.default.View(templateObject_1 || (templateOb
|
|
|
74
74
|
var Checkbox = (0, react_1.forwardRef)(function (_a, ref) {
|
|
75
75
|
var label = _a.label, hint = _a.hint, error = _a.error, checked = _a.checked, optional = _a.optional, invalid = _a.invalid, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "error", "checked", "optional", "invalid", "activeOpacity", "testID"]);
|
|
76
76
|
var hasError = !!error;
|
|
77
|
-
return ((0, jsx_runtime_1.jsx)(FormGroup_1.FormGroup, { error: hasError, children: (0, jsx_runtime_1.jsxs)(Stack_1.Stack, { spaceBetween: 1, children: [error ? (0, jsx_runtime_1.jsx)(ErrorText_1.ErrorText, { children: error }) : null, (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, __assign({ ref: ref, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: (0, jsx_runtime_1.jsxs)(StyledWrapper, { children: [(0, jsx_runtime_1.jsx)(Input, { checked: checked, invalid: hasError || invalid, testID: testID }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexShrink: 1 }, children: [(0, jsx_runtime_1.jsxs)(CheckLabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] })] }) }))] }) }));
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)(FormGroup_1.FormGroup, { error: hasError, children: (0, jsx_runtime_1.jsxs)(Stack_1.Stack, { spaceBetween: 1, children: [error ? (0, jsx_runtime_1.jsx)(ErrorText_1.ErrorText, { children: error }) : null, (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: (0, jsx_runtime_1.jsxs)(StyledWrapper, { children: [(0, jsx_runtime_1.jsx)(Input, { checked: checked, invalid: hasError || invalid, testID: testID }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexShrink: 1 }, children: [(0, jsx_runtime_1.jsxs)(CheckLabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] })] }) }))] }) }));
|
|
78
78
|
});
|
|
79
79
|
exports.Checkbox = Checkbox;
|
|
80
80
|
var templateObject_1;
|
|
@@ -67,7 +67,7 @@ var StyledHeading1 = styled_native_1.default.Text(function (_a) {
|
|
|
67
67
|
var Heading1 = function (_a) {
|
|
68
68
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
69
69
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(StyledHeading1, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(StyledHeading1, __assign({ accessible: true, accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
71
71
|
};
|
|
72
72
|
exports.Heading1 = Heading1;
|
|
73
73
|
var templateObject_1;
|
|
@@ -67,7 +67,7 @@ var StyledHeading2 = styled_native_1.default.Text(function (_a) {
|
|
|
67
67
|
var Heading2 = function (_a) {
|
|
68
68
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
69
69
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(StyledHeading2, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(StyledHeading2, __assign({ accessible: true, accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
71
71
|
};
|
|
72
72
|
exports.Heading2 = Heading2;
|
|
73
73
|
var templateObject_1;
|
|
@@ -67,7 +67,7 @@ var StyledHeading3 = styled_native_1.default.Text(function (_a) {
|
|
|
67
67
|
var Heading3 = function (_a) {
|
|
68
68
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
69
69
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(StyledHeading3, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(StyledHeading3, __assign({ accessible: true, accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
71
71
|
};
|
|
72
72
|
exports.Heading3 = Heading3;
|
|
73
73
|
var templateObject_1;
|
|
@@ -67,7 +67,7 @@ var StyledHeading4 = styled_native_1.default.Text(function (_a) {
|
|
|
67
67
|
var Heading4 = function (_a) {
|
|
68
68
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
69
69
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(StyledHeading4, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(StyledHeading4, __assign({ accessible: true, accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
71
71
|
};
|
|
72
72
|
exports.Heading4 = Heading4;
|
|
73
73
|
var templateObject_1;
|
|
@@ -19,7 +19,7 @@ exports.useTogglePasswordVisibility = useTogglePasswordVisibility;
|
|
|
19
19
|
var PasswordVisibilityToggle = function (_a) {
|
|
20
20
|
var iconName = _a.iconName, visibilityToggleLabel = _a.visibilityToggleLabel, handlePasswordVisibility = _a.handlePasswordVisibility;
|
|
21
21
|
var _b = (0, react_1.useState)(false), focused = _b[0], setFocused = _b[1];
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(PasswordInput_styled_1.StyledPressable, { testID: "password-input-visibility-toggle", focused: focused, accessibilityRole: "button", accessibilityLabel: visibilityToggleLabel, onPress: handlePasswordVisibility, hitSlop: 16, onFocus: function () {
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(PasswordInput_styled_1.StyledPressable, { testID: "password-input-visibility-toggle", focused: focused, accessible: true, accessibilityRole: "button", accessibilityLabel: visibilityToggleLabel, onPress: handlePasswordVisibility, hitSlop: 16, onFocus: function () {
|
|
23
23
|
setFocused(true);
|
|
24
24
|
}, onBlur: function () {
|
|
25
25
|
setFocused(false);
|
|
@@ -63,6 +63,6 @@ var Radio = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
63
63
|
value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
64
64
|
_b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
65
65
|
activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: (0, jsx_runtime_1.jsxs)(StyledWrapper, { children: [(0, jsx_runtime_1.jsx)(Input, { checked: checked, invalid: invalid, testID: testID }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexShrink: 1 }, children: [(0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] })] }) })));
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: (0, jsx_runtime_1.jsxs)(StyledWrapper, { children: [(0, jsx_runtime_1.jsx)(Input, { checked: checked, invalid: invalid, testID: testID }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexShrink: 1 }, children: [(0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] })] }) })));
|
|
67
67
|
});
|
|
68
68
|
exports.Radio = Radio;
|
|
@@ -36,7 +36,7 @@ var RadioField = function (_a) {
|
|
|
36
36
|
var label = _a.label, hint = _a.hint, error = _a.error, children = _a.children, _b = _a.optional, optional = _b === void 0 ? false : _b, value = _a.value, onValueChange = _a.onValueChange, rest = __rest(_a, ["label", "hint", "error", "children", "optional", "value", "onValueChange"]);
|
|
37
37
|
var hasError = !!error;
|
|
38
38
|
var validChildren = (0, utils_1.getValidChildren)(children);
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(FormGroup_1.FormGroup, __assign({}, rest, { error: hasError, children: (0, jsx_runtime_1.jsxs)(Stack_1.Stack, { spaceBetween: 1, children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [(0, jsx_runtime_1.jsxs)(LabelText_1.LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null, error ? (0, jsx_runtime_1.jsx)(ErrorText_1.ErrorText, { children: error }) : null] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { accessibilityRole: "radiogroup", children: react_1.Children.map(validChildren, function (child) {
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(FormGroup_1.FormGroup, __assign({}, rest, { error: hasError, children: (0, jsx_runtime_1.jsxs)(Stack_1.Stack, { spaceBetween: 1, children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [(0, jsx_runtime_1.jsxs)(LabelText_1.LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null, error ? (0, jsx_runtime_1.jsx)(ErrorText_1.ErrorText, { children: error }) : null] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { accessible: true, accessibilityRole: "radiogroup", children: react_1.Children.map(validChildren, function (child) {
|
|
40
40
|
return (0, react_1.cloneElement)(child, {
|
|
41
41
|
invalid: hasError ? true : child.props.invalid,
|
|
42
42
|
checked: child.props.checked != null
|
|
@@ -67,6 +67,6 @@ var StyledWrapper = styled_native_1.default.View(function (_a) {
|
|
|
67
67
|
});
|
|
68
68
|
exports.RadioCard = (0, react_1.forwardRef)(function (_a, ref) {
|
|
69
69
|
var label = _a.label, checked = _a.checked, invalid = _a.invalid, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, _c = _a.hasInput, hasInput = _c === void 0 ? true : _c, rest = __rest(_a, ["label", "checked", "invalid", "activeOpacity", "testID", "hasInput"]);
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: (0, jsx_runtime_1.jsxs)(StyledWrapper, { checked: checked, invalid: invalid, children: [typeof label === 'string' ? (0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }) : label, hasInput ? ((0, jsx_runtime_1.jsx)(Input, { checked: checked, invalid: invalid, testID: testID })) : null] }) })));
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: (0, jsx_runtime_1.jsxs)(StyledWrapper, { checked: checked, invalid: invalid, children: [typeof label === 'string' ? (0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }) : label, hasInput ? ((0, jsx_runtime_1.jsx)(Input, { checked: checked, invalid: invalid, testID: testID })) : null] }) })));
|
|
71
71
|
});
|
|
72
72
|
var templateObject_1;
|
|
@@ -79,7 +79,7 @@ var SegmentedControls = function (_a) {
|
|
|
79
79
|
}); }, [animatedX, animatedY, animatedWidth, animatedHeight]);
|
|
80
80
|
return ((0, jsx_runtime_1.jsxs)(SegmentsContainer, __assign({ "$inline": inline, "$multipleRows": multipleRows }, rest, { children: [(0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { style: animatedBackgroundStyle }), segments.map(function (segment) {
|
|
81
81
|
var _a;
|
|
82
|
-
return ((0, jsx_runtime_1.jsx)(SegmentButton_1.SegmentButton, { isSelected: activeSegment.key === segment.key, label: segment.label, accessibilityLabel: segment.accessibilityLabel, onPress: function (x, y, width) {
|
|
82
|
+
return ((0, jsx_runtime_1.jsx)(SegmentButton_1.SegmentButton, { isSelected: activeSegment.key === segment.key, isLast: segments[segments.length - 1].key === segment.key, label: segment.label, accessibilityLabel: segment.accessibilityLabel, onPress: function (x, y, width) {
|
|
83
83
|
setActiveSegment(segment);
|
|
84
84
|
animatedX.value = (0, react_native_reanimated_1.withSpring)(x, springSettings);
|
|
85
85
|
animatedY.value = (0, react_native_reanimated_1.withSpring)(y, springSettings);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type SegmentButtonProps = {
|
|
2
|
+
isLast: boolean;
|
|
2
3
|
isSelected: boolean;
|
|
3
4
|
label: string;
|
|
4
5
|
onPress: (x: number, y: number, width: number) => void;
|
|
@@ -9,5 +10,5 @@ type SegmentButtonProps = {
|
|
|
9
10
|
size?: 'small' | 'large';
|
|
10
11
|
testID?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare const SegmentButton: ({ accessibilityLabel, inline, isSelected, label, multipleRows, onLayout, onPress, size, testID, }: SegmentButtonProps) => JSX.Element;
|
|
13
|
+
export declare const SegmentButton: ({ accessibilityLabel, inline, isLast, isSelected, label, multipleRows, onLayout, onPress, size, testID, }: SegmentButtonProps) => JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -35,7 +35,7 @@ var styled_native_1 = __importDefault(require("../../../styled.native"));
|
|
|
35
35
|
var P_1 = require("../../P");
|
|
36
36
|
var AnimatedP = react_native_reanimated_1.default.createAnimatedComponent(P_1.P);
|
|
37
37
|
var SegmentButton = function (_a) {
|
|
38
|
-
var accessibilityLabel = _a.accessibilityLabel, inline = _a.inline, isSelected = _a.isSelected, label = _a.label, multipleRows = _a.multipleRows, onLayout = _a.onLayout, onPress = _a.onPress, _b = _a.size, size = _b === void 0 ? 'large' : _b, testID = _a.testID;
|
|
38
|
+
var accessibilityLabel = _a.accessibilityLabel, inline = _a.inline, isLast = _a.isLast, isSelected = _a.isSelected, label = _a.label, multipleRows = _a.multipleRows, onLayout = _a.onLayout, onPress = _a.onPress, _b = _a.size, size = _b === void 0 ? 'large' : _b, testID = _a.testID;
|
|
39
39
|
var xRef = (0, react_1.useRef)(0);
|
|
40
40
|
var yRef = (0, react_1.useRef)(0);
|
|
41
41
|
var widthRef = (0, react_1.useRef)(0);
|
|
@@ -57,12 +57,16 @@ var SegmentButton = function (_a) {
|
|
|
57
57
|
(0, react_1.useEffect)(function () {
|
|
58
58
|
fontWeightAnim.value = (0, react_native_reanimated_1.withTiming)(isSelected ? 1 : 0);
|
|
59
59
|
}, [fontWeightAnim, isSelected]);
|
|
60
|
+
// strange discrepancy with the last segment not reaching the end of the container
|
|
61
|
+
var adjustLastSegmentWidth = function (width) {
|
|
62
|
+
return isLast && size === 'large' ? width + 2 : width;
|
|
63
|
+
};
|
|
60
64
|
var handleLayout = function (event) {
|
|
61
65
|
var _a = event.nativeEvent.layout, width = _a.width, height = _a.height, x = _a.x, y = _a.y;
|
|
62
66
|
xRef.current = x;
|
|
63
67
|
yRef.current = y;
|
|
64
68
|
heightRef.current = height;
|
|
65
|
-
widthRef.current = width;
|
|
69
|
+
widthRef.current = adjustLastSegmentWidth(width);
|
|
66
70
|
onLayout(width, height, x, y);
|
|
67
71
|
};
|
|
68
72
|
var handlePress = function () {
|
|
@@ -71,9 +75,9 @@ var SegmentButton = function (_a) {
|
|
|
71
75
|
// choices go on the second row. The only way I could get it to work
|
|
72
76
|
// was to hardcode the denominator to 3 for the single row ones
|
|
73
77
|
// and 1.1 for the multiple row ones.
|
|
74
|
-
yRef.current - heightRef.current / (multipleRows ? 1.1 : 3), widthRef.current);
|
|
78
|
+
yRef.current - heightRef.current / (multipleRows ? 1.1 : 3), adjustLastSegmentWidth(widthRef.current));
|
|
75
79
|
};
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { onLayout: handleLayout, onPress: handlePress, accessible: true, accessibilityRole: "checkbox", accessibilityState: { selected: isSelected }, accessibilityLabel: accessibilityLabel, hitSlop: {
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { onLayout: handleLayout, onPress: handlePress, accessible: true, accessibilityRole: "checkbox", accessibilityState: { selected: isSelected }, accessibilityLabel: accessibilityLabel || label, hitSlop: {
|
|
77
81
|
top: hitslopVal,
|
|
78
82
|
bottom: hitslopVal,
|
|
79
83
|
}, style: { flexGrow: inline || multipleRows ? undefined : 1 }, testID: testID, children: (0, jsx_runtime_1.jsxs)(SSegmentsWrapper, { "$isSelected": isSelected, "$size": size, children: [(0, jsx_runtime_1.jsx)(SSegmentText, { style: {
|
|
@@ -90,7 +90,7 @@ var Select = function (_a) {
|
|
|
90
90
|
label: "-- ".concat(noOptionMessage, " --"),
|
|
91
91
|
value: 'default',
|
|
92
92
|
};
|
|
93
|
-
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [(0, jsx_runtime_1.jsxs)(SelectInput, { testID: testID, hasError: hasError, onPress: function () { return setOpen(!isOpen); }, children: [(0, jsx_runtime_1.jsx)(P_1.P, { style: { marginTop: 0, marginBottom: 0 }, children: selected.value === 'default' ? '' : selected.label }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "chevron-down", size: 16, style: { marginLeft: 'auto' } })] }), (0, jsx_runtime_1.jsx)(react_native_1.Modal, { transparent: true, visible: isOpen, animationType: "fade", onRequestClose: function () { return setOpen(false); }, children: (0, jsx_runtime_1.jsx)(DropdownWrapper, { children: (0, jsx_runtime_1.jsx)(DropdownContainer, { children: (0, jsx_runtime_1.jsxs)(react_native_1.ScrollView, { nestedScrollEnabled: true, children: [(0, jsx_runtime_1.jsxs)(SelectOption, { accessibilityRole: "radio", onPress: function () { return handleOptionPress(requiredOption); }, children: [(0, jsx_runtime_1.jsx)(StyledP, { children: (0, jsx_runtime_1.jsx)(Strong_1.Strong, { children: requiredOption.label }) }), (0, jsx_runtime_1.jsx)(Radio, { isChecked: selected.value === requiredOption.value, children: (0, jsx_runtime_1.jsx)(RadioDot, { isChecked: selected.value === requiredOption.value }) })] }), Object.keys(optionsByCategories).map(function (category) { return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [category !== 'undefined' ? ((0, jsx_runtime_1.jsx)(StyledCategory, { children: category })) : null, optionsByCategories[category].map(function (option, i) { return ((0, jsx_runtime_1.jsxs)(SelectOption, { accessibilityRole: "radio", isLastOption: i === optionsByCategories[category].length - 1, onPress: function () { return handleOptionPress(option); }, children: [(0, jsx_runtime_1.jsx)(StyledP, { children: (0, jsx_runtime_1.jsx)(Strong_1.Strong, { children: option.label }) }), (0, jsx_runtime_1.jsx)(Radio, { isChecked: selected.value === option.value, children: (0, jsx_runtime_1.jsx)(RadioDot, { isChecked: selected.value === option.value }) })] }, option.label)); })] }, category)); })] }) }) }) })] }));
|
|
93
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [(0, jsx_runtime_1.jsxs)(SelectInput, { testID: testID, hasError: hasError, onPress: function () { return setOpen(!isOpen); }, children: [(0, jsx_runtime_1.jsx)(P_1.P, { style: { marginTop: 0, marginBottom: 0 }, children: selected.value === 'default' ? '' : selected.label }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: "chevron-down", size: 16, style: { marginLeft: 'auto' } })] }), (0, jsx_runtime_1.jsx)(react_native_1.Modal, { transparent: true, visible: isOpen, animationType: "fade", onRequestClose: function () { return setOpen(false); }, children: (0, jsx_runtime_1.jsx)(DropdownWrapper, { children: (0, jsx_runtime_1.jsx)(DropdownContainer, { children: (0, jsx_runtime_1.jsxs)(react_native_1.ScrollView, { nestedScrollEnabled: true, children: [(0, jsx_runtime_1.jsxs)(SelectOption, { accessible: true, accessibilityRole: "radio", onPress: function () { return handleOptionPress(requiredOption); }, children: [(0, jsx_runtime_1.jsx)(StyledP, { children: (0, jsx_runtime_1.jsx)(Strong_1.Strong, { children: requiredOption.label }) }), (0, jsx_runtime_1.jsx)(Radio, { isChecked: selected.value === requiredOption.value, children: (0, jsx_runtime_1.jsx)(RadioDot, { isChecked: selected.value === requiredOption.value }) })] }), Object.keys(optionsByCategories).map(function (category) { return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [category !== 'undefined' ? ((0, jsx_runtime_1.jsx)(StyledCategory, { children: category })) : null, optionsByCategories[category].map(function (option, i) { return ((0, jsx_runtime_1.jsxs)(SelectOption, { accessible: true, accessibilityRole: "radio", isLastOption: i === optionsByCategories[category].length - 1, onPress: function () { return handleOptionPress(option); }, children: [(0, jsx_runtime_1.jsx)(StyledP, { children: (0, jsx_runtime_1.jsx)(Strong_1.Strong, { children: option.label }) }), (0, jsx_runtime_1.jsx)(Radio, { isChecked: selected.value === option.value, children: (0, jsx_runtime_1.jsx)(RadioDot, { isChecked: selected.value === option.value }) })] }, option.label)); })] }, category)); })] }) }) }) })] }));
|
|
94
94
|
};
|
|
95
95
|
exports.Select = Select;
|
|
96
96
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -21,7 +21,7 @@ var SkeletonAnimation = function (_a) {
|
|
|
21
21
|
animationRef.current.setValue(0);
|
|
22
22
|
react_native_1.Animated.loop(animationLoop.current).start();
|
|
23
23
|
}, []);
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { accessibilityRole: "none", accessibilityLabel: "loading...",
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { accessible: false, accessibilityRole: "none", accessibilityLabel: "loading...", testID: testID, children: animation === 'pulse' ? ((0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [
|
|
25
25
|
{
|
|
26
26
|
height: '100%',
|
|
27
27
|
width: '100%',
|
|
@@ -74,6 +74,6 @@ var TabTouchable = styled_native_1.default.TouchableOpacity(function (_a) {
|
|
|
74
74
|
exports.Tab = (0, react_1.forwardRef)(function (_a, ref) {
|
|
75
75
|
var active = _a.active, _b = _a.fullWidth, fullWidth = _b === void 0 ? false : _b, children = _a.children, rest = __rest(_a, ["active", "fullWidth", "children"]);
|
|
76
76
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
77
|
-
return ((0, jsx_runtime_1.jsx)(TabTouchable, __assign({ accessibilityRole: "tab", accessibilityState: { selected: active }, active: active, stretch: fullWidth, ref: ref }, rest, { children: (0, jsx_runtime_1.jsx)(TabText, __assign({ active: active }, breakpoints, { children: children })) })));
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)(TabTouchable, __assign({ accessible: true, accessibilityRole: "tab", accessibilityState: { selected: active }, active: active, stretch: fullWidth, ref: ref }, rest, { children: (0, jsx_runtime_1.jsx)(TabText, __assign({ active: active }, breakpoints, { children: children })) })));
|
|
78
78
|
});
|
|
79
79
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -62,7 +62,7 @@ var StyledTabList = styled_native_1.default.View(function (_a) {
|
|
|
62
62
|
var TabList = function (_a) {
|
|
63
63
|
var children = _a.children, setActiveTab = _a.setActiveTab, activeTab = _a.activeTab, tabRefs = _a.tabRefs, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "setActiveTab", "activeTab", "tabRefs", "fullWidth", "inline"]);
|
|
64
64
|
var validChildren = (0, utils_1.getValidChildren)(children);
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(StyledTabList, __assign({ accessibilityRole: "tablist" }, rest, { children: react_1.Children.map(validChildren, function (child, i) {
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(StyledTabList, __assign({ accessible: true, accessibilityRole: "tablist" }, rest, { children: react_1.Children.map(validChildren, function (child, i) {
|
|
66
66
|
return (0, react_1.cloneElement)(child, {
|
|
67
67
|
onPress: (0, utils_1.callAll)(function () { return setActiveTab && setActiveTab(i); }, child.props.onPress),
|
|
68
68
|
active: activeTab === i,
|
|
@@ -4,7 +4,7 @@ export type HorizontalPosition = 'left' | 'right';
|
|
|
4
4
|
export declare const Toggle: import("react").ForwardRefExoticComponent<Omit<TouchableOpacityProps, "children"> & {
|
|
5
5
|
label?: string | ReactNode;
|
|
6
6
|
checked?: boolean | undefined;
|
|
7
|
+
inline?: boolean | undefined;
|
|
7
8
|
hint?: ReactNode;
|
|
8
9
|
labelPosition?: HorizontalPosition | undefined;
|
|
9
|
-
onChange?: (() => void) | undefined;
|
|
10
10
|
} & import("react").RefAttributes<TouchableOpacity>>;
|
|
@@ -46,11 +46,11 @@ var Input = function (_a) {
|
|
|
46
46
|
}, checked: checked }) }) })));
|
|
47
47
|
};
|
|
48
48
|
exports.Toggle = (0, react_1.forwardRef)(function (_a, ref) {
|
|
49
|
-
var
|
|
49
|
+
var
|
|
50
50
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
51
|
-
|
|
51
|
+
_b = _a.activeOpacity,
|
|
52
52
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
53
|
-
activeOpacity =
|
|
53
|
+
activeOpacity = _b === void 0 ? 0.8 : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, label = _a.label, hint = _a.hint, inline = _a.inline, _d = _a.labelPosition, labelPosition = _d === void 0 ? 'left' : _d, testID = _a.testID, rest = __rest(_a, ["activeOpacity", "checked", "label", "hint", "inline", "labelPosition", "testID"]);
|
|
54
54
|
var hasLabel = label !== undefined;
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledWrapper, __assign({ ref: ref, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked }, hitSlop: 10, hasLabel: hasLabel, labelPosition: labelPosition }, rest, { children: [hasLabel ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexShrink: 1 }, children: [(0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] })) : null, (0, jsx_runtime_1.jsx)(Input, { checked: checked, testID: testID, labelPosition: hasLabel ? labelPosition : undefined })] })));
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledWrapper, __assign({ ref: ref, accessible: true, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked }, hitSlop: 10, hasLabel: hasLabel, labelPosition: labelPosition, inline: inline }, rest, { children: [hasLabel ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexShrink: 1 }, children: [(0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] })) : null, (0, jsx_runtime_1.jsx)(Input, { checked: checked, testID: testID, labelPosition: hasLabel ? labelPosition : undefined })] })));
|
|
56
56
|
});
|
|
@@ -487,6 +487,7 @@ export declare const StyledWrapper: import("styled-components").StyledComponent<
|
|
|
487
487
|
}, {
|
|
488
488
|
hasLabel?: boolean | undefined;
|
|
489
489
|
labelPosition?: HorizontalPosition | undefined;
|
|
490
|
+
inline?: boolean | undefined;
|
|
490
491
|
}, never>;
|
|
491
492
|
export declare const StyledToggleInputWrapper: import("styled-components").StyledComponent<typeof import("react-native").View, {
|
|
492
493
|
core: {
|
|
@@ -8,8 +8,8 @@ var element_core_1 = require("@ovotech/element-core");
|
|
|
8
8
|
var react_native_1 = require("react-native");
|
|
9
9
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
10
10
|
exports.StyledWrapper = styled_native_1.default.TouchableOpacity(function (_a) {
|
|
11
|
-
var core = _a.theme.core, hasLabel = _a.hasLabel, labelPosition = _a.labelPosition;
|
|
12
|
-
return "\n width: ".concat(hasLabel ? '100%' : (0, element_core_1.numToPx)(core.space[11]), ";\n display: flex;\n flex-direction: row").concat(labelPosition === 'left' ? '' : '-reverse', ";\n justify-content: space-between;\n position: relative;\n ");
|
|
11
|
+
var core = _a.theme.core, hasLabel = _a.hasLabel, inline = _a.inline, labelPosition = _a.labelPosition;
|
|
12
|
+
return "\n width: ".concat(hasLabel ? (inline ? undefined : '100%') : (0, element_core_1.numToPx)(core.space[11]), ";\n display: flex;\n flex-direction: row").concat(labelPosition === 'left' ? '' : '-reverse', ";\n justify-content: space-between;\n position: relative;\n ");
|
|
13
13
|
});
|
|
14
14
|
exports.StyledToggleInputWrapper = styled_native_1.default.View(function (_a) {
|
|
15
15
|
var core = _a.theme.core, labelPosition = _a.labelPosition;
|
|
@@ -44,11 +44,11 @@ var ActionList = function (_a) {
|
|
|
44
44
|
};
|
|
45
45
|
var ActionWrapper = forwardRef(function (_a, ref) {
|
|
46
46
|
var children = _a.children, accessibilityRole = _a.accessibilityRole, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.75 : _b, fullWidth = _a.fullWidth, _c = _a.hasBorder, hasBorder = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, _e = _a.inline, inline = _e === void 0 ? false : _e, inList = _a.inList, onPress = _a.onPress, testID = _a.testID, rest = __rest(_a, ["children", "accessibilityRole", "activeOpacity", "fullWidth", "hasBorder", "inverted", "inline", "inList", "onPress", "testID"]);
|
|
47
|
-
return (_jsx(StyledActionWrapper, __assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID }, rest, { children: _jsx(TouchableOpacity, { hitSlop: inline ? 24 : null, activeOpacity: activeOpacity, accessibilityRole: accessibilityRole, onPress: onPress, children: _jsx(StyledActionInner, { fullWidth: fullWidth, inList: inList, inline: inline, children: children }) }) })));
|
|
47
|
+
return (_jsx(StyledActionWrapper, __assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID }, rest, { children: _jsx(TouchableOpacity, { hitSlop: inline ? 24 : null, activeOpacity: activeOpacity, accessible: true, accessibilityRole: accessibilityRole, onPress: onPress, children: _jsx(StyledActionInner, { fullWidth: fullWidth, inList: inList, inline: inline, children: children }) }) })));
|
|
48
48
|
});
|
|
49
49
|
var Action = forwardRef(function (_a, ref) {
|
|
50
50
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'link' : _b, children = _a.children, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, _e = _a.inline, inline = _e === void 0 ? false : _e, onPress = _a.onPress, testID = _a.testID, iconLeft = _a.iconLeft, iconRight = _a.iconRight, rest = __rest(_a, ["accessibilityRole", "children", "fullWidth", "inverted", "inline", "onPress", "testID", "iconLeft", "iconRight"]);
|
|
51
51
|
var smallAndUp = useBreakpoint().smallAndUp;
|
|
52
|
-
return (_jsxs(ActionWrapper, __assign({ ref: ref, accessibilityRole: accessibilityRole, fullWidth: fullWidth, inverted: inverted, inline: inline, onPress: onPress, testID: testID }, rest, { children: [iconLeft ? (_jsx(StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, typeof children === 'string' ? (_jsx(StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, inList: rest === null || rest === void 0 ? void 0 : rest.inList, children: children })) : (_jsx(StyledActionNodeWrapper, { children: children })), iconRight ? (_jsx(StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
|
|
52
|
+
return (_jsxs(ActionWrapper, __assign({ ref: ref, accessible: true, accessibilityRole: accessibilityRole, fullWidth: fullWidth, inverted: inverted, inline: inline, onPress: onPress, testID: testID }, rest, { children: [iconLeft ? (_jsx(StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, typeof children === 'string' ? (_jsx(StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, inList: rest === null || rest === void 0 ? void 0 : rest.inList, children: children })) : (_jsx(StyledActionNodeWrapper, { children: children })), iconRight ? (_jsx(StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
|
|
53
53
|
});
|
|
54
54
|
export { ActionList, Action };
|
|
@@ -33,7 +33,7 @@ import { Icon } from '../Icon/Icon';
|
|
|
33
33
|
var StyledCTAWrapper = styled.TouchableOpacity(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-self: flex-start;\n flex-direction: row;\n align-items: flex-start;\n"], ["\n align-self: flex-start;\n flex-direction: row;\n align-items: flex-start;\n"])));
|
|
34
34
|
var CTAButtonWrapper = function (_a) {
|
|
35
35
|
var children = _a.children, _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'button' : _b, _c = _a.activeOpacity, activeOpacity = _c === void 0 ? 0.8 : _c, rest = __rest(_a, ["children", "accessibilityRole", "activeOpacity"]);
|
|
36
|
-
return (_jsx(StyledCTAWrapper, __assign({ accessibilityRole: accessibilityRole, activeOpacity: activeOpacity }, rest, { children: children })));
|
|
36
|
+
return (_jsx(StyledCTAWrapper, __assign({ accessible: true, accessibilityRole: accessibilityRole, activeOpacity: activeOpacity }, rest, { children: children })));
|
|
37
37
|
};
|
|
38
38
|
var StyledInner = styled.View(function (_a) {
|
|
39
39
|
var _b = _a.theme, core = _b.core, component = _b.component, fullWidth = _a.fullWidth, variant = _a.variant, inverted = _a.inverted;
|
|
@@ -68,7 +68,7 @@ var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTe
|
|
|
68
68
|
var Checkbox = forwardRef(function (_a, ref) {
|
|
69
69
|
var label = _a.label, hint = _a.hint, error = _a.error, checked = _a.checked, optional = _a.optional, invalid = _a.invalid, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "error", "checked", "optional", "invalid", "activeOpacity", "testID"]);
|
|
70
70
|
var hasError = !!error;
|
|
71
|
-
return (_jsx(FormGroup, { error: hasError, children: _jsxs(Stack, { spaceBetween: 1, children: [error ? _jsx(ErrorText, { children: error }) : null, _jsx(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { children: [_jsx(Input, { checked: checked, invalid: hasError || invalid, testID: testID }), _jsxs(View, { style: { flexShrink: 1 }, children: [_jsxs(CheckLabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null] })] }) }))] }) }));
|
|
71
|
+
return (_jsx(FormGroup, { error: hasError, children: _jsxs(Stack, { spaceBetween: 1, children: [error ? _jsx(ErrorText, { children: error }) : null, _jsx(TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { children: [_jsx(Input, { checked: checked, invalid: hasError || invalid, testID: testID }), _jsxs(View, { style: { flexShrink: 1 }, children: [_jsxs(CheckLabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null] })] }) }))] }) }));
|
|
72
72
|
});
|
|
73
73
|
export { Checkbox };
|
|
74
74
|
var templateObject_1;
|
|
@@ -41,6 +41,6 @@ var StyledHeading1 = styled.Text(function (_a) {
|
|
|
41
41
|
export var Heading1 = function (_a) {
|
|
42
42
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
43
43
|
var breakpoints = useBreakpoint();
|
|
44
|
-
return (_jsx(StyledHeading1, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
44
|
+
return (_jsx(StyledHeading1, __assign({ accessible: true, accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
45
45
|
};
|
|
46
46
|
var templateObject_1;
|
|
@@ -41,6 +41,6 @@ var StyledHeading2 = styled.Text(function (_a) {
|
|
|
41
41
|
export var Heading2 = function (_a) {
|
|
42
42
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
43
43
|
var breakpoints = useBreakpoint();
|
|
44
|
-
return (_jsx(StyledHeading2, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
44
|
+
return (_jsx(StyledHeading2, __assign({ accessible: true, accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
45
45
|
};
|
|
46
46
|
var templateObject_1;
|
|
@@ -41,6 +41,6 @@ var StyledHeading3 = styled.Text(function (_a) {
|
|
|
41
41
|
export var Heading3 = function (_a) {
|
|
42
42
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
43
43
|
var breakpoints = useBreakpoint();
|
|
44
|
-
return (_jsx(StyledHeading3, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
44
|
+
return (_jsx(StyledHeading3, __assign({ accessible: true, accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
45
45
|
};
|
|
46
46
|
var templateObject_1;
|
|
@@ -41,6 +41,6 @@ var StyledHeading4 = styled.Text(function (_a) {
|
|
|
41
41
|
export var Heading4 = function (_a) {
|
|
42
42
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
43
43
|
var breakpoints = useBreakpoint();
|
|
44
|
-
return (_jsx(StyledHeading4, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
44
|
+
return (_jsx(StyledHeading4, __assign({ accessible: true, accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
45
45
|
};
|
|
46
46
|
var templateObject_1;
|
|
@@ -15,7 +15,7 @@ export var useTogglePasswordVisibility = function () {
|
|
|
15
15
|
export var PasswordVisibilityToggle = function (_a) {
|
|
16
16
|
var iconName = _a.iconName, visibilityToggleLabel = _a.visibilityToggleLabel, handlePasswordVisibility = _a.handlePasswordVisibility;
|
|
17
17
|
var _b = useState(false), focused = _b[0], setFocused = _b[1];
|
|
18
|
-
return (_jsx(StyledPressable, { testID: "password-input-visibility-toggle", focused: focused, accessibilityRole: "button", accessibilityLabel: visibilityToggleLabel, onPress: handlePasswordVisibility, hitSlop: 16, onFocus: function () {
|
|
18
|
+
return (_jsx(StyledPressable, { testID: "password-input-visibility-toggle", focused: focused, accessible: true, accessibilityRole: "button", accessibilityLabel: visibilityToggleLabel, onPress: handlePasswordVisibility, hitSlop: 16, onFocus: function () {
|
|
19
19
|
setFocused(true);
|
|
20
20
|
}, onBlur: function () {
|
|
21
21
|
setFocused(false);
|
|
@@ -57,6 +57,6 @@ var Radio = forwardRef(function (_a, ref) {
|
|
|
57
57
|
value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
58
58
|
_b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
59
59
|
activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
|
|
60
|
-
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { children: [_jsx(Input, { checked: checked, invalid: invalid, testID: testID }), _jsxs(View, { style: { flexShrink: 1 }, children: [_jsx(LabelText, { children: label }), hint ? _jsx(HintText, { children: hint }) : null] })] }) })));
|
|
60
|
+
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { children: [_jsx(Input, { checked: checked, invalid: invalid, testID: testID }), _jsxs(View, { style: { flexShrink: 1 }, children: [_jsx(LabelText, { children: label }), hint ? _jsx(HintText, { children: hint }) : null] })] }) })));
|
|
61
61
|
});
|
|
62
62
|
export { Radio };
|
|
@@ -33,7 +33,7 @@ var RadioField = function (_a) {
|
|
|
33
33
|
var label = _a.label, hint = _a.hint, error = _a.error, children = _a.children, _b = _a.optional, optional = _b === void 0 ? false : _b, value = _a.value, onValueChange = _a.onValueChange, rest = __rest(_a, ["label", "hint", "error", "children", "optional", "value", "onValueChange"]);
|
|
34
34
|
var hasError = !!error;
|
|
35
35
|
var validChildren = getValidChildren(children);
|
|
36
|
-
return (_jsx(FormGroup, __assign({}, rest, { error: hasError, children: _jsxs(Stack, { spaceBetween: 1, children: [_jsxs(View, { children: [_jsxs(LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null, error ? _jsx(ErrorText, { children: error }) : null] }), _jsx(View, { accessibilityRole: "radiogroup", children: Children.map(validChildren, function (child) {
|
|
36
|
+
return (_jsx(FormGroup, __assign({}, rest, { error: hasError, children: _jsxs(Stack, { spaceBetween: 1, children: [_jsxs(View, { children: [_jsxs(LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null, error ? _jsx(ErrorText, { children: error }) : null] }), _jsx(View, { accessible: true, accessibilityRole: "radiogroup", children: Children.map(validChildren, function (child) {
|
|
37
37
|
return cloneElement(child, {
|
|
38
38
|
invalid: hasError ? true : child.props.invalid,
|
|
39
39
|
checked: child.props.checked != null
|
|
@@ -61,6 +61,6 @@ var StyledWrapper = styled.View(function (_a) {
|
|
|
61
61
|
});
|
|
62
62
|
export var RadioCard = forwardRef(function (_a, ref) {
|
|
63
63
|
var label = _a.label, checked = _a.checked, invalid = _a.invalid, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, _c = _a.hasInput, hasInput = _c === void 0 ? true : _c, rest = __rest(_a, ["label", "checked", "invalid", "activeOpacity", "testID", "hasInput"]);
|
|
64
|
-
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { checked: checked, invalid: invalid, children: [typeof label === 'string' ? _jsx(LabelText, { children: label }) : label, hasInput ? (_jsx(Input, { checked: checked, invalid: invalid, testID: testID })) : null] }) })));
|
|
64
|
+
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { checked: checked, invalid: invalid, children: [typeof label === 'string' ? _jsx(LabelText, { children: label }) : label, hasInput ? (_jsx(Input, { checked: checked, invalid: invalid, testID: testID })) : null] }) })));
|
|
65
65
|
});
|
|
66
66
|
var templateObject_1;
|
|
@@ -53,7 +53,7 @@ export var SegmentedControls = function (_a) {
|
|
|
53
53
|
}); }, [animatedX, animatedY, animatedWidth, animatedHeight]);
|
|
54
54
|
return (_jsxs(SegmentsContainer, __assign({ "$inline": inline, "$multipleRows": multipleRows }, rest, { children: [_jsx(Animated.View, { style: animatedBackgroundStyle }), segments.map(function (segment) {
|
|
55
55
|
var _a;
|
|
56
|
-
return (_jsx(SegmentButton, { isSelected: activeSegment.key === segment.key, label: segment.label, accessibilityLabel: segment.accessibilityLabel, onPress: function (x, y, width) {
|
|
56
|
+
return (_jsx(SegmentButton, { isSelected: activeSegment.key === segment.key, isLast: segments[segments.length - 1].key === segment.key, label: segment.label, accessibilityLabel: segment.accessibilityLabel, onPress: function (x, y, width) {
|
|
57
57
|
setActiveSegment(segment);
|
|
58
58
|
animatedX.value = withSpring(x, springSettings);
|
|
59
59
|
animatedY.value = withSpring(y, springSettings);
|
|
@@ -6,7 +6,7 @@ import styled from '../../../styled.native';
|
|
|
6
6
|
import { P } from '../../P';
|
|
7
7
|
var AnimatedP = Animated.createAnimatedComponent(P);
|
|
8
8
|
export var SegmentButton = function (_a) {
|
|
9
|
-
var accessibilityLabel = _a.accessibilityLabel, inline = _a.inline, isSelected = _a.isSelected, label = _a.label, multipleRows = _a.multipleRows, onLayout = _a.onLayout, onPress = _a.onPress, _b = _a.size, size = _b === void 0 ? 'large' : _b, testID = _a.testID;
|
|
9
|
+
var accessibilityLabel = _a.accessibilityLabel, inline = _a.inline, isLast = _a.isLast, isSelected = _a.isSelected, label = _a.label, multipleRows = _a.multipleRows, onLayout = _a.onLayout, onPress = _a.onPress, _b = _a.size, size = _b === void 0 ? 'large' : _b, testID = _a.testID;
|
|
10
10
|
var xRef = useRef(0);
|
|
11
11
|
var yRef = useRef(0);
|
|
12
12
|
var widthRef = useRef(0);
|
|
@@ -28,12 +28,16 @@ export var SegmentButton = function (_a) {
|
|
|
28
28
|
useEffect(function () {
|
|
29
29
|
fontWeightAnim.value = withTiming(isSelected ? 1 : 0);
|
|
30
30
|
}, [fontWeightAnim, isSelected]);
|
|
31
|
+
// strange discrepancy with the last segment not reaching the end of the container
|
|
32
|
+
var adjustLastSegmentWidth = function (width) {
|
|
33
|
+
return isLast && size === 'large' ? width + 2 : width;
|
|
34
|
+
};
|
|
31
35
|
var handleLayout = function (event) {
|
|
32
36
|
var _a = event.nativeEvent.layout, width = _a.width, height = _a.height, x = _a.x, y = _a.y;
|
|
33
37
|
xRef.current = x;
|
|
34
38
|
yRef.current = y;
|
|
35
39
|
heightRef.current = height;
|
|
36
|
-
widthRef.current = width;
|
|
40
|
+
widthRef.current = adjustLastSegmentWidth(width);
|
|
37
41
|
onLayout(width, height, x, y);
|
|
38
42
|
};
|
|
39
43
|
var handlePress = function () {
|
|
@@ -42,9 +46,9 @@ export var SegmentButton = function (_a) {
|
|
|
42
46
|
// choices go on the second row. The only way I could get it to work
|
|
43
47
|
// was to hardcode the denominator to 3 for the single row ones
|
|
44
48
|
// and 1.1 for the multiple row ones.
|
|
45
|
-
yRef.current - heightRef.current / (multipleRows ? 1.1 : 3), widthRef.current);
|
|
49
|
+
yRef.current - heightRef.current / (multipleRows ? 1.1 : 3), adjustLastSegmentWidth(widthRef.current));
|
|
46
50
|
};
|
|
47
|
-
return (_jsx(Pressable, { onLayout: handleLayout, onPress: handlePress, accessible: true, accessibilityRole: "checkbox", accessibilityState: { selected: isSelected }, accessibilityLabel: accessibilityLabel, hitSlop: {
|
|
51
|
+
return (_jsx(Pressable, { onLayout: handleLayout, onPress: handlePress, accessible: true, accessibilityRole: "checkbox", accessibilityState: { selected: isSelected }, accessibilityLabel: accessibilityLabel || label, hitSlop: {
|
|
48
52
|
top: hitslopVal,
|
|
49
53
|
bottom: hitslopVal,
|
|
50
54
|
}, style: { flexGrow: inline || multipleRows ? undefined : 1 }, testID: testID, children: _jsxs(SSegmentsWrapper, { "$isSelected": isSelected, "$size": size, children: [_jsx(SSegmentText, { style: {
|
|
@@ -61,6 +61,6 @@ export var Select = function (_a) {
|
|
|
61
61
|
label: "-- ".concat(noOptionMessage, " --"),
|
|
62
62
|
value: 'default',
|
|
63
63
|
};
|
|
64
|
-
return (_jsxs(View, { children: [_jsxs(SelectInput, { testID: testID, hasError: hasError, onPress: function () { return setOpen(!isOpen); }, children: [_jsx(P, { style: { marginTop: 0, marginBottom: 0 }, children: selected.value === 'default' ? '' : selected.label }), _jsx(Icon, { name: "chevron-down", size: 16, style: { marginLeft: 'auto' } })] }), _jsx(Modal, { transparent: true, visible: isOpen, animationType: "fade", onRequestClose: function () { return setOpen(false); }, children: _jsx(DropdownWrapper, { children: _jsx(DropdownContainer, { children: _jsxs(ScrollView, { nestedScrollEnabled: true, children: [_jsxs(SelectOption, { accessibilityRole: "radio", onPress: function () { return handleOptionPress(requiredOption); }, children: [_jsx(StyledP, { children: _jsx(Strong, { children: requiredOption.label }) }), _jsx(Radio, { isChecked: selected.value === requiredOption.value, children: _jsx(RadioDot, { isChecked: selected.value === requiredOption.value }) })] }), Object.keys(optionsByCategories).map(function (category) { return (_jsxs(Fragment, { children: [category !== 'undefined' ? (_jsx(StyledCategory, { children: category })) : null, optionsByCategories[category].map(function (option, i) { return (_jsxs(SelectOption, { accessibilityRole: "radio", isLastOption: i === optionsByCategories[category].length - 1, onPress: function () { return handleOptionPress(option); }, children: [_jsx(StyledP, { children: _jsx(Strong, { children: option.label }) }), _jsx(Radio, { isChecked: selected.value === option.value, children: _jsx(RadioDot, { isChecked: selected.value === option.value }) })] }, option.label)); })] }, category)); })] }) }) }) })] }));
|
|
64
|
+
return (_jsxs(View, { children: [_jsxs(SelectInput, { testID: testID, hasError: hasError, onPress: function () { return setOpen(!isOpen); }, children: [_jsx(P, { style: { marginTop: 0, marginBottom: 0 }, children: selected.value === 'default' ? '' : selected.label }), _jsx(Icon, { name: "chevron-down", size: 16, style: { marginLeft: 'auto' } })] }), _jsx(Modal, { transparent: true, visible: isOpen, animationType: "fade", onRequestClose: function () { return setOpen(false); }, children: _jsx(DropdownWrapper, { children: _jsx(DropdownContainer, { children: _jsxs(ScrollView, { nestedScrollEnabled: true, children: [_jsxs(SelectOption, { accessible: true, accessibilityRole: "radio", onPress: function () { return handleOptionPress(requiredOption); }, children: [_jsx(StyledP, { children: _jsx(Strong, { children: requiredOption.label }) }), _jsx(Radio, { isChecked: selected.value === requiredOption.value, children: _jsx(RadioDot, { isChecked: selected.value === requiredOption.value }) })] }), Object.keys(optionsByCategories).map(function (category) { return (_jsxs(Fragment, { children: [category !== 'undefined' ? (_jsx(StyledCategory, { children: category })) : null, optionsByCategories[category].map(function (option, i) { return (_jsxs(SelectOption, { accessible: true, accessibilityRole: "radio", isLastOption: i === optionsByCategories[category].length - 1, onPress: function () { return handleOptionPress(option); }, children: [_jsx(StyledP, { children: _jsx(Strong, { children: option.label }) }), _jsx(Radio, { isChecked: selected.value === option.value, children: _jsx(RadioDot, { isChecked: selected.value === option.value }) })] }, option.label)); })] }, category)); })] }) }) }) })] }));
|
|
65
65
|
};
|
|
66
66
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -18,7 +18,7 @@ export var SkeletonAnimation = function (_a) {
|
|
|
18
18
|
animationRef.current.setValue(0);
|
|
19
19
|
Animated.loop(animationLoop.current).start();
|
|
20
20
|
}, []);
|
|
21
|
-
return (_jsx(View, { accessibilityRole: "none", accessibilityLabel: "loading...",
|
|
21
|
+
return (_jsx(View, { accessible: false, accessibilityRole: "none", accessibilityLabel: "loading...", testID: testID, children: animation === 'pulse' ? (_jsx(Animated.View, { style: [
|
|
22
22
|
{
|
|
23
23
|
height: '100%',
|
|
24
24
|
width: '100%',
|
|
@@ -48,6 +48,6 @@ var TabTouchable = styled.TouchableOpacity(function (_a) {
|
|
|
48
48
|
export var Tab = forwardRef(function (_a, ref) {
|
|
49
49
|
var active = _a.active, _b = _a.fullWidth, fullWidth = _b === void 0 ? false : _b, children = _a.children, rest = __rest(_a, ["active", "fullWidth", "children"]);
|
|
50
50
|
var breakpoints = useBreakpoint();
|
|
51
|
-
return (_jsx(TabTouchable, __assign({ accessibilityRole: "tab", accessibilityState: { selected: active }, active: active, stretch: fullWidth, ref: ref }, rest, { children: _jsx(TabText, __assign({ active: active }, breakpoints, { children: children })) })));
|
|
51
|
+
return (_jsx(TabTouchable, __assign({ accessible: true, accessibilityRole: "tab", accessibilityState: { selected: active }, active: active, stretch: fullWidth, ref: ref }, rest, { children: _jsx(TabText, __assign({ active: active }, breakpoints, { children: children })) })));
|
|
52
52
|
});
|
|
53
53
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -36,7 +36,7 @@ var StyledTabList = styled.View(function (_a) {
|
|
|
36
36
|
export var TabList = function (_a) {
|
|
37
37
|
var children = _a.children, setActiveTab = _a.setActiveTab, activeTab = _a.activeTab, tabRefs = _a.tabRefs, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "setActiveTab", "activeTab", "tabRefs", "fullWidth", "inline"]);
|
|
38
38
|
var validChildren = getValidChildren(children);
|
|
39
|
-
return (_jsx(StyledTabList, __assign({ accessibilityRole: "tablist" }, rest, { children: Children.map(validChildren, function (child, i) {
|
|
39
|
+
return (_jsx(StyledTabList, __assign({ accessible: true, accessibilityRole: "tablist" }, rest, { children: Children.map(validChildren, function (child, i) {
|
|
40
40
|
return cloneElement(child, {
|
|
41
41
|
onPress: callAll(function () { return setActiveTab && setActiveTab(i); }, child.props.onPress),
|
|
42
42
|
active: activeTab === i,
|
|
@@ -43,11 +43,11 @@ var Input = function (_a) {
|
|
|
43
43
|
}, checked: checked }) }) })));
|
|
44
44
|
};
|
|
45
45
|
export var Toggle = forwardRef(function (_a, ref) {
|
|
46
|
-
var
|
|
46
|
+
var
|
|
47
47
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
48
|
-
|
|
48
|
+
_b = _a.activeOpacity,
|
|
49
49
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
50
|
-
activeOpacity =
|
|
50
|
+
activeOpacity = _b === void 0 ? 0.8 : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, label = _a.label, hint = _a.hint, inline = _a.inline, _d = _a.labelPosition, labelPosition = _d === void 0 ? 'left' : _d, testID = _a.testID, rest = __rest(_a, ["activeOpacity", "checked", "label", "hint", "inline", "labelPosition", "testID"]);
|
|
51
51
|
var hasLabel = label !== undefined;
|
|
52
|
-
return (_jsxs(StyledWrapper, __assign({ ref: ref, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked }, hitSlop: 10, hasLabel: hasLabel, labelPosition: labelPosition }, rest, { children: [hasLabel ? (_jsxs(View, { style: { flexShrink: 1 }, children: [_jsx(LabelText, { children: label }), hint ? _jsx(HintText, { children: hint }) : null] })) : null, _jsx(Input, { checked: checked, testID: testID, labelPosition: hasLabel ? labelPosition : undefined })] })));
|
|
52
|
+
return (_jsxs(StyledWrapper, __assign({ ref: ref, accessible: true, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked }, hitSlop: 10, hasLabel: hasLabel, labelPosition: labelPosition, inline: inline }, rest, { children: [hasLabel ? (_jsxs(View, { style: { flexShrink: 1 }, children: [_jsx(LabelText, { children: label }), hint ? _jsx(HintText, { children: hint }) : null] })) : null, _jsx(Input, { checked: checked, testID: testID, labelPosition: hasLabel ? labelPosition : undefined })] })));
|
|
53
53
|
});
|
|
@@ -2,8 +2,8 @@ import { numToPx } from '@ovotech/element-core';
|
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
3
|
import styled from '../../styled.native';
|
|
4
4
|
export var StyledWrapper = styled.TouchableOpacity(function (_a) {
|
|
5
|
-
var core = _a.theme.core, hasLabel = _a.hasLabel, labelPosition = _a.labelPosition;
|
|
6
|
-
return "\n width: ".concat(hasLabel ? '100%' : numToPx(core.space[11]), ";\n display: flex;\n flex-direction: row").concat(labelPosition === 'left' ? '' : '-reverse', ";\n justify-content: space-between;\n position: relative;\n ");
|
|
5
|
+
var core = _a.theme.core, hasLabel = _a.hasLabel, inline = _a.inline, labelPosition = _a.labelPosition;
|
|
6
|
+
return "\n width: ".concat(hasLabel ? (inline ? undefined : '100%') : numToPx(core.space[11]), ";\n display: flex;\n flex-direction: row").concat(labelPosition === 'left' ? '' : '-reverse', ";\n justify-content: space-between;\n position: relative;\n ");
|
|
7
7
|
});
|
|
8
8
|
export var StyledToggleInputWrapper = styled.View(function (_a) {
|
|
9
9
|
var core = _a.theme.core, labelPosition = _a.labelPosition;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovotech/element-native",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1-canary-20993f2-269",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@backpackapp-io/react-native-toast": "^0.10.0",
|
|
17
|
+
"@ovotech/element-core": "3.0.1-canary-20993f2-269",
|
|
17
18
|
"deepmerge": "^4.2.2",
|
|
18
19
|
"lodash.groupby": "^4.6.0",
|
|
19
|
-
"react-native-reanimated-carousel": "^3.5.1"
|
|
20
|
-
"@ovotech/element-core": "3.0.1"
|
|
20
|
+
"react-native-reanimated-carousel": "^3.5.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@babel/core": "^7.11.5",
|