@telus-uds/components-base 1.30.1 → 1.32.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 (117) hide show
  1. package/CHANGELOG.md +31 -2
  2. package/component-docs.json +25 -0
  3. package/lib/ActivityIndicator/Spinner.js +7 -7
  4. package/lib/ActivityIndicator/Spinner.native.js +2 -2
  5. package/lib/BaseProvider/HydrationContext.js +1 -1
  6. package/lib/Box/Box.js +1 -1
  7. package/lib/Button/ButtonBase.js +2 -2
  8. package/lib/Button/ButtonGroup.js +1 -1
  9. package/lib/Carousel/Carousel.js +2 -4
  10. package/lib/Carousel/CarouselContext.js +1 -1
  11. package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +1 -1
  12. package/lib/Carousel/CarouselThumbnail.js +2 -2
  13. package/lib/Checkbox/Checkbox.js +1 -1
  14. package/lib/Checkbox/CheckboxGroup.js +2 -2
  15. package/lib/Divider/Divider.js +2 -2
  16. package/lib/Fieldset/Fieldset.js +1 -5
  17. package/lib/Fieldset/FieldsetContainer.js +1 -1
  18. package/lib/FlexGrid/Col/Col.js +1 -1
  19. package/lib/Icon/Icon.js +1 -1
  20. package/lib/List/ListItemContent.js +5 -2
  21. package/lib/List/PressableListItemBase.js +2 -0
  22. package/lib/MultiSelectFilter/MultiSelectFilter.js +2 -2
  23. package/lib/Pagination/PageButton.js +2 -2
  24. package/lib/Pagination/Pagination.js +3 -5
  25. package/lib/Pagination/usePagination.js +2 -2
  26. package/lib/Progress/ProgressBar.js +3 -3
  27. package/lib/Progress/ProgressBarBackground.js +3 -3
  28. package/lib/Radio/Radio.js +2 -2
  29. package/lib/Radio/RadioGroup.js +2 -2
  30. package/lib/RadioCard/RadioCard.js +1 -1
  31. package/lib/RadioCard/RadioCardGroup.js +2 -2
  32. package/lib/Search/Search.js +1 -1
  33. package/lib/SideNav/SideNav.js +2 -2
  34. package/lib/Skeleton/Skeleton.js +1 -1
  35. package/lib/Skeleton/skeletonWebAnimation.js +1 -1
  36. package/lib/StackView/StackWrap.js +1 -3
  37. package/lib/StackView/getStackedContent.js +2 -2
  38. package/lib/Tabs/Tabs.js +2 -4
  39. package/lib/Tags/Tags.js +1 -1
  40. package/lib/TextInput/TextInputBase.js +1 -1
  41. package/lib/ThemeProvider/utils/styles.js +8 -3
  42. package/lib/ThemeProvider/utils/theme-tokens.js +9 -7
  43. package/lib/Timeline/Timeline.js +1 -1
  44. package/lib/ToggleSwitch/ToggleSwitch.js +1 -1
  45. package/lib/ToggleSwitch/ToggleSwitchGroup.js +1 -1
  46. package/lib/Tooltip/Backdrop.js +10 -2
  47. package/lib/Tooltip/Tooltip.js +2 -2
  48. package/lib/Validator/Validator.js +14 -15
  49. package/lib/utils/animation/useVerticalExpandAnimation.js +1 -1
  50. package/lib/utils/children.js +2 -2
  51. package/lib/utils/input.js +13 -7
  52. package/lib/utils/props/componentPropType.js +3 -3
  53. package/lib/utils/props/selectSystemProps.js +2 -2
  54. package/lib/utils/props/tokens.js +2 -2
  55. package/lib/utils/useSpacingScale.js +1 -3
  56. package/lib/utils/useUniqueId.js +1 -1
  57. package/lib-module/ActivityIndicator/Spinner.js +7 -7
  58. package/lib-module/ActivityIndicator/Spinner.native.js +2 -2
  59. package/lib-module/BaseProvider/HydrationContext.js +1 -1
  60. package/lib-module/Box/Box.js +1 -1
  61. package/lib-module/Button/ButtonBase.js +2 -2
  62. package/lib-module/Button/ButtonGroup.js +1 -1
  63. package/lib-module/Carousel/Carousel.js +2 -4
  64. package/lib-module/Carousel/CarouselContext.js +1 -1
  65. package/lib-module/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +1 -1
  66. package/lib-module/Carousel/CarouselThumbnail.js +2 -2
  67. package/lib-module/Checkbox/Checkbox.js +1 -1
  68. package/lib-module/Checkbox/CheckboxGroup.js +2 -2
  69. package/lib-module/Divider/Divider.js +2 -2
  70. package/lib-module/Fieldset/Fieldset.js +1 -5
  71. package/lib-module/Fieldset/FieldsetContainer.js +1 -1
  72. package/lib-module/FlexGrid/Col/Col.js +1 -1
  73. package/lib-module/Icon/Icon.js +1 -1
  74. package/lib-module/List/ListItemContent.js +5 -2
  75. package/lib-module/List/PressableListItemBase.js +2 -0
  76. package/lib-module/MultiSelectFilter/MultiSelectFilter.js +2 -2
  77. package/lib-module/Pagination/PageButton.js +2 -2
  78. package/lib-module/Pagination/Pagination.js +3 -5
  79. package/lib-module/Pagination/usePagination.js +2 -2
  80. package/lib-module/Progress/ProgressBar.js +3 -3
  81. package/lib-module/Progress/ProgressBarBackground.js +3 -3
  82. package/lib-module/Radio/Radio.js +2 -2
  83. package/lib-module/Radio/RadioGroup.js +2 -2
  84. package/lib-module/RadioCard/RadioCard.js +1 -1
  85. package/lib-module/RadioCard/RadioCardGroup.js +2 -2
  86. package/lib-module/Search/Search.js +1 -1
  87. package/lib-module/SideNav/SideNav.js +2 -2
  88. package/lib-module/Skeleton/Skeleton.js +1 -1
  89. package/lib-module/Skeleton/skeletonWebAnimation.js +1 -1
  90. package/lib-module/StackView/StackWrap.js +1 -3
  91. package/lib-module/StackView/getStackedContent.js +2 -2
  92. package/lib-module/Tabs/Tabs.js +2 -4
  93. package/lib-module/Tags/Tags.js +1 -1
  94. package/lib-module/TextInput/TextInputBase.js +1 -1
  95. package/lib-module/ThemeProvider/utils/styles.js +8 -3
  96. package/lib-module/ThemeProvider/utils/theme-tokens.js +9 -7
  97. package/lib-module/Timeline/Timeline.js +1 -1
  98. package/lib-module/ToggleSwitch/ToggleSwitch.js +1 -1
  99. package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +1 -1
  100. package/lib-module/Tooltip/Backdrop.js +10 -2
  101. package/lib-module/Tooltip/Tooltip.js +2 -2
  102. package/lib-module/Validator/Validator.js +14 -15
  103. package/lib-module/utils/animation/useVerticalExpandAnimation.js +1 -1
  104. package/lib-module/utils/children.js +2 -2
  105. package/lib-module/utils/input.js +13 -7
  106. package/lib-module/utils/props/componentPropType.js +3 -3
  107. package/lib-module/utils/props/selectSystemProps.js +2 -2
  108. package/lib-module/utils/props/tokens.js +2 -2
  109. package/lib-module/utils/useSpacingScale.js +1 -3
  110. package/lib-module/utils/useUniqueId.js +1 -1
  111. package/package.json +2 -2
  112. package/src/Fieldset/Fieldset.jsx +1 -7
  113. package/src/Fieldset/FieldsetContainer.jsx +1 -1
  114. package/src/List/ListItemContent.jsx +4 -2
  115. package/src/List/PressableListItemBase.jsx +2 -0
  116. package/src/ThemeProvider/utils/styles.js +5 -0
  117. package/src/Validator/Validator.jsx +2 -1
