@telus-uds/components-web 3.2.1 → 3.4.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 (44) hide show
  1. package/CHANGELOG.md +35 -2
  2. package/lib/Badge/Badge.js +2 -0
  3. package/lib/Card/Card.js +5 -5
  4. package/lib/DatePicker/DatePicker.js +20 -18
  5. package/lib/Footnote/Footnote.js +4 -7
  6. package/lib/NavigationBar/NavigationBar.js +13 -15
  7. package/lib/NavigationBar/NavigationSubMenu.js +1 -2
  8. package/lib/NavigationBar/collapseItems.js +2 -3
  9. package/lib/NavigationBar/resolveItemSelection.js +1 -1
  10. package/lib/OrderedList/OrderedList.js +2 -3
  11. package/lib/PriceLockup/PriceLockup.js +26 -10
  12. package/lib/PriceLockup/tokens.js +6 -2
  13. package/lib/SkeletonProvider/SkeletonImage.js +3 -4
  14. package/lib/SkeletonProvider/SkeletonTypography.js +5 -6
  15. package/lib/Table/Table.js +2 -3
  16. package/lib/TermsAndConditions/ExpandCollapse.js +2 -1
  17. package/lib/Toast/Toast.js +2 -3
  18. package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +1 -2
  19. package/lib/Video/Video.js +2 -2
  20. package/lib/VideoPicker/VideoPicker.js +1 -2
  21. package/lib/VideoPicker/VideoPickerThumbnail.js +1 -2
  22. package/lib/baseExports.js +1 -1
  23. package/lib/index.js +0 -1
  24. package/lib/utils/scrollToAnchor.js +2 -2
  25. package/lib/utils/ssr.js +7 -0
  26. package/lib/utils/useOverlaidPosition.js +2 -4
  27. package/package.json +3 -3
  28. package/src/Badge/Badge.jsx +2 -0
  29. package/src/DatePicker/DatePicker.jsx +19 -11
  30. package/src/PriceLockup/PriceLockup.jsx +12 -2
  31. package/src/PriceLockup/tokens.js +15 -3
  32. package/src/TermsAndConditions/ExpandCollapse.jsx +5 -1
  33. package/src/baseExports.js +1 -0
  34. package/src/index.js +0 -1
  35. package/src/utils/ssr.js +9 -1
  36. package/types/Callout.d.ts +2 -1
  37. package/types/Tooltip.d.ts +1 -0
  38. package/types/common.d.ts +1 -1
  39. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
  40. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -116
  41. package/lib/ExpandCollapseMini/index.js +0 -2
  42. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +0 -72
  43. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +0 -104
  44. package/src/ExpandCollapseMini/index.js +0 -3
package/CHANGELOG.md CHANGED
@@ -1,12 +1,45 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Thu, 19 Dec 2024 04:54:39 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 22 Jan 2025 21:06:14 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 3.4.0
8
+
9
+ Wed, 22 Jan 2025 21:06:14 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `Badge`: new size variant (sergio.ramirez@telus.com)
14
+ - `SSR`: add router property (guillermo.peitzner@telus.com)
15
+ - Bump @telus-uds/components-base to v2.5.0
16
+
17
+ ### Patches
18
+
19
+ - `TermsAndConditions`: throws nested button error as `Pressable` tends to render as a `button` rather than a `div` with `button` role (shahzaibkhalidmalik@outlook.com)
20
+ - `Tooltip`: Customized/optional props interface types update (shivam.gupta3@telus.com)
21
+ - `Callout`: include `tokens` to type definition. (jaime.tuyuc@telus.com)
22
+
23
+ ## 3.3.0
24
+
25
+ Fri, 10 Jan 2025 21:49:25 GMT
26
+
27
+ ### Minor changes
28
+
29
+ - "Search: iconLeftGap value added in the testTheme file for TextInput in Search" (35577399+JoshHC@users.noreply.github.com)
30
+ - `Docs`: fixed camelcase and hardcoded path for components (kristina.kirpichnikova@telus.com)
31
+ - `DatePicker`: update component to enable custom date formats (eduardo.pereira1@telus.com)
32
+ - `PriceLockup`: new tokens `centsPaddingTop` and `currencySymbolPaddingTop` added to the component to match with Koodo design in the micro variant (35577399+JoshHC@users.noreply.github.com)
33
+ - Bump @telus-uds/components-base to v2.4.0
34
+ - Bump @telus-uds/system-theme-tokens to v3.3.0
35
+
36
+ ### Patches
37
+
38
+ - "`DatePicker`: calendar position issue rendered incorrectly fixed" (35577399+JoshHC@users.noreply.github.com)
39
+
7
40
  ## 3.2.1
8
41
 
