@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,11 +10,12 @@ import dictionary from './dictionary';
10
10
  import useCopy from '../utils/useCopy';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
 
13
- const selectIconTokens = ({
14
- color,
15
- iconSize,
16
- iconDisplace
17
- }, direction) => {
13
+ const selectIconTokens = (_ref, direction) => {
14
+ let {
15
+ color,
16
+ iconSize,
17
+ iconDisplace
18
+ } = _ref;
18
19
  return {
19
20
  color,
20
21
  size: iconSize,
@@ -26,15 +27,16 @@ const directionToSide = {
26
27
  previous: 'left',
27
28
  next: 'right'
28
29
  };
29
- const SideButton = /*#__PURE__*/forwardRef(({
30
- direction = 'previous',
31
- onPress,
32
- href,
33
- copy,
34
- variant,
35
- tokens,
36
- ...props
37
- }, ref) => {
30
+ const SideButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
31
+ let {
32
+ direction = 'previous',
33
+ onPress,
34
+ href,
35
+ copy,
36
+ variant,
37
+ tokens,
38
+ ...props
39
+ } = _ref2;
38
40
  const viewport = useViewport();
39
41
  const buttonVariant = {
40
42
  direction,
@@ -74,10 +76,11 @@ const SideButton = /*#__PURE__*/forwardRef(({
74
76
  ref: ref,
75
77
  ...buttonProps,
76
78
  tokens: getButtonTokens,
77
- children: ({
78
- textStyles,
79
- ...buttonState
80
- }) => {
79
+ children: _ref3 => {
80
+ let {
81
+ textStyles,
82
+ ...buttonState
83
+ } = _ref3;
81
84
  const iconProps = {
82
85
  tokens: getIconTokens(buttonState)
83
86
  };
@@ -5,15 +5,16 @@
5
5
  * @param {React.Element[]} items
6
6
  * @param {number} truncateAbove
7
7
  */
8
- function usePagination({
9
- items,
10
- truncateAbove
11
- }) {
8
+ function usePagination(_ref) {
9
+ let {
10
+ items,
11
+ truncateAbove
12
+ } = _ref;
12
13
  const activeItemIndex = Math.max(items.findIndex(item => item.props.isActive), 0 // default to the first item if none is marked as active
13
14
  );
14
15
 
15
16
  const getItemProps = index => {
16
- var _items$index;
17
+ var _items$index$props, _items$index;
17
18
 
18
19
  const {
19
20
  onPress,
@@ -21,7 +22,7 @@ function usePagination({
21
22
  hrefAttrs,
22
23
  variant,
23
24
  tokens
24
- } = ((_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props) ?? {};
25
+ } = (_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 : {};
25
26
  return {
26
27
  onPress,
27
28
  href,
@@ -6,19 +6,22 @@ import { a11yProps, getTokensPropType, selectSystemProps, variantProp, viewProps
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
8
8
 
9
- const selectProgressStyles = ({
10
- backgroundColor,
11
- borderWidth,
12
- borderColor,
13
- borderRadius,
14
- height
15
- }) => ({
16
- backgroundColor,
17
- borderWidth,
18
- borderColor,
19
- borderRadius,
20
- height
21
- });
9
+ const selectProgressStyles = _ref => {
10
+ let {
11
+ backgroundColor,
12
+ borderWidth,
13
+ borderColor,
14
+ borderRadius,
15
+ height
16
+ } = _ref;
17
+ return {
18
+ backgroundColor,
19
+ borderWidth,
20
+ borderColor,
21
+ borderRadius,
22
+ height
23
+ };
24
+ };
22
25
  /**
23
26
  * The `Progress` is a container for displaying one or several `ProgressBar`s.
24
27
  *
@@ -50,12 +53,13 @@ const selectProgressStyles = ({
50
53
  */
51
54
 
52
55
 
53
- const Progress = /*#__PURE__*/forwardRef(({
54
- children,
55
- tokens,
56
- variant,
57
- ...rest
58
- }, ref) => {
56
+ const Progress = /*#__PURE__*/forwardRef((_ref2, ref) => {
57
+ let {
58
+ children,
59
+ tokens,
60
+ variant,
61
+ ...rest
62
+ } = _ref2;
59
63
  const themeTokens = useThemeTokens('Progress', tokens, variant);
60
64
  return /*#__PURE__*/_jsx(View, {
61
65
  ref: ref,
@@ -9,18 +9,21 @@ import { a11yProps, getTokensPropType, selectSystemProps, variantProp, viewProps
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
11
11
 
12
- const selectBarStyles = ({
13
- backgroundColor,
14
- borderRadius,
15
- outlineWidth,
16
- outlineColor
17
- }, percentage) => ({
18
- backgroundColor,
19
- borderRadius,
20
- outlineWidth,
21
- outlineColor,
22
- width: `${percentage}%`
23
- });
12
+ const selectBarStyles = (_ref, percentage) => {
13
+ let {
14
+ backgroundColor,
15
+ borderRadius,
16
+ outlineWidth,
17
+ outlineColor
18
+ } = _ref;
19
+ return {
20
+ backgroundColor,
21
+ borderRadius,
22
+ outlineWidth,
23
+ outlineColor,
24
+ width: "".concat(percentage, "%")
25
+ };
26
+ };
24
27
  /**
25
28
  * The `ProgressBar` is a visual representation of linear progression.
26
29
  * It provides simple but important information at a quick glance.
@@ -57,13 +60,14 @@ const selectBarStyles = ({
57
60
  */
58
61
 
59
62
 
60
- const ProgressBar = /*#__PURE__*/forwardRef(({
61
- children = null,
62
- percentage = 0,
63
- tokens,
64
- variant,
65
- ...rest
66
- }, ref) => {
63
+ const ProgressBar = /*#__PURE__*/forwardRef((_ref2, ref) => {
64
+ let {
65
+ children = null,
66
+ percentage = 0,
67
+ tokens,
68
+ variant,
69
+ ...rest
70
+ } = _ref2;
67
71
  const themeTokens = useThemeTokens('ProgressBar', tokens, variant);
68
72
 
69
73
  if (percentage < 0) {
@@ -78,7 +82,7 @@ const ProgressBar = /*#__PURE__*/forwardRef(({
78
82
  min: 0,
79
83
  max: 100,
80
84
  now: percentage,
81
- text: `${percentage}%`
85
+ text: "".concat(percentage, "%")
82
86
  },
83
87
  ...rest
84
88
  });
@@ -86,7 +90,7 @@ const ProgressBar = /*#__PURE__*/forwardRef(({
86
90
  ref: ref,
87
91
  style: [staticStyles.bar, selectBarStyles(themeTokens, percentage)],
88
92
  ...selectedProps,
89
- children: children ?? /*#__PURE__*/_jsx(ProgressBarBackground, {
93
+ children: children !== null && children !== void 0 ? children : /*#__PURE__*/_jsx(ProgressBarBackground, {
90
94
  variant: variant
91
95
  })
92
96
  }) : null;
@@ -3,11 +3,12 @@ import ImageBackground from "react-native-web/dist/exports/ImageBackground";
3
3
  import StyleSheet from "react-native-web/dist/exports/StyleSheet";
4
4
  import { variantProp } from '../utils';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- 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`;
7
- 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`;
8
- const ProgressBarBackground = /*#__PURE__*/forwardRef(({
9
- variant
10
- }, ref) => {
6
+ 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";
7
+ 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";
8
+ const ProgressBarBackground = /*#__PURE__*/forwardRef((_ref, ref) => {
9
+ let {
10
+ variant
11
+ } = _ref;
11
12
  let source = null;
12
13
 
13
14
  if (variant !== null && variant !== void 0 && variant.inactive) {
@@ -21,7 +22,7 @@ const ProgressBarBackground = /*#__PURE__*/forwardRef(({
21
22
  return /*#__PURE__*/_jsx(ImageBackground, {
22
23
  ref: ref,
23
24
  source: {
24
- uri: `data:image/svg+xml,${source}`
25
+ uri: "data:image/svg+xml,".concat(source)
25
26
  },
26
27
  style: staticStyles.imageBackground
27
28
  });
@@ -13,56 +13,65 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
14
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, viewProps]);
15
15
 
16
- const selectContainerStyles = ({
17
- containerBackgroundColor,
18
- containerBorderRadius,
19
- containerOpacity,
20
- containerPaddingBottom,
21
- containerPaddingLeft,
22
- containerPaddingRight,
23
- containerPaddingTop,
24
- containerShadow
25
- }) => ({
26
- backgroundColor: containerBackgroundColor,
27
- borderRadius: containerBorderRadius,
28
- opacity: containerOpacity,
29
- paddingBottom: containerPaddingBottom,
30
- paddingLeft: containerPaddingLeft,
31
- paddingRight: containerPaddingRight,
32
- paddingTop: containerPaddingTop,
33
- ...applyShadowToken(containerShadow)
34
- });
16
+ const selectContainerStyles = _ref => {
17
+ let {
18
+ containerBackgroundColor,
19
+ containerBorderRadius,
20
+ containerOpacity,
21
+ containerPaddingBottom,
22
+ containerPaddingLeft,
23
+ containerPaddingRight,
24
+ containerPaddingTop,
25
+ containerShadow
26
+ } = _ref;
27
+ return {
28
+ backgroundColor: containerBackgroundColor,
29
+ borderRadius: containerBorderRadius,
30
+ opacity: containerOpacity,
31
+ paddingBottom: containerPaddingBottom,
32
+ paddingLeft: containerPaddingLeft,
33
+ paddingRight: containerPaddingRight,
34
+ paddingTop: containerPaddingTop,
35
+ ...applyShadowToken(containerShadow)
36
+ };
37
+ };
35
38
 
36
- const selectDescriptionStyles = ({
37
- containerPaddingLeft = 0,
38
- descriptionFontSize,
39
- descriptionLineHeight,
40
- descriptionMarginLeft,
41
- inputSize,
42
- labelMarginLeft = 0
43
- }) => ({
44
- marginLeft: descriptionMarginLeft ?? containerPaddingLeft + inputSize + labelMarginLeft,
45
- ...applyTextStyles({
46
- fontSize: descriptionFontSize,
47
- lineHeight: descriptionLineHeight
48
- })
49
- });
39
+ const selectDescriptionStyles = _ref2 => {
40
+ let {
41
+ containerPaddingLeft = 0,
42
+ descriptionFontSize,
43
+ descriptionLineHeight,
44
+ descriptionMarginLeft,
45
+ inputSize,
46
+ labelMarginLeft = 0
47
+ } = _ref2;
48
+ return {
49
+ marginLeft: descriptionMarginLeft !== null && descriptionMarginLeft !== void 0 ? descriptionMarginLeft : containerPaddingLeft + inputSize + labelMarginLeft,
50
+ ...applyTextStyles({
51
+ fontSize: descriptionFontSize,
52
+ lineHeight: descriptionLineHeight
53
+ })
54
+ };
55
+ };
50
56
 
51
- const selectLabelStyles = ({
52
- labelColor,
53
- labelFontName,
54
- labelFontSize,
55
- labelFontWeight,
56
- labelMarginLeft,
57
- labelLineHeight
58
- }) => applyTextStyles({
59
- color: labelColor,
60
- fontName: labelFontName,
61
- fontWeight: labelFontWeight,
62
- fontSize: labelFontSize,
63
- lineHeight: labelLineHeight,
64
- marginLeft: labelMarginLeft
65
- });
57
+ const selectLabelStyles = _ref3 => {
58
+ let {
59
+ labelColor,
60
+ labelFontName,
61
+ labelFontSize,
62
+ labelFontWeight,
63
+ labelMarginLeft,
64
+ labelLineHeight
65
+ } = _ref3;
66
+ return applyTextStyles({
67
+ color: labelColor,
68
+ fontName: labelFontName,
69
+ fontWeight: labelFontWeight,
70
+ fontSize: labelFontSize,
71
+ lineHeight: labelLineHeight,
72
+ marginLeft: labelMarginLeft
73
+ });
74
+ };
66
75
  /**
67
76
  * Basic Radio component.
68
77
  *
@@ -97,21 +106,22 @@ const selectLabelStyles = ({
97
106
  */
98
107
 
99
108
 
100
- const Radio = /*#__PURE__*/forwardRef(({
101
- checked,
102
- defaultChecked,
103
- description,
104
- error = false,
105
- id,
106
- inactive,
107
- label,
108
- name: inputName,
109
- onChange,
110
- tokens,
111
- value,
112
- variant,
113
- ...rest
114
- }, ref) => {
109
+ const Radio = /*#__PURE__*/forwardRef((_ref4, ref) => {
110
+ let {
111
+ checked,
112
+ defaultChecked,
113
+ description,
114
+ error = false,
115
+ id,
116
+ inactive,
117
+ label,
118
+ name: inputName,
119
+ onChange,
120
+ tokens,
121
+ value,
122
+ variant,
123
+ ...rest
124
+ } = _ref4;
115
125
  const {
116
126
  currentValue: isChecked,
117
127
  setValue: setIsChecked,
@@ -140,7 +150,7 @@ const Radio = /*#__PURE__*/forwardRef(({
140
150
  };
141
151
 
142
152
  const uniqueId = useUniqueId('radio');
143
- const inputId = id ?? uniqueId;
153
+ const inputId = id !== null && id !== void 0 ? id : uniqueId;
144
154
  return /*#__PURE__*/_jsx(Pressable, {
145
155
  ref: ref,
146
156
  disabled: inactive,
@@ -152,11 +162,12 @@ const Radio = /*#__PURE__*/forwardRef(({
152
162
  disabled: inactive
153
163
  },
154
164
  ...selectProps(rest),
155
- children: ({
156
- focused: focus,
157
- hovered: hover,
158
- pressed
159
- }) => {
165
+ children: _ref5 => {
166
+ let {
167
+ focused: focus,
168
+ hovered: hover,
169
+ pressed
170
+ } = _ref5;
160
171
  const stateTokens = getTokens({
161
172
  focus,
162
173
  hover,
@@ -16,69 +16,79 @@ export const selectRadioButtonTokens = (themeTokens, prefix) => selectTokens(tok
16
16
 
17
17
  const getBorderRadius = inputSize => inputSize / 2;
18
18
 
19
- const selectCheckedStyles = ({
20
- checkedBackgroundColor,
21
- checkedSize
22
- }) => ({
23
- backgroundColor: checkedBackgroundColor,
24
- borderRadius: checkedSize / 2,
25
- height: checkedSize,
26
- width: checkedSize
27
- });
19
+ const selectCheckedStyles = _ref => {
20
+ let {
21
+ checkedBackgroundColor,
22
+ checkedSize
23
+ } = _ref;
24
+ return {
25
+ backgroundColor: checkedBackgroundColor,
26
+ borderRadius: checkedSize / 2,
27
+ height: checkedSize,
28
+ width: checkedSize
29
+ };
30
+ };
28
31
 
29
- const selectInputStyles = ({
30
- inputBackgroundColor,
31
- inputBorderColor,
32
- inputBorderWidth,
33
- inputOutlineColor,
34
- inputOutlineWidth,
35
- inputSize
36
- }) => ({
37
- borderColor: inputBorderColor,
38
- borderRadius: getBorderRadius(inputSize),
39
- borderWidth: inputBorderWidth,
40
- backgroundColor: inputBackgroundColor,
41
- height: inputSize,
42
- width: inputSize,
43
- ...Platform.select({
44
- web: {
45
- outlineStyle: 'solid',
46
- outlineColor: inputOutlineColor,
47
- outlineWidth: inputOutlineWidth
48
- }
49
- })
50
- });
32
+ const selectInputStyles = _ref2 => {
33
+ let {
34
+ inputBackgroundColor,
35
+ inputBorderColor,
36
+ inputBorderWidth,
37
+ inputOutlineColor,
38
+ inputOutlineWidth,
39
+ inputSize
40
+ } = _ref2;
41
+ return {
42
+ borderColor: inputBorderColor,
43
+ borderRadius: getBorderRadius(inputSize),
44
+ borderWidth: inputBorderWidth,
45
+ backgroundColor: inputBackgroundColor,
46
+ height: inputSize,
47
+ width: inputSize,
48
+ ...Platform.select({
49
+ web: {
50
+ outlineStyle: 'solid',
51
+ outlineColor: inputOutlineColor,
52
+ outlineWidth: inputOutlineWidth
53
+ }
54
+ })
55
+ };
56
+ };
51
57
 
52
- const selectOuterBorderStyles = ({
53
- outerBorderColor,
54
- outerBorderWidth,
55
- outerBorderGap,
56
- inputSize
57
- }) => ({ ...applyOuterBorder({
58
+ const selectOuterBorderStyles = _ref3 => {
59
+ let {
58
60
  outerBorderColor,
59
61
  outerBorderWidth,
60
62
  outerBorderGap,
61
- borderRadius: getBorderRadius(inputSize)
62
- })
63
- });
63
+ inputSize
64
+ } = _ref3;
65
+ return { ...applyOuterBorder({
66
+ outerBorderColor,
67
+ outerBorderWidth,
68
+ outerBorderGap,
69
+ borderRadius: getBorderRadius(inputSize)
70
+ })
71
+ };
72
+ };
64
73
  /**
65
74
  * The visual toggle of a radio input. Is not interactive on its own, should be used inside
66
75
  * an interactive parent that passes down props when interacted with.
67
76
  */
68
77
 
69
78
 
70
- const RadioButton = /*#__PURE__*/forwardRef(({
71
- isChecked,
72
- tokens,
73
- inactive,
74
- defaultChecked,
75
- inputId,
76
- isControlled,
77
- handleChange,
78
- name: inputName,
79
- value,
80
- ...rest
81
- }, ref) => {
79
+ const RadioButton = /*#__PURE__*/forwardRef((_ref4, ref) => {
80
+ let {
81
+ isChecked,
82
+ tokens,
83
+ inactive,
84
+ defaultChecked,
85
+ inputId,
86
+ isControlled,
87
+ handleChange,
88
+ name: inputName,
89
+ value,
90
+ ...rest
91
+ } = _ref4;
82
92
  const themeTokens = validateThemeTokens(resolveThemeTokens(tokens, {
83
93
  checked: isChecked
84
94
  }), getTokensSetPropType(tokenKeys), 'RadioButton');
@@ -59,25 +59,26 @@ const [selectItemProps, selectedItemPropTypes] = selectSystemProps([a11yProps, f
59
59
  * ```
60
60
  */
61
61
 
62
- const RadioGroup = /*#__PURE__*/forwardRef(({
63
- copy = 'en',
64
- tokens,
65
- radioTokens,
66
- variant,
67
- items = [],
68
- legend,
69
- tooltip,
70
- hint,
71
- validation,
72
- feedback,
73
- initialCheckedId,
74
- checkedId,
75
- onChange,
76
- readOnly,
77
- name: inputGroupName,
78
- inactive,
79
- ...rest
80
- }, ref) => {
62
+ const RadioGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
63
+ let {
64
+ copy = 'en',
65
+ tokens,
66
+ radioTokens,
67
+ variant,
68
+ items = [],
69
+ legend,
70
+ tooltip,
71
+ hint,
72
+ validation,
73
+ feedback,
74
+ initialCheckedId,
75
+ checkedId,
76
+ onChange,
77
+ readOnly,
78
+ name: inputGroupName,
79
+ inactive,
80
+ ...rest
81
+ } = _ref;
81
82
  const viewport = useViewport();
82
83
  const {
83
84
  space,
@@ -97,17 +98,18 @@ const RadioGroup = /*#__PURE__*/forwardRef(({
97
98
  const uniqueFields = ['id', 'label'];
98
99
 
99
100
  if (!containUniqueFields(items, uniqueFields)) {
100
- throw new Error(`RadioGroup items must have unique ${uniqueFields.join(', ')}`);
101
+ throw new Error("RadioGroup items must have unique ".concat(uniqueFields.join(', ')));
101
102
  }
102
103
 
103
- const radios = items.map(({
104
- label,
105
- id,
106
- onChange: itemOnChange,
107
- ref: itemRef,
108
- ...itemRest
109
- }, index) => {
110
- const radioId = id || `Radio[${index}]`;
104
+ const radios = items.map((_ref2, index) => {
105
+ let {
106
+ label,
107
+ id,
108
+ onChange: itemOnChange,
109
+ ref: itemRef,
110
+ ...itemRest
111
+ } = _ref2;
112
+ const radioId = id || "Radio[".concat(index, "]");
111
113
  const isChecked = currentValue === radioId;
112
114
 
113
115
  const handleChange = (newCheckedState, event) => {
@@ -5,16 +5,18 @@ import PropTypes from 'prop-types';
5
5
  */
6
6
 
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
- const RadioInput = /*#__PURE__*/forwardRef(({
9
- checked,
10
- defaultChecked,
11
- disabled,
12
- id,
13
- isControlled,
14
- name,
15
- onChange,
16
- value
17
- }, ref) => {
8
+ const RadioInput = /*#__PURE__*/forwardRef((_ref, ref) => {
9
+ let {
10
+ checked,
11
+ defaultChecked,
12
+ disabled,
13
+ id,
14
+ isControlled,
15
+ name,
16
+ onChange,
17
+ value
18
+ } = _ref;
19
+
18
20
  const handleClick = event => {
19
21
  // Cancel the click dispatched via the label tag, since it's already wrapped
20
22
  // in <Pressable>