@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
@@ -12,33 +12,45 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
12
12
 
13
13
  const selectStyles = tokens => selectTokens('Feedback', tokens);
14
14
 
15
- const selectTitleTextStyles = ({
16
- titleFontSize,
17
- ...tokens
18
- }) => applyTextStyles(selectTokens('Typography', { ...tokens,
19
- fontSize: titleFontSize
20
- }));
15
+ const selectTitleTextStyles = _ref => {
16
+ let {
17
+ titleFontSize,
18
+ ...tokens
19
+ } = _ref;
20
+ return applyTextStyles(selectTokens('Typography', { ...tokens,
21
+ fontSize: titleFontSize
22
+ }));
23
+ };
21
24
 
22
- const selectContentTextStyles = ({
23
- contentFontSize,
24
- ...tokens
25
- }) => applyTextStyles(selectTokens('Typography', { ...tokens,
26
- fontSize: contentFontSize
27
- }));
25
+ const selectContentTextStyles = _ref2 => {
26
+ let {
27
+ contentFontSize,
28
+ ...tokens
29
+ } = _ref2;
30
+ return applyTextStyles(selectTokens('Typography', { ...tokens,
31
+ fontSize: contentFontSize
32
+ }));
33
+ };
28
34
 
29
- const selectIconTokens = ({
30
- iconSize,
31
- iconColor
32
- }) => ({
33
- size: iconSize,
34
- color: iconColor
35
- });
35
+ const selectIconTokens = _ref3 => {
36
+ let {
37
+ iconSize,
38
+ iconColor
39
+ } = _ref3;
40
+ return {
41
+ size: iconSize,
42
+ color: iconColor
43
+ };
44
+ };
36
45
 
37
- const selectIconContainerStyles = ({
38
- iconGap
39
- }) => ({
40
- paddingRight: iconGap
41
- });
46
+ const selectIconContainerStyles = _ref4 => {
47
+ let {
48
+ iconGap
49
+ } = _ref4;
50
+ return {
51
+ paddingRight: iconGap
52
+ };
53
+ };
42
54
  /**
43
55
  * A feedback box commonly used with form fields.
44
56
  *
@@ -59,15 +71,16 @@ const selectIconContainerStyles = ({
59
71
  */
60
72
 
61
73
 
