@splunk/react-ui 4.38.0 → 4.39.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 (136) hide show
  1. package/Accordion.js +131 -153
  2. package/Anchor.js +50 -58
  3. package/Animation.js +64 -59
  4. package/AnimationToggle.js +59 -61
  5. package/Box.js +59 -67
  6. package/Breadcrumbs.js +113 -127
  7. package/Button.js +151 -169
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +28 -0
  11. package/Calendar.js +353 -414
  12. package/Card.js +183 -243
  13. package/CardLayout.js +86 -83
  14. package/Chip.js +104 -122
  15. package/Clickable.js +180 -198
  16. package/CloseButton.js +52 -60
  17. package/Code.js +24 -31
  18. package/CollapsiblePanel.js +172 -202
  19. package/Color.js +371 -412
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +266 -303
  22. package/Concertina.js +406 -454
  23. package/ControlGroup.js +165 -194
  24. package/Date.js +116 -131
  25. package/DefinitionList.js +125 -149
  26. package/Divider.js +81 -79
  27. package/Dropdown.js +226 -237
  28. package/DualListbox.js +150 -186
  29. package/EventListener.js +4 -1
  30. package/File.js +1032 -955
  31. package/FormRows.js +281 -334
  32. package/Heading.js +27 -35
  33. package/Image.js +101 -116
  34. package/JSONTree.js +301 -344
  35. package/Layer.js +118 -126
  36. package/Link.js +141 -159
  37. package/List.js +61 -77
  38. package/MIGRATION.mdx +92 -38
  39. package/Markdown.js +288 -347
  40. package/Menu.js +506 -532
  41. package/Message.js +173 -196
  42. package/MessageBar.js +58 -66
  43. package/Modal.js +241 -290
  44. package/ModalLayer.js +130 -148
  45. package/Monogram.js +138 -138
  46. package/Multiselect.js +1589 -1902
  47. package/Number.js +159 -178
  48. package/Paginator.js +296 -335
  49. package/Paragraph.js +24 -32
  50. package/Popover.js +448 -441
  51. package/Progress.js +65 -75
  52. package/RadioBar.js +301 -303
  53. package/RadioList.js +77 -119
  54. package/Resize.js +105 -127
  55. package/ResultsMenu.js +373 -385
  56. package/ScreenReaderContent.js +50 -58
  57. package/Scroll.js +209 -244
  58. package/Search.js +379 -391
  59. package/Select.js +1077 -1345
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +132 -145
  62. package/SlidingPanels.js +238 -270
  63. package/SplitButton.js +222 -245
  64. package/StaticContent.js +68 -76
  65. package/StepBar.js +206 -205
  66. package/Switch.js +176 -205
  67. package/TabBar.js +222 -258
  68. package/TabLayout.js +114 -139
  69. package/Table.js +2017 -2180
  70. package/Text.js +379 -493
  71. package/TextArea.js +411 -441
  72. package/Tooltip.js +116 -132
  73. package/TransitionOpen.js +160 -178
  74. package/Tree.js +268 -287
  75. package/Typography.js +48 -52
  76. package/WaitSpinner.js +60 -68
  77. package/cypress/support/commands.ts +9 -0
  78. package/cypress/support/index.d.ts +6 -0
  79. package/cypress/tsconfig.cypress.json +1 -0
  80. package/docker-compose.yml +0 -1
  81. package/package.json +14 -14
  82. package/types/src/Button/Button.d.ts +5 -1
  83. package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
  84. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
  85. package/types/src/Color/Color.d.ts +2 -2
  86. package/types/src/Color/Palette.d.ts +4 -2
  87. package/types/src/ComboBox/Option.d.ts +1 -1
  88. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  89. package/types/src/Date/Date.d.ts +2 -2
  90. package/types/src/File/File.d.ts +2 -3
  91. package/types/src/File/Retry.d.ts +1 -2
  92. package/types/src/Menu/Item.d.ts +18 -5
  93. package/types/src/Menu/Menu.d.ts +3 -3
  94. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  95. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  96. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  97. package/types/src/Multiselect/Option.d.ts +2 -0
  98. package/types/src/Number/Number.d.ts +3 -3
  99. package/types/src/Popover/Popover.d.ts +3 -4
  100. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  101. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  102. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  103. package/types/src/Search/Option.d.ts +9 -3
  104. package/types/src/Select/Option.d.ts +3 -1
  105. package/types/src/Select/OptionBase.d.ts +7 -5
  106. package/types/src/Select/Select.d.ts +1 -1
  107. package/types/src/Select/SelectAllOption.d.ts +4 -4
  108. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  109. package/types/src/Slider/Slider.d.ts +2 -2
  110. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  111. package/types/src/StepBar/Step.d.ts +1 -2
  112. package/types/src/Switch/Switch.d.ts +0 -1
  113. package/types/src/TabBar/Tab.d.ts +1 -1
  114. package/types/src/TabBar/TabBar.d.ts +3 -1
  115. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  116. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  117. package/types/src/Table/Table.d.ts +0 -1
  118. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  119. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  120. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  121. package/types/src/Text/Text.d.ts +2 -2
  122. package/types/src/TextArea/TextArea.d.ts +2 -2
  123. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  124. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  125. package/useForceUpdate.js +30 -32
  126. package/useKeyPress.js +1 -1
  127. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  128. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  129. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  130. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  131. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  132. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  133. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  134. /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
  135. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  136. /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/TabBar.js CHANGED
