@splunk/react-ui 5.0.0-rc.2 → 5.0.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.
package/ResultsMenu.js CHANGED
@@ -15,12 +15,12 @@
15
15
  var a = n(23);
16
16
  var i = n.n(a);
17
17
  // EXTERNAL MODULE: external "styled-components"
18
- var u = n(232);
19
- var l = n.n(u);
18
+ var l = n(232);
19
+ var u = n.n(l);
20
20
  // EXTERNAL MODULE: external "@splunk/themes"
21
21
  var c = n(3563);
22
22
  // CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContentStyles.ts
23
- var s = l().span.withConfig({
23
+ var s = u().span.withConfig({
24
24
  displayName: "ScreenReaderContentStyles__Styled",
25
25
  componentId: "sc-1lnohwp-0"
26
26
  })([ "", ";" ], c.mixins.screenReaderContent());
@@ -191,10 +191,10 @@
191
191
  var a = n.n(o);
192
192
  // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
193
193
  const i = require("@splunk/react-ui/Divider");
194
- var u = n.n(i);
194
+ var l = n.n(i);
195
195
  // CONCATENATED MODULE: external "@splunk/react-ui/Menu"
196
- const l = require("@splunk/react-ui/Menu");
197
- var c = n.n(l);
196
+ const u = require("@splunk/react-ui/Menu");
197
+ var c = n.n(u);
198
198
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
199
199
  const s = require("@splunk/ui-utils/i18n");
200
200
  // EXTERNAL MODULE: external "styled-components"
@@ -290,23 +290,23 @@
290
290
  function P(e, r) {
291
291
  var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
292
292
  if (null != n) {
293
- var t, o, a, i, u = [], l = !0, c = !1;
293
+ var t, o, a, i, l = [], u = !0, c = !1;
294
294
  try {
295
295
  if (a = (n = n.call(e)).next, 0 === r) {
296
296
  if (Object(n) !== n) return;
297
- l = !1;
298
- } else for (;!(l = (t = a.call(n)).done) && (u.push(t.value), u.length !== r); l = !0) {
297
+ u = !1;
298
+ } else for (;!(u = (t = a.call(n)).done) && (l.push(t.value), l.length !== r); u = !0) {
299
299
  }
300
300
  } catch (e) {
301
301
  c = !0, o = e;
302
302
  } finally {
303
303
  try {
304
- if (!l && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
304
+ if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
305
305
  } finally {
306
306
  if (c) throw o;
307
307
  }
308
308
  }
309
- return u;
309
+ return l;
310
310
  }
311
311
  }
312
312
  function x(e) {
@@ -355,143 +355,144 @@
355
355
  var N = 400;
356
356
  var D = 28;
357
357
  function H(n) {
358
- var t = n.animateLoading, o = n["aria-multiselectable"], a = n.children, i = n.childrenStart, c = n.elementRef, s = n.focusMode, f = n.footerMessage, v = n.isLoading, d = n.loadingMessage, m = d === void 0 ? _ : d, p = n.menuId, R = n.noOptionsMessage, k = R === void 0 ? q : R, I = n.onScroll, P = n.onScrollBottom, x = n.placement, A = n.style, L = n.tabIndex, H = T(n, [ "animateLoading", "aria-multiselectable", "children", "childrenStart", "elementRef", "focusMode", "footerMessage", "isLoading", "loadingMessage", "menuId", "noOptionsMessage", "onScroll", "onScrollBottom", "placement", "style", "tabIndex" ]);
358
+ var t = n.animateLoading, o = n["aria-multiselectable"], a = n.children, i = n.childrenStart, c = n.elementRef, s = n.focusMode, f = n.footerMessage, v = n.isLoading, d = n.labelledBy, m = n.loadingMessage, p = m === void 0 ? _ : m, R = n.menuId, k = n.noOptionsMessage, I = k === void 0 ? q : k, P = n.onScroll, x = n.onScrollBottom, A = n.placement, L = n.style, H = n.tabIndex, F = T(n, [ "animateLoading", "aria-multiselectable", "children", "childrenStart", "elementRef", "focusMode", "footerMessage", "isLoading", "labelledBy", "loadingMessage", "menuId", "noOptionsMessage", "onScroll", "onScrollBottom", "placement", "style", "tabIndex" ]);
359
359
  // @docs-props-type ResultsMenuPropsBase
360
- var F = (0, e.useState)(undefined), U = j(F, 2), z = U[0], B = U[1];
361
- var V = (0, e.useState)(null), K = j(V, 2), W = K[0], $ = K[1];
362
- var G = (0, e.useState)(null), X = j(G, 2), J = X[0], Q = X[1];
363
- var Y = (0, e.useState)(0), Z = j(Y, 2), ee = Z[0], re = Z[1];
364
- var ne = (0, e.useState)(0), te = j(ne, 2), oe = te[0], ae = te[1];
365
- var ie = (0, e.useState)(false), ue = j(ie, 2), le = ue[0], ce = ue[1];
366
- var se = (0, e.useCallback)((function(e) {
367
- Q(e);
368
- }), []);
360
+ var B = (0, e.useState)(undefined), U = j(B, 2), z = U[0], V = U[1];
361
+ var K = (0, e.useState)(null), W = j(K, 2), $ = W[0], G = W[1];
362
+ var X = (0, e.useState)(null), J = j(X, 2), Q = J[0], Y = J[1];
363
+ var Z = (0, e.useState)(0), ee = j(Z, 2), re = ee[0], ne = ee[1];
364
+ var te = (0, e.useState)(0), oe = j(te, 2), ae = oe[0], ie = oe[1];
365
+ var le = (0, e.useState)(false), ue = j(le, 2), ce = ue[0], se = ue[1];
369
366
  var fe = (0, e.useCallback)((function(e) {
370
- $(e);
367
+ Y(e);
368
+ }), []);
369
+ var ve = (0, e.useCallback)((function(e) {
370
+ G(e);
371
371
  w(c, e);
372
372
  }), [ c ]);
373
- var ve = (0, e.useCallback)((function() {
374
- ae(document.documentElement.scrollTop);
375
- }), []);
376
373
  var de = (0, e.useCallback)((function() {
377
- ae(document.documentElement.scrollTop);
374
+ ie(document.documentElement.scrollTop);
375
+ }), []);
376
+ var me = (0, e.useCallback)((function() {
377
+ ie(document.documentElement.scrollTop);
378
378
  }), []);
379
- var me = (0, e.useCallback)((function(e) {
379
+ var pe = (0, e.useCallback)((function(e) {
380
380
  // Safety net to ensure window doesn't scroll if menu is scrolled pass the numberOfItemsLoaded at high velocity.
381
381
  e.stopPropagation();
382
- document.documentElement.scrollTop = oe;
383
- }), [ oe ]);
384
- var pe = (0, e.useCallback)((function() {
385
- return !!J && J.scrollHeight === J.offsetHeight;
386
- }), [ J ]);
387
- var be = (0, e.useCallback)((function(e) {
388
- if (!le) {
389
- ce(true);
390
- P === null || P === void 0 ? void 0 : P(e);
391
- }
392
- }), [ le, P ]);
382
+ document.documentElement.scrollTop = ae;
383
+ }), [ ae ]);
384
+ var be = (0, e.useCallback)((function() {
385
+ return !!Q && Q.scrollHeight === Q.offsetHeight;
386
+ }), [ Q ]);
393
387
  var ye = (0, e.useCallback)((function(e) {
394
- if (P && e.target && J) {
395
- var r = J.scrollHeight - J.offsetHeight - N;
388
+ if (!ce) {
389
+ se(true);
390
+ x === null || x === void 0 ? void 0 : x(e);
391
+ }
392
+ }), [ ce, x ]);
393
+ var ge = (0, e.useCallback)((function(e) {
394
+ if (x && e.target && Q) {
395
+ var r = Q.scrollHeight - Q.offsetHeight - N;
396
396
  // Adding 1 due to border of menu item.
397
- if (J.scrollTop + 1 >= r) {
398
- be(e);
397
+ if (Q.scrollTop + 1 >= r) {
398
+ ye(e);
399
399
  }
400
400
  }
401
- I === null || I === void 0 ? void 0 : I(e);
402
- }), [ be, J, I, P ]);
403
- var ge = (0, e.useCallback)((function() {
401
+ P === null || P === void 0 ? void 0 : P(e);
402
+ }), [ ye, Q, P, x ]);
403
+ var he = (0, e.useCallback)((function() {
404
404
  var r = e.Children.count(a);
405
405
  // If menu is full length, load more items.
406
- if (pe()) {
407
- be(null);
406
+ if (be()) {
407
+ ye(null);
408
408
  }
409
409
  // Avoid triggering this logic if this.state.childrenCount is null
410
410
  // because that's not a real change in the number of children
411
411
  // and thus we want to avoid resetting the value of scrollBottomTriggered
412
412
  if (z != null && r !== z) {
413
- re(r - (z !== null && z !== void 0 ? z : 0));
414
- ce(false);
413
+ ne(r - (z !== null && z !== void 0 ? z : 0));
414
+ se(false);
415
415
  }
416
416
  if (r !== z) {
417
- B(r);
417
+ V(r);
418
418
  }
419
- }), [ pe, a, z, be ]);
419
+ }), [ be, a, z, ye ]);
420
420
  (0, e.useEffect)((function() {
421
- if (!W || !J) {
421
+ if (!$ || !Q) {
422
422
  return;
423
423
  }
424
424
  // If onScrollBottom is defined, determine if it should be triggered.
425
- if (P && a) {
426
- ge();
425
+ if (x && a) {
426
+ he();
427
427
  }
428
- }), [ W, J, a, P, ge ]);
428
+ }), [ $, Q, a, x, he ]);
429
429
  // Assumption: that you cannot be filtered if you are a result
430
- var he = e.Children.toArray(a).filter(e.isValidElement).some((function(e) {
430
+ var Se = e.Children.toArray(a).filter(e.isValidElement).some((function(e) {
431
431
  var r = e.type;
432
432
  return !(r.as === "Divider" && r.filterFirst || (r.as === "Divider" || r.as === "Heading") && (r.filterLast || r.filterConsecutive));
433
433
  }));
434
- var Se = pe();
435
- var Ee = (0, e.useMemo)((function() {
434
+ var Ee = be();
435
+ var Oe = (0, e.useMemo)((function() {
436
436
  return {
437
- height: le ? ee * D : 0
437
+ height: ce ? re * D : 0
438
438
  };
439
- }), [ le, ee ]);
440
- var Oe = !he && !!k && !v;
441
- var we = (0, e.useCallback)((function() {
439
+ }), [ ce, re ]);
440
+ var we = !Se && !!I && !v;
441
+ var Me = (0, e.useCallback)((function() {
442
442
  return {
443
443
  role: "listbox",
444
444
  preventFocus: s === "never"
445
445
  };
446
446
  }), [ s ]);
447
- var Me = (0, e.useCallback)((function() {
447
+ var Ce = (0, e.useCallback)((function() {
448
448
  var n = !!e.Children.toArray(a).length;
449
- return f && n && r().createElement(r().Fragment, null, x !== "above" && r().createElement(u(), null), r().createElement(g, {
449
+ return f && n && r().createElement(r().Fragment, null, A !== "above" && r().createElement(l(), null), r().createElement(g, {
450
450
  "data-test": "footer-message",
451
451
  key: "footer"
452
- }, f), x === "above" && r().createElement(u(), null));
453
- }), [ f, a, x ]);
452
+ }, f), A === "above" && r().createElement(l(), null));
453
+ }), [ f, a, A ]);
454
454
 
455
455
  return r().createElement(y, C({
456
456
  "data-test": "results-menu",
457
457
  key: "wrapper",
458
- ref: fe,
459
- onWheel: P ? me : undefined,
460
- onMouseEnter: P ? ve : undefined,
461
- onMouseLeave: P ? de : undefined
462
- }, H, {
463
- style: A
464
- }), x !== "above" && i, x === "above" && Me(), r().createElement(l.MenuContext.Provider, {
465
- value: we()
458
+ ref: ve,
459
+ onWheel: x ? pe : undefined,
460
+ onMouseEnter: x ? de : undefined,
461
+ onMouseLeave: x ? me : undefined
462
+ }, F, {
463
+ style: L
464
+ }), A !== "above" && i, A === "above" && Ce(), r().createElement(u.MenuContext.Provider, {
465
+ value: Me()
466
466
  }, r().createElement(b, {
467
467
  "aria-multiselectable": o,
468
- elementRef: se,
468
+ "aria-labelledby": d,
469
+ elementRef: fe,
469
470
  focusMode: s,
470
- id: p,
471
+ id: R,
471
472
  key: "menu",
472
- onScroll: ye,
473
+ onScroll: ge,
473
474
  stopScrollPropagation: true,
474
- tabIndex: L
475
- }, Oe && r().createElement(S, {
475
+ tabIndex: H
476
+ }, we && r().createElement(S, {
476
477
  "data-test": "no-results-message",
477
478
  disabled: true
478
- }, k), a, P && !Se &&
479
+ }, I), a, x && !Ee &&
479
480
 
480
481
  // Bottom spacer fills in the space of new items being loaded by using the minimum possible height x menuItems.
481
482
  r().createElement("div", {
482
483
  "data-test": "results-menu-bottom-spacer",
483
- style: Ee
484
- }), v && r().createElement(h, null, t && r().createElement(E, null), r().createElement(O, null, m)))), r().createElement(M["default"], {
484
+ style: Oe
485
+ }), v && r().createElement(h, null, t && r().createElement(E, null), r().createElement(O, null, p)))), r().createElement(M["default"], {
485
486
  "aria-live": "polite"
486
- }, Oe && k), x !== "above" && Me(), x === "above" && i);
487
+ }, we && I), A !== "above" && Ce(), A === "above" && i);
487
488
  }
488
489
  H.propTypes = L;
489
490
  /* harmony default export */ const F = H;
490
491
  // CONCATENATED MODULE: external "lodash/omit"
491
- const U = require("lodash/omit");
492
- var z = n.n(U);
492
+ const B = require("lodash/omit");
493
+ var U = n.n(B);
493
494
  // CONCATENATED MODULE: external "@splunk/ui-utils/focus"
494
- const B = require("@splunk/ui-utils/focus");
495
+ const z = require("@splunk/ui-utils/focus");
495
496
  // CONCATENATED MODULE: ./src/ResultsMenu/VirtualizedResultsMenu/groupChildren.ts
496
497
  // Cheap(er than processing potentially thousands of array elements) memoization
497
498
  var V = {
@@ -557,13 +558,13 @@
557
558
  }
558
559
  };
559
560
  }), [ o, a ]);
