@telus-uds/components-web 3.4.0 → 4.0.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 (368) hide show
  1. package/.eslintrc.cjs +7 -1
  2. package/CHANGELOG.md +22 -2
  3. package/jest.config.cjs +1 -1
  4. package/lib/cjs/Badge/Badge.js +128 -0
  5. package/lib/cjs/Badge/index.js +9 -0
  6. package/lib/cjs/BlockQuote/BlockQuote.js +256 -0
  7. package/lib/cjs/BlockQuote/index.js +9 -0
  8. package/lib/cjs/Breadcrumbs/Breadcrumbs.js +264 -0
  9. package/lib/cjs/Breadcrumbs/Item/Item.js +180 -0
  10. package/lib/cjs/Breadcrumbs/index.js +13 -0
  11. package/lib/cjs/Callout/Callout.js +141 -0
  12. package/lib/cjs/Callout/index.js +9 -0
  13. package/lib/cjs/Card/Card.js +257 -0
  14. package/lib/cjs/Card/CardContent.js +97 -0
  15. package/lib/cjs/Card/CardFooter.js +85 -0
  16. package/lib/cjs/Card/index.js +9 -0
  17. package/lib/cjs/Countdown/Countdown.js +268 -0
  18. package/lib/cjs/Countdown/Segment.js +108 -0
  19. package/lib/cjs/Countdown/constants.js +10 -0
  20. package/lib/cjs/Countdown/dictionary.js +28 -0
  21. package/lib/cjs/Countdown/index.js +9 -0
  22. package/lib/cjs/Countdown/types.js +31 -0
  23. package/lib/cjs/Countdown/useCountdown.js +32 -0
  24. package/lib/cjs/DatePicker/CalendarContainer.js +214 -0
  25. package/lib/cjs/DatePicker/DatePicker.js +525 -0
  26. package/lib/cjs/DatePicker/dictionary.js +125 -0
  27. package/lib/cjs/DatePicker/index.js +9 -0
  28. package/lib/cjs/DatePicker/reactDatesCss.js +9 -0
  29. package/lib/cjs/Disclaimer/Disclaimer.js +61 -0
  30. package/lib/cjs/Disclaimer/index.js +13 -0
  31. package/lib/cjs/Footnote/Footnote.js +637 -0
  32. package/lib/cjs/Footnote/FootnoteLink.js +125 -0
  33. package/lib/cjs/Footnote/dictionary.js +18 -0
  34. package/lib/cjs/Footnote/index.js +11 -0
  35. package/lib/cjs/IconButton/IconButton.js +62 -0
  36. package/lib/cjs/IconButton/index.js +9 -0
  37. package/lib/cjs/Image/Image.js +90 -0
  38. package/lib/cjs/Image/index.js +20 -0
  39. package/lib/cjs/Image/server.js +11 -0
  40. package/lib/cjs/List/List.js +8 -0
  41. package/lib/cjs/List/ListItem.js +34 -0
  42. package/lib/cjs/List/index.js +11 -0
  43. package/lib/cjs/NavigationBar/NavigationBar.js +282 -0
  44. package/lib/cjs/NavigationBar/NavigationItem.js +94 -0
  45. package/lib/cjs/NavigationBar/NavigationSubMenu.js +164 -0
  46. package/lib/cjs/NavigationBar/collapseItems.js +43 -0
  47. package/lib/cjs/NavigationBar/index.js +11 -0
  48. package/lib/cjs/NavigationBar/resolveItemSelection.js +22 -0
  49. package/lib/cjs/OptimizeImage/OptimizeImage.js +99 -0
  50. package/lib/cjs/OptimizeImage/index.js +9 -0
  51. package/lib/cjs/OptimizeImage/utils/getFallbackUrl.js +14 -0
  52. package/lib/cjs/OptimizeImage/utils/getImageUrls.js +19 -0
  53. package/lib/cjs/OptimizeImage/utils/getOptimizedUrl.js +24 -0
  54. package/lib/cjs/OptimizeImage/utils/hasWebpSupport.js +34 -0
  55. package/lib/cjs/OptimizeImage/utils/index.js +34 -0
  56. package/lib/cjs/OptimizeImage/utils/isSvgUrl.js +9 -0
  57. package/lib/cjs/OrderedList/Item.js +151 -0
  58. package/lib/cjs/OrderedList/ItemBase.js +34 -0
  59. package/lib/cjs/OrderedList/OrderedList.js +92 -0
  60. package/lib/cjs/OrderedList/OrderedListBase.js +52 -0
  61. package/lib/cjs/OrderedList/constants.js +8 -0
  62. package/lib/cjs/OrderedList/index.js +11 -0
  63. package/lib/cjs/Paragraph/Paragraph.js +97 -0
  64. package/lib/cjs/Paragraph/index.js +9 -0
  65. package/lib/cjs/PreviewCard/AuthorDate.js +63 -0
  66. package/lib/cjs/PreviewCard/PreviewCard.js +215 -0
  67. package/lib/cjs/PreviewCard/index.js +9 -0
  68. package/lib/cjs/PriceLockup/PriceLockup.js +356 -0
  69. package/lib/cjs/PriceLockup/index.js +9 -0
  70. package/lib/cjs/PriceLockup/tokens.js +66 -0
  71. package/lib/cjs/Progress/ProgressBar.js +99 -0
  72. package/lib/cjs/Progress/index.js +11 -0
  73. package/lib/cjs/QuantitySelector/QuantitySelector.js +267 -0
  74. package/lib/cjs/QuantitySelector/SideButton.js +77 -0
  75. package/lib/cjs/QuantitySelector/dictionary.js +32 -0
  76. package/lib/cjs/QuantitySelector/index.js +9 -0
  77. package/lib/cjs/QuantitySelector/styles.js +16 -0
  78. package/lib/cjs/ResponsiveImage/ResponsiveImage.js +107 -0
  79. package/lib/cjs/ResponsiveImage/index.js +9 -0
  80. package/lib/cjs/Ribbon/Ribbon.js +222 -0
  81. package/lib/cjs/Ribbon/index.js +9 -0
  82. package/lib/cjs/SkeletonProvider/SkeletonImage.js +45 -0
  83. package/lib/cjs/SkeletonProvider/SkeletonProvider.js +63 -0
  84. package/lib/cjs/SkeletonProvider/SkeletonTypography.js +44 -0
  85. package/lib/cjs/SkeletonProvider/index.js +9 -0
  86. package/lib/cjs/Span/Span.js +79 -0
  87. package/lib/cjs/Span/index.js +9 -0
  88. package/lib/cjs/Spinner/Spinner.js +221 -0
  89. package/lib/cjs/Spinner/SpinnerContent.js +100 -0
  90. package/lib/cjs/Spinner/constants.js +10 -0
  91. package/lib/cjs/Spinner/index.js +9 -0
  92. package/lib/cjs/StoryCard/StoryCard.js +219 -0
  93. package/lib/cjs/StoryCard/index.js +9 -0
  94. package/lib/cjs/Table/Body.js +24 -0
  95. package/lib/cjs/Table/Cell.js +187 -0
  96. package/lib/cjs/Table/Header.js +32 -0
  97. package/lib/cjs/Table/Row.js +41 -0
  98. package/lib/cjs/Table/SubHeading.js +30 -0
  99. package/lib/cjs/Table/Table.js +124 -0
  100. package/lib/cjs/Table/index.js +19 -0
  101. package/lib/cjs/TermsAndConditions/ExpandCollapse.js +160 -0
  102. package/lib/cjs/TermsAndConditions/TermsAndConditions.js +283 -0
  103. package/lib/cjs/TermsAndConditions/dictionary.js +22 -0
  104. package/lib/cjs/TermsAndConditions/index.js +13 -0
  105. package/lib/cjs/Testimonial/Testimonial.js +240 -0
  106. package/lib/cjs/Testimonial/index.js +9 -0
  107. package/lib/cjs/Toast/Toast.js +165 -0
  108. package/lib/cjs/Toast/index.js +9 -0
  109. package/lib/cjs/Video/ControlBar/ControlBar.js +294 -0
  110. package/lib/cjs/Video/ControlBar/Controls/VideoButton/VideoButton.js +76 -0
  111. package/lib/cjs/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +169 -0
  112. package/lib/cjs/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +211 -0
  113. package/lib/cjs/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +197 -0
  114. package/lib/cjs/Video/MiddleControlButton/MiddleControlButton.js +78 -0
  115. package/lib/cjs/Video/Video.js +964 -0
  116. package/lib/cjs/Video/index.js +9 -0
  117. package/lib/cjs/Video/videoText.js +61 -0
  118. package/lib/cjs/VideoPicker/VideoPicker.js +197 -0
  119. package/lib/cjs/VideoPicker/VideoPickerPlayer.js +54 -0
  120. package/lib/cjs/VideoPicker/VideoPickerThumbnail.js +223 -0
  121. package/lib/cjs/VideoPicker/VideoSlider.js +88 -0
  122. package/lib/cjs/VideoPicker/index.js +9 -0
  123. package/lib/cjs/VideoPicker/videoPropType.js +17 -0
  124. package/lib/cjs/WaffleGrid/WaffleGrid.js +164 -0
  125. package/lib/cjs/WaffleGrid/index.js +9 -0
  126. package/lib/cjs/WebVideo/WebVideo.js +197 -0
  127. package/lib/cjs/WebVideo/index.js +9 -0
  128. package/lib/cjs/WebVideo/utils/index.js +57 -0
  129. package/lib/cjs/baseExports.js +438 -0
  130. package/lib/cjs/index.js +317 -0
  131. package/lib/cjs/server.js +13 -0
  132. package/lib/cjs/shared/ConditionalWrapper/ConditionalWrapper.js +29 -0
  133. package/lib/cjs/shared/ConditionalWrapper/index.js +9 -0
  134. package/lib/cjs/shared/FullBleedContent/FullBleedContent.js +108 -0
  135. package/lib/cjs/shared/FullBleedContent/getFullBleedBorderRadius.js +61 -0
  136. package/lib/cjs/shared/FullBleedContent/index.js +23 -0
  137. package/lib/cjs/shared/FullBleedContent/useFullBleedContentProps.js +61 -0
  138. package/lib/cjs/shared/VideoSplash/SplashButton/SplashButton.js +91 -0
  139. package/lib/cjs/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +229 -0
  140. package/lib/cjs/shared/VideoSplash/VideoSplash.js +72 -0
  141. package/lib/cjs/shared/VideoSplash/helpers.js +32 -0
  142. package/lib/cjs/utils/index.js +88 -0
  143. package/lib/cjs/utils/isElementFocusable.js +14 -0
  144. package/lib/cjs/utils/logger.js +24 -0
  145. package/lib/cjs/utils/media.js +45 -0
  146. package/lib/cjs/utils/renderStructuredContent.js +71 -0
  147. package/lib/cjs/utils/scrollToAnchor.js +25 -0
  148. package/lib/cjs/utils/ssr.js +50 -0
  149. package/lib/cjs/utils/theming/get-theme-from-server.js +24 -0
  150. package/lib/cjs/utils/theming/with-client-theme.js +31 -0
  151. package/lib/cjs/utils/theming/with-server-theme.js +33 -0
  152. package/lib/cjs/utils/transforms.js +11 -0
  153. package/lib/cjs/utils/useOverlaidPosition.js +222 -0
  154. package/lib/cjs/utils/useTypographyTheme.js +30 -0
  155. package/lib/{Badge → esm/Badge}/Badge.js +11 -21
  156. package/lib/{BlockQuote → esm/BlockQuote}/BlockQuote.js +17 -31
  157. package/lib/{Breadcrumbs → esm/Breadcrumbs}/Breadcrumbs.js +6 -5
  158. package/lib/{Breadcrumbs → esm/Breadcrumbs}/Item/Item.js +10 -6
  159. package/lib/{Callout → esm/Callout}/Callout.js +6 -5
  160. package/lib/{Card → esm/Card}/Card.js +5 -5
  161. package/lib/{Card → esm/Card}/CardContent.js +6 -5
  162. package/lib/{Card → esm/Card}/CardFooter.js +6 -5
  163. package/lib/{Countdown → esm/Countdown}/Countdown.js +53 -32
  164. package/lib/{Countdown → esm/Countdown}/Segment.js +6 -6
  165. package/lib/{DatePicker → esm/DatePicker}/CalendarContainer.js +5 -5
  166. package/lib/{DatePicker → esm/DatePicker}/DatePicker.js +18 -12
  167. package/lib/esm/DatePicker/reactDatesCss.js +3 -0
  168. package/lib/{Disclaimer → esm/Disclaimer}/Disclaimer.js +6 -5
  169. package/lib/{Footnote → esm/Footnote}/Footnote.js +39 -15
  170. package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +6 -5
  171. package/lib/{NavigationBar → esm/NavigationBar}/NavigationBar.js +6 -5
  172. package/lib/{NavigationBar → esm/NavigationBar}/NavigationItem.js +6 -5
  173. package/lib/{OrderedList → esm/OrderedList}/Item.js +10 -6
  174. package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +5 -5
  175. package/lib/{OrderedList → esm/OrderedList}/OrderedList.js +6 -5
  176. package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +5 -5
  177. package/lib/{Paragraph → esm/Paragraph}/Paragraph.js +8 -16
  178. package/lib/{PreviewCard → esm/PreviewCard}/PreviewCard.js +10 -7
  179. package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +59 -69
  180. package/lib/{Progress → esm/Progress}/ProgressBar.js +6 -6
  181. package/lib/esm/QuantitySelector/styles.js +9 -0
  182. package/lib/{Ribbon → esm/Ribbon}/Ribbon.js +31 -57
  183. package/lib/{Span → esm/Span}/Span.js +7 -6
  184. package/lib/{Spinner → esm/Spinner}/Spinner.js +18 -8
  185. package/lib/{Spinner → esm/Spinner}/SpinnerContent.js +6 -5
  186. package/lib/{StoryCard → esm/StoryCard}/StoryCard.js +10 -7
  187. package/lib/{Table → esm/Table}/Cell.js +16 -45
  188. package/lib/esm/Table/Row.js +34 -0
  189. package/lib/{Table → esm/Table}/Table.js +16 -17
  190. package/lib/{TermsAndConditions → esm/TermsAndConditions}/ExpandCollapse.js +13 -7
  191. package/lib/{TermsAndConditions → esm/TermsAndConditions}/TermsAndConditions.js +22 -9
  192. package/lib/{Testimonial → esm/Testimonial}/Testimonial.js +26 -10
  193. package/lib/{Toast → esm/Toast}/Toast.js +13 -64
  194. package/lib/{Video → esm/Video}/ControlBar/ControlBar.js +18 -8
  195. package/lib/{Video → esm/Video}/ControlBar/Controls/VideoButton/VideoButton.js +6 -5
  196. package/lib/{Video → esm/Video}/ControlBar/Controls/VideoMenu/VideoMenu.js +14 -7
  197. package/lib/{Video → esm/Video}/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +14 -7
  198. package/lib/{Video → esm/Video}/ControlBar/Controls/VolumeSlider/VolumeSlider.js +10 -6
  199. package/lib/{Video → esm/Video}/MiddleControlButton/MiddleControlButton.js +6 -5
  200. package/lib/{Video → esm/Video}/Video.js +26 -10
  201. package/lib/{VideoPicker → esm/VideoPicker}/VideoPicker.js +20 -44
  202. package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerThumbnail.js +18 -52
  203. package/lib/{WaffleGrid → esm/WaffleGrid}/WaffleGrid.js +14 -7
  204. package/lib/{WebVideo → esm/WebVideo}/WebVideo.js +14 -9
  205. package/lib/{index.js → esm/index.js} +1 -1
  206. package/lib/{shared → esm/shared}/FullBleedContent/FullBleedContent.js +5 -5
  207. package/lib/{shared → esm/shared}/VideoSplash/SplashButton/SplashButton.js +9 -6
  208. package/lib/{shared → esm/shared}/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +17 -8
  209. package/lib/{shared → esm/shared}/VideoSplash/VideoSplash.js +6 -5
  210. package/lib/{utils → esm/utils}/index.js +1 -2
  211. package/lib/{utils → esm/utils}/ssr.js +1 -4
  212. package/package.json +17 -16
  213. package/src/Badge/Badge.jsx +2 -3
  214. package/src/BlockQuote/BlockQuote.jsx +2 -3
  215. package/src/Breadcrumbs/Breadcrumbs.jsx +2 -3
  216. package/src/Breadcrumbs/Item/Item.jsx +2 -3
  217. package/src/Callout/Callout.jsx +2 -4
  218. package/src/Card/Card.jsx +1 -3
  219. package/src/Card/CardContent.jsx +2 -3
  220. package/src/Card/CardFooter.jsx +2 -3
  221. package/src/Countdown/Countdown.jsx +62 -36
  222. package/src/Countdown/Segment.jsx +1 -3
  223. package/src/DatePicker/CalendarContainer.jsx +1 -3
  224. package/src/DatePicker/DatePicker.jsx +2 -3
  225. package/src/DatePicker/reactDatesCss.js +1 -3
  226. package/src/Disclaimer/Disclaimer.jsx +2 -3
  227. package/src/Footnote/Footnote.jsx +2 -10
  228. package/src/Footnote/FootnoteLink.jsx +2 -3
  229. package/src/NavigationBar/NavigationBar.jsx +2 -3
  230. package/src/NavigationBar/NavigationItem.jsx +2 -3
  231. package/src/OrderedList/Item.jsx +2 -3
  232. package/src/OrderedList/ItemBase.jsx +1 -3
  233. package/src/OrderedList/OrderedList.jsx +2 -3
  234. package/src/OrderedList/OrderedListBase.jsx +1 -3
  235. package/src/Paragraph/Paragraph.jsx +2 -4
  236. package/src/PreviewCard/PreviewCard.jsx +1 -3
  237. package/src/PriceLockup/PriceLockup.jsx +2 -3
  238. package/src/Progress/ProgressBar.jsx +1 -3
  239. package/src/QuantitySelector/styles.js +1 -3
  240. package/src/Ribbon/Ribbon.jsx +2 -3
  241. package/src/Span/Span.jsx +2 -4
  242. package/src/Spinner/Spinner.jsx +2 -3
  243. package/src/Spinner/SpinnerContent.jsx +2 -3
  244. package/src/StoryCard/StoryCard.jsx +1 -3
  245. package/src/Table/Cell.jsx +4 -5
  246. package/src/Table/Row.jsx +13 -2
  247. package/src/Table/Table.jsx +14 -5
  248. package/src/TermsAndConditions/ExpandCollapse.jsx +1 -3
  249. package/src/TermsAndConditions/TermsAndConditions.jsx +2 -3
  250. package/src/Testimonial/Testimonial.jsx +2 -3
  251. package/src/Toast/Toast.jsx +2 -3
  252. package/src/Video/ControlBar/ControlBar.jsx +2 -4
  253. package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +2 -4
  254. package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +2 -4
  255. package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +2 -4
  256. package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +2 -4
  257. package/src/Video/MiddleControlButton/MiddleControlButton.jsx +2 -4
  258. package/src/Video/Video.jsx +2 -4
  259. package/src/VideoPicker/VideoPicker.jsx +2 -4
  260. package/src/VideoPicker/VideoPickerThumbnail.jsx +1 -3
  261. package/src/WaffleGrid/WaffleGrid.jsx +2 -3
  262. package/src/WebVideo/WebVideo.jsx +3 -4
  263. package/src/index.js +1 -1
  264. package/src/shared/FullBleedContent/FullBleedContent.jsx +1 -3
  265. package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +1 -3
  266. package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +1 -4
  267. package/src/shared/VideoSplash/VideoSplash.jsx +2 -3
  268. package/src/utils/index.js +1 -3
  269. package/src/utils/ssr.js +1 -2
  270. package/lib/DatePicker/reactDatesCss.js +0 -830
  271. package/lib/QuantitySelector/styles.js +0 -18
  272. package/lib/Table/Row.js +0 -19
  273. package/lib/utils/theming/styled-components.js +0 -26
  274. package/src/utils/theming/styled-components.js +0 -23
  275. /package/lib/{Badge → esm/Badge}/index.js +0 -0
  276. /package/lib/{BlockQuote → esm/BlockQuote}/index.js +0 -0
  277. /package/lib/{Breadcrumbs → esm/Breadcrumbs}/index.js +0 -0
  278. /package/lib/{Callout → esm/Callout}/index.js +0 -0
  279. /package/lib/{Card → esm/Card}/index.js +0 -0
  280. /package/lib/{Countdown → esm/Countdown}/constants.js +0 -0
  281. /package/lib/{Countdown → esm/Countdown}/dictionary.js +0 -0
  282. /package/lib/{Countdown → esm/Countdown}/index.js +0 -0
  283. /package/lib/{Countdown → esm/Countdown}/types.js +0 -0
  284. /package/lib/{Countdown → esm/Countdown}/useCountdown.js +0 -0
  285. /package/lib/{DatePicker → esm/DatePicker}/dictionary.js +0 -0
  286. /package/lib/{DatePicker → esm/DatePicker}/index.js +0 -0
  287. /package/lib/{Disclaimer → esm/Disclaimer}/index.js +0 -0
  288. /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
  289. /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
  290. /package/lib/{IconButton → esm/IconButton}/IconButton.js +0 -0
  291. /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
  292. /package/lib/{Image → esm/Image}/Image.js +0 -0
  293. /package/lib/{Image → esm/Image}/index.js +0 -0
  294. /package/lib/{Image → esm/Image}/server.js +0 -0
  295. /package/lib/{List → esm/List}/List.js +0 -0
  296. /package/lib/{List → esm/List}/ListItem.js +0 -0
  297. /package/lib/{List → esm/List}/index.js +0 -0
  298. /package/lib/{NavigationBar → esm/NavigationBar}/NavigationSubMenu.js +0 -0
  299. /package/lib/{NavigationBar → esm/NavigationBar}/collapseItems.js +0 -0
  300. /package/lib/{NavigationBar → esm/NavigationBar}/index.js +0 -0
  301. /package/lib/{NavigationBar → esm/NavigationBar}/resolveItemSelection.js +0 -0
  302. /package/lib/{OptimizeImage → esm/OptimizeImage}/OptimizeImage.js +0 -0
  303. /package/lib/{OptimizeImage → esm/OptimizeImage}/index.js +0 -0
  304. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getFallbackUrl.js +0 -0
  305. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getImageUrls.js +0 -0
  306. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getOptimizedUrl.js +0 -0
  307. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/hasWebpSupport.js +0 -0
  308. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/index.js +0 -0
  309. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/isSvgUrl.js +0 -0
  310. /package/lib/{OrderedList → esm/OrderedList}/constants.js +0 -0
  311. /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
  312. /package/lib/{Paragraph → esm/Paragraph}/index.js +0 -0
  313. /package/lib/{PreviewCard → esm/PreviewCard}/AuthorDate.js +0 -0
  314. /package/lib/{PreviewCard → esm/PreviewCard}/index.js +0 -0
  315. /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
  316. /package/lib/{PriceLockup → esm/PriceLockup}/tokens.js +0 -0
  317. /package/lib/{Progress → esm/Progress}/index.js +0 -0
  318. /package/lib/{QuantitySelector → esm/QuantitySelector}/QuantitySelector.js +0 -0
  319. /package/lib/{QuantitySelector → esm/QuantitySelector}/SideButton.js +0 -0
  320. /package/lib/{QuantitySelector → esm/QuantitySelector}/dictionary.js +0 -0
  321. /package/lib/{QuantitySelector → esm/QuantitySelector}/index.js +0 -0
  322. /package/lib/{ResponsiveImage → esm/ResponsiveImage}/ResponsiveImage.js +0 -0
  323. /package/lib/{ResponsiveImage → esm/ResponsiveImage}/index.js +0 -0
  324. /package/lib/{Ribbon → esm/Ribbon}/index.js +0 -0
  325. /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonImage.js +0 -0
  326. /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonProvider.js +0 -0
  327. /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonTypography.js +0 -0
  328. /package/lib/{SkeletonProvider → esm/SkeletonProvider}/index.js +0 -0
  329. /package/lib/{Span → esm/Span}/index.js +0 -0
  330. /package/lib/{Spinner → esm/Spinner}/constants.js +0 -0
  331. /package/lib/{Spinner → esm/Spinner}/index.js +0 -0
  332. /package/lib/{StoryCard → esm/StoryCard}/index.js +0 -0
  333. /package/lib/{Table → esm/Table}/Body.js +0 -0
  334. /package/lib/{Table → esm/Table}/Header.js +0 -0
  335. /package/lib/{Table → esm/Table}/SubHeading.js +0 -0
  336. /package/lib/{Table → esm/Table}/index.js +0 -0
  337. /package/lib/{TermsAndConditions → esm/TermsAndConditions}/dictionary.js +0 -0
  338. /package/lib/{TermsAndConditions → esm/TermsAndConditions}/index.js +0 -0
  339. /package/lib/{Testimonial → esm/Testimonial}/index.js +0 -0
  340. /package/lib/{Toast → esm/Toast}/index.js +0 -0
  341. /package/lib/{Video → esm/Video}/index.js +0 -0
  342. /package/lib/{Video → esm/Video}/videoText.js +0 -0
  343. /package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerPlayer.js +0 -0
  344. /package/lib/{VideoPicker → esm/VideoPicker}/VideoSlider.js +0 -0
  345. /package/lib/{VideoPicker → esm/VideoPicker}/index.js +0 -0
  346. /package/lib/{VideoPicker → esm/VideoPicker}/videoPropType.js +0 -0
  347. /package/lib/{WaffleGrid → esm/WaffleGrid}/index.js +0 -0
  348. /package/lib/{WebVideo → esm/WebVideo}/index.js +0 -0
  349. /package/lib/{WebVideo → esm/WebVideo}/utils/index.js +0 -0
  350. /package/lib/{baseExports.js → esm/baseExports.js} +0 -0
  351. /package/lib/{server.js → esm/server.js} +0 -0
  352. /package/lib/{shared → esm/shared}/ConditionalWrapper/ConditionalWrapper.js +0 -0
  353. /package/lib/{shared → esm/shared}/ConditionalWrapper/index.js +0 -0
  354. /package/lib/{shared → esm/shared}/FullBleedContent/getFullBleedBorderRadius.js +0 -0
  355. /package/lib/{shared → esm/shared}/FullBleedContent/index.js +0 -0
  356. /package/lib/{shared → esm/shared}/FullBleedContent/useFullBleedContentProps.js +0 -0
  357. /package/lib/{shared → esm/shared}/VideoSplash/helpers.js +0 -0
  358. /package/lib/{utils → esm/utils}/isElementFocusable.js +0 -0
  359. /package/lib/{utils → esm/utils}/logger.js +0 -0
  360. /package/lib/{utils → esm/utils}/media.js +0 -0
  361. /package/lib/{utils → esm/utils}/renderStructuredContent.js +0 -0
  362. /package/lib/{utils → esm/utils}/scrollToAnchor.js +0 -0
  363. /package/lib/{utils → esm/utils}/theming/get-theme-from-server.js +0 -0
  364. /package/lib/{utils → esm/utils}/theming/with-client-theme.js +0 -0
  365. /package/lib/{utils → esm/utils}/theming/with-server-theme.js +0 -0
  366. /package/lib/{utils → esm/utils}/transforms.js +0 -0
  367. /package/lib/{utils → esm/utils}/useOverlaidPosition.js +0 -0
  368. /package/lib/{utils → esm/utils}/useTypographyTheme.js +0 -0
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _Video = _interopRequireDefault(require("./Video"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ var _default = exports.default = _Video.default;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ const videoText = {
8
+ en: {
9
+ videoPlayer: 'Press the space bar or K to toggle play and pause. Use the left and right arrow keys or the comma and period keys to scrub through the video. Use the up and down arrow keys, the dash and equal keys, or the add and subtract number pad keys to increase and decrease volume. Press M to toggle mute. Press F to toggle fullscreen. Press escape to exit instructions and return to video.',
10
+ videoSelected: 'Video selected. Press Q to listen to controls.',
11
+ videoSelectedSimple: 'Video selected. Press the space bar or K to toggle play and pause.',
12
+ mute: 'Mute',
13
+ unmute: 'Unmute',
14
+ watch: 'Watch the video',
15
+ replay: 'Replay the video',
16
+ itemSelected: 'This is the currently selected option.',
17
+ itemUnselected: 'Select to switch to this option.',
18
+ captionsToggle: 'Select captions',
19
+ captionsDialogue: 'Captions',
20
+ captionsNone: 'None',
21
+ qualityToggle: 'Change video quality',
22
+ qualityDialogue: 'Quality',
23
+ fullScreenToggle: 'Toggle fullscreen',
24
+ minute: 'minute',
25
+ minutes: 'minutes',
26
+ second: 'second',
27
+ seconds: 'seconds',
28
+ ariaLabel: 'Play video. Video length is {minutes} and {seconds}.',
29
+ volumeSliderLabel: 'Adjust the volume',
30
+ videoProgressBarLabel: 'Progress bar',
31
+ en: 'English',
32
+ fr: 'French'
33
+ },
34
+ fr: {
35
+ videoPlayer: 'Appuyer sur K pour basculer entre lecture et pause. Utiliser les flèches gauche et droite ou les touches virgule et point pour reculer ou faire une avance rapide dans la vidéo. Utiliser les flèches ascendante et descendante, les touches tiret et égal ou les touches plus et moins du clavier numérique pour contrôler le volume. Appuyer sur la touche M pour désactiver le son. Appuyer sur F pour basculer en mode plein écran. Appuyer sur la touche d’échappement pour quitter les instructions et retourner à la vidéo.',
36
+ videoSelected: 'Vidéo sélectionnée. Appuyer sur Q pour écouter les contrôles',
37
+ videoSelectedSimple: 'Vidéo sélectionnée. Appuyer sur K pour basculer entre lecture et pause.',
38
+ mute: 'Désactiver le son',
39
+ unmute: 'Activer le son',
40
+ watch: 'Voir la vidéo',
41
+ replay: 'Relire la vidéo',
42
+ itemSelected: 'Cette option est déjà sélectionnée.',
43
+ itemUnselected: 'Sélectionner pour basculer à cette option.',
44
+ captionsToggle: 'Sélectionner les sous-titres',
45
+ captionsDialogue: 'Sous-titres',
46
+ captionsNone: 'Aucun',
47
+ qualityToggle: 'Modifier la qualité de la vidéo',
48
+ qualityDialogue: 'Qualité',
49
+ fullScreenToggle: 'Basculer en mode plein écran',
50
+ minute: 'minute',
51
+ minutes: 'minutes',
52
+ second: 'seconde',
53
+ seconds: 'secondes',
54
+ ariaLabel: 'Lire la vidéo. La durée de la vidéo est de {minutes} et {seconds}.',
55
+ volumeSliderLabel: 'Réglez le volume',
56
+ videoProgressBarLabel: 'Barre de progression',
57
+ en: 'Anglais',
58
+ fr: 'Français'
59
+ }
60
+ };
61
+ var _default = exports.default = videoText;
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _systemConstants = require("@telus-uds/system-constants");
10
+ var _componentsBase = require("@telus-uds/components-base");
11
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
12
+ var _videoPropType = require("./videoPropType");
13
+ var _VideoPickerThumbnail = _interopRequireDefault(require("./VideoPickerThumbnail"));
14
+ var _VideoPickerPlayer = _interopRequireDefault(require("./VideoPickerPlayer"));
15
+ var _VideoSlider = _interopRequireDefault(require("./VideoSlider"));
16
+ var _utils = require("../utils");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
+ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
22
+ const framedContainerStyles = _ref => {
23
+ let {
24
+ framedContainerBackgroundColor,
25
+ framedContainerBorderWidth,
26
+ framedContainerBorderColor,
27
+ framedContainerBorderRadius,
28
+ framedMaxHeight
29
+ } = _ref;
30
+ return (0, _styledComponents.css)(["background-color:", ";border:", "px solid ", ";border-radius:", "px;& > div{max-height:", "px;}"], framedContainerBackgroundColor, framedContainerBorderWidth, framedContainerBorderColor, framedContainerBorderRadius, framedMaxHeight);
31
+ };
32
+ const VideoPickerContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
33
+ displayName: "VideoPicker__VideoPickerContainer",
34
+ componentId: "components-web__sc-x6lxp0-0"
35
+ })(["", ""], _ref2 => {
36
+ let {
37
+ isFramed,
38
+ ...tokens
39
+ } = _ref2;
40
+ return isFramed && framedContainerStyles(tokens);
41
+ });
42
+ const framedPlayerContainerStyles = _ref3 => {
43
+ let {
44
+ framedMaxHeight,
45
+ framedContainerPadding
46
+ } = _ref3;
47
+ return (0, _styledComponents.css)(["width:66.67%;padding:", "px;max-height:", "px;flex-shrink:0;box-sizing:border-box;"], framedContainerPadding, framedMaxHeight);
48
+ };
49
+ const VideoPlayerContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
50
+ displayName: "VideoPicker__VideoPlayerContainer",
51
+ componentId: "components-web__sc-x6lxp0-1"
52
+ })(["", " overflow:auto;"], _ref4 => {
53
+ let {
54
+ isFramed,
55
+ ...tokens
56
+ } = _ref4;
57
+ return isFramed && framedPlayerContainerStyles(tokens);
58
+ });
59
+ const framedVideoListContainerStyle = /*#__PURE__*/(0, _styledComponents.css)(["max-height:", "px;overflow:auto;flex-direction:column;"], _ref5 => {
60
+ let {
61
+ framedMaxHeight
62
+ } = _ref5;
63
+ return framedMaxHeight;
64
+ });
65
+ const VideoListContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
66
+ displayName: "VideoPicker__VideoListContainer",
67
+ componentId: "components-web__sc-x6lxp0-2"
68
+ })(["display:flex;justify-content:flex-start;position:relative;flex-grow:1;flex-direction:column;", ""], props => props.isFramed && framedVideoListContainerStyle);
69
+ const VideoPicker = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
70
+ let {
71
+ videoList = [],
72
+ selectedVideo = videoList[0]?.videoId,
73
+ frame,
74
+ onStartVideo = () => {},
75
+ onSelectVideo = () => {},
76
+ onPlay = () => {},
77
+ onPause = () => {},
78
+ onProgress = () => {},
79
+ ...rest
80
+ } = _ref6;
81
+ const viewport = (0, _componentsBase.useViewport)();
82
+ const {
83
+ stackViewDividerColor,
84
+ ...themeTokens
85
+ } = (0, _componentsBase.useThemeTokens)('VideoPicker');
86
+ const [currentVideoId, setCurrentVideoId] = _react.default.useState(selectedVideo);
87
+ const videoPlayerRef = _react.default.useRef(null);
88
+ const currentVideo = videoList.find(video => video.videoId === currentVideoId);
89
+ _react.default.useEffect(() => {
90
+ // Update current video if parent changes which video id it passes down
91
+ setCurrentVideoId(selectedVideo);
92
+ }, [selectedVideo]);
93
+ const addVideoEventHandlers = video => {
94
+ if (!video) return {};
95
+ return {
96
+ ...video,
97
+ onPlay: video.onPlay || onPlay,
98
+ onPause: video.onPause || onPause,
99
+ onProgress: video.onProgress || onProgress
100
+ };
101
+ };
102
+
103
+ // `frame` variant should only work on larger screens
104
+ const isFramed = frame && [_systemConstants.viewports.lg, _systemConstants.viewports.xl].includes(viewport);
105
+ const hasSlider = !frame && [_systemConstants.viewports.md, _systemConstants.viewports.lg, _systemConstants.viewports.xl].includes(viewport);
106
+ const listElements = videoList.map((video, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoPickerThumbnail.default, {
107
+ video: video,
108
+ videoPlayerRef: videoPlayerRef,
109
+ selectedVideoId: currentVideoId,
110
+ onSelectVideo: current => {
111
+ setCurrentVideoId(current.videoId);
112
+ onSelectVideo(current);
113
+ },
114
+ layout: !hasSlider ? 'horizontal' : 'vertical',
115
+ index: index,
116
+ isFramed: isFramed
117
+ }, video.videoId));
118
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(VideoPickerContainer, {
119
+ ref: ref,
120
+ isFramed: isFramed,
121
+ ...selectProps(rest),
122
+ ...themeTokens,
123
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
124
+ divider: isFramed ? {
125
+ tokens: {
126
+ color: stackViewDividerColor
127
+ }
128
+ } : {
129
+ variant: {
130
+ decorative: true
131
+ }
132
+ },
133
+ space: isFramed ? 0 : 4 // everything has internal padding in `frame` variant
134
+ ,
135
+ direction: isFramed ? 'row' : 'column',
136
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(VideoPlayerContainer, {
137
+ ...themeTokens,
138
+ isFramed: isFramed,
139
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoPickerPlayer.default, {
140
+ video: addVideoEventHandlers(currentVideo, onPlay, onPause, onProgress),
141
+ videoPlayerRef: videoPlayerRef,
142
+ onStartVideo: onStartVideo
143
+ })
144
+ }), hasSlider ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoSlider.default, {
145
+ children: listElements
146
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(VideoListContainer, {
147
+ viewport: viewport,
148
+ "data-testid": "video-list-container",
149
+ isFramed: isFramed,
150
+ children: listElements
151
+ })]
152
+ })
153
+ });
154
+ });
155
+ VideoPicker.displayName = 'VideoPicker';
156
+ VideoPicker.propTypes = {
157
+ ...selectedSystemPropTypes,
158
+ tokens: (0, _componentsBase.getTokensPropType)('VideoPicker'),
159
+ /**
160
+ * Id of the currently selected video (defaults to the first video if not set).
161
+ */
162
+ selectedVideo: _propTypes.default.string,
163
+ /**
164
+ * An array of Video objects.
165
+ */
166
+ videoList: _propTypes.default.arrayOf(_videoPropType.VideoPropType),
167
+ /**
168
+ * Use to display the picker in a container and the playlist as a sidebar (only available for breakpoints LG and larger)
169
+ */
170
+ frame: _propTypes.default.bool,
171
+ /**
172
+ * Callback function trigerred when the video player starts playing video.
173
+ * @param {object} video - The video object that is playing.
174
+ */
175
+ onStartVideo: _propTypes.default.func,
176
+ /**
177
+ * Callback function trigerred when a video is selected from the thumbnail list.
178
+ * @param {object} video - The video object that is selected.
179
+ */
180
+ onSelectVideo: _propTypes.default.func,
181
+ /**
182
+ * Callback function trigerred during progress milestones 10% 25% 50% 75% 100%.
183
+ * @param {object} event - The event object.
184
+ */
185
+ onProgress: _propTypes.default.func,
186
+ /**
187
+ * Callback function trigerred when the video player starts playing video.
188
+ * @param {object} event - The event object.
189
+ */
190
+ onPlay: _propTypes.default.func,
191
+ /**
192
+ * Callback function trigerred when the video gets paused.
193
+ * @param {object} event - The event object.
194
+ */
195
+ onPause: _propTypes.default.func
196
+ };
197
+ var _default = exports.default = VideoPicker;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _componentsBase = require("@telus-uds/components-base");
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _WebVideo = _interopRequireDefault(require("../WebVideo/WebVideo"));
11
+ var _videoPropType = require("./videoPropType");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const VideoPickerPlayer = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
15
+ let {
16
+ video = {},
17
+ videoPlayerRef,
18
+ onStartVideo = () => {}
19
+ } = _ref;
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
21
+ space: 3,
22
+ tokens: {
23
+ flexShrink: 1
24
+ },
25
+ ref: ref,
26
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
27
+ ref: videoPlayerRef,
28
+ children: video.videoId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_WebVideo.default, {
29
+ ...video,
30
+ onStart: () => onStartVideo(video)
31
+ })
32
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
33
+ space: 2,
34
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
35
+ variant: {
36
+ size: 'h3'
37
+ },
38
+ children: video.title
39
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
40
+ variant: {
41
+ colour: 'default'
42
+ },
43
+ children: video.description
44
+ })]
45
+ })]
46
+ });
47
+ });
48
+ VideoPickerPlayer.displayName = 'VideoPickerPlayer';
49
+ VideoPickerPlayer.propTypes = {
50
+ video: _videoPropType.VideoPropType,
51
+ videoPlayerRef: _videoPropType.RefPropType,
52
+ onStartVideo: _propTypes.default.func
53
+ };
54
+ var _default = exports.default = VideoPickerPlayer;
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
9
+ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+ var _systemConstants = require("@telus-uds/system-constants");
12
+ var _componentsBase = require("@telus-uds/components-base");
13
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
14
+ var _helpers = require("../shared/VideoSplash/helpers");
15
+ var _videoPropType = require("./videoPropType");
16
+ var _VideoSplash = _interopRequireDefault(require("../shared/VideoSplash/VideoSplash"));
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ const {
20
+ getItemPositionLayoutHandler,
21
+ itemPositionsPropType
22
+ } = _componentsBase.horizontalScrollUtils;
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
26
+ const createReactNativeStyles = _ref => {
27
+ let {
28
+ pressablePaddingBottom,
29
+ pressablePaddingVertical,
30
+ pressablePaddingHorizontal,
31
+ pressableBorderTopWidth,
32
+ pressableBorderTopColor
33
+ } = _ref;
34
+ return _StyleSheet.default.create({
35
+ container: {
36
+ cursor: 'pointer'
37
+ },
38
+ horizontal: {
39
+ paddingBottom: pressablePaddingBottom
40
+ },
41
+ framed: {
42
+ paddingVertical: pressablePaddingVertical,
43
+ paddingHorizontal: pressablePaddingHorizontal
44
+ },
45
+ framedLine: {
46
+ borderTopWidth: pressableBorderTopWidth,
47
+ borderTopColor: pressableBorderTopColor
48
+ }
49
+ });
50
+ };
51
+ const ImageContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
52
+ displayName: "VideoPickerThumbnail__ImageContainer",
53
+ componentId: "components-web__sc-1glxurq-0"
54
+ })(["padding:", ";border:", ";border-radius:", "px;"], props => `${props.outerBorderGap}px`, props => `${props.outerBorderWidth}px solid ${props.outerBorderColor}`, _ref2 => {
55
+ let {
56
+ outerBorderRadius
57
+ } = _ref2;
58
+ return outerBorderRadius;
59
+ });
60
+ const VideoThumbnail = /*#__PURE__*/_styledComponents.default.div.withConfig({
61
+ displayName: "VideoPickerThumbnail__VideoThumbnail",
62
+ componentId: "components-web__sc-1glxurq-1"
63
+ })(["position:relative;width:", ";flex-shrink:0;* button{display:none;}&::before{content:'';display:block;padding-bottom:56.25%;}&::after{content:'';border:", "px solid;border-color:", ";border-radius:", "px;position:absolute;top:0;left:0;right:0;bottom:0;}& > div{border-radius:", "px;}"], props => props.layout === 'vertical' ? '100%' : '144px', _ref3 => {
64
+ let {
65
+ borderWidth
66
+ } = _ref3;
67
+ return borderWidth;
68
+ }, _ref4 => {
69
+ let {
70
+ borderColor
71
+ } = _ref4;
72
+ return borderColor;
73
+ }, _ref5 => {
74
+ let {
75
+ borderRadius
76
+ } = _ref5;
77
+ return borderRadius;
78
+ }, _ref6 => {
79
+ let {
80
+ borderRadius
81
+ } = _ref6;
82
+ return borderRadius;
83
+ });
84
+ const ThumbnailTitleContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
85
+ displayName: "VideoPickerThumbnail__ThumbnailTitleContainer",
86
+ componentId: "components-web__sc-1glxurq-2"
87
+ })(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;"]);
88
+ const VideoPickerThumbnail = /*#__PURE__*/_react.default.forwardRef((_ref7, ref) => {
89
+ let {
90
+ videoPlayerRef,
91
+ selectedVideoId,
92
+ video,
93
+ onSelectVideo,
94
+ layout = 'vertical',
95
+ isFramed,
96
+ itemPositions,
97
+ index,
98
+ width = '100%'
99
+ } = _ref7;
100
+ const viewport = (0, _componentsBase.useViewport)();
101
+ const getTokens = (0, _componentsBase.useThemeTokensCallback)('VideoPickerThumbnail', {}, {});
102
+ const {
103
+ timestamp
104
+ } = (0, _helpers.getTimestamp)(video.videoLength, video.copy);
105
+ const isPlaying = selectedVideoId === video.videoId;
106
+ const renderThumbnailImage = themeTokens => {
107
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(VideoThumbnail, {
108
+ ...themeTokens,
109
+ isPlaying: isPlaying,
110
+ layout: layout,
111
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoSplash.default, {
112
+ simpleMode: true,
113
+ poster: video.posterSrc || `https://img.youtube.com/vi/${video.videoId}/maxresdefault.jpg`,
114
+ videoLength: video.videoLength,
115
+ copy: video.copy
116
+ })
117
+ });
118
+ };
119
+ const renderThumbnailInfo = _ref8 => {
120
+ let {
121
+ titleColor,
122
+ subTitleColor
123
+ } = _ref8;
124
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
125
+ space: 2,
126
+ tokens: {
127
+ flexShrink: 1
128
+ },
129
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ThumbnailTitleContainer, {
130
+ viewport: viewport,
131
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
132
+ variant: {
133
+ bold: true
134
+ },
135
+ tokens: {
136
+ color: titleColor
137
+ },
138
+ children: video.title
139
+ })
140
+ }), viewport !== _systemConstants.viewports.xs && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
141
+ variant: {
142
+ size: 'micro'
143
+ },
144
+ tokens: {
145
+ color: subTitleColor
146
+ },
147
+ children: timestamp
148
+ })]
149
+ });
150
+ };
151
+ const handleLayout = itemPositions !== undefined ? getItemPositionLayoutHandler(itemPositions.positions, index) : undefined;
152
+ const onKeyPress = event => {
153
+ if (['Space', 'Enter'].includes(event.key)) {
154
+ onSelectVideo(video);
155
+ const splashButton = videoPlayerRef.current?.querySelector('button');
156
+ if (splashButton) splashButton.focus();
157
+ }
158
+ };
159
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
160
+ onLayout: handleLayout,
161
+ onPress: () => onSelectVideo(video),
162
+ testID: `thumbnail-container-${video.videoId}`,
163
+ onKeyPress: onKeyPress,
164
+ accessibilityRole: "radio",
165
+ accessibilityState: {
166
+ checked: isPlaying
167
+ },
168
+ style: _ref9 => {
169
+ let {
170
+ hovered: hover,
171
+ focused: focus,
172
+ pressed
173
+ } = _ref9;
174
+ const themeTokens = getTokens({
175
+ hover,
176
+ focus,
177
+ pressed,
178
+ selected: isPlaying
179
+ });
180
+ const rnStyles = createReactNativeStyles(themeTokens);
181
+ return [rnStyles.container, layout === 'horizontal' && rnStyles.horizontal, isFramed && rnStyles.framed, isFramed && index > 0 && rnStyles.framedLine, {
182
+ width
183
+ }, {
184
+ outline: 'none'
185
+ }];
186
+ },
187
+ ref: ref,
188
+ children: _ref10 => {
189
+ let {
190
+ hovered: hover,
191
+ focused: focus,
192
+ pressed
193
+ } = _ref10;
194
+ const themeTokens = getTokens({
195
+ hover,
196
+ focus,
197
+ pressed,
198
+ selected: isPlaying
199
+ });
200
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
201
+ space: layout === 'vertical' ? 2 : 3,
202
+ direction: layout === 'vertical' ? 'column' : 'row',
203
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ImageContainer, {
204
+ ...themeTokens,
205
+ children: renderThumbnailImage(themeTokens)
206
+ }), renderThumbnailInfo(themeTokens)]
207
+ });
208
+ }
209
+ }, video.videoId);
210
+ });
211
+ VideoPickerThumbnail.displayName = 'VideoPickerThumbnail';
212
+ VideoPickerThumbnail.propTypes = {
213
+ selectedVideoId: _propTypes.default.string,
214
+ onSelectVideo: _propTypes.default.func,
215
+ video: _videoPropType.VideoPropType,
216
+ videoPlayerRef: _videoPropType.RefPropType,
217
+ layout: _propTypes.default.oneOf(['vertical', 'horizontal']),
218
+ isFramed: _propTypes.default.bool,
219
+ itemPositions: itemPositionsPropType,
220
+ index: _propTypes.default.number,
221
+ width: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
222
+ };
223
+ var _default = exports.default = VideoPickerThumbnail;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _componentsBase = require("@telus-uds/components-base");
9
+ var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ const {
14
+ useItemPositions
15
+ } = _componentsBase.horizontalScrollUtils;
16
+ const VideoSlider = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
17
+ let {
18
+ children
19
+ } = _ref;
20
+ const viewport = (0, _componentsBase.useViewport)();
21
+ const [itemPositions] = useItemPositions();
22
+ const [containerWidth, setContainerWidth] = _react.default.useState(null);
23
+ const {
24
+ previousIcon: PreviousIcon,
25
+ nextIcon: NextIcon
26
+ } = (0, _componentsBase.useThemeTokens)('VideoPickerSlider');
27
+ const onLayout = _ref2 => {
28
+ let {
29
+ nativeEvent: {
30
+ layout: {
31
+ width
32
+ }
33
+ }
34
+ } = _ref2;
35
+ setContainerWidth(width);
36
+ };
37
+ const itemsGap = 32; // '5' on spacing scale
38
+ const itemsCount = viewport === 'lg' || viewport === 'xl' ? 4 : 3;
39
+ const itemGapPortioned = (itemsCount - 1) * itemsGap / itemsCount;
40
+ const itemWidth = containerWidth === null ?
41
+ // For first render, we don't know container width, so avoid flicker with static % width
42
+ `calc(${Math.round(100 / itemsCount)}% - ${Math.round(itemGapPortioned)}px)` :
43
+ // After first render, can't use % widths because parent is > 100% width horizontal scroll area
44
+ Math.max(containerWidth / itemsCount - itemGapPortioned, 0 // Prevent negative width breaking layout on very narrow containers
45
+ );
46
+ const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.StackView, {
47
+ space: 5,
48
+ direction: "row",
49
+ accessibilityRole: "radiogroup",
50
+ tokens: {
51
+ flexGrow: 1
52
+ },
53
+ children: _react.default.Children.map(children, (child, index) => /*#__PURE__*/_react.default.cloneElement(child, {
54
+ index,
55
+ itemPositions,
56
+ width: itemWidth
57
+ }))
58
+ });
59
+ const overflow = containerWidth === null && {
60
+ overflow: 'hidden'
61
+ };
62
+ const horizontalScrollTokens = {
63
+ nextIcon: NextIcon,
64
+ previousIcon: PreviousIcon,
65
+ gutter: 0,
66
+ borderBottomWidth: 0,
67
+ borderBottomColor: 'transparent',
68
+ buttonClearance: 0
69
+ };
70
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
71
+ onLayout: onLayout,
72
+ style: overflow,
73
+ ref: ref,
74
+ children: containerWidth === null ?
75
+ // Use a 100% width non-scrollable parent until containerWidth is known, to avoid flicker
76
+ content : /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.HorizontalScroll, {
77
+ ScrollButton: _componentsBase.HorizontalScrollButton,
78
+ itemPositions: itemPositions,
79
+ tokens: horizontalScrollTokens,
80
+ children: content
81
+ })
82
+ });
83
+ });
84
+ VideoSlider.displayName = 'VideoSlider';
85
+ VideoSlider.propTypes = {
86
+ children: _propTypes.default.node
87
+ };
88
+ var _default = exports.default = VideoSlider;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _VideoPicker = _interopRequireDefault(require("./VideoPicker"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ var _default = exports.default = _VideoPicker.default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VideoPropType = exports.RefPropType = void 0;
7
+ var _propTypes = _interopRequireDefault(require("prop-types"));
8
+ var _WebVideo = require("../WebVideo/WebVideo");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const VideoPropType = exports.VideoPropType = _propTypes.default.shape({
11
+ ..._WebVideo.VideoProps,
12
+ title: _propTypes.default.string,
13
+ description: _propTypes.default.string
14
+ });
15
+ const RefPropType = exports.RefPropType = _propTypes.default.shape({
16
+ current: _propTypes.default.object
17
+ });