package/CHANGELOG.md CHANGED
@@ -1,12 +1,41 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Thu, 23 Mar 2023 20:46:10 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 04 Apr 2023 14:45:59 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.32.0
8
+
9
+ Tue, 04 Apr 2023 14:45:59 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - feat: Standardize radio telus,PM,Koodo (samuraix221@hotmail.com)
14
+ - Bump @telus-uds/system-theme-tokens to v2.16.0
15
+
16
+ ### Patches
17
+
18
+ - Fixes extra spaces around `Fieldset` group (shahzaibkhalidmalik@outlook.com)
19
+
20
+ ## 1.31.0
21
+
22
+ Mon, 03 Apr 2023 20:41:50 GMT
23
+
24
+ ### Minor changes
25
+
26
+ - added storybook stories for Koodo divider (kyle.king2@telus.com)
27
+ - add more icon variants to storybook (mauricio.batresmontejo@telus.com)
28
+ - Added color property to QuickLinksList (wlsdud194@hotmail.com)
29
+ - add stories for inverse and inactive buttons (evander.owusu@telus.com)
30
+ - Bump @telus-uds/system-theme-tokens to v2.15.0
31
+
32
+ ### Patches
33
+
34
+ - add keyboard type numeric to validator (mauricio.batresmontejo@telus.com)
35
+
7
36
  ## 1.30.1
8
37
 
9
- Thu, 23 Mar 2023 20:46:10 GMT
38
+ Thu, 23 Mar 2023 20:52:43 GMT
10
39
 
11
40
  ### Patches
12
41
 
@@ -514,6 +514,7 @@
514
514
  "itemBulletContainerWidth": "size",
