@telus-uds/components-base 1.8.3 → 1.8.4

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 (269) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/component-docs.json +1 -1
  3. package/lib/ActivityIndicator/Spinner.js +7 -7
  4. package/lib/ActivityIndicator/Spinner.native.js +2 -2
  5. package/lib/Button/ButtonBase.js +2 -2
  6. package/lib/Button/ButtonGroup.js +1 -1
  7. package/lib/Checkbox/Checkbox.js +1 -1
  8. package/lib/Checkbox/CheckboxGroup.js +2 -2
  9. package/lib/Divider/Divider.js +2 -2
  10. package/lib/ExpandCollapse/Panel.js +2 -17
  11. package/lib/FlexGrid/Col/Col.js +1 -1
  12. package/lib/Icon/Icon.js +1 -1
  13. package/lib/List/List.js +8 -2
  14. package/lib/Pagination/PageButton.js +2 -2
  15. package/lib/Pagination/Pagination.js +5 -3
  16. package/lib/Pagination/usePagination.js +2 -2
  17. package/lib/Progress/ProgressBar.js +3 -3
  18. package/lib/Progress/ProgressBarBackground.js +3 -3
  19. package/lib/Radio/Radio.js +2 -2
  20. package/lib/Radio/RadioGroup.js +2 -2
  21. package/lib/RadioCard/RadioCard.js +1 -1
  22. package/lib/RadioCard/RadioCardGroup.js +2 -2
  23. package/lib/Search/Search.js +1 -1
  24. package/lib/SideNav/SideNav.js +2 -2
  25. package/lib/Skeleton/Skeleton.js +1 -1
  26. package/lib/Skeleton/skeletonWebAnimation.js +1 -1
  27. package/lib/StackView/StackWrap.js +3 -1
  28. package/lib/StackView/getStackedContent.js +2 -2
  29. package/lib/Tabs/Tabs.js +28 -3
  30. package/lib/Tabs/TabsItem.js +5 -6
  31. package/lib/Tags/Tags.js +1 -1
  32. package/lib/ThemeProvider/utils/styles.js +2 -2
  33. package/lib/ThemeProvider/utils/theme-tokens.js +7 -9
  34. package/lib/ToggleSwitch/ToggleSwitch.js +1 -1
  35. package/lib/ToggleSwitch/ToggleSwitchGroup.js +1 -1
  36. package/lib/Tooltip/Backdrop.js +2 -10
  37. package/lib/utils/animation/useVerticalExpandAnimation.js +40 -14
  38. package/lib/utils/children.js +2 -2
  39. package/lib/utils/input.js +6 -12
  40. package/lib/utils/props/componentPropType.js +3 -3
  41. package/lib/utils/props/selectSystemProps.js +2 -2
  42. package/lib/utils/props/tokens.js +2 -2
  43. package/lib/utils/useSpacingScale.js +3 -1
  44. package/lib/utils/useUniqueId.js +1 -1
  45. package/lib-module/A11yInfoProvider/index.js +63 -0
  46. package/lib-module/A11yText/index.js +56 -0
  47. package/lib-module/ActivityIndicator/Spinner.js +77 -0
  48. package/lib-module/ActivityIndicator/Spinner.native.js +144 -0
  49. package/lib-module/ActivityIndicator/index.js +41 -0
  50. package/lib-module/ActivityIndicator/shared.js +12 -0
  51. package/lib-module/BaseProvider/index.js +29 -0
  52. package/lib-module/Box/Box.js +244 -0
  53. package/lib-module/Box/index.js +2 -0
  54. package/lib-module/Button/Button.js +26 -0
  55. package/lib-module/Button/ButtonBase.js +271 -0
  56. package/lib-module/Button/ButtonGroup.js +247 -0
  57. package/lib-module/Button/ButtonLink.js +40 -0
  58. package/lib-module/Button/index.js +4 -0
  59. package/lib-module/Button/propTypes.js +36 -0
  60. package/lib-module/Card/Card.js +84 -0
  61. package/lib-module/Card/CardBase.js +66 -0
  62. package/lib-module/Card/PressableCardBase.js +114 -0
  63. package/lib-module/Card/index.js +4 -0
  64. package/lib-module/Checkbox/Checkbox.js +346 -0
  65. package/lib-module/Checkbox/CheckboxGroup.js +233 -0
  66. package/lib-module/Checkbox/CheckboxInput.js +60 -0
  67. package/lib-module/Checkbox/CheckboxInput.native.js +6 -0
  68. package/lib-module/Checkbox/index.js +3 -0
  69. package/lib-module/Divider/Divider.js +124 -0
  70. package/lib-module/Divider/index.js +2 -0
  71. package/lib-module/ExpandCollapse/Accordion.js +15 -0
  72. package/lib-module/ExpandCollapse/Control.js +136 -0
  73. package/lib-module/ExpandCollapse/ExpandCollapse.js +95 -0
  74. package/lib-module/ExpandCollapse/Panel.js +151 -0
  75. package/lib-module/ExpandCollapse/index.js +7 -0
  76. package/lib-module/Feedback/Feedback.js +157 -0
  77. package/lib-module/Feedback/index.js +2 -0
  78. package/lib-module/Fieldset/Fieldset.js +153 -0
  79. package/lib-module/Fieldset/FieldsetContainer.js +32 -0
  80. package/lib-module/Fieldset/FieldsetContainer.native.js +23 -0
  81. package/lib-module/Fieldset/Legend.js +24 -0
  82. package/lib-module/Fieldset/Legend.native.js +31 -0
  83. package/lib-module/Fieldset/cssReset.js +14 -0
  84. package/lib-module/Fieldset/index.js +2 -0
  85. package/lib-module/FlexGrid/Col/Col.js +276 -0
  86. package/lib-module/FlexGrid/Col/index.js +2 -0
  87. package/lib-module/FlexGrid/FlexGrid.js +148 -0
  88. package/lib-module/FlexGrid/Row/Row.js +184 -0
  89. package/lib-module/FlexGrid/Row/index.js +2 -0
  90. package/lib-module/FlexGrid/helpers/index.js +18 -0
  91. package/lib-module/FlexGrid/index.js +2 -0
  92. package/lib-module/FlexGrid/providers/GutterContext.js +3 -0
  93. package/lib-module/HorizontalScroll/HorizontalScroll.js +175 -0
  94. package/lib-module/HorizontalScroll/HorizontalScrollButton.js +81 -0
  95. package/lib-module/HorizontalScroll/ScrollViewEnd.js +48 -0
  96. package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +27 -0
  97. package/lib-module/HorizontalScroll/dictionary.js +11 -0
  98. package/lib-module/HorizontalScroll/index.js +11 -0
  99. package/lib-module/HorizontalScroll/itemPositions.js +112 -0
  100. package/lib-module/Icon/Icon.js +62 -0
  101. package/lib-module/Icon/IconText.js +83 -0
  102. package/lib-module/Icon/index.js +4 -0
  103. package/lib-module/IconButton/IconButton.js +122 -0
  104. package/lib-module/IconButton/index.js +2 -0
  105. package/lib-module/InputLabel/InputLabel.js +148 -0
  106. package/lib-module/InputLabel/LabelContent.js +27 -0
  107. package/lib-module/InputLabel/LabelContent.native.js +19 -0
  108. package/lib-module/InputLabel/index.js +2 -0
  109. package/lib-module/InputSupports/InputSupports.js +96 -0
  110. package/lib-module/InputSupports/index.js +2 -0
  111. package/lib-module/InputSupports/useInputSupports.js +32 -0
  112. package/lib-module/Link/ChevronLink.js +52 -0
  113. package/lib-module/Link/InlinePressable.js +40 -0
  114. package/lib-module/Link/InlinePressable.native.js +89 -0
  115. package/lib-module/Link/Link.js +28 -0
  116. package/lib-module/Link/LinkBase.js +240 -0
  117. package/lib-module/Link/TextButton.js +35 -0
  118. package/lib-module/Link/index.js +5 -0
  119. package/lib-module/List/List.js +62 -0
  120. package/lib-module/List/ListItem.js +248 -0
  121. package/lib-module/List/index.js +5 -0
  122. package/lib-module/Modal/Modal.js +222 -0
  123. package/lib-module/Modal/dictionary.js +9 -0
  124. package/lib-module/Modal/index.js +2 -0
  125. package/lib-module/Notification/Notification.js +209 -0
  126. package/lib-module/Notification/dictionary.js +8 -0
  127. package/lib-module/Notification/index.js +2 -0
  128. package/lib-module/Pagination/PageButton.js +66 -0
  129. package/lib-module/Pagination/Pagination.js +153 -0
  130. package/lib-module/Pagination/SideButton.js +106 -0
  131. package/lib-module/Pagination/dictionary.js +18 -0
  132. package/lib-module/Pagination/index.js +2 -0
  133. package/lib-module/Pagination/usePagination.js +73 -0
  134. package/lib-module/Progress/Progress.js +89 -0
  135. package/lib-module/Progress/ProgressBar.js +138 -0
  136. package/lib-module/Progress/ProgressBarBackground.js +42 -0
  137. package/lib-module/Progress/index.js +4 -0
  138. package/lib-module/Radio/Radio.js +285 -0
  139. package/lib-module/Radio/RadioButton.js +138 -0
  140. package/lib-module/Radio/RadioGroup.js +243 -0
  141. package/lib-module/Radio/RadioInput.js +62 -0
  142. package/lib-module/Radio/RadioInput.native.js +6 -0
  143. package/lib-module/Radio/index.js +3 -0
  144. package/lib-module/RadioCard/RadioCard.js +219 -0
  145. package/lib-module/RadioCard/RadioCardGroup.js +250 -0
  146. package/lib-module/RadioCard/index.js +3 -0
  147. package/lib-module/Search/Search.js +261 -0
  148. package/lib-module/Search/dictionary.js +12 -0
  149. package/lib-module/Search/index.js +2 -0
  150. package/lib-module/Select/Group.js +21 -0
  151. package/lib-module/Select/Group.native.js +15 -0
  152. package/lib-module/Select/Item.js +20 -0
  153. package/lib-module/Select/Item.native.js +3 -0
  154. package/lib-module/Select/Picker.js +68 -0
  155. package/lib-module/Select/Picker.native.js +120 -0
  156. package/lib-module/Select/Select.js +337 -0
  157. package/lib-module/Select/index.js +6 -0
  158. package/lib-module/SideNav/Item.js +145 -0
  159. package/lib-module/SideNav/ItemContent.js +48 -0
  160. package/lib-module/SideNav/ItemsGroup.js +117 -0
  161. package/lib-module/SideNav/SideNav.js +136 -0
  162. package/lib-module/SideNav/index.js +1 -0
  163. package/lib-module/Skeleton/Skeleton.js +179 -0
  164. package/lib-module/Skeleton/index.js +2 -0
  165. package/lib-module/Skeleton/skeleton.constant.js +3 -0
  166. package/lib-module/Skeleton/skeletonWebAnimation.js +18 -0
  167. package/lib-module/Skeleton/useSkeletonNativeAnimation.js +24 -0
  168. package/lib-module/Spacer/Spacer.js +98 -0
  169. package/lib-module/Spacer/index.js +2 -0
  170. package/lib-module/StackView/StackView.js +125 -0
  171. package/lib-module/StackView/StackWrap.js +50 -0
  172. package/lib-module/StackView/StackWrap.native.js +3 -0
  173. package/lib-module/StackView/StackWrapBox.js +115 -0
  174. package/lib-module/StackView/StackWrapGap.js +59 -0
  175. package/lib-module/StackView/common.js +35 -0
  176. package/lib-module/StackView/getStackedContent.js +124 -0
  177. package/lib-module/StackView/index.js +5 -0
  178. package/lib-module/StepTracker/Step.js +248 -0
  179. package/lib-module/StepTracker/StepTracker.js +185 -0
  180. package/lib-module/StepTracker/dictionary.js +10 -0
  181. package/lib-module/StepTracker/index.js +2 -0
  182. package/lib-module/Tabs/Tabs.js +143 -0
  183. package/lib-module/Tabs/TabsItem.js +224 -0
  184. package/lib-module/Tabs/index.js +2 -0
  185. package/lib-module/Tags/Tags.js +251 -0
  186. package/lib-module/Tags/index.js +2 -0
  187. package/lib-module/TextInput/TextArea.js +94 -0
  188. package/lib-module/TextInput/TextInput.js +72 -0
  189. package/lib-module/TextInput/TextInputBase.js +245 -0
  190. package/lib-module/TextInput/index.js +3 -0
  191. package/lib-module/TextInput/propTypes.js +37 -0
  192. package/lib-module/ThemeProvider/ThemeProvider.js +36 -0
  193. package/lib-module/ThemeProvider/index.js +6 -0
  194. package/lib-module/ThemeProvider/useSetTheme.js +25 -0
  195. package/lib-module/ThemeProvider/useTheme.js +14 -0
  196. package/lib-module/ThemeProvider/useThemeTokens.js +110 -0
  197. package/lib-module/ThemeProvider/utils/index.js +2 -0
  198. package/lib-module/ThemeProvider/utils/styles.js +181 -0
  199. package/lib-module/ThemeProvider/utils/theme-tokens.js +163 -0
  200. package/lib-module/ToggleSwitch/ToggleSwitch.js +250 -0
  201. package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +220 -0
  202. package/lib-module/ToggleSwitch/index.js +3 -0
  203. package/lib-module/Tooltip/Backdrop.js +45 -0
  204. package/lib-module/Tooltip/Backdrop.native.js +44 -0
  205. package/lib-module/Tooltip/Tooltip.js +348 -0
  206. package/lib-module/Tooltip/dictionary.js +8 -0
  207. package/lib-module/Tooltip/getTooltipPosition.js +175 -0
  208. package/lib-module/Tooltip/index.js +2 -0
  209. package/lib-module/TooltipButton/TooltipButton.js +78 -0
  210. package/lib-module/TooltipButton/index.js +2 -0
  211. package/lib-module/Typography/Typography.js +124 -0
  212. package/lib-module/Typography/index.js +2 -0
  213. package/lib-module/ViewportProvider/ViewportProvider.js +29 -0
  214. package/lib-module/ViewportProvider/index.js +3 -0
  215. package/lib-module/ViewportProvider/useViewport.js +3 -0
  216. package/lib-module/ViewportProvider/useViewportListener.js +46 -0
  217. package/lib-module/index.js +48 -0
  218. package/lib-module/utils/a11y/index.js +2 -0
  219. package/lib-module/utils/a11y/semantics.js +157 -0
  220. package/lib-module/utils/a11y/textSize.js +36 -0
  221. package/lib-module/utils/animation/index.js +2 -0
  222. package/lib-module/utils/animation/useVerticalExpandAnimation.js +88 -0
  223. package/lib-module/utils/children.js +119 -0
  224. package/lib-module/utils/containUniqueFields.js +26 -0
  225. package/lib-module/utils/index.js +16 -0
  226. package/lib-module/utils/info/index.js +7 -0
  227. package/lib-module/utils/info/platform/index.js +11 -0
  228. package/lib-module/utils/info/platform/platform.android.js +1 -0
  229. package/lib-module/utils/info/platform/platform.ios.js +1 -0
  230. package/lib-module/utils/info/platform/platform.js +1 -0
  231. package/lib-module/utils/info/platform/platform.native.js +4 -0
  232. package/lib-module/utils/info/versions.js +5 -0
  233. package/lib-module/utils/input.js +179 -0
  234. package/lib-module/utils/pressability.js +111 -0
  235. package/lib-module/utils/props/a11yProps.js +140 -0
  236. package/lib-module/utils/props/clickProps.js +26 -0
  237. package/lib-module/utils/props/componentPropType.js +63 -0
  238. package/lib-module/utils/props/copyPropTypes.js +2 -0
  239. package/lib-module/utils/props/getPropSelector.js +9 -0
  240. package/lib-module/utils/props/handlerProps.js +65 -0
  241. package/lib-module/utils/props/hrefAttrsProp.js +33 -0
  242. package/lib-module/utils/props/index.js +19 -0
  243. package/lib-module/utils/props/inputSupportsProps.js +62 -0
  244. package/lib-module/utils/props/linkProps.js +44 -0
  245. package/lib-module/utils/props/paddingProp.js +9 -0
  246. package/lib-module/utils/props/pressProps.js +42 -0
  247. package/lib-module/utils/props/rectProp.js +9 -0
  248. package/lib-module/utils/props/responsiveProps.js +30 -0
  249. package/lib-module/utils/props/selectSystemProps.js +24 -0
  250. package/lib-module/utils/props/spacingProps.js +56 -0
  251. package/lib-module/utils/props/textInputProps.js +194 -0
  252. package/lib-module/utils/props/textProps.js +59 -0
  253. package/lib-module/utils/props/tokens.js +133 -0
  254. package/lib-module/utils/props/variantProp.js +18 -0
  255. package/lib-module/utils/props/viewProps.js +22 -0
  256. package/lib-module/utils/ssr.js +38 -0
  257. package/lib-module/utils/useCopy.js +44 -0
  258. package/lib-module/utils/useHash.js +45 -0
  259. package/lib-module/utils/useHash.native.js +7 -0
  260. package/lib-module/utils/useResponsiveProp.js +47 -0
  261. package/lib-module/utils/useSpacingScale.js +125 -0
  262. package/lib-module/utils/useUniqueId.js +13 -0
  263. package/lib-module/utils/withLinkRouter.js +83 -0
  264. package/package.json +2 -2
  265. package/src/ExpandCollapse/Panel.jsx +2 -19
  266. package/src/List/List.jsx +6 -2
  267. package/src/Tabs/Tabs.jsx +24 -2
  268. package/src/Tabs/TabsItem.jsx +6 -5
  269. package/src/utils/animation/useVerticalExpandAnimation.js +47 -13
