@telus-uds/components-base 0.0.2-prerelease.9 → 1.1.0

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 (293) hide show
  1. package/.eslintrc.js +9 -0
  2. package/.storybook/main.js +4 -0
  3. package/.storybook/preview.js +37 -0
  4. package/.ultra.cache.json +1 -1
  5. package/CHANGELOG.md +50 -0
  6. package/README.md +4 -2
  7. package/__fixtures__/test-utils.js +25 -0
  8. package/__fixtures__/testTheme.js +4 -2
  9. package/__tests__/Button/ButtonGroup.test.jsx +4 -5
  10. package/__tests__/Checkbox/Checkbox.test.jsx +2 -2
  11. package/__tests__/Checkbox/CheckboxGroup.test.jsx +4 -5
  12. package/__tests__/ExpandCollapse/ExpandCollapse.test.jsx +2 -2
  13. package/__tests__/HorizontalScroll/HorizontalScroll.test.jsx +164 -0
  14. package/__tests__/Link/LinkBase.test.jsx +0 -14
  15. package/__tests__/Radio/Radio.test.jsx +2 -2
  16. package/__tests__/Radio/RadioGroup.test.jsx +4 -5
  17. package/__tests__/RadioCard/RadioCard.test.jsx +2 -2
  18. package/__tests__/RadioCard/RadioCardGroup.test.jsx +4 -5
  19. package/__tests__/Search/Search.test.jsx +9 -8
  20. package/__tests__/Select/Select.test.jsx +3 -2
  21. package/__tests__/Tabs/Tabs.test.jsx +1 -161
  22. package/__tests__/Tags/Tags.test.jsx +4 -5
  23. package/__tests__/TextInput/TextArea.test.jsx +3 -2
  24. package/__tests__/TextInput/TextInputBase.test.jsx +10 -5
  25. package/__tests__/ThemeProvider/ThemeProvider.test.jsx +77 -0
  26. package/__tests__/ThemeProvider/useThemeTokens.test.jsx +9 -5
  27. package/__tests__/ThemeProvider/utils/theme-tokens.test.js +41 -0
  28. package/__tests__/ToggleSwitch/ToggleSwitch.test.jsx +3 -2
  29. package/__tests__/utils/children.test.jsx +128 -0
  30. package/__tests__/utils/input.test.js +1 -1
  31. package/__tests__/utils/semantics.test.jsx +43 -0
  32. package/babel.config.js +9 -16
  33. package/component-docs.json +10313 -0
  34. package/generate-component-docs.js +56 -0
  35. package/lib/A11yText/index.js +10 -5
  36. package/lib/ActivityIndicator/Spinner.js +16 -13
  37. package/lib/ActivityIndicator/Spinner.native.js +12 -8
  38. package/lib/Box/Box.js +103 -8
  39. package/lib/Button/Button.js +9 -8
  40. package/lib/Button/ButtonBase.js +14 -7
  41. package/lib/Button/ButtonGroup.js +25 -10
  42. package/lib/Button/ButtonLink.js +10 -7
  43. package/lib/Card/Card.js +2 -0
  44. package/lib/Card/CardBase.js +13 -5
  45. package/lib/Card/PressableCardBase.js +12 -8
  46. package/lib/Checkbox/Checkbox.js +25 -14
  47. package/lib/Checkbox/CheckboxGroup.js +22 -12
  48. package/lib/Divider/Divider.js +12 -7
  49. package/lib/ExpandCollapse/Accordion.js +10 -4
  50. package/lib/ExpandCollapse/Control.js +12 -6
  51. package/lib/ExpandCollapse/ExpandCollapse.js +10 -5
  52. package/lib/ExpandCollapse/Panel.js +8 -7
  53. package/lib/Feedback/Feedback.js +10 -5
  54. package/lib/Fieldset/Fieldset.js +10 -5
  55. package/lib/Fieldset/FieldsetContainer.js +10 -5
  56. package/lib/Fieldset/FieldsetContainer.native.js +10 -5
  57. package/lib/Fieldset/Legend.js +10 -5
  58. package/lib/Fieldset/Legend.native.js +10 -5
  59. package/lib/FlexGrid/Col/Col.js +8 -5
  60. package/lib/FlexGrid/FlexGrid.js +31 -6
  61. package/lib/FlexGrid/Row/Row.js +12 -5
  62. package/lib/{Tabs → HorizontalScroll}/HorizontalScroll.js +5 -4
  63. package/lib/{Tabs/TabsScrollButton.js → HorizontalScroll/HorizontalScrollButton.js} +14 -8
  64. package/lib/{Tabs → HorizontalScroll}/ScrollViewEnd.js +0 -0
  65. package/lib/{Tabs → HorizontalScroll}/ScrollViewEnd.native.js +0 -0
  66. package/lib/{Tabs → HorizontalScroll}/dictionary.js +0 -0
  67. package/lib/HorizontalScroll/index.js +35 -0
  68. package/lib/{Tabs → HorizontalScroll}/itemPositions.js +0 -0
  69. package/lib/Icon/Icon.js +16 -9
  70. package/lib/Icon/IconText.js +8 -7
  71. package/lib/IconButton/IconButton.js +10 -5
  72. package/lib/InputLabel/InputLabel.js +33 -5
  73. package/lib/InputLabel/LabelContent.js +22 -12
  74. package/lib/InputLabel/LabelContent.native.js +23 -5
  75. package/lib/InputSupports/InputSupports.js +10 -5
  76. package/lib/Link/ChevronLink.js +12 -5
  77. package/lib/Link/InlinePressable.js +10 -4
  78. package/lib/Link/InlinePressable.native.js +5 -4
  79. package/lib/Link/Link.js +12 -5
  80. package/lib/Link/LinkBase.js +12 -5
  81. package/lib/Link/TextButton.js +10 -5
  82. package/lib/List/List.js +6 -6
  83. package/lib/List/ListItem.js +28 -33
  84. package/lib/List/index.js +15 -0
  85. package/lib/Modal/Modal.js +10 -5
  86. package/lib/Notification/Notification.js +21 -5
  87. package/lib/Pagination/PageButton.js +16 -11
  88. package/lib/Pagination/Pagination.js +12 -7
  89. package/lib/Pagination/SideButton.js +12 -7
  90. package/lib/Pagination/usePagination.js +2 -2
  91. package/lib/Progress/Progress.js +10 -5
  92. package/lib/Progress/ProgressBar.js +21 -10
  93. package/lib/Progress/ProgressBarBackground.js +12 -8
  94. package/lib/Radio/Radio.js +14 -13
  95. package/lib/Radio/RadioButton.js +20 -9
  96. package/lib/Radio/RadioGroup.js +24 -13
  97. package/lib/RadioCard/RadioCard.js +14 -10
  98. package/lib/RadioCard/RadioCardGroup.js +13 -12
  99. package/lib/Search/Search.js +29 -18
  100. package/lib/Select/Picker.js +11 -6
  101. package/lib/Select/Picker.native.js +21 -6
  102. package/lib/Select/Select.js +46 -4
  103. package/lib/SideNav/Item.js +10 -5
  104. package/lib/SideNav/ItemsGroup.js +10 -5
  105. package/lib/SideNav/SideNav.js +11 -7
  106. package/lib/Skeleton/Skeleton.js +15 -15
  107. package/lib/Skeleton/skeletonWebAnimation.js +1 -1
  108. package/lib/Spacer/Spacer.js +19 -7
  109. package/lib/StackView/StackView.js +26 -7
  110. package/lib/StackView/StackWrap.js +24 -13
  111. package/lib/StackView/StackWrapBox.js +34 -8
  112. package/lib/StackView/StackWrapGap.js +16 -7
  113. package/lib/StackView/common.js +4 -2
  114. package/lib/StackView/getStackedContent.js +2 -2
  115. package/lib/StepTracker/StepTracker.js +10 -5
  116. package/lib/Tabs/Tabs.js +26 -19
  117. package/lib/Tabs/TabsItem.js +16 -12
  118. package/lib/Tags/Tags.js +27 -11
  119. package/lib/TextInput/TextArea.js +7 -5
  120. package/lib/TextInput/TextInput.js +12 -6
  121. package/lib/TextInput/TextInputBase.js +12 -8
  122. package/lib/ThemeProvider/ThemeProvider.js +14 -10
  123. package/lib/ThemeProvider/useSetTheme.js +6 -1
  124. package/lib/ThemeProvider/utils/styles.js +2 -2
  125. package/lib/ThemeProvider/utils/theme-tokens.js +39 -8
  126. package/lib/ToggleSwitch/ToggleSwitch.js +11 -6
  127. package/lib/Tooltip/Backdrop.js +10 -2
  128. package/lib/Tooltip/Tooltip.js +5 -4
  129. package/lib/Typography/Typography.js +40 -24
  130. package/lib/index.js +36 -1
  131. package/lib/utils/a11y/index.js +13 -0
  132. package/lib/utils/a11y/propTypes.js +61 -0
  133. package/lib/utils/a11y/propTypes.native.js +47 -0
  134. package/lib/utils/a11y/semantics.js +173 -0
  135. package/lib/utils/animation/useVerticalExpandAnimation.js +1 -1
  136. package/lib/utils/children.js +55 -8
  137. package/lib/utils/input.js +27 -17
  138. package/lib/utils/propTypes.js +40 -68
  139. package/lib/utils/useCopy.js +1 -1
  140. package/lib/utils/useHash.js +8 -4
  141. package/lib/utils/useSpacingScale.js +1 -3
  142. package/lib/utils/useUniqueId.js +1 -1
  143. package/package.json +14 -6
  144. package/release-context.json +4 -4
  145. package/src/A11yText/index.jsx +6 -4
  146. package/src/ActivityIndicator/Spinner.jsx +5 -3
  147. package/src/ActivityIndicator/Spinner.native.jsx +5 -3
  148. package/src/Box/Box.jsx +125 -39
  149. package/src/Button/Button.jsx +7 -4
  150. package/src/Button/ButtonBase.jsx +86 -77
  151. package/src/Button/ButtonGroup.jsx +81 -69
  152. package/src/Button/ButtonLink.jsx +18 -13
  153. package/src/Card/Card.jsx +2 -2
  154. package/src/Card/CardBase.jsx +6 -4
  155. package/src/Card/PressableCardBase.jsx +71 -64
  156. package/src/Checkbox/Checkbox.jsx +118 -108
  157. package/src/Checkbox/CheckboxGroup.jsx +72 -62
  158. package/src/Divider/Divider.jsx +7 -4
  159. package/src/ExpandCollapse/Accordion.jsx +3 -2
  160. package/src/ExpandCollapse/Control.jsx +40 -43
  161. package/src/ExpandCollapse/ExpandCollapse.jsx +26 -23
  162. package/src/ExpandCollapse/Panel.jsx +69 -63
  163. package/src/Feedback/Feedback.jsx +36 -33
  164. package/src/Fieldset/Fieldset.jsx +63 -56
  165. package/src/Fieldset/FieldsetContainer.jsx +14 -5
  166. package/src/Fieldset/FieldsetContainer.native.jsx +7 -4
  167. package/src/Fieldset/Legend.jsx +7 -2
  168. package/src/Fieldset/Legend.native.jsx +7 -2
  169. package/src/FlexGrid/Col/Col.jsx +139 -132
  170. package/src/FlexGrid/FlexGrid.jsx +79 -51
  171. package/src/FlexGrid/Row/Row.jsx +55 -48
  172. package/src/HorizontalScroll/HorizontalScroll.jsx +168 -0
  173. package/src/HorizontalScroll/HorizontalScrollButton.jsx +105 -0
  174. package/src/{Tabs → HorizontalScroll}/ScrollViewEnd.jsx +0 -0
  175. package/src/{Tabs → HorizontalScroll}/ScrollViewEnd.native.jsx +0 -0
  176. package/src/{Tabs → HorizontalScroll}/dictionary.js +0 -0
  177. package/src/HorizontalScroll/index.js +17 -0
  178. package/src/{Tabs → HorizontalScroll}/itemPositions.js +0 -0
  179. package/src/Icon/Icon.jsx +37 -35
  180. package/src/Icon/IconText.jsx +22 -17
  181. package/src/IconButton/IconButton.jsx +49 -42
  182. package/src/InputLabel/InputLabel.jsx +53 -38
  183. package/src/InputLabel/LabelContent.jsx +14 -6
  184. package/src/InputLabel/LabelContent.native.jsx +11 -2
  185. package/src/InputSupports/InputSupports.jsx +29 -34
  186. package/src/Link/ChevronLink.jsx +26 -16
  187. package/src/Link/InlinePressable.jsx +5 -3
  188. package/src/Link/InlinePressable.native.jsx +5 -3
  189. package/src/Link/Link.jsx +22 -16
  190. package/src/Link/LinkBase.jsx +67 -58
  191. package/src/Link/TextButton.jsx +30 -23
  192. package/src/List/List.jsx +6 -7
  193. package/src/List/ListItem.jsx +70 -90
  194. package/src/List/index.js +5 -0
  195. package/src/Modal/Modal.jsx +9 -4
  196. package/src/Notification/Notification.jsx +58 -43
  197. package/src/Pagination/PageButton.jsx +37 -34
  198. package/src/Pagination/Pagination.jsx +88 -92
  199. package/src/Pagination/SideButton.jsx +44 -41
  200. package/src/Progress/Progress.jsx +5 -4
  201. package/src/Progress/ProgressBar.jsx +42 -29
  202. package/src/Progress/ProgressBarBackground.jsx +5 -3
  203. package/src/Radio/Radio.jsx +85 -78
  204. package/src/Radio/RadioButton.jsx +54 -43
  205. package/src/Radio/RadioGroup.jsx +74 -63
  206. package/src/RadioCard/RadioCard.jsx +75 -68
  207. package/src/RadioCard/RadioCardGroup.jsx +82 -75
  208. package/src/Search/Search.jsx +127 -106
  209. package/src/Select/Picker.jsx +49 -42
  210. package/src/Select/Picker.native.jsx +56 -49
  211. package/src/Select/Select.jsx +115 -72
  212. package/src/SideNav/Item.jsx +53 -46
  213. package/src/SideNav/ItemsGroup.jsx +50 -43
  214. package/src/SideNav/SideNav.jsx +68 -60
  215. package/src/Skeleton/Skeleton.jsx +9 -13
  216. package/src/Spacer/Spacer.jsx +11 -4
  217. package/src/StackView/StackView.jsx +47 -23
  218. package/src/StackView/StackWrap.jsx +14 -12
  219. package/src/StackView/StackWrapBox.jsx +62 -28
  220. package/src/StackView/StackWrapGap.jsx +46 -24
  221. package/src/StackView/common.jsx +3 -2
  222. package/src/StepTracker/StepTracker.jsx +73 -62
  223. package/src/Tabs/Tabs.jsx +70 -62
  224. package/src/Tabs/TabsItem.jsx +111 -103
  225. package/src/Tags/Tags.jsx +114 -102
  226. package/src/TextInput/TextArea.jsx +5 -4
  227. package/src/TextInput/TextInput.jsx +5 -4
  228. package/src/TextInput/TextInputBase.jsx +84 -77
  229. package/src/ThemeProvider/ThemeProvider.jsx +11 -7
  230. package/src/ThemeProvider/useSetTheme.js +4 -0
  231. package/src/ThemeProvider/utils/theme-tokens.js +28 -0
  232. package/src/ToggleSwitch/ToggleSwitch.jsx +49 -50
  233. package/src/Tooltip/Tooltip.jsx +134 -130
  234. package/src/Typography/Typography.jsx +67 -44
  235. package/src/index.js +3 -1
  236. package/src/utils/a11y/index.js +1 -0
  237. package/src/utils/a11y/propTypes.js +61 -0
  238. package/src/utils/a11y/propTypes.native.js +39 -0
  239. package/src/utils/a11y/semantics.js +162 -0
  240. package/src/utils/children.jsx +60 -7
  241. package/src/utils/input.js +20 -17
  242. package/src/utils/propTypes.js +30 -76
  243. package/src/utils/useCopy.js +1 -1
  244. package/src/utils/useHash.js +8 -3
  245. package/stories/A11yText/A11yText.stories.jsx +3 -3
  246. package/stories/ActivityIndicator/ActivityIndicator.stories.jsx +2 -2
  247. package/stories/Box/Box.stories.jsx +2 -2
  248. package/stories/Button/Button.stories.jsx +3 -3
  249. package/stories/Button/ButtonGroup.stories.jsx +2 -2
  250. package/stories/Button/ButtonLink.stories.jsx +2 -2
  251. package/stories/Card/Card.stories.jsx +2 -2
  252. package/stories/Checkbox/Checkbox.stories.jsx +2 -2
  253. package/stories/Divider/Divider.stories.jsx +2 -2
  254. package/stories/ExpandCollapse/ExpandCollapse.stories.jsx +3 -3
  255. package/stories/Feedback/Feedback.stories.jsx +2 -2
  256. package/stories/FlexGrid/01 FlexGrid.stories.jsx +2 -2
  257. package/stories/FlexGrid/02 Row.stories.jsx +2 -2
  258. package/stories/FlexGrid/03 Col.stories.jsx +2 -2
  259. package/stories/Icon/Icon.stories.jsx +2 -2
  260. package/stories/IconButton/IconButton.stories.jsx +2 -2
  261. package/stories/InputLabel/InputLabel.stories.jsx +2 -2
  262. package/stories/Link/ChevronLink.stories.jsx +2 -2
  263. package/stories/Link/Link.stories.jsx +2 -2
  264. package/stories/Link/TextButton.stories.jsx +2 -2
  265. package/stories/List/List.stories.jsx +2 -2
  266. package/stories/Modal/Modal.stories.jsx +2 -2
  267. package/stories/Notification/Notification.stories.jsx +2 -2
  268. package/stories/Pagination/Pagination.stories.jsx +2 -2
  269. package/stories/Progress/Progress.stories.jsx +2 -2
  270. package/stories/Radio/Radio.stories.jsx +2 -2
  271. package/stories/RadioCard/RadioCard.stories.jsx +2 -2
  272. package/stories/Search/Search.stories.jsx +2 -2
  273. package/stories/Select/Select.stories.jsx +2 -2
  274. package/stories/SideNav/SideNav.stories.jsx +2 -2
  275. package/stories/SideNav/SideNavItem.stories.jsx +2 -2
  276. package/stories/SideNav/SideNavItemsGroup.stories.jsx +2 -2
  277. package/stories/Skeleton/Skeleton.stories.jsx +3 -3
  278. package/stories/Spacer/Spacer.stories.jsx +2 -2
  279. package/stories/StackView/StackView.stories.jsx +2 -2
  280. package/stories/StackView/StackWrap.stories.jsx +2 -2
  281. package/stories/StepTracker/StepTracker.stories.jsx +2 -2
  282. package/stories/Tabs/Tabs.stories.jsx +2 -2
  283. package/stories/Tags/Tags.stories.jsx +2 -2
  284. package/stories/TextInput/TextArea.stories.jsx +2 -2
  285. package/stories/TextInput/TextInput.stories.jsx +2 -2
  286. package/stories/ToggleSwitch/ToggleSwitch.stories.jsx +2 -2
  287. package/stories/Tooltip/Tooltip.stories.jsx +2 -2
  288. package/stories/TooltipButton/TooltipButton.stories.jsx +2 -2
  289. package/stories/Typography/Typography.stories.jsx +2 -2
  290. package/stories/platform-supports.jsx +1 -1
  291. package/stories/supports.jsx +4 -5
  292. package/src/Tabs/HorizontalScroll.jsx +0 -165
  293. package/src/Tabs/TabsScrollButton.jsx +0 -100
