@telus-uds/components-web 2.21.1 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/CHANGELOG.md +22 -2
  2. package/lib/Badge/Badge.js +2 -14
  3. package/lib/Badge/index.js +0 -3
  4. package/lib/BlockQuote/BlockQuote.js +4 -25
  5. package/lib/BlockQuote/index.js +0 -3
  6. package/lib/Breadcrumbs/Breadcrumbs.js +9 -36
  7. package/lib/Breadcrumbs/Item/Item.js +15 -25
  8. package/lib/Breadcrumbs/index.js +0 -2
  9. package/lib/Callout/Callout.js +2 -24
  10. package/lib/Callout/index.js +0 -3
  11. package/lib/Card/Card.js +15 -29
  12. package/lib/Card/CardContent.js +5 -18
  13. package/lib/Card/CardFooter.js +7 -19
  14. package/lib/Card/index.js +0 -3
  15. package/lib/Countdown/Countdown.js +5 -24
  16. package/lib/Countdown/Segment.js +3 -15
  17. package/lib/Countdown/index.js +0 -3
  18. package/lib/Countdown/types.js +2 -7
  19. package/lib/Countdown/useCountdown.js +0 -7
  20. package/lib/DatePicker/CalendarContainer.js +0 -5
  21. package/lib/DatePicker/DatePicker.js +9 -61
  22. package/lib/DatePicker/dictionary.js +0 -8
  23. package/lib/DatePicker/index.js +0 -3
  24. package/lib/DatePicker/reactDatesCss.js +0 -2
  25. package/lib/Disclaimer/Disclaimer.js +5 -14
  26. package/lib/Disclaimer/index.js +0 -2
  27. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +6 -17
  28. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +12 -25
  29. package/lib/ExpandCollapseMini/index.js +0 -3
  30. package/lib/Footnote/Footnote.js +17 -63
  31. package/lib/Footnote/FootnoteLink.js +3 -24
  32. package/lib/Footnote/index.js +0 -4
  33. package/lib/IconButton/IconButton.js +4 -14
  34. package/lib/IconButton/index.js +0 -3
  35. package/lib/Image/Image.js +5 -24
  36. package/lib/Image/index.js +0 -3
  37. package/lib/List/List.js +0 -2
  38. package/lib/List/ListItem.js +0 -8
  39. package/lib/List/index.js +0 -4
  40. package/lib/NavigationBar/NavigationBar.js +10 -35
  41. package/lib/NavigationBar/NavigationItem.js +5 -17
  42. package/lib/NavigationBar/NavigationSubMenu.js +3 -19
  43. package/lib/NavigationBar/collapseItems.js +6 -9
  44. package/lib/NavigationBar/index.js +0 -3
  45. package/lib/NavigationBar/resolveItemSelection.js +2 -3
  46. package/lib/OptimizeImage/OptimizeImage.js +6 -27
  47. package/lib/OptimizeImage/index.js +0 -3
  48. package/lib/OptimizeImage/utils/getFallbackUrl.js +0 -4
  49. package/lib/OptimizeImage/utils/getOptimizedUrl.js +0 -8
  50. package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -5
  51. package/lib/OptimizeImage/utils/index.js +0 -4
  52. package/lib/OptimizeImage/utils/isSvgUrl.js +0 -1
  53. package/lib/OrderedList/Item.js +4 -21
  54. package/lib/OrderedList/ItemBase.js +2 -9
  55. package/lib/OrderedList/OrderedList.js +11 -22
  56. package/lib/OrderedList/OrderedListBase.js +3 -13
  57. package/lib/OrderedList/index.js +0 -4
  58. package/lib/Paragraph/Paragraph.js +3 -18
  59. package/lib/Paragraph/index.js +0 -3
  60. package/lib/PreviewCard/AuthorDate.js +1 -10
  61. package/lib/PreviewCard/PreviewCard.js +15 -35
  62. package/lib/PreviewCard/index.js +0 -3
  63. package/lib/PriceLockup/PriceLockup.js +78 -75
  64. package/lib/PriceLockup/index.js +0 -3
  65. package/lib/PriceLockup/tokens.js +0 -2
  66. package/lib/Progress/ProgressBar.js +5 -16
  67. package/lib/Progress/index.js +0 -4
  68. package/lib/QuantitySelector/QuantitySelector.js +8 -42
  69. package/lib/QuantitySelector/SideButton.js +4 -11
  70. package/lib/QuantitySelector/index.js +0 -3
  71. package/lib/QuantitySelector/styles.js +0 -6
  72. package/lib/ResponsiveImage/ResponsiveImage.js +5 -20
  73. package/lib/ResponsiveImage/index.js +0 -3
  74. package/lib/Ribbon/Ribbon.js +4 -20
  75. package/lib/Ribbon/index.js +0 -3
  76. package/lib/SkeletonProvider/SkeletonImage.js +0 -10
  77. package/lib/SkeletonProvider/SkeletonProvider.js +4 -22
  78. package/lib/SkeletonProvider/SkeletonTypography.js +0 -10
  79. package/lib/SkeletonProvider/index.js +0 -3
  80. package/lib/Span/Span.js +3 -17
  81. package/lib/Span/index.js +0 -3
  82. package/lib/Spinner/Spinner.js +11 -39
  83. package/lib/Spinner/SpinnerContent.js +2 -18
  84. package/lib/Spinner/index.js +0 -3
  85. package/lib/StoryCard/StoryCard.js +11 -31
  86. package/lib/StoryCard/index.js +0 -3
  87. package/lib/Table/Body.js +0 -6
  88. package/lib/Table/Cell.js +4 -24
  89. package/lib/Table/Header.js +0 -9
  90. package/lib/Table/Row.js +0 -8
  91. package/lib/Table/SubHeading.js +0 -9
  92. package/lib/Table/Table.js +5 -23
  93. package/lib/Table/index.js +0 -8
  94. package/lib/TermsAndConditions/ExpandCollapse.js +4 -14
  95. package/lib/TermsAndConditions/TermsAndConditions.js +7 -29
  96. package/lib/TermsAndConditions/index.js +0 -2
  97. package/lib/Testimonial/Testimonial.js +2 -26
  98. package/lib/Testimonial/index.js +0 -3
  99. package/lib/Toast/Toast.js +4 -25
  100. package/lib/Toast/index.js +0 -3
  101. package/lib/Video/ControlBar/ControlBar.js +2 -25
  102. package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -17
  103. package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -20
  104. package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -26
  105. package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -23
  106. package/lib/Video/MiddleControlButton/MiddleControlButton.js +2 -12
  107. package/lib/Video/Video.js +122 -194
  108. package/lib/Video/index.js +0 -3
  109. package/lib/VideoPicker/VideoPicker.js +6 -32
  110. package/lib/VideoPicker/VideoPickerPlayer.js +2 -10
  111. package/lib/VideoPicker/VideoPickerThumbnail.js +7 -28
  112. package/lib/VideoPicker/VideoSlider.js +7 -17
  113. package/lib/VideoPicker/index.js +0 -3
  114. package/lib/VideoPicker/videoPropType.js +2 -8
  115. package/lib/WaffleGrid/WaffleGrid.js +11 -28
  116. package/lib/WaffleGrid/index.js +0 -3
  117. package/lib/WebPortal/WebPortal.js +1 -5
  118. package/lib/WebPortal/index.js +0 -3
  119. package/lib/WebVideo/WebVideo.js +4 -30
  120. package/lib/WebVideo/index.js +0 -3
  121. package/lib/baseExports.js +6 -1
  122. package/lib/index.js +0 -49
  123. package/lib/shared/FullBleedContent/FullBleedContent.js +5 -17
  124. package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -11
  125. package/lib/shared/FullBleedContent/index.js +0 -5
  126. package/lib/shared/FullBleedContent/useFullBleedContentProps.js +1 -12
  127. package/lib/shared/VideoSplash/SplashButton/SplashButton.js +2 -12
  128. package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -23
  129. package/lib/shared/VideoSplash/VideoSplash.js +4 -17
  130. package/lib/shared/VideoSplash/helpers.js +0 -6
  131. package/lib/utils/index.js +0 -9
  132. package/lib/utils/logger.js +0 -6
  133. package/lib/utils/media.js +2 -11
  134. package/lib/utils/renderStructuredContent.js +14 -31
  135. package/lib/utils/ssr.js +0 -6
  136. package/lib/utils/transforms.js +0 -2
  137. package/lib/utils/useOverlaidPosition.js +6 -28
  138. package/lib/utils/useTypographyTheme.js +4 -5
  139. package/lib-module/Badge/Badge.js +2 -5
  140. package/lib-module/BlockQuote/BlockQuote.js +4 -15
  141. package/lib-module/Breadcrumbs/Breadcrumbs.js +9 -25
  142. package/lib-module/Breadcrumbs/Item/Item.js +15 -12
  143. package/lib-module/Callout/Callout.js +2 -16
  144. package/lib-module/Card/Card.js +14 -17
  145. package/lib-module/Card/CardContent.js +5 -8
  146. package/lib-module/Card/CardFooter.js +7 -9
  147. package/lib-module/Countdown/Countdown.js +6 -11
  148. package/lib-module/Countdown/Segment.js +6 -8
  149. package/lib-module/Countdown/types.js +2 -1
  150. package/lib-module/Countdown/useCountdown.js +0 -6
  151. package/lib-module/DatePicker/CalendarContainer.js +3 -1
  152. package/lib-module/DatePicker/DatePicker.js +9 -39
  153. package/lib-module/DatePicker/dictionary.js +0 -8
  154. package/lib-module/Disclaimer/Disclaimer.js +5 -4
  155. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +6 -8
  156. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +13 -19
  157. package/lib-module/Footnote/Footnote.js +17 -41
  158. package/lib-module/Footnote/FootnoteLink.js +3 -12
  159. package/lib-module/IconButton/IconButton.js +4 -6
  160. package/lib-module/Image/Image.js +5 -14
  161. package/lib-module/NavigationBar/NavigationBar.js +10 -20
  162. package/lib-module/NavigationBar/NavigationItem.js +5 -5
  163. package/lib-module/NavigationBar/NavigationSubMenu.js +3 -8
  164. package/lib-module/NavigationBar/collapseItems.js +6 -8
  165. package/lib-module/NavigationBar/resolveItemSelection.js +2 -2
  166. package/lib-module/OptimizeImage/OptimizeImage.js +6 -16
  167. package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -1
  168. package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -5
  169. package/lib-module/OptimizeImage/utils/hasWebpSupport.js +1 -5
  170. package/lib-module/OrderedList/Item.js +4 -7
  171. package/lib-module/OrderedList/ItemBase.js +2 -3
  172. package/lib-module/OrderedList/OrderedList.js +11 -9
  173. package/lib-module/OrderedList/OrderedListBase.js +3 -3
  174. package/lib-module/Paragraph/Paragraph.js +3 -8
  175. package/lib-module/PreviewCard/AuthorDate.js +1 -4
  176. package/lib-module/PreviewCard/PreviewCard.js +16 -19
  177. package/lib-module/PriceLockup/PriceLockup.js +78 -57
  178. package/lib-module/Progress/ProgressBar.js +7 -8
  179. package/lib-module/QuantitySelector/QuantitySelector.js +8 -30
  180. package/lib-module/QuantitySelector/SideButton.js +4 -6
  181. package/lib-module/ResponsiveImage/ResponsiveImage.js +5 -12
  182. package/lib-module/Ribbon/Ribbon.js +4 -9
  183. package/lib-module/SkeletonProvider/SkeletonImage.js +0 -5
  184. package/lib-module/SkeletonProvider/SkeletonProvider.js +4 -12
  185. package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -5
  186. package/lib-module/Span/Span.js +3 -7
  187. package/lib-module/Spinner/Spinner.js +11 -24
  188. package/lib-module/Spinner/SpinnerContent.js +2 -8
  189. package/lib-module/StoryCard/StoryCard.js +12 -17
  190. package/lib-module/Table/Body.js +0 -2
  191. package/lib-module/Table/Cell.js +4 -14
  192. package/lib-module/Table/Header.js +0 -2
  193. package/lib-module/Table/Row.js +0 -2
  194. package/lib-module/Table/SubHeading.js +0 -2
  195. package/lib-module/Table/Table.js +5 -6
  196. package/lib-module/TermsAndConditions/ExpandCollapse.js +4 -2
  197. package/lib-module/TermsAndConditions/TermsAndConditions.js +7 -9
  198. package/lib-module/Testimonial/Testimonial.js +2 -11
  199. package/lib-module/Toast/Toast.js +4 -15
  200. package/lib-module/Video/ControlBar/ControlBar.js +2 -9
  201. package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -8
  202. package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -8
  203. package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -13
  204. package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -10
  205. package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +2 -3
  206. package/lib-module/Video/Video.js +122 -173
  207. package/lib-module/VideoPicker/VideoPicker.js +6 -15
  208. package/lib-module/VideoPicker/VideoPickerPlayer.js +2 -3
  209. package/lib-module/VideoPicker/VideoPickerThumbnail.js +7 -13
  210. package/lib-module/VideoPicker/VideoSlider.js +6 -9
  211. package/lib-module/VideoPicker/videoPropType.js +2 -1
  212. package/lib-module/WaffleGrid/WaffleGrid.js +11 -15
  213. package/lib-module/WebPortal/WebPortal.js +1 -1
  214. package/lib-module/WebVideo/WebVideo.js +4 -15
  215. package/lib-module/baseExports.js +3 -2
  216. package/lib-module/index.js +0 -1
  217. package/lib-module/shared/FullBleedContent/FullBleedContent.js +5 -10
  218. package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -10
  219. package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +1 -11
  220. package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +2 -3
  221. package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -12
  222. package/lib-module/shared/VideoSplash/VideoSplash.js +4 -4
  223. package/lib-module/utils/logger.js +2 -2
  224. package/lib-module/utils/media.js +2 -9
  225. package/lib-module/utils/renderStructuredContent.js +14 -25
  226. package/lib-module/utils/ssr.js +0 -4
  227. package/lib-module/utils/useOverlaidPosition.js +8 -27
  228. package/lib-module/utils/useTypographyTheme.js +4 -4
  229. package/package.json +3 -3
  230. package/src/PriceLockup/PriceLockup.jsx +36 -11
  231. package/src/baseExports.js +1 -0
  232. package/src/index.js +0 -1
  233. package/lib/Modal/Modal.js +0 -146
  234. package/lib/Modal/ModalContent.js +0 -203
  235. package/lib/Modal/index.js +0 -13
  236. package/lib-module/Modal/Modal.js +0 -132
  237. package/lib-module/Modal/ModalContent.js +0 -181
  238. package/lib-module/Modal/index.js +0 -2
  239. package/src/Modal/Modal.jsx +0 -121
  240. package/src/Modal/ModalContent.jsx +0 -167
  241. package/src/Modal/index.js +0 -3