515
515
  "itemBulletHeight": "size",
516
516
  "itemBulletWidth": "size",
517
+ "itemFontColor": "color",
517
518
  "itemFontName": "fontName",
518
519
  "itemFontSize": "fontSize",
519
520
  "itemFontWeight": "fontWeight",
@@ -647,6 +648,28 @@
647
648
  "space": "integer",
648
649
  "fieldSpace": "integer"
649
650
  },
651
+ "Ribbon": {
652
+ "paddingLeft": "size",
653
+ "paddingRight": "size",
654
+ "paddingTop": "size",
655
+ "paddingBottom": "size",
656
+ "borderRadius": "size",
657
+ "backgroundColor": "color",
658
+ "boxShadowPaddingLeft": "size",
659
+ "boxShadowPaddingTop": "size",
660
+ "boxShadowPaddingRight": "size",
661
+ "boxShadowPaddingBottom": "size",
662
+ "boxShadowColor": "color",
663
+ "curveAfterWidth": "size",
664
+ "curveMarginTop": "size",
665
+ "curveAfterRadius": "size",
666
+ "curveBackgroundColor": "color",
667
+ "curveHeight": "size",
668
+ "curveWidth": "size",
669
+ "curveAfterBackgroundColor": "color",
670
+ "curveAfterHeight": "size",
671
+ "gradient": "gradient"
672
+ },
650
673
  "Search": {
651
674
  "backgroundColor": "color",
652
675
  "color": "color",
@@ -6706,6 +6729,7 @@
6706
6729
  "itemBulletContainerWidth": "size",
6707
6730
  "itemBulletHeight": "size",
6708
6731
  "itemBulletWidth": "size",
6732
+ "itemFontColor": "color",
6709
6733
  "itemFontName": "fontName",
6710
6734
  "itemFontSize": "fontSize",
6711
6735
  "itemFontWeight": "fontWeight",
@@ -6788,6 +6812,7 @@
6788
6812
  "itemBulletContainerWidth": "size",
6789
6813
  "itemBulletHeight": "size",
6790
6814
  "itemBulletWidth": "size",
6815
+ "itemFontColor": "color",
6791
6816
  "itemFontName": "fontName",
6792
6817
  "itemFontSize": "fontSize",
6793
6818
  "itemFontWeight": "fontWeight",
@@ -23,14 +23,14 @@ const MIN_SVG_LENGTH = _shared.MIN_STROKE_ANGLE / 360 * SVG_CIRCUMFERENCE;
23
23
  const MAX_SVG_LENGTH = (1 - _shared.MIN_EMPTY_ANGLE / 360) * SVG_CIRCUMFERENCE;
24
24
  const animationProps = {
25
25
  begin: '0s',
26
- dur: "".concat(_shared.DURATION, "ms"),
26
+ dur: `${_shared.DURATION}ms`,
27
27
  fill: 'freeze',
28
28
  repeatCount: 'indefinite'
29
29
  };
30
30
  const bezierProps = {
31
31
  calcMode: 'spline',
32
32
  keyTimes: '0; 0.5; 1',
33
- keySplines: "".concat(_shared.BEZIER.join(', '), " ; ").concat(_shared.BEZIER.join(', '))
33
+ keySplines: `${_shared.BEZIER.join(', ')} ; ${_shared.BEZIER.join(', ')}`
34
34
  }; // We're using svg rather than css here to define the animation to avoid needing to introduce css injection mechanism
35
35
  // It's possible to replicate this functionality with RNW animations, but it snags on chrome at least, see https://github.com/telus/universal-design-system/pull/477 for details.
36
36
 
@@ -48,8 +48,8 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
48
48
  const reduceMotion = reduceMotionEnabled || isStatic;
49
49
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
50
50
  ref: ref,
51
- width: "".concat(size, "px"),
52
- height: "".concat(size, "px"),
51
+ width: `${size}px`,
52
+ height: `${size}px`,
53
53
  viewBox: "0 0 48 48",
54
54
  "aria-valuetext": label,
55
55
  role: "progressbar",
@@ -58,7 +58,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
58
58
  children: [reduceMotion ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)("animateTransform", {
59
59
  attributeName: "transform",
60
60
  type: "rotate",
61
- values: "-180 24 24;".concat(360 + _shared.MIN_STROKE_ANGLE - 180, " 24 24"),
61
+ values: `-180 24 24;${360 + _shared.MIN_STROKE_ANGLE - 180} 24 24`,
62
62
  ...animationProps
63
63
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
64
64
  fill: "none",
@@ -73,12 +73,12 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
73
73
  children: reduceMotion ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
74
74
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
75
75
  attributeName: "stroke-dashoffset",
76
- values: "0;-10;".concat(MIN_SVG_LENGTH - SVG_CIRCUMFERENCE),
76
+ values: `0;-10;${MIN_SVG_LENGTH - SVG_CIRCUMFERENCE}`,
77
77
  ...animationProps,
78
78
  ...bezierProps
79
79
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
80
80
  attributeName: "stroke-dasharray",
81
- values: "".concat(MIN_SVG_LENGTH, ", 200;").concat(MAX_SVG_LENGTH, ", 200;").concat(MIN_SVG_LENGTH, ", 200"),
81
+ values: `${MIN_SVG_LENGTH}, 200;${MAX_SVG_LENGTH}, 200;${MIN_SVG_LENGTH}, 200`,
82
82
  ...animationProps,
83
83
  ...bezierProps
84
84
  })]
