@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
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.selectRadioButtonTokens = void 0;
6
+ exports.selectRadioButtonTokens = exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
 
@@ -40,69 +40,79 @@ exports.selectRadioButtonTokens = selectRadioButtonTokens;
40
40
 
41
41
  const getBorderRadius = inputSize => inputSize / 2;
42
42
 
43
- const selectCheckedStyles = ({
44
- checkedBackgroundColor,
45
- checkedSize
46
- }) => ({
47
- backgroundColor: checkedBackgroundColor,
48
- borderRadius: checkedSize / 2,
49
- height: checkedSize,
50
- width: checkedSize
51
- });
43
+ const selectCheckedStyles = _ref => {
44
+ let {
45
+ checkedBackgroundColor,
46
+ checkedSize
47
+ } = _ref;
48
+ return {
49
+ backgroundColor: checkedBackgroundColor,
50
+ borderRadius: checkedSize / 2,
51
+ height: checkedSize,
52
+ width: checkedSize
53
+ };
54
+ };
52
55
 
53
- const selectInputStyles = ({
54
- inputBackgroundColor,
55
- inputBorderColor,
56
- inputBorderWidth,
57
- inputOutlineColor,
58
- inputOutlineWidth,
59
- inputSize
60
- }) => ({
61
- borderColor: inputBorderColor,
62
- borderRadius: getBorderRadius(inputSize),
63
- borderWidth: inputBorderWidth,
64
- backgroundColor: inputBackgroundColor,
65
- height: inputSize,
66
- width: inputSize,
67
- ..._Platform.default.select({
68
- web: {
69
- outlineStyle: 'solid',
70
- outlineColor: inputOutlineColor,
71
- outlineWidth: inputOutlineWidth
72
- }
73
- })
74
- });
56
+ const selectInputStyles = _ref2 => {
57
+ let {
58
+ inputBackgroundColor,
59
+ inputBorderColor,
60
+ inputBorderWidth,
61
+ inputOutlineColor,
62
+ inputOutlineWidth,
63
+ inputSize
64
+ } = _ref2;
65
+ return {
66
+ borderColor: inputBorderColor,
67
+ borderRadius: getBorderRadius(inputSize),
68
+ borderWidth: inputBorderWidth,
69
+ backgroundColor: inputBackgroundColor,
70
+ height: inputSize,
71
+ width: inputSize,
72
+ ..._Platform.default.select({
73
+ web: {
74
+ outlineStyle: 'solid',
75
+ outlineColor: inputOutlineColor,
76
+ outlineWidth: inputOutlineWidth
77
+ }
78
+ })
79
+ };
80
+ };
75
81
 
76
- const selectOuterBorderStyles = ({
77
- outerBorderColor,
78
- outerBorderWidth,
79
- outerBorderGap,
80
- inputSize
81
- }) => ({ ...(0, _ThemeProvider.applyOuterBorder)({
82
+ const selectOuterBorderStyles = _ref3 => {
83
+ let {
82
84
  outerBorderColor,
83
85
  outerBorderWidth,
84
86
  outerBorderGap,
85
- borderRadius: getBorderRadius(inputSize)
86
- })
87
- });
87
+ inputSize
88
+ } = _ref3;
89
+ return { ...(0, _ThemeProvider.applyOuterBorder)({
90
+ outerBorderColor,
91
+ outerBorderWidth,
92
+ outerBorderGap,
93
+ borderRadius: getBorderRadius(inputSize)
94
+ })
95
+ };
96
+ };
88
97
  /**
89
98
  * The visual toggle of a radio input. Is not interactive on its own, should be used inside
90
99
  * an interactive parent that passes down props when interacted with.
91
100
  */
92
101
 
93
102
 
