@ovotech/element-native 4.4.9 → 5.0.0-canary-bcb1788-338
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.js +11 -9
- package/dist/components/Accordion/Icon.d.ts +2 -1
- package/dist/components/Accordion/Icon.js +9 -6
- package/dist/components/Accordion/styles.d.ts +1520 -1525
- package/dist/components/Accordion/styles.js +17 -11
- package/dist/components/Accordion/types.d.ts +2 -1
- package/dist/components/ActionCard/ActionCard.d.ts +2 -2
- package/dist/components/ActionCard/ActionCard.js +21 -21
- package/dist/components/ActionCard/CloseIconShape.js +2 -2
- package/dist/components/ActionCard/IndicatorIconShape.js +2 -2
- package/dist/components/ActionList/ActionList.d.ts +9 -3
- package/dist/components/ActionList/ActionList.js +7 -6
- package/dist/components/ActionList/styled.d.ts +5116 -3430
- package/dist/components/ActionList/styled.js +36 -19
- package/dist/components/Badge/Badge.d.ts +511 -508
- package/dist/components/Badge/Badge.js +24 -34
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +9 -1
- package/dist/components/Card/Card.js +5 -6
- package/dist/components/Checkbox/Checkbox.js +13 -13
- package/dist/components/DataTable/styles.d.ts +6527 -6553
- package/dist/components/DataTable/styles.js +27 -27
- package/dist/components/DateField/DateField.d.ts +5 -4
- package/dist/components/DateField/DateField.js +20 -10
- package/dist/components/Disclosure/Disclosure.js +6 -6
- package/dist/components/Divider/Divider.js +3 -3
- package/dist/components/Em/Em.d.ts +493 -495
- package/dist/components/Em/Em.js +1 -1
- package/dist/components/ErrorText/ErrorText.d.ts +493 -495
- package/dist/components/ErrorText/ErrorText.js +6 -4
- package/dist/components/Field/Field.js +1 -1
- package/dist/components/Grid/Col.d.ts +493 -495
- package/dist/components/Grid/Col.js +10 -16
- package/dist/components/Grid/Row.d.ts +493 -495
- package/dist/components/Grid/Row.js +7 -6
- package/dist/components/HintText/HintText.d.ts +493 -495
- package/dist/components/HintText/HintText.js +6 -4
- package/dist/components/Icon/Icon.d.ts +1 -3
- package/dist/components/Icon/Icon.js +3 -5
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +16 -11
- package/dist/components/LabelText/LabelText.d.ts +493 -495
- package/dist/components/LabelText/LabelText.js +7 -4
- package/dist/components/LineThrough/LineThrough.d.ts +493 -495
- package/dist/components/List/styled.d.ts +2017 -2025
- package/dist/components/List/styled.js +11 -11
- package/dist/components/Margin/Margin.d.ts +493 -495
- package/dist/components/Margin/Margin.js +4 -2
- package/dist/components/NavHeader/NavHeader.d.ts +7 -1
- package/dist/components/NavHeader/NavHeader.js +2 -12
- package/dist/components/NavHeader/NavHeader.styles.d.ts +3489 -4636
- package/dist/components/NavHeader/NavHeader.styles.js +22 -32
- package/dist/components/Notification/Notification.d.ts +987 -991
- package/dist/components/Notification/Notification.js +18 -18
- package/dist/components/P/P.d.ts +7 -3
- package/dist/components/P/P.js +4 -2
- package/dist/components/PasswordInput/PasswordInput.styled.d.ts +493 -495
- package/dist/components/PasswordInput/PasswordInput.styled.js +2 -2
- package/dist/components/ProductCarousel/NavigationDots.js +4 -4
- package/dist/components/ProductCarousel/ProductCarousel.js +4 -4
- package/dist/components/Radio/Radio.js +11 -11
- package/dist/components/RadioCard/RadioCard.d.ts +0 -1
- package/dist/components/RadioCard/RadioCard.js +15 -15
- package/dist/components/SegmentedControls/SegmentedControls.js +5 -5
- package/dist/components/SegmentedControls/components/SegmentButton.js +4 -4
- package/dist/components/SelectField/Select.d.ts +493 -495
- package/dist/components/SelectField/Select.js +22 -24
- package/dist/components/SkeletonCircle/SkeletonCircle.d.ts +2 -2
- package/dist/components/SkeletonCircle/SkeletonCircle.js +6 -6
- package/dist/components/SkeletonHeading/SkeletonHeading.js +4 -4
- package/dist/components/SkeletonText/SkeletonText.js +4 -4
- package/dist/components/Spinner/Spinner.js +2 -2
- package/dist/components/Stack/Stack.js +4 -2
- package/dist/components/Strong/Strong.d.ts +493 -495
- package/dist/components/Strong/Strong.js +2 -2
- package/dist/components/SubLabelText/SubLabelText.d.ts +493 -495
- package/dist/components/SubLabelText/SubLabelText.js +4 -4
- package/dist/components/Tabs/Tab.js +8 -13
- package/dist/components/Tabs/TabList.d.ts +1 -2
- package/dist/components/Tabs/TabList.js +3 -6
- package/dist/components/Tabs/TabPanel.js +2 -2
- package/dist/components/Tabs/Tabs.d.ts +1 -2
- package/dist/components/Tabs/Tabs.js +4 -7
- package/dist/components/TextareaInput/TextareaInput.js +2 -2
- package/dist/components/Toast/Toast.js +16 -24
- package/dist/components/Toggle/Toggle.js +5 -9
- package/dist/components/Toggle/styles.d.ts +2023 -2031
- package/dist/components/Toggle/styles.js +10 -8
- package/dist/components/index.d.ts +6 -20
- package/dist/components/index.js +6 -20
- package/dist/esm/components/Accordion/Accordion.js +10 -8
- package/dist/esm/components/Accordion/Icon.js +9 -6
- package/dist/esm/components/Accordion/styles.js +17 -11
- package/dist/esm/components/ActionCard/ActionCard.js +22 -22
- package/dist/esm/components/ActionCard/CloseIconShape.js +2 -2
- package/dist/esm/components/ActionCard/IndicatorIconShape.js +2 -2
- package/dist/esm/components/ActionList/ActionList.js +9 -8
- package/dist/esm/components/ActionList/styled.js +35 -18
- package/dist/esm/components/Badge/Badge.js +25 -35
- package/dist/esm/components/Card/Card.js +5 -6
- package/dist/esm/components/Checkbox/Checkbox.js +13 -13
- package/dist/esm/components/DataTable/styles.js +27 -27
- package/dist/esm/components/DateField/DateField.js +20 -10
- package/dist/esm/components/Disclosure/Disclosure.js +6 -6
- package/dist/esm/components/Divider/Divider.js +3 -3
- package/dist/esm/components/Em/Em.js +1 -1
- package/dist/esm/components/ErrorText/ErrorText.js +6 -4
- package/dist/esm/components/Field/Field.js +1 -1
- package/dist/esm/components/Grid/Col.js +10 -16
- package/dist/esm/components/Grid/Row.js +7 -6
- package/dist/esm/components/HintText/HintText.js +6 -4
- package/dist/esm/components/Icon/Icon.js +3 -5
- package/dist/esm/components/Input/Input.js +16 -11
- package/dist/esm/components/LabelText/LabelText.js +7 -4
- package/dist/esm/components/List/styled.js +11 -11
- package/dist/esm/components/Margin/Margin.js +4 -2
- package/dist/esm/components/NavHeader/NavHeader.js +3 -13
- package/dist/esm/components/NavHeader/NavHeader.styles.js +21 -31
- package/dist/esm/components/Notification/Notification.js +18 -18
- package/dist/esm/components/P/P.js +4 -2
- package/dist/esm/components/PasswordInput/PasswordInput.styled.js +2 -2
- package/dist/esm/components/ProductCarousel/NavigationDots.js +4 -4
- package/dist/esm/components/ProductCarousel/ProductCarousel.js +4 -4
- package/dist/esm/components/Radio/Radio.js +11 -11
- package/dist/esm/components/RadioCard/RadioCard.js +15 -15
- package/dist/esm/components/SegmentedControls/SegmentedControls.js +5 -5
- package/dist/esm/components/SegmentedControls/components/SegmentButton.js +4 -4
- package/dist/esm/components/SelectField/Select.js +23 -25
- package/dist/esm/components/SkeletonCircle/SkeletonCircle.js +6 -6
- package/dist/esm/components/SkeletonHeading/SkeletonHeading.js +3 -3
- package/dist/esm/components/SkeletonText/SkeletonText.js +4 -4
- package/dist/esm/components/Spinner/Spinner.js +2 -2
- package/dist/esm/components/Stack/Stack.js +4 -2
- package/dist/esm/components/Strong/Strong.js +2 -2
- package/dist/esm/components/SubLabelText/SubLabelText.js +4 -4
- package/dist/esm/components/Tabs/Tab.js +8 -13
- package/dist/esm/components/Tabs/TabList.js +3 -6
- package/dist/esm/components/Tabs/TabPanel.js +2 -2
- package/dist/esm/components/Tabs/Tabs.js +4 -7
- package/dist/esm/components/TextareaInput/TextareaInput.js +2 -2
- package/dist/esm/components/Toast/Toast.js +16 -24
- package/dist/esm/components/Toggle/Toggle.js +5 -9
- package/dist/esm/components/Toggle/styles.js +10 -8
- package/dist/esm/components/index.js +6 -20
- package/dist/esm/hooks/use-breakpoint.js +1 -1
- package/dist/esm/providers/IconsProvider.js +1 -1
- package/dist/esm/providers/index.js +3 -1
- package/dist/hooks/use-breakpoint.js +1 -1
- package/dist/providers/IconsProvider.d.ts +1 -1
- package/dist/providers/index.d.ts +3 -1
- package/dist/providers/index.js +3 -1
- package/dist/styled.native.d.ts +3012 -3023
- package/package.json +3 -3
- package/dist/components/CTAButton/CTAButton.d.ts +0 -20
- package/dist/components/CTAButton/CTAButton.js +0 -119
- package/dist/components/CTAButton/index.d.ts +0 -1
- package/dist/components/CTAButton/index.js +0 -8
- package/dist/components/CTALink/CTALink.d.ts +0 -11
- package/dist/components/CTALink/CTALink.js +0 -23
- package/dist/components/CTALink/index.d.ts +0 -1
- package/dist/components/CTALink/index.js +0 -7
- package/dist/components/DescriptionList/DescriptionList.d.ts +0 -10
- package/dist/components/DescriptionList/DescriptionList.js +0 -44
- package/dist/components/DescriptionList/index.d.ts +0 -1
- package/dist/components/DescriptionList/index.js +0 -6
- package/dist/components/DescriptionList/styled.d.ts +0 -570
- package/dist/components/DescriptionList/styled.js +0 -86
- package/dist/components/Display0/Display0.d.ts +0 -5
- package/dist/components/Display0/Display0.js +0 -73
- package/dist/components/Display0/index.d.ts +0 -1
- package/dist/components/Display0/index.js +0 -5
- package/dist/components/Display1/Display1.d.ts +0 -5
- package/dist/components/Display1/Display1.js +0 -73
- package/dist/components/Display1/index.d.ts +0 -1
- package/dist/components/Display1/index.js +0 -5
- package/dist/components/Display2/Display2.d.ts +0 -5
- package/dist/components/Display2/Display2.js +0 -73
- package/dist/components/Display2/index.d.ts +0 -1
- package/dist/components/Display2/index.js +0 -5
- package/dist/components/Display3/Display3.d.ts +0 -5
- package/dist/components/Display3/Display3.js +0 -73
- package/dist/components/Display3/index.d.ts +0 -1
- package/dist/components/Display3/index.js +0 -5
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +0 -18
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +0 -52
- package/dist/components/ErrorSummaryNotification/index.d.ts +0 -1
- package/dist/components/ErrorSummaryNotification/index.js +0 -5
- package/dist/components/FilterSelect/FilterSelect.d.ts +0 -17
- package/dist/components/FilterSelect/FilterSelect.js +0 -88
- package/dist/components/FilterSelect/index.d.ts +0 -1
- package/dist/components/FilterSelect/index.js +0 -5
- package/dist/components/Heading1/Heading1.d.ts +0 -5
- package/dist/components/Heading1/Heading1.js +0 -73
- package/dist/components/Heading1/index.d.ts +0 -1
- package/dist/components/Heading1/index.js +0 -5
- package/dist/components/Heading2/Heading2.d.ts +0 -5
- package/dist/components/Heading2/Heading2.js +0 -73
- package/dist/components/Heading2/index.d.ts +0 -1
- package/dist/components/Heading2/index.js +0 -5
- package/dist/components/Heading3/Heading3.d.ts +0 -5
- package/dist/components/Heading3/Heading3.js +0 -73
- package/dist/components/Heading3/index.d.ts +0 -1
- package/dist/components/Heading3/index.js +0 -5
- package/dist/components/Heading4/Heading4.d.ts +0 -5
- package/dist/components/Heading4/Heading4.js +0 -73
- package/dist/components/Heading4/index.d.ts +0 -1
- package/dist/components/Heading4/index.js +0 -5
- package/dist/components/Label/Label.d.ts +0 -7
- package/dist/components/Label/Label.js +0 -51
- package/dist/components/Label/index.d.ts +0 -1
- package/dist/components/Label/index.js +0 -5
- package/dist/components/Lead/Lead.d.ts +0 -7
- package/dist/components/Lead/Lead.js +0 -53
- package/dist/components/Lead/index.d.ts +0 -1
- package/dist/components/Lead/index.js +0 -5
- package/dist/components/NavHeader/IconButton.d.ts +0 -15
- package/dist/components/NavHeader/IconButton.js +0 -21
- package/dist/components/SkeletonCTA/SkeletonCTA.d.ts +0 -6
- package/dist/components/SkeletonCTA/SkeletonCTA.js +0 -42
- package/dist/components/SkeletonCTA/index.d.ts +0 -1
- package/dist/components/SkeletonCTA/index.js +0 -5
- package/dist/components/Small/Small.d.ts +0 -576
- package/dist/components/Small/Small.js +0 -39
- package/dist/components/Small/index.d.ts +0 -1
- package/dist/components/Small/index.js +0 -5
- package/dist/components/TextGroup/TextGroup.d.ts +0 -3
- package/dist/components/TextGroup/TextGroup.js +0 -43
- package/dist/components/TextGroup/index.d.ts +0 -1
- package/dist/components/TextGroup/index.js +0 -5
- package/dist/components/TextLink/TextLink.d.ts +0 -8
- package/dist/components/TextLink/TextLink.js +0 -75
- package/dist/components/TextLink/index.d.ts +0 -1
- package/dist/components/TextLink/index.js +0 -5
- package/dist/esm/components/CTAButton/CTAButton.js +0 -90
- package/dist/esm/components/CTAButton/index.js +0 -1
- package/dist/esm/components/CTALink/CTALink.js +0 -18
- package/dist/esm/components/CTALink/index.js +0 -1
- package/dist/esm/components/DescriptionList/DescriptionList.js +0 -40
- package/dist/esm/components/DescriptionList/index.js +0 -1
- package/dist/esm/components/DescriptionList/styled.js +0 -58
- package/dist/esm/components/Display0/Display0.js +0 -46
- package/dist/esm/components/Display0/index.js +0 -1
- package/dist/esm/components/Display1/Display1.js +0 -46
- package/dist/esm/components/Display1/index.js +0 -1
- package/dist/esm/components/Display2/Display2.js +0 -46
- package/dist/esm/components/Display2/index.js +0 -1
- package/dist/esm/components/Display3/Display3.js +0 -46
- package/dist/esm/components/Display3/index.js +0 -1
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +0 -49
- package/dist/esm/components/ErrorSummaryNotification/index.js +0 -1
- package/dist/esm/components/FilterSelect/FilterSelect.js +0 -61
- package/dist/esm/components/FilterSelect/index.js +0 -1
- package/dist/esm/components/Heading1/Heading1.js +0 -46
- package/dist/esm/components/Heading1/index.js +0 -1
- package/dist/esm/components/Heading2/Heading2.js +0 -46
- package/dist/esm/components/Heading2/index.js +0 -1
- package/dist/esm/components/Heading3/Heading3.js +0 -46
- package/dist/esm/components/Heading3/index.js +0 -1
- package/dist/esm/components/Heading4/Heading4.js +0 -46
- package/dist/esm/components/Heading4/index.js +0 -1
- package/dist/esm/components/Label/Label.js +0 -25
- package/dist/esm/components/Label/index.js +0 -1
- package/dist/esm/components/Lead/Lead.js +0 -27
- package/dist/esm/components/Lead/index.js +0 -1
- package/dist/esm/components/NavHeader/IconButton.js +0 -17
- package/dist/esm/components/SkeletonCTA/SkeletonCTA.js +0 -35
- package/dist/esm/components/SkeletonCTA/index.js +0 -1
- package/dist/esm/components/Small/Small.js +0 -13
- package/dist/esm/components/Small/index.js +0 -1
- package/dist/esm/components/TextGroup/TextGroup.js +0 -39
- package/dist/esm/components/TextGroup/index.js +0 -1
- package/dist/esm/components/TextLink/TextLink.js +0 -49
- package/dist/esm/components/TextLink/index.js +0 -1
- package/dist/esm/providers/types.js +0 -1
- package/dist/providers/types.d.ts +0 -5
- package/dist/providers/types.js +0 -2
|
@@ -6,11 +6,14 @@ import { numToPx } from '@ovotech/element-core';
|
|
|
6
6
|
import styled, { css } from '../../styled.native';
|
|
7
7
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
8
8
|
var StyledLabelText = styled.Text(function (_a) {
|
|
9
|
-
var
|
|
9
|
+
var theme = _a.theme, smallAndUp = _a.smallAndUp;
|
|
10
10
|
var fontSize = smallAndUp
|
|
11
|
-
?
|
|
12
|
-
:
|
|
13
|
-
|
|
11
|
+
? theme.font.size.md.mediaQuery.lg
|
|
12
|
+
: theme.font.size.md.mediaQuery.sm;
|
|
13
|
+
var lineHeight = smallAndUp
|
|
14
|
+
? theme.font.lineHeight.md.mediaQuery.lg
|
|
15
|
+
: theme.font.lineHeight.md.mediaQuery.sm;
|
|
16
|
+
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 "])), theme.native.font.family.bold, numToPx(lineHeight), theme.color.surface.onSurface, numToPx(fontSize));
|
|
14
17
|
});
|
|
15
18
|
var LabelText = styledComponentWithBreakpoints(StyledLabelText);
|
|
16
19
|
export { LabelText };
|
|
@@ -5,22 +5,22 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
5
5
|
import { numToPx } from '@ovotech/element-core';
|
|
6
6
|
import styled, { css } from '../../styled.native';
|
|
7
7
|
export var SquareBullet = styled.View(function (_a) {
|
|
8
|
-
var
|
|
8
|
+
var theme = _a.theme, visible = _a.visible, smallAndUp = _a.smallAndUp;
|
|
9
9
|
var lineHeight = smallAndUp
|
|
10
|
-
?
|
|
11
|
-
:
|
|
12
|
-
var topMargin = (lineHeight -
|
|
13
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-self: flex-start;\n width: ", ";\n height: ", ";\n margin-right:
|
|
10
|
+
? theme.font.lineHeight.md.mediaQuery.lg
|
|
11
|
+
: theme.font.lineHeight.md.mediaQuery.sm;
|
|
12
|
+
var topMargin = (lineHeight - theme.space[200]) / 2;
|
|
13
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-self: flex-start;\n width: ", ";\n height: ", ";\n margin-right: 10px;\n margin-top: ", ";\n background-color: ", ";\n transform: rotate(-15deg);\n "], ["\n align-self: flex-start;\n width: ", ";\n height: ", ";\n margin-right: 10px;\n margin-top: ", ";\n background-color: ", ";\n transform: rotate(-15deg);\n "])), numToPx(theme.space[200]), numToPx(theme.space[200]), numToPx(topMargin), visible ? theme.color.brand.brand : 'transparent');
|
|
14
14
|
});
|
|
15
15
|
export var TextBullet = styled.Text(function (_a) {
|
|
16
|
-
var
|
|
16
|
+
var theme = _a.theme, smallAndUp = _a.smallAndUp;
|
|
17
17
|
var fontSize = smallAndUp
|
|
18
|
-
?
|
|
19
|
-
:
|
|
18
|
+
? theme.font.size.md.mediaQuery.lg
|
|
19
|
+
: theme.font.size.md.mediaQuery.sm;
|
|
20
20
|
var lineHeight = smallAndUp
|
|
21
|
-
?
|
|
22
|
-
:
|
|
23
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n
|
|
21
|
+
? theme.font.lineHeight.md.mediaQuery.lg
|
|
22
|
+
: theme.font.lineHeight.md.mediaQuery.sm;
|
|
23
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n min-width: ", ";\n min-height: ", ";\n margin-right: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-align: left;\n color: ", ";\n "], ["\n min-width: ", ";\n min-height: ", ";\n margin-right: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-align: left;\n color: ", ";\n "])), numToPx(theme.space[300]), numToPx(theme.space[300]), numToPx(theme.space[100]), theme.native.font.family.book, numToPx(fontSize), numToPx(lineHeight), theme.color.surface.onSurface);
|
|
24
24
|
});
|
|
25
25
|
export var FlexRow = styled.View(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
26
26
|
export var LiContent = styled.View(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-direction: column;\n flex: 1;\n"], ["\n flex-direction: column;\n flex: 1;\n"])));
|
|
@@ -26,8 +26,10 @@ import { useBreakpoint } from '../../hooks';
|
|
|
26
26
|
import styled from '../../styled.native';
|
|
27
27
|
import { responsiveStyle } from '../../utils';
|
|
28
28
|
var StyledMargin = styled.View(function (_a) {
|
|
29
|
-
var
|
|
30
|
-
var formatter = function (spaceKey) {
|
|
29
|
+
var theme = _a.theme, mTop = _a.mTop, mBottom = _a.mBottom, mLeft = _a.mLeft, mRight = _a.mRight, horizontal = _a.horizontal, vertical = _a.vertical, all = _a.all, breakpoints = _a.breakpoints;
|
|
30
|
+
var formatter = function (spaceKey) {
|
|
31
|
+
return numToPx(theme.space[String(spaceKey * 100)]);
|
|
32
|
+
};
|
|
31
33
|
return "\n ".concat(horizontal
|
|
32
34
|
? "\n ".concat(responsiveStyle('margin-left', horizontal, breakpoints, formatter), "\n ").concat(responsiveStyle('margin-right', horizontal, breakpoints, formatter), "\n ")
|
|
33
35
|
: '', "\n ").concat(vertical
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Animated, { Easing, FadeInDown, FadeInUp, FadeOutDown, FadeOutUp, useAnimatedStyle, useSharedValue, withTiming, } from 'react-native-reanimated';
|
|
3
|
-
import { useTheme } from '../../styled.native';
|
|
4
3
|
import { Action } from '../ActionList';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import { BackActionWrapper, CollapsedTitle, CollapsedTitleWrapper, ExpandedTitle, NavContainer, NavWrapper, HeaderGap, } from './NavHeader.styles';
|
|
7
6
|
var FADE_ANIMATION_DURATION = 200;
|
|
8
7
|
export var NavHeader = function (_a) {
|
|
9
8
|
var title = _a.title, scrolled = _a.scrolled, canGoBack = _a.canGoBack, rightActionConfig = _a.rightActionConfig, _b = _a.topOffset, topOffset = _b === void 0 ? 0 : _b, _c = _a.backButtonText, backButtonText = _c === void 0 ? 'Back' : _c, onHeaderHeightChange = _a.onHeaderHeightChange, onBackButtonPress = _a.onBackButtonPress;
|
|
10
9
|
var hasRightAction = !!rightActionConfig;
|
|
11
10
|
var hasTitle = title !== undefined && (title === null || title === void 0 ? void 0 : title.length) > 0;
|
|
12
|
-
var theme = useTheme();
|
|
13
11
|
var layoutHeight = useSharedValue(0);
|
|
14
12
|
var animatedHeightStyle = useAnimatedStyle(function () {
|
|
15
13
|
return {
|
|
@@ -32,13 +30,5 @@ export var NavHeader = function (_a) {
|
|
|
32
30
|
};
|
|
33
31
|
// NavWrapper will recieve height of the NavContainer and animate it
|
|
34
32
|
// content inside NavContainer is the only dynamic part of NavHeader
|
|
35
|
-
return (_jsx(NavWrapper, { collapsed: scrolled, style: animatedHeightStyle, children: _jsxs(NavContainer, { topOffset: topOffset, onLayout: onLayout,
|
|
36
|
-
width: scrolled ? '33.3%' : '100%',
|
|
37
|
-
// Important for maintaining white space above the title on main app screens.
|
|
38
|
-
height: !canGoBack ? theme.core.space[10] : undefined,
|
|
39
|
-
}, children: canGoBack && (_jsx(ActionWrapper, { collapsed: scrolled, children: _jsx(Action, { iconLeft: "chevron-left-small", inline: true, onPress: onBackButtonPress, children: backButtonText }) })) }), scrolled ? (_jsxs(_Fragment, { children: [_jsx(CollapsedTitleWrapper, { titleVisible: hasTitle, children: _jsx(CollapsedTitle, { numberOfLines: 1, ellipsizeMode: "tail", entering: FadeInDown.delay(FADE_ANIMATION_DURATION), exiting: FadeOutDown.duration(FADE_ANIMATION_DURATION), children: title }) }), _jsx(IconButtonWrapper, { children: _jsx(IconButton, { rightActionConfig: rightActionConfig, size: "small", animation: FadeInDown.delay(FADE_ANIMATION_DURATION) }) })] })) : (_jsxs(_Fragment, { children: [_jsx(ExpandedTitle
|
|
40
|
-
// if we don't have right action leave more space for the title text in expanded state
|
|
41
|
-
, {
|
|
42
|
-
// if we don't have right action leave more space for the title text in expanded state
|
|
43
|
-
fullWidth: !scrolled && !hasRightAction, numberOfLines: 2, ellipsizeMode: "tail", hasBackButton: canGoBack, titleVisible: hasTitle, entering: FadeInUp.delay(FADE_ANIMATION_DURATION), exiting: FadeOutUp.duration(FADE_ANIMATION_DURATION), children: title }), _jsx(IconButtonWrapper, { children: _jsx(IconButton, { rightActionConfig: rightActionConfig, size: "large", animation: FadeInUp.delay(FADE_ANIMATION_DURATION) }) })] }))] }) }));
|
|
33
|
+
return (_jsx(NavWrapper, { collapsed: scrolled, style: animatedHeightStyle, children: _jsxs(NavContainer, { topOffset: topOffset, hasTitle: hasTitle, onLayout: onLayout, children: [_jsx(BackActionWrapper, { collapsed: scrolled, hasBackButton: canGoBack, children: canGoBack && (_jsx(Action, { standalone: true, iconLeft: "chevron-left-small", onPress: onBackButtonPress, children: backButtonText })) }), scrolled ? (_jsxs(_Fragment, { children: [_jsx(CollapsedTitleWrapper, { entering: FadeInDown.delay(FADE_ANIMATION_DURATION), exiting: FadeOutDown.duration(FADE_ANIMATION_DURATION), children: _jsx(CollapsedTitle, { numberOfLines: 1, ellipsizeMode: "tail", children: title }) }), _jsx(HeaderGap, { hasRightAction: hasRightAction }), hasRightAction && (_jsx(_Fragment, { children: _jsx(Animated.View, { entering: FadeInDown.delay(FADE_ANIMATION_DURATION), exiting: FadeOutDown.duration(FADE_ANIMATION_DURATION), accessibilityRole: "button", accessibilityLabel: rightActionConfig === null || rightActionConfig === void 0 ? void 0 : rightActionConfig.accessibilityLabel, accessibilityHint: rightActionConfig === null || rightActionConfig === void 0 ? void 0 : rightActionConfig.accessibilityHint, children: _jsx(Button, { iconRight: rightActionConfig.iconName, onPress: rightActionConfig.onActionPress }) }) }))] })) : (_jsxs(_Fragment, { children: [_jsx(ExpandedTitle, { hasRightAction: !hasRightAction, hasTitle: hasTitle, numberOfLines: 2, ellipsizeMode: "tail", hasBackButton: canGoBack, entering: FadeInUp.delay(FADE_ANIMATION_DURATION), exiting: FadeOutUp.duration(FADE_ANIMATION_DURATION), children: title }), hasRightAction && (_jsx(Animated.View, { entering: FadeInUp.delay(FADE_ANIMATION_DURATION), exiting: FadeOutUp.duration(FADE_ANIMATION_DURATION), accessibilityRole: "button", accessibilityLabel: rightActionConfig === null || rightActionConfig === void 0 ? void 0 : rightActionConfig.accessibilityLabel, accessibilityHint: rightActionConfig === null || rightActionConfig === void 0 ? void 0 : rightActionConfig.accessibilityHint, children: _jsx(Button, { iconRight: rightActionConfig.iconName, onPress: rightActionConfig.onActionPress }) }))] }))] }) }));
|
|
44
34
|
};
|
|
@@ -7,43 +7,33 @@ import Animated from 'react-native-reanimated';
|
|
|
7
7
|
import styled, { css } from '../../styled.native';
|
|
8
8
|
var Z_INDEX = 1000;
|
|
9
9
|
export var NavWrapper = styled(Animated.View)(function (_a) {
|
|
10
|
-
var
|
|
11
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n position: absolute;\n\n /* yes, it is not a good move, but we want header to be the topmost element on the screen and we can't control app zIndex */\n z-index: ", ";\n background-color: ", ";\n\n ", "\n "], ["\n width: 100%;\n position: absolute;\n\n /* yes, it is not a good move, but we want header to be the topmost element on the screen and we can't control app zIndex */\n z-index: ", ";\n background-color: ", ";\n\n ", "\n "])), Z_INDEX,
|
|
12
|
-
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-bottom-width: ", ";\n border-bottom-style: solid;\n border-bottom-color: ", ";\n "], ["\n border-bottom-width: ", ";\n border-bottom-style: solid;\n border-bottom-color: ", ";\n "])), numToPx(
|
|
10
|
+
var theme = _a.theme, collapsed = _a.collapsed;
|
|
11
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n position: absolute;\n\n /* yes, it is not a good move, but we want header to be the topmost element on the screen and we can't control app zIndex */\n z-index: ", ";\n background-color: ", ";\n\n ", "\n "], ["\n width: 100%;\n position: absolute;\n\n /* yes, it is not a good move, but we want header to be the topmost element on the screen and we can't control app zIndex */\n z-index: ", ";\n background-color: ", ";\n\n ", "\n "])), Z_INDEX, theme.color.surface.surface, collapsed
|
|
12
|
+
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-bottom-width: ", ";\n border-bottom-style: solid;\n border-bottom-color: ", ";\n "], ["\n border-bottom-width: ", ";\n border-bottom-style: solid;\n border-bottom-color: ", ";\n "])), numToPx(theme.border.width.sm), theme.color.input.borderDim) : '');
|
|
13
13
|
});
|
|
14
14
|
export var NavContainer = styled.View(function (_a) {
|
|
15
|
-
var
|
|
16
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n\n /* NavWrapper zIndex + 1 so it is always on top of the wrapper */\n z-index: ", ";\n width:
|
|
15
|
+
var theme = _a.theme, topOffset = _a.topOffset, hasTitle = _a.hasTitle;
|
|
16
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n\n /* NavWrapper zIndex + 1 so it is always on top of the wrapper */\n z-index: ", ";\n width: 100%;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n position: absolute;\n\n /* NavWrapper zIndex + 1 so it is always on top of the wrapper */\n z-index: ", ";\n width: 100%;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), Z_INDEX + 1, topOffset
|
|
17
17
|
? topOffset
|
|
18
|
-
: numToPx(
|
|
18
|
+
: numToPx(theme.space[hasTitle ? 200 : 400]), numToPx(theme.space[hasTitle ? 200 : 400]), numToPx(theme.space[400]), numToPx(theme.space[400]));
|
|
19
19
|
});
|
|
20
20
|
export var ExpandedTitle = styled(Animated.Text)(function (_a) {
|
|
21
|
-
var
|
|
22
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n ", ";\n "], ["\n width: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n ", ";\n "])),
|
|
21
|
+
var theme = _a.theme, hasBackButton = _a.hasBackButton, hasRightAction = _a.hasRightAction, hasTitle = _a.hasTitle;
|
|
22
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n ", ";\n "], ["\n width: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n ", ";\n "])), hasRightAction ? '100%' : '65%', theme.native.font.family.bold, numToPx(theme.font.size['4xl'].mediaQuery[hasBackButton ? 'sm' : 'lg']), numToPx(hasBackButton
|
|
23
|
+
? theme.font.lineHeight['4xl'].mediaQuery.sm
|
|
24
|
+
: theme.space[1300]), theme.color.brand.brand, !hasTitle && 'height: 0;');
|
|
23
25
|
});
|
|
24
|
-
export var CollapsedTitleWrapper = styled(Animated.View)(
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
export var CollapsedTitleWrapper = styled(Animated.View)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 33.3%;\n align-items: center;\n"], ["\n width: 33.3%;\n align-items: center;\n"])));
|
|
27
|
+
export var CollapsedTitle = styled.Text(function (_a) {
|
|
28
|
+
var theme = _a.theme;
|
|
29
|
+
return css(templateObject_6 || (templateObject_6 = __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 "])), theme.native.font.family.bold, numToPx(theme.font.size.xl.mediaQuery.sm), numToPx(theme.font.lineHeight.xl.mediaQuery.sm), theme.color.brand.brand);
|
|
27
30
|
});
|
|
28
|
-
export var
|
|
29
|
-
var
|
|
30
|
-
return css(
|
|
31
|
+
export var HeaderGap = styled.View(function (_a) {
|
|
32
|
+
var hasRightAction = _a.hasRightAction;
|
|
33
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), hasRightAction ? '20%' : '33.3%');
|
|
31
34
|
});
|
|
32
|
-
export var
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
return "\n border-radius: 100px;\n background-color: ".concat(semantic.inverted.surface, ";\n align-items: center;\n justify-content: center;\n");
|
|
35
|
+
export var BackActionWrapper = styled(Animated.View)(function (_a) {
|
|
36
|
+
var theme = _a.theme, collapsed = _a.collapsed, hasBackButton = _a.hasBackButton;
|
|
37
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n margin-bottom: ", ";\n width: ", ";\n\n /* Important for maintaining white space above the title on main app screens */\n height: ", ";\n "], ["\n margin-bottom: ", ";\n width: ", ";\n\n /* Important for maintaining white space above the title on main app screens */\n height: ", ";\n "])), collapsed ? '0' : numToPx(theme.space[400]), collapsed ? '33.3%' : '100%', hasBackButton ? numToPx(theme.space[1000]) : undefined);
|
|
36
38
|
});
|
|
37
|
-
|
|
38
|
-
var $pressed = _a.$pressed;
|
|
39
|
-
return ($pressed ? 0.8 : 1);
|
|
40
|
-
}, iconButtonSharedStyles);
|
|
41
|
-
export var StyledIconButtonL = styled(Animated.View)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n width: 36px;\n height: 36px;\n opacity: ", ";\n ", ";\n"], ["\n width: 36px;\n height: 36px;\n opacity: ", ";\n ", ";\n"])), function (_a) {
|
|
42
|
-
var $pressed = _a.$pressed;
|
|
43
|
-
return ($pressed ? 0.8 : 1);
|
|
44
|
-
}, iconButtonSharedStyles);
|
|
45
|
-
export var ActionWrapper = styled.View(function (_a) {
|
|
46
|
-
var core = _a.theme.core, collapsed = _a.collapsed;
|
|
47
|
-
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n margin-bottom: ", ";\n "], ["\n margin-bottom: ", ";\n "])), collapsed ? '0' : numToPx(core.space[2]));
|
|
48
|
-
});
|
|
49
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
39
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -31,40 +31,40 @@ import { View } from 'react-native';
|
|
|
31
31
|
import styled, { css } from '../../styled.native';
|
|
32
32
|
import { Icon } from '../Icon';
|
|
33
33
|
var NotificationBox = styled.View(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n margin-bottom: ", ";\n border: ", " solid\n ", ";\n border-radius: ", ";\n overflow: hidden;\n "], ["\n position: relative;\n margin-bottom: ", ";\n border: ", " solid\n ", ";\n border-radius: ", ";\n overflow: hidden;\n "])), noMargin ? 0 : numToPx(
|
|
34
|
+
var theme = _a.theme, noMargin = _a.noMargin, variant = _a.variant;
|
|
35
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n margin-bottom: ", ";\n border: ", " solid\n ", ";\n border-radius: ", ";\n overflow: hidden;\n "], ["\n position: relative;\n margin-bottom: ", ";\n border: ", " solid\n ", ";\n border-radius: ", ";\n overflow: hidden;\n "])), noMargin ? 0 : numToPx(theme.space[400]), numToPx(theme.border.width.sm), theme.color.alert[variant], numToPx(theme.border.radius['2xl']));
|
|
36
36
|
});
|
|
37
37
|
export var NotificationContentBox = styled.View(function (_a) {
|
|
38
|
-
var
|
|
39
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n
|
|
38
|
+
var theme = _a.theme;
|
|
39
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), theme.color.surface.bright, numToPx(theme.space[200]), numToPx(theme.space[300]), numToPx(theme.space[400]), numToPx(theme.space[400]));
|
|
40
40
|
});
|
|
41
41
|
export var NotificationTitleBox = styled.View(function (_a) {
|
|
42
|
-
var
|
|
43
|
-
var currentVariant =
|
|
44
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n min-height: 44px;\n "], ["\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n min-height: 44px;\n "])), currentVariant
|
|
45
|
-
? numToPx(
|
|
46
|
-
: numToPx(
|
|
42
|
+
var theme = _a.theme, variant = _a.variant, dismissible = _a.dismissible;
|
|
43
|
+
var currentVariant = theme.color.alert["".concat(variant, "Tint")];
|
|
44
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n min-height: 44px;\n "], ["\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n min-height: 44px;\n "])), currentVariant, numToPx(theme.space[200]), numToPx(theme.space[200]), numToPx(theme.space[400]), dismissible
|
|
45
|
+
? numToPx(theme.space[300])
|
|
46
|
+
: numToPx(theme.space[400]));
|
|
47
47
|
});
|
|
48
48
|
var NotificationTitleText = styled.Text(function (_a) {
|
|
49
|
-
var
|
|
50
|
-
var currentVariant =
|
|
51
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "])), numToPx(
|
|
49
|
+
var theme = _a.theme, variant = _a.variant;
|
|
50
|
+
var currentVariant = theme.color.alert[variant];
|
|
51
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "])), numToPx(theme.font.size.md.mediaQuery.sm), theme.native.font.family.bold, currentVariant);
|
|
52
52
|
});
|
|
53
53
|
var DismissButton = styled.TouchableOpacity(function (_a) {
|
|
54
|
-
var
|
|
55
|
-
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n
|
|
54
|
+
var theme = _a.theme;
|
|
55
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 28px;\n height: 28px;\n background: ", ";\n border: ", " solid ", ";\n border-radius: ", ";\n "], ["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 28px;\n height: 28px;\n background: ", ";\n border: ", " solid ", ";\n border-radius: ", ";\n "])), theme.button.surface.color.bg, numToPx(theme.border.width.sm), theme.color.surface.link, numToPx(theme.border.radius['2xl']));
|
|
56
56
|
});
|
|
57
57
|
var StyledIcon = styled(Icon)(function (_a) {
|
|
58
|
-
var
|
|
59
|
-
return "\n color: ".concat(
|
|
58
|
+
var theme = _a.theme;
|
|
59
|
+
return "\n color: ".concat(theme.color.surface.bright, ";\n ");
|
|
60
60
|
});
|
|
61
61
|
export var Notification = forwardRef(function (_a, ref) {
|
|
62
|
-
var _b = _a.variant, variant = _b === void 0 ? '
|
|
62
|
+
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissible = _a.dismissible, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissible", "onDismiss"]);
|
|
63
63
|
var _c = useState(false), dismissed = _c[0], setDismissed = _c[1];
|
|
64
64
|
if (dismissed || (!title && !children)) {
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
|
-
return (_jsx(View, __assign({ ref: ref }, rest, { children: _jsxs(NotificationBox, { noMargin: noMargin, testID: "nb-notification", children: [_jsxs(NotificationTitleBox, { variant: variant, dismissible: dismissible, children: [_jsx(NotificationTitleText, { variant: variant, children: title }), dismissible ? (_jsx(DismissButton, { accessible: true, accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
|
|
67
|
+
return (_jsx(View, __assign({ ref: ref }, rest, { children: _jsxs(NotificationBox, { variant: variant, noMargin: noMargin, testID: "nb-notification", children: [_jsxs(NotificationTitleBox, { variant: variant, dismissible: dismissible, children: [_jsx(NotificationTitleText, { variant: variant, children: title }), dismissible ? (_jsx(DismissButton, { accessible: true, accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
|
|
68
68
|
setDismissed(true);
|
|
69
69
|
if (onDismiss) {
|
|
70
70
|
onDismiss();
|
|
@@ -19,8 +19,10 @@ import { forwardRef } from 'react';
|
|
|
19
19
|
import { useBreakpoint } from '../../hooks';
|
|
20
20
|
import styled, { css } from '../../styled.native';
|
|
21
21
|
var StyledP = styled.Text(function (_a) {
|
|
22
|
-
var
|
|
23
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
22
|
+
var theme = _a.theme, smallAndUp = _a.smallAndUp, inverted = _a.inverted, _b = _a.size, size = _b === void 0 ? 'md' : _b;
|
|
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 "])), theme.native.font.family.book, numToPx(theme.font.size[size].mediaQuery[smallAndUp ? 'lg' : 'sm']), numToPx(theme.font.lineHeight[size].mediaQuery[smallAndUp ? 'lg' : 'sm']), inverted
|
|
24
|
+
? theme.color.surface.surface
|
|
25
|
+
: theme.color.surface.onSurface);
|
|
24
26
|
});
|
|
25
27
|
export var P = forwardRef(function (props, ref) {
|
|
26
28
|
var breakpoints = useBreakpoint();
|
|
@@ -6,7 +6,7 @@ import { numToPx } from '@ovotech/element-core';
|
|
|
6
6
|
import { Pressable } from 'react-native';
|
|
7
7
|
import styled, { css } from '../../styled.native';
|
|
8
8
|
export var StyledPressable = styled(Pressable)(function (_a) {
|
|
9
|
-
var
|
|
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(
|
|
9
|
+
var theme = _a.theme, focused = _a.focused;
|
|
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(theme.space[400]), focused ? '16px' : '14px', numToPx(theme.space[300]));
|
|
11
11
|
});
|
|
12
12
|
var templateObject_1;
|
|
@@ -20,9 +20,9 @@ var Dot = function (_a) {
|
|
|
20
20
|
outputRange = [-width, 0, width];
|
|
21
21
|
}
|
|
22
22
|
var backgroundColor = interpolateColor(animatedValue === null || animatedValue === void 0 ? void 0 : animatedValue.value, inputRange, [
|
|
23
|
-
theme.
|
|
24
|
-
theme.
|
|
25
|
-
theme.
|
|
23
|
+
theme.color.brand.dim,
|
|
24
|
+
theme.color.brand.bold,
|
|
25
|
+
theme.color.brand.dim,
|
|
26
26
|
]);
|
|
27
27
|
return {
|
|
28
28
|
transform: [
|
|
@@ -38,7 +38,7 @@ var Dot = function (_a) {
|
|
|
38
38
|
var SDotsContainer = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n bottom: 20px;\n flex-direction: row;\n gap: 10px;\n"], ["\n position: absolute;\n bottom: 20px;\n flex-direction: row;\n gap: 10px;\n"])));
|
|
39
39
|
var SDot = styled.View(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n border-radius: 50px;\n overflow: hidden;\n"], ["\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n border-radius: 50px;\n overflow: hidden;\n"])), function (_a) {
|
|
40
40
|
var theme = _a.theme;
|
|
41
|
-
return theme.
|
|
41
|
+
return theme.color.brand.dim;
|
|
42
42
|
}, function (_a) {
|
|
43
43
|
var $width = _a.$width;
|
|
44
44
|
return $width;
|
|
@@ -45,12 +45,12 @@ export function ProductCarousel(_a) {
|
|
|
45
45
|
bottom: 32,
|
|
46
46
|
left: 16,
|
|
47
47
|
right: 16,
|
|
48
|
-
}, children: _jsx(Icon, { name: "arrow-left", size: 32, color: theme.
|
|
48
|
+
}, children: _jsx(Icon, { name: "arrow-left", size: 32, color: theme.color.brand.onBrand }) }), _jsx(SActionPressable, { "$next": true, onPress: function () { var _a; return (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.next(); }, "$top": arrowsDistanceFromTop, mediumAndUp: mediumAndUp, hitSlop: {
|
|
49
49
|
top: 32,
|
|
50
50
|
bottom: 32,
|
|
51
51
|
left: 16,
|
|
52
52
|
right: 16,
|
|
53
|
-
}, children: _jsx(Icon, { name: "arrow-right", size: 32, color: theme.
|
|
53
|
+
}, children: _jsx(Icon, { name: "arrow-right", size: 32, color: theme.color.brand.onBrand }) })] })), showDots && data.length > 1 && (_jsx(NavigationDots, { data: data, animatedValue: progressValue }))] })] }));
|
|
54
54
|
}
|
|
55
55
|
var Card = function (_a) {
|
|
56
56
|
var children = _a.children, animationValue = _a.animationValue, height = _a.height, width = _a.width;
|
|
@@ -91,8 +91,8 @@ var SActionPressable = styled.Pressable(templateObject_2 || (templateObject_2 =
|
|
|
91
91
|
}, function (_a) {
|
|
92
92
|
var theme = _a.theme, $next = _a.$next, mediumAndUp = _a.mediumAndUp;
|
|
93
93
|
return $next
|
|
94
|
-
? "right: ".concat(mediumAndUp ? '25%' : numToPx(theme.
|
|
95
|
-
: "left: ".concat(mediumAndUp ? '25%' : numToPx(theme.
|
|
94
|
+
? "right: ".concat(mediumAndUp ? '25%' : numToPx(theme.space[1400]))
|
|
95
|
+
: "left: ".concat(mediumAndUp ? '25%' : numToPx(theme.space[1400]));
|
|
96
96
|
});
|
|
97
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
98
|
var templateObject_1, templateObject_2;
|
|
@@ -28,28 +28,28 @@ import styled from '../../styled.native';
|
|
|
28
28
|
import { HintText } from '../HintText';
|
|
29
29
|
import { LabelText } from '../LabelText';
|
|
30
30
|
var StyledRadioInputWrapper = styled.View(function (_a) {
|
|
31
|
-
var
|
|
32
|
-
return "\n width: ".concat(numToPx(
|
|
31
|
+
var theme = _a.theme;
|
|
32
|
+
return "\n width: ".concat(numToPx(theme.space[600]), ";\n height: ").concat(numToPx(theme.space[600]), ";\n margin-right: 10px;\n ");
|
|
33
33
|
});
|
|
34
34
|
var StyledRadioInput = styled.View(function (_a) {
|
|
35
|
-
var
|
|
36
|
-
return "\n width: ".concat(numToPx(
|
|
37
|
-
?
|
|
35
|
+
var theme = _a.theme, invalid = _a.invalid, checked = _a.checked;
|
|
36
|
+
return "\n width: ".concat(numToPx(theme.space[600]), ";\n height: ").concat(numToPx(theme.space[600]), ";\n border: ").concat(numToPx(theme.border.width.md), " solid;\n align-items: center;\n justify-content: center;\n border-radius: ").concat(numToPx(theme.space[600]), ";\n border-color: ").concat(invalid
|
|
37
|
+
? theme.input.color.borderError
|
|
38
38
|
: checked
|
|
39
|
-
?
|
|
40
|
-
:
|
|
39
|
+
? theme.input.color.selected
|
|
40
|
+
: theme.input.color.border, ";\n background: ").concat(checked ? theme.input.color.selectedTint : 'transparent', ";\n ");
|
|
41
41
|
});
|
|
42
42
|
var StyledRadioInputDot = styled.View(function (_a) {
|
|
43
|
-
var
|
|
44
|
-
return "\n width: ".concat(numToPx(
|
|
43
|
+
var theme = _a.theme, checked = _a.checked;
|
|
44
|
+
return "\n width: ".concat(numToPx(theme.space[300]), ";\n height: ").concat(numToPx(theme.space[300]), ";\n border-radius: ").concat(numToPx(theme.space[300]), ";\n background: ").concat(theme.input.color.selected, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
45
45
|
});
|
|
46
46
|
var Input = function (_a) {
|
|
47
47
|
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
48
48
|
return (_jsx(StyledRadioInputWrapper, __assign({}, rest, { children: _jsx(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID, children: _jsx(StyledRadioInputDot, { checked: checked }) }) })));
|
|
49
49
|
};
|
|
50
50
|
var StyledWrapper = styled.View(function (_a) {
|
|
51
|
-
var
|
|
52
|
-
return "\n padding-top: ".concat(numToPx(
|
|
51
|
+
var theme = _a.theme;
|
|
52
|
+
return "\n padding-top: ".concat(numToPx(theme.space[300]), ";\n flex-direction: row;\n ");
|
|
53
53
|
});
|
|
54
54
|
var Radio = forwardRef(function (_a, ref) {
|
|
55
55
|
var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
|
|
@@ -32,35 +32,35 @@ import { css } from 'styled-components';
|
|
|
32
32
|
import styled from '../../styled.native';
|
|
33
33
|
import { LabelText } from '../LabelText';
|
|
34
34
|
var StyledRadioInputWrapper = styled.View(function (_a) {
|
|
35
|
-
var
|
|
36
|
-
return "\n width: ".concat(numToPx(
|
|
35
|
+
var theme = _a.theme;
|
|
36
|
+
return "\n width: ".concat(numToPx(theme.space[600]), ";\n height: ").concat(numToPx(theme.space[600]), ";\n margin-top: ").concat(numToPx(theme.space[200]), ";\n ");
|
|
37
37
|
});
|
|
38
38
|
var StyledRadioInput = styled.View(function (_a) {
|
|
39
|
-
var
|
|
40
|
-
return "\n width: ".concat(numToPx(
|
|
41
|
-
?
|
|
39
|
+
var theme = _a.theme, invalid = _a.invalid, checked = _a.checked;
|
|
40
|
+
return "\n width: ".concat(numToPx(theme.space[600]), ";\n height: ").concat(numToPx(theme.space[600]), ";\n border: ").concat(numToPx(theme.border.width.md), " solid;\n align-items: center;\n justify-content: center;\n border-radius: ").concat(numToPx(theme.space[600]), ";\n border-color: ").concat(invalid
|
|
41
|
+
? theme.input.color.borderError
|
|
42
42
|
: checked
|
|
43
|
-
?
|
|
44
|
-
:
|
|
43
|
+
? theme.input.color.selected
|
|
44
|
+
: theme.input.color.border, ";\n background: ").concat(checked ? theme.input.color.selectedTint : 'transparent', ";\n ");
|
|
45
45
|
});
|
|
46
46
|
var StyledRadioInputDot = styled.View(function (_a) {
|
|
47
|
-
var
|
|
48
|
-
return "\n width: ".concat(numToPx(
|
|
47
|
+
var theme = _a.theme, checked = _a.checked;
|
|
48
|
+
return "\n width: ".concat(numToPx(theme.space[300]), ";\n height: ").concat(numToPx(theme.space[300]), ";\n border-radius: ").concat(numToPx(theme.space[300]), ";\n background: ").concat(theme.input.color.selected, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
49
49
|
});
|
|
50
50
|
var Input = function (_a) {
|
|
51
51
|
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
52
52
|
return (_jsx(StyledRadioInputWrapper, __assign({}, rest, { children: _jsx(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID, children: _jsx(StyledRadioInputDot, { checked: checked }) }) })));
|
|
53
53
|
};
|
|
54
54
|
var StyledWrapper = styled.View(function (_a) {
|
|
55
|
-
var
|
|
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 "])),
|
|
57
|
-
?
|
|
55
|
+
var theme = _a.theme, 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 "])), theme.color.surface.bright, numToPx(theme.space[200]), numToPx(theme.border.radius.lg), numToPx(theme.border.width.md), invalid
|
|
57
|
+
? theme.input.color.borderError
|
|
58
58
|
: checked
|
|
59
|
-
?
|
|
59
|
+
? theme.input.color.selected
|
|
60
60
|
: 'transparent');
|
|
61
61
|
});
|
|
62
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,
|
|
64
|
-
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { checked: checked, invalid: invalid, children: [typeof label === 'string' ? _jsx(LabelText, { children: label }) : label,
|
|
63
|
+
var label = _a.label, checked = _a.checked, invalid = _a.invalid, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "checked", "invalid", "activeOpacity", "testID"]);
|
|
64
|
+
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { checked: checked, invalid: invalid, children: [typeof label === 'string' ? _jsx(LabelText, { children: label }) : label, _jsx(Input, { checked: checked, invalid: invalid, testID: testID })] }) })));
|
|
65
65
|
});
|
|
66
66
|
var templateObject_1;
|
|
@@ -42,14 +42,14 @@ export var SegmentedControls = function (_a) {
|
|
|
42
42
|
translateX: animatedX.value,
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
translateY: animatedY.value + theme.
|
|
45
|
+
translateY: animatedY.value + theme.space[size === 'small' ? 100 : 200],
|
|
46
46
|
} /* accounting for margin from top & bottom */,
|
|
47
47
|
],
|
|
48
48
|
width: animatedWidth.value,
|
|
49
49
|
height: animatedHeight.value,
|
|
50
50
|
position: 'absolute',
|
|
51
|
-
borderRadius: theme.
|
|
52
|
-
backgroundColor: theme.
|
|
51
|
+
borderRadius: theme.border.radius['2xl'],
|
|
52
|
+
backgroundColor: theme.color.surface.bright,
|
|
53
53
|
}); }, [animatedX, animatedY, animatedWidth, animatedHeight]);
|
|
54
54
|
return (_jsxs(SegmentsContainer, __assign({ "$inline": inline, "$multipleRows": multipleRows }, rest, { children: [_jsx(Animated.View, { style: animatedBackgroundStyle }), segments.map(function (segment) {
|
|
55
55
|
var _a, _b;
|
|
@@ -68,6 +68,6 @@ export var SegmentedControls = function (_a) {
|
|
|
68
68
|
})] })));
|
|
69
69
|
};
|
|
70
70
|
var SegmentsContainer = styled.View(function (_a) {
|
|
71
|
-
var
|
|
72
|
-
return "\n flex-direction: row;\n flex-wrap: ".concat($multipleRows ? '' : 'no-', "wrap;\n justify-content: ").concat($multipleRows ? 'space-between' : 'space-around', ";\n align-items: center;\n width: ").concat($inline ? 'auto' : '100%', ";\n align-self: ").concat($inline ? 'flex-start' : 'stretch', ";\n padding: ").concat(
|
|
71
|
+
var theme = _a.theme, $inline = _a.$inline, $multipleRows = _a.$multipleRows;
|
|
72
|
+
return "\n flex-direction: row;\n flex-wrap: ".concat($multipleRows ? '' : 'no-', "wrap;\n justify-content: ").concat($multipleRows ? 'space-between' : 'space-around', ";\n align-items: center;\n width: ").concat($inline ? 'auto' : '100%', ";\n align-self: ").concat($inline ? 'flex-start' : 'stretch', ";\n padding: ").concat(theme.space[100], "px;\n background-color: ").concat(theme.color.surface.dim, ";\n border-radius: ").concat(theme.border.radius['2xl'], "px;\n");
|
|
73
73
|
});
|
|
@@ -78,12 +78,12 @@ export var SegmentButton = function (_a) {
|
|
|
78
78
|
var SSegmentsWrapper = styled.View(function (_a) {
|
|
79
79
|
var theme = _a.theme, $size = _a.$size, multiline = _a.multiline;
|
|
80
80
|
return "\n ".concat(multiline
|
|
81
|
-
? "padding: 4px ".concat(theme.
|
|
82
|
-
: "padding: ".concat($size === 'small' ? 2 : 8, "px ").concat(theme.
|
|
81
|
+
? "padding: 4px ".concat(theme.space[$size === 'small' ? 400 : 600], "px;")
|
|
82
|
+
: "padding: ".concat($size === 'small' ? 2 : 8, "px ").concat(theme.space[$size === 'small' ? 300 : 400], "px;"), "\n align-items: center;\n justify-content: center;\n");
|
|
83
83
|
});
|
|
84
84
|
var SSegmentText = styled(AnimatedP)(function (_a) {
|
|
85
85
|
var $isSelected = _a.$isSelected, theme = _a.theme;
|
|
86
86
|
return "\n font-family: ".concat($isSelected
|
|
87
|
-
? theme.
|
|
88
|
-
: theme.
|
|
87
|
+
? theme.native.font.family.bold
|
|
88
|
+
: theme.native.font.family.book, ";\n color: ").concat(theme.color.surface.onSurface, ";\n ");
|
|
89
89
|
});
|