@@ -97,7 +97,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
97
97
  }
98
98
 
99
99
  const direction = index ? -1 : +1;
100
- return "".concat(direction * (180 - (sa + ea)) * easing(progress) + rotation, "deg");
100
+ return `${direction * (180 - (sa + ea)) * easing(progress) + rotation}deg`;
101
101
  });
102
102
  const layerStyle = {
103
103
  width: size,
@@ -112,7 +112,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
112
112
  layerStyle.transform = [{
113
113
  rotate: timer.interpolate({
114
114
  inputRange: [0, 1],
115
- outputRange: ["".concat(0 + ea + sa, "deg"), "".concat(2 * 360 + ea + sa, "deg")]
115
+ outputRange: [`${0 + ea + sa}deg`, `${2 * 360 + ea + sa}deg`]
116
116
  })
117
117
  }];
118
118
  viewportStyle.transform = [{
@@ -59,7 +59,7 @@ const HydrationProvider = _ref => {
59
59
  }, []); // If we've got a HydrationProvider inside a HydrationProvider somehow, defer to the top one
60
60
 
61
61
  const valueFromAncestor = useHydrationContext();
62
- const isHydrating = valueFromAncestor !== null && valueFromAncestor !== void 0 ? valueFromAncestor : Boolean(!hasMounted && hasWebStyleTag());
62
+ const isHydrating = valueFromAncestor ?? Boolean(!hasMounted && hasWebStyleTag());
63
63
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(HydrationContext.Provider, {
64
64
  value: isHydrating,
65
65
  children: children
package/lib/Box/Box.js CHANGED
@@ -46,7 +46,7 @@ const selectBoxStyles = tokens => {
46
46
  }
47
47
  } = tokens;
48
48
  styles = { ...styles,
49
- backgroundImage: "linear-gradient(".concat(angle, "deg, ").concat(stopOne.color, ", 75% , ").concat(stopTwo.color, ")")
49
+ backgroundImage: `linear-gradient(${angle}deg, ${stopOne.color}, 75% , ${stopTwo.color})`
50
50
  };
51
51
  }
52
52
 
@@ -100,7 +100,7 @@ const selectOuterWidthStyles = _ref3 => {
100
100
 
101
101
 
102
102
  if (_Platform.default.OS === 'web') {
103
- widthStyles.width = "calc(".concat(width, " + ").concat(outerBorderOffset * 2, "px)");
103
+ widthStyles.width = `calc(${width} + ${outerBorderOffset * 2}px)`;
104
104
  return widthStyles;
105
105
  } // Can't use calc() on native but (unlike on web) flexGrow fills the container width here
106
106
 
@@ -187,7 +187,7 @@ const selectWebOnlyStyles = (inactive, themeTokens, _ref7) => {
187
187
  return _Platform.default.select({
188
188
  web: {
189
189
  // if it would overflow the container, wraps instead
190
- maxWidth: "calc(100% + ".concat(getOuterBorderOffset(themeTokens) * 2, "px)"),
190
+ maxWidth: `calc(100% + ${getOuterBorderOffset(themeTokens) * 2}px)`,
191
191
  outline: 'none',
192
192
  // removes the default browser :focus outline
193
193
  ...(0, _utils.getCursorStyle)(inactive, accessibilityRole)
@@ -93,7 +93,7 @@ const ButtonGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
93
93
  const uniqueFields = ['id', 'label'];
94
94
 
95
95
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
96
- throw new Error("ButtonGroup items must have unique ".concat(uniqueFields.join(', ')));
96
+ throw new Error(`ButtonGroup items must have unique ${uniqueFields.join(', ')}`);
97
97
  } // Some web screenreaders e.g. MacOS Voiceover don't handle radiogroups properly unless radio is direct child of radiogroup
98
98
 
99
99
 
@@ -159,8 +159,6 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
159
159
  */
160
160
 
161
161
  const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
162
- var _systemProps$accessib;
163
-
164
162
  let {
165
163
  tokens,
166
164
  variant,
@@ -460,7 +458,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
460
458
  const getCopyWithPlaceholders = _react.default.useCallback(copyKey => {
461
459
  const copyText = getCopy(copyKey).replace(/%\{title\}/g, title).replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, activeIndex + 1).replace(/%\{stepCount\}/g, childrenArray.length); // First word might be a lowercase placeholder: capitalize the first letter
462
460
 
463
- return "".concat(copyText[0].toUpperCase()).concat(copyText.slice(1));
461
+ return `${copyText[0].toUpperCase()}${copyText.slice(1)}`;
464
462
  }, [activeIndex, childrenArray.length, itemLabel, getCopy, title]);
465
463
 
466
464
  const activePanelNavigation = tabs && showPanelTabs ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselTabsPanel.default, {
@@ -484,7 +482,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
484
482
  // otherwise read the current position on focus
485
483
 
486
484
 
487
- const containerAccessibilityLabel = ((_systemProps$accessib = systemProps.accessibilityLabel) !== null && _systemProps$accessib !== void 0 ? _systemProps$accessib : isFirstFocusContainer) ? "".concat(title ? "".concat(title, " ") : '').concat(getCopyWithPlaceholders('stepTrackerLabel')) : title;
485
+ const containerAccessibilityLabel = systemProps.accessibilityLabel ?? isFirstFocusContainer ? `${title ? `${title} ` : ''}${getCopyWithPlaceholders('stepTrackerLabel')}` : title;
488
486
  const containerProps = {
489
487
  accessibilityLabel: containerAccessibilityLabel,
490
488
  // If used for focus, attach the ref and draw a focus box around the whole carousel
@@ -54,7 +54,7 @@ function useCarousel() {
54
54
  const context = _react.default.useContext(CarouselContext);
55
55
 
56
56
  if (context === undefined) {
57
- throw new Error("'useCarousel' must be used within a 'CarouselProvider'");
57
+ throw new Error(`'useCarousel' must be used within a 'CarouselProvider'`);
58
58
  }
59
59
 
60
60
  return context;
@@ -40,7 +40,7 @@ const CarouselFirstFocus = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
40
40
  } = (0, _CarouselContext.useCarousel)(); // TODO: integrate skip link description if behaving as skip link.
41
41
  // Consider moving this content to aria-live area while only the skip link is focused.
42
42
 
43
- const accessibilityLabel = "".concat(title, ", ").concat(getCopyWithPlaceholders('stepTrackerLabel'));
43
+ const accessibilityLabel = `${title}, ${getCopyWithPlaceholders('stepTrackerLabel')}`;
44
44
 
45
45
  const accessibilityRole = _Platform.default.select({
46
46
  web: 'link',
@@ -38,7 +38,7 @@ const CarouselThumbnail = _ref => {
38
38
  goTo,
39
39
  themeTokens
40
40
  } = (0, _CarouselContext.useCarousel)();
41
- const thumbnailTitle = alt !== null && alt !== void 0 ? alt : getCopyWithPlaceholders('stepTrackerLabel').replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, index).replace(/%\{stepCount\}/g, totalItems);
41
+ const thumbnailTitle = alt ?? getCopyWithPlaceholders('stepTrackerLabel').replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, index).replace(/%\{stepCount\}/g, totalItems);
42
42
 
43
43
  const handlePress = () => goTo(index);
44
44
 
@@ -81,7 +81,7 @@ const CarouselThumbnail = _ref => {
81
81
  style: [styles.pressable, index === activeIndex && styles.selected],
82
82
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, {
83
83
  accessibilityIgnoresInvertColors: true,
84
- accessibilityLabel: accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : alt,
84
+ accessibilityLabel: accessibilityLabel ?? alt,
85
85
  source: src,
86
86
  style: styles.image,
87
87
  title: thumbnailTitle
@@ -215,7 +215,7 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
215
215
  };
216
216
 
217
217
  const uniqueId = (0, _useUniqueId.default)('checkbox');
218
- const inputId = id !== null && id !== void 0 ? id : uniqueId;
218
+ const inputId = id ?? uniqueId;
219
219
  const {
220
220
  themeOptions
221
221
  } = (0, _ThemeProvider.useTheme)();
@@ -120,7 +120,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
120
120
  const uniqueFields = ['id', 'label'];
121
121
 
122
122
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
123
- throw new Error("CheckboxGroup items must have unique ".concat(uniqueFields.join(', ')));
123
+ throw new Error(`CheckboxGroup items must have unique ${uniqueFields.join(', ')}`);
124
124
  }
125
125
 
126
126
  const checkboxes = items.map((_ref2, index) => {
@@ -131,7 +131,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
131
131
  ref: itemRef,
132
132
  ...itemRest
133
133
  } = _ref2;
134
- const checkboxId = id || "Checkbox[".concat(index, "]");
134
+ const checkboxId = id || `Checkbox[${index}]`;
135
135
 
136
136
  const handleChange = (newCheckedState, event) => {
137
137
  if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
@@ -119,9 +119,9 @@ const Divider = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
119
119
  };
120
120
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
121
121
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, { ...spacerProps,
122
- testID: testID ? "".concat(testID, "-Spacer-before") : undefined
122
+ testID: testID ? `${testID}-Spacer-before` : undefined
123
123
  }), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, { ...spacerProps,
124
- testID: testID ? "".concat(testID, "-Spacer-after") : undefined
124
+ testID: testID ? `${testID}-Spacer-after` : undefined
125
125
  })]
126
126
  });
127
127
  });
@@ -94,7 +94,7 @@ const Fieldset = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
94
94
  space,
95
95
  preserveFragments: true
96
96
  });
