@ovotech/element-native 2.0.4 → 2.2.0-canary-1cac2ba-73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.js +23 -22
- package/dist/components/Accordion/Icon.js +7 -10
- package/dist/components/Accordion/styles.d.ts +688 -46
- package/dist/components/Accordion/styles.js +56 -49
- package/dist/components/Accordion/types.d.ts +1 -0
- package/dist/components/Badge/Badge.d.ts +238 -8
- package/dist/components/Badge/Badge.js +35 -14
- package/dist/components/CTAButton/CTAButton.d.ts +7 -12
- package/dist/components/CTAButton/CTAButton.js +18 -19
- package/dist/components/CTALink/CTALink.d.ts +3 -4
- package/dist/components/Card/Card.d.ts +228 -5
- package/dist/components/Card/Card.js +5 -25
- package/dist/components/Checkbox/Checkbox.js +19 -26
- package/dist/components/DataTable/DataTable.d.ts +3 -12
- package/dist/components/DataTable/DataTable.js +8 -71
- package/dist/components/DataTable/TableRow.d.ts +2 -0
- package/dist/components/DataTable/TableRow.js +33 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +16 -0
- package/dist/components/DataTable/styles.d.ts +2517 -0
- package/dist/components/DataTable/styles.js +77 -0
- package/dist/components/DataTable/types.d.ts +15 -0
- package/dist/components/DataTable/types.js +2 -0
- package/dist/components/DateField/DateField.js +9 -9
- package/dist/components/DescriptionList/DescriptionList.d.ts +10 -0
- package/dist/components/DescriptionList/DescriptionList.js +66 -0
- package/dist/components/DescriptionList/index.d.ts +1 -0
- package/dist/components/DescriptionList/index.js +6 -0
- package/dist/components/DescriptionList/styled.d.ts +241 -0
- package/dist/components/DescriptionList/styled.js +88 -0
- package/dist/components/Disclosure/Disclosure.js +7 -10
- package/dist/components/Divider/Divider.d.ts +5 -0
- package/dist/components/Divider/Divider.js +45 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Divider/index.js +5 -0
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
- package/dist/components/ErrorText/ErrorText.d.ts +228 -1
- package/dist/components/ErrorText/ErrorText.js +1 -1
- package/dist/components/Field/Field.js +3 -3
- package/dist/components/Grid/Col.d.ts +229 -2
- package/dist/components/Grid/Row.d.ts +228 -1
- package/dist/components/Heading/Heading.js +8 -24
- package/dist/components/HintText/HintText.d.ts +228 -1
- package/dist/components/HintText/HintText.js +1 -1
- package/dist/components/Icon/Icon.d.ts +2 -3
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/Input/CurrencyInput.d.ts +2 -1
- package/dist/components/Input/EmailInput.d.ts +2 -1
- package/dist/components/Input/Input.d.ts +4 -2
- package/dist/components/Input/Input.js +16 -18
- package/dist/components/Input/NumberInput.d.ts +2 -1
- package/dist/components/Input/PasswordInput.d.ts +4 -1
- package/dist/components/Input/PasswordInput.js +4 -2
- package/dist/components/Input/PasswordInput.styled.d.ts +231 -0
- package/dist/components/Input/PasswordInput.styled.js +37 -0
- package/dist/components/Input/PasswordVisibilityToggle.d.ts +11 -0
- package/dist/components/Input/PasswordVisibilityToggle.js +51 -0
- package/dist/components/Input/{TelInput.d.ts → PhoneInput.d.ts} +3 -2
- package/dist/components/Input/{TelInput.js → PhoneInput.js} +3 -3
- package/dist/components/Input/TextInput.d.ts +2 -1
- package/dist/components/Input/TextareaInput.d.ts +2 -1
- package/dist/components/Input/TextareaInput.js +11 -9
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/LabelText/LabelText.d.ts +228 -1
- package/dist/components/LabelText/LabelText.js +1 -1
- package/dist/components/List/List.d.ts +706 -3
- package/dist/components/List/List.js +18 -5
- package/dist/components/Margin/Margin.d.ts +228 -1
- package/dist/components/NavHeader/NavHeader.d.ts +1 -0
- package/dist/components/NavHeader/NavHeader.js +11 -13
- package/dist/components/Notification/Notification.d.ts +466 -20
- package/dist/components/Notification/Notification.js +32 -44
- package/dist/components/Radio/Radio.js +18 -36
- package/dist/components/SelectField/Select.d.ts +244 -0
- package/dist/components/SelectField/Select.js +101 -0
- package/dist/components/SelectField/SelectField.d.ts +7 -0
- package/dist/components/SelectField/SelectField.js +38 -0
- package/dist/components/SelectField/index.d.ts +1 -0
- package/dist/components/SelectField/index.js +5 -0
- package/dist/components/SkeletonLoading/Skeleton.d.ts +228 -1
- package/dist/components/SkeletonLoading/SkeletonAnimation.d.ts +6 -0
- package/dist/components/SkeletonLoading/SkeletonAnimation.js +57 -0
- package/dist/components/SkeletonLoading/SkeletonCTA.js +3 -1
- package/dist/components/SkeletonLoading/SkeletonCircle.js +4 -2
- package/dist/components/SkeletonLoading/SkeletonHeading.js +3 -1
- package/dist/components/SkeletonLoading/SkeletonText.js +2 -2
- package/dist/components/SubLabelText/SubLabelText.d.ts +228 -1
- package/dist/components/SubLabelText/SubLabelText.js +1 -1
- package/dist/components/SummaryList/SummaryList.d.ts +4 -0
- package/dist/components/SummaryList/SummaryList.js +5 -0
- package/dist/components/Tabs/Tab.js +22 -19
- package/dist/components/Tabs/TabList.d.ts +11 -1
- package/dist/components/Tabs/TabList.js +19 -16
- package/dist/components/Tabs/TabPanel.js +32 -6
- package/dist/components/Tabs/Tabs.d.ts +8 -6
- package/dist/components/Tabs/Tabs.js +10 -6
- package/dist/components/Text/Text.d.ts +1140 -5
- package/dist/components/Text/Text.js +6 -10
- package/dist/components/TextField/CurrencyField.d.ts +2 -1
- package/dist/components/TextField/EmailField.d.ts +2 -1
- package/dist/components/TextField/NumberField.d.ts +2 -1
- package/dist/components/TextField/PasswordField.d.ts +4 -1
- package/dist/components/TextField/PasswordField.js +2 -2
- package/dist/components/TextField/PhoneField.d.ts +10 -0
- package/dist/components/TextField/PhoneField.js +56 -0
- package/dist/components/TextField/TelField.d.ts +6 -1
- package/dist/components/TextField/TelField.js +7 -2
- package/dist/components/TextField/TextField.d.ts +2 -1
- package/dist/components/TextField/TextareaField.d.ts +2 -1
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TextField/index.js +3 -1
- package/dist/components/TextLink/TextLink.js +2 -2
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/esm/components/Accordion/Accordion.js +26 -25
- package/dist/esm/components/Accordion/Icon.js +8 -8
- package/dist/esm/components/Accordion/styles.js +29 -48
- package/dist/esm/components/Badge/Badge.js +35 -14
- package/dist/esm/components/CTAButton/CTAButton.js +20 -21
- package/dist/esm/components/Card/Card.js +5 -25
- package/dist/esm/components/Checkbox/Checkbox.js +17 -27
- package/dist/esm/components/DataTable/DataTable.js +3 -66
- package/dist/esm/components/DataTable/TableRow.js +26 -0
- package/dist/esm/components/DataTable/index.js +2 -0
- package/dist/esm/components/DataTable/styles.js +51 -0
- package/dist/esm/components/DataTable/types.js +1 -0
- package/dist/esm/components/DateField/DateField.js +9 -9
- package/dist/esm/components/DescriptionList/DescriptionList.js +39 -0
- package/dist/esm/components/DescriptionList/index.js +1 -0
- package/dist/esm/components/DescriptionList/styled.js +57 -0
- package/dist/esm/components/Disclosure/Disclosure.js +9 -12
- package/dist/esm/components/Divider/Divider.js +15 -0
- package/dist/esm/components/Divider/index.js +1 -0
- package/dist/esm/components/ErrorText/ErrorText.js +1 -1
- package/dist/esm/components/Field/Field.js +3 -3
- package/dist/esm/components/Heading/Heading.js +8 -24
- package/dist/esm/components/HintText/HintText.js +1 -1
- package/dist/esm/components/Icon/Icon.js +2 -2
- package/dist/esm/components/Input/Input.js +18 -20
- package/dist/esm/components/Input/PasswordInput.js +4 -2
- package/dist/esm/components/Input/PasswordInput.styled.js +11 -0
- package/dist/esm/components/Input/PasswordVisibilityToggle.js +23 -0
- package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +2 -2
- package/dist/esm/components/Input/TextareaInput.js +11 -9
- package/dist/esm/components/Input/index.js +1 -1
- package/dist/esm/components/LabelText/LabelText.js +1 -1
- package/dist/esm/components/List/List.js +17 -5
- package/dist/esm/components/NavHeader/NavHeader.js +12 -14
- package/dist/esm/components/Notification/Notification.js +34 -46
- package/dist/esm/components/Radio/Radio.js +18 -36
- package/dist/esm/components/SelectField/Select.js +74 -0
- package/dist/esm/components/SelectField/SelectField.js +31 -0
- package/dist/esm/components/SelectField/index.js +1 -0
- package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +30 -0
- package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +3 -1
- package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +4 -2
- package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +3 -1
- package/dist/esm/components/SkeletonLoading/SkeletonText.js +2 -2
- package/dist/esm/components/SubLabelText/SubLabelText.js +1 -1
- package/dist/esm/components/SummaryList/SummaryList.js +5 -0
- package/dist/esm/components/Tabs/Tab.js +22 -16
- package/dist/esm/components/Tabs/TabList.js +18 -16
- package/dist/esm/components/Tabs/TabPanel.js +9 -6
- package/dist/esm/components/Tabs/Tabs.js +9 -6
- package/dist/esm/components/Text/Text.js +6 -10
- package/dist/esm/components/TextField/PasswordField.js +2 -2
- package/dist/esm/components/TextField/PhoneField.js +30 -0
- package/dist/esm/components/TextField/TelField.js +7 -2
- package/dist/esm/components/TextField/index.js +1 -0
- package/dist/esm/components/TextLink/TextLink.js +2 -2
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/providers/icons/Logo.js +6 -3
- package/dist/esm/theme/create-theme.js +2 -176
- package/dist/esm/theme/index.js +13 -2
- package/dist/providers/icons/Logo.js +5 -2
- package/dist/styled.native.d.ts +1363 -1
- package/dist/theme/create-theme.d.ts +1 -1
- package/dist/theme/create-theme.js +2 -176
- package/dist/theme/index.d.ts +228 -2
- package/dist/theme/index.js +13 -2
- package/dist/theme/theme.d.ts +1 -110
- package/package.json +12 -10
|
@@ -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++) {
|
|
@@ -27,59 +23,45 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
23
|
import React, { forwardRef } from 'react';
|
|
28
24
|
import { TouchableOpacity, View, } from 'react-native';
|
|
29
25
|
import styled from '../../styled.native';
|
|
30
|
-
import { pxToNumber } from '../../utils';
|
|
31
26
|
import { HintText } from '../HintText';
|
|
32
27
|
import { LabelText } from '../LabelText';
|
|
33
28
|
var StyledRadioInputWrapper = styled.View(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var gap = pxToNumber(radio.gap);
|
|
37
|
-
return "\n width: ".concat(radioSize + gap, "px;\n height: ").concat(radio.touchSize, ";\n ");
|
|
29
|
+
var core = _a.theme.core;
|
|
30
|
+
return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n margin-right: 10px;\n ");
|
|
38
31
|
});
|
|
39
32
|
var StyledRadioInput = styled.View(function (_a) {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
33
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
|
|
34
|
+
return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n border: ").concat(core.borderWidth.small, " solid;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n border-color: ").concat(invalid
|
|
35
|
+
? semantic.error.border
|
|
46
36
|
: checked
|
|
47
|
-
?
|
|
48
|
-
:
|
|
37
|
+
? core.color.blue.dark
|
|
38
|
+
: semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
|
|
49
39
|
});
|
|
50
40
|
var StyledRadioInputDot = styled.View(function (_a) {
|
|
51
|
-
var
|
|
52
|
-
|
|
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 ");
|
|
41
|
+
var core = _a.theme.core, checked = _a.checked;
|
|
42
|
+
return "\n width: ".concat(core.space[3], ";\n height: ").concat(core.space[3], ";\n border-radius: 50%;\n background: ").concat(core.color.blue.dark, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
57
43
|
});
|
|
58
44
|
var Input = function (_a) {
|
|
59
|
-
var checked = _a.checked, invalid = _a.invalid, rest = __rest(_a, ["checked", "invalid"]);
|
|
45
|
+
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
60
46
|
return (React.createElement(StyledRadioInputWrapper, __assign({}, rest),
|
|
61
|
-
React.createElement(StyledRadioInput, { invalid: invalid, checked: checked },
|
|
47
|
+
React.createElement(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID },
|
|
62
48
|
React.createElement(StyledRadioInputDot, { checked: checked }))));
|
|
63
49
|
};
|
|
64
|
-
var
|
|
65
|
-
var
|
|
66
|
-
return "\n padding-top: ".concat(space[3], ";\n ");
|
|
50
|
+
var StyledWrapper = styled.View(function (_a) {
|
|
51
|
+
var core = _a.theme.core;
|
|
52
|
+
return "\n padding-top: ".concat(core.space[3], ";\n flex-direction: row;\n ");
|
|
67
53
|
});
|
|
68
|
-
var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
69
54
|
var Radio = forwardRef(function (_a, ref) {
|
|
70
55
|
var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
|
|
71
56
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
72
57
|
value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
73
58
|
_b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
74
|
-
activeOpacity = _b === void 0 ? 0.8 : _b, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity"]);
|
|
75
|
-
return (React.createElement(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked },
|
|
76
|
-
// @ts-ignore
|
|
77
|
-
invalid: invalid }, rest),
|
|
59
|
+
activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
|
|
60
|
+
return (React.createElement(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest),
|
|
78
61
|
React.createElement(StyledWrapper, null,
|
|
79
|
-
React.createElement(Input, { checked: checked, invalid: invalid }),
|
|
62
|
+
React.createElement(Input, { checked: checked, invalid: invalid, testID: testID }),
|
|
80
63
|
React.createElement(View, { style: { flexShrink: 1 } },
|
|
81
|
-
React.createElement(
|
|
64
|
+
React.createElement(LabelText, null, label),
|
|
82
65
|
hint ? React.createElement(HintText, null, hint) : null))));
|
|
83
66
|
});
|
|
84
67
|
export { Radio };
|
|
85
|
-
var templateObject_1;
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
6
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
7
|
+
if (ar || !(i in from)) {
|
|
8
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
9
|
+
ar[i] = from[i];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
13
|
+
};
|
|
14
|
+
import React, { useState } from 'react';
|
|
15
|
+
import { Modal, ScrollView, View } from 'react-native';
|
|
16
|
+
import styled, { css } from '../../styled.native';
|
|
17
|
+
import { Icon } from '../Icon';
|
|
18
|
+
import { P, Strong } from '../Text';
|
|
19
|
+
var SelectInput = styled.TouchableOpacity(function (_a) {
|
|
20
|
+
var _b = _a.theme, semantic = _b.semantic, core = _b.core, hasError = _a.hasError;
|
|
21
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-color: ", ";\n border-width: ", "\n border-radius: ", ";\n padding-vertical: ", "\n padding-left: ", "\n padding-right: 14px;\n height: 44px;\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-color: ", ";\n border-width: ", "\n border-radius: ", ";\n padding-vertical: ", "\n padding-left: ", "\n padding-right: 14px;\n height: 44px;\n "])), core.color.brand.white, hasError ? semantic.error.border : semantic.border.functional, core.borderWidth.small, core.radius.small, core.space[2], core.space[2]);
|
|
22
|
+
});
|
|
23
|
+
var DropdownWrapper = styled.View(function (_a) {
|
|
24
|
+
var core = _a.theme.core;
|
|
25
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex: 1;\n justify-content: center;\n align-items: center;\n // 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4\n background-color: ", "40;\n "], ["\n flex: 1;\n justify-content: center;\n align-items: center;\n // 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4\n background-color: ", "40;\n "])), core.color.neutral.darkest);
|
|
26
|
+
});
|
|
27
|
+
var DropdownContainer = styled.SafeAreaView(function (_a) {
|
|
28
|
+
var core = _a.theme.core;
|
|
29
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 95%;\n max-height: 70%;\n border-radius: ", ";\n background-color: ", ";\n "], ["\n width: 95%;\n max-height: 70%;\n border-radius: ", ";\n background-color: ", ";\n "])), core.radius.small, core.color.brand.white);
|
|
30
|
+
});
|
|
31
|
+
var SelectOption = styled.TouchableOpacity(function (_a) {
|
|
32
|
+
var _b = _a.theme, semantic = _b.semantic, core = _b.core, isLastOption = _a.isLastOption;
|
|
33
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n border-bottom-color: ", ";\n border-bottom-width: ", "px;\n padding-horizontal: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n border-bottom-color: ", ";\n border-bottom-width: ", "px;\n padding-horizontal: ", ";\n "])), semantic.border.differentiated, isLastOption ? 0 : 1, core.space[4]);
|
|
34
|
+
});
|
|
35
|
+
var Radio = styled.View(function (_a) {
|
|
36
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, isChecked = _a.isChecked;
|
|
37
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 24px;\n height: 24px;\n margin-left: auto;\n border-radius: 24px;\n border-width: ", ";\n border-color: ", ";\n "], ["\n width: 24px;\n height: 24px;\n margin-left: auto;\n border-radius: 24px;\n border-width: ", ";\n border-color: ", ";\n "])), core.borderWidth.small, isChecked
|
|
38
|
+
? semantic.focus.outline
|
|
39
|
+
: semantic.border.functional);
|
|
40
|
+
});
|
|
41
|
+
var RadioDot = styled.View(function (_a) {
|
|
42
|
+
var semantic = _a.theme.semantic, isChecked = _a.isChecked;
|
|
43
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n position: absolute;\n top: 5px;\n width: 12px;\n height: 12px;\n border-radius: 12px;\n align-self: center;\n opacity: ", ";\n "], ["\n background-color: ", ";\n position: absolute;\n top: 5px;\n width: 12px;\n height: 12px;\n border-radius: 12px;\n align-self: center;\n opacity: ", ";\n "])), semantic.focus.outline, isChecked ? 1 : 0);
|
|
44
|
+
});
|
|
45
|
+
var StyledP = styled(P)(function (_a) {
|
|
46
|
+
var core = _a.theme.core;
|
|
47
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n "], ["\n margin-top: ", ";\n "])), core.space[3]);
|
|
48
|
+
});
|
|
49
|
+
export var Select = function (_a) {
|
|
50
|
+
var _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.defaultSelected, defaultSelected = _c === void 0 ? { label: '', value: 'default' } : _c, _d = _a.noOptionMessage, noOptionMessage = _d === void 0 ? 'No option selected' : _d, _e = _a.onSelected, onSelected = _e === void 0 ? function () { return null; } : _e, _f = _a.hasError, hasError = _f === void 0 ? false : _f, _g = _a.testID, testID = _g === void 0 ? 'select' : _g;
|
|
51
|
+
var _h = useState(false), isOpen = _h[0], setOpen = _h[1];
|
|
52
|
+
var _j = useState(defaultSelected), selected = _j[0], setSelected = _j[1];
|
|
53
|
+
var handleOptionPress = function (val) {
|
|
54
|
+
onSelected(val);
|
|
55
|
+
setOpen(false);
|
|
56
|
+
setSelected(val);
|
|
57
|
+
};
|
|
58
|
+
var extendedOptions = __spreadArray([
|
|
59
|
+
{ label: "-- ".concat(noOptionMessage, " --"), value: 'default' }
|
|
60
|
+
], options, true);
|
|
61
|
+
return (React.createElement(View, null,
|
|
62
|
+
React.createElement(SelectInput, { testID: testID, hasError: hasError, onPress: function () { return setOpen(!isOpen); } },
|
|
63
|
+
React.createElement(P, { style: { marginTop: 0, marginBottom: 0 } }, selected.value === 'default' ? '' : selected.label),
|
|
64
|
+
React.createElement(Icon, { name: "chevron-down", size: 16, style: { marginLeft: 'auto' } })),
|
|
65
|
+
React.createElement(Modal, { transparent: true, visible: isOpen, animationType: "fade", onRequestClose: function () { return setOpen(false); } },
|
|
66
|
+
React.createElement(DropdownWrapper, null,
|
|
67
|
+
React.createElement(DropdownContainer, null,
|
|
68
|
+
React.createElement(ScrollView, { nestedScrollEnabled: true }, extendedOptions.map(function (option, i) { return (React.createElement(SelectOption, { key: option.label, accessibilityRole: "radio", isLastOption: i === extendedOptions.length - 1, onPress: function () { return handleOptionPress(option); } },
|
|
69
|
+
React.createElement(StyledP, null,
|
|
70
|
+
React.createElement(Strong, null, option.label)),
|
|
71
|
+
React.createElement(Radio, { isChecked: selected.value === option.value },
|
|
72
|
+
React.createElement(RadioDot, { isChecked: selected.value === option.value })))); })))))));
|
|
73
|
+
};
|
|
74
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { Field } from '../Field';
|
|
25
|
+
import { Select } from './Select';
|
|
26
|
+
export var SelectField = function (_a) {
|
|
27
|
+
var error = _a.error, options = _a.options, onSelected = _a.onSelected, noOptionMessage = _a.noOptionMessage, defaultSelected = _a.defaultSelected, testID = _a.testID, rest = __rest(_a, ["error", "options", "onSelected", "noOptionMessage", "defaultSelected", "testID"]);
|
|
28
|
+
return (React.createElement(Field, __assign({ affixWidth: 20, error: error }, rest),
|
|
29
|
+
React.createElement(React.Fragment, null,
|
|
30
|
+
React.createElement(Select, { onSelected: onSelected, options: options, noOptionMessage: noOptionMessage, defaultSelected: defaultSelected, hasError: Boolean(error), testID: testID }))));
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SelectField } from './SelectField';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { View, Animated, Platform } from 'react-native';
|
|
3
|
+
export var SkeletonAnimation = function (_a) {
|
|
4
|
+
var children = _a.children, _b = _a.animation, animation = _b === void 0 ? 'pulse' : _b, testID = _a.testID;
|
|
5
|
+
var animationRef = useRef(new Animated.Value(0));
|
|
6
|
+
var animationLoop = useRef();
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
animationLoop.current = Animated.timing(animationRef.current, {
|
|
9
|
+
toValue: 2,
|
|
10
|
+
delay: 400,
|
|
11
|
+
duration: 1500,
|
|
12
|
+
useNativeDriver: !!Platform.select({
|
|
13
|
+
web: false,
|
|
14
|
+
native: true,
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
animationRef.current.setValue(0);
|
|
18
|
+
Animated.loop(animationLoop.current).start();
|
|
19
|
+
}, []);
|
|
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))));
|
|
30
|
+
};
|
|
@@ -24,11 +24,13 @@ import React from 'react';
|
|
|
24
24
|
import styled from '../../styled.native';
|
|
25
25
|
import { P } from '../Text';
|
|
26
26
|
import { Skeleton } from './Skeleton';
|
|
27
|
+
import { SkeletonAnimation } from './SkeletonAnimation';
|
|
27
28
|
var StyledSkeletonCTA = styled(Skeleton)(function (_a) {
|
|
28
29
|
var _b = _a.theme, colors = _b.colors, space = _b.space, size = _a.size;
|
|
29
30
|
return "\n background-color: ".concat(colors.borderMuted, ";\n width: ").concat(size, ";\n height: ").concat(space[12], ";\n ");
|
|
30
31
|
});
|
|
31
32
|
export var SkeletonCTA = function (_a) {
|
|
32
33
|
var _b = _a.size, size = _b === void 0 ? '250px' : _b, rest = __rest(_a, ["size"]);
|
|
33
|
-
return (React.createElement(
|
|
34
|
+
return (React.createElement(SkeletonAnimation, null,
|
|
35
|
+
React.createElement(StyledSkeletonCTA, __assign({ as: P, size: size }, rest))));
|
|
34
36
|
};
|
|
@@ -24,6 +24,7 @@ import React from 'react';
|
|
|
24
24
|
import styled from '../../styled.native';
|
|
25
25
|
import { pxToNumber } from '../../utils';
|
|
26
26
|
import { Skeleton } from './Skeleton';
|
|
27
|
+
import { SkeletonAnimation } from './SkeletonAnimation';
|
|
27
28
|
var StyledSkeletonCircleWrapper = styled(Skeleton)(function (_a) {
|
|
28
29
|
var size = _a.size;
|
|
29
30
|
return "width: ".concat(size, "; max-width: 100%;");
|
|
@@ -34,6 +35,7 @@ var StyledSkeletonCircle = styled(Skeleton)(function (_a) {
|
|
|
34
35
|
});
|
|
35
36
|
export var SkeletonCircle = function (_a) {
|
|
36
37
|
var _b = _a.size, size = _b === void 0 ? '120px' : _b, rest = __rest(_a, ["size"]);
|
|
37
|
-
return (React.createElement(
|
|
38
|
-
React.createElement(
|
|
38
|
+
return (React.createElement(SkeletonAnimation, null,
|
|
39
|
+
React.createElement(StyledSkeletonCircleWrapper, __assign({ size: size }, rest),
|
|
40
|
+
React.createElement(StyledSkeletonCircle, { size: size }))));
|
|
39
41
|
};
|
|
@@ -24,11 +24,13 @@ import React from 'react';
|
|
|
24
24
|
import styled from '../../styled.native';
|
|
25
25
|
import { Heading3 } from '../Heading';
|
|
26
26
|
import { Skeleton } from './Skeleton';
|
|
27
|
+
import { SkeletonAnimation } from './SkeletonAnimation';
|
|
27
28
|
var StyledSkeletonHeading = styled(Skeleton)(function (_a) {
|
|
28
29
|
var colors = _a.theme.colors, size = _a.size;
|
|
29
30
|
return "\n background-color: ".concat(colors.borderMuted, ";\n width: ").concat(size, ";\n ");
|
|
30
31
|
});
|
|
31
32
|
export var SkeletonHeading = function (_a) {
|
|
32
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"]);
|
|
33
|
-
return (React.createElement(
|
|
34
|
+
return (React.createElement(SkeletonAnimation, null,
|
|
35
|
+
React.createElement(StyledSkeletonHeading, __assign({ "aria-hidden": "true", size: size, as: Heading }, rest), "\u00A0")));
|
|
34
36
|
};
|
|
@@ -21,12 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
|
-
import { View } from 'react-native';
|
|
25
24
|
import { useBreakpoint } from '../../hooks';
|
|
26
25
|
import styled from '../../styled.native';
|
|
27
26
|
import { responsiveStyle } from '../../utils';
|
|
28
27
|
import { P } from '../Text';
|
|
29
28
|
import { Skeleton } from './Skeleton';
|
|
29
|
+
import { SkeletonAnimation } from './SkeletonAnimation';
|
|
30
30
|
var StyledSkeletonText = styled(Skeleton)(function (_a) {
|
|
31
31
|
var _b = _a.theme, colors = _b.colors, space = _b.space, responsiveFontSizes = _b.responsiveFontSizes, short = _a.short, breakpoints = _a.breakpoints;
|
|
32
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 ");
|
|
@@ -38,5 +38,5 @@ export var SkeletonText = function (_a) {
|
|
|
38
38
|
for (var i = 1; i <= lines; i++) {
|
|
39
39
|
generatedLines.push(React.createElement(StyledSkeletonText, { key: "line-".concat(i), short: i === lines, breakpoints: breakpoints }));
|
|
40
40
|
}
|
|
41
|
-
return (React.createElement(P, __assign({ as:
|
|
41
|
+
return (React.createElement(P, __assign({ as: SkeletonAnimation }, rest), generatedLines));
|
|
42
42
|
};
|
|
@@ -8,7 +8,7 @@ import { styledComponentWithBreakpoints } from '../../utils';
|
|
|
8
8
|
var StyledSubLabelText = styled.Text(function (_a) {
|
|
9
9
|
var field = _a.theme.field, smallAndUp = _a.smallAndUp;
|
|
10
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
|
|
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);
|
|
12
12
|
});
|
|
13
13
|
var SubLabelText = styledComponentWithBreakpoints(StyledSubLabelText);
|
|
14
14
|
export { SubLabelText };
|
|
@@ -22,8 +22,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React, { Children, cloneElement, } from 'react';
|
|
24
24
|
import { Dd, Dl, Dt } from '../List';
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated This component has been deprecated and will be removed in a future release.
|
|
27
|
+
* Please use the Description List (List/Dl) component instead.
|
|
28
|
+
* */
|
|
25
29
|
var SummaryList = function (_a) {
|
|
26
30
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
31
|
+
console.warn('SummaryList component has been deprecated and will be removed in a future release. Please use the DescriptionList component instead.');
|
|
27
32
|
return (React.createElement(Dl, __assign({}, rest), Children.map(children, function (child, index) {
|
|
28
33
|
return cloneElement(child, {
|
|
29
34
|
index: index,
|
|
@@ -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++) {
|
|
@@ -22,24 +26,26 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
26
|
};
|
|
23
27
|
import React, { forwardRef } from 'react';
|
|
24
28
|
import { useBreakpoint, useFullWidth, } from '../../hooks';
|
|
25
|
-
import styled from '../../styled.native';
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
return "\n font-size: ".concat(tabs.tab.fontSize[smallAndUp ? 1 : 0], ";\n font-family: ").concat(tabs.tab.fontFamily, ";\n font-weight: ").concat(tabs.tab.fontWeight, ";\n background-color: ").concat(active ? tabs.tab.active.backgroundColor : tabs.tab.inactive.backgroundColor, ";\n line-height: ").concat("".concat(tabs.tab.lineHeight * pxToNumber(tabs.tab.fontSize[0]), "px"), ";\n color: ").concat(active ? tabs.tab.active.foregroundColor : tabs.tab.inactive.foregroundColor, ";\n text-align: center;\n padding: ").concat("".concat(tabs.tab.paddingVertical[smallAndUp ? 1 : 0], " ").concat(tabs.tab.paddingHorizontal[smallAndUp ? 1 : 0]), ";\n");
|
|
29
|
+
import styled, { css } from '../../styled.native';
|
|
30
|
+
var TabText = styled.Text(function (_a) {
|
|
31
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
32
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n text-align: center;\n padding: ", " ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n text-align: center;\n padding: ", " ", ";\n "])), core.fontSize.body.small, core.fontFamily.bodyBold.native, core.lineHeight.body.small, semantic.message.base, core.space[3], core.space[smallAndUp ? 3 : 2]);
|
|
30
33
|
});
|
|
31
|
-
var
|
|
32
|
-
var _b = _a.active, active = _b === void 0 ? false : _b, _c = _a.first, first = _c === void 0 ? false : _c, _d = _a.last, last = _d === void 0 ? false : _d, _e = _a.stretch, stretch = _e === void 0 ? false : _e, _f = _a.theme,
|
|
33
|
-
return "flex-grow: "
|
|
34
|
+
var TabTouchable = styled.TouchableOpacity(function (_a) {
|
|
35
|
+
var _b = _a.active, active = _b === void 0 ? false : _b, _c = _a.first, first = _c === void 0 ? false : _c, _d = _a.last, last = _d === void 0 ? false : _d, _e = _a.stretch, stretch = _e === void 0 ? false : _e, _f = _a.theme, core = _f.core, semantic = _f.semantic, inline = _a.inline;
|
|
36
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n flex-grow: ", ";\n border: ", " solid ", ";\n ", "\n ", "\n ", "\n ", "\n "], ["\n flex-grow: ", ";\n border: ", " solid ", ";\n ", "\n ", "\n ", "\n ", "\n "])), stretch ? 1 : 0, core.borderWidth.small, semantic.border.differentiated, active
|
|
37
|
+
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-bottom-color: ", ";\n border-bottom-width: ", ";\n "], ["\n border-bottom-color: ", ";\n border-bottom-width: ", ";\n "])), semantic.message.branded, core.borderWidth.medium) : '', !inline
|
|
38
|
+
? css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-top-color: transparent;\n border-top-width: 0;\n "], ["\n border-top-color: transparent;\n border-top-width: 0;\n "]))) : '', last && inline
|
|
39
|
+
? ''
|
|
40
|
+
: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-right-color: transparent;\n border-right-width: 0;\n "], ["\n border-right-color: transparent;\n border-right-width: 0;\n "]))), first && inline
|
|
41
|
+
? ''
|
|
42
|
+
: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-left-color: transparent;\n border-left-width: 0;\n "], ["\n border-left-color: transparent;\n border-left-width: 0;\n "]))));
|
|
34
43
|
});
|
|
35
|
-
export var Tab = forwardRef(function (
|
|
36
|
-
|
|
37
|
-
_a, ref) {
|
|
38
|
-
var active = _a.active, fullWidth = _a.fullWidth, children = _a.children, rest = __rest(_a,
|
|
39
|
-
// eslint-disable-next-line
|
|
40
|
-
["active", "fullWidth", "children"]);
|
|
44
|
+
export var Tab = forwardRef(function (_a, ref) {
|
|
45
|
+
var active = _a.active, fullWidth = _a.fullWidth, children = _a.children, rest = __rest(_a, ["active", "fullWidth", "children"]);
|
|
41
46
|
var stretch = useFullWidth(fullWidth);
|
|
42
47
|
var breakpoints = useBreakpoint();
|
|
43
|
-
return (React.createElement(
|
|
44
|
-
React.createElement(
|
|
48
|
+
return (React.createElement(TabTouchable, __assign({ accessibilityRole: "tab", accessibilityState: { selected: active }, active: active, stretch: stretch, ref: ref }, rest),
|
|
49
|
+
React.createElement(TabText, __assign({ active: active }, breakpoints), children)));
|
|
45
50
|
});
|
|
51
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -25,24 +25,26 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
import React, { Children, cloneElement } from 'react';
|
|
28
|
-
import { View } from 'react-native';
|
|
29
28
|
import styled, { css } from '../../styled.native';
|
|
30
29
|
import { callAll } from '../../utils';
|
|
31
|
-
|
|
30
|
+
var StyledTabList = styled.View(function (_a) {
|
|
31
|
+
var core = _a.theme.core;
|
|
32
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n margin: -", ";\n "], ["\n flex-direction: row;\n margin: -", ";\n "])), core.borderWidth.small);
|
|
33
|
+
});
|
|
34
|
+
export var TabList = function (_a) {
|
|
32
35
|
var children = _a.children, setActiveTab = _a.setActiveTab, activeTab = _a.activeTab, tabRefs = _a.tabRefs, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "setActiveTab", "activeTab", "tabRefs", "fullWidth", "inline"]);
|
|
33
|
-
return (React.createElement(
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
return (React.createElement(StyledTabList, __assign({ accessibilityRole: "tablist" }, rest), Children.map(children, function (child, i) {
|
|
37
|
+
return child
|
|
38
|
+
? cloneElement(child, {
|
|
39
|
+
onPress: callAll(function () { return setActiveTab && setActiveTab(i); }, child.props.onPress),
|
|
40
|
+
active: activeTab === i,
|
|
41
|
+
fullWidth: fullWidth,
|
|
42
|
+
ref: tabRefs === null || tabRefs === void 0 ? void 0 : tabRefs[i],
|
|
43
|
+
first: i === 0,
|
|
44
|
+
last: Children.count(children) - 1 === i,
|
|
45
|
+
inline: inline,
|
|
46
|
+
})
|
|
47
|
+
: null;
|
|
43
48
|
})));
|
|
44
|
-
}
|
|
45
|
-
var card = _a.theme.card;
|
|
46
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n margin: -", ";\n "], ["\n flex-direction: row;\n margin: -", ";\n "])), card.borderWidth);
|
|
47
|
-
});
|
|
49
|
+
};
|
|
48
50
|
var templateObject_1;
|
|
@@ -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++) {
|
|
@@ -21,14 +25,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
25
|
return t;
|
|
22
26
|
};
|
|
23
27
|
import React from 'react';
|
|
24
|
-
import {
|
|
25
|
-
import styled from '../../styled.native';
|
|
28
|
+
import styled, { css } from '../../styled.native';
|
|
26
29
|
var StyledView = styled.View(function (_a) {
|
|
27
|
-
var
|
|
28
|
-
return "\n padding: "
|
|
30
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
31
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n border-top-width: ", ";\n border-style: solid;\n border-color: ", ";\n z-index: -1;\n "], ["\n padding: ", ";\n border-top-width: ", ";\n border-style: solid;\n border-color: ", ";\n z-index: -1;\n "])), core.space[4], core.borderWidth.small, semantic.border.differentiated);
|
|
29
32
|
});
|
|
30
33
|
export var TabPanel = function (_a) {
|
|
31
34
|
var rest = __rest(_a, []);
|
|
32
|
-
|
|
33
|
-
return React.createElement(StyledView, __assign({}, breakpoints, rest));
|
|
35
|
+
return React.createElement(StyledView, __assign({}, rest));
|
|
34
36
|
};
|
|
37
|
+
var templateObject_1;
|
|
@@ -30,9 +30,15 @@ import { filterChildrenByType } from '../../utils';
|
|
|
30
30
|
import { Card } from '../Card';
|
|
31
31
|
import { TabList } from './TabList';
|
|
32
32
|
import { TabPanel } from './TabPanel';
|
|
33
|
-
|
|
33
|
+
var TabsCard = styled(Card)(function (_a) {
|
|
34
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, inline = _a.inline;
|
|
35
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border: ", " solid\n ", ";\n "], ["\n padding: 0;\n border: ", " solid\n ", ";\n "])), core.borderWidth.small, inline ? semantic.border.differentiated : 'transparent');
|
|
36
|
+
});
|
|
37
|
+
export var Tabs = function (_a) {
|
|
34
38
|
var children = _a.children, _b = _a.defaultSelected, defaultSelected = _b === void 0 ? 0 : _b, onSelected = _a.onSelected, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "defaultSelected", "onSelected", "fullWidth", "inline"]);
|
|
35
39
|
var _c = useState(defaultSelected), activeTab = _c[0], setActiveTab = _c[1];
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
41
|
+
// @ts-ignore there is no way to properly type it
|
|
36
42
|
var tabList = filterChildrenByType(children, TabList);
|
|
37
43
|
var tabPanels = filterChildrenByType(children, TabPanel);
|
|
38
44
|
var tabRefs = tabPanels.map(function () { return createRef(); });
|
|
@@ -45,7 +51,7 @@ export var Tabs = styled(function (_a) {
|
|
|
45
51
|
loaded.current = true;
|
|
46
52
|
}
|
|
47
53
|
}, [onSelected, activeTab]);
|
|
48
|
-
return (React.createElement(
|
|
54
|
+
return (React.createElement(TabsCard, __assign({ inline: inline }, rest),
|
|
49
55
|
tabList.map(function (child) {
|
|
50
56
|
return cloneElement(child, {
|
|
51
57
|
setActiveTab: setActiveTab,
|
|
@@ -62,8 +68,5 @@ export var Tabs = styled(function (_a) {
|
|
|
62
68
|
hidden: activeTab !== index,
|
|
63
69
|
});
|
|
64
70
|
})));
|
|
65
|
-
}
|
|
66
|
-
var _b = _a.theme, card = _b.card, tabs = _b.tabs, inline = _a.inline;
|
|
67
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border: ", " solid\n ", ";\n "], ["\n padding: 0;\n border: ", " solid\n ", ";\n "])), card.borderWidth, inline ? card.borderColor : tabs.tab.borderColor);
|
|
68
|
-
});
|
|
71
|
+
};
|
|
69
72
|
var templateObject_1;
|
|
@@ -29,22 +29,18 @@ import { View } from 'react-native';
|
|
|
29
29
|
import styled, { css } from '../../styled.native';
|
|
30
30
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
31
31
|
var StyledP = styled.Text(function (_a) {
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
var lineHeight = smallAndUp ? text.p.lineHeight[1] : text.p.lineHeight[0];
|
|
35
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-top: ", ";\n margin-bottom: ", ";\n "])), text.fontFamily, text.fontWeight, fontSize, lineHeight, text.color, smallAndUp ? text.p.marginTop[1] : text.p.marginTop[0], smallAndUp
|
|
36
|
-
? text.p.marginBottom[1]
|
|
37
|
-
: text.p.marginBottom[0]);
|
|
32
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
33
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-bottom: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n margin-bottom: ", ";\n "])), core.fontFamily.body.native, core.fontSize.body[smallAndUp ? 'large' : 'small'], core.lineHeight.body[smallAndUp ? 'large' : 'small'], semantic.message.base, core.space[3]);
|
|
38
34
|
});
|
|
39
35
|
export var P = styledComponentWithBreakpoints(StyledP);
|
|
40
36
|
var StyledSmall = styled.Text(function (_a) {
|
|
41
|
-
var
|
|
42
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n "], ["\n font-size: ", ";\n "])), smallAndUp ?
|
|
37
|
+
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
38
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n line-height: ", ";\n "], ["\n font-size: ", ";\n line-height: ", ";\n "])), core.fontSize.small[smallAndUp ? 'large' : 'small'], core.lineHeight.small[smallAndUp ? 'large' : 'small']);
|
|
43
39
|
});
|
|
44
40
|
export var Small = styledComponentWithBreakpoints(StyledSmall);
|
|
45
41
|
export var Strong = styled.Text(function (_a) {
|
|
46
|
-
var
|
|
47
|
-
return "\n font-family: ".concat(
|
|
42
|
+
var core = _a.theme.core;
|
|
43
|
+
return "\n font-family: ".concat(core.fontFamily.bodyBold.native, ";\n ");
|
|
48
44
|
});
|
|
49
45
|
export var Em = styled.Text(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: 'System font';\n font-style: italic;\n"], ["\n font-family: 'System font';\n font-style: italic;\n"])));
|
|
50
46
|
export var LineThrough = styled.Text(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n text-decoration: line-through;\n"], ["\n text-decoration: line-through;\n"])));
|
|
@@ -24,7 +24,7 @@ import React, { forwardRef } from 'react';
|
|
|
24
24
|
import { Field } from '../Field';
|
|
25
25
|
import { PasswordInput } from '../Input/PasswordInput';
|
|
26
26
|
export var PasswordField = forwardRef(function (_a, ref) {
|
|
27
|
-
var rest = __rest(_a, []);
|
|
27
|
+
var hasVisibilityToggle = _a.hasVisibilityToggle, rest = __rest(_a, ["hasVisibilityToggle"]);
|
|
28
28
|
return (React.createElement(Field, __assign({}, rest, { ref: ref }),
|
|
29
|
-
React.createElement(PasswordInput,
|
|
29
|
+
React.createElement(PasswordInput, { hasVisibilityToggle: hasVisibilityToggle })));
|
|
30
30
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { forwardRef } from 'react';
|
|
24
|
+
import { Field } from '../Field';
|
|
25
|
+
import { PhoneInput } from '../Input/PhoneInput';
|
|
26
|
+
export var PhoneField = forwardRef(function (_a, ref) {
|
|
27
|
+
var rest = __rest(_a, []);
|
|
28
|
+
return (React.createElement(Field, __assign({}, rest, { ref: ref }),
|
|
29
|
+
React.createElement(PhoneInput, null)));
|
|
30
|
+
});
|
|
@@ -22,9 +22,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React, { forwardRef } from 'react';
|
|
24
24
|
import { Field } from '../Field';
|
|
25
|
-
import {
|
|
25
|
+
import { PhoneInput } from '../Input/PhoneInput';
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated This component has been deprecated and will be removed in a future release.
|
|
28
|
+
* Please use the PhoneField component instead.
|
|
29
|
+
* */
|
|
26
30
|
export var TelField = forwardRef(function (_a, ref) {
|
|
27
31
|
var rest = __rest(_a, []);
|
|
32
|
+
console.warn('TelField component has been deprecated and will be removed in a future release. Please use the PhoneField component instead.');
|
|
28
33
|
return (React.createElement(Field, __assign({}, rest, { ref: ref }),
|
|
29
|
-
React.createElement(
|
|
34
|
+
React.createElement(PhoneInput, null)));
|
|
30
35
|
});
|
|
@@ -2,6 +2,7 @@ export { CurrencyField } from './CurrencyField';
|
|
|
2
2
|
export { TextField } from './TextField';
|
|
3
3
|
export { NumberField } from './NumberField';
|
|
4
4
|
export { TelField } from './TelField';
|
|
5
|
+
export { PhoneField } from './PhoneField';
|
|
5
6
|
export { EmailField } from './EmailField';
|
|
6
7
|
export { PasswordField } from './PasswordField';
|
|
7
8
|
export { TextareaField } from './TextareaField';
|