9
- Thu, 19 Dec 2024 04:54:39 GMT
42
+ Thu, 19 Dec 2024 05:02:20 GMT
10
43
 
11
44
  ### Patches
12
45
 
@@ -22,6 +22,8 @@ const BadgeContainer = styled.div`
22
22
  }};
23
23
  display: inline-flex;
24
24
  justify-content: center;
25
+ align-items: center;
26
+ height: fit-content;
25
27
  padding: ${_ref3 => {
26
28
  let {
27
29
  padding
package/lib/Card/Card.js CHANGED
@@ -92,9 +92,9 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
92
92
  const {
93
93
  borderRadius
94
94
  } = useThemeTokens('Card', tokens, variant);
95
- const getThemeTokens = useThemeTokensCallback('Card', interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.tokens, {
95
+ const getThemeTokens = useThemeTokensCallback('Card', interactiveCard?.tokens, {
96
96
  interactive: true,
97
- ...((interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.variant) || {})
97
+ ...(interactiveCard?.variant || {})
98
98
  });
99
99
  const hasFooter = Boolean(footer);
100
100
  const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius, fullBleedContentPosition, hasFooter);
@@ -118,7 +118,7 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
118
118
  display: imgColCurrentViewport === 0 ? 'none' : undefined
119
119
  };
120
120
  const columnFlex = {
121
- flexGrow: interactiveCard !== null && interactiveCard !== void 0 && interactiveCard.body ? 0 : 1,
121
+ flexGrow: interactiveCard?.body ? 0 : 1,
122
122
  flexShrink: 1,
123
123
  justifyContent: 'space-between'
124
124
  };
@@ -140,13 +140,13 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
140
140
  tokens: restOfTokens,
141
141
  backgroundImage: backgroundImage,
142
142
  ...selectProps(rest),
143
- children: [interactiveCard !== null && interactiveCard !== void 0 && interactiveCard.body ? /*#__PURE__*/_jsx(PressableCardBase, {
143
+ children: [interactiveCard?.body ? /*#__PURE__*/_jsx(PressableCardBase, {
144
144
  ref: ref,
145
145
  tokens: getThemeTokens,
146
146
  dataSet: dataSet,
147
147
  onPress: onPress,
148
148
  ...selectProps(rest),
149
- children: typeof (interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body) === 'function' ? interactiveCard.body() : interactiveCard.body
149
+ children: typeof interactiveCard?.body === 'function' ? interactiveCard.body() : interactiveCard.body
150
150
  }) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/_jsxs(StackView, {
151
151
  direction: contentStackDirection,
152
152
  tokens: {
@@ -14,8 +14,6 @@ const {
14
14
  styled
15
15
  } = styledComponents;
16
16
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
17
- const dateFormat = 'DD / MM / YYYY';
18
- const dateFormatWithoutSpaces = 'DD/MM/YYYY';
19
17
  const getResponsiveDaySize = function () {
20
18
  let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
21
19
  let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
@@ -55,7 +53,6 @@ const PortalPositionedContainer = styled.div({
55
53
  return `${top}px`;
56
54
  }
57
55
  });
58
- const validDatePattern = /^([0-2][0-9]|3[0-1])(\/)(0[1-9]|1[0-2])\2(\d{4})$/;
59
56
  const getInitialVisibleMonth = (initialVisibleMonth, inputDate) => {
60
57
  if (initialVisibleMonth === '' || inputDate instanceof moment) {
61
58
  return null;
@@ -85,11 +82,11 @@ const getInitialVisibleMonth = (initialVisibleMonth, inputDate) => {
85
82
  * - Recommended for viewports greater than or equal to 576px
86
83
  */
87
84
  const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
88
- var _dictionary$copy;
89
85
  let {
90
86
  copy = 'en',
91
87
  id,
92
88
  date,
89
+ dateFormat = 'DD / MM / YYYY',
93
90
  feedback,
94
91
  inline = false,
95
92
  isDayDisabled,
@@ -104,12 +101,13 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
104
101
  disabled = false,
105
102
  prevTestID = '',
106
103
  nextTestID = '',
107
- placeholder = 'DD / MM / YYYY',
104
+ placeholder = dateFormat,
108
105
  initialVisibleMonth = '',
109
106
  ...rest
110
107
  } = _ref3;
111
108
  const [inputDate, setInputDate] = React.useState(date instanceof moment ? date : undefined);
112
109
  const [inputText, setInputText] = React.useState(date instanceof moment ? date.format(dateFormat) : '');
110
+ const dateFormatWithoutSpaces = dateFormat.replace(/\s/g, '');
113
111
  const textInputRef = React.useRef();
114
112
  const prevButtonRef = React.useRef();
115
113
  const [datePickerPosition, setDatePickerPosition] = React.useState({
@@ -119,7 +117,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
119
117
  const datePickerRef = React.useRef(null);
120
118
  useSafeLayoutEffect(() => {
121
119
  const updateDatePickerPosition = () => {
122
- if (inline || !(textInputRef !== null && textInputRef !== void 0 && textInputRef.current)) return;
120
+ if (inline || !textInputRef?.current) return;
123
121
  const {
124
122
  left,
125
123
  top
@@ -136,7 +134,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
136
134
  });
137
135
 
138
136
  // Initial call to set the position
139
- updateDatePickerPosition();
137
+ throttledUpdate();
140
138
 
141
139
  // Register event listeners
142
140
  window.addEventListener('resize', throttledUpdate);
@@ -165,7 +163,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
165
163
  setInputDate(date);
166
164
  setInputText(date instanceof moment ? date.format(dateFormat) : '');
167
165
  }
168
- }, [date, inputDate]);
166
+ }, [date, inputDate, dateFormat]);
169
167
  React.useEffect(() => {
170
168
  let timeoutId;
171
169
  if (prevButtonRef.current && isFocused) {
@@ -175,8 +173,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
175
173
  }, [isFocused]);
176
174
  React.useEffect(() => {
177
175
  if (inputText !== '' && inputDate !== undefined) {
178
- var _textInputRef$current;
179
- textInputRef === null || textInputRef === void 0 || (_textInputRef$current = textInputRef.current) === null || _textInputRef$current === void 0 || _textInputRef$current.focus();
176
+ textInputRef?.current?.focus();
180
177
  }
181
178
  }, [inputDate, inputText]);
182
179
  const onFocusChange = _ref4 => {
@@ -217,10 +214,10 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
217
214
  if (value === '' || moment(value.replace(/\s/g, ''), dateFormatWithoutSpaces, true).isValid()) {
218
215
  if (value === '') {
219
216
  setInputDate(undefined); // Set inputDate to undefined if input is empty
220
- onDateChange === null || onDateChange === void 0 || onDateChange(undefined);
217
+ onDateChange?.(undefined);
221
218
  } else {
222
219
  setInputDate(moment(value, dateFormat));
223
- onDateChange === null || onDateChange === void 0 || onDateChange(moment(value, dateFormat));
220
+ onDateChange?.(moment(value, dateFormat));
224
221
  }
225
222
  setInputText(value === '' ? '' : moment(value, dateFormatWithoutSpaces).format(dateFormat));
226
223
  } else {
@@ -230,11 +227,13 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
230
227
  const handleOnKeyPress = event => {
231
228
  if (event.key === 'Backspace' && inputText === '') {
232
229
  setInputDate(undefined);
233
- onDateChange === null || onDateChange === void 0 || onDateChange(undefined);
230
+ onDateChange?.(undefined);
234
231
  }
235
232
  };
236
233
  const handleValidation = inputValidation => {
237
- if (validDatePattern.test(inputText.replace(/\s+/g, '')) === false && inputText !== '') {
234
+ const momentDate = moment(inputText, dateFormat, true);
235
+ const isValidDate = momentDate.isValid();
236
+ if (!isValidDate && inputText !== '') {
238
237
  return 'error';
239
238
  }
240
239
  if (inputValidation === 'error' || inputValidation === 'success') {
@@ -368,7 +367,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
368
367
  onKeyPress: handleOnKeyPress,
369
368
  tooltip: tooltip,
370
369
  hintPosition: hintPosition,
371
- label: label ?? ((_dictionary$copy = dictionary[copy]) === null || _dictionary$copy === void 0 ? void 0 : _dictionary$copy.roleDescription),
370
+ label: label ?? dictionary[copy]?.roleDescription,
372
371
  value: inputText,
373
372
  validation: handleValidation(validation),
374
373
  inactive: disabled,
@@ -443,8 +442,11 @@ DatePicker.propTypes = {
443
442
  */
444
443
  date: momentPropTypes.momentObj,
445
444
  /**
446
- * A detailed description of validation error/success or additional instructions.
447
- * Visual variant is determined based on the `validation` prop.
445
+ * A Moment instance representing the currently selected date, i.e. `moment()`
446
+ */
447
+ dateFormat: PropTypes.string,
448
+ /**
449
+ * Optional date format for the date input. If not set, the default value will be `DD / MM / YYYY`
448
450
  */
449
451
  feedback: PropTypes.string,
450
452
  /**
@@ -499,7 +501,7 @@ DatePicker.propTypes = {
499
501
  */
500
502
  nextTestID: PropTypes.string,
501
503
  /**
502
- * Optional placeholder for the date input. If not set the default value will be `DD / MM / YYYY`
504
+ * Optional placeholder for the date input. If not set, the default value will be equal to the `dateFormat` prop
503
505
  */
504
506
  placeholder: PropTypes.string,
505
507
  /**
@@ -220,7 +220,6 @@ const usePrevious = value => {
220
220
  * - When `Footnote` is closed, focus must return to the initiating element
221
221
  */
222
222
  const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
223
- var _theme$themeOptions;
224
223
  const {
225
224
  copy = 'en',
226
225
  number,
@@ -290,7 +289,7 @@ const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
290
289
  });
291
290
  const prevProps = usePrevious(props);
292
291
  const theme = useTheme();
293
- const maxWidth = useResponsiveProp((_theme$themeOptions = theme.themeOptions) === null || _theme$themeOptions === void 0 ? void 0 : _theme$themeOptions.contentMaxWidth);
292
+ const maxWidth = useResponsiveProp(theme.themeOptions?.contentMaxWidth);
294
293
  const [isScrollable, setIsScrollable] = React.useState(false);
295
294
  const closeFootnote = React.useCallback((event, options) => {
296
295
  onClose(event, options);
@@ -304,7 +303,6 @@ const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
304
303
  * if there are no interactive elements the focus will remain inside the close button.
305
304
  */
306
305
  const manageFootnoteFocusAndClose = React.useCallback(event => {
307
- var _footnoteRef$current, _footnoteRef$current2;
308
306
  if (!isVisible) {
309
307
  return;
310
308
  }
@@ -325,11 +323,11 @@ const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
325
323
  firstElement.focus();
326
324
  }
327
325
  }
328
- } else if ((event.type === 'click' || event.type === 'mousedown') && footnoteRef !== null && footnoteRef !== void 0 && footnoteRef.current && event.target && !(footnoteRef !== null && footnoteRef !== void 0 && (_footnoteRef$current = footnoteRef.current) !== null && _footnoteRef$current !== void 0 && _footnoteRef$current.contains(event.target)) && event.target.getAttribute('data-tds-id') !== 'footnote-link') {
326
+ } else if ((event.type === 'click' || event.type === 'mousedown') && footnoteRef?.current && event.target && !footnoteRef?.current?.contains(event.target) && event.target.getAttribute('data-tds-id') !== 'footnote-link') {
329
327
  closeFootnote(event, {
330
328
  returnFocus: false
331
329
  });
332
- } else if (event.type === 'touchstart' && footnoteRef !== null && footnoteRef !== void 0 && footnoteRef.current && event.touches[0].target && !(footnoteRef !== null && footnoteRef !== void 0 && (_footnoteRef$current2 = footnoteRef.current) !== null && _footnoteRef$current2 !== void 0 && _footnoteRef$current2.contains(event.touches[0].target)) && event.touches[0].target.getAttribute('data-tds-id') !== 'footnote-link') {
330
+ } else if (event.type === 'touchstart' && footnoteRef?.current && event.touches[0].target && !footnoteRef?.current?.contains(event.touches[0].target) && event.touches[0].target.getAttribute('data-tds-id') !== 'footnote-link') {
333
331
  closeFootnote(event, {
334
332
  returnFocus: false
335
333
  });
@@ -381,8 +379,7 @@ const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
381
379
 
382
380
  // Set height of header on mount
383
381
  React.useEffect(() => {
384
- var _headerRef$current;
385
- setHeaderHeight((_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.offsetHeight);
382
+ setHeaderHeight(headerRef.current?.offsetHeight);
386
383
  }, []);
387
384
  const preventDefault = event => {
388
385
  if (!bodyRef.current.contains(event.touches[0].target)) {
@@ -1,4 +1,3 @@
1
- var _withLinkRouter$propT, _withLinkRouter$propT2, _withLinkRouter$propT3, _withLinkRouter$propT4;
2
1
  import React from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import { selectSystemProps, StackView, Typography, useHash, useInputValue, useResponsiveProp, withLinkRouter } from '@telus-uds/components-base';
@@ -59,14 +58,14 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
59
58
  let {
60
59
  items: parentItems
61
60
  } = _ref3;
62
- return parentItems === null || parentItems === void 0 ? void 0 : parentItems.some(_ref4 => {
61
+ return parentItems?.some(_ref4 => {
63
62
  let {
64
63
  href
65
64
  } = _ref4;
66
65
  return hash === href;
67
66
  });
68
67
  });
69
- hashItem = parentItem === null || parentItem === void 0 ? void 0 : parentItem.items.find(_ref5 => {
68
+ hashItem = parentItem?.items.find(_ref5 => {
70
69
  let {
71
70
  href
72
71
  } = _ref5;
@@ -87,14 +86,13 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
87
86
  const openOverlayRef = React.useRef(null);
88
87
  const [openSubMenuId, setOpenSubMenuId] = React.useState(null);
89
88
  const handleSubMenuClose = event => {
90
- var _openOverlayRef$curre, _openOverlayRef$curre2;
91
89
  if (event.type === 'keydown') {
92
90
  if (event.key === 'Escape' || event.key === 27) {
93
91
  setOpenSubMenuId(null);
94
92
  }
95
- } else if (event.type === 'click' && openOverlayRef !== null && openOverlayRef !== void 0 && openOverlayRef.current && event.target && !(openOverlayRef !== null && openOverlayRef !== void 0 && (_openOverlayRef$curre = openOverlayRef.current) !== null && _openOverlayRef$curre !== void 0 && _openOverlayRef$curre.contains(event.target))) {
93
+ } else if (event.type === 'click' && openOverlayRef?.current && event.target && !openOverlayRef?.current?.contains(event.target)) {
96
94
  setOpenSubMenuId(null);
97
- } else if (event.type === 'touchstart' && openOverlayRef !== null && openOverlayRef !== void 0 && openOverlayRef.current && event.touches[0].target && !(openOverlayRef !== null && openOverlayRef !== void 0 && (_openOverlayRef$curre2 = openOverlayRef.current) !== null && _openOverlayRef$curre2 !== void 0 && _openOverlayRef$curre2.contains(event.touches[0].target))) {
95
+ } else if (event.type === 'touchstart' && openOverlayRef?.current && event.touches[0].target && !openOverlayRef?.current?.contains(event.touches[0].target)) {
98
96
  setOpenSubMenuId(null);
99
97
  }
100
98
  };
@@ -155,7 +153,7 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
155
153
  heading: headingLevel,
156
154
  children: heading
157
155
  })
158
- }), itemsForViewport === null || itemsForViewport === void 0 ? void 0 : itemsForViewport.map((_ref6, index) => {
156
+ }), itemsForViewport?.map((_ref6, index) => {
159
157
  let {
160
158
  href,
161
159
  label,
@@ -173,22 +171,22 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
173
171
  setOpenSubMenuId(openSubMenuId !== itemId ? itemId : null);
174
172
  return;
175
173
  }
176
- if (href !== null && href !== void 0 && href.startsWith('#')) {
174
+ if (href?.startsWith('#')) {
177
175
  scrollToAnchor(href, event, () => setValue(itemId, event));
178
176
  } else {
179
177
  setValue(itemId, event);
180
178
  }
181
- onClick === null || onClick === void 0 || onClick(event);
179
+ onClick?.(event);
182
180
  };
183
181
  const ItemComponent = nestedItems ? NavigationSubMenu : NavigationItem;
184
182
  const isOpen = itemId === openSubMenuId;
185
- const scrollableNestedItems = (nestedItems === null || nestedItems === void 0 ? void 0 : nestedItems.map(item => ({
183
+ const scrollableNestedItems = nestedItems?.map(item => ({
186
184
  ...item,
187
185
  onPress: event => {
188
186
  const nestedItemId = item.id ?? item.label;
189
187
  scrollToAnchor(item.href, event, () => setValue(nestedItemId, event));
190
188
  }
191
- }))) ?? nestedItems;
189
+ })) ?? nestedItems;
192
190
  return /*#__PURE__*/_jsx(ItemComponent, {
193
191
  ref: itemRef,
194
192
  href: href,
@@ -235,8 +233,8 @@ NavigationBar.propTypes = {
235
233
  id: PropTypes.string.isRequired,
236
234
  onClick: PropTypes.func,
237
235
  selected: PropTypes.bool,
238
- LinkRouter: (_withLinkRouter$propT = withLinkRouter.propTypes) === null || _withLinkRouter$propT === void 0 ? void 0 : _withLinkRouter$propT.LinkRouter,
239
- linkRouterProps: (_withLinkRouter$propT2 = withLinkRouter.propTypes) === null || _withLinkRouter$propT2 === void 0 ? void 0 : _withLinkRouter$propT2.linkRouterProps,
236
+ LinkRouter: withLinkRouter.propTypes?.LinkRouter,
237
+ linkRouterProps: withLinkRouter.propTypes?.linkRouterProps,
240
238
  // One layer of nested links is allowed
241
239
  items: PropTypes.arrayOf(PropTypes.shape({
242
240
  label: PropTypes.string.isRequired,
@@ -244,8 +242,8 @@ NavigationBar.propTypes = {
244
242
  id: PropTypes.string.isRequired,
245
243
  onClick: PropTypes.func,
246
244
  selected: PropTypes.bool,
247
- LinkRouter: (_withLinkRouter$propT3 = withLinkRouter.propTypes) === null || _withLinkRouter$propT3 === void 0 ? void 0 : _withLinkRouter$propT3.LinkRouter,
248
- linkRouterProps: (_withLinkRouter$propT4 = withLinkRouter.propTypes) === null || _withLinkRouter$propT4 === void 0 ? void 0 : _withLinkRouter$propT4.linkRouterProps
245
+ LinkRouter: withLinkRouter.propTypes?.LinkRouter,
246
+ linkRouterProps: withLinkRouter.propTypes?.linkRouterProps
249
247
  }))
250
248
  })).isRequired,
251
249
  /**
@@ -99,7 +99,6 @@ const NavigationSubMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
99
99
  icon: icoMenu,
100
100
  tokens: tokens,
101
101
  children: _ref2 => {
102
- var _textStyles$;
103
102
  let {
104
103
  textStyles
105
104
  } = _ref2;
@@ -109,7 +108,7 @@ const NavigationSubMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
109
108
  size: 'micro'
110
109
  },
111
110
  tokens: {
112
- color: (_textStyles$ = textStyles[0]) === null || _textStyles$ === void 0 ? void 0 : _textStyles$.color
111
+ color: textStyles[0]?.color
113
112
  }
114
113
  }, `${id}_icon`)];
115
114
  }
@@ -2,7 +2,7 @@
2
2
  * Make a list of items into a one-item list where all items are nested under the first item
3
3
  */
4
4
  const collapseItems = (items, selectedId) => {
5
- if (!(items !== null && items !== void 0 && items.length)) return items;
5
+ if (!items?.length) return items;
6
6
 
7
7
  // Give the root item the label of the current active link
8
8
  // (or the first item if for some reason there's no match on the selectedId)
@@ -17,12 +17,11 @@ const collapseItems = (items, selectedId) => {
17
17
 
18
18
  // Linter doesn't like for loops, simulate loop that breaks
19
19
  items.some(item => {
20
- var _item$items;
21
20
  if (isSelected(item)) {
22
21
  rootLabel = item.label;
23
22
  return true; // break
24
23
  }
25
- const nestedMatch = (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.find(isSelected);
24
+ const nestedMatch = item.items?.find(isSelected);
26
25
  if (nestedMatch) {
27
26
  rootLabel = nestedMatch.label;
28
27
  return true; // break
@@ -7,7 +7,7 @@ const resolveItemSelection = (_ref, selectedId) => {
7
7
  const itemId = id ?? label;
8
8
 
9
9
  // Treat item as selected if it or any nested child matches the selected id
10
- const selected = Boolean(selectedId === itemId || (items === null || items === void 0 ? void 0 : items.some(item => resolveItemSelection(item, selectedId).selected)));
10
+ const selected = Boolean(selectedId === itemId || items?.some(item => resolveItemSelection(item, selectedId).selected));
11
11
  return {
12
12
  itemId,
13
13
  selected
@@ -38,9 +38,8 @@ const OrderedList = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
38
38
  // Pass any variants and tokens "OrderedList" receives down to the individual list items.
39
39
  const childrenWithParentVariantsAndTokens = React.useMemo(() => {
40
40
  const addVariantAndTokensToProps = child => {
41
- var _child$props, _child$props2;
42
- const existingChildVariants = ((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.variant) ?? {};
43
- const existingChildTokens = ((_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.tokens) ?? {};
41
+ const existingChildVariants = child.props?.variant ?? {};
42
+ const existingChildTokens = child.props?.tokens ?? {};
44
43
  return /*#__PURE__*/React.cloneElement(child, {
45
44
  variant: {
46
45
  ...existingChildVariants,
@@ -117,13 +117,22 @@ const StrikeThroughContainer = styled.div`
117
117
  position: absolute;
