@ovotech/element-native 2.0.3 → 2.1.0
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/Accordion/Accordion.js +5 -5
- package/dist/components/Accordion/types.d.ts +1 -0
- package/dist/components/Badge/Badge.d.ts +1 -0
- package/dist/components/Badge/Badge.js +6 -4
- package/dist/components/CTALink/CTALink.d.ts +3 -4
- package/dist/components/Checkbox/Checkbox.js +5 -7
- package/dist/components/Divider/Divider.d.ts +5 -0
- package/dist/components/Divider/Divider.js +45 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Divider/index.js +5 -0
- package/dist/components/Grid/Col.d.ts +1 -1
- package/dist/components/Input/CurrencyInput.d.ts +2 -1
- package/dist/components/Input/EmailInput.d.ts +2 -1
- package/dist/components/Input/Input.d.ts +3 -1
- package/dist/components/Input/Input.js +6 -5
- package/dist/components/Input/NumberInput.d.ts +2 -1
- package/dist/components/Input/PasswordInput.d.ts +4 -1
- package/dist/components/Input/PasswordInput.js +4 -2
- package/dist/components/Input/PasswordInput.styled.d.ts +4 -0
- package/dist/components/Input/PasswordInput.styled.js +40 -0
- package/dist/components/Input/PasswordVisibilityToggle.d.ts +11 -0
- package/dist/components/Input/PasswordVisibilityToggle.js +54 -0
- package/dist/components/Input/TelInput.d.ts +2 -1
- package/dist/components/Input/TextInput.d.ts +2 -1
- package/dist/components/Input/TextareaInput.d.ts +2 -1
- package/dist/components/List/List.js +1 -1
- package/dist/components/NavHeader/NavHeader.d.ts +1 -0
- package/dist/components/NavHeader/NavHeader.js +8 -10
- package/dist/components/Radio/Radio.js +5 -7
- package/dist/components/SkeletonLoading/SkeletonAnimation.d.ts +6 -0
- package/dist/components/SkeletonLoading/SkeletonAnimation.js +57 -0
- package/dist/components/SkeletonLoading/SkeletonCTA.js +3 -1
- package/dist/components/SkeletonLoading/SkeletonCircle.js +4 -2
- package/dist/components/SkeletonLoading/SkeletonHeading.js +3 -1
- package/dist/components/SkeletonLoading/SkeletonText.js +2 -2
- package/dist/components/TextField/CurrencyField.d.ts +2 -1
- package/dist/components/TextField/EmailField.d.ts +2 -1
- package/dist/components/TextField/NumberField.d.ts +2 -1
- package/dist/components/TextField/PasswordField.d.ts +4 -1
- package/dist/components/TextField/PasswordField.js +2 -2
- package/dist/components/TextField/TelField.d.ts +2 -1
- package/dist/components/TextField/TextField.d.ts +2 -1
- package/dist/components/TextField/TextareaField.d.ts +2 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/components/Accordion/Accordion.js +6 -6
- package/dist/esm/components/Badge/Badge.js +6 -4
- package/dist/esm/components/Checkbox/Checkbox.js +5 -7
- package/dist/esm/components/Divider/Divider.js +15 -0
- package/dist/esm/components/Divider/index.js +1 -0
- package/dist/esm/components/Input/Input.js +6 -5
- package/dist/esm/components/Input/PasswordInput.js +4 -2
- package/dist/esm/components/Input/PasswordInput.styled.js +14 -0
- package/dist/esm/components/Input/PasswordVisibilityToggle.js +26 -0
- package/dist/esm/components/List/List.js +1 -1
- package/dist/esm/components/NavHeader/NavHeader.js +9 -11
- package/dist/esm/components/Radio/Radio.js +5 -7
- package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +30 -0
- package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +3 -1
- package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +4 -2
- package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +3 -1
- package/dist/esm/components/SkeletonLoading/SkeletonText.js +2 -2
- package/dist/esm/components/TextField/PasswordField.js +2 -2
- package/dist/esm/components/index.js +1 -0
- package/package.json +6 -7
|
@@ -82,7 +82,7 @@ var Accordion = function (_a) {
|
|
|
82
82
|
headingComponent,
|
|
83
83
|
]);
|
|
84
84
|
var _d = (0, hooks_1.useLayout)(0), layout = _d[0], onLayout = _d[1];
|
|
85
|
-
var
|
|
85
|
+
var _e = (0, react_1.useState)(expanded), open = _e[0], setOpen = _e[1];
|
|
86
86
|
var handleHeightContent = (0, react_1.useMemo)(function () { return layout.height || 100; }, [
|
|
87
87
|
layout.height,
|
|
88
88
|
]);
|
|
@@ -103,19 +103,19 @@ var Accordion = function (_a) {
|
|
|
103
103
|
}
|
|
104
104
|
})();
|
|
105
105
|
}, [handleHeightContent, size]);
|
|
106
|
-
var progress = (0, react_native_reanimated_1.useDerivedValue)(function () { return (0, react_native_reanimated_1.withTiming)(open
|
|
106
|
+
var progress = (0, react_native_reanimated_1.useDerivedValue)(function () { return (0, react_native_reanimated_1.withTiming)(open ? 1 : 0); });
|
|
107
107
|
var style = (0, react_native_reanimated_1.useAnimatedStyle)(function () { return ({
|
|
108
108
|
height: size.value * progress.value + 1,
|
|
109
109
|
}); });
|
|
110
110
|
var toggleOpen = (0, react_1.useCallback)(function () {
|
|
111
|
-
onToggle === null || onToggle === void 0 ? void 0 : onToggle(!open
|
|
111
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(!open);
|
|
112
112
|
if (size.value === 0) {
|
|
113
113
|
(0, react_native_reanimated_1.runOnUI)(function () {
|
|
114
114
|
'worklet';
|
|
115
115
|
size.value = handleHeightContent;
|
|
116
116
|
})();
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
setOpen(function (o) { return !o; });
|
|
119
119
|
}, [handleHeightContent, open, size]);
|
|
120
120
|
var containerAnimatedStyle = (0, react_1.useMemo)(function () { return [styles_1.styles.content, style]; }, [style]);
|
|
121
121
|
var headerStyle = (0, react_native_reanimated_1.useAnimatedStyle)(function () { return ({
|
|
@@ -130,7 +130,7 @@ var Accordion = function (_a) {
|
|
|
130
130
|
first ? styles_1.styles.topItem : null,
|
|
131
131
|
last ? styles_1.styles.bottomItem : null,
|
|
132
132
|
] },
|
|
133
|
-
react_1.default.createElement(react_native_1.TouchableOpacity, { accessibilityState: { expanded:
|
|
133
|
+
react_1.default.createElement(react_native_1.TouchableOpacity, { accessibilityState: { expanded: open }, onPress: toggleOpen, style: styles_1.styles.accordionHeader, testID: "accordionTitle" },
|
|
134
134
|
react_1.default.createElement(AnimatedHeading, { style: [headerStyle, styles_1.styles.accordionHeaderText] }, title),
|
|
135
135
|
react_1.default.createElement(Icon_1.AccordionIcon, { animationTiming: progress })),
|
|
136
136
|
react_1.default.createElement(react_native_reanimated_1.default.View, { style: containerAnimatedStyle },
|
|
@@ -6,6 +6,7 @@ export declare type BadgeVariant = {
|
|
|
6
6
|
};
|
|
7
7
|
declare const StyledBadge: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme, {
|
|
8
8
|
variant?: BadgeVariantName | (string & {}) | undefined;
|
|
9
|
+
inverted?: boolean | undefined;
|
|
9
10
|
}, never>;
|
|
10
11
|
declare type BadgeProps = ComponentProps<typeof StyledBadge>;
|
|
11
12
|
export declare const Badge: ({ children, variant, ...rest }: BadgeProps) => JSX.Element;
|
|
@@ -58,16 +58,18 @@ var hooks_1 = require("../../hooks");
|
|
|
58
58
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
59
59
|
var theme_1 = require("../../theme");
|
|
60
60
|
var StyledBadge = styled_native_1.default.View(function (_a) {
|
|
61
|
-
var badge = _a.theme.badge, _b = _a.variant, variant = _b === void 0 ? 'default' : _b;
|
|
61
|
+
var badge = _a.theme.badge, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.inverted, inverted = _c === void 0 ? false : _c;
|
|
62
62
|
// @ts-ignore to support additional palettes.
|
|
63
63
|
var currentVariant = badge.variants[variant];
|
|
64
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 ", ";\n border-radius: ", ";\n background-color: ", ";\n align-self: flex-start;\n "], ["\n padding: 0 ", ";\n border-radius: ", ";\n background-color: ", ";\n align-self: flex-start;\n "])), badge.paddingHorizontal, badge.borderRadius,
|
|
64
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 ", ";\n border-radius: ", ";\n background-color: ", ";\n align-self: flex-start;\n "], ["\n padding: 0 ", ";\n border-radius: ", ";\n background-color: ", ";\n align-self: flex-start;\n "])), badge.paddingHorizontal, badge.borderRadius, inverted
|
|
65
|
+
? currentVariant.foreground
|
|
66
|
+
: currentVariant.background);
|
|
65
67
|
});
|
|
66
68
|
var StyledBadgeText = styled_native_1.default.Text(function (_a) {
|
|
67
|
-
var badge = _a.theme.badge, _b = _a.variant, variant = _b === void 0 ? 'default' : _b;
|
|
69
|
+
var badge = _a.theme.badge, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.inverted, inverted = _c === void 0 ? false : _c;
|
|
68
70
|
// @ts-ignore to support additional palettes.
|
|
69
71
|
var currentVariant = badge.variants[variant];
|
|
70
|
-
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), badge.fontFamily, badge.fontWeight, (0, theme_1.calculateLineHeight)(badge.fontSize[1], badge.lineHeight), currentVariant.foreground, badge.fontSize[1]);
|
|
72
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), badge.fontFamily, badge.fontWeight, (0, theme_1.calculateLineHeight)(badge.fontSize[1], badge.lineHeight), inverted ? currentVariant.background : currentVariant.foreground, badge.fontSize[1]);
|
|
71
73
|
});
|
|
72
74
|
var Badge = function (_a) {
|
|
73
75
|
var children = _a.children, variant = _a.variant, rest = __rest(_a, ["children", "variant"]);
|
|
@@ -3,10 +3,9 @@ import { TouchableOpacity } from 'react-native';
|
|
|
3
3
|
import { CTAButton } from '../CTAButton';
|
|
4
4
|
declare type CTALinkProps = Omit<ComponentProps<typeof CTAButton>, 'ref'> & {
|
|
5
5
|
ref: Ref<TouchableOpacity>;
|
|
6
|
-
opensInNewWindow?: boolean;
|
|
7
6
|
};
|
|
8
|
-
declare const CTALink: React.ForwardRefExoticComponent<Pick<CTALinkProps, "variant" | "fullWidth" | "iconLeft" | "iconRight" | keyof import("react-native").TouchableOpacityProps
|
|
7
|
+
declare const CTALink: React.ForwardRefExoticComponent<Pick<CTALinkProps, "variant" | "fullWidth" | "iconLeft" | "iconRight" | keyof import("react-native/types").TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
9
8
|
declare type CTAProps = Omit<ComponentProps<typeof CTALink>, 'variant'>;
|
|
10
|
-
declare const PrimaryCTALink: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "key" | "iconLeft" | "iconRight" | keyof import("react-native").TouchableOpacityProps
|
|
11
|
-
declare const SecondaryCTALink: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "key" | "iconLeft" | "iconRight" | keyof import("react-native").TouchableOpacityProps
|
|
9
|
+
declare const PrimaryCTALink: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "key" | "iconLeft" | "iconRight" | keyof import("react-native/types").TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
10
|
+
declare const SecondaryCTALink: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "key" | "iconLeft" | "iconRight" | keyof import("react-native/types").TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
12
11
|
export { CTALink, PrimaryCTALink, SecondaryCTALink };
|
|
@@ -90,9 +90,9 @@ var StyledCheckboxInputCheck = (0, styled_native_1.default)(CheckboxCheck)(funct
|
|
|
90
90
|
return "\n margin-top: ".concat(checkDistance, "px;\n margin-left: ").concat(checkDistance, "px;\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
91
91
|
});
|
|
92
92
|
var Input = function (_a) {
|
|
93
|
-
var checked = _a.checked, invalid = _a.invalid, rest = __rest(_a, ["checked", "invalid"]);
|
|
93
|
+
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
94
94
|
return (react_1.default.createElement(StyledCheckboxInputWrapper, __assign({}, rest),
|
|
95
|
-
react_1.default.createElement(StyledCheckboxInput, { invalid: invalid, checked: checked },
|
|
95
|
+
react_1.default.createElement(StyledCheckboxInput, { invalid: invalid, checked: checked, testID: testID },
|
|
96
96
|
react_1.default.createElement(StyledCheckboxInputCheck, { checked: checked }))));
|
|
97
97
|
};
|
|
98
98
|
var CheckLabelText = (0, styled_native_1.default)(LabelText_1.LabelText)(function (_a) {
|
|
@@ -101,16 +101,14 @@ var CheckLabelText = (0, styled_native_1.default)(LabelText_1.LabelText)(functio
|
|
|
101
101
|
});
|
|
102
102
|
var StyledWrapper = styled_native_1.default.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
103
103
|
var Checkbox = (0, react_1.forwardRef)(function (_a, ref) {
|
|
104
|
-
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, rest = __rest(_a, ["label", "hint", "error", "checked", "optional", "invalid", "activeOpacity"]);
|
|
104
|
+
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"]);
|
|
105
105
|
var hasError = !!error;
|
|
106
106
|
return (react_1.default.createElement(FormGroup_1.FormGroup, { error: hasError },
|
|
107
107
|
react_1.default.createElement(Stack_1.Stack, { spaceBetween: 1 },
|
|
108
108
|
error ? react_1.default.createElement(ErrorText_1.ErrorText, null, error) : null,
|
|
109
|
-
react_1.default.createElement(react_native_1.TouchableOpacity, __assign({ ref: ref, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked },
|
|
110
|
-
// @ts-ignore
|
|
111
|
-
invalid: hasError || invalid }, rest),
|
|
109
|
+
react_1.default.createElement(react_native_1.TouchableOpacity, __assign({ ref: ref, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest),
|
|
112
110
|
react_1.default.createElement(StyledWrapper, null,
|
|
113
|
-
react_1.default.createElement(Input, { checked: checked, invalid: hasError || invalid }),
|
|
111
|
+
react_1.default.createElement(Input, { checked: checked, invalid: hasError || invalid, testID: testID }),
|
|
114
112
|
react_1.default.createElement(react_native_1.View, { style: { flexShrink: 1 } },
|
|
115
113
|
react_1.default.createElement(CheckLabelText, null,
|
|
116
114
|
label,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.Divider = void 0;
|
|
34
|
+
var react_1 = __importDefault(require("react"));
|
|
35
|
+
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
36
|
+
var StyledDivider = styled_native_1.default.View(function (_a) {
|
|
37
|
+
var colors = _a.theme.colors, _b = _a.type, type = _b === void 0 ? 'default' : _b, _c = _a.width, width = _c === void 0 ? '100%' : _c;
|
|
38
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1px;\n background: ", ";\n width: ", ";\n "], ["\n height: 1px;\n background: ", ";\n width: ", ";\n "])), type === 'default' ? colors.primaryContrast : '#ECE5DD', width);
|
|
39
|
+
});
|
|
40
|
+
var Divider = function (_a) {
|
|
41
|
+
var type = _a.type, width = _a.width;
|
|
42
|
+
return react_1.default.createElement(StyledDivider, { type: type, width: width });
|
|
43
|
+
};
|
|
44
|
+
exports.Divider = Divider;
|
|
45
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Divider } from './Divider';
|
|
@@ -8,5 +8,5 @@ declare const Col: import("react").ForwardRefExoticComponent<Pick<Omit<{
|
|
|
8
8
|
} & {
|
|
9
9
|
as?: string | import("react").ComponentType<any> | undefined;
|
|
10
10
|
forwardedAs?: string | import("react").ComponentType<any> | undefined;
|
|
11
|
-
}, import("../../hooks").BreakpointNames>, string | number | symbol> & import("react").RefAttributes<import("react-native").View>>;
|
|
11
|
+
}, import("../../hooks").BreakpointNames>, string | number | symbol> & import("react").RefAttributes<import("react-native/types").View>>;
|
|
12
12
|
export { Col };
|
|
@@ -4,11 +4,12 @@ import { InputProps } from './Input';
|
|
|
4
4
|
export declare type CurrencyInputProps = InputProps & {
|
|
5
5
|
currency?: 'GBP' | 'EUR' | 'AUD' | 'USD';
|
|
6
6
|
};
|
|
7
|
-
declare const CurrencyInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
7
|
+
declare const CurrencyInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
8
8
|
invalid?: boolean | undefined;
|
|
9
9
|
stretch?: boolean | undefined;
|
|
10
10
|
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
11
11
|
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
12
|
+
rightSlot?: React.ReactNode;
|
|
12
13
|
} & {
|
|
13
14
|
currency?: "GBP" | "EUR" | "AUD" | "USD" | undefined;
|
|
14
15
|
} & React.RefAttributes<TextInput>>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInput } from 'react-native';
|
|
3
|
-
declare const EmailInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
3
|
+
declare const EmailInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
6
|
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
7
|
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
rightSlot?: React.ReactNode;
|
|
8
9
|
} & React.RefAttributes<TextInput>>;
|
|
9
10
|
export { EmailInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { TextInputProps, TextInput } from 'react-native';
|
|
3
3
|
import { IconName } from '../../providers/types';
|
|
4
4
|
export declare type InputProps = TextInputProps & {
|
|
@@ -6,11 +6,13 @@ export declare type InputProps = TextInputProps & {
|
|
|
6
6
|
stretch?: boolean;
|
|
7
7
|
iconLeft?: IconName | (string & {});
|
|
8
8
|
iconRight?: IconName | (string & {});
|
|
9
|
+
rightSlot?: ReactNode;
|
|
9
10
|
};
|
|
10
11
|
declare const Input: React.ForwardRefExoticComponent<TextInputProps & {
|
|
11
12
|
invalid?: boolean | undefined;
|
|
12
13
|
stretch?: boolean | undefined;
|
|
13
14
|
iconLeft?: (string & {}) | IconName | undefined;
|
|
14
15
|
iconRight?: (string & {}) | IconName | undefined;
|
|
16
|
+
rightSlot?: ReactNode;
|
|
15
17
|
} & React.RefAttributes<TextInput>>;
|
|
16
18
|
export { Input };
|
|
@@ -62,13 +62,13 @@ var StyledIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_a) {
|
|
|
62
62
|
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", "px;\n ", ";\n ", ";\n "], ["\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", "px;\n ", ";\n ", ";\n "])), input.icon.size, distance, side === 'left' ? "left: ".concat(distance, "px") : '', side === 'right' ? "right: ".concat(distance, "px") : '');
|
|
63
63
|
});
|
|
64
64
|
var Input = (0, react_1.forwardRef)(function (_a, ref) {
|
|
65
|
-
var onFocus = _a.onFocus, onBlur = _a.onBlur, style = _a.style, iconLeft = _a.iconLeft, iconRight = _a.iconRight, rest = __rest(_a, ["onFocus", "onBlur", "style", "iconLeft", "iconRight"]);
|
|
65
|
+
var onFocus = _a.onFocus, onBlur = _a.onBlur, style = _a.style, iconLeft = _a.iconLeft, iconRight = _a.iconRight, rightSlot = _a.rightSlot, rest = __rest(_a, ["onFocus", "onBlur", "style", "iconLeft", "iconRight", "rightSlot"]);
|
|
66
66
|
var _b = (0, react_1.useState)(false), focused = _b[0], setFocused = _b[1];
|
|
67
67
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
68
68
|
var input = (0, react_1.useContext)(styled_native_1.ThemeContext).input;
|
|
69
69
|
return (react_1.default.createElement(InputWrapper, { focused: focused },
|
|
70
70
|
iconLeft ? (react_1.default.createElement(StyledIcon, { name: iconLeft, size: (0, utils_1.pxToNumber)(input.icon.size), focused: focused, pointerEvents: "none", side: "left" })) : null,
|
|
71
|
-
react_1.default.createElement(StyledInput, __assign({}, rest, breakpoints, { iconLeft: !!iconLeft, iconRight: !!iconRight, style: style,
|
|
71
|
+
react_1.default.createElement(StyledInput, __assign({}, rest, breakpoints, { iconLeft: !!iconLeft, iconRight: !!iconRight, hasRightSlot: !!rightSlot, style: style,
|
|
72
72
|
// @ts-ignore
|
|
73
73
|
ref: ref, onFocus: function (event) {
|
|
74
74
|
setFocused(true);
|
|
@@ -81,7 +81,8 @@ var Input = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
81
81
|
onBlur(event);
|
|
82
82
|
}
|
|
83
83
|
} })),
|
|
84
|
-
iconRight ? (react_1.default.createElement(StyledIcon, { name: iconRight, size: (0, utils_1.pxToNumber)(input.icon.size), focused: focused, pointerEvents: "none", side: "right" })) : null
|
|
84
|
+
iconRight && !rightSlot ? (react_1.default.createElement(StyledIcon, { name: iconRight, size: (0, utils_1.pxToNumber)(input.icon.size), focused: focused, pointerEvents: "none", side: "right" })) : null,
|
|
85
|
+
rightSlot));
|
|
85
86
|
});
|
|
86
87
|
exports.Input = Input;
|
|
87
88
|
var InputWrapper = styled_native_1.default.View(function (_a) {
|
|
@@ -92,11 +93,11 @@ var InputWrapper = styled_native_1.default.View(function (_a) {
|
|
|
92
93
|
: null);
|
|
93
94
|
});
|
|
94
95
|
var StyledInput = styled_native_1.default.TextInput(function (_a) {
|
|
95
|
-
var input = _a.theme.input, invalid = _a.invalid, smallAndUp = _a.smallAndUp, iconLeft = _a.iconLeft, iconRight = _a.iconRight;
|
|
96
|
+
var input = _a.theme.input, invalid = _a.invalid, smallAndUp = _a.smallAndUp, iconLeft = _a.iconLeft, iconRight = _a.iconRight, hasRightSlot = _a.hasRightSlot;
|
|
96
97
|
var fontSize = smallAndUp ? input.fontSize[1] : input.fontSize[0];
|
|
97
98
|
var errorStyles = invalid
|
|
98
99
|
? "\n border-width: ".concat(input.error.borderWidth, ";\n border-color: ").concat(input.error.color, ";\n ")
|
|
99
100
|
: '';
|
|
100
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid ", ";\n background: ", ";\n border-radius: ", ";\n padding: ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "], ["\n font-family: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid ", ";\n background: ", ";\n border-radius: ", ";\n padding: ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "])), input.fontFamily, input.fontWeight, input.color, fontSize, input.height, input.borderWidth, input.borderColor, input.background, input.borderRadius, input.padding, iconLeft ? "padding-left: ".concat(input.height, ";") : '', iconRight ? "padding-right: ".concat(input.height, ";") : '', errorStyles);
|
|
101
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid ", ";\n background: ", ";\n border-radius: ", ";\n padding: ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "], ["\n font-family: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n height: ", ";\n line-height: 18px; /* Corrects for responsive line height in fixed height input */\n border: ", " solid ", ";\n background: ", ";\n border-radius: ", ";\n padding: ", ";\n flex: 1;\n\n ", "\n ", "\n\n ", "\n "])), input.fontFamily, input.fontWeight, input.color, fontSize, input.height, input.borderWidth, input.borderColor, input.background, input.borderRadius, input.padding, iconLeft ? "padding-left: ".concat(input.height, ";") : '', iconRight || hasRightSlot ? "padding-right: ".concat(input.height, ";") : '', errorStyles);
|
|
101
102
|
});
|
|
102
103
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInput as RNTextInput } from 'react-native';
|
|
3
|
-
declare const NumberInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
3
|
+
declare const NumberInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
6
|
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
7
|
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
rightSlot?: React.ReactNode;
|
|
8
9
|
} & React.RefAttributes<RNTextInput>>;
|
|
9
10
|
export { NumberInput };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInput as RNTextInput } from 'react-native';
|
|
3
|
-
declare const PasswordInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
3
|
+
declare const PasswordInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
6
|
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
7
|
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
rightSlot?: React.ReactNode;
|
|
9
|
+
} & {
|
|
10
|
+
hasVisibilityToggle?: boolean | undefined;
|
|
8
11
|
} & React.RefAttributes<RNTextInput>>;
|
|
9
12
|
export { PasswordInput };
|
|
@@ -48,8 +48,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
48
48
|
exports.PasswordInput = void 0;
|
|
49
49
|
var react_1 = __importStar(require("react"));
|
|
50
50
|
var Input_1 = require("./Input");
|
|
51
|
+
var PasswordVisibilityToggle_1 = require("./PasswordVisibilityToggle");
|
|
51
52
|
var PasswordInput = (0, react_1.forwardRef)(function (_a, ref) {
|
|
52
|
-
var
|
|
53
|
-
|
|
53
|
+
var props = __rest(_a, []);
|
|
54
|
+
var _b = (0, PasswordVisibilityToggle_1.useTogglePasswordVisibility)(), isPasswordVisible = _b.isPasswordVisible, handlePasswordVisibility = _b.handlePasswordVisibility;
|
|
55
|
+
return (react_1.default.createElement(Input_1.Input, __assign({}, props, { rightSlot: props.hasVisibilityToggle ? (react_1.default.createElement(PasswordVisibilityToggle_1.PasswordVisibilityToggle, { iconName: isPasswordVisible ? 'hide' : 'show', visibilityToggleLabel: isPasswordVisible ? 'Hide password' : 'Show password', handlePasswordVisibility: handlePasswordVisibility })) : null, keyboardType: "default", autoCapitalize: "none", autoCorrect: false, blurOnSubmit: false, secureTextEntry: !isPasswordVisible, ref: ref })));
|
|
54
56
|
});
|
|
55
57
|
exports.PasswordInput = PasswordInput;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledPressable: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react-native/types").PressableProps & import("react").RefAttributes<import("react-native/types").View>>, import("../../theme/theme").Theme, {
|
|
3
|
+
focused: boolean;
|
|
4
|
+
}, never>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.StyledPressable = void 0;
|
|
31
|
+
var react_native_1 = require("react-native");
|
|
32
|
+
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
33
|
+
var utils_1 = require("../../utils");
|
|
34
|
+
exports.StyledPressable = (0, styled_native_1.default)(react_native_1.Pressable)(function (_a) {
|
|
35
|
+
var _b = _a.theme, input = _b.input, focusRing = _b.focusRing, focused = _a.focused;
|
|
36
|
+
var distance = ((0, utils_1.pxToNumber)(input.height) - (0, utils_1.pxToNumber)(input.icon.size)) / 2 +
|
|
37
|
+
(focused ? (0, utils_1.pxToNumber)(focusRing.distance) : 0);
|
|
38
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", "px;\n right: ", "px;\n "], ["\n display: flex;\n align-items: center;\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", "px;\n right: ", "px;\n "])), input.icon.size, distance, distance);
|
|
39
|
+
});
|
|
40
|
+
var templateObject_1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const useTogglePasswordVisibility: () => {
|
|
2
|
+
isPasswordVisible: boolean;
|
|
3
|
+
handlePasswordVisibility: () => void;
|
|
4
|
+
};
|
|
5
|
+
declare type PasswordVisibilityToggleProps = {
|
|
6
|
+
iconName: string;
|
|
7
|
+
visibilityToggleLabel: string;
|
|
8
|
+
handlePasswordVisibility: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const PasswordVisibilityToggle: ({ iconName, visibilityToggleLabel, handlePasswordVisibility, }: PasswordVisibilityToggleProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.PasswordVisibilityToggle = exports.useTogglePasswordVisibility = void 0;
|
|
27
|
+
var react_1 = __importStar(require("react"));
|
|
28
|
+
var styled_native_1 = require("../../styled.native");
|
|
29
|
+
var utils_1 = require("../../utils");
|
|
30
|
+
var Icon_1 = require("../Icon");
|
|
31
|
+
var PasswordInput_styled_1 = require("./PasswordInput.styled");
|
|
32
|
+
var useTogglePasswordVisibility = function () {
|
|
33
|
+
var _a = (0, react_1.useState)(false), isPasswordVisible = _a[0], setIsPasswordVisible = _a[1];
|
|
34
|
+
var handlePasswordVisibility = function () {
|
|
35
|
+
setIsPasswordVisible(!isPasswordVisible);
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
isPasswordVisible: isPasswordVisible,
|
|
39
|
+
handlePasswordVisibility: handlePasswordVisibility,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.useTogglePasswordVisibility = useTogglePasswordVisibility;
|
|
43
|
+
var PasswordVisibilityToggle = function (_a) {
|
|
44
|
+
var iconName = _a.iconName, visibilityToggleLabel = _a.visibilityToggleLabel, handlePasswordVisibility = _a.handlePasswordVisibility;
|
|
45
|
+
var input = (0, react_1.useContext)(styled_native_1.ThemeContext).input;
|
|
46
|
+
var _b = (0, react_1.useState)(false), focused = _b[0], setFocused = _b[1];
|
|
47
|
+
return (react_1.default.createElement(PasswordInput_styled_1.StyledPressable, { testID: "password-input-visibility-toggle", focused: focused, accessibilityRole: "button", accessibilityLabel: visibilityToggleLabel, onPress: handlePasswordVisibility, hitSlop: (0, utils_1.pxToNumber)(input.icon.size), onFocus: function () {
|
|
48
|
+
setFocused(true);
|
|
49
|
+
}, onBlur: function () {
|
|
50
|
+
setFocused(false);
|
|
51
|
+
} },
|
|
52
|
+
react_1.default.createElement(Icon_1.Icon, { name: iconName, size: (0, utils_1.pxToNumber)(input.icon.size), pointerEvents: "none" })));
|
|
53
|
+
};
|
|
54
|
+
exports.PasswordVisibilityToggle = PasswordVisibilityToggle;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInput } from 'react-native';
|
|
3
|
-
declare const TelInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
3
|
+
declare const TelInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
6
|
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
7
|
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
rightSlot?: React.ReactNode;
|
|
8
9
|
} & React.RefAttributes<TextInput>>;
|
|
9
10
|
export { TelInput };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInput as RNTextInput } from 'react-native';
|
|
3
|
-
declare const TextInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
3
|
+
declare const TextInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
4
4
|
invalid?: boolean | undefined;
|
|
5
5
|
stretch?: boolean | undefined;
|
|
6
6
|
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
7
7
|
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
8
|
+
rightSlot?: React.ReactNode;
|
|
8
9
|
} & React.RefAttributes<RNTextInput>>;
|
|
9
10
|
export { TextInput };
|
|
@@ -4,11 +4,12 @@ import { InputProps } from './Input';
|
|
|
4
4
|
declare type TextareaInputProps = InputProps & {
|
|
5
5
|
rows?: number;
|
|
6
6
|
};
|
|
7
|
-
declare const TextareaInput: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
7
|
+
declare const TextareaInput: React.ForwardRefExoticComponent<import("react-native/types").TextInputProps & {
|
|
8
8
|
invalid?: boolean | undefined;
|
|
9
9
|
stretch?: boolean | undefined;
|
|
10
10
|
iconLeft?: (string & {}) | import("../../providers").IconName | undefined;
|
|
11
11
|
iconRight?: (string & {}) | import("../../providers").IconName | undefined;
|
|
12
|
+
rightSlot?: React.ReactNode;
|
|
12
13
|
} & {
|
|
13
14
|
rows?: number | undefined;
|
|
14
15
|
} & React.RefAttributes<RNTextInput>>;
|
|
@@ -74,7 +74,7 @@ var StyledBullet = styled_native_1.default.Text(function (_a) {
|
|
|
74
74
|
: list.listItem.lineHeight[0];
|
|
75
75
|
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-weight: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "])), text.fontFamily, lineHeight, text.fontWeight, text.color, fontSize, list.listItem.bulletGap, space[4]);
|
|
76
76
|
});
|
|
77
|
-
var StyledUlItem = styled_native_1.default.View(function () { return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items:
|
|
77
|
+
var StyledUlItem = styled_native_1.default.View(function () { return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: flex-start;\n justify-content: center;\n "], ["\n flex-direction: row;\n align-items: flex-start;\n justify-content: center;\n "]))); });
|
|
78
78
|
var Bullet = (0, utils_1.styledComponentWithBreakpoints)(StyledBullet);
|
|
79
79
|
var ListBulletItem = function (_a) {
|
|
80
80
|
var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b;
|
|
@@ -49,30 +49,29 @@ var LeftHeaderText = (0, styled_native_1.default)(StyledText)(function (_a) {
|
|
|
49
49
|
var space = _a.theme.space;
|
|
50
50
|
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n "], ["\n padding-left: ", ";\n "])), space[2]);
|
|
51
51
|
});
|
|
52
|
-
var FeedbackText = (0, styled_native_1.default)(StyledText)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
|
|
53
52
|
var HeadlineView = (0, styled_native_1.default)(react_native_reanimated_1.default.View)(function (_a) {
|
|
54
53
|
var space = _a.theme.space;
|
|
55
|
-
return (0, styled_native_1.css)(
|
|
54
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 0 ", " ", ";\n "], ["\n padding: 0 ", " ", ";\n "])), space[3], space[3]);
|
|
56
55
|
});
|
|
57
56
|
var RootView = styled_native_1.default.View(function (_a) {
|
|
58
57
|
var colors = _a.theme.colors;
|
|
59
|
-
return (0, styled_native_1.css)(
|
|
58
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n "], ["\n background-color: ", ";\n overflow: hidden;\n "])), colors.primary);
|
|
60
59
|
});
|
|
61
60
|
var StyledView = (0, styled_native_1.default)(react_native_reanimated_1.default.View)(function (_a) {
|
|
62
61
|
var space = _a.theme.space, marginTop = _a.marginTop;
|
|
63
|
-
return (0, styled_native_1.css)(
|
|
62
|
+
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "], ["\n padding: ", ";\n padding-bottom: ", ";\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n margin-top: ", ";\n "])), space[3], space[2], marginTop !== null && marginTop !== void 0 ? marginTop : 0);
|
|
64
63
|
});
|
|
65
64
|
var StyledHeading4 = (0, styled_native_1.default)(Heading_1.Heading4)(function (_a) {
|
|
66
65
|
var _b = _a.theme, fonts = _b.fonts, fontWeights = _b.fontWeights, colors = _b.colors, textAlign = _a.textAlign;
|
|
67
|
-
return (0, styled_native_1.css)(
|
|
66
|
+
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "])), fonts.bold, fontWeights.bold, colors.primaryContrast, textAlign);
|
|
68
67
|
});
|
|
69
68
|
var StyledHeading3 = (0, styled_native_1.default)(Heading_1.Heading3)(function (_a) {
|
|
70
69
|
var colors = _a.theme.colors;
|
|
71
|
-
return (0, styled_native_1.css)(
|
|
70
|
+
return (0, styled_native_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "], ["\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 0;\n color: ", ";\n text-align: left;\n "])), colors.primaryContrast);
|
|
72
71
|
});
|
|
73
72
|
var NavHeader = function (_a) {
|
|
74
73
|
var options = _a.options, headline = _a.headline;
|
|
75
|
-
return (react_1.default.createElement(RootView, { layout: react_native_reanimated_1.Layout.duration(150) },
|
|
74
|
+
return (react_1.default.createElement(RootView, { layout: react_native_reanimated_1.Layout === null || react_native_reanimated_1.Layout === void 0 ? void 0 : react_native_reanimated_1.Layout.duration(150) },
|
|
76
75
|
react_1.default.createElement(StyledView, { marginTop: options === null || options === void 0 ? void 0 : options.statusBarHeight },
|
|
77
76
|
(options === null || options === void 0 ? void 0 : options.headerLeft) ? (options === null || options === void 0 ? void 0 : options.headerLeft()) : (options === null || options === void 0 ? void 0 : options.canGoBack()) ? (react_1.default.createElement(react_native_1.TouchableOpacity, { style: {
|
|
78
77
|
flexDirection: 'row',
|
|
@@ -85,9 +84,8 @@ var NavHeader = function (_a) {
|
|
|
85
84
|
react_1.default.createElement(LeftHeaderText, null, "Back"))) : null,
|
|
86
85
|
react_1.default.createElement(react_native_reanimated_1.default.View, { entering: react_native_reanimated_1.FadeIn, exiting: react_native_reanimated_1.FadeOut, style: { flex: 1, flexGrow: 3, flexShrink: 1 } },
|
|
87
86
|
react_1.default.createElement(StyledHeading4, { textAlign: (options === null || options === void 0 ? void 0 : options.canGoBack()) ? 'center' : 'left', numberOfLines: 1 }, !headline ? options === null || options === void 0 ? void 0 : options.title : ' ')),
|
|
88
|
-
react_1.default.createElement(react_native_1.
|
|
89
|
-
react_1.default.createElement(FeedbackText, null, "Feedback"))),
|
|
87
|
+
react_1.default.createElement(react_native_1.View, { style: { flex: 1, flexGrow: 1, flexShrink: 1 } }, options.headerRight ? options.headerRight() : null)),
|
|
90
88
|
headline ? (react_1.default.createElement(HeadlineView, { entering: react_native_reanimated_1.FadeIn, exiting: react_native_reanimated_1.FadeOut }, (options === null || options === void 0 ? void 0 : options.title) ? (react_1.default.createElement(StyledHeading3, null, options.title)) : null)) : null));
|
|
91
89
|
};
|
|
92
90
|
exports.NavHeader = NavHeader;
|
|
93
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7
|
|
91
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|