97
- const borderStyle = validation === 'error' && showErrorBorder && staticStyles.errorBorder || staticStyles.noBorder;
97
+ const borderStyle = validation === 'error' && showErrorBorder ? staticStyles.errorBorder : null;
98
98
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FieldsetContainer.default, {
99
99
  ref: ref,
100
100
  inactive: inactive,
@@ -113,10 +113,6 @@ const staticStyles = _StyleSheet.default.create({
113
113
  borderColor: 'red',
114
114
  borderRadius: 10,
115
115
  padding: 8
116
- },
117
- noBorder: {
118
- padding: 9,
119
- border: 'unset'
120
116
  }
121
117
  });
122
118
 
@@ -32,7 +32,7 @@ const FieldsetContainer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
32
32
  borderStyle
33
33
  } = _ref;
34
34
  // If needs border for error design or reset the component style
35
- const styleContainer = showBorderStyle ? borderStyle : _cssReset.default;
35
+ const styleContainer = showBorderStyle && borderStyle ? borderStyle : _cssReset.default;
36
36
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("fieldset", {
37
37
  ref: ref,
38
38
  disabled: inactive,
@@ -67,7 +67,7 @@ const Col = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
67
67
  const horizontalAlignLevel = getHorizontalAlignLevel();
68
68
 
69
69
  const toPercent = num => {
70
- return "".concat(num / 12 * 100, "%");
70
+ return `${num / 12 * 100}%`;
71
71
  };
72
72
 
73
73
  const calculateWidth = value => {
package/lib/Icon/Icon.js CHANGED
@@ -48,7 +48,7 @@ const Icon = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
48
48
  // TODO: systematise animations.
49
49
  // https://github.com/telus/universal-design-system/issues/487
50
50
  transition: 'transform 200ms, color 200ms',
51
- transform: [themeTokens.scale ? "scale(".concat(themeTokens.scale, ")") : '', themeTokens.translateX ? "translateX(".concat(themeTokens.translateX, "px)") : '', themeTokens.translateY ? "translateY(".concat(themeTokens.translateY, "px)") : ''].filter(exists => exists).join(' ')
51
+ transform: [themeTokens.scale ? `scale(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' ')
52
52
  },
53
53
  dataSet: dataSet,
54
54
  children: iconContent
@@ -25,7 +25,8 @@ const tokenTypes = {
25
25
  itemFontWeight: _propTypes.default.string.isRequired,
26
26
  itemFontSize: _propTypes.default.number.isRequired,
27
27
  itemLineHeight: _propTypes.default.number.isRequired,
28
- itemFontName: _propTypes.default.string.isRequired
28
+ itemFontName: _propTypes.default.string.isRequired,
29
+ itemFontColor: _propTypes.default.string
29
30
  };
30
31
  exports.tokenTypes = tokenTypes;
31
32
 
@@ -34,9 +35,11 @@ const selectItemTextStyles = (_ref, themeOptions) => {
34
35
  itemFontWeight,
35
36
  itemFontSize,
36
37
  itemLineHeight,
37
- itemFontName
38
+ itemFontName,
39
+ itemFontColor
38
40
  } = _ref;
39
41
  return (0, _ThemeProvider.applyTextStyles)({
42
+ fontColor: itemFontColor,
40
43
  fontWeight: itemFontWeight,
41
44
  fontSize: itemFontSize,
42
45
  lineHeight: itemLineHeight,
@@ -36,6 +36,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
36
36
  const selectPressableStyles = _ref => {
37
37
  let {
38
38
  backgroundColor,
39
+ itemFontColor,
39
40
  paddingLeft,
40
41
  paddingRight,
41
42
  paddingTop,
@@ -44,6 +45,7 @@ const selectPressableStyles = _ref => {
44
45
  } = _ref;
45
46
  return {
46
47
  backgroundColor,
48
+ itemFontColor,
47
49
  paddingLeft,
48
50
  paddingRight,
49
51
  paddingTop,
@@ -110,13 +110,13 @@ const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
110
110
  copy
111
111
  });
112
112
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
113
- const [checkedIds, setCheckedIds] = (0, _react.useState)(currentValues !== null && currentValues !== void 0 ? currentValues : []);
113
+ const [checkedIds, setCheckedIds] = (0, _react.useState)(currentValues ?? []);
114
114
  const colSize = items.length > rowLimit ? 2 : 1;
115
115
  const isSelected = currentValues.length > 0;
116
116
  const uniqueFields = ['id', 'label'];
117
117
 
118
118
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
119
- throw new Error("MultiSelectFilter items must have unique ".concat(uniqueFields.join(', ')));
119
+ throw new Error(`MultiSelectFilter items must have unique ${uniqueFields.join(', ')}`);
120
120
  } // Pass an object of relevant component state as first argument for any passed-in press handlers
121
121
 
122
122
 
@@ -54,8 +54,8 @@ const PageButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
54
54
  key: 'active-item'
55
55
  } : {};
56
56
  const accessibilityRole = href !== undefined ? 'link' : 'button';
57
- const activeLabel = isActive ? " ".concat(getCopy('currentLabel')) : '';
58
- const accessibilityLabel = "".concat(getCopy('goToLabel'), " ").concat(label).concat(activeLabel);
57
+ const activeLabel = isActive ? ` ${getCopy('currentLabel')}` : '';
58
+ const accessibilityLabel = `${getCopy('goToLabel')} ${label}${activeLabel}`;
59
59
 
60
60
  const {
61
61
  hrefAttrs,
@@ -110,11 +110,9 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
110
110
  LinkRouter: LinkRouter,
111
111
  linkRouterProps: linkRouterProps
112
112
  }), ...items.map((_child, itemIndex) => {
113
- var _itemProps$LinkRouter;
114
-
115
- const buttonLabel = "".concat(itemIndex + 1);
113
+ const buttonLabel = `${itemIndex + 1}`;
116
114
  const itemProps = getItemProps(itemIndex);
117
- const ItemLinkRouter = (_itemProps$LinkRouter = itemProps.LinkRouter) !== null && _itemProps$LinkRouter !== void 0 ? _itemProps$LinkRouter : LinkRouter;
115
+ const ItemLinkRouter = itemProps.LinkRouter ?? LinkRouter;
118
116
  const itemLinkRouterProps = { ...linkRouterProps,
119
117
  ...itemProps.linkRouterProps
120
118
  };
@@ -151,7 +149,7 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
151
149
  ref: ref,
152
150
  ...selectProps(rest),
153
151
  children: buttons // keep the keys in-line with the page numbers regardless of which buttons are actually rendered
154
- .map((element, index) => [element, "page-".concat(index + 1)]).filter(_ref3 => {
152
+ .map((element, index) => [element, `page-${index + 1}`]).filter(_ref3 => {
155
153
  let [element] = _ref3;
156
154
  return element !== null;
157
155
  }).map(_ref4 => {
@@ -21,7 +21,7 @@ function usePagination(_ref) {
21
21
  );
22
22
 
23
23
  const getItemProps = index => {
24
- var _items$index$props, _items$index;
24
+ var _items$index;
25
25
 
26
26
  const {
27
27
  onPress,
@@ -29,7 +29,7 @@ function usePagination(_ref) {
29
29
  hrefAttrs,
30
30
  variant,
31
31
  tokens
32
- } = (_items$index$props = (_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props) !== null && _items$index$props !== void 0 ? _items$index$props : {};
32
+ } = ((_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props) ?? {};
33
33
  return {
34
34
  onPress,
35
35
  href,
@@ -43,7 +43,7 @@ const selectBarStyles = (_ref, percentage) => {
43
43
  borderRadius,
44
44
  outlineWidth,
45
45
  outlineColor,
46
- width: "".concat(percentage, "%")
46
+ width: `${percentage}%`
47
47
  };
48
48
  };
49
49
  /**
@@ -104,7 +104,7 @@ const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
104
104
  min: 0,
105
105
  max: 100,
106
106
  now: percentage,
107
- text: "".concat(percentage, "%")
107
+ text: `${percentage}%`
108
108
  },
109
109
  ...rest
110
110
  });
@@ -112,7 +112,7 @@ const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
112
112
  ref: ref,
113
113
  style: [staticStyles.bar, selectBarStyles(themeTokens, percentage)],
114
114
  ...selectedProps,
115
- children: children !== null && children !== void 0 ? children : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBarBackground.default, {
115
+ children: children ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBarBackground.default, {
116
116
  variant: variant
117
117
  })
118
118
  }) : null;
@@ -21,8 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
21
21
 
22
22
  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; }
23
23
 
24
- const inactiveBackground = "%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='DisabledProgress7' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23B2B9BF'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url(&quot;%23DisabledProgress7&quot;);'%3E%3C/path%3E%3C/svg%3E";
25
- const negativeBackground = "%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='NegativeProgress6' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23C12335'%3E%3C/rect%3E%3Cpath d='M 0,8 l 8,-8 M -2,2 l 4,-4 M 6,10 l 4,-4' stroke-width='2' shape-rendering='auto' stroke='%23e7adb4' stroke-linecap='square'%3E%3C/path%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url(&quot;%23NegativeProgress6&quot;);'%3E%3C/path%3E%3C/svg%3E";
24
+ const inactiveBackground = `%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='DisabledProgress7' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23B2B9BF'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url(&quot;%23DisabledProgress7&quot;);'%3E%3C/path%3E%3C/svg%3E`;
25
+ const negativeBackground = `%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='NegativeProgress6' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23C12335'%3E%3C/rect%3E%3Cpath d='M 0,8 l 8,-8 M -2,2 l 4,-4 M 6,10 l 4,-4' stroke-width='2' shape-rendering='auto' stroke='%23e7adb4' stroke-linecap='square'%3E%3C/path%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url(&quot;%23NegativeProgress6&quot;);'%3E%3C/path%3E%3C/svg%3E`;
26
26
  const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
27
27
  let {
28
28
  variant
@@ -40,7 +40,7 @@ const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) =>
40
40
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageBackground.default, {
41
41
  ref: ref,
42
42
  source: {
43
- uri: "data:image/svg+xml,".concat(source)
43
+ uri: `data:image/svg+xml,${source}`
44
44
  },
45
45
  style: staticStyles.imageBackground
46
46
  });
@@ -70,7 +70,7 @@ const selectDescriptionStyles = _ref2 => {
70
70
  labelMarginLeft = 0
71
71
  } = _ref2;
72
72
  return {
73
- marginLeft: descriptionMarginLeft !== null && descriptionMarginLeft !== void 0 ? descriptionMarginLeft : containerPaddingLeft + inputSize + labelMarginLeft,
73
+ marginLeft: descriptionMarginLeft ?? containerPaddingLeft + inputSize + labelMarginLeft,
74
74
  ...(0, _ThemeProvider.applyTextStyles)({
75
75
  fontSize: descriptionFontSize,
76
76
  lineHeight: descriptionLineHeight
@@ -174,7 +174,7 @@ const Radio = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
174
174
  };
175
175
 
176
176
  const uniqueId = (0, _utils.useUniqueId)('radio');
177
- const inputId = id !== null && id !== void 0 ? id : uniqueId;
177
+ const inputId = id ?? uniqueId;
178
178
  const selectedProps = selectProps({
179
179
  accessibilityRole: 'radio',
180
180
  accessibilityState: {
@@ -122,7 +122,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
122
122
  const uniqueFields = ['id', 'label'];
123
123
 
124
124
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
125
- throw new Error("RadioGroup items must have unique ".concat(uniqueFields.join(', ')));
125
+ throw new Error(`RadioGroup items must have unique ${uniqueFields.join(', ')}`);
126
126
  }
127
127
 
128
128
  const radios = items.map((_ref2, index) => {
@@ -134,7 +134,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
134
134
  description,
135
135
  ...itemRest
136
136
  } = _ref2;
137
- const radioId = id || "Radio[".concat(index, "]");
137
+ const radioId = id || `Radio[${index}]`;
138
138
  const isChecked = currentValue === radioId;
139
139
 
140
140
  const handleChange = (newCheckedState, event) => {
@@ -102,7 +102,7 @@ const RadioCard = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
102
102
  };
103
103
 
104
104
  const uniqueId = (0, _utils.useUniqueId)('RadioCard');
105
- const inputId = id !== null && id !== void 0 ? id : uniqueId;
105
+ const inputId = id ?? uniqueId;
106
106
  const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('RadioCard', tokens, variant);
107
107
 
108
108
  const getCardTokens = cardState => (0, _Card.selectPressableCardTokens)(getTokens(cardState));
@@ -127,7 +127,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
127
127
  const uniqueFields = ['id'];
128
128
 
129
129
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
130
- throw new Error("RadioCardGroup items must have unique ".concat(uniqueFields.join(', ')));
130
+ throw new Error(`RadioCardGroup items must have unique ${uniqueFields.join(', ')}`);
131
131
  }
132
132
 
133
133
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, {
@@ -157,7 +157,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
157
157
  onChange: itemOnChange,
158
158
  ...itemRest
159
159
  } = _ref2;
160
- const cardId = id || "RadioCard[".concat(index, "]");
160
+ const cardId = id || `RadioCard[${index}]`;
161
161
 
162
162
  const handleChange = (newCheckedState, event) => {
163
163
  if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
@@ -148,7 +148,7 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
148
148
 
149
149
  const a11yLabelText = accessibilityLabel || getCopy('accessibilityLabel'); // Placeholder is optional and may be unset by passing an empty string
150
150
 
151
- const placeholderText = placeholder !== null && placeholder !== void 0 ? placeholder : a11yLabelText;
151
+ const placeholderText = placeholder ?? a11yLabelText;
152
152
  const {
153
153
  nativeID,
154
154
  testID,