@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,43 +10,49 @@ import Icon from '../Icon';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
12
12
 
13
- const selectOuterStyle = ({
14
- backgroundColor,
15
- borderRadius,
16
- outerBorderWidth,
17
- outerBorderColor,
18
- outerBorderGap,
19
- shadow
20
- }) => [{
21
- backgroundColor,
22
- ...applyShadowToken(shadow),
23
- ...applyOuterBorder({
13
+ const selectOuterStyle = _ref => {
14
+ let {
15
+ backgroundColor,
24
16
  borderRadius,
25
17
  outerBorderWidth,
26
18
  outerBorderColor,
27
- outerBorderGap
28
- }),
29
- ...Platform.select({
30
- web: {
31
- outline: 'none',
32
- display: 'inline-flex'
33
- }
34
- })
35
- }, staticStyles.outer];
19
+ outerBorderGap,
20
+ shadow
21
+ } = _ref;
22
+ return [{
23
+ backgroundColor,
24
+ ...applyShadowToken(shadow),
25
+ ...applyOuterBorder({
26
+ borderRadius,
27
+ outerBorderWidth,
28
+ outerBorderColor,
29
+ outerBorderGap
30
+ }),
31
+ ...Platform.select({
32
+ web: {
33
+ outline: 'none',
34
+ display: 'inline-flex'
35
+ }
36
+ })
37
+ }, staticStyles.outer];
38
+ };
36
39
 
37
- const selectInnerStyle = ({
38
- borderColor,
39
- borderWidth = 0,
40
- borderRadius,
41
- padding = 0
42
- }) => ({
43
- // Inner borders animate with the icon and should be treated like a themable feature of the icon
44
- borderColor,
45
- borderRadius,
46
- borderWidth,
47
- padding: Math.max(0, padding - borderWidth) // Stable size as border changes
40
+ const selectInnerStyle = _ref2 => {
41
+ let {
42
+ borderColor,
43
+ borderWidth = 0,
44
+ borderRadius,
45
+ padding = 0
46
+ } = _ref2;
47
+ return {
48
+ // Inner borders animate with the icon and should be treated like a themable feature of the icon
49
+ borderColor,
50
+ borderRadius,
51
+ borderWidth,
52
+ padding: Math.max(0, padding - borderWidth) // Stable size as border changes
48
53
 
49
- });
54
+ };
55
+ };
50
56
  /**
51
57
  * A pressable themeless base component that handles pressable states and passes tokens
52
58
  * based on these to an outer border and a base Card component. Not intended to be used in
@@ -54,15 +60,16 @@ const selectInnerStyle = ({
54
60
  */
55
61
 
56
62
 
