@telus-uds/components-web 2.44.0 → 3.0.1

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 +22 -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 +94 -103
  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 +1 -2
  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 -519
  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,18 +1,11 @@
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 _utils = require("../../utils");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
15
- const StyledItemContainer = /*#__PURE__*/_styledComponents.default.li.withConfig({
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import { Link, Typography, applyTextStyles, clickProps, selectSystemProps, useThemeTokens } from '@telus-uds/components-base';
5
+ import { htmlAttrs } from '../../utils';
6
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
8
+ const StyledItemContainer = /*#__PURE__*/styled.li.withConfig({
16
9
  displayName: "Item__StyledItemContainer",
17
10
  componentId: "components-web__sc-1rfdaul-0"
18
11
  })({
@@ -32,7 +25,7 @@ const StyledItemContainer = /*#__PURE__*/_styledComponents.default.li.withConfig
32
25
  },
33
26
  marginBottom: '8px'
34
27
  });
35
- const IconContainer = /*#__PURE__*/_styledComponents.default.span.withConfig({
28
+ const IconContainer = /*#__PURE__*/styled.span.withConfig({
36
29
  displayName: "Item__IconContainer",
37
30
  componentId: "components-web__sc-1rfdaul-1"
38
31
  })({
@@ -54,7 +47,7 @@ const IconContainer = /*#__PURE__*/_styledComponents.default.span.withConfig({
54
47
  fontName,
55
48
  fontWeight
56
49
  } = _ref5;
57
- return (0, _componentsBase.applyTextStyles)({
50
+ return applyTextStyles({
58
51
  fontName,
59
52
  fontWeight
60
53
  }).fontFamily;
@@ -74,7 +67,7 @@ const IconContainer = /*#__PURE__*/_styledComponents.default.span.withConfig({
74
67
  },
75
68
  verticalAlign: 'bottom'
76
69
  });
77
- const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
70
+ const Item = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
78
71
  let {
79
72
  href,
80
73
  children,
@@ -102,17 +95,17 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
102
95
  listItemPadding,
103
96
  iconContainerSize,
104
97
  iconPadding
105
- } = (0, _componentsBase.useThemeTokens)('Breadcrumbs', tokens, variant);
98
+ } = useThemeTokens('Breadcrumbs', tokens, variant);
106
99
  const linkOptions = {
107
- ..._componentsBase.clickProps.toPressProps(selectProps(rest)),
100
+ ...clickProps.toPressProps(selectProps(rest)),
108
101
  href
109
102
  };
110
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledItemContainer, {
103
+ return /*#__PURE__*/_jsx(StyledItemContainer, {
111
104
  listItemPadding: listItemPadding,
112
105
  lineHeight: lineHeight,
113
106
  fontSize: fontSize,
114
107
  iconContainerSize: iconContainerSize,
115
- children: current ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
108
+ children: current ? /*#__PURE__*/_jsx(Typography, {
116
109
  tokens: {
117
110
  color: currentColor,
118
111
  fontSize,
@@ -121,8 +114,8 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
121
114
  },
122
115
  variant: variant,
123
116
  children: children
124
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
125
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Link, {
117
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
118
+ children: [/*#__PURE__*/_jsx(Link, {
126
119
  ...linkOptions,
127
120
  ref: ref,
128
121
  tokens: {
@@ -135,12 +128,12 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
135
128
  variant: variant,
136
129
  onPress: onPress,
137
130
  children: children
138
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconContainer, {
131
+ }), /*#__PURE__*/_jsx(IconContainer, {
139
132
  iconPadding: iconPadding,
140
133
  fontName: fontName,
141
134
  fontWeight: fontWeight,
142
135
  iconContainerSize: iconContainerSize,
143
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronRightIcon, {
136
+ children: /*#__PURE__*/_jsx(ChevronRightIcon, {
144
137
  size: iconSize,
145
138
  color: iconColor
146
139
  })
@@ -154,28 +147,27 @@ Item.propTypes = {
154
147
  /**
155
148
  * Breadcrumb text
156
149
  */
157
- children: _propTypes.default.node.isRequired,
150
+ children: PropTypes.node.isRequired,
158
151
  /**
159
152
  * @ignore
160
153
  *
161
154
  * Indicates whether or not the Item should be as current/active
162
155
  */
163
- current: _propTypes.default.bool,
156
+ current: PropTypes.bool,
164
157
  /**
165
158
  * Target URL. This will be converted to `to` if the `LinkRouter`
166
159
  * prop is provided to the `Item` or parent `Breadcrumbs` element.
167
160
  */
168
- href: _propTypes.default.string.isRequired,
161
+ href: PropTypes.string.isRequired,
169
162
  /**
170
163
  * Variant to render.
171
164
  */
172
- variant: _propTypes.default.shape({
173
- inverse: _propTypes.default.bool
165
+ variant: PropTypes.shape({
166
+ inverse: PropTypes.bool
174
167
  }),
175
168
  /**
176
169
  * Function to be called when the Item is clicked.
177
170
  */
178
- onPress: _propTypes.default.func
171
+ onPress: PropTypes.func
179
172
  };
180
- var _default = Item;
181
- exports.default = _default;
173
+ export default Item;
@@ -1,13 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "default", {
7
- enumerable: true,
8
- get: function () {
9
- return _Breadcrumbs.default;
10
- }
11
- });
12
- var _Breadcrumbs = _interopRequireDefault(require("./Breadcrumbs"));
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1
+ export { default } from './Breadcrumbs';
@@ -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 _utils = require("../utils");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import { Icon, selectSystemProps, Typography, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
5
+ import { htmlAttrs } from '../utils';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
15
8
  const getAlignment = (rounded, textAlignToFlex) => {
16
9
  if (textAlignToFlex) {
17
10
  switch (textAlignToFlex) {
@@ -37,7 +30,7 @@ const verticalAlignToFlex = verticalAlign => {
37
30
  return 'top';
38
31
  }
39
32
  };
40
- const CalloutContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
33
+ const CalloutContainer = /*#__PURE__*/styled.div.withConfig({
41
34
  displayName: "Callout__CalloutContainer",
42
35
  componentId: "components-web__sc-1a7ptx-0"
43
36
  })(_ref => {
@@ -60,7 +53,7 @@ const CalloutContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
60
53
  alignItems: verticalAlignToFlex(verticalAlign)
61
54
  };
62
55
  });
63
- const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
56
+ const Callout = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
64
57
  let {
65
58
  icon,
66
59
  children,
@@ -79,12 +72,12 @@ const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
79
72
  paddingTop,
80
73
  paddingBottom,
81
74
  color
82
- } = (0, _componentsBase.useThemeTokens)('Callout', tokens, variant);
75
+ } = useThemeTokens('Callout', tokens, variant);
83
76
  const {
84
77
  rounded = false,
85
78
  size = 'medium'
86
79
  } = variant;
87
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CalloutContainer, {
80
+ return /*#__PURE__*/_jsxs(CalloutContainer, {
88
81
  size: size,
89
82
  rounded: rounded,
90
83
  "data-testid": "callout-container",
@@ -96,7 +89,7 @@ const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
96
89
  padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
97
90
  ref: ref,
98
91
  ...selectProps(rest),
99
- children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Icon, {
92
+ children: [icon && /*#__PURE__*/_jsx(Icon, {
100
93
  tokens: {
101
94
  color
102
95
  },
@@ -105,7 +98,7 @@ const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
105
98
  rank: 'primary',
106
99
  size
107
100
  }
108
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
101
+ }), /*#__PURE__*/_jsx(Typography, {
109
102
  variant: {
110
103
  size,
111
104
  compact: size === 'small'
@@ -120,23 +113,22 @@ const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
120
113
  Callout.displayName = 'Callout';
121
114
  Callout.propTypes = {
122
115
  ...selectedSystemPropTypes,
123
- tokens: (0, _componentsBase.getTokensPropType)('Callout'),
116
+ tokens: getTokensPropType('Callout'),
124
117
  /**
125
118
  * Icon to display on the left side of the Callout
126
119
  */
127
- icon: _propTypes.default.elementType,
120
+ icon: PropTypes.elementType,
128
121
  /**
129
122
  * Children nodes that can be added
130
123
  */
131
- children: _propTypes.default.node.isRequired,
124
+ children: PropTypes.node.isRequired,
132
125
  /**
133
126
  * To change the horizontal alignment of the Callout's text
134
127
  */
135
- textAlignToFlex: _propTypes.default.oneOf(['center', 'left']),
128
+ textAlignToFlex: PropTypes.oneOf(['center', 'left']),
136
129
  /**
137
130
  * To change the vertical alignment of the Callout's icon
138
131
  */
139
- verticalAlign: _propTypes.default.oneOf(['top', 'middle', 'bottom'])
132
+ verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom'])
140
133
  };
141
- var _default = Callout;
142
- exports.default = _default;
134
+ export default Callout;
@@ -1,10 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _Callout = _interopRequireDefault(require("./Callout"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var _default = _Callout.default;
10
- exports.default = _default;
1
+ import Callout from './Callout';
2
+ export default Callout;
package/lib/Card/Card.js CHANGED
@@ -1,24 +1,15 @@
1
- "use strict";
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { Card as CardBase, getTokensPropType, paddingProp, responsiveProps, selectSystemProps, StackView, useThemeTokens, useThemeTokensCallback, variantProp, a11yProps, viewProps, PressableCardBase, useResponsiveProp } from '@telus-uds/components-base';
4
+ import styled from 'styled-components';
5
+ import CardContent from './CardContent';
6
+ import CardFooter from './CardFooter';
7
+ import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
8
+ import ConditionalWrapper from '../shared/ConditionalWrapper';
2
9
 
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 _componentsWeb = require("@telus-uds/components-web");
11
- var _styledComponents = _interopRequireDefault(require("styled-components"));
12
- var _CardContent = _interopRequireDefault(require("./CardContent"));
13
- var _CardFooter = _interopRequireDefault(require("./CardFooter"));
14
- var _FullBleedContent = _interopRequireWildcard(require("../shared/FullBleedContent"));
15
- var _ConditionalWrapper = _interopRequireDefault(require("../shared/ConditionalWrapper"));
16
- var _jsxRuntime = require("react/jsx-runtime");
17
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
10
  // Passes React Native-oriented system props through UDS Card
21
- const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_componentsBase.a11yProps, _componentsBase.viewProps]);
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
22
13
 
23
14
  /**
24
15
  * A basic card component, unstyled by default.
@@ -49,7 +40,7 @@ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemP
49
40
  * ## Accessibility
50
41
  * `Card` component accepts all the standard accessibility props.
51
42
  */
52
- const DynamicWidthContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
43
+ const DynamicWidthContainer = /*#__PURE__*/styled.div.withConfig({
53
44
  displayName: "Card__DynamicWidthContainer",
54
45
  componentId: "components-web__sc-1elbtwd-0"
55
46
  })(_ref => {
@@ -66,7 +57,7 @@ const DynamicWidthContainer = /*#__PURE__*/_styledComponents.default.div.withCon
66
57
  overflow
67
58
  };
68
59
  });
69
- const Card = /*#__PURE__*/_react.default.forwardRef(function () {
60
+ const Card = /*#__PURE__*/React.forwardRef(function () {
70
61
  let {
71
62
  children,
72
63
  footer,
@@ -91,7 +82,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
91
82
  contentStackDirection,
92
83
  fullBleedContentPosition,
93
84
  fullBleedContentProps
94
- } = (0, _FullBleedContent.useFullBleedContentProps)(fullBleedContent);
85
+ } = useFullBleedContentProps(fullBleedContent);
95
86
  const {
96
87
  imgCol
97
88
  } = fullBleedContentProps;
@@ -100,18 +91,18 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
100
91
  // those corners on the image as well, but partially
101
92
  const {
102
93
  borderRadius
103
- } = (0, _componentsBase.useThemeTokens)('Card', tokens, variant);
104
- const getThemeTokens = (0, _componentsBase.useThemeTokensCallback)('Card', interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.tokens, {
94
+ } = useThemeTokens('Card', tokens, variant);
95
+ const getThemeTokens = useThemeTokensCallback('Card', interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.tokens, {
105
96
  interactive: true,
106
97
  ...((interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.variant) || {})
107
98
  });
108
99
  const hasFooter = Boolean(footer);
109
- const fullBleedBorderRadius = (0, _FullBleedContent.getFullBleedBorderRadius)(borderRadius, fullBleedContentPosition, hasFooter);
100
+ const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius, fullBleedContentPosition, hasFooter);
110
101
 
111
102
  // takes imgCol from fullBleedContent if present, to dynamically set width of image
112
103
  // card content will adapt to the size of image to add up to 100% width of card width
113
104
  // pass as props to ConditionalWrapper
114
- const imgColCurrentViewport = (0, _componentsWeb.useResponsiveProp)(imgCol);
105
+ const imgColCurrentViewport = useResponsiveProp(imgCol);
115
106
  const maxCol = 12;
116
107
  const fullBleedImageWidth = `${imgColCurrentViewport / maxCol * 100}%`;
117
108
  const adaptiveContentWidth = `${(maxCol - imgColCurrentViewport) / maxCol * 100}%`;
@@ -140,7 +131,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
140
131
  paddingRight,
141
132
  ...restOfTokens
142
133
  } = tokens;
143
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.Card, {
134
+ return /*#__PURE__*/_jsxs(CardBase, {
144
135
  ref: ref,
145
136
  variant: {
146
137
  ...variant,
@@ -149,41 +140,41 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
149
140
  tokens: restOfTokens,
150
141
  backgroundImage: backgroundImage,
151
142
  ...selectProps(rest),
152
- children: [interactiveCard !== null && interactiveCard !== void 0 && interactiveCard.body ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.PressableCardBase, {
143
+ children: [interactiveCard !== null && interactiveCard !== void 0 && interactiveCard.body ? /*#__PURE__*/_jsx(PressableCardBase, {
153
144
  ref: ref,
154
145
  tokens: getThemeTokens,
155
146
  dataSet: dataSet,
156
147
  onPress: onPress,
157
148
  ...selectProps(rest),
158
149
  children: typeof (interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body) === 'function' ? interactiveCard.body() : interactiveCard.body
159
- }) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
150
+ }) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/_jsxs(StackView, {
160
151
  direction: contentStackDirection,
161
152
  tokens: {
162
153
  ...columnFlex,
163
154
  alignItems: contentStackAlign
164
155
  },
165
156
  space: 0,
166
- children: [children ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.default, {
157
+ children: [children ? /*#__PURE__*/_jsx(ConditionalWrapper, {
167
158
  WrapperComponent: DynamicWidthContainer,
168
159
  wrapperProps: contentWrapperStyleProps,
169
160
  condition: isImageWidthAdjustable,
170
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardContent.default, {
161
+ children: /*#__PURE__*/_jsx(CardContent, {
171
162
  tokens: tokens,
172
163
  variant: variant,
173
164
  withFooter: hasFooter,
174
165
  children: children
175
166
  })
176
- }) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.default, {
167
+ }) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/_jsx(ConditionalWrapper, {
177
168
  WrapperComponent: DynamicWidthContainer,
178
169
  wrapperProps: imageWrapperStyleProps,
179
170
  condition: isImageWidthAdjustable,
180
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullBleedContent.default, {
171
+ children: /*#__PURE__*/_jsx(FullBleedContent, {
181
172
  borderRadius: fullBleedBorderRadius,
182
173
  ...fullBleedContentProps,
183
174
  position: fullBleedContentPosition
184
175
  })
185
176
  })]
186
- }) : null, footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardFooter.default, {
177
+ }) : null, footer && /*#__PURE__*/_jsx(CardFooter, {
187
178
  padding: footerPadding,
188
179
  tokens: tokens,
189
180
  variant: variant,
@@ -193,11 +184,11 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
193
184
  });
194
185
  const positionValues = ['none', 'bottom', 'left', 'right', 'top'];
195
186
  const alignValues = ['start', 'end', 'center', 'stretch'];
196
- const PositionedFullBleedContentPropType = _propTypes.default.shape({
197
- position: _componentsBase.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(positionValues)).isRequired,
198
- align: _componentsBase.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(alignValues)),
187
+ const PositionedFullBleedContentPropType = PropTypes.shape({
188
+ position: responsiveProps.getTypeOptionallyByViewport(PropTypes.oneOf(positionValues)).isRequired,
189
+ align: responsiveProps.getTypeOptionallyByViewport(PropTypes.oneOf(alignValues)),
199
190
  // eslint-disable-next-line react/forbid-foreign-prop-types
200
- ..._FullBleedContent.default.propTypes
191
+ ...FullBleedContent.propTypes
201
192
  });
202
193
  Card.displayName = 'Card';
203
194
  Card.propTypes = {
@@ -205,15 +196,15 @@ Card.propTypes = {
205
196
  /**
206
197
  * Card content.
207
198
  */
208
- children: _propTypes.default.node,
199
+ children: PropTypes.node,
209
200
  /**
210
201
  * Card footer.
211
202
  */
212
- footer: _propTypes.default.node,
203
+ footer: PropTypes.node,
213
204
  /**
214
205
  * Custom card footer padding.
215
206
  */
216
- footerPadding: _componentsBase.paddingProp.propType,
207
+ footerPadding: paddingProp.propType,
217
208
  /**
218
209
  * Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
219
210
  *
@@ -227,33 +218,32 @@ Card.propTypes = {
227
218
  /**
228
219
  * Card tokens.
229
220
  */
230
- tokens: (0, _componentsBase.getTokensPropType)('Card'),
221
+ tokens: getTokensPropType('Card'),
231
222
  /**
232
223
  * Card variant.
233
224
  */
234
- variant: _componentsBase.variantProp.propType,
225
+ variant: variantProp.propType,
235
226
  /**
236
227
  * Function to call on pressing the card.
237
228
  * Note: This is only available when `interactive` variant is used.
238
229
  */
239
- onPress: _propTypes.default.func,
230
+ onPress: PropTypes.func,
240
231
  /**
241
232
  * Object to set interactive card's properties
242
233
  */
243
- interactiveCard: _propTypes.default.shape({
244
- body: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
245
- tokens: (0, _componentsBase.getTokensPropType)('Card'),
246
- variant: _componentsBase.variantProp.propType
234
+ interactiveCard: PropTypes.shape({
235
+ body: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
236
+ tokens: getTokensPropType('Card'),
237
+ variant: variantProp.propType
247
238
  }),
248
239
  /**
249
240
  * Apply background image to the card.
250
241
  */
251
- backgroundImage: _propTypes.default.shape({
242
+ backgroundImage: PropTypes.shape({
252
243
  // src is either a URI string or an object when used responsively to provide different image sources for different screen sizes
253
- src: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]).isRequired,
254
- alt: _propTypes.default.string,
255
- resizeMode: _componentsBase.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']))
244
+ src: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
245
+ alt: PropTypes.string,
246
+ resizeMode: responsiveProps.getTypeOptionallyByViewport(PropTypes.oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']))
256
247
  })
257
248
  };
258
- var _default = Card;
259
- exports.default = _default;
249
+ export default Card;
@@ -1,18 +1,11 @@
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 _utils = require("../utils");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
15
- const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { getTokensPropType, selectSystemProps, useThemeTokens, useViewport, variantProp } from '@telus-uds/components-base';
4
+ import styled from 'styled-components';
5
+ import { htmlAttrs } from '../utils';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
8
+ const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
16
9
  displayName: "CardContent__CardContentContainer",
17
10
  componentId: "components-web__sc-1k2501q-0"
18
11
  })(_ref => {
@@ -52,7 +45,7 @@ const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConf
52
45
  /**
53
46
  * Card content, applying the card tokens as per the theme used.
54
47
  */
55
- const CardContent = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
48
+ const CardContent = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
56
49
  let {
57
50
  children,
58
51
  flexContent,
@@ -61,11 +54,11 @@ const CardContent = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
61
54
  withFooter = false,
62
55
  ...rest
63
56
  } = _ref2;
64
- const viewport = (0, _componentsBase.useViewport)();
65
- const themeTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, variant, {
57
+ const viewport = useViewport();
58
+ const themeTokens = useThemeTokens('Card', tokens, variant, {
66
59
  viewport
67
60
  });
68
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardContentContainer, {
61
+ return /*#__PURE__*/_jsx(CardContentContainer, {
69
62
  ...themeTokens,
70
63
  flexContent: flexContent,
71
64
  withFooter: withFooter,
@@ -80,19 +73,18 @@ CardContent.propTypes = {
80
73
  /**
81
74
  * Card section content.
82
75
  */
83
- children: _propTypes.default.node,
76
+ children: PropTypes.node,
84
77
  /**
85
78
  * Card tokens.
86
79
  */
87
- tokens: (0, _componentsBase.getTokensPropType)('Card'),
80
+ tokens: getTokensPropType('Card'),
88
81
  /**
89
82
  * Card variant.
90
83
  */
91
- variant: _componentsBase.variantProp.propType,
84
+ variant: variantProp.propType,
92
85
  /**
93
86
  * Whether the card has a footer.
94
87
  */
95
- withFooter: _propTypes.default.bool
88
+ withFooter: PropTypes.bool
96
89
  };
97
- var _default = CardContent;
98
- exports.default = _default;
90
+ export default CardContent;
@@ -1,18 +1,11 @@
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 _utils = require("../utils");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
15
- const CardFooterContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { getTokensPropType, paddingProp, selectSystemProps, useThemeTokens, useViewport, variantProp } from '@telus-uds/components-base';
4
+ import styled from 'styled-components';
5
+ import { htmlAttrs } from '../utils';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
8
+ const CardFooterContainer = /*#__PURE__*/styled.div.withConfig({
16
9
  displayName: "CardFooter__CardFooterContainer",
17
10
  componentId: "components-web__sc-pm6vns-0"
18
11
  })(_ref => {
@@ -49,14 +42,14 @@ const CardFooter = _ref2 => {
49
42
  variant,
50
43
  ...rest
51
44
  } = _ref2;
52
- const viewport = (0, _componentsBase.useViewport)();
53
- const themeTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, {
45
+ const viewport = useViewport();
46
+ const themeTokens = useThemeTokens('Card', tokens, {
54
47
  ...variant,
55
48
  background: 'alternative'
56
49
  }, {
57
50
  viewport
58
51
  });
59
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardFooterContainer, {
52
+ return /*#__PURE__*/_jsx(CardFooterContainer, {
60
53
  ...themeTokens,
61
54
  ...padding,
62
55
  ...selectProps(rest),
@@ -68,19 +61,18 @@ CardFooter.propTypes = {
68
61
  /**
69
62
  * Card footer content.
70
63
  */
71
- children: _propTypes.default.node,
64
+ children: PropTypes.node,
72
65
  /**
73
66
  * Card footer padding.
74
67
  */
75
- padding: _componentsBase.paddingProp.propType,
68
+ padding: paddingProp.propType,
76
69
  /**
77
70
  * Card tokens.
78
71
  */
79
- tokens: (0, _componentsBase.getTokensPropType)('Card'),
72
+ tokens: getTokensPropType('Card'),
80
73
  /**
81
74
  * Card variant.
82
75
  */
83
- variant: _componentsBase.variantProp.propType
76
+ variant: variantProp.propType
84
77
  };
85
- var _default = CardFooter;
86
- exports.default = _default;
78
+ export default CardFooter;
package/lib/Card/index.js CHANGED
@@ -1,10 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _Card = _interopRequireDefault(require("./Card"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var _default = _Card.default;
10
- exports.default = _default;
1
+ import Card from './Card';
2
+ export default Card;