package/CHANGELOG.md CHANGED
@@ -1,12 +1,24 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Wed, 15 Jun 2022 19:23:06 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 22 Jun 2022 15:03:03 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.8.4
8
+
9
+ Wed, 22 Jun 2022 15:03:03 GMT
10
+
11
+ ### Patches
12
+
13
+ - fix published lib-modules (cody.zuschlag@nearform.com)
14
+ - don't override List.Item props with less-specific List props (alan.slater@nearform.com)
15
+ - better tabs roles for tablist/navigation usage (simon.lawrence@nearform.com)
16
+ - better ExpandCollapse style timing (alan.slater@nearform.com)
17
+ - Bump @telus-uds/browserslist-config to v1.0.4
18
+
7
19
  ## 1.8.3
8
20
 
9
- Wed, 15 Jun 2022 19:23:06 GMT
21
+ Wed, 15 Jun 2022 19:23:57 GMT
10
22
 
11
23
  ### Patches
12
24
 
@@ -7043,7 +7043,7 @@
7043
7043
  },
7044
7044
  "Tabs": {
7045
7045
  "docs": {
7046
- "description": "Tabs renders a horizontally-scrolling menu of selectable buttons which may link\nto a page or control what content is displayed on this page.",
7046
+ "description": "Tabs renders a horizontally-scrolling menu of selectable buttons which may link\nto a page or control what content is displayed on this page.\n\nIf you are using Tabs to navigate to a new page (web-only) you should pass\n`navigation`as the `accessibilityRole` to te Tabs component, this will cause\nTabItems to default to a role of link and obtain aria-current behaviour.",
7047
7047
  "props": {
7048
7048
  "items": {
7049
7049
  "defaultValue": {
@@ -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: `${_shared.DURATION}ms`,
26
+ dur: "".concat(_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: `${_shared.BEZIER.join(', ')} ; ${_shared.BEZIER.join(', ')}`
33
+ keySplines: "".concat(_shared.BEZIER.join(', '), " ; ").concat(_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
 
@@ -46,8 +46,8 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
46
46
  } = (0, _A11yInfoProvider.useA11yInfo)();
47
47
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
48
48
  ref: ref,
49
- width: `${size}px`,
50
- height: `${size}px`,
49
+ width: "".concat(size, "px"),
50
+ height: "".concat(size, "px"),
51
51
  viewBox: "0 0 48 48",
52
52
  "aria-valuetext": label,
53
53
  role: "progressbar",
@@ -56,7 +56,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
56
56
  children: [reduceMotionEnabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)("animateTransform", {
57
57
  attributeName: "transform",
58
58
  type: "rotate",
59
- values: `-180 24 24;${360 + _shared.MIN_STROKE_ANGLE - 180} 24 24`,
59
+ values: "-180 24 24;".concat(360 + _shared.MIN_STROKE_ANGLE - 180, " 24 24"),
60
60
  ...animationProps
61
61
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
62
62
  fill: "none",
@@ -71,12 +71,12 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
71
71
  children: reduceMotionEnabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
72
72
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
73
73
  attributeName: "stroke-dashoffset",
74
- values: `0;-10;${MIN_SVG_LENGTH - SVG_CIRCUMFERENCE}`,
74
+ values: "0;-10;".concat(MIN_SVG_LENGTH - SVG_CIRCUMFERENCE),
75
75
  ...animationProps,
76
76
  ...bezierProps
77
77
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
78
78
  attributeName: "stroke-dasharray",
79
- values: `${MIN_SVG_LENGTH}, 200;${MAX_SVG_LENGTH}, 200;${MIN_SVG_LENGTH}, 200`,
79
+ values: "".concat(MIN_SVG_LENGTH, ", 200;").concat(MAX_SVG_LENGTH, ", 200;").concat(MIN_SVG_LENGTH, ", 200"),
80
80
  ...animationProps,
81
81
  ...bezierProps
82
82
  })]
@@ -95,7 +95,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
95
95
  }
96
96
 
97
97
  const direction = index ? -1 : +1;
98
- return `${direction * (180 - (sa + ea)) * easing(progress) + rotation}deg`;
98
+ return "".concat(direction * (180 - (sa + ea)) * easing(progress) + rotation, "deg");
99
99
  });
100
100
  const layerStyle = {
101
101
  width: size,
@@ -110,7 +110,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
110
110
  layerStyle.transform = [{
111
111
  rotate: timer.interpolate({
112
112
  inputRange: [0, 1],
113
- outputRange: [`${0 + ea + sa}deg`, `${2 * 360 + ea + sa}deg`]
113
+ outputRange: ["".concat(0 + ea + sa, "deg"), "".concat(2 * 360 + ea + sa, "deg")]
114
114
  })
115
115
  }];
116
116
  viewportStyle.transform = [{
@@ -98,7 +98,7 @@ const selectOuterWidthStyles = _ref3 => {
98
98
 
99
99
 
100
100
  if (_Platform.default.OS === 'web') {
101
- widthStyles.width = `calc(${width} + ${outerBorderOffset * 2}px)`;
101
+ widthStyles.width = "calc(".concat(width, " + ").concat(outerBorderOffset * 2, "px)");
102
102
  return widthStyles;
103
103
  } // Can't use calc() on native but (unlike on web) flexGrow fills the container width here
104
104
 
@@ -180,7 +180,7 @@ const selectWebOnlyStyles = (inactive, themeTokens, _ref7) => {
180
180
  return _Platform.default.select({
181
181
  web: {
182
182
  // if it would overflow the container, wraps instead
183
- maxWidth: `calc(100% + ${getOuterBorderOffset(themeTokens) * 2}px)`,
183
+ maxWidth: "calc(100% + ".concat(getOuterBorderOffset(themeTokens) * 2, "px)"),
184
184
  outline: 'none',
185
185
  // removes the default browser :focus outline
186
186
  ...(0, _utils2.getCursorStyle)(inactive, accessibilityRole)
@@ -91,7 +91,7 @@ const ButtonGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
91
91
  const uniqueFields = ['id', 'label'];
92
92
 
93
93
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
94
- throw new Error(`ButtonGroup items must have unique ${uniqueFields.join(', ')}`);
94
+ throw new Error("ButtonGroup items must have unique ".concat(uniqueFields.join(', ')));
95
95
  } // Some web screenreaders e.g. MacOS Voiceover don't handle radiogroups properly unless radio is direct child of radiogroup
96
96
 
97
97
 
@@ -214,7 +214,7 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
214
214
  };
215
215
 
216
216
  const uniqueId = (0, _useUniqueId.default)('checkbox');
217
- const inputId = id ?? uniqueId;
217
+ const inputId = id !== null && id !== void 0 ? id : uniqueId;
218
218
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
219
219
  style: staticStyles.wrapper,
220
220
  ref: ref,
@@ -119,7 +119,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
119
119
  const uniqueFields = ['id', 'label'];
120
120
 
121
121
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
122
- throw new Error(`CheckboxGroup items must have unique ${uniqueFields.join(', ')}`);
122
+ throw new Error("CheckboxGroup items must have unique ".concat(uniqueFields.join(', ')));
123
123
  }
124
124
 
125
125
  const checkboxes = items.map((_ref2, index) => {
@@ -130,7 +130,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
130
130
  ref: itemRef,
131
131
  ...itemRest
132
132
  } = _ref2;
133
- const checkboxId = id || `Checkbox[${index}]`;
133
+ const checkboxId = id || "Checkbox[".concat(index, "]");
134
134
 
135
135
  const handleChange = (newCheckedState, event) => {
136
136
  if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
@@ -116,9 +116,9 @@ const Divider = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
116
116
  };
117
117
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
118
118
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, { ...spacerProps,
119
- testID: testID ? `${testID}-Spacer-before` : undefined
119
+ testID: testID ? "".concat(testID, "-Spacer-before") : undefined
120
120
  }), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, { ...spacerProps,
121
- testID: testID ? `${testID}-Spacer-after` : undefined
121
+ testID: testID ? "".concat(testID, "-Spacer-after") : undefined
122
122
  })]
123
123
  });
124
124
  });
@@ -11,8 +11,6 @@ var _Animated = _interopRequireDefault(require("react-native-web/dist/cjs/export
11
11
 
12
12
  var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
13
13
 
14
- var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
15
-
16
14
  var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
17
15
 
18
16
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -105,13 +103,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
105
103
  containerHeight,
106
104
  isExpanded,
107
105
  tokens: themeTokens
108
- }); // on web we can hide the contents until we have the container measured and avoid occasional jitter
109
- // this won't work on native platforms
110
-
111
- const overflowContainerStyles = containerHeight === null && _Platform.default.OS === 'web' ? {
112
- height: 0,
113
- visibility: 'hidden'
114
- } : undefined;
106
+ });
115
107
  const focusabilityProps = isExpanded ? {} : _utils.a11yProps.nonFocusableProps;