94
- const RadioButton = /*#__PURE__*/(0, _react.forwardRef)(({
95
- isChecked,
96
- tokens,
97
- inactive,
98
- defaultChecked,
99
- inputId,
100
- isControlled,
101
- handleChange,
102
- name: inputName,
103
- value,
104
- ...rest
105
- }, ref) => {
103
+ const RadioButton = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
104
+ let {
105
+ isChecked,
106
+ tokens,
107
+ inactive,
108
+ defaultChecked,
109
+ inputId,
110
+ isControlled,
111
+ handleChange,
112
+ name: inputName,
113
+ value,
114
+ ...rest
115
+ } = _ref4;
106
116
  const themeTokens = (0, _ThemeProvider.validateThemeTokens)((0, _ThemeProvider.resolveThemeTokens)(tokens, {
107
117
  checked: isChecked
108
118
  }), (0, _utils.getTokensSetPropType)(tokenKeys), 'RadioButton');
@@ -82,25 +82,26 @@ const [selectItemProps, selectedItemPropTypes] = (0, _utils.selectSystemProps)([
82
82
  * ```
83
83
  */
84
84
 
85
- const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
86
- copy = 'en',
87
- tokens,
88
- radioTokens,
89
- variant,
90
- items = [],
91
- legend,
92
- tooltip,
93
- hint,
94
- validation,
95
- feedback,
96
- initialCheckedId,
97
- checkedId,
98
- onChange,
99
- readOnly,
100
- name: inputGroupName,
101
- inactive,
102
- ...rest
103
- }, ref) => {
85
+ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
86
+ let {
87
+ copy = 'en',
88
+ tokens,
89
+ radioTokens,
90
+ variant,
91
+ items = [],
92
+ legend,
93
+ tooltip,
94
+ hint,
95
+ validation,
96
+ feedback,
97
+ initialCheckedId,
98
+ checkedId,
99
+ onChange,
100
+ readOnly,
101
+ name: inputGroupName,
102
+ inactive,
103
+ ...rest
104
+ } = _ref;
104
105
  const viewport = (0, _ViewportProvider.useViewport)();
105
106
  const {
106
107
  space,
@@ -120,17 +121,18 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
120
121
  const uniqueFields = ['id', 'label'];
121
122
 
122
123
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
123
- throw new Error(`RadioGroup items must have unique ${uniqueFields.join(', ')}`);
124
+ throw new Error("RadioGroup items must have unique ".concat(uniqueFields.join(', ')));
124
125
  }
125
126
 
126
- const radios = items.map(({
127
- label,
128
- id,
129
- onChange: itemOnChange,
130
- ref: itemRef,
131
- ...itemRest
132
- }, index) => {
133
- const radioId = id || `Radio[${index}]`;
127
+ const radios = items.map((_ref2, index) => {
128
+ let {
129
+ label,
130
+ id,
131
+ onChange: itemOnChange,
132
+ ref: itemRef,
133
+ ...itemRest
134
+ } = _ref2;
135
+ const radioId = id || "Radio[".concat(index, "]");
134
136
  const isChecked = currentValue === radioId;
135
137
 
136
138
  const handleChange = (newCheckedState, event) => {
@@ -20,16 +20,18 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
20
20
  /**
21
21
  * On Web we need to include an actual input but hide it.
22
22
  */
23
- const RadioInput = /*#__PURE__*/(0, _react.forwardRef)(({
24
- checked,
25
- defaultChecked,
26
- disabled,
27
- id,
28
- isControlled,
29
- name,
30
- onChange,
31
- value
32
- }, ref) => {
23
+ const RadioInput = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
24
+ let {
25
+ checked,
26
+ defaultChecked,
27
+ disabled,
28
+ id,
29
+ isControlled,
30
+ name,
31
+ onChange,
32
+ value
33
+ } = _ref;
34
+
33
35
  const handleClick = event => {
34
36
  // Cancel the click dispatched via the label tag, since it's already wrapped
35
37
  // in <Pressable>
@@ -70,20 +70,21 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
70
70
  * or the internal state in case of uncontrolled radio button.
71
71
  */
72
72
 
73
- const RadioCard = /*#__PURE__*/(0, _react.forwardRef)(({
74
- tokens,
75
- variant,
76
- title,
77
- children,
78
- inactive,
79
- defaultChecked,
80
- checked,
81
- name: inputName,
82
- value,
83
- id,
84
- onChange,
85
- ...rest
86
- }, ref) => {
73
+ const RadioCard = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
74
+ let {
75
+ tokens,
76
+ variant,
77
+ title,
78
+ children,
79
+ inactive,
80
+ defaultChecked,
81
+ checked,
82
+ name: inputName,
83
+ value,
84
+ id,
85
+ onChange,
86
+ ...rest
87
+ } = _ref;
87
88
  const {
88
89
  currentValue: isChecked,
89
90
  setValue: setIsChecked,
@@ -101,7 +102,7 @@ const RadioCard = /*#__PURE__*/(0, _react.forwardRef)(({
101
102
  };
102
103
 
103
104
  const uniqueId = (0, _utils.useUniqueId)('RadioCard');
104
- const inputId = id ?? uniqueId;
105
+ const inputId = id !== null && id !== void 0 ? id : uniqueId;
105
106
  const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('RadioCard', tokens, variant);
106
107
 
107
108
  const getCardTokens = cardState => (0, _Card.selectPressableCardTokens)(getTokens(cardState));
@@ -82,25 +82,26 @@ const [selectItemProps, selectedItemPropTypes] = (0, _utils.selectSystemProps)([
82
82
  * ```
83
83
  */
84
84
 
85
- const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
86
- copy = 'en',
87
- tokens,
88
- radioCardTokens,
89
- variant,
90
- items = [],
91
- legend,
92
- tooltip,
93
- hint,
94
- validation,
95
- feedback,
96
- initialCheckedId,
97
- checkedId,
98
- onChange,
99
- readOnly,
100
- name: inputGroupName,
101
- inactive,
102
- ...rest
103
- }, ref) => {
85
+ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
86
+ let {
87
+ copy = 'en',
88
+ tokens,
89
+ radioCardTokens,
90
+ variant,
91
+ items = [],
92
+ legend,
93
+ tooltip,
94
+ hint,
95
+ validation,
96
+ feedback,
97
+ initialCheckedId,
98
+ checkedId,
99
+ onChange,
100
+ readOnly,
101
+ name: inputGroupName,
102
+ inactive,
103
+ ...rest
104
+ } = _ref;
104
105
  const viewport = (0, _ViewportProvider.useViewport)();
105
106
  const {
106
107
  space,
@@ -125,7 +126,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
125
126
  const uniqueFields = ['id'];
126
127
 
127
128
  if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
128
- throw new Error(`RadioCardGroup items must have unique ${uniqueFields.join(', ')}`);
129
+ throw new Error("RadioCardGroup items must have unique ".concat(uniqueFields.join(', ')));
129
130
  }
130
131
 
131
132
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, {
@@ -144,14 +145,15 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
144
145
  children: props => /*#__PURE__*/(0, _jsxRuntime.jsx)(StackContainer, {
145
146
  space: space,
146
147
  accessibilityRole: "radiogroup",
147
- children: items.map(({
148
- title,
149
- content,
150
- id,
151
- onChange: itemOnChange,
152
- ...itemRest
153
- }, index) => {
154
- const cardId = id || `RadioCard[${index}]`;
148
+ children: items.map((_ref2, index) => {
149
+ let {
150
+ title,
151
+ content,
152
+ id,
153
+ onChange: itemOnChange,
154
+ ...itemRest
155
+ } = _ref2;
156
+ const cardId = id || "RadioCard[".concat(index, "]");
155
157
 
156
158
  const handleChange = (newCheckedState, event) => {
157
159
  if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
@@ -38,11 +38,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
38
38
  const [selectContainerProps, selectedContainerPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
39
39
  const [selectInputProps, selectedInputPropTypes] = (0, _utils.selectSystemProps)([_utils.textInputHandlerProps, _utils.textInputProps]);
40
40
 
41
- const selectInputTokens = ({
42
- searchTokens,
43
- buttonTokens,
44
- buttonsGapSize
45
- }) => {
41
+ const selectInputTokens = _ref => {
42
+ let {
43
+ searchTokens,
44
+ buttonTokens,
45
+ buttonsGapSize
46
+ } = _ref;
46
47
  const {
47
48
  paddingRight: inputPaddingRight,
48
49
  clearButtonIcon,
@@ -62,19 +63,25 @@ const selectInputTokens = ({
62
63
 
63
64
  const selectButtonTokens = tokens => (0, _utils.selectTokens)('Button', tokens);
64
65
 
65
- const selectIconsContainerStyle = ({
66
- paddingRight
67
- }) => ({
68
- paddingRight
69
- });
66
+ const selectIconsContainerStyle = _ref2 => {
67
+ let {
68
+ paddingRight
69
+ } = _ref2;
70
+ return {
71
+ paddingRight
72
+ };
73
+ };
70
74
 
71
- const selectIconTokens = ({
72
- iconSize,
73
- iconColor
74
- }) => ({
75
- color: iconColor,
76
- size: iconSize
77
- });
75
+ const selectIconTokens = _ref3 => {
76
+ let {
77
+ iconSize,
78
+ iconColor
79
+ } = _ref3;
80
+ return {
81
+ color: iconColor,
82
+ size: iconSize
83
+ };
84
+ };
78
85
  /**
79
86
  * The `Search` component is a combination of a `TextInput` and 2 different kinds of custom buttons.
80
87
  * Use `Search` to feature autocomplete interactions.
@@ -90,20 +97,22 @@ const selectIconTokens = ({
90
97
  */
91
98
 
92
99
 
93
- const Search = /*#__PURE__*/(0, _react.forwardRef)(({
94
- initialValue,
95
- value,
96
- placeholder,
97
- inactive,
98
- onChange,
99
- onSubmit,
100
- onClear,
101
- accessibilityLabel,
102
- copy = 'en',
103
- tokens,
104
- variant,
105
- ...rest
106
- }, ref) => {
100
+ const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
101
+ let {
102
+ initialValue,
103
+ value,
104
+ placeholder,
105
+ inactive,
106
+ onChange,
107
+ onSubmit,
108
+ onClear,
109
+ onFocus,
110
+ accessibilityLabel,
111
+ copy = 'en',
112
+ tokens,
113
+ variant,
114
+ ...rest
115
+ } = _ref4;
107
116
  const {
108
117
  currentValue = '',
109
118
  setValue
@@ -141,11 +150,15 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)(({
141
150
  if (onClear !== undefined) onClear('', event);
142
151
  };
143
152
 
153
+ const handleFocus = event => {
154
+ if (onFocus !== undefined) onFocus(event);
155
+ };
156
+
144
157
  const isEmpty = currentValue === ''; // Accessibility label should always be present and correctly localised
145
158
 
146
159
  const a11yLabelText = accessibilityLabel || getCopy('accessibilityLabel'); // Placeholder is optional and may be unset by passing an empty string
147
160
 
148
- const placeholderText = placeholder ?? a11yLabelText;
161
+ const placeholderText = placeholder !== null && placeholder !== void 0 ? placeholder : a11yLabelText;
149
162
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
150
163
  style: staticStyles.container,
151
164
  ...selectContainerProps(rest),
@@ -165,6 +178,7 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)(({
165
178
  value: currentValue,
166
179
  onChange: setValue,
167
180
  onSubmitEditing: handleSubmit,
181
+ onFocus: handleFocus,
168
182
  accessibilityLabel: a11yLabelText
169
183
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
170
184
  style: [staticStyles.iconsContainer, selectIconsContainerStyle(themeTokens)],
@@ -235,6 +249,12 @@ Search.propTypes = { ...selectedContainerPropTypes,
235
249
  onClear: _propTypes.default.func,
236
250
 
237
251
  /**
252
+ * Triggered when the search input is focused.
253
+ */
254
+ onFocus: _propTypes.default.func,
255
+
256
+ /**
257
+ *
238
258
  * Use to provide an accessible label for the input (visually hidden).
239
259
  */
240
260
  accessibilityLabel: _propTypes.default.string,
@@ -15,10 +15,11 @@ var _jsxRuntime = require("react/jsx-runtime");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
- const Group = ({
19
- children,
20
- label
21
- }) => {
18
+ const Group = _ref => {
19
+ let {
20
+ children,
21
+ label
22
+ } = _ref;
22
23
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("optgroup", {
23
24
  label: label,
24
25
  children: children
@@ -11,9 +11,10 @@ var _utils = require("../utils");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- const Group = ({
15
- children
16
- }) => {
14
+ const Group = _ref => {
15
+ let {
16
+ children
17
+ } = _ref;
17
18
  return children;
18
19
  };
19
20
 
@@ -13,13 +13,16 @@ var _jsxRuntime = require("react/jsx-runtime");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- const Item = ({
17
- children,
18
- value
19
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
20
- value: value,
21
- children: children
22
- });
16
+ const Item = _ref => {
17
+ let {
18
+ children,
19
+ value
20
+ } = _ref;
21
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
22
+ value: value,
23
+ children: children
24
+ });
25
+ };
23
26
 
24
27
  var _default = Item;
25
28
  exports.default = _default;
@@ -5,15 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
8
  const Item = () => null;
13
9
 
14
10
  var _default = Item;
15
- exports.default = _default;
16
- Item.propTypes = {
17
- children: _propTypes.default.string.isRequired,
18
- value: _propTypes.default.string.isRequired
19
- };
11
+ exports.default = _default;
@@ -19,21 +19,22 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
21
 
22
- const Picker = /*#__PURE__*/(0, _react.forwardRef)(({
23
- value,
24
- onChange,
25
- onFocus,
26
- onBlur,
27
- onMouseOver,
28
- onMouseOut,
29
- style,
30
- inactive,
31
- children,
32
- placeholder,
33
- nativeID,
34
- testID,
35
- ...rest
36
- }, ref) => {
22
+ const Picker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
23
+ let {
24
+ value,
25
+ onChange,
26
+ onFocus,
27
+ onBlur,
28
+ onMouseOver,
29
+ onMouseOut,
30
+ style,
31
+ inactive,
32
+ children,
33
+ placeholder,
34
+ nativeID,
35
+ testID,
36
+ ...rest
37
+ } = _ref;
37
38
  const {
38
39
  accessibilityLabel,
39
40
  accessibilityDescribedBy,