@telus-uds/components-base 1.8.1 → 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 (288) hide show
  1. package/CHANGELOG.md +35 -2
  2. package/component-docs.json +711 -669
  3. package/lib/A11yInfoProvider/index.js +4 -3
  4. package/lib/A11yText/index.js +6 -5
  5. package/lib/ActivityIndicator/Spinner.js +14 -13
  6. package/lib/ActivityIndicator/Spinner.native.js +10 -8
  7. package/lib/ActivityIndicator/index.js +6 -5
  8. package/lib/ActivityIndicator/shared.js +1 -1
  9. package/lib/BaseProvider/index.js +13 -10
  10. package/lib/Box/Box.js +20 -19
  11. package/lib/Button/Button.js +7 -6
  12. package/lib/Button/ButtonBase.js +97 -79
  13. package/lib/Button/ButtonGroup.js +34 -32
  14. package/lib/Button/ButtonLink.js +9 -7
  15. package/lib/Button/index.js +4 -4
  16. package/lib/Button/propTypes.js +1 -1
  17. package/lib/Card/Card.js +8 -7
  18. package/lib/Card/CardBase.js +35 -31
  19. package/lib/Card/PressableCardBase.js +14 -12
  20. package/lib/Checkbox/Checkbox.js +97 -83
  21. package/lib/Checkbox/CheckboxGroup.js +29 -27
  22. package/lib/Checkbox/CheckboxInput.js +12 -10
  23. package/lib/Divider/Divider.js +10 -9
  24. package/lib/ExpandCollapse/Control.js +42 -36
  25. package/lib/ExpandCollapse/ExpandCollapse.js +11 -10
  26. package/lib/ExpandCollapse/Panel.js +29 -40
  27. package/lib/Feedback/Feedback.js +48 -35
  28. package/lib/Fieldset/Fieldset.js +16 -15
  29. package/lib/Fieldset/FieldsetContainer.js +16 -13
  30. package/lib/Fieldset/FieldsetContainer.native.js +11 -8
  31. package/lib/Fieldset/Legend.js +10 -7
  32. package/lib/Fieldset/Legend.native.js +10 -7
  33. package/lib/FlexGrid/Col/Col.js +18 -17
  34. package/lib/FlexGrid/FlexGrid.js +15 -14
  35. package/lib/FlexGrid/Row/Row.js +13 -12
  36. package/lib/HorizontalScroll/HorizontalScroll.js +25 -20
  37. package/lib/HorizontalScroll/HorizontalScrollButton.js +18 -14
  38. package/lib/HorizontalScroll/ScrollViewEnd.js +6 -5
  39. package/lib/HorizontalScroll/ScrollViewEnd.native.js +12 -9
  40. package/lib/HorizontalScroll/itemPositions.js +19 -13
  41. package/lib/Icon/Icon.js +11 -10
  42. package/lib/Icon/IconText.js +8 -7
  43. package/lib/Icon/index.js +5 -5
  44. package/lib/IconButton/IconButton.js +50 -42
  45. package/lib/InputLabel/InputLabel.js +37 -30
  46. package/lib/InputLabel/LabelContent.js +12 -9
  47. package/lib/InputLabel/LabelContent.native.js +9 -6
  48. package/lib/InputSupports/InputSupports.js +11 -10
  49. package/lib/InputSupports/useInputSupports.js +7 -6
  50. package/lib/Link/ChevronLink.js +9 -8
  51. package/lib/Link/InlinePressable.js +13 -10
  52. package/lib/Link/InlinePressable.native.js +20 -16
  53. package/lib/Link/Link.js +10 -9
  54. package/lib/Link/LinkBase.js +96 -78
  55. package/lib/Link/TextButton.js +9 -8
  56. package/lib/List/List.js +20 -13
  57. package/lib/List/ListItem.js +103 -79
  58. package/lib/Modal/Modal.js +74 -60
  59. package/lib/Notification/Notification.js +46 -33
  60. package/lib/Pagination/PageButton.js +13 -12
  61. package/lib/Pagination/Pagination.js +43 -30
  62. package/lib/Pagination/SideButton.js +21 -18
  63. package/lib/Pagination/usePagination.js +7 -6
  64. package/lib/Progress/Progress.js +23 -19
  65. package/lib/Progress/ProgressBar.js +25 -21
  66. package/lib/Progress/ProgressBarBackground.js +7 -6
  67. package/lib/Radio/Radio.js +80 -69
  68. package/lib/Radio/RadioButton.js +63 -53
  69. package/lib/Radio/RadioGroup.js +30 -28
  70. package/lib/Radio/RadioInput.js +12 -10
  71. package/lib/RadioCard/RadioCard.js +16 -15
  72. package/lib/RadioCard/RadioCardGroup.js +30 -28
  73. package/lib/Search/Search.js +52 -32
  74. package/lib/Select/Group.js +5 -4
  75. package/lib/Select/Group.native.js +4 -3
  76. package/lib/Select/Item.js +10 -7
  77. package/lib/Select/Item.native.js +1 -9
  78. package/lib/Select/Picker.js +16 -15
  79. package/lib/Select/Picker.native.js +49 -38
  80. package/lib/Select/Select.js +134 -113
  81. package/lib/SideNav/Item.js +39 -33
  82. package/lib/SideNav/ItemContent.js +15 -12
  83. package/lib/SideNav/ItemsGroup.js +13 -11
  84. package/lib/SideNav/SideNav.js +21 -18
  85. package/lib/Skeleton/Skeleton.js +60 -44
  86. package/lib/Skeleton/skeleton.constant.js +1 -1
  87. package/lib/Skeleton/skeletonWebAnimation.js +1 -1
  88. package/lib/Spacer/Spacer.js +6 -5
  89. package/lib/StackView/StackView.js +12 -11
  90. package/lib/StackView/StackWrap.js +5 -3
  91. package/lib/StackView/StackWrapBox.js +12 -11
  92. package/lib/StackView/StackWrapGap.js +11 -10
  93. package/lib/StackView/common.js +14 -11
  94. package/lib/StackView/getStackedContent.js +10 -9
  95. package/lib/StackView/index.js +1 -1
  96. package/lib/StepTracker/Step.js +122 -103
  97. package/lib/StepTracker/StepTracker.js +48 -38
  98. package/lib/Tabs/Tabs.js +57 -27
  99. package/lib/Tabs/TabsItem.js +78 -68
  100. package/lib/Tags/Tags.js +68 -62
  101. package/lib/TextInput/TextArea.js +26 -20
  102. package/lib/TextInput/TextInput.js +20 -15
  103. package/lib/TextInput/TextInputBase.js +74 -62
  104. package/lib/TextInput/index.js +4 -4
  105. package/lib/ThemeProvider/ThemeProvider.js +6 -5
  106. package/lib/ThemeProvider/index.js +5 -5
  107. package/lib/ThemeProvider/useSetTheme.js +6 -3
  108. package/lib/ThemeProvider/useThemeTokens.js +7 -2
  109. package/lib/ThemeProvider/utils/styles.js +50 -43
  110. package/lib/ThemeProvider/utils/theme-tokens.js +33 -21
  111. package/lib/ToggleSwitch/ToggleSwitch.js +90 -74
  112. package/lib/ToggleSwitch/ToggleSwitchGroup.js +37 -35
  113. package/lib/Tooltip/Backdrop.js +6 -13
  114. package/lib/Tooltip/Backdrop.native.js +5 -4
  115. package/lib/Tooltip/Tooltip.js +81 -65
  116. package/lib/Tooltip/getTooltipPosition.js +29 -18
  117. package/lib/TooltipButton/TooltipButton.js +28 -21
  118. package/lib/Typography/Typography.js +37 -33
  119. package/lib/ViewportProvider/ViewportProvider.js +4 -3
  120. package/lib/ViewportProvider/useViewportListener.js +6 -3
  121. package/lib/index.js +54 -54
  122. package/lib/utils/a11y/semantics.js +5 -2
  123. package/lib/utils/a11y/textSize.js +8 -6
  124. package/lib/utils/animation/useVerticalExpandAnimation.js +46 -19
  125. package/lib/utils/children.js +4 -3
  126. package/lib/utils/index.js +10 -10
  127. package/lib/utils/input.js +28 -29
  128. package/lib/utils/pressability.js +36 -22
  129. package/lib/utils/props/clickProps.js +2 -1
  130. package/lib/utils/props/componentPropType.js +3 -3
  131. package/lib/utils/props/getPropSelector.js +6 -3
  132. package/lib/utils/props/handlerProps.js +25 -19
  133. package/lib/utils/props/hrefAttrsProp.js +14 -11
  134. package/lib/utils/props/index.js +12 -12
  135. package/lib/utils/props/inputSupportsProps.js +15 -12
  136. package/lib/utils/props/linkProps.js +7 -6
  137. package/lib/utils/props/pressProps.js +1 -1
  138. package/lib/utils/props/selectSystemProps.js +2 -2
  139. package/lib/utils/props/tokens.js +29 -15
  140. package/lib/utils/ssr.js +6 -2
  141. package/lib/utils/useCopy.js +6 -4
  142. package/lib/utils/useHash.js +2 -1
  143. package/lib/utils/useResponsiveProp.js +1 -1
  144. package/lib/utils/useSpacingScale.js +3 -1
  145. package/lib/utils/useUniqueId.js +3 -2
  146. package/lib/utils/withLinkRouter.js +6 -5
  147. package/lib-module/A11yInfoProvider/index.js +4 -3
  148. package/lib-module/A11yText/index.js +6 -5
  149. package/lib-module/ActivityIndicator/Spinner.js +14 -13
  150. package/lib-module/ActivityIndicator/Spinner.native.js +9 -8
  151. package/lib-module/ActivityIndicator/index.js +6 -5
  152. package/lib-module/BaseProvider/index.js +13 -10
  153. package/lib-module/Box/Box.js +20 -19
  154. package/lib-module/Button/Button.js +7 -6
  155. package/lib-module/Button/ButtonBase.js +96 -79
  156. package/lib-module/Button/ButtonGroup.js +34 -32
  157. package/lib-module/Button/ButtonLink.js +8 -7
  158. package/lib-module/Card/Card.js +8 -7
  159. package/lib-module/Card/CardBase.js +35 -31
  160. package/lib-module/Card/PressableCardBase.js +12 -11
  161. package/lib-module/Checkbox/Checkbox.js +97 -83
  162. package/lib-module/Checkbox/CheckboxGroup.js +29 -27
  163. package/lib-module/Checkbox/CheckboxInput.js +12 -10
  164. package/lib-module/Divider/Divider.js +10 -9
  165. package/lib-module/ExpandCollapse/Control.js +42 -36
  166. package/lib-module/ExpandCollapse/ExpandCollapse.js +11 -10
  167. package/lib-module/ExpandCollapse/Panel.js +29 -37
  168. package/lib-module/Feedback/Feedback.js +46 -33
  169. package/lib-module/Fieldset/Fieldset.js +16 -15
  170. package/lib-module/Fieldset/FieldsetContainer.js +16 -13
  171. package/lib-module/Fieldset/FieldsetContainer.native.js +11 -8
  172. package/lib-module/Fieldset/Legend.js +10 -7
  173. package/lib-module/Fieldset/Legend.native.js +10 -7
  174. package/lib-module/FlexGrid/Col/Col.js +18 -17
  175. package/lib-module/FlexGrid/FlexGrid.js +15 -14
  176. package/lib-module/FlexGrid/Row/Row.js +13 -12
  177. package/lib-module/HorizontalScroll/HorizontalScroll.js +24 -19
  178. package/lib-module/HorizontalScroll/HorizontalScrollButton.js +18 -14
  179. package/lib-module/HorizontalScroll/ScrollViewEnd.js +6 -5
  180. package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +12 -9
  181. package/lib-module/HorizontalScroll/itemPositions.js +18 -12
  182. package/lib-module/Icon/Icon.js +10 -9
  183. package/lib-module/Icon/IconText.js +9 -7
  184. package/lib-module/IconButton/IconButton.js +48 -41
  185. package/lib-module/InputLabel/InputLabel.js +37 -30
  186. package/lib-module/InputLabel/LabelContent.js +12 -9
  187. package/lib-module/InputLabel/LabelContent.native.js +9 -6
  188. package/lib-module/InputSupports/InputSupports.js +11 -10
  189. package/lib-module/InputSupports/useInputSupports.js +7 -6
  190. package/lib-module/Link/ChevronLink.js +9 -8
  191. package/lib-module/Link/InlinePressable.js +13 -10
  192. package/lib-module/Link/InlinePressable.native.js +20 -16
  193. package/lib-module/Link/Link.js +10 -9
  194. package/lib-module/Link/LinkBase.js +94 -77
  195. package/lib-module/Link/TextButton.js +9 -8
  196. package/lib-module/List/List.js +20 -13
  197. package/lib-module/List/ListItem.js +103 -78
  198. package/lib-module/Modal/Modal.js +74 -60
  199. package/lib-module/Notification/Notification.js +46 -33
  200. package/lib-module/Pagination/PageButton.js +13 -12
  201. package/lib-module/Pagination/Pagination.js +43 -30
  202. package/lib-module/Pagination/SideButton.js +21 -18
  203. package/lib-module/Pagination/usePagination.js +7 -6
  204. package/lib-module/Progress/Progress.js +23 -19
  205. package/lib-module/Progress/ProgressBar.js +25 -21
  206. package/lib-module/Progress/ProgressBarBackground.js +7 -6
  207. package/lib-module/Radio/Radio.js +80 -69
  208. package/lib-module/Radio/RadioButton.js +62 -52
  209. package/lib-module/Radio/RadioGroup.js +30 -28
  210. package/lib-module/Radio/RadioInput.js +12 -10
  211. package/lib-module/RadioCard/RadioCard.js +16 -15
  212. package/lib-module/RadioCard/RadioCardGroup.js +30 -28
  213. package/lib-module/Search/Search.js +52 -32
  214. package/lib-module/Select/Group.js +5 -4
  215. package/lib-module/Select/Group.native.js +4 -3
  216. package/lib-module/Select/Item.js +10 -7
  217. package/lib-module/Select/Item.native.js +1 -7
  218. package/lib-module/Select/Picker.js +16 -15
  219. package/lib-module/Select/Picker.native.js +46 -36
  220. package/lib-module/Select/Select.js +134 -113
  221. package/lib-module/SideNav/Item.js +39 -33
  222. package/lib-module/SideNav/ItemContent.js +14 -11
  223. package/lib-module/SideNav/ItemsGroup.js +13 -11
  224. package/lib-module/SideNav/SideNav.js +21 -18
  225. package/lib-module/Skeleton/Skeleton.js +60 -44
  226. package/lib-module/Skeleton/skeletonWebAnimation.js +1 -1
  227. package/lib-module/Spacer/Spacer.js +6 -5
  228. package/lib-module/StackView/StackView.js +12 -11
  229. package/lib-module/StackView/StackWrap.js +5 -3
  230. package/lib-module/StackView/StackWrapBox.js +12 -11
  231. package/lib-module/StackView/StackWrapGap.js +11 -10
  232. package/lib-module/StackView/common.js +14 -11
  233. package/lib-module/StackView/getStackedContent.js +10 -9
  234. package/lib-module/StepTracker/Step.js +122 -103
  235. package/lib-module/StepTracker/StepTracker.js +48 -38
  236. package/lib-module/Tabs/Tabs.js +57 -27
  237. package/lib-module/Tabs/TabsItem.js +77 -68
  238. package/lib-module/Tags/Tags.js +68 -62
  239. package/lib-module/TextInput/TextArea.js +26 -20
  240. package/lib-module/TextInput/TextInput.js +19 -15
  241. package/lib-module/TextInput/TextInputBase.js +74 -62
  242. package/lib-module/ThemeProvider/ThemeProvider.js +5 -4
  243. package/lib-module/ThemeProvider/useSetTheme.js +6 -3
  244. package/lib-module/ThemeProvider/useThemeTokens.js +7 -2
  245. package/lib-module/ThemeProvider/utils/styles.js +48 -41
  246. package/lib-module/ThemeProvider/utils/theme-tokens.js +32 -20
  247. package/lib-module/ToggleSwitch/ToggleSwitch.js +90 -74
  248. package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +37 -35
  249. package/lib-module/Tooltip/Backdrop.js +6 -13
  250. package/lib-module/Tooltip/Backdrop.native.js +5 -4
  251. package/lib-module/Tooltip/Tooltip.js +81 -65
  252. package/lib-module/Tooltip/getTooltipPosition.js +29 -18
  253. package/lib-module/TooltipButton/TooltipButton.js +28 -21
  254. package/lib-module/Typography/Typography.js +35 -31
  255. package/lib-module/ViewportProvider/ViewportProvider.js +4 -3
  256. package/lib-module/ViewportProvider/useViewportListener.js +6 -3
  257. package/lib-module/utils/a11y/semantics.js +4 -1
  258. package/lib-module/utils/a11y/textSize.js +7 -5
  259. package/lib-module/utils/animation/useVerticalExpandAnimation.js +47 -20
  260. package/lib-module/utils/children.js +4 -3
  261. package/lib-module/utils/input.js +28 -29
  262. package/lib-module/utils/pressability.js +35 -21
  263. package/lib-module/utils/props/clickProps.js +2 -1
  264. package/lib-module/utils/props/componentPropType.js +3 -3
  265. package/lib-module/utils/props/getPropSelector.js +6 -3
  266. package/lib-module/utils/props/handlerProps.js +24 -18
  267. package/lib-module/utils/props/hrefAttrsProp.js +14 -11
  268. package/lib-module/utils/props/inputSupportsProps.js +15 -12
  269. package/lib-module/utils/props/linkProps.js +7 -6
  270. package/lib-module/utils/props/selectSystemProps.js +2 -2
  271. package/lib-module/utils/props/tokens.js +27 -14
  272. package/lib-module/utils/ssr.js +5 -2
  273. package/lib-module/utils/useCopy.js +6 -4
  274. package/lib-module/utils/useHash.js +2 -1
  275. package/lib-module/utils/useSpacingScale.js +3 -1
  276. package/lib-module/utils/useUniqueId.js +3 -2
  277. package/lib-module/utils/withLinkRouter.js +6 -5
  278. package/package.json +13 -11
  279. package/src/ExpandCollapse/Panel.jsx +2 -19
  280. package/src/List/List.jsx +34 -19
  281. package/src/List/ListItem.jsx +12 -2
  282. package/src/Modal/Modal.jsx +2 -1
  283. package/src/Pagination/Pagination.jsx +3 -0
  284. package/src/Search/Search.jsx +11 -0
  285. package/src/Select/Item.native.jsx +0 -7
  286. package/src/Tabs/Tabs.jsx +24 -2
  287. package/src/Tabs/TabsItem.jsx +6 -5
  288. package/src/utils/animation/useVerticalExpandAnimation.js +47 -13