116
108
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
117
109
  ref: ref,
@@ -123,7 +115,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
123
115
  children: control
124
116
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
125
117
  ref: animatedRef,
126
- style: [overflowContainerStyles, animatedStyles, staticStyles.itemsContainer],
118
+ style: animatedStyles,
127
119
  ...focusabilityProps,
128
120
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
129
121
  onLayout: onContainerLayout,
@@ -177,12 +169,5 @@ ExpandCollapsePanel.propTypes = { ...selectedSystemPropTypes,
177
169
  */
178
170
  controlTokens: (0, _utils.getTokensPropType)('ExpandCollapseControl')
179
171
  };
180
-
181
- const staticStyles = _StyleSheet.default.create({
182
- itemsContainer: {
183
- overflow: 'hidden'
184
- }
185
- });
186
-
187
172
  var _default = ExpandCollapsePanel;
188
173
  exports.default = _default;
@@ -69,7 +69,7 @@ const Col = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
69
69
  const horizontalAlignLevel = getHorizontalAlignLevel();
70
70
 
71
71
  const toPercent = num => {
72
- return `${num / 12 * 100}%`;
72
+ return "".concat(num / 12 * 100, "%");
73
73
  };
74
74
 
75
75
  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(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' ')
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(' ')
52
52
  },
53
53
  dataSet: dataSet,
54
54
  children: iconContent
package/lib/List/List.js CHANGED
@@ -45,12 +45,18 @@ const List = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
45
45
  } = _ref;
46
46
 
47
47
  const items = _react.Children.map(children, (child, index) => {
48
- if (child.type.name === _ListItem.default.name) {
48
+ var _child$type, _child$type2;
49
+
50
+ // Pass ListItem-specific props to children (by name so teams can add their own ListItems)
51
+ const isListItem = componentName => Boolean(componentName === _ListItem.default.displayName);
52
+
53
+ if (isListItem(child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) || isListItem(child === null || child === void 0 ? void 0 : (_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.name)) {
49
54
  return /*#__PURE__*/(0, _react.cloneElement)(child, {
50
55
  showDivider,
51
56
  isLastItem: index + 1 === _react.Children.count(children),
52
57
  tokens,
53
- variant
58
+ variant,
59
+ ...child.props
54
60
  });
55
61
  }
56
62
 
@@ -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 ? ` ${getCopy('currentLabel')}` : '';
58
- const accessibilityLabel = `${getCopy('goToLabel')} ${label}${activeLabel}`;
57
+ const activeLabel = isActive ? " ".concat(getCopy('currentLabel')) : '';
58
+ const accessibilityLabel = "".concat(getCopy('goToLabel'), " ").concat(label).concat(activeLabel);
59
59
 
60
60
  const {
61
61
  hrefAttrs,
@@ -106,9 +106,11 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
106
106
  LinkRouter: LinkRouter,
107
107
  linkRouterProps: linkRouterProps
108
108
  }), ...items.map((_child, itemIndex) => {
109
- const buttonLabel = `${itemIndex + 1}`;
109
+ var _itemProps$LinkRouter;
110
+
111
+ const buttonLabel = "".concat(itemIndex + 1);
110
112
  const itemProps = getItemProps(itemIndex);
111
- const ItemLinkRouter = itemProps.LinkRouter ?? LinkRouter;
113
+ const ItemLinkRouter = (_itemProps$LinkRouter = itemProps.LinkRouter) !== null && _itemProps$LinkRouter !== void 0 ? _itemProps$LinkRouter : LinkRouter;
112
114
  const itemLinkRouterProps = { ...linkRouterProps,
113
115
  ...itemProps.linkRouterProps
114
116
  };
@@ -144,7 +146,7 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
144
146
  ref: ref,
145
147
  ...selectProps(rest),
146
148
  children: buttons // keep the keys in-line with the page numbers regardless of which buttons are actually rendered
147
- .map((element, index) => [element, `page-${index + 1}`]).filter(_ref3 => {
149
+ .map((element, index) => [element, "page-".concat(index + 1)]).filter(_ref3 => {
148
150
  let [element] = _ref3;
149
151
  return element !== null;
150
152
  }).map(_ref4 => {
@@ -21,7 +21,7 @@ function usePagination(_ref) {
21
21
  );
22
22
 
23
23
  const getItemProps = index => {
24
- var _items$index;
24
+ var _items$index$props, _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 = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props) ?? {};
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 : {};
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: `${percentage}%`
46
+ width: "".concat(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: `${percentage}%`
107
+ text: "".concat(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 ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBarBackground.default, {
115
+ children: children !== null && children !== void 0 ? 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,${source}`
43
+ uri: "data:image/svg+xml,".concat(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 ?? containerPaddingLeft + inputSize + labelMarginLeft,
73
+ marginLeft: descriptionMarginLeft !== null && descriptionMarginLeft !== void 0 ? 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 ?? uniqueId;
177
+ const inputId = id !== null && id !== void 0 ? id : uniqueId;
178
178
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
179
179
  ref: ref,
180
180
  disabled: inactive,
@@ -121,7 +121,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
121
121
  const uniqueFields = ['id', 'label'];
122
122
 
123
123
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
124
- throw new Error(`RadioGroup items must have unique ${uniqueFields.join(', ')}`);
124
+ throw new Error("RadioGroup items must have unique ".concat(uniqueFields.join(', ')));
125
125
  }
126
126
 
127
127
  const radios = items.map((_ref2, index) => {
@@ -132,7 +132,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
132
132
  ref: itemRef,
133
133
  ...itemRest
134
134
  } = _ref2;
135
- const radioId = id || `Radio[${index}]`;
135
+ const radioId = id || "Radio[".concat(index, "]");
136
136
  const isChecked = currentValue === radioId;
137
137
 
138
138
  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 ?? uniqueId;
105
+ const inputId = id !== null && id !== void 0 ? id : uniqueId;
106
106
  const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('RadioCard', tokens, variant);
107
107
 
108
108
  const getCardTokens = cardState => (0, _Card.selectPressableCardTokens)(getTokens(cardState));
@@ -126,7 +126,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
126
126
  const uniqueFields = ['id'];
127
127
 
128
128
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
129
- throw new Error(`RadioCardGroup items must have unique ${uniqueFields.join(', ')}`);
129
+ throw new Error("RadioCardGroup items must have unique ".concat(uniqueFields.join(', ')));
130
130
  }
131
131
 
132
132
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, {
@@ -153,7 +153,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
153
153
  onChange: itemOnChange,
154
154
  ...itemRest
155
155
  } = _ref2;
156
- const cardId = id || `RadioCard[${index}]`;
156
+ const cardId = id || "RadioCard[".concat(index, "]");
157
157
 
158
158
  const handleChange = (newCheckedState, event) => {
159
159
  if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
@@ -158,7 +158,7 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
158
158
 
159
159
  const a11yLabelText = accessibilityLabel || getCopy('accessibilityLabel'); // Placeholder is optional and may be unset by passing an empty string
160
160
 
161
- const placeholderText = placeholder ?? a11yLabelText;
161
+ const placeholderText = placeholder !== null && placeholder !== void 0 ? placeholder : a11yLabelText;
162
162
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
163
163
  style: staticStyles.container,
164
164
  ...selectContainerProps(rest),
@@ -82,7 +82,7 @@ const SideNav = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
82
82
 
83
83
  const renderItem = (item, index, groupId) => {
84
84
  const {
85
- itemId = `item-${index}`,
85
+ itemId = "item-".concat(index),
86
86
  onPress
87
87
  } = item.props;
88
88
 
@@ -110,7 +110,7 @@ const SideNav = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
110
110
 
111
111
  if (child.type === _ItemsGroup.default) {
112
112
  const {
113
- groupId = `group-${index}`
113
+ groupId = "group-".concat(index)
114
114
  } = child.props;
115
115
  const isGroupActive = active.itemId !== undefined && active.groupId === groupId;
116
116
 
@@ -144,7 +144,7 @@ const Skeleton = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
144
144
  style: [selectSkeletonStyles({ ...themeTokens,
145
145
  fadeAnimation: getAnimationBaseOnPlatform()
146
146
  }), getStyledBasedOnShape()]
147
- }, `skeleton-${index + 1}`);
147
+ }, "skeleton-".concat(index + 1));
148
148
  };
149
149
 
150
150
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _skeleton = require("./skeleton.constant");
9
9
 
10
10
  var _default = {
11
- animationDuration: `${_skeleton.ANIMATION_DURATION}ms`,
11
+ animationDuration: "".concat(_skeleton.ANIMATION_DURATION, "ms"),
12
12
  animationTimingFunction: 'ease-in-out',
13
13
  animationDelay: '0.5s',
14
14
  animationIterationCount: 'infinite',
@@ -40,11 +40,13 @@ const exampleGapValue = '1px';
40
40
  */
41
41
 
42
42
  const StackWrap = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
43
+ var _props$gap;
44
+
43
45
  const {
44
46
  space
45
47
  } = props; // Don't apply separate gap if `null` or `undefined`, so can be unset in Storybook etc
46
48
 
47
- const gap = props.gap ?? space;
49
+ const gap = (_props$gap = props.gap) !== null && _props$gap !== void 0 ? _props$gap : space;
48
50
  const canUseCSSGap = _Platform.default.OS === 'web' && gap === space && cssSupports('gap', exampleGapValue);
49
51
  return canUseCSSGap ?
50
52
  /*#__PURE__*/
@@ -65,7 +65,7 @@ const getStackedContent = (children, _ref) => {
65
65
  const validChildren = _react.Children.toArray(topLevelChildren).filter(Boolean);
66
66
 
67
67
  const content = validChildren.reduce((newChildren, child, index) => {
68
- const boxID = `Stack-Box-${index}`;
68
+ const boxID = "Stack-Box-".concat(index);
69
69
  const item = box ?
70
70
  /*#__PURE__*/
71
71
  // If wrapped in Box, that Box needs a key.
@@ -75,7 +75,7 @@ const getStackedContent = (children, _ref) => {
75
75
  testID: boxID
76
76
  }, child) : child;
77
77
  if (!index || !space && !divider) return [...newChildren, item];
78
- const testID = `Stack-${divider ? 'Divider' : 'Spacer'}-${index}`;
78
+ const testID = "Stack-".concat(divider ? 'Divider' : 'Spacer', "-").concat(index);
79
79
  const commonProps = {
80
80
  testID,
81
81
  key: testID,
package/lib/Tabs/Tabs.js CHANGED
@@ -34,12 +34,32 @@ const {
34
34
  selectHorizontalScrollTokens,
35
35
  useItemPositions
36
36
  } = _HorizontalScroll.horizontalScrollUtils;
37
+
38
+ const getDefaultTabItemAccessibilityRole = parentRole => {
39
+ switch (parentRole) {
40
+ case 'tablist':
41
+ return 'tab';
42
+
43
+ case 'navigation':
44
+ return 'link';
45
+
46
+ default:
47
+ return undefined;
48
+ }
49
+ };
37
50
  /**
38
51
  * Tabs renders a horizontally-scrolling menu of selectable buttons which may link
39
52
  * to a page or control what content is displayed on this page.
53
+ *
54
+ * If you are using Tabs to navigate to a new page (web-only) you should pass
55
+ * `navigation`as the `accessibilityRole` to te Tabs component, this will cause
56
+ * TabItems to default to a role of link and obtain aria-current behaviour.
40
57
  */
41
58
 
59
+
42
60
  const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
61
+ var _restProps$accessibil;
62
+
43
63
  let {
44
64
  tokens,
45
65
  itemTokens,
@@ -76,14 +96,17 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
76
96
  const hashId = hashItem && (hashItem.id || hashItem.label);
77
97
  if (hashId) setTimeout(setValue(hashId, event), 500);
78
98
  }, [items, setValue]), isPositioningReady);
99
+ const restProps = selectProps(rest);
100
+ const parentAccessibilityRole = (_restProps$accessibil = restProps.accessibilityRole) !== null && _restProps$accessibil !== void 0 ? _restProps$accessibil : 'tablist';
101
+ const defaultTabItemAccessibiltyRole = getDefaultTabItemAccessibilityRole(parentAccessibilityRole);
79
102
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_HorizontalScroll.default, {
80
103
  ref: ref,
81
104
  ScrollButton: _HorizontalScroll.HorizontalScrollButton,
82
105
  itemPositions: itemPositions,
83
106
  tokens: selectHorizontalScrollTokens(themeTokens),
84
107
  scrollButtonTokens: scrollButtonTokens,
85
- accessibilityRole: "tablist",
86
- ...selectProps(rest),
108
+ accessibilityRole: parentAccessibilityRole,
109
+ ...restProps,
87
110
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
88
111
  space: space,
89
112
  direction: "row",
@@ -92,11 +115,12 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
92
115
  href,
93
116
  label,
94
117
  id,
118
+ accessibilityRole = defaultTabItemAccessibiltyRole,
95
119
  ref: itemRef,
96
120
  LinkRouter: ItemLinkRouter = LinkRouter,
97
121
  linkRouterProps: itemLinkRouterProps
98
122
  } = _ref3;
99
- const itemId = id ?? label;
123
+ const itemId = id !== null && id !== void 0 ? id : label;
100
124
  const isSelected = Boolean(currentValue && currentValue === itemId);
101
125
 
102
126
  const handlePress = event => setValue(itemId, event);
@@ -110,6 +134,7 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
110
134
  selected: isSelected,
111
135
  itemPositions: itemPositions,
112
136
  index: index,
137
+ accessibilityRole: accessibilityRole,
113
138
  LinkRouter: ItemLinkRouter,
114
139
  linkRouterProps: { ...linkRouterProps,
115
140
  ...itemLinkRouterProps
@@ -117,13 +117,11 @@ const TabsItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
117
117
  itemPositions,
118
118
  index,
119
119
  children,
120
- accessibilityRole = href ? 'link' : 'tab',
121
- accessibilityState = _Platform.default.OS === 'web' && accessibilityRole === 'link' ? // Web links can't be aria-selected but can be aria-current
122
- {
123
- current: selected ? 'page' : false
124
- } : {
120
+ accessibilityRole,
121
+ accessibilityCurrent = _Platform.default.OS === 'web' && accessibilityRole === 'link' && selected ? 'page' : undefined,
122
+ accessibilityState = accessibilityRole === 'tab' ? {
125
123
  selected
126
- },
124
+ } : undefined,
127
125
  ...rawRest
128
126
  } = _ref4;
129
127
 
@@ -162,6 +160,7 @@ const TabsItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
162
160
  } : undefined;
163
161
  const selectedProps = selectProps({
164
162
  accessibilityRole,
163
+ accessibilityCurrent,
165
164
  accessibilityState,
166
165
  ...rest
167
166
  });