@telus-uds/components-base 1.62.0 → 1.63.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 (36) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/lib/Autocomplete/Autocomplete.js +36 -4
  3. package/lib/Button/ButtonDropdown.js +1 -0
  4. package/lib/Icon/Icon.js +15 -2
  5. package/lib/Link/LinkBase.js +9 -2
  6. package/lib/Listbox/Listbox.js +2 -2
  7. package/lib/Listbox/ListboxItem.js +7 -2
  8. package/lib/MultiSelectFilter/MultiSelectFilter.js +2 -2
  9. package/lib/Tooltip/Tooltip.js +2 -0
  10. package/lib/Tooltip/Tooltip.native.js +2 -0
  11. package/lib/Tooltip/shared.js +5 -0
  12. package/lib/TooltipButton/TooltipButton.js +14 -1
  13. package/lib-module/Autocomplete/Autocomplete.js +37 -5
  14. package/lib-module/Button/ButtonDropdown.js +2 -1
  15. package/lib-module/Icon/Icon.js +15 -2
  16. package/lib-module/Link/LinkBase.js +9 -2
  17. package/lib-module/Listbox/Listbox.js +2 -2
  18. package/lib-module/Listbox/ListboxItem.js +7 -2
  19. package/lib-module/MultiSelectFilter/MultiSelectFilter.js +2 -2
  20. package/lib-module/Tooltip/Tooltip.js +2 -0
  21. package/lib-module/Tooltip/Tooltip.native.js +2 -0
  22. package/lib-module/Tooltip/shared.js +5 -0
  23. package/lib-module/TooltipButton/TooltipButton.js +11 -1
  24. package/package.json +3 -4
  25. package/src/Autocomplete/Autocomplete.jsx +43 -5
  26. package/src/Button/ButtonDropdown.jsx +3 -0
  27. package/src/Icon/Icon.jsx +22 -3
  28. package/src/Link/LinkBase.jsx +20 -2
  29. package/src/Listbox/Listbox.jsx +2 -2
  30. package/src/Listbox/ListboxItem.jsx +14 -2
  31. package/src/MultiSelectFilter/MultiSelectFilter.jsx +2 -2
  32. package/src/Tooltip/Tooltip.jsx +2 -0
  33. package/src/Tooltip/Tooltip.native.jsx +2 -0
  34. package/src/Tooltip/shared.js +4 -0
  35. package/src/TooltipButton/TooltipButton.jsx +13 -2
  36. package/component-docs.json +0 -15853
package/CHANGELOG.md CHANGED
@@ -1,12 +1,29 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Fri, 15 Sep 2023 20:56:52 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 04 Oct 2023 18:37:04 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.63.0
8
+
9
+ Wed, 04 Oct 2023 18:37:04 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - new logic for autocomplete when has nested items (mauricio.batresmontejo@telus.com)
14
+ - update components base imports (evander.owusu@telus.com)
15
+
16
+ ## 1.62.1
17
+
18
+ Wed, 27 Sep 2023 20:47:22 GMT
19
+
20
+ ### Patches
21
+
22
+ - Clicking on any clickable area should bubble event to relevant `Pressable` element (shahzaibkhalidmalik@outlook.com)
23
+
7
24
  ## 1.62.0
8
25
 
9
- Fri, 15 Sep 2023 20:56:52 GMT
26
+ Fri, 15 Sep 2023 21:02:27 GMT
10
27
 
11
28
  ### Minor changes
12
29
 
@@ -154,7 +154,8 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
154
154
 
155
155
  const isControlled = value !== undefined; // We need to store current items for uncontrolled usage
156
156
 
157
- const [currentItems, setCurrentItems] = (0, _react.useState)(initialItems); // We need to store the current value as well to be able to highlight it
157
+ const [currentItems, setCurrentItems] = (0, _react.useState)(initialItems);
158
+ const [otherItems, setOtherItems] = (0, _react.useState)(items); // We need to store the current value as well to be able to highlight it
158
159
 