@@ -10,30 +10,31 @@ const MIN_SVG_LENGTH = MIN_STROKE_ANGLE / 360 * SVG_CIRCUMFERENCE;
10
10
  const MAX_SVG_LENGTH = (1 - MIN_EMPTY_ANGLE / 360) * SVG_CIRCUMFERENCE;
11
11
  const animationProps = {
12
12
  begin: '0s',
13
- dur: `${DURATION}ms`,
13
+ dur: "".concat(DURATION, "ms"),
14
14
  fill: 'freeze',
15
15
  repeatCount: 'indefinite'
16
16
  };
17
17
  const bezierProps = {
18
18
  calcMode: 'spline',
19
19
  keyTimes: '0; 0.5; 1',
20
- keySplines: `${BEZIER.join(', ')} ; ${BEZIER.join(', ')}`
20
+ keySplines: "".concat(BEZIER.join(', '), " ; ").concat(BEZIER.join(', '))
21
21
  }; // We're using svg rather than css here to define the animation to avoid needing to introduce css injection mechanism
22
22
  // 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.
23
23
 
24
- const Spinner = /*#__PURE__*/forwardRef(({
25
- size,
26
- color,
27
- thickness,
28
- label
29
- }, ref) => {
24
+ const Spinner = /*#__PURE__*/forwardRef((_ref, ref) => {
25
+ let {
26
+ size,
27
+ color,
28
+ thickness,
29
+ label
30
+ } = _ref;
30
31
  const {
31
32
  reduceMotionEnabled
32
33
  } = useA11yInfo();
33
34
  return /*#__PURE__*/_jsx("svg", {
34
35
  ref: ref,
35
- width: `${size}px`,
36
- height: `${size}px`,
36
+ width: "".concat(size, "px"),
37
+ height: "".concat(size, "px"),
37
38
  viewBox: "0 0 48 48",
38
39
  "aria-valuetext": label,
39
40
  role: "progressbar",
@@ -42,7 +43,7 @@ const Spinner = /*#__PURE__*/forwardRef(({
42
43
  children: [reduceMotionEnabled ? null : /*#__PURE__*/_jsx("animateTransform", {
43
44
  attributeName: "transform",
44
45
  type: "rotate",
45
- values: `-180 24 24;${360 + MIN_STROKE_ANGLE - 180} 24 24`,
46
+ values: "-180 24 24;".concat(360 + MIN_STROKE_ANGLE - 180, " 24 24"),
46
47
  ...animationProps
47
48
  }), /*#__PURE__*/_jsx("circle", {
48
49
  fill: "none",
@@ -57,12 +58,12 @@ const Spinner = /*#__PURE__*/forwardRef(({
57
58
  children: reduceMotionEnabled ? null : /*#__PURE__*/_jsxs(_Fragment, {
58
59
  children: [/*#__PURE__*/_jsx("animate", {
59
60
  attributeName: "stroke-dashoffset",
60
- values: `0;-10;${MIN_SVG_LENGTH - SVG_CIRCUMFERENCE}`,
61
+ values: "0;-10;".concat(MIN_SVG_LENGTH - SVG_CIRCUMFERENCE),
61
62
  ...animationProps,
62
63
  ...bezierProps
63
64
  }), /*#__PURE__*/_jsx("animate", {
64
65
  attributeName: "stroke-dasharray",
65
- values: `${MIN_SVG_LENGTH}, 200;${MAX_SVG_LENGTH}, 200;${MIN_SVG_LENGTH}, 200`,
66
+ values: "".concat(MIN_SVG_LENGTH, ", 200;").concat(MAX_SVG_LENGTH, ", 200;").concat(MIN_SVG_LENGTH, ", 200"),
66
67
  ...animationProps,
67
68
  ...bezierProps
68
69
  })]
@@ -8,12 +8,13 @@ import { useA11yInfo } from '../A11yInfoProvider';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  const ea = MIN_EMPTY_ANGLE / 2;
10
10
  const sa = MIN_STROKE_ANGLE / 2;
11
- const Spinner = /*#__PURE__*/forwardRef(({
12
- size,
13
- color,
14
- thickness,
15
- label
16
- }, ref) => {
11
+ const Spinner = /*#__PURE__*/forwardRef((_ref, ref) => {
12
+ let {
13
+ size,
14
+ color,
15
+ thickness,
16
+ label
17
+ } = _ref;
17
18
  const {
18
19
  current: timer
19
20
  } = React.useRef(new Animated.Value(0));
@@ -66,7 +67,7 @@ const Spinner = /*#__PURE__*/forwardRef(({
66
67
  }
67
68
 
68
69
  const direction = index ? -1 : +1;
69
- return `${direction * (180 - (sa + ea)) * easing(progress) + rotation}deg`;
70
+ return "".concat(direction * (180 - (sa + ea)) * easing(progress) + rotation, "deg");
70
71
  });
71
72
  const layerStyle = {
72
73
  width: size,
@@ -81,7 +82,7 @@ const Spinner = /*#__PURE__*/forwardRef(({
81
82
  layerStyle.transform = [{
82
83
  rotate: timer.interpolate({
83
84
  inputRange: [0, 1],
84
- outputRange: [`${0 + ea + sa}deg`, `${2 * 360 + ea + sa}deg`]
85
+ outputRange: ["".concat(0 + ea + sa, "deg"), "".concat(2 * 360 + ea + sa, "deg")]
85
86
  })
86
87
  }];
87
88
  viewportStyle.transform = [{
@@ -10,11 +10,12 @@ import Spinner from './Spinner';
10
10
 
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
 
13
- const ActivityIndicator = ({
14
- variant,
15
- tokens,
16
- label
17
- }) => {
13
+ const ActivityIndicator = _ref => {
14
+ let {
15
+ variant,
16
+ tokens,
17
+ label
18
+ } = _ref;
18
19
  const {
19
20
  size,
20
21
  color,
@@ -7,17 +7,20 @@ import ViewportProvider from '../ViewportProvider';
7
7
  import ThemeProvider from '../ThemeProvider';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
 
10
- const BaseProvider = ({
11
- defaultTheme,
12
- children
13
- }) => /*#__PURE__*/_jsx(A11yInfoProvider, {
14
- children: /*#__PURE__*/_jsx(ViewportProvider, {
15
- children: /*#__PURE__*/_jsx(ThemeProvider, {
16
- defaultTheme: defaultTheme,
17
- children: children
10
+ const BaseProvider = _ref => {
11
+ let {
12
+ defaultTheme,
13
+ children
14
+ } = _ref;
15
+ return /*#__PURE__*/_jsx(A11yInfoProvider, {
16
+ children: /*#__PURE__*/_jsx(ViewportProvider, {
17
+ children: /*#__PURE__*/_jsx(ThemeProvider, {
18
+ defaultTheme: defaultTheme,
19
+ children: children
20
+ })
18
21
  })
19
- })
20
- });
22
+ });
23
+ };
21
24
 
22
25
  BaseProvider.propTypes = {
23
26
  defaultTheme: (_ThemeProvider$propTy = ThemeProvider.propTypes) === null || _ThemeProvider$propTy === void 0 ? void 0 : _ThemeProvider$propTy.defaultTheme,
@@ -93,25 +93,26 @@ const selectBoxStyles = tokens => {
93
93
  */
94
94
 
95
95
 
96
- const Box = /*#__PURE__*/forwardRef(({
97
- space,
98
- horizontal = space,
99
- vertical = space,
100
- top = vertical,
101
- bottom = vertical,
102
- left = horizontal,
103
- right = horizontal,
104
- flex,
105
- children,
106
- variant,
107
- tokens,
108
- scroll,
109
- tag,
110
- accessibilityRole,
111
- testID,
112
- dataSet,
113
- ...rest
114
- }, ref) => {
96
+ const Box = /*#__PURE__*/forwardRef((_ref, ref) => {
97
+ let {
98
+ space,
99
+ horizontal = space,
100
+ vertical = space,
101
+ top = vertical,
102
+ bottom = vertical,
103
+ left = horizontal,
104
+ right = horizontal,
105
+ flex,
106
+ children,
107
+ variant,
108
+ tokens,
109
+ scroll,
110
+ tag,
111
+ accessibilityRole,
112
+ testID,
113
+ dataSet,
114
+ ...rest
115
+ } = _ref;
115
116
  const props = { ...getA11yPropsFromHtmlTag(tag, accessibilityRole),
116
117
  ...selectProps(rest)
117
118
  };
@@ -4,12 +4,13 @@ import buttonPropTypes, { textAndA11yText } from './propTypes';
4
4
  import { useThemeTokensCallback } from '../ThemeProvider';
5
5
  import { a11yProps } from '../utils/props';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
- const Button = /*#__PURE__*/forwardRef(({
8
- accessibilityRole = 'button',
9
- tokens,
10
- variant,
11
- ...props
12
- }, ref) => {
7
+ const Button = /*#__PURE__*/forwardRef((_ref, ref) => {
8
+ let {
9
+ accessibilityRole = 'button',
10
+ tokens,
11
+ variant,
12
+ ...props
13
+ } = _ref;
13
14
  const getTokens = useThemeTokensCallback('Button', tokens, variant);
14
15
  return /*#__PURE__*/_jsx(ButtonBase, { ...props,
15
16
  tokens: getTokens,
@@ -10,36 +10,43 @@ import { a11yProps, clickProps, focusHandlerProps, getCursorStyle, linkProps, re
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, linkProps, viewProps]);
12
12
 
13
- const getOuterBorderOffset = ({
14
- outerBorderGap = 0,
15
- outerBorderWidth = 0
16
- }) => outerBorderGap + outerBorderWidth;
17
-
18
- const selectOuterContainerStyles = ({
19
- alignSelf,
20
- opacity,
21
- outerBorderColor,
22
- outerBorderWidth,
23
- outerBorderGap,
24
- borderRadius,
25
- outerBackgroundColor
26
- }) => ({
27
- alignSelf,
28
- backgroundColor: outerBackgroundColor,
29
- opacity,
30
- ...applyOuterBorder({
31
- outerBorderGap,
32
- outerBorderWidth,
13
+ const getOuterBorderOffset = _ref => {
14
+ let {
15
+ outerBorderGap = 0,
16
+ outerBorderWidth = 0
17
+ } = _ref;
18
+ return outerBorderGap + outerBorderWidth;
19
+ };
20
+
21
+ const selectOuterContainerStyles = _ref2 => {
22
+ let {
23
+ alignSelf,
24
+ opacity,
33
25
  outerBorderColor,
34
- borderRadius
35
- })
36
- });
26
+ outerBorderWidth,
27
+ outerBorderGap,
28
+ borderRadius,
29
+ outerBackgroundColor
30
+ } = _ref2;
31
+ return {
32
+ alignSelf,
33
+ backgroundColor: outerBackgroundColor,
34
+ opacity,
35
+ ...applyOuterBorder({
36
+ outerBorderGap,
37
+ outerBorderWidth,
38
+ outerBorderColor,
39
+ borderRadius
40
+ })
41
+ };
42
+ };
37
43
 
38
- const selectOuterWidthStyles = ({
39
- outerBorderGap,
40
- outerBorderWidth,
41
- width
42
- }) => {
44
+ const selectOuterWidthStyles = _ref3 => {
45
+ let {
46
+ outerBorderGap,
47
+ outerBorderWidth,
48
+ width
49
+ } = _ref3;
43
50
  // The inner container's bounding box is the bounding box of the button overall
44
51
  // so this many device pixels will sit outside of the overall bounding box
45
52
  const outerBorderOffset = getOuterBorderOffset({
@@ -68,7 +75,7 @@ const selectOuterWidthStyles = ({
68
75
 
69
76
 
70
77
  if (Platform.OS === 'web') {
71
- widthStyles.width = `calc(${width} + ${outerBorderOffset * 2}px)`;
78
+ widthStyles.width = "calc(".concat(width, " + ").concat(outerBorderOffset * 2, "px)");
72
79
  return widthStyles;
73
80
  } // Can't use calc() on native but (unlike on web) flexGrow fills the container width here
74
81
 
@@ -84,16 +91,18 @@ const selectOuterWidthStyles = ({
84
91
  return widthStyles;
85
92
  };
86
93
 
87
- const selectInnerContainerStyles = ({
88
- backgroundColor,
89
- paddingLeft,
90
- paddingRight,
91
- paddingTop,
92
- paddingBottom,
93
- shadow,
94
- borderWidth,
95
- minWidth
96
- }) => {
94
+ const selectInnerContainerStyles = _ref4 => {
95
+ let {
96
+ backgroundColor,
97
+ paddingLeft,
98
+ paddingRight,
99
+ paddingTop,
100
+ paddingBottom,
101
+ shadow,
102
+ borderWidth,
103
+ minWidth
104
+ } = _ref4;
105
+
97
106
  // Subtract border width from padding so overall button width/height doesn't
98
107
  // jump around if the border width changes (avoiding NaN and negative padding)
99
108
  const offsetBorder = value => typeof value === 'number' && typeof borderWidth === 'number' ? Math.max(0, value - borderWidth) : value;
@@ -109,39 +118,46 @@ const selectInnerContainerStyles = ({
109
118
  };
110
119
  };
111
120
 
112
- const selectBorderStyles = ({
113
- borderColor,
114
- borderWidth,
115
- borderRadius
116
- }) => ({
117
- borderColor,
118
- borderWidth,
119
- borderRadius
120
- });
121
+ const selectBorderStyles = _ref5 => {
122
+ let {
123
+ borderColor,
124
+ borderWidth,
125
+ borderRadius
126
+ } = _ref5;
127
+ return {
128
+ borderColor,
129
+ borderWidth,
130
+ borderRadius
131
+ };
132
+ };
121
133
 
122
- const selectTextStyles = ({
123
- fontSize,
124
- color,
125
- lineHeight,
126
- fontName,
127
- fontWeight,
128
- textAlign
129
- }) => applyTextStyles({
130
- fontSize,
131
- color,
132
- lineHeight,
133
- fontName,
134
- fontWeight,
135
- textAlign
136
- });
134
+ const selectTextStyles = _ref6 => {
135
+ let {
136
+ fontSize,
137
+ color,
138
+ lineHeight,
139
+ fontName,
140
+ fontWeight,
141
+ textAlign
142
+ } = _ref6;
143
+ return applyTextStyles({
144
+ fontSize,
145
+ color,
146
+ lineHeight,
147
+ fontName,
148
+ fontWeight,
149
+ textAlign
150
+ });
151
+ };
137
152
 
138
- const selectWebOnlyStyles = (inactive, themeTokens, {
139
- accessibilityRole
140
- }) => {
153
+ const selectWebOnlyStyles = (inactive, themeTokens, _ref7) => {
154
+ let {
155
+ accessibilityRole
156
+ } = _ref7;
141
157
  return Platform.select({
142
158
  web: {
143
159
  // if it would overflow the container, wraps instead
144
- maxWidth: `calc(100% + ${getOuterBorderOffset(themeTokens) * 2}px)`,
160
+ maxWidth: "calc(100% + ".concat(getOuterBorderOffset(themeTokens) * 2, "px)"),
145
161
  outline: 'none',
146
162
  // removes the default browser :focus outline
147
163
  ...getCursorStyle(inactive, accessibilityRole)
@@ -150,18 +166,19 @@ const selectWebOnlyStyles = (inactive, themeTokens, {
150
166
  });
151
167
  };
152
168
 
153
- const ButtonBase = /*#__PURE__*/forwardRef(({
154
- id,
155
- href,
156
- hrefAttrs,
157
- children,
158
- tokens = {},
159
- disabled = false,
160
- // alias for inactive
161
- inactive = disabled,
162
- selected = false,
163
- ...rawRest
164
- }, ref) => {
169
+ const ButtonBase = /*#__PURE__*/forwardRef((_ref8, ref) => {
170
+ let {
171
+ id,
172
+ href,
173
+ hrefAttrs,
174
+ children,
175
+ tokens = {},
176
+ disabled = false,
177
+ // alias for inactive
178
+ inactive = disabled,
179
+ selected = false,
180
+ ...rawRest
181
+ } = _ref8;
165
182
  const {
166
183
  onPress,
167
184
  ...rest
@@ -12,30 +12,31 @@ import { getPressHandlersWithArgs } from '../utils/pressability';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
14
14
  const [selectItemProps, selectedItemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, pressProps, viewProps]);
15
- const ButtonGroup = /*#__PURE__*/forwardRef(({
16
- variant,
17
- tokens,
18
- items = [],
19
- values,
20
- initialValues,
21
- maxValues = 1,
22
- onChange,
23
- readOnly = false,
24
- inactive = false,
25
- legend,
26
- tooltip,
27
- hint,
28
- validation,
29
- feedback,
30
- name: inputGroupName,
31
- copy,
32
- accessibilityRole = maxValues === 1 ? 'radiogroup' // radiogroup is cross-platform; only web aria has generic groups
33
- : Platform.select({
34
- web: 'group',
35
- default: 'none'
36
- }),
37
- ...rest
38
- }, ref) => {
15
+ const ButtonGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
16
+ let {
17
+ variant,
18
+ tokens,
19
+ items = [],
20
+ values,
21
+ initialValues,
22
+ maxValues = 1,
23
+ onChange,
24
+ readOnly = false,
25
+ inactive = false,
26
+ legend,
27
+ tooltip,
28
+ hint,
29
+ validation,
30
+ feedback,
31
+ name: inputGroupName,
32
+ copy,
33
+ accessibilityRole = maxValues === 1 ? 'radiogroup' // radiogroup is cross-platform; only web aria has generic groups
34
+ : Platform.select({
35
+ web: 'group',
36
+ default: 'none'
37
+ }),
38
+ ...rest
39
+ } = _ref;
39
40
  const viewport = useViewport();
40
41
  const themeTokens = useThemeTokens('ButtonGroup', tokens, variant, {
41
42
  viewport
@@ -65,7 +66,7 @@ const ButtonGroup = /*#__PURE__*/forwardRef(({
65
66
  const uniqueFields = ['id', 'label'];
66
67
 
67
68
  if (!containUniqueFields(items, uniqueFields)) {
68
- throw new Error(`ButtonGroup items must have unique ${uniqueFields.join(', ')}`);
69
+ throw new Error("ButtonGroup items must have unique ".concat(uniqueFields.join(', ')));
69
70
  } // Some web screenreaders e.g. MacOS Voiceover don't handle radiogroups properly unless radio is direct child of radiogroup
70
71
 
71
72
 
@@ -89,13 +90,14 @@ const ButtonGroup = /*#__PURE__*/forwardRef(({
89
90
  direction: direction,
90
91
  tokens: stackTokens,
91
92
  ref: ref,
92
- children: items.map(({
93
- label,
94
- id = label,
95
- accessibilityLabel,
96
- ref: itemRef,
97
- ...itemRest
98
- }, index) => {
93
+ children: items.map((_ref2, index) => {
94
+ let {
95
+ label,
96
+ id = label,
97
+ accessibilityLabel,
98
+ ref: itemRef,
99
+ ...itemRest
100
+ } = _ref2;
99
101
  const isSelected = currentValues.includes(id); // Pass an object of relevant component state as first argument for any passed-in press handlers
100
102
 
101
103
  const pressHandlers = getPressHandlersWithArgs(rest, [{
@@ -9,13 +9,14 @@ import { useThemeTokensCallback } from '../ThemeProvider';
9
9
  */
10
10
 
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- const ButtonLink = /*#__PURE__*/forwardRef(({
13
- accessibilityRole = 'link',
14
- tokens,
15
- variant,
16
- dataSet,
17
- ...props
18
- }, ref) => {
12
+ const ButtonLink = /*#__PURE__*/forwardRef((_ref, ref) => {
13
+ let {
14
+ accessibilityRole = 'link',
15
+ tokens,
16
+ variant,
17
+ dataSet,
18
+ ...props
19
+ } = _ref;
19
20
  const {
20
21
  hrefAttrs,
21
22
  rest
@@ -56,13 +56,14 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
56
56
  * depending on what you are trying to achieve.
57
57
  */
58
58
 
59
- const Card = ({
60
- children,
61
- tokens,
62
- variant,
63
- dataSet,
64
- ...rest
65
- }) => {
59
+ const Card = _ref => {
60
+ let {
61
+ children,
62
+ tokens,
63
+ variant,
64
+ dataSet,
65
+ ...rest
66
+ } = _ref;
66
67
  const viewport = useViewport();
67
68
  const themeTokens = useThemeTokens('Card', tokens, variant, {
68
69
  viewport
@@ -7,43 +7,47 @@ import { a11yProps, viewProps, selectSystemProps } from '../utils/props';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]); // Ensure explicit selection of tokens
9
9
 
10
- const selectStyles = ({
11
- flex,
12
- backgroundColor,
13
- borderColor,
14
- borderRadius,
15
- borderWidth,
16
- paddingBottom,
17
- paddingLeft,
18
- paddingRight,
19
- paddingTop,
20
- minWidth,
21
- shadow
22
- }) => ({
23
- flex,
24
- backgroundColor,
25
- borderColor,
26
- borderRadius,
27
- borderWidth,
28
- paddingBottom,
29
- paddingLeft,
30
- paddingRight,
31
- paddingTop,
32
- minWidth,
33
- ...applyShadowToken(shadow)
34
- });
10
+ const selectStyles = _ref => {
11
+ let {
12
+ flex,
13
+ backgroundColor,
14
+ borderColor,
15
+ borderRadius,
16
+ borderWidth,
17
+ paddingBottom,
18
+ paddingLeft,
19
+ paddingRight,
20
+ paddingTop,
21
+ minWidth,
22
+ shadow
23
+ } = _ref;
24
+ return {
25
+ flex,
26
+ backgroundColor,
27
+ borderColor,
28
+ borderRadius,
29
+ borderWidth,
30
+ paddingBottom,
31
+ paddingLeft,
32
+ paddingRight,
33
+ paddingTop,
34
+ minWidth,
35
+ ...applyShadowToken(shadow)
36
+ };
37
+ };
35
38
  /**
36
39
  * A themeless base component for Card which components can apply theme tokens to. Not
37
40
  * intended to be used in apps or sites directly: build themed components on top of this.
38
41
  */
39
42
 
40
43
 
41
- const CardBase = /*#__PURE__*/forwardRef(({
42
- children,
43
- tokens,
44
- dataSet,
45
- ...rest
46
- }, ref) => {
44
+ const CardBase = /*#__PURE__*/forwardRef((_ref2, ref) => {
45
+ let {
46
+ children,
47
+ tokens,
48
+ dataSet,
49
+ ...rest
50
+ } = _ref2;
47
51
  const cardStyle = selectStyles(typeof tokens === 'function' ? tokens() : tokens);
48
52
  const props = selectProps(rest);
49
53
  return /*#__PURE__*/_jsx(View, {