@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
@@ -18,17 +18,18 @@ export const selectPressableCardTokens = tokens => Object.fromEntries(tokenKeys.
18
18
  * apps or sites directly: build themed components on top of this.
19
19
  */
20
20
 
21
- const PressableCardBase = /*#__PURE__*/forwardRef(({
22
- children,
23
- tokens,
24
- checked,
25
- validation,
26
- inactive,
27
- href,
28
- hrefAttrs,
29
- accessibilityRole = href ? 'link' : undefined,
30
- ...rawRest
31
- }, ref) => {
21
+ const PressableCardBase = /*#__PURE__*/forwardRef((_ref, ref) => {
22
+ let {
23
+ children,
24
+ tokens,
25
+ checked,
26
+ validation,
27
+ inactive,
28
+ href,
29
+ hrefAttrs,
30
+ accessibilityRole = href ? 'link' : undefined,
31
+ ...rawRest
32
+ } = _ref;
32
33
  const {
33
34
  onPress,
34
35
  ...rest
@@ -16,71 +16,83 @@ import { jsx as _jsx } from "react/jsx-runtime";
16
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
17
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, viewProps]);
18
18
 
19
- const selectInputStyles = ({
20
- iconBackgroundColor,
21
- inputBorderColor,
22
- inputBorderRadius,
23
- inputBorderWidth,
24
- inputBackgroundColor,
25
- inputHeight,
26
- inputOutlineColor,
27
- inputOutlineWidth,
28
- inputShadow,
29
- inputWidth
30
- }, isChecked) => ({
31
- borderColor: inputBorderColor,
32
- borderWidth: inputBorderWidth,
33
- borderRadius: inputBorderRadius,
34
- backgroundColor: isChecked ? iconBackgroundColor : inputBackgroundColor,
35
- height: inputHeight,
36
- width: inputWidth,
37
- ...applyShadowToken(inputShadow),
38
- ...Platform.select({
39
- web: {
40
- outlineStyle: 'solid',
41
- outlineColor: inputOutlineColor,
42
- outlineWidth: inputOutlineWidth
43
- }
44
- })
45
- });
19
+ const selectInputStyles = (_ref, isChecked) => {
20
+ let {
21
+ iconBackgroundColor,
22
+ inputBorderColor,
23
+ inputBorderRadius,
24
+ inputBorderWidth,
25
+ inputBackgroundColor,
26
+ inputHeight,
27
+ inputOutlineColor,
28
+ inputOutlineWidth,
29
+ inputShadow,
30
+ inputWidth
31
+ } = _ref;
32
+ return {
33
+ borderColor: inputBorderColor,
34
+ borderWidth: inputBorderWidth,
35
+ borderRadius: inputBorderRadius,
36
+ backgroundColor: isChecked ? iconBackgroundColor : inputBackgroundColor,
37
+ height: inputHeight,
38
+ width: inputWidth,
39
+ ...applyShadowToken(inputShadow),
40
+ ...Platform.select({
41
+ web: {
42
+ outlineStyle: 'solid',
43
+ outlineColor: inputOutlineColor,
44
+ outlineWidth: inputOutlineWidth
45
+ }
46
+ })
47
+ };
48
+ };
46
49
 
47
- const selectLabelStyles = ({
48
- labelColor,
49
- labelFontName,
50
- labelFontSize,
51
- labelFontWeight,
52
- labelMarginLeft,
53
- labelLineHeight
54
- }) => ({
55
- marginLeft: labelMarginLeft,
56
- ...applyTextStyles({
57
- color: labelColor,
58
- fontName: labelFontName,
59
- fontWeight: labelFontWeight,
60
- fontSize: labelFontSize,
61
- lineHeight: labelLineHeight
62
- })
63
- });
50
+ const selectLabelStyles = _ref2 => {
51
+ let {
52
+ labelColor,
53
+ labelFontName,
54
+ labelFontSize,
55
+ labelFontWeight,
56
+ labelMarginLeft,
57
+ labelLineHeight
58
+ } = _ref2;
59
+ return {
60
+ marginLeft: labelMarginLeft,
61
+ ...applyTextStyles({
62
+ color: labelColor,
63
+ fontName: labelFontName,
64
+ fontWeight: labelFontWeight,
65
+ fontSize: labelFontSize,
66
+ lineHeight: labelLineHeight
67
+ })
68
+ };
69
+ };
64
70
 
65
- const selectIconTokens = ({
66
- icon,
67
- iconColor,
68
- iconSize
69
- }) => ({
70
- icon,
71
- color: iconColor,
72
- size: iconSize
73
- });
71
+ const selectIconTokens = _ref3 => {
72
+ let {
73
+ icon,
74
+ iconColor,
75
+ iconSize
76
+ } = _ref3;
77
+ return {
78
+ icon,
79
+ color: iconColor,
80
+ size: iconSize
81
+ };
82
+ };
74
83
 
75
- const selectFeedbackTokens = ({
76
- feedbackMarginBottom,
77
- feedbackMarginTop,
78
- feedbackPosition
79
- }) => ({
80
- feedbackPosition,
81
- feedbackMarginBottom,
82
- feedbackMarginTop
83
- });
84
+ const selectFeedbackTokens = _ref4 => {
85
+ let {
86
+ feedbackMarginBottom,
87
+ feedbackMarginTop,
88
+ feedbackPosition
89
+ } = _ref4;
90
+ return {
91
+ feedbackPosition,
92
+ feedbackMarginBottom,
93
+ feedbackMarginTop
94
+ };
95
+ };
84
96
  /**
85
97
  * Basic Checkbox component.
86
98
  *
@@ -118,21 +130,22 @@ const selectFeedbackTokens = ({
118
130
  */
119
131
 
120
132
 
121
- const Checkbox = /*#__PURE__*/forwardRef(({
122
- checked,
123
- defaultChecked,
124
- error = false,
125
- feedback,
126
- id,
127
- inactive,
128
- label,
129
- name,
130
- onChange,
131
- tokens,
132
- value,
133
- variant,
134
- ...rest
135
- }, ref) => {
133
+ const Checkbox = /*#__PURE__*/forwardRef((_ref5, ref) => {
134
+ let {
135
+ checked,
136
+ defaultChecked,
137
+ error = false,
138
+ feedback,
139
+ id,
140
+ inactive,
141
+ label,
142
+ name,
143
+ onChange,
144
+ tokens,
145
+ value,
146
+ variant,
147
+ ...rest
148
+ } = _ref5;
136
149
  const {
137
150
  currentValue: isChecked,
138
151
  setValue: setIsChecked,
@@ -173,7 +186,7 @@ const Checkbox = /*#__PURE__*/forwardRef(({
173
186
  };
174
187
 
175
188
  const uniqueId = useUniqueId('checkbox');
176
- const inputId = id ?? uniqueId;
189
+ const inputId = id !== null && id !== void 0 ? id : uniqueId;
177
190
  return /*#__PURE__*/_jsx(View, {
178
191
  style: staticStyles.wrapper,
179
192
  ref: ref,
@@ -190,11 +203,12 @@ const Checkbox = /*#__PURE__*/forwardRef(({
190
203
  disabled: inactive
191
204
  },
192
205
  ...selectProps(rest),
193
- children: ({
194
- focused: focus,
195
- hovered: hover,
196
- pressed
197
- }) => {
206
+ children: _ref6 => {
207
+ let {
208
+ focused: focus,
209
+ hovered: hover,
210
+ pressed
211
+ } = _ref6;
198
212
  const {
199
213
  icon: IconComponent,
200
214
  ...stateTokens
@@ -58,24 +58,25 @@ const [selectItemProps, selectedItemPropTypes] = selectSystemProps([a11yProps, f
58
58
  * ```
59
59
  */
60
60
 
61
- const CheckboxGroup = /*#__PURE__*/forwardRef(({
62
- tokens,
63
- radioTokens,
64
- variant,
65
- items = [],
66
- legend,
67
- tooltip,
68
- hint,
69
- validation,
70
- feedback,
71
- initialCheckedIds,
72
- checkedIds,
73
- onChange,
74
- readOnly,
75
- name: inputGroupName,
76
- inactive,
77
- ...rest
78
- }, ref) => {
61
+ const CheckboxGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
62
+ let {
63
+ tokens,
64
+ radioTokens,
65
+ variant,
66
+ items = [],
67
+ legend,
68
+ tooltip,
69
+ hint,
70
+ validation,
71
+ feedback,
72
+ initialCheckedIds,
73
+ checkedIds,
74
+ onChange,
75
+ readOnly,
76
+ name: inputGroupName,
77
+ inactive,
78
+ ...rest
79
+ } = _ref;
79
80
  const viewport = useViewport();
80
81
  const {
81
82
  space,
@@ -95,17 +96,18 @@ const CheckboxGroup = /*#__PURE__*/forwardRef(({
95
96
  const uniqueFields = ['id', 'label'];
96
97
 
97
98
  if (!containUniqueFields(items, uniqueFields)) {
98
- throw new Error(`CheckboxGroup items must have unique ${uniqueFields.join(', ')}`);
99
+ throw new Error("CheckboxGroup items must have unique ".concat(uniqueFields.join(', ')));
99
100
  }
100
101
 
101
- const checkboxes = items.map(({
102
- label,
103
- id,
104
- onChange: itemOnChange,
105
- ref: itemRef,
106
- ...itemRest
107
- }, index) => {
108
- const checkboxId = id || `Checkbox[${index}]`;
102
+ const checkboxes = items.map((_ref2, index) => {
103
+ let {
104
+ label,
105
+ id,
106
+ onChange: itemOnChange,
107
+ ref: itemRef,
108
+ ...itemRest
109
+ } = _ref2;
110
+ const checkboxId = id || "Checkbox[".concat(index, "]");
109
111
 
110
112
  const handleChange = (newCheckedState, event) => {
111
113
  if (typeof itemOnChange === 'function') itemOnChange(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 CheckboxInput = /*#__PURE__*/forwardRef(({
9
- checked,
10
- defaultChecked,
11
- disabled,
12
- id,
13
- isControlled,
14
- name,
15
- onChange,
16
- value
17
- }, ref) => {
8
+ const CheckboxInput = /*#__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>
@@ -52,13 +52,14 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
52
52
  * For accessibility purposes a divider component will be described with ARIA attributes, i.e. `role="separator"` and `aria-orientation="vertical/horizontal"`.
53
53
  */
54
54
 
55
- const Divider = /*#__PURE__*/forwardRef(({
56
- variant,
57
- vertical = false,
58
- space,
59
- tokens,
60
- ...rest
61
- }, ref) => {
55
+ const Divider = /*#__PURE__*/forwardRef((_ref, ref) => {
56
+ let {
57
+ variant,
58
+ vertical = false,
59
+ space,
60
+ tokens,
61
+ ...rest
62
+ } = _ref;
62
63
  const {
63
64
  color,
64
65
  width
@@ -97,9 +98,9 @@ const Divider = /*#__PURE__*/forwardRef(({
97
98
  };
98
99
  return /*#__PURE__*/_jsxs(_Fragment, {
99
100
  children: [/*#__PURE__*/_jsx(Spacer, { ...spacerProps,
100
- testID: testID ? `${testID}-Spacer-before` : undefined
101
+ testID: testID ? "".concat(testID, "-Spacer-before") : undefined
101
102
  }), divider, /*#__PURE__*/_jsx(Spacer, { ...spacerProps,
102
- testID: testID ? `${testID}-Spacer-after` : undefined
103
+ testID: testID ? "".concat(testID, "-Spacer-after") : undefined
103
104
  })]
104
105
  });
105
106
  });
@@ -9,19 +9,20 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
10
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
11
11
 
12
- function selectContainerStyles({
13
- backgroundColor,
14
- borderColor,
15
- borderWidth,
16
- borderStyle,
17
- paddingLeft,
18
- paddingRight,
19
- paddingTop,
20
- paddingBottom,
21
- justifyContent,
22
- verticalAlign,
23
- iconPosition
24
- }) {
12
+ function selectContainerStyles(_ref) {
13
+ let {
14
+ backgroundColor,
15
+ borderColor,
16
+ borderWidth,
17
+ borderStyle,
18
+ paddingLeft,
19
+ paddingRight,
20
+ paddingTop,
21
+ paddingBottom,
22
+ justifyContent,
23
+ verticalAlign,
24
+ iconPosition
25
+ } = _ref;
25
26
  return {
26
27
  backgroundColor,
27
28
  borderTopColor: borderColor,
@@ -37,10 +38,11 @@ function selectContainerStyles({
37
38
  } // TODO: use stack / spacer when available
38
39
 
39
40
 
40
- function selectIconContainerStyles({
41
- iconGap,
42
- iconPosition
43
- }) {
41
+ function selectIconContainerStyles(_ref2) {
42
+ let {
43
+ iconGap,
44
+ iconPosition
45
+ } = _ref2;
44
46
  const paddingSide = iconPosition === 'right' ? 'paddingLeft' : 'paddingRight';
45
47
  return {
46
48
  [paddingSide]: iconGap
@@ -54,15 +56,16 @@ function selectIconTokens(tokens) {
54
56
  };
55
57
  }
56
58
 
57
- const ExpandCollapseControl = /*#__PURE__*/forwardRef(({
58
- onPress,
59
- isExpanded,
60
- children,
61
- tokens,
62
- accessibilityRole = 'button',
63
- variant,
64
- ...rest
65
- }, ref) => {
59
+ const ExpandCollapseControl = /*#__PURE__*/forwardRef((_ref3, ref) => {
60
+ let {
61
+ onPress,
62
+ isExpanded,
63
+ children,
64
+ tokens,
65
+ accessibilityRole = 'button',
66
+ variant,
67
+ ...rest
68
+ } = _ref3;
66
69
  const getTokens = useThemeTokensCallback('ExpandCollapseControl', tokens, variant);
67
70
  const selectedProps = selectProps({ ...rest,
68
71
  accessibilityRole
@@ -71,16 +74,19 @@ const ExpandCollapseControl = /*#__PURE__*/forwardRef(({
71
74
  expanded: isExpanded
72
75
  };
73
76
 
74
- const getControlState = ({
75
- pressed,
76
- hovered,
77
- focused
78
- }) => ({
79
- pressed,
80
- hover: hovered,
81
- focus: focused,
82
- expanded: isExpanded
83
- });
77
+ const getControlState = _ref4 => {
78
+ let {
79
+ pressed,
80
+ hovered,
81
+ focused
82
+ } = _ref4;
83
+ return {
84
+ pressed,
85
+ hover: hovered,
86
+ focus: focused,
87
+ expanded: isExpanded
88
+ };
89
+ };
84
90
 
85
91
  const getControlTokens = pressableState => getTokens(getControlState(pressableState));
86
92
 
@@ -22,16 +22,17 @@ function selectBorderStyles(tokens) {
22
22
  */
23
23
 
24
24
 
25
- const ExpandCollapse = /*#__PURE__*/forwardRef(({
26
- children,
27
- tokens,
28
- variant,
29
- maxOpen,
30
- open,
31
- initialOpen,
32
- onChange,
33
- ...rest
34
- }, ref) => {
25
+ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref, ref) => {
26
+ let {
27
+ children,
28
+ tokens,
29
+ variant,
30
+ maxOpen,
31
+ open,
32
+ initialOpen,
33
+ onChange,
34
+ ...rest
35
+ } = _ref;
35
36
  const {
36
37
  currentValues: openIds,
37
38
  toggleOneValue: onToggle,
@@ -1,7 +1,6 @@
1
1
  import React, { forwardRef, useState } from 'react';
2
2
  import Animated from "react-native-web/dist/exports/Animated";
3
3
  import Platform from "react-native-web/dist/exports/Platform";
4
- import StyleSheet from "react-native-web/dist/exports/StyleSheet";
5
4
  import View from "react-native-web/dist/exports/View";
6
5
  import PropTypes from 'prop-types';
7
6
  import ExpandCollapseControl from './Control';
@@ -13,17 +12,20 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
13
12
 
14
13
  const selectGroupStyles = () => {};
15
14
 
16
- const selectContainerStyles = ({
17
- contentPaddingLeft,
18
- contentPaddingRight,
19
- contentPaddingTop,
20
- contentPaddingBottom
21
- }) => ({
22
- paddingLeft: contentPaddingLeft,
23
- paddingRight: contentPaddingRight,
24
- paddingTop: contentPaddingTop,
25
- paddingBottom: contentPaddingBottom
26
- });
15
+ const selectContainerStyles = _ref => {
16
+ let {
17
+ contentPaddingLeft,
18
+ contentPaddingRight,
19
+ contentPaddingTop,
20
+ contentPaddingBottom
21
+ } = _ref;
22
+ return {
23
+ paddingLeft: contentPaddingLeft,
24
+ paddingRight: contentPaddingRight,
25
+ paddingTop: contentPaddingTop,
26
+ paddingBottom: contentPaddingBottom
27
+ };
28
+ };
27
29
  /**
28
30
  * An item in an `ExpandCollapse` which contains collapsible `children` and a `control` that opens
29
31
  * and closes the collapsible children when pressed.
@@ -36,18 +38,19 @@ const selectContainerStyles = ({
36
38
  */
37
39
 
38
40
 
39
- const ExpandCollapsePanel = /*#__PURE__*/forwardRef(({
40
- openIds = [],
41
- panelId,
42
- onToggle,
43
- onPress,
44
- control,
45
- controlTokens,
46
- children,
47
- tokens,
48
- variant,
49
- ...rest
50
- }, ref) => {
41
+ const ExpandCollapsePanel = /*#__PURE__*/forwardRef((_ref2, ref) => {
42
+ let {
43
+ openIds = [],
44
+ panelId,
45
+ onToggle,
46
+ onPress,
47
+ control,
48
+ controlTokens,
49
+ children,
50
+ tokens,
51
+ variant,
52
+ ...rest
53
+ } = _ref2;
51
54
  const [containerHeight, setContainerHeight] = useState(null);
52
55
  const isExpanded = openIds.includes(panelId);
53
56
  const selectedProps = selectProps(rest);
@@ -79,13 +82,7 @@ const ExpandCollapsePanel = /*#__PURE__*/forwardRef(({
79
82
  containerHeight,
80
83
  isExpanded,
81
84
  tokens: themeTokens
82
- }); // on web we can hide the contents until we have the container measured and avoid occasional jitter
83
- // this won't work on native platforms
84
-
85
- const overflowContainerStyles = containerHeight === null && Platform.OS === 'web' ? {
86
- height: 0,
87
- visibility: 'hidden'
88
- } : undefined;
85
+ });
89
86
  const focusabilityProps = isExpanded ? {} : a11yProps.nonFocusableProps;
90
87
  return /*#__PURE__*/_jsxs(View, {
91
88
  ref: ref,
@@ -97,7 +94,7 @@ const ExpandCollapsePanel = /*#__PURE__*/forwardRef(({
97
94
  children: control
98
95
  }), /*#__PURE__*/_jsx(Animated.View, {
99
96
  ref: animatedRef,
100
- style: [overflowContainerStyles, animatedStyles, staticStyles.itemsContainer],
97
+ style: animatedStyles,
101
98
  ...focusabilityProps,
102
99
  children: /*#__PURE__*/_jsx(View, {
103
100
  onLayout: onContainerLayout,
@@ -151,9 +148,4 @@ ExpandCollapsePanel.propTypes = { ...selectedSystemPropTypes,
151
148
  */
152
149
  controlTokens: getTokensPropType('ExpandCollapseControl')
153
150
  };
154
- const staticStyles = StyleSheet.create({
155
- itemsContainer: {
156
- overflow: 'hidden'
157
- }
158
- });
159
151
  export default ExpandCollapsePanel;