159
160
  const [currentValue, setCurrentValue] = (0, _react.useState)(value ?? initialValue);
160
161
  const inputTokens = {
@@ -164,7 +165,9 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
164
165
  const openOverlayRef = (0, _react.useRef)();
165
166
  const [isExpanded, setIsExpanded] = (0, _react.useState)(((_ref3 = value ?? initialValue) === null || _ref3 === void 0 ? void 0 : _ref3.length) >= minToSuggestion);
166
167
  const [isFocused, setisFocused] = (0, _react.useState)(false);
167
- const [sourceLayout, setSourceLayout] = (0, _react.useState)(null);
168
+ const [sourceLayout, setSourceLayout] = (0, _react.useState)(null); // When it's nested, selected value
169
+
170
+ const [nestedSelectedValue, setNestedSelectedValue] = (0, _react.useState)(null);
168
171
  const {
169
172
  supportsProps,
170
173
  ...selectedProps
@@ -262,22 +265,49 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
262
265
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedId);
263
266
  const {
264
267
  label: newValue,
265
- nested
268
+ nested,
269
+ title
266
270
  } = (_ref5 = isControlled ? items : currentItems) === null || _ref5 === void 0 ? void 0 : _ref5.find(_ref6 => {
267
271
  let {
268
272
  id
269
273
  } = _ref6;
270
274
  return id === selectedId;
271
275
  });
276
+ if (title) return;
272
277
 
273
278
  if (!nested) {
279
+ setNestedSelectedValue(null);
274
280
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
275
281
  setIsExpanded(false);
276
282
  }
277
283
 
278
284
  setCurrentValue(newValue);
279
285
  if (!isControlled && inputRef !== null && inputRef !== void 0 && inputRef.current) inputRef.current.value = newValue;
286
+ if (nested) setNestedSelectedValue(newValue);
280
287
  };
288
+ /**
289
+ * When an item that is nested equal "true" is selected this useEffect is executed.
290
+ * The nested item is added to the item list at the top, the if validates it doesn't exist
291
+ * within the list, if doesn't exist the nested item is added to the top of the list,
292
+ * the nested item is added with an id equal "0"
293
+ */
294
+
295
+
296
+ (0, _react.useEffect)(() => {
297
+ if (nestedSelectedValue && !items.find(item => item.id === 0)) {
298
+ const tmpItems = [...items];
299
+ tmpItems.unshift({
300
+ label: nestedSelectedValue,
301
+ title: true,
302
+ id: 0
303
+ });
304
+ setOtherItems(tmpItems.map(item => {
305
+ return { ...item,
306
+ nestedChild: item.id !== 0
307
+ };
308
+ }));
309
+ }
310
+ }, [nestedSelectedValue, items]);
281
311
 
282
312
  const handleClose = event => {
283
313
  var _openOverlayRef$curre, _openOverlayRef$curre2;
@@ -285,6 +315,7 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
285
315
  if (event.type === 'keydown') {
286
316
  if (event.key === 'Escape' || event.key === 27) {
287
317
  setIsExpanded(false);
318
+ setNestedSelectedValue(null);
288
319
  } else if (event.key === 'ArrowDown' && isExpanded && !isLoading && targetRef !== null && targetRef !== void 0 && targetRef.current) {
289
320
  targetRef.current.focus();
290
321
  }
@@ -295,6 +326,7 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
295
326
  } else if (_Platform.default.OS === 'web') {
296
327
  // needed for dropdown to be collapsed when clicking outside on web
297
328
  setIsExpanded(false);
329
+ setNestedSelectedValue(null);
298
330
  }
299
331
  };
300
332
 