62
- const Feedback = /*#__PURE__*/forwardRef(({
63
- title,
64
- children,
65
- id,
66
- validation,
67
- tokens,
68
- variant,
69
- ...rest
70
- }, ref) => {
74
+ const Feedback = /*#__PURE__*/forwardRef((_ref5, ref) => {
75
+ let {
76
+ title,
77
+ children,
78
+ id,
79
+ validation,
80
+ tokens,
81
+ variant,
82
+ ...rest
83
+ } = _ref5;
71
84
  const themeTokens = useThemeTokens('Feedback', tokens, { ...variant,
72
85
  validation
73
86
  });
@@ -16,21 +16,22 @@ import Legend from './Legend';
16
16
 
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { Fragment as _Fragment } from "react/jsx-runtime";
19
- const Fieldset = /*#__PURE__*/forwardRef(({
20
- copy = 'en',
21
- space,
22
- feedback,
23
- feedbackPosition = 'top',
24
- validation,
25
- legend,
26
- hint,
27
- hintPosition,
28
- tooltip,
29
- inactive,
30
- accessibilityRole,
31
- name: fieldsetName,
32
- children
33
- }, ref) => {
19
+ const Fieldset = /*#__PURE__*/forwardRef((_ref, ref) => {
20
+ let {
21
+ copy = 'en',
22
+ space,
23
+ feedback,
24
+ feedbackPosition = 'top',
25
+ validation,
26
+ legend,
27
+ hint,
28
+ hintPosition,
29
+ tooltip,
30
+ inactive,
31
+ accessibilityRole,
32
+ name: fieldsetName,
33
+ children
34
+ } = _ref;
34
35
  // Skips `inputId` because a fieldset' legend describes multiple inputs
35
36
  const {
36
37
  hintId,
@@ -6,19 +6,22 @@ import cssReset from './cssReset';
6
6
  */
7
7
 
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
- const FieldsetContainer = /*#__PURE__*/forwardRef(({
10
- children,
11
- inactive,
12
- accessibilityRole,
13
- name: fieldsetName
14
- }, ref) => /*#__PURE__*/_jsx("fieldset", {
15
- ref: ref,
16
- disabled: inactive,
17
- style: cssReset,
18
- role: accessibilityRole,
19
- name: fieldsetName,
20
- children: children
21
- }));
9
+ const FieldsetContainer = /*#__PURE__*/forwardRef((_ref, ref) => {
10
+ let {
11
+ children,
12
+ inactive,
13
+ accessibilityRole,
14
+ name: fieldsetName
15
+ } = _ref;
16
+ return /*#__PURE__*/_jsx("fieldset", {
17
+ ref: ref,
18
+ disabled: inactive,
19
+ style: cssReset,
20
+ role: accessibilityRole,
21
+ name: fieldsetName,
22
+ children: children
23
+ });
24
+ });
22
25
  FieldsetContainer.displayName = 'FieldsetContainer';
23
26
  FieldsetContainer.propTypes = {
24
27
  accessibilityRole: PropTypes.string,
@@ -4,14 +4,17 @@ import View from "react-native-web/dist/exports/View"; // No equivalent of `<fie
4
4
  // If a11y testing finds any additional handling is needed at the container level, add it here.
5
5
 
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
- const FieldsetContainer = /*#__PURE__*/forwardRef(({
8
- children,
9
- accessibilityRole
10
- }, ref) => /*#__PURE__*/_jsx(View, {
11
- ref: ref,
12
- accessibilityRole: accessibilityRole,
13
- children: children
14
- }));
7
+ const FieldsetContainer = /*#__PURE__*/forwardRef((_ref, ref) => {
8
+ let {
9
+ children,
10
+ accessibilityRole
11
+ } = _ref;
12
+ return /*#__PURE__*/_jsx(View, {
13
+ ref: ref,
14
+ accessibilityRole: accessibilityRole,
15
+ children: children
16
+ });
17
+ });
15
18
  FieldsetContainer.displayName = 'FieldsetContainer';
16
19
  FieldsetContainer.propTypes = {
17
20
  children: PropTypes.node,
@@ -7,13 +7,16 @@ import cssReset from './cssReset';
7
7
  */
8
8
 
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
- const Legend = /*#__PURE__*/forwardRef(({
11
- children
12
- }, ref) => /*#__PURE__*/_jsx("legend", {
13
- ref: ref,
14
- style: cssReset,
15
- children: children
16
- }));
10
+ const Legend = /*#__PURE__*/forwardRef((_ref, ref) => {
11
+ let {
12
+ children
13
+ } = _ref;
14
+ return /*#__PURE__*/_jsx("legend", {
15
+ ref: ref,
16
+ style: cssReset,
17
+ children: children
18
+ });
19
+ });
17
20
  Legend.displayName = 'Legend';
18
21
  Legend.propTypes = {
19
22
  children: PropTypes.node
@@ -8,13 +8,16 @@ import PropTypes from 'prop-types';
8
8
  */
9
9
 
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
- const Legend = /*#__PURE__*/forwardRef(({
12
- children
13
- }, ref) => /*#__PURE__*/_jsx(View, {
14
- ref: ref,
15
- style: staticStyles.stretch,
16
- children: children
17
- }));
11
+ const Legend = /*#__PURE__*/forwardRef((_ref, ref) => {
12
+ let {
13
+ children
14
+ } = _ref;
15
+ return /*#__PURE__*/_jsx(View, {
16
+ ref: ref,
17
+ style: staticStyles.stretch,
18
+ children: children
19
+ });
20
+ });
18
21
  Legend.displayName = 'Legend';
19
22
  Legend.propTypes = {
20
23
  children: PropTypes.node
@@ -9,22 +9,23 @@ import { useViewport } from '../../ViewportProvider';
9
9
  import applyInheritance from '../helpers';
10
10
  import { responsiveProps } from '../../utils';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- const Col = /*#__PURE__*/forwardRef(({
13
- horizontalAlign,
14
- children,
15
- xs,
16
- sm,
17
- md,
18
- lg,
19
- xl,
20
- xsOffset,
21
- smOffset,
22
- mdOffset,
23
- lgOffset,
24
- xlOffset,
25
- flex,
26
- ...viewProps
27
- }, ref) => {
12
+ const Col = /*#__PURE__*/forwardRef((_ref, ref) => {
13
+ let {
14
+ horizontalAlign,
15
+ children,
16
+ xs,
17
+ sm,
18
+ md,
19
+ lg,
20
+ xl,
21
+ xsOffset,
22
+ smOffset,
23
+ mdOffset,
24
+ lgOffset,
25
+ xlOffset,
26
+ flex,
27
+ ...viewProps
28
+ } = _ref;
28
29
  const gutter = useContext(GutterContext);
29
30
  const viewPort = useViewport();
30
31
  const hiddenLevels = applyInheritance([xs, sm, md, lg, xl]);
@@ -44,7 +45,7 @@ const Col = /*#__PURE__*/forwardRef(({
44
45
  const horizontalAlignLevel = getHorizontalAlignLevel();
45
46
 
46
47
  const toPercent = num => {
47
- return `${num / 12 * 100}%`;
48
+ return "".concat(num / 12 * 100, "%");
48
49
  };
49
50
 
50
51
  const calculateWidth = value => {
@@ -15,20 +15,21 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
15
15
  * A mobile-first flexbox grid.
16
16
  */
17
17
 
18
- const FlexGrid = /*#__PURE__*/forwardRef(({
19
- limitWidth = true,
20
- gutter = true,
21
- outsideGutter = true,
22
- xsReverse,
23
- smReverse,
24
- mdReverse,
25
- lgReverse,
26
- xlReverse,
27
- tag,
28
- accessibilityRole,
29
- children,
30
- ...rest
31
- }, ref) => {
18
+ const FlexGrid = /*#__PURE__*/forwardRef((_ref, ref) => {
19
+ let {
20
+ limitWidth = true,
21
+ gutter = true,
22
+ outsideGutter = true,
23
+ xsReverse,
24
+ smReverse,
25
+ mdReverse,
26
+ lgReverse,
27
+ xlReverse,
28
+ tag,
29
+ accessibilityRole,
30
+ children,
31
+ ...rest
32
+ } = _ref;
32
33
  const viewPort = useViewport();
33
34
  const reverseLevel = applyInheritance([xsReverse, smReverse, mdReverse, lgReverse, xlReverse]);
34
35
  const marginVertical = 0;
@@ -71,18 +71,19 @@ const distributeStyles = distribute => {
71
71
  }
72
72
  };
73
73
 
74
- const Row = /*#__PURE__*/forwardRef(({
75
- horizontalAlign,
76
- verticalAlign,
77
- distribute,
78
- xsReverse,
79
- smReverse,
80
- mdReverse,
81
- lgReverse,
82
- xlReverse,
83
- children,
84
- ...rest
85
- }, ref) => {
74
+ const Row = /*#__PURE__*/forwardRef((_ref, ref) => {
75
+ let {
76
+ horizontalAlign,
77
+ verticalAlign,
78
+ distribute,
79
+ xsReverse,
80
+ smReverse,
81
+ mdReverse,
82
+ lgReverse,
83
+ xlReverse,
84
+ children,
85
+ ...rest
86
+ } = _ref;
86
87
  const viewPort = useViewport();
87
88
  const reverseLevel = applyInheritance([xsReverse, smReverse, mdReverse, lgReverse, xlReverse]);
88
89
  let flexDirection = '';
@@ -19,13 +19,14 @@ export const selectHorizontalScrollTokens = (themeTokens, prefix) => selectToken
19
19
  * @TODO revisit `ScrollButton` after IconButton is stable.
20
20
  */
21
21
 
22
- const HorizontalScroll = /*#__PURE__*/forwardRef(({
23
- ScrollButton,
24
- tokens,
25
- itemPositions,
26
- children,
27
- ...rest
28
- }, ref) => {
22
+ const HorizontalScroll = /*#__PURE__*/forwardRef((_ref, ref) => {
23
+ let {
24
+ ScrollButton,
25
+ tokens,
26
+ itemPositions,
27
+ children,
28
+ ...rest
29
+ } = _ref;
29
30
  const {
30
31
  nextIcon,
31
32
  previousIcon,
@@ -42,25 +43,29 @@ const HorizontalScroll = /*#__PURE__*/forwardRef(({
42
43
 
43
44
  const handleContentWidth = width => setContentWidth(width);
44
45
 
45
- const handleContainerLayout = ({
46
- nativeEvent: {
47
- layout: {
48
- width
46
+ const handleContainerLayout = _ref2 => {
47
+ let {
48
+ nativeEvent: {
49
+ layout: {
50
+ width
51
+ }
49
52
  }
50
- }
51
- }) => setContainerWidth(width); // Update the scroll position only when scrolling actions ends to minimally rerender
53
+ } = _ref2;
54
+ return setContainerWidth(width);
55
+ }; // Update the scroll position only when scrolling actions ends to minimally rerender
52
56
  // and update which buttons are conditionally rendered.
53
57
 
54
58
 
55
59
  const [scrollOffset, setScrollOffset] = useState(0);
56
60
 
57
- const handleScrollEnd = ({
58
- nativeEvent: {
59
- contentOffset: {
60
- x
61
+ const handleScrollEnd = _ref3 => {
62
+ let {
63
+ nativeEvent: {
64
+ contentOffset: {
65
+ x
66
+ }
61
67
  }
62
- }
63
- }) => {
68
+ } = _ref3;
64
69
  setScrollOffset(x);
65
70
  };
66
71
 
@@ -8,11 +8,14 @@ import IconButton from '../IconButton';
8
8
  import dictionary from './dictionary';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
 
11
- const selectContainerStyles = ({
12
- offset
13
- }) => ({
14
- marginTop: offset ? -offset : 0
15
- });
11
+ const selectContainerStyles = _ref => {
12
+ let {
13
+ offset
14
+ } = _ref;
15
+ return {
16
+ marginTop: offset ? -offset : 0
17
+ };
18
+ };
16
19
  /**
17
20
  * Button within a Tabs component showing users that content is available to the left or
18
21
  * right, scrolling a screen's worth of content left or right when pressed.
@@ -23,15 +26,16 @@ const selectContainerStyles = ({
23
26
  */
24
27
 
25
28
 
26
- const HorizontalScrollButton = /*#__PURE__*/forwardRef(({
27
- direction = 'next',
28
- icon,
29
- offset,
30
- onPress,
31
- variant,
32
- tokens,
33
- copy
34
- }, ref) => {
29
+ const HorizontalScrollButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
30
+ let {
31
+ direction = 'next',
32
+ icon,
33
+ offset,
34
+ onPress,
35
+ variant,
36
+ tokens,
37
+ copy
38
+ } = _ref2;
35
39
  const themeTokens = useThemeTokens('HorizontalScrollButton', tokens, variant);
36
40
  const getCopy = useCopy({
37
41
  dictionary,
@@ -12,11 +12,12 @@ const DEBOUNCE_MS = 100;
12
12
  * https://github.com/necolas/react-native-web/issues/1021
13
13
  */
14
14
 
15
- const ScrollViewEnd = /*#__PURE__*/forwardRef(({
16
- onScrollEnd,
17
- onScroll,
18
- ...props
19
- }, ref) => {
15
+ const ScrollViewEnd = /*#__PURE__*/forwardRef((_ref, ref) => {
16
+ let {
17
+ onScrollEnd,
18
+ onScroll,
19
+ ...props
20
+ } = _ref;
20
21
  // Return debounced function directly from useCallback so it has .cancel method etc.
21
22
  // Linter complains this stops it automatically scanning the deps, but we can check them manually.
22
23
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -8,15 +8,18 @@ import ScrollView from "react-native-web/dist/exports/ScrollView";
8
8
  */
9
9
 
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
- const ScrollViewEnd = /*#__PURE__*/forwardRef(({
12
- onScrollEnd,
13
- ...props
14
- }, ref) => /*#__PURE__*/_jsx(ScrollView, {
15
- ref: ref,
16
- ...props,
17
- onScrollEndDrag: onScrollEnd,
18
- onMomentumScrollEnd: onScrollEnd
19
- }));
11
+ const ScrollViewEnd = /*#__PURE__*/forwardRef((_ref, ref) => {
12
+ let {
13
+ onScrollEnd,
14
+ ...props
15
+ } = _ref;
16
+ return /*#__PURE__*/_jsx(ScrollView, {
17
+ ref: ref,
18
+ ...props,
19
+ onScrollEndDrag: onScrollEnd,
20
+ onMomentumScrollEnd: onScrollEnd
21
+ });
22
+ });
20
23
  ScrollViewEnd.displayName = 'ScrollViewEnd';
21
24
  ScrollViewEnd.propTypes = {
22
25
  onScrollEnd: PropTypes.func.isRequired
@@ -29,15 +29,19 @@ import PropTypes from 'prop-types'; // Utilities to assist scrolling a parent so
29
29
  * @returns {number}
30
30
  */
31
31
 
32
- export const getItemPositionScrollTarget = (x, scrollMax, positions, buttonClearance = 0) => {
32
+ export const getItemPositionScrollTarget = function (x, scrollMax, positions) {
33
+ let buttonClearance = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
33
34
  if (x <= 0) return 0;
34
35
  if (x >= scrollMax) return scrollMax; // If not scrolling all the way to the start or end, stop
35
36
  // where the first item is not coverred by the scroll previous button
36
37
 
37
- const targetItem = Object.values(positions).find(({
38
- start,
39
- end
40
- }) => start <= x && end > x); // If there's no target item we're landing at a gap between items
38
+ const targetItem = Object.values(positions).find(_ref => {
39
+ let {
40
+ start,
41
+ end
42
+ } = _ref;
43
+ return start <= x && end > x;
44
+ }); // If there's no target item we're landing at a gap between items
41
45
 
42
46
  const targetX = targetItem ? targetItem.start : x;
43
47
  return Math.max(0, targetX - buttonClearance);
@@ -52,14 +56,16 @@ export const getItemPositionScrollTarget = (x, scrollMax, positions, buttonClear
52
56
  */
53
57
 
54
58
  export const getItemPositionLayoutHandler = (positions, index) => {
55
- const handleLayout = ({
56
- nativeEvent: {
57
- layout: {
58
- width,
59
- x
59
+ const handleLayout = _ref2 => {
60
+ let {
61
+ nativeEvent: {
62
+ layout: {
63
+ width,
64
+ x
65
+ }
60
66
  }
61
- }
62
- }) => {
67
+ } = _ref2;
68
+
63
69
  /* eslint-disable-next-line no-param-reassign */
64
70
  positions[index] = {
65
71
  start: x,
@@ -5,14 +5,15 @@ import PropTypes from 'prop-types';
5
5
  import { useThemeTokens } from '../ThemeProvider';
6
6
  import { getTokensPropType, scaleWithText, variantProp } from '../utils';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
- const Icon = /*#__PURE__*/forwardRef(({
9
- icon: IconComponent,
10
- accessibilityLabel,
11
- variant,
12
- tokens,
13
- scalesWithText = false,
14
- dataSet
15
- }, ref) => {
8
+ const Icon = /*#__PURE__*/forwardRef((_ref, ref) => {
9
+ let {
10
+ icon: IconComponent,
11
+ accessibilityLabel,
12
+ variant,
13
+ tokens,
14
+ scalesWithText = false,
15
+ dataSet
16
+ } = _ref;
16
17
  const themeTokens = useThemeTokens('Icon', tokens, variant);
17
18
  const size = scalesWithText ? scaleWithText(themeTokens.size) : themeTokens.size;
18
19
 
@@ -29,7 +30,7 @@ const Icon = /*#__PURE__*/forwardRef(({
29
30
  // TODO: systematise animations.
30
31
  // https://github.com/telus/universal-design-system/issues/487
31
32
  transition: 'transform 200ms, color 200ms',
32
- transform: [themeTokens.scale ? `scale(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' ')
33
+ transform: [themeTokens.scale ? "scale(".concat(themeTokens.scale, ")") : '', themeTokens.translateX ? "translateX(".concat(themeTokens.translateX, "px)") : '', themeTokens.translateY ? "translateY(".concat(themeTokens.translateY, "px)") : ''].filter(exists => exists).join(' ')
33
34
  },
34
35
  dataSet: dataSet,
35
36
  children: iconContent
@@ -15,15 +15,17 @@ import { spacingProps } from '../utils';
15
15
  */
16
16
 
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
- const IconText = /*#__PURE__*/forwardRef(({
19
- space,
20
- iconPosition = 'left',
21
- icon: IconComponent,
22
- iconProps,
23
- children
24
- }, ref) => {
18
+ const IconText = /*#__PURE__*/forwardRef((_ref, ref) => {
25
19
  var _iconProps$tokens;
26
20
 
21
+ let {
22
+ space,
23
+ iconPosition = 'left',
24
+ icon: IconComponent,
25
+ iconProps,
26
+ children
27
+ } = _ref;
28
+
27
29
  const iconContent = IconComponent && /*#__PURE__*/_jsx(Icon, {
28
30
  ref: ref,
29
31
  icon: IconComponent,