118
118
  }
119
119
  `;
120
- const selectFootnoteLinkStyles = _ref13 => {
120
+ const TypographyContainer = styled.div`
121
+ display: flex;
122
+ padding-top: ${_ref13 => {
123
+ let {
124
+ paddingTop
125
+ } = _ref13;
126
+ return `${paddingTop || 0}px`;
127
+ }};
128
+ `;
129
+ const selectFootnoteLinkStyles = _ref14 => {
121
130
  let {
122
131
  footnoteLinkColor,
123
132
  footnoteLinkFontName,
124
133
  footnoteLinkFontWeight,
125
134
  footnoteLinkLineHeight
126
- } = _ref13;
135
+ } = _ref14;
127
136
  return {
128
137
  color: footnoteLinkColor,
129
138
  fontName: footnoteLinkFontName,
@@ -131,19 +140,19 @@ const selectFootnoteLinkStyles = _ref13 => {
131
140
  lineHeight: footnoteLinkLineHeight
132
141
  };
133
142
  };
134
- const selectStrikeThroughTokens = _ref14 => {
143
+ const selectStrikeThroughTokens = _ref15 => {
135
144
  let {
136
145
  strikeThroughPosition,
137
146
  strikeThroughHeight,
138
147
  strikeThroughColor
139
- } = _ref14;
148
+ } = _ref15;
140
149
  return {
141
150
  strikeThroughHeight,
142
151
  strikeThroughPosition,
143
152
  strikeThroughColor
144
153
  };
145
154
  };
146
- const PriceLockup = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
155
+ const PriceLockup = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
147
156
  let {
148
157
  size = 'medium',
149
158
  signDirection = 'left',
@@ -160,7 +169,7 @@ const PriceLockup = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
160
169
  tokens: priceLockupTokens,
161
170
  variant = {},
162
171
  ...rest
163
- } = _ref15;
172
+ } = _ref16;
164
173
  const viewport = useViewport();
165
174
  const {
166
175
  footnoteMarginTop,
@@ -193,6 +202,10 @@ const PriceLockup = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
193
202
  const amount = hasCents ? priceString.substring(0, separatorPosition) : priceString;
194
203
  const cents = hasCents ? priceString.substring(separatorPosition + 1) : null;
195
204
  const renderTypography = (value, tokens, position) => {
205
+ const {
206
+ paddingTop,
207
+ ...restOfTokens
208
+ } = tokens;
196
209
  const customProps = position === 'bottom' ? {
197
210
  variant: {
198
211
  size: 'micro'
@@ -202,13 +215,16 @@ const PriceLockup = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
202
215
  }
203
216
  } : {
204
217
  tokens: {
205
- ...tokens,
218
+ ...restOfTokens,
206
219
  color: fontColor
207
220
  }
208
221
  };
209
- return /*#__PURE__*/_jsx(Typography, {
210
- ...customProps,
211
- children: value
222
+ return /*#__PURE__*/_jsx(TypographyContainer, {
223
+ paddingTop: paddingTop,
224
+ children: /*#__PURE__*/_jsx(Typography, {
225
+ ...customProps,
226
+ children: value
227
+ })
212
228
  });
213
229
  };
214
230
  const renderCurrencySymbol = () => renderTypography(`${currencySymbol}`, typographyTokens.dollarSign);
@@ -7,12 +7,14 @@ export default _ref => {
7
7
  currencySymbolFontSize,
8
8
  currencySymbolLineHeight,
9
9
  currencySymbolFontWeight,
10
+ currencySymbolPaddingTop,
10
11
  amountFontSize,
11
12
  amountLineHeight,
12
13
  amountLetterSpacing,
13
14
  amountFontWeight,
14
15
  centsFontSize,
15
16
  centsLineHeight,
17
+ centsPaddingTop,
16
18
  rateFontSize,
17
19
  rateLineHeight,
18
20
  bottomTextFontSize,
@@ -28,7 +30,8 @@ export default _ref => {
28
30
  dollarSign: {
29
31
  fontSize: currencySymbolFontSize,
30
32
  lineHeight: currencySymbolLineHeight,
31
- fontWeight: currencySymbolFontWeight
33
+ fontWeight: currencySymbolFontWeight,
34
+ paddingTop: currencySymbolPaddingTop
32
35
  },
33
36
  amount: {
34
37
  color: fontColor,
@@ -40,7 +43,8 @@ export default _ref => {
40
43
  cents: {
41
44
  fontSize: centsFontSize,
42
45
  lineHeight: centsLineHeight,
43
- fontWeight: centsFontWeight
46
+ fontWeight: centsFontWeight,
47
+ paddingTop: centsPaddingTop
44
48
  },
45
49
  rate: {
46
50
  fontSize: rateFontSize,
@@ -1,4 +1,3 @@
1
- var _Skeleton$propTypes, _Skeleton$propTypes2, _Skeleton$propTypes3;
2
1
  import React from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import { Skeleton } from '@telus-uds/components-base';
@@ -30,9 +29,9 @@ SkeletonImage.displayName = 'SkeletonImage';
30
29
  SkeletonImage.propTypes = {
31
30
  imgHeight: PropTypes.number,
32
31
  rounded: PropTypes.oneOf(['circle', 'corners']),
33
- size: (_Skeleton$propTypes = Skeleton.propTypes) === null || _Skeleton$propTypes === void 0 ? void 0 : _Skeleton$propTypes.size,
34
- sizeIndex: (_Skeleton$propTypes2 = Skeleton.propTypes) === null || _Skeleton$propTypes2 === void 0 ? void 0 : _Skeleton$propTypes2.sizeIndex,
35
- sizePixels: (_Skeleton$propTypes3 = Skeleton.propTypes) === null || _Skeleton$propTypes3 === void 0 ? void 0 : _Skeleton$propTypes3.sizePixels,
32
+ size: Skeleton.propTypes?.size,
33
+ sizeIndex: Skeleton.propTypes?.sizeIndex,
34
+ sizePixels: Skeleton.propTypes?.sizePixels,
36
35
  show: PropTypes.bool.isRequired,
37
36
  children: PropTypes.node
38
37
  };
@@ -1,4 +1,3 @@
1
- var _Skeleton$propTypes, _Skeleton$propTypes2, _Skeleton$propTypes3, _Skeleton$propTypes4, _Skeleton$propTypes5;
2
1
  import React from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import { Skeleton } from '@telus-uds/components-base';
@@ -29,10 +28,10 @@ SkeletonTypography.displayName = 'SkeletonTypography';
29
28
  SkeletonTypography.propTypes = {
30
29
  show: PropTypes.bool.isRequired,
31
30
  children: PropTypes.node,
32
- size: (_Skeleton$propTypes = Skeleton.propTypes) === null || _Skeleton$propTypes === void 0 ? void 0 : _Skeleton$propTypes.size,
33
- sizeIndex: (_Skeleton$propTypes2 = Skeleton.propTypes) === null || _Skeleton$propTypes2 === void 0 ? void 0 : _Skeleton$propTypes2.sizeIndex,
34
- sizePixels: (_Skeleton$propTypes3 = Skeleton.propTypes) === null || _Skeleton$propTypes3 === void 0 ? void 0 : _Skeleton$propTypes3.sizePixels,
35
- characters: (_Skeleton$propTypes4 = Skeleton.propTypes) === null || _Skeleton$propTypes4 === void 0 ? void 0 : _Skeleton$propTypes4.characters,
36
- lines: (_Skeleton$propTypes5 = Skeleton.propTypes) === null || _Skeleton$propTypes5 === void 0 ? void 0 : _Skeleton$propTypes5.lines
31
+ size: Skeleton.propTypes?.size,
32
+ sizeIndex: Skeleton.propTypes?.sizeIndex,
33
+ sizePixels: Skeleton.propTypes?.sizePixels,
34
+ characters: Skeleton.propTypes?.characters,
35
+ lines: Skeleton.propTypes?.lines
37
36
  };
38
37
  export default SkeletonTypography;
@@ -62,9 +62,8 @@ const Table = _ref2 => {
62
62
  const [tableWidth, setTableWidth] = React.useState(0);
63
63
  useSafeLayoutEffect(() => {
64
64
  const updateDimensions = () => {
65
- var _containerRef$current, _tableRef$current;
66
- const containerClientWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientWidth;
67
- const responsiveTableWidth = fullWidth ? containerClientWidth : (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.clientWidth;
65
+ const containerClientWidth = containerRef.current?.clientWidth;
66
+ const responsiveTableWidth = fullWidth ? containerClientWidth : tableRef.current?.clientWidth;
68
67
  setContainerWidth(containerClientWidth);
69
68
  setTableWidth(responsiveTableWidth);
70
69
  };
@@ -114,7 +114,8 @@ const ExpandCollapse = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
114
114
  },
115
115
  tokens: iconTokens,
116
116
  focusable: false,
117
- accessibilityLabel: label
117
+ accessibilityLabel: label,
118
+ accessibilityRole: "none"
118
119
  })
119
120
  }), /*#__PURE__*/_jsx(ExpandCollapseTitle, {
120
121
  tokens: getTokens(),
@@ -1,4 +1,3 @@
1
- var _withLinkRouter$propT, _withLinkRouter$propT2;
2
1
  import React from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import { ChevronLink, selectSystemProps, useThemeTokens, Typography, withLinkRouter, Spacer, useViewport, getTokensPropType } from '@telus-uds/components-base';
@@ -201,8 +200,8 @@ Toast.propTypes = {
201
200
  link: PropTypes.shape({
202
201
  href: PropTypes.string.isRequired,
203
202
  text: PropTypes.string.isRequired,
204
- LinkRouter: (_withLinkRouter$propT = withLinkRouter.propTypes) === null || _withLinkRouter$propT === void 0 ? void 0 : _withLinkRouter$propT.LinkRouter,
205
- linkRouterProps: (_withLinkRouter$propT2 = withLinkRouter.propTypes) === null || _withLinkRouter$propT2 === void 0 ? void 0 : _withLinkRouter$propT2.linkRouterProps
203
+ LinkRouter: withLinkRouter.propTypes?.LinkRouter,
204
+ linkRouterProps: withLinkRouter.propTypes?.linkRouterProps
206
205
  })
207
206
  };
208
207
  export default Toast;