@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
|
@@ -14,12 +14,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { numToPx } from '@ovotech/element-core';
|
|
17
18
|
import { forwardRef } from 'react';
|
|
18
19
|
import { useBreakpoint } from '../../hooks';
|
|
19
20
|
import styled, { css } from '../../styled.native';
|
|
20
21
|
var StyledP = styled.Text(function (_a) {
|
|
21
|
-
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
22
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, core.fontSize.body[smallAndUp ? 'large' : 'small'], core.lineHeight.body[smallAndUp ? 'large' : 'small'], semantic.message.base);
|
|
22
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp, inverted = _a.inverted;
|
|
23
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']), numToPx(core.lineHeight.body[smallAndUp ? 'large' : 'small']), inverted ? semantic.inverted.message.base : semantic.message.base);
|
|
23
24
|
});
|
|
24
25
|
export var P = forwardRef(function (props, ref) {
|
|
25
26
|
var breakpoints = useBreakpoint();
|
|
@@ -2,10 +2,11 @@ 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 { Pressable } from 'react-native';
|
|
6
7
|
import styled, { css } from '../../styled.native';
|
|
7
8
|
export var StyledPressable = styled(Pressable)(function (_a) {
|
|
8
9
|
var core = _a.theme.core, focused = _a.focused;
|
|
9
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
10
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", ";\n right: ", ";\n "], ["\n display: flex;\n align-items: center;\n position: absolute;\n width: ", ";\n z-index: 1;\n top: ", ";\n right: ", ";\n "])), numToPx(core.space[4]), focused ? '16px' : '14px', numToPx(core.space[3]));
|
|
10
11
|
});
|
|
11
12
|
var templateObject_1;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { numToPx } from '@ovotech/element-core';
|
|
18
|
+
import { useRef } from 'react';
|
|
19
|
+
import { useWindowDimensions, View } from 'react-native';
|
|
20
|
+
import Animated, { Extrapolate, interpolate, useAnimatedStyle, useSharedValue, } from 'react-native-reanimated';
|
|
21
|
+
import Carousel from 'react-native-reanimated-carousel';
|
|
22
|
+
import Svg, { Path } from 'react-native-svg';
|
|
23
|
+
import { useBreakpoint } from '../../hooks';
|
|
24
|
+
import styled, { useTheme } from '../../styled.native';
|
|
25
|
+
import { Icon } from '../Icon';
|
|
26
|
+
import { NavigationDots } from './NavigationDots';
|
|
27
|
+
import { withAnchorPoint } from './anchor-point';
|
|
28
|
+
export function ProductCarousel(_a) {
|
|
29
|
+
var data = _a.data, children = _a.children, width = _a.width, height = _a.height, fullWidth = _a.fullWidth, _b = _a.showArrows, showArrows = _b === void 0 ? true : _b, _c = _a.showDots, showDots = _c === void 0 ? false : _c, _d = _a.loop, loop = _d === void 0 ? true : _d, arrowsDistanceFromTop = _a.arrowsDistanceFromTop;
|
|
30
|
+
var theme = useTheme();
|
|
31
|
+
var mediumAndUp = useBreakpoint().mediumAndUp;
|
|
32
|
+
var carouselRef = useRef(null);
|
|
33
|
+
var progressValue = useSharedValue(0);
|
|
34
|
+
var windowWidth = useWindowDimensions().width;
|
|
35
|
+
var carouselWidth = fullWidth ? windowWidth : width || windowWidth;
|
|
36
|
+
return (_jsxs(View, { children: [mediumAndUp ? null : _jsx(SkewLine, {}), _jsxs(SCarouselContainer, { children: [_jsx(Carousel, { ref: carouselRef, data: data, renderItem: function (_a) {
|
|
37
|
+
var item = _a.item, animationValue = _a.animationValue;
|
|
38
|
+
return (_jsx(Card, __assign({ animationValue: animationValue, height: height, width: carouselWidth }, { children: children(item) })));
|
|
39
|
+
}, vertical: false, width: carouselWidth, height: height, onProgressChange: function (_, absoluteProgress) {
|
|
40
|
+
return (progressValue.value = absoluteProgress);
|
|
41
|
+
}, panGestureHandlerProps: {
|
|
42
|
+
activeOffsetX: [-20, 20],
|
|
43
|
+
}, loop: loop, testID: "carousel", scrollAnimationDuration: 700 }), showArrows && data.length > 1 && (_jsxs(_Fragment, { children: [_jsx(SActionPressable, __assign({ onPress: function () { var _a; return (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.prev(); }, "$top": arrowsDistanceFromTop, mediumAndUp: mediumAndUp, hitSlop: {
|
|
44
|
+
top: 32,
|
|
45
|
+
bottom: 32,
|
|
46
|
+
left: 16,
|
|
47
|
+
right: 16,
|
|
48
|
+
} }, { children: _jsx(Icon, { name: "arrow-left", size: 32, color: theme.core.color.brand.white }) })), _jsx(SActionPressable, __assign({ "$next": true, onPress: function () { var _a; return (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.next(); }, "$top": arrowsDistanceFromTop, mediumAndUp: mediumAndUp, hitSlop: {
|
|
49
|
+
top: 32,
|
|
50
|
+
bottom: 32,
|
|
51
|
+
left: 16,
|
|
52
|
+
right: 16,
|
|
53
|
+
} }, { children: _jsx(Icon, { name: "arrow-right", size: 32, color: theme.core.color.brand.white }) }))] })), showDots && data.length > 1 && (_jsx(NavigationDots, { data: data, animatedValue: progressValue }))] })] }));
|
|
54
|
+
}
|
|
55
|
+
var Card = function (_a) {
|
|
56
|
+
var children = _a.children, animationValue = _a.animationValue, height = _a.height, width = _a.width;
|
|
57
|
+
var WIDTH = width / 1.3;
|
|
58
|
+
var HEIGHT = height / 1.3;
|
|
59
|
+
var cardStyle = useAnimatedStyle(function () {
|
|
60
|
+
var scale = interpolate(animationValue.value, [-0.1, 0, 1], [0.95, 1, 1], Extrapolate.CLAMP);
|
|
61
|
+
var opacity = interpolate(animationValue.value, [-0.75, 0, 1], [0, 1, 0]);
|
|
62
|
+
var translateX = interpolate(animationValue.value, [-1, -0.2, 0, 1], [0, WIDTH * 0.3, 0, 0]);
|
|
63
|
+
var transform = {
|
|
64
|
+
transform: [
|
|
65
|
+
{ scale: scale },
|
|
66
|
+
{ translateX: translateX },
|
|
67
|
+
{ perspective: 200 },
|
|
68
|
+
{
|
|
69
|
+
rotateY: "".concat(interpolate(animationValue.value, [-1, 0, 0.4, 1], [30, 0, -25, -25], Extrapolate.CLAMP), "deg"),
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
return __assign(__assign({}, withAnchorPoint(transform, { x: 0.5, y: 0.5 }, { width: WIDTH, height: HEIGHT })), { opacity: opacity });
|
|
74
|
+
}, []);
|
|
75
|
+
return (_jsx(Animated.View, __assign({ style: {
|
|
76
|
+
flex: 1,
|
|
77
|
+
justifyContent: 'center',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
} }, { children: _jsx(Animated.View, __assign({ style: [
|
|
80
|
+
{
|
|
81
|
+
width: WIDTH,
|
|
82
|
+
height: HEIGHT,
|
|
83
|
+
},
|
|
84
|
+
cardStyle,
|
|
85
|
+
] }, { children: children })) })));
|
|
86
|
+
};
|
|
87
|
+
var SCarouselContainer = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n background-color: #0a9828;\n overflow: hidden;\n margin-top: -0.5px;\n"], ["\n align-items: center;\n background-color: #0a9828;\n overflow: hidden;\n margin-top: -0.5px;\n"])));
|
|
88
|
+
var SActionPressable = styled.Pressable(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: ", ";\n ", ";\n"], ["\n position: absolute;\n top: ", ";\n ", ";\n"])), function (_a) {
|
|
89
|
+
var $top = _a.$top;
|
|
90
|
+
return ($top ? "".concat($top, "px") : '30%');
|
|
91
|
+
}, function (_a) {
|
|
92
|
+
var theme = _a.theme, $next = _a.$next, mediumAndUp = _a.mediumAndUp;
|
|
93
|
+
return $next
|
|
94
|
+
? "right: ".concat(mediumAndUp ? '25%' : numToPx(theme.core.space[14]))
|
|
95
|
+
: "left: ".concat(mediumAndUp ? '25%' : numToPx(theme.core.space[14]));
|
|
96
|
+
});
|
|
97
|
+
var SkewLine = function (props) { return (_jsx(Svg, __assign({ width: "100%", height: 69 }, props, { children: _jsx(Path, { fill: "#0A9828", d: "M768 0 0 68.776h768V0Z" }) }))); };
|
|
98
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
var isValidSize = function (size) {
|
|
11
|
+
'worklet';
|
|
12
|
+
return size && size.width > 0 && size.height > 0;
|
|
13
|
+
};
|
|
14
|
+
var defaultAnchorPoint = { x: 0.5, y: 0.5 };
|
|
15
|
+
export var withAnchorPoint = function (transform, anchorPoint, size) {
|
|
16
|
+
'worklet';
|
|
17
|
+
if (!isValidSize(size))
|
|
18
|
+
return transform;
|
|
19
|
+
var injectedTransform = transform.transform;
|
|
20
|
+
if (!injectedTransform)
|
|
21
|
+
return transform;
|
|
22
|
+
if (anchorPoint.x !== defaultAnchorPoint.x && size.width) {
|
|
23
|
+
var shiftTranslateX = [];
|
|
24
|
+
// shift before rotation
|
|
25
|
+
shiftTranslateX.push({
|
|
26
|
+
translateX: size.width * (anchorPoint.x - defaultAnchorPoint.x),
|
|
27
|
+
});
|
|
28
|
+
injectedTransform = __spreadArray(__spreadArray([], shiftTranslateX, true), injectedTransform, true);
|
|
29
|
+
// shift after rotation
|
|
30
|
+
injectedTransform.push({
|
|
31
|
+
translateX: size.width * (defaultAnchorPoint.x - anchorPoint.x),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (!Array.isArray(injectedTransform))
|
|
35
|
+
return { transform: injectedTransform };
|
|
36
|
+
if (anchorPoint.y !== defaultAnchorPoint.y && size.height) {
|
|
37
|
+
var shiftTranslateY = [];
|
|
38
|
+
// shift before rotation
|
|
39
|
+
shiftTranslateY.push({
|
|
40
|
+
translateY: size.height * (anchorPoint.y - defaultAnchorPoint.y),
|
|
41
|
+
});
|
|
42
|
+
injectedTransform = __spreadArray(__spreadArray([], shiftTranslateY, true), injectedTransform, true);
|
|
43
|
+
// shift after rotation
|
|
44
|
+
injectedTransform.push({
|
|
45
|
+
translateY: size.height * (defaultAnchorPoint.y - anchorPoint.y),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return { transform: injectedTransform };
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProductCarousel } from './ProductCarousel';
|
|
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { numToPx } from '@ovotech/element-core';
|
|
24
25
|
import { forwardRef } from 'react';
|
|
25
26
|
import { TouchableOpacity, View, } from 'react-native';
|
|
26
27
|
import styled from '../../styled.native';
|
|
@@ -28,11 +29,11 @@ import { HintText } from '../HintText';
|
|
|
28
29
|
import { LabelText } from '../LabelText';
|
|
29
30
|
var StyledRadioInputWrapper = styled.View(function (_a) {
|
|
30
31
|
var core = _a.theme.core;
|
|
31
|
-
return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n margin-right: 10px;\n ");
|
|
32
|
+
return "\n width: ".concat(numToPx(core.space[6]), ";\n height: ").concat(numToPx(core.space[6]), ";\n margin-right: 10px;\n ");
|
|
32
33
|
});
|
|
33
34
|
var StyledRadioInput = styled.View(function (_a) {
|
|
34
35
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
|
|
35
|
-
return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n border: ").concat(core.borderWidth.small, " solid;\n align-items: center;\n justify-content: center;\n border-radius: ").concat(core.space[6], ";\n border-color: ").concat(invalid
|
|
36
|
+
return "\n width: ".concat(numToPx(core.space[6]), ";\n height: ").concat(numToPx(core.space[6]), ";\n border: ").concat(numToPx(core.borderWidth.small), " solid;\n align-items: center;\n justify-content: center;\n border-radius: ").concat(numToPx(core.space[6]), ";\n border-color: ").concat(invalid
|
|
36
37
|
? semantic.message.error
|
|
37
38
|
: checked
|
|
38
39
|
? core.color.blue.dark
|
|
@@ -40,7 +41,7 @@ var StyledRadioInput = styled.View(function (_a) {
|
|
|
40
41
|
});
|
|
41
42
|
var StyledRadioInputDot = styled.View(function (_a) {
|
|
42
43
|
var core = _a.theme.core, checked = _a.checked;
|
|
43
|
-
return "\n width: ".concat(core.space[3], ";\n height: ").concat(core.space[3], ";\n border-radius: ").concat(core.space[3], ";\n background: ").concat(core.color.blue.dark, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
44
|
+
return "\n width: ".concat(numToPx(core.space[3]), ";\n height: ").concat(numToPx(core.space[3]), ";\n border-radius: ").concat(numToPx(core.space[3]), ";\n background: ").concat(core.color.blue.dark, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
44
45
|
});
|
|
45
46
|
var Input = function (_a) {
|
|
46
47
|
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
@@ -48,7 +49,7 @@ var Input = function (_a) {
|
|
|
48
49
|
};
|
|
49
50
|
var StyledWrapper = styled.View(function (_a) {
|
|
50
51
|
var core = _a.theme.core;
|
|
51
|
-
return "\n padding-top: ".concat(core.space[3], ";\n flex-direction: row;\n ");
|
|
52
|
+
return "\n padding-top: ".concat(numToPx(core.space[3]), ";\n flex-direction: row;\n ");
|
|
52
53
|
});
|
|
53
54
|
var Radio = forwardRef(function (_a, ref) {
|
|
54
55
|
var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
29
|
+
import { forwardRef } from 'react';
|
|
30
|
+
import { TouchableOpacity, } from 'react-native';
|
|
31
|
+
import { css } from 'styled-components';
|
|
32
|
+
import styled from '../../styled.native';
|
|
33
|
+
import { LabelText } from '../LabelText';
|
|
34
|
+
var StyledRadioInputWrapper = styled.View(function (_a) {
|
|
35
|
+
var core = _a.theme.core;
|
|
36
|
+
return "\n width: ".concat(numToPx(core.space[6]), ";\n height: ").concat(numToPx(core.space[6]), ";\n margin-top: ").concat(numToPx(core.space[2]), ";\n ");
|
|
37
|
+
});
|
|
38
|
+
var StyledRadioInput = styled.View(function (_a) {
|
|
39
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
|
|
40
|
+
return "\n width: ".concat(numToPx(core.space[6]), ";\n height: ").concat(numToPx(core.space[6]), ";\n border: ").concat(numToPx(core.borderWidth.small), " solid;\n align-items: center;\n justify-content: center;\n border-radius: ").concat(numToPx(core.space[6]), ";\n border-color: ").concat(invalid
|
|
41
|
+
? semantic.message.error
|
|
42
|
+
: checked
|
|
43
|
+
? core.color.blue.dark
|
|
44
|
+
: semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
|
|
45
|
+
});
|
|
46
|
+
var StyledRadioInputDot = styled.View(function (_a) {
|
|
47
|
+
var core = _a.theme.core, checked = _a.checked;
|
|
48
|
+
return "\n width: ".concat(numToPx(core.space[3]), ";\n height: ").concat(numToPx(core.space[3]), ";\n border-radius: ").concat(numToPx(core.space[3]), ";\n background: ").concat(core.color.blue.dark, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
49
|
+
});
|
|
50
|
+
var Input = function (_a) {
|
|
51
|
+
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
52
|
+
return (_jsx(StyledRadioInputWrapper, __assign({}, rest, { children: _jsx(StyledRadioInput, __assign({ invalid: invalid, checked: checked, testID: testID }, { children: _jsx(StyledRadioInputDot, { checked: checked }) })) })));
|
|
53
|
+
};
|
|
54
|
+
var StyledWrapper = styled.View(function (_a) {
|
|
55
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, checked = _a.checked, invalid = _a.invalid;
|
|
56
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n background: ", ";\n padding: ", ";\n min-width: 82px;\n border-radius: ", ";\n border: ", " solid;\n border-color: ", ";\n "], ["\n align-items: center;\n background: ", ";\n padding: ", ";\n min-width: 82px;\n border-radius: ", ";\n border: ", " solid;\n border-color: ", ";\n "])), semantic.surface.elevated, numToPx(core.space[2]), numToPx(core.radius.small), numToPx(core.borderWidth.medium), invalid
|
|
57
|
+
? semantic.message.error
|
|
58
|
+
: checked
|
|
59
|
+
? core.color.blue.dark
|
|
60
|
+
: 'transparent');
|
|
61
|
+
});
|
|
62
|
+
export var RadioCard = forwardRef(function (_a, ref) {
|
|
63
|
+
var label = _a.label, checked = _a.checked, invalid = _a.invalid, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, _c = _a.hasInput, hasInput = _c === void 0 ? true : _c, rest = __rest(_a, ["label", "checked", "invalid", "activeOpacity", "testID", "hasInput"]);
|
|
64
|
+
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, __assign({ checked: checked, invalid: invalid }, { children: [typeof label === 'string' ? _jsx(LabelText, { children: label }) : label, hasInput ? (_jsx(Input, { checked: checked, invalid: invalid, testID: testID })) : null] })) })));
|
|
65
|
+
});
|
|
66
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RadioCard } from './RadioCard';
|
|
@@ -14,6 +14,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { numToPx } from '@ovotech/element-core';
|
|
17
18
|
import groupBy from 'lodash.groupby';
|
|
18
19
|
import { Fragment, useState } from 'react';
|
|
19
20
|
import { Modal, ScrollView, View } from 'react-native';
|
|
@@ -23,9 +24,9 @@ import { P } from '../P';
|
|
|
23
24
|
import { Strong } from '../Strong';
|
|
24
25
|
var SelectInput = styled.TouchableOpacity(function (_a) {
|
|
25
26
|
var _b = _a.theme, semantic = _b.semantic, core = _b.core, hasError = _a.hasError;
|
|
26
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color:
|
|
27
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: transparent;\n border-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n padding: ", ";\n padding-right: 14px;\n height: 44px;\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: transparent;\n border-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n padding: ", ";\n padding-right: 14px;\n height: 44px;\n "])), hasError
|
|
27
28
|
? semantic.error.border
|
|
28
|
-
: semantic.border.functional, core.borderWidth.small, core.radius.small, core.space[2]);
|
|
29
|
+
: semantic.border.functional, numToPx(core.borderWidth.small), numToPx(core.radius.small), numToPx(core.space[2]));
|
|
29
30
|
});
|
|
30
31
|
var DropdownWrapper = styled.View(function (_a) {
|
|
31
32
|
var core = _a.theme.core;
|
|
@@ -33,15 +34,15 @@ var DropdownWrapper = styled.View(function (_a) {
|
|
|
33
34
|
});
|
|
34
35
|
var DropdownContainer = styled.SafeAreaView(function (_a) {
|
|
35
36
|
var core = _a.theme.core;
|
|
36
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 95%;\n max-height: 70%;\n border-radius: ", ";\n background-color: ", ";\n "], ["\n width: 95%;\n max-height: 70%;\n border-radius: ", ";\n background-color: ", ";\n "])), core.radius.small, core.color.brand.white);
|
|
37
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 95%;\n max-height: 70%;\n border-radius: ", ";\n background-color: ", ";\n "], ["\n width: 95%;\n max-height: 70%;\n border-radius: ", ";\n background-color: ", ";\n "])), numToPx(core.radius.small), core.color.brand.white);
|
|
37
38
|
});
|
|
38
39
|
var SelectOption = styled.TouchableOpacity(function (_a) {
|
|
39
40
|
var _b = _a.theme, semantic = _b.semantic, core = _b.core, isLastOption = _a.isLastOption;
|
|
40
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n border-bottom-color: ", ";\n border-bottom-width: ", "px;\n padding-horizontal: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n border-bottom-color: ", ";\n border-bottom-width: ", "px;\n padding-horizontal: ", ";\n "])), semantic.border.differentiated, isLastOption ? 0 : 1, core.space[4]);
|
|
41
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n border-bottom-color: ", ";\n border-bottom-width: ", "px;\n padding-horizontal: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n border-bottom-color: ", ";\n border-bottom-width: ", "px;\n padding-horizontal: ", ";\n "])), semantic.border.differentiated, isLastOption ? 0 : 1, numToPx(core.space[4]));
|
|
41
42
|
});
|
|
42
43
|
var Radio = styled.View(function (_a) {
|
|
43
44
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, isChecked = _a.isChecked;
|
|
44
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 24px;\n height: 24px;\n margin-left: auto;\n border-radius: 24px;\n border-width: ", ";\n border-color: ", ";\n "], ["\n width: 24px;\n height: 24px;\n margin-left: auto;\n border-radius: 24px;\n border-width: ", ";\n border-color: ", ";\n "])), core.borderWidth.small, isChecked
|
|
45
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 24px;\n height: 24px;\n margin-left: auto;\n border-radius: 24px;\n border-width: ", ";\n border-color: ", ";\n "], ["\n width: 24px;\n height: 24px;\n margin-left: auto;\n border-radius: 24px;\n border-width: ", ";\n border-color: ", ";\n "])), numToPx(core.borderWidth.small), isChecked
|
|
45
46
|
? semantic.focus.outline
|
|
46
47
|
: semantic.border.functional);
|
|
47
48
|
});
|
|
@@ -51,11 +52,11 @@ var RadioDot = styled.View(function (_a) {
|
|
|
51
52
|
});
|
|
52
53
|
var StyledP = styled(P)(function (_a) {
|
|
53
54
|
var core = _a.theme.core;
|
|
54
|
-
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), core.space[3], core.space[3]);
|
|
55
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n margin-top: ", ";\n margin-bottom: ", ";\n "])), numToPx(core.space[3]), numToPx(core.space[3]));
|
|
55
56
|
});
|
|
56
57
|
var StyledCategory = styled(P)(function (_a) {
|
|
57
58
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
58
|
-
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n padding-horizontal: ", ";\n padding-vertical: ", ";\n "], ["\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n padding-horizontal: ", ";\n padding-vertical: ", ";\n "])), core.fontSize.label.large, semantic.message.secondary, semantic.surface.cutout, core.space[4], core.space[1]);
|
|
59
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n padding-horizontal: ", ";\n padding-vertical: ", ";\n "], ["\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n padding-horizontal: ", ";\n padding-vertical: ", ";\n "])), numToPx(core.fontSize.label.large), semantic.message.secondary, semantic.surface.cutout, numToPx(core.space[4]), numToPx(core.space[1]));
|
|
59
60
|
});
|
|
60
61
|
export var Select = function (_a) {
|
|
61
62
|
var _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.defaultSelected, defaultSelected = _c === void 0 ? { label: '', value: 'default' } : _c, _d = _a.noOptionMessage, noOptionMessage = _d === void 0 ? 'No option selected' : _d, _e = _a.onSelected, onSelected = _e === void 0 ? function () { return null; } : _e, _f = _a.hasError, hasError = _f === void 0 ? false : _f, _g = _a.testID, testID = _g === void 0 ? 'select' : _g;
|
|
@@ -21,12 +21,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { numToPx } from '@ovotech/element-core';
|
|
24
25
|
import styled from '../../styled.native';
|
|
25
26
|
import { P } from '../P';
|
|
26
27
|
import { SkeletonAnimation } from '../SkeletonAnimation';
|
|
27
28
|
var StyledSkeletonCTA = styled.View(function (_a) {
|
|
28
29
|
var core = _a.theme.core, size = _a.size;
|
|
29
|
-
return "\n background-color: ".concat(core.color.neutral.light, ";\n width: ").concat(size, ";\n height: ").concat(core.space[12], ";\n ");
|
|
30
|
+
return "\n background-color: ".concat(core.color.neutral.light, ";\n width: ").concat(size, ";\n height: ").concat(numToPx(core.space[12]), ";\n ");
|
|
30
31
|
});
|
|
31
32
|
export var SkeletonCTA = function (_a) {
|
|
32
33
|
var _b = _a.size, size = _b === void 0 ? '250px' : _b, rest = __rest(_a, ["size"]);
|
|
@@ -21,8 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { pxToNumber } from '@ovotech/element-core';
|
|
24
25
|
import styled from '../../styled.native';
|
|
25
|
-
import { pxToNumber } from '../../utils';
|
|
26
26
|
import { SkeletonAnimation } from '../SkeletonAnimation';
|
|
27
27
|
var StyledSkeletonCircleWrapper = styled.View(function (_a) {
|
|
28
28
|
var size = _a.size;
|
|
@@ -21,13 +21,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { numToPx } from '@ovotech/element-core';
|
|
24
25
|
import { useBreakpoint } from '../../hooks';
|
|
25
26
|
import styled from '../../styled.native';
|
|
26
27
|
import { P } from '../P';
|
|
27
28
|
import { SkeletonAnimation } from '../SkeletonAnimation';
|
|
28
29
|
var StyledSkeletonText = styled.View(function (_a) {
|
|
29
30
|
var core = _a.theme.core, aboveSmallBreakpoint = _a.aboveSmallBreakpoint, short = _a.short;
|
|
30
|
-
return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(core.space[2], ";\n height: ").concat(aboveSmallBreakpoint
|
|
31
|
+
return "\n background-color: ".concat(core.color.neutral.light, ";\n margin-bottom: ").concat(numToPx(core.space[2]), ";\n height: ").concat(aboveSmallBreakpoint
|
|
32
|
+
? numToPx(core.fontSize.body.large)
|
|
33
|
+
: numToPx(core.fontSize.body.small), ";\n\n ").concat(short ? 'width: 50%' : '', ";\n ");
|
|
31
34
|
});
|
|
32
35
|
export var SkeletonText = function (_a) {
|
|
33
36
|
var _b = _a.lines, lines = _b === void 0 ? 1 : _b, rest = __rest(_a, ["lines"]);
|
|
@@ -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 styled, { css } from '../../styled.native';
|
|
6
7
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
7
8
|
var StyledSmall = styled.Text(function (_a) {
|
|
8
9
|
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
9
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n line-height: ", ";\n "], ["\n font-size: ", ";\n line-height: ", ";\n "])), core.fontSize.small[smallAndUp ? 'large' : 'small'], core.lineHeight.small[smallAndUp ? 'large' : 'small']);
|
|
10
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n line-height: ", ";\n "], ["\n font-size: ", ";\n line-height: ", ";\n "])), numToPx(core.fontSize.small[smallAndUp ? 'large' : 'small']), numToPx(core.lineHeight.small[smallAndUp ? 'large' : 'small']));
|
|
10
11
|
});
|
|
11
12
|
export var Small = styledComponentWithBreakpoints(StyledSmall);
|
|
12
13
|
var templateObject_1;
|
|
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { numToPx } from '@ovotech/element-core';
|
|
24
25
|
import { Children } from 'react';
|
|
25
26
|
import { View } from 'react-native';
|
|
26
27
|
import styled from '../../styled.native';
|
|
@@ -39,7 +40,7 @@ var Stack = function (_a) {
|
|
|
39
40
|
};
|
|
40
41
|
var StyledStackItem = styled.View(function (_a) {
|
|
41
42
|
var space = _a.theme.core.space, spaceBetween = _a.spaceBetween, smallAndUp = _a.smallAndUp, mediumAndUp = _a.mediumAndUp, largeAndUp = _a.largeAndUp;
|
|
42
|
-
var formatter = function (spaceKey) { return space[spaceKey]; };
|
|
43
|
+
var formatter = function (spaceKey) { return numToPx(space[spaceKey]); };
|
|
43
44
|
var breakpoints = { smallAndUp: smallAndUp, mediumAndUp: mediumAndUp, largeAndUp: largeAndUp };
|
|
44
45
|
return responsiveStyle('margin-top', spaceBetween, breakpoints, formatter);
|
|
45
46
|
});
|
|
@@ -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 StyledSubLabelText = styled.Text(function (_a) {
|
|
@@ -9,7 +10,7 @@ var StyledSubLabelText = 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 color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, core.lineHeight.body.small, semantic.message.secondary, fontSize);
|
|
13
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, numToPx(core.lineHeight.body.small), semantic.message.secondary, numToPx(fontSize));
|
|
13
14
|
});
|
|
14
15
|
var SubLabelText = styledComponentWithBreakpoints(StyledSubLabelText);
|
|
15
16
|
export { SubLabelText };
|
|
@@ -25,22 +25,23 @@ 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 { forwardRef } from 'react';
|
|
29
|
-
import { useBreakpoint, useFullWidth
|
|
30
|
+
import { useBreakpoint, useFullWidth } from '../../hooks';
|
|
30
31
|
import styled, { css } from '../../styled.native';
|
|
31
32
|
var TabText = styled.Text(function (_a) {
|
|
32
|
-
var _b = _a.theme, core = _b.core, semantic = _b.semantic,
|
|
33
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n text-align: center;\n padding: ", " ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n text-align: center;\n padding: ", " ", ";\n "])), core.fontSize.body.small, core.fontFamily.bodyBold.native, core.lineHeight.body.small, semantic.message.base, core.space[3], core.space[
|
|
33
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, _c = _a.active, active = _c === void 0 ? false : _c;
|
|
34
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n text-align: center;\n padding: ", " ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n text-align: center;\n padding: ", " ", ";\n "])), numToPx(core.fontSize.body.small), core.fontFamily.bodyBold.native, numToPx(core.lineHeight.body.small), active ? semantic.focus.outline : semantic.message.base, numToPx(core.space[3]), numToPx(core.space[2]));
|
|
34
35
|
});
|
|
35
36
|
var TabTouchable = styled.TouchableOpacity(function (_a) {
|
|
36
37
|
var _b = _a.active, active = _b === void 0 ? false : _b, _c = _a.first, first = _c === void 0 ? false : _c, _d = _a.last, last = _d === void 0 ? false : _d, _e = _a.stretch, stretch = _e === void 0 ? false : _e, _f = _a.theme, core = _f.core, semantic = _f.semantic, inline = _a.inline;
|
|
37
|
-
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n flex-grow: ", ";\n border: ", " solid
|
|
38
|
-
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n
|
|
39
|
-
? css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n
|
|
38
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n flex-grow: ", ";\n border: ", " solid\n ", ";\n ", "\n ", "\n ", "\n ", "\n "], ["\n flex-grow: ", ";\n border: ", " solid\n ", ";\n ", "\n ", "\n ", "\n ", "\n "])), stretch ? 1 : 0, numToPx(core.borderWidth.small), semantic.border.differentiated, active
|
|
39
|
+
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-bottom-color: ", ";\n border-bottom-width: ", ";\n "], ["\n border-bottom-color: ", ";\n border-bottom-width: ", ";\n "])), semantic.focus.outline, numToPx(core.borderWidth.medium)) : '', !inline
|
|
40
|
+
? css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-top-color: transparent;\n border-top-width: 0;\n "], ["\n border-top-color: transparent;\n border-top-width: 0;\n "]))) : '', last && inline
|
|
40
41
|
? ''
|
|
41
|
-
: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n
|
|
42
|
+
: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-right-color: transparent;\n border-right-width: 0;\n "], ["\n border-right-color: transparent;\n border-right-width: 0;\n "]))), first && inline
|
|
42
43
|
? ''
|
|
43
|
-
: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n
|
|
44
|
+
: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-left-color: transparent;\n border-left-width: 0;\n "], ["\n border-left-color: transparent;\n border-left-width: 0;\n "]))));
|
|
44
45
|
});
|
|
45
46
|
export var Tab = forwardRef(function (_a, ref) {
|
|
46
47
|
var active = _a.active, fullWidth = _a.fullWidth, children = _a.children, rest = __rest(_a, ["active", "fullWidth", "children"]);
|
|
@@ -25,12 +25,13 @@ 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 { Children, cloneElement } from 'react';
|
|
29
30
|
import styled, { css } from '../../styled.native';
|
|
30
31
|
import { callAll } from '../../utils';
|
|
31
32
|
var StyledTabList = styled.View(function (_a) {
|
|
32
33
|
var core = _a.theme.core;
|
|
33
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n margin: -", ";\n "], ["\n flex-direction: row;\n margin: -", ";\n "])), core.borderWidth.small);
|
|
34
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n margin: -", ";\n "], ["\n flex-direction: row;\n margin: -", ";\n "])), numToPx(core.borderWidth.small));
|
|
34
35
|
});
|
|
35
36
|
export var TabList = function (_a) {
|
|
36
37
|
var children = _a.children, setActiveTab = _a.setActiveTab, activeTab = _a.activeTab, tabRefs = _a.tabRefs, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "setActiveTab", "activeTab", "tabRefs", "fullWidth", "inline"]);
|
|
@@ -25,10 +25,11 @@ 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 StyledView = styled.View(function (_a) {
|
|
30
31
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
31
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n border-top-width: ", ";\n border-style: solid;\n border-color: ", ";\n z-index: -1;\n "], ["\n padding: ", ";\n border-top-width: ", ";\n border-style: solid;\n border-color: ", ";\n z-index: -1;\n "])), core.space[4], core.borderWidth.small, semantic.border.differentiated);
|
|
32
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n border-top-width: ", ";\n border-style: solid;\n border-color: ", ";\n z-index: -1;\n "], ["\n padding: ", ";\n border-top-width: ", ";\n border-style: solid;\n border-color: ", ";\n z-index: -1;\n "])), numToPx(core.space[4]), numToPx(core.borderWidth.small), semantic.border.differentiated);
|
|
32
33
|
});
|
|
33
34
|
export var TabPanel = function (_a) {
|
|
34
35
|
var rest = __rest(_a, []);
|
|
@@ -25,6 +25,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
28
29
|
import { useState, cloneElement, useEffect, createRef, useRef, } from 'react';
|
|
29
30
|
import styled, { css } from '../../styled.native';
|
|
30
31
|
import { filterChildrenByType } from '../../utils';
|
|
@@ -33,7 +34,7 @@ import { TabList } from './TabList';
|
|
|
33
34
|
import { TabPanel } from './TabPanel';
|
|
34
35
|
var TabsCard = styled(Card)(function (_a) {
|
|
35
36
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic, inline = _a.inline;
|
|
36
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border: ", " solid\n ", ";\n background: transparent;\n "], ["\n padding: 0;\n border: ", " solid\n ", ";\n background: transparent;\n "])), core.borderWidth.small, inline ? semantic.border.differentiated : 'transparent');
|
|
37
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border: ", " solid\n ", ";\n background: transparent;\n "], ["\n padding: 0;\n border: ", " solid\n ", ";\n background: transparent;\n "])), numToPx(core.borderWidth.small), inline ? semantic.border.differentiated : 'transparent');
|
|
37
38
|
});
|
|
38
39
|
export var Tabs = function (_a) {
|
|
39
40
|
var children = _a.children, _b = _a.defaultSelected, defaultSelected = _b === void 0 ? 0 : _b, onSelected = _a.onSelected, fullWidth = _a.fullWidth, inline = _a.inline, rest = __rest(_a, ["children", "defaultSelected", "onSelected", "fullWidth", "inline"]);
|
|
@@ -25,13 +25,13 @@ 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 { forwardRef } from 'react';
|
|
29
30
|
import styled, { css } from '../../styled.native';
|
|
30
|
-
import { pxToNumber } from '../../utils';
|
|
31
31
|
import { Input } from '../Input/Input';
|
|
32
32
|
var StyledInput = styled(Input)(function (_a) {
|
|
33
33
|
var core = _a.theme.core, rows = _a.rows;
|
|
34
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", " ", "
|
|
34
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n padding-top: ", ";\n height: ", "px;\n "], ["\n padding: ", ";\n padding-top: ", ";\n height: ", "px;\n "])), numToPx(core.space[2]), numToPx(core.space[3]), core.space[8] * rows);
|
|
35
35
|
});
|
|
36
36
|
var TextareaInput = forwardRef(function (_a, ref) {
|
|
37
37
|
var _b = _a.rows, rows = _b === void 0 ? 3 : _b, rest = __rest(_a, ["rows"]);
|
|
@@ -15,6 +15,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
15
15
|
};
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
import { toast, ToastPosition, Toasts, } from '@backpackapp-io/react-native-toast';
|
|
18
|
+
import { numToPx } from '@ovotech/element-core';
|
|
18
19
|
import { useEffect, useRef, useState } from 'react';
|
|
19
20
|
import { Dimensions, TouchableOpacity, View } from 'react-native';
|
|
20
21
|
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming, } from 'react-native-reanimated';
|
|
@@ -30,7 +31,7 @@ var StyledView = styled.View(function (_a) {
|
|
|
30
31
|
var core = _a.theme.core, variant = _a.variant;
|
|
31
32
|
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n overflow: hidden;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-right: ", ";\n padding-left: ", ";\n border-radius: ", ";\n flex-direction: row;\n "], ["\n background-color: ", ";\n overflow: hidden;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-right: ", ";\n padding-left: ", ";\n border-radius: ", ";\n flex-direction: row;\n "])), variant === 'default'
|
|
32
33
|
? core.color.brand.forest
|
|
33
|
-
: core.color.red.darkest, core.space[2], core.space[3], core.space[2], core.space[4], core.radius.max);
|
|
34
|
+
: core.color.red.darkest, numToPx(core.space[2]), numToPx(core.space[3]), numToPx(core.space[2]), numToPx(core.space[4]), numToPx(core.radius.max));
|
|
34
35
|
});
|
|
35
36
|
var StyledP = styled(P)(function (_a) {
|
|
36
37
|
var semantic = _a.theme.semantic;
|
|
@@ -50,7 +51,7 @@ var StyledThickBorder = styled(Animated.View)(function (_a) {
|
|
|
50
51
|
});
|
|
51
52
|
var StyledCloseIcon = styled(TouchableOpacity)(function (_a) {
|
|
52
53
|
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
53
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n height: ", ";\n padding: ", ";\n align-items: center;\n justify-content: center;\n "], ["\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n height: ", ";\n padding: ", ";\n align-items: center;\n justify-content: center;\n "])), semantic.inverted.surface, core.radius.max, core.space[7], core.space[7], core.space[2]);
|
|
54
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n height: ", ";\n padding: ", ";\n align-items: center;\n justify-content: center;\n "], ["\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n height: ", ";\n padding: ", ";\n align-items: center;\n justify-content: center;\n "])), semantic.inverted.surface, numToPx(core.radius.max), numToPx(core.space[7]), numToPx(core.space[7]), numToPx(core.space[2]));
|
|
54
55
|
});
|
|
55
56
|
export var showToast = function (_a) {
|
|
56
57
|
var message = _a.message, _b = _a.dismissible, dismissible = _b === void 0 ? false : _b, action = _a.action, actionTitle = _a.actionTitle, _c = _a.variant, variant = _c === void 0 ? 'default' : _c, _d = _a.duration, duration = _d === void 0 ? 5000 : _d;
|
|
@@ -30,10 +30,10 @@ import { StyledToggleDot, StyledToggleInputWrapper, StyledToggleInput, StyledWra
|
|
|
30
30
|
var Input = function (_a) {
|
|
31
31
|
var checked = _a.checked, labelPosition = _a.labelPosition, testID = _a.testID, rest = __rest(_a, ["checked", "labelPosition", "testID"]);
|
|
32
32
|
var core = useContext(ThemeContext).core;
|
|
33
|
-
var leftVal = useRef(new Animated.Value(checked ?
|
|
33
|
+
var leftVal = useRef(new Animated.Value(checked ? core.space[6] : core.space[1])).current;
|
|
34
34
|
useEffect(function () {
|
|
35
35
|
Animated.timing(leftVal, {
|
|
36
|
-
toValue: checked ?
|
|
36
|
+
toValue: checked ? core.space[6] : core.space[1],
|
|
37
37
|
duration: 150,
|
|
38
38
|
useNativeDriver: true,
|
|
39
39
|
}).start();
|