57
- const IconButton = /*#__PURE__*/forwardRef(({
58
- tokens,
59
- variant,
60
- icon: IconComponent,
61
- href,
62
- hrefAttrs,
63
- accessibilityRole = href ? 'link' : 'button',
64
- ...rawRest
65
- }, ref) => {
63
+ const IconButton = /*#__PURE__*/forwardRef((_ref3, ref) => {
64
+ let {
65
+ tokens,
66
+ variant,
67
+ icon: IconComponent,
68
+ href,
69
+ hrefAttrs,
70
+ accessibilityRole = href ? 'link' : 'button',
71
+ ...rawRest
72
+ } = _ref3;
66
73
  const {
67
74
  onPress,
68
75
  ...rest
@@ -14,38 +14,45 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
14
14
 
15
15
  const selectLabelStyles = tokens => applyTextStyles(selectTokens('Typography', tokens));
16
16
 
17
- const selectHintStyles = ({
18
- hintColor,
19
- hintFontName,
20
- hintFontSize,
21
- hintFontWeight,
22
- hintLineHeight
23
- }) => applyTextStyles({
24
- color: hintColor,
25
- fontName: hintFontName,
26
- fontSize: hintFontSize,
27
- fontWeight: hintFontWeight,
28
- lineHeight: hintLineHeight
29
- });
17
+ const selectHintStyles = _ref => {
18
+ let {
19
+ hintColor,
20
+ hintFontName,
21
+ hintFontSize,
22
+ hintFontWeight,
23
+ hintLineHeight
24
+ } = _ref;
25
+ return applyTextStyles({
26
+ color: hintColor,
27
+ fontName: hintFontName,
28
+ fontSize: hintFontSize,
29
+ fontWeight: hintFontWeight,
30
+ lineHeight: hintLineHeight
31
+ });
32
+ };
30
33
 
31
- const selectGapStyles = ({
32
- gap
33
- }) => ({
34
- marginRight: gap
35
- });
34
+ const selectGapStyles = _ref2 => {
35
+ let {
36
+ gap
37
+ } = _ref2;
38
+ return {
39
+ marginRight: gap
40
+ };
41
+ };
36
42
 
37
- const InputLabel = /*#__PURE__*/forwardRef(({
38
- copy = 'en',
39
- label,
40
- forId,
41
- hint,
42
- hintPosition = 'inline',
43
- hintId,
44
- tooltip,
45
- tokens,
46
- variant,
47
- ...rest
48
- }, ref) => {
43
+ const InputLabel = /*#__PURE__*/forwardRef((_ref3, ref) => {
44
+ let {
45
+ copy = 'en',
46
+ label,
47
+ forId,
48
+ hint,
49
+ hintPosition = 'inline',
50
+ hintId,
51
+ tooltip,
52
+ tokens,
53
+ variant,
54
+ ...rest
55
+ } = _ref3;
49
56
  const themeTokens = useThemeTokens('InputLabel', tokens, variant);
50
57
  const hasTooltip = tooltip !== undefined;
51
58
  const isHintInline = hintPosition === 'inline';
@@ -1,15 +1,18 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
- const LabelContent = /*#__PURE__*/forwardRef(({
5
- children,
6
- forId
7
- }, ref) => /*#__PURE__*/_jsx("label", {
8
- ref: ref,
9
- htmlFor: forId,
10
- style: staticStyles.inheritCursor,
11
- children: children
12
- }));
4
+ const LabelContent = /*#__PURE__*/forwardRef((_ref, ref) => {
5
+ let {
6
+ children,
7
+ forId
8
+ } = _ref;
9
+ return /*#__PURE__*/_jsx("label", {
10
+ ref: ref,
11
+ htmlFor: forId,
12
+ style: staticStyles.inheritCursor,
13
+ children: children
14
+ });
15
+ });
13
16
  LabelContent.displayName = 'LabelContent';
14
17
  LabelContent.propTypes = {
15
18
  children: PropTypes.string,
@@ -3,12 +3,15 @@ import PropTypes from 'prop-types';
3
3
  import View from "react-native-web/dist/exports/View"; // Since there's no equivalent for web's <label> element we're simply rendering whatever is passed to this component.
4
4
 
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- const LabelContent = /*#__PURE__*/forwardRef(({
7
- children
8
- }, ref) => ref ? /*#__PURE__*/_jsx(View, {
9
- ref: ref,
10
- children: children
11
- }) : children);
6
+ const LabelContent = /*#__PURE__*/forwardRef((_ref, ref) => {
7
+ let {
8
+ children
9
+ } = _ref;
10
+ return ref ? /*#__PURE__*/_jsx(View, {
11
+ ref: ref,
12
+ children: children
13
+ }) : children;
14
+ });
12
15
  LabelContent.displayName = 'LabelContent';
13
16
  LabelContent.propTypes = {
14
17
  children: PropTypes.node
@@ -7,16 +7,17 @@ import { useThemeTokens } from '../ThemeProvider';
7
7
  import useInputSupports from './useInputSupports';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const InputSupports = /*#__PURE__*/forwardRef(({
11
- children,
12
- copy = 'en',
13
- label,
14
- hint,
15
- hintPosition = 'inline',
16
- feedback,
17
- tooltip,
18
- validation
19
- }, ref) => {
10
+ const InputSupports = /*#__PURE__*/forwardRef((_ref, ref) => {
11
+ let {
12
+ children,
13
+ copy = 'en',
14
+ label,
15
+ hint,
16
+ hintPosition = 'inline',
17
+ feedback,
18
+ tooltip,
19
+ validation
20
+ } = _ref;
20
21
  const {
21
22
  space
22
23
  } = useThemeTokens('InputSupports');
@@ -2,12 +2,13 @@ import useUniqueId from '../utils/useUniqueId';
2
2
 
3
3
  const joinDefined = array => array.filter(item => item !== undefined).join(' ');
4
4
 
5
- const useInputSupports = ({
6
- label,
7
- feedback,
8
- validation,
9
- hint
10
- }) => {
5
+ const useInputSupports = _ref => {
6
+ let {
7
+ label,
8
+ feedback,
9
+ validation,
10
+ hint
11
+ } = _ref;
11
12
  const hasValidationError = validation === 'error';
12
13
  const inputId = useUniqueId('input');
13
14
  const hintId = useUniqueId('input-hint');
@@ -11,14 +11,15 @@ import LinkBase from './LinkBase';
11
11
  */
12
12
 
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
- const ChevronLink = /*#__PURE__*/forwardRef(({
15
- direction = 'right',
16
- children,
17
- tokens,
18
- variant,
19
- dataSet,
20
- ...linkProps
21
- }, ref) => {
14
+ const ChevronLink = /*#__PURE__*/forwardRef((_ref, ref) => {
15
+ let {
16
+ direction = 'right',
17
+ children,
18
+ tokens,
19
+ variant,
20
+ dataSet,
21
+ ...linkProps
22
+ } = _ref;
22
23
  const getChevronTokens = useThemeTokensCallback('ChevronLink', tokens, variant);
23
24
 
24
25
  const applyChevronTokens = linkState => {
@@ -17,16 +17,19 @@ import StyleSheet from "react-native-web/dist/exports/StyleSheet";
17
17
  // eslint-disable-next-line react/prop-types
18
18
 
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
- const InlinePressable = /*#__PURE__*/forwardRef(({
21
- children,
22
- style,
23
- ...props
24
- }, ref) => /*#__PURE__*/_jsx(Pressable, {
25
- ref: ref,
26
- style: pressState => [staticStyles.inline, typeof style === 'function' ? style(pressState) : style],
27
- ...props,
28
- children: pressState => typeof children === 'function' ? children(pressState) : children
29
- }));
20
+ const InlinePressable = /*#__PURE__*/forwardRef((_ref, ref) => {
21
+ let {
22
+ children,
23
+ style,
24
+ ...props
25
+ } = _ref;
26
+ return /*#__PURE__*/_jsx(Pressable, {
27
+ ref: ref,
28
+ style: pressState => [staticStyles.inline, typeof style === 'function' ? style(pressState) : style],
29
+ ...props,
30
+ children: pressState => typeof children === 'function' ? children(pressState) : children
31
+ });
32
+ });
30
33
  InlinePressable.displayName = 'InlinePressable';
31
34
  const staticStyles = StyleSheet.create({
32
35
  inline: {
@@ -9,16 +9,19 @@ import TouchableWithoutFeedback from "react-native-web/dist/exports/TouchableWit
9
9
 
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
 
12
- const pressablePropsToTouchable = ({
13
- unstable_pressDelay,
14
- android_disableSound,
15
- android_ripple,
16
- // Unsupported, discard it
17
- ...props
18
- }) => ({ ...props,
19
- touchSoundDisabled: android_disableSound,
20
- delayPressIn: unstable_pressDelay
21
- });
12
+ const pressablePropsToTouchable = _ref => {
13
+ let {
14
+ unstable_pressDelay,
15
+ android_disableSound,
16
+ android_ripple,
17
+ // Unsupported, discard it
18
+ ...props
19
+ } = _ref;
20
+ return { ...props,
21
+ touchSoundDisabled: android_disableSound,
22
+ delayPressIn: unstable_pressDelay
23
+ };
24
+ };
22
25
  /**
23
26
  * InlinePressable is an alternative to React Native's Pressable that works better when nested
24
27
  * inline inside Text. It accepts the same props as React Native's Pressable.
@@ -41,12 +44,13 @@ const pressablePropsToTouchable = ({
41
44
  // eslint-disable-next-line react/prop-types
42
45
 
43
46
 
44
- const InlinePressable = /*#__PURE__*/forwardRef(({
45
- onPress,
46
- children,
47
- style,
48
- ...rest
49
- }, ref) => {
47
+ const InlinePressable = /*#__PURE__*/forwardRef((_ref2, ref) => {
48
+ let {
49
+ onPress,
50
+ children,
51
+ style,
52
+ ...rest
53
+ } = _ref2;
50
54
  const [isFocused, setIsFocused] = useState(false);
51
55
 
52
56
  const handleFocus = () => setIsFocused(true);
@@ -2,15 +2,16 @@ import React, { forwardRef } from 'react';
2
2
  import { useThemeTokensCallback } from '../ThemeProvider';
3
3
  import LinkBase from './LinkBase';
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
- const Link = /*#__PURE__*/forwardRef(({
6
- href,
7
- children,
8
- accessibilityRole = 'link',
9
- variant = {},
10
- tokens,
11
- dataSet,
12
- ...linkProps
13
- }, ref) => {
5
+ const Link = /*#__PURE__*/forwardRef((_ref, ref) => {
6
+ let {
7
+ href,
8
+ children,
9
+ accessibilityRole = 'link',
10
+ variant = {},
11
+ tokens,
12
+ dataSet,
13
+ ...linkProps
14
+ } = _ref;
14
15
  const getTokens = useThemeTokensCallback('Link', tokens, variant);
15
16
  return /*#__PURE__*/_jsx(LinkBase, {
16
17
  href: href,
@@ -12,79 +12,95 @@ import { IconText, iconComponentPropTypes } from '../Icon';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, linkProps, viewProps]);
14
14
 
15
- const selectOuterBorderStyles = ({
16
- outerBorderColor,
17
- outerBorderWidth,
18
- outerBorderGap,
19
- borderRadius,
20
- outerBorderOutline
21
- }) => // A view wrapper with a border on native messes up inline text alignment
22
- // so for now make focus styles strictly web-only
23
- Platform.OS === 'web' ? {
24
- // Allow theme to define outline, or, turn off outline and use border if rounded corners required
25
- outline: outerBorderOutline,
26
- ...applyOuterBorder({
15
+ const selectOuterBorderStyles = _ref => {
16
+ let {
27
17
  outerBorderColor,
28
18
  outerBorderWidth,
29
19
  outerBorderGap,
30
- borderRadius
31
- }),
32
- // Stops focus ring stretching horizontally if parent has display: block
33
- // width: fit-content isn't supported on Firefox; can't cascade props like CSS `width: fit-content; width: --moz-fit-content;`
34
- display: 'inline-flex'
35
- } : {};
20
+ borderRadius,
21
+ outerBorderOutline
22
+ } = _ref;
23
+ return (// A view wrapper with a border on native messes up inline text alignment
24
+ // so for now make focus styles strictly web-only
25
+ Platform.OS === 'web' ? {
26
+ // Allow theme to define outline, or, turn off outline and use border if rounded corners required
27
+ outline: outerBorderOutline,
28
+ ...applyOuterBorder({
29
+ outerBorderColor,
30
+ outerBorderWidth,
31
+ outerBorderGap,
32
+ borderRadius
33
+ }),
34
+ // Stops focus ring stretching horizontally if parent has display: block
35
+ // width: fit-content isn't supported on Firefox; can't cascade props like CSS `width: fit-content; width: --moz-fit-content;`
36
+ display: 'inline-flex'
37
+ } : {}
38
+ );
39
+ };
36
40
 
37
- const selectTextStyles = ({
38
- color
39
- }) => ({
40
- color,
41
- ...Platform.select({
42
- web: {
43
- // TODO: https://github.com/telus/universal-design-system/issues/487
44
- transition: 'color 200ms'
45
- }
46
- })
47
- });
41
+ const selectTextStyles = _ref2 => {
42
+ let {
43
+ color
44
+ } = _ref2;
45
+ return {
46
+ color,
47
+ ...Platform.select({
48
+ web: {
49
+ // TODO: https://github.com/telus/universal-design-system/issues/487
50
+ transition: 'color 200ms'
51
+ }
52
+ })
53
+ };
54
+ };
48
55
 
49
- const selectBlockStyles = ({
50
- blockFontWeight,
51
- blockFontSize,
52
- blockLineHeight,
53
- blockFontName
54
- }) => applyTextStyles({
55
- fontWeight: blockFontWeight,
56
- fontSize: blockFontSize,
57
- lineHeight: blockLineHeight,
58
- fontName: blockFontName
59
- });
56
+ const selectBlockStyles = _ref3 => {
57
+ let {
58
+ blockFontWeight,
59
+ blockFontSize,
60
+ blockLineHeight,
61
+ blockFontName
62
+ } = _ref3;
63
+ return applyTextStyles({
64
+ fontWeight: blockFontWeight,
65
+ fontSize: blockFontSize,
66
+ lineHeight: blockLineHeight,
67
+ fontName: blockFontName
68
+ });
69
+ };
60
70
 
61
- const selectDecorationStyles = ({
62
- color,
63
- textLine,
64
- textLineStyle
65
- }) => ({
66
- color,
67
- textDecorationLine: textLine,
68
- textDecorationStyle: textLineStyle,
69
- ...Platform.select({
70
- web: {
71
- // TODO: https://github.com/telus/universal-design-system/issues/487
72
- transition: 'color 200ms'
73
- }
74
- })
75
- });
71
+ const selectDecorationStyles = _ref4 => {
72
+ let {
73
+ color,
74
+ textLine,
75
+ textLineStyle
76
+ } = _ref4;
77
+ return {
78
+ color,
79
+ textDecorationLine: textLine,
80
+ textDecorationStyle: textLineStyle,
81
+ ...Platform.select({
82
+ web: {
83
+ // TODO: https://github.com/telus/universal-design-system/issues/487
84
+ transition: 'color 200ms'
85
+ }
86
+ })
87
+ };
88
+ };
76
89
 
77
- const selectIconTokens = ({
78
- color,
79
- iconSize,
80
- iconTranslateX,
81
- iconTranslateY
82
- }) => ({
83
- color,
84
- translateX: iconTranslateX,
85
- translateY: iconTranslateY,
86
- size: iconSize
87
- });
90
+ const selectIconTokens = _ref5 => {
91
+ let {
92
+ color,
93
+ iconSize,
94
+ iconTranslateX,
95
+ iconTranslateY
96
+ } = _ref5;
97
+ return {
98
+ color,
99
+ translateX: iconTranslateX,
100
+ translateY: iconTranslateY,
101
+ size: iconSize
102
+ };
103
+ };
88
104
  /**
89
105
  * Renders a pressable text link, with optional icon. This is rendered as a block element
90
106
  * only (see 'Current Limitations'). On Web, renders an `<a>` anchor tag if `href` is provided.
@@ -109,17 +125,18 @@ const selectIconTokens = ({
109
125
  */
110
126
 
111
127
 
112
- const LinkBase = /*#__PURE__*/forwardRef(({
113
- href,
114
- icon,
115
- iconPosition = icon ? 'left' : undefined,
116
- iconProps,
117
- variant,
118
- tokens = {},
119
- children,
120
- accessibilityRole = 'link',
121
- ...rawRest
122
- }, ref) => {
128
+ const LinkBase = /*#__PURE__*/forwardRef((_ref6, ref) => {
129
+ let {
130
+ href,
131
+ icon,
132
+ iconPosition = icon ? 'left' : undefined,
133
+ iconProps,
134
+ variant,
135
+ tokens = {},
136
+ children,
137
+ accessibilityRole = 'link',
138
+ ...rawRest
139
+ } = _ref6;
123
140
  const {
124
141
  onPress,
125
142
  ...props
@@ -9,14 +9,15 @@ import LinkBase from './LinkBase';
9
9
  */
10
10
 
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- const TextButton = /*#__PURE__*/forwardRef(({
13
- onPress,
14
- children,
15
- variant,
16
- tokens,
17
- accessibilityRole = 'button',
18
- ...linkProps
19
- }, ref) => {
12
+ const TextButton = /*#__PURE__*/forwardRef((_ref, ref) => {
13
+ let {
14
+ onPress,
15
+ children,
16
+ variant,
17
+ tokens,
18
+ accessibilityRole = 'button',
19
+ ...linkProps
20
+ } = _ref;
20
21
  const getTokens = useThemeTokensCallback('Link', tokens, variant);
21
22
  return /*#__PURE__*/_jsx(LinkBase, {
22
23
  onPress: onPress,