@splunk/react-ui 4.38.0 → 4.40.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 (172) 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 +49 -0
  11. package/Calendar.js +353 -414
  12. package/Card.js +186 -244
  13. package/CardLayout.js +86 -83
  14. package/Chip.js +136 -146
  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 +178 -210
  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 +123 -38
  39. package/Markdown.js +288 -347
  40. package/Menu.js +506 -532
  41. package/Message.js +197 -207
  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 +3137 -3433
  47. package/Number.js +164 -178
  48. package/Paginator.js +296 -335
  49. package/Paragraph.js +24 -32
  50. package/Popover.js +450 -442
  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 +2085 -2345
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +132 -145
  62. package/SlidingPanels.js +238 -270
  63. package/SplitButton.d.ts +2 -0
  64. package/SplitButton.js +222 -245
  65. package/StaticContent.js +68 -76
  66. package/StepBar.js +206 -205
  67. package/Switch.js +176 -205
  68. package/TabBar.js +235 -268
  69. package/TabLayout.js +122 -141
  70. package/Table.js +2103 -2261
  71. package/Text.js +379 -493
  72. package/TextArea.js +411 -441
  73. package/Tooltip.js +116 -132
  74. package/TransitionOpen.js +160 -178
  75. package/Tree.js +268 -287
  76. package/Typography.js +48 -52
  77. package/WaitSpinner.js +61 -69
  78. package/cypress/support/commands.ts +9 -0
  79. package/cypress/support/index.d.ts +6 -0
  80. package/cypress/tsconfig.cypress.json +1 -0
  81. package/docker-compose.yml +0 -1
  82. package/package.json +15 -15
  83. package/types/src/Button/Button.d.ts +5 -1
  84. package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
  85. package/types/src/Card/Card.d.ts +1 -0
  86. package/types/src/Card/Footer.d.ts +1 -0
  87. package/types/src/Chip/Chip.d.ts +3 -6
  88. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
  89. package/types/src/Color/Color.d.ts +2 -2
  90. package/types/src/Color/Palette.d.ts +4 -2
  91. package/types/src/ComboBox/ComboBox.d.ts +1 -1
  92. package/types/src/ComboBox/Option.d.ts +1 -1
  93. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  94. package/types/src/Date/Date.d.ts +2 -2
  95. package/types/src/File/File.d.ts +2 -3
  96. package/types/src/File/Retry.d.ts +1 -2
  97. package/types/src/Menu/Item.d.ts +18 -5
  98. package/types/src/Menu/Menu.d.ts +3 -3
  99. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  100. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  101. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  102. package/types/src/Multiselect/Compact.d.ts +1 -1
  103. package/types/src/Multiselect/Multiselect.d.ts +1 -1
  104. package/types/src/Multiselect/Normal.d.ts +1 -1
  105. package/types/src/Multiselect/Option.d.ts +2 -0
  106. package/types/src/Number/Number.d.ts +3 -3
  107. package/types/src/Popover/Popover.d.ts +3 -4
  108. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  109. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  110. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  111. package/types/src/Search/Option.d.ts +9 -3
  112. package/types/src/Select/Option.d.ts +3 -1
  113. package/types/src/Select/OptionBase.d.ts +7 -5
  114. package/types/src/Select/Select.d.ts +4 -2
  115. package/types/src/Select/SelectAllOption.d.ts +4 -4
  116. package/types/src/Select/SelectBase.d.ts +104 -66
  117. package/types/src/Select/docs/examples/Appearance.d.ts +0 -2
  118. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  119. package/types/src/Slider/Slider.d.ts +2 -2
  120. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  121. package/types/src/StepBar/Step.d.ts +1 -2
  122. package/types/src/Switch/Switch.d.ts +0 -1
  123. package/types/src/TabBar/Tab.d.ts +1 -1
  124. package/types/src/TabBar/TabBar.d.ts +3 -1
  125. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  126. package/types/src/Table/Cell.d.ts +0 -2
  127. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  128. package/types/src/Table/HeadInner.d.ts +5 -1
  129. package/types/src/Table/Table.d.ts +0 -1
  130. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  131. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  132. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  133. package/types/src/Text/Text.d.ts +2 -2
  134. package/types/src/TextArea/TextArea.d.ts +2 -2
  135. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  136. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  137. package/types/src/WaitSpinner/WaitSpinner.d.ts +0 -1
  138. package/types/src/useControlled/index.d.ts +2 -0
  139. package/types/src/useControlled/useControlled.d.ts +21 -0
  140. package/types/src/useResizeObserver/index.d.ts +2 -0
  141. package/types/src/useResizeObserver/useResizeObserver.d.ts +12 -0
  142. package/useControlled.js +112 -0
  143. package/useForceUpdate.js +30 -32
  144. package/useKeyPress.d.ts +2 -0
  145. package/useKeyPress.js +1 -1
  146. package/useResizeObserver.d.ts +2 -0
  147. package/useResizeObserver.js +137 -0
  148. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  149. package/types/src/Chip/docs/examples/Basic.d.ts +0 -2
  150. package/types/src/Chip/docs/examples/prisma/Appearance.d.ts +0 -2
  151. package/types/src/Color/docs/examples/prisma/Controlled.d.ts +0 -2
  152. package/types/src/Color/docs/examples/prisma/ThemeVariables.d.ts +0 -1
  153. package/types/src/Color/docs/examples/prisma/Uncontrolled.d.ts +0 -2
  154. package/types/src/Dropdown/docs/examples/prisma/Basic.d.ts +0 -2
  155. package/types/src/Dropdown/docs/examples/prisma/BasicMenu.d.ts +0 -2
  156. package/types/src/Dropdown/docs/examples/prisma/ControlledDropdown.d.ts +0 -2
  157. package/types/src/Dropdown/docs/examples/prisma/Dialog.d.ts +0 -2
  158. package/types/src/Dropdown/docs/examples/prisma/OtherToggles.d.ts +0 -2
  159. package/types/src/Dropdown/docs/examples/prisma/ScrollingMenu.d.ts +0 -2
  160. package/types/src/File/docs/examples/prisma/Disabled.d.ts +0 -12
  161. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  162. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  163. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  164. package/types/src/Message/docs/examples/prisma/Title.d.ts +0 -2
  165. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  166. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  167. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  168. package/types/src/WaitSpinner/docs/examples/prisma/Basic.d.ts +0 -2
  169. /package/types/src/Color/docs/examples/{prisma/CustomizedPalette.d.ts → CustomizedPalette.d.ts} +0 -0
  170. /package/types/src/Color/docs/examples/{prisma/HideInput.d.ts → HideInput.d.ts} +0 -0
  171. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  172. /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,30 +551,33 @@
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 ? {
590
562
  width: B
591
563
  } : Y;
