@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
package/lib/Tags/Tags.js CHANGED
@@ -5,10 +5,12 @@ 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
 
12
+ var _airbnbPropTypes = _interopRequireDefault(require("airbnb-prop-types"));
13
+
12
14
  var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
13
15
 
14
16
  var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
@@ -35,6 +37,10 @@ var _jsxRuntime = require("react/jsx-runtime");
35
37
 
36
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
39
 
40
+ 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); }
41
+
42
+ 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; }
43
+
38
44
  const selectIconTextTokens = ({
39
45
  icon,
40
46
  iconPosition,
@@ -71,7 +77,7 @@ const selectIconTextTokens = ({
71
77
  }
72
78
  });
73
79
 
74
- const Tags = ({
80
+ const Tags = /*#__PURE__*/(0, _react.forwardRef)(({
75
81
  variant,
76
82
  tokens,
77
83
  items = [],
@@ -86,7 +92,7 @@ const Tags = ({
86
92
  default: 'none'
87
93
  }),
88
94
  ...rest
89
- }) => {
95
+ }, ref) => {
90
96
  const viewport = (0, _ViewportProvider.useViewport)();
91
97
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Tags', tokens, variant, {
92
98
  viewport
@@ -117,14 +123,17 @@ const Tags = ({
117
123
  });
118
124
 
119
125
  const itemA11yRole = 'checkbox';
120
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.StackWrap, { ...a11y,
126
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.StackWrap, {
127
+ ref: ref,
128
+ ...a11y,
121
129
  space: space,
122
130
  direction: direction,
123
131
  tokens: stackTokens,
124
132
  children: items.map(({
125
133
  label,
126
134
  id = label,
127
- accessibilityLabel
135
+ accessibilityLabel,
136
+ ref: itemRef
128
137
  }, index) => {
129
138
  const isSelected = currentValues.includes(id); // Pass an object of relevant component state as first argument for any passed-in press handlers
130
139
 
@@ -134,9 +143,9 @@ const Tags = ({
134
143
  currentValues
135
144
  }]);
136
145
 
137
- const handlePress = () => {
146
+ const handlePress = event => {
138
147
  if (pressHandlers.onPress) pressHandlers.onPress();
139
- toggleOneValue(id);
148
+ toggleOneValue(id, event);
140
149
  };
141
150
 
142
151
  const itemA11y = {
@@ -147,7 +156,9 @@ const Tags = ({
147
156
  accessibilityLabel,
148
157
  ..._propTypes2.a11yProps.getPositionInSet(items.length, index)
149
158
  };
150
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, { ...pressHandlers,
159
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
160
+ ref: itemRef,
161
+ ...pressHandlers,
151
162
  onPress: handlePress,
152
163
  tokens: getButtonTokens,
153
164
  selected: isSelected,
@@ -189,8 +200,8 @@ const Tags = ({
189
200
  }, id);
190
201
  })
191
202
  });
192
- };
193
-
203
+ });
204
+ Tags.displayName = 'Tags';
194
205
  Tags.propTypes = { ..._propTypes2.a11yProps.propTypes,
195
206
  ..._propTypes2.pressProps.propTypes,
196
207
  tokens: (0, _propTypes2.getTokensPropType)('Tags'),
@@ -222,7 +233,12 @@ Tags.propTypes = { ..._propTypes2.a11yProps.propTypes,
222
233
  * which will be used in code and passed to any onChange function.
223
234
  * If not provided, the label is used.
224
235
  */
225
- id: _propTypes.default.string
236
+ id: _propTypes.default.string,
237
+
238
+ /**
239
+ * An optional ref for one individual Tag button in the tags
240
+ */
241
+ ref: _airbnbPropTypes.default.ref()
226
242
  })),
227
243
 
228
244
  /**
@@ -53,11 +53,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
53
53
  * or an indicator that the field is optional.
54
54
  * It is a more usable and accessible option than the HTML `placeholder` attribute.
55
55
  */
56
- function TextArea({
56
+ const TextArea = /*#__PURE__*/(0, _react.forwardRef)(({
57
57
  tokens,
58
58
  variant = {},
59
59
  ...remainingProps
60
- }) {
60
+ }, ref) => {
61
61
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('TextArea', tokens, variant);
62
62
  const [inputHeight, setInputHeight] = (0, _react.useState)(); // adjust the text area's height as new lines are added to the content
63
63
 
@@ -92,13 +92,15 @@ function TextArea({
92
92
  children: ({
93
93
  a11yProps,
94
94
  inputId
95
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextInputBase.default, { ...inputProps,
95
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextInputBase.default, {
96
+ ref: ref,
97
+ ...inputProps,
96
98
  ...a11yProps,
97
99
  nativeID: inputId
98
100
  })
99
101
  });
100
- }
101
-
102
+ });
103
+ TextArea.displayName = 'TextArea';
102
104
  TextArea.propTypes = { ..._propTypes.default.types,
103
105
  ..._propTypes2.default,
104
106
  tokens: (0, _utils.getTokensPropType)('TextArea', 'TextInput'),
@@ -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 _utils = require("../utils");
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
  * A basic text input component. Use in forms or individually to receive user's input.
26
30
  * Due to React Native's implementation of `TextInput` it's not possible to access the current value by passing a ref.
@@ -39,11 +43,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
39
43
  * supported props and <a href="https://reactnative.dev/docs/textinput" target="_blank">React Native Web documentation</a> for
40
44
  * their implementation on the web.
41
45
  */
42
- function TextInput({
46
+ const TextInput = /*#__PURE__*/(0, _react.forwardRef)(({
43
47
  tokens,
44
48
  variant = {},
45
49
  ...remainingProps
46
- }) {
50
+ }, ref) => {
47
51
  const {
48
52
  props: supportsProps,
49
53
  rest
@@ -59,13 +63,15 @@ function TextInput({
59
63
  children: ({
60
64
  a11yProps,
61
65
  inputId
62
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextInputBase.default, { ...inputProps,
66
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextInputBase.default, {
67
+ ref: ref,
68
+ ...inputProps,
63
69
  ...a11yProps,
64
70
  nativeID: inputId
65
71
  })
66
72
  });
67
- }
68
-
73
+ });
74
+ TextInput.displayName = 'TextInput';
69
75
  TextInput.propTypes = { ..._propTypes.default.types,
70
76
  ..._propTypes2.default,
71
77
  tokens: (0, _utils.getTokensPropType)('TextInput'),
@@ -130,7 +130,7 @@ const selectIconContainerStyles = ({
130
130
  paddingBottom
131
131
  });
132
132
 
133
- function TextInputBase({
133
+ const TextInputBase = /*#__PURE__*/(0, _react.forwardRef)(({
134
134
  value,
135
135
  height,
136
136
  initialValue,
@@ -145,7 +145,7 @@ function TextInputBase({
145
145
  tokens,
146
146
  variant = {},
147
147
  ...remainingProps
148
- }) {
148
+ }, ref) => {
149
149
  const [isFocused, setIsFocused] = (0, _react.useState)(false);
150
150
 
151
151
  const handleFocus = event => {
@@ -181,9 +181,12 @@ function TextInputBase({
181
181
  readOnly
182
182
  });
183
183
 
184
- const handleChangeText = text => {
185
- setValue(text);
186
- if (typeof onChangeText === 'function') onChangeText(text);
184
+ const handleChangeText = event => {
185
+ var _event$nativeEvent, _event$target;
186
+
187
+ const text = ((_event$nativeEvent = event.nativeEvent) === null || _event$nativeEvent === void 0 ? void 0 : _event$nativeEvent.text) || ((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value);
188
+ setValue(text, event);
189
+ if (typeof onChangeText === 'function') onChangeText(text, event);
187
190
  };
188
191
 
189
192
  const states = {
@@ -201,7 +204,7 @@ function TextInputBase({
201
204
  onBlur: handleBlur,
202
205
  onMouseOver: handleMouseOver,
203
206
  onMouseOut: handleMouseOut,
204
- onChangeText: handleChangeText,
207
+ onChange: handleChangeText,
205
208
  defaultValue: initialValue,
206
209
  // currentValue is being updated even if the input is not controlled, passing it down to the
207
210
  // Input could lead to changing its state from uncontrolled to controlled
@@ -213,6 +216,7 @@ function TextInputBase({
213
216
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
214
217
  style: selectOuterBorderStyles(themeTokens),
215
218
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextInput.default, {
219
+ ref: ref,
216
220
  style: nativeInputStyle,
217
221
  ...inputProps
218
222
  }), IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
@@ -223,8 +227,8 @@ function TextInputBase({
223
227
  })
224
228
  })]
225
229
  });
226
- }
227
-
230
+ });
231
+ TextInputBase.displayName = 'TextInputBase';
228
232
  TextInputBase.propTypes = {
229
233
  value: _propTypes.default.string,
230
234
  height: _propTypes.default.number,
@@ -3,12 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.themeType = exports.ThemeSetterContext = exports.ThemeContext = exports.uninitialisedError = void 0;
6
+ exports.default = exports.ThemeSetterContext = exports.ThemeContext = exports.uninitialisedError = void 0;
7
7
 
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
+ var _utils = require("./utils");
13
+
12
14
  var _jsxRuntime = require("react/jsx-runtime");
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -21,18 +23,18 @@ const uninitialisedError = new Error('Theme context used outside of ThemeProvide
21
23
  exports.uninitialisedError = uninitialisedError;
22
24
  const ThemeContext = /*#__PURE__*/(0, _react.createContext)(uninitialisedError);
23
25
  exports.ThemeContext = ThemeContext;
24
- const ThemeSetterContext = /*#__PURE__*/(0, _react.createContext)(uninitialisedError); // TODO: develop this as theme metadata is added
25
- // https://github.com/telus/universal-design-system/issues/92
26
-
26
+ const ThemeSetterContext = /*#__PURE__*/(0, _react.createContext)(uninitialisedError);
27
27
  exports.ThemeSetterContext = ThemeSetterContext;
28
- const themeType = _propTypes.default.object;
29
- exports.themeType = themeType;
30
28
 
31
29
  const ThemeProvider = ({
32
30
  children,
33
31
  defaultTheme
34
32
  }) => {
35
- const [theme, setTheme] = (0, _react.useState)(defaultTheme);
33
+ const [theme, setTheme] = (0, _react.useState)(defaultTheme); // Validate the theme tokens version on every render.
34
+ // This will intentionally break the application when attempting to use an invalid theme.
35
+ // This will surface an incompatibility quickly rather than allowing the potential for strange bugs due to missing or incompatible tokens.
36
+
37
+ (0, _utils.validateThemeTokensVersion)(theme);
36
38
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(ThemeSetterContext.Provider, {
37
39
  value: setTheme,
38
40
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ThemeContext.Provider, {
@@ -43,10 +45,12 @@ const ThemeProvider = ({
43
45
  };
44
46
 
45
47
  ThemeProvider.propTypes = {
46
- // TODO: implement a custom propType that validates schema version
47
- // https://github.com/telus/universal-design-system/issues/92
48
48
  children: _propTypes.default.node.isRequired,
49
- defaultTheme: themeType.isRequired
49
+ defaultTheme: _propTypes.default.shape({
50
+ metadata: _propTypes.default.shape({
51
+ themeTokensVersion: _propTypes.default.string.isRequired
52
+ }).isRequired
53
+ }).isRequired
50
54
  };
51
55
  var _default = ThemeProvider;
52
56
  exports.default = _default;
@@ -11,7 +11,12 @@ var _ThemeProvider = require("./ThemeProvider");
11
11
 
12
12
  const useSetTheme = () => {
13
13
  // Replace current theme with provided object
14
- const setTheme = (0, _react.useContext)(_ThemeProvider.ThemeSetterContext); // Merge provided object into current theme
14
+ const setTheme = (0, _react.useContext)(_ThemeProvider.ThemeSetterContext); // Fail fast if dev uses useSetTheme outside of ThemeProvider
15
+
16
+ if (setTheme instanceof Error) {
17
+ throw setTheme;
18
+ } // Merge provided object into current theme
19
+
15
20
 
16
21
  const editTheme = (0, _react.useCallback)(newTheme => setTheme((oldTheme = {}) => ({ ...oldTheme,
17
22
  ...newTheme
@@ -50,7 +50,7 @@ function applyTextStyles({
50
50
  if (fontName) {
51
51
  // Don't set undefined font families. May need some validation here that the font is available.
52
52
  // Android doesn't recognise font weights natively so apply custom font weights via `fontFamily`.
53
- styles.fontFamily = "".concat(fontName).concat(fontWeight).concat(fontStyle);
53
+ styles.fontFamily = `${fontName}${fontWeight}${fontStyle}`;
54
54
  } else if (fontWeight) {
55
55
  // If using system default font, apply the font weight directly.
56
56
  // Font weight support in Android is limited to 'bold' or anything else === 'normal'.
@@ -99,7 +99,7 @@ function applyWebShadow({
99
99
  }) {
100
100
  const insetString = inset ? 'inset ' : '';
101
101
  const boxShadow = {
102
- boxShadow: "".concat(insetString).concat(offsetX, "px ").concat(offsetY, "px ").concat(blur, "px ").concat(spread, "px ").concat(color)
102
+ boxShadow: `${insetString}${offsetX}px ${offsetY}px ${blur}px ${spread}px ${color}`
103
103
  };
104
104
  return boxShadow;
105
105
  }
@@ -3,10 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.toArray = exports.getThemeTokens = exports.mergeAppearances = exports.validateThemeTokens = exports.resolveThemeTokens = exports.doesThemeRuleApply = exports.doesThemeConditionApply = exports.getComponentTheme = void 0;
6
+ exports.validateThemeTokensVersion = exports.toArray = exports.getThemeTokens = exports.mergeAppearances = exports.validateThemeTokens = exports.resolveThemeTokens = exports.doesThemeRuleApply = exports.doesThemeConditionApply = exports.getComponentTheme = void 0;
7
7
 
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
+ var _satisfies = _interopRequireDefault(require("semver/functions/satisfies"));
11
+
12
+ var _package = _interopRequireDefault(require("../../../package.json"));
13
+
10
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
15
 
12
16
  /**
@@ -24,19 +28,19 @@ const getComponentTheme = (theme, componentName) => {
24
28
  // Give clear and understandable error messages for common dev errors, for example,
25
29
  // typo in component name, missing export or accessing old version of theme
26
30
  if (!theme) {
27
- throw new Error("Called useTheme's getStyle on \"".concat(componentName, "\" with no theme provided"));
31
+ throw new Error(`Called useTheme's getStyle on "${componentName}" with no theme provided`);
28
32
  }
29
33
 
30
34
  const themeName = ((_theme$metadata = theme.metadata) === null || _theme$metadata === void 0 ? void 0 : _theme$metadata.name) || '';
31
35
 
32
36
  if (!theme.components) {
33
- throw new Error("Theme \"".concat(themeName, "\" has no components defined (looking for \"").concat(componentName, "\")"));
37
+ throw new Error(`Theme "${themeName}" has no components defined (looking for "${componentName}")`);
34
38
  }
35
39
 
36
40
  const componentTheme = theme.components[componentName];
37
41
 
38
42
  if (!componentTheme) {
39
- throw new Error("Theme \"".concat(themeName, "\" does not have styles for component \"").concat(componentName, "\""));
43
+ throw new Error(`Theme "${themeName}" does not have styles for component "${componentName}"`);
40
44
  }
41
45
 
42
46
  return componentTheme;
@@ -45,10 +49,8 @@ const getComponentTheme = (theme, componentName) => {
45
49
  exports.getComponentTheme = getComponentTheme;
46
50
 
47
51
  const doesThemeConditionApply = ([key, value], appearances) => {
48
- var _appearances$key;
49
-
50
52
  // use null rather than undefined so we can serialise the value in themes
51
- const appearanceValue = (_appearances$key = appearances[key]) !== null && _appearances$key !== void 0 ? _appearances$key : null;
53
+ const appearanceValue = appearances[key] ?? null;
52
54
  return Array.isArray(value) ? value.includes(appearanceValue) : value === appearanceValue;
53
55
  };
54
56
 
@@ -154,5 +156,34 @@ const getThemeTokens = ({
154
156
  exports.getThemeTokens = getThemeTokens;
155
157
 
156
158
  const toArray = strOrArr => Array.isArray(strOrArr) ? strOrArr : [strOrArr];
159
+ /**
160
+ * Throws an error if the theme was built with an incompatible version of @telus-uds/system-theme-tokens
161
+ *
162
+ * This is used internally by the ThemeProvider to force a fast failure when an incompatible version is detected.
163
+ *
164
+ * Version compatibility is calculated with semver.satisfies.
165
+ * Refer to https://github.com/npm/node-semver and https://semver.npmjs.com/ for details about how
166
+ * semver compatibility.
167
+ *
168
+ * @param {object} theme - UDS theme built for react-native
169
+ */
170
+
171
+
172
+ exports.toArray = toArray;
173
+
174
+ const validateThemeTokensVersion = theme => {
175
+ var _theme$metadata2;
176
+
177
+ const expectedThemeTokensVersion = _package.default.dependencies['@telus-uds/system-theme-tokens'];
178
+ const actualThemeTokensVersion = theme === null || theme === void 0 ? void 0 : (_theme$metadata2 = theme.metadata) === null || _theme$metadata2 === void 0 ? void 0 : _theme$metadata2.themeTokensVersion;
179
+
180
+ if (!(0, _satisfies.default)(actualThemeTokensVersion, expectedThemeTokensVersion)) {
181
+ throw new Error(`Invalid UDS token schema version detected.
182
+
183
+ The UDS base components ${_package.default.name} v${_package.default.version} are only compatible with UDS themes that are built with @telus-uds/system-theme-tokens version that is semver compatible with ${expectedThemeTokensVersion}. The current theme was built with @telus-uds/system-theme-tokens v${actualThemeTokensVersion}.
184
+
185
+ If you see this error than most likely you have attempted to install ${_package.default.name} and a UDS theme manually because you are building a multi-brand application. If you are building a single brand application, consider installing the brand specific design system package such as @telus-uds/ds-allium. For more information, see https://github.com/telus/universal-design-system/blob/main/packages/docs-uds/docs/multi-brand-usage.md`);
186
+ }
187
+ };
157
188
 
158
- exports.toArray = toArray;
189
+ exports.validateThemeTokensVersion = validateThemeTokensVersion;
@@ -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
 
@@ -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 selectButtonTokens = tokens => (0, _propTypes2.selectTokens)('Button', { ...tokens,
31
35
  // Width tokens are applied to our inner track. Disable Button width token so it wraps our track width.
32
36
  width: null
@@ -76,7 +80,7 @@ const selectSwitchStyles = ({
76
80
  })
77
81
  });
78
82
 
79
- const ToggleSwitch = ({
83
+ const ToggleSwitch = /*#__PURE__*/(0, _react.forwardRef)(({
80
84
  value,
81
85
  initialValue,
82
86
  onChange,
@@ -84,7 +88,7 @@ const ToggleSwitch = ({
84
88
  tokens,
85
89
  variant,
86
90
  accessibilityRole = 'switch'
87
- }) => {
91
+ }, ref) => {
88
92
  const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('ToggleSwitch', tokens, variant);
89
93
  const {
90
94
  currentValue,
@@ -95,11 +99,12 @@ const ToggleSwitch = ({
95
99
  onChange
96
100
  });
97
101
 
98
- const handlePress = () => setValue(!currentValue);
102
+ const handlePress = event => setValue(!currentValue, event);
99
103
 
100
104
  const getButtonTokens = buttonState => selectButtonTokens(getTokens(buttonState));
101
105
 
102
106
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
107
+ ref: ref,
103
108
  selected: currentValue,
104
109
  inactive: inactive,
105
110
  tokens: getButtonTokens,
@@ -134,8 +139,8 @@ const ToggleSwitch = ({
134
139
  });
135
140
  }
136
141
  });
137
- };
138
-
142
+ });
143
+ ToggleSwitch.displayName = 'ToggleSwitch';
139
144
  ToggleSwitch.propTypes = { ..._propTypes2.a11yProps.propTypes,
140
145
  ..._propTypes2.pressProps.propTypes,
141
146
  tokens: (0, _propTypes2.getTokensPropType)('ToggleSwitch'),
@@ -19,7 +19,15 @@ function createPortalNode(nodeId) {
19
19
  // this way the backdrop stays in place when scrolling the window - that's why we need to
20
20
  // position it at the scroll position when rendering
21
21
 
22
- node.style.cssText = "\n position: absolute; \n top: ".concat(window.scrollY, "px;\n left: ").concat(window.scrollX, "px; \n right: 0; \n bottom: 0; \n z-index: 9999; \n pointer-events: none;\n ");
22
+ node.style.cssText = `
23
+ position: absolute;
24
+ top: ${window.scrollY}px;
25
+ left: ${window.scrollX}px;
26
+ right: 0;
27
+ bottom: 0;
28
+ z-index: 9999;
29
+ pointer-events: none;
30
+ `;
23
31
  document.body.appendChild(node);
24
32
  return node;
25
33
  }
@@ -39,7 +47,7 @@ function Backdrop({
39
47
  }) {
40
48
  const [portalNode, setPortalNode] = (0, _react.useState)();
41
49
  (0, _react.useEffect)(() => {
42
- const nodeId = "tooltip-backdrop-".concat(Date.now());
50
+ const nodeId = `tooltip-backdrop-${Date.now()}`;
43
51
  const node = createPortalNode(nodeId);
44
52
  setPortalNode(node);
45
53
  return () => {
@@ -161,14 +161,14 @@ const defaultControl = (pressableState, variant) => /*#__PURE__*/(0, _jsxRuntime
161
161
  */
162
162
 
163
163
 
164
- const Tooltip = ({
164
+ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)(({
165
165
  children,
166
166
  content,
167
167
  position = 'auto',
168
168
  copy = 'en',
169
169
  tokens,
170
170
  variant
171
- }) => {
171
+ }, ref) => {
172
172
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
173
173
  const controlRef = (0, _react.useRef)();
174
174
  const [controlLayout, setControlLayout] = (0, _react.useState)(null);
@@ -292,6 +292,7 @@ const Tooltip = ({
292
292
  }), isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
293
293
  onPress: close,
294
294
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
295
+ ref: ref,
295
296
  style: [staticStyles.tooltip, selectTooltipShadowStyles(themeTokens), // applied separately so that it doesn't cover the arrow
296
297
  tooltipPosition && selectTooltipPositionStyles(tooltipPosition), (tooltipPosition === null || (tooltipPosition === null || tooltipPosition === void 0 ? void 0 : tooltipPosition.isNormalized)) && staticStyles.tooltipHidden // visually hide the tooltip until we have a final measurement
297
298
  ],
@@ -309,8 +310,8 @@ const Tooltip = ({
309
310
  })
310
311
  })]
311
312
  });
312
- };
313
-
313
+ });
314
+ Tooltip.displayName = 'Tooltip';
314
315
  Tooltip.propTypes = {
315
316
  /**
316
317
  * Used to render the control (i.e. tooltip trigger). If a render function is used it will receive the