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