592
564
  var Z = p.isEnterprise;
593
- 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.
596
- var re;
597
- if (Z) {
598
- // countValue needs unicode space for width to not change after it's clicked.
599
- var ne = te ? "(".concat(te, ")  ") : "";
600
- re = "".concat(ee, " ").concat(ne);
601
- } else {
602
- re = "".concat(ee, "    ").concat(te);
565
+ var ee = "";
566
+ // SUI-6877: if the label isn't a string, don't attempt to do this since it'll just be wrong
567
+ if (c && typeof c === "string") {
568
+ var te = c ? c.toString() : "";
569
+ var re = o === 0 || o ? "".concat(o === null || o === void 0 ? void 0 : o.toString()) : "";
570
+ // titleValue is used for CSS styling in TabStyles. labelValue and countValue needs to be included in the title.
571
+ if (Z) {
572
+ // countValue needs unicode space for width to not change after it's clicked.
573
+ var ne = re ? "(".concat(re, ")  ") : "";
574
+ ee = "".concat(te, " ").concat(ne);
575
+ } else {
576
+ ee = "".concat(te, "    ").concat(re);
577
+ }
603
578
  }
604
579
  var ie = H === x && L && !!m;
605
- var ae = n().createElement(M, {
580
+ var oe = n().createElement(M, {
606
581
  $active: r,
607
582
  "data-test": "menu-toggle",
608
583
  tabIndex: -1,
@@ -610,16 +585,16 @@
610
585
  }, Z ? n().createElement(g(), {
611
586
  size: 1.1
612
587
  }) : n().createElement(b(), null));
613
- var oe = function e(t) {
588
+ var ae = function e(t) {
614
589
  // if there is no menu, or if we are not in horizontal, do not render menu container
615
590
  if (!m || Q !== "horizontal") {
616
591
  return t;
617
592
  }
618
593
 
619
594
  return n().createElement(P, null, t, n().createElement(y(), {
620
- toggle: ae,
595
+ toggle: oe,
621
596
  align: "center",
622
- onRequestOpen: F,
597
+ onRequestOpen: N,
623
598
  onRequestClose: W,
624
599
  open: ie
625
600
  }, m));
@@ -628,7 +603,7 @@
628
603
  // TODO: Fix the ts error: https://splunk.atlassian.net/browse/SUI-5569
629
604
  // eslint-disable-next-line
630
605
  // @ts-ignore-next-line
631
- return n().createElement(z, N({
606
+ return n().createElement(z, F({
632
607
  "aria-controls": i,
633
608
  "aria-selected": r,
634
609
  "aria-labelledby": this.ariaId,
@@ -641,7 +616,8 @@
641
616
  $icon: l && J !== "inline" ? true : undefined,
642
617
  disabled: G,
643
618
  style: X,
644
- elementRef: this.handleMount
619
+ elementRef: this.handleMount,
620
+ "data-title": ee
645
621
  }, d()(w, "elementRef"), {
646
622
  onClick: this.handleClick,
647
623
  onFocus: this.handleFocus,
@@ -650,24 +626,23 @@
650
626
  onMouseLeave: this.handleTooltipClose,
651
627
  role: "tab",
652
628
  tabIndex: r ? undefined : -1,
653
- "data-title": re,
654
629
  to: v,
655
630
  $hasMenu: !!m
656
- }), oe( n().createElement($, {
631
+ }), ae( n().createElement($, {
657
632
  "data-test": "label",
658
633
  $withUnderline: j === "navigation"
659
634
  }, l && n().createElement(_, {
660
635
  $iconSize: J
661
- }, l), c, !m && (a === 0 || a) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(R, {
636
+ }, l), c, !m && (o === 0 || o) && n().createElement(n().Fragment, null, n().createElement(S(), null, " "), n().createElement(D, {
662
637
  "data-test": "count",
663
638
  disabled: G
664
- }, u ? K(a, u) : a)), !!m && n().createElement(S(), {
639
+ }, u ? K(o, u) : o)), !!m && n().createElement(S(), {
665
640
  "aria-hidden": true,
666
641
  id: this.menuDescription
667
642
  }, (0, f._)("Press Shift + F10 to open the tab’s menu")))), n().createElement(E, {
668
643
  $layout: Q,
669
644
  $withUnderline: j === "navigation"
670
- }), !o && h && n().createElement(k(), {
645
+ }), !a && h && n().createElement(k(), {
671
646
  role: "tooltip",
672
647
  anchor: O,
673
648
  animationConfig: {
@@ -679,7 +654,7 @@
679
654
  id: this.popoverId,
680
655
  open: !!O && T,
681
656
  align: "center"
682
- }, n().createElement(D, null, h)), h && n().createElement(S(), {
657
+ }, n().createElement(R, null, h)), h && n().createElement(S(), {
683
658
  "aria-hidden": "true",
684
659
  id: this.ariaId
685
660
  }, h));
@@ -687,148 +662,140 @@
687
662
  } ]);
688
663
  return r;
689
664
  }(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;
665
+ re(le, "propTypes", oe);
666
+ re(le, "defaultProps", ae);
667
+ re(le, "contextType", V);
668
+ var ce = (0, s.withSplunkTheme)(le);
669
+ ce.propTypes = le.propTypes;
670
+ /* harmony default export */ const se = ce;
696
671
  // CONCATENATED MODULE: ./src/utils/navigateList.ts
697
672
  // A utility for keyboard navigation of lists
698
- function ce(e, t, r) {
673
+ function ue(e, t, r) {
699
674
  for (var n = 0; n < e.length; n += 1) {
700
675
  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];
676
+ var o = (n + r) % e.length;
677
+ if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
678
+ return e[o];
704
679
  }
705
680
  }
706
681
  return e[t];
707
682
  }
708
- function se(e, t, r) {
683
+ function pe(e, t, r) {
709
684
  for (var n = e.length; n > 0; n -= 1) {
710
685
  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];
686
+ var o = (n + r) % e.length;
687
+ if (((i = e[o].current) === null || i === void 0 ? void 0 : i.props.disabled) !== true) {
688
+ return e[o];
714
689
  }
715
690
  }
716
691
  return e[t];
717
692
  }
718
693
  // CONCATENATED MODULE: ./src/TabBar/TabBar.tsx
719
- function ue() {
720
- ue = Object.assign || function(e) {
694
+ function de() {
695
+ return de = Object.assign ? Object.assign.bind() : function(e) {
721
696
  for (var t = 1; t < arguments.length; t++) {
722
697
  var r = arguments[t];
723
698
  for (var n in r) {
724
- if (Object.prototype.hasOwnProperty.call(r, n)) {
725
- e[n] = r[n];
726
- }
699
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
727
700
  }
728
701
  }
729
702
  return e;
730
- };
731
- return ue.apply(this, arguments);
703
+ }, de.apply(null, arguments);
732
704
  }
733
- function pe(e, t) {
734
- return he(e) || be(e, t) || fe(e, t) || de();
705
+ function fe(e, t) {
706
+ return me(e) || ye(e, t) || be(e, t) || ve();
735
707
  }
736
- function de() {
708
+ function ve() {
737
709
  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
710
  }
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);
711
+ function be(e, t) {
712
+ if (e) {
713
+ if ("string" == typeof e) return he(e, t);
714
+ var r = {}.toString.call(e).slice(8, -1);
715
+ 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;
716
+ }
746
717
  }
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++) {
718
+ function he(e, t) {
719
+ (null == t || t > e.length) && (t = e.length);
720
+ for (var r = 0, n = Array(t); r < t; r++) {
750
721
  n[r] = e[r];
751
722
  }
752
723
  return n;
753
724
  }
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 {
725
+ function ye(e, t) {
726
+ var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
727
+ if (null != r) {
728
+ var n, i, o, a, l = [], c = !0, s = !1;
769
729
  try {
770
- if (!n && o["return"] != null) o["return"]();
730
+ if (o = (r = r.call(e)).next, 0 === t) {
731
+ if (Object(r) !== r) return;
732
+ c = !1;
733
+ } else for (;!(c = (n = o.call(r)).done) && (l.push(n.value), l.length !== t); c = !0) {
734
+ }
735
+ } catch (e) {
736
+ s = !0, i = e;
771
737
  } finally {
772
- if (i) throw a;
738
+ try {
739
+ if (!c && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
740
+ } finally {
741
+ if (s) throw i;
742
+ }
773
743
  }
744
+ return l;
774
745
  }
775
- return r;
776
746
  }
777
- function he(e) {
747
+ function me(e) {
778
748
  if (Array.isArray(e)) return e;
779
749
  }
780
- function ye(e, t) {
781
- if (e == null) return {};
782
- var r = me(e, t);
783
- var n, i;
750
+ function ge(e, t) {
751
+ if (null == e) return {};
752
+ var r, n, i = xe(e, t);
784
753
  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];
754
+ var o = Object.getOwnPropertySymbols(e);
755
+ for (n = 0; n < o.length; n++) {
756
+ r = o[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (i[r] = e[r]);
791
757
  }
792
758
  }
793
- return r;
759
+ return i;
794
760
  }
795
- function me(e, t) {
796
- if (e == null) return {};
761
+ function xe(e, t) {
762
+ if (null == e) return {};
797
763
  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];
764
+ for (var n in e) {
765
+ if ({}.hasOwnProperty.call(e, n)) {
766
+ if (t.includes(n)) continue;
767
+ r[n] = e[n];
768
+ }
804
769
  }
805
770
  return r;
806
771
  }
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,
772
+ var ke = 50;
773
+ /** @public */
774
+ /** @public */ var we = {
775
+ autoActivate: o().bool,
776
+ activeTabId: o().string,
777
+ appearance: o().oneOf([ "navigation", "context" ]),
778
+ children: o().node,
813
779
  /** @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
780
+ disabled: o().bool,
781
+ elementRef: o().oneOfType([ o().func, o().object ]),
782
+ iconSize: o().oneOf([ "inline", "small", "large" ]),
783
+ layout: o().oneOf([ "horizontal", "vertical" ]),
784
+ onChange: o().func,
785
+ tabWidth: o().number
820
786
  };
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" ]);
787
+ function Se(e) {
788
+ 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
789
  // @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];
790
+ var x = (0, r.useState)(false), k = fe(x, 2), w = k[0], S = k[1];
791
+ var C = (0, r.useState)(0), O = fe(C, 2), T = O[0], I = O[1];
826
792
  var j = (0, r.useRef)(T);
827
793
  j.current = T;
828
794
  var z = (0, r.useRef)("");
829
795
  var E = (0, r.useRef)([]);
830
796
  var M = h === "vertical" ? "down" : "right";
831
797
  var _ = h === "vertical" ? "up" : "left";
798
+ if (false) {}
832
799
  var P = (0, r.useCallback)((function(e, t) {
833
800
  var r = t.tabKey, n = t.tabId;
834
801
  if (r != null) {
@@ -848,48 +815,48 @@
848
815
  selectedTabId: t.tabId
849
816
  });
850
817
  }), [ y ]);
851
- var R = (0, r.useMemo)((function() {
818
+ var D = (0, r.useMemo)((function() {
852
819
  var e = 0;
853
- // reset tabRefs since children are changed
820
+ // reset tabRefs since children are changed
854
821
  E.current = [];
855
822
  return r.Children.toArray(c).filter(r.isValidElement).map((function(i) {
856
823
  // <TabBar> allows non-<Tab> children, pass them through without any modification
857
- if (typeof i.type === "string" || i.type.name !== le.name) {
824
+ if (typeof i.type === "string" || i.type.name !== se.name) {
858
825
  return i;
859
826
  }
860
- var a = n().createRef();
861
- E.current.push(a);
862
- var o = {
827
+ var o = n().createRef();
828
+ E.current.push(o);
829
+ var a = {
863
830
  active: t === i.props.tabId,
864
831
  tabKey: e,
865
- ref: a
832
+ ref: o
866
833
  };
867
834
  e += 1;
868
835
 
869
- return (0, r.cloneElement)(i, o);
836
+ return (0, r.cloneElement)(i, a);
870
837
  }));
871
838
  }), [ t, c ]);
872
839
  (0, r.useEffect)((function() {
873
- R.forEach((function(e, t) {
840
+ D.forEach((function(e, t) {
874
841
  // if the focused tab has changed order in the tab bar,
875
842
  // then we want to update the focusedTabKey to the new position of the focused tab
876
843
  if (z.current != null && z.current === e.props.tabId && j.current !== t) {
877
844
  I(t);
878
845
  }
879
846
  }));
880
- }), [ R ]);
881
- var D = m && m > ge ? m : null;
847
+ }), [ D ]);
848
+ var R = m && m > ke ? m : null;
882
849
  var q = (0, r.useCallback)((function(e) {
883
- var t = (0, o.keycode)(e.nativeEvent);
850
+ var t = (0, a.keycode)(e.nativeEvent);
884
851
  var r;
885
852
  if (t === M) {
886
- r = ce(E.current, T, T + 1);
853
+ r = ue(E.current, T, T + 1);
887
854
  } else if (t === _) {
888
- r = se(E.current, T, T - 1);
855
+ r = pe(E.current, T, T - 1);
889
856
  } else if (t === "home") {
890
- r = ce(E.current, T, 0);
857
+ r = ue(E.current, T, 0);
891
858
  } else if (t === "end") {
892
- r = se(E.current, T, E.current.length - 1);
859
+ r = pe(E.current, T, E.current.length - 1);
893
860
  } else if (h === "horizontal" && e.shiftKey && t === "f10") {
894
861
  S((function(e) {
895
862
  if (e) {
@@ -928,15 +895,15 @@
928
895
  layout: h,
929
896
  onClick: $,
930
897
  onFocus: P,
931
- width: D,
898
+ width: R,
932
899
  onMenuOpen: A,
933
900
  onMenuClose: K,
934
901
  isMenuOpen: w,
935
902
  focusedTabKey: T
936
903
  };
937
- }), [ l, p, T, v, w, h, K, A, $, P, D ]);
904
+ }), [ l, p, T, v, w, h, K, A, $, P, R ]);
938
905
 
939
- return n().createElement(u, ue({
906
+ return n().createElement(u, de({
940
907
  "data-tab-layout": h,
941
908
  "data-test-active-tab-id": t,
942
909
  "data-test": "tab-bar",
@@ -947,11 +914,11 @@
947
914
  onKeyDown: q
948
915
  }, g), n().createElement(V.Provider, {
949
916
  value: B
950
- }, R));
917
+ }, D));
951
918
  }
952
- ke.propTypes = xe;
953
- ke.Tab = le;
954
- /* harmony default export */ const we = ke;
919
+ Se.propTypes = we;
920
+ Se.Tab = se;
921
+ /* harmony default export */ const Ce = Se;
955
922
  // CONCATENATED MODULE: ./src/TabBar/index.ts
956
923
  module.exports = t;
957
924
  /******/})();