@telus-uds/components-base 1.59.2 → 1.61.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 (90) hide show
  1. package/CHANGELOG.md +26 -2
  2. package/component-docs.json +526 -76
  3. package/lib/Autocomplete/Autocomplete.js +483 -0
  4. package/lib/Autocomplete/Loading.js +51 -0
  5. package/lib/Autocomplete/Suggestions.js +85 -0
  6. package/lib/Autocomplete/constants.js +14 -0
  7. package/lib/Autocomplete/dictionary.js +19 -0
  8. package/lib/Autocomplete/index.js +13 -0
  9. package/lib/Button/ButtonLink.js +7 -3
  10. package/lib/ExpandCollapse/Panel.js +7 -0
  11. package/lib/IconButton/IconButton.js +8 -0
  12. package/lib/Link/ChevronLink.js +9 -2
  13. package/lib/Link/LinkBase.js +14 -0
  14. package/lib/Link/TextButton.js +12 -1
  15. package/lib/Listbox/GroupControl.js +121 -0
  16. package/lib/Listbox/Listbox.js +198 -0
  17. package/lib/Listbox/ListboxGroup.js +142 -0
  18. package/lib/Listbox/ListboxItem.js +97 -0
  19. package/lib/Listbox/ListboxOverlay.js +106 -0
  20. package/lib/Listbox/PressableItem.js +0 -2
  21. package/lib/Listbox/index.js +5 -24
  22. package/lib/Pagination/dictionary.js +3 -3
  23. package/lib/Progress/ProgressBarBackground.js +2 -2
  24. package/lib/SideNav/Item.js +15 -5
  25. package/lib/Tags/Tags.js +6 -1
  26. package/lib/TextInput/TextInputBase.js +2 -0
  27. package/lib/Tooltip/Tooltip.js +6 -1
  28. package/lib/Tooltip/Tooltip.native.js +6 -1
  29. package/lib/Tooltip/shared.js +5 -0
  30. package/lib/index.js +17 -13
  31. package/lib/utils/useOverlaidPosition.js +6 -4
  32. package/lib-module/Autocomplete/Autocomplete.js +448 -0
  33. package/lib-module/Autocomplete/Loading.js +36 -0
  34. package/lib-module/Autocomplete/Suggestions.js +66 -0
  35. package/lib-module/Autocomplete/constants.js +4 -0
  36. package/lib-module/Autocomplete/dictionary.js +12 -0
  37. package/lib-module/Autocomplete/index.js +2 -0
  38. package/lib-module/Button/ButtonLink.js +4 -1
  39. package/lib-module/ExpandCollapse/Panel.js +7 -0
  40. package/lib-module/IconButton/IconButton.js +8 -0
  41. package/lib-module/Link/ChevronLink.js +10 -3
  42. package/lib-module/Link/LinkBase.js +14 -0
  43. package/lib-module/Link/TextButton.js +11 -1
  44. package/lib-module/Listbox/GroupControl.js +102 -0
  45. package/lib-module/Listbox/Listbox.js +172 -0
  46. package/lib-module/Listbox/ListboxGroup.js +117 -0
  47. package/lib-module/Listbox/ListboxItem.js +71 -0
  48. package/lib-module/Listbox/ListboxOverlay.js +80 -0
  49. package/lib-module/Listbox/PressableItem.js +0 -2
  50. package/lib-module/Listbox/index.js +2 -2
  51. package/lib-module/Pagination/dictionary.js +3 -3
  52. package/lib-module/Progress/ProgressBarBackground.js +2 -2
  53. package/lib-module/SideNav/Item.js +15 -5
  54. package/lib-module/Tags/Tags.js +6 -1
  55. package/lib-module/TextInput/TextInputBase.js +2 -0
  56. package/lib-module/Tooltip/Tooltip.js +6 -1
  57. package/lib-module/Tooltip/Tooltip.native.js +6 -1
  58. package/lib-module/Tooltip/shared.js +5 -0
  59. package/lib-module/index.js +2 -1
  60. package/lib-module/utils/useOverlaidPosition.js +5 -4
  61. package/package.json +5 -3
  62. package/src/Autocomplete/Autocomplete.jsx +411 -0
  63. package/src/Autocomplete/Loading.jsx +18 -0
  64. package/src/Autocomplete/Suggestions.jsx +54 -0
  65. package/src/Autocomplete/constants.js +4 -0
  66. package/src/Autocomplete/dictionary.js +12 -0
  67. package/src/Autocomplete/index.js +3 -0
  68. package/src/Button/ButtonLink.jsx +4 -1
  69. package/src/ExpandCollapse/Panel.jsx +11 -1
  70. package/src/IconButton/IconButton.jsx +7 -0
  71. package/src/Link/ChevronLink.jsx +10 -3
  72. package/src/Link/LinkBase.jsx +11 -0
  73. package/src/Link/TextButton.jsx +8 -2
  74. package/src/Listbox/GroupControl.jsx +93 -0
  75. package/src/Listbox/Listbox.jsx +165 -0
  76. package/src/Listbox/ListboxGroup.jsx +120 -0
  77. package/src/Listbox/ListboxItem.jsx +76 -0
  78. package/src/Listbox/ListboxOverlay.jsx +82 -0
  79. package/src/Listbox/PressableItem.jsx +0 -2
  80. package/src/Listbox/index.js +3 -2
  81. package/src/Pagination/dictionary.js +3 -3
  82. package/src/Progress/ProgressBarBackground.jsx +2 -2
  83. package/src/SideNav/Item.jsx +13 -5
  84. package/src/Tags/Tags.jsx +5 -1
  85. package/src/TextInput/TextInputBase.jsx +2 -0
  86. package/src/Tooltip/Tooltip.jsx +16 -2
  87. package/src/Tooltip/Tooltip.native.jsx +15 -2
  88. package/src/Tooltip/shared.js +4 -0
  89. package/src/index.js +2 -1
  90. package/src/utils/useOverlaidPosition.js +6 -5
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
13
+
14
+ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
15
+
16
+ var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
17
+
18
+ var _portal = require("@gorhom/portal");
19
+
20
+ var _ThemeProvider = require("../ThemeProvider");
21
+
22
+ var _Card = _interopRequireDefault(require("../Card"));
23
+
24
+ var _jsxRuntime = require("react/jsx-runtime");
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
+
28
+ 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); }
29
+
30
+ 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; }
31
+
32
+ /* eslint-disable react/require-default-props */
33
+ const staticStyles = _StyleSheet.default.create({
34
+ positioner: {
35
+ flex: 1,
36
+ // Grow to maxWidth when possible, shrink when not possible
37
+ position: 'absolute',
38
+ zIndex: 1000000000000000 // Position on top of all the other overlays, including backdrops and modals
39
+
40
+ },
41
+ hidden: {
42
+ // Use opacity not visibility to hide the dropdown during positioning
43
+ // so on web, children may be focused from the first render
44
+ opacity: 0
45
+ }
46
+ });
47
+
48
+ const paddingVertical = 0;
49
+ const paddingHorizontal = 0;
50
+ const DropdownOverlay = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
51
+ let {
52
+ children,
53
+ isReady = false,
54
+ overlaidPosition,
55
+ maxWidth,
56
+ minWidth,
57
+ onLayout
58
+ } = _ref;
59
+ const systemTokens = (0, _ThemeProvider.useThemeTokens)('Listbox', {}, {});
60
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
61
+ ref: ref,
62
+ onLayout: onLayout,
63
+ style: [overlaidPosition, {
64
+ maxWidth,
65
+ minWidth
66
+ }, staticStyles.positioner, !isReady && staticStyles.hidden],
67
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.default, {
68
+ tokens: {
69
+ shadow: systemTokens.shadow,
70
+ paddingBottom: paddingVertical,
71
+ paddingTop: paddingVertical,
72
+ paddingLeft: paddingHorizontal,
73
+ paddingRight: paddingHorizontal
74
+ },
75
+ children: children
76
+ })
77
+ });
78
+ });
79
+
80
+ const withPortal = Overlay => {
81
+ // eslint-disable-next-line react/display-name, react/no-multi-comp
82
+ return props => {
83
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_portal.Portal, {
84
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Overlay, { ...props
85
+ })
86
+ });
87
+ };
88
+ };
89
+
90
+ DropdownOverlay.displayName = 'DropdownOverlay';
91
+ DropdownOverlay.propTypes = {
92
+ children: _propTypes.default.node.isRequired,
93
+ isReady: _propTypes.default.bool,
94
+ overlaidPosition: _propTypes.default.shape({
95
+ top: _propTypes.default.number,
96
+ left: _propTypes.default.number,
97
+ width: _propTypes.default.number
98
+ }),
99
+ maxWidth: _propTypes.default.number,
100
+ minWidth: _propTypes.default.number,
101
+ onLayout: _propTypes.default.func
102
+ };
103
+
104
+ var _default = _Platform.default.OS === 'web' ? withPortal(DropdownOverlay) : DropdownOverlay;
105
+
106
+ exports.default = _default;
@@ -40,7 +40,6 @@ const getItemStyles = _ref => {
40
40
  itemPaddingRight,
41
41
  itemBackgroundColor,
42
42
  itemColor,
43
- itemDisplay,
44
43
  itemOutline,
45
44
  itemTextDecoration,
46
45
  itemBorderLeftColor,
@@ -62,7 +61,6 @@ const getItemStyles = _ref => {
62
61
  width: '100%',
63
62
  backgroundColor: itemBackgroundColor,
64
63
  color: itemColor,
65
- display: itemDisplay,
66
64
  outline: itemOutline,
67
65
  textDecoration: itemTextDecoration,
68
66
  borderLeft: `${itemBorderLeftWidth}px solid ${itemBorderLeftColor}`,
@@ -3,30 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- PressableItem: true
8
- };
9
- Object.defineProperty(exports, "PressableItem", {
10
- enumerable: true,
11
- get: function () {
12
- return _PressableItem.default;
13
- }
14
- });
15
-
16
- var _ListboxContext = require("./ListboxContext");
6
+ exports.default = void 0;
17
7
 
18
- Object.keys(_ListboxContext).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
- if (key in exports && exports[key] === _ListboxContext[key]) return;
22
- Object.defineProperty(exports, key, {
23
- enumerable: true,
24
- get: function () {
25
- return _ListboxContext[key];
26
- }
27
- });
28
- });
8
+ var _Listbox = _interopRequireDefault(require("./Listbox"));
29
9
 
30
- var _PressableItem = _interopRequireDefault(require("./PressableItem"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
11
 
32
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ var _default = _Listbox.default;
13
+ exports.default = _default;
@@ -14,11 +14,11 @@ var _default = {
14
14
  nextText: 'Next'
15
15
  },
16
16
  fr: {
17
- goToLabel: 'Aller au page n°',
17
+ goToLabel: 'Aller à la page n°',
18
18
  currentLabel: '(page actuelle)',
19
- previousLabel: 'Aller au page précédent',
19
+ previousLabel: 'Aller à la page précédente',
20
20
  previousText: 'Précédent',
21
- nextLabel: 'Aller au prochain page',
21
+ nextLabel: 'Aller à la page suivante',
22
22
  nextText: 'Suivant'
23
23
  }
24
24
  };
@@ -21,8 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
21
21
 
22
22
  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; }
23
23
 
24
- const inactiveBackground = `%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='DisabledProgress7' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23B2B9BF'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23DisabledProgress7");'%3E%3C/path%3E%3C/svg%3E`;
25
- const negativeBackground = `%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='NegativeProgress6' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23C12335'%3E%3C/rect%3E%3Cpath d='M 0,8 l 8,-8 M -2,2 l 4,-4 M 6,10 l 4,-4' stroke-width='2' shape-rendering='auto' stroke='%23e7adb4' stroke-linecap='square'%3E%3C/path%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23NegativeProgress6");'%3E%3C/path%3E%3C/svg%3E`;
24
+ const inactiveBackground = `%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='inactive' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='rgba(255, 255, 255, 0)'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2' fill='rgba(0, 0, 0, 0.4)' stroke='rgba(0, 0, 0, 0.4)' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='0' r='2' fill='rgba(0, 0, 0, 0.4)' stroke='rgba(0, 0, 0, 0.4)' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='8' r='2' fill='rgba(0, 0, 0, 0.4)' stroke='rgba(0, 0, 0, 0.4)' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='0' r='2' fill='rgba(0, 0, 0, 0.4)' stroke='rgba(0, 0, 0, 0.4)' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='8' r='2' fill='rgba(0, 0, 0, 0.4)' stroke='rgba(0, 0, 0, 0.4)' stroke-width='0'%3E%3C/circle%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23inactive");'%3E%3C/path%3E%3C/svg%3E`;
25
+ const negativeBackground = `%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='negative' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='rgba(255, 255, 255, 0)'%3E%3C/rect%3E%3Cpath d='M 0,8 l 8,-8 M -2,2 l 4,-4 M 6,10 l 4,-4' stroke-width='1' shape-rendering='auto' stroke='rgba(255, 255, 255, 0.4)' stroke-linecap='square'%3E%3C/path%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23negative");'%3E%3C/path%3E%3C/svg%3E`;
26
26
  const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
27
27
  let {
28
28
  variant
@@ -138,13 +138,13 @@ Item.propTypes = { ...selectedSystemPropTypes,
138
138
  children: _propTypes.default.node.isRequired,
139
139
 
140
140
  /**
141
- * @ignore
141
+ *
142
142
  * Set internally in `SideNav` render function - used to keep track of active item.
143
143
  */
144
144
  itemId: _propTypes.default.string,
145
145
 
146
146
  /**
147
- * @ignore
147
+ *
148
148
  * Set internally in `SideNav` render function - used to keep track of expanded items groups.
149
149
  */
150
150
  groupId: _propTypes.default.string,
@@ -158,18 +158,28 @@ Item.propTypes = { ...selectedSystemPropTypes,
158
158
  hrefAttrs: _propTypes.default.shape(_utils.hrefAttrsProp.types),
159
159
 
160
160
  /**
161
- * @ignore
161
+ *
162
162
  * Set internally in `SideNav` render function.
163
163
  */
164
164
  isActive: _propTypes.default.bool,
165
165
 
166
166
  /**
167
- * @ignore
167
+ *
168
168
  * Set internally in `SideNav.ItemsGroup` render function. Used to mark expanded `ItemsGroup` parent.
169
169
  */
170
170
  isExpanded: _propTypes.default.bool,
171
171
  tokens: (0, _utils.getTokensPropType)('SideNavItem'),
172
- variant: _utils.variantProp.propType
172
+ variant: _utils.variantProp.propType,
173
+
174
+ /**
175
+ * Accesibility Role
176
+ */
177
+ accessibilityRole: _propTypes.default.string,
178
+
179
+ /**
180
+ * test ID
181
+ */
182
+ testID: _propTypes.default.number
173
183
  };
174
184
  var _default = Item;
175
185
  exports.default = _default;
package/lib/Tags/Tags.js CHANGED
@@ -277,7 +277,12 @@ Tags.propTypes = { ...selectedSystemPropTypes,
277
277
  * managing its own selected state, a default set of selections may be provided.
278
278
  * Changing the `initialValues` does not change the user's selections.
279
279
  */
280
- initialValues: _propTypes.default.arrayOf(_propTypes.default.string)
280
+ initialValues: _propTypes.default.arrayOf(_propTypes.default.string),
281
+
282
+ /**
283
+ * AccesibilityRole for the Tags
284
+ */
285
+ accessibilityRole: _propTypes.default.string
281
286
  };
282
287
  var _default = Tags;
283
288
  exports.default = _default;
@@ -375,6 +375,8 @@ exports.default = _default;
375
375
  const staticStyles = _StyleSheet.default.create({
376
376
  buttonsContainer: {
377
377
  position: 'absolute',
378
+ flexDirection: 'row',
379
+ alignItems: 'center',
378
380
  right: 0,
379
381
  top: 0,
380
382
  bottom: 0,
@@ -151,6 +151,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
151
151
  copy = 'en',
152
152
  tokens,
153
153
  variant,
154
+ inline = false,
154
155
  ...rest
155
156
  } = _ref6;
156
157
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
@@ -245,7 +246,11 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
245
246
  right: 10
246
247
  } : undefined;
247
248
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
248
- style: staticStyles.container,
249
+ style: [staticStyles.container, _Platform.default.select({
250
+ web: {
251
+ display: inline ? 'inline-block' : 'flex'
252
+ }
253
+ })],
249
254
  ...selectProps(rest),
250
255
  ref: ref,
251
256
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
@@ -180,6 +180,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
180
180
  copy = 'en',
181
181
  tokens,
182
182
  variant,
183
+ inline = false,
183
184
  ...rest
184
185
  } = _ref6;
185
186
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
@@ -298,7 +299,11 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
298
299
  right: 10
299
300
  } : undefined;
300
301
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
301
- style: staticStyles.container,
302
+ style: [staticStyles.container, _Platform.default.select({
303
+ web: {
304
+ display: inline ? 'inline-block' : 'flex'
305
+ }
306
+ })],
302
307
  ...selectProps(rest),
303
308
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
304
309
  onPress: toggleIsOpen,
@@ -32,6 +32,11 @@ const propTypes = {
32
32
  * Use to place the tooltip in a specific location (only if it fits within viewport).
33
33
  */
34
34
  position: _propTypes.default.oneOf(['auto', 'above', 'right', 'below', 'left']),
35
+
36
+ /**
37
+ * Display tooltip icon button as an inline element.
38
+ */
39
+ inline: _propTypes.default.bool,
35
40
  tokens: (0, _utils.getTokensPropType)('Tooltip'),
36
41
  variant: _utils.variantProp.propType
37
42
  };
package/lib/index.js CHANGED
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  var _exportNames = {
7
7
  A11yText: true,
8
8
  ActivityIndicator: true,
9
+ Autocomplete: true,
9
10
  Box: true,
10
11
  Card: true,
11
12
  PressableCardBase: true,
13
+ Listbox: true,
12
14
  Checkbox: true,
13
15
  Divider: true,
14
16
  ExpandCollapse: true,
@@ -91,6 +93,12 @@ Object.defineProperty(exports, "ActivityIndicator", {
91
93
  return _ActivityIndicator.default;
92
94
  }
93
95
  });
96
+ Object.defineProperty(exports, "Autocomplete", {
97
+ enumerable: true,
98
+ get: function () {
99
+ return _Autocomplete.default;
100
+ }
101
+ });
94
102
  Object.defineProperty(exports, "BaseProvider", {
95
103
  enumerable: true,
96
104
  get: function () {
@@ -193,6 +201,12 @@ Object.defineProperty(exports, "ListItem", {
193
201
  return _List.ListItem;
194
202
  }
195
203
  });
204
+ Object.defineProperty(exports, "Listbox", {
205
+ enumerable: true,
206
+ get: function () {
207
+ return _Listbox.default;
208
+ }
209
+ });
196
210
  Object.defineProperty(exports, "Modal", {
197
211
  enumerable: true,
198
212
  get: function () {
@@ -444,6 +458,8 @@ var _A11yText = _interopRequireDefault(require("./A11yText"));
444
458
 
445
459
  var _ActivityIndicator = _interopRequireDefault(require("./ActivityIndicator"));
446
460
 
461
+ var _Autocomplete = _interopRequireDefault(require("./Autocomplete"));
462
+
447
463
  var _Box = _interopRequireDefault(require("./Box"));
448
464
 
449
465
  var _Button = require("./Button");
@@ -476,19 +492,7 @@ Object.keys(_Carousel).forEach(function (key) {
476
492
  });
477
493
  });
478
494
 
479
- var _Listbox = require("./Listbox");
480
-
481
- Object.keys(_Listbox).forEach(function (key) {
482
- if (key === "default" || key === "__esModule") return;
483
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
484
- if (key in exports && exports[key] === _Listbox[key]) return;
485
- Object.defineProperty(exports, key, {
486
- enumerable: true,
487
- get: function () {
488
- return _Listbox[key];
489
- }
490
- });
491
- });
495
+ var _Listbox = _interopRequireDefault(require("./Listbox"));
492
496
 
493
497
  var _Checkbox = _interopRequireWildcard(require("./Checkbox"));
494
498
 
@@ -9,6 +9,8 @@ var _react = require("react");
9
9
 
10
10
  var _Dimensions = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Dimensions"));
11
11
 
12
+ var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
 
14
16
  const adjustHorizontalToFit = (initialOffset, windowWidth, sourceWidth) => {
@@ -182,8 +184,8 @@ const useOverlaidPosition = _ref3 => {
182
184
  let {
183
185
  window
184
186
  } = _ref5;
185
- (_sourceRef$current = sourceRef.current) === null || _sourceRef$current === void 0 ? void 0 : _sourceRef$current.measureInWindow((x, y, width, height) => {
186
- // Could add a debouncer here if there's too many rerenders during gradual resizes
187
+ const measurementFunction = _Platform.default.OS === 'web' ? 'measureInWindow' : 'measure';
188
+ (_sourceRef$current = sourceRef.current) === null || _sourceRef$current === void 0 ? void 0 : _sourceRef$current[measurementFunction]((x, y, width, height) => {
187
189
  setWindowDimensions(window);
188
190
  setSourceLayout({
189
191
  x,
@@ -202,9 +204,9 @@ const useOverlaidPosition = _ref3 => {
202
204
  if (typeof ((_subscription = subscription) === null || _subscription === void 0 ? void 0 : _subscription.remove) === 'function') {
203
205
  // React Native >=0.65.0
204
206
  subscription.remove();
205
- } else if (typeof _Dimensions.default.removeEventListener === 'function') {
207
+ } else if (typeof _Dimensions.default.remove === 'function') {
206
208
  // React Native <0.65.0
207
- _Dimensions.default.removeEventListener('change', handleDimensionsChange);
209
+ _Dimensions.default.remove('change', handleDimensionsChange);
208
210
  }
209
211
 
210
212
  setSourceLayout(null);