@@ -63,37 +63,54 @@ const TopTextContainer = /*#__PURE__*/styled.div.withConfig({
63
63
  } = _ref6;
64
64
  return topTextMarginBottom;
65
65
  });
66
+ const PriceTextContainer = /*#__PURE__*/styled.div.withConfig({
67
+ displayName: "PriceLockup__PriceTextContainer",
68
+ componentId: "components-web__sc-1x6duay-6"
69
+ })(["display:flex;flex-direction:", ";"], _ref7 => {
70
+ let {
71
+ ratePosition
72
+ } = _ref7;
73
+ return ratePosition === 'bottom' ? 'column' : 'row';
74
+ });
75
+ const RateContainer = /*#__PURE__*/styled.div.withConfig({
76
+ displayName: "PriceLockup__RateContainer",
77
+ componentId: "components-web__sc-1x6duay-7"
78
+ })(["display:flex;"]);
66
79
  const RateTextContainer = /*#__PURE__*/styled.div.withConfig({
67
80
  displayName: "PriceLockup__RateTextContainer",
68
- componentId: "components-web__sc-1x6duay-6"
69
- })(["align-self:flex-end;"]);
81
+ componentId: "components-web__sc-1x6duay-8"
82
+ })(["align-self:", ";"], _ref8 => {
83
+ let {
84
+ ratePosition
85
+ } = _ref8;
86
+ return ratePosition === 'bottom' ? 'flex-start' : 'flex-end';
87
+ });
70
88
  const StrikeThroughContainer = /*#__PURE__*/styled.div.withConfig({
71
89
  displayName: "PriceLockup__StrikeThroughContainer",
72
- componentId: "components-web__sc-1x6duay-7"
73
- })(["display:flex;position:relative;align-items:center;::before{content:'';width:100%;top:", ";height:", ";background:", ";position:absolute;}"], _ref7 => {
90
+ componentId: "components-web__sc-1x6duay-9"
91
+ })(["display:flex;position:relative;align-items:center;::before{content:'';width:100%;top:", ";height:", ";background:", ";position:absolute;}"], _ref9 => {
74
92
  let {
75
93
  strikeThroughPosition
76
- } = _ref7;
94
+ } = _ref9;
77
95
  return `${strikeThroughPosition}px`;
78
- }, _ref8 => {
96
+ }, _ref10 => {
79
97
  let {
80
98
  strikeThroughHeight
81
- } = _ref8;
99
+ } = _ref10;
82
100
  return `${strikeThroughHeight}px`;
