@ovotech/element-native 3.8.0 → 3.8.1-canary-dff71b6-233
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 +4 -9
- package/dist/components/Accordion/styles.d.ts +1225 -484
- package/dist/components/Accordion/styles.js +4 -3
- package/dist/components/ActionCard/ActionCard.js +4 -3
- package/dist/components/ActionList/ActionList.d.ts +1 -1
- package/dist/components/ActionList/ActionList.js +2 -1
- package/dist/components/ActionList/styled.d.ts +2502 -1020
- package/dist/components/ActionList/styled.js +6 -5
- package/dist/components/Badge/Badge.d.ts +408 -161
- package/dist/components/Badge/Badge.js +3 -2
- package/dist/components/CTAButton/CTAButton.js +7 -6
- package/dist/components/Card/Card.d.ts +410 -161
- package/dist/components/Card/Card.js +5 -4
- package/dist/components/Checkbox/Checkbox.js +4 -3
- package/dist/components/DataTable/styles.d.ts +5472 -2261
- package/dist/components/DataTable/styles.js +14 -15
- package/dist/components/DateField/DateField.js +4 -3
- package/dist/components/DescriptionList/styled.d.ts +407 -160
- package/dist/components/DescriptionList/styled.js +5 -4
- package/dist/components/Disclosure/Disclosure.js +4 -3
- package/dist/components/Em/Em.d.ts +407 -160
- package/dist/components/ErrorText/ErrorText.d.ts +407 -160
- package/dist/components/ErrorText/ErrorText.js +2 -3
- package/dist/components/FilterSelect/FilterSelect.js +5 -4
- package/dist/components/Grid/Col.d.ts +407 -160
- package/dist/components/Grid/Col.js +3 -3
- package/dist/components/Grid/Row.d.ts +407 -160
- package/dist/components/Grid/Row.js +4 -4
- package/dist/components/Heading1/Heading1.d.ts +3 -1
- package/dist/components/Heading1/Heading1.js +6 -4
- package/dist/components/Heading2/Heading2.d.ts +3 -1
- package/dist/components/Heading2/Heading2.js +6 -4
- package/dist/components/Heading3/Heading3.d.ts +3 -1
- package/dist/components/Heading3/Heading3.js +6 -4
- package/dist/components/Heading4/Heading4.d.ts +3 -1
- package/dist/components/Heading4/Heading4.js +6 -4
- package/dist/components/HintText/HintText.d.ts +407 -160
- package/dist/components/HintText/HintText.js +2 -3
- package/dist/components/Input/Input.js +7 -4
- package/dist/components/Label/Label.d.ts +5 -241
- package/dist/components/Label/Label.js +17 -4
- package/dist/components/LabelText/LabelText.d.ts +407 -160
- package/dist/components/LabelText/LabelText.js +2 -1
- package/dist/components/Lead/Lead.d.ts +5 -241
- package/dist/components/Lead/Lead.js +19 -4
- package/dist/components/LineThrough/LineThrough.d.ts +407 -160
- package/dist/components/List/styled.d.ts +1636 -648
- package/dist/components/List/styled.js +4 -4
- package/dist/components/Margin/Margin.d.ts +408 -162
- package/dist/components/Margin/Margin.js +2 -3
- package/dist/components/NavHeader/NavHeader.d.ts +10 -2
- package/dist/components/NavHeader/NavHeader.js +25 -29
- package/dist/components/NavHeader/NavHeader.styles.d.ts +3845 -1387
- package/dist/components/NavHeader/NavHeader.styles.js +18 -17
- package/dist/components/Notification/Notification.d.ts +816 -322
- package/dist/components/Notification/Notification.js +18 -15
- package/dist/components/P/P.d.ts +2 -0
- package/dist/components/P/P.js +3 -2
- package/dist/components/PasswordInput/PasswordInput.styled.d.ts +407 -160
- package/dist/components/PasswordInput/PasswordInput.styled.js +2 -1
- package/dist/components/{HorizontalCarousel/HorizontalCarousel.d.ts → ProductCarousel/ProductCarousel.d.ts} +2 -2
- package/dist/components/ProductCarousel/ProductCarousel.js +128 -0
- package/dist/components/ProductCarousel/anchor-point.d.ts +10 -0
- package/dist/components/ProductCarousel/anchor-point.js +53 -0
- package/dist/components/ProductCarousel/index.d.ts +1 -0
- package/dist/components/ProductCarousel/index.js +5 -0
- package/dist/components/Radio/Radio.js +5 -4
- package/dist/components/RadioCard/RadioCard.d.ts +9 -0
- package/dist/components/RadioCard/RadioCard.js +72 -0
- package/dist/components/RadioCard/index.d.ts +1 -0
- package/dist/components/RadioCard/index.js +5 -0
- package/dist/components/SelectField/Select.d.ts +407 -160
- package/dist/components/SelectField/Select.js +8 -7
- package/dist/components/SkeletonCTA/SkeletonCTA.js +2 -1
- package/dist/components/SkeletonCircle/SkeletonCircle.js +2 -2
- package/dist/components/SkeletonText/SkeletonText.js +4 -1
- package/dist/components/Small/Small.d.ts +407 -160
- package/dist/components/Small/Small.js +2 -1
- package/dist/components/Stack/Stack.d.ts +1 -2
- package/dist/components/Stack/Stack.js +2 -1
- package/dist/components/Strong/Strong.d.ts +407 -160
- package/dist/components/SubLabelText/SubLabelText.d.ts +407 -160
- package/dist/components/SubLabelText/SubLabelText.js +2 -1
- package/dist/components/Tabs/Tab.js +8 -7
- package/dist/components/Tabs/TabList.js +2 -1
- package/dist/components/Tabs/TabPanel.js +2 -1
- package/dist/components/Tabs/Tabs.js +2 -1
- package/dist/components/TextareaInput/TextareaInput.js +2 -2
- package/dist/components/Toast/Toast.js +3 -2
- package/dist/components/Toggle/Toggle.js +2 -2
- package/dist/components/Toggle/styles.d.ts +1638 -650
- package/dist/components/Toggle/styles.js +5 -4
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/esm/components/Accordion/Accordion.js +4 -9
- package/dist/esm/components/Accordion/styles.js +4 -3
- package/dist/esm/components/ActionCard/ActionCard.js +4 -3
- package/dist/esm/components/ActionList/ActionList.js +2 -1
- package/dist/esm/components/ActionList/styled.js +6 -5
- package/dist/esm/components/Badge/Badge.js +3 -2
- package/dist/esm/components/CTAButton/CTAButton.js +7 -6
- package/dist/esm/components/Card/Card.js +5 -4
- package/dist/esm/components/Checkbox/Checkbox.js +4 -3
- package/dist/esm/components/DataTable/styles.js +14 -15
- package/dist/esm/components/DateField/DateField.js +4 -3
- package/dist/esm/components/DescriptionList/styled.js +5 -4
- package/dist/esm/components/Disclosure/Disclosure.js +4 -3
- package/dist/esm/components/ErrorText/ErrorText.js +2 -3
- package/dist/esm/components/FilterSelect/FilterSelect.js +5 -4
- package/dist/esm/components/Grid/Col.js +3 -3
- package/dist/esm/components/Grid/Row.js +4 -4
- package/dist/esm/components/Heading1/Heading1.js +5 -3
- package/dist/esm/components/Heading2/Heading2.js +5 -3
- package/dist/esm/components/Heading3/Heading3.js +5 -3
- package/dist/esm/components/Heading4/Heading4.js +5 -3
- package/dist/esm/components/HintText/HintText.js +2 -3
- package/dist/esm/components/Input/Input.js +7 -4
- package/dist/esm/components/Label/Label.js +17 -4
- package/dist/esm/components/LabelText/LabelText.js +2 -1
- package/dist/esm/components/Lead/Lead.js +19 -4
- package/dist/esm/components/List/styled.js +4 -4
- package/dist/esm/components/Margin/Margin.js +2 -3
- package/dist/esm/components/NavHeader/NavHeader.js +26 -30
- package/dist/esm/components/NavHeader/NavHeader.styles.js +17 -16
- package/dist/esm/components/Notification/Notification.js +18 -15
- package/dist/esm/components/P/P.js +3 -2
- package/dist/esm/components/PasswordInput/PasswordInput.styled.js +2 -1
- package/dist/esm/components/ProductCarousel/ProductCarousel.js +98 -0
- package/dist/esm/components/ProductCarousel/anchor-point.js +49 -0
- package/dist/esm/components/ProductCarousel/index.js +1 -0
- package/dist/esm/components/Radio/Radio.js +5 -4
- package/dist/esm/components/RadioCard/RadioCard.js +66 -0
- package/dist/esm/components/RadioCard/index.js +1 -0
- package/dist/esm/components/SelectField/Select.js +8 -7
- package/dist/esm/components/SkeletonCTA/SkeletonCTA.js +2 -1
- package/dist/esm/components/SkeletonCircle/SkeletonCircle.js +1 -1
- package/dist/esm/components/SkeletonText/SkeletonText.js +4 -1
- package/dist/esm/components/Small/Small.js +2 -1
- package/dist/esm/components/Stack/Stack.js +2 -1
- package/dist/esm/components/SubLabelText/SubLabelText.js +2 -1
- package/dist/esm/components/Tabs/Tab.js +9 -8
- package/dist/esm/components/Tabs/TabList.js +2 -1
- package/dist/esm/components/Tabs/TabPanel.js +2 -1
- package/dist/esm/components/Tabs/Tabs.js +2 -1
- package/dist/esm/components/TextareaInput/TextareaInput.js +2 -2
- package/dist/esm/components/Toast/Toast.js +3 -2
- package/dist/esm/components/Toggle/Toggle.js +2 -2
- package/dist/esm/components/Toggle/styles.js +5 -4
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/utils/utils.js +1 -7
- package/dist/styled.native.d.ts +2523 -1041
- package/dist/utils/utils.d.ts +1 -3
- package/dist/utils/utils.js +1 -9
- package/package.json +5 -4
- package/dist/components/HorizontalCarousel/HorizontalCarousel.js +0 -92
- package/dist/components/HorizontalCarousel/index.d.ts +0 -1
- package/dist/components/HorizontalCarousel/index.js +0 -17
- package/dist/esm/components/HorizontalCarousel/HorizontalCarousel.js +0 -62
- package/dist/esm/components/HorizontalCarousel/index.js +0 -1
- /package/dist/components/{HorizontalCarousel → ProductCarousel}/NavigationDots.d.ts +0 -0
- /package/dist/components/{HorizontalCarousel → ProductCarousel}/NavigationDots.js +0 -0
- /package/dist/esm/components/{HorizontalCarousel → ProductCarousel}/NavigationDots.js +0 -0
|
@@ -4,15 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.StyledToggleDot = exports.StyledToggleInput = exports.StyledToggleInputWrapper = exports.StyledWrapper = void 0;
|
|
7
|
+
var element_core_1 = require("@ovotech/element-core");
|
|
7
8
|
var react_native_1 = require("react-native");
|
|
8
9
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
9
10
|
exports.StyledWrapper = styled_native_1.default.TouchableOpacity(function (_a) {
|
|
10
11
|
var core = _a.theme.core, hasLabel = _a.hasLabel, labelPosition = _a.labelPosition;
|
|
11
|
-
return "\n width: ".concat(hasLabel ? '100%' : core.space[11], ";\n display: flex;\n flex-direction: row").concat(labelPosition === 'left' ? '' : '-reverse', ";\n justify-content: space-between;\n position: relative;\n ");
|
|
12
|
+
return "\n width: ".concat(hasLabel ? '100%' : (0, element_core_1.numToPx)(core.space[11]), ";\n display: flex;\n flex-direction: row").concat(labelPosition === 'left' ? '' : '-reverse', ";\n justify-content: space-between;\n position: relative;\n ");
|
|
12
13
|
});
|
|
13
14
|
exports.StyledToggleInputWrapper = styled_native_1.default.View(function (_a) {
|
|
14
15
|
var core = _a.theme.core, labelPosition = _a.labelPosition;
|
|
15
|
-
return "\n width: ".concat(core.space[11], ";\n height: ").concat(core.space[6], ";\n ").concat(labelPosition
|
|
16
|
+
return "\n width: ".concat((0, element_core_1.numToPx)(core.space[11]), ";\n height: ").concat((0, element_core_1.numToPx)(core.space[6]), ";\n ").concat(labelPosition
|
|
16
17
|
? labelPosition === 'left'
|
|
17
18
|
? 'margin-left: 10px;'
|
|
18
19
|
: 'margin-right: 10px;'
|
|
@@ -20,9 +21,9 @@ exports.StyledToggleInputWrapper = styled_native_1.default.View(function (_a) {
|
|
|
20
21
|
});
|
|
21
22
|
exports.StyledToggleInput = styled_native_1.default.View(function (_a) {
|
|
22
23
|
var core = _a.theme.core, checked = _a.checked;
|
|
23
|
-
return "\n width: ".concat(core.space[11], ";\n height: ").concat(core.space[6], ";\n justify-content: center;\n border-radius: ").concat(core.radius.large, ";\n background: ").concat(checked ? core.color.brand.ovo : core.color.neutral.lighter, ";\n ");
|
|
24
|
+
return "\n width: ".concat((0, element_core_1.numToPx)(core.space[11]), ";\n height: ").concat((0, element_core_1.numToPx)(core.space[6]), ";\n justify-content: center;\n border-radius: ").concat((0, element_core_1.numToPx)(core.radius.large), ";\n background: ").concat(checked ? core.color.brand.ovo : core.color.neutral.lighter, ";\n ");
|
|
24
25
|
});
|
|
25
26
|
exports.StyledToggleDot = (0, styled_native_1.default)(react_native_1.Animated.View)(function (_a) {
|
|
26
27
|
var core = _a.theme.core, checked = _a.checked;
|
|
27
|
-
return "\n position: absolute;\n width: ".concat(core.space[4], ";\n height: ").concat(core.space[4], ";\n border-radius: ").concat(core.space[4], ";\n background-color: ").concat(checked ? core.color.brand.white : core.color.neutral.dark, ";\n");
|
|
28
|
+
return "\n position: absolute;\n width: ".concat((0, element_core_1.numToPx)(core.space[4]), ";\n height: ").concat((0, element_core_1.numToPx)(core.space[4]), ";\n border-radius: ").concat((0, element_core_1.numToPx)(core.space[4]), ";\n background-color: ").concat(checked ? core.color.brand.white : core.color.neutral.dark, ";\n");
|
|
28
29
|
});
|
package/dist/components/index.js
CHANGED
|
@@ -74,3 +74,5 @@ __exportStar(require("./TextInput"), exports);
|
|
|
74
74
|
__exportStar(require("./TextLink"), exports);
|
|
75
75
|
__exportStar(require("./Toggle"), exports);
|
|
76
76
|
__exportStar(require("./Toast"), exports);
|
|
77
|
+
__exportStar(require("./ProductCarousel"), exports);
|
|
78
|
+
__exportStar(require("./RadioCard"), exports);
|
|
@@ -29,7 +29,6 @@ import { Component, useCallback, useContext, useEffect, useMemo, useState, } fro
|
|
|
29
29
|
import Animated, { interpolateColor, runOnUI, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming, } from 'react-native-reanimated';
|
|
30
30
|
import { useLayout } from '../../hooks/use-layout';
|
|
31
31
|
import { ThemeContext } from '../../styled.native';
|
|
32
|
-
import { pxToNumber } from '../../utils';
|
|
33
32
|
import { Heading4 } from '../Heading4';
|
|
34
33
|
import { AccordionGroupContext } from './Group';
|
|
35
34
|
import { AccordionIcon } from './Icon';
|
|
@@ -55,14 +54,10 @@ export var Accordion = function (_a) {
|
|
|
55
54
|
var _c = useContext(ThemeContext), core = _c.core, semantic = _c.semantic;
|
|
56
55
|
var Header = useContext(AccordionGroupContext).Header;
|
|
57
56
|
var AccordionHeading = Header !== null && Header !== void 0 ? Header : Heading4;
|
|
58
|
-
var AnimatedHeading = useMemo(function () { return withAnimated(AccordionHeading); }, [
|
|
59
|
-
AccordionHeading,
|
|
60
|
-
]);
|
|
57
|
+
var AnimatedHeading = useMemo(function () { return withAnimated(AccordionHeading); }, [AccordionHeading]);
|
|
61
58
|
var _d = useLayout(0), layout = _d[0], onLayout = _d[1];
|
|
62
59
|
var _e = useState(expanded), open = _e[0], setOpen = _e[1];
|
|
63
|
-
var handleHeightContent = useMemo(function () { return layout.height || 100; }, [
|
|
64
|
-
layout.height,
|
|
65
|
-
]);
|
|
60
|
+
var handleHeightContent = useMemo(function () { return layout.height || 100; }, [layout.height]);
|
|
66
61
|
var size = useSharedValue(handleHeightContent);
|
|
67
62
|
useEffect(function () {
|
|
68
63
|
runOnUI(function () {
|
|
@@ -101,8 +96,8 @@ export var Accordion = function (_a) {
|
|
|
101
96
|
return (_jsxs(StyledAccordion, __assign({ first: first, last: last, isExpanded: open }, { children: [_jsxs(StyledAccordionHeader, __assign({ accessibilityState: { expanded: open }, onPress: toggleOpen, testID: "accordionTitle" }, { children: [_jsx(AnimatedHeading, __assign({ style: [
|
|
102
97
|
headerStyle,
|
|
103
98
|
{
|
|
104
|
-
paddingTop:
|
|
105
|
-
paddingRight:
|
|
99
|
+
paddingTop: core.space[1],
|
|
100
|
+
paddingRight: core.space[3],
|
|
106
101
|
marginTop: 0,
|
|
107
102
|
marginBottom: 0,
|
|
108
103
|
flexShrink: 1,
|
|
@@ -2,11 +2,12 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
+
import { numToPx } from '@ovotech/element-core';
|
|
5
6
|
import Animated from 'react-native-reanimated';
|
|
6
7
|
import styled, { css } from '../../styled.native';
|
|
7
8
|
export var StyledAccordion = styled(Animated.View)(function (_a) {
|
|
8
9
|
var _b = _a.theme, semantic = _b.semantic, core = _b.core, first = _a.first, last = _a.last, isExpanded = _a.isExpanded;
|
|
9
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n border-width: ", ";\n border-color: ", ";\n border-bottom-width: 0;\n background-color: ", ";\n transition: background-color ", ";\n\n ", "\n\n ", "\n "], ["\n width: 100%;\n border-width: ", ";\n border-color: ", ";\n border-bottom-width: 0;\n background-color: ", ";\n transition: background-color ", ";\n\n ", "\n\n ", "\n "])), core.borderWidth.small, semantic.border.differentiated, isExpanded ? core.color.brand.white : 'transparent', core.transition.fast, first
|
|
10
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n border-width: ", ";\n border-color: ", ";\n border-bottom-width: 0;\n background-color: ", ";\n transition: background-color ", ";\n\n ", "\n\n ", "\n "], ["\n width: 100%;\n border-width: ", ";\n border-color: ", ";\n border-bottom-width: 0;\n background-color: ", ";\n transition: background-color ", ";\n\n ", "\n\n ", "\n "])), numToPx(core.borderWidth.small), semantic.border.differentiated, isExpanded ? core.color.brand.white : 'transparent', core.transition.fast, first
|
|
10
11
|
? {
|
|
11
12
|
borderTopLeftRadius: core.radius.small,
|
|
12
13
|
borderTopRightRadius: core.radius.small,
|
|
@@ -21,10 +22,10 @@ export var StyledAccordion = styled(Animated.View)(function (_a) {
|
|
|
21
22
|
});
|
|
22
23
|
export var StyledAccordionHeader = styled.TouchableOpacity(function (_a) {
|
|
23
24
|
var core = _a.theme.core;
|
|
24
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-left: ", ";\n padding-right: 18px;\n padding-bottom: 18px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n "], ["\n padding-top: ", ";\n padding-left: ", ";\n padding-right: 18px;\n padding-bottom: 18px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n "])), core.space[5], core.space[3]);
|
|
25
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-left: ", ";\n padding-right: 18px;\n padding-bottom: 18px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n "], ["\n padding-top: ", ";\n padding-left: ", ";\n padding-right: 18px;\n padding-bottom: 18px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n "])), numToPx(core.space[5]), numToPx(core.space[3]));
|
|
25
26
|
});
|
|
26
27
|
export var StyledContainer = styled.View(function (_a) {
|
|
27
28
|
var core = _a.theme.core;
|
|
28
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-top: 0;\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n "], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-top: 0;\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n "])), core.space[12], core.space[6], core.space[3]);
|
|
29
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-top: 0;\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n "], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-top: 0;\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n "])), numToPx(core.space[12]), numToPx(core.space[6]), numToPx(core.space[3]));
|
|
29
30
|
});
|
|
30
31
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -10,6 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { numToPx } from '@ovotech/element-core';
|
|
13
14
|
import MaskedView from '@react-native-masked-view/masked-view';
|
|
14
15
|
import { useContext, useEffect } from 'react';
|
|
15
16
|
import { Image, Pressable, View } from 'react-native';
|
|
@@ -22,7 +23,7 @@ var StyledCard = styled.Pressable(function (_a) {
|
|
|
22
23
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, inline = _a.inline, inverted = _a.inverted, reducedBottomPadding = _a.reducedBottomPadding;
|
|
23
24
|
var paddingVal = inline ? core.space[4] : core.space[6];
|
|
24
25
|
var reducedBottomPaddingVal = inline ? core.space[3] : core.space[5];
|
|
25
|
-
return "\n border-radius: ".concat(inline ? core.space[6] : 0, ";\n background-color: ").concat(inverted ? semantic.inverted.surface : semantic.surface.elevated, ";\n padding: ").concat(paddingVal, ";\n padding-bottom: ").concat(reducedBottomPadding ? reducedBottomPaddingVal : paddingVal, ";\n overflow: hidden;\n border-width: 0;\n width: 100%;\n ");
|
|
26
|
+
return "\n border-radius: ".concat(inline ? numToPx(core.space[6]) : 0, ";\n background-color: ").concat(inverted ? semantic.inverted.surface : semantic.surface.elevated, ";\n padding: ").concat(numToPx(paddingVal), ";\n padding-bottom: ").concat(numToPx(reducedBottomPadding ? reducedBottomPaddingVal : paddingVal), ";\n overflow: hidden;\n border-width: 0;\n width: 100%;\n ");
|
|
26
27
|
});
|
|
27
28
|
var StyledP = styled(P)(function (_a) {
|
|
28
29
|
var semantic = _a.theme.semantic, inverted = _a.inverted;
|
|
@@ -37,7 +38,7 @@ export var ActionCard = function (_a) {
|
|
|
37
38
|
}
|
|
38
39
|
}, []);
|
|
39
40
|
var Heading = inline ? Heading3 : Heading2;
|
|
40
|
-
var cardPadding =
|
|
41
|
+
var cardPadding = core.space[inline ? 4 : 6];
|
|
41
42
|
var negativeMarginAdjustment = -cardPadding;
|
|
42
43
|
return (_jsx(StyledCard, __assign({ onPress: onPressIndicator, inline: inline, inverted: inverted, reducedBottomPadding: Boolean(buttonTitle && !ctaVariant), testID: "".concat(testID, "-card") }, { children: _jsxs(View, __assign({ style: { flexDirection: 'row' } }, { children: [_jsx(View, __assign({ style: { flex: 1 } }, { children: _jsxs(Stack, __assign({ spaceBetween: 2 }, { children: [_jsx(Heading, __assign({ style: {
|
|
43
44
|
color: inverted
|
|
@@ -46,7 +47,7 @@ export var ActionCard = function (_a) {
|
|
|
46
47
|
paddingRight: image || !onPressCloseButton ? 0 : cardPadding,
|
|
47
48
|
}, testID: "".concat(testID, "-heading") }, { children: title })), _jsxs(View, { children: [typeof body === 'string' ? (_jsx(View, __assign({ style: {
|
|
48
49
|
paddingRight: !image && !title && onPressCloseButton ? cardPadding : 0,
|
|
49
|
-
} }, { children: _jsx(StyledP, __assign({ inverted: inverted }, { children: body })) }))) : (body), buttonTitle && onPressActionButton && !onPressIndicator ? (!ctaVariant ? (_jsx(Margin, __assign({ top: 2 }, { children: _jsx(Action, __assign({ inverted: inverted, inline: true, onPress: onPressActionButton, testID: "".concat(testID, "-button") }, { children: buttonTitle })) }))) : (_jsx(Margin, __assign({ top: 4 }, { children: _jsx(CTAButton, __assign({ onPress: onPressActionButton, testID: "".concat(testID, "-button"), variant: ctaVariant }, { children: buttonTitle })) })))) : null] })] })) })), image ? (_jsx(MaskedView, __assign({ style: {
|
|
50
|
+
} }, { children: _jsx(StyledP, __assign({ inverted: inverted }, { children: body })) }))) : (body), buttonTitle && onPressActionButton && !onPressIndicator ? (!ctaVariant ? (_jsx(Margin, __assign({ top: 2 }, { children: _jsx(Action, __assign({ inverted: inverted, inline: true, onPress: onPressActionButton, testID: "".concat(testID, "-button"), iconRight: "chevron-right-small" }, { children: buttonTitle })) }))) : (_jsx(Margin, __assign({ top: 4 }, { children: _jsx(CTAButton, __assign({ onPress: onPressActionButton, testID: "".concat(testID, "-button"), variant: ctaVariant }, { children: buttonTitle })) })))) : null] })] })) })), image ? (_jsx(MaskedView, __assign({ style: {
|
|
50
51
|
flex: 1,
|
|
51
52
|
flexDirection: 'row',
|
|
52
53
|
height: '100%',
|
|
@@ -29,13 +29,14 @@ var ActionList = function (_a) {
|
|
|
29
29
|
var children = _a.children, inverted = _a.inverted, rest = __rest(_a, ["children", "inverted"]);
|
|
30
30
|
var childCount = children.length;
|
|
31
31
|
return (_jsx(StyledActionList, __assign({}, rest, { children: Children.map(children, function (child, index) {
|
|
32
|
-
var _a;
|
|
32
|
+
var _a, _b;
|
|
33
33
|
return cloneElement(child, {
|
|
34
34
|
fullWidth: 'always',
|
|
35
35
|
index: index,
|
|
36
36
|
hasBorder: childCount > 1 && index !== childCount - 1,
|
|
37
37
|
inverted: (_a = child.props.inverted) !== null && _a !== void 0 ? _a : inverted,
|
|
38
38
|
inList: true,
|
|
39
|
+
iconRight: (_b = child.props.iconRight) !== null && _b !== void 0 ? _b : 'chevron-right-small',
|
|
39
40
|
});
|
|
40
41
|
}) })));
|
|
41
42
|
};
|
|
@@ -2,17 +2,18 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
+
import { numToPx } from '@ovotech/element-core';
|
|
5
6
|
import styled, { css } from '../../styled.native';
|
|
6
7
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
7
8
|
import { Icon } from '../Icon';
|
|
8
9
|
var StyledList = styled.View(function (_a) {
|
|
9
10
|
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
10
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n flex-direction: column;\n margin-top: ", ";\n margin-bottom: ", ";\n "])), smallAndUp ? core.space[3] : core.space[2], smallAndUp ? core.space[3] : core.space[2]);
|
|
11
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n flex-direction: column;\n margin-top: ", ";\n margin-bottom: ", ";\n "])), numToPx(smallAndUp ? core.space[3] : core.space[2]), numToPx(smallAndUp ? core.space[3] : core.space[2]));
|
|
11
12
|
});
|
|
12
13
|
export var StyledActionList = styledComponentWithBreakpoints(StyledList);
|
|
13
14
|
export var StyledActionWrapper = styled.View(function (_a) {
|
|
14
15
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, hasBorder = _a.hasBorder, inverted = _a.inverted;
|
|
15
|
-
return "\n width: 100%;\n align-self: flex-start;\n border-bottom-width: ".concat(hasBorder ? core.borderWidth.small : 0, ";\n border-bottom-style: solid;\n border-bottom-color: ").concat(inverted ? semantic.inverted.border : semantic.border.graphic, ";\n");
|
|
16
|
+
return "\n width: 100%;\n align-self: flex-start;\n border-bottom-width: ".concat(hasBorder ? numToPx(core.borderWidth.small) : 0, ";\n border-bottom-style: solid;\n border-bottom-color: ").concat(inverted ? semantic.inverted.border : semantic.border.graphic, ";\n");
|
|
16
17
|
});
|
|
17
18
|
export var StyledActionInner = styled.View(function (_a) {
|
|
18
19
|
var fullWidth = _a.fullWidth, inline = _a.inline;
|
|
@@ -25,14 +26,14 @@ export var StyledActionText = styled.Text(function (_a) {
|
|
|
25
26
|
: core.fontSize.body.small;
|
|
26
27
|
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n flex: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n flex: ", ";\n "])), inverted
|
|
27
28
|
? semantic.inverted.message.base
|
|
28
|
-
: semantic.message.base, core.fontFamily.bodyBold.native, fontSize, core.lineHeight.body.small, inList ? 1 : 'none');
|
|
29
|
+
: semantic.message.base, core.fontFamily.bodyBold.native, numToPx(fontSize), numToPx(core.lineHeight.body.small), inList ? 1 : 'none');
|
|
29
30
|
});
|
|
30
31
|
export var StyledRightIcon = styled(Icon)(function (_a) {
|
|
31
32
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, inverted = _a.inverted, marginTop = _a.marginTop;
|
|
32
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n margin-left: ", ";\n margin-top: ", ";\n "], ["\n color: ", ";\n margin-left: ", ";\n margin-top: ", ";\n "])), inverted ? semantic.inverted.message.base : semantic.message.base, core.space[1], core.space[marginTop]);
|
|
33
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n margin-left: ", ";\n margin-top: ", ";\n "], ["\n color: ", ";\n margin-left: ", ";\n margin-top: ", ";\n "])), inverted ? semantic.inverted.message.base : semantic.message.base, numToPx(core.space[1]), numToPx(core.space[marginTop]));
|
|
33
34
|
});
|
|
34
35
|
export var StyledLeftIcon = styled(Icon)(function (_a) {
|
|
35
36
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, inverted = _a.inverted;
|
|
36
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n margin-right: ", ";\n margin-top: ", ";\n align-self: start;\n "], ["\n color: ", ";\n margin-right: ", ";\n margin-top: ", ";\n align-self: start;\n "])), inverted ? semantic.inverted.message.base : semantic.message.base, core.space[1], core.space[1]);
|
|
37
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n margin-right: ", ";\n margin-top: ", ";\n align-self: start;\n "], ["\n color: ", ";\n margin-right: ", ";\n margin-top: ", ";\n align-self: start;\n "])), inverted ? semantic.inverted.message.base : semantic.message.base, numToPx(core.space[1]), numToPx(core.space[1]));
|
|
37
38
|
});
|
|
38
39
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -25,6 +25,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
28
29
|
import styled, { css } from '../../styled.native';
|
|
29
30
|
var StyledBadge = styled.View(function (_a) {
|
|
30
31
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, component = _b.component, _c = _a.variant, variant = _c === void 0 ? 'info' : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, customVariant = _a.customVariant;
|
|
@@ -42,7 +43,7 @@ var StyledBadge = styled.View(function (_a) {
|
|
|
42
43
|
surface = customVariant.backgroundColor;
|
|
43
44
|
message = customVariant.foregroundColor;
|
|
44
45
|
}
|
|
45
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 ", ";\n border-radius: 16px;\n border: ", " solid
|
|
46
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 ", ";\n border-radius: 16px;\n border: ", " solid\n ", ";\n background-color: ", ";\n align-self: flex-start;\n "], ["\n padding: 0 ", ";\n border-radius: 16px;\n border: ", " solid\n ", ";\n background-color: ", ";\n align-self: flex-start;\n "])), numToPx(core.space[2]), numToPx(core.borderWidth.medium), core.color.brand.white, inverted ? message : surface);
|
|
46
47
|
});
|
|
47
48
|
var StyledBadgeText = styled.Text(function (_a) {
|
|
48
49
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, component = _b.component, _c = _a.variant, variant = _c === void 0 ? 'info' : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, customVariant = _a.customVariant;
|
|
@@ -60,7 +61,7 @@ var StyledBadgeText = styled.Text(function (_a) {
|
|
|
60
61
|
surface = customVariant.backgroundColor;
|
|
61
62
|
message = customVariant.foregroundColor;
|
|
62
63
|
}
|
|
63
|
-
return 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);
|
|
64
|
+
return 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, numToPx(core.lineHeight.body.small), inverted ? surface : message, numToPx(core.fontSize.body.small));
|
|
64
65
|
});
|
|
65
66
|
export var Badge = function (_a) {
|
|
66
67
|
var children = _a.children, variant = _a.variant, inverted = _a.inverted, rest = __rest(_a, ["children", "variant", "inverted"]);
|
|
@@ -25,6 +25,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
28
29
|
import { forwardRef } from 'react';
|
|
29
30
|
import { useBreakpoint } from '../../hooks';
|
|
30
31
|
import styled, { css } from '../../styled.native';
|
|
@@ -37,21 +38,21 @@ var CTAButtonWrapper = function (_a) {
|
|
|
37
38
|
var StyledInner = styled.View(function (_a) {
|
|
38
39
|
var _b = _a.theme, core = _b.core, component = _b.component, fullWidth = _a.fullWidth, variant = _a.variant;
|
|
39
40
|
var currentVariant = component.cta[variant];
|
|
40
|
-
var borderRadius =
|
|
41
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: ", " ", ";\n background-color: ", ";\n border-radius: ", ";\n min-height: ", ";\n border: ", ";\n justify-content: center;\n align-items: center;\n flex-direction: row;\n flex-grow: 1;\n\n ", ";\n "], ["\n padding: ", " ", ";\n background-color: ", ";\n border-radius: ", ";\n min-height: ", ";\n border: ", ";\n justify-content: center;\n align-items: center;\n flex-direction: row;\n flex-grow: 1;\n\n ", ";\n "])), core.space[2], core.space[4], currentVariant.surface, borderRadius, core.space[11], variant === 'secondary'
|
|
42
|
-
? "solid ".concat(core.borderWidth.small, " ").concat(core.color.brand.forest)
|
|
41
|
+
var borderRadius = core.space[11] / 2 + 'px';
|
|
42
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: ", " ", ";\n background-color: ", ";\n border-radius: ", ";\n min-height: ", ";\n border: ", ";\n justify-content: center;\n align-items: center;\n flex-direction: row;\n flex-grow: 1;\n\n ", ";\n "], ["\n padding: ", " ", ";\n background-color: ", ";\n border-radius: ", ";\n min-height: ", ";\n border: ", ";\n justify-content: center;\n align-items: center;\n flex-direction: row;\n flex-grow: 1;\n\n ", ";\n "])), numToPx(core.space[2]), numToPx(core.space[4]), currentVariant.surface, borderRadius, numToPx(core.space[11]), variant === 'secondary'
|
|
43
|
+
? "solid ".concat(numToPx(core.borderWidth.small), " ").concat(core.color.brand.forest)
|
|
43
44
|
: 'none', fullWidth === 'never'
|
|
44
45
|
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-grow: 0;\n "], ["\n flex-grow: 0;\n "]))) : '');
|
|
45
46
|
});
|
|
46
47
|
var StyledRightIcon = styled(Icon)(function (_a) {
|
|
47
48
|
var _b = _a.theme, core = _b.core, component = _b.component, variant = _a.variant;
|
|
48
49
|
var currentVariant = component.cta[variant];
|
|
49
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n
|
|
50
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-left: ", ";\n color: ", ";\n "], ["\n margin-left: ", ";\n color: ", ";\n "])), numToPx(core.space[1]), currentVariant.message);
|
|
50
51
|
});
|
|
51
52
|
var StyledLeftIcon = styled(Icon)(function (_a) {
|
|
52
53
|
var _b = _a.theme, core = _b.core, component = _b.component, variant = _a.variant;
|
|
53
54
|
var currentVariant = component.cta[variant];
|
|
54
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n
|
|
55
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-right: ", ";\n color: ", ";\n "], ["\n margin-right: ", ";\n color: ", ";\n "])), numToPx(core.space[1]), currentVariant.message);
|
|
55
56
|
});
|
|
56
57
|
var StyledCTAButtonText = styled.Text(function (_a) {
|
|
57
58
|
var _b = _a.theme, core = _b.core, component = _b.component, smallAndUp = _a.smallAndUp, variant = _a.variant;
|
|
@@ -59,7 +60,7 @@ var StyledCTAButtonText = styled.Text(function (_a) {
|
|
|
59
60
|
? core.fontSize.body.large
|
|
60
61
|
: core.fontSize.body.small;
|
|
61
62
|
var currentVariant = component.cta[variant];
|
|
62
|
-
return 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);
|
|
63
|
+
return 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, numToPx(fontSize), numToPx(core.lineHeight.body.small));
|
|
63
64
|
});
|
|
64
65
|
var CTAButton = function (_a) {
|
|
65
66
|
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"]);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { numToPx } from '@ovotech/element-core';
|
|
1
2
|
import styled from '../../styled.native';
|
|
2
3
|
export var Card = styled.View(function (_a) {
|
|
3
|
-
var _b = _a.theme, core = _b.core, semantic = _b.semantic, _c = _a.inline, inline = _c === void 0 ? false : _c;
|
|
4
|
-
return "\n background: ".concat(semantic.surface.elevated, ";\n
|
|
5
|
-
?
|
|
6
|
-
:
|
|
4
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, _c = _a.inline, inline = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, smallAndUp = _a.smallAndUp;
|
|
5
|
+
return "\n background: ".concat(inverted ? semantic.inverted.surface : semantic.surface.elevated, ";\n padding: ").concat(inline
|
|
6
|
+
? numToPx(core.space[smallAndUp ? 6 : 4])
|
|
7
|
+
: numToPx(core.space[smallAndUp ? 9 : 6]), ";\n border-radius: ").concat(inline ? numToPx(core.radius.max) : 0, ";\n ");
|
|
7
8
|
});
|
|
@@ -25,6 +25,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
28
29
|
import { forwardRef } from 'react';
|
|
29
30
|
import { TouchableOpacity, View, } from 'react-native';
|
|
30
31
|
import styled from '../../styled.native';
|
|
@@ -38,11 +39,11 @@ var StyledCheckboxInputWrapper = styled.View(function (_a) {
|
|
|
38
39
|
var core = _a.theme.core;
|
|
39
40
|
var checkboxSize = core.space[6];
|
|
40
41
|
var gap = core.space[2];
|
|
41
|
-
return "\n width: ".concat(
|
|
42
|
+
return "\n width: ".concat(numToPx(checkboxSize + gap), ";\n height: ").concat(numToPx(core.space[11]), ";\n ");
|
|
42
43
|
});
|
|
43
44
|
var StyledCheckboxInput = styled.View(function (_a) {
|
|
44
45
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
|
|
45
|
-
return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n border: ").concat(core.borderWidth.small, " solid;\n margin-top: 10px;\n border-radius: ").concat(core.radius.small, ";\n border-color: ").concat(invalid
|
|
46
|
+
return "\n width: ".concat(numToPx(core.space[6]), ";\n height: ").concat(numToPx(core.space[6]), ";\n border: ").concat(numToPx(core.borderWidth.small), " solid;\n margin-top: 10px;\n border-radius: ").concat(numToPx(core.radius.small), ";\n border-color: ").concat(invalid
|
|
46
47
|
? semantic.message.error
|
|
47
48
|
: checked
|
|
48
49
|
? core.color.blue.dark
|
|
@@ -61,7 +62,7 @@ var Input = function (_a) {
|
|
|
61
62
|
};
|
|
62
63
|
var CheckLabelText = styled(LabelText)(function (_a) {
|
|
63
64
|
var core = _a.theme.core;
|
|
64
|
-
return "\n padding-top: ".concat(core.space[3], ";\n ");
|
|
65
|
+
return "\n padding-top: ".concat(numToPx(core.space[3]), ";\n ");
|
|
65
66
|
});
|
|
66
67
|
var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
67
68
|
var Checkbox = forwardRef(function (_a, ref) {
|
|
@@ -2,61 +2,60 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
+
import { numToPx } from '@ovotech/element-core';
|
|
5
6
|
import styled, { css } from '../../styled.native';
|
|
6
7
|
export var StyledTableContainer = styled.View(function (_a) {
|
|
7
8
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
8
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), core.borderWidth.small, semantic.border.differentiated);
|
|
9
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), numToPx(core.borderWidth.small), semantic.border.differentiated);
|
|
9
10
|
});
|
|
10
11
|
export var TableHeader = styled.View(function (_a) {
|
|
11
12
|
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
12
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", "
|
|
13
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", "\n ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "], ["\n padding: ", "\n ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[1]), cellWidth === 'auto' ? 1 : 0, cellWidth);
|
|
13
14
|
});
|
|
14
15
|
export var TableHeaderText = styled.Text(function (_a) {
|
|
15
16
|
var _b = _a.theme, semantic = _b.semantic, core = _b.core, smallAndUp = _a.smallAndUp;
|
|
16
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body[smallAndUp ? 'large' : 'small'], core.fontSize.body[smallAndUp ? 'large' : 'small'], semantic.message.base);
|
|
17
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, numToPx(core.lineHeight.body[smallAndUp ? 'large' : 'small']), numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']), semantic.message.base);
|
|
17
18
|
});
|
|
18
19
|
export var TableCaptionText = styled.Text(function (_a) {
|
|
19
20
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
20
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n
|
|
21
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, numToPx(core.fontSize.heading4[smallAndUp ? 'large' : 'small']), numToPx(core.lineHeight.heading4[smallAndUp ? 'large' : 'small']), semantic.message.branded);
|
|
21
22
|
});
|
|
22
23
|
export var CellText = styled.Text(function (_a) {
|
|
23
24
|
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
24
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, core.lineHeight.body.large, core.fontSize.body[smallAndUp ? 'large' : 'small']);
|
|
25
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, numToPx(core.lineHeight.body.large), numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']));
|
|
25
26
|
});
|
|
26
27
|
export var TableCaption = styled.View(function (_a) {
|
|
27
28
|
var core = _a.theme.core;
|
|
28
|
-
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), core.space[4], core.space[2]);
|
|
29
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), numToPx(core.space[4]), numToPx(core.space[2]));
|
|
29
30
|
});
|
|
30
31
|
export var TableRow = styled.View(function (_a) {
|
|
31
32
|
var _b = _a.theme, semantic = _b.semantic, core = _b.core, stripe = _a.stripe;
|
|
32
33
|
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), stripe
|
|
33
34
|
? semantic.surface.cutout
|
|
34
|
-
: semantic.surface.base, stripe ? '0px' :
|
|
35
|
+
: semantic.surface.base, stripe ? '0px' : numToPx(core.borderWidth.small), stripe
|
|
35
36
|
? 'transparent'
|
|
36
37
|
: "".concat(semantic.border.differentiated));
|
|
37
38
|
});
|
|
38
39
|
export var TableRowHeading = styled.View(function (_a) {
|
|
39
40
|
var _b = _a.theme, semantic = _b.semantic, core = _b.core;
|
|
40
|
-
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n
|
|
41
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), semantic.surface.base, numToPx(core.borderWidth.small), semantic.border.functional);
|
|
41
42
|
});
|
|
42
43
|
export var TableBody = styled.View(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex-direction: column;\n flex-wrap: nowrap;\n"], ["\n flex-direction: column;\n flex-wrap: nowrap;\n"])));
|
|
43
44
|
export var TableCell = styled.View(function (_a) {
|
|
44
45
|
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
45
|
-
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: ", "
|
|
46
|
+
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding: ", "\n ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", "\n ", ";\n width: ", ";\n flex: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[2]), cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
46
47
|
});
|
|
47
48
|
export var RowHeading = styled.View(function (_a) {
|
|
48
49
|
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
49
|
-
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: ", "
|
|
50
|
+
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: ", "\n ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding: ", "\n ", ";\n width: ", ";\n flex: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[2]), cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
50
51
|
});
|
|
51
52
|
export var StyledSeparatorRow = styled.View(function (_a) {
|
|
52
53
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, width = _a.width;
|
|
53
|
-
var minWidth = width
|
|
54
|
-
|
|
55
|
-
: '100%';
|
|
56
|
-
return "\n min-width: ".concat(minWidth, ";\n flex: 1;\n flex-direction: row;\n background-color: ").concat(semantic.surface.elevated, ";\n padding: ").concat(core.space[1], " ").concat(core.space[2], ";\n ");
|
|
54
|
+
var minWidth = width ? "".concat(width - core.space[2] * 2, "px") : '100%';
|
|
55
|
+
return "\n min-width: ".concat(minWidth, ";\n flex: 1;\n flex-direction: row;\n background-color: ").concat(semantic.surface.elevated, ";\n padding: ").concat(numToPx(core.space[1]), " ").concat(numToPx(core.space[2]), ";\n ");
|
|
57
56
|
});
|
|
58
57
|
export var SeparatorRowText = styled.Text(function (_a) {
|
|
59
58
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
60
|
-
return "\n flex: 1;\n font-family: ".concat(core.fontFamily.body.native, ";\n font-size: ").concat(core.fontSize.small[smallAndUp ? 'large' : 'small'], ";\n line-height: ").concat(core.lineHeight.small[smallAndUp ? 'large' : 'small'], ";\n color: ").concat(semantic.message.secondary, ";\n");
|
|
59
|
+
return "\n flex: 1;\n font-family: ".concat(core.fontFamily.body.native, ";\n font-size: ").concat(numToPx(core.fontSize.small[smallAndUp ? 'large' : 'small']), ";\n line-height: ").concat(numToPx(core.lineHeight.small[smallAndUp ? 'large' : 'small']), ";\n color: ").concat(semantic.message.secondary, ";\n");
|
|
61
60
|
});
|
|
62
61
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -14,6 +14,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
16
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { numToPx } from '@ovotech/element-core';
|
|
17
18
|
import { forwardRef, createRef } from 'react';
|
|
18
19
|
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
19
20
|
import { useFullWidth } from '../../hooks';
|
|
@@ -22,18 +23,18 @@ import { mergeRefs, getText } from '../../utils';
|
|
|
22
23
|
import { ErrorText } from '../ErrorText';
|
|
23
24
|
import { FormGroup } from '../FormGroup';
|
|
24
25
|
import { HintText } from '../HintText';
|
|
25
|
-
import { NumberInput } from '../NumberInput';
|
|
26
26
|
import { LabelText } from '../LabelText';
|
|
27
|
+
import { NumberInput } from '../NumberInput';
|
|
27
28
|
import { Stack } from '../Stack';
|
|
28
29
|
import { SubLabelText } from '../SubLabelText';
|
|
29
30
|
var InlineFields = styled.View(function (_a) {
|
|
30
31
|
var stretch = _a.stretch, core = _a.theme.core;
|
|
31
|
-
var margin = core.space[1];
|
|
32
|
+
var margin = numToPx(core.space[1]);
|
|
32
33
|
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "], ["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "])), margin, margin, stretch ? '' : "width: 265px;");
|
|
33
34
|
});
|
|
34
35
|
var SubField = styled(Stack)(function (_a) {
|
|
35
36
|
var core = _a.theme.core;
|
|
36
|
-
var padding = core.space[1];
|
|
37
|
+
var padding = numToPx(core.space[1]);
|
|
37
38
|
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-right: ", ";\n padding-left: ", ";\n "], ["\n padding-right: ", ";\n padding-left: ", ";\n "])), padding, padding);
|
|
38
39
|
});
|
|
39
40
|
var DayField = styled(SubField)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
|
|
@@ -25,21 +25,22 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
28
29
|
import { View } from 'react-native';
|
|
29
30
|
import styled, { css } from '../../styled.native';
|
|
30
31
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
31
32
|
export var Dl = styled.View(function (_a) {
|
|
32
33
|
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
33
|
-
return "\n flex-direction: column;\n flex: 1;\n margin-vertical: ".concat(smallAndUp ? core.space[3] : core.space[2], ";\n");
|
|
34
|
+
return "\n flex-direction: column;\n flex: 1;\n margin-vertical: ".concat(smallAndUp ? numToPx(core.space[3]) : numToPx(core.space[2]), ";\n");
|
|
34
35
|
});
|
|
35
36
|
var StyledDtText = styled.Text(function (_a) {
|
|
36
37
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
37
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "])), core.fontFamily.bodyBold.native, core.lineHeight.body.small, core.fontSize.body.small, semantic.message.base);
|
|
38
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n\n flex: 1;\n "])), core.fontFamily.bodyBold.native, numToPx(core.lineHeight.body.small), numToPx(core.fontSize.body.small), semantic.message.base);
|
|
38
39
|
});
|
|
39
40
|
var DtText = styledComponentWithBreakpoints(StyledDtText);
|
|
40
41
|
var StyledDtItem = styled.View(function (_a) {
|
|
41
42
|
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
42
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n flex-direction: row;\n "])), core.space[smallAndUp ? 4 : 3]);
|
|
43
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n flex-direction: row;\n "])), numToPx(core.space[smallAndUp ? 4 : 3]));
|
|
43
44
|
});
|
|
44
45
|
var DtItem = styledComponentWithBreakpoints(StyledDtItem);
|
|
45
46
|
export var Dt = function (_a) {
|
|
@@ -48,7 +49,7 @@ export var Dt = function (_a) {
|
|
|
48
49
|
};
|
|
49
50
|
var StyledDdText = styled.Text(function (_a) {
|
|
50
51
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
51
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), core.fontFamily.body.native, core.lineHeight.body.small, semantic.message.secondary, core.fontSize.body.small);
|
|
52
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), core.fontFamily.body.native, numToPx(core.lineHeight.body.small), semantic.message.secondary, numToPx(core.fontSize.body.small));
|
|
52
53
|
});
|
|
53
54
|
export var Dd = function (_a) {
|
|
54
55
|
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
@@ -25,6 +25,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
28
29
|
import { forwardRef, useState } from 'react';
|
|
29
30
|
import { useBreakpoint } from '../../hooks';
|
|
30
31
|
import styled, { css } from '../../styled.native';
|
|
@@ -32,15 +33,15 @@ import { Icon } from '../Icon';
|
|
|
32
33
|
var DisclosureButton = styled.TouchableOpacity(function () { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n "], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n "]))); });
|
|
33
34
|
var DisclosureButtonIcon = styled(Icon)(function (_a) {
|
|
34
35
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, expanded = _a.expanded, smallAndUp = _a.smallAndUp;
|
|
35
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)', core.space[smallAndUp ? 2 : 1], semantic.message.link);
|
|
36
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)', numToPx(core.space[smallAndUp ? 2 : 1]), semantic.message.link);
|
|
36
37
|
});
|
|
37
38
|
var DisclosureButtonText = styled.Text(function (_a) {
|
|
38
39
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
39
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, core.fontSize.body[smallAndUp ? 'large' : 'small'], core.lineHeight.body[smallAndUp ? 'large' : 'small'], semantic.message.link, semantic.message.link);
|
|
40
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']), numToPx(core.lineHeight.body[smallAndUp ? 'large' : 'small']), semantic.message.link, semantic.message.link);
|
|
40
41
|
});
|
|
41
42
|
var DisclosurePanel = styled.View(function (_a) {
|
|
42
43
|
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
43
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", ";\n "], ["\n margin-top: ", ";\n padding-left: ", ";\n "])), core.space[smallAndUp ? 3 : 2], core.space[smallAndUp ? 2 : 1]);
|
|
44
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", ";\n "], ["\n margin-top: ", ";\n padding-left: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 2 : 1]));
|
|
44
45
|
});
|
|
45
46
|
export var Disclosure = forwardRef(function (_a, ref) {
|
|
46
47
|
var children = _a.children, title = _a.title, _b = _a.expanded, expanded = _b === void 0 ? false : _b, onToggle = _a.onToggle, rest = __rest(_a, ["children", "title", "expanded", "onToggle"]);
|
|
@@ -2,6 +2,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
+
import { numToPx } from '@ovotech/element-core';
|
|
5
6
|
import styled, { css } from '../../styled.native';
|
|
6
7
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
7
8
|
var StyledErrorText = styled.Text(function (_a) {
|
|
@@ -9,9 +10,7 @@ var StyledErrorText = styled.Text(function (_a) {
|
|
|
9
10
|
var fontSize = smallAndUp
|
|
10
11
|
? core.fontSize.body.large
|
|
11
12
|
: core.fontSize.body.small;
|
|
12
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, smallAndUp
|
|
13
|
-
? core.lineHeight.body.large
|
|
14
|
-
: core.lineHeight.body.small, fontSize, semantic.message.error);
|
|
13
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, numToPx(smallAndUp ? core.lineHeight.body.large : core.lineHeight.body.small), numToPx(fontSize), semantic.message.error);
|
|
15
14
|
});
|
|
16
15
|
var ErrorText = styledComponentWithBreakpoints(StyledErrorText);
|
|
17
16
|
export { ErrorText };
|
|
@@ -14,6 +14,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
16
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { numToPx } from '@ovotech/element-core';
|
|
17
18
|
import { Fragment, useRef, useState } from 'react';
|
|
18
19
|
import { Modal, ScrollView, View } from 'react-native';
|
|
19
20
|
import styled, { css } from '../../styled.native';
|
|
@@ -24,19 +25,19 @@ import { P } from '../P';
|
|
|
24
25
|
import { Strong } from '../Strong';
|
|
25
26
|
var SelectInput = styled.TouchableOpacity(function (_a) {
|
|
26
27
|
var core = _a.theme.core;
|
|
27
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), core.color.brand.white, core.radius.max, core.space[2], core.space[1]);
|
|
28
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), core.color.brand.white, numToPx(core.radius.max), numToPx(core.space[2]), numToPx(core.space[1]));
|
|
28
29
|
});
|
|
29
30
|
var DropdownWrapper = styled.View(function (_a) {
|
|
30
31
|
var core = _a.theme.core;
|
|
31
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n
|
|
32
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n /* 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 */\n background-color: ", "40;\n "], ["\n width: 100%;\n height: 100%;\n /* 40 is an opacity for hex https://gist.github.com/lopspower/03fb1cc0ac9f32ef38f4 */\n background-color: ", "40;\n "])), core.color.neutral.darkest);
|
|
32
33
|
});
|
|
33
34
|
var DropdownContainer = styled.View(function (_a) {
|
|
34
35
|
var core = _a.theme.core;
|
|
35
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1;\n min-width: 25%;\n max-height: 100%;\n border-radius: ", ";\n background-color: ", ";\n position: absolute;\n "], ["\n flex: 1;\n min-width: 25%;\n max-height: 100%;\n border-radius: ", ";\n background-color: ", ";\n position: absolute;\n "])), core.radius.large, core.color.brand.white);
|
|
36
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1;\n min-width: 25%;\n max-height: 100%;\n border-radius: ", ";\n background-color: ", ";\n position: absolute;\n "], ["\n flex: 1;\n min-width: 25%;\n max-height: 100%;\n border-radius: ", ";\n background-color: ", ";\n position: absolute;\n "])), numToPx(core.radius.large), core.color.brand.white);
|
|
36
37
|
});
|
|
37
38
|
var SelectOption = styled.TouchableOpacity(function (_a) {
|
|
38
39
|
var core = _a.theme.core;
|
|
39
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n padding-horizontal: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n padding-horizontal: ", ";\n "])), core.space[2]);
|
|
40
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n padding-horizontal: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n padding-horizontal: ", ";\n "])), numToPx(core.space[2]));
|
|
40
41
|
});
|
|
41
42
|
export var FilterSelect = function (_a) {
|
|
42
43
|
var _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.defaultSelected, defaultSelected = _c === void 0 ? { label: '', value: 'default' } : _c, _d = _a.onSelected, onSelected = _d === void 0 ? function () { return null; } : _d, _e = _a.testID, testID = _e === void 0 ? 'select' : _e, rightText = _a.rightText, leftText = _a.leftText;
|