@telus-uds/components-web 2.43.0 → 3.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 (315) hide show
  1. package/.eslintrc.cjs +26 -0
  2. package/CHANGELOG.md +21 -2
  3. package/babel.config.cjs +4 -0
  4. package/jest.config.cjs +29 -0
  5. package/lib/Badge/Badge.js +21 -29
  6. package/lib/Badge/index.js +2 -10
  7. package/lib/BlockQuote/BlockQuote.js +31 -39
  8. package/lib/BlockQuote/index.js +2 -10
  9. package/lib/Breadcrumbs/Breadcrumbs.js +39 -49
  10. package/lib/Breadcrumbs/Item/Item.js +26 -34
  11. package/lib/Breadcrumbs/index.js +1 -13
  12. package/lib/Callout/Callout.js +19 -27
  13. package/lib/Callout/index.js +2 -10
  14. package/lib/Card/Card.js +44 -54
  15. package/lib/Card/CardContent.js +17 -25
  16. package/lib/Card/CardFooter.js +16 -24
  17. package/lib/Card/index.js +2 -10
  18. package/lib/Countdown/Countdown.js +34 -42
  19. package/lib/Countdown/Segment.js +26 -34
  20. package/lib/Countdown/constants.js +4 -14
  21. package/lib/Countdown/dictionary.js +2 -9
  22. package/lib/Countdown/index.js +2 -10
  23. package/lib/Countdown/types.js +18 -28
  24. package/lib/Countdown/useCountdown.js +4 -11
  25. package/lib/DatePicker/CalendarContainer.js +6 -12
  26. package/lib/DatePicker/DatePicker.js +105 -101
  27. package/lib/DatePicker/dictionary.js +1 -8
  28. package/lib/DatePicker/index.js +2 -10
  29. package/lib/DatePicker/reactDatesCss.js +3 -10
  30. package/lib/Disclaimer/Disclaimer.js +15 -23
  31. package/lib/Disclaimer/index.js +1 -13
  32. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +16 -24
  33. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +17 -26
  34. package/lib/ExpandCollapseMini/index.js +2 -10
  35. package/lib/Footnote/Footnote.js +85 -95
  36. package/lib/Footnote/FootnoteLink.js +25 -33
  37. package/lib/Footnote/dictionary.js +2 -9
  38. package/lib/Footnote/index.js +4 -12
  39. package/lib/IconButton/IconButton.js +12 -20
  40. package/lib/IconButton/index.js +2 -10
  41. package/lib/Image/Image.js +17 -25
  42. package/lib/Image/index.js +6 -18
  43. package/lib/Image/server.js +4 -12
  44. package/lib/List/List.js +2 -9
  45. package/lib/List/ListItem.js +10 -18
  46. package/lib/List/index.js +4 -12
  47. package/lib/NavigationBar/NavigationBar.js +51 -59
  48. package/lib/NavigationBar/NavigationItem.js +19 -27
  49. package/lib/NavigationBar/NavigationSubMenu.js +34 -40
  50. package/lib/NavigationBar/collapseItems.js +1 -11
  51. package/lib/NavigationBar/index.js +4 -12
  52. package/lib/NavigationBar/resolveItemSelection.js +1 -8
  53. package/lib/OptimizeImage/OptimizeImage.js +26 -34
  54. package/lib/OptimizeImage/index.js +2 -10
  55. package/lib/OptimizeImage/utils/getFallbackUrl.js +3 -10
  56. package/lib/OptimizeImage/utils/getImageUrls.js +9 -16
  57. package/lib/OptimizeImage/utils/getOptimizedUrl.js +3 -10
  58. package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -7
  59. package/lib/OptimizeImage/utils/index.js +5 -34
  60. package/lib/OptimizeImage/utils/isSvgUrl.js +1 -7
  61. package/lib/OrderedList/Item.js +28 -36
  62. package/lib/OrderedList/ItemBase.js +8 -16
  63. package/lib/OrderedList/OrderedList.js +22 -30
  64. package/lib/OrderedList/OrderedListBase.js +12 -20
  65. package/lib/OrderedList/constants.js +1 -8
  66. package/lib/OrderedList/index.js +4 -12
  67. package/lib/Paragraph/Paragraph.js +22 -30
  68. package/lib/Paragraph/index.js +2 -10
  69. package/lib/PreviewCard/AuthorDate.js +17 -21
  70. package/lib/PreviewCard/PreviewCard.js +40 -49
  71. package/lib/PreviewCard/index.js +2 -10
  72. package/lib/PriceLockup/PriceLockup.js +56 -64
  73. package/lib/PriceLockup/index.js +2 -10
  74. package/lib/PriceLockup/tokens.js +2 -9
  75. package/lib/Progress/ProgressBar.js +17 -24
  76. package/lib/Progress/index.js +4 -12
  77. package/lib/QuantitySelector/QuantitySelector.js +55 -63
  78. package/lib/QuantitySelector/SideButton.js +15 -23
  79. package/lib/QuantitySelector/dictionary.js +2 -9
  80. package/lib/QuantitySelector/index.js +2 -10
  81. package/lib/QuantitySelector/styles.js +4 -13
  82. package/lib/ResponsiveImage/ResponsiveImage.js +29 -37
  83. package/lib/ResponsiveImage/index.js +2 -10
  84. package/lib/Ribbon/Ribbon.js +22 -30
  85. package/lib/Ribbon/index.js +2 -10
  86. package/lib/SkeletonProvider/SkeletonImage.js +14 -22
  87. package/lib/SkeletonProvider/SkeletonProvider.js +17 -25
  88. package/lib/SkeletonProvider/SkeletonTypography.js +14 -22
  89. package/lib/SkeletonProvider/index.js +2 -10
  90. package/lib/Span/Span.js +23 -31
  91. package/lib/Span/index.js +2 -10
  92. package/lib/Spinner/Spinner.js +43 -51
  93. package/lib/Spinner/SpinnerContent.js +21 -29
  94. package/lib/Spinner/constants.js +4 -14
  95. package/lib/Spinner/index.js +2 -10
  96. package/lib/StoryCard/StoryCard.js +40 -49
  97. package/lib/StoryCard/index.js +2 -10
  98. package/lib/Table/Body.js +7 -15
  99. package/lib/Table/Cell.js +28 -38
  100. package/lib/Table/Header.js +11 -19
  101. package/lib/Table/Row.js +8 -16
  102. package/lib/Table/SubHeading.js +10 -18
  103. package/lib/Table/Table.js +26 -35
  104. package/lib/Table/index.js +12 -20
  105. package/lib/TermsAndConditions/ExpandCollapse.js +22 -30
  106. package/lib/TermsAndConditions/TermsAndConditions.js +52 -60
  107. package/lib/TermsAndConditions/dictionary.js +2 -9
  108. package/lib/TermsAndConditions/index.js +1 -13
  109. package/lib/Testimonial/Testimonial.js +37 -45
  110. package/lib/Testimonial/index.js +2 -10
  111. package/lib/Toast/Toast.js +32 -42
  112. package/lib/Toast/index.js +2 -10
  113. package/lib/Video/ControlBar/ControlBar.js +73 -81
  114. package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +16 -24
  115. package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +27 -35
  116. package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +27 -36
  117. package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +30 -38
  118. package/lib/Video/MiddleControlButton/MiddleControlButton.js +16 -24
  119. package/lib/Video/Video.js +74 -83
  120. package/lib/Video/index.js +2 -10
  121. package/lib/Video/videoText.js +1 -8
  122. package/lib/VideoPicker/VideoPicker.js +43 -53
  123. package/lib/VideoPicker/VideoPickerPlayer.js +17 -25
  124. package/lib/VideoPicker/VideoPickerThumbnail.js +38 -46
  125. package/lib/VideoPicker/VideoSlider.js +17 -26
  126. package/lib/VideoPicker/index.js +2 -10
  127. package/lib/VideoPicker/videoPropType.js +9 -18
  128. package/lib/WaffleGrid/WaffleGrid.js +33 -43
  129. package/lib/WaffleGrid/index.js +2 -10
  130. package/lib/WebVideo/WebVideo.js +42 -52
  131. package/lib/WebVideo/index.js +2 -10
  132. package/lib/WebVideo/utils/index.js +3 -11
  133. package/lib/baseExports.js +18 -431
  134. package/lib/index.js +38 -323
  135. package/lib/server.js +4 -12
  136. package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +9 -17
  137. package/lib/shared/ConditionalWrapper/index.js +2 -10
  138. package/lib/shared/FullBleedContent/FullBleedContent.js +21 -29
  139. package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -8
  140. package/lib/shared/FullBleedContent/index.js +4 -24
  141. package/lib/shared/FullBleedContent/useFullBleedContentProps.js +4 -11
  142. package/lib/shared/VideoSplash/SplashButton/SplashButton.js +19 -27
  143. package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +27 -35
  144. package/lib/shared/VideoSplash/VideoSplash.js +24 -32
  145. package/lib/shared/VideoSplash/helpers.js +5 -14
  146. package/lib/utils/index.js +10 -75
  147. package/lib/utils/isElementFocusable.js +1 -8
  148. package/lib/utils/logger.js +6 -15
  149. package/lib/utils/media.js +5 -11
  150. package/lib/utils/renderStructuredContent.js +8 -15
  151. package/lib/utils/ssr.js +5 -12
  152. package/lib/utils/theming/get-theme-from-server.js +2 -10
  153. package/lib/utils/theming/with-client-theme.js +9 -17
  154. package/lib/utils/theming/with-server-theme.js +11 -19
  155. package/lib/utils/transforms.js +3 -11
  156. package/lib/utils/useOverlaidPosition.js +15 -23
  157. package/lib/utils/useTypographyTheme.js +6 -13
  158. package/package.json +18 -20
  159. package/src/Card/Card.jsx +2 -2
  160. package/src/DatePicker/DatePicker.jsx +17 -4
  161. package/src/PreviewCard/AuthorDate.jsx +5 -3
  162. package/src/utils/logger.js +2 -2
  163. package/lib-module/Badge/Badge.js +0 -121
  164. package/lib-module/Badge/index.js +0 -2
  165. package/lib-module/BlockQuote/BlockQuote.js +0 -204
  166. package/lib-module/BlockQuote/index.js +0 -2
  167. package/lib-module/Breadcrumbs/Breadcrumbs.js +0 -250
  168. package/lib-module/Breadcrumbs/Item/Item.js +0 -175
  169. package/lib-module/Breadcrumbs/index.js +0 -1
  170. package/lib-module/Callout/Callout.js +0 -135
  171. package/lib-module/Callout/index.js +0 -2
  172. package/lib-module/Card/Card.js +0 -251
  173. package/lib-module/Card/CardContent.js +0 -90
  174. package/lib-module/Card/CardFooter.js +0 -78
  175. package/lib-module/Card/index.js +0 -2
  176. package/lib-module/Countdown/Countdown.js +0 -169
  177. package/lib-module/Countdown/Segment.js +0 -96
  178. package/lib-module/Countdown/constants.js +0 -4
  179. package/lib-module/Countdown/dictionary.js +0 -22
  180. package/lib-module/Countdown/index.js +0 -2
  181. package/lib-module/Countdown/types.js +0 -24
  182. package/lib-module/Countdown/useCountdown.js +0 -26
  183. package/lib-module/DatePicker/CalendarContainer.js +0 -208
  184. package/lib-module/DatePicker/DatePicker.js +0 -506
  185. package/lib-module/DatePicker/dictionary.js +0 -119
  186. package/lib-module/DatePicker/index.js +0 -2
  187. package/lib-module/DatePicker/reactDatesCss.js +0 -3
  188. package/lib-module/Disclaimer/Disclaimer.js +0 -54
  189. package/lib-module/Disclaimer/index.js +0 -1
  190. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
  191. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -117
  192. package/lib-module/ExpandCollapseMini/index.js +0 -2
  193. package/lib-module/Footnote/Footnote.js +0 -632
  194. package/lib-module/Footnote/FootnoteLink.js +0 -118
  195. package/lib-module/Footnote/dictionary.js +0 -12
  196. package/lib-module/Footnote/index.js +0 -4
  197. package/lib-module/IconButton/IconButton.js +0 -55
  198. package/lib-module/IconButton/index.js +0 -2
  199. package/lib-module/Image/Image.js +0 -83
  200. package/lib-module/Image/index.js +0 -9
  201. package/lib-module/Image/server.js +0 -4
  202. package/lib-module/List/List.js +0 -2
  203. package/lib-module/List/ListItem.js +0 -28
  204. package/lib-module/List/index.js +0 -4
  205. package/lib-module/NavigationBar/NavigationBar.js +0 -224
  206. package/lib-module/NavigationBar/NavigationItem.js +0 -87
  207. package/lib-module/NavigationBar/NavigationSubMenu.js +0 -162
  208. package/lib-module/NavigationBar/collapseItems.js +0 -41
  209. package/lib-module/NavigationBar/index.js +0 -4
  210. package/lib-module/NavigationBar/resolveItemSelection.js +0 -16
  211. package/lib-module/OptimizeImage/OptimizeImage.js +0 -92
  212. package/lib-module/OptimizeImage/index.js +0 -2
  213. package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -7
  214. package/lib-module/OptimizeImage/utils/getImageUrls.js +0 -12
  215. package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -17
  216. package/lib-module/OptimizeImage/utils/hasWebpSupport.js +0 -28
  217. package/lib-module/OptimizeImage/utils/index.js +0 -5
  218. package/lib-module/OptimizeImage/utils/isSvgUrl.js +0 -3
  219. package/lib-module/OrderedList/Item.js +0 -145
  220. package/lib-module/OrderedList/ItemBase.js +0 -27
  221. package/lib-module/OrderedList/OrderedList.js +0 -86
  222. package/lib-module/OrderedList/OrderedListBase.js +0 -45
  223. package/lib-module/OrderedList/constants.js +0 -2
  224. package/lib-module/OrderedList/index.js +0 -4
  225. package/lib-module/Paragraph/Paragraph.js +0 -90
  226. package/lib-module/Paragraph/index.js +0 -2
  227. package/lib-module/PreviewCard/AuthorDate.js +0 -57
  228. package/lib-module/PreviewCard/PreviewCard.js +0 -209
  229. package/lib-module/PreviewCard/index.js +0 -2
  230. package/lib-module/PriceLockup/PriceLockup.js +0 -335
  231. package/lib-module/PriceLockup/index.js +0 -2
  232. package/lib-module/PriceLockup/tokens.js +0 -55
  233. package/lib-module/Progress/ProgressBar.js +0 -83
  234. package/lib-module/Progress/index.js +0 -4
  235. package/lib-module/QuantitySelector/QuantitySelector.js +0 -261
  236. package/lib-module/QuantitySelector/SideButton.js +0 -70
  237. package/lib-module/QuantitySelector/dictionary.js +0 -26
  238. package/lib-module/QuantitySelector/index.js +0 -2
  239. package/lib-module/QuantitySelector/styles.js +0 -9
  240. package/lib-module/ResponsiveImage/ResponsiveImage.js +0 -95
  241. package/lib-module/ResponsiveImage/index.js +0 -2
  242. package/lib-module/Ribbon/Ribbon.js +0 -216
  243. package/lib-module/Ribbon/index.js +0 -2
  244. package/lib-module/SkeletonProvider/SkeletonImage.js +0 -39
  245. package/lib-module/SkeletonProvider/SkeletonProvider.js +0 -57
  246. package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -38
  247. package/lib-module/SkeletonProvider/index.js +0 -2
  248. package/lib-module/Span/Span.js +0 -72
  249. package/lib-module/Span/index.js +0 -2
  250. package/lib-module/Spinner/Spinner.js +0 -215
  251. package/lib-module/Spinner/SpinnerContent.js +0 -94
  252. package/lib-module/Spinner/constants.js +0 -4
  253. package/lib-module/Spinner/index.js +0 -2
  254. package/lib-module/StoryCard/StoryCard.js +0 -212
  255. package/lib-module/StoryCard/index.js +0 -2
  256. package/lib-module/Table/Body.js +0 -17
  257. package/lib-module/Table/Cell.js +0 -176
  258. package/lib-module/Table/Header.js +0 -25
  259. package/lib-module/Table/Row.js +0 -19
  260. package/lib-module/Table/SubHeading.js +0 -23
  261. package/lib-module/Table/Table.js +0 -114
  262. package/lib-module/Table/index.js +0 -12
  263. package/lib-module/TermsAndConditions/ExpandCollapse.js +0 -153
  264. package/lib-module/TermsAndConditions/TermsAndConditions.js +0 -277
  265. package/lib-module/TermsAndConditions/dictionary.js +0 -16
  266. package/lib-module/TermsAndConditions/index.js +0 -1
  267. package/lib-module/Testimonial/Testimonial.js +0 -234
  268. package/lib-module/Testimonial/index.js +0 -2
  269. package/lib-module/Toast/Toast.js +0 -158
  270. package/lib-module/Toast/index.js +0 -2
  271. package/lib-module/Video/ControlBar/ControlBar.js +0 -288
  272. package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -70
  273. package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -163
  274. package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +0 -203
  275. package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -191
  276. package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +0 -71
  277. package/lib-module/Video/Video.js +0 -959
  278. package/lib-module/Video/index.js +0 -2
  279. package/lib-module/Video/videoText.js +0 -55
  280. package/lib-module/VideoPicker/VideoPicker.js +0 -190
  281. package/lib-module/VideoPicker/VideoPickerPlayer.js +0 -48
  282. package/lib-module/VideoPicker/VideoPickerThumbnail.js +0 -218
  283. package/lib-module/VideoPicker/VideoSlider.js +0 -82
  284. package/lib-module/VideoPicker/index.js +0 -2
  285. package/lib-module/VideoPicker/videoPropType.js +0 -10
  286. package/lib-module/WaffleGrid/WaffleGrid.js +0 -157
  287. package/lib-module/WaffleGrid/index.js +0 -2
  288. package/lib-module/WebVideo/WebVideo.js +0 -191
  289. package/lib-module/WebVideo/index.js +0 -2
  290. package/lib-module/WebVideo/utils/index.js +0 -50
  291. package/lib-module/baseExports.js +0 -19
  292. package/lib-module/index.js +0 -40
  293. package/lib-module/server.js +0 -5
  294. package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +0 -22
  295. package/lib-module/shared/ConditionalWrapper/index.js +0 -2
  296. package/lib-module/shared/FullBleedContent/FullBleedContent.js +0 -101
  297. package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -55
  298. package/lib-module/shared/FullBleedContent/index.js +0 -4
  299. package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +0 -55
  300. package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +0 -84
  301. package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -223
  302. package/lib-module/shared/VideoSplash/VideoSplash.js +0 -65
  303. package/lib-module/shared/VideoSplash/helpers.js +0 -23
  304. package/lib-module/utils/index.js +0 -10
  305. package/lib-module/utils/isElementFocusable.js +0 -8
  306. package/lib-module/utils/logger.js +0 -18
  307. package/lib-module/utils/media.js +0 -39
  308. package/lib-module/utils/renderStructuredContent.js +0 -66
  309. package/lib-module/utils/ssr.js +0 -37
  310. package/lib-module/utils/theming/get-theme-from-server.js +0 -16
  311. package/lib-module/utils/theming/with-client-theme.js +0 -24
  312. package/lib-module/utils/theming/with-server-theme.js +0 -26
  313. package/lib-module/utils/transforms.js +0 -4
  314. package/lib-module/utils/useOverlaidPosition.js +0 -216
  315. package/lib-module/utils/useTypographyTheme.js +0 -24
@@ -1,17 +1,10 @@
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 _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _componentsBase = require("@telus-uds/components-base");
11
- var _helpers = require("../helpers");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- const ButtonContainer = /*#__PURE__*/_styledComponents.default.button.withConfig({
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import { Typography, useThemeTokens } from '@telus-uds/components-base';
5
+ import { getAriaLabel, getTimestamp } from '../helpers';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const ButtonContainer = /*#__PURE__*/styled.button.withConfig({
15
8
  displayName: "SplashButtonWithDetails__ButtonContainer",
16
9
  componentId: "components-web__sc-1edwy9o-0"
17
10
  })({
@@ -23,7 +16,7 @@ const ButtonContainer = /*#__PURE__*/_styledComponents.default.button.withConfig
23
16
  padding: 0,
24
17
  cursor: 'pointer'
25
18
  });
26
- const ButtonContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
19
+ const ButtonContent = /*#__PURE__*/styled.div.withConfig({
27
20
  displayName: "SplashButtonWithDetails__ButtonContent",
28
21
  componentId: "components-web__sc-1edwy9o-1"
29
22
  })({
@@ -89,7 +82,7 @@ const ButtonContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
89
82
  }
90
83
  }
91
84
  });
92
- const PlayIconContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
85
+ const PlayIconContainer = /*#__PURE__*/styled.div.withConfig({
93
86
  displayName: "SplashButtonWithDetails__PlayIconContainer",
94
87
  componentId: "components-web__sc-1edwy9o-2"
95
88
  })({
@@ -107,7 +100,7 @@ const PlayIconContainer = /*#__PURE__*/_styledComponents.default.div.withConfig(
107
100
  borderRadius: '100%',
108
101
  transition: 'background 0.2s ease-in-out'
109
102
  });
110
- const DetailsContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
103
+ const DetailsContainer = /*#__PURE__*/styled.div.withConfig({
111
104
  displayName: "SplashButtonWithDetails__DetailsContainer",
112
105
  componentId: "components-web__sc-1edwy9o-3"
113
106
  })({
@@ -179,36 +172,36 @@ const SplashButtonWithDetails = _ref16 => {
179
172
  } = _ref16;
180
173
  const {
181
174
  buttonContentChildrenBackground
182
- } = (0, _componentsBase.useThemeTokens)('SplashButtonWithDetails', tokens, variant, {
175
+ } = useThemeTokens('SplashButtonWithDetails', tokens, variant, {
183
176
  hover: true
184
177
  });
185
178
  const {
186
179
  playIcon: PlayIcon,
187
180
  playIconColor,
188
181
  ...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, {
182
+ } = useThemeTokens('SplashButtonWithDetails', tokens, variant);
183
+ const mappedVideoLength = getTimestamp(videoLength, copy);
184
+ const ariaLabel = getAriaLabel(mappedVideoLength, copy);
185
+ return /*#__PURE__*/_jsx(ButtonContainer, {
193
186
  "aria-label": ariaLabel,
194
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ButtonContent, {
187
+ children: /*#__PURE__*/_jsxs(ButtonContent, {
195
188
  ...selectButtonContentTokens(themeTokens),
196
189
  buttonContentChildrenBackground: buttonContentChildrenBackground,
197
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PlayIconContainer, {
190
+ children: [/*#__PURE__*/_jsx(PlayIconContainer, {
198
191
  ...selectPlayIconContainerTokens(themeTokens),
199
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PlayIcon, {
192
+ children: /*#__PURE__*/_jsx(PlayIcon, {
200
193
  size: 13,
201
194
  color: playIconColor
202
195
  })
203
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(DetailsContainer, {
196
+ }), /*#__PURE__*/_jsxs(DetailsContainer, {
204
197
  ...selectDetailsContainerTokens(themeTokens),
205
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
198
+ children: [/*#__PURE__*/_jsx(Typography, {
206
199
  variant: {
207
200
  bold: true
208
201
  },
209
202
  tokens: getLabelTokens(themeTokens),
210
203
  children: label
211
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
204
+ }), /*#__PURE__*/_jsx(Typography, {
212
205
  variant: {
213
206
  colour: 'secondary' /* TODO: this is not the same color as in designs */,
214
207
  size: 'micro'
@@ -220,11 +213,10 @@ const SplashButtonWithDetails = _ref16 => {
220
213
  });
221
214
  };
222
215
  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'])
216
+ label: PropTypes.string,
217
+ tokens: PropTypes.object,
218
+ variant: PropTypes.object,
219
+ videoLength: PropTypes.number,
220
+ copy: PropTypes.oneOf(['en', 'fr'])
228
221
  };
229
- var _default = SplashButtonWithDetails;
230
- exports.default = _default;
222
+ export default SplashButtonWithDetails;
@@ -1,22 +1,15 @@
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 _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _componentsBase = require("@telus-uds/components-base");
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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
- const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
19
- const SplashBackground = /*#__PURE__*/_styledComponents.default.div.withConfig({
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import { selectSystemProps, useViewport } from '@telus-uds/components-base';
5
+ import { viewports } from '@telus-uds/system-constants';
6
+ import SplashButton from './SplashButton/SplashButton';
7
+ import SplashButtonWithDetails from './SplashButtonWithDetails/SplashButtonWithDetails';
8
+ import videoText from '../../Video/videoText';
9
+ import { htmlAttrs } from '../../utils';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
12
+ const SplashBackground = /*#__PURE__*/styled.div.withConfig({
20
13
  displayName: "VideoSplash__SplashBackground",
21
14
  componentId: "components-web__sc-1ejxt6-0"
22
15
  })(_ref => {
@@ -44,18 +37,18 @@ const VideoSplash = _ref2 => {
44
37
  onClick,
45
38
  ...rest
46
39
  } = _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, {
40
+ const viewport = useViewport();
41
+ const showDetails = !simpleMode && viewport !== viewports.xs;
42
+ const label = videoText[copy].watch;
43
+ return /*#__PURE__*/_jsx(SplashBackground, {
51
44
  ...selectProps(rest),
52
45
  onClick: onClick,
53
46
  videoPoster: poster,
54
- children: showDetails ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SplashButtonWithDetails.default, {
47
+ children: showDetails ? /*#__PURE__*/_jsx(SplashButtonWithDetails, {
55
48
  videoLength: videoLength,
56
49
  copy: copy,
57
50
  label: label
58
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_SplashButton.default, {
51
+ }) : /*#__PURE__*/_jsx(SplashButton, {
59
52
  videoLength: videoLength,
60
53
  copy: copy
61
54
  })
@@ -63,11 +56,10 @@ const VideoSplash = _ref2 => {
63
56
  };
64
57
  VideoSplash.propTypes = {
65
58
  ...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'])
59
+ onClick: PropTypes.func,
60
+ poster: PropTypes.string,
61
+ videoLength: PropTypes.number.isRequired,
62
+ simpleMode: PropTypes.bool,
63
+ copy: PropTypes.oneOf(['en', 'fr'])
71
64
  };
72
- var _default = VideoSplash;
73
- exports.default = _default;
65
+ export default VideoSplash;
@@ -1,12 +1,5 @@
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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- const getTimestamp = (videoLength, copy) => {
1
+ import videoText from '../../Video/videoText';
2
+ export const getTimestamp = (videoLength, copy) => {
10
3
  const minutes = Math.floor(videoLength / 60);
11
4
  const seconds = Math.ceil(videoLength % 60);
12
5
  const minutesText = minutes > 0 ? `${minutes}min ` : '';
@@ -18,15 +11,13 @@ const getTimestamp = (videoLength, copy) => {
18
11
  timestamp
19
12
  };
20
13
  };
21
- exports.getTimestamp = getTimestamp;
22
- const getAriaLabel = (timestamp, copy) => {
14
+ export const getAriaLabel = (timestamp, copy) => {
23
15
  const {
24
16
  minutes,
25
17
  seconds
26
18
  } = timestamp;
27
- const text = _videoText.default[copy];
19
+ const text = videoText[copy];
28
20
  const minutesText = `${minutes} ${minutes !== 1 ? text.minutes : text.minute}`;
29
21
  const secondsText = `${seconds} ${seconds !== 1 ? text.seconds : text.second}`;
30
22
  return text.ariaLabel.replace('{minutes}', minutesText).replace('{seconds}', secondsText);
31
- };
32
- exports.getAriaLabel = getAriaLabel;
23
+ };
@@ -1,75 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "deprecate", {
7
- enumerable: true,
8
- get: function () {
9
- return _logger.deprecate;
10
- }
11
- });
12
- Object.defineProperty(exports, "htmlAttrs", {
13
- enumerable: true,
14
- get: function () {
15
- return _componentsBase.htmlAttrs;
16
- }
17
- });
18
- Object.defineProperty(exports, "isElementFocusable", {
19
- enumerable: true,
20
- get: function () {
21
- return _isElementFocusable.default;
22
- }
23
- });
24
- Object.defineProperty(exports, "media", {
25
- enumerable: true,
26
- get: function () {
27
- return _media.default;
28
- }
29
- });
30
- Object.defineProperty(exports, "renderStructuredContent", {
31
- enumerable: true,
32
- get: function () {
33
- return _renderStructuredContent.default;
34
- }
35
- });
36
- Object.defineProperty(exports, "ssrStyles", {
37
- enumerable: true,
38
- get: function () {
39
- return _ssr.default;
40
- }
41
- });
42
- Object.defineProperty(exports, "transformGradient", {
43
- enumerable: true,
44
- get: function () {
45
- return _transforms.transformGradient;
46
- }
47
- });
48
- Object.defineProperty(exports, "useOverlaidPosition", {
49
- enumerable: true,
50
- get: function () {
51
- return _useOverlaidPosition.default;
52
- }
53
- });
54
- Object.defineProperty(exports, "useTypographyTheme", {
55
- enumerable: true,
56
- get: function () {
57
- return _useTypographyTheme.default;
58
- }
59
- });
60
- Object.defineProperty(exports, "warn", {
61
- enumerable: true,
62
- get: function () {
63
- return _logger.warn;
64
- }
65
- });
66
- var _componentsBase = require("@telus-uds/components-base");
67
- var _logger = require("./logger");
68
- var _transforms = require("./transforms");
69
- var _useTypographyTheme = _interopRequireDefault(require("./useTypographyTheme"));
70
- var _media = _interopRequireDefault(require("./media"));
71
- var _ssr = _interopRequireDefault(require("./ssr"));
72
- var _isElementFocusable = _interopRequireDefault(require("./isElementFocusable"));
73
- var _renderStructuredContent = _interopRequireDefault(require("./renderStructuredContent"));
74
- var _useOverlaidPosition = _interopRequireDefault(require("./useOverlaidPosition"));
75
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1
+ import { htmlAttrs } from '@telus-uds/components-base';
2
+ import { warn, deprecate } from './logger';
3
+ import { transformGradient } from './transforms';
4
+ import useTypographyTheme from './useTypographyTheme';
5
+ import media from './media';
6
+ import ssrStyles from './ssr';
7
+ import isElementFocusable from './isElementFocusable';
8
+ import renderStructuredContent from './renderStructuredContent';
9
+ import useOverlaidPosition from './useOverlaidPosition';
10
+ export { deprecate, htmlAttrs, transformGradient, useTypographyTheme, warn, media, renderStructuredContent, ssrStyles, isElementFocusable, useOverlaidPosition };
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
1
  /**
8
2
  * Returns focusable elements inside of the Footnote
9
3
  */
@@ -11,5 +5,4 @@ const isElementFocusable = element => {
11
5
  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
6
  return element.matches(focusableElements) && !element.hasAttribute('disabled') && !element.matches('[tabindex="-1"]');
13
7
  };
14
- var _default = isElementFocusable;
15
- exports.default = _default;
8
+ export default isElementFocusable;
@@ -1,25 +1,16 @@
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) => {
1
+ export const deprecate = (componentName, message) => {
8
2
  if (process.env.NODE_ENV === 'production') {
9
3
  return;
10
4
  }
11
- console.warn(`[Allium] [Deprecate] ${componentName}: ${message}`); // eslint-disable-line no-console
5
+ console.warn(`[Allium] [Deprecate] ${componentName}: ${message}`);
12
6
  };
13
- exports.deprecate = deprecate;
14
- const warn = (componentName, message) => {
7
+ export const warn = (componentName, message) => {
15
8
  if (process.env.NODE_ENV === 'production') {
16
9
  return;
17
10
  }
18
- console.warn(`[Allium] ${componentName}: ${message}`); // eslint-disable-line no-console
11
+ console.warn(`[Allium] ${componentName}: ${message}`);
19
12
  };
20
- exports.warn = warn;
21
- var _default = {
13
+ export default {
22
14
  deprecate,
23
15
  warn
24
- };
25
- exports.default = _default;
16
+ };
@@ -1,15 +1,9 @@
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() {
1
+ import { viewports } from '@telus-uds/system-constants';
2
+ export default function media() {
9
3
  return {
10
4
  query: {},
11
5
  from(breakpoint) {
12
- if (breakpoint !== _systemConstants.viewports.xs) {
6
+ if (breakpoint !== viewports.xs) {
13
7
  this.query.minWidth = breakpoint;
14
8
  }
15
9
  return this;
@@ -28,8 +22,8 @@ function media() {
28
22
  maxWidth,
29
23
  and
30
24
  } = 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;
25
+ const min = minWidth ? `(min-width: ${viewports.map.get(minWidth)}px)` : undefined;
26
+ const max = maxWidth ? `(max-width: ${viewports.map.get(maxWidth) - 1}px)` : undefined;
33
27
  if (typeof min !== 'undefined' || typeof max !== 'undefined' || typeof and !== 'undefined') {
34
28
  const mediaQuery = `@media ${[min, max, and].filter(a => a).join(' and ')}`;
35
29
  this.query = {};
@@ -1,18 +1,12 @@
1
- "use strict";
1
+ import React, { createElement as _createElement } from 'react';
2
+ import { Link } from '@telus-uds/components-base';
2
3
 
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(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
4
  /**
13
5
  * Takes a string content and marks up all the links in it by wrapping them
14
6
  * in `Link` component.
15
- */const generateLinks = content => {
7
+ */
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ const generateLinks = content => {
16
10
  const linkRegex = /<\s*a([^>]*)>(.*?)<\s*\/\s*a>/g;
17
11
  const attributeRegex = /(\w+)\s*=\s*((["'])(.*?)\3|(?=\s|\/>))/g;
18
12
  const parts = content.split(linkRegex);
@@ -37,7 +31,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
37
31
  // Remove anchor attributes from parts
38
32
  parts[i - 1] = undefined;
39
33
  // Replace anchor text with Link in parts
40
- parts[i] = /*#__PURE__*/(0, _react.createElement)(_componentsBase.Link, {
34
+ parts[i] = /*#__PURE__*/_createElement(Link, {
41
35
  ...o,
42
36
  key: i
43
37
  }, parts[i]);
@@ -55,7 +49,7 @@ const generateBreaks = parts => {
55
49
  if (typeof partsWithBreaks[i] === 'string' && partsWithBreaks[i].search(breakRegex) !== -1) {
56
50
  const toSplit = partsWithBreaks[i].split(breakRegex);
57
51
  for (let x = 1; x < toSplit.length; x += 2) {
58
- toSplit.splice(x, 0, /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}, `break-${i}-${x}`));
52
+ toSplit.splice(x, 0, /*#__PURE__*/_jsx("br", {}, `break-${i}-${x}`));
59
53
  }
60
54
  partsWithBreaks[i] = toSplit;
61
55
  }
@@ -68,5 +62,4 @@ const renderStructuredContent = content => {
68
62
  }
69
63
  return generateBreaks(generateLinks(content));
70
64
  };
71
- var _default = renderStructuredContent;
72
- exports.default = _default;
65
+ export default renderStructuredContent;
package/lib/utils/ssr.js CHANGED
@@ -1,11 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _styledComponents = require("styled-components");
8
- var _componentsBase = require("@telus-uds/components-base");
1
+ import { ServerStyleSheet } from 'styled-components';
2
+ import { ssrStyles as baseSsrStyles } from '@telus-uds/components-base';
9
3
  /**
10
4
  * Returns object with `renderApp` and `getStyles` functions.
11
5
  * Weave these into your app's server-side render process:
@@ -29,16 +23,15 @@ const ssrStyles = function () {
29
23
  styleGetters = [],
30
24
  collectStyles = renderedApp => renderedApp
31
25
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
32
- const sheet = new _styledComponents.ServerStyleSheet();
26
+ const sheet = new ServerStyleSheet();
33
27
  const getStyledComponentsStyles = () => {
34
28
  const styles = sheet.getStyleElement();
35
29
  sheet.seal();
36
30
  return styles;
37
31
  };
38
- return (0, _componentsBase.ssrStyles)(appName, {
32
+ return baseSsrStyles(appName, {
39
33
  styleGetters: [getStyledComponentsStyles, ...styleGetters],
40
34
  collectStyles: renderedApp => collectStyles(sheet.collectStyles(renderedApp))
41
35
  });
42
36
  };
43
- var _default = ssrStyles;
44
- exports.default = _default;
37
+ export default ssrStyles;
@@ -1,21 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = getTheme;
7
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
8
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
9
1
  const cachedTheme = {};
10
2
  const theme = process.env.UDS_THEME;
11
3
  async function importTheme(componentName) {
12
4
  try {
13
- cachedTheme[componentName] = await Promise.resolve(`@telus-uds/theme-${theme}/build/rn/${componentName}.js`).then(s => _interopRequireWildcard(require(s)));
5
+ cachedTheme[componentName] = await import(`@telus-uds/theme-${theme}/build/rn/${componentName}.js`);
14
6
  } catch (_) {
15
7
  throw new Error(`An error occurred while trying to import theme-${process.env.UDS_THEME}. Please check that the theme has been installed in your app or that you are not importing a server component inside a client component.`);
16
8
  }
17
9
  }
18
- async function getTheme(componentName) {
10
+ export default async function getTheme(componentName) {
19
11
  if (cachedTheme[componentName]) {
20
12
  return cachedTheme[componentName];
21
13
  }
@@ -1,14 +1,7 @@
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 _jsxRuntime = require("react/jsx-runtime");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { getTokensPropType, useThemeTokens } from '@telus-uds/components-base';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
12
5
  const withClientTheme = Component => {
13
6
  const UdsStyledComponent = _ref => {
14
7
  let {
@@ -16,17 +9,16 @@ const withClientTheme = Component => {
16
9
  variant,
17
10
  ...props
18
11
  } = _ref;
19
- const theme = (0, _componentsBase.useThemeTokens)(Component.displayName, tokenOverrides, variant);
20
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
12
+ const theme = useThemeTokens(Component.displayName, tokenOverrides, variant);
13
+ return /*#__PURE__*/_jsx(Component, {
21
14
  theme: theme,
22
15
  ...props
23
16
  });
24
17
  };
25
18
  UdsStyledComponent.propTypes = {
26
- tokens: (0, _componentsBase.getTokensPropType)(Component.displayName),
27
- variant: _propTypes.default.string
19
+ tokens: getTokensPropType(Component.displayName),
20
+ variant: PropTypes.string
28
21
  };
29
22
  return UdsStyledComponent;
30
23
  };
31
- var _default = withClientTheme;
32
- exports.default = _default;
24
+ export default withClientTheme;
@@ -1,15 +1,8 @@
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 _server = require("@telus-uds/components-base/server");
10
- var _getThemeFromServer = _interopRequireDefault(require("./get-theme-from-server"));
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { getThemeTokens, getTokensPropType } from '@telus-uds/components-base/server';
4
+ import getTheme from './get-theme-from-server';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
13
6
  const withServerTheme = (Component, componentName) => {
14
7
  const UdsStyledComponent = async _ref => {
15
8
  let {
@@ -17,18 +10,17 @@ const withServerTheme = (Component, componentName) => {
17
10
  variant,
18
11
  ...props
19
12
  } = _ref;
20
- const componentTheme = await (0, _getThemeFromServer.default)(componentName);
21
- const themeTokens = (0, _server.getThemeTokens)(componentTheme, tokenOverrides, variant);
22
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
13
+ const componentTheme = await getTheme(componentName);
14
+ const themeTokens = getThemeTokens(componentTheme, tokenOverrides, variant);
15
+ return /*#__PURE__*/_jsx(Component, {
23
16
  theme: themeTokens,
24
17
  ...props
25
18
  });
26
19
  };
27
20
  UdsStyledComponent.propTypes = {
28
- tokens: (0, _server.getTokensPropType)(componentName),
29
- variant: _propTypes.default.string
21
+ tokens: getTokensPropType(componentName),
22
+ variant: PropTypes.string
30
23
  };
31
24
  return UdsStyledComponent;
32
25
  };
33
- var _default = withServerTheme;
34
- exports.default = _default;
26
+ export default withServerTheme;
@@ -1,12 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.transformGradient = exports.default = void 0;
7
- const transformGradient = gradient => `${gradient.type}-gradient(${gradient.angle}deg, ${gradient.stops[0].color} ${gradient.stops[0].stop * 100}%, ${gradient.stops[1].color} ${gradient.stops[1].stop * 100}%)`;
8
- exports.transformGradient = transformGradient;
9
- var _default = {
1
+ export const transformGradient = gradient => `${gradient.type}-gradient(${gradient.angle}deg, ${gradient.stops[0].color} ${gradient.stops[0].stop * 100}%, ${gradient.stops[1].color} ${gradient.stops[1].stop * 100}%)`;
2
+ export default {
10
3
  transformGradient
11
- };
12
- exports.default = _default;
4
+ };