@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
|
@@ -20,12 +20,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import React from 'react';
|
|
24
24
|
import { useBreakpoint } from '../../hooks';
|
|
25
25
|
import styled from '../../styled.native';
|
|
26
26
|
import { responsiveStyle } from '../../utils';
|
|
27
27
|
var StyledMargin = styled.View(function (_a) {
|
|
28
|
-
var space = _a.theme.
|
|
28
|
+
var space = _a.theme.space, mTop = _a.mTop, mBottom = _a.mBottom, mLeft = _a.mLeft, mRight = _a.mRight, horizontal = _a.horizontal, vertical = _a.vertical, all = _a.all, breakpoints = _a.breakpoints;
|
|
29
29
|
var formatter = function (spaceKey) {
|
|
30
30
|
return spaceKey === 0 ? '0' : space[spaceKey];
|
|
31
31
|
};
|
|
@@ -42,6 +42,6 @@ var StyledMargin = styled.View(function (_a) {
|
|
|
42
42
|
var Margin = function (_a) {
|
|
43
43
|
var top = _a.top, bottom = _a.bottom, left = _a.left, right = _a.right, rest = __rest(_a, ["top", "bottom", "left", "right"]);
|
|
44
44
|
var breakpoints = useBreakpoint();
|
|
45
|
-
return (
|
|
45
|
+
return (React.createElement(StyledMargin, __assign({}, rest, { breakpoints: breakpoints, mTop: top, mBottom: bottom, mLeft: left, mRight: right })));
|
|
46
46
|
};
|
|
47
47
|
export { Margin };
|
|
@@ -2,62 +2,60 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
import React from 'react';
|
|
17
6
|
import { TouchableOpacity, View } from 'react-native';
|
|
18
7
|
import Animated, { FadeIn, FadeOut, Layout } from 'react-native-reanimated';
|
|
19
8
|
import { Path, Svg } from 'react-native-svg';
|
|
20
9
|
import styled, { css } from '../../styled.native';
|
|
21
10
|
import { Heading3, Heading4 } from '../Heading';
|
|
22
11
|
var BackIcon = function () {
|
|
23
|
-
return (
|
|
12
|
+
return (React.createElement(Svg, { width: "10", height: "16", viewBox: "0 0 10 16" },
|
|
13
|
+
React.createElement(Path, { d: "M0.579956 8L8.57996 16L9.99996 14.58L3.41996 8L9.99996 1.42L8.57996 0L0.579956 8Z", fill: "white" })));
|
|
24
14
|
};
|
|
25
15
|
var StyledText = styled.Text(function (_a) {
|
|
26
|
-
var _b = _a.theme,
|
|
27
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "], ["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "])),
|
|
16
|
+
var _b = _a.theme, colors = _b.colors, fonts = _b.fonts, fontSizes = _b.fontSizes;
|
|
17
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "], ["\n color: ", ";\n font-size: ", ";\n font-family: ", ";\n "])), colors.primaryContrast, fontSizes[1], fonts.body);
|
|
28
18
|
});
|
|
29
19
|
var LeftHeaderText = styled(StyledText)(function (_a) {
|
|
30
|
-
var
|
|
31
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n "], ["\n padding-left: ", ";\n "])),
|
|
20
|
+
var space = _a.theme.space;
|
|
21
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n "], ["\n padding-left: ", ";\n "])), space[2]);
|
|
32
22
|
});
|
|
33
23
|
var HeadlineView = styled(Animated.View)(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 0 ", " ", ";\n "], ["\n padding: 0 ", " ", ";\n "])),
|
|
24
|
+
var space = _a.theme.space;
|
|
25
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 0 ", " ", ";\n "], ["\n padding: 0 ", " ", ";\n "])), space[3], space[3]);
|
|
36
26
|
});
|
|
37
27
|
var RootView = styled.View(function (_a) {
|
|
38
|
-
var
|
|
39
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n "], ["\n background-color: ", ";\n overflow: hidden;\n "])),
|
|
28
|
+
var colors = _a.theme.colors;
|
|
29
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n "], ["\n background-color: ", ";\n overflow: hidden;\n "])), colors.primary);
|
|
40
30
|
});
|
|
41
31
|
var StyledView = styled(Animated.View)(function (_a) {
|
|
42
|
-
var
|
|
43
|
-
return 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 "])),
|
|
32
|
+
var space = _a.theme.space, marginTop = _a.marginTop;
|
|
33
|
+
return 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);
|
|
44
34
|
});
|
|
45
35
|
var StyledHeading4 = styled(Heading4)(function (_a) {
|
|
46
|
-
var _b = _a.theme,
|
|
47
|
-
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "], ["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "])),
|
|
36
|
+
var _b = _a.theme, fonts = _b.fonts, colors = _b.colors, textAlign = _a.textAlign;
|
|
37
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "], ["\n font-family: ", ";\n margin-top: 0;\n margin-bottom: 0;\n color: ", ";\n text-align: ", ";\n "])), fonts.bold, colors.primaryContrast, textAlign);
|
|
48
38
|
});
|
|
49
39
|
var StyledHeading3 = styled(Heading3)(function (_a) {
|
|
50
|
-
var
|
|
51
|
-
return 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 "])),
|
|
40
|
+
var colors = _a.theme.colors;
|
|
41
|
+
return 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);
|
|
52
42
|
});
|
|
53
43
|
export var NavHeader = function (_a) {
|
|
54
44
|
var options = _a.options, headline = _a.headline;
|
|
55
|
-
return (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
return (React.createElement(RootView, { layout: Layout === null || Layout === void 0 ? void 0 : Layout.duration(150) },
|
|
46
|
+
React.createElement(StyledView, { marginTop: options === null || options === void 0 ? void 0 : options.statusBarHeight },
|
|
47
|
+
(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.createElement(TouchableOpacity, { style: {
|
|
48
|
+
flexDirection: 'row',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
flex: 1,
|
|
51
|
+
flexGrow: 1,
|
|
52
|
+
flexShrink: 1,
|
|
53
|
+
}, onPress: options === null || options === void 0 ? void 0 : options.goBack },
|
|
54
|
+
React.createElement(BackIcon, null),
|
|
55
|
+
React.createElement(LeftHeaderText, null, "Back"))) : null,
|
|
56
|
+
React.createElement(Animated.View, { entering: FadeIn, exiting: FadeOut, style: { flex: 1, flexGrow: 3, flexShrink: 1 } },
|
|
57
|
+
React.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 : ' ')),
|
|
58
|
+
React.createElement(View, { style: { flex: 1, flexGrow: 1, flexShrink: 1 } }, options.headerRight ? options.headerRight() : null)),
|
|
59
|
+
headline ? (React.createElement(HeadlineView, { entering: FadeIn, exiting: FadeOut }, (options === null || options === void 0 ? void 0 : options.title) ? (React.createElement(StyledHeading3, null, options.title)) : null)) : null));
|
|
62
60
|
};
|
|
63
61
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -24,52 +24,69 @@ 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, { forwardRef, useContext, useState, } from 'react';
|
|
29
28
|
import { View } from 'react-native';
|
|
30
|
-
import
|
|
29
|
+
import { useBreakpoint } from '../../hooks';
|
|
30
|
+
import styled, { css, ThemeContext } from '../../styled.native';
|
|
31
31
|
import { Icon } from '../Icon';
|
|
32
|
+
var pxToNumber = function (value) { return parseInt(value.replace('px', '')); };
|
|
33
|
+
var numberToPx = function (value) { return "".concat(value, "px"); };
|
|
32
34
|
var NotificationBox = styled.View(function (_a) {
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
+
var _b = _a.theme, colors = _b.colors, notification = _b.notification, space = _b.space, variant = _a.variant, noMargin = _a.noMargin;
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
var currentVariant = notification.variants[variant];
|
|
38
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "])), notification.borderWidth, currentVariant.borderColor, notification.borderRadius, noMargin ? 0 : space[4], colors.canvas);
|
|
35
39
|
});
|
|
36
40
|
export var NotificationContentBox = styled.View(function (_a) {
|
|
37
|
-
var
|
|
38
|
-
|
|
41
|
+
var _b = _a.theme, colors = _b.colors, _c = _b.notification, paddingX = _c.paddingX, paddingY = _c.paddingY, variants = _c.variants, smallAndUp = _a.smallAndUp, variant = _a.variant;
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
var currentVariant = variants[variant];
|
|
44
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "], ["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "])), paddingX[smallAndUp ? 1 : 0], paddingY[smallAndUp ? 1 : 0], currentVariant.textColor, colors.body, currentVariant.textColor);
|
|
39
45
|
});
|
|
40
46
|
export var NotificationTitleBox = styled.View(function (_a) {
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
var notification = _a.theme.notification, variant = _a.variant, dismissable = _a.dismissable, smallAndUp = _a.smallAndUp;
|
|
48
|
+
// @ts-ignore to support additional palettes.
|
|
49
|
+
var currentVariant = notification.variants[variant];
|
|
50
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.background, notification.paddingX[smallAndUp ? 1 : 0], notification.paddingX[smallAndUp ? 1 : 0], notification.paddingY[smallAndUp ? 1 : 0], dismissable
|
|
51
|
+
? numberToPx(pxToNumber(notification.dismiss.touchSize) -
|
|
52
|
+
pxToNumber(notification.dismiss.size))
|
|
53
|
+
: notification.paddingY[smallAndUp ? 1 : 0]);
|
|
44
54
|
});
|
|
45
55
|
var NotificationTitleText = styled.Text(function (_a) {
|
|
46
|
-
var _b = _a.theme,
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
var _b = _a.theme, fonts = _b.fonts, responsiveFontSizes = _b.responsiveFontSizes, notification = _b.notification, variant = _a.variant;
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
var currentVariant = notification.variants[variant];
|
|
59
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n "])), currentVariant.textColor, fonts.bold, responsiveFontSizes.body[0]);
|
|
49
60
|
});
|
|
50
|
-
var DismissButton = styled.TouchableOpacity(function () {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var StyledIcon = styled(Icon)(function (_a) {
|
|
54
|
-
var semantic = _a.theme.semantic, variant = _a.variant;
|
|
55
|
-
var currentVariant = semantic[variant];
|
|
56
|
-
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), currentVariant.message);
|
|
61
|
+
var DismissButton = styled.TouchableOpacity(function (_a) {
|
|
62
|
+
var notification = _a.theme.notification;
|
|
63
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "], ["\n position: absolute;\n top: 0;\n right: 0;\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "])), notification.dismiss.touchSize, notification.dismiss.touchSize);
|
|
57
64
|
});
|
|
58
65
|
export var Notification = forwardRef(function (_a, ref) {
|
|
59
|
-
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin,
|
|
66
|
+
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissable = _a.dismissable, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissable", "onDismiss"]);
|
|
67
|
+
var breakpoints = useBreakpoint();
|
|
68
|
+
var theme = useContext(ThemeContext);
|
|
60
69
|
var _c = useState(false), dismissed = _c[0], setDismissed = _c[1];
|
|
61
|
-
if (dismissed || !children) {
|
|
70
|
+
if (dismissed || (!title && !children)) {
|
|
62
71
|
return null;
|
|
63
72
|
}
|
|
64
|
-
return (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
return (React.createElement(View, __assign({ ref: ref }, rest),
|
|
74
|
+
React.createElement(NotificationBox, __assign({ variant: variant, noMargin: noMargin, testID: "nb-notification" }, breakpoints),
|
|
75
|
+
!!title ? (React.createElement(NotificationTitleBox, __assign({ variant: variant, dismissable: dismissable }, breakpoints),
|
|
76
|
+
React.createElement(View, null, typeof title === 'string' ? (React.createElement(NotificationTitleText, { variant: variant }, title)) : (title)))) : null,
|
|
77
|
+
dismissable ? (React.createElement(DismissButton, { accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
|
|
78
|
+
setDismissed(true);
|
|
79
|
+
if (onDismiss) {
|
|
80
|
+
onDismiss();
|
|
81
|
+
}
|
|
82
|
+
} },
|
|
83
|
+
React.createElement(Icon, { name: theme.notification.dismiss.icon, size: theme.notification.dismiss.size,
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
color: theme.notification.variants[variant].textColor }))) : null,
|
|
86
|
+
children ? (React.createElement(NotificationContentBox, __assign({ "data-testid": "el-notification-box", variant: variant }, breakpoints), children)) : null)));
|
|
70
87
|
});
|
|
71
|
-
export var ErrorNotification = forwardRef(function (props, ref) { return
|
|
72
|
-
export var SuccessNotification = forwardRef(function (props, ref) { return (
|
|
73
|
-
export var InfoNotification = forwardRef(function (props, ref) { return
|
|
74
|
-
export var WarningNotification = forwardRef(function (props, ref) { return
|
|
75
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5
|
|
88
|
+
export var ErrorNotification = forwardRef(function (props, ref) { return (React.createElement(Notification, __assign({ ref: ref, variant: "error", title: "Oops, there\u2019s a problem\u2026" }, props))); });
|
|
89
|
+
export var SuccessNotification = forwardRef(function (props, ref) { return (React.createElement(Notification, __assign({ ref: ref, variant: "success" }, props))); });
|
|
90
|
+
export var InfoNotification = forwardRef(function (props, ref) { return React.createElement(Notification, __assign({ ref: ref, variant: "info" }, props)); });
|
|
91
|
+
export var WarningNotification = forwardRef(function (props, ref) { return React.createElement(Notification, __assign({ ref: ref, variant: "warning" }, props)); });
|
|
92
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
};
|
|
1
5
|
var __assign = (this && this.__assign) || function () {
|
|
2
6
|
__assign = Object.assign || function(t) {
|
|
3
7
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -20,42 +24,60 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
24
|
}
|
|
21
25
|
return t;
|
|
22
26
|
};
|
|
23
|
-
import
|
|
24
|
-
import { forwardRef } from 'react';
|
|
27
|
+
import React, { forwardRef } from 'react';
|
|
25
28
|
import { TouchableOpacity, View, } from 'react-native';
|
|
26
29
|
import styled from '../../styled.native';
|
|
30
|
+
import { pxToNumber } from '../../utils';
|
|
27
31
|
import { HintText } from '../HintText';
|
|
28
32
|
import { LabelText } from '../LabelText';
|
|
29
33
|
var StyledRadioInputWrapper = styled.View(function (_a) {
|
|
30
|
-
var
|
|
31
|
-
|
|
34
|
+
var radio = _a.theme.radio;
|
|
35
|
+
var radioSize = pxToNumber(radio.size);
|
|
36
|
+
var gap = pxToNumber(radio.gap);
|
|
37
|
+
return "\n width: ".concat(radioSize + gap, "px;\n height: ").concat(radio.touchSize, ";\n ");
|
|
32
38
|
});
|
|
33
39
|
var StyledRadioInput = styled.View(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
var radio = _a.theme.radio, invalid = _a.invalid, checked = _a.checked;
|
|
41
|
+
var touchSize = pxToNumber(radio.touchSize);
|
|
42
|
+
var radioSize = pxToNumber(radio.size);
|
|
43
|
+
var radioDistance = (touchSize - radioSize) / 2;
|
|
44
|
+
return "\n width: ".concat(radio.size, ";\n height: ").concat(radio.size, ";\n border: ").concat(radio.borderWidth, " solid;\n margin-top: ").concat(radioDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n border-color: ").concat(invalid
|
|
45
|
+
? radio.errorColor
|
|
37
46
|
: checked
|
|
38
|
-
?
|
|
39
|
-
:
|
|
47
|
+
? radio.dotColor
|
|
48
|
+
: radio.borderColor, ";\n background: ").concat(radio.background, ";\n background: ").concat(checked ? radio.checkedBackground : radio.background, ";\n ");
|
|
40
49
|
});
|
|
41
50
|
var StyledRadioInputDot = styled.View(function (_a) {
|
|
42
|
-
var
|
|
43
|
-
|
|
51
|
+
var radio = _a.theme.radio, checked = _a.checked;
|
|
52
|
+
var radioSize = pxToNumber(radio.size);
|
|
53
|
+
var dotSize = pxToNumber(radio.dotSize);
|
|
54
|
+
var borderWidth = pxToNumber(radio.borderWidth);
|
|
55
|
+
var dotDistance = (radioSize - dotSize) / 2 - borderWidth;
|
|
56
|
+
return "\n width: ".concat(radio.dotSize, ";\n height: ").concat(radio.dotSize, ";\n margin: ").concat(dotDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n background: ").concat(radio.dotColor, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
44
57
|
});
|
|
45
58
|
var Input = function (_a) {
|
|
46
59
|
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
47
|
-
return (
|
|
60
|
+
return (React.createElement(StyledRadioInputWrapper, __assign({}, rest),
|
|
61
|
+
React.createElement(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID },
|
|
62
|
+
React.createElement(StyledRadioInputDot, { checked: checked }))));
|
|
48
63
|
};
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
return "\n padding-top: ".concat(
|
|
64
|
+
var RadioLabelText = styled(LabelText)(function (_a) {
|
|
65
|
+
var space = _a.theme.space;
|
|
66
|
+
return "\n padding-top: ".concat(space[3], ";\n ");
|
|
52
67
|
});
|
|
68
|
+
var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
53
69
|
var Radio = forwardRef(function (_a, ref) {
|
|
54
70
|
var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
|
|
55
71
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
56
72
|
value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
57
73
|
_b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
58
74
|
activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
|
|
59
|
-
return (
|
|
75
|
+
return (React.createElement(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest),
|
|
76
|
+
React.createElement(StyledWrapper, null,
|
|
77
|
+
React.createElement(Input, { checked: checked, invalid: invalid, testID: testID }),
|
|
78
|
+
React.createElement(View, { style: { flexShrink: 1 } },
|
|
79
|
+
React.createElement(RadioLabelText, null, label),
|
|
80
|
+
hint ? React.createElement(HintText, null, hint) : null))));
|
|
60
81
|
});
|
|
61
82
|
export { Radio };
|
|
83
|
+
var templateObject_1;
|
|
@@ -20,8 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import {
|
|
24
|
-
import { Children, cloneElement } from 'react';
|
|
23
|
+
import React, { Children, cloneElement, } from 'react';
|
|
25
24
|
import { View } from 'react-native';
|
|
26
25
|
import { callAll } from '../../utils';
|
|
27
26
|
import { ErrorText } from '../ErrorText';
|
|
@@ -32,14 +31,22 @@ import { Stack } from '../Stack';
|
|
|
32
31
|
var RadioField = function (_a) {
|
|
33
32
|
var label = _a.label, hint = _a.hint, error = _a.error, children = _a.children, _b = _a.optional, optional = _b === void 0 ? false : _b, value = _a.value, onValueChange = _a.onValueChange, rest = __rest(_a, ["label", "hint", "error", "children", "optional", "value", "onValueChange"]);
|
|
34
33
|
var hasError = !!error;
|
|
35
|
-
return (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
return (React.createElement(FormGroup, __assign({}, rest, { error: hasError }),
|
|
35
|
+
React.createElement(Stack, { spaceBetween: 1 },
|
|
36
|
+
React.createElement(View, null,
|
|
37
|
+
React.createElement(LabelText, null,
|
|
38
|
+
label,
|
|
39
|
+
optional ? ' (optional)' : null),
|
|
40
|
+
hint ? React.createElement(HintText, null, hint) : null,
|
|
41
|
+
error ? React.createElement(ErrorText, null, error) : null),
|
|
42
|
+
React.createElement(View, { accessibilityRole: "radiogroup" }, Children.map(children, function (child) {
|
|
43
|
+
return cloneElement(child, {
|
|
44
|
+
invalid: hasError ? true : child.props.invalid,
|
|
45
|
+
checked: child.props.checked != null
|
|
46
|
+
? child.props.checked
|
|
47
|
+
: value && (value === child.props.value ? true : false),
|
|
48
|
+
onPress: callAll(onValueChange && (function () { return onValueChange(child.props.value); }), child.props.onPress),
|
|
49
|
+
});
|
|
50
|
+
})))));
|
|
44
51
|
};
|
|
45
52
|
export { RadioField };
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
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 { useEffect, useRef } from 'react';
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
14
2
|
import { View, Animated, Platform } from 'react-native';
|
|
15
3
|
export var SkeletonAnimation = function (_a) {
|
|
16
4
|
var children = _a.children, _b = _a.animation, animation = _b === void 0 ? 'pulse' : _b, testID = _a.testID;
|
|
@@ -29,14 +17,14 @@ export var SkeletonAnimation = function (_a) {
|
|
|
29
17
|
animationRef.current.setValue(0);
|
|
30
18
|
Animated.loop(animationLoop.current).start();
|
|
31
19
|
}, []);
|
|
32
|
-
return (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
20
|
+
return (React.createElement(View, { accessibilityRole: "none", accessibilityLabel: "loading...", accessible: false, testID: testID }, animation === 'pulse' ? (React.createElement(Animated.View, { style: [
|
|
21
|
+
{
|
|
22
|
+
height: '100%',
|
|
23
|
+
width: '100%',
|
|
24
|
+
opacity: animationRef.current.interpolate({
|
|
25
|
+
inputRange: [0.25, 1, 2],
|
|
26
|
+
outputRange: [1, 0.25, 1],
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
] }, children)) : (React.createElement(View, null, children))));
|
|
42
30
|
};
|
|
@@ -20,16 +20,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import React from 'react';
|
|
24
24
|
import styled from '../../styled.native';
|
|
25
25
|
import { P } from '../Text';
|
|
26
26
|
import { Skeleton } from './Skeleton';
|
|
27
27
|
import { SkeletonAnimation } from './SkeletonAnimation';
|
|
28
28
|
var StyledSkeletonCTA = styled(Skeleton)(function (_a) {
|
|
29
|
-
var
|
|
30
|
-
return "\n background-color: ".concat(
|
|
29
|
+
var _b = _a.theme, colors = _b.colors, space = _b.space, size = _a.size;
|
|
30
|
+
return "\n background-color: ".concat(colors.borderMuted, ";\n width: ").concat(size, ";\n height: ").concat(space[12], ";\n ");
|
|
31
31
|
});
|
|
32
32
|
export var SkeletonCTA = function (_a) {
|
|
33
33
|
var _b = _a.size, size = _b === void 0 ? '250px' : _b, rest = __rest(_a, ["size"]);
|
|
34
|
-
return (
|
|
34
|
+
return (React.createElement(SkeletonAnimation, null,
|
|
35
|
+
React.createElement(StyledSkeletonCTA, __assign({ as: P, size: size }, rest))));
|
|
35
36
|
};
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import React from 'react';
|
|
24
24
|
import styled from '../../styled.native';
|
|
25
25
|
import { pxToNumber } from '../../utils';
|
|
26
26
|
import { Skeleton } from './Skeleton';
|
|
@@ -30,10 +30,12 @@ var StyledSkeletonCircleWrapper = styled(Skeleton)(function (_a) {
|
|
|
30
30
|
return "width: ".concat(size, "; max-width: 100%;");
|
|
31
31
|
});
|
|
32
32
|
var StyledSkeletonCircle = styled(Skeleton)(function (_a) {
|
|
33
|
-
var
|
|
34
|
-
return "\n background-color: ".concat(
|
|
33
|
+
var colors = _a.theme.colors, size = _a.size;
|
|
34
|
+
return "\n background-color: ".concat(colors.borderMuted, ";\n height: 0;\n padding-bottom: 100%;\n border-radius: ").concat(pxToNumber(size) / 2, "px;\n ");
|
|
35
35
|
});
|
|
36
36
|
export var SkeletonCircle = function (_a) {
|
|
37
37
|
var _b = _a.size, size = _b === void 0 ? '120px' : _b, rest = __rest(_a, ["size"]);
|
|
38
|
-
return (
|
|
38
|
+
return (React.createElement(SkeletonAnimation, null,
|
|
39
|
+
React.createElement(StyledSkeletonCircleWrapper, __assign({ size: size }, rest),
|
|
40
|
+
React.createElement(StyledSkeletonCircle, { size: size }))));
|
|
39
41
|
};
|
|
@@ -20,16 +20,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import React from 'react';
|
|
24
24
|
import styled from '../../styled.native';
|
|
25
25
|
import { Heading3 } from '../Heading';
|
|
26
26
|
import { Skeleton } from './Skeleton';
|
|
27
27
|
import { SkeletonAnimation } from './SkeletonAnimation';
|
|
28
28
|
var StyledSkeletonHeading = styled(Skeleton)(function (_a) {
|
|
29
|
-
var
|
|
30
|
-
return "\n background-color: ".concat(
|
|
29
|
+
var colors = _a.theme.colors, size = _a.size;
|
|
30
|
+
return "\n background-color: ".concat(colors.borderMuted, ";\n width: ").concat(size, ";\n ");
|
|
31
31
|
});
|
|
32
32
|
export var SkeletonHeading = function (_a) {
|
|
33
33
|
var _b = _a.size, size = _b === void 0 ? '70%' : _b, _c = _a.headingComponent, Heading = _c === void 0 ? Heading3 : _c, rest = __rest(_a, ["size", "headingComponent"]);
|
|
34
|
-
return (
|
|
34
|
+
return (React.createElement(SkeletonAnimation, null,
|
|
35
|
+
React.createElement(StyledSkeletonHeading, __assign({ "aria-hidden": "true", size: size, as: Heading }, rest), "\u00A0")));
|
|
35
36
|
};
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import
|
|
23
|
+
import React from 'react';
|
|
24
24
|
import { useBreakpoint } from '../../hooks';
|
|
25
25
|
import styled from '../../styled.native';
|
|
26
26
|
import { responsiveStyle } from '../../utils';
|
|
@@ -28,15 +28,15 @@ import { P } from '../Text';
|
|
|
28
28
|
import { Skeleton } from './Skeleton';
|
|
29
29
|
import { SkeletonAnimation } from './SkeletonAnimation';
|
|
30
30
|
var StyledSkeletonText = styled(Skeleton)(function (_a) {
|
|
31
|
-
var
|
|
32
|
-
return "\n background-color: ".concat(
|
|
31
|
+
var _b = _a.theme, colors = _b.colors, space = _b.space, responsiveFontSizes = _b.responsiveFontSizes, short = _a.short, breakpoints = _a.breakpoints;
|
|
32
|
+
return "\n background-color: ".concat(colors.borderMuted, ";\n margin-bottom: ").concat(space[2], ";\n ").concat(responsiveStyle('height', responsiveFontSizes.body, breakpoints), "\n\n ").concat(short ? 'width: 50%' : '', ";\n ");
|
|
33
33
|
});
|
|
34
34
|
export var SkeletonText = function (_a) {
|
|
35
35
|
var _b = _a.lines, lines = _b === void 0 ? 1 : _b, rest = __rest(_a, ["lines"]);
|
|
36
36
|
var breakpoints = useBreakpoint();
|
|
37
37
|
var generatedLines = [];
|
|
38
38
|
for (var i = 1; i <= lines; i++) {
|
|
39
|
-
generatedLines.push(
|
|
39
|
+
generatedLines.push(React.createElement(StyledSkeletonText, { key: "line-".concat(i), short: i === lines, breakpoints: breakpoints }));
|
|
40
40
|
}
|
|
41
|
-
return (
|
|
41
|
+
return (React.createElement(P, __assign({ as: SkeletonAnimation }, rest), generatedLines));
|
|
42
42
|
};
|
|
@@ -20,8 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import {
|
|
24
|
-
import { Children } from 'react';
|
|
23
|
+
import React, { Children } from 'react';
|
|
25
24
|
import { View } from 'react-native';
|
|
26
25
|
import styled from '../../styled.native';
|
|
27
26
|
import { responsiveStyle, styledComponentWithBreakpoints } from '../../utils';
|
|
@@ -33,12 +32,12 @@ var Stack = function (_a) {
|
|
|
33
32
|
filteredChildren.push(child);
|
|
34
33
|
}
|
|
35
34
|
});
|
|
36
|
-
return (
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
return (React.createElement(View, __assign({}, rest), Children.map(filteredChildren, function (child, index) {
|
|
36
|
+
return index === 0 ? (child) : (React.createElement(StackItem, { spaceBetween: spaceBetween }, child));
|
|
37
|
+
})));
|
|
39
38
|
};
|
|
40
39
|
var StyledStackItem = styled.View(function (_a) {
|
|
41
|
-
var space = _a.theme.
|
|
40
|
+
var space = _a.theme.space, spaceBetween = _a.spaceBetween, smallAndUp = _a.smallAndUp, mediumAndUp = _a.mediumAndUp, largeAndUp = _a.largeAndUp;
|
|
42
41
|
var formatter = function (spaceKey) { return space[spaceKey]; };
|
|
43
42
|
var breakpoints = { smallAndUp: smallAndUp, mediumAndUp: mediumAndUp, largeAndUp: largeAndUp };
|
|
44
43
|
return responsiveStyle('margin-top', spaceBetween, breakpoints, formatter);
|
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import
|
|
12
|
+
import React from 'react';
|
|
13
13
|
import { useBreakpoint } from '../../hooks';
|
|
14
14
|
import styled from '../../styled.native';
|
|
15
15
|
var StyledStretch = styled.View(function (_a) {
|
|
@@ -20,5 +20,5 @@ var StyledStretch = styled.View(function (_a) {
|
|
|
20
20
|
});
|
|
21
21
|
export var Stretch = function (props) {
|
|
22
22
|
var smallAndUp = useBreakpoint().smallAndUp;
|
|
23
|
-
return
|
|
23
|
+
return React.createElement(StyledStretch, __assign({ smallAndUp: smallAndUp }, props));
|
|
24
24
|
};
|
|
@@ -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 StyledSubLabelText = 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.body.native, core.lineHeight.body.small, semantic.message.secondary, 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.fontFamily, calculateLineHeight(fontSize, field.lineHeight), field.subLabel.color, fontSize);
|
|
13
12
|
});
|
|
14
13
|
var SubLabelText = styledComponentWithBreakpoints(StyledSubLabelText);
|
|
15
14
|
export { SubLabelText };
|