@ovotech/element-native 2.2.0-canary-668a0ee-91 → 2.2.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.d.ts +2 -2
- package/dist/components/Accordion/Accordion.js +24 -21
- package/dist/components/Accordion/Group.js +32 -10
- package/dist/components/Accordion/Icon.js +14 -19
- package/dist/components/Accordion/hooks.d.ts +1 -1
- package/dist/components/Accordion/hooks.js +26 -3
- package/dist/components/Accordion/styles.d.ts +46 -688
- package/dist/components/Accordion/styles.js +49 -56
- package/dist/components/Badge/Badge.d.ts +46 -54
- package/dist/components/Badge/Badge.js +20 -35
- package/dist/components/CTAButton/CTAButton.d.ts +12 -7
- package/dist/components/CTAButton/CTAButton.js +27 -23
- package/dist/components/CTALink/CTALink.d.ts +4 -4
- package/dist/components/CTALink/CTALink.js +27 -5
- package/dist/components/Card/Card.d.ts +45 -47
- package/dist/components/Card/Card.js +25 -5
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.js +57 -18
- package/dist/components/Checkbox/CheckboxField.js +37 -7
- package/dist/components/DataTable/DataTable.d.ts +12 -3
- package/dist/components/DataTable/DataTable.js +98 -11
- package/dist/components/DataTable/index.d.ts +0 -2
- package/dist/components/DataTable/index.js +0 -16
- package/dist/components/DateField/DateField.d.ts +2 -2
- package/dist/components/DateField/DateField.js +28 -9
- package/dist/components/DescriptionList/DescriptionList.js +32 -8
- package/dist/components/DescriptionList/styled.d.ts +44 -50
- package/dist/components/DescriptionList/styled.js +34 -9
- package/dist/components/Disclosure/Disclosure.d.ts +3 -3
- package/dist/components/Disclosure/Disclosure.js +18 -12
- package/dist/components/Divider/Divider.js +7 -4
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +28 -6
- package/dist/components/ErrorText/ErrorText.d.ts +39 -45
- package/dist/components/ErrorText/ErrorText.js +4 -7
- package/dist/components/Field/Field.d.ts +2 -2
- package/dist/components/Field/Field.js +49 -18
- package/dist/components/FormGroup/FormGroup.js +3 -2
- package/dist/components/Grid/Col.d.ts +39 -45
- package/dist/components/Grid/Col.js +3 -4
- package/dist/components/Grid/Row.d.ts +41 -47
- package/dist/components/Grid/Row.js +10 -7
- package/dist/components/Heading/Heading.js +32 -21
- package/dist/components/HintText/HintText.d.ts +39 -45
- package/dist/components/HintText/HintText.js +4 -7
- package/dist/components/Icon/Icon.d.ts +4 -3
- package/dist/components/Icon/Icon.js +27 -5
- package/dist/components/Input/CurrencyInput.d.ts +6 -6
- package/dist/components/Input/CurrencyInput.js +25 -3
- package/dist/components/Input/EmailInput.d.ts +6 -6
- package/dist/components/Input/EmailInput.js +25 -3
- package/dist/components/Input/Input.d.ts +8 -8
- package/dist/components/Input/Input.js +32 -26
- package/dist/components/Input/NumberInput.d.ts +6 -6
- package/dist/components/Input/NumberInput.js +25 -3
- package/dist/components/Input/PasswordInput.d.ts +6 -6
- package/dist/components/Input/PasswordInput.js +25 -3
- package/dist/components/Input/PasswordInput.styled.d.ts +39 -45
- package/dist/components/Input/PasswordInput.styled.js +5 -2
- package/dist/components/Input/PasswordVisibilityToggle.js +29 -14
- package/dist/components/Input/TelInput.d.ts +10 -0
- package/dist/components/Input/TelInput.js +41 -0
- package/dist/components/Input/TextInput.d.ts +6 -6
- package/dist/components/Input/TextInput.js +25 -3
- package/dist/components/Input/TextareaInput.d.ts +6 -6
- package/dist/components/Input/TextareaInput.js +10 -13
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/LabelText/LabelText.d.ts +39 -45
- package/dist/components/LabelText/LabelText.js +4 -5
- package/dist/components/List/List.d.ts +131 -149
- package/dist/components/List/List.js +44 -30
- package/dist/components/Margin/Margin.d.ts +39 -45
- package/dist/components/Margin/Margin.js +3 -3
- package/dist/components/NavHeader/NavHeader.d.ts +1 -1
- package/dist/components/NavHeader/NavHeader.js +35 -34
- package/dist/components/Notification/Notification.d.ts +100 -104
- package/dist/components/Notification/Notification.js +49 -32
- package/dist/components/Radio/Radio.d.ts +3 -3
- package/dist/components/Radio/Radio.js +61 -16
- package/dist/components/Radio/RadioField.js +41 -11
- package/dist/components/SkeletonLoading/Skeleton.d.ts +39 -45
- package/dist/components/SkeletonLoading/SkeletonAnimation.js +33 -22
- package/dist/components/SkeletonLoading/SkeletonCTA.js +5 -4
- package/dist/components/SkeletonLoading/SkeletonCircle.js +6 -4
- package/dist/components/SkeletonLoading/SkeletonHeading.js +5 -4
- package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/components/Stack/Stack.js +28 -6
- package/dist/components/Stretch/Stretch.js +2 -2
- package/dist/components/SubLabelText/SubLabelText.d.ts +39 -45
- package/dist/components/SubLabelText/SubLabelText.js +4 -5
- package/dist/components/SummaryList/SummaryList.js +32 -8
- package/dist/components/Tabs/Tab.d.ts +4 -4
- package/dist/components/Tabs/Tab.js +20 -23
- package/dist/components/Tabs/TabList.d.ts +222 -11
- package/dist/components/Tabs/TabList.js +18 -22
- package/dist/components/Tabs/TabPanel.js +10 -33
- package/dist/components/Tabs/Tabs.d.ts +227 -8
- package/dist/components/Tabs/Tabs.js +23 -26
- package/dist/components/Text/Text.d.ts +204 -234
- package/dist/components/Text/Text.js +20 -17
- package/dist/components/TextField/CurrencyField.d.ts +6 -6
- package/dist/components/TextField/CurrencyField.js +26 -3
- package/dist/components/TextField/EmailField.d.ts +6 -6
- package/dist/components/TextField/EmailField.js +26 -3
- package/dist/components/TextField/NumberField.d.ts +6 -6
- package/dist/components/TextField/NumberField.js +26 -3
- package/dist/components/TextField/PasswordField.d.ts +6 -6
- package/dist/components/TextField/PasswordField.js +26 -3
- package/dist/components/TextField/TelField.d.ts +6 -10
- package/dist/components/TextField/TelField.js +27 -9
- package/dist/components/TextField/TextField.d.ts +6 -6
- package/dist/components/TextField/TextField.js +26 -3
- package/dist/components/TextField/TextareaField.d.ts +6 -6
- package/dist/components/TextField/TextareaField.js +26 -3
- package/dist/components/TextField/index.d.ts +0 -1
- package/dist/components/TextField/index.js +1 -3
- package/dist/components/TextLink/TextLink.d.ts +4 -4
- package/dist/components/TextLink/TextLink.js +8 -5
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/esm/components/Accordion/Accordion.js +26 -23
- package/dist/esm/components/Accordion/Group.js +9 -10
- package/dist/esm/components/Accordion/Icon.js +12 -20
- package/dist/esm/components/Accordion/hooks.js +3 -3
- package/dist/esm/components/Accordion/styles.js +48 -29
- package/dist/esm/components/Badge/Badge.js +17 -35
- package/dist/esm/components/CTAButton/CTAButton.js +28 -24
- package/dist/esm/components/CTALink/CTALink.js +4 -5
- package/dist/esm/components/Card/Card.js +25 -5
- package/dist/esm/components/Checkbox/Checkbox.js +34 -15
- package/dist/esm/components/Checkbox/CheckboxField.js +14 -7
- package/dist/esm/components/DataTable/DataTable.js +74 -10
- package/dist/esm/components/DataTable/index.js +0 -2
- package/dist/esm/components/DateField/DateField.js +28 -9
- package/dist/esm/components/DescriptionList/DescriptionList.js +9 -8
- package/dist/esm/components/DescriptionList/styled.js +31 -9
- package/dist/esm/components/Disclosure/Disclosure.js +19 -13
- package/dist/esm/components/Divider/Divider.js +4 -4
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +5 -6
- package/dist/esm/components/ErrorText/ErrorText.js +4 -7
- package/dist/esm/components/Field/Field.js +26 -18
- package/dist/esm/components/FormGroup/FormGroup.js +3 -2
- package/dist/esm/components/Grid/Col.js +3 -4
- package/dist/esm/components/Grid/Row.js +7 -7
- package/dist/esm/components/Heading/Heading.js +29 -21
- package/dist/esm/components/HintText/HintText.js +4 -7
- package/dist/esm/components/Icon/Icon.js +4 -5
- package/dist/esm/components/Input/CurrencyInput.js +2 -3
- package/dist/esm/components/Input/EmailInput.js +2 -3
- package/dist/esm/components/Input/Input.js +33 -27
- package/dist/esm/components/Input/NumberInput.js +2 -3
- package/dist/esm/components/Input/PasswordInput.js +2 -3
- package/dist/esm/components/Input/PasswordInput.styled.js +5 -2
- package/dist/esm/components/Input/PasswordVisibilityToggle.js +7 -15
- package/dist/esm/components/Input/{PhoneInput.js → TelInput.js} +3 -4
- package/dist/esm/components/Input/TextInput.js +2 -3
- package/dist/esm/components/Input/TextareaInput.js +10 -13
- package/dist/esm/components/Input/index.js +1 -1
- package/dist/esm/components/LabelText/LabelText.js +4 -5
- package/dist/esm/components/List/List.js +45 -31
- package/dist/esm/components/Margin/Margin.js +3 -3
- package/dist/esm/components/NavHeader/NavHeader.js +32 -34
- package/dist/esm/components/Notification/Notification.js +50 -33
- package/dist/esm/components/Radio/Radio.js +38 -16
- package/dist/esm/components/Radio/RadioField.js +18 -11
- package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +11 -23
- package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +5 -4
- package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +6 -4
- package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +5 -4
- package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/esm/components/Stack/Stack.js +5 -6
- package/dist/esm/components/Stretch/Stretch.js +2 -2
- package/dist/esm/components/SubLabelText/SubLabelText.js +4 -5
- package/dist/esm/components/SummaryList/SummaryList.js +9 -8
- package/dist/esm/components/Tabs/Tab.js +17 -23
- package/dist/esm/components/Tabs/TabList.js +18 -21
- package/dist/esm/components/Tabs/TabPanel.js +7 -10
- package/dist/esm/components/Tabs/Tabs.js +23 -25
- package/dist/esm/components/Text/Text.js +20 -17
- package/dist/esm/components/TextField/CurrencyField.js +3 -3
- package/dist/esm/components/TextField/EmailField.js +3 -3
- package/dist/esm/components/TextField/NumberField.js +3 -3
- package/dist/esm/components/TextField/PasswordField.js +3 -3
- package/dist/esm/components/TextField/TelField.js +4 -9
- package/dist/esm/components/TextField/TextField.js +3 -3
- package/dist/esm/components/TextField/TextareaField.js +3 -3
- package/dist/esm/components/TextField/index.js +0 -1
- package/dist/esm/components/TextLink/TextLink.js +8 -5
- package/dist/esm/components/index.js +0 -1
- package/dist/esm/hooks/use-breakpoint.js +4 -4
- package/dist/esm/providers/IconsProvider.js +2 -3
- package/dist/esm/providers/icons/ArrowDown.js +3 -2
- package/dist/esm/providers/icons/ArrowLeft.js +3 -2
- package/dist/esm/providers/icons/ArrowRight.js +3 -2
- package/dist/esm/providers/icons/ArrowUp.js +3 -2
- package/dist/esm/providers/icons/CaretDown.js +3 -2
- package/dist/esm/providers/icons/CaretLeft.js +3 -2
- package/dist/esm/providers/icons/CaretRight.js +3 -2
- package/dist/esm/providers/icons/CaretUp.js +3 -2
- package/dist/esm/providers/icons/Chart.js +3 -2
- package/dist/esm/providers/icons/Check.js +3 -2
- package/dist/esm/providers/icons/ChevronDown.js +3 -2
- package/dist/esm/providers/icons/ChevronLeft.js +3 -2
- package/dist/esm/providers/icons/ChevronLeftSmall.js +3 -2
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +3 -2
- package/dist/esm/providers/icons/ChevronRight.js +3 -2
- package/dist/esm/providers/icons/ChevronRightSmall.js +3 -2
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +3 -2
- package/dist/esm/providers/icons/ChevronUp.js +3 -2
- package/dist/esm/providers/icons/Cross.js +3 -2
- package/dist/esm/providers/icons/Dollar.js +3 -2
- package/dist/esm/providers/icons/Download.js +3 -2
- package/dist/esm/providers/icons/Electricity.js +3 -2
- package/dist/esm/providers/icons/Euro.js +3 -2
- package/dist/esm/providers/icons/Gas.js +4 -2
- package/dist/esm/providers/icons/Help.js +3 -2
- package/dist/esm/providers/icons/Hide.js +3 -2
- package/dist/esm/providers/icons/Home.js +3 -2
- package/dist/esm/providers/icons/Info.js +3 -2
- package/dist/esm/providers/icons/Link.js +4 -2
- package/dist/esm/providers/icons/Logo.js +4 -3
- package/dist/esm/providers/icons/Minus.js +3 -2
- package/dist/esm/providers/icons/NewWindow.js +3 -2
- package/dist/esm/providers/icons/PaymentCard.js +3 -2
- package/dist/esm/providers/icons/Plus.js +3 -2
- package/dist/esm/providers/icons/Pound.js +3 -2
- package/dist/esm/providers/icons/Search.js +3 -2
- package/dist/esm/providers/icons/Show.js +3 -2
- package/dist/esm/providers/icons/User.js +3 -2
- package/dist/esm/theme/create-theme.js +153 -0
- package/dist/esm/utils/utils.js +3 -7
- package/dist/hooks/use-breakpoint.js +4 -4
- package/dist/providers/IconsProvider.js +25 -3
- package/dist/providers/icons/ArrowDown.js +6 -2
- package/dist/providers/icons/ArrowLeft.js +6 -2
- package/dist/providers/icons/ArrowRight.js +6 -2
- package/dist/providers/icons/ArrowUp.js +6 -2
- package/dist/providers/icons/CaretDown.js +6 -2
- package/dist/providers/icons/CaretLeft.js +6 -2
- package/dist/providers/icons/CaretRight.js +6 -2
- package/dist/providers/icons/CaretUp.js +6 -2
- package/dist/providers/icons/Chart.js +6 -2
- package/dist/providers/icons/Check.js +6 -2
- package/dist/providers/icons/ChevronDown.js +6 -2
- package/dist/providers/icons/ChevronLeft.js +6 -2
- package/dist/providers/icons/ChevronLeftSmall.js +6 -2
- package/dist/providers/icons/ChevronLeftSmallFirst.js +6 -2
- package/dist/providers/icons/ChevronRight.js +6 -2
- package/dist/providers/icons/ChevronRightSmall.js +6 -2
- package/dist/providers/icons/ChevronRightSmallLast.js +6 -2
- package/dist/providers/icons/ChevronUp.js +6 -2
- package/dist/providers/icons/Cross.js +6 -2
- package/dist/providers/icons/Dollar.js +6 -2
- package/dist/providers/icons/Download.js +6 -2
- package/dist/providers/icons/Electricity.js +6 -2
- package/dist/providers/icons/Euro.js +6 -2
- package/dist/providers/icons/Gas.js +7 -2
- package/dist/providers/icons/Help.js +6 -2
- package/dist/providers/icons/Hide.js +6 -2
- package/dist/providers/icons/Home.js +6 -2
- package/dist/providers/icons/Info.js +6 -2
- package/dist/providers/icons/Link.js +7 -2
- package/dist/providers/icons/Logo.js +6 -2
- package/dist/providers/icons/Minus.js +6 -2
- package/dist/providers/icons/NewWindow.js +6 -2
- package/dist/providers/icons/PaymentCard.js +6 -2
- package/dist/providers/icons/Plus.js +6 -2
- package/dist/providers/icons/Pound.js +6 -2
- package/dist/providers/icons/Search.js +6 -2
- package/dist/providers/icons/Show.js +6 -2
- package/dist/providers/icons/User.js +6 -2
- package/dist/styled.native.d.ts +234 -270
- package/dist/theme/create-theme.js +153 -0
- package/dist/theme/index.d.ts +39 -45
- package/dist/theme/theme.d.ts +90 -0
- package/dist/utils/utils.d.ts +4 -5
- package/dist/utils/utils.js +26 -8
- package/package.json +5 -6
- package/dist/components/DataTable/TableRow.d.ts +0 -2
- package/dist/components/DataTable/TableRow.js +0 -31
- package/dist/components/DataTable/styles.d.ts +0 -2517
- package/dist/components/DataTable/styles.js +0 -77
- package/dist/components/DataTable/types.d.ts +0 -15
- package/dist/components/DataTable/types.js +0 -2
- package/dist/components/Input/PhoneInput.d.ts +0 -10
- package/dist/components/Input/PhoneInput.js +0 -19
- package/dist/components/SelectField/Select.d.ts +0 -244
- package/dist/components/SelectField/Select.js +0 -102
- package/dist/components/SelectField/SelectField.d.ts +0 -7
- package/dist/components/SelectField/SelectField.js +0 -33
- package/dist/components/SelectField/index.d.ts +0 -1
- package/dist/components/SelectField/index.js +0 -5
- package/dist/components/TextField/PhoneField.d.ts +0 -10
- package/dist/components/TextField/PhoneField.js +0 -33
- package/dist/esm/components/DataTable/TableRow.js +0 -27
- package/dist/esm/components/DataTable/styles.js +0 -51
- package/dist/esm/components/DataTable/types.js +0 -1
- package/dist/esm/components/SelectField/Select.js +0 -75
- package/dist/esm/components/SelectField/SelectField.js +0 -29
- package/dist/esm/components/SelectField/index.js +0 -1
- package/dist/esm/components/TextField/PhoneField.js +0 -30
|
@@ -24,51 +24,59 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
-
import
|
|
27
|
+
import React from 'react';
|
|
28
28
|
import { useBreakpoint } from '../../hooks';
|
|
29
29
|
import styled, { css } from '../../styled.native';
|
|
30
|
-
import { pxToNumber, numToPx } from '../../utils';
|
|
31
|
-
var calculateLetterSpacing = function (fontSize, letterSpacing) {
|
|
32
|
-
return numToPx(pxToNumber(fontSize) * letterSpacing);
|
|
33
|
-
};
|
|
34
30
|
var StyledHeading1 = styled.Text(function (_a) {
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
|
|
32
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.color, heading.heading1.fontSize[smallAndUp ? 1 : 0], heading.heading1.lineHeight[smallAndUp ? 1 : 0], smallAndUp
|
|
33
|
+
? heading.heading1.marginTop[1]
|
|
34
|
+
: heading.heading1.marginTop[0], smallAndUp
|
|
35
|
+
? heading.heading1.marginBottom[1]
|
|
36
|
+
: heading.heading1.marginBottom[0]);
|
|
38
37
|
});
|
|
39
38
|
export var Heading1 = function (_a) {
|
|
40
39
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
41
40
|
var breakpoints = useBreakpoint();
|
|
42
|
-
return (
|
|
41
|
+
return (React.createElement(StyledHeading1, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
43
42
|
};
|
|
44
43
|
var StyledHeading2 = styled.Text(function (_a) {
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
|
|
45
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading2.fontSize[smallAndUp ? 1 : 0], heading.heading2.lineHeight[smallAndUp ? 1 : 0], heading.color, smallAndUp
|
|
46
|
+
? heading.heading2.marginTop[1]
|
|
47
|
+
: heading.heading2.marginTop[0], smallAndUp
|
|
48
|
+
? heading.heading2.marginBottom[1]
|
|
49
|
+
: heading.heading2.marginBottom[0]);
|
|
48
50
|
});
|
|
49
51
|
export var Heading2 = function (_a) {
|
|
50
52
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
51
53
|
var breakpoints = useBreakpoint();
|
|
52
|
-
return (
|
|
54
|
+
return (React.createElement(StyledHeading2, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
53
55
|
};
|
|
54
56
|
var StyledHeading3 = styled.Text(function (_a) {
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
|
|
58
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading3.fontSize[smallAndUp ? 1 : 0], heading.heading3.lineHeight[smallAndUp ? 1 : 0], heading.color, smallAndUp
|
|
59
|
+
? heading.heading3.marginTop[1]
|
|
60
|
+
: heading.heading3.marginTop[0], smallAndUp
|
|
61
|
+
? heading.heading3.marginBottom[1]
|
|
62
|
+
: heading.heading3.marginBottom[0]);
|
|
58
63
|
});
|
|
59
64
|
export var Heading3 = function (_a) {
|
|
60
65
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
61
66
|
var breakpoints = useBreakpoint();
|
|
62
|
-
return (
|
|
67
|
+
return (React.createElement(StyledHeading3, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
63
68
|
};
|
|
64
69
|
var StyledHeading4 = styled.Text(function (_a) {
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
var heading = _a.theme.heading, smallAndUp = _a.smallAndUp;
|
|
71
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), heading.fontFamily, heading.heading3.fontSize[smallAndUp ? 1 : 0], heading.heading3.lineHeight[smallAndUp ? 1 : 0], heading.color, smallAndUp
|
|
72
|
+
? heading.heading4.marginTop[1]
|
|
73
|
+
: heading.heading4.marginTop[0], smallAndUp
|
|
74
|
+
? heading.heading4.marginBottom[1]
|
|
75
|
+
: heading.heading4.marginBottom[0]);
|
|
68
76
|
});
|
|
69
77
|
export var Heading4 = function (_a) {
|
|
70
78
|
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'header' : _b, rest = __rest(_a, ["accessibilityRole"]);
|
|
71
79
|
var breakpoints = useBreakpoint();
|
|
72
|
-
return (
|
|
80
|
+
return (React.createElement(StyledHeading4, __assign({ accessibilityRole: accessibilityRole }, breakpoints, rest)));
|
|
73
81
|
};
|
|
74
82
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -3,15 +3,12 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled, { css } from '../../styled.native';
|
|
6
|
+
import { calculateLineHeight } from '../../theme';
|
|
6
7
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
7
8
|
var StyledHintText = styled.Text(function (_a) {
|
|
8
|
-
var
|
|
9
|
-
var fontSize = smallAndUp
|
|
10
|
-
|
|
11
|
-
: core.fontSize.body.small;
|
|
12
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, fontSize, smallAndUp
|
|
13
|
-
? core.lineHeight.body.large
|
|
14
|
-
: core.lineHeight.body.small, semantic.border.functional);
|
|
9
|
+
var field = _a.theme.field, smallAndUp = _a.smallAndUp;
|
|
10
|
+
var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
|
|
11
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), field.fontFamily, fontSize, calculateLineHeight(fontSize, field.lineHeight), field.hint.color);
|
|
15
12
|
});
|
|
16
13
|
var HintText = styledComponentWithBreakpoints(StyledHintText);
|
|
17
14
|
export { HintText };
|
|
@@ -20,17 +20,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import {
|
|
24
|
-
import { useContext } from 'react';
|
|
23
|
+
import React, { useContext } from 'react';
|
|
25
24
|
import { useIcons } from '../../providers';
|
|
26
25
|
import { ThemeContext } from '../../styled.native';
|
|
27
26
|
export var Icon = function (_a) {
|
|
28
27
|
var name = _a.name, size = _a.size, color = _a.color, testID = _a.testID, rest = __rest(_a, ["name", "size", "color", "testID"]);
|
|
29
28
|
var icons = useIcons();
|
|
30
|
-
var
|
|
29
|
+
var colors = useContext(ThemeContext).colors;
|
|
31
30
|
// @ts-ignore to support additional icons.
|
|
32
31
|
var Svg = name && icons[name];
|
|
33
|
-
return Svg ? (
|
|
32
|
+
return Svg ? (React.createElement(Svg, __assign({ testID: testID ? testID : "element-icon".concat(name ? "-".concat(name) : ''),
|
|
34
33
|
// @ts-ignore this is valid.
|
|
35
|
-
color: color !== null && color !== void 0 ? color :
|
|
34
|
+
color: color !== null && color !== void 0 ? color : colors.body, width: size, height: size }, rest))) : null;
|
|
36
35
|
};
|
|
@@ -20,8 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import {
|
|
24
|
-
import { forwardRef, createRef } from 'react';
|
|
23
|
+
import React, { forwardRef, createRef } from 'react';
|
|
25
24
|
import { mergeRefs } from '../../utils';
|
|
26
25
|
import { NumberInput } from './NumberInput';
|
|
27
26
|
var CurrencyInput = forwardRef(function (_a, ref) {
|
|
@@ -29,6 +28,6 @@ var CurrencyInput = forwardRef(function (_a, ref) {
|
|
|
29
28
|
var inputRef = createRef();
|
|
30
29
|
var updatedAccessibilityLabel = "".concat(accessibilityLabel, " ").concat(currency === 'GBP' ? 'pounds' : currency === 'EUR' ? 'euro' : 'dollar').trim();
|
|
31
30
|
var iconName = currency === 'GBP' ? 'pound' : currency === 'EUR' ? 'euro' : 'dollar';
|
|
32
|
-
return (
|
|
31
|
+
return (React.createElement(NumberInput, __assign({}, rest, { invalid: invalid, accessibilityLabel: updatedAccessibilityLabel, ref: mergeRefs(ref, inputRef), iconLeft: iconName })));
|
|
33
32
|
});
|
|
34
33
|
export { CurrencyInput };
|
|
@@ -9,8 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import { forwardRef } from 'react';
|
|
12
|
+
import React, { forwardRef } from 'react';
|
|
14
13
|
import { Input } from './Input';
|
|
15
|
-
var EmailInput = forwardRef(function (props, ref) { return (
|
|
14
|
+
var EmailInput = forwardRef(function (props, ref) { return (React.createElement(Input, __assign({}, props, { keyboardType: "email-address", autoCapitalize: "none", autoCorrect: false, ref: ref }))); });
|
|
16
15
|
export { EmailInput };
|
|
@@ -24,48 +24,54 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
-
import {
|
|
28
|
-
import { forwardRef, useState } from 'react';
|
|
27
|
+
import React, { useState, forwardRef, useContext } from 'react';
|
|
29
28
|
import { useBreakpoint } from '../../hooks';
|
|
30
|
-
import styled, { css } from '../../styled.native';
|
|
29
|
+
import styled, { css, ThemeContext } from '../../styled.native';
|
|
30
|
+
import { pxToNumber } from '../../utils';
|
|
31
31
|
import { Icon } from '../Icon/Icon';
|
|
32
32
|
var StyledIcon = styled(Icon)(function (_a) {
|
|
33
|
-
var
|
|
34
|
-
|
|
33
|
+
var _b = _a.theme, input = _b.input, focusRing = _b.focusRing, side = _a.side, focused = _a.focused;
|
|
34
|
+
var distance = (pxToNumber(input.height) - pxToNumber(input.icon.size)) / 2 +
|
|
35
|
+
(focused ? pxToNumber(focusRing.distance) : 0);
|
|
36
|
+
return 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") : '');
|
|
35
37
|
});
|
|
36
38
|
var Input = forwardRef(function (_a, ref) {
|
|
37
39
|
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"]);
|
|
38
40
|
var _b = useState(false), focused = _b[0], setFocused = _b[1];
|
|
39
41
|
var breakpoints = useBreakpoint();
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
var input = useContext(ThemeContext).input;
|
|
43
|
+
return (React.createElement(InputWrapper, { focused: focused },
|
|
44
|
+
iconLeft ? (React.createElement(StyledIcon, { name: iconLeft, size: pxToNumber(input.icon.size), focused: focused, pointerEvents: "none", side: "left" })) : null,
|
|
45
|
+
React.createElement(StyledInput, __assign({}, rest, breakpoints, { iconLeft: !!iconLeft, iconRight: !!iconRight, hasRightSlot: !!rightSlot, style: style,
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
ref: ref, onFocus: function (event) {
|
|
48
|
+
setFocused(true);
|
|
49
|
+
if (onFocus) {
|
|
50
|
+
onFocus(event);
|
|
51
|
+
}
|
|
52
|
+
}, onBlur: function (event) {
|
|
53
|
+
setFocused(false);
|
|
54
|
+
if (onBlur) {
|
|
55
|
+
onBlur(event);
|
|
56
|
+
}
|
|
57
|
+
} })),
|
|
58
|
+
iconRight && !rightSlot ? (React.createElement(StyledIcon, { name: iconRight, size: pxToNumber(input.icon.size), focused: focused, pointerEvents: "none", side: "right" })) : null,
|
|
59
|
+
rightSlot));
|
|
53
60
|
});
|
|
54
61
|
var InputWrapper = styled.View(function (_a) {
|
|
55
|
-
var _b = _a.theme,
|
|
56
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: stretch;\n border-radius: ", ";\n border-width:
|
|
57
|
-
? "\n border-width: ".concat(
|
|
62
|
+
var _b = _a.theme, input = _b.input, focusRing = _b.focusRing, focused = _a.focused;
|
|
63
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: stretch;\n background-color: ", ";\n border-radius: ", ";\n border-width: 0px;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "], ["\n align-self: stretch;\n background-color: ", ";\n border-radius: ", ";\n border-width: 0px;\n border-style: solid;\n border-color: ", ";\n flex-direction: row;\n\n ", "\n "])), input.background, input.borderRadius, focusRing.color, focused
|
|
64
|
+
? "\n border-width: ".concat(focusRing.width, ";\n padding: ").concat(focusRing.distance, ";\n margin: -").concat(pxToNumber(focusRing.width) +
|
|
65
|
+
pxToNumber(focusRing.distance), "px;")
|
|
58
66
|
: null);
|
|
59
67
|
});
|
|
60
68
|
var StyledInput = styled.TextInput(function (_a) {
|
|
61
|
-
var
|
|
62
|
-
var fontSize = smallAndUp
|
|
63
|
-
? core.fontSize.body.large
|
|
64
|
-
: core.fontSize.body.small;
|
|
69
|
+
var input = _a.theme.input, invalid = _a.invalid, smallAndUp = _a.smallAndUp, iconLeft = _a.iconLeft, iconRight = _a.iconRight, hasRightSlot = _a.hasRightSlot;
|
|
70
|
+
var fontSize = smallAndUp ? input.fontSize[1] : input.fontSize[0];
|
|
65
71
|
var errorStyles = invalid
|
|
66
|
-
? "\n border-color: ".concat(
|
|
72
|
+
? "\n border-width: ".concat(input.error.borderWidth, ";\n border-color: ").concat(input.error.color, ";\n ")
|
|
67
73
|
: '';
|
|
68
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n
|
|
74
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\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 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.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);
|
|
69
75
|
});
|
|
70
76
|
export { Input };
|
|
71
77
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -9,8 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import { forwardRef } from 'react';
|
|
12
|
+
import React, { forwardRef } from 'react';
|
|
14
13
|
import { Input } from './Input';
|
|
15
|
-
var NumberInput = forwardRef(function (props, ref) { return (
|
|
14
|
+
var NumberInput = forwardRef(function (props, ref) { return (React.createElement(Input, __assign({}, props, { keyboardType: "numeric", autoCapitalize: "none", autoCorrect: false, ref: ref }))); });
|
|
16
15
|
export { NumberInput };
|
|
@@ -20,13 +20,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import {
|
|
24
|
-
import { forwardRef } from 'react';
|
|
23
|
+
import React, { forwardRef } from 'react';
|
|
25
24
|
import { Input } from './Input';
|
|
26
25
|
import { PasswordVisibilityToggle, useTogglePasswordVisibility, } from './PasswordVisibilityToggle';
|
|
27
26
|
var PasswordInput = forwardRef(function (_a, ref) {
|
|
28
27
|
var props = __rest(_a, []);
|
|
29
28
|
var _b = useTogglePasswordVisibility(), isPasswordVisible = _b.isPasswordVisible, handlePasswordVisibility = _b.handlePasswordVisibility;
|
|
30
|
-
return (
|
|
29
|
+
return (React.createElement(Input, __assign({}, props, { rightSlot: props.hasVisibilityToggle ? (React.createElement(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 })));
|
|
31
30
|
});
|
|
32
31
|
export { PasswordInput };
|
|
@@ -4,8 +4,11 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { Pressable } from 'react-native';
|
|
6
6
|
import styled, { css } from '../../styled.native';
|
|
7
|
+
import { pxToNumber } from '../../utils';
|
|
7
8
|
export var StyledPressable = styled(Pressable)(function (_a) {
|
|
8
|
-
var
|
|
9
|
-
|
|
9
|
+
var _b = _a.theme, input = _b.input, focusRing = _b.focusRing, focused = _a.focused;
|
|
10
|
+
var distance = (pxToNumber(input.height) - pxToNumber(input.icon.size)) / 2 +
|
|
11
|
+
(focused ? pxToNumber(focusRing.distance) : 0);
|
|
12
|
+
return 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);
|
|
10
13
|
});
|
|
11
14
|
var templateObject_1;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { useState } from 'react';
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
|
+
import { ThemeContext } from '../../styled.native';
|
|
3
|
+
import { pxToNumber } from '../../utils';
|
|
14
4
|
import { Icon } from '../Icon';
|
|
15
5
|
import { StyledPressable } from './PasswordInput.styled';
|
|
16
6
|
export var useTogglePasswordVisibility = function () {
|
|
@@ -25,10 +15,12 @@ export var useTogglePasswordVisibility = function () {
|
|
|
25
15
|
};
|
|
26
16
|
export var PasswordVisibilityToggle = function (_a) {
|
|
27
17
|
var iconName = _a.iconName, visibilityToggleLabel = _a.visibilityToggleLabel, handlePasswordVisibility = _a.handlePasswordVisibility;
|
|
18
|
+
var input = useContext(ThemeContext).input;
|
|
28
19
|
var _b = useState(false), focused = _b[0], setFocused = _b[1];
|
|
29
|
-
return (
|
|
20
|
+
return (React.createElement(StyledPressable, { testID: "password-input-visibility-toggle", focused: focused, accessibilityRole: "button", accessibilityLabel: visibilityToggleLabel, onPress: handlePasswordVisibility, hitSlop: pxToNumber(input.icon.size), onFocus: function () {
|
|
30
21
|
setFocused(true);
|
|
31
22
|
}, onBlur: function () {
|
|
32
23
|
setFocused(false);
|
|
33
|
-
} },
|
|
24
|
+
} },
|
|
25
|
+
React.createElement(Icon, { name: iconName, size: pxToNumber(input.icon.size), pointerEvents: "none" })));
|
|
34
26
|
};
|
|
@@ -9,8 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import { forwardRef } from 'react';
|
|
12
|
+
import React, { forwardRef } from 'react';
|
|
14
13
|
import { Input } from './Input';
|
|
15
|
-
var
|
|
16
|
-
export {
|
|
14
|
+
var TelInput = forwardRef(function (props, ref) { return (React.createElement(Input, __assign({}, props, { keyboardType: "phone-pad", autoCapitalize: "none", autoCorrect: false, ref: ref }))); });
|
|
15
|
+
export { TelInput };
|
|
@@ -9,8 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import { forwardRef } from 'react';
|
|
12
|
+
import React, { forwardRef } from 'react';
|
|
14
13
|
import { Input } from './Input';
|
|
15
|
-
var TextInput = forwardRef(function (props, ref) { return (
|
|
14
|
+
var TextInput = forwardRef(function (props, ref) { return (React.createElement(Input, __assign({}, props, { keyboardType: "default", ref: ref }))); });
|
|
16
15
|
export { TextInput };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
var __assign = (this && this.__assign) || function () {
|
|
6
2
|
__assign = Object.assign || function(t) {
|
|
7
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -24,18 +20,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
20
|
}
|
|
25
21
|
return t;
|
|
26
22
|
};
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
23
|
+
import React, { forwardRef } from 'react';
|
|
24
|
+
import { useBreakpoint } from '../../hooks';
|
|
25
|
+
import { useTheme } from '../../styled.native';
|
|
26
|
+
import { calculateLineHeight } from '../../theme';
|
|
30
27
|
import { pxToNumber } from '../../utils';
|
|
31
28
|
import { Input } from './Input';
|
|
32
|
-
var StyledInput = styled(Input)(function (_a) {
|
|
33
|
-
var core = _a.theme.core, rows = _a.rows;
|
|
34
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", " ", " ", " ", ";\n height: ", "px;\n "], ["\n padding: ", " ", " ", " ", ";\n height: ", "px;\n "])), core.space[3], core.space[2], core.space[2], core.space[2], pxToNumber(core.space[8]) * rows);
|
|
35
|
-
});
|
|
36
29
|
var TextareaInput = forwardRef(function (_a, ref) {
|
|
37
30
|
var _b = _a.rows, rows = _b === void 0 ? 3 : _b, rest = __rest(_a, ["rows"]);
|
|
38
|
-
|
|
31
|
+
var input = useTheme().input;
|
|
32
|
+
var smallAndUp = useBreakpoint().smallAndUp;
|
|
33
|
+
var height = pxToNumber(input.padding) * 2 +
|
|
34
|
+
pxToNumber(calculateLineHeight(smallAndUp ? input.fontSize[1] : input.fontSize[0], input.lineHeight)) *
|
|
35
|
+
rows;
|
|
36
|
+
return (React.createElement(Input, __assign({}, rest, { keyboardType: "default", multiline: true, textAlignVertical: "top", style: { height: height }, ref: ref })));
|
|
39
37
|
});
|
|
40
38
|
export { TextareaInput };
|
|
41
|
-
var templateObject_1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CurrencyInput } from './CurrencyInput';
|
|
2
2
|
export { EmailInput } from './EmailInput';
|
|
3
3
|
export { NumberInput } from './NumberInput';
|
|
4
|
-
export {
|
|
4
|
+
export { TelInput } from './TelInput';
|
|
5
5
|
export { TextInput } from './TextInput';
|
|
6
6
|
export { PasswordInput } from './PasswordInput';
|
|
7
7
|
export { TextareaInput } from './TextareaInput';
|
|
@@ -3,13 +3,12 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled, { css } from '../../styled.native';
|
|
6
|
+
import { calculateLineHeight } from '../../theme';
|
|
6
7
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
7
8
|
var StyledLabelText = styled.Text(function (_a) {
|
|
8
|
-
var
|
|
9
|
-
var fontSize = smallAndUp
|
|
10
|
-
|
|
11
|
-
: core.fontSize.body.small;
|
|
12
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body.small, semantic.message.base, fontSize);
|
|
9
|
+
var field = _a.theme.field, smallAndUp = _a.smallAndUp;
|
|
10
|
+
var fontSize = smallAndUp ? field.fontSize[1] : field.fontSize[0];
|
|
11
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), field.label.fontFamily, calculateLineHeight(fontSize, field.lineHeight), field.label.color, fontSize);
|
|
13
12
|
});
|
|
14
13
|
var LabelText = styledComponentWithBreakpoints(StyledLabelText);
|
|
15
14
|
export { LabelText };
|
|
@@ -24,63 +24,70 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
-
import {
|
|
28
|
-
import { Children } from 'react';
|
|
27
|
+
import React, { Children, useContext, } from 'react';
|
|
29
28
|
import { View } from 'react-native';
|
|
30
29
|
import { useBreakpoint } from '../../hooks';
|
|
31
|
-
import styled, { css } from '../../styled.native';
|
|
30
|
+
import styled, { css, ThemeContext } from '../../styled.native';
|
|
32
31
|
import { pxToNumber, styledComponentWithBreakpoints } from '../../utils';
|
|
33
32
|
import { Stack } from '../Stack';
|
|
34
33
|
var UlBullet = styled.View(function (_a) {
|
|
35
|
-
var _b = _a.theme,
|
|
34
|
+
var _b = _a.theme, colors = _b.colors, list = _b.list, _c = _a.visible, visible = _c === void 0 ? true : _c, smallAndUp = _a.smallAndUp;
|
|
36
35
|
var lineHeight = smallAndUp
|
|
37
|
-
?
|
|
38
|
-
:
|
|
39
|
-
var topMargin = (pxToNumber(lineHeight) - pxToNumber(
|
|
40
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "], ["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "])),
|
|
36
|
+
? list.listItem.lineHeight[1]
|
|
37
|
+
: list.listItem.lineHeight[0];
|
|
38
|
+
var topMargin = (pxToNumber(lineHeight) - pxToNumber(list.listItem.bulletWidth)) / 2;
|
|
39
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "], ["\n margin-right: ", ";\n margin-top: ", "px;\n width: ", ";\n height: ", ";\n background-color: ", ";\n "])), list.listItem.bulletGap, topMargin, list.listItem.bulletWidth, list.listItem.bulletWidth, visible ? colors.body : 'transparent');
|
|
41
40
|
});
|
|
42
41
|
var StyledBullet = styled.Text(function (_a) {
|
|
43
|
-
var _b = _a.theme,
|
|
42
|
+
var _b = _a.theme, text = _b.text, list = _b.list, space = _b.space, smallAndUp = _a.smallAndUp;
|
|
44
43
|
var fontSize = smallAndUp
|
|
45
|
-
?
|
|
46
|
-
:
|
|
44
|
+
? list.listItem.fontSize[1]
|
|
45
|
+
: list.listItem.fontSize[0];
|
|
47
46
|
var lineHeight = smallAndUp
|
|
48
|
-
?
|
|
49
|
-
:
|
|
50
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "])),
|
|
47
|
+
? list.listItem.lineHeight[1]
|
|
48
|
+
: list.listItem.lineHeight[0];
|
|
49
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n margin-right: ", ";\n width: ", ";\n text-align: right;\n "])), text.fontFamily, lineHeight, text.color, fontSize, list.listItem.bulletGap, space[4]);
|
|
51
50
|
});
|
|
52
51
|
var StyledUlItem = styled.View(function () { return 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 "]))); });
|
|
53
52
|
var Bullet = styledComponentWithBreakpoints(StyledBullet);
|
|
54
53
|
var ListBulletItem = function (_a) {
|
|
55
54
|
var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b;
|
|
56
|
-
return (
|
|
55
|
+
return (React.createElement(StyledUlItem, null,
|
|
56
|
+
React.createElement(UlBullet, { visible: showBullets }),
|
|
57
|
+
children));
|
|
57
58
|
};
|
|
58
59
|
var ListNumberedItem = function (_a) {
|
|
59
60
|
var children = _a.children, prefix = _a.prefix;
|
|
60
|
-
return (
|
|
61
|
+
return (React.createElement(View, { style: { flexDirection: 'row' } },
|
|
62
|
+
React.createElement(Bullet, null, prefix),
|
|
63
|
+
children));
|
|
61
64
|
};
|
|
62
65
|
var StyledList = styled.View(function (_a) {
|
|
63
|
-
var
|
|
64
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), smallAndUp ?
|
|
66
|
+
var list = _a.theme.list, smallAndUp = _a.smallAndUp;
|
|
67
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), smallAndUp ? list.marginTop[1] : list.marginTop[0], smallAndUp ? list.marginBottom[1] : list.marginBottom[0]);
|
|
65
68
|
});
|
|
66
69
|
var ListWrapper = styledComponentWithBreakpoints(StyledList);
|
|
67
70
|
var Ul = function (_a) {
|
|
68
71
|
var children = _a.children, _b = _a.showBullets, showBullets = _b === void 0 ? true : _b, rest = __rest(_a, ["children", "showBullets"]);
|
|
69
|
-
|
|
72
|
+
var list = useContext(ThemeContext).list;
|
|
73
|
+
return (React.createElement(ListWrapper, __assign({}, rest),
|
|
74
|
+
React.createElement(Stack, { spaceBetween: list.listItem.marginVertical }, Children.map(children, function (child) { return (React.createElement(ListBulletItem, { showBullets: showBullets }, child)); }))));
|
|
70
75
|
};
|
|
71
76
|
var Ol = function (_a) {
|
|
72
77
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
73
|
-
|
|
78
|
+
var list = useContext(ThemeContext).list;
|
|
79
|
+
return (React.createElement(ListWrapper, __assign({}, rest),
|
|
80
|
+
React.createElement(Stack, { spaceBetween: list.listItem.marginVertical }, Children.map(children, function (child, index) { return (React.createElement(ListNumberedItem, { prefix: index + 1 + '.' }, child)); }))));
|
|
74
81
|
};
|
|
75
82
|
var StyledLi = styled.Text(function (_a) {
|
|
76
|
-
var _b = _a.theme,
|
|
83
|
+
var _b = _a.theme, text = _b.text, list = _b.list, smallAndUp = _a.smallAndUp;
|
|
77
84
|
var fontSize = smallAndUp
|
|
78
|
-
?
|
|
79
|
-
:
|
|
85
|
+
? list.listItem.fontSize[1]
|
|
86
|
+
: list.listItem.fontSize[0];
|
|
80
87
|
var lineHeight = smallAndUp
|
|
81
|
-
?
|
|
82
|
-
:
|
|
83
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])),
|
|
88
|
+
? list.listItem.lineHeight[1]
|
|
89
|
+
: list.listItem.lineHeight[0];
|
|
90
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), text.fontFamily, lineHeight, text.color, fontSize);
|
|
84
91
|
});
|
|
85
92
|
var Li = styledComponentWithBreakpoints(StyledLi);
|
|
86
93
|
/**
|
|
@@ -100,9 +107,14 @@ var StyledDtText = styled.Text(function (_a) {
|
|
|
100
107
|
});
|
|
101
108
|
var DtText = styledComponentWithBreakpoints(StyledDtText);
|
|
102
109
|
var StyledDtItem = styled.View(function (_a) {
|
|
103
|
-
var
|
|
104
|
-
var marginTop = smallAndUp
|
|
105
|
-
|
|
110
|
+
var list = _a.theme.list, smallAndUp = _a.smallAndUp;
|
|
111
|
+
var marginTop = smallAndUp
|
|
112
|
+
? list.descriptionTerm.marginTop[1]
|
|
113
|
+
: list.descriptionTerm.marginTop[0];
|
|
114
|
+
var marginBottom = smallAndUp
|
|
115
|
+
? list.descriptionTerm.marginBottom[1]
|
|
116
|
+
: list.descriptionTerm.marginBottom[0];
|
|
117
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n flex-direction: row;\n "])), marginTop, marginBottom);
|
|
106
118
|
});
|
|
107
119
|
var DtItem = styledComponentWithBreakpoints(StyledDtItem);
|
|
108
120
|
/**
|
|
@@ -111,7 +123,8 @@ var DtItem = styledComponentWithBreakpoints(StyledDtItem);
|
|
|
111
123
|
* */
|
|
112
124
|
var Dt = function (_a) {
|
|
113
125
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
114
|
-
return (
|
|
126
|
+
return (React.createElement(DtItem, __assign({}, rest),
|
|
127
|
+
React.createElement(DtText, null, children)));
|
|
115
128
|
};
|
|
116
129
|
var StyledDdText = styled.Text(function (_a) {
|
|
117
130
|
var _b = _a.theme, text = _b.text, list = _b.list, smallAndUp = _a.smallAndUp;
|
|
@@ -130,7 +143,8 @@ var StyledDdText = styled.Text(function (_a) {
|
|
|
130
143
|
var Dd = function (_a) {
|
|
131
144
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
132
145
|
var breakpoints = useBreakpoint();
|
|
133
|
-
return (
|
|
146
|
+
return (React.createElement(View, __assign({ style: { flexDirection: 'row' } }, rest),
|
|
147
|
+
React.createElement(StyledDdText, __assign({}, breakpoints), children)));
|
|
134
148
|
};
|
|
135
149
|
export { Ul, Ol, Li, Dl, Dt, Dd, ListWrapper };
|
|
136
150
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|