@@ -61,17 +61,17 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- Tab: () => /* reexport */ le,
65
- default: () => /* reexport */ we
64
+ Tab: () => /* reexport */ se,
65
+ default: () => /* reexport */ Ce
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
68
  const r = require("react");
69
69
  var n = e.n(r);
70
70
  // CONCATENATED MODULE: external "prop-types"
71
71
  const i = require("prop-types");
72
- var a = e.n(i);
72
+ var o = e.n(i);
73
73
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
74
- const o = require("@splunk/ui-utils/keyboard");
74
+ const a = require("@splunk/ui-utils/keyboard");
75
75
  // CONCATENATED MODULE: external "styled-components"
76
76
  const l = require("styled-components");
77
77
  var c = e.n(l);
@@ -211,9 +211,7 @@
211
211
  enterprise: (0, l.css)([ "width:3px;" ]),
212
212
  prisma: (0, l.css)([ "width:1px;" ])
213
213
  }
214
- }),
215
- /* sc-sel */
216
- z, j, j);
214
+ }), /* sc-sel */ z, j, j);
217
215
  var M = c().span.withConfig({
218
216
  displayName: "TabStyles__StyledMenu",
219
217
  componentId: "sc-1ry8mzj-2"
@@ -230,13 +228,7 @@
230
228
  dark: s.variables.borderColor
231
229
  })),
232
230
  prisma: (0, l.css)([ "background-color:", ";border-color:", ";box-shadow:", ";" ], s.variables.interactiveColorOverlayHover, s.variables.interactiveColorBorderHover, s.variables.hoverShadow)
233
- }),
234
- /* sc-sel */
235
- z,
236
- /* sc-sel */
237
- z,
238
- /* sc-sel */
239
- z);
231
+ }), /* sc-sel */ z, /* sc-sel */ z, /* sc-sel */ z);
240
232
  var _ = c().span.withConfig({
241
233
  displayName: "TabStyles__StyledIcon",
242
234
  componentId: "sc-1ry8mzj-3"
@@ -266,7 +258,7 @@
266
258
  compact: "10px 0"
267
259
  }
268
260
  }));
269
- var R = c().span.withConfig({
261
+ var D = c().span.withConfig({
270
262
  displayName: "TabStyles__StyledCount",
271
263
  componentId: "sc-1ry8mzj-6"
272
264
  })([ "display:inline-block;border-radius:18px;color:", ";font-size:", ";line-height:10px;padding:", ";margin-inline-start:", ";", " &[disabled]{color:", ";}" ], s.variables.contentColorDefault, (0,
@@ -283,7 +275,7 @@
283
275
  enterprise: (0, l.css)([ "&::before{content:'(';}&::after{content:')';}" ]),
284
276
  prisma: (0, l.css)([ "background:", ";" ], s.variables.neutral100)
285
277
  }), s.variables.contentColorDisabled);
286
- var D = c().div.withConfig({
278
+ var R = c().div.withConfig({
287
279
  displayName: "TabStyles__StyledTooltipContent",
288
280
  componentId: "sc-1ry8mzj-7"
289
281
  })([ "padding:8px;font-size:", ";" ], s.variables.fontSizeSmall);
@@ -326,185 +318,165 @@
326
318
  }
327
319
  }
328
320
  // CONCATENATED MODULE: ./src/TabBar/Tab.tsx
329
- function F(e) {
321
+ function N(e) {
330
322
  "@babel/helpers - typeof";
331
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
332
- F = function e(t) {
333
- return typeof t;
334
- };
335
- } else {
336
- F = function e(t) {
337
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
338
- };
339
- }
340
- return F(e);
323
+ return N = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
324
+ return typeof e;
325
+ } : function(e) {
326
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
327
+ }, N(e);
341
328
  }
