@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
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _Video = _interopRequireDefault(require("./Video"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  var _default = _Video.default;
13
10
  exports.default = _default;
@@ -4,37 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _systemConstants = require("@telus-uds/system-constants");
13
-
14
10
  var _componentsBase = require("@telus-uds/components-base");
15
-
16
11
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
17
-
18
12
  var _videoPropType = require("./videoPropType");
19
-
20
13
  var _VideoPickerThumbnail = _interopRequireDefault(require("./VideoPickerThumbnail"));
21
-
22
14
  var _VideoPickerPlayer = _interopRequireDefault(require("./VideoPickerPlayer"));
23
-
24
15
  var _VideoSlider = _interopRequireDefault(require("./VideoSlider"));
25
-
26
16
  var _utils = require("../utils");
27
-
28
17
  var _jsxRuntime = require("react/jsx-runtime");
29
-
30
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
-
32
19
  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); }
33
-
34
20
  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; }
35
-
36
21
  const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
37
-
38
22
  const framedContainerStyles = _ref => {
39
23
  let {
40
24
  framedContainerBackgroundColor,
@@ -45,7 +29,6 @@ const framedContainerStyles = _ref => {
45
29
  } = _ref;
46
30
  return (0, _styledComponents.css)(["background-color:", ";border:", "px solid ", ";border-radius:", "px;& > div{max-height:", "px;}"], framedContainerBackgroundColor, framedContainerBorderWidth, framedContainerBorderColor, framedContainerBorderRadius, framedMaxHeight);
47
31
  };
48
-
49
32
  const VideoPickerContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
50
33
  displayName: "VideoPicker__VideoPickerContainer",
51
34
  componentId: "components-web__sc-x6lxp0-0"
@@ -56,7 +39,6 @@ const VideoPickerContainer = /*#__PURE__*/_styledComponents.default.div.withConf
56
39
  } = _ref2;
57
40
  return isFramed && framedContainerStyles(tokens);
58
41
  });
59
-
60
42
  const framedPlayerContainerStyles = _ref3 => {
61
43
  let {
62
44
  framedMaxHeight,
@@ -64,7 +46,6 @@ const framedPlayerContainerStyles = _ref3 => {
64
46
  } = _ref3;
65
47
  return (0, _styledComponents.css)(["width:66.67%;padding:", "px;max-height:", "px;flex-shrink:0;box-sizing:border-box;"], framedContainerPadding, framedMaxHeight);
66
48
  };
67
-
68
49
  const VideoPlayerContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
69
50
  displayName: "VideoPicker__VideoPlayerContainer",
70
51
  componentId: "components-web__sc-x6lxp0-1"
@@ -75,22 +56,18 @@ const VideoPlayerContainer = /*#__PURE__*/_styledComponents.default.div.withConf
75
56
  } = _ref4;
76
57
  return isFramed && framedPlayerContainerStyles(tokens);
77
58
  });
78
-
79
59
  const framedVideoListContainerStyle = /*#__PURE__*/(0, _styledComponents.css)(["max-height:", "px;overflow:auto;flex-direction:column;"], _ref5 => {
80
60
  let {
81
61
  framedMaxHeight
82
62
  } = _ref5;
83
63
  return framedMaxHeight;
84
64
  });
85
-
86
65
  const VideoListContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
87
66
  displayName: "VideoPicker__VideoListContainer",
88
67
  componentId: "components-web__sc-x6lxp0-2"
89
68
  })(["display:flex;justify-content:flex-start;position:relative;flex-grow:1;flex-direction:column;", ""], props => props.isFramed && framedVideoListContainerStyle);
