@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
|
@@ -1,59 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
3
|
+
exports.styles = void 0;
|
|
4
|
+
var react_native_1 = require("react-native");
|
|
5
|
+
var theme_1 = require("../../theme");
|
|
6
|
+
var greyBase = theme_1.theme.colors.brand.grey.base;
|
|
7
|
+
var styles = react_native_1.StyleSheet.create({
|
|
8
|
+
accordion: {
|
|
9
|
+
width: '100%',
|
|
10
|
+
borderWidth: parseInt(theme_1.theme.borderWidths.standard),
|
|
11
|
+
borderBottomWidth: 0,
|
|
12
|
+
borderColor: greyBase,
|
|
13
|
+
},
|
|
14
|
+
topItem: {
|
|
15
|
+
borderTopLeftRadius: parseInt(theme_1.theme.radii.small),
|
|
16
|
+
borderTopRightRadius: parseInt(theme_1.theme.radii.small),
|
|
17
|
+
},
|
|
18
|
+
bottomItem: {
|
|
19
|
+
borderBottomLeftRadius: parseInt(theme_1.theme.radii.small),
|
|
20
|
+
borderBottomRightRadius: parseInt(theme_1.theme.radii.small),
|
|
21
|
+
borderBottomWidth: parseInt(theme_1.theme.borderWidths.standard),
|
|
22
|
+
},
|
|
23
|
+
accordionHeader: {
|
|
24
|
+
paddingTop: parseInt(theme_1.theme.space[5]),
|
|
25
|
+
paddingRight: 18,
|
|
26
|
+
paddingBottom: 18,
|
|
27
|
+
paddingLeft: parseInt(theme_1.theme.space[3]),
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
alignItems: 'flex-start',
|
|
30
|
+
justifyContent: 'space-between',
|
|
31
|
+
},
|
|
32
|
+
accordionHeaderText: {
|
|
33
|
+
paddingRight: parseInt(theme_1.theme.space[3]),
|
|
34
|
+
marginTop: 0,
|
|
35
|
+
marginBottom: 0,
|
|
36
|
+
flexShrink: 1,
|
|
37
|
+
},
|
|
38
|
+
content: {
|
|
39
|
+
overflow: 'hidden',
|
|
40
|
+
},
|
|
41
|
+
container: {
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
right: 0,
|
|
46
|
+
paddingTop: 0,
|
|
47
|
+
paddingRight: parseInt(theme_1.theme.space[12]),
|
|
48
|
+
paddingBottom: parseInt(theme_1.theme.space[6]),
|
|
49
|
+
paddingLeft: parseInt(theme_1.theme.space[3]),
|
|
50
|
+
},
|
|
58
51
|
});
|
|
59
|
-
|
|
52
|
+
exports.styles = styles;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { Theme, BadgeColors } from '@ovotech/element-core';
|
|
2
1
|
import { ComponentProps } from 'react';
|
|
3
|
-
export declare type
|
|
4
|
-
export declare type
|
|
2
|
+
export declare type BadgeVariantName = 'default' | 'error' | 'success' | 'warning' | 'info';
|
|
3
|
+
export declare type BadgeVariant = {
|
|
4
|
+
background: string;
|
|
5
|
+
foreground: string;
|
|
6
|
+
};
|
|
5
7
|
declare const StyledBadge: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme & {
|
|
6
8
|
core: {
|
|
7
9
|
radius: Record<"small" | "medium" | "large" | "max", string>;
|
|
8
10
|
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
9
11
|
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
10
12
|
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
11
|
-
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|
|
13
|
+
space: Record<0 | 2 | 1 | 10 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15, string>;
|
|
12
14
|
transition: Record<"medium" | "slow" | "fast", string>;
|
|
13
|
-
opacity: Record<"
|
|
14
|
-
color: Record<"
|
|
15
|
+
opacity: Record<"transparent" | "translucent" | "solid", string | number>;
|
|
16
|
+
color: Record<"sand" | "red" | "orange" | "yellow" | "lime" | "green" | "teal" | "blue" | "purple", {
|
|
15
17
|
lightest: string;
|
|
16
18
|
lighter: string;
|
|
17
19
|
light: string;
|
|
@@ -27,53 +29,71 @@ declare const StyledBadge: import("styled-components").StyledComponent<typeof im
|
|
|
27
29
|
web: string;
|
|
28
30
|
}>;
|
|
29
31
|
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
30
|
-
fontSize: Record<"small" | "body" | "label" | "
|
|
32
|
+
fontSize: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
31
33
|
small: string | number;
|
|
32
34
|
large: string | number;
|
|
33
35
|
}>;
|
|
34
|
-
lineHeight: Record<"small" | "body" | "label" | "
|
|
36
|
+
lineHeight: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
35
37
|
small: string | number;
|
|
36
38
|
large: string | number;
|
|
37
39
|
}>;
|
|
38
|
-
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
39
40
|
};
|
|
40
41
|
semantic: {
|
|
41
42
|
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
42
43
|
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
43
44
|
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
44
|
-
focus: Record<"
|
|
45
|
-
inverted: Record<"
|
|
45
|
+
focus: Record<"outline" | "surface", string>;
|
|
46
|
+
inverted: Record<"surface" | "border", string> & {
|
|
46
47
|
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
47
48
|
};
|
|
48
49
|
success: {
|
|
49
50
|
border: string;
|
|
50
51
|
surface: string;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
message: {
|
|
53
|
+
base: string;
|
|
54
|
+
secondary: string;
|
|
55
|
+
};
|
|
54
56
|
};
|
|
55
57
|
warning: {
|
|
56
58
|
border: string;
|
|
57
59
|
surface: string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
message: {
|
|
61
|
+
base: string;
|
|
62
|
+
secondary: string;
|
|
63
|
+
};
|
|
61
64
|
};
|
|
62
65
|
error: {
|
|
63
66
|
border: string;
|
|
64
67
|
surface: string;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
message: {
|
|
69
|
+
base: string;
|
|
70
|
+
secondary: string;
|
|
71
|
+
};
|
|
68
72
|
};
|
|
69
73
|
info: {
|
|
70
74
|
border: string;
|
|
71
75
|
surface: string;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
message: {
|
|
77
|
+
base: string;
|
|
78
|
+
secondary: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
electricity: {
|
|
82
|
+
border: string;
|
|
83
|
+
surface: string;
|
|
84
|
+
message: {
|
|
85
|
+
base: string;
|
|
86
|
+
secondary: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
gas: {
|
|
90
|
+
border: string;
|
|
91
|
+
surface: string;
|
|
92
|
+
message: {
|
|
93
|
+
base: string;
|
|
94
|
+
secondary: string;
|
|
95
|
+
};
|
|
75
96
|
};
|
|
76
|
-
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
77
97
|
};
|
|
78
98
|
component: {
|
|
79
99
|
heading1: {
|
|
@@ -204,39 +224,11 @@ declare const StyledBadge: import("styled-components").StyledComponent<typeof im
|
|
|
204
224
|
backgroundFocused: string;
|
|
205
225
|
};
|
|
206
226
|
};
|
|
207
|
-
badge: {
|
|
208
|
-
variants: {
|
|
209
|
-
red: {
|
|
210
|
-
foreground: string;
|
|
211
|
-
background: string;
|
|
212
|
-
};
|
|
213
|
-
orange: {
|
|
214
|
-
foreground: string;
|
|
215
|
-
background: string;
|
|
216
|
-
};
|
|
217
|
-
yellow: {
|
|
218
|
-
foreground: string;
|
|
219
|
-
background: string;
|
|
220
|
-
};
|
|
221
|
-
green: {
|
|
222
|
-
foreground: string;
|
|
223
|
-
background: string;
|
|
224
|
-
};
|
|
225
|
-
blue: {
|
|
226
|
-
foreground: string;
|
|
227
|
-
background: string;
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
227
|
};
|
|
232
228
|
}, {
|
|
233
|
-
|
|
234
|
-
backgroundColor: string;
|
|
235
|
-
foregroundColor: string;
|
|
236
|
-
} | undefined;
|
|
229
|
+
variant?: BadgeVariantName | (string & {}) | undefined;
|
|
237
230
|
inverted?: boolean | undefined;
|
|
238
|
-
variant?: BadgeVariantName | undefined;
|
|
239
231
|
}, never>;
|
|
240
232
|
declare type BadgeProps = ComponentProps<typeof StyledBadge>;
|
|
241
|
-
export declare const Badge: ({ children, variant,
|
|
233
|
+
export declare const Badge: ({ children, variant, ...rest }: BadgeProps) => JSX.Element;
|
|
242
234
|
export {};
|
|
@@ -48,49 +48,34 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
48
48
|
}
|
|
49
49
|
return t;
|
|
50
50
|
};
|
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
+
};
|
|
51
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
55
|
exports.Badge = void 0;
|
|
53
|
-
var
|
|
56
|
+
var react_1 = __importDefault(require("react"));
|
|
57
|
+
var hooks_1 = require("../../hooks");
|
|
54
58
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
59
|
+
var theme_1 = require("../../theme");
|
|
55
60
|
var StyledBadge = styled_native_1.default.View(function (_a) {
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
surface = component.badge.variants[variant].background;
|
|
65
|
-
message = component.badge.variants[variant].foreground;
|
|
66
|
-
}
|
|
67
|
-
if ((customVariant === null || customVariant === void 0 ? void 0 : customVariant.foregroundColor) && (customVariant === null || customVariant === void 0 ? void 0 : customVariant.backgroundColor)) {
|
|
68
|
-
surface = customVariant.backgroundColor;
|
|
69
|
-
message = customVariant.foregroundColor;
|
|
70
|
-
}
|
|
71
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 ", ";\n border-radius: 16px;\n border: ", " solid ", ";\n background-color: ", ";\n align-self: flex-start;\n "], ["\n padding: 0 ", ";\n border-radius: 16px;\n border: ", " solid ", ";\n background-color: ", ";\n align-self: flex-start;\n "])), core.space[2], core.borderWidth.medium, core.color.brand.white, inverted ? message : surface);
|
|
61
|
+
var badge = _a.theme.badge, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.inverted, inverted = _c === void 0 ? false : _c;
|
|
62
|
+
// @ts-ignore to support additional palettes.
|
|
63
|
+
var currentVariant = badge.variants[variant];
|
|
64
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 ", ";\n border-radius: ", ";\n background-color: ", ";\n align-self: flex-start;\n "], ["\n padding: 0 ", ";\n border-radius: ", ";\n background-color: ", ";\n align-self: flex-start;\n "])), badge.paddingHorizontal, badge.borderRadius, inverted
|
|
65
|
+
? currentVariant.foreground
|
|
66
|
+
: currentVariant.background);
|
|
72
67
|
});
|
|
73
68
|
var StyledBadgeText = styled_native_1.default.Text(function (_a) {
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
surface = semantic[variant].surface;
|
|
79
|
-
message = semantic[variant].message;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
surface = component.badge.variants[variant].background;
|
|
83
|
-
message = component.badge.variants[variant].foreground;
|
|
84
|
-
}
|
|
85
|
-
if ((customVariant === null || customVariant === void 0 ? void 0 : customVariant.foregroundColor) && (customVariant === null || customVariant === void 0 ? void 0 : customVariant.backgroundColor)) {
|
|
86
|
-
surface = customVariant.backgroundColor;
|
|
87
|
-
message = customVariant.foregroundColor;
|
|
88
|
-
}
|
|
89
|
-
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body.small, inverted ? surface : message, core.fontSize.body.small);
|
|
69
|
+
var badge = _a.theme.badge, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.inverted, inverted = _c === void 0 ? false : _c;
|
|
70
|
+
// @ts-ignore to support additional palettes.
|
|
71
|
+
var currentVariant = badge.variants[variant];
|
|
72
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __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 "])), badge.fontFamily, (0, theme_1.calculateLineHeight)(badge.fontSize[1], badge.lineHeight), inverted ? currentVariant.background : currentVariant.foreground, badge.fontSize[1]);
|
|
90
73
|
});
|
|
91
74
|
var Badge = function (_a) {
|
|
92
|
-
var children = _a.children, variant = _a.variant,
|
|
93
|
-
|
|
75
|
+
var children = _a.children, variant = _a.variant, rest = __rest(_a, ["children", "variant"]);
|
|
76
|
+
var smallAndUp = (0, hooks_1.useBreakpoint)().smallAndUp;
|
|
77
|
+
return (react_1.default.createElement(StyledBadge, __assign({}, rest, { variant: variant }),
|
|
78
|
+
react_1.default.createElement(StyledBadgeText, { variant: variant, smallAndUp: smallAndUp }, children)));
|
|
94
79
|
};
|
|
95
80
|
exports.Badge = Badge;
|
|
96
81
|
var templateObject_1, templateObject_2;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import React, { PropsWithChildren, ComponentProps, Ref } from 'react';
|
|
2
|
+
import { TouchableOpacityProps, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { IconName } from '../../providers/types';
|
|
4
|
-
export declare type CTAVariantName = 'primary' | 'secondary' | 'destructive';
|
|
4
|
+
export declare type CTAVariantName = 'primary' | 'secondary' | 'destructive' | 'missionPrimary' | 'missionSecondary';
|
|
5
|
+
export declare type CTAVariant = {
|
|
6
|
+
background: string;
|
|
7
|
+
foreground: string;
|
|
8
|
+
border: string;
|
|
9
|
+
};
|
|
5
10
|
declare type CTAButtonProps = PropsWithChildren<TouchableOpacityProps & {
|
|
6
11
|
iconLeft?: IconName | 'off';
|
|
7
12
|
iconRight?: IconName | 'off';
|
|
8
13
|
fullWidth?: 'always' | 'never' | 'small';
|
|
9
|
-
variant?: CTAVariantName;
|
|
14
|
+
variant?: CTAVariantName | (string & {});
|
|
10
15
|
ref?: Ref<TouchableOpacity>;
|
|
11
16
|
}>;
|
|
12
17
|
declare const CTAButton: ({ iconLeft, iconRight, children, fullWidth, variant, ...rest }: CTAButtonProps) => JSX.Element;
|
|
13
18
|
declare type CTAProps = Omit<ComponentProps<typeof CTAButton>, 'variant' | 'ref'> & {
|
|
14
19
|
ref: Ref<TouchableOpacity>;
|
|
15
20
|
};
|
|
16
|
-
declare const PrimaryCTAButton:
|
|
17
|
-
declare const SecondaryCTAButton:
|
|
18
|
-
declare const DestructiveCTAButton:
|
|
21
|
+
declare const PrimaryCTAButton: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "iconLeft" | "iconRight" | keyof TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
22
|
+
declare const SecondaryCTAButton: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "iconLeft" | "iconRight" | keyof TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
23
|
+
declare const DestructiveCTAButton: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "iconLeft" | "iconRight" | keyof TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
19
24
|
export { CTAButton, PrimaryCTAButton, SecondaryCTAButton, DestructiveCTAButton, };
|
|
@@ -50,54 +50,58 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
50
50
|
};
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
52
|
exports.DestructiveCTAButton = exports.SecondaryCTAButton = exports.PrimaryCTAButton = exports.CTAButton = void 0;
|
|
53
|
-
var
|
|
54
|
-
var react_1 = require("react");
|
|
53
|
+
var react_1 = __importStar(require("react"));
|
|
55
54
|
var hooks_1 = require("../../hooks");
|
|
56
55
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
56
|
+
var theme_1 = require("../../theme");
|
|
57
57
|
var Icon_1 = require("../Icon/Icon");
|
|
58
58
|
var StyledCTAWrapper = styled_native_1.default.TouchableOpacity(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-self: flex-start;\n flex-direction: row;\n align-items: flex-start;\n"], ["\n align-self: flex-start;\n flex-direction: row;\n align-items: flex-start;\n"])));
|
|
59
59
|
var CTAButtonWrapper = function (_a) {
|
|
60
60
|
var children = _a.children, _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'button' : _b, _c = _a.activeOpacity, activeOpacity = _c === void 0 ? 0.8 : _c, rest = __rest(_a, ["children", "accessibilityRole", "activeOpacity"]);
|
|
61
|
-
return (
|
|
61
|
+
return (react_1.default.createElement(StyledCTAWrapper, __assign({ accessibilityRole: accessibilityRole, activeOpacity: activeOpacity }, rest), children));
|
|
62
62
|
};
|
|
63
63
|
var StyledInner = styled_native_1.default.View(function (_a) {
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
var
|
|
67
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: ", " ", ";\n background-color: ", ";\n border-radius: ", ";\n min-height: ", ";\n border:
|
|
64
|
+
var cta = _a.theme.cta, fullWidth = _a.fullWidth, variant = _a.variant;
|
|
65
|
+
// @ts-ignore to support additional palettes.
|
|
66
|
+
var currentVariant = cta.variants[variant];
|
|
67
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: ", " ", ";\n border-color: ", ";\n background-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n min-height: ", ";\n border-style: solid;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n flex-grow: 1;\n\n ", ";\n "], ["\n padding: ", " ", ";\n border-color: ", ";\n background-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n min-height: ", ";\n border-style: solid;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n flex-grow: 1;\n\n ", ";\n "])), cta.paddingVertical, cta.paddingHorizontal, currentVariant.border, currentVariant.background, cta.borderWidth, cta.borderRadius, cta.minHeight, fullWidth === 'never'
|
|
68
68
|
? (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-grow: 0;\n "], ["\n flex-grow: 0;\n "]))) : '');
|
|
69
69
|
});
|
|
70
70
|
var StyledRightIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_a) {
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-left: ", ";\n color: ", ";\n "], ["\n margin-left: ", ";\n color: ", ";\n "])), core.space[1], currentVariant.message);
|
|
71
|
+
var cta = _a.theme.cta;
|
|
72
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-left: ", ";\n "], ["\n margin-left: ", ";\n "])), cta.iconGap);
|
|
74
73
|
});
|
|
75
74
|
var StyledLeftIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_a) {
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-right: ", ";\n color: ", ";\n "], ["\n margin-right: ", ";\n color: ", ";\n "])), core.space[1], currentVariant.message);
|
|
75
|
+
var cta = _a.theme.cta;
|
|
76
|
+
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-right: ", ";\n "], ["\n margin-right: ", ";\n "])), cta.iconGap);
|
|
79
77
|
});
|
|
80
78
|
var StyledCTAButtonText = styled_native_1.default.Text(function (_a) {
|
|
81
|
-
var
|
|
82
|
-
var fontSize = smallAndUp
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-align: center;\n flex-shrink: 2;\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-align: center;\n flex-shrink: 2;\n "])), currentVariant.message, core.fontFamily.bodyBold.native, fontSize, core.lineHeight.body.small);
|
|
79
|
+
var cta = _a.theme.cta, smallAndUp = _a.smallAndUp, variant = _a.variant;
|
|
80
|
+
var fontSize = smallAndUp ? cta.fontSize[1] : cta.fontSize[0];
|
|
81
|
+
// @ts-ignore to support additional palettes.
|
|
82
|
+
var currentVariant = cta.variants[variant];
|
|
83
|
+
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-align: left;\n flex-shrink: 2;\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-align: left;\n flex-shrink: 2;\n "])), currentVariant.foreground, cta.fontFamily, fontSize, (0, theme_1.calculateLineHeight)(fontSize, cta.lineHeight));
|
|
87
84
|
});
|
|
88
85
|
var CTAButton = function (_a) {
|
|
89
86
|
var _b = _a.iconLeft, iconLeft = _b === void 0 ? 'off' : _b, _c = _a.iconRight, iconRight = _c === void 0 ? 'off' : _c, children = _a.children, _d = _a.fullWidth, fullWidth = _d === void 0 ? 'small' : _d, _e = _a.variant, variant = _e === void 0 ? 'primary' : _e, rest = __rest(_a, ["iconLeft", "iconRight", "children", "fullWidth", "variant"]);
|
|
87
|
+
var cta = (0, react_1.useContext)(styled_native_1.ThemeContext).cta;
|
|
90
88
|
var smallAndUp = (0, hooks_1.useBreakpoint)().smallAndUp;
|
|
89
|
+
// @ts-ignore to support additional palettes.
|
|
90
|
+
var currentVariant = cta.variants[variant];
|
|
91
91
|
if (fullWidth === 'small') {
|
|
92
92
|
fullWidth = smallAndUp ? 'never' : 'always';
|
|
93
93
|
}
|
|
94
|
-
return (
|
|
94
|
+
return (react_1.default.createElement(CTAButtonWrapper, __assign({}, rest),
|
|
95
|
+
react_1.default.createElement(StyledInner, { fullWidth: fullWidth, variant: variant },
|
|
96
|
+
iconLeft !== 'off' ? (react_1.default.createElement(StyledLeftIcon, { name: iconLeft, size: 16, color: currentVariant.foreground })) : null,
|
|
97
|
+
react_1.default.createElement(StyledCTAButtonText, { smallAndUp: smallAndUp, variant: variant }, children),
|
|
98
|
+
iconRight !== 'off' ? (react_1.default.createElement(StyledRightIcon, { name: iconRight, size: 16, color: currentVariant.foreground })) : null)));
|
|
95
99
|
};
|
|
96
100
|
exports.CTAButton = CTAButton;
|
|
97
|
-
var PrimaryCTAButton = (0, react_1.forwardRef)(function (props, ref) { return (
|
|
101
|
+
var PrimaryCTAButton = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(CTAButton, __assign({ variant: "primary" }, props, { ref: ref }))); });
|
|
98
102
|
exports.PrimaryCTAButton = PrimaryCTAButton;
|
|
99
|
-
var SecondaryCTAButton = (0, react_1.forwardRef)(function (props, ref) { return (
|
|
103
|
+
var SecondaryCTAButton = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(CTAButton, __assign({ variant: "secondary" }, props, { ref: ref }))); });
|
|
100
104
|
exports.SecondaryCTAButton = SecondaryCTAButton;
|
|
101
|
-
var DestructiveCTAButton = (0, react_1.forwardRef)(function (props, ref) { return (
|
|
105
|
+
var DestructiveCTAButton = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(CTAButton, __assign({ variant: "destructive" }, props, { ref: ref }))); });
|
|
102
106
|
exports.DestructiveCTAButton = DestructiveCTAButton;
|
|
103
107
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ComponentProps, Ref } from 'react';
|
|
1
|
+
import React, { ComponentProps, Ref } from 'react';
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
import { CTAButton } from '../CTAButton';
|
|
4
4
|
declare type CTALinkProps = Omit<ComponentProps<typeof CTAButton>, 'ref'> & {
|
|
5
5
|
ref: Ref<TouchableOpacity>;
|
|
6
6
|
};
|
|
7
|
-
declare const CTALink:
|
|
7
|
+
declare const CTALink: React.ForwardRefExoticComponent<Pick<CTALinkProps, "variant" | "fullWidth" | "iconLeft" | "iconRight" | keyof import("react-native/types").TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
8
8
|
declare type CTAProps = Omit<ComponentProps<typeof CTALink>, 'variant'>;
|
|
9
|
-
declare const PrimaryCTALink:
|
|
10
|
-
declare const SecondaryCTALink:
|
|
9
|
+
declare const PrimaryCTALink: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "key" | "iconLeft" | "iconRight" | keyof import("react-native/types").TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
10
|
+
declare const SecondaryCTALink: React.ForwardRefExoticComponent<Pick<CTAProps, "fullWidth" | "key" | "iconLeft" | "iconRight" | keyof import("react-native/types").TouchableOpacityProps> & React.RefAttributes<TouchableOpacity>>;
|
|
11
11
|
export { CTALink, PrimaryCTALink, SecondaryCTALink };
|
|
@@ -10,14 +10,36 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
37
|
exports.SecondaryCTALink = exports.PrimaryCTALink = exports.CTALink = void 0;
|
|
15
|
-
var
|
|
16
|
-
var react_1 = require("react");
|
|
38
|
+
var react_1 = __importStar(require("react"));
|
|
17
39
|
var CTAButton_1 = require("../CTAButton");
|
|
18
|
-
var CTALink = (0, react_1.forwardRef)(function (props, ref) { return
|
|
40
|
+
var CTALink = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(CTAButton_1.CTAButton, __assign({}, props, { ref: ref })); });
|
|
19
41
|
exports.CTALink = CTALink;
|
|
20
|
-
var PrimaryCTALink = (0, react_1.forwardRef)(function (props, ref) { return
|
|
42
|
+
var PrimaryCTALink = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(CTALink, __assign({ variant: "primary", ref: ref }, props)); });
|
|
21
43
|
exports.PrimaryCTALink = PrimaryCTALink;
|
|
22
|
-
var SecondaryCTALink = (0, react_1.forwardRef)(function (props, ref) { return (
|
|
44
|
+
var SecondaryCTALink = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(CTALink, __assign({ variant: "secondary", ref: ref }, props))); });
|
|
23
45
|
exports.SecondaryCTALink = SecondaryCTALink;
|