@telus-uds/components-web 2.21.2 → 2.22.0
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/CHANGELOG.md +13 -2
- package/lib/Badge/Badge.js +2 -14
- package/lib/Badge/index.js +0 -3
- package/lib/BlockQuote/BlockQuote.js +4 -25
- package/lib/BlockQuote/index.js +0 -3
- package/lib/Breadcrumbs/Breadcrumbs.js +9 -36
- package/lib/Breadcrumbs/Item/Item.js +15 -25
- package/lib/Breadcrumbs/index.js +0 -2
- package/lib/Callout/Callout.js +2 -24
- package/lib/Callout/index.js +0 -3
- package/lib/Card/Card.js +15 -29
- package/lib/Card/CardContent.js +5 -18
- package/lib/Card/CardFooter.js +7 -19
- package/lib/Card/index.js +0 -3
- package/lib/Countdown/Countdown.js +5 -24
- package/lib/Countdown/Segment.js +3 -15
- package/lib/Countdown/index.js +0 -3
- package/lib/Countdown/types.js +2 -7
- package/lib/Countdown/useCountdown.js +0 -7
- package/lib/DatePicker/CalendarContainer.js +0 -5
- package/lib/DatePicker/DatePicker.js +9 -61
- package/lib/DatePicker/dictionary.js +0 -8
- package/lib/DatePicker/index.js +0 -3
- package/lib/DatePicker/reactDatesCss.js +0 -2
- package/lib/Disclaimer/Disclaimer.js +5 -14
- package/lib/Disclaimer/index.js +0 -2
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +6 -17
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +12 -25
- package/lib/ExpandCollapseMini/index.js +0 -3
- package/lib/Footnote/Footnote.js +17 -63
- package/lib/Footnote/FootnoteLink.js +3 -24
- package/lib/Footnote/index.js +0 -4
- package/lib/IconButton/IconButton.js +4 -14
- package/lib/IconButton/index.js +0 -3
- package/lib/Image/Image.js +5 -24
- package/lib/Image/index.js +0 -3
- package/lib/List/List.js +0 -2
- package/lib/List/ListItem.js +0 -8
- package/lib/List/index.js +0 -4
- package/lib/NavigationBar/NavigationBar.js +10 -35
- package/lib/NavigationBar/NavigationItem.js +5 -17
- package/lib/NavigationBar/NavigationSubMenu.js +3 -19
- package/lib/NavigationBar/collapseItems.js +6 -9
- package/lib/NavigationBar/index.js +0 -3
- package/lib/NavigationBar/resolveItemSelection.js +2 -3
- package/lib/OptimizeImage/OptimizeImage.js +6 -27
- package/lib/OptimizeImage/index.js +0 -3
- package/lib/OptimizeImage/utils/getFallbackUrl.js +0 -4
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +0 -8
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -5
- package/lib/OptimizeImage/utils/index.js +0 -4
- package/lib/OptimizeImage/utils/isSvgUrl.js +0 -1
- package/lib/OrderedList/Item.js +4 -21
- package/lib/OrderedList/ItemBase.js +2 -9
- package/lib/OrderedList/OrderedList.js +11 -22
- package/lib/OrderedList/OrderedListBase.js +3 -13
- package/lib/OrderedList/index.js +0 -4
- package/lib/Paragraph/Paragraph.js +3 -18
- package/lib/Paragraph/index.js +0 -3
- package/lib/PreviewCard/AuthorDate.js +1 -10
- package/lib/PreviewCard/PreviewCard.js +15 -35
- package/lib/PreviewCard/index.js +0 -3
- package/lib/PriceLockup/PriceLockup.js +78 -75
- package/lib/PriceLockup/index.js +0 -3
- package/lib/PriceLockup/tokens.js +0 -2
- package/lib/Progress/ProgressBar.js +5 -16
- package/lib/Progress/index.js +0 -4
- package/lib/QuantitySelector/QuantitySelector.js +8 -42
- package/lib/QuantitySelector/SideButton.js +4 -11
- package/lib/QuantitySelector/index.js +0 -3
- package/lib/QuantitySelector/styles.js +0 -6
- package/lib/ResponsiveImage/ResponsiveImage.js +5 -20
- package/lib/ResponsiveImage/index.js +0 -3
- package/lib/Ribbon/Ribbon.js +4 -20
- package/lib/Ribbon/index.js +0 -3
- package/lib/SkeletonProvider/SkeletonImage.js +0 -10
- package/lib/SkeletonProvider/SkeletonProvider.js +4 -22
- package/lib/SkeletonProvider/SkeletonTypography.js +0 -10
- package/lib/SkeletonProvider/index.js +0 -3
- package/lib/Span/Span.js +3 -17
- package/lib/Span/index.js +0 -3
- package/lib/Spinner/Spinner.js +11 -39
- package/lib/Spinner/SpinnerContent.js +2 -18
- package/lib/Spinner/index.js +0 -3
- package/lib/StoryCard/StoryCard.js +11 -31
- package/lib/StoryCard/index.js +0 -3
- package/lib/Table/Body.js +0 -6
- package/lib/Table/Cell.js +4 -24
- package/lib/Table/Header.js +0 -9
- package/lib/Table/Row.js +0 -8
- package/lib/Table/SubHeading.js +0 -9
- package/lib/Table/Table.js +5 -23
- package/lib/Table/index.js +0 -8
- package/lib/TermsAndConditions/ExpandCollapse.js +4 -14
- package/lib/TermsAndConditions/TermsAndConditions.js +7 -29
- package/lib/TermsAndConditions/index.js +0 -2
- package/lib/Testimonial/Testimonial.js +2 -26
- package/lib/Testimonial/index.js +0 -3
- package/lib/Toast/Toast.js +4 -25
- package/lib/Toast/index.js +0 -3
- package/lib/Video/ControlBar/ControlBar.js +2 -25
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -17
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -20
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -26
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -23
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +2 -12
- package/lib/Video/Video.js +122 -194
- package/lib/Video/index.js +0 -3
- package/lib/VideoPicker/VideoPicker.js +6 -32
- package/lib/VideoPicker/VideoPickerPlayer.js +2 -10
- package/lib/VideoPicker/VideoPickerThumbnail.js +7 -28
- package/lib/VideoPicker/VideoSlider.js +7 -17
- package/lib/VideoPicker/index.js +0 -3
- package/lib/VideoPicker/videoPropType.js +2 -8
- package/lib/WaffleGrid/WaffleGrid.js +11 -28
- package/lib/WaffleGrid/index.js +0 -3
- package/lib/WebPortal/WebPortal.js +1 -5
- package/lib/WebPortal/index.js +0 -3
- package/lib/WebVideo/WebVideo.js +4 -30
- package/lib/WebVideo/index.js +0 -3
- package/lib/baseExports.js +6 -1
- package/lib/index.js +0 -49
- package/lib/shared/FullBleedContent/FullBleedContent.js +5 -17
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -11
- package/lib/shared/FullBleedContent/index.js +0 -5
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +1 -12
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +2 -12
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -23
- package/lib/shared/VideoSplash/VideoSplash.js +4 -17
- package/lib/shared/VideoSplash/helpers.js +0 -6
- package/lib/utils/index.js +0 -9
- package/lib/utils/logger.js +0 -6
- package/lib/utils/media.js +2 -11
- package/lib/utils/renderStructuredContent.js +14 -31
- package/lib/utils/ssr.js +0 -6
- package/lib/utils/transforms.js +0 -2
- package/lib/utils/useOverlaidPosition.js +6 -28
- package/lib/utils/useTypographyTheme.js +4 -5
- package/lib-module/Badge/Badge.js +2 -5
- package/lib-module/BlockQuote/BlockQuote.js +4 -15
- package/lib-module/Breadcrumbs/Breadcrumbs.js +9 -25
- package/lib-module/Breadcrumbs/Item/Item.js +15 -12
- package/lib-module/Callout/Callout.js +2 -16
- package/lib-module/Card/Card.js +14 -17
- package/lib-module/Card/CardContent.js +5 -8
- package/lib-module/Card/CardFooter.js +7 -9
- package/lib-module/Countdown/Countdown.js +6 -11
- package/lib-module/Countdown/Segment.js +6 -8
- package/lib-module/Countdown/types.js +2 -1
- package/lib-module/Countdown/useCountdown.js +0 -6
- package/lib-module/DatePicker/CalendarContainer.js +3 -1
- package/lib-module/DatePicker/DatePicker.js +9 -39
- package/lib-module/DatePicker/dictionary.js +0 -8
- package/lib-module/Disclaimer/Disclaimer.js +5 -4
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +6 -8
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +13 -19
- package/lib-module/Footnote/Footnote.js +17 -41
- package/lib-module/Footnote/FootnoteLink.js +3 -12
- package/lib-module/IconButton/IconButton.js +4 -6
- package/lib-module/Image/Image.js +5 -14
- package/lib-module/NavigationBar/NavigationBar.js +10 -20
- package/lib-module/NavigationBar/NavigationItem.js +5 -5
- package/lib-module/NavigationBar/NavigationSubMenu.js +3 -8
- package/lib-module/NavigationBar/collapseItems.js +6 -8
- package/lib-module/NavigationBar/resolveItemSelection.js +2 -2
- package/lib-module/OptimizeImage/OptimizeImage.js +6 -16
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -1
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -5
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +1 -5
- package/lib-module/OrderedList/Item.js +4 -7
- package/lib-module/OrderedList/ItemBase.js +2 -3
- package/lib-module/OrderedList/OrderedList.js +11 -9
- package/lib-module/OrderedList/OrderedListBase.js +3 -3
- package/lib-module/Paragraph/Paragraph.js +3 -8
- package/lib-module/PreviewCard/AuthorDate.js +1 -4
- package/lib-module/PreviewCard/PreviewCard.js +16 -19
- package/lib-module/PriceLockup/PriceLockup.js +78 -57
- package/lib-module/Progress/ProgressBar.js +7 -8
- package/lib-module/QuantitySelector/QuantitySelector.js +8 -30
- package/lib-module/QuantitySelector/SideButton.js +4 -6
- package/lib-module/ResponsiveImage/ResponsiveImage.js +5 -12
- package/lib-module/Ribbon/Ribbon.js +4 -9
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -5
- package/lib-module/SkeletonProvider/SkeletonProvider.js +4 -12
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -5
- package/lib-module/Span/Span.js +3 -7
- package/lib-module/Spinner/Spinner.js +11 -24
- package/lib-module/Spinner/SpinnerContent.js +2 -8
- package/lib-module/StoryCard/StoryCard.js +12 -17
- package/lib-module/Table/Body.js +0 -2
- package/lib-module/Table/Cell.js +4 -14
- package/lib-module/Table/Header.js +0 -2
- package/lib-module/Table/Row.js +0 -2
- package/lib-module/Table/SubHeading.js +0 -2
- package/lib-module/Table/Table.js +5 -6
- package/lib-module/TermsAndConditions/ExpandCollapse.js +4 -2
- package/lib-module/TermsAndConditions/TermsAndConditions.js +7 -9
- package/lib-module/Testimonial/Testimonial.js +2 -11
- package/lib-module/Toast/Toast.js +4 -15
- package/lib-module/Video/ControlBar/ControlBar.js +2 -9
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -8
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -8
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -13
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -10
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +2 -3
- package/lib-module/Video/Video.js +122 -173
- package/lib-module/VideoPicker/VideoPicker.js +6 -15
- package/lib-module/VideoPicker/VideoPickerPlayer.js +2 -3
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +7 -13
- package/lib-module/VideoPicker/VideoSlider.js +6 -9
- package/lib-module/VideoPicker/videoPropType.js +2 -1
- package/lib-module/WaffleGrid/WaffleGrid.js +11 -15
- package/lib-module/WebPortal/WebPortal.js +1 -1
- package/lib-module/WebVideo/WebVideo.js +4 -15
- package/lib-module/baseExports.js +3 -2
- package/lib-module/index.js +0 -1
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +5 -10
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -10
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +1 -11
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +2 -3
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -12
- package/lib-module/shared/VideoSplash/VideoSplash.js +4 -4
- package/lib-module/utils/logger.js +2 -2
- package/lib-module/utils/media.js +2 -9
- package/lib-module/utils/renderStructuredContent.js +14 -25
- package/lib-module/utils/ssr.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +8 -27
- package/lib-module/utils/useTypographyTheme.js +4 -4
- package/package.json +3 -3
- package/src/PriceLockup/PriceLockup.jsx +36 -11
- package/src/baseExports.js +1 -0
- package/src/index.js +0 -1
- package/lib/Modal/Modal.js +0 -146
- package/lib/Modal/ModalContent.js +0 -203
- package/lib/Modal/index.js +0 -13
- package/lib-module/Modal/Modal.js +0 -132
- package/lib-module/Modal/ModalContent.js +0 -181
- package/lib-module/Modal/index.js +0 -2
- package/src/Modal/Modal.jsx +0 -121
- package/src/Modal/ModalContent.jsx +0 -167
- package/src/Modal/index.js +0 -3
package/lib/Modal/Modal.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _ModalContent = _interopRequireDefault(require("./ModalContent"));
|
|
15
|
-
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
const Modal = _ref => {
|
|
21
|
-
let {
|
|
22
|
-
children,
|
|
23
|
-
isOpen,
|
|
24
|
-
onClose,
|
|
25
|
-
maxWidth,
|
|
26
|
-
onCancel = onClose,
|
|
27
|
-
onConfirm,
|
|
28
|
-
heading,
|
|
29
|
-
headingLevel,
|
|
30
|
-
subHeading,
|
|
31
|
-
subHeadingSize,
|
|
32
|
-
bodyText,
|
|
33
|
-
tokens,
|
|
34
|
-
variant = {},
|
|
35
|
-
confirmButtonText,
|
|
36
|
-
confirmButtonVariant,
|
|
37
|
-
cancelButtonText,
|
|
38
|
-
cancelButtonType,
|
|
39
|
-
...nonContentProps
|
|
40
|
-
} = _ref;
|
|
41
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Modal, {
|
|
42
|
-
isOpen: isOpen,
|
|
43
|
-
onClose: onClose,
|
|
44
|
-
variant: variant,
|
|
45
|
-
maxWidth: maxWidth,
|
|
46
|
-
...nonContentProps,
|
|
47
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalContent.default, {
|
|
48
|
-
tokens: tokens,
|
|
49
|
-
variant: variant,
|
|
50
|
-
onCancel: onCancel,
|
|
51
|
-
onConfirm: onConfirm,
|
|
52
|
-
heading: heading,
|
|
53
|
-
headingLevel: headingLevel,
|
|
54
|
-
subHeading: subHeading,
|
|
55
|
-
subHeadingSize: subHeadingSize,
|
|
56
|
-
bodyText: bodyText,
|
|
57
|
-
confirmButtonText: confirmButtonText,
|
|
58
|
-
confirmButtonVariant: confirmButtonVariant,
|
|
59
|
-
cancelButtonText: cancelButtonText,
|
|
60
|
-
cancelButtonType: cancelButtonType,
|
|
61
|
-
children: children
|
|
62
|
-
})
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
Modal.propTypes = {
|
|
67
|
-
children: _propTypes.default.node,
|
|
68
|
-
tokens: _propTypes.default.object,
|
|
69
|
-
variant: _propTypes.default.object,
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* If true, the modal overlay covers the page and the modal content is shown
|
|
73
|
-
*/
|
|
74
|
-
isOpen: _propTypes.default.bool,
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Function called on pressing the Modal close "x" button
|
|
78
|
-
*/
|
|
79
|
-
onClose: _propTypes.default.func,
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* If true, Modal is rendered with the 'maxWidth' appearance applied.
|
|
83
|
-
* Use this for wider content, such as content with long headers.
|
|
84
|
-
*/
|
|
85
|
-
maxWidth: _propTypes.default.bool,
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Heading text shown prominently with heading semantic tags.
|
|
89
|
-
*/
|
|
90
|
-
heading: _propTypes.default.string,
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Stylistic size and semantic level of the modal heading
|
|
94
|
-
*/
|
|
95
|
-
headingLevel: _propTypes.default.oneOf(['h3', 'h4']),
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Short content rendered below the heading. If there is long body content that is scrollable,
|
|
99
|
-
* the subHeading sits above the scrollable area.
|
|
100
|
-
*/
|
|
101
|
-
subHeading: _propTypes.default.string,
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Short content rendered below the heading. If there is long body content that is scrollable,
|
|
105
|
-
* the subHeading sits above the scrollable area.
|
|
106
|
-
*/
|
|
107
|
-
subHeadingSize: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* If the modal requires longer text, include it here. This text will become scrollable if it
|
|
111
|
-
* is too long for the allowed height of the modal.
|
|
112
|
-
*/
|
|
113
|
-
bodyText: _propTypes.default.string,
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Text for the button controlling the primary action of the modal.
|
|
117
|
-
*/
|
|
118
|
-
confirmButtonText: _propTypes.default.string,
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Button variant object to be passed through to Button to choose its visual style.
|
|
122
|
-
*/
|
|
123
|
-
confirmButtonVariant: _propTypes.default.object,
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Action on pressing the confirm button.
|
|
127
|
-
*/
|
|
128
|
-
onConfirm: _propTypes.default.func,
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Text for the optional cancel button provided if the user does not want to do the confirm action.
|
|
132
|
-
*/
|
|
133
|
-
cancelButtonText: _propTypes.default.string,
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Component to use for the cancel button (default: `TextButton`). Should accept similar props to `TextButton`.
|
|
137
|
-
*/
|
|
138
|
-
cancelButtonType: _propTypes.default.elementType,
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Action to perform on pressing the cancel button. Defaults to `onClose` action if undefined.
|
|
142
|
-
*/
|
|
143
|
-
onCancel: _propTypes.default.func
|
|
144
|
-
};
|
|
145
|
-
var _default = Modal;
|
|
146
|
-
exports.default = _default;
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
|
-
const StyledModalContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
25
|
-
displayName: "ModalContent__StyledModalContent",
|
|
26
|
-
componentId: "components-web__sc-k40cwb-0"
|
|
27
|
-
})(["display:flex;flex-direction:column;min-height:100%;"]);
|
|
28
|
-
|
|
29
|
-
const StyledHeading = /*#__PURE__*/_styledComponents.default.header.withConfig({
|
|
30
|
-
displayName: "ModalContent__StyledHeading",
|
|
31
|
-
componentId: "components-web__sc-k40cwb-1"
|
|
32
|
-
})(["display:flex;flex-direction:column;padding-right:", "px;"], _ref => {
|
|
33
|
-
let {
|
|
34
|
-
paddingRight
|
|
35
|
-
} = _ref;
|
|
36
|
-
return paddingRight;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const StyledSubHeading = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
40
|
-
displayName: "ModalContent__StyledSubHeading",
|
|
41
|
-
componentId: "components-web__sc-k40cwb-2"
|
|
42
|
-
})(["margin-top:", "px;"], _ref2 => {
|
|
43
|
-
let {
|
|
44
|
-
marginTop
|
|
45
|
-
} = _ref2;
|
|
46
|
-
return marginTop;
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const StyledTextButtonContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
50
|
-
displayName: "ModalContent__StyledTextButtonContainer",
|
|
51
|
-
componentId: "components-web__sc-k40cwb-3"
|
|
52
|
-
})({
|
|
53
|
-
display: 'flex'
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const StyledFooter = /*#__PURE__*/_styledComponents.default.footer.withConfig({
|
|
57
|
-
displayName: "ModalContent__StyledFooter",
|
|
58
|
-
componentId: "components-web__sc-k40cwb-4"
|
|
59
|
-
})(_ref3 => {
|
|
60
|
-
let {
|
|
61
|
-
hasBorder,
|
|
62
|
-
viewport,
|
|
63
|
-
paddingLeft,
|
|
64
|
-
paddingRight,
|
|
65
|
-
paddingTop,
|
|
66
|
-
marginLeft,
|
|
67
|
-
marginRight,
|
|
68
|
-
borderColor,
|
|
69
|
-
gap
|
|
70
|
-
} = _ref3;
|
|
71
|
-
return {
|
|
72
|
-
display: 'flex',
|
|
73
|
-
flexDirection: viewport === 'xs' || viewport === 'sm' ? 'column' : 'row',
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
gap: `${gap}px`,
|
|
76
|
-
marginLeft: `calc(-1 * ${marginLeft}px)`,
|
|
77
|
-
marginRight: `calc(-1 * ${marginRight}px)`,
|
|
78
|
-
paddingLeft: `${paddingLeft}px`,
|
|
79
|
-
paddingRight: `${paddingRight}px`,
|
|
80
|
-
paddingTop: `${paddingTop}px`,
|
|
81
|
-
borderTop: hasBorder ? `1px solid ${borderColor}` : 'none'
|
|
82
|
-
};
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const ModalContent = _ref4 => {
|
|
86
|
-
let {
|
|
87
|
-
heading,
|
|
88
|
-
headingLevel = 'h3',
|
|
89
|
-
subHeading,
|
|
90
|
-
subHeadingSize = 'medium',
|
|
91
|
-
bodyText,
|
|
92
|
-
confirmButtonText,
|
|
93
|
-
confirmButtonVariant = {
|
|
94
|
-
priority: 'high'
|
|
95
|
-
},
|
|
96
|
-
onConfirm,
|
|
97
|
-
tokens,
|
|
98
|
-
variant,
|
|
99
|
-
cancelButtonText,
|
|
100
|
-
cancelButtonType: CancelButton = _componentsBase.TextButton,
|
|
101
|
-
children,
|
|
102
|
-
onCancel
|
|
103
|
-
} = _ref4;
|
|
104
|
-
const {
|
|
105
|
-
headingColor,
|
|
106
|
-
cancelButtonColor,
|
|
107
|
-
...themeTokens
|
|
108
|
-
} = (0, _componentsBase.useThemeTokens)('Modal', tokens, variant);
|
|
109
|
-
const [scrollContainerHeight, setScrollContainerHeight] = (0, _react.useState)(0);
|
|
110
|
-
const [scrollContentHeight, setScrollContentHeight] = (0, _react.useState)(0);
|
|
111
|
-
const viewport = (0, _componentsBase.useViewport)();
|
|
112
|
-
|
|
113
|
-
const handleContainerLayout = _ref5 => {
|
|
114
|
-
let {
|
|
115
|
-
nativeEvent: {
|
|
116
|
-
layout: {
|
|
117
|
-
height
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
} = _ref5;
|
|
121
|
-
return setScrollContainerHeight(height);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const onContentSizeChange = (_, height) => setScrollContentHeight(height);
|
|
125
|
-
|
|
126
|
-
const isContentOverflowing = scrollContentHeight > scrollContainerHeight;
|
|
127
|
-
const hasConfirmButton = confirmButtonText !== undefined && onConfirm !== undefined;
|
|
128
|
-
const hasCancelButton = cancelButtonText !== undefined && onCancel !== undefined;
|
|
129
|
-
const hasHeadingSection = Boolean(heading || subHeading);
|
|
130
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledModalContent, {
|
|
131
|
-
children: [hasHeadingSection && /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledHeading, {
|
|
132
|
-
paddingRight: themeTokens.headingPaddingRight,
|
|
133
|
-
children: [heading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
134
|
-
variant: {
|
|
135
|
-
size: headingLevel
|
|
136
|
-
},
|
|
137
|
-
tokens: {
|
|
138
|
-
color: headingColor
|
|
139
|
-
},
|
|
140
|
-
heading: headingLevel,
|
|
141
|
-
children: heading
|
|
142
|
-
}), subHeading && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSubHeading, {
|
|
143
|
-
marginTop: themeTokens.subHeadingMarginTop,
|
|
144
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
145
|
-
variant: {
|
|
146
|
-
size: subHeadingSize
|
|
147
|
-
},
|
|
148
|
-
children: subHeading
|
|
149
|
-
})
|
|
150
|
-
}), Boolean(bodyText && hasHeadingSection) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
|
|
151
|
-
space: 3
|
|
152
|
-
})]
|
|
153
|
-
}), bodyText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Box, {
|
|
154
|
-
scroll: {
|
|
155
|
-
onContentSizeChange,
|
|
156
|
-
showsVerticalScrollIndicator: true
|
|
157
|
-
},
|
|
158
|
-
onLayout: handleContainerLayout,
|
|
159
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
160
|
-
children: bodyText
|
|
161
|
-
})
|
|
162
|
-
}), children, (hasConfirmButton || hasCancelButton) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledFooter, { ...themeTokens,
|
|
163
|
-
hasBorder: isContentOverflowing,
|
|
164
|
-
viewport: viewport,
|
|
165
|
-
children: [hasConfirmButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Button, {
|
|
166
|
-
variant: confirmButtonVariant,
|
|
167
|
-
tokens: {
|
|
168
|
-
width: viewport === 'xs' || viewport === 'sm' ? '100%' : undefined
|
|
169
|
-
},
|
|
170
|
-
onPress: onConfirm,
|
|
171
|
-
children: confirmButtonText
|
|
172
|
-
}), hasCancelButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTextButtonContainer, {
|
|
173
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CancelButton, {
|
|
174
|
-
tokens: {
|
|
175
|
-
color: cancelButtonColor
|
|
176
|
-
},
|
|
177
|
-
onPress: onCancel,
|
|
178
|
-
children: cancelButtonText
|
|
179
|
-
})
|
|
180
|
-
}) : null]
|
|
181
|
-
})]
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
ModalContent.propTypes = {
|
|
186
|
-
tokens: _propTypes.default.object,
|
|
187
|
-
variant: _propTypes.default.object,
|
|
188
|
-
heading: _propTypes.default.string,
|
|
189
|
-
headingLevel: _propTypes.default.oneOf(['h3', 'h4']),
|
|
190
|
-
subHeading: _propTypes.default.string,
|
|
191
|
-
subHeadingSize: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
192
|
-
bodyText: _propTypes.default.string,
|
|
193
|
-
confirmButtonText: _propTypes.default.string,
|
|
194
|
-
confirmButtonVariant: _propTypes.default.object,
|
|
195
|
-
onConfirm: _propTypes.default.func,
|
|
196
|
-
cancelButtonText: _propTypes.default.string,
|
|
197
|
-
cancelButtonType: _propTypes.default.elementType,
|
|
198
|
-
// TODO: figure out a way of passing an icon to the TextButton
|
|
199
|
-
children: _propTypes.default.node,
|
|
200
|
-
onCancel: _propTypes.default.func
|
|
201
|
-
};
|
|
202
|
-
var _default = ModalContent;
|
|
203
|
-
exports.default = _default;
|
package/lib/Modal/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
var _default = _Modal.default;
|
|
13
|
-
exports.default = _default;
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Modal as BaseModal } from '@telus-uds/components-base';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import ModalContent from './ModalContent';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
const Modal = _ref => {
|
|
8
|
-
let {
|
|
9
|
-
children,
|
|
10
|
-
isOpen,
|
|
11
|
-
onClose,
|
|
12
|
-
maxWidth,
|
|
13
|
-
onCancel = onClose,
|
|
14
|
-
onConfirm,
|
|
15
|
-
heading,
|
|
16
|
-
headingLevel,
|
|
17
|
-
subHeading,
|
|
18
|
-
subHeadingSize,
|
|
19
|
-
bodyText,
|
|
20
|
-
tokens,
|
|
21
|
-
variant = {},
|
|
22
|
-
confirmButtonText,
|
|
23
|
-
confirmButtonVariant,
|
|
24
|
-
cancelButtonText,
|
|
25
|
-
cancelButtonType,
|
|
26
|
-
...nonContentProps
|
|
27
|
-
} = _ref;
|
|
28
|
-
return /*#__PURE__*/_jsx(BaseModal, {
|
|
29
|
-
isOpen: isOpen,
|
|
30
|
-
onClose: onClose,
|
|
31
|
-
variant: variant,
|
|
32
|
-
maxWidth: maxWidth,
|
|
33
|
-
...nonContentProps,
|
|
34
|
-
children: /*#__PURE__*/_jsx(ModalContent, {
|
|
35
|
-
tokens: tokens,
|
|
36
|
-
variant: variant,
|
|
37
|
-
onCancel: onCancel,
|
|
38
|
-
onConfirm: onConfirm,
|
|
39
|
-
heading: heading,
|
|
40
|
-
headingLevel: headingLevel,
|
|
41
|
-
subHeading: subHeading,
|
|
42
|
-
subHeadingSize: subHeadingSize,
|
|
43
|
-
bodyText: bodyText,
|
|
44
|
-
confirmButtonText: confirmButtonText,
|
|
45
|
-
confirmButtonVariant: confirmButtonVariant,
|
|
46
|
-
cancelButtonText: cancelButtonText,
|
|
47
|
-
cancelButtonType: cancelButtonType,
|
|
48
|
-
children: children
|
|
49
|
-
})
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
Modal.propTypes = {
|
|
54
|
-
children: PropTypes.node,
|
|
55
|
-
tokens: PropTypes.object,
|
|
56
|
-
variant: PropTypes.object,
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* If true, the modal overlay covers the page and the modal content is shown
|
|
60
|
-
*/
|
|
61
|
-
isOpen: PropTypes.bool,
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Function called on pressing the Modal close "x" button
|
|
65
|
-
*/
|
|
66
|
-
onClose: PropTypes.func,
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* If true, Modal is rendered with the 'maxWidth' appearance applied.
|
|
70
|
-
* Use this for wider content, such as content with long headers.
|
|
71
|
-
*/
|
|
72
|
-
maxWidth: PropTypes.bool,
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Heading text shown prominently with heading semantic tags.
|
|
76
|
-
*/
|
|
77
|
-
heading: PropTypes.string,
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Stylistic size and semantic level of the modal heading
|
|
81
|
-
*/
|
|
82
|
-
headingLevel: PropTypes.oneOf(['h3', 'h4']),
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Short content rendered below the heading. If there is long body content that is scrollable,
|
|
86
|
-
* the subHeading sits above the scrollable area.
|
|
87
|
-
*/
|
|
88
|
-
subHeading: PropTypes.string,
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Short content rendered below the heading. If there is long body content that is scrollable,
|
|
92
|
-
* the subHeading sits above the scrollable area.
|
|
93
|
-
*/
|
|
94
|
-
subHeadingSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* If the modal requires longer text, include it here. This text will become scrollable if it
|
|
98
|
-
* is too long for the allowed height of the modal.
|
|
99
|
-
*/
|
|
100
|
-
bodyText: PropTypes.string,
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Text for the button controlling the primary action of the modal.
|
|
104
|
-
*/
|
|
105
|
-
confirmButtonText: PropTypes.string,
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Button variant object to be passed through to Button to choose its visual style.
|
|
109
|
-
*/
|
|
110
|
-
confirmButtonVariant: PropTypes.object,
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Action on pressing the confirm button.
|
|
114
|
-
*/
|
|
115
|
-
onConfirm: PropTypes.func,
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Text for the optional cancel button provided if the user does not want to do the confirm action.
|
|
119
|
-
*/
|
|
120
|
-
cancelButtonText: PropTypes.string,
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Component to use for the cancel button (default: `TextButton`). Should accept similar props to `TextButton`.
|
|
124
|
-
*/
|
|
125
|
-
cancelButtonType: PropTypes.elementType,
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Action to perform on pressing the cancel button. Defaults to `onClose` action if undefined.
|
|
129
|
-
*/
|
|
130
|
-
onCancel: PropTypes.func
|
|
131
|
-
};
|
|
132
|
-
export default Modal;
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Box, Button, Spacer, TextButton, Typography, useThemeTokens, useViewport } from '@telus-uds/components-base';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
const StyledModalContent = /*#__PURE__*/styled.div.withConfig({
|
|
8
|
-
displayName: "ModalContent__StyledModalContent",
|
|
9
|
-
componentId: "components-web__sc-k40cwb-0"
|
|
10
|
-
})(["display:flex;flex-direction:column;min-height:100%;"]);
|
|
11
|
-
const StyledHeading = /*#__PURE__*/styled.header.withConfig({
|
|
12
|
-
displayName: "ModalContent__StyledHeading",
|
|
13
|
-
componentId: "components-web__sc-k40cwb-1"
|
|
14
|
-
})(["display:flex;flex-direction:column;padding-right:", "px;"], _ref => {
|
|
15
|
-
let {
|
|
16
|
-
paddingRight
|
|
17
|
-
} = _ref;
|
|
18
|
-
return paddingRight;
|
|
19
|
-
});
|
|
20
|
-
const StyledSubHeading = /*#__PURE__*/styled.div.withConfig({
|
|
21
|
-
displayName: "ModalContent__StyledSubHeading",
|
|
22
|
-
componentId: "components-web__sc-k40cwb-2"
|
|
23
|
-
})(["margin-top:", "px;"], _ref2 => {
|
|
24
|
-
let {
|
|
25
|
-
marginTop
|
|
26
|
-
} = _ref2;
|
|
27
|
-
return marginTop;
|
|
28
|
-
});
|
|
29
|
-
const StyledTextButtonContainer = /*#__PURE__*/styled.div.withConfig({
|
|
30
|
-
displayName: "ModalContent__StyledTextButtonContainer",
|
|
31
|
-
componentId: "components-web__sc-k40cwb-3"
|
|
32
|
-
})({
|
|
33
|
-
display: 'flex'
|
|
34
|
-
});
|
|
35
|
-
const StyledFooter = /*#__PURE__*/styled.footer.withConfig({
|
|
36
|
-
displayName: "ModalContent__StyledFooter",
|
|
37
|
-
componentId: "components-web__sc-k40cwb-4"
|
|
38
|
-
})(_ref3 => {
|
|
39
|
-
let {
|
|
40
|
-
hasBorder,
|
|
41
|
-
viewport,
|
|
42
|
-
paddingLeft,
|
|
43
|
-
paddingRight,
|
|
44
|
-
paddingTop,
|
|
45
|
-
marginLeft,
|
|
46
|
-
marginRight,
|
|
47
|
-
borderColor,
|
|
48
|
-
gap
|
|
49
|
-
} = _ref3;
|
|
50
|
-
return {
|
|
51
|
-
display: 'flex',
|
|
52
|
-
flexDirection: viewport === 'xs' || viewport === 'sm' ? 'column' : 'row',
|
|
53
|
-
alignItems: 'center',
|
|
54
|
-
gap: `${gap}px`,
|
|
55
|
-
marginLeft: `calc(-1 * ${marginLeft}px)`,
|
|
56
|
-
marginRight: `calc(-1 * ${marginRight}px)`,
|
|
57
|
-
paddingLeft: `${paddingLeft}px`,
|
|
58
|
-
paddingRight: `${paddingRight}px`,
|
|
59
|
-
paddingTop: `${paddingTop}px`,
|
|
60
|
-
borderTop: hasBorder ? `1px solid ${borderColor}` : 'none'
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const ModalContent = _ref4 => {
|
|
65
|
-
let {
|
|
66
|
-
heading,
|
|
67
|
-
headingLevel = 'h3',
|
|
68
|
-
subHeading,
|
|
69
|
-
subHeadingSize = 'medium',
|
|
70
|
-
bodyText,
|
|
71
|
-
confirmButtonText,
|
|
72
|
-
confirmButtonVariant = {
|
|
73
|
-
priority: 'high'
|
|
74
|
-
},
|
|
75
|
-
onConfirm,
|
|
76
|
-
tokens,
|
|
77
|
-
variant,
|
|
78
|
-
cancelButtonText,
|
|
79
|
-
cancelButtonType: CancelButton = TextButton,
|
|
80
|
-
children,
|
|
81
|
-
onCancel
|
|
82
|
-
} = _ref4;
|
|
83
|
-
const {
|
|
84
|
-
headingColor,
|
|
85
|
-
cancelButtonColor,
|
|
86
|
-
...themeTokens
|
|
87
|
-
} = useThemeTokens('Modal', tokens, variant);
|
|
88
|
-
const [scrollContainerHeight, setScrollContainerHeight] = useState(0);
|
|
89
|
-
const [scrollContentHeight, setScrollContentHeight] = useState(0);
|
|
90
|
-
const viewport = useViewport();
|
|
91
|
-
|
|
92
|
-
const handleContainerLayout = _ref5 => {
|
|
93
|
-
let {
|
|
94
|
-
nativeEvent: {
|
|
95
|
-
layout: {
|
|
96
|
-
height
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
} = _ref5;
|
|
100
|
-
return setScrollContainerHeight(height);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const onContentSizeChange = (_, height) => setScrollContentHeight(height);
|
|
104
|
-
|
|
105
|
-
const isContentOverflowing = scrollContentHeight > scrollContainerHeight;
|
|
106
|
-
const hasConfirmButton = confirmButtonText !== undefined && onConfirm !== undefined;
|
|
107
|
-
const hasCancelButton = cancelButtonText !== undefined && onCancel !== undefined;
|
|
108
|
-
const hasHeadingSection = Boolean(heading || subHeading);
|
|
109
|
-
return /*#__PURE__*/_jsxs(StyledModalContent, {
|
|
110
|
-
children: [hasHeadingSection && /*#__PURE__*/_jsxs(StyledHeading, {
|
|
111
|
-
paddingRight: themeTokens.headingPaddingRight,
|
|
112
|
-
children: [heading && /*#__PURE__*/_jsx(Typography, {
|
|
113
|
-
variant: {
|
|
114
|
-
size: headingLevel
|
|
115
|
-
},
|
|
116
|
-
tokens: {
|
|
117
|
-
color: headingColor
|
|
118
|
-
},
|
|
119
|
-
heading: headingLevel,
|
|
120
|
-
children: heading
|
|
121
|
-
}), subHeading && /*#__PURE__*/_jsx(StyledSubHeading, {
|
|
122
|
-
marginTop: themeTokens.subHeadingMarginTop,
|
|
123
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
124
|
-
variant: {
|
|
125
|
-
size: subHeadingSize
|
|
126
|
-
},
|
|
127
|
-
children: subHeading
|
|
128
|
-
})
|
|
129
|
-
}), Boolean(bodyText && hasHeadingSection) && /*#__PURE__*/_jsx(Spacer, {
|
|
130
|
-
space: 3
|
|
131
|
-
})]
|
|
132
|
-
}), bodyText && /*#__PURE__*/_jsx(Box, {
|
|
133
|
-
scroll: {
|
|
134
|
-
onContentSizeChange,
|
|
135
|
-
showsVerticalScrollIndicator: true
|
|
136
|
-
},
|
|
137
|
-
onLayout: handleContainerLayout,
|
|
138
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
139
|
-
children: bodyText
|
|
140
|
-
})
|
|
141
|
-
}), children, (hasConfirmButton || hasCancelButton) && /*#__PURE__*/_jsxs(StyledFooter, { ...themeTokens,
|
|
142
|
-
hasBorder: isContentOverflowing,
|
|
143
|
-
viewport: viewport,
|
|
144
|
-
children: [hasConfirmButton && /*#__PURE__*/_jsx(Button, {
|
|
145
|
-
variant: confirmButtonVariant,
|
|
146
|
-
tokens: {
|
|
147
|
-
width: viewport === 'xs' || viewport === 'sm' ? '100%' : undefined
|
|
148
|
-
},
|
|
149
|
-
onPress: onConfirm,
|
|
150
|
-
children: confirmButtonText
|
|
151
|
-
}), hasCancelButton ? /*#__PURE__*/_jsx(StyledTextButtonContainer, {
|
|
152
|
-
children: /*#__PURE__*/_jsx(CancelButton, {
|
|
153
|
-
tokens: {
|
|
154
|
-
color: cancelButtonColor
|
|
155
|
-
},
|
|
156
|
-
onPress: onCancel,
|
|
157
|
-
children: cancelButtonText
|
|
158
|
-
})
|
|
159
|
-
}) : null]
|
|
160
|
-
})]
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
ModalContent.propTypes = {
|
|
165
|
-
tokens: PropTypes.object,
|
|
166
|
-
variant: PropTypes.object,
|
|
167
|
-
heading: PropTypes.string,
|
|
168
|
-
headingLevel: PropTypes.oneOf(['h3', 'h4']),
|
|
169
|
-
subHeading: PropTypes.string,
|
|
170
|
-
subHeadingSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
171
|
-
bodyText: PropTypes.string,
|
|
172
|
-
confirmButtonText: PropTypes.string,
|
|
173
|
-
confirmButtonVariant: PropTypes.object,
|
|
174
|
-
onConfirm: PropTypes.func,
|
|
175
|
-
cancelButtonText: PropTypes.string,
|
|
176
|
-
cancelButtonType: PropTypes.elementType,
|
|
177
|
-
// TODO: figure out a way of passing an icon to the TextButton
|
|
178
|
-
children: PropTypes.node,
|
|
179
|
-
onCancel: PropTypes.func
|
|
180
|
-
};
|
|
181
|
-
export default ModalContent;
|