83
- }, _ref9 => {
101
+ }, _ref11 => {
84
102
  let {
85
103
  strikeThroughColor
86
- } = _ref9;
104
+ } = _ref11;
87
105
  return strikeThroughColor;
88
106
  });
89
-
90
- const selectFootnoteLinkStyles = _ref10 => {
107
+ const selectFootnoteLinkStyles = _ref12 => {
91
108
  let {
92
109
  footnoteLinkColor,
93
110
  footnoteLinkFontName,
94
111
  footnoteLinkFontWeight,
95
112
  footnoteLinkLineHeight
96
- } = _ref10;
113
+ } = _ref12;
97
114
  return {
98
115
  color: footnoteLinkColor,
99
116
  fontName: footnoteLinkFontName,
@@ -101,21 +118,19 @@ const selectFootnoteLinkStyles = _ref10 => {
101
118
  lineHeight: footnoteLinkLineHeight
102
119
  };
103
120
  };
104
-
105
- const selectStrikeThroughTokens = _ref11 => {
121
+ const selectStrikeThroughTokens = _ref13 => {
106
122
  let {
107
123
  strikeThroughPosition,
108
124
  strikeThroughHeight,
109
125
  strikeThroughColor
110
- } = _ref11;
126
+ } = _ref13;
111
127
  return {
112
128
  strikeThroughHeight,
113
129
  strikeThroughPosition,
114
130
  strikeThroughColor
115
131
  };
116
132
  };
117
-
118
- const PriceLockup = _ref12 => {
133
+ const PriceLockup = _ref14 => {
119
134
  let {
120
135
  size = 'medium',
121
136
  signDirection = 'left',
@@ -124,6 +139,7 @@ const PriceLockup = _ref12 => {
124
139
  price,
125
140
  currencySymbol = '$',
126
141
  rateText,
142
+ ratePosition = 'right',
127
143
  bottomText,
128
144
  onClickFootnote,
129
145
  strikeThrough,
@@ -131,7 +147,7 @@ const PriceLockup = _ref12 => {
131
147
  tokens: priceLockupTokens,
132
148
  variant = {},
133
149
  ...rest
134
- } = _ref12;
150
+ } = _ref14;
135
151
  const viewport = useViewport();
136
152
  const {
137
153
  footnoteMarginTop,
@@ -144,7 +160,8 @@ const PriceLockup = _ref12 => {
144
160
  dividerColor,
145
161
  footnoteLinkFontSize,
146
162
  ...themeTokens
147
- } = useThemeTokens('PriceLockup', priceLockupTokens, { ...variant,
163
+ } = useThemeTokens('PriceLockup', priceLockupTokens, {
164
+ ...variant,
148
165
  size
149
166
  }, {
150
167
  viewport,
@@ -154,59 +171,72 @@ const PriceLockup = _ref12 => {
154
171
  const priceString = String(price);
155
172
  const lastDotPosition = priceString.lastIndexOf('.');
156
173
  const lastCommaPosition = priceString.lastIndexOf(',');
157
- const [separator, separatorPosition] = lastDotPosition > lastCommaPosition ? ['.', lastDotPosition] : [',', lastCommaPosition]; // If the separator is at the fourth character from the end of the string or more, it's most probably
158
- // a part of the amount, and the cents are not included in the price string
174
+ const [separator, separatorPosition] = lastDotPosition > lastCommaPosition ? ['.', lastDotPosition] : [',', lastCommaPosition];
159
175
 
176
+ // If the separator is at the fourth character from the end of the string or more, it's most probably
177
+ // a part of the amount, and the cents are not included in the price string
160
178
  const hasCents = separatorPosition !== -1 && separatorPosition >= priceString.length - 3;
161
179
  const amount = hasCents ? priceString.substring(0, separatorPosition) : priceString;
162
180
  const cents = hasCents ? priceString.substring(separatorPosition + 1) : null;
163
-
164
- const renderTypography = (value, tokens) => /*#__PURE__*/_jsx(Typography, {
165
- tokens: { ...tokens,
166
- color: fontColor
167
- },
168
- children: value
169
- });
170
-
181
+ const renderTypography = (value, tokens, position) => {
182
+ const customProps = position === 'bottom' ? {
183
+ variant: {
184
+ size: 'micro'
185
+ },
186
+ tokens: {
187
+ color: fontColor
188
+ }
189
+ } : {
190
+ tokens: {
191
+ ...tokens,
192
+ color: fontColor
193
+ }
194
+ };
195
+ return /*#__PURE__*/_jsx(Typography, {
196
+ ...customProps,
197
+ children: value
198
+ });
199
+ };
171
200
  const renderCurrencySymbol = () => renderTypography(`${currencySymbol}`, typographyTokens.dollarSign);
172
-
173
201
  const renderFootnoteLinks = () => footnoteLinks && footnoteLinks.length > 0 ? /*#__PURE__*/_jsx(FootnoteLink, {
174
202
  fontSize: footnoteLinkFontSize,
175
203
  tokens: selectFootnoteLinkStyles(themeTokens),
176
204
  number: footnoteLinks,
177
205
  onClick: onClickFootnote
178
206
  }) : null;
179
-
180
207
  const renderAmount = () => {
181
208
  const amountComponent = renderTypography(amount, typographyTokens.amount);
182
-
183
209
  if (strikeThrough) {
184
210
  return /*#__PURE__*/_jsxs(_Fragment, {
185
211
  children: [/*#__PURE__*/_jsx(A11yText, {
186
212
  text: a11yText
187
- }), /*#__PURE__*/_jsx(StrikeThroughContainer, { ...selectStrikeThroughTokens(themeTokens),
213
+ }), /*#__PURE__*/_jsx(StrikeThroughContainer, {
214
+ ...selectStrikeThroughTokens(themeTokens),
188
215
  children: amountComponent
189
216
  })]
190
217
  });
191
218
  }
192
-
193
219
  return amountComponent;
194
220
  };
195
-
196
221
  const renderPrice = () => /*#__PURE__*/_jsxs(_Fragment, {
197
222
  children: [/*#__PURE__*/_jsxs(PriceContainer, {
198
223
  priceMarginBottom: `${priceMarginBottom}px`,
199
- children: [signDirection === 'left' && renderCurrencySymbol(), renderAmount(), cents && renderTypography(`${separator}${cents}`, typographyTokens.cents), signDirection === 'right' && /*#__PURE__*/_jsxs(_Fragment, {
200
- children: ["\xA0", renderCurrencySymbol()]
201
- }), rateText && /*#__PURE__*/_jsx(RateTextContainer, {
202
- children: renderTypography(rateText, typographyTokens.rate)
224
+ children: [/*#__PURE__*/_jsxs(PriceTextContainer, {
225
+ ratePosition: ratePosition,
226
+ children: [/*#__PURE__*/_jsxs(RateContainer, {
227
+ children: [signDirection === 'left' && renderCurrencySymbol(), renderAmount(), cents && renderTypography(`${separator}${cents}`, typographyTokens.cents), signDirection === 'right' && /*#__PURE__*/_jsxs(_Fragment, {
228
+ children: ["\xA0", renderCurrencySymbol()]
229
+ })]
230
+ }), rateText && /*#__PURE__*/_jsx(RateTextContainer, {
231
+ ratePosition: ratePosition,
232
+ children: renderTypography(rateText, typographyTokens.rate, ratePosition)
233
+ })]
203
234
  }), !bottomText && footnoteLinks.length <= 3 && /*#__PURE__*/_jsx(BottomLinksContainer, {
204
235
  bottomLinksMarginLeft: `${bottomLinksMarginLeft}px`,
205
236
  children: renderFootnoteLinks()
206
237
  })]
207
238
  }), !bottomText && footnoteLinks.length > 3 && renderFootnoteLinks()]
208
239
  });
209
-
210
240
  const renderFootnoteContent = () => /*#__PURE__*/_jsxs(_Fragment, {
211
241
  children: [/*#__PURE__*/_jsxs(FootnoteContainer, {
212
242
  footnoteMarginTop: `${footnoteMarginTop}px`,
@@ -217,12 +247,11 @@ const PriceLockup = _ref12 => {
217
247
  }), footnoteLinks.length <= 3 && renderFootnoteLinks()]
218
248
  }), footnoteLinks.length > 3 && renderFootnoteLinks()]
219
249
  });
220
-
221
250
  if (strikeThrough && !a11yText) {
222
251
  warn('PriceLockup', 'a11yText must be provided with strikethrough pricing');
223
252
  }
224
-
225
- return /*#__PURE__*/_jsxs(PriceLockupContainer, { ...selectProps(rest),
253
+ return /*#__PURE__*/_jsxs(PriceLockupContainer, {
254
+ ...selectProps(rest),
226
255
  children: [topText && /*#__PURE__*/_jsx(TopTextContainer, {
227
256
  topTextMarginBottom: `${topTextMarginBottom}px`,
228
257
  children: renderTypography(topText, typographyTokens.topText)
@@ -235,68 +264,60 @@ const PriceLockup = _ref12 => {
235
264
  }), bottomText && renderFootnoteContent()]
236
265
  });
237
266
  };
238
-
239
- PriceLockup.propTypes = { ...selectedSystemPropTypes,
240
-
267
+ PriceLockup.propTypes = {
268
+ ...selectedSystemPropTypes,
241
269
  /**
242
270
  * Size of the component
243
271
  *
244
272
  * Small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
245
273
  */
246
274
  size: PropTypes.oneOf(['small', 'medium', 'large']),
247
-
248
275
  /**
249
276
  * If currency symbol other than `$` to be used
250
277
  */
251
278
  currencySymbol: PropTypes.string,
252
-
253
279
  /**
254
280
  * Shows additional info above the price
255
281
  */
256
282
  topText: PropTypes.string,
257
-
258
283
  /**
259
284
  * Monetary value (including decimals separated by ".")
260
285
  */
261
286
  price: PropTypes.string.isRequired,
262
-
263
287
  /**
264
288
  * Shows month/year unit
265
289
  */
266
290
  rateText: PropTypes.string,
267
-
268
291
  /**
269
292
  * Shows additional info below the price with a `Divider`
270
293
  */
271
294
  bottomText: PropTypes.string,
272
-
273
295
  /**
274
296
  * Displays which side the currency should apperar (left, right)
275
297
  */
276
298
  signDirection: PropTypes.oneOf(['right', 'left']),
277
-
299
+ /**
300
+ * Displays where the rate should apperar (bottom, right)
301
+ */
302
+ ratePosition: PropTypes.oneOf(['right', 'bottom']),
278
303
  /**
279
304
  * Shows additional link for context
280
305
  */
281
306
  footnoteLinks: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
282
-
283
307
  /**
284
308
  * Function to be called when a footnote link is clicked
285
309
  */
286
310
  onClickFootnote: PropTypes.func,
287
-
288
311
  /**
289
312
  * To show price savings comparison
290
313
  */
291
314
  strikeThrough: PropTypes.bool,
292
-
293
315
  /**
294
316
  * To provide a11y text for `PriceLockup` component
295
317
  *
296
318
  * **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
297
319
  */
298
320
  a11yText: PropTypes.string,
299
-
300
321
  /**
301
322
  * `PriceLockup` tokens
302
323
  */
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { getTokensPropType, Progress, selectSystemProps, useThemeTokens, a11yProps, viewProps, variantProp } from '@telus-uds/components-base';
4
- import styled from 'styled-components'; // Passes React Native-oriented system props through UDS Progress
4
+ import styled from 'styled-components';
5
5
 
6
+ // Passes React Native-oriented system props through UDS Progress
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
8
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
8
9
  const {
@@ -31,6 +32,7 @@ const Gradient = /*#__PURE__*/styled.div.attrs({
31
32
  background: `${type}-gradient(${angle}deg, ${stops[0].color}, ${stops[1].color})`
32
33
  };
33
34
  });
35
+
34
36
  /**
35
37
  * The `ProgressBar` is a visual representation of linear progression.
36
38
  * It provides simple but important information at a quick glance.
@@ -42,7 +44,6 @@ const Gradient = /*#__PURE__*/styled.div.attrs({
42
44
  * `gradient` is being used here to provide gradient filling.
43
45
  *
44
46
  */
45
-
46
47
  const ProgressBar = _ref2 => {
47
48
  let {
48
49
  percentage,
@@ -57,24 +58,22 @@ const ProgressBar = _ref2 => {
57
58
  tokens: tokens,
58
59
  variant: variant,
59
60
  ...selectedProps,
60
- children: themeTokens.gradient && /*#__PURE__*/_jsx(Gradient, { ...themeTokens,
61
+ children: themeTokens.gradient && /*#__PURE__*/_jsx(Gradient, {
62
+ ...themeTokens,
61
63
  percentage: percentage
62
64
  })
63
65
  });
64
66
  };
65
-
66
- ProgressBar.propTypes = { ...selectedSystemPropTypes,
67
-
67
+ ProgressBar.propTypes = {
68
+ ...selectedSystemPropTypes,
68
69
  /**
69
70
  * Percentage of completion.
70
71
  */
71
72
  percentage: PropTypes.number,
72
-
73
73
  /**
74
74
  * ProgressBar tokens.
75
75
  */
76
76
  tokens: getTokensPropType('ProgressBar'),
77
-
78
77
  /**
79
78
  * ProgressBar variant.
80
79
  */
@@ -9,11 +9,9 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  const {
10
10
  isNaN
11
11
  } = Number;
12
-
13
12
  const isNumber = value => {
14
13
  return typeof value === 'number' && !isNaN(value);
15
14
  };
16
-
17
15
  const QuantitySelector = _ref => {
18
16
  let {
19
17
  id,
@@ -41,14 +39,12 @@ const QuantitySelector = _ref => {
41
39
  dictionary,
42
40
  copy
43
41
  });
44
-
45
42
  const getValidatedNumber = numberToEvaluate => {
46
43
  if (isNaN(numberToEvaluate)) return null;
47
44
  if (isNumber(minNumber) && numberToEvaluate < minNumber) throw getCopy('errors').numberIsTooSmall(minNumber);
48
45
  if (isNumber(maxNumber) && numberToEvaluate > maxNumber) throw getCopy('errors').numberIsTooBig(maxNumber);
49
46
  return numberToEvaluate;
50
47
  };
51
-
52
48
  const {
53
49
  currentValue: number,
54
50
  setValue: setNumber
@@ -60,7 +56,6 @@ const QuantitySelector = _ref => {
60
56
  const isDecreaseEnabled = !disabled && !isNumber(minNumber) || number > minNumber;
61
57
  const isIncreaseEnabled = !disabled && !isNumber(maxNumber) || number < maxNumber;
62
58
  const inputValue = isNumber(number) ? number.toString() : '';
63
-
64
59
  const updateNumber = (newNumber, originalInputEvent) => {
65
60
  try {
66
61
  const validatedNumber = getValidatedNumber(newNumber);
@@ -70,18 +65,15 @@ const QuantitySelector = _ref => {
70
65
  setError(e);
71
66
  }
72
67
  };
73
-
74
68
  const inputChangeHandler = (textInputValue, event) => {
75
69
  if (textInputValue === '') setNumber(null);
76
70
  const numberFromTextInput = Number(textInputValue);
77
-
78
71
  if (isNumber(numberFromTextInput)) {
79
72
  updateNumber(numberFromTextInput, event);
80
73
  } else {
81
74
  setError(getCopy('errors').invalidCharacters);
82
75
  }
83
76
  };
84
-
85
77
  const renderLabel = () => label ? /*#__PURE__*/_jsx(InputLabel, {
86
78
  forId: id,
87
79
  label: label,
@@ -89,9 +81,7 @@ const QuantitySelector = _ref => {
89
81
  hintPosition: hintPosition,
90
82
  tooltip: tooltip
91
83
  }) : null;
92
-
93
84
  const getTokens = useThemeTokensCallback('QuantitySelector', tokens, variant);
94
-
95
85
  const renderTextInput = () => /*#__PURE__*/_jsx(TextInput, {
96
86
  nativeID: id,
97
87
  value: inputValue,
@@ -104,9 +94,11 @@ const QuantitySelector = _ref => {
104
94
  textColor,
105
95
  inputBackgroundColor,
106
96
  ...rest
107
- } = getTokens({ ...textInputState
97
+ } = getTokens({
98
+ ...textInputState
108
99
  });
109
- return { ...rest,
100
+ return {
101
+ ...rest,
110
102
  order: 1,
111
103
  borderWidth: inputBorderWidth,
112
104
  backgroundColor: inputBackgroundColor,
@@ -117,7 +109,8 @@ const QuantitySelector = _ref => {
117
109
  outerBorderWidth: 0
118
110
  };
119
111
  },
120
- onChange: inputChangeHandler // Using title as an accessibility workaround
112
+ onChange: inputChangeHandler
113
+ // Using title as an accessibility workaround
121
114
  // given that accessibilityLabel is not available
122
115
  ,
123
116
  keyboardType: "numeric",
@@ -127,11 +120,9 @@ const QuantitySelector = _ref => {
127
120
  accessibilityValueMin: minNumber,
128
121
  accessibilityValueNow: number
129
122
  });
130
-
131
123
  const flexOrder = order => ({
132
124
  order
133
125
  });
134
-
135
126
  return /*#__PURE__*/_jsxs(Box, {
136
127
  space: 2,
137
128
  testID: testID,
@@ -177,9 +168,9 @@ const QuantitySelector = _ref => {
177
168
  })
178
169
  }) : null]
179
170
  });
180
- }; // If a language dictionary entry is provided, it must contain every key
181
-
171
+ };
182
172
 
173
+ // If a language dictionary entry is provided, it must contain every key
183
174
  const dictionaryContentShape = PropTypes.shape({
184
175
  accessibility: PropTypes.shape({
185
176
  a11yLabel: PropTypes.string.isRequired,
@@ -197,58 +188,47 @@ QuantitySelector.propTypes = {
197
188
  * The id of the input field
198
189
  */
199
190
  id: PropTypes.string,
200
-
201
191
  /**
202
192
  * The minimum number allowed
203
193
  */
204
194
  minNumber: PropTypes.number,
205
-
206
195
  /**
207
196
  * The maximum number allowed
208
197
  */
209
198
  maxNumber: PropTypes.number,
210
-
211
199
  /**
212
200
  * The callback function that is called when the value of the input field changes
213
201
  */
214
202
  onChange: PropTypes.func,
215
-
216
203
  /**
217
204
  * The default value of the input field
218
205
  */
219
206
  defaultValue: PropTypes.number,
220
-
221
207
  /**
222
208
  * If the input's state is to be controlled by a parent component, use this prop
223
209
  * together with the `onChange` to pass down and update the lifted state.
224
210
  */
225
211
  value: PropTypes.number,
226
-
227
212
  /**
228
213
  * The label of the input field
229
214
  */
230
215
  label: PropTypes.string,
231
-
232
216
  /**
233
217
  * The hint of the input field
234
218
  */
235
219
  hint: PropTypes.string,
236
-
237
220
  /**
238
221
  * The position of the hint. Could be shown along side the label or below it
239
222
  */
240
223
  hintPosition: PropTypes.oneOf(['inline', 'below']),
241
-
242
224
  /**
243
225
  * Adds a question mark which will display a tooltip when clicked
244
226
  */
245
227
  tooltip: PropTypes.string,
246
-
247
228
  /**
248
229
  * The accessibility label of the input field
249
230
  */
250
231
  accessibilityLabel: PropTypes.string,
251
-
252
232
  /**
253
233
  * The dictionary object containing the content for the input field
254
234
  */
@@ -256,7 +236,6 @@ QuantitySelector.propTypes = {
256
236
  en: dictionaryContentShape,
257
237
  fr: dictionaryContentShape
258
238
  }),
259
-
260
239
  /**
261
240
  * The language to use for the copy.
262
241
  */
@@ -266,7 +245,6 @@ QuantitySelector.propTypes = {
266
245
  disabled: PropTypes.bool
267
246
  }),
268
247
  tokens: PropTypes.oneOf([PropTypes.object, PropTypes.func]),
269
-
270
248
  /**
271
249
  * Sets `data-testid` attribute on the input field for testing purposes.
272
250
  */
@@ -2,7 +2,6 @@ import { IconButton, useThemeTokensCallback } from '@telus-uds/components-base';
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
-
6
5
  const SideButton = _ref => {
7
6
  let {
8
7
  isEnabled,
@@ -14,7 +13,6 @@ const SideButton = _ref => {
14
13
  variant
15
14
  } = _ref;
16
15
  const getTokens = useThemeTokensCallback('QuantitySelectorSideButton', tokens, variant);
17
-
18
16
  const getButtonTokens = _ref2 => {
19
17
  let {
20
18
  buttonState,
@@ -27,10 +25,12 @@ const SideButton = _ref => {
27
25
  borderBottomLeftRadius,
28
26
  borderBottomRightRadius,
29
27
  ...rest
30
- } = getTokens({ ...buttonState,
28
+ } = getTokens({
29
+ ...buttonState,
31
30
  disabled
32
31
  });
33
- return { ...rest,
32
+ return {
33
+ ...rest,
34
34
  borderRadius,
35
35
  borderTopLeftRadius,
36
36
  borderTopRightRadius,
@@ -45,7 +45,6 @@ const SideButton = _ref => {
45
45
  outerBorderWidth: 0
46
46
  };
47
47
  };
48
-
49
48
  return /*#__PURE__*/_jsx(IconButton, {
50
49
  tokens: buttonState => getButtonTokens({
51
50
  disabled: !isEnabled,
@@ -57,7 +56,6 @@ const SideButton = _ref => {
57
56
  accessibilityDisabled: accessibilityDisabled
58
57
  });
59
58
  };
60
-
61
59
  SideButton.displayName = 'QuantitySelectorSideButton';
62
60
  SideButton.defaultProps = {
63
61
  isEnabled: true,
@@ -12,10 +12,10 @@ const staticStyles = {
12
12
  width: '100%'
13
13
  }
14
14
  };
15
+
15
16
  /**
16
17
  * Provide different image sources for different screen sizes.
17
18
  */
18
-
19
19
  const ResponsiveImage = _ref => {
20
20
  let {
21
21
  xsSrc,
@@ -28,7 +28,8 @@ const ResponsiveImage = _ref => {
28
28
  loading = 'eager',
29
29
  ...rest
30
30
  } = _ref;
31
- return /*#__PURE__*/_jsxs("picture", { ...selectProps(rest),
31
+ return /*#__PURE__*/_jsxs("picture", {
32
+ ...selectProps(rest),
32
33
  children: [/*#__PURE__*/_jsx("source", {
33
34
  srcSet: xlSrc,
34
35
  media: `(min-width: ${viewports.map.get(viewports.xl)}px)`
@@ -52,44 +53,36 @@ const ResponsiveImage = _ref => {
52
53
  })]
53
54
  });
54
55
  };
55
-
56
- ResponsiveImage.propTypes = { ...selectedSystemPropTypes,
57
-
56
+ ResponsiveImage.propTypes = {
57
+ ...selectedSystemPropTypes,
58
58
  /**
59
59
  * The src attribute used for screen widths up to 575px
60
60
  */
61
61
  xsSrc: PropTypes.string.isRequired,
62
-
63
62
  /**
64
63
  * The src attribute used for screen widths greater than 576px
65
64
  */
66
65
  smSrc: PropTypes.string.isRequired,
67
-
68
66
  /**
69
67
  * The src attribute used for screen widths greater than 768px
70
68
  */
71
69
  mdSrc: PropTypes.string,
72
-
73
70
  /**
74
71
  * The src attribute used for screen widths greater than 992px
75
72
  */
76
73
  lgSrc: PropTypes.string,
77
-
78
74
  /**
79
75
  * The src attribute used for screen widths greater than 1200px
80
76
  */
81
77
  xlSrc: PropTypes.string,
82
-
83
78
  /**
84
79
  * The src attribute used for browsers that don't support responsive images (InternetExplorer)
85
80
  */
86
81
  fallbackSrc: PropTypes.string.isRequired,
87
-
88
82
  /**
89
83
  * The alt attribute for the HTML img element. Setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content, and that non-visual browsers may omit it from rendering.
90
84
  */
91
85
  alt: PropTypes.string.isRequired,
92
-
93
86
  /**
94
87
  * Loading strategy.
95
88
  * @default 'eager'