@splunk/react-ui 4.23.0 → 4.25.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 (68) hide show
  1. package/Breadcrumbs.js +99 -124
  2. package/Button.js +8 -7
  3. package/ButtonSimple.js +40 -39
  4. package/CHANGELOG.md +22 -0
  5. package/Code.js +193 -100
  6. package/Color.js +18 -15
  7. package/ComboBox.js +49 -37
  8. package/JSONTree.js +210 -177
  9. package/Menu.js +643 -472
  10. package/Modal.js +265 -226
  11. package/Multiselect.js +634 -620
  12. package/RadioList.js +12 -11
  13. package/ResultsMenu.js +863 -148
  14. package/Search.js +3 -1
  15. package/Select.js +427 -416
  16. package/TabBar.js +2 -2
  17. package/Table.js +2 -2
  18. package/Tree.js +617 -0
  19. package/cypress/README.md +11 -0
  20. package/cypress/support/commands.ts +1 -0
  21. package/cypress/support/component.ts +0 -1
  22. package/cypress/tsconfig.cypress.json +14 -0
  23. package/package.json +12 -12
  24. package/types/src/Breadcrumbs/Breadcrumbs.d.ts +7 -1
  25. package/types/src/Breadcrumbs/Item.d.ts +8 -2
  26. package/types/src/Button/Button.d.ts +4 -2
  27. package/types/src/Button/docs/examples/Block.d.ts +2 -2
  28. package/types/src/Button/docs/examples/Dimmed.d.ts +2 -0
  29. package/types/src/Button/docs/examples/Disabled.d.ts +2 -2
  30. package/types/src/Button/docs/examples/Icons.d.ts +2 -2
  31. package/types/src/Button/docs/examples/Menus.d.ts +2 -2
  32. package/types/src/Button/docs/examples/To.d.ts +2 -2
  33. package/types/src/Button/docs/examples/Truncated.d.ts +2 -2
  34. package/types/src/Button/docs/examples/prisma/Basic.d.ts +2 -2
  35. package/types/src/Button/docs/examples/prisma/Block.d.ts +2 -2
  36. package/types/src/Button/docs/examples/prisma/Dimmed.d.ts +2 -0
  37. package/types/src/Button/docs/examples/prisma/Disabled.d.ts +2 -2
  38. package/types/src/Button/docs/examples/prisma/Menus.d.ts +2 -2
  39. package/types/src/Button/docs/examples/prisma/To.d.ts +2 -2
  40. package/types/src/Button/docs/examples/prisma/Truncated.d.ts +2 -2
  41. package/types/src/ButtonSimple/ButtonSimple.d.ts +4 -2
  42. package/types/src/Color/Color.d.ts +5 -3
  43. package/types/src/ComboBox/ComboBox.d.ts +6 -0
  44. package/types/src/JSONTree/JSONTree.d.ts +3 -2
  45. package/types/src/Menu/Menu.d.ts +14 -1
  46. package/types/src/Modal/Header.d.ts +0 -2
  47. package/types/src/Modal/Modal.d.ts +7 -0
  48. package/types/src/Modal/ModalContext.d.ts +1 -0
  49. package/types/src/Multiselect/Compact.d.ts +6 -0
  50. package/types/src/Multiselect/Multiselect.d.ts +7 -0
  51. package/types/src/RadioList/RadioList.d.ts +27 -27
  52. package/types/src/RadioList/RadioListContext.d.ts +5 -4
  53. package/types/src/ResultsMenu/ResultsMenu.d.ts +53 -1
  54. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedItem.d.ts +9 -0
  55. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +33 -0
  56. package/types/src/ResultsMenu/VirtualizedResultsMenu/groupChildren.d.ts +16 -0
  57. package/types/src/ResultsMenu/VirtualizedResultsMenu/index.d.ts +3 -0
  58. package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +21 -0
  59. package/types/src/ResultsMenu/index.d.ts +2 -1
  60. package/types/src/Select/Select.d.ts +2 -0
  61. package/types/src/Select/SelectBase.d.ts +6 -0
  62. package/types/src/Tree/Tree.d.ts +24 -0
  63. package/types/src/Tree/TreeContext.d.ts +13 -0
  64. package/types/src/Tree/TreeItem.d.ts +31 -0
  65. package/types/src/Tree/index.d.ts +3 -0
  66. package/types/src/Tree/treeUtils.d.ts +29 -0
  67. package/types/unit-test-setup-testing-library.d.ts +1 -0
  68. package/types/src/Modal/docs/examples/prisma/TypicalUsage.d.ts +0 -2
package/Menu.js CHANGED
@@ -8,27 +8,27 @@
8
8
  /******/ /* webpack/runtime/compat get default export */
9
9
  /******/ (() => {
10
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
11
- /******/ e.n = t => {
12
- /******/ var r = t && t.__esModule ?
13
- /******/ () => t["default"]
14
- /******/ : () => t
11
+ /******/ e.n = r => {
12
+ /******/ var t = r && r.__esModule ?
13
+ /******/ () => r["default"]
14
+ /******/ : () => r
15
15
  /******/;
16
- e.d(r, {
17
- a: r
16
+ e.d(t, {
17
+ a: t
18
18
  });
19
- /******/ return r;
19
+ /******/ return t;
20
20
  /******/ };
21
21
  /******/ })();
22
22
  /******/
23
23
  /******/ /* webpack/runtime/define property getters */
24
24
  /******/ (() => {
25
25
  /******/ // define getter functions for harmony exports
26
- /******/ e.d = (t, r) => {
27
- /******/ for (var n in r) {
28
- /******/ if (e.o(r, n) && !e.o(t, n)) {
29
- /******/ Object.defineProperty(t, n, {
26
+ /******/ e.d = (r, t) => {
27
+ /******/ for (var n in t) {
28
+ /******/ if (e.o(t, n) && !e.o(r, n)) {
29
+ /******/ Object.defineProperty(r, n, {
30
30
  enumerable: true,
31
- get: r[n]
31
+ get: t[n]
32
32
  });
33
33
  /******/ }
34
34
  /******/ }
@@ -37,7 +37,7 @@
37
37
  /******/
38
38
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
39
  /******/ (() => {
40
- /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
40
+ /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
41
41
  /******/;
42
42
  })();
43
43
  /******/
@@ -56,38 +56,38 @@
56
56
  /******/ };
57
57
  /******/ })();
58
58
  /******/
59
- /************************************************************************/ var t = {};
59
+ /************************************************************************/ var r = {};
60
60
  // ESM COMPAT FLAG
61
- e.r(t);
61
+ e.r(r);
62
62
  // EXPORTS
63
- e.d(t, {
63
+ e.d(r, {
64
64
  Divider: () => /* reexport */ x,
65
- Heading: () => /* reexport */ H,
65
+ Heading: () => /* reexport */ N,
66
66
  Item: () => /* reexport */ ze,
67
- MenuContext: () => /* reexport */ h,
68
- default: () => /* reexport */ rt
67
+ MenuContext: () => /* reexport */ y,
68
+ default: () => /* reexport */ cr
69
69
  });
70
70
  // CONCATENATED MODULE: external "react"
71
- const r = require("react");
72
- var n = e.n(r);
71
+ const t = require("react");
72
+ var n = e.n(t);
73
73
  // CONCATENATED MODULE: external "prop-types"
74
74
  const i = require("prop-types");
75
- var o = e.n(i);
75
+ var a = e.n(i);
76
76
  // CONCATENATED MODULE: external "lodash/omit"
77
- const a = require("lodash/omit");
78
- var l = e.n(a);
77
+ const o = require("lodash/omit");
78
+ var l = e.n(o);
79
79
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
80
80
  const s = require("@splunk/react-ui/Popover");
81
81
  // CONCATENATED MODULE: external "@splunk/ui-utils/focus"
82
82
  const c = require("@splunk/ui-utils/focus");
83
83
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
84
- const p = require("@splunk/ui-utils/keyboard");
84
+ const u = require("@splunk/ui-utils/keyboard");
85
85
  // CONCATENATED MODULE: external "@splunk/react-ui/useForceUpdate"
86
- const u = require("@splunk/react-ui/useForceUpdate");
87
- var d = e.n(u);
86
+ const p = require("@splunk/react-ui/useForceUpdate");
87
+ var f = e.n(p);
88
88
  // CONCATENATED MODULE: external "styled-components"
89
- const f = require("styled-components");
90
- var v = e.n(f);
89
+ const d = require("styled-components");
90
+ var v = e.n(d);
91
91
  // CONCATENATED MODULE: external "@splunk/themes"
92
92
  const b = require("@splunk/themes");
93
93
  // CONCATENATED MODULE: ./src/Menu/DividerStyles.ts
@@ -99,42 +99,42 @@
99
99
  prisma: b.variables.neutral200
100
100
  }), (0, b.pick)({
101
101
  prisma: {
102
- comfortable: (0, f.css)([ "margin:8px 0;" ]),
103
- compact: (0, f.css)([ "margin:6px 0;" ])
102
+ comfortable: (0, d.css)([ "margin:8px 0;" ]),
103
+ compact: (0, d.css)([ "margin:6px 0;" ])
104
104
  }
105
105
  }));
106
106
  // CONCATENATED MODULE: ./src/Menu/MenuContext.tsx
107
- var h = (0, r.createContext)({
107
+ var y = (0, t.createContext)({
108
108
  role: "menu"
109
109
  });
110
110
  // CONCATENATED MODULE: ./src/Menu/Divider.tsx
111
- function y() {
112
- y = Object.assign || function(e) {
113
- for (var t = 1; t < arguments.length; t++) {
114
- var r = arguments[t];
115
- for (var n in r) {
116
- if (Object.prototype.hasOwnProperty.call(r, n)) {
117
- e[n] = r[n];
111
+ function h() {
112
+ h = Object.assign || function(e) {
113
+ for (var r = 1; r < arguments.length; r++) {
114
+ var t = arguments[r];
115
+ for (var n in t) {
116
+ if (Object.prototype.hasOwnProperty.call(t, n)) {
117
+ e[n] = t[n];
118
118
  }
119
119
  }
120
120
  }
121
121
  return e;
122
122
  };
123
- return y.apply(this, arguments);
123
+ return h.apply(this, arguments);
124
124
  }
125
125
  var g = {};
126
126
  /**
127
127
  * A non-interactive menu item used to visually separate groups of items in the menu.
128
128
  */ function k(e) {
129
- var t = y({}, e);
129
+ var r = h({}, e);
130
130
  // @docs-props-type DividerPropsBase
131
- var i = (0, r.useContext)(h), o = i.role;
131
+ var i = (0, t.useContext)(y), a = i.role;
132
132
 
133
- return n().createElement(m, y({
134
- "aria-hidden": o === "listbox",
133
+ return n().createElement(m, h({
134
+ "aria-hidden": a === "listbox",
135
135
  "data-test": "divider",
136
136
  role: "separator"
137
- }, t));
137
+ }, r));
138
138
  }
139
139
  k.propTypes = g;
140
140
  /* Remove the item if it is the first item after filtering */ k.filterFirst = true;
@@ -149,76 +149,76 @@
149
149
  const O = require("@splunk/themes/useSplunkTheme");
150
150
  var C = e.n(O);
151
151
  // CONCATENATED MODULE: ./src/Menu/HeadingStyles.ts
152
- var I = v().div.withConfig({
152
+ var P = v().div.withConfig({
153
153
  displayName: "HeadingStyles__Styled",
154
154
  componentId: "mcd2ws-0"
155
155
  })([ "", " border-top:1px solid transparent;padding:", ";&:not(:first-child){", ";}" ], b.mixins.reset("block"), (0,
156
156
  b.pick)({
157
- enterprise: (0, f.css)([ "", " ", " 6px" ], b.variables.spacingQuarter, b.variables.spacingHalf),
157
+ enterprise: (0, d.css)([ "", " ", " 6px" ], b.variables.spacingQuarter, b.variables.spacingHalf),
158
158
  prisma: {
159
159
  comfortable: "13px 16px 10px 16px",
160
160
  compact: "9px 16px 6px 16px"
161
161
  }
162
162
  }), (0, b.pick)({
163
- enterprise: (0, f.css)([ "border-top:", ";" ], b.variables.border),
163
+ enterprise: (0, d.css)([ "border-top:", ";" ], b.variables.border),
164
164
  prisma: {
165
- comfortable: (0, f.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:19px;" ], b.variables.neutral200),
166
- compact: (0, f.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:15px;" ], b.variables.neutral200)
165
+ comfortable: (0, d.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:19px;" ], b.variables.neutral200),
166
+ compact: (0, d.css)([ "border-top:1px solid ", ";margin-top:6px;padding-top:15px;" ], b.variables.neutral200)
167
167
  }
168
168
  }));
169
- var P = v().h5.withConfig({
169
+ var I = v().h5.withConfig({
170
170
  displayName: "HeadingStyles__PrismaSectionTitle",
171
171
  componentId: "mcd2ws-1"
172
172
  })([ "", " font-size:", ";line-height:", ";font-weight:", ";letter-spacing:0.02em;" ], b.mixins.reset("block"), b.variables.fontSizeSmall, b.variables.lineHeight, b.variables.fontWeightBold);
173
173
  // CONCATENATED MODULE: ./src/Menu/Heading.tsx
174
- function _(e, t) {
175
- var r = Object.keys(e);
174
+ function j(e, r) {
175
+ var t = Object.keys(e);
176
176
  if (Object.getOwnPropertySymbols) {
177
177
  var n = Object.getOwnPropertySymbols(e);
178
- if (t) n = n.filter((function(t) {
179
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
178
+ if (r) n = n.filter((function(r) {
179
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
180
180
  }));
181
- r.push.apply(r, n);
181
+ t.push.apply(t, n);
182
182
  }
183
- return r;
183
+ return t;
184
184
  }
185
- function j(e) {
186
- for (var t = 1; t < arguments.length; t++) {
187
- var r = arguments[t] != null ? arguments[t] : {};
188
- if (t % 2) {
189
- _(Object(r), true).forEach((function(t) {
190
- E(e, t, r[t]);
185
+ function E(e) {
186
+ for (var r = 1; r < arguments.length; r++) {
187
+ var t = arguments[r] != null ? arguments[r] : {};
188
+ if (r % 2) {
189
+ j(Object(t), true).forEach((function(r) {
190
+ _(e, r, t[r]);
191
191
  }));
192
192
  } else if (Object.getOwnPropertyDescriptors) {
193
- Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
193
+ Object.defineProperties(e, Object.getOwnPropertyDescriptors(t));
194
194
  } else {
195
- _(Object(r)).forEach((function(t) {
196
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
195
+ j(Object(t)).forEach((function(r) {
196
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
197
197
  }));
198
198
  }
199
199
  }
200
200
  return e;
201
201
  }
202
- function E(e, t, r) {
203
- if (t in e) {
204
- Object.defineProperty(e, t, {
205
- value: r,
202
+ function _(e, r, t) {
203
+ if (r in e) {
204
+ Object.defineProperty(e, r, {
205
+ value: t,
206
206
  enumerable: true,
207
207
  configurable: true,
208
208
  writable: true
209
209
  });
210
210
  } else {
211
- e[t] = r;
211
+ e[r] = t;
212
212
  }
213
213
  return e;
214
214
  }
215
215
  function T() {
216
216
  T = Object.assign || function(e) {
217
- for (var t = 1; t < arguments.length; t++) {
218
- var r = arguments[t];
219
- for (var n in r) {
220
- if (Object.prototype.hasOwnProperty.call(r, n)) {
221
- e[n] = r[n];
217
+ for (var r = 1; r < arguments.length; r++) {
218
+ var t = arguments[r];
219
+ for (var n in t) {
220
+ if (Object.prototype.hasOwnProperty.call(t, n)) {
221
+ e[n] = t[n];
222
222
  }
223
223
  }
224
224
  }
@@ -226,92 +226,92 @@
226
226
  };
227
227
  return T.apply(this, arguments);
228
228
  }
229
- function D(e, t) {
229
+ function R(e, r) {
230
230
  if (e == null) return {};
231
- var r = R(e, t);
231
+ var t = D(e, r);
232
232
  var n, i;
233
233
  if (Object.getOwnPropertySymbols) {
234
- var o = Object.getOwnPropertySymbols(e);
235
- for (i = 0; i < o.length; i++) {
236
- n = o[i];
237
- if (t.indexOf(n) >= 0) continue;
234
+ var a = Object.getOwnPropertySymbols(e);
235
+ for (i = 0; i < a.length; i++) {
236
+ n = a[i];
237
+ if (r.indexOf(n) >= 0) continue;
238
238
  if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
239
- r[n] = e[n];
239
+ t[n] = e[n];
240
240
  }
241
241
  }
242
- return r;
242
+ return t;
243
243
  }
244
- function R(e, t) {
244
+ function D(e, r) {
245
245
  if (e == null) return {};
246
- var r = {};
246
+ var t = {};
247
247
  var n = Object.keys(e);
248
- var i, o;
249
- for (o = 0; o < n.length; o++) {
250
- i = n[o];
251
- if (t.indexOf(i) >= 0) continue;
252
- r[i] = e[i];
248
+ var i, a;
249
+ for (a = 0; a < n.length; a++) {
250
+ i = n[a];
251
+ if (r.indexOf(i) >= 0) continue;
252
+ t[i] = e[i];
253
253
  }
254
- return r;
254
+ return t;
255
255
  }
256
256
  var q = {
257
- children: o().node,
258
- title: o().bool,
259
- outerStyle: o().object
257
+ children: a().node,
258
+ title: a().bool,
259
+ outerStyle: a().object
260
260
  };
261
261
  /**
262
262
  * A non-interactive `Menu` item used to separate and label groups of `Menu` items.
263
- */ function N(e) {
264
- var t = e.children, i = e.title, o = e.outerStyle, a = D(e, [ "children", "title", "outerStyle" ]);
265
- var l = (0, r.useContext)(h), s = l.role;
266
- var c = C()(), p = c.family;
267
- var u = p === "prisma" ? n().createElement(P, T({
263
+ */ function K(e) {
264
+ var r = e.children, i = e.title, a = e.outerStyle, o = R(e, [ "children", "title", "outerStyle" ]);
265
+ var l = (0, t.useContext)(y), s = l.role;
266
+ var c = C()(), u = c.family;
267
+ var p = u === "prisma" ? n().createElement(I, T({
268
268
  as: i ? "h4" : "h5",
269
- style: o,
269
+ style: a,
270
270
  "data-test": "heading"
271
- }, a), t) : n().createElement(S(), T({
272
- style: j(j({}, o), {}, {
271
+ }, o), r) : n().createElement(S(), T({
272
+ style: E(E({}, a), {}, {
273
273
  margin: 0
274
274
  }),
275
275
  level: i ? 4 : "ss",
276
276
  "data-test": "heading"
277
- }, a), t);
277
+ }, o), r);
278
278
  // headings are not supported in role="listbox"
279
279
  // this causes Firefox to incorrectly read the total number
280
280
  // of items in the list if it contains a heading or divider
281
281
  // so we set them to aria-hidden to prevent that
282
282
 
283
- return n().createElement(I, {
283
+ return n().createElement(P, {
284
284
  "aria-hidden": s === "listbox"
285
- }, u);
285
+ }, p);
286
286
  }
287
- N.propTypes = q;
288
- /* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ N.filterConsecutive = true;
289
- /* Remove the item if it is the last item after filtering. */ N.filterLast = true;
290
- /* Tag the item as a Heading */ N.as = "Heading";
291
- /* harmony default export */ const H = N;
287
+ K.propTypes = q;
288
+ /* Remove consecutive items with filterConsecutive = true (Dividers and Headings) */ K.filterConsecutive = true;
289
+ /* Remove the item if it is the last item after filtering. */ K.filterLast = true;
290
+ /* Tag the item as a Heading */ K.as = "Heading";
291
+ /* harmony default export */ const N = K;
292
292
  // CONCATENATED MODULE: external "lodash/isString"
293
- const F = require("lodash/isString");
294
- var $ = e.n(F);
293
+ const H = require("lodash/isString");
294
+ var A = e.n(H);
295
295
  // CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
296
- const A = require("@splunk/react-icons/ChevronRight");
297
- var M = e.n(A);
296
+ const F = require("@splunk/react-icons/ChevronRight");
297
+ var $ = e.n(F);
298
298
  // CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
299
- const K = require("@splunk/react-icons/Checkmark");
300
- var z = e.n(K);
299
+ const M = require("@splunk/react-icons/Checkmark");
300
+ var z = e.n(M);
301
301
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Check"
302
302
  const L = require("@splunk/react-icons/enterprise/Check");
303
- var W = e.n(L);
303
+ var U = e.n(L);
304
304
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
305
- const B = require("@splunk/react-icons/enterprise/ChevronRight");
306
- var G = e.n(B);
305
+ const W = require("@splunk/react-icons/enterprise/ChevronRight");
306
+ var B = e.n(W);
307
307
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
308
- const U = require("@splunk/react-ui/Clickable");
309
- var V = e.n(U);
308
+ const G = require("@splunk/react-ui/Clickable");
309
+ var V = e.n(G);
310
310
  // CONCATENATED MODULE: external "@splunk/react-ui/Switch"
311
311
  const Q = require("@splunk/react-ui/Switch");
312
312
  var Y = e.n(Q);
313
313
  // CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
314
- var J = (0, f.css)([ "color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;" ], (0,
314
+ var J = (0, d.css)([ "color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;" ], (0,
315
315
  b.pick)({
316
316
  prisma: b.variables.contentColorDefault,
317
317
  enterprise: b.variables.textGray
@@ -330,13 +330,13 @@
330
330
  displayName: "ItemStyles__StyledItemSelectedIcon",
331
331
  componentId: "sc-4kc053-2"
332
332
  })([ "position:absolute;", " color:", ";" ], (0, b.pick)({
333
- prisma: (0, f.css)([ "right:16px;" ]),
334
- enterprise: (0, f.css)([ "top:5px;right:3px;left:8px;" ])
333
+ prisma: (0, d.css)([ "right:16px;" ]),
334
+ enterprise: (0, d.css)([ "top:5px;right:3px;left:8px;" ])
335
335
  }), (0, b.pick)({
336
336
  prisma: b.variables.contentColorActive,
337
337
  enterprise: b.variables.accentColorL10
338
338
  }));
339
- var te = v().span.withConfig({
339
+ var re = v().span.withConfig({
340
340
  displayName: "ItemStyles__StyledItemIcon",
341
341
  componentId: "sc-4kc053-3"
342
342
  })([ "flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", "" ], (0,
@@ -347,10 +347,10 @@
347
347
  prisma: "initial",
348
348
  enterprise: "middle"
349
349
  }), (0, b.pick)({
350
- prisma: (0, f.css)([ "color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}" ], b.variables.contentColorMuted),
351
- enterprise: (0, f.css)([ "transform:translateY(-1px);" ])
350
+ prisma: (0, d.css)([ "color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}" ], b.variables.contentColorMuted),
351
+ enterprise: (0, d.css)([ "transform:translateY(-1px);" ])
352
352
  }));
353
- var re = v()(V()).withConfig({
353
+ var te = v()(V()).withConfig({
354
354
  displayName: "ItemStyles__StyledClickable",
355
355
  componentId: "sc-4kc053-4"
356
356
  })([ "display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled]){&:hover{background:", ";", "}&:focus{outline:0;box-shadow:", ";", "}", " ", "}&[disabled]{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", "" ], (0,
@@ -367,21 +367,21 @@
367
367
  },
368
368
  enterprise: "6px 10px"
369
369
  }), (function(e) {
370
- var t = e.$isSelectable, r = e.$selectableAppearance;
371
- return t && (0, b.pick)({
372
- prisma: (0, f.css)([ "padding-right:44px;", "" ], (function() {
373
- return r === "checkbox" && "padding-left: 42px;";
370
+ var r = e.$isSelectable, t = e.$selectableAppearance;
371
+ return r && (0, b.pick)({
372
+ prisma: (0, d.css)([ "padding-right:44px;", "" ], (function() {
373
+ return t === "checkbox" && "padding-left: 42px;";
374
374
  })),
375
- enterprise: (0, f.css)([ "padding-right:10px;padding-left:", ";" ], (function() {
376
- return r === "checkbox" ? "32px" : "28px";
375
+ enterprise: (0, d.css)([ "padding-right:10px;padding-left:", ";" ], (function() {
376
+ return t === "checkbox" ? "32px" : "28px";
377
377
  }))
378
378
  });
379
379
  }), (function(e) {
380
- var t = e.$active, r = e.$preventFocus;
381
- return t && !r && (0, f.css)([ "box-shadow:", ";" ], b.variables.focusShadowInset);
380
+ var r = e.$active, t = e.$preventFocus;
381
+ return r && !t && (0, d.css)([ "box-shadow:", ";" ], b.variables.focusShadowInset);
382
382
  }), (function(e) {
383
- var t = e.$active;
384
- return t && (0, f.css)([ "background:", ";font-weight:", ";" ], (0, b.pick)({
383
+ var r = e.$active;
384
+ return r && (0, d.css)([ "background:", ";font-weight:", ";" ], (0, b.pick)({
385
385
  enterprise: {
386
386
  light: b.variables.gray92,
387
387
  dark: b.variables.gray22
@@ -392,18 +392,18 @@
392
392
  prisma: b.variables.interactiveColorOverlayHover,
393
393
  enterprise: b.variables.backgroundColorHover
394
394
  }), (function(e) {
395
- var t = e.$selected;
396
- return t && (0, b.pick)({
397
- prisma: (0, f.css)([ "background:", ";" ], b.mixins.overlayColors(b.variables.interactiveColorOverlaySelected, b.variables.interactiveColorOverlayHover))
395
+ var r = e.$selected;
396
+ return r && (0, b.pick)({
397
+ prisma: (0, d.css)([ "background:", ";" ], b.mixins.overlayColors(b.variables.interactiveColorOverlaySelected, b.variables.interactiveColorOverlayHover))
398
398
  });
399
399
  }), b.variables.focusShadowInset, (0, b.pick)({
400
- prisma: (0, f.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
400
+ prisma: (0, d.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
401
401
  }), (0, b.pick)({
402
- prisma: (0, f.css)([ "&:active{background:", ";}" ], b.variables.interactiveColorOverlayActive)
402
+ prisma: (0, d.css)([ "&:active{background:", ";}" ], b.variables.interactiveColorOverlayActive)
403
403
  }), (function(e) {
404
- var t = e.$selected;
405
- return t && (0, b.pick)({
406
- prisma: (0, f.css)([ "background:", ";&:active{background:", ";}" ], b.variables.interactiveColorOverlaySelected, b.mixins.overlayColors(b.variables.interactiveColorOverlaySelected, b.variables.interactiveColorOverlayActive))
404
+ var r = e.$selected;
405
+ return r && (0, b.pick)({
406
+ prisma: (0, d.css)([ "background:", ";&:active{background:", ";}" ], b.variables.interactiveColorOverlaySelected, b.mixins.overlayColors(b.variables.interactiveColorOverlaySelected, b.variables.interactiveColorOverlayActive))
407
407
  });
408
408
  }), (0, b.pick)({
409
409
  enterprise: {
@@ -421,15 +421,15 @@
421
421
  prisma: b.variables.contentColorDisabled,
422
422
  enterprise: b.variables.gray80
423
423
  }), (0, b.pick)({
424
- prisma: (0, f.css)([ "& > * > ", "{color:", ";}" ],
424
+ prisma: (0, d.css)([ "& > * > ", "{color:", ";}" ],
425
425
  /* sc-sel */
426
- te, b.variables.contentColorDisabled)
426
+ re, b.variables.contentColorDisabled)
427
427
  }), (function(e) {
428
- var t = e.$selected;
429
- return t && (0, b.pick)({
430
- prisma: (0, f.css)([ "", "{color:", ";}" ],
428
+ var r = e.$selected;
429
+ return r && (0, b.pick)({
430
+ prisma: (0, d.css)([ "", "{color:", ";}" ],
431
431
  /* sc-sel */
432
- te, b.variables.contentColorActive)
432
+ re, b.variables.contentColorActive)
433
433
  });
434
434
  }));
435
435
  var ne = v()(Y()).withConfig({
@@ -449,19 +449,19 @@
449
449
  displayName: "ItemStyles__StyledInnerWrapper",
450
450
  componentId: "sc-4kc053-6"
451
451
  })([ "display:flex;align-items:flex-start;" ]);
452
- var oe = v().span.withConfig({
452
+ var ae = v().span.withConfig({
453
453
  displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
454
454
  componentId: "sc-4kc053-7"
455
455
  })([ "max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", "" ], (function(e) {
456
- var t = e.$truncate;
457
- return t && (0, f.css)([ "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ]);
456
+ var r = e.$truncate;
457
+ return r && (0, d.css)([ "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ]);
458
458
  }));
459
- var ae = v().div.withConfig({
459
+ var oe = v().div.withConfig({
460
460
  displayName: "ItemStyles__StyledLabel",
461
461
  componentId: "sc-4kc053-8"
462
462
  })([ "overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", "" ], (function(e) {
463
- var t = e.$truncate;
464
- return t && (0, f.css)([ "display:block;clear:both;" ]);
463
+ var r = e.$truncate;
464
+ return r && (0, d.css)([ "display:block;clear:both;" ]);
465
465
  }));
466
466
  var le = v().span.withConfig({
467
467
  displayName: "ItemStyles__StyledMatch",
@@ -481,39 +481,39 @@
481
481
  prisma: "inherit",
482
482
  enterprise: b.variables.textGray
483
483
  }), (0, b.pick)({
484
- prisma: (0, f.css)([ "& > svg{width:20px;height:20px;}" ])
484
+ prisma: (0, d.css)([ "& > svg{width:20px;height:20px;}" ])
485
485
  }));
486
486
  // CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRight"
487
487
  const ce = require("@splunk/react-icons/ArrowSquareTopRight");
488
- var pe = e.n(ce);
488
+ var ue = e.n(ce);
489
489
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
490
- const ue = require("@splunk/react-icons/enterprise/External");
491
- var de = e.n(ue);
490
+ const pe = require("@splunk/react-icons/enterprise/External");
491
+ var fe = e.n(pe);
492
492
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
493
- const fe = require("@splunk/ui-utils/i18n");
493
+ const de = require("@splunk/ui-utils/i18n");
494
494
  // CONCATENATED MODULE: ./src/Menu/icons/External.tsx
495
- var ve = (0, fe._)("Open externally");
496
- var be = (0, f.css)([ "width:0.8em;height:0.8em;vertical-align:baseline;" ]);
497
- var me = v()(de()).withConfig({
495
+ var ve = (0, de._)("Open externally");
496
+ var be = (0, d.css)([ "width:0.8em;height:0.8em;vertical-align:baseline;" ]);
497
+ var me = v()(fe()).withConfig({
498
498
  displayName: "External__StyledEnterprise",
499
499
  componentId: "sc-1turs2s-0"
500
500
  })([ "", " margin:0 0 0 3px;" ], be);
501
- var he = v()(pe()).withConfig({
501
+ var ye = v()(ue()).withConfig({
502
502
  displayName: "External__StyledPrisma",
503
503
  componentId: "sc-1turs2s-1"
504
504
  })([ "", " margin:0 0 0 4px;" ], be);
505
- function ye() {
506
- var e = (0, b.useSplunkTheme)(), t = e.isEnterprise, r = e.isCompact;
507
- var i = r ? "20px" : "24px";
508
- return t ? n().createElement(me, {
505
+ function he() {
506
+ var e = (0, b.useSplunkTheme)(), r = e.isEnterprise, t = e.isCompact;
507
+ var i = t ? "20px" : "24px";
508
+ return r ? n().createElement(me, {
509
509
  screenReaderText: ve
510
- }) : n().createElement(he, {
510
+ }) : n().createElement(ye, {
511
511
  "aria-label": ve,
512
512
  height: i,
513
513
  width: i
514
514
  }, n().createElement("title", null, ve));
515
515
  }
516
- /* harmony default export */ const ge = ye;
516
+ /* harmony default export */ const ge = he;
517
517
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
518
518
  /**
519
519
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -521,57 +521,57 @@
521
521
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
522
522
  * @param current - The new value of the ref.
523
523
  */
524
- function ke(e, t) {
524
+ function ke(e, r) {
525
525
  if (e) {
526
526
  if (typeof e === "function") {
527
- e(t);
527
+ e(r);
528
528
  } else {
529
529
  // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
530
530
  // the intention here is to signal "we will take care of setting 'current', not you".
531
- e.current = t;
531
+ e.current = r;
532
532
  // eslint-disable-line no-param-reassign
533
533
  }
534
534
  }
535
535
  }
536
536
  // CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
537
537
  // A utility that attempts to move an element into view by scrolling it's derived parent.
538
- var xe = function e(t) {
539
- if (!t) {
538
+ var xe = function e(r) {
539
+ if (!r) {
540
540
  return;
541
541
  }
542
- var r = t.offsetParent;
543
- if (!r) {
542
+ var t = r.offsetParent;
543
+ if (!t) {
544
544
  return;
545
545
  }
546
546
  // Below the bottom of the container.
547
- if (r.scrollTop + r.clientHeight < t.offsetTop + t.clientHeight) {
548
- r.scrollTop = t.offsetTop + t.clientHeight - r.clientHeight;
547
+ if (t.scrollTop + t.clientHeight < r.offsetTop + r.clientHeight) {
548
+ t.scrollTop = r.offsetTop + r.clientHeight - t.clientHeight;
549
549
  // Above the top of the container.
550
- } else if (r.scrollTop > t.offsetTop) {
551
- r.scrollTop = t.offsetTop;
550
+ } else if (t.scrollTop > r.offsetTop) {
551
+ t.scrollTop = r.offsetTop;
552
552
  }
553
553
  };
554
554
  // CONCATENATED MODULE: ./src/Menu/Item.tsx
555
555
  function we(e) {
556
556
  "@babel/helpers - typeof";
557
557
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
558
- we = function e(t) {
559
- return typeof t;
558
+ we = function e(r) {
559
+ return typeof r;
560
560
  };
561
561
  } else {
562
- we = function e(t) {
563
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
562
+ we = function e(r) {
563
+ return r && typeof Symbol === "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
564
564
  };
565
565
  }
566
566
  return we(e);
567
567
  }
568
568
  function Se() {
569
569
  Se = Object.assign || function(e) {
570
- for (var t = 1; t < arguments.length; t++) {
571
- var r = arguments[t];
572
- for (var n in r) {
573
- if (Object.prototype.hasOwnProperty.call(r, n)) {
574
- e[n] = r[n];
570
+ for (var r = 1; r < arguments.length; r++) {
571
+ var t = arguments[r];
572
+ for (var n in t) {
573
+ if (Object.prototype.hasOwnProperty.call(t, n)) {
574
+ e[n] = t[n];
575
575
  }
576
576
  }
577
577
  }
@@ -579,92 +579,92 @@
579
579
  };
580
580
  return Se.apply(this, arguments);
581
581
  }
582
- function Oe(e, t) {
582
+ function Oe(e, r) {
583
583
  if (e == null) return {};
584
- var r = Ce(e, t);
584
+ var t = Ce(e, r);
585
585
  var n, i;
586
586
  if (Object.getOwnPropertySymbols) {
587
- var o = Object.getOwnPropertySymbols(e);
588
- for (i = 0; i < o.length; i++) {
589
- n = o[i];
590
- if (t.indexOf(n) >= 0) continue;
587
+ var a = Object.getOwnPropertySymbols(e);
588
+ for (i = 0; i < a.length; i++) {
589
+ n = a[i];
590
+ if (r.indexOf(n) >= 0) continue;
591
591
  if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
592
- r[n] = e[n];
592
+ t[n] = e[n];
593
593
  }
594
594
  }
595
- return r;
595
+ return t;
596
596
  }
597
- function Ce(e, t) {
597
+ function Ce(e, r) {
598
598
  if (e == null) return {};
599
- var r = {};
599
+ var t = {};
600
600
  var n = Object.keys(e);
601
- var i, o;
602
- for (o = 0; o < n.length; o++) {
603
- i = n[o];
604
- if (t.indexOf(i) >= 0) continue;
605
- r[i] = e[i];
601
+ var i, a;
602
+ for (a = 0; a < n.length; a++) {
603
+ i = n[a];
604
+ if (r.indexOf(i) >= 0) continue;
605
+ t[i] = e[i];
606
606
  }
607
- return r;
607
+ return t;
608
608
  }
609
- function Ie(e, t) {
610
- if (!(e instanceof t)) {
609
+ function Pe(e, r) {
610
+ if (!(e instanceof r)) {
611
611
  throw new TypeError("Cannot call a class as a function");
612
612
  }
613
613
  }
614
- function Pe(e, t) {
615
- for (var r = 0; r < t.length; r++) {
616
- var n = t[r];
614
+ function Ie(e, r) {
615
+ for (var t = 0; t < r.length; t++) {
616
+ var n = r[t];
617
617
  n.enumerable = n.enumerable || false;
618
618
  n.configurable = true;
619
619
  if ("value" in n) n.writable = true;
620
620
  Object.defineProperty(e, n.key, n);
621
621
  }
622
622
  }
623
- function _e(e, t, r) {
624
- if (t) Pe(e.prototype, t);
625
- if (r) Pe(e, r);
623
+ function je(e, r, t) {
624
+ if (r) Ie(e.prototype, r);
625
+ if (t) Ie(e, t);
626
626
  return e;
627
627
  }
628
- function je(e, t) {
629
- if (typeof t !== "function" && t !== null) {
628
+ function Ee(e, r) {
629
+ if (typeof r !== "function" && r !== null) {
630
630
  throw new TypeError("Super expression must either be null or a function");
631
631
  }
632
- e.prototype = Object.create(t && t.prototype, {
632
+ e.prototype = Object.create(r && r.prototype, {
633
633
  constructor: {
634
634
  value: e,
635
635
  writable: true,
636
636
  configurable: true
637
637
  }
638
638
  });
639
- if (t) Ee(e, t);
639
+ if (r) _e(e, r);
640
640
  }
641
- function Ee(e, t) {
642
- Ee = Object.setPrototypeOf || function e(t, r) {
643
- t.__proto__ = r;
644
- return t;
641
+ function _e(e, r) {
642
+ _e = Object.setPrototypeOf || function e(r, t) {
643
+ r.__proto__ = t;
644
+ return r;
645
645
  };
646
- return Ee(e, t);
646
+ return _e(e, r);
647
647
  }
648
648
  function Te(e) {
649
- var t = qe();
650
- return function r() {
651
- var n = Ne(e), i;
652
- if (t) {
653
- var o = Ne(this).constructor;
654
- i = Reflect.construct(n, arguments, o);
649
+ var r = qe();
650
+ return function t() {
651
+ var n = Ke(e), i;
652
+ if (r) {
653
+ var a = Ke(this).constructor;
654
+ i = Reflect.construct(n, arguments, a);
655
655
  } else {
656
656
  i = n.apply(this, arguments);
657
657
  }
658
- return De(this, i);
658
+ return Re(this, i);
659
659
  };
660
660
  }
661
- function De(e, t) {
662
- if (t && (we(t) === "object" || typeof t === "function")) {
663
- return t;
661
+ function Re(e, r) {
662
+ if (r && (we(r) === "object" || typeof r === "function")) {
663
+ return r;
664
664
  }
665
- return Re(e);
665
+ return De(e);
666
666
  }
667
- function Re(e) {
667
+ function De(e) {
668
668
  if (e === void 0) {
669
669
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
670
670
  }
@@ -681,56 +681,56 @@
681
681
  return false;
682
682
  }
683
683
  }
684
- function Ne(e) {
685
- Ne = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
686
- return t.__proto__ || Object.getPrototypeOf(t);
684
+ function Ke(e) {
685
+ Ke = Object.setPrototypeOf ? Object.getPrototypeOf : function e(r) {
686
+ return r.__proto__ || Object.getPrototypeOf(r);
687
687
  };
688
- return Ne(e);
688
+ return Ke(e);
689
689
  }
690
- function He(e, t, r) {
691
- if (t in e) {
692
- Object.defineProperty(e, t, {
693
- value: r,
690
+ function Ne(e, r, t) {
691
+ if (r in e) {
692
+ Object.defineProperty(e, r, {
693
+ value: t,
694
694
  enumerable: true,
695
695
  configurable: true,
696
696
  writable: true
697
697
  });
698
698
  } else {
699
- e[t] = r;
699
+ e[r] = t;
700
700
  }
701
701
  return e;
702
702
  }
703
- var Fe = {
704
- active: o().bool,
705
- children: o().node,
706
- description: o().string,
707
- descriptionPosition: o().oneOf([ "right", "bottom" ]),
708
- disabled: o().bool,
709
- elementRef: o().oneOfType([ o().func, o().object ]),
710
- hasSubmenu: o().bool,
711
- icon: o().node,
703
+ var He = {
704
+ active: a().bool,
705
+ children: a().node,
706
+ description: a().string,
707
+ descriptionPosition: a().oneOf([ "right", "bottom" ]),
708
+ disabled: a().bool,
709
+ elementRef: a().oneOfType([ a().func, a().object ]),
710
+ hasSubmenu: a().bool,
711
+ icon: a().node,
712
712
  /** @private. The internal key of the tab */
713
- itemKey: o().number,
714
- matchRanges: o().arrayOf(o().shape({
715
- start: o().number.isRequired,
716
- end: o().number.isRequired
713
+ itemKey: a().number,
714
+ matchRanges: a().arrayOf(a().shape({
715
+ start: a().number.isRequired,
716
+ end: a().number.isRequired
717
717
  })),
718
- onClick: o().func,
718
+ onClick: a().func,
719
719
  /** @private */
720
- onFocus: o().func,
721
- openInNewContext: o().bool,
720
+ onFocus: a().func,
721
+ openInNewContext: a().bool,
722
722
  /** @private */
723
- preventFocus: o().bool,
724
- role: o().oneOf([ "menuitem", "menuitemradio", "menuitemcheckbox", "listboxitem", "option" ]),
725
- selectable: o().bool,
726
- selectableAppearance: o().oneOf([ "checkmark", "checkbox" ]),
727
- selected: o().bool,
723
+ preventFocus: a().bool,
724
+ role: a().oneOf([ "menuitem", "menuitemradio", "menuitemcheckbox", "listboxitem", "option" ]),
725
+ selectable: a().bool,
726
+ selectableAppearance: a().oneOf([ "checkmark", "checkbox" ]),
727
+ selected: a().bool,
728
728
  /** @private */
729
- splunkTheme: o().object,
730
- to: o().string,
731
- truncate: o().bool
729
+ splunkTheme: a().object,
730
+ to: a().string,
731
+ truncate: a().bool
732
732
  };
733
- var $e = {
733
+ var Ae = {
734
734
  active: false,
735
735
  descriptionPosition: "bottom",
736
736
  disabled: false,
@@ -742,44 +742,44 @@
742
742
  selected: false,
743
743
  truncate: false
744
744
  };
745
- var Ae = function(e) {
746
- je(r, e);
747
- var t = Te(r);
748
- _e(r, null, [ {
745
+ var Fe = function(e) {
746
+ Ee(t, e);
747
+ var r = Te(t);
748
+ je(t, null, [ {
749
749
  key: "validateProps",
750
750
  // @docs-props-type ItemPropsBase
751
- value: function e(t) {
751
+ value: function e(r) {
752
752
  if (false) {}
753
753
  }
754
754
  } ]);
755
- function r(e) {
755
+ function t(e) {
756
756
  var n;
757
- Ie(this, r);
758
- n = t.call(this, e);
759
- He(Re(n), "el", null);
760
- He(Re(n), "handleFocus", (function(e) {
761
- var t = n.props, r = t.onFocus, i = t.itemKey;
762
- r === null || r === void 0 ? void 0 : r(e, {
757
+ Pe(this, t);
758
+ n = r.call(this, e);
759
+ Ne(De(n), "el", null);
760
+ Ne(De(n), "handleFocus", (function(e) {
761
+ var r = n.props, t = r.onFocus, i = r.itemKey;
762
+ t === null || t === void 0 ? void 0 : t(e, {
763
763
  itemKey: i
764
764
  });
765
765
  }));
766
- He(Re(n), "handleMount", (function(e) {
766
+ Ne(De(n), "handleMount", (function(e) {
767
767
  n.el = e;
768
768
  ke(n.props.elementRef, e);
769
769
  }));
770
- r.validateProps(e);
770
+ t.validateProps(e);
771
771
  return n;
772
772
  }
773
- _e(r, [ {
773
+ je(t, [ {
774
774
  key: "componentDidUpdate",
775
775
  value: function e() {
776
- r.validateProps(this.props);
776
+ t.validateProps(this.props);
777
777
  }
778
778
  }, {
779
779
  key: "focus",
780
780
  value: function e() {
781
- var t;
782
- (t = this.el) === null || t === void 0 ? void 0 : t.focus();
781
+ var r;
782
+ (r = this.el) === null || r === void 0 ? void 0 : r.focus();
783
783
  }
784
784
  }, {
785
785
  key: "scrollIntoViewIfNeeded",
@@ -789,121 +789,121 @@
789
789
  }, {
790
790
  key: "renderLabel",
791
791
  value: function e() {
792
- var t = this.props, r = t.children, i = t.matchRanges;
793
- if (!i || !$()(r)) {
794
- return r;
792
+ var r = this.props, t = r.children, i = r.matchRanges;
793
+ if (!i || !A()(t)) {
794
+ return t;
795
795
  }
796
- var o = [];
796
+ var a = [];
797
797
  // before first match. May be empty string.
798
- o.push(r.substring(0, i[0].start));
799
- i.forEach((function(e, t) {
800
- o.push(
798
+ a.push(t.substring(0, i[0].start));
799
+ i.forEach((function(e, r) {
800
+ a.push(
801
801
 
802
802
  // eslint-disable-next-line react/no-array-index-key
803
803
  n().createElement(le, {
804
- key: t,
804
+ key: r,
805
805
  "data-test": "match"
806
- }, r.substring(e.start, e.end)));
807
- if (t < i.length - 1) {
808
- o.push(r.substring(e.end, i[t + 1].start));
806
+ }, t.substring(e.start, e.end)));
807
+ if (r < i.length - 1) {
808
+ a.push(t.substring(e.end, i[r + 1].start));
809
809
  } else {
810
- o.push(r.substring(e.end, r.length));
810
+ a.push(t.substring(e.end, t.length));
811
811
  }
812
812
  }));
813
- return o;
813
+ return a;
814
814
  }
815
815
  }, {
816
816
  key: "render",
817
817
  value: function e() {
818
- var t = this.props, r = t.active, i = t.children, o = t.hasSubmenu, a = t.selectable, s = t.selectableAppearance, c = t.selected, p = t.icon, u = t.description, d = t.disabled, f = t.onClick, v = t.preventFocus, b = t.role, m = t.splunkTheme, h = t.to, y = t.truncate, g = t.descriptionPosition, k = t.openInNewContext, x = Oe(t, [ "active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "preventFocus", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext" ]);
818
+ var r = this.props, t = r.active, i = r.children, a = r.hasSubmenu, o = r.selectable, s = r.selectableAppearance, c = r.selected, u = r.icon, p = r.description, f = r.disabled, d = r.onClick, v = r.preventFocus, b = r.role, m = r.splunkTheme, y = r.to, h = r.truncate, g = r.descriptionPosition, k = r.openInNewContext, x = Oe(r, [ "active", "children", "hasSubmenu", "selectable", "selectableAppearance", "selected", "icon", "description", "disabled", "onClick", "preventFocus", "role", "splunkTheme", "to", "truncate", "descriptionPosition", "openInNewContext" ]);
819
819
  var w = m.isEnterprise, S = m.isPrisma;
820
- var O = a || c;
820
+ var O = o || c;
821
821
  var C = {
822
822
  nonselectable: "menuitem",
823
823
  checkmark: "menuitemradio",
824
824
  checkbox: "menuitemcheckbox"
825
825
  }[O ? s : "nonselectable"];
826
826
  // aria-checked updates only with checkmark appearance for now SUI-2578
827
- var I = {
828
- "aria-haspopup": o ? true : undefined,
827
+ var P = {
828
+ "aria-haspopup": a ? true : undefined,
829
829
  "aria-checked": s === "checkmark" && c ? true : undefined
830
830
  };
831
- var P = S ? "right" : "left";
832
- var _ = u && g === "right" && P !== "right";
833
- var j = u && !_;
834
- var E = c && s === "checkmark" && n().createElement(ee, null, S ? n().createElement(z(), {
831
+ var I = S ? "right" : "left";
832
+ var j = p && g === "right" && I !== "right";
833
+ var E = p && !j;
834
+ var _ = c && s === "checkmark" && n().createElement(ee, null, S ? n().createElement(z(), {
835
835
  inline: true,
836
836
  height: "16",
837
837
  width: "16"
838
- }) : n().createElement(W(), {
838
+ }) : n().createElement(U(), {
839
839
  hideDefaultTooltip: true,
840
840
  inline: true,
841
841
  screenReaderText: null,
842
842
  size: .85
843
843
  }));
844
844
 
845
- return n().createElement(re, Se({
845
+ return n().createElement(te, Se({
846
846
  $isSelectable: O,
847
847
  $selectableAppearance: s,
848
848
  $selected: c,
849
- $active: r,
849
+ $active: t,
850
850
  $preventFocus: v,
851
851
  "data-test-selected": O ? c : null,
852
852
  "data-test": "item",
853
- "data-has-icon": !!p,
854
- disabled: d,
855
- onClick: f,
853
+ "data-has-icon": !!u,
854
+ disabled: f,
855
+ onClick: d,
856
856
  onFocus: this.handleFocus,
857
- onMouseDown: function e(t) {
857
+ onMouseDown: function e(r) {
858
858
  if (v) {
859
- t.preventDefault();
859
+ r.preventDefault();
860
860
  }
861
861
  },
862
862
  role: b || C,
863
- to: h,
864
- title: y && $()(i) ? i : undefined,
863
+ to: y,
864
+ title: h && A()(i) ? i : undefined,
865
865
  openInNewContext: k
866
- }, I, l()(x, "onFocus"), {
866
+ }, P, l()(x, "onFocus"), {
867
867
  elementRef: this.handleMount
868
- }), P === "left" && E, a && s === "checkbox" && n().createElement(ne, {
868
+ }), I === "left" && _, o && s === "checkbox" && n().createElement(ne, {
869
869
  interactive: false,
870
870
  selected: c,
871
871
  selectedLabel: "Selected",
872
872
  value: "menu-item"
873
- }), o && n().createElement(se, null, w ? n().createElement(G(), {
873
+ }), a && n().createElement(se, null, w ? n().createElement(B(), {
874
874
  hideDefaultTooltip: true,
875
875
  screenReaderText: null
876
- }) : n().createElement(M(), null)), _ && n().createElement(Z, {
876
+ }) : n().createElement($(), null)), j && n().createElement(Z, {
877
877
  "data-test": "description"
878
- }, u), n().createElement(ie, null, p && n().createElement(te, null, p), n().createElement(oe, {
879
- $truncate: y
880
- }, n().createElement(ae, {
881
- $truncate: y,
878
+ }, p), n().createElement(ie, null, u && n().createElement(re, null, u), n().createElement(ae, {
879
+ $truncate: h
880
+ }, n().createElement(oe, {
881
+ $truncate: h,
882
882
  "data-test": "label"
883
- }, this.renderLabel(), k && n().createElement(ge, null)), j && n().createElement(X, {
883
+ }, this.renderLabel(), k && n().createElement(ge, null)), E && n().createElement(X, {
884
884
  "data-test": "description"
885
- }, u)), P === "right" && E));
885
+ }, p)), I === "right" && _));
886
886
  }
887
887
  } ]);
888
- return r;
889
- }(r.Component);
890
- He(Ae, "propTypes", Fe);
891
- He(Ae, "defaultProps", $e);
892
- He(Ae, "as", void 0);
893
- var Me = (0, b.withSplunkTheme)(Ae);
894
- var Ke = Me;
895
- Ke.propTypes = Ae.propTypes;
896
- Ke.as = "Item";
897
- /* harmony default export */ const ze = Ke;
888
+ return t;
889
+ }(t.Component);
890
+ Ne(Fe, "propTypes", He);
891
+ Ne(Fe, "defaultProps", Ae);
892
+ Ne(Fe, "as", void 0);
893
+ var $e = (0, b.withSplunkTheme)(Fe);
894
+ var Me = $e;
895
+ Me.propTypes = Fe.propTypes;
896
+ Me.as = "Item";
897
+ /* harmony default export */ const ze = Me;
898
898
  // CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
899
899
  const Le = require("@splunk/react-ui/Scroll");
900
- var We = e.n(Le);
900
+ var Ue = e.n(Le);
901
901
  // CONCATENATED MODULE: ./src/Menu/MenuStyles.ts
902
- var Be = (0, f.css)([ "border-top:1px solid ", ";" ], (0, b.pick)({
902
+ var We = (0, d.css)([ "border-top:1px solid ", ";" ], (0, b.pick)({
903
903
  enterprise: b.variables.gray60,
904
904
  prisma: b.variables.neutral200
905
905
  }));
906
- var Ge = v().div.withConfig({
906
+ var Be = v().div.withConfig({
907
907
  displayName: "MenuStyles__Styled",
908
908
  componentId: "sc-1olffp9-0"
909
909
  })([ "", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;", " &:focus{outline:0;box-shadow:", ";", "}& + &{", "}" ], b.mixins.reset("block"), (0,
@@ -911,220 +911,391 @@
911
911
  enterprise: b.variables.backgroundColor,
912
912
  prisma: b.variables.backgroundColorPopup
913
913
  }), b.variables.borderRadius, (0, b.pick)({
914
- prisma: (0, f.css)([ "padding:8px 0;" ])
914
+ prisma: (0, d.css)([ "padding:8px 0;" ])
915
915
  }), b.variables.focusShadowInset, (0, b.pick)({
916
- prisma: (0, f.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
917
- }), Be);
918
- var Ue = v()(Ge.withComponent(We())).withConfig({
916
+ prisma: (0, d.css)([ "background:", ";" ], b.variables.interactiveColorOverlayHover)
917
+ }), We);
918
+ var Ge = v()(Be.withComponent(Ue())).withConfig({
919
919
  displayName: "MenuStyles__StyledScroll",
920
920
  componentId: "sc-1olffp9-1"
921
921
  })([ "", " + &,& + ", "{", "}" ],
922
922
  /* sc-sel */
923
- Ge,
923
+ Be,
924
924
  /* sc-sel */
925
- Ge, Be);
925
+ Be, We);
926
926
  // CONCATENATED MODULE: ./src/utils/navigateList.ts
927
927
  // A utility for keyboard navigation of lists
928
- function Ve(e, t, r) {
928
+ function Ve(e, r, t) {
929
929
  for (var n = 0; n < e.length; n += 1) {
930
930
  var i;
931
- var o = (n + r) % e.length;
932
- if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
933
- return e[o];
931
+ var a = (n + t) % e.length;
932
+ if (((i = e[a].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
933
+ return e[a];
934
934
  }
935
935
  }
936
- return e[t];
936
+ return e[r];
937
937
  }
938
- function Qe(e, t, r) {
938
+ function Qe(e, r, t) {
939
939
  for (var n = e.length; n > 0; n -= 1) {
940
940
  var i;
941
- var o = (n + r) % e.length;
942
- if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
943
- return e[o];
941
+ var a = (n + t) % e.length;
942
+ if (((i = e[a].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
943
+ return e[a];
944
944
  }
945
945
  }
946
- return e[t];
946
+ return e[r];
947
947
  }
948
+ // CONCATENATED MODULE: ./src/utils/getMenuChildNode.tsx
949
+ // TODO(SUI-5919): fix the ref handling in the other components so this isn't needed
950
+ /**
951
+ * @private Get the HTML <anchor> or <button> node for a received derivative of Menu.Item
952
+ */
953
+ var Ye = function e(r) {
954
+ var t, n, i, a;
955
+ if (r.el) {
956
+ return r.el;
957
+ // Menu.Item
958
+ }
959
+ if ((t = r.c) === null || t === void 0 ? void 0 : t.el) {
960
+ return r.c.el;
961
+ // Multiselect.Option
962
+ }
963
+ if ((n = r.c) === null || n === void 0 ? void 0 : (i = n.c) === null || i === void 0 ? void 0 : i.el) {
964
+ return r.c.c.el;
965
+ // Select.Option
966
+ }
967
+ if ((a = r.item) === null || a === void 0 ? void 0 : a.el) {
968
+ return r.item.el;
969
+ // ComboBox.Option
970
+ }
971
+ return null;
972
+ };
948
973
  // CONCATENATED MODULE: ./src/Menu/Menu.tsx
949
- function Ye() {
950
- Ye = Object.assign || function(e) {
951
- for (var t = 1; t < arguments.length; t++) {
952
- var r = arguments[t];
953
- for (var n in r) {
954
- if (Object.prototype.hasOwnProperty.call(r, n)) {
955
- e[n] = r[n];
974
+ function Je() {
975
+ Je = Object.assign || function(e) {
976
+ for (var r = 1; r < arguments.length; r++) {
977
+ var t = arguments[r];
978
+ for (var n in t) {
979
+ if (Object.prototype.hasOwnProperty.call(t, n)) {
980
+ e[n] = t[n];
956
981
  }
957
982
  }
958
983
  }
959
984
  return e;
960
985
  };
961
- return Ye.apply(this, arguments);
986
+ return Je.apply(this, arguments);
987
+ }
988
+ function Xe(e, r) {
989
+ return nr(e) || tr(e, r) || er(e, r) || Ze();
990
+ }
991
+ function Ze() {
992
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
993
+ }
994
+ function er(e, r) {
995
+ if (!e) return;
996
+ if (typeof e === "string") return rr(e, r);
997
+ var t = Object.prototype.toString.call(e).slice(8, -1);
998
+ if (t === "Object" && e.constructor) t = e.constructor.name;
999
+ if (t === "Map" || t === "Set") return Array.from(e);
1000
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return rr(e, r);
1001
+ }
1002
+ function rr(e, r) {
1003
+ if (r == null || r > e.length) r = e.length;
1004
+ for (var t = 0, n = new Array(r); t < r; t++) {
1005
+ n[t] = e[t];
1006
+ }
1007
+ return n;
1008
+ }
1009
+ function tr(e, r) {
1010
+ if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
1011
+ var t = [];
1012
+ var n = true;
1013
+ var i = false;
1014
+ var a = undefined;
1015
+ try {
1016
+ for (var o = e[Symbol.iterator](), l; !(n = (l = o.next()).done); n = true) {
1017
+ t.push(l.value);
1018
+ if (r && t.length === r) break;
1019
+ }
1020
+ } catch (e) {
1021
+ i = true;
1022
+ a = e;
1023
+ } finally {
1024
+ try {
1025
+ if (!n && o["return"] != null) o["return"]();
1026
+ } finally {
1027
+ if (i) throw a;
1028
+ }
1029
+ }
1030
+ return t;
962
1031
  }
963
- function Je(e, t) {
1032
+ function nr(e) {
1033
+ if (Array.isArray(e)) return e;
1034
+ }
1035
+ function ir(e, r) {
964
1036
  if (e == null) return {};
965
- var r = Xe(e, t);
1037
+ var t = ar(e, r);
966
1038
  var n, i;
967
1039
  if (Object.getOwnPropertySymbols) {
968
- var o = Object.getOwnPropertySymbols(e);
969
- for (i = 0; i < o.length; i++) {
970
- n = o[i];
971
- if (t.indexOf(n) >= 0) continue;
1040
+ var a = Object.getOwnPropertySymbols(e);
1041
+ for (i = 0; i < a.length; i++) {
1042
+ n = a[i];
1043
+ if (r.indexOf(n) >= 0) continue;
972
1044
  if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
973
- r[n] = e[n];
1045
+ t[n] = e[n];
974
1046
  }
975
1047
  }
976
- return r;
1048
+ return t;
977
1049
  }
978
- function Xe(e, t) {
1050
+ function ar(e, r) {
979
1051
  if (e == null) return {};
980
- var r = {};
1052
+ var t = {};
981
1053
  var n = Object.keys(e);
982
- var i, o;
983
- for (o = 0; o < n.length; o++) {
984
- i = n[o];
985
- if (t.indexOf(i) >= 0) continue;
986
- r[i] = e[i];
1054
+ var i, a;
1055
+ for (a = 0; a < n.length; a++) {
1056
+ i = n[a];
1057
+ if (r.indexOf(i) >= 0) continue;
1058
+ t[i] = e[i];
987
1059
  }
988
- return r;
1060
+ return t;
989
1061
  }
990
- var Ze = {
991
- children: o().node,
1062
+ var or = {
1063
+ children: a().node,
1064
+ /** @private */
1065
+ controlledExternally: a().bool,
1066
+ elementRef: a().oneOfType([ a().func, a().object ]),
1067
+ /** @private */
1068
+ onDownKeyPress: a().func,
992
1069
  /** @private */
993
- controlledExternally: o().bool,
994
- elementRef: o().oneOfType([ o().func, o().object ]),
995
- retainFocus: o().bool,
996
- stopScrollPropagation: o().bool
1070
+ onEndKeyPress: a().func,
1071
+ /** @private */
1072
+ onHomeKeyPress: a().func,
1073
+ /** @private */
1074
+ onUpKeyPress: a().func,
1075
+ retainFocus: a().bool,
1076
+ stopScrollPropagation: a().bool
997
1077
  };
998
- var et = {
1078
+ var lr = {
999
1079
  stopScrollPropagation: false
1000
1080
  };
1001
- function tt(e) {
1002
- var t = e.children, i = e.controlledExternally, o = e.elementRef, a = e.retainFocus, u = e.stopScrollPropagation, f = Je(e, [ "children", "controlledExternally", "elementRef", "retainFocus", "stopScrollPropagation" ]);
1081
+ function sr(e) {
1082
+ var r = e.children, i = e.controlledExternally, a = e.elementRef, o = e.onDownKeyPress, p = e.onEndKeyPress, d = e.onHomeKeyPress, v = e.onUpKeyPress, b = e.retainFocus, m = e.stopScrollPropagation, h = ir(e, [ "children", "controlledExternally", "elementRef", "onDownKeyPress", "onEndKeyPress", "onHomeKeyPress", "onUpKeyPress", "retainFocus", "stopScrollPropagation" ]);
1003
1083
  // @docs-props-type MenuPropsBase
1004
- var v = (0, r.useContext)(h), b = v.role, m = b === void 0 ? "menu" : b;
1005
- var y = (0, r.useContext)(s.PopoverContext), g = y.retainFocus;
1006
- var k = d()();
1007
- var x = true;
1008
- if (a != null) {
1009
- x = a;
1010
- } else if (g != null) {
1011
- x = g;
1084
+ var g = (0, t.useContext)(y), k = g.role, x = k === void 0 ? "menu" : k;
1085
+ var w = (0, t.useContext)(s.PopoverContext), S = w.retainFocus;
1086
+ var O = f()();
1087
+ var C = true;
1088
+ if (b != null) {
1089
+ C = b;
1090
+ } else if (S != null) {
1091
+ C = S;
1012
1092
  }
1013
- var w = n().useRef(0);
1014
- var S = [];
1015
- var O = 0;
1016
- var C;
1017
- var I = false;
1018
- var P = false;
1019
- var _ = false;
1020
- var j = function e(t) {
1093
+ var P = n().useRef(0);
1094
+ var I = [];
1095
+ // `VirtualizedResultsMenu` needs some special consideration regarding the focused element index so that on
1096
+ // keypress it won't ignore the requested focus index or element, even when it doesn't exist. `VirtualizedResultsMenu`
1097
+ // knows what it _will_ mount as a child of `Menu`, and upon mount that targeted child should receive focus.
1098
+ var j = n().useRef(null);
1099
+ var E = n().useRef(false);
1100
+ // TODO(SUI-5918): stabilize itemRefs so itemOnFocus does not churn and can access itemRefs
1101
+ var _ = (0, t.useRef)(I);
1102
+ _.current = I;
1103
+ var T = 0;
1104
+ var R;
1105
+ var D = false;
1106
+ var q = false;
1107
+ var K = false;
1108
+ var N = (0, t.useCallback)((function(e) {
1109
+ var r = e.e, t = e.data, n = e.userCallback, i = e.defaultCallback;
1110
+ var a;
1111
+ if (n) {
1112
+ var o = n(r, t);
1113
+ if (typeof o[0] === "number") {
1114
+ // userCallback returned index of the to-render element which should capture focus on mount
1115
+ a = {
1116
+ current: null
1117
+ };
1118
+ var l = Xe(o, 2);
1119
+ P.current = l[0];
1120
+ E.current = l[1];
1121
+ } else {
1122
+ // userCallback returned ref of the rendered element which should take focus
1123
+ var s = o;
1124
+ var c = Xe(s, 2);
1125
+ a = c[0];
1126
+ E.current = c[1];
1127
+ P.current = Math.max(0, t.itemRefs.indexOf(a));
1128
+ }
1129
+ } else {
1130
+ a = i();
1131
+ }
1132
+ return a;
1133
+ }), []);
1134
+ var H = function e(r) {
1021
1135
  // SUI-2734: keeping this active even if controlledExternally is set
1022
1136
  // because Firefox + Voiceover (and possibly other a11y tools)
1023
1137
  // can still set focus on the Menu items and this avoids the
1024
1138
  // whole page scrolling when that happens
1025
- var r = (0, p.keycode)(t.nativeEvent);
1026
- var n = w.current;
1139
+ var t = (0, u.keycode)(r.nativeEvent);
1140
+ var n = P.current;
1027
1141
  var i;
1028
1142
  // the "retainFocus" checks here mimic the prior tab key functionality
1029
- if (r === "down" || x && (0, c.isTabKey)(t)) {
1030
- i = Ve(S, n, n + 1);
1031
- } else if (r === "up" || x && (0, c.isTabKey)(t) && t.shiftKey) {
1032
- i = Qe(S, n, n - 1);
1033
- } else if (r === "home") {
1034
- i = Ve(S, n, 0);
1035
- } else if (r === "end") {
1036
- i = Qe(S, n, S.length - 1);
1143
+ if (t === "down" || C && (0, c.isTabKey)(r)) {
1144
+ i = N({
1145
+ e: r,
1146
+ data: {
1147
+ itemRefs: I,
1148
+ focusedItemKey: n
1149
+ },
1150
+ userCallback: o,
1151
+ defaultCallback: function e() {
1152
+ return Ve(I, n, n + 1);
1153
+ }
1154
+ });
1155
+ } else if (t === "up" || C && (0, c.isTabKey)(r) && r.shiftKey) {
1156
+ i = N({
1157
+ e: r,
1158
+ data: {
1159
+ itemRefs: I,
1160
+ focusedItemKey: n
1161
+ },
1162
+ userCallback: v,
1163
+ defaultCallback: function e() {
1164
+ return Qe(I, n, n - 1);
1165
+ }
1166
+ });
1167
+ } else if (t === "home") {
1168
+ i = N({
1169
+ e: r,
1170
+ data: {
1171
+ itemRefs: I,
1172
+ focusedItemKey: n
1173
+ },
1174
+ userCallback: d,
1175
+ defaultCallback: function e() {
1176
+ return Ve(I, n, 0);
1177
+ }
1178
+ });
1179
+ } else if (t === "end") {
1180
+ i = N({
1181
+ e: r,
1182
+ data: {
1183
+ itemRefs: I,
1184
+ focusedItemKey: n
1185
+ },
1186
+ userCallback: p,
1187
+ defaultCallback: function e() {
1188
+ return Qe(I, n, I.length - 1);
1189
+ }
1190
+ });
1037
1191
  }
1038
1192
  if (i != null) {
1039
- var o, a;
1040
- (o = i.current) === null || o === void 0 ? void 0 : (a = o.focus) === null || a === void 0 ? void 0 : a.call(o);
1041
- t.preventDefault();
1193
+ var a, l;
1194
+ (a = i.current) === null || a === void 0 ? void 0 : (l = a.focus) === null || l === void 0 ? void 0 : l.call(a);
1195
+ r.preventDefault();
1196
+ j.current = E.current ? null : i.current;
1042
1197
  }
1043
1198
  };
1044
- var E = (0, r.useCallback)((function(e, t) {
1045
- var r = t.itemKey;
1046
- if (r != null) {
1047
- w.current = r;
1199
+ var A = (0, t.useCallback)((function(e, r) {
1200
+ var t = r.itemKey;
1201
+ if (t != null) {
1202
+ var n;
1203
+ P.current = t;
1204
+ j.current = E.current ? null : (n = _.current[P.current]) === null || n === void 0 ? void 0 : n.current;
1048
1205
  }
1049
1206
  }), []);
1050
- var T = r.Children.toArray(t).filter(r.isValidElement).reduce((function(e, t, r, o) {
1207
+ var F = t.Children.toArray(r).filter(t.isValidElement).reduce((function(e, r, t, a) {
1051
1208
  /* Filter out initial Dividers
1052
1209
  * Requires reduce() over filter() because a Heading may have been
1053
1210
  * before the Divider.
1054
1211
  */
1055
- if (t.type.as === "Divider" && e.length === 0) {
1212
+ if (r.type.as === "Divider" && e.length === 0) {
1056
1213
  return e;
1057
1214
  }
1058
1215
  // Filter out consecutive Dividers and Headings
1059
1216
  // If Divider is next to Heading then it will remove both Heading and Divider unless Heading has title prop set to it
1060
- if ((t.type.as === "Heading" || t.type.as === "Divider") && !t.props.title && t.type.filterConsecutive && o.length > r + 1) {
1061
- var a = o[r + 1];
1062
- if (a.type.as === "Heading" || a.type.as === "Divider") {
1217
+ if ((r.type.as === "Heading" || r.type.as === "Divider") && !r.props.title && r.type.filterConsecutive && a.length > t + 1) {
1218
+ var o = a[t + 1];
1219
+ if (o.type.as === "Heading" || o.type.as === "Divider") {
1063
1220
  return e;
1064
1221
  }
1065
1222
  }
1066
1223
  // Filter out last Dividers and Headings
1067
- if ((t.type.as === "Divider" || t.type.as === "Heading") && r === o.length - 1) {
1224
+ if ((r.type.as === "Divider" || r.type.as === "Heading") && t === a.length - 1) {
1068
1225
  return e;
1069
1226
  }
1070
1227
  // the filterConsecutive check filters out Headings and Dividers whether styled or not
1071
1228
  // the typeof check prevents props from being applied to HTML elements
1072
1229
  // such as the zero-height scroll bottom div in <ResultsMenu>
1073
- if (!(t.type.as === "Divider" || t.type.as === "Heading") && typeof t.type !== "string") {
1230
+ if (!(r.type.as === "Divider" || r.type.as === "Heading") && typeof r.type !== "string") {
1074
1231
  var l = n().createRef();
1075
- S.push(l);
1076
- if (C == null && (!("disabled" in t.props) || !t.props.disabled)) {
1077
- C = O;
1232
+ var s = I.length;
1233
+ I.push(l);
1234
+ if (R == null && (!("disabled" in r.props) || !r.props.disabled)) {
1235
+ R = T;
1078
1236
  }
1079
- if (w.current === O && "disabled" in t.props && t.props.disabled) {
1080
- I = true;
1237
+ if (P.current === T && "disabled" in r.props && r.props.disabled) {
1238
+ D = true;
1081
1239
  }
1082
- if ("selected" in t.props && t.props.selected) {
1083
- P = true;
1084
- if ("disabled" in t.props && !t.props.disabled) {
1085
- _ = true;
1240
+ if ("selected" in r.props && r.props.selected) {
1241
+ q = true;
1242
+ if ("disabled" in r.props && !r.props.disabled) {
1243
+ K = true;
1086
1244
  }
1087
1245
  }
1088
- var s = !i && w.current === O ? undefined : -1;
1089
- e.push( n().cloneElement(t, {
1090
- itemKey: O,
1091
- onFocus: E,
1246
+ var c = !i && P.current === T ? undefined : -1;
1247
+ e.push( n().cloneElement(r, {
1248
+ itemKey: T,
1249
+ onFocus: A,
1092
1250
  preventFocus: i,
1093
- ref: function e(r) {
1094
- ke(t.ref, r);
1095
- ke(l, r);
1251
+ ref: function e(t) {
1252
+ ke(r.ref, t);
1253
+ ke(l, t);
1254
+ if (!t) {
1255
+ return;
1256
+ }
1257
+ if (t === j.current) {
1258
+ // When using `VirtualizedResultsMenu` the ref content changes but the
1259
+ // count doesn't. The keyboard scrolling will break if the focus index
1260
+ // isn't corrected during scroll
1261
+ P.current = s;
1262
+ } else if (E.current && s === P.current) {
1263
+ var n;
1264
+ (n = Ye(t)) === null || n === void 0 ? void 0 : n.focus();
1265
+ E.current = false;
1266
+ }
1096
1267
  },
1097
- tabIndex: s
1268
+ tabIndex: c
1098
1269
  }));
1099
- O += 1;
1270
+ T += 1;
1100
1271
  return e;
1101
1272
  }
1102
- e.push(t);
1273
+ e.push(r);
1103
1274
  return e;
1104
1275
  }), []);
1105
- if (C !== w.current && (!P || _) && I && C != null) {
1106
- w.current = C;
1107
- k();
1276
+ if (R !== P.current && (!q || K) && D && R != null) {
1277
+ P.current = R;
1278
+ O();
1108
1279
  }
1109
- var D = {
1280
+ var $ = {
1110
1281
  "data-test": "menu",
1111
- onKeyDown: j,
1112
- role: m,
1113
- tabIndex: C == null && !i ? 0 : undefined
1282
+ onKeyDown: H,
1283
+ role: x,
1284
+ tabIndex: R == null && !i ? 0 : undefined
1114
1285
  };
1115
- return u ? n().createElement(Ue, Ye({}, D, {
1116
- elementRef: o,
1286
+ return m ? n().createElement(Ge, Je({}, $, {
1287
+ elementRef: a,
1117
1288
  stopScrollPropagation: true
1118
- }, l()(f, "tagName")), T) : n().createElement(Ge, Ye({}, D, {
1119
- ref: o
1120
- }, f), T);
1289
+ }, l()(h, "tagName")), F) : n().createElement(Be, Je({}, $, {
1290
+ ref: a
1291
+ }, h), F);
1121
1292
  }
1122
- tt.propTypes = Ze;
1123
- tt.defaultProps = et;
1124
- tt.Item = ze;
1125
- tt.Divider = x;
1126
- tt.Heading = H;
1127
- /* harmony default export */ const rt = tt;
1293
+ sr.propTypes = or;
1294
+ sr.defaultProps = lr;
1295
+ sr.Item = ze;
1296
+ sr.Divider = x;
1297
+ sr.Heading = N;
1298
+ /* harmony default export */ const cr = sr;
1128
1299
  // CONCATENATED MODULE: ./src/Menu/index.ts
1129
- module.exports = t;
1300
+ module.exports = r;
1130
1301
  /******/})();