90
-
91
69
  const VideoPicker = _ref6 => {
92
70
  var _videoList$;
93
-
94
71
  let {
95
72
  videoList = [],
96
73
  selectedVideo = (_videoList$ = videoList[0]) === null || _videoList$ === void 0 ? void 0 : _videoList$.videoId,
@@ -110,8 +87,9 @@ const VideoPicker = _ref6 => {
110
87
  (0, _react.useEffect)(() => {
111
88
  // Update current video if parent changes which video id it passes down
112
89
  setCurrentVideoId(selectedVideo);
113
- }, [selectedVideo]); // `frame` variant should only work on larger screens
90
+ }, [selectedVideo]);
114
91
 
92
+ // `frame` variant should only work on larger screens
115
93
  const isFramed = frame && [_systemConstants.viewports.lg, _systemConstants.viewports.xl].includes(viewport);
116
94
  const hasSlider = !frame && [_systemConstants.viewports.md, _systemConstants.viewports.lg, _systemConstants.viewports.xl].includes(viewport);
117
95
  const listElements = videoList.map((video, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoPickerThumbnail.default, {
@@ -143,7 +121,8 @@ const VideoPicker = _ref6 => {
143
121
  space: isFramed ? 0 : 4 // everything has internal padding in `frame` variant
144
122
  ,
145
123
  direction: isFramed ? 'row' : 'column',
146
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(VideoPlayerContainer, { ...themeTokens,
124
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(VideoPlayerContainer, {
125
+ ...themeTokens,
147
126
  isFramed: isFramed,
148
127
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoPickerPlayer.default, {
149
128
  video: currentVideo,
@@ -161,31 +140,26 @@ const VideoPicker = _ref6 => {
161
140
  })
162
141
  });
163
142
  };
164
-
165
- VideoPicker.propTypes = { ...selectedSystemPropTypes,
143
+ VideoPicker.propTypes = {
144
+ ...selectedSystemPropTypes,
166
145
  tokens: (0, _componentsBase.getTokensPropType)('VideoPicker'),
167
-
168
146
  /**
169
147
  * Id of the currently selected video (defaults to the first video if not set).
170
148
  */
171
149
  selectedVideo: _propTypes.default.string,
172
-
173
150
  /**
174
151
  * An array of Video objects.
175
152
  */
176
153
  videoList: _propTypes.default.arrayOf(_videoPropType.VideoPropType),
177
-
178
154
  /**
179
155
  * Use to display the picker in a container and the playlist as a sidebar (only available for breakpoints LG and larger)
180
156
  */
181
157
  frame: _propTypes.default.bool,
182
-
183
158
  /**
184
159
  * Callback function trigerred when the video player starts playing video.
185
160
  * @param {object} video - The video object that is playing.
186
161
  */
187
162
  onStartVideo: _propTypes.default.func,
188
-
189
163
  /**
190
164
  * Callback function trigerred when a video is selected from the thumbnail list.
191
165
  * @param {object} video - The video object that is selected.
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _componentsBase = require("@telus-uds/components-base");
11
-
12
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
10
  var _WebVideo = _interopRequireDefault(require("../WebVideo/WebVideo"));
15
-
16
11
  var _videoPropType = require("./videoPropType");
17
-
18
12
  var _jsxRuntime = require("react/jsx-runtime");
19
-
20
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
14
  const VideoPickerPlayer = _ref => {
23
15
  let {
24
16
  video = {},
@@ -32,7 +24,8 @@ const VideoPickerPlayer = _ref => {
32
24
  },
33
25
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
34
26
  ref: videoPlayerRef,
35
- children: video.videoId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_WebVideo.default, { ...video,
27
+ children: video.videoId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_WebVideo.default, {
28
+ ...video,
36
29
  onStart: () => onStartVideo(video)
37
30
  })
38
31
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
@@ -51,7 +44,6 @@ const VideoPickerPlayer = _ref => {
51
44
  })]
52
45
  });
53
46
  };
54
-
55
47
  VideoPickerPlayer.propTypes = {
56
48
  video: _videoPropType.VideoPropType,
57
49
  videoPlayerRef: _videoPropType.RefPropType,
@@ -4,37 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
11
-
12
9
  var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
13
-
14
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
11
  var _systemConstants = require("@telus-uds/system-constants");
17
-
18
12
  var _styledComponents = _interopRequireDefault(require("styled-components"));
19
-
20
13
  var _componentsBase = require("@telus-uds/components-base");
21
-
22
14
  var _helpers = require("../shared/VideoSplash/helpers");
23
-
24
15
  var _videoPropType = require("./videoPropType");
25
-
26
16
  var _VideoSplash = _interopRequireDefault(require("../shared/VideoSplash/VideoSplash"));
27
-
28
17
  var _jsxRuntime = require("react/jsx-runtime");
29
-
30
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
-
32
19
  const {
33
20
  getItemPositionLayoutHandler,
34
21
  itemPositionsPropType
35
- } = _componentsBase.horizontalScrollUtils; // Use a React Native (web) outer container so it can take an onLayout callback, to
36
- // access position in VideoSlider's UDS HorizontalScroll and update its itemPositions
22
+ } = _componentsBase.horizontalScrollUtils;
37
23
 
24
+ // Use a React Native (web) outer container so it can take an onLayout callback, to
25
+ // access position in VideoSlider's UDS HorizontalScroll and update its itemPositions
38
26
  const createReactNativeStyles = _ref => {
39
27
  let {
40
28
  pressablePaddingBottom,
@@ -60,7 +48,6 @@ const createReactNativeStyles = _ref => {
60
48
  }
61
49
  });
62
50
  };
63
-
64
51
  const ImageContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
65
52
  displayName: "VideoPickerThumbnail__ImageContainer",
66
53
  componentId: "components-web__sc-1glxurq-0"
@@ -70,7 +57,6 @@ const ImageContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
70
57
  } = _ref2;
71
58
  return outerBorderRadius;
72
59
  });
73
-
74
60
  const VideoThumbnail = /*#__PURE__*/_styledComponents.default.div.withConfig({
75
61
  displayName: "VideoPickerThumbnail__VideoThumbnail",
76
62
  componentId: "components-web__sc-1glxurq-1"
@@ -95,12 +81,10 @@ const VideoThumbnail = /*#__PURE__*/_styledComponents.default.div.withConfig({
95
81
  } = _ref6;
96
82
  return borderRadius;
97
83
  });
98
-
99
84
  const ThumbnailTitleContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
100
85
  displayName: "VideoPickerThumbnail__ThumbnailTitleContainer",
101
86
  componentId: "components-web__sc-1glxurq-2"
102
87
  })(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;"]);
103
-
104
88
  const VideoPickerThumbnail = _ref7 => {
105
89
  let {
106
90
  videoPlayerRef,
@@ -119,9 +103,9 @@ const VideoPickerThumbnail = _ref7 => {
119
103
  timestamp
120
104
  } = (0, _helpers.getTimestamp)(video.videoLength, video.copy);
121
105
  const isPlaying = selectedVideoId === video.videoId;
122
-
123
106
  const renderThumbnailImage = themeTokens => {
124
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(VideoThumbnail, { ...themeTokens,
107
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(VideoThumbnail, {
108
+ ...themeTokens,
125
109
  isPlaying: isPlaying,
126
110
  layout: layout,
127
111
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoSplash.default, {
@@ -132,7 +116,6 @@ const VideoPickerThumbnail = _ref7 => {
132
116
  })
133
117
  });
134
118
  };
135
-
136
119
  const renderThumbnailInfo = _ref8 => {
137
120
  let {
138
121
  titleColor,
@@ -165,19 +148,15 @@ const VideoPickerThumbnail = _ref7 => {
165
148
  })]
166
149
  });
167
150
  };
168
-
169
151
  const handleLayout = itemPositions !== undefined ? getItemPositionLayoutHandler(itemPositions.positions, index) : undefined;
170
-
171
152
  const onKeyPress = event => {
172
153
  if (['Space', 'Enter'].includes(event.key)) {
173
154
  var _videoPlayerRef$curre;
174
-
175
155
  onSelectVideo(video);
176
156
  const splashButton = (_videoPlayerRef$curre = videoPlayerRef.current) === null || _videoPlayerRef$curre === void 0 ? void 0 : _videoPlayerRef$curre.querySelector('button');
177
157
  if (splashButton) splashButton.focus();
178
158
  }
179
159
  };
180
-
181
160
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
182
161
  onLayout: handleLayout,
183
162
  onPress: () => onSelectVideo(video),
@@ -221,14 +200,14 @@ const VideoPickerThumbnail = _ref7 => {
221
200
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
222
201
  space: layout === 'vertical' ? 2 : 3,
223
202
  direction: layout === 'vertical' ? 'column' : 'row',
224
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ImageContainer, { ...themeTokens,
203
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ImageContainer, {
204
+ ...themeTokens,
225
205
  children: renderThumbnailImage(themeTokens)
226
206
  }), renderThumbnailInfo(themeTokens)]
227
207
  });
228
208
  }
229
209
  }, video.videoId);
230
210
  };
231
-
232
211
  VideoPickerThumbnail.propTypes = {
233
212
  selectedVideoId: _propTypes.default.string,
234
213
  onSelectVideo: _propTypes.default.func,
@@ -4,27 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _componentsBase = require("@telus-uds/components-base");
11
-
12
9
  var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
13
-
14
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
11
  var _jsxRuntime = require("react/jsx-runtime");
17
-
18
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
13
  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
14
  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
15
  const {
25
16
  useItemPositions
26
17
  } = _componentsBase.horizontalScrollUtils;
27
-
28
18
  const VideoSlider = _ref => {
29
19
  let {
30
20
  children
@@ -36,7 +26,6 @@ const VideoSlider = _ref => {
36
26
  previousIcon: PreviousIcon,
37
27
  nextIcon: NextIcon
38
28
  } = (0, _componentsBase.useThemeTokens)('VideoPickerSlider');
39
-
40
29
  const onLayout = _ref2 => {
41
30
  let {
42
31
  nativeEvent: {
@@ -47,15 +36,16 @@ const VideoSlider = _ref => {
47
36
  } = _ref2;
48
37
  setContainerWidth(width);
49
38
  };
50
-
51
39
  const itemsGap = 32; // '5' on spacing scale
52
-
53
40
  const itemsCount = viewport === 'lg' || viewport === 'xl' ? 4 : 3;
54
41
  const itemGapPortioned = (itemsCount - 1) * itemsGap / itemsCount;
55
- const itemWidth = containerWidth === null ? // For first render, we don't know container width, so avoid flicker with static % width
56
- `calc(${Math.round(100 / itemsCount)}% - ${Math.round(itemGapPortioned)}px)` : // After first render, can't use % widths because parent is > 100% width horizontal scroll area
42
+ const itemWidth = containerWidth === null ?
43
+ // For first render, we don't know container width, so avoid flicker with static % width
44
+ `calc(${Math.round(100 / itemsCount)}% - ${Math.round(itemGapPortioned)}px)` :
45
+ // After first render, can't use % widths because parent is > 100% width horizontal scroll area
57
46
  Math.max(containerWidth / itemsCount - itemGapPortioned, 0 // Prevent negative width breaking layout on very narrow containers
58
47
  );
48
+
59
49
  const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.StackView, {
60
50
  space: 5,
61
51
  direction: "row",
@@ -83,7 +73,8 @@ const VideoSlider = _ref => {
83
73
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
84
74
  onLayout: onLayout,
85
75
  style: overflow,
86
- children: containerWidth === null ? // Use a 100% width non-scrollable parent until containerWidth is known, to avoid flicker
76
+ children: containerWidth === null ?
77
+ // Use a 100% width non-scrollable parent until containerWidth is known, to avoid flicker
87
78
  content : /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.HorizontalScroll, {
88
79
  ScrollButton: _componentsBase.HorizontalScrollButton,
89
80
  itemPositions: itemPositions,
@@ -92,7 +83,6 @@ const VideoSlider = _ref => {
92
83
  })
93
84
  });
94
85
  };
95
-
96
86
  VideoSlider.propTypes = {
97
87
  children: _propTypes.default.node
98
88
  };
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _VideoPicker = _interopRequireDefault(require("./VideoPicker"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  var _default = _VideoPicker.default;
13
10
  exports.default = _default;
@@ -4,22 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VideoPropType = exports.RefPropType = void 0;
7
-
8
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
-
10
8
  var _WebVideo = require("../WebVideo/WebVideo");
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const VideoPropType = _propTypes.default.shape({ ..._WebVideo.VideoProps,
10
+ const VideoPropType = _propTypes.default.shape({
11
+ ..._WebVideo.VideoProps,
15
12
  title: _propTypes.default.string,
16
13
  description: _propTypes.default.string
17
14
  });
18
-
19
15
  exports.VideoPropType = VideoPropType;
20
-
21
16
  const RefPropType = _propTypes.default.shape({
22
17
  current: _propTypes.default.object
23
18
  });
24
-
25
19
  exports.RefPropType = RefPropType;
@@ -4,33 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
13
-
14
10
  var _componentsBase = require("@telus-uds/components-base");
15
-
16
11
  var _OrderedListBase = _interopRequireDefault(require("../OrderedList/OrderedListBase"));
17
-
18
12
  var _ItemBase = _interopRequireDefault(require("../OrderedList/ItemBase"));
19
-
20
13
  var _Image = _interopRequireDefault(require("../Image"));
21
-
22
14
  var _utils = require("../utils");
23
-
24
15
  var _jsxRuntime = require("react/jsx-runtime");
25
-
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
17
  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); }
29
-
30
18
  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; }
31
-
32
19
  const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
33
-
34
20
  const row = (rowSize, rowBorderWidth) => ({
35
21
  flexBasis: `calc(100% / ${rowSize})`,
36
22
  [`:not(:nth-of-type(${rowSize}n + 1))`]: {
@@ -40,7 +26,6 @@ const row = (rowSize, rowBorderWidth) => ({
40
26
  borderTopWidth: `${rowBorderWidth}px`
41
27
  }
42
28
  });
43
-
44
29
  const Container = /*#__PURE__*/(0, _styledComponents.default)(_OrderedListBase.default).withConfig({
45
30
  displayName: "WaffleGrid__Container",
46
31
  componentId: "components-web__sc-ec8g0a-0"
@@ -87,10 +72,10 @@ const Center = /*#__PURE__*/(0, _styledComponents.default)('div').withConfig({
87
72
  alignItems: 'center',
88
73
  textAlign: 'center'
89
74
  });
75
+
90
76
  /**
91
77
  * The WaffleGrid is used to show items in a waffle like manner with borders surrounding the element
92
78
  */
93
-
94
79
  const WaffleGrid = _ref2 => {
95
80
  let {
96
81
  items,
@@ -106,14 +91,17 @@ const WaffleGrid = _ref2 => {
106
91
  viewport
107
92
  });
108
93
  const currentRowSize = (0, _componentsBase.useResponsiveProp)(rowSize);
109
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, { ...selectProps(rest),
110
- children: items.map(child => /*#__PURE__*/(0, _react.createElement)(Item, { ...themeTokens,
94
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
95
+ ...selectProps(rest),
96
+ children: items.map(child => /*#__PURE__*/(0, _react.createElement)(Item, {
97
+ ...themeTokens,
111
98
  key: child.href,
112
99
  rowSize: rowSize ? currentRowSize : themeTokens.rowSize
113
100
  }, /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Link, {
114
101
  href: child.href,
115
102
  LinkRouter: child.LinkRouter || LinkRouter,
116
- linkRouterProps: { ...linkRouterProps,
103
+ linkRouterProps: {
104
+ ...linkRouterProps,
117
105
  ...child.linkRouterProps
118
106
  },
119
107
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Center, {
@@ -125,7 +113,8 @@ const WaffleGrid = _ref2 => {
125
113
  alt: child.imageAltText,
126
114
  width: 96,
127
115
  height: 128
128
- }) : // Otherwise it must be an arbitrary content, which we just display by itself
116
+ }) :
117
+ // Otherwise it must be an arbitrary content, which we just display by itself
129
118
  child.image, /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
130
119
  variant: {
131
120
  weight: 'semibold'
@@ -136,9 +125,8 @@ const WaffleGrid = _ref2 => {
136
125
  })))
137
126
  });
138
127
  };
139
-
140
- WaffleGrid.propTypes = { ...selectedSystemPropTypes,
141
-
128
+ WaffleGrid.propTypes = {
129
+ ...selectedSystemPropTypes,
142
130
  /**
143
131
  * The image and the link to display. `items` should be an array of objects with the following keys:
144
132
  */
@@ -147,30 +135,25 @@ WaffleGrid.propTypes = { ...selectedSystemPropTypes,
147
135
  * The src attribute for the HTML img element or custom JSX content to render instead
148
136
  */
149
137
  image: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
150
-
151
138
  /**
152
139
  * The alt attribute for the HTML img element (note that this is ignored if a custom
153
140
  * JSX content is used instead of an image URL)
154
141
  */
155
142
  imageAltText: _propTypes.default.string,
156
-
157
143
  /**
158
144
  * The text displayed under the image
159
145
  */
160
146
  text: _propTypes.default.string,
161
-
162
147
  /**
163
148
  * Target URL
164
149
  */
165
150
  href: _propTypes.default.string,
166
151
  ..._componentsBase.withLinkRouter.propTypes
167
152
  })).isRequired,
168
-
169
153
  /**
170
154
  * Sets the tokens for WaffleGrid element.
171
155
  */
172
156
  tokens: (0, _componentsBase.getTokensPropType)('WaffleGrid'),
173
-
174
157
  /**
175
158
  * Row size, optionally depending on the viewport
176
159
  */
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _WaffleGrid = _interopRequireDefault(require("./WaffleGrid"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  var _default = _WaffleGrid.default;
13
10
  exports.default = _default;
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("react");
9
-
10
8
  var _reactDom = _interopRequireDefault(require("react-dom"));
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  /**
15
11
  * WebPortal component renders its children in a separate portal container appended to the document body.
16
12
  *
@@ -28,6 +24,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
28
24
  * @param {React.ReactNode} props.children - The content to render within the portal.
29
25
  * @returns {React.ReactPortal} The React portal component.
30
26
  */
27
+
31
28
  const WebPortal = _ref => {
32
29
  let {
33
30
  children
@@ -41,6 +38,5 @@ const WebPortal = _ref => {
41
38
  }, [portalContainer]);
42
39
  return /*#__PURE__*/_reactDom.default.createPortal(children, portalContainer);
43
40
  };
44
-
45
41
  var _default = WebPortal;
46
42
  exports.default = _default;
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _WebPortal = _interopRequireDefault(require("./WebPortal"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
9
  var _default = _WebPortal.default;
13
10
  exports.default = _default;