@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
|
@@ -35,26 +35,32 @@ var element_core_1 = require("@ovotech/element-core");
|
|
|
35
35
|
var react_native_reanimated_1 = __importDefault(require("react-native-reanimated"));
|
|
36
36
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
37
37
|
exports.StyledAccordion = (0, styled_native_1.default)(react_native_reanimated_1.default.View)(function (_a) {
|
|
38
|
-
var
|
|
39
|
-
return (0, styled_native_1.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 "])), (0, element_core_1.numToPx)(
|
|
38
|
+
var theme = _a.theme, first = _a.first, last = _a.last, isExpanded = _a.isExpanded, $variant = _a.$variant;
|
|
39
|
+
return (0, styled_native_1.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 "])), (0, element_core_1.numToPx)(theme.border.width[$variant === 'default' ? 'sm' : 'md']), $variant === 'brand'
|
|
40
|
+
? theme.color.brand.brand
|
|
41
|
+
: theme.color.surface.borderDim, $variant === 'brand'
|
|
42
|
+
? theme.color.brand.bright
|
|
43
|
+
: isExpanded
|
|
44
|
+
? theme.color.brand.onBrand
|
|
45
|
+
: 'transparent', theme.transition.duration.fast, first
|
|
40
46
|
? {
|
|
41
|
-
borderTopLeftRadius:
|
|
42
|
-
borderTopRightRadius:
|
|
47
|
+
borderTopLeftRadius: theme.border.radius.md,
|
|
48
|
+
borderTopRightRadius: theme.border.radius.md,
|
|
43
49
|
}
|
|
44
50
|
: null, last
|
|
45
51
|
? {
|
|
46
|
-
borderBottomLeftRadius:
|
|
47
|
-
borderBottomRightRadius:
|
|
48
|
-
borderBottomWidth:
|
|
52
|
+
borderBottomLeftRadius: theme.border.radius.md,
|
|
53
|
+
borderBottomRightRadius: theme.border.radius.md,
|
|
54
|
+
borderBottomWidth: (0, element_core_1.numToPx)(theme.border.width[$variant === 'default' ? 'sm' : 'md']),
|
|
49
55
|
}
|
|
50
56
|
: null);
|
|
51
57
|
});
|
|
52
58
|
exports.StyledAccordionHeader = styled_native_1.default.TouchableOpacity(function (_a) {
|
|
53
|
-
var
|
|
54
|
-
return (0, styled_native_1.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 "])), (0, element_core_1.numToPx)(
|
|
59
|
+
var theme = _a.theme;
|
|
60
|
+
return (0, styled_native_1.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 "])), (0, element_core_1.numToPx)(theme.space[500]), (0, element_core_1.numToPx)(theme.space[300]));
|
|
55
61
|
});
|
|
56
62
|
exports.StyledContainer = styled_native_1.default.View(function (_a) {
|
|
57
|
-
var
|
|
58
|
-
return (0, styled_native_1.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 "])), (0, element_core_1.numToPx)(
|
|
63
|
+
var theme = _a.theme;
|
|
64
|
+
return (0, styled_native_1.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 "])), (0, element_core_1.numToPx)(theme.space[1200]), (0, element_core_1.numToPx)(theme.space[600]), (0, element_core_1.numToPx)(theme.space[300]));
|
|
59
65
|
});
|
|
60
66
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
export type AccordionProps = PropsWithChildren<{
|
|
3
|
-
title:
|
|
3
|
+
title: string;
|
|
4
4
|
expanded?: boolean;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
onToggle?: CallableFunction;
|
|
@@ -11,6 +11,7 @@ export type AccordionProps = PropsWithChildren<{
|
|
|
11
11
|
first?: boolean;
|
|
12
12
|
last?: boolean;
|
|
13
13
|
testId?: string;
|
|
14
|
+
variant?: 'default' | 'brand';
|
|
14
15
|
}>;
|
|
15
16
|
export type AccordionGroupProps = {
|
|
16
17
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ImageSourcePropType } from 'react-native';
|
|
3
3
|
import { IconName } from '../../providers';
|
|
4
|
-
import {
|
|
4
|
+
import { ButtonVariantName } from '../Button';
|
|
5
5
|
export type ActionCardProps = {
|
|
6
6
|
title: string;
|
|
7
7
|
body?: string | ReactElement;
|
|
@@ -9,7 +9,7 @@ export type ActionCardProps = {
|
|
|
9
9
|
onPressActionButton?: () => void;
|
|
10
10
|
onPressIndicator?: () => void;
|
|
11
11
|
onMount?: () => void;
|
|
12
|
-
ctaVariant?:
|
|
12
|
+
ctaVariant?: ButtonVariantName;
|
|
13
13
|
image?: ImageSourcePropType;
|
|
14
14
|
buttonTitle?: string;
|
|
15
15
|
actionIconName?: IconName;
|
|
@@ -48,28 +48,28 @@ var styled_native_1 = __importStar(require("../../styled.native"));
|
|
|
48
48
|
var P_1 = require("../P");
|
|
49
49
|
var IndicatorIconShape_1 = require("./IndicatorIconShape");
|
|
50
50
|
var StyledPressableCard = styled_native_1.default.Pressable(function (_a) {
|
|
51
|
-
var
|
|
52
|
-
var paddingVal = inline ?
|
|
53
|
-
var reducedBottomPaddingVal = inline ?
|
|
54
|
-
return "\n border-radius: ".concat(inline ? (0, element_core_1.numToPx)(
|
|
51
|
+
var theme = _a.theme, inline = _a.inline, inverted = _a.inverted, reducedBottomPadding = _a.reducedBottomPadding;
|
|
52
|
+
var paddingVal = inline ? theme.space[400] : theme.space[600];
|
|
53
|
+
var reducedBottomPaddingVal = inline ? theme.space[300] : theme.space[500];
|
|
54
|
+
return "\n border-radius: ".concat(inline ? (0, element_core_1.numToPx)(theme.space[600]) : 0, ";\n background-color: ").concat(inverted ? theme.color.surface.dim : theme.color.surface.bright, ";\n padding: ").concat((0, element_core_1.numToPx)(paddingVal), ";\n padding-bottom: ").concat((0, element_core_1.numToPx)(reducedBottomPadding ? reducedBottomPaddingVal : paddingVal), ";\n overflow: hidden;\n border-width: 0;\n width: 100%;\n ");
|
|
55
55
|
});
|
|
56
56
|
var StyledCard = styled_native_1.default.View(function (_a) {
|
|
57
|
-
var
|
|
58
|
-
var paddingVal = inline ?
|
|
59
|
-
var reducedBottomPaddingVal = inline ?
|
|
60
|
-
return "\n border-radius: ".concat(inline ? (0, element_core_1.numToPx)(
|
|
57
|
+
var theme = _a.theme, inline = _a.inline, inverted = _a.inverted, reducedBottomPadding = _a.reducedBottomPadding;
|
|
58
|
+
var paddingVal = inline ? theme.space[400] : theme.space[600];
|
|
59
|
+
var reducedBottomPaddingVal = inline ? theme.space[300] : theme.space[500];
|
|
60
|
+
return "\n border-radius: ".concat(inline ? (0, element_core_1.numToPx)(theme.space[600]) : 0, ";\n background-color: ").concat(inverted ? theme.color.surface.onSurface : theme.color.surface.bright, ";\n padding: ").concat((0, element_core_1.numToPx)(paddingVal), ";\n padding-bottom: ").concat((0, element_core_1.numToPx)(reducedBottomPadding ? reducedBottomPaddingVal : paddingVal), ";\n overflow: hidden;\n border-width: 0;\n width: 100%;\n ");
|
|
61
61
|
});
|
|
62
62
|
var StyledP = (0, styled_native_1.default)(P_1.P)(function (_a) {
|
|
63
|
-
var
|
|
64
|
-
return "\n color: ".concat(inverted ?
|
|
63
|
+
var theme = _a.theme, inverted = _a.inverted;
|
|
64
|
+
return "\n color: ".concat(inverted ? theme.color.surface.bright : theme.color.surface.onSurface, ";\n");
|
|
65
65
|
});
|
|
66
66
|
var CloseIconWrapper = styled_native_1.default.View(function (_a) {
|
|
67
|
-
var
|
|
68
|
-
return "\n padding: ".concat((0, element_core_1.numToPx)(
|
|
67
|
+
var theme = _a.theme;
|
|
68
|
+
return "\n padding: ".concat((0, element_core_1.numToPx)(theme.space[200]), ";\n background-color: ").concat(theme.color.surface.bright, ";\n border-radius: ").concat((0, element_core_1.numToPx)(theme.space[600]), ";\n");
|
|
69
69
|
});
|
|
70
70
|
var ActionCard = function (_a) {
|
|
71
71
|
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;
|
|
72
|
-
var
|
|
72
|
+
var theme = (0, react_1.useContext)(styled_native_1.ThemeContext);
|
|
73
73
|
var hasSingleAction = (onPressActionButton && !onPressIndicator && !onPressCloseButton) ||
|
|
74
74
|
(onPressIndicator && !onPressActionButton && !onPressCloseButton);
|
|
75
75
|
var cardAction = hasSingleAction
|
|
@@ -84,16 +84,16 @@ var ActionCard = function (_a) {
|
|
|
84
84
|
}
|
|
85
85
|
}, []);
|
|
86
86
|
var Heading = inline ? __1.Heading3 : __1.Heading2;
|
|
87
|
-
var cardPadding =
|
|
87
|
+
var cardPadding = theme.space[inline ? 400 : 600];
|
|
88
88
|
var negativeMarginAdjustment = -cardPadding;
|
|
89
89
|
return ((0, jsx_runtime_1.jsxs)(RootContainer, __assign({}, (cardAction ? { onPress: cardAction } : {}), { inline: inline, inverted: inverted, reducedBottomPadding: Boolean(buttonTitle && !ctaVariant), testID: "".concat(testID, "-card"), accessibilityRole: cardAction ? 'button' : 'none', children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flexDirection: 'row' }, children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(__1.Stack, { spaceBetween: 2, children: [(0, jsx_runtime_1.jsx)(Heading, { style: {
|
|
90
90
|
color: inverted
|
|
91
|
-
?
|
|
92
|
-
:
|
|
91
|
+
? theme.color.surface.bright
|
|
92
|
+
: theme.color.brand.brand,
|
|
93
93
|
paddingRight: image || !onPressCloseButton ? 0 : cardPadding,
|
|
94
94
|
}, testID: "".concat(testID, "-heading"), children: title }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [typeof body === 'string' ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
95
95
|
paddingRight: !image && !title && onPressCloseButton ? cardPadding : 0,
|
|
96
|
-
}, children: (0, jsx_runtime_1.jsx)(StyledP, { inverted: inverted, children: body }) })) : (body), buttonTitle && onPressActionButton && !onPressIndicator ? (!ctaVariant ? ((0, jsx_runtime_1.jsx)(__1.Margin, { top: 2, children: (0, jsx_runtime_1.jsx)(__1.Action, {
|
|
96
|
+
}, children: (0, jsx_runtime_1.jsx)(StyledP, { inverted: inverted, children: body }) })) : (body), buttonTitle && onPressActionButton && !onPressIndicator ? (!ctaVariant ? ((0, jsx_runtime_1.jsx)(__1.Margin, { top: 2, children: (0, jsx_runtime_1.jsx)(__1.Action, { standalone: true, onPress: onPressActionButton, testID: "".concat(testID, "-button"), iconRight: actionIconName, inverted: inverted, children: buttonTitle }) })) : ((0, jsx_runtime_1.jsx)(__1.Margin, { top: 4, children: (0, jsx_runtime_1.jsx)(__1.Button, { onPress: onPressActionButton, testID: "".concat(testID, "-button"), variant: ctaVariant, inverted: inverted, children: buttonTitle }) }))) : null] })] }) }), image ? ((0, jsx_runtime_1.jsx)(masked_view_1.default, { style: {
|
|
97
97
|
flex: 1,
|
|
98
98
|
flexDirection: 'row',
|
|
99
99
|
height: '100%',
|
|
@@ -122,10 +122,10 @@ var ActionCard = function (_a) {
|
|
|
122
122
|
position: 'absolute',
|
|
123
123
|
right: inline ? 8 : 6,
|
|
124
124
|
bottom: 16,
|
|
125
|
-
}, color:
|
|
125
|
+
}, color: theme.color.surface.bright, name: "chevron-right", accessibilityLabel: "chevron-right" })] })) : null] }), onPressCloseButton && !onPressIndicator ? ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { style: {
|
|
126
126
|
position: 'absolute',
|
|
127
|
-
right:
|
|
128
|
-
top:
|
|
129
|
-
}, onPress: onPressCloseButton, testID: "".concat(testID, "-close-button"), children: (0, jsx_runtime_1.jsx)(CloseIconWrapper, { inverted: inverted, children: (0, jsx_runtime_1.jsx)(__1.Icon, { name: "cross", size: "16", color:
|
|
127
|
+
right: theme.space[200],
|
|
128
|
+
top: theme.space[200],
|
|
129
|
+
}, onPress: onPressCloseButton, testID: "".concat(testID, "-close-button"), children: (0, jsx_runtime_1.jsx)(CloseIconWrapper, { inverted: inverted, children: (0, jsx_runtime_1.jsx)(__1.Icon, { name: "cross", size: "16", color: theme.color.surface.onSurface }) }) })) : null] })));
|
|
130
130
|
};
|
|
131
131
|
exports.ActionCard = ActionCard;
|
|
@@ -31,8 +31,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
31
31
|
var react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
32
32
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
33
33
|
var StyledPath = (0, styled_native_1.default)(react_native_svg_1.Path)(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
return "\n fill: ".concat(color !== null && color !== void 0 ? color :
|
|
34
|
+
var theme = _a.theme, color = _a.color;
|
|
35
|
+
return "\n fill: ".concat(color !== null && color !== void 0 ? color : theme.color.brand.brand, "\n");
|
|
36
36
|
});
|
|
37
37
|
var CloseIconShape = function (_a) {
|
|
38
38
|
var color = _a.color;
|
|
@@ -31,8 +31,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
31
31
|
var react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
32
32
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
33
33
|
var StyledPath = (0, styled_native_1.default)(react_native_svg_1.Path)(function (_a) {
|
|
34
|
-
var
|
|
35
|
-
return "\n fill: ".concat(color !== null && color !== void 0 ? color :
|
|
34
|
+
var theme = _a.theme, color = _a.color;
|
|
35
|
+
return "\n fill: ".concat(color !== null && color !== void 0 ? color : theme.color.brand.brand, "\n");
|
|
36
36
|
});
|
|
37
37
|
var IndicatorIconShape = function (_a) {
|
|
38
38
|
var color = _a.color;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { ComponentProps, PropsWithChildren, Ref } from 'react';
|
|
2
2
|
import { AccessibilityRole, View, ViewProps } from 'react-native';
|
|
3
3
|
import { IconName } from '../../providers';
|
|
4
|
+
import { SemanticVariants } from '../Badge';
|
|
4
5
|
import { StyledActionList } from './styled';
|
|
5
|
-
type ActionListProps = ComponentProps<typeof StyledActionList
|
|
6
|
+
type ActionListProps = ComponentProps<typeof StyledActionList> & {
|
|
7
|
+
inverted?: boolean;
|
|
8
|
+
borderBottom?: boolean;
|
|
9
|
+
};
|
|
6
10
|
type ActionProps = PropsWithChildren<ViewProps & {
|
|
7
11
|
accessibilityRole?: AccessibilityRole;
|
|
8
12
|
accessibilityLabel?: string;
|
|
@@ -10,14 +14,16 @@ type ActionProps = PropsWithChildren<ViewProps & {
|
|
|
10
14
|
iconLeft?: IconName;
|
|
11
15
|
iconRight?: IconName;
|
|
12
16
|
inverted?: boolean;
|
|
13
|
-
inline?: boolean;
|
|
14
17
|
onPress?: () => void;
|
|
15
18
|
fullWidth?: boolean;
|
|
16
19
|
ref?: Ref<View>;
|
|
17
20
|
testID?: string;
|
|
18
21
|
inList?: boolean;
|
|
19
22
|
standalone?: boolean;
|
|
23
|
+
badgeText?: string;
|
|
24
|
+
badgeVariant?: SemanticVariants;
|
|
25
|
+
hint?: string;
|
|
20
26
|
}>;
|
|
21
|
-
declare const ActionList: ({ children, inverted, ...rest }: ActionListProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare const ActionList: ({ children, inverted, borderBottom, ...rest }: ActionListProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
28
|
declare const Action: import("react").ForwardRefExoticComponent<Omit<ActionProps, "ref"> & import("react").RefAttributes<View>>;
|
|
23
29
|
export { ActionList, Action };
|
|
@@ -28,9 +28,10 @@ var react_1 = require("react");
|
|
|
28
28
|
var react_native_1 = require("react-native");
|
|
29
29
|
var hooks_1 = require("../../hooks");
|
|
30
30
|
var utils_1 = require("../../utils");
|
|
31
|
+
var Badge_1 = require("../Badge");
|
|
31
32
|
var styled_1 = require("./styled");
|
|
32
33
|
var ActionList = function (_a) {
|
|
33
|
-
var children = _a.children, inverted = _a.inverted, rest = __rest(_a, ["children", "inverted"]);
|
|
34
|
+
var children = _a.children, inverted = _a.inverted, borderBottom = _a.borderBottom, rest = __rest(_a, ["children", "inverted", "borderBottom"]);
|
|
34
35
|
var validChildren = (0, utils_1.getValidChildren)(children);
|
|
35
36
|
var childCount = react_1.Children.count(validChildren);
|
|
36
37
|
return ((0, jsx_runtime_1.jsx)(styled_1.StyledActionList, __assign({}, rest, { children: react_1.Children.map(validChildren, function (child, index) {
|
|
@@ -38,7 +39,7 @@ var ActionList = function (_a) {
|
|
|
38
39
|
return (0, react_1.cloneElement)(child, {
|
|
39
40
|
fullWidth: true,
|
|
40
41
|
index: index,
|
|
41
|
-
hasBorder: childCount > 1 && index !== childCount - 1,
|
|
42
|
+
hasBorder: (childCount > 1 && index !== childCount - 1) || borderBottom,
|
|
42
43
|
inverted: (_a = child.props.inverted) !== null && _a !== void 0 ? _a : inverted, // prioritise child prop
|
|
43
44
|
inList: true,
|
|
44
45
|
iconRight: (_b = child.props.iconRight) !== null && _b !== void 0 ? _b : 'chevron-right-small',
|
|
@@ -47,12 +48,12 @@ var ActionList = function (_a) {
|
|
|
47
48
|
};
|
|
48
49
|
exports.ActionList = ActionList;
|
|
49
50
|
var ActionWrapper = (0, react_1.forwardRef)(function (_a, ref) {
|
|
50
|
-
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,
|
|
51
|
-
return ((0, jsx_runtime_1.jsx)(styled_1.StyledActionWrapper, __assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID }, rest, { children: (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, {
|
|
51
|
+
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"]);
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(styled_1.StyledActionWrapper, __assign({ ref: ref, hasBorder: hasBorder, inverted: inverted, testID: testID, inList: inList }, rest, { children: (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { activeOpacity: activeOpacity, accessible: true, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, onPress: onPress, children: (0, jsx_runtime_1.jsx)(styled_1.StyledActionInner, { fullWidth: fullWidth, inList: inList, standalone: standalone, children: children }) }) })));
|
|
52
53
|
});
|
|
53
54
|
var Action = (0, react_1.forwardRef)(function (_a, ref) {
|
|
54
|
-
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,
|
|
55
|
+
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"]);
|
|
55
56
|
var smallAndUp = (0, hooks_1.useBreakpoint)().smallAndUp;
|
|
56
|
-
return ((0, jsx_runtime_1.jsxs)(ActionWrapper, __assign({ ref: ref, accessibilityRole: accessibilityRole, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, fullWidth: fullWidth, inverted: inverted,
|
|
57
|
+
return ((0, jsx_runtime_1.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 ? ((0, jsx_runtime_1.jsx)(styled_1.StyledLeftIcon, { inverted: inverted, name: iconLeft, size: 16 })) : null, (0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [typeof children === 'string' ? ((0, jsx_runtime_1.jsxs)(styled_1.StyledTextWrapper, { children: [(0, jsx_runtime_1.jsx)(styled_1.StyledActionText, { smallAndUp: smallAndUp, inverted: inverted, children: children }), badgeText ? ((0, jsx_runtime_1.jsx)(Badge_1.Badge, { variant: badgeVariant, children: badgeText })) : null] })) : ((0, jsx_runtime_1.jsx)(styled_1.StyledActionNodeWrapper, { children: children })), hint ? ((0, jsx_runtime_1.jsx)(styled_1.StyledHintText, { inverted: inverted, children: hint })) : null] }), iconRight ? ((0, jsx_runtime_1.jsx)(styled_1.StyledRightIcon, { inverted: inverted, name: iconRight, size: 16 })) : null] })));
|
|
57
58
|
});
|
|
58
59
|
exports.Action = Action;
|