@telus-uds/components-web 3.3.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 (378) hide show
  1. package/.eslintrc.cjs +7 -1
  2. package/CHANGELOG.md +38 -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/{NavigationBar → cjs/NavigationBar}/collapseItems.js +9 -4
  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 -19
  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 +10 -10
  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 +24 -20
  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 +43 -22
  170. package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +6 -5
  171. package/lib/{NavigationBar → esm/NavigationBar}/NavigationBar.js +19 -20
  172. package/lib/{NavigationBar → esm/NavigationBar}/NavigationItem.js +6 -5
  173. package/lib/{NavigationBar → esm/NavigationBar}/NavigationSubMenu.js +1 -2
  174. package/lib/esm/NavigationBar/collapseItems.js +37 -0
  175. package/lib/{NavigationBar → esm/NavigationBar}/resolveItemSelection.js +1 -1
  176. package/lib/{OrderedList → esm/OrderedList}/Item.js +10 -6
  177. package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +5 -5
  178. package/lib/{OrderedList → esm/OrderedList}/OrderedList.js +8 -8
  179. package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +5 -5
  180. package/lib/{Paragraph → esm/Paragraph}/Paragraph.js +8 -16
  181. package/lib/{PreviewCard → esm/PreviewCard}/PreviewCard.js +10 -7
  182. package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +59 -69
  183. package/lib/{Progress → esm/Progress}/ProgressBar.js +6 -6
  184. package/lib/esm/QuantitySelector/styles.js +9 -0
  185. package/lib/{Ribbon → esm/Ribbon}/Ribbon.js +31 -57
  186. package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonImage.js +3 -4
  187. package/lib/esm/SkeletonProvider/SkeletonTypography.js +37 -0
  188. package/lib/{Span → esm/Span}/Span.js +7 -6
  189. package/lib/{Spinner → esm/Spinner}/Spinner.js +18 -8
  190. package/lib/{Spinner → esm/Spinner}/SpinnerContent.js +6 -5
  191. package/lib/{StoryCard → esm/StoryCard}/StoryCard.js +10 -7
  192. package/lib/{Table → esm/Table}/Cell.js +16 -45
  193. package/lib/esm/Table/Row.js +34 -0
  194. package/lib/{Table → esm/Table}/Table.js +18 -20
  195. package/lib/{TermsAndConditions → esm/TermsAndConditions}/ExpandCollapse.js +15 -8
  196. package/lib/{TermsAndConditions → esm/TermsAndConditions}/TermsAndConditions.js +22 -9
  197. package/lib/{Testimonial → esm/Testimonial}/Testimonial.js +26 -10
  198. package/lib/{Toast → esm/Toast}/Toast.js +15 -67
  199. package/lib/{Video → esm/Video}/ControlBar/ControlBar.js +18 -8
  200. package/lib/{Video → esm/Video}/ControlBar/Controls/VideoButton/VideoButton.js +7 -7
  201. package/lib/{Video → esm/Video}/ControlBar/Controls/VideoMenu/VideoMenu.js +14 -7
  202. package/lib/{Video → esm/Video}/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +14 -7
  203. package/lib/{Video → esm/Video}/ControlBar/Controls/VolumeSlider/VolumeSlider.js +10 -6
  204. package/lib/{Video → esm/Video}/MiddleControlButton/MiddleControlButton.js +6 -5
  205. package/lib/{Video → esm/Video}/Video.js +28 -12
  206. package/lib/{VideoPicker → esm/VideoPicker}/VideoPicker.js +21 -46
  207. package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerThumbnail.js +19 -54
  208. package/lib/{WaffleGrid → esm/WaffleGrid}/WaffleGrid.js +14 -7
  209. package/lib/{WebVideo → esm/WebVideo}/WebVideo.js +14 -9
  210. package/lib/{baseExports.js → esm/baseExports.js} +1 -1
  211. package/lib/{index.js → esm/index.js} +1 -2
  212. package/lib/{shared → esm/shared}/FullBleedContent/FullBleedContent.js +5 -5
  213. package/lib/{shared → esm/shared}/VideoSplash/SplashButton/SplashButton.js +9 -6
  214. package/lib/{shared → esm/shared}/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +17 -8
  215. package/lib/{shared → esm/shared}/VideoSplash/VideoSplash.js +6 -5
  216. package/lib/{utils → esm/utils}/index.js +1 -2
  217. package/lib/{utils → esm/utils}/scrollToAnchor.js +2 -2
  218. package/lib/{utils → esm/utils}/ssr.js +8 -4
  219. package/lib/{utils → esm/utils}/useOverlaidPosition.js +2 -4
  220. package/package.json +17 -16
  221. package/src/Badge/Badge.jsx +4 -3
  222. package/src/BlockQuote/BlockQuote.jsx +2 -3
  223. package/src/Breadcrumbs/Breadcrumbs.jsx +2 -3
  224. package/src/Breadcrumbs/Item/Item.jsx +2 -3
  225. package/src/Callout/Callout.jsx +2 -4
  226. package/src/Card/Card.jsx +1 -3
  227. package/src/Card/CardContent.jsx +2 -3
  228. package/src/Card/CardFooter.jsx +2 -3
  229. package/src/Countdown/Countdown.jsx +62 -36
  230. package/src/Countdown/Segment.jsx +1 -3
  231. package/src/DatePicker/CalendarContainer.jsx +1 -3
  232. package/src/DatePicker/DatePicker.jsx +2 -3
  233. package/src/DatePicker/reactDatesCss.js +1 -3
  234. package/src/Disclaimer/Disclaimer.jsx +2 -3
  235. package/src/Footnote/Footnote.jsx +2 -10
  236. package/src/Footnote/FootnoteLink.jsx +2 -3
  237. package/src/NavigationBar/NavigationBar.jsx +2 -3
  238. package/src/NavigationBar/NavigationItem.jsx +2 -3
  239. package/src/OrderedList/Item.jsx +2 -3
  240. package/src/OrderedList/ItemBase.jsx +1 -3
  241. package/src/OrderedList/OrderedList.jsx +2 -3
  242. package/src/OrderedList/OrderedListBase.jsx +1 -3
  243. package/src/Paragraph/Paragraph.jsx +2 -4
  244. package/src/PreviewCard/PreviewCard.jsx +1 -3
  245. package/src/PriceLockup/PriceLockup.jsx +2 -3
  246. package/src/Progress/ProgressBar.jsx +1 -3
  247. package/src/QuantitySelector/styles.js +1 -3
  248. package/src/Ribbon/Ribbon.jsx +2 -3
  249. package/src/Span/Span.jsx +2 -4
  250. package/src/Spinner/Spinner.jsx +2 -3
  251. package/src/Spinner/SpinnerContent.jsx +2 -3
  252. package/src/StoryCard/StoryCard.jsx +1 -3
  253. package/src/Table/Cell.jsx +4 -5
  254. package/src/Table/Row.jsx +13 -2
  255. package/src/Table/Table.jsx +14 -5
  256. package/src/TermsAndConditions/ExpandCollapse.jsx +6 -4
  257. package/src/TermsAndConditions/TermsAndConditions.jsx +2 -3
  258. package/src/Testimonial/Testimonial.jsx +2 -3
  259. package/src/Toast/Toast.jsx +2 -3
  260. package/src/Video/ControlBar/ControlBar.jsx +2 -4
  261. package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +2 -4
  262. package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +2 -4
  263. package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +2 -4
  264. package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +2 -4
  265. package/src/Video/MiddleControlButton/MiddleControlButton.jsx +2 -4
  266. package/src/Video/Video.jsx +2 -4
  267. package/src/VideoPicker/VideoPicker.jsx +2 -4
  268. package/src/VideoPicker/VideoPickerThumbnail.jsx +1 -3
  269. package/src/WaffleGrid/WaffleGrid.jsx +2 -3
  270. package/src/WebVideo/WebVideo.jsx +3 -4
  271. package/src/baseExports.js +1 -0
  272. package/src/index.js +1 -2
  273. package/src/shared/FullBleedContent/FullBleedContent.jsx +1 -3
  274. package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +1 -3
  275. package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +1 -4
  276. package/src/shared/VideoSplash/VideoSplash.jsx +2 -3
  277. package/src/utils/index.js +1 -3
  278. package/src/utils/ssr.js +10 -3
  279. package/types/Callout.d.ts +2 -1
  280. package/types/Tooltip.d.ts +1 -0
  281. package/lib/DatePicker/reactDatesCss.js +0 -830
  282. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
  283. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -116
  284. package/lib/ExpandCollapseMini/index.js +0 -2
  285. package/lib/QuantitySelector/styles.js +0 -18
  286. package/lib/SkeletonProvider/SkeletonTypography.js +0 -38
  287. package/lib/Table/Row.js +0 -19
  288. package/lib/utils/theming/styled-components.js +0 -26
  289. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +0 -72
  290. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +0 -104
  291. package/src/ExpandCollapseMini/index.js +0 -3
  292. package/src/utils/theming/styled-components.js +0 -23
  293. /package/lib/{Badge → esm/Badge}/index.js +0 -0
  294. /package/lib/{BlockQuote → esm/BlockQuote}/index.js +0 -0
  295. /package/lib/{Breadcrumbs → esm/Breadcrumbs}/index.js +0 -0
  296. /package/lib/{Callout → esm/Callout}/index.js +0 -0
  297. /package/lib/{Card → esm/Card}/index.js +0 -0
  298. /package/lib/{Countdown → esm/Countdown}/constants.js +0 -0
  299. /package/lib/{Countdown → esm/Countdown}/dictionary.js +0 -0
  300. /package/lib/{Countdown → esm/Countdown}/index.js +0 -0
  301. /package/lib/{Countdown → esm/Countdown}/types.js +0 -0
  302. /package/lib/{Countdown → esm/Countdown}/useCountdown.js +0 -0
  303. /package/lib/{DatePicker → esm/DatePicker}/dictionary.js +0 -0
  304. /package/lib/{DatePicker → esm/DatePicker}/index.js +0 -0
  305. /package/lib/{Disclaimer → esm/Disclaimer}/index.js +0 -0
  306. /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
  307. /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
  308. /package/lib/{IconButton → esm/IconButton}/IconButton.js +0 -0
  309. /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
  310. /package/lib/{Image → esm/Image}/Image.js +0 -0
  311. /package/lib/{Image → esm/Image}/index.js +0 -0
  312. /package/lib/{Image → esm/Image}/server.js +0 -0
  313. /package/lib/{List → esm/List}/List.js +0 -0
  314. /package/lib/{List → esm/List}/ListItem.js +0 -0
  315. /package/lib/{List → esm/List}/index.js +0 -0
  316. /package/lib/{NavigationBar → esm/NavigationBar}/index.js +0 -0
  317. /package/lib/{OptimizeImage → esm/OptimizeImage}/OptimizeImage.js +0 -0
  318. /package/lib/{OptimizeImage → esm/OptimizeImage}/index.js +0 -0
  319. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getFallbackUrl.js +0 -0
  320. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getImageUrls.js +0 -0
  321. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getOptimizedUrl.js +0 -0
  322. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/hasWebpSupport.js +0 -0
  323. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/index.js +0 -0
  324. /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/isSvgUrl.js +0 -0
  325. /package/lib/{OrderedList → esm/OrderedList}/constants.js +0 -0
  326. /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
  327. /package/lib/{Paragraph → esm/Paragraph}/index.js +0 -0
  328. /package/lib/{PreviewCard → esm/PreviewCard}/AuthorDate.js +0 -0
  329. /package/lib/{PreviewCard → esm/PreviewCard}/index.js +0 -0
  330. /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
  331. /package/lib/{PriceLockup → esm/PriceLockup}/tokens.js +0 -0
  332. /package/lib/{Progress → esm/Progress}/index.js +0 -0
  333. /package/lib/{QuantitySelector → esm/QuantitySelector}/QuantitySelector.js +0 -0
  334. /package/lib/{QuantitySelector → esm/QuantitySelector}/SideButton.js +0 -0
  335. /package/lib/{QuantitySelector → esm/QuantitySelector}/dictionary.js +0 -0
  336. /package/lib/{QuantitySelector → esm/QuantitySelector}/index.js +0 -0
  337. /package/lib/{ResponsiveImage → esm/ResponsiveImage}/ResponsiveImage.js +0 -0
  338. /package/lib/{ResponsiveImage → esm/ResponsiveImage}/index.js +0 -0
  339. /package/lib/{Ribbon → esm/Ribbon}/index.js +0 -0
  340. /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonProvider.js +0 -0
  341. /package/lib/{SkeletonProvider → esm/SkeletonProvider}/index.js +0 -0
  342. /package/lib/{Span → esm/Span}/index.js +0 -0
  343. /package/lib/{Spinner → esm/Spinner}/constants.js +0 -0
  344. /package/lib/{Spinner → esm/Spinner}/index.js +0 -0
  345. /package/lib/{StoryCard → esm/StoryCard}/index.js +0 -0
  346. /package/lib/{Table → esm/Table}/Body.js +0 -0
  347. /package/lib/{Table → esm/Table}/Header.js +0 -0
  348. /package/lib/{Table → esm/Table}/SubHeading.js +0 -0
  349. /package/lib/{Table → esm/Table}/index.js +0 -0
  350. /package/lib/{TermsAndConditions → esm/TermsAndConditions}/dictionary.js +0 -0
  351. /package/lib/{TermsAndConditions → esm/TermsAndConditions}/index.js +0 -0
  352. /package/lib/{Testimonial → esm/Testimonial}/index.js +0 -0
  353. /package/lib/{Toast → esm/Toast}/index.js +0 -0
  354. /package/lib/{Video → esm/Video}/index.js +0 -0
  355. /package/lib/{Video → esm/Video}/videoText.js +0 -0
  356. /package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerPlayer.js +0 -0
  357. /package/lib/{VideoPicker → esm/VideoPicker}/VideoSlider.js +0 -0
  358. /package/lib/{VideoPicker → esm/VideoPicker}/index.js +0 -0
  359. /package/lib/{VideoPicker → esm/VideoPicker}/videoPropType.js +0 -0
  360. /package/lib/{WaffleGrid → esm/WaffleGrid}/index.js +0 -0
  361. /package/lib/{WebVideo → esm/WebVideo}/index.js +0 -0
  362. /package/lib/{WebVideo → esm/WebVideo}/utils/index.js +0 -0
  363. /package/lib/{server.js → esm/server.js} +0 -0
  364. /package/lib/{shared → esm/shared}/ConditionalWrapper/ConditionalWrapper.js +0 -0
  365. /package/lib/{shared → esm/shared}/ConditionalWrapper/index.js +0 -0
  366. /package/lib/{shared → esm/shared}/FullBleedContent/getFullBleedBorderRadius.js +0 -0
  367. /package/lib/{shared → esm/shared}/FullBleedContent/index.js +0 -0
  368. /package/lib/{shared → esm/shared}/FullBleedContent/useFullBleedContentProps.js +0 -0
  369. /package/lib/{shared → esm/shared}/VideoSplash/helpers.js +0 -0
  370. /package/lib/{utils → esm/utils}/isElementFocusable.js +0 -0
  371. /package/lib/{utils → esm/utils}/logger.js +0 -0
  372. /package/lib/{utils → esm/utils}/media.js +0 -0
  373. /package/lib/{utils → esm/utils}/renderStructuredContent.js +0 -0
  374. /package/lib/{utils → esm/utils}/theming/get-theme-from-server.js +0 -0
  375. /package/lib/{utils → esm/utils}/theming/with-client-theme.js +0 -0
  376. /package/lib/{utils → esm/utils}/theming/with-server-theme.js +0 -0
  377. /package/lib/{utils → esm/utils}/transforms.js +0 -0
  378. /package/lib/{utils → esm/utils}/useTypographyTheme.js +0 -0
@@ -0,0 +1,91 @@
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 _componentsBase = require("@telus-uds/components-base");
10
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
+ var _helpers = require("../helpers");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const ButtonContainer = /*#__PURE__*/_styledComponents.default.button.withConfig({
15
+ displayName: "SplashButton__ButtonContainer",
16
+ componentId: "components-web__sc-1oe22fk-0"
17
+ })({
18
+ background: 'none',
19
+ border: 0,
20
+ padding: 0,
21
+ position: 'absolute',
22
+ width: '100%',
23
+ height: '100%',
24
+ display: 'flex',
25
+ justifyContent: 'center',
26
+ alignItems: 'center',
27
+ cursor: 'pointer'
28
+ });
29
+ const ButtonContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
30
+ displayName: "SplashButton__ButtonContent",
31
+ componentId: "components-web__sc-1oe22fk-1"
32
+ })({
33
+ display: 'flex',
34
+ justifyContent: 'center',
35
+ alignItems: 'center',
36
+ width: 64,
37
+ height: 64,
38
+ background: _ref => {
39
+ let {
40
+ buttonContentBackground
41
+ } = _ref;
42
+ return buttonContentBackground ?? 'none';
43
+ },
44
+ borderRadius: '100%',
45
+ transition: 'background 0.2s ease-in-out',
46
+ [`${ButtonContainer}:hover &`]: {
47
+ background: _ref2 => {
48
+ let {
49
+ buttonContentChildrenBackground
50
+ } = _ref2;
51
+ return buttonContentChildrenBackground;
52
+ }
53
+ }
54
+ });
55
+ const SplashButton = _ref3 => {
56
+ let {
57
+ copy,
58
+ tokens,
59
+ variant,
60
+ videoLength
61
+ } = _ref3;
62
+ const {
63
+ buttonContentChildrenBackground
64
+ } = (0, _componentsBase.useThemeTokens)('SplashButton', tokens, variant, {
65
+ hover: true
66
+ });
67
+ const {
68
+ playIcon: PlayIcon,
69
+ playIconColor,
70
+ ...themeTokens
71
+ } = (0, _componentsBase.useThemeTokens)('SplashButton', tokens, variant);
72
+ const ariaLabel = (0, _helpers.getAriaLabel)((0, _helpers.getTimestamp)(videoLength), copy);
73
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ButtonContainer, {
74
+ "aria-label": ariaLabel,
75
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ButtonContent, {
76
+ ...themeTokens,
77
+ buttonContentChildrenBackground: buttonContentChildrenBackground,
78
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PlayIcon, {
79
+ size: 27,
80
+ color: playIconColor
81
+ })
82
+ })
83
+ });
84
+ };
85
+ SplashButton.propTypes = {
86
+ videoLength: _propTypes.default.number,
87
+ tokens: _propTypes.default.object,
88
+ variant: _propTypes.default.object,
89
+ copy: _propTypes.default.oneOf(['en', 'fr'])
90
+ };
91
+ var _default = exports.default = SplashButton;
@@ -0,0 +1,229 @@
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 _componentsBase = require("@telus-uds/components-base");
10
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
+ var _helpers = require("../helpers");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const ButtonContainer = /*#__PURE__*/_styledComponents.default.button.withConfig({
15
+ displayName: "SplashButtonWithDetails__ButtonContainer",
16
+ componentId: "components-web__sc-1edwy9o-0"
17
+ })({
18
+ background: 'none',
19
+ border: 0,
20
+ position: 'absolute',
21
+ width: '100%',
22
+ height: '100%',
23
+ padding: 0,
24
+ cursor: 'pointer'
25
+ });
26
+ const ButtonContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
27
+ displayName: "SplashButtonWithDetails__ButtonContent",
28
+ componentId: "components-web__sc-1edwy9o-1"
29
+ })({
30
+ background: _ref => {
31
+ let {
32
+ buttonBackground
33
+ } = _ref;
34
+ return buttonBackground;
35
+ },
36
+ border: _ref2 => {
37
+ let {
38
+ buttonBorderColor
39
+ } = _ref2;
40
+ return `1px solid ${buttonBorderColor}`;
41
+ },
42
+ borderRadius: _ref3 => {
43
+ let {
44
+ buttonRadius
45
+ } = _ref3;
46
+ return `${buttonRadius}px`;
47
+ },
48
+ position: 'absolute',
49
+ left: _ref4 => {
50
+ let {
51
+ buttonLeftPosition
52
+ } = _ref4;
53
+ return `${buttonLeftPosition}px`;
54
+ },
55
+ bottom: _ref5 => {
56
+ let {
57
+ buttonBottomPosition
58
+ } = _ref5;
59
+ return `${buttonBottomPosition}px`;
60
+ },
61
+ boxSizing: 'border-box',
62
+ display: 'flex',
63
+ alignItems: 'center',
64
+ minHeight: _ref6 => {
65
+ let {
66
+ buttonMinHeight
67
+ } = _ref6;
68
+ return `${buttonMinHeight}px`;
69
+ },
70
+ paddingRight: _ref7 => {
71
+ let {
72
+ buttonPaddingLeft
73
+ } = _ref7;
74
+ return `${buttonPaddingLeft}px`;
75
+ },
76
+ paddingLeft: _ref8 => {
77
+ let {
78
+ buttonPaddingRight
79
+ } = _ref8;
80
+ return `${buttonPaddingRight}px`;
81
+ },
82
+ transition: 'background 0.2s ease-in-out',
83
+ [`${ButtonContainer}:hover &`]: {
84
+ background: _ref9 => {
85
+ let {
86
+ buttonContentChildrenBackground
87
+ } = _ref9;
88
+ return buttonContentChildrenBackground;
89
+ }
90
+ }
91
+ });
92
+ const PlayIconContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
93
+ displayName: "SplashButtonWithDetails__PlayIconContainer",
94
+ componentId: "components-web__sc-1edwy9o-2"
95
+ })({
96
+ display: 'flex',
97
+ justifyContent: 'center',
98
+ alignItems: 'center',
99
+ width: 32,
100
+ height: 32,
101
+ background: _ref10 => {
102
+ let {
103
+ playIconContainerBackground
104
+ } = _ref10;
105
+ return playIconContainerBackground ?? 'none';
106
+ },
107
+ borderRadius: '100%',
108
+ transition: 'background 0.2s ease-in-out'
109
+ });
110
+ const DetailsContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
111
+ displayName: "SplashButtonWithDetails__DetailsContainer",
112
+ componentId: "components-web__sc-1edwy9o-3"
113
+ })({
114
+ display: 'flex',
115
+ flexDirection: 'column',
116
+ alignItems: 'flex-start',
117
+ paddingLeft: _ref11 => {
118
+ let {
119
+ detailsContainerPadding
120
+ } = _ref11;
121
+ return `${detailsContainerPadding}px`;
122
+ }
123
+ });
124
+ const selectPlayIconContainerTokens = _ref12 => {
125
+ let {
126
+ playIconContainerBackground
127
+ } = _ref12;
128
+ return {
129
+ playIconContainerBackground
130
+ };
131
+ };
132
+ const selectDetailsContainerTokens = _ref13 => {
133
+ let {
134
+ detailsContainerPadding
135
+ } = _ref13;
136
+ return {
137
+ detailsContainerPadding
138
+ };
139
+ };
140
+ const selectButtonContentTokens = _ref14 => {
141
+ let {
142
+ buttonBackground,
143
+ buttonBorderColor,
144
+ buttonRadius,
145
+ buttonLeftPosition,
146
+ buttonBottomPosition,
147
+ buttonMinHeight,
148
+ buttonPaddingLeft,
149
+ buttonPaddingRight
150
+ } = _ref14;
151
+ return {
152
+ buttonBackground,
153
+ buttonBorderColor,
154
+ buttonRadius,
155
+ buttonLeftPosition,
156
+ buttonBottomPosition,
157
+ buttonMinHeight,
158
+ buttonPaddingLeft,
159
+ buttonPaddingRight
160
+ };
161
+ };
162
+ const getLabelTokens = _ref15 => {
163
+ let {
164
+ labelFontName: fontName,
165
+ labelFontWeight: fontWeight
166
+ } = _ref15;
167
+ return {
168
+ fontName,
169
+ fontWeight
170
+ };
171
+ };
172
+ const SplashButtonWithDetails = _ref16 => {
173
+ let {
174
+ label,
175
+ tokens,
176
+ variant,
177
+ copy,
178
+ videoLength
179
+ } = _ref16;
180
+ const {
181
+ buttonContentChildrenBackground
182
+ } = (0, _componentsBase.useThemeTokens)('SplashButtonWithDetails', tokens, variant, {
183
+ hover: true
184
+ });
185
+ const {
186
+ playIcon: PlayIcon,
187
+ playIconColor,
188
+ ...themeTokens
189
+ } = (0, _componentsBase.useThemeTokens)('SplashButtonWithDetails', tokens, variant);
190
+ const mappedVideoLength = (0, _helpers.getTimestamp)(videoLength, copy);
191
+ const ariaLabel = (0, _helpers.getAriaLabel)(mappedVideoLength, copy);
192
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ButtonContainer, {
193
+ "aria-label": ariaLabel,
194
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ButtonContent, {
195
+ ...selectButtonContentTokens(themeTokens),
196
+ buttonContentChildrenBackground: buttonContentChildrenBackground,
197
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PlayIconContainer, {
198
+ ...selectPlayIconContainerTokens(themeTokens),
199
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PlayIcon, {
200
+ size: 13,
201
+ color: playIconColor
202
+ })
203
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(DetailsContainer, {
204
+ ...selectDetailsContainerTokens(themeTokens),
205
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
206
+ variant: {
207
+ bold: true
208
+ },
209
+ tokens: getLabelTokens(themeTokens),
210
+ children: label
211
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
212
+ variant: {
213
+ colour: 'secondary' /* TODO: this is not the same color as in designs */,
214
+ size: 'micro'
215
+ },
216
+ children: mappedVideoLength.timestamp
217
+ })]
218
+ })]
219
+ })
220
+ });
221
+ };
222
+ SplashButtonWithDetails.propTypes = {
223
+ label: _propTypes.default.string,
224
+ tokens: _propTypes.default.object,
225
+ variant: _propTypes.default.object,
226
+ videoLength: _propTypes.default.number,
227
+ copy: _propTypes.default.oneOf(['en', 'fr'])
228
+ };
229
+ var _default = exports.default = SplashButtonWithDetails;
@@ -0,0 +1,72 @@
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 _componentsBase = require("@telus-uds/components-base");
10
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
+ var _systemConstants = require("@telus-uds/system-constants");
12
+ var _SplashButton = _interopRequireDefault(require("./SplashButton/SplashButton"));
13
+ var _SplashButtonWithDetails = _interopRequireDefault(require("./SplashButtonWithDetails/SplashButtonWithDetails"));
14
+ var _videoText = _interopRequireDefault(require("../../Video/videoText"));
15
+ var _utils = require("../../utils");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
+ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
19
+ const SplashBackground = /*#__PURE__*/_styledComponents.default.div.withConfig({
20
+ displayName: "VideoSplash__SplashBackground",
21
+ componentId: "components-web__sc-1ejxt6-0"
22
+ })(_ref => {
23
+ let {
24
+ videoPoster
25
+ } = _ref;
26
+ return {
27
+ backgroundImage: `url(${videoPoster})`,
28
+ backgroundSize: 'cover',
29
+ backgroundPosition: 'center',
30
+ position: 'absolute',
31
+ top: 0,
32
+ width: '100%',
33
+ height: '100%',
34
+ // fixes vertical alignment on IE 11
35
+ cursor: 'pointer'
36
+ };
37
+ });
38
+ const VideoSplash = _ref2 => {
39
+ let {
40
+ poster,
41
+ videoLength,
42
+ simpleMode,
43
+ copy = 'en',
44
+ onClick,
45
+ ...rest
46
+ } = _ref2;
47
+ const viewport = (0, _componentsBase.useViewport)();
48
+ const showDetails = !simpleMode && viewport !== _systemConstants.viewports.xs;
49
+ const label = _videoText.default[copy].watch;
50
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(SplashBackground, {
51
+ ...selectProps(rest),
52
+ onClick: onClick,
53
+ videoPoster: poster,
54
+ children: showDetails ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SplashButtonWithDetails.default, {
55
+ videoLength: videoLength,
56
+ copy: copy,
57
+ label: label
58
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_SplashButton.default, {
59
+ videoLength: videoLength,
60
+ copy: copy
61
+ })
62
+ });
63
+ };
64
+ VideoSplash.propTypes = {
65
+ ...selectedSystemPropTypes,
66
+ onClick: _propTypes.default.func,
67
+ poster: _propTypes.default.string,
68
+ videoLength: _propTypes.default.number.isRequired,
69
+ simpleMode: _propTypes.default.bool,
70
+ copy: _propTypes.default.oneOf(['en', 'fr'])
71
+ };
72
+ var _default = exports.default = VideoSplash;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getTimestamp = exports.getAriaLabel = void 0;
7
+ var _videoText = _interopRequireDefault(require("../../Video/videoText"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const getTimestamp = (videoLength, copy) => {
10
+ const minutes = Math.floor(videoLength / 60);
11
+ const seconds = Math.ceil(videoLength % 60);
12
+ const minutesText = minutes > 0 ? `${minutes}min ` : '';
13
+ const secondsText = `${seconds}${copy === 'fr' ? 's' : 'sec'}`;
14
+ const timestamp = `${minutesText}${secondsText}`;
15
+ return {
16
+ minutes,
17
+ seconds,
18
+ timestamp
19
+ };
20
+ };
21
+ exports.getTimestamp = getTimestamp;
22
+ const getAriaLabel = (timestamp, copy) => {
23
+ const {
24
+ minutes,
25
+ seconds
26
+ } = timestamp;
27
+ const text = _videoText.default[copy];
28
+ const minutesText = `${minutes} ${minutes !== 1 ? text.minutes : text.minute}`;
29
+ const secondsText = `${seconds} ${seconds !== 1 ? text.seconds : text.second}`;
30
+ return text.ariaLabel.replace('{minutes}', minutesText).replace('{seconds}', secondsText);
31
+ };
32
+ exports.getAriaLabel = getAriaLabel;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "contentfulProps", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _componentsBase.contentfulProps;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "deprecate", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _logger.deprecate;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "htmlAttrs", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _componentsBase.htmlAttrs;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "isElementFocusable", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _isElementFocusable.default;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "media", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _media.default;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "renderStructuredContent", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _renderStructuredContent.default;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "scrollToAnchor", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _scrollToAnchor.default;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "ssrStyles", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _ssr.default;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "transformGradient", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _transforms.transformGradient;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "useOverlaidPosition", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _useOverlaidPosition.default;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "useTypographyTheme", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _useTypographyTheme.default;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "warn", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _logger.warn;
76
+ }
77
+ });
78
+ var _componentsBase = require("@telus-uds/components-base");
79
+ var _logger = require("./logger");
80
+ var _transforms = require("./transforms");
81
+ var _useTypographyTheme = _interopRequireDefault(require("./useTypographyTheme"));
82
+ var _media = _interopRequireDefault(require("./media"));
83
+ var _ssr = _interopRequireDefault(require("./ssr"));
84
+ var _isElementFocusable = _interopRequireDefault(require("./isElementFocusable"));
85
+ var _renderStructuredContent = _interopRequireDefault(require("./renderStructuredContent"));
86
+ var _useOverlaidPosition = _interopRequireDefault(require("./useOverlaidPosition"));
87
+ var _scrollToAnchor = _interopRequireDefault(require("./scrollToAnchor"));
88
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * Returns focusable elements inside of the Footnote
9
+ */
10
+ const isElementFocusable = element => {
11
+ const focusableElements = `a[href], button, textarea, input, select, form, label, audio, video, source, track, canvas, rect, polygon, iframe[data-src], [tabindex]:not([tabindex="-1"]), [contenteditable]`;
12
+ return element.matches(focusableElements) && !element.hasAttribute('disabled') && !element.matches('[tabindex="-1"]');
13
+ };
14
+ var _default = exports.default = isElementFocusable;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.warn = exports.deprecate = exports.default = void 0;
7
+ const deprecate = (componentName, message) => {
8
+ if (process.env.NODE_ENV === 'production') {
9
+ return;
10
+ }
11
+ console.warn(`[Allium] [Deprecate] ${componentName}: ${message}`);
12
+ };
13
+ exports.deprecate = deprecate;
14
+ const warn = (componentName, message) => {
15
+ if (process.env.NODE_ENV === 'production') {
16
+ return;
17
+ }
18
+ console.warn(`[Allium] ${componentName}: ${message}`);
19
+ };
20
+ exports.warn = warn;
21
+ var _default = exports.default = {
22
+ deprecate,
23
+ warn
24
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = media;
7
+ var _systemConstants = require("@telus-uds/system-constants");
8
+ function media() {
9
+ return {
10
+ query: {},
11
+ from(breakpoint) {
12
+ if (breakpoint !== _systemConstants.viewports.xs) {
13
+ this.query.minWidth = breakpoint;
14
+ }
15
+ return this;
16
+ },
17
+ until(breakpoint) {
18
+ this.query.maxWidth = breakpoint;
19
+ return this;
20
+ },
21
+ and(custom) {
22
+ this.query.and = custom;
23
+ return this;
24
+ },
25
+ css(style) {
26
+ const {
27
+ minWidth,
28
+ maxWidth,
29
+ and
30
+ } = this.query;
31
+ const min = minWidth ? `(min-width: ${_systemConstants.viewports.map.get(minWidth)}px)` : undefined;
32
+ const max = maxWidth ? `(max-width: ${_systemConstants.viewports.map.get(maxWidth) - 1}px)` : undefined;
33
+ if (typeof min !== 'undefined' || typeof max !== 'undefined' || typeof and !== 'undefined') {
34
+ const mediaQuery = `@media ${[min, max, and].filter(a => a).join(' and ')}`;
35
+ this.query = {};
36
+ return {
37
+ [mediaQuery]: {
38
+ ...(typeof style === 'function' ? style() : style)
39
+ }
40
+ };
41
+ }
42
+ return typeof style === 'function' ? style() : style;
43
+ }
44
+ };
45
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _componentsBase = require("@telus-uds/components-base");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ 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); }
11
+ 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; }
12
+ /**
13
+ * Takes a string content and marks up all the links in it by wrapping them
14
+ * in `Link` component.
15
+ */const generateLinks = content => {
16
+ const linkRegex = /<\s*a([^>]*)>(.*?)<\s*\/\s*a>/g;
17
+ const attributeRegex = /(\w+)\s*=\s*((["'])(.*?)\3|(?=\s|\/>))/g;
18
+ const parts = content.split(linkRegex);
19
+ if (parts.length === 1) {
20
+ return parts;
21
+ }
22
+
23
+ // Start with first anchor text, attributes will be in the previous part
24
+ for (let i = 2; i < parts.length; i += 3) {
25
+ const o = {};
26
+ // Get attributes from previous part
27
+ const attributes = parts[i - 1].trim();
28
+
29
+ // Create object from attributes
30
+ const matchedAttributes = attributes.match(attributeRegex);
31
+ if (matchedAttributes) {
32
+ matchedAttributes.forEach(attribute => {
33
+ const split = attribute.split('=');
34
+ o[split[0]] = split[1].substr(1, split[1].length - 2);
35
+ });
36
+ }
37
+ // Remove anchor attributes from parts
38
+ parts[i - 1] = undefined;
39
+ // Replace anchor text with Link in parts
40
+ parts[i] = /*#__PURE__*/(0, _react.createElement)(_componentsBase.Link, {
41
+ ...o,
42
+ key: i
43
+ }, parts[i]);
44
+ }
45
+ return parts;
46
+ };
47
+
48
+ /**
49
+ * Takes an array of strings and in each element replaces the breaks with `<br>` tags.
50
+ */
51
+ const generateBreaks = parts => {
52
+ const breakRegex = /<br\s?\/*>/g;
53
+ const partsWithBreaks = parts;
54
+ for (let i = 0; i < partsWithBreaks.length; i += 1) {
55
+ if (typeof partsWithBreaks[i] === 'string' && partsWithBreaks[i].search(breakRegex) !== -1) {
56
+ const toSplit = partsWithBreaks[i].split(breakRegex);
57
+ for (let x = 1; x < toSplit.length; x += 2) {
58
+ toSplit.splice(x, 0, /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}, `break-${i}-${x}`));
59
+ }
60
+ partsWithBreaks[i] = toSplit;
61
+ }
62
+ }
63
+ return partsWithBreaks;
64
+ };
65
+ const renderStructuredContent = content => {
66
+ if (typeof content !== 'string') {
67
+ return content;
68
+ }
69
+ return generateBreaks(generateLinks(content));
70
+ };
71
+ var _default = exports.default = renderStructuredContent;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * Scrolls smoothly to the anchor element specified by the href.
9
+ *
10
+ * @param {string} href - The href attribute value, expected to be an anchor link starting with '#'.
11
+ * @param {Event} event - The event object associated with the click or navigation action.
12
+ * @param {Function} onAfterScroll - A callback function to be executed after the scroll action is completed.
13
+ */
14
+ const scrollToAnchor = (href, event, onAfterScroll) => {
15
+ if (href?.startsWith('#')) {
16
+ event.preventDefault();
17
+ const target = document.getElementById(href.slice(1));
18
+ target?.scrollIntoView({
19
+ behavior: 'smooth'
20
+ });
21
+ window.location.hash = href;
22
+ onAfterScroll(event);
23
+ }
24
+ };
25
+ var _default = exports.default = scrollToAnchor;