342
- function N() {
343
- N = Object.assign || function(e) {
329
+ function F() {
330
+ return F = Object.assign ? Object.assign.bind() : function(e) {
344
331
  for (var t = 1; t < arguments.length; t++) {
345
332
  var r = arguments[t];
346
333
  for (var n in r) {
347
- if (Object.prototype.hasOwnProperty.call(r, n)) {
348
- e[n] = r[n];
349
- }
334
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
350
335
  }
351
336
  }
352
337
  return e;
353
- };
354
- return N.apply(this, arguments);
338
+ }, F.apply(null, arguments);
355
339
  }
356
340
  function U(e, t) {
357
- if (e == null) return {};
358
- var r = W(e, t);
359
- var n, i;
341
+ if (null == e) return {};
342
+ var r, n, i = W(e, t);
360
343
  if (Object.getOwnPropertySymbols) {
361
- var a = Object.getOwnPropertySymbols(e);
362
- for (i = 0; i < a.length; i++) {
363
- n = a[i];
364
- if (t.indexOf(n) >= 0) continue;
365
- if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
366
- r[n] = e[n];
344
+ var o = Object.getOwnPropertySymbols(e);
345
+ for (n = 0; n < o.length; n++) {
346
+ r = o[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (i[r] = e[r]);
367
347
  }
368
348
  }
369
- return r;
349
+ return i;
370
350
  }
371
351
  function W(e, t) {
372
- if (e == null) return {};
352
+ if (null == e) return {};
373
353
  var r = {};
374
- var n = Object.keys(e);
375
- var i, a;
376
- for (a = 0; a < n.length; a++) {
377
- i = n[a];
378
- if (t.indexOf(i) >= 0) continue;
379
- r[i] = e[i];
354
+ for (var n in e) {
355
+ if ({}.hasOwnProperty.call(e, n)) {
356
+ if (t.includes(n)) continue;
357
+ r[n] = e[n];
358
+ }
380
359
  }
381
360
  return r;
382
361
  }
383
362
  function L(e, t) {
384
- if (!(e instanceof t)) {
385
- throw new TypeError("Cannot call a class as a function");
386
- }
363
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
387
364
  }
388
365
  function H(e, t) {
389
366
  for (var r = 0; r < t.length; r++) {
390
367
  var n = t[r];
391
- n.enumerable = n.enumerable || false;
392
- n.configurable = true;
393
- if ("value" in n) n.writable = true;
394
- Object.defineProperty(e, n.key, n);
368
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
369
+ Object.defineProperty(e, ne(n.key), n);
395
370
  }
396
371
  }
397
372
  function Y(e, t, r) {
398
- if (t) H(e.prototype, t);
399
- if (r) H(e, r);
400
- return e;
373
+ return t && H(e.prototype, t), r && H(e, r), Object.defineProperty(e, "prototype", {
374
+ writable: !1
375
+ }), e;
401
376
  }
402
377
  function G(e, t) {
403
- if (typeof t !== "function" && t !== null) {
404
- throw new TypeError("Super expression must either be null or a function");
405
- }
378
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
406
379
  e.prototype = Object.create(t && t.prototype, {
407
380
  constructor: {
408
381
  value: e,
409
- writable: true,
410
- configurable: true
382
+ writable: !0,
383
+ configurable: !0
411
384
  }
412
- });
413
- if (t) J(e, t);
385
+ }), Object.defineProperty(e, "prototype", {
386
+ writable: !1
387
+ }), t && J(e, t);
414
388
  }
415
389
  function J(e, t) {
416
- J = Object.setPrototypeOf || function e(t, r) {
417
- t.__proto__ = r;
418
- return t;
419
- };
420
- return J(e, t);
390
+ return J = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
391
+ return e.__proto__ = t, e;
392
+ }, J(e, t);
421
393
  }
422
394
  function Q(e) {
423
395
  var t = ee();
424
- return function r() {
425
- var n = te(e), i;
396
+ return function() {
397
+ var r, n = te(e);
426
398
  if (t) {
427
- var a = te(this).constructor;
428
- i = Reflect.construct(n, arguments, a);
429
- } else {
430
- i = n.apply(this, arguments);
431
- }
432
- return X(this, i);
399
+ var i = te(this).constructor;
400
+ r = Reflect.construct(n, arguments, i);
401
+ } else r = n.apply(this, arguments);
402
+ return X(this, r);
433
403
  };
434
404
  }
435
405
  function X(e, t) {
436
- if (t && (F(t) === "object" || typeof t === "function")) {
437
- return t;
438
- }
406
+ if (t && ("object" == N(t) || "function" == typeof t)) return t;
407
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
439
408
  return Z(e);
440
409
  }
441
410
  function Z(e) {
442
- if (e === void 0) {
443
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
444
- }
411
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
445
412
  return e;
446
413
  }
447
414
  function ee() {
448
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
449
- if (Reflect.construct.sham) return false;
450
- if (typeof Proxy === "function") return true;
451
415
  try {
452
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
453
- return true;
454
- } catch (e) {
455
- return false;
456
- }
416
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
417
+ } catch (e) {}
418
+ return (ee = function t() {
419
+ return !!e;
420
+ })();
457
421
  }
458
422
  function te(e) {
459
- te = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
460
- return t.__proto__ || Object.getPrototypeOf(t);
461
- };
462
- return te(e);
423
+ return te = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
424
+ return e.__proto__ || Object.getPrototypeOf(e);
425
+ }, te(e);
463
426
  }