560
- var u = e.Children.only(t);
561
- if (!u) {
561
+ var l = e.Children.only(t);
562
+ if (!l) {
562
563
  if (false) {}
563
564
  return null;
564
565
  }
565
566
 
566
- return (0, e.cloneElement)(u, {
567
+ return (0, e.cloneElement)(l, {
567
568
  elementRef: function e(r) {
568
569
  i.current = r;
569
570
  w(n, r);
@@ -587,7 +588,7 @@
587
588
  if (t >= 0 && t < a) {
588
589
  return;
589
590
  }
590
- if (e.type !== l.Divider && e.type !== l.Heading) {
591
+ if (e.type !== u.Divider && e.type !== u.Heading) {
591
592
  t = a;
592
593
  o = r;
593
594
  }
@@ -600,15 +601,15 @@
600
601
  * - If `trackFirstElement` the **FIRST** non-divider/heading item will also be replaced.
601
602
  * - If `trackLastElement` the **LAST** non-divider/heading item will also be replaced.
602
603
  */ var J = function e(n, t, o) {
603
- var a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, i = a.trackFirstElement, u = a.trackLastElement;
604
+ var a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, i = a.trackFirstElement, l = a.trackLastElement;
604
605
  if (!Array.isArray(n)) {
605
606
  return [];
606
607
  }
607
- var l = X(n, Math.floor(n.length / 2));
608
+ var u = X(n, Math.floor(n.length / 2));
608
609
  var c = i && X(n, 0);
609
- var s = u && X(n, n.length - 1);
610
+ var s = l && X(n, n.length - 1);
610
611
  return n.map((function(e, n) {
611
- if (n === l || n === c || n === s) {
612
+ if (n === u || n === c || n === s) {
612
613
 
613
614
  return r().createElement(G, {
614
615
  key: (0, W.createGUID)(),
@@ -652,7 +653,7 @@
652
653
  if (Array.isArray(e)) return ie(e);
653
654
  }
654
655
  function te(e, r) {
655
- return le(e) || ue(e, r) || ae(e, r) || oe();
656
+ return ue(e) || le(e, r) || ae(e, r) || oe();
656
657
  }
657
658
  function oe() {
658
659
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
@@ -671,29 +672,29 @@
671
672
  }
672
673
  return t;
673
674
  }
674
- function ue(e, r) {
675
+ function le(e, r) {
675
676
  var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
676
677
  if (null != n) {
677
- var t, o, a, i, u = [], l = !0, c = !1;
678
+ var t, o, a, i, l = [], u = !0, c = !1;
678
679
  try {
679
680
  if (a = (n = n.call(e)).next, 0 === r) {
680
681
  if (Object(n) !== n) return;
681
- l = !1;
682
- } else for (;!(l = (t = a.call(n)).done) && (u.push(t.value), u.length !== r); l = !0) {
682
+ u = !1;
683
+ } else for (;!(u = (t = a.call(n)).done) && (l.push(t.value), l.length !== r); u = !0) {
683
684
  }
684
685
  } catch (e) {
685
686
  c = !0, o = e;
686
687
  } finally {
687
688
  try {
688
- if (!l && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
689
+ if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
689
690
  } finally {
690
691
  if (c) throw o;
691
692
  }
692
693
  }
693
- return u;
694
+ return l;
694
695
  }
695
696
  }
696
- function le(e) {
697
+ function ue(e) {
697
698
  if (Array.isArray(e)) return e;
698
699
  }
699
700
  function ce(e, r) {
@@ -762,7 +763,7 @@
762
763
  return ("string" === r ? String : Number)(e);
763
764
  }
764
765
  // TODO(SUI-5920): add transitions to this component in React 18
765
- var be = ve(ve({}, z()(L, "onDownKeyPress", "onEndKeyPress", "onHomeKeyPress", "onUpKeyPress")), {}, {
766
+ var be = ve(ve({}, U()(L, "onDownKeyPress", "onEndKeyPress", "onHomeKeyPress", "onUpKeyPress")), {}, {
766
767
  virtualization: a().number
767
768
  });
768
769
  var ye = [];
@@ -785,7 +786,7 @@
785
786
  * @throws in `__DEV__` when `virtualization` is less than or equal to 1 (`virtualization` must be ≥ 2)
786
787
  * @throws in `__DEV__` when `virtualization` is changed during the lifecycle of the `VirtualizedResultsMenu` component
787
788
  */ function ge(n) {
788
- var t = n.virtualization, o = t === void 0 ? 2 : t, a = n.elementRef, i = n.children, u = n.focusMode, l = u === void 0 ? "normal" : u, c = ce(n, [ "virtualization", "elementRef", "children", "focusMode" ]);
789
+ var t = n.virtualization, o = t === void 0 ? 2 : t, a = n.elementRef, i = n.children, l = n.focusMode, u = l === void 0 ? "normal" : l, c = ce(n, [ "virtualization", "elementRef", "children", "focusMode" ]);
789
790
  // @docs-props-type VirtualizedResultsMenuPropsBase
790
791
  var s = (0, e.useRef)(o);
791
792
  // If a user tries to set virtualization to a value smaller than the number of options
@@ -962,7 +963,7 @@
962
963
  if (t) {
963
964
  var o;
964
965
  // if the first pane is already rendered, find the first element and focus it
965
- var a = (0, B.getSortedTabbableElements)(r, {
966
+ var a = (0, z.getSortedTabbableElements)(r, {
966
967
  ignoreTabIndex: true
967
968
  });
968
969
  var i = a[0];
@@ -975,13 +976,13 @@
975
976
  }
976
977
  return;
977
978
  }
978
- var u = O.current.length - 1;
979
+ var l = O.current.length - 1;
979
980
  if (n === "End") {
980
- var l = M.current === u;
981
- if (l) {
981
+ var u = M.current === l;
982
+ if (u) {
982
983
  var c;
983
984
  // if the last pane is already rendered, find the first element and focus it
984
- var s = (0, B.getSortedTabbableElements)(r, {
985
+ var s = (0, z.getSortedTabbableElements)(r, {
985
986
  ignoreTabIndex: true
986
987
  });
987
988
  var f = s[s.length - 1];
@@ -990,18 +991,18 @@
990
991
  // if it's not rendered, set up focusing it after the next render
991
992
  b.current = true;
992
993
  // then call changePane() to trigger the render
993
- L(u);
994
+ L(l);
994
995
  }
995
996
  return;
996
997
  }
997
- var v = (0, B.getSortedTabbableElements)(r, {
998
+ var v = (0, z.getSortedTabbableElements)(r, {
998
999
  ignoreTabIndex: true
999
1000
  });
1000
1001
  var d = (e === null || e === void 0 ? void 0 : e.target) instanceof Element ? e.target : null;
1001
1002
  var m = r === null || r === void 0 ? void 0 : r.querySelector(":focus");
1002
1003
  var y = d || m;
1003
1004
  var g = y ? v.indexOf(y) : -1;
1004
- (0, B.handleFocus)(n, v, g, {
1005
+ (0, z.handleFocus)(n, v, g, {
1005
1006
  enableLoop: false,
1006
1007
  // VirtualizedResultsMenu does not support looping focus
1007
1008
  orientation: "vertical",
@@ -1026,7 +1027,7 @@
1026
1027
  };
1027
1028
  }), []);
1028
1029
  (0, e.useEffect)((function() {
1029
- if (l === "never") {
1030
+ if (u === "never") {
1030
1031
  return undefined;
1031
1032
  }
1032
1033
  var e = C.current;
@@ -1036,11 +1037,11 @@
1036
1037
  return function() {
1037
1038
  e === null || e === void 0 ? void 0 : e.removeEventListener("keydown", q);
1038
1039
  };
1039
- }), [ q, l ]);
1040
+ }), [ q, u ]);
1040
1041
 
1041
1042
  return r().createElement(F, Y({
1042
1043
  elementRef: _,
1043
- focusMode: l
1044
+ focusMode: u
1044
1045
  }, c), T);
1045
1046
  }
1046
1047
  ge.propTypes = be;
package/Select.js CHANGED
@@ -1579,15 +1579,15 @@
1579
1579
  return c;
1580
1580
  }), [ Re, je, l, s, f, Jn, S, _e, $n, Bn, Kn, Fn, Xn, _n, E, N, Yn, U, ce, Ue, be ]);
1581
1581
  var et = function e(t) {
1582
- var r = t.anchorWidth, l = t.maxHeight, o = t.placement;
1583
- var i = tn({
1582
+ var r = t.anchorWidth, l = t.maxHeight, o = t.placement, i = t.toggleId;
1583
+ var u = tn({
1584
1584
  anchorWidth: r,
1585
1585
  isMultiple: N,
1586
1586
  maxHeight: l,
1587
1587
  menuStyle: B
1588
1588
  });
1589
- var u = Jn.length > 0 && !Qn && !S ? 0 : undefined;
1590
- var c = {
1589
+ var c = Jn.length > 0 && !Qn && !S ? 0 : undefined;
1590
+ var s = {
1591
1591
  "aria-multiselectable": N || undefined,
1592
1592
  childrenStart: !!S && n().createElement(fn, {
1593
1593
  activeItemId: je,
@@ -1613,6 +1613,8 @@
1613
1613
  }),
1614
1614
  focusMode: S ? "never" : undefined,
1615
1615
  isLoading: E,
1616
+ labelledBy: "".concat(Rn !== null && Rn !== void 0 ? Rn : "", " ").concat(i !== null && i !== void 0 ? i : "").trim(),
1617
+ // NVDA ignores aria-labelledby attribute on popover, but reads it on menu
1616
1618
  menuId: Pe,
1617
1619
  onScrollBottom: U ? Nn : undefined,
1618
1620
  placement: o !== null && o !== void 0 ? o : undefined,
@@ -1621,17 +1623,17 @@
1621
1623
  animateLoading: a,
1622
1624
  loadingMessage: L,
1623
1625
  onScroll: X,
1624
- style: i,
1625
- tabIndex: u
1626
+ style: u,
1627
+ tabIndex: c
1626
1628
  };
1627
1629
  if (ve) {
1628
1630
 
1629
1631
  return n().createElement(D.VirtualizedResultsMenu, Ne({
1630
1632
  virtualization: ve
1631
- }, c), Zn);
1633
+ }, s), Zn);
1632
1634
  }
1633
1635
 
1634
- return n().createElement(_(), c, Zn);
1636
+ return n().createElement(_(), s, Zn);
1635
1637
  };
1636
1638
  var nt = (0, e.useMemo)((function() {
1637
1639
 
package/TransitionOpen.js CHANGED
@@ -369,8 +369,11 @@
369
369
  U(true);
370
370
  }
371
371
  }), [ w, H ]);
372
- // equivalent to componentWillUnmount
372
+ // equivalent to componentDidMount and componentWillUnmount
373
373
  (0, r.useEffect)((function() {
374
+ // we need to set this to true on every mount because React.StrictMode will call the effect twice
375
+ // and we need to ensure that allowAnimationUpdates is true while the component is mounted
376
+ L.current = true;
374
377
  return function() {
375
378
  L.current = false;
376
379
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "5.0.0-rc.2",
3
+ "version": "5.0.0",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -26,7 +26,6 @@
26
26
  "storybook:build": "yarn sb build",
27
27
  "stylelint": "stylelint \"src/**/*.{ts,tsx,js,jsx}\" --config stylelint.config.js",
28
28
  "test": "jest",
29
- "test:ci": "JEST_JUNIT_OUTPUT_DIR=./test-reports JEST_JUNIT_OUTPUT_NAME=unit-results.xml JEST_JUNIT_CLASSNAME=unit yarn run test --ci --reporters=default jest-junit --coverage --coverageDirectory=coverage_report/coverage_maps_unit --coverageReporters=cobertura",
30
29
  "test:watch": "jest --watch",
31
30
  "test:cypress": "yarn cypress open --component",
32
31
  "test:cypress:ci": "yarn cypress run --component",
@@ -45,9 +44,9 @@
45
44
  "@dnd-kit/sortable": "^8.0.0",
46
45
  "@dnd-kit/utilities": "^3.2.2",
47
46
  "@react-spring/web": "^9.7.5",
48
- "@splunk/react-icons": "5.0.0-rc.2",
49
- "@splunk/themes": "1.0.0-rc.2",
50
- "@splunk/ui-utils": "^1.8.0",
47
+ "@splunk/react-icons": "^5.0.0",
48
+ "@splunk/themes": "^1.0.0",
49
+ "@splunk/ui-utils": "^1.9.0",
51
50
  "decimal.js-light": "^2.2.3",
52
51
  "lodash": "^4.17.14",
53
52
  "moment": "^2.29.4",
@@ -61,9 +60,9 @@
61
60
  "@babel/core": "^7.2.0",
62
61
  "@babel/plugin-transform-runtime": "^7.18.6",
63
62
  "@splunk/babel-preset": "^4.0.0",
64
- "@splunk/docs-gen": "1.0.0-rc.2",
63
+ "@splunk/docs-gen": "^1.0.0",
65
64
  "@splunk/eslint-config": "^5.0.0",
66
- "@splunk/react-docs": "1.0.0-rc.2",
65
+ "@splunk/react-docs": "^1.0.0",
67
66
  "@splunk/stylelint-config": "^5.0.0",
68
67
  "@splunk/test-runner-utils": "^0.4.1",
69
68
  "@splunk/webpack-configs": "^7.0.2",
@@ -80,7 +79,7 @@
80
79
  "@testing-library/react": "^16.3.0",
81
80
  "@testing-library/react-hooks": "^8.0.1",
82
81
  "@testing-library/user-event": "^14.6.1",
83
- "@types/jest": "^26.0.0",
82
+ "@types/jest": "^29.5.14",
84
83
  "@types/lodash": "^4.14.156",
85
84
  "@types/node": "^10.17.26",
86
85
  "@types/prismjs": "^1.26.3",
@@ -102,7 +101,7 @@
102
101
  "babel-plugin-transform-require-context": "^0.1.1",
103
102
  "core-js": "^3.6.4",
104
103
  "cross-env": "^6.0.3",
105
- "cypress": "^12.17.1",
104
+ "cypress": "^13.17.0",
106
105
  "cypress-real-events": "^1.9.1",
107
106
  "eslint": "^8.57.1",
108
107
  "eslint-config-airbnb": "^19.0.4",
@@ -121,7 +120,8 @@
121
120
  "fs-readdir-recursive": "^1.0.0",
122
121
  "glob": "^7.1.6",
123
122
  "http-server": "^14.1.1",
124
- "jest": "^26.6.3",
123
+ "jest": "^29.7.0",
124
+ "jest-environment-jsdom": "^29.7.0",
125
125
  "jest-image-snapshot": "^5.1.0",
126
126
  "jest-junit": "^10.0.0",
127
127
  "jest-stare": "^2.4.1",
@@ -8,6 +8,7 @@ type DropdownChildrenRenderer = (data: {
8
8
  maxHeight: number | null;
9
9
  maxWidth: number | null;
10
10
  placement: DropdownPlacementStatus | null;
11
+ toggleId?: string;
11
12
  }) => React.ReactNode;
12
13
  /** @public */
13
14
  type DropdownPlacement = 'above' | 'below' | 'left' | 'right' | 'vertical' | 'horizontal';
@@ -9,6 +9,7 @@ type PopoverChildrenRenderer = (data: {
9
9
  maxHeight: number | null;
10
10
  maxWidth: number | null;
11
11
  placement: PopoverPlacementStatus | null;
12
+ toggleId?: string;
12
13
  }) => React.ReactNode;
13
14
  /** @public */
14
15
  type PopoverPlacement = 'above' | 'below' | 'left' | 'right' | 'vertical' | 'horizontal';
@@ -143,6 +144,11 @@ interface PopoverPropsBase {
143
144
  * Disable this for a `Popover` that has shows on hover, such as a tooltip.
144
145
  */
145
146
  takeFocus?: boolean;
147
+ /**
148
+ * Id of the toggle is added to aria-labelledby attribute of inner results menu
149
+ * @private
150
+ */
151
+ toggleId?: string;
146
152
  }
147
153
  type PopoverProps = ComponentProps<PopoverPropsBase, 'div'>;
148
154
  /**
@@ -150,7 +156,7 @@ type PopoverProps = ComponentProps<PopoverPropsBase, 'div'>;
150
156
  * this only when the other components don't provide sufficient functionality or control. A controlled
151
157
  * `Dropdown` covers use cases where you might consider using `Popover` directly.
152
158
  */
153
- declare function Popover({ align, anchor, animation, animationConfig, appearance, autoCloseWhenOffScreen, canCoverAnchor, children, closeReasons, defaultPlacement, elementRef, hideArrow, hitAreaRef, id, onRequestClose, open, outerRef, pointTo, repositionMode, retainFocus, takeFocus, ...otherProps }: PopoverProps): React.JSX.Element;
159
+ declare function Popover({ align, anchor, animation, animationConfig, appearance, autoCloseWhenOffScreen, canCoverAnchor, children, closeReasons, defaultPlacement, elementRef, hideArrow, hitAreaRef, id, onRequestClose, open, outerRef, pointTo, repositionMode, retainFocus, takeFocus, toggleId, ...otherProps }: PopoverProps): React.JSX.Element;
154
160
  declare namespace Popover {
155
161
  var propTypes: {
156
162
  align: PropTypes.Requireable<string>;
@@ -36,6 +36,7 @@ interface ResultsMenuPropsBase {
36
36
  * children, so therefore it may be necessary to scroll to see the animation.
37
37
  */
38
38
  isLoading?: boolean;
39
+ labelledBy?: string;
39
40
  loadingMessage?: React.ReactNode;
40
41
  menuId?: string;
41
42
  noOptionsMessage?: React.ReactNode;
@@ -66,7 +67,7 @@ declare const propTypes: {
66
67
  placement: PropTypes.Requireable<string>;
67
68
  };
68
69
  type ResultsMenuProps = ComponentProps<ResultsMenuPropsBase, 'div'>;
69
- declare function ResultsMenu({ animateLoading, 'aria-multiselectable': ariaMultiselectable, children, childrenStart, elementRef, focusMode, footerMessage, isLoading, loadingMessage, menuId, noOptionsMessage, onScroll, onScrollBottom, placement, style, tabIndex, ...otherProps }: ResultsMenuProps): React.JSX.Element;
70
+ declare function ResultsMenu({ animateLoading, 'aria-multiselectable': ariaMultiselectable, children, childrenStart, elementRef, focusMode, footerMessage, isLoading, labelledBy, loadingMessage, menuId, noOptionsMessage, onScroll, onScrollBottom, placement, style, tabIndex, ...otherProps }: ResultsMenuProps): React.JSX.Element;
70
71
  declare namespace ResultsMenu {
71
72
  var propTypes: {
72
73
  animateLoading: PropTypes.Requireable<boolean>;