@@ -87,7 +87,7 @@ const selectIconTokens = ({
87
87
  */
88
88
 
89
89
 
90
- const Search = ({
90
+ const Search = /*#__PURE__*/(0, _react.forwardRef)(({
91
91
  initialValue = '',
92
92
  placeholder = 'Search',
93
93
  inactive,
@@ -98,7 +98,7 @@ const Search = ({
98
98
  copy = 'en',
99
99
  tokens,
100
100
  variant
101
- }) => {
101
+ }, ref) => {
102
102
  const [value, setValue] = (0, _react.useState)(initialValue);
103
103
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Search', tokens, variant);
104
104
  const buttonTokens = (0, _ThemeProvider.useThemeTokens)('SearchButton', tokens, variant);
@@ -118,26 +118,28 @@ const Search = ({
118
118
 
119
119
  const buttonsGapSize = (0, _utils.useSpacingScale)(buttonsGap);
120
120
 
121
- const handleSubmit = () => {
121
+ const handleSubmit = event => {
122
122
  if (onSubmit !== undefined) {
123
- onSubmit(value);
123
+ onSubmit(value, event);
124
124
  }
125
125
  };
126
126
 
127
- const handleChange = currentValue => {
128
- setValue(currentValue);
129
- if (onChange !== undefined) onChange(currentValue);
127
+ const handleChange = (currentValue, event) => {
128
+ setValue(currentValue, event);
129
+ if (onChange !== undefined) onChange(currentValue, event);
130
130
  };
131
131
 
132
- const handleClear = () => {
133
- setValue('');
134
- if (onClear !== undefined) onClear();
135
- if (onChange !== undefined) onChange('');
132
+ const handleClear = event => {
133
+ setValue('', event);
134
+ if (onClear !== undefined) onClear('', event);
135
+ if (onChange !== undefined) onChange('', event);
136
136
  };
137
137
 
138
138
  const isEmpty = value === '';
139
139
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
140
+ style: staticStyles.container,
140
141
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextInputBase.default, {
142
+ ref: ref,
141
143
  tokens: appearances => selectInputTokens({
142
144
  searchTokens: getThemeTokens(appearances),
143
145
  buttonTokens,
@@ -164,8 +166,7 @@ const Search = ({
164
166
  accessibilityRole: "button",
165
167
  accessibilityLabel: getCopy('clearButtonAccessibilityLabel'),
166
168
  tokens: appearances => selectButtonTokens(getButtonTokens(appearances)),
167
- children: buttonState => /*#__PURE__*/(0, _jsxRuntime.jsx)(ClearButtonIcon, {
168
- tokens: selectIconTokens(getButtonTokens(buttonState))
169
+ children: buttonState => /*#__PURE__*/(0, _jsxRuntime.jsx)(ClearButtonIcon, { ...selectIconTokens(getButtonTokens(buttonState))
169
170
  })
170
171
  }), SubmitButtonIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
171
172
  onPress: handleSubmit,
@@ -175,8 +176,7 @@ const Search = ({
175
176
  tokens: buttonState => selectButtonTokens(getButtonTokens({ ...buttonState,
176
177
  priority: 'high'
177
178
  })),
178
- children: buttonState => /*#__PURE__*/(0, _jsxRuntime.jsx)(SubmitButtonIcon, {
179
- tokens: selectIconTokens(getButtonTokens({ ...buttonState,
179
+ children: buttonState => /*#__PURE__*/(0, _jsxRuntime.jsx)(SubmitButtonIcon, { ...selectIconTokens(getButtonTokens({ ...buttonState,
180
180
  priority: 'high'
181
181
  }))
182
182
  })
@@ -184,8 +184,8 @@ const Search = ({
184
184
  })
185
185
  })]
186
186
  });
187
- };
188
-
187
+ });
188
+ Search.displayName = 'Search';
189
189
  Search.propTypes = {
190
190
  /**
191
191
  * Use this to set the initial value of the search input.
@@ -225,7 +225,16 @@ Search.propTypes = {
225
225
  * Use to provide an accessible label for the input (visually hidden).
226
226
  */
227
227
  accessibilityLabel: _propTypes.default.string,
228
- copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), _propTypes.default.object]),
228
+
229
+ /**
230
+ * Select english or french copy for the accessible labels.
231
+ * You may also pass in a custom dictionary object.
232
+ */
233
+ copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), _propTypes.default.shape({
234
+ accessibilityLabel: _propTypes.default.string,
235
+ clearButtonAccessibilityLabel: _propTypes.default.string,
236
+ submitButtonAccessibilityLabel: _propTypes.default.string
237
+ })]),
229
238
  tokens: (0, _utils.getTokensPropType)('Search'),
230
239
  variant: _utils.variantProp.propType
231
240
  };
@@ -233,6 +242,8 @@ var _default = Search;
233
242
  exports.default = _default;
234
243
 
235
244
  const staticStyles = _StyleSheet.default.create({
245
+ container: {// No styles needed here except the View defaults (position: relative etc)
246
+ },
236
247
  iconsContainer: {
237
248
  position: 'absolute',
238
249
  right: 0,
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -15,7 +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 Picker = ({
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
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
+
22
+ const Picker = /*#__PURE__*/(0, _react.forwardRef)(({
19
23
  value,
20
24
  onChange,
21
25
  onFocus,
@@ -29,13 +33,14 @@ const Picker = ({
29
33
  nativeID,
30
34
  testID,
31
35
  ...rest
32
- }) => {
36
+ }, ref) => {
33
37
  const {
34
38
  accessibilityLabel,
35
39
  accessibilityDescribedBy,
36
40
  accessibilityInvalid
37
41
  } = rest;
38
42
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
43
+ ref: ref,
39
44
  style: style,
40
45
  onMouseOver: onMouseOver,
41
46
  onMouseOut: onMouseOut,
@@ -43,7 +48,7 @@ const Picker = ({
43
48
  onBlur: onBlur,
44
49
  disabled: inactive,
45
50
  value: value || (placeholder !== undefined ? placeholder.value : undefined),
46
- onChange: event => onChange(event.target.value),
51
+ onChange: event => onChange(event.target.value, event),
47
52
  id: nativeID,
48
53
  "aria-label": accessibilityLabel,
49
54
  "aria-describedby": accessibilityDescribedBy,
@@ -56,8 +61,8 @@ const Picker = ({
56
61
  children: placeholder.label
57
62
  }), children]
58
63
  });
59
- };
60
-
64
+ });
65
+ Picker.displayName = 'Picker';
61
66
  var _default = Picker;
62
67
  exports.default = _default;
63
68
  Picker.propTypes = {
@@ -50,7 +50,7 @@ const selectAndroidContainerStyles = ({
50
50
  ...rest
51
51
  });
52
52
 
53
- const Picker = ({
53
+ const Picker = /*#__PURE__*/(0, _react.forwardRef)(({
54
54
  value,
55
55
  onChange,
56
56
  onFocus,
@@ -60,7 +60,7 @@ const Picker = ({
60
60
  children,
61
61
  placeholder,
62
62
  ...rest
63
- }) => {
63
+ }, ref) => {
64
64
  // ungroup items, since there's no way to support groups on native
65
65
  const flatChildren = _react.Children.toArray(children).flatMap(child => {
66
66
  if (child.type === _Group.default) {
@@ -75,15 +75,30 @@ const Picker = ({
75
75
  }) => ({
76
76
  label: props.children,
77
77
  value: props.value
78
- }));
78
+ })); // Unlike other input components, react-native-picker-select doesn't pass an event to its change fn.
79
+
80
+ const handleChange = (newValue, index) => {
81
+ if (onChange) onChange(newValue, {
82
+ // TODO: see if it's possible to pass a real React SyntheticEvent here. For now, just pass an
83
+ // object with a shape where if an onChange deconstructs `event.nativeEvent`, it won't crash.
84
+ nativeEvent: {
85
+ index,
86
+ value: newValue
87
+ }
88
+ });
89
+ };
90
+
79
91
  const picker = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativePickerSelect.default, {
92
+ pickerProps: {
93
+ ref
94
+ },
80
95
  touchableWrapperProps: _utils.a11yProps.select(rest),
81
96
  onOpen: onFocus,
82
97
  onClose: onBlur,
83
98
  disabled: inactive,
84
99
  items: items,
85
100
  value: value,
86
- onValueChange: onChange,
101
+ onValueChange: handleChange,
87
102
  style: {
88
103
  inputIOS: style,
89
104
  inputAndroid: selectAndroidInputStyles(style)
@@ -96,8 +111,8 @@ const Picker = ({
96
111
  children: picker
97
112
  }) : picker
98
113
  });
99
- };
100
-
114
+ });
115
+ Picker.displayName = 'Picker';
101
116
  var _default = Picker;
102
117
  exports.default = _default;
103
118
  Picker.propTypes = {
@@ -185,7 +185,7 @@ const selectValidationIconContainerStyles = ({
185
185
  */
186
186
 
187
187
 
188
- const Select = ({
188
+ const Select = /*#__PURE__*/(0, _react.forwardRef)(({
189
189
  value,
190
190
  initialValue,
191
191
  onChange,
@@ -198,7 +198,7 @@ const Select = ({
198
198
  variant,
199
199
  testID,
200
200
  ...rest
201
- }) => {
201
+ }, ref) => {
202
202
  const {
203
203
  currentValue,
204
204
  setValue
@@ -241,6 +241,7 @@ const Select = ({
241
241
  }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
242
242
  style: selectOuterBorderStyles(themeTokens),
243
243
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Picker.default, {
244
+ ref: ref,
244
245
  style: selectInputStyles(themeTokens, inactive),
245
246
  onFocus: handleFocus,
246
247
  onBlur: handleBlur,
@@ -274,18 +275,59 @@ const Select = ({
274
275
  })]
275
276
  })
276
277
  });
277
- };
278
-
278
+ });
279
+ Select.displayName = 'Select';
279
280
  Select.propTypes = { ..._propTypes2.default.types,
281
+
282
+ /**
283
+ * Initial value for the uncontrolled version.
284
+ */
280
285
  initialValue: _propTypes.default.string,
286
+
287
+ /**
288
+ * Current value to be set as selected.
289
+ */
281
290
  value: _propTypes.default.string,
291
+
292
+ /**
293
+ * Callback to be called when the value changes.
294
+ */
282
295
  onChange: _propTypes.default.func,
296
+
297
+ /**
298
+ * An array of items or item groups to be used as options.
299
+ */
283
300
  children: (0, _utils.componentPropType)(['Item', 'Group']),
301
+
302
+ /**
303
+ * Whether the select is disabled.
304
+ */
284
305
  inactive: _propTypes.default.bool,
306
+
307
+ /**
308
+ * Whether the select is read-only.
309
+ */
285
310
  readOnly: _propTypes.default.bool,
311
+
312
+ /**
313
+ * A placeholder to provide instructions (such as "Please select...")
314
+ * as an unselectable option
315
+ */
286
316
  placeholder: _propTypes.default.string,
317
+
318
+ /**
319
+ * Select tokens.
320
+ */
287
321
  tokens: (0, _utils.getTokensPropType)('Select'),
322
+
323
+ /**
324
+ * Select variant.
325
+ */
288
326
  variant: _utils.variantProp.propType,
327
+
328
+ /**
329
+ * Dedicated ID for testing.
330
+ */
289
331
  testID: _propTypes.default.string
290
332
  };
291
333
  var _default = Select;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
11
11
 
@@ -21,6 +21,10 @@ var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+
26
+ 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; }
27
+
24
28
  function selectItemStyles({
25
29
  backgroundColor,
26
30
  borderColor,
@@ -53,7 +57,7 @@ function selectItemStyles({
53
57
  */
54
58
 
55
59
 
56
- const Item = ({
60
+ const Item = /*#__PURE__*/(0, _react.forwardRef)(({
57
61
  children,
58
62
  itemId,
59
63
  groupId,
@@ -66,7 +70,7 @@ const Item = ({
66
70
  accessibilityRole = 'link',
67
71
  testID,
68
72
  ...props
69
- }) => {
73
+ }, ref) => {
70
74
  const handlePress = () => onPress(itemId, groupId);
71
75
 
72
76
  const {
@@ -95,6 +99,7 @@ const Item = ({
95
99
  const getPressableStyle = pressableState => selectItemStyles(getTokens(getAppearanceState(pressableState)));
96
100
 
97
101
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
102
+ ref: ref,
98
103
  style: getPressableStyle,
99
104
  ...linkPropSet,
100
105
  accessibilityState: {
@@ -109,8 +114,8 @@ const Item = ({
109
114
  });
110
115
  }
111
116
  });
112
- };
113
-
117
+ });
118
+ Item.displayName = 'Item';
114
119
  Item.propTypes = {
115
120
  /**
116
121
  * Text content of the `Item`.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -21,6 +21,10 @@ var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+
26
+ 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; }
27
+
24
28
  /**
25
29
  Expandable content areas for use within `SideNav`.
26
30
 
@@ -31,7 +35,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
31
35
  ## Usage Criteria
32
36
  - Use `SideNav.ItemsGroup` with large pages that have multiple sections
33
37
  */
34
- const ItemsGroup = ({
38
+ const ItemsGroup = /*#__PURE__*/(0, _react.forwardRef)(({
35
39
  children,
36
40
  label,
37
41
  openGroups,
@@ -41,7 +45,7 @@ const ItemsGroup = ({
41
45
  tokens,
42
46
  itemTokens,
43
47
  onToggle
44
- }) => {
48
+ }, ref) => {
45
49
  // A SideNav control uses the same style and theme as SideNavItem, with a 'parent' variant,
46
50
  // plus control-specific tokens from the SideNavItemsGroup theme (e.g. open/close icon, etc).
47
51
  const getAppearance = appearance => ({ ...variant,
@@ -74,6 +78,7 @@ const ItemsGroup = ({
74
78
  };
75
79
 
76
80
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandCollapse.default.Panel, {
81
+ ref: ref,
77
82
  openIds: openGroups,
78
83
  panelId: groupId,
79
84
  onToggle: onToggle,
@@ -86,8 +91,8 @@ const ItemsGroup = ({
86
91
  ,
87
92
  children: children
88
93
  });
89
- };
90
-
94
+ });
95
+ ItemsGroup.displayName = 'ItemsGroup';
91
96
  ItemsGroup.propTypes = {
92
97
  /**
93
98
  * Specifies the links contained within. It may only contain `SideNav.Item`.
@@ -41,14 +41,14 @@ function selectBorderStyles(tokens) {
41
41
  */
42
42
 
43
43
 
44
- const SideNav = ({
44
+ const SideNav = /*#__PURE__*/(0, _react.forwardRef)(({
45
45
  children,
46
46
  variant = {},
47
47
  tokens,
48
48
  accordion = true,
49
49
  itemTokens,
50
50
  groupTokens
51
- }) => {
51
+ }, ref) => {
52
52
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('SideNav', tokens, variant);
53
53
  const [active, setActive] = (0, _react.useState)({
54
54
  groupId: undefined,
@@ -67,6 +67,7 @@ const SideNav = ({
67
67
  };
68
68
 
69
69
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandCollapse.default, {
70
+ ref: ref,
70
71
  maxOpen: accordion ? 1 : null,
71
72
  style: selectBorderStyles(themeTokens),
72
73
  children: ({
@@ -75,7 +76,7 @@ const SideNav = ({
75
76
  }) => {
76
77
  const renderItem = (item, index, groupId) => {
77
78
  const {
78
- itemId = "item-".concat(index),
79
+ itemId = `item-${index}`,
79
80
  onPress
80
81
  } = item.props;
81
82
 
@@ -103,9 +104,12 @@ const SideNav = ({
103
104
 
104
105
  if (child.type === _ItemsGroup.default) {
105
106
  const {
106
- groupId = "group-".concat(index)
107
+ groupId = `group-${index}`
107
108
  } = child.props;
108
109
  const isGroupActive = active.itemId !== undefined && active.groupId === groupId;
110
+
111
+ const handleToggle = event => onToggle(groupId, event);
112
+
109
113
  return /*#__PURE__*/(0, _react.createElement)(_ItemsGroup.default, { ...child.props,
110
114
  key: groupId,
111
115
  groupId: groupId,
@@ -114,7 +118,7 @@ const SideNav = ({
114
118
  itemTokens: itemTokens,
115
119
  openGroups: openIds,
116
120
  isActive: isGroupActive,
117
- onToggle: () => onToggle(groupId)
121
+ onToggle: handleToggle
118
122
  }, _react.default.Children.map(child.props.children, (item, itemIndex) => renderItem(item, itemIndex, groupId)));
119
123
  }
120
124
 
@@ -122,8 +126,8 @@ const SideNav = ({
122
126
  });
123
127
  }
124
128
  });
125
- };
126
-
129
+ });
130
+ SideNav.displayName = 'SideNav';
127
131
  SideNav.propTypes = {
128
132
  /**
129
133
  * Specifies the structure and links of the `SideNav`. It may only consist of `SideNav.Item` and `SideNav.ItemsGroup`.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _Animated = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Animated"));
11
11
 
@@ -27,6 +27,10 @@ var _jsxRuntime = require("react/jsx-runtime");
27
27
 
28
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
29
 
30
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
+
32
+ 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; }
33
+
30
34
  const selectSkeletonStyles = ({
31
35
  color,
32
36
  radius,
@@ -58,14 +62,14 @@ const selectSquareStyles = ({
58
62
  borderRadius: radius
59
63
  });
60
64
 
61
- const Skeleton = ({
65
+ const Skeleton = /*#__PURE__*/(0, _react.forwardRef)(({
62
66
  tokens,
63
67
  variant,
64
68
  size,
65
69
  characters,
66
70
  lines,
67
71
  shape = 'line'
68
- }) => {
72
+ }, ref) => {
69
73
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Skeleton', tokens, variant);
70
74
  const skeletonHeight = (0, _utils.useSpacingScale)(size || themeTokens.size);
71
75
  const nativeAnimation = (0, _useSkeletonNativeAnimation.default)();
@@ -112,19 +116,15 @@ const Skeleton = ({
112
116
  style: [selectSkeletonStyles({ ...themeTokens,
113
117
  fadeAnimation: getAnimationBaseOnPlatform()
114
118
  }), getStyledBasedOnShape()]
115
- }, "skeleton-".concat(index + 1));
116
-
117
- if (lines) {
118
- const arrayOfSkeletons = [...Array(lines)];
119
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
120
- space: themeTokens.spaceBetweenLines,
121
- children: arrayOfSkeletons.map((_, index) => renderSkeleton(index))
122
- });
123
- }
124
-
125
- return renderSkeleton();
126
- };
119
+ }, `skeleton-${index + 1}`);
127
120
 
121
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
122
+ space: themeTokens.spaceBetweenLines,
123
+ ref: ref,
124
+ children: lines > 1 ? [...Array(lines)].map((_, index) => renderSkeleton(index)) : renderSkeleton()
125
+ });
126
+ });
127
+ Skeleton.displayName = 'Skeleton';
128
128
  Skeleton.propTypes = {
129
129
  tokens: (0, _utils.getTokensPropType)('Skeleton'),
130
130
  variant: _utils.variantProp.propType,
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _skeleton = require("./skeleton.constant");
9
9
 
10
10
  var _default = {
11
- animationDuration: "".concat(_skeleton.ANIMATION_DURATION, "ms"),
11
+ animationDuration: `${_skeleton.ANIMATION_DURATION}ms`,
12
12
  animationTimingFunction: 'ease-in-out',
13
13
  animationDelay: '0.5s',
14
14
  animationIterationCount: 'infinite',
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -19,6 +19,10 @@ var _jsxRuntime = require("react/jsx-runtime");
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ 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; }
25
+
22
26
  /**
23
27
  * @typedef {import('../utils/propTypes.js').SpacingValue} SpacingValue
24
28
  * @typedef {import('../utils/propTypes.js').SpacingObject} SpacingObject
@@ -70,19 +74,22 @@ const selectSizeStyle = (size, direction) => ({
70
74
  */
71
75
 
72
76
 
73
- const Spacer = ({
77
+ const Spacer = /*#__PURE__*/(0, _react.forwardRef)(({
74
78
  space = 1,
75
79
  direction = 'column',
76
- testID
77
- }) => {
80
+ testID,
81
+ dataSet
82
+ }, ref) => {
78
83
  const size = (0, _utils.useSpacingScale)(space);
79
84
  const sizeStyle = selectSizeStyle(size, direction);
80
85
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
86
+ ref: ref,
81
87
  testID: testID,
82
- style: [staticStyles.stretch, sizeStyle]
88
+ style: [staticStyles.stretch, sizeStyle],
89
+ dataSet: dataSet
83
90
  });
84
- };
85
-
91
+ });
92
+ Spacer.displayName = 'Spacer';
86
93
  Spacer.propTypes = {
87
94
  /**
88
95
  * The size of the spacer according to the theme's spacing scale.
@@ -99,6 +106,11 @@ Spacer.propTypes = {
99
106
  */
100
107
  direction: _propTypes.default.oneOf(['column', 'row']),
101
108
 
109
+ /**
110
+ * @ignore
111
+ */
112
+ dataSet: _propTypes.default.object,
113
+
102
114
  /**
103
115
  * @ignore
104
116
  * In tests, the only way to select Spacers is with testID prop and getByTestId, since they have no content,