464
427
  function re(e, t, r) {
465
- if (t in e) {
466
- Object.defineProperty(e, t, {
467
- value: r,
468
- enumerable: true,
469
- configurable: true,
470
- writable: true
471
- });
472
- } else {
473
- e[t] = r;
428
+ return (t = ne(t)) in e ? Object.defineProperty(e, t, {
429
+ value: r,
430
+ enumerable: !0,
431
+ configurable: !0,
432
+ writable: !0
433
+ }) : e[t] = r, e;
434
+ }
435
+ function ne(e) {
436
+ var t = ie(e, "string");
437
+ return "symbol" == N(t) ? t : t + "";
438
+ }
439
+ function ie(e, t) {
440
+ if ("object" != N(e) || !e) return e;
441
+ var r = e[Symbol.toPrimitive];
442
+ if (void 0 !== r) {
443
+ var n = r.call(e, t || "default");
444
+ if ("object" != N(n)) return n;
445
+ throw new TypeError("@@toPrimitive must return a primitive value.");
474
446
  }
475
- return e;
447
+ return ("string" === t ? String : Number)(e);
476
448
  }
477
- var ne = {
449
+ var oe = {
478
450
  /** @private. Is the tab active. */
479
- active: a().bool,
480
- ariaControls: a().string,
481
- count: a().number,
482
- disabled: a().bool,
483
- elementRef: a().oneOfType([ a().func, a().object ]),
484
- icon: a().node,
485
- id: a().string,
486
- label: a().oneOfType([ a().string, a().element ]),
451
+ active: o().bool,
452
+ ariaControls: o().string,
453
+ count: o().number,
454
+ disabled: o().bool,
455
+ elementRef: o().oneOfType([ o().func, o().object ]),
456
+ icon: o().node,
457
+ id: o().string,
458
+ label: o().oneOfType([ o().string, o().element ]),
487
459
  /** @private Maximum count number in tab label */
488
- maxCount: a().number,
460
+ maxCount: o().number,
489
461
  /** @private */
490
- splunkTheme: a().object,
491
- tabId: a().string,
462
+ splunkTheme: o().object,
463
+ tabId: o().string,
492
464
  /** @private. The internal key of the tab */
493
- tabKey: a().number,
494
- to: a().string,
495
- tooltip: a().node,
465
+ tabKey: o().number,
466
+ to: o().string,
467
+ tooltip: o().node,
496
468
  /**
497
469
  * @private
498
470
  * Accepts a Menu component that is rendered for that Tab.
499
471
  * Is not compatible with `count`.
500
472
  * The `menu` prop is only supported in horizontal layout due to both design constraints as well as keyboard support.
501
473
  */
502
- menu: a().node
474
+ menu: o().node
503
475
  };
504
- var ie = {
476
+ var ae = {
505
477
  active: false
506
478
  };
507
- var ae = function(e) {
479
+ var le = function(e) {
508
480
  G(r, e);
509
481
  var t = Q(r);
510
482
  // @docs-props-type TabPropsBase
@@ -532,25 +504,25 @@
532
504
  });
533
505
  }));
