@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
|
@@ -8,22 +8,24 @@ var element_core_1 = require("@ovotech/element-core");
|
|
|
8
8
|
var react_native_1 = require("react-native");
|
|
9
9
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
10
10
|
exports.StyledWrapper = styled_native_1.default.TouchableOpacity(function (_a) {
|
|
11
|
-
var
|
|
12
|
-
return "\n width: ".concat(hasLabel ? (inline ? undefined : '100%') : (0, element_core_1.numToPx)(
|
|
11
|
+
var theme = _a.theme, hasLabel = _a.hasLabel, inline = _a.inline, labelPosition = _a.labelPosition;
|
|
12
|
+
return "\n width: ".concat(hasLabel ? (inline ? undefined : '100%') : (0, element_core_1.numToPx)(theme.space[1100]), ";\n display: flex;\n flex-direction: row").concat(labelPosition === 'left' ? '' : '-reverse', ";\n justify-content: space-between;\n position: relative;\n ");
|
|
13
13
|
});
|
|
14
14
|
exports.StyledToggleInputWrapper = styled_native_1.default.View(function (_a) {
|
|
15
|
-
var
|
|
16
|
-
return "\n width: ".concat((0, element_core_1.numToPx)(
|
|
15
|
+
var theme = _a.theme, labelPosition = _a.labelPosition;
|
|
16
|
+
return "\n width: ".concat((0, element_core_1.numToPx)(theme.space[1100]), ";\n height: ").concat((0, element_core_1.numToPx)(theme.space[600]), ";\n ").concat(labelPosition
|
|
17
17
|
? labelPosition === 'left'
|
|
18
18
|
? 'margin-left: 10px;'
|
|
19
19
|
: 'margin-right: 10px;'
|
|
20
20
|
: null, "\n ");
|
|
21
21
|
});
|
|
22
22
|
exports.StyledToggleInput = styled_native_1.default.View(function (_a) {
|
|
23
|
-
var
|
|
24
|
-
return "\n width: ".concat((0, element_core_1.numToPx)(
|
|
23
|
+
var theme = _a.theme, checked = _a.checked;
|
|
24
|
+
return "\n width: ".concat((0, element_core_1.numToPx)(theme.space[1100]), ";\n height: ").concat((0, element_core_1.numToPx)(theme.space[600]), ";\n justify-content: center;\n border-radius: ").concat((0, element_core_1.numToPx)(theme.border.radius.lg), ";\n background: ").concat(checked
|
|
25
|
+
? theme.color.outline.outer
|
|
26
|
+
: theme.color.surface.onSurfaceVariant, ";\n ");
|
|
25
27
|
});
|
|
26
28
|
exports.StyledToggleDot = (0, styled_native_1.default)(react_native_1.Animated.View)(function (_a) {
|
|
27
|
-
var
|
|
28
|
-
return "\n position: absolute;\n width: ".concat((0, element_core_1.numToPx)(
|
|
29
|
+
var theme = _a.theme, checked = _a.checked;
|
|
30
|
+
return "\n position: absolute;\n width: ".concat((0, element_core_1.numToPx)(theme.space[400]), ";\n height: ").concat((0, element_core_1.numToPx)(theme.space[400]), ";\n border-radius: ").concat((0, element_core_1.numToPx)(theme.space[400]), ";\n background-color: ").concat(checked ? theme.color.brand.onBrand : theme.color.surface.dim, ";\n");
|
|
29
31
|
});
|
|
@@ -4,33 +4,22 @@ export * from './ActionList';
|
|
|
4
4
|
export * from './Badge';
|
|
5
5
|
export * from './Card';
|
|
6
6
|
export * from './Checkbox';
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
7
|
+
export * from './Button';
|
|
8
|
+
export * from './Link';
|
|
9
9
|
export * from './CurrencyField';
|
|
10
10
|
export * from './CurrencyInput';
|
|
11
11
|
export * from './DataTable';
|
|
12
12
|
export * from './DateField';
|
|
13
|
-
export * from './DescriptionList';
|
|
14
13
|
export * from './Disclosure';
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './Display1';
|
|
17
|
-
export * from './Display2';
|
|
18
|
-
export * from './Display3';
|
|
14
|
+
export * from './Display';
|
|
19
15
|
export * from './Divider';
|
|
20
16
|
export * from './Em';
|
|
21
17
|
export * from './EmailField';
|
|
22
18
|
export * from './EmailInput';
|
|
23
|
-
export * from './ErrorSummaryNotification';
|
|
24
19
|
export * from './Field';
|
|
25
|
-
export * from './FilterSelect';
|
|
26
20
|
export * from './Grid';
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './Heading2';
|
|
29
|
-
export * from './Heading3';
|
|
30
|
-
export * from './Heading4';
|
|
21
|
+
export * from './Heading';
|
|
31
22
|
export * from './Icon';
|
|
32
|
-
export * from './Label';
|
|
33
|
-
export * from './Lead';
|
|
34
23
|
export * from './LineThrough';
|
|
35
24
|
export * from './List';
|
|
36
25
|
export * from './Margin';
|
|
@@ -47,10 +36,9 @@ export * from './Radio';
|
|
|
47
36
|
export * from './SegmentedControls';
|
|
48
37
|
export * from './SelectField';
|
|
49
38
|
export * from './SkeletonCircle';
|
|
50
|
-
export * from './
|
|
39
|
+
export * from './SkeletonButton';
|
|
51
40
|
export * from './SkeletonHeading';
|
|
52
41
|
export * from './SkeletonText';
|
|
53
|
-
export * from './Small';
|
|
54
42
|
export * from './Spinner';
|
|
55
43
|
export * from './Stack';
|
|
56
44
|
export * from './Strong';
|
|
@@ -58,10 +46,8 @@ export * from './Tabs';
|
|
|
58
46
|
export * from './TextareaField';
|
|
59
47
|
export * from './TextareaInput';
|
|
60
48
|
export * from './TextField';
|
|
61
|
-
export * from './TextGroup';
|
|
62
49
|
export * from './TextInput';
|
|
63
|
-
export * from './TextLink';
|
|
64
50
|
export * from './Toggle';
|
|
65
51
|
export * from './Toast';
|
|
66
|
-
export * from './ProductCarousel';
|
|
67
52
|
export * from './RadioCard';
|
|
53
|
+
export * from './Pictogram';
|
package/dist/components/index.js
CHANGED
|
@@ -20,33 +20,22 @@ __exportStar(require("./ActionList"), exports);
|
|
|
20
20
|
__exportStar(require("./Badge"), exports);
|
|
21
21
|
__exportStar(require("./Card"), exports);
|
|
22
22
|
__exportStar(require("./Checkbox"), exports);
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
23
|
+
__exportStar(require("./Button"), exports);
|
|
24
|
+
__exportStar(require("./Link"), exports);
|
|
25
25
|
__exportStar(require("./CurrencyField"), exports);
|
|
26
26
|
__exportStar(require("./CurrencyInput"), exports);
|
|
27
27
|
__exportStar(require("./DataTable"), exports);
|
|
28
28
|
__exportStar(require("./DateField"), exports);
|
|
29
|
-
__exportStar(require("./DescriptionList"), exports);
|
|
30
29
|
__exportStar(require("./Disclosure"), exports);
|
|
31
|
-
__exportStar(require("./
|
|
32
|
-
__exportStar(require("./Display1"), exports);
|
|
33
|
-
__exportStar(require("./Display2"), exports);
|
|
34
|
-
__exportStar(require("./Display3"), exports);
|
|
30
|
+
__exportStar(require("./Display"), exports);
|
|
35
31
|
__exportStar(require("./Divider"), exports);
|
|
36
32
|
__exportStar(require("./Em"), exports);
|
|
37
33
|
__exportStar(require("./EmailField"), exports);
|
|
38
34
|
__exportStar(require("./EmailInput"), exports);
|
|
39
|
-
__exportStar(require("./ErrorSummaryNotification"), exports);
|
|
40
35
|
__exportStar(require("./Field"), exports);
|
|
41
|
-
__exportStar(require("./FilterSelect"), exports);
|
|
42
36
|
__exportStar(require("./Grid"), exports);
|
|
43
|
-
__exportStar(require("./
|
|
44
|
-
__exportStar(require("./Heading2"), exports);
|
|
45
|
-
__exportStar(require("./Heading3"), exports);
|
|
46
|
-
__exportStar(require("./Heading4"), exports);
|
|
37
|
+
__exportStar(require("./Heading"), exports);
|
|
47
38
|
__exportStar(require("./Icon"), exports);
|
|
48
|
-
__exportStar(require("./Label"), exports);
|
|
49
|
-
__exportStar(require("./Lead"), exports);
|
|
50
39
|
__exportStar(require("./LineThrough"), exports);
|
|
51
40
|
__exportStar(require("./List"), exports);
|
|
52
41
|
__exportStar(require("./Margin"), exports);
|
|
@@ -63,10 +52,9 @@ __exportStar(require("./Radio"), exports);
|
|
|
63
52
|
__exportStar(require("./SegmentedControls"), exports);
|
|
64
53
|
__exportStar(require("./SelectField"), exports);
|
|
65
54
|
__exportStar(require("./SkeletonCircle"), exports);
|
|
66
|
-
__exportStar(require("./
|
|
55
|
+
__exportStar(require("./SkeletonButton"), exports);
|
|
67
56
|
__exportStar(require("./SkeletonHeading"), exports);
|
|
68
57
|
__exportStar(require("./SkeletonText"), exports);
|
|
69
|
-
__exportStar(require("./Small"), exports);
|
|
70
58
|
__exportStar(require("./Spinner"), exports);
|
|
71
59
|
__exportStar(require("./Stack"), exports);
|
|
72
60
|
__exportStar(require("./Strong"), exports);
|
|
@@ -74,10 +62,8 @@ __exportStar(require("./Tabs"), exports);
|
|
|
74
62
|
__exportStar(require("./TextareaField"), exports);
|
|
75
63
|
__exportStar(require("./TextareaInput"), exports);
|
|
76
64
|
__exportStar(require("./TextField"), exports);
|
|
77
|
-
__exportStar(require("./TextGroup"), exports);
|
|
78
65
|
__exportStar(require("./TextInput"), exports);
|
|
79
|
-
__exportStar(require("./TextLink"), exports);
|
|
80
66
|
__exportStar(require("./Toggle"), exports);
|
|
81
67
|
__exportStar(require("./Toast"), exports);
|
|
82
|
-
__exportStar(require("./ProductCarousel"), exports);
|
|
83
68
|
__exportStar(require("./RadioCard"), exports);
|
|
69
|
+
__exportStar(require("./Pictogram"), exports);
|
|
@@ -29,7 +29,7 @@ import { Component, useCallback, useContext, useEffect, useMemo, useState, } fro
|
|
|
29
29
|
import Animated, { interpolateColor, runOnUI, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming, } from 'react-native-reanimated';
|
|
30
30
|
import { useLayout } from '../../hooks/use-layout';
|
|
31
31
|
import { ThemeContext } from '../../styled.native';
|
|
32
|
-
import { Heading4 } from '../
|
|
32
|
+
import { Heading4 } from '../Heading';
|
|
33
33
|
import { AccordionGroupContext } from './Group';
|
|
34
34
|
import { AccordionIcon } from './Icon';
|
|
35
35
|
import { StyledAccordion, StyledAccordionHeader, StyledContainer, } from './styles';
|
|
@@ -50,13 +50,16 @@ export function withAnimated(WrappedComponent) {
|
|
|
50
50
|
return Animated.createAnimatedComponent(WithAnimated);
|
|
51
51
|
}
|
|
52
52
|
export var Accordion = function (_a) {
|
|
53
|
-
var _b = _a.expanded, expanded = _b === void 0 ? false : _b, first = _a.first, last = _a.last, title = _a.title, children = _a.children, onToggle = _a.onToggle;
|
|
54
|
-
var
|
|
53
|
+
var _b = _a.expanded, expanded = _b === void 0 ? false : _b, first = _a.first, last = _a.last, title = _a.title, children = _a.children, onToggle = _a.onToggle, _c = _a.variant, variant = _c === void 0 ? 'default' : _c;
|
|
54
|
+
var theme = useContext(ThemeContext);
|
|
55
55
|
var Header = useContext(AccordionGroupContext).Header;
|
|
56
56
|
var AccordionHeading = Header !== null && Header !== void 0 ? Header : Heading4;
|
|
57
57
|
var AnimatedHeading = useMemo(function () { return withAnimated(AccordionHeading); }, [AccordionHeading]);
|
|
58
58
|
var _d = useLayout(0), layout = _d[0], onLayout = _d[1];
|
|
59
59
|
var _e = useState(expanded), open = _e[0], setOpen = _e[1];
|
|
60
|
+
var initialHeadingColor = variant === 'default'
|
|
61
|
+
? theme.color.brand.brand
|
|
62
|
+
: theme.color.surface.onSurface;
|
|
60
63
|
var handleHeightContent = useMemo(function () { return layout.height || 100; }, [layout.height]);
|
|
61
64
|
var size = useSharedValue(handleHeightContent);
|
|
62
65
|
useEffect(function () {
|
|
@@ -91,16 +94,15 @@ export var Accordion = function (_a) {
|
|
|
91
94
|
}, [handleHeightContent, open, size]);
|
|
92
95
|
var containerAnimatedStyle = useMemo(function () { return [{ overflow: 'hidden' }, style]; }, [style]);
|
|
93
96
|
var headerStyle = useAnimatedStyle(function () { return ({
|
|
94
|
-
color: interpolateColor(progress.value, [0, 1], [
|
|
97
|
+
color: interpolateColor(progress.value, [0, 1], [initialHeadingColor, theme.color.surface.onSurface]),
|
|
95
98
|
}); }, [progress]);
|
|
96
|
-
return (_jsxs(StyledAccordion, { first: first, last: last, isExpanded: open, children: [_jsxs(StyledAccordionHeader, { accessibilityState: { expanded: open }, onPress: toggleOpen, testID: "accordionTitle", children: [_jsx(AnimatedHeading, { style: [
|
|
99
|
+
return (_jsxs(StyledAccordion, { first: first, last: last, isExpanded: open, "$variant": variant, children: [_jsxs(StyledAccordionHeader, { accessibilityState: { expanded: open }, onPress: toggleOpen, testID: "accordionTitle", children: [_jsx(AnimatedHeading, { style: [
|
|
97
100
|
headerStyle,
|
|
98
101
|
{
|
|
99
|
-
|
|
100
|
-
paddingRight: core.space[3],
|
|
102
|
+
paddingRight: theme.space[300],
|
|
101
103
|
marginTop: 0,
|
|
102
104
|
marginBottom: 0,
|
|
103
105
|
flexShrink: 1,
|
|
104
106
|
},
|
|
105
|
-
], children: title }), _jsx(AccordionIcon, { animationTiming: progress })] }), _jsx(Animated.View, { style: containerAnimatedStyle, children: _jsx(StyledContainer, { onLayout: onLayout, children: children }) })] }));
|
|
107
|
+
], children: title }), _jsx(AccordionIcon, { animationTiming: progress, "$variant": variant })] }), _jsx(Animated.View, { style: containerAnimatedStyle, children: _jsx(StyledContainer, { onLayout: onLayout, children: children }) })] }));
|
|
106
108
|
};
|
|
@@ -6,11 +6,14 @@ import { ThemeContext } from '../../styled.native';
|
|
|
6
6
|
var OVO_LOGO_ANGLE = 105;
|
|
7
7
|
var AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
8
8
|
export function AccordionIcon(_a) {
|
|
9
|
-
var animationTiming = _a.animationTiming;
|
|
10
|
-
var
|
|
9
|
+
var animationTiming = _a.animationTiming, $variant = _a.$variant;
|
|
10
|
+
var color = useContext(ThemeContext).color;
|
|
11
|
+
var initialBgColor = $variant === 'default' ? color.surface.borderDim : color.brand.dark;
|
|
12
|
+
var expandedBgColor = $variant === 'default' ? color.brand.brand : color.brand.dark;
|
|
13
|
+
var initialIconColor = $variant === 'default' ? color.surface.onSurface : color.brand.onBrand;
|
|
11
14
|
var outerAnimatedStyles = useAnimatedStyle(function () { return ({
|
|
12
|
-
backgroundColor: interpolateColor(animationTiming.value, [0, 1], [
|
|
13
|
-
height:
|
|
15
|
+
backgroundColor: interpolateColor(animationTiming.value, [0, 1], [initialBgColor, expandedBgColor]),
|
|
16
|
+
height: 32 - animationTiming.value,
|
|
14
17
|
margin: 2 * animationTiming.value,
|
|
15
18
|
transform: [{ rotateZ: animationTiming.value * -OVO_LOGO_ANGLE + 'deg' }],
|
|
16
19
|
}); }, [animationTiming]);
|
|
@@ -25,11 +28,11 @@ export function AccordionIcon(_a) {
|
|
|
25
28
|
}); }, [animationTiming]);
|
|
26
29
|
return (_jsx(Animated.View, { style: [
|
|
27
30
|
{
|
|
28
|
-
backgroundColor:
|
|
31
|
+
backgroundColor: color.surface.dim,
|
|
29
32
|
aspectRatio: 1,
|
|
30
33
|
alignItems: 'center',
|
|
31
34
|
justifyContent: 'center',
|
|
32
35
|
},
|
|
33
36
|
outerAnimatedStyles,
|
|
34
|
-
], children: _jsx(Animated.View, { style: innerAnimatedStyles, children: _jsxs(Svg, { width: "
|
|
37
|
+
], children: _jsx(Animated.View, { style: innerAnimatedStyles, children: _jsxs(Svg, { width: "14", height: "14", viewBox: "0 0 16 16", children: [_jsx(AnimatedPath, { animatedProps: plusAnimatedProps, d: "M9 9H16V6.99H9V0H6.99V7H0V9.01H7V16.01H9.01V9.01L9 9Z", fill: initialIconColor }), _jsx(AnimatedPath, { animatedProps: minusAnimatedProps, d: "M16.3826 9.66663V7.66663H0.462646V9.66663H16.3826Z", fill: color.brand.onBrand })] }) }) }));
|
|
35
38
|
}
|
|
@@ -6,26 +6,32 @@ import { numToPx } from '@ovotech/element-core';
|
|
|
6
6
|
import Animated from 'react-native-reanimated';
|
|
7
7
|
import styled, { css } from '../../styled.native';
|
|
8
8
|
export var StyledAccordion = styled(Animated.View)(function (_a) {
|
|
9
|
-
var
|
|
10
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n border-width: ", ";\n border-color: ", ";\n border-bottom-width: 0;\n background-color: ", ";\n transition: background-color ", ";\n\n ", "\n\n ", "\n "], ["\n width: 100%;\n border-width: ", ";\n border-color: ", ";\n border-bottom-width: 0;\n background-color: ", ";\n transition: background-color ", ";\n\n ", "\n\n ", "\n "])), numToPx(
|
|
9
|
+
var theme = _a.theme, first = _a.first, last = _a.last, isExpanded = _a.isExpanded, $variant = _a.$variant;
|
|
10
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n border-width: ", ";\n border-color: ", ";\n border-bottom-width: 0;\n background-color: ", ";\n transition: background-color ", ";\n\n ", "\n\n ", "\n "], ["\n width: 100%;\n border-width: ", ";\n border-color: ", ";\n border-bottom-width: 0;\n background-color: ", ";\n transition: background-color ", ";\n\n ", "\n\n ", "\n "])), numToPx(theme.border.width[$variant === 'default' ? 'sm' : 'md']), $variant === 'brand'
|
|
11
|
+
? theme.color.brand.brand
|
|
12
|
+
: theme.color.surface.borderDim, $variant === 'brand'
|
|
13
|
+
? theme.color.brand.bright
|
|
14
|
+
: isExpanded
|
|
15
|
+
? theme.color.brand.onBrand
|
|
16
|
+
: 'transparent', theme.transition.duration.fast, first
|
|
11
17
|
? {
|
|
12
|
-
borderTopLeftRadius:
|
|
13
|
-
borderTopRightRadius:
|
|
18
|
+
borderTopLeftRadius: theme.border.radius.md,
|
|
19
|
+
borderTopRightRadius: theme.border.radius.md,
|
|
14
20
|
}
|
|
15
21
|
: null, last
|
|
16
22
|
? {
|
|
17
|
-
borderBottomLeftRadius:
|
|
18
|
-
borderBottomRightRadius:
|
|
19
|
-
borderBottomWidth:
|
|
23
|
+
borderBottomLeftRadius: theme.border.radius.md,
|
|
24
|
+
borderBottomRightRadius: theme.border.radius.md,
|
|
25
|
+
borderBottomWidth: numToPx(theme.border.width[$variant === 'default' ? 'sm' : 'md']),
|
|
20
26
|
}
|
|
21
27
|
: null);
|
|
22
28
|
});
|
|
23
29
|
export var StyledAccordionHeader = styled.TouchableOpacity(function (_a) {
|
|
24
|
-
var
|
|
25
|
-
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-left: ", ";\n padding-right: 18px;\n padding-bottom: 18px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n "], ["\n padding-top: ", ";\n padding-left: ", ";\n padding-right: 18px;\n padding-bottom: 18px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n "])), numToPx(
|
|
30
|
+
var theme = _a.theme;
|
|
31
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-left: ", ";\n padding-right: 18px;\n padding-bottom: 18px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n "], ["\n padding-top: ", ";\n padding-left: ", ";\n padding-right: 18px;\n padding-bottom: 18px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n "])), numToPx(theme.space[500]), numToPx(theme.space[300]));
|
|
26
32
|
});
|
|
27
33
|
export var StyledContainer = styled.View(function (_a) {
|
|
28
|
-
var
|
|
29
|
-
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-top: 0;\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n "], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-top: 0;\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n "])), numToPx(
|
|
34
|
+
var theme = _a.theme;
|
|
35
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-top: 0;\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n "], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-top: 0;\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n "])), numToPx(theme.space[1200]), numToPx(theme.space[600]), numToPx(theme.space[300]));
|
|
30
36
|
});
|
|
31
37
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -14,33 +14,33 @@ import { numToPx } from '@ovotech/element-core';
|
|
|
14
14
|
import MaskedView from '@react-native-masked-view/masked-view';
|
|
15
15
|
import { useContext, useEffect } from 'react';
|
|
16
16
|
import { Image, Pressable, View } from 'react-native';
|
|
17
|
-
import { Action,
|
|
17
|
+
import { Action, Button, Heading2, Heading3, Icon, Margin, Stack } from '../';
|
|
18
18
|
import styled, { ThemeContext } from '../../styled.native';
|
|
19
19
|
import { P } from '../P';
|
|
20
20
|
import { IndicatorIconShape } from './IndicatorIconShape';
|
|
21
21
|
var StyledPressableCard = styled.Pressable(function (_a) {
|
|
22
|
-
var
|
|
23
|
-
var paddingVal = inline ?
|
|
24
|
-
var reducedBottomPaddingVal = inline ?
|
|
25
|
-
return "\n border-radius: ".concat(inline ? numToPx(
|
|
22
|
+
var theme = _a.theme, inline = _a.inline, inverted = _a.inverted, reducedBottomPadding = _a.reducedBottomPadding;
|
|
23
|
+
var paddingVal = inline ? theme.space[400] : theme.space[600];
|
|
24
|
+
var reducedBottomPaddingVal = inline ? theme.space[300] : theme.space[500];
|
|
25
|
+
return "\n border-radius: ".concat(inline ? numToPx(theme.space[600]) : 0, ";\n background-color: ").concat(inverted ? theme.color.surface.dim : theme.color.surface.bright, ";\n padding: ").concat(numToPx(paddingVal), ";\n padding-bottom: ").concat(numToPx(reducedBottomPadding ? reducedBottomPaddingVal : paddingVal), ";\n overflow: hidden;\n border-width: 0;\n width: 100%;\n ");
|
|
26
26
|
});
|
|
27
27
|
var StyledCard = styled.View(function (_a) {
|
|
28
|
-
var
|
|
29
|
-
var paddingVal = inline ?
|
|
30
|
-
var reducedBottomPaddingVal = inline ?
|
|
31
|
-
return "\n border-radius: ".concat(inline ? numToPx(
|
|
28
|
+
var theme = _a.theme, inline = _a.inline, inverted = _a.inverted, reducedBottomPadding = _a.reducedBottomPadding;
|
|
29
|
+
var paddingVal = inline ? theme.space[400] : theme.space[600];
|
|
30
|
+
var reducedBottomPaddingVal = inline ? theme.space[300] : theme.space[500];
|
|
31
|
+
return "\n border-radius: ".concat(inline ? numToPx(theme.space[600]) : 0, ";\n background-color: ").concat(inverted ? theme.color.surface.onSurface : theme.color.surface.bright, ";\n padding: ").concat(numToPx(paddingVal), ";\n padding-bottom: ").concat(numToPx(reducedBottomPadding ? reducedBottomPaddingVal : paddingVal), ";\n overflow: hidden;\n border-width: 0;\n width: 100%;\n ");
|
|
32
32
|
});
|
|
33
33
|
var StyledP = styled(P)(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
return "\n color: ".concat(inverted ?
|
|
34
|
+
var theme = _a.theme, inverted = _a.inverted;
|
|
35
|
+
return "\n color: ".concat(inverted ? theme.color.surface.bright : theme.color.surface.onSurface, ";\n");
|
|
36
36
|
});
|
|
37
37
|
var CloseIconWrapper = styled.View(function (_a) {
|
|
38
|
-
var
|
|
39
|
-
return "\n padding: ".concat(numToPx(
|
|
38
|
+
var theme = _a.theme;
|
|
39
|
+
return "\n padding: ".concat(numToPx(theme.space[200]), ";\n background-color: ").concat(theme.color.surface.bright, ";\n border-radius: ").concat(numToPx(theme.space[600]), ";\n");
|
|
40
40
|
});
|
|
41
41
|
export var ActionCard = function (_a) {
|
|
42
42
|
var _b = _a.accessibilityLabel, accessibilityLabel = _b === void 0 ? 'image' : _b, _c = _a.actionIconName, actionIconName = _c === void 0 ? 'chevron-right-small' : _c, body = _a.body, buttonTitle = _a.buttonTitle, ctaVariant = _a.ctaVariant, image = _a.image, _d = _a.inline, inline = _d === void 0 ? false : _d, _e = _a.inverted, inverted = _e === void 0 ? false : _e, onMount = _a.onMount, onPressCloseButton = _a.onPressCloseButton, onPressActionButton = _a.onPressActionButton, onPressIndicator = _a.onPressIndicator, testID = _a.testID, title = _a.title;
|
|
43
|
-
var
|
|
43
|
+
var theme = useContext(ThemeContext);
|
|
44
44
|
var hasSingleAction = (onPressActionButton && !onPressIndicator && !onPressCloseButton) ||
|
|
45
45
|
(onPressIndicator && !onPressActionButton && !onPressCloseButton);
|
|
46
46
|
var cardAction = hasSingleAction
|
|
@@ -55,16 +55,16 @@ export var ActionCard = function (_a) {
|
|
|
55
55
|
}
|
|
56
56
|
}, []);
|
|
57
57
|
var Heading = inline ? Heading3 : Heading2;
|
|
58
|
-
var cardPadding =
|
|
58
|
+
var cardPadding = theme.space[inline ? 400 : 600];
|
|
59
59
|
var negativeMarginAdjustment = -cardPadding;
|
|
60
60
|
return (_jsxs(RootContainer, __assign({}, (cardAction ? { onPress: cardAction } : {}), { inline: inline, inverted: inverted, reducedBottomPadding: Boolean(buttonTitle && !ctaVariant), testID: "".concat(testID, "-card"), accessibilityRole: cardAction ? 'button' : 'none', children: [_jsxs(View, { style: { flexDirection: 'row' }, children: [_jsx(View, { style: { flex: 1 }, children: _jsxs(Stack, { spaceBetween: 2, children: [_jsx(Heading, { style: {
|
|
61
61
|
color: inverted
|
|
62
|
-
?
|
|
63
|
-
:
|
|
62
|
+
? theme.color.surface.bright
|
|
63
|
+
: theme.color.brand.brand,
|
|
64
64
|
paddingRight: image || !onPressCloseButton ? 0 : cardPadding,
|
|
65
65
|
}, testID: "".concat(testID, "-heading"), children: title }), _jsxs(View, { children: [typeof body === 'string' ? (_jsx(View, { style: {
|
|
66
66
|
paddingRight: !image && !title && onPressCloseButton ? cardPadding : 0,
|
|
67
|
-
}, children: _jsx(StyledP, { inverted: inverted, children: body }) })) : (body), buttonTitle && onPressActionButton && !onPressIndicator ? (!ctaVariant ? (_jsx(Margin, { top: 2, children: _jsx(Action, {
|
|
67
|
+
}, children: _jsx(StyledP, { inverted: inverted, children: body }) })) : (body), buttonTitle && onPressActionButton && !onPressIndicator ? (!ctaVariant ? (_jsx(Margin, { top: 2, children: _jsx(Action, { standalone: true, onPress: onPressActionButton, testID: "".concat(testID, "-button"), iconRight: actionIconName, inverted: inverted, children: buttonTitle }) })) : (_jsx(Margin, { top: 4, children: _jsx(Button, { onPress: onPressActionButton, testID: "".concat(testID, "-button"), variant: ctaVariant, inverted: inverted, children: buttonTitle }) }))) : null] })] }) }), image ? (_jsx(MaskedView, { style: {
|
|
68
68
|
flex: 1,
|
|
69
69
|
flexDirection: 'row',
|
|
70
70
|
height: '100%',
|
|
@@ -93,9 +93,9 @@ export var ActionCard = function (_a) {
|
|
|
93
93
|
position: 'absolute',
|
|
94
94
|
right: inline ? 8 : 6,
|
|
95
95
|
bottom: 16,
|
|
96
|
-
}, color:
|
|
96
|
+
}, color: theme.color.surface.bright, name: "chevron-right", accessibilityLabel: "chevron-right" })] })) : null] }), onPressCloseButton && !onPressIndicator ? (_jsx(Pressable, { style: {
|
|
97
97
|
position: 'absolute',
|
|
98
|
-
right:
|
|
99
|
-
top:
|
|
100
|
-
}, onPress: onPressCloseButton, testID: "".concat(testID, "-close-button"), children: _jsx(CloseIconWrapper, { inverted: inverted, children: _jsx(Icon, { name: "cross", size: "16", color:
|
|
98
|
+
right: theme.space[200],
|
|
99
|
+
top: theme.space[200],
|
|
100
|
+
}, onPress: onPressCloseButton, testID: "".concat(testID, "-close-button"), children: _jsx(CloseIconWrapper, { inverted: inverted, children: _jsx(Icon, { name: "cross", size: "16", color: theme.color.surface.onSurface }) }) })) : null] })));
|
|
101
101
|
};
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Svg, { Path, ClipPath, Defs } from 'react-native-svg';
|
|
3
3
|
import styled from '../../styled.native';
|
|
4
4
|
var StyledPath = styled(Path)(function (_a) {
|
|
5
|
-
var
|
|
6
|
-
return "\n fill: ".concat(color !== null && color !== void 0 ? color :
|
|
5
|
+
var theme = _a.theme, color = _a.color;
|
|
6
|
+
return "\n fill: ".concat(color !== null && color !== void 0 ? color : theme.color.brand.brand, "\n");
|
|
7
7
|
});
|
|
8
8
|
export var CloseIconShape = function (_a) {
|
|
9
9
|
var color = _a.color;
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import Svg, { Path } from 'react-native-svg';
|
|
3
3
|
import styled from '../../styled.native';
|
|
4
4
|
var StyledPath = styled(Path)(function (_a) {
|
|
5
|
-
var
|
|
6
|
-
return "\n fill: ".concat(color !== null && color !== void 0 ? color :
|
|
5
|
+
var theme = _a.theme, color = _a.color;
|
|
6
|
+
return "\n fill: ".concat(color !== null && color !== void 0 ? color : theme.color.brand.brand, "\n");
|
|
7
7
|
});
|
|
8
8
|
export var IndicatorIconShape = function (_a) {
|
|
9
9
|
var color = _a.color;
|
|
@@ -22,12 +22,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import { Children, cloneElement, forwardRef, } from 'react';
|
|
25
|
-
import { TouchableOpacity, } from 'react-native';
|
|
25
|
+
import { TouchableOpacity, View, } from 'react-native';
|
|
26
26
|
import { useBreakpoint } from '../../hooks';
|
|
27
27
|
import { getValidChildren } from '../../utils';
|
|
28
|
-
import {
|
|
28
|
+
import { Badge } from '../Badge';
|
|
29
|
+
import { StyledActionInner, StyledActionList, StyledActionNodeWrapper, StyledActionText, StyledActionWrapper, StyledHintText, StyledLeftIcon, StyledRightIcon, StyledTextWrapper, } from './styled';
|
|
29
30
|
var ActionList = function (_a) {
|
|
30
|
-
var children = _a.children, inverted = _a.inverted, rest = __rest(_a, ["children", "inverted"]);
|
|
31
|
+
var children = _a.children, inverted = _a.inverted, borderBottom = _a.borderBottom, rest = __rest(_a, ["children", "inverted", "borderBottom"]);
|
|
31
32
|
var validChildren = getValidChildren(children);
|
|
32
33
|
var childCount = Children.count(validChildren);
|
|
33
34
|
return (_jsx(StyledActionList, __assign({}, rest, { children: Children.map(validChildren, function (child, index) {
|
|
@@ -35,7 +36,7 @@ var ActionList = function (_a) {
|
|
|
35
36
|
return cloneElement(child, {
|
|
36
37
|
fullWidth: true,
|
|
37
38
|
index: index,
|
|
38
|
-
hasBorder: childCount > 1 && index !== childCount - 1,
|
|
39
|
+
hasBorder: (childCount > 1 && index !== childCount - 1) || borderBottom,
|
|
39
40
|
inverted: (_a = child.props.inverted) !== null && _a !== void 0 ? _a : inverted, // prioritise child prop
|
|
40
41
|
inList: true,
|
|
41
42
|
iconRight: (_b = child.props.iconRight) !== null && _b !== void 0 ? _b : 'chevron-right-small',
|
|
@@ -43,12 +44,12 @@ var ActionList = function (_a) {
|
|
|
43
44
|
}) })));
|
|
44
45
|
};
|
|
45
46
|
var ActionWrapper = forwardRef(function (_a, ref) {
|
|
46
|
-
var children = _a.children, accessibilityRole = _a.accessibilityRole, accessibilityLabel = _a.accessibilityLabel, accessibilityHint = _a.accessibilityHint, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.75 : _b, fullWidth = _a.fullWidth, _c = _a.hasBorder, hasBorder = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d,
|
|
47
|
-
return (_jsx(StyledActionWrapper, __assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID }, rest, { children: _jsx(TouchableOpacity, {
|
|
47
|
+
var children = _a.children, accessibilityRole = _a.accessibilityRole, accessibilityLabel = _a.accessibilityLabel, accessibilityHint = _a.accessibilityHint, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.75 : _b, fullWidth = _a.fullWidth, _c = _a.hasBorder, hasBorder = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, inList = _a.inList, onPress = _a.onPress, testID = _a.testID, _e = _a.standalone, standalone = _e === void 0 ? false : _e, rest = __rest(_a, ["children", "accessibilityRole", "accessibilityLabel", "accessibilityHint", "activeOpacity", "fullWidth", "hasBorder", "inverted", "inList", "onPress", "testID", "standalone"]);
|
|
48
|
+
return (_jsx(StyledActionWrapper, __assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID, inList: inList }, rest, { children: _jsx(TouchableOpacity, { activeOpacity: activeOpacity, accessible: true, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, onPress: onPress, children: _jsx(StyledActionInner, { fullWidth: fullWidth, inList: inList, standalone: standalone, children: children }) }) })));
|
|
48
49
|
});
|
|
49
50
|
var Action = forwardRef(function (_a, ref) {
|
|
50
|
-
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'link' : _b, accessibilityLabel = _a.accessibilityLabel, accessibilityHint = _a.accessibilityHint, children = _a.children, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d,
|
|
51
|
+
var _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'link' : _b, accessibilityLabel = _a.accessibilityLabel, accessibilityHint = _a.accessibilityHint, children = _a.children, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.inverted, inverted = _d === void 0 ? false : _d, onPress = _a.onPress, testID = _a.testID, iconLeft = _a.iconLeft, iconRight = _a.iconRight, _e = _a.standalone, standalone = _e === void 0 ? false : _e, _f = _a.badgeVariant, badgeVariant = _f === void 0 ? 'info' : _f, badgeText = _a.badgeText, hint = _a.hint, rest = __rest(_a, ["accessibilityRole", "accessibilityLabel", "accessibilityHint", "children", "fullWidth", "inverted", "onPress", "testID", "iconLeft", "iconRight", "standalone", "badgeVariant", "badgeText", "hint"]);
|
|
51
52
|
var smallAndUp = useBreakpoint().smallAndUp;
|
|
52
|
-
return (_jsxs(ActionWrapper, __assign({ ref: ref, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, fullWidth: fullWidth, inverted: inverted,
|
|
53
|
+
return (_jsxs(ActionWrapper, __assign({ ref: ref, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, fullWidth: fullWidth, inverted: inverted, onPress: onPress, testID: testID, standalone: standalone, hint: hint, badgeText: badgeText }, rest, { children: [iconLeft ? (_jsx(StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, _jsxs(View, { children: [typeof children === 'string' ? (_jsxs(StyledTextWrapper, { children: [_jsx(StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, children: children }), badgeText ? (_jsx(Badge, { variant: badgeVariant, children: badgeText })) : null] })) : (_jsx(StyledActionNodeWrapper, { children: children })), hint ? (_jsx(StyledHintText, { inverted: inverted, children: hint })) : null] }), iconRight ? (_jsx(StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
|
|
53
54
|
});
|
|
54
55
|
export { ActionList, Action };
|
|
@@ -5,36 +5,53 @@ 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
|
import { styledComponentWithBreakpoints } from '../../utils';
|
|
8
|
+
import { HintText } from '../HintText';
|
|
8
9
|
import { Icon } from '../Icon';
|
|
9
10
|
var StyledList = styled.View(function (_a) {
|
|
10
|
-
var
|
|
11
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n flex-direction: column;\n margin-top: ", ";\n margin-bottom: ", ";\n "])), numToPx(smallAndUp ?
|
|
11
|
+
var theme = _a.theme, smallAndUp = _a.smallAndUp;
|
|
12
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n margin-top: ", ";\n margin-bottom: ", ";\n "], ["\n flex-direction: column;\n margin-top: ", ";\n margin-bottom: ", ";\n "])), numToPx(smallAndUp ? theme.space[300] : theme.space[200]), numToPx(smallAndUp ? theme.space[300] : theme.space[200]));
|
|
12
13
|
});
|
|
13
14
|
export var StyledActionList = styledComponentWithBreakpoints(StyledList);
|
|
14
15
|
export var StyledActionWrapper = styled.View(function (_a) {
|
|
15
|
-
var
|
|
16
|
-
return "\n
|
|
16
|
+
var theme = _a.theme, hasBorder = _a.hasBorder, inverted = _a.inverted, inList = _a.inList, hint = _a.hint, badgeText = _a.badgeText;
|
|
17
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n align-self: flex-start;\n border-bottom-width: ", ";\n border-bottom-style: solid;\n border-bottom-color: ", ";\n padding: ", " 0;\n "], ["\n width: 100%;\n align-self: flex-start;\n border-bottom-width: ", ";\n border-bottom-style: solid;\n border-bottom-color: ", ";\n padding: ", " 0;\n "])), hasBorder ? numToPx(theme.border.width.sm) : 0, inverted
|
|
18
|
+
? theme.color.surface.dim
|
|
19
|
+
: theme.color.brand.fixed.onBrand, inList && (hint || badgeText) ? numToPx(theme.space[200]) : 0);
|
|
17
20
|
});
|
|
18
21
|
export var StyledActionInner = styled.View(function (_a) {
|
|
19
|
-
var fullWidth = _a.fullWidth,
|
|
20
|
-
return css(
|
|
22
|
+
var fullWidth = _a.fullWidth, standalone = _a.standalone;
|
|
23
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n justify-content: ", ";\n align-items: center;\n min-height: ", ";\n "], ["\n flex-direction: row;\n justify-content: ", ";\n align-items: center;\n min-height: ", ";\n "])), fullWidth ? 'space-between' : 'flex-start', standalone ? '' : '44px');
|
|
21
24
|
});
|
|
22
25
|
export var StyledActionText = styled.Text(function (_a) {
|
|
23
|
-
var
|
|
26
|
+
var theme = _a.theme, smallAndUp = _a.smallAndUp, _b = _a.inverted, inverted = _b === void 0 ? false : _b;
|
|
24
27
|
var fontSize = smallAndUp
|
|
25
|
-
?
|
|
26
|
-
:
|
|
27
|
-
return css(
|
|
28
|
-
?
|
|
29
|
-
:
|
|
28
|
+
? theme.font.size.md.mediaQuery.lg
|
|
29
|
+
: theme.font.size.md.mediaQuery.sm;
|
|
30
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n "])), inverted
|
|
31
|
+
? theme.color.surface.bright
|
|
32
|
+
: theme.color.surface.onSurface, theme.native.font.family.bold, numToPx(fontSize), numToPx(theme.font.lineHeight.md.mediaQuery.sm));
|
|
30
33
|
});
|
|
31
|
-
export var StyledActionNodeWrapper = styled.View(
|
|
34
|
+
export var StyledActionNodeWrapper = styled.View(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n flex: 1;\n flex-direction: row;\n"], ["\n display: flex;\n flex: 1;\n flex-direction: row;\n"])));
|
|
32
35
|
export var StyledRightIcon = styled(Icon)(function (_a) {
|
|
33
|
-
var
|
|
34
|
-
return css(
|
|
36
|
+
var theme = _a.theme, inverted = _a.inverted;
|
|
37
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n margin-left: ", ";\n margin-top: 2px; /* compensation for the line-height of the text */\n "], ["\n color: ", ";\n margin-left: ", ";\n margin-top: 2px; /* compensation for the line-height of the text */\n "])), inverted
|
|
38
|
+
? theme.color.surface.bright
|
|
39
|
+
: theme.color.surface.onSurface, numToPx(theme.space[100]));
|
|
35
40
|
});
|
|
36
41
|
export var StyledLeftIcon = styled(Icon)(function (_a) {
|
|
37
|
-
var
|
|
38
|
-
return css(
|
|
42
|
+
var theme = _a.theme, inverted = _a.inverted;
|
|
43
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n margin-right: ", ";\n "], ["\n color: ", ";\n margin-right: ", ";\n "])), inverted
|
|
44
|
+
? theme.color.surface.bright
|
|
45
|
+
: theme.color.surface.onSurface, numToPx(theme.space[100]));
|
|
39
46
|
});
|
|
40
|
-
var
|
|
47
|
+
export var StyledTextWrapper = styled.View(function (_a) {
|
|
48
|
+
var theme = _a.theme;
|
|
49
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n gap: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n gap: ", ";\n "])), numToPx(theme.space[200]));
|
|
50
|
+
});
|
|
51
|
+
export var StyledHintText = styled(HintText)(function (_a) {
|
|
52
|
+
var theme = _a.theme, _b = _a.inverted, inverted = _b === void 0 ? false : _b;
|
|
53
|
+
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), inverted
|
|
54
|
+
? theme.color.surface.bright
|
|
55
|
+
: theme.color.surface.onSurfaceVariant);
|
|
56
|
+
});
|
|
57
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|