@@ -369,7 +401,7 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
369
401
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Suggestions.default, {
370
402
  hasResults: getCopy('hasResults'),
371
403
  id: "autocomplete",
372
- items: itemsToShow,
404
+ items: nestedSelectedValue ? itemsToSuggest(highlight(otherItems, nestedSelectedValue, resultsTextColor)) : itemsToShow,
373
405
  noResults: helpTextToShow,
374
406
  onClose: handleClose,
375
407
  onSelect: handleSelect,
@@ -176,6 +176,7 @@ ButtonDropdown.propTypes = { ..._utils.a11yProps.types,
176
176
  ..._utils.focusHandlerProps.types,
177
177
  ..._propTypes2.default,
178
178
  children: _propTypes2.textAndA11yText,
179
+ tokens: (0, _utils.getTokensPropType)('ButtonDropdown'),
179
180
 
180
181
  /**
181
182
  * Callback called when a controlled ButtonDropdown gets interacted with.
package/lib/Icon/Icon.js CHANGED
@@ -32,6 +32,7 @@ const Icon = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
32
32
  variant,
33
33
  tokens,
34
34
  scalesWithText = false,
35
+ style = {},
35
36
  dataSet
36
37
  } = _ref;
37
38
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Icon', tokens, variant);
@@ -48,7 +49,8 @@ const Icon = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
48
49
  // TODO: systematise animations.
49
50
  // https://github.com/telus/universal-design-system/issues/487
50
51
  transition: 'transform 200ms, color 200ms',
51
- transform: [themeTokens.scale ? `scale(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' ')
52
+ transform: [themeTokens.scale ? `scale(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' '),
53
+ ...style
52
54
  },
53
55
  dataSet: dataSet,
54
56
  children: iconContent
@@ -67,7 +69,18 @@ const iconComponentPropTypes = {
67
69
  /**
68
70
  * controls whether the icon size should be proportionate to any accessibility-related font scaling.
69
71
  */
70
- scalesWithText: _propTypes.default.bool
72
+ scalesWithText: _propTypes.default.bool,
73
+
74
+ /**
75
+ * Custom style object to be applied to the icon component.
76
+ * This is useful for overriding the default icon style but for cases where desires styles are not available as tokens.
77
+ *
78
+ * Note: This prop is only used in web.
79
+ *
80
+ * @example
81
+ * <Icon style={{ color: 'red' }}
82
+ */
83
+ style: _propTypes.default.object
71
84
  };
72
85
  exports.iconComponentPropTypes = iconComponentPropTypes;
73
86
  Icon.propTypes = { ...iconComponentPropTypes,
@@ -225,10 +225,11 @@ const LinkBase = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
225
225
  iconPosition: iconPosition,
226
226
  space: iconSpace,
227
227
  iconProps: { ...iconProps,
228
- tokens: iconTokens
228
+ tokens: iconTokens,
229
+ style: staticStyles.bubblePointerEvents
229
230
  },
230
231
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
231
- style: [textStyles, blockTextStyles, staticStyles.baseline],
232
+ style: [textStyles, blockTextStyles, staticStyles.baseline, staticStyles.bubblePointerEvents],
232
233
  children: typeof children === 'function' ? children(linkState) : children
233
234
  })
234
235
  });
@@ -287,6 +288,12 @@ const staticStyles = _StyleSheet.default.create({
287
288
  },
288
289
  baseline: {
289
290
  alignSelf: 'baseline'
291
+ },
292
+ bubblePointerEvents: { ..._Platform.default.select({
293
+ web: {
294
+ pointerEvents: 'none'
295
+ }
296
+ })
290
297
  }
291
298
  });
292
299
 
@@ -165,6 +165,7 @@ const Listbox = _ref => {
165
165
  };
166
166
 
167
167
  Listbox.propTypes = { ..._utils.withLinkRouter.propTypes,
168
+ tokens: (0, _utils.getTokensPropType)('Listbox'),
168
169
 
169
170
  /**
170
171
  * Focus will be moved to the item with this ref once within the menu.
@@ -190,8 +191,7 @@ Listbox.propTypes = { ..._utils.withLinkRouter.propTypes,
190
191
  /**
191
192
  * onClose event
192
193
  */
193
- onClose: _propTypes.default.func,
194
- tokens: (0, _utils.getTokensPropType)('Listbox')
194
+ onClose: _propTypes.default.func
195
195
  };
196
196
  Listbox.Overlay = _ListboxOverlay.default;
197
197
  var _default = Listbox;
@@ -37,6 +37,9 @@ const styles = _StyleSheet.default.create({
37
37
  },
38
38
  childContainer: {
39
39
  paddingLeft: 16
40
+ },
41
+ nestedChildContainer: {
42
+ paddingLeft: 24
40
43
  }
41
44
  });
42
45
 
@@ -45,6 +48,7 @@ const ListboxItem = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
45
48
  href,
46
49
  label,
47
50
  isChild = false,
51
+ nestedChild,
48
52
  onBlur,
49
53
  nextItemRef,
50
54
  prevItemRef,
@@ -64,7 +68,7 @@ const ListboxItem = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
64
68
  isChild
65
69
  });
66
70
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
67
- style: [styles.itemContainer, isChild && styles.childContainer],
71
+ style: [styles.itemContainer, isChild && styles.childContainer, nestedChild && styles.nestedChildContainer],
68
72
  role: "option",
69
73
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PressableItem.default, {
70
74
  href: href,
@@ -89,7 +93,8 @@ ListboxItem.propTypes = { ...selectedSystemPropTypes,
89
93
  label: _propTypes.default.node.isRequired,
90
94
  nextItemRef: _propTypes.default.object,
91
95
  prevItemRef: _propTypes.default.object,
92
- onPress: _propTypes.default.func
96
+ onPress: _propTypes.default.func,
97
+ nestedChild: _propTypes.default.bool
93
98
  };
94
99
 
95
100
  var _default = (0, _utils.withLinkRouter)(ListboxItem);
@@ -439,9 +439,9 @@ MultiSelectFilter.propTypes = {
439
439
  variant: _utils.variantProp.propType,
440
440
 
441
441
  /**
442
- * Sets the tokens for ButtonDropdown element.
442
+ * Sets the tokens for MultiSelectFilter element.
443
443
  */
444
- tokens: (0, _utils.getTokensPropType)('ButtonDropdown'),
444
+ tokens: (0, _utils.getTokensPropType)('MultiSelectFilter'),
445
445
 
446
446
  /**
447
447
  * The options a user may select.
@@ -153,6 +153,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
153
153
  tokens,
154
154
  variant,
155
155
  inline = false,
156
+ nativeID,
156
157
  ...rest
157
158
  } = _ref6;
158
159
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
@@ -265,6 +266,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
265
266
  hitSlop: pressableHitSlop,
266
267
  accessibilityLabel: getCopy('a11yText'),
267
268
  accessibilityRole: "button",
269
+ nativeID: nativeID,
268
270
  children: typeof control === 'function' ? pressableState => control(getPressableState(pressableState), variant) : control
269
271
  }), isOpen && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
270
272
  ref: floating,
@@ -182,6 +182,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
182
182
  tokens,
183
183
  variant,
184
184
  inline = false,
185
+ nativeID,
185
186
  ...rest
186
187
  } = _ref6;
187
188
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
@@ -317,6 +318,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
317
318
  hitSlop: pressableHitSlop,
318
319
  accessibilityLabel: getCopy('a11yText'),
319
320
  accessibilityRole: "button",
321
+ nativeID: nativeID,
320
322
  children: typeof control === 'function' ? pressableState => control(getPressableState(pressableState), variant) : control
321
323
  }), isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
322
324
  onPress: close,
@@ -42,6 +42,11 @@ const propTypes = {
42
42
  * Callback function triggered when the tooltip is pressed.
43
43
  */
44
44
  onPress: _propTypes.default.func,
45
+
46
+ /**
47
+ * The `id` of the tooltip button.
48
+ */
49
+ nativeID: _propTypes.default.string,
45
50
  tokens: (0, _utils.getTokensPropType)('Tooltip'),
46
51
  variant: _utils.variantProp.propType
47
52
  };
@@ -9,6 +9,10 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
11
11
 
12
+ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
13
+
14
+ var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
15
+
12
16
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
17
 
14
18
  var _ThemeProvider = require("../ThemeProvider");
@@ -69,7 +73,7 @@ const TooltipButton = _ref3 => {
69
73
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
70
74
  style: [(0, _ThemeProvider.applyOuterBorder)(themeTokens), themeTokens.outerBorderWidth && {
71
75
  margin: -themeTokens.outerBorderWidth
72
- }],
76
+ }, staticStyles.bubblePointerEvents],
73
77
  ...selectProps(rest),
74
78
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
75
79
  style: selectInnerContainerStyles(themeTokens),
@@ -81,6 +85,15 @@ const TooltipButton = _ref3 => {
81
85
  });
82
86
  };
83
87
 
88
+ const staticStyles = _StyleSheet.default.create({
89
+ bubblePointerEvents: { ..._Platform.default.select({
90
+ web: {
91
+ pointerEvents: 'none'
92
+ }
93
+ })
94
+ }
95
+ });
96
+
84
97
  TooltipButton.propTypes = { ...selectedSystemPropTypes,
85
98
 
86
99
  /**
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react/require-default-props */
2
- import React, { forwardRef, useRef, useState } from 'react';
2
+ import React, { forwardRef, useEffect, useRef, useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import Dimensions from "react-native-web/dist/exports/Dimensions";
5
5
  import Platform from "react-native-web/dist/exports/Platform";
@@ -123,7 +123,8 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
123
123
 
124
124
  const isControlled = value !== undefined; // We need to store current items for uncontrolled usage
125
125
 
126
- const [currentItems, setCurrentItems] = useState(initialItems); // We need to store the current value as well to be able to highlight it
126
+ const [currentItems, setCurrentItems] = useState(initialItems);
127
+ const [otherItems, setOtherItems] = useState(items); // We need to store the current value as well to be able to highlight it
127
128
 
128
129
  const [currentValue, setCurrentValue] = useState(value ?? initialValue);
129
130
  const inputTokens = {
@@ -133,7 +134,9 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
133
134
  const openOverlayRef = useRef();
134
135
  const [isExpanded, setIsExpanded] = useState(((_ref3 = value ?? initialValue) === null || _ref3 === void 0 ? void 0 : _ref3.length) >= minToSuggestion);
135
136
  const [isFocused, setisFocused] = useState(false);
136
- const [sourceLayout, setSourceLayout] = useState(null);
137
+ const [sourceLayout, setSourceLayout] = useState(null); // When it's nested, selected value
138
+
139
+ const [nestedSelectedValue, setNestedSelectedValue] = useState(null);
137
140
  const {
138
141
  supportsProps,
139
142
  ...selectedProps
@@ -229,22 +232,49 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
229
232
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedId);
230
233
  const {
231
234
  label: newValue,
232
- nested
235
+ nested,
236
+ title
233
237
  } = (_ref5 = isControlled ? items : currentItems) === null || _ref5 === void 0 ? void 0 : _ref5.find(_ref6 => {
234
238
  let {
235
239
  id
236
240
  } = _ref6;
237
241
  return id === selectedId;
238
242
  });
243
+ if (title) return;
239
244
 
240
245
  if (!nested) {
246
+ setNestedSelectedValue(null);
241
247
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
242
248
  setIsExpanded(false);
243
249
  }
244
250
 
245
251
  setCurrentValue(newValue);
246
252
  if (!isControlled && inputRef !== null && inputRef !== void 0 && inputRef.current) inputRef.current.value = newValue;
253
+ if (nested) setNestedSelectedValue(newValue);
247
254
  };
255
+ /**
256
+ * When an item that is nested equal "true" is selected this useEffect is executed.
257
+ * The nested item is added to the item list at the top, the if validates it doesn't exist
258
+ * within the list, if doesn't exist the nested item is added to the top of the list,
259
+ * the nested item is added with an id equal "0"
260
+ */
261
+
262
+
263
+ useEffect(() => {
264
+ if (nestedSelectedValue && !items.find(item => item.id === 0)) {
265
+ const tmpItems = [...items];
266
+ tmpItems.unshift({
267
+ label: nestedSelectedValue,
268
+ title: true,
269
+ id: 0
270
+ });
271
+ setOtherItems(tmpItems.map(item => {
272
+ return { ...item,
273
+ nestedChild: item.id !== 0
274
+ };
275
+ }));
276
+ }
277
+ }, [nestedSelectedValue, items]);
248
278
 
249
279
  const handleClose = event => {
250
280
  var _openOverlayRef$curre, _openOverlayRef$curre2;
@@ -252,6 +282,7 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
252
282
  if (event.type === 'keydown') {
253
283
  if (event.key === 'Escape' || event.key === 27) {
254
284
  setIsExpanded(false);
285
+ setNestedSelectedValue(null);
255
286
  } else if (event.key === 'ArrowDown' && isExpanded && !isLoading && targetRef !== null && targetRef !== void 0 && targetRef.current) {
256
287
  targetRef.current.focus();
257
288
  }
@@ -262,6 +293,7 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
262
293
  } else if (Platform.OS === 'web') {
263
294
  // needed for dropdown to be collapsed when clicking outside on web
264
295
  setIsExpanded(false);
296
+ setNestedSelectedValue(null);
265
297
  }
266
298
  };
267
299
 
@@ -336,7 +368,7 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
336
368
  }) : /*#__PURE__*/_jsx(Suggestions, {
337
369
  hasResults: getCopy('hasResults'),
338
370
  id: "autocomplete",
339
- items: itemsToShow,
371
+ items: nestedSelectedValue ? itemsToSuggest(highlight(otherItems, nestedSelectedValue, resultsTextColor)) : itemsToShow,
340
372
  noResults: helpTextToShow,
341
373
  onClose: handleClose,
342
374
  onSelect: handleSelect,
@@ -6,7 +6,7 @@ import View from "react-native-web/dist/exports/View";
6
6
  import buttonPropTypes, { textAndA11yText } from './propTypes';
7
7
  import ButtonBase from './ButtonBase';
8
8
  import { useThemeTokensCallback } from '../ThemeProvider';
9
- import { a11yProps, focusHandlerProps, resolvePressableState, selectTokens, useInputValue } from '../utils';
9
+ import { a11yProps, getTokensPropType, focusHandlerProps, resolvePressableState, selectTokens, useInputValue } from '../utils';
10
10
  import Icon from '../Icon';
11
11
  import { getStackedContent } from '../StackView';
12
12
  import { getPressHandlersWithArgs } from '../utils/pressability';
@@ -151,6 +151,7 @@ ButtonDropdown.propTypes = { ...a11yProps.types,
151
151
  ...focusHandlerProps.types,
152
152
  ...buttonPropTypes,
153
153
  children: textAndA11yText,
154
+ tokens: getTokensPropType('ButtonDropdown'),
154
155
 
155
156
  /**
156
157
  * Callback called when a controlled ButtonDropdown gets interacted with.
@@ -12,6 +12,7 @@ const Icon = /*#__PURE__*/forwardRef((_ref, ref) => {
12
12
  variant,
13
13
  tokens,
14
14
  scalesWithText = false,
15
+ style = {},
15
16
  dataSet
16
17
  } = _ref;
17
18
  const themeTokens = useThemeTokens('Icon', tokens, variant);
@@ -30,7 +31,8 @@ const Icon = /*#__PURE__*/forwardRef((_ref, ref) => {
30
31
  // TODO: systematise animations.
31
32
  // https://github.com/telus/universal-design-system/issues/487
32
33
  transition: 'transform 200ms, color 200ms',
33
- transform: [themeTokens.scale ? `scale(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' ')
34
+ transform: [themeTokens.scale ? `scale(${themeTokens.scale})` : '', themeTokens.translateX ? `translateX(${themeTokens.translateX}px)` : '', themeTokens.translateY ? `translateY(${themeTokens.translateY}px)` : ''].filter(exists => exists).join(' '),
35
+ ...style
34
36
  },
35
37
  dataSet: dataSet,
36
38
  children: iconContent
@@ -49,7 +51,18 @@ export const iconComponentPropTypes = {
49
51
  /**
50
52
  * controls whether the icon size should be proportionate to any accessibility-related font scaling.
51
53
  */
52
- scalesWithText: PropTypes.bool
54
+ scalesWithText: PropTypes.bool,
55
+
56
+ /**
57
+ * Custom style object to be applied to the icon component.
58
+ * This is useful for overriding the default icon style but for cases where desires styles are not available as tokens.
59
+ *
60
+ * Note: This prop is only used in web.
61
+ *
62
+ * @example
63
+ * <Icon style={{ color: 'red' }}
64
+ */
65
+ style: PropTypes.object
53
66
  };
54
67
  Icon.propTypes = { ...iconComponentPropTypes,
55
68
 
@@ -197,10 +197,11 @@ const LinkBase = /*#__PURE__*/forwardRef((_ref6, ref) => {
197
197
  iconPosition: iconPosition,
198
198
  space: iconSpace,
199
199
  iconProps: { ...iconProps,
200
- tokens: iconTokens
200
+ tokens: iconTokens,
201
+ style: staticStyles.bubblePointerEvents
201
202
  },
202
203
  children: /*#__PURE__*/_jsx(Text, {
203
- style: [textStyles, blockTextStyles, staticStyles.baseline],
204
+ style: [textStyles, blockTextStyles, staticStyles.baseline, staticStyles.bubblePointerEvents],
204
205
  children: typeof children === 'function' ? children(linkState) : children
205
206
  })
206
207
  });
@@ -258,6 +259,12 @@ const staticStyles = StyleSheet.create({
258
259
  },
259
260
  baseline: {
260
261
  alignSelf: 'baseline'
262
+ },
263
+ bubblePointerEvents: { ...Platform.select({
264
+ web: {
265
+ pointerEvents: 'none'
266
+ }
267
+ })
261
268
  }
262
269
  });
263
270
  export default withLinkRouter(LinkBase);
@@ -140,6 +140,7 @@ const Listbox = _ref => {
140
140
  };
141
141
 
142
142
  Listbox.propTypes = { ...withLinkRouter.propTypes,
143
+ tokens: getTokensPropType('Listbox'),
143
144
 
144
145
  /**
145
146
  * Focus will be moved to the item with this ref once within the menu.
@@ -165,8 +166,7 @@ Listbox.propTypes = { ...withLinkRouter.propTypes,
165
166
  /**
166
167
  * onClose event
167
168
  */
168
- onClose: PropTypes.func,
169
- tokens: getTokensPropType('Listbox')
169
+ onClose: PropTypes.func
170
170
  };
171
171
  Listbox.Overlay = DropdownOverlay;
172
172
  export default Listbox;
@@ -15,6 +15,9 @@ const styles = StyleSheet.create({
15
15
  },
16
16
  childContainer: {
17
17
  paddingLeft: 16
18
+ },
19
+ nestedChildContainer: {
20
+ paddingLeft: 24
18
21
  }
19
22
  });
20
23
  const ListboxItem = /*#__PURE__*/forwardRef((_ref, ref) => {
@@ -22,6 +25,7 @@ const ListboxItem = /*#__PURE__*/forwardRef((_ref, ref) => {
22
25
  href,
23
26
  label,
24
27
  isChild = false,
28
+ nestedChild,
25
29
  onBlur,
26
30
  nextItemRef,
27
31
  prevItemRef,
@@ -41,7 +45,7 @@ const ListboxItem = /*#__PURE__*/forwardRef((_ref, ref) => {
41
45
  isChild
42
46
  });
43
47
  return /*#__PURE__*/_jsx(View, {
44
- style: [styles.itemContainer, isChild && styles.childContainer],
48
+ style: [styles.itemContainer, isChild && styles.childContainer, nestedChild && styles.nestedChildContainer],
45
49
  role: "option",
46
50
  children: /*#__PURE__*/_jsx(PressableItem, {
47
51
  href: href,
@@ -66,6 +70,7 @@ ListboxItem.propTypes = { ...selectedSystemPropTypes,
66
70
  label: PropTypes.node.isRequired,
67
71
  nextItemRef: PropTypes.object,
68
72
  prevItemRef: PropTypes.object,
69
- onPress: PropTypes.func
73
+ onPress: PropTypes.func,
74
+ nestedChild: PropTypes.bool
70
75
  };
71
76
  export default withLinkRouter(ListboxItem);
@@ -405,9 +405,9 @@ MultiSelectFilter.propTypes = {
405
405
  variant: variantProp.propType,
406
406
 
407
407
  /**
408
- * Sets the tokens for ButtonDropdown element.
408
+ * Sets the tokens for MultiSelectFilter element.
409
409
  */
410
- tokens: getTokensPropType('ButtonDropdown'),
410
+ tokens: getTokensPropType('MultiSelectFilter'),
411
411
 
412
412
  /**
413
413
  * The options a user may select.
@@ -127,6 +127,7 @@ const Tooltip = /*#__PURE__*/forwardRef((_ref6, ref) => {
127
127
  tokens,
128
128
  variant,
129
129
  inline = false,
130
+ nativeID,
130
131
  ...rest
131
132
  } = _ref6;
132
133
  const [isOpen, setIsOpen] = useState(false);
@@ -239,6 +240,7 @@ const Tooltip = /*#__PURE__*/forwardRef((_ref6, ref) => {
239
240
  hitSlop: pressableHitSlop,
240
241
  accessibilityLabel: getCopy('a11yText'),
241
242
  accessibilityRole: "button",
243
+ nativeID: nativeID,
242
244
  children: typeof control === 'function' ? pressableState => control(getPressableState(pressableState), variant) : control
243
245
  }), isOpen && /*#__PURE__*/_jsxs(View, {
244
246
  ref: floating,
@@ -154,6 +154,7 @@ const Tooltip = /*#__PURE__*/forwardRef((_ref6, ref) => {
154
154
  tokens,
155
155
  variant,
156
156
  inline = false,
157
+ nativeID,
157
158
  ...rest
158
159
  } = _ref6;
159
160
  const [isOpen, setIsOpen] = useState(false);
@@ -288,6 +289,7 @@ const Tooltip = /*#__PURE__*/forwardRef((_ref6, ref) => {
288
289
  hitSlop: pressableHitSlop,
289
290
  accessibilityLabel: getCopy('a11yText'),
290
291
  accessibilityRole: "button",
292
+ nativeID: nativeID,
291
293
  children: typeof control === 'function' ? pressableState => control(getPressableState(pressableState), variant) : control
292
294
  }), isOpen && /*#__PURE__*/_jsx(Backdrop, {
293
295
  onPress: close,
@@ -31,6 +31,11 @@ const propTypes = {
31
31
  * Callback function triggered when the tooltip is pressed.
32
32
  */
33
33
  onPress: PropTypes.func,
34
+
35
+ /**
36
+ * The `id` of the tooltip button.
37
+ */
38
+ nativeID: PropTypes.string,
34
39
  tokens: getTokensPropType('Tooltip'),
35
40
  variant: variantProp.propType
36
41
  };