534
506
  re(Z(n), "handleClick", (function(e) {
535
- var t = n.props, r = t.active, i = t.tabId, a = t.tabKey, o = t.to;
507
+ var t = n.props, r = t.active, i = t.tabId, o = t.tabKey, a = t.to;
536
508
  var l = n.context.onClick;
537
509
  // preserve the previous behaviour from 2ad8e7eaf47 to avoid firing unnecessary onChange events
538
510
  // while preventing the "to" prop from incorrectly triggering <Clickable>'s providedOnClick on the active tab
539
511
  if (!r) {
540
512
  l === null || l === void 0 ? void 0 : l(e, {
541
513
  tabId: i,
542
- tabKey: a
514
+ tabKey: o
543
515
  });
544
516
  }
545
- if (o == null || o != null && r) {
517
+ if (a == null || a != null && r) {
546
518
  e.preventDefault();
547
519
  }
548
520
  }));
549
521
  re(Z(n), "handleFocus", (function(e) {
550
522
  n.handleTooltipOpen();
551
523
  var t = n.props, r = t.tabId, i = t.tabKey;
552
- var a = n.context.onFocus;
553
- a === null || a === void 0 ? void 0 : a(e, {
524
+ var o = n.context.onFocus;
525
+ o === null || o === void 0 ? void 0 : o(e, {
554
526
  tabId: r,
555
527
  tabKey: i
556
528
  });
@@ -579,11 +551,11 @@
579
551
  }, {
580
552
  key: "render",
581
553
  value: function e() {
582
- var t = this.props, r = t.active, i = t.ariaControls, a = t.count, o = t.disabled, l = t.icon, c = t.label, s = t.tabId, u = t.maxCount, p = t.splunkTheme, v = t.to, h = t.tooltip, m = t.menu, x = t.tabKey, w = U(t, [ "active", "ariaControls", "count", "disabled", "icon", "label", "tabId", "maxCount", "splunkTheme", "to", "tooltip", "menu", "tabKey" ]);
554
+ var t = this.props, r = t.active, i = t.ariaControls, o = t.count, a = t.disabled, l = t.icon, c = t.label, s = t.tabId, u = t.maxCount, p = t.splunkTheme, v = t.to, h = t.tooltip, m = t.menu, x = t.tabKey, w = U(t, [ "active", "ariaControls", "count", "disabled", "icon", "label", "tabId", "maxCount", "splunkTheme", "to", "tooltip", "menu", "tabKey" ]);
583
555
  var C = this.state, O = C.anchor, T = C.open;
584
- var I = this.context, j = I.appearance, q = I.disabled, A = I.iconSize, V = I.layout, B = I.width, F = I.onMenuOpen, W = I.onMenuClose, L = I.isMenuOpen, H = I.focusedTabKey;
556
+ var I = this.context, j = I.appearance, q = I.disabled, A = I.iconSize, V = I.layout, B = I.width, N = I.onMenuOpen, W = I.onMenuClose, L = I.isMenuOpen, H = I.focusedTabKey;
585
557
  var Y = w.style;
586
- var G = q || o || false;
558
+ var G = q || a || false;
587
559
  var J = A || "inline";
588
560
  var Q = V || "horizontal";
589
561
  var X = B ? {
@@ -591,8 +563,8 @@
591
563
  } : Y;
592
564
  var Z = p.isEnterprise;
593
565
  var ee = c ? c.toString() : "";
594
- var te = a === 0 || a ? "".concat(a === null || a === void 0 ? void 0 : a.toString()) : "";
595
- // title is used for CSS styling in TabStyles. labelValue and countValue needs to be included in the title.
566
+ var te = o === 0 || o ? "".concat(o === null || o === void 0 ? void 0 : o.toString()) : "";
567
+ // title is used for CSS styling in TabStyles. labelValue and countValue needs to be included in the title.
596
568
  var re;
597
569
  if (Z) {
598
570
  // countValue needs unicode space for width to not change after it's clicked.
@@ -602,7 +574,7 @@
602
574
  re = "".concat(ee, "    ").concat(te);
603
575
  }
604
576
  var ie = H === x && L && !!m;
605
- var ae = n().createElement(M, {
577
+ var oe = n().createElement(M, {
606
578
  $active: r,
607
579
  "data-test": "menu-toggle",
608
580
  tabIndex: -1,
@@ -610,16 +582,16 @@
610
582
  }, Z ? n().createElement(g(), {
611
583
  size: 1.1
612
584
  }) : n().createElement(b(), null));
613
- var oe = function e(t) {
585
+ var ae = function e(t) {
614
586
  // if there is no menu, or if we are not in horizontal, do not render menu container
615
587
  if (!m || Q !== "horizontal") {
616
588
  return t;
617
589
  }
618
590
 
619
591
  return n().createElement(P, null, t, n().createElement(y(), {
620
- toggle: ae,
592
+ toggle: oe,
621
593
  align: "center",
622
- onRequestOpen: F,
594
+ onRequestOpen: N,
623
595
  onRequestClose: W,
624
596
  open: ie
625
597
  }, m));
@@ -628,7 +600,7 @@
628
600
  // TODO: Fix the ts error: https://splunk.atlassian.net/browse/SUI-5569
629
601
  // eslint-disable-next-line
630
602
  // @ts-ignore-next-line
631
- return n().createElement(z, N({
603
+ return n().createElement(z, F({
632
604
  "aria-controls": i,
633
605
  "aria-selected": r,
634
606
  "aria-labelledby": this.ariaId,
@@ -653,21 +625,21 @@
653
625
  "data-title": re,
654
626
  to: v,
655
627
  $hasMenu: !!m
656
- }), oe( n().createElement($, {
628
+ }), ae( n().createElement($, {
657
629
  "data-test": "label",
658
630
  $withUnderline: j === "navigation"
659
631
  }, l && n().createElement(_, {
660
632
  $iconSize: J
661
- }, l), c, !m && (a === 0 || a) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(R, {
633
+ }, l), c, !m && (o === 0 || o) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(D, {
662
634
  "data-test": "count",
663
635
  disabled: G
664
- }, u ? K(a, u) : a)), !!m && n().createElement(S(), {
636
+ }, u ? K(o, u) : o)), !!m && n().createElement(S(), {
665
637
  "aria-hidden": true,
666
638
  id: this.menuDescription
667
639
  }, (0, f._)("Press Shift + F10 to open the tab’s menu")))), n().createElement(E, {
668
640
  $layout: Q,
669
641
  $withUnderline: j === "navigation"
670
- }), !o && h && n().createElement(k(), {
642
+ }), !a && h && n().createElement(k(), {
671
643
  role: "tooltip",
672
644
  anchor: O,
673
645
  animationConfig: {
@@ -679,7 +651,7 @@
679
651
  id: this.popoverId,
680
652
  open: !!O && T,
681
653
  align: "center"
682
- }, n().createElement(D, null, h)), h && n().createElement(S(), {
654
+ }, n().createElement(R, null, h)), h && n().createElement(S(), {
683
655
  "aria-hidden": "true",
684
656
  id: this.ariaId
685
657
  }, h));
@@ -687,148 +659,140 @@
687
659
  } ]);
688
660
  return r;
689
661
  }(r.Component);
690
- re(ae, "propTypes", ne);
691
- re(ae, "defaultProps", ie);
692
- re(ae, "contextType", V);
693
- var oe = (0, s.withSplunkTheme)(ae);
694
- oe.propTypes = ae.propTypes;
695
- /* harmony default export */ const le = oe;
662
+ re(le, "propTypes", oe);
663
+ re(le, "defaultProps", ae);
664
+ re(le, "contextType", V);
665
+ var ce = (0, s.withSplunkTheme)(le);
666
+ ce.propTypes = le.propTypes;
667
+ /* harmony default export */ const se = ce;
696
668
  // CONCATENATED MODULE: ./src/utils/navigateList.ts
697
669
  // A utility for keyboard navigation of lists
698
- function ce(e, t, r) {
670
+ function ue(e, t, r) {
699
671
  for (var n = 0; n < e.length; n += 1) {
700
672
  var i;
701
- var a = (n + r) % e.length;
702
- if (((i = e[a].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
703
- return e[a];
673
+ var o = (n + r) % e.length;
674
+ if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
675
+ return e[o];
704
676
  }
705
677
  }
706
678
  return e[t];
707
679
  }
708
- function se(e, t, r) {
680
+ function pe(e, t, r) {
709
681
  for (var n = e.length; n > 0; n -= 1) {
710
682
  var i;
711
- var a = (n + r) % e.length;
712
- if (((i = e[a].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
713
- return e[a];
683
+ var o = (n + r) % e.length;
684
+ if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
685
+ return e[o];
714
686
  }
715
687
  }
716
688
  return e[t];
717
689
  }
718
690
  // CONCATENATED MODULE: ./src/TabBar/TabBar.tsx
719
- function ue() {
720
- ue = Object.assign || function(e) {
691
+ function de() {
692
+ return de = Object.assign ? Object.assign.bind() : function(e) {
721
693
  for (var t = 1; t < arguments.length; t++) {
722
694
  var r = arguments[t];
723
695
  for (var n in r) {
724
- if (Object.prototype.hasOwnProperty.call(r, n)) {
725
- e[n] = r[n];
726
- }
696
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
727
697
  }
728
698
  }
729
699
  return e;
730
- };
731
- return ue.apply(this, arguments);
700
+ }, de.apply(null, arguments);
732
701
  }
733
- function pe(e, t) {
734
- return he(e) || be(e, t) || fe(e, t) || de();
702
+ function fe(e, t) {
703
+ return me(e) || ye(e, t) || be(e, t) || ve();
735
704
  }
736
- function de() {
705
+ function ve() {
737
706
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
738
707
  }
739
- function fe(e, t) {
740
- if (!e) return;
741
- if (typeof e === "string") return ve(e, t);
742
- var r = Object.prototype.toString.call(e).slice(8, -1);
743
- if (r === "Object" && e.constructor) r = e.constructor.name;
744
- if (r === "Map" || r === "Set") return Array.from(e);
745
- if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return ve(e, t);
708
+ function be(e, t) {
709
+ if (e) {
710
+ if ("string" == typeof e) return he(e, t);
711
+ var r = {}.toString.call(e).slice(8, -1);
712
+ return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? he(e, t) : void 0;
713
+ }
746
714
  }
747
- function ve(e, t) {
748
- if (t == null || t > e.length) t = e.length;
749
- for (var r = 0, n = new Array(t); r < t; r++) {
715
+ function he(e, t) {
716
+ (null == t || t > e.length) && (t = e.length);
717
+ for (var r = 0, n = Array(t); r < t; r++) {
750
718
  n[r] = e[r];
751
719
  }
752
720
  return n;
753
721
  }
754
- function be(e, t) {
755
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
756
- var r = [];
757
- var n = true;
758
- var i = false;
759
- var a = undefined;
760
- try {
761
- for (var o = e[Symbol.iterator](), l; !(n = (l = o.next()).done); n = true) {
762
- r.push(l.value);
763
- if (t && r.length === t) break;
764
- }
765
- } catch (e) {
766
- i = true;
767
- a = e;
768
- } finally {
722
+ function ye(e, t) {
723
+ var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
724
+ if (null != r) {
725
+ var n, i, o, a, l = [], c = !0, s = !1;
769
726
  try {
770
- if (!n && o["return"] != null) o["return"]();
727
+ if (o = (r = r.call(e)).next, 0 === t) {
728
+ if (Object(r) !== r) return;
729
+ c = !1;
730
+ } else for (;!(c = (n = o.call(r)).done) && (l.push(n.value), l.length !== t); c = !0) {
731
+ }
732
+ } catch (e) {
733
+ s = !0, i = e;
771
734
  } finally {
772
- if (i) throw a;
735
+ try {
736
+ if (!c && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
737
+ } finally {
738
+ if (s) throw i;
739
+ }
773
740
  }
741
+ return l;
774
742
  }
775
- return r;
776
743
  }
777
- function he(e) {
744
+ function me(e) {
778
745
  if (Array.isArray(e)) return e;
779
746
  }
780
- function ye(e, t) {
781
- if (e == null) return {};
782
- var r = me(e, t);
783
- var n, i;
747
+ function ge(e, t) {
748
+ if (null == e) return {};
749
+ var r, n, i = xe(e, t);
784
750
  if (Object.getOwnPropertySymbols) {
785
- var a = Object.getOwnPropertySymbols(e);
786
- for (i = 0; i < a.length; i++) {
787
- n = a[i];
788
- if (t.indexOf(n) >= 0) continue;
789
- if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
790
- r[n] = e[n];
751
+ var o = Object.getOwnPropertySymbols(e);
752
+ for (n = 0; n < o.length; n++) {
753
+ r = o[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (i[r] = e[r]);
791
754
  }
792
755
  }
793
- return r;
756
+ return i;
794
757
  }
795
- function me(e, t) {
796
- if (e == null) return {};
758
+ function xe(e, t) {
759
+ if (null == e) return {};
797
760
  var r = {};
798
- var n = Object.keys(e);
799
- var i, a;
800
- for (a = 0; a < n.length; a++) {
801
- i = n[a];
802
- if (t.indexOf(i) >= 0) continue;
803
- r[i] = e[i];
761
+ for (var n in e) {
762
+ if ({}.hasOwnProperty.call(e, n)) {
763
+ if (t.includes(n)) continue;
764
+ r[n] = e[n];
765
+ }
804
766
  }
805
767
  return r;
806
768
  }
807
- var ge = 50;
808
- /** @public */ var xe = {
809
- autoActivate: a().bool,
810
- activeTabId: a().string,
811
- appearance: a().oneOf([ "navigation", "context" ]),
812
- children: a().node,
769
+ var ke = 50;
770
+ /** @public */
771
+ /** @public */ var we = {
772
+ autoActivate: o().bool,
773
+ activeTabId: o().string,
774
+ appearance: o().oneOf([ "navigation", "context" ]),
775
+ children: o().node,
813
776
  /** @private */
814
- disabled: a().bool,
815
- elementRef: a().oneOfType([ a().func, a().object ]),
816
- iconSize: a().oneOf([ "inline", "small", "large" ]),
817
- layout: a().oneOf([ "horizontal", "vertical" ]),
818
- onChange: a().func,
819
- tabWidth: a().number
777
+ disabled: o().bool,
778
+ elementRef: o().oneOfType([ o().func, o().object ]),
779
+ iconSize: o().oneOf([ "inline", "small", "large" ]),
780
+ layout: o().oneOf([ "horizontal", "vertical" ]),
781
+ onChange: o().func,
782
+ tabWidth: o().number
820
783
  };
821
- function ke(e) {
822
- var t = e.activeTabId, i = e.autoActivate, a = e.appearance, l = a === void 0 ? "navigation" : a, c = e.children, s = e.disabled, p = s === void 0 ? false : s, d = e.elementRef, f = e.iconSize, v = f === void 0 ? "inline" : f, b = e.layout, h = b === void 0 ? "horizontal" : b, y = e.onChange, m = e.tabWidth, g = ye(e, [ "activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconSize", "layout", "onChange", "tabWidth" ]);
784
+ function Se(e) {
785
+ var t = e.activeTabId, i = e.autoActivate, o = e.appearance, l = o === void 0 ? "navigation" : o, c = e.children, s = e.disabled, p = s === void 0 ? false : s, d = e.elementRef, f = e.iconSize, v = f === void 0 ? "inline" : f, b = e.layout, h = b === void 0 ? "horizontal" : b, y = e.onChange, m = e.tabWidth, g = ge(e, [ "activeTabId", "autoActivate", "appearance", "children", "disabled", "elementRef", "iconSize", "layout", "onChange", "tabWidth" ]);
823
786
  // @docs-props-type TabBarPropsBase
824
- var x = (0, r.useState)(false), k = pe(x, 2), w = k[0], S = k[1];
825
- var C = (0, r.useState)(0), O = pe(C, 2), T = O[0], I = O[1];
787
+ var x = (0, r.useState)(false), k = fe(x, 2), w = k[0], S = k[1];
788
+ var C = (0, r.useState)(0), O = fe(C, 2), T = O[0], I = O[1];
826
789
  var j = (0, r.useRef)(T);
827
790
  j.current = T;
828
791
  var z = (0, r.useRef)("");
829
792
  var E = (0, r.useRef)([]);
830
793
  var M = h === "vertical" ? "down" : "right";
831
794
  var _ = h === "vertical" ? "up" : "left";
795
+ if (false) {}
832
796
  var P = (0, r.useCallback)((function(e, t) {
833
797
  var r = t.tabKey, n = t.tabId;
834
798
  if (r != null) {
@@ -848,48 +812,48 @@
848
812
  selectedTabId: t.tabId
849
813
  });
850
814
  }), [ y ]);
851
- var R = (0, r.useMemo)((function() {
815
+ var D = (0, r.useMemo)((function() {
852
816
  var e = 0;
853
- // reset tabRefs since children are changed
817
+ // reset tabRefs since children are changed
854
818
  E.current = [];
855
819
  return r.Children.toArray(c).filter(r.isValidElement).map((function(i) {
856
820
  // <TabBar> allows non-<Tab> children, pass them through without any modification
857
- if (typeof i.type === "string" || i.type.name !== le.name) {
821
+ if (typeof i.type === "string" || i.type.name !== se.name) {
858
822
  return i;
859
823
  }
860
- var a = n().createRef();
861
- E.current.push(a);
862
- var o = {
824
+ var o = n().createRef();
825
+ E.current.push(o);
826
+ var a = {
863
827
  active: t === i.props.tabId,
864
828
  tabKey: e,
865
- ref: a
829
+ ref: o
866
830
  };
867
831
  e += 1;
868
832
 
869
- return (0, r.cloneElement)(i, o);
833
+ return (0, r.cloneElement)(i, a);
870
834
  }));
871
835
  }), [ t, c ]);
872
836
  (0, r.useEffect)((function() {
873
- R.forEach((function(e, t) {
837
+ D.forEach((function(e, t) {
874
838
  // if the focused tab has changed order in the tab bar,
875
839
  // then we want to update the focusedTabKey to the new position of the focused tab
876
840
  if (z.current != null && z.current === e.props.tabId && j.current !== t) {
877
841
  I(t);
878
842
  }
879
843
  }));
880
- }), [ R ]);
881
- var D = m && m > ge ? m : null;
844
+ }), [ D ]);
845
+ var R = m && m > ke ? m : null;
882
846
  var q = (0, r.useCallback)((function(e) {
883
- var t = (0, o.keycode)(e.nativeEvent);
847
+ var t = (0, a.keycode)(e.nativeEvent);
884
848
  var r;
885
849
  if (t === M) {
886
- r = ce(E.current, T, T + 1);
850
+ r = ue(E.current, T, T + 1);
887
851
  } else if (t === _) {
888
- r = se(E.current, T, T - 1);
852
+ r = pe(E.current, T, T - 1);
889
853
  } else if (t === "home") {
890
- r = ce(E.current, T, 0);
854
+ r = ue(E.current, T, 0);
891
855
  } else if (t === "end") {
892
- r = se(E.current, T, E.current.length - 1);
856
+ r = pe(E.current, T, E.current.length - 1);
893
857
  } else if (h === "horizontal" && e.shiftKey && t === "f10") {
894
858
  S((function(e) {
895
859
  if (e) {
@@ -928,15 +892,15 @@
928
892
  layout: h,
929
893
  onClick: $,
930
894
  onFocus: P,
931
- width: D,
895
+ width: R,
932
896
  onMenuOpen: A,
933
897
  onMenuClose: K,
934
898
  isMenuOpen: w,
935
899
  focusedTabKey: T
936
900
  };
937
- }), [ l, p, T, v, w, h, K, A, $, P, D ]);
901
+ }), [ l, p, T, v, w, h, K, A, $, P, R ]);
938
902
 
939
- return n().createElement(u, ue({
903
+ return n().createElement(u, de({
940
904
  "data-tab-layout": h,
941
905
  "data-test-active-tab-id": t,
942
906
  "data-test": "tab-bar",
@@ -947,11 +911,11 @@
947
911
  onKeyDown: q
948
912
  }, g), n().createElement(V.Provider, {
949
913
  value: B
950
- }, R));
914
+ }, D));
951
915
  }
952
- ke.propTypes = xe;
953
- ke.Tab = le;
954
- /* harmony default export */ const we = ke;
916
+ Se.propTypes = we;
917
+ Se.Tab = se;
918
+ /* harmony default export */ const Ce = Se;
955
919
  // CONCATENATED MODULE: ./src/TabBar/index.ts
956
920
  module.exports = t;
957
921
  /******/})();