@splunk/react-ui 5.7.1 → 5.9.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 (152) hide show
  1. package/Accordion.js +6 -6
  2. package/Anchor.js +2 -1
  3. package/Box.js +83 -34
  4. package/CHANGELOG.md +51 -0
  5. package/Calendar.js +134 -134
  6. package/Clickable.js +131 -94
  7. package/CollapsiblePanel.js +175 -137
  8. package/ComboBox.js +32 -27
  9. package/ControlGroup.js +92 -91
  10. package/DefinitionList.js +9 -9
  11. package/Drawer.d.ts +2 -0
  12. package/Drawer.js +679 -0
  13. package/Dropdown.js +27 -18
  14. package/DualListbox.js +1 -1
  15. package/File.js +35 -35
  16. package/JSONTree.js +73 -72
  17. package/Link.js +2 -2
  18. package/MIGRATION.md +10 -0
  19. package/Menu.js +403 -261
  20. package/Modal.js +263 -252
  21. package/Monogram.js +2 -2
  22. package/Multiselect.js +551 -385
  23. package/Number.js +2 -1
  24. package/Paginator.js +14 -12
  25. package/Popover.js +4 -1
  26. package/README.md +11 -0
  27. package/RadioBar.js +1 -1
  28. package/Search.js +111 -95
  29. package/Select.js +42 -40
  30. package/SelectBase.js +819 -715
  31. package/SidePanel.js +346 -167
  32. package/SlidingPanels.js +11 -11
  33. package/StepBar.js +7 -7
  34. package/Switch.js +5 -5
  35. package/Table.js +116 -119
  36. package/Text.js +48 -48
  37. package/TextArea.js +7 -7
  38. package/TransitionOpen.js +188 -169
  39. package/docs-llm/Accordion.md +267 -0
  40. package/docs-llm/Anchor Menu.md +115 -0
  41. package/docs-llm/Anchor.md +54 -0
  42. package/docs-llm/AnimationToggle.md +254 -0
  43. package/docs-llm/Avatar.md +292 -0
  44. package/docs-llm/Badge.md +212 -0
  45. package/docs-llm/Breadcrumbs.md +306 -0
  46. package/docs-llm/Button Group.md +53 -0
  47. package/docs-llm/Button.md +361 -0
  48. package/docs-llm/Card Layout.md +286 -0
  49. package/docs-llm/Card.md +619 -0
  50. package/docs-llm/Checkbox.md +218 -0
  51. package/docs-llm/Chip.md +291 -0
  52. package/docs-llm/Clickable.md +160 -0
  53. package/docs-llm/Code.md +292 -0
  54. package/docs-llm/Collapsible Panel.md +744 -0
  55. package/docs-llm/Color.md +253 -0
  56. package/docs-llm/Column Layout.md +391 -0
  57. package/docs-llm/Combo Box.md +540 -0
  58. package/docs-llm/Control Group.md +594 -0
  59. package/docs-llm/Date.md +270 -0
  60. package/docs-llm/Definition List.md +278 -0
  61. package/docs-llm/Divider.md +216 -0
  62. package/docs-llm/Drawer.md +414 -0
  63. package/docs-llm/Dropdown.md +472 -0
  64. package/docs-llm/Dual Listbox.md +325 -0
  65. package/docs-llm/File.md +653 -0
  66. package/docs-llm/Form Rows.md +374 -0
  67. package/docs-llm/Heading.md +179 -0
  68. package/docs-llm/Image.md +109 -0
  69. package/docs-llm/JSON Tree.md +260 -0
  70. package/docs-llm/Layer.md +74 -0
  71. package/docs-llm/Layout.md +50 -0
  72. package/docs-llm/Link.md +318 -0
  73. package/docs-llm/List.md +189 -0
  74. package/docs-llm/Markdown.md +179 -0
  75. package/docs-llm/Menu.md +735 -0
  76. package/docs-llm/Message Bar.md +236 -0
  77. package/docs-llm/Message.md +248 -0
  78. package/docs-llm/Modal.md +443 -0
  79. package/docs-llm/Monogram.md +159 -0
  80. package/docs-llm/Multiselect.md +939 -0
  81. package/docs-llm/Notifications.md +46 -0
  82. package/docs-llm/Number.md +298 -0
  83. package/docs-llm/Paginator.md +395 -0
  84. package/docs-llm/Paragraph.md +148 -0
  85. package/docs-llm/Phone Number.md +254 -0
  86. package/docs-llm/Popover.md +166 -0
  87. package/docs-llm/Progress.md +141 -0
  88. package/docs-llm/Radio Bar.md +303 -0
  89. package/docs-llm/Radio List.md +350 -0
  90. package/docs-llm/Resize.md +362 -0
  91. package/docs-llm/Screen Reader Content.md +73 -0
  92. package/docs-llm/Scroll Container Context.md +155 -0
  93. package/docs-llm/Scroll.md +152 -0
  94. package/docs-llm/Search.md +381 -0
  95. package/docs-llm/Select.md +985 -0
  96. package/docs-llm/Side Panel.md +777 -0
  97. package/docs-llm/Slider.md +339 -0
  98. package/docs-llm/Sliding Panels.md +340 -0
  99. package/docs-llm/Split Button.md +295 -0
  100. package/docs-llm/Static Content.md +90 -0
  101. package/docs-llm/Step Bar.md +292 -0
  102. package/docs-llm/Switch.md +268 -0
  103. package/docs-llm/Tab Bar.md +439 -0
  104. package/docs-llm/Tab Layout.md +398 -0
  105. package/docs-llm/Table.md +2642 -0
  106. package/docs-llm/Text Area.md +253 -0
  107. package/docs-llm/Text.md +339 -0
  108. package/docs-llm/Tooltip.md +325 -0
  109. package/docs-llm/Transition Open.md +406 -0
  110. package/docs-llm/Tree.md +591 -0
  111. package/docs-llm/Typography.md +125 -0
  112. package/docs-llm/Wait Spinner.md +121 -0
  113. package/docs-llm/llms.txt +101 -0
  114. package/package.json +6 -5
  115. package/types/src/Box/Box.d.ts +2 -10
  116. package/types/src/Drawer/Body.d.ts +17 -0
  117. package/types/src/Drawer/Drawer.d.ts +114 -0
  118. package/types/src/Drawer/DrawerContext.d.ts +11 -0
  119. package/types/src/Drawer/Footer.d.ts +25 -0
  120. package/types/src/Drawer/Header.d.ts +41 -0
  121. package/types/src/Drawer/docs/examples/Basic.d.ts +6 -0
  122. package/types/src/Drawer/docs/examples/ContainerPosition.d.ts +7 -0
  123. package/types/src/Drawer/docs/examples/InitialFocus.d.ts +9 -0
  124. package/types/src/Drawer/docs/examples/InlinePosition.d.ts +7 -0
  125. package/types/src/Drawer/docs/examples/PagePosition.d.ts +7 -0
  126. package/types/src/Drawer/index.d.ts +2 -0
  127. package/types/src/JSONTree/JSONTree.d.ts +12 -5
  128. package/types/src/JSONTree/renderTreeItems.d.ts +2 -1
  129. package/types/src/Menu/Item.d.ts +2 -1
  130. package/types/src/Menu/docs/examples/SelectableCheckbox.d.ts +7 -0
  131. package/types/src/Modal/Modal.d.ts +1 -2
  132. package/types/src/Multiselect/Compact.d.ts +8 -3
  133. package/types/src/Multiselect/Multiselect.d.ts +8 -3
  134. package/types/src/Multiselect/Normal.d.ts +8 -3
  135. package/types/src/Multiselect/Option.d.ts +6 -3
  136. package/types/src/Multiselect/docs/examples/Disabled.d.ts +1 -0
  137. package/types/src/Select/Option.d.ts +6 -3
  138. package/types/src/Select/Select.d.ts +8 -5
  139. package/types/src/Select/docs/examples/Dimmed.d.ts +7 -0
  140. package/types/src/SelectBase/OptionBase.d.ts +6 -3
  141. package/types/src/SelectBase/SelectBase.d.ts +8 -3
  142. package/types/src/SidePanel/SidePanel.d.ts +43 -2
  143. package/types/src/SidePanel/docs/examples/DockLayout.d.ts +17 -0
  144. package/types/src/SidePanel/docs/examples/InitialFocus.d.ts +9 -0
  145. package/types/src/TransitionOpen/TransitionOpen.d.ts +29 -4
  146. package/types/src/useKeyPress/index.d.ts +9 -2
  147. package/types/src/useOnClickOutside/index.d.ts +2 -0
  148. package/types/src/useOnClickOutside/useOnClickOutside.d.ts +4 -0
  149. package/useKeyPress.js +23 -18
  150. package/useOnClickOutside.d.ts +2 -0
  151. package/useOnClickOutside.js +79 -0
  152. package/types/src/RadioList/docs/examples/Row.d.ts +0 -6
package/Dropdown.js CHANGED
@@ -171,7 +171,7 @@
171
171
  toggle: a().element.isRequired
172
172
  };
173
173
  function O(e) {
174
- var o = e["aria-labelledby"], t = e.align, a = t === void 0 ? "center" : t, l = e.canCoverAnchor, u = l === void 0 ? true : l, p = e.children, v = e.closeReasons, y = v === void 0 ? C : v, g = e.defaultPlacement, b = g === void 0 ? "below" : g, m = e.elementRef, h = e.focusToggleReasons, O = h === void 0 ? k : h, w = e.inputId, R = e.open, S = e.openWithArrowKeys, A = e.onRequestClose, I = e.onRequestOpen, q = e.repositionMode, P = q === void 0 ? "flip" : q, K = e.retainFocus, j = K === void 0 ? false : K, D = e.takeFocus, M = D === void 0 ? true : D, T = e.toggle;
174
+ var o = e["aria-labelledby"], t = e.align, a = t === void 0 ? "center" : t, l = e.canCoverAnchor, u = l === void 0 ? true : l, p = e.children, v = e.closeReasons, y = v === void 0 ? C : v, g = e.defaultPlacement, b = g === void 0 ? "below" : g, m = e.elementRef, h = e.focusToggleReasons, O = h === void 0 ? k : h, w = e.inputId, R = e.open, S = e.openWithArrowKeys, A = e.onRequestClose, I = e.onRequestOpen, q = e.repositionMode, P = q === void 0 ? "flip" : q, D = e.retainFocus, K = D === void 0 ? false : D, j = e.takeFocus, M = j === void 0 ? true : j, T = e.toggle;
175
175
  // @docs-props-type DropdownPropsBase
176
176
  var F = (0, n.useState)(null), E = d(F, 2), N = E[0], _ = E[1];
177
177
  var x = (0, n.useState)(false), W = d(x, 2), U = W[0], z = W[1];
@@ -198,8 +198,13 @@
198
198
  // TS: ref does not exist on React.ReactElement - technically, this is undocumented API
199
199
  f(T.ref, e);
200
200
  }), [ T ]);
201
- var Z = (0, n.useCallback)((function(e) {
201
+ var Z = T.props.disabled;
202
+ var ee = Z === true || Z === "disabled" || Z === "dimmed";
203
+ var oe = (0, n.useCallback)((function(e) {
202
204
  var o, n;
205
+ if (ee) {
206
+ return;
207
+ }
203
208
  (o = (n = T.props).onKeyDown) === null || o === void 0 ? void 0 : o.call(n, e);
204
209
  if (!S) {
205
210
  return;
@@ -214,8 +219,8 @@
214
219
  z(true);
215
220
  }
216
221
  }
217
- }), [ $, S, I, T ]);
218
- var ee = (0, n.useCallback)((function(e) {
222
+ }), [ $, ee, S, I, T ]);
223
+ var ne = (0, n.useCallback)((function(e) {
219
224
  var o = e.event, n = e.reason;
220
225
  if (o && n === "clickAway") {
221
226
  var r = o.target;
@@ -238,17 +243,21 @@
238
243
  A === null || A === void 0 ? void 0 : A(e);
239
244
  }
240
245
  }), [ y, O, $, B, A ]);
241
- var oe = (0, n.useCallback)((function(e) {
242
- ee({
246
+ var re = (0, n.useCallback)((function(e) {
247
+ ne({
243
248
  reason: "contentClick",
244
249
  event: e
245
250
  });
246
- }), [ ee ]);
247
- var ne = (0, n.useCallback)((function(e) {
251
+ }), [ ne ]);
252
+ var te = (0, n.useCallback)((function(e) {
248
253
  var o, n;
254
+ if (ee) {
255
+ e.preventDefault();
256
+ return;
257
+ }
249
258
  (o = (n = T.props).onClick) === null || o === void 0 ? void 0 : o.call(n, e);
250
259
  if (B) {
251
- ee({
260
+ ne({
252
261
  reason: "toggleClick",
253
262
  event: e
254
263
  });
@@ -260,10 +269,10 @@
260
269
  z(true);
261
270
  }
262
271
  }
263
- }), [ ee, $, B, I, T ]);
264
- var re = (0, n.cloneElement)(T, {
265
- onClick: ne,
266
- onKeyDown: Z,
272
+ }), [ ne, $, B, ee, I, T ]);
273
+ var ae = (0, n.cloneElement)(T, {
274
+ onClick: te,
275
+ onKeyDown: oe,
267
276
  ref: Y,
268
277
  "aria-controls": B ? L : undefined,
269
278
  "aria-haspopup": T.props["aria-haspopup"] || true,
@@ -273,16 +282,16 @@
273
282
  id: X
274
283
  });
275
284
 
276
- return r().createElement(r().Fragment, null, re, r().createElement(i(), {
285
+ return r().createElement(r().Fragment, null, ae, r().createElement(i(), {
277
286
  align: a,
278
287
  open: !!N && B,
279
288
  autoCloseWhenOffScreen: y.includes("offScreen"),
280
289
  anchor: N,
281
290
  canCoverAnchor: u,
282
291
  elementRef: m,
283
- retainFocus: j,
292
+ retainFocus: K,
284
293
  defaultPlacement: b,
285
- onRequestClose: ee,
294
+ onRequestClose: ne,
286
295
  repositionMode: P,
287
296
  id: L,
288
297
  "aria-labelledby": "".concat(o !== null && o !== void 0 ? o : "", " ").concat(X).trim(),
@@ -292,13 +301,13 @@
292
301
 
293
302
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
294
303
  return r().createElement("div", {
295
- onClick: oe
304
+ onClick: re
296
305
  }, p.apply(void 0, arguments));
297
306
  } :
298
307
 
299
308
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
300
309
  r().createElement("div", {
301
- onClick: oe
310
+ onClick: re
302
311
  }, p)));
303
312
  }
304
313
  O.propTypes = h;
package/DualListbox.js CHANGED
@@ -1408,7 +1408,7 @@
1408
1408
 
1409
1409
  return n().createElement(O, xe({
1410
1410
  "data-test": "dual-listbox",
1411
- elementRef: h,
1411
+ ref: h,
1412
1412
  $inline: y ? false : C,
1413
1413
  $fill: y
1414
1414
  }, E), n().createElement(m.Provider, {
package/File.js CHANGED
@@ -136,7 +136,7 @@
136
136
  return !n && (0, h.css)([ "&:hover{background-color:", ";", "{color:", ";}", "{fill:", ";}}" ], w.variables.actionColorBackgroundSubtleHover, /* sc-sel */ _, w.variables.contentColorAccentStrong, /* sc-sel */ E, w.variables.contentColorAccentStrong);
137
137
  }), (function(e) {
138
138
  var n = e.$screenMode;
139
- return n === "normal" && (0, h.css)([ "border:", " dashed ", ";" ], w.variables.inputBorderWidth, w.variables.borderColor);
139
+ return n === "normal" && (0, h.css)([ "border:", " dashed ", ";" ], w.variables.inputBorderWidth, w.variables.interactiveColorBorder);
140
140
  }), (function(e) {
141
141
  var n = e.$dragOver, r = e.$focused, t = e.$error;
142
142
  return (n || r && !t) && (0, h.css)([ "", "{color:", ";}", "{fill:", ";}" ], /* sc-sel */ _, w.variables.contentColorAccentStrong, /* sc-sel */ E, w.variables.contentColorAccentStrong);
@@ -148,7 +148,7 @@
148
148
  return n && (0, h.css)([ "box-shadow:", ";" ], w.variables.focusShadow);
149
149
  }), (function(e) {
150
150
  var n = e.$disabled;
151
- return n && (0, h.css)([ "border-color:", ";cursor:not-allowed;", ",", "{color:", ";}", "{fill:", ";}" ], w.variables.borderColorWeak, /* sc-sel */ _, /* sc-sel */ R, w.variables.contentColorDisabled, /* sc-sel */ E, w.variables.contentColorDisabled);
151
+ return n && (0, h.css)([ "border-color:", ";cursor:not-allowed;", ",", "{color:", ";}", "{fill:", ";}" ], w.variables.interactiveColorBorderDisabled, /* sc-sel */ _, /* sc-sel */ R, w.variables.contentColorDisabled, /* sc-sel */ E, w.variables.contentColorDisabled);
152
152
  }), (function(e) {
153
153
  var n = e.$error, r = e.$dragOver;
154
154
  return n && !r && (0, h.css)([ "border-color:", ";" ], w.variables.interactiveColorAccentError);
@@ -167,10 +167,10 @@
167
167
  })([ "display:flex;flex-direction:column;gap:", ";" ], w.variables.spacingXSmall);
168
168
  // CONCATENATED MODULE: external "@splunk/react-icons/ArrowsCircularDouble"
169
169
  const j = require("@splunk/react-icons/ArrowsCircularDouble");
170
- var N = e.n(j);
170
+ var D = e.n(j);
171
171
  // CONCATENATED MODULE: external "@splunk/react-icons/Cross"
172
- const D = require("@splunk/react-icons/Cross");
173
- var M = e.n(D);
172
+ const N = require("@splunk/react-icons/Cross");
173
+ var M = e.n(N);
174
174
  // CONCATENATED MODULE: external "@splunk/react-icons/TrashCanCross"
175
175
  const $ = require("@splunk/react-icons/TrashCanCross");
176
176
  var B = e.n($);
@@ -179,10 +179,10 @@
179
179
  var X = e.n(L);
180
180
  // CONCATENATED MODULE: external "@splunk/react-icons/FileCss"
181
181
  const U = require("@splunk/react-icons/FileCss");
182
- var W = e.n(U);
182
+ var z = e.n(U);
183
183
  // CONCATENATED MODULE: external "@splunk/react-icons/FileCsv"
184
- const z = require("@splunk/react-icons/FileCsv");
185
- var H = e.n(z);
184
+ const H = require("@splunk/react-icons/FileCsv");
185
+ var W = e.n(H);
186
186
  // CONCATENATED MODULE: external "@splunk/react-icons/FileDat"
187
187
  const J = require("@splunk/react-icons/FileDat");
188
188
  var G = e.n(J);
@@ -248,10 +248,10 @@
248
248
  var Pe = e.n(Te);
249
249
  // CONCATENATED MODULE: external "@splunk/react-icons/FilePng"
250
250
  const je = require("@splunk/react-icons/FilePng");
251
- var Ne = e.n(je);
251
+ var De = e.n(je);
252
252
  // CONCATENATED MODULE: external "@splunk/react-icons/FilePpt"
253
- const De = require("@splunk/react-icons/FilePpt");
254
- var Me = e.n(De);
253
+ const Ne = require("@splunk/react-icons/FilePpt");
254
+ var Me = e.n(Ne);
255
255
  // CONCATENATED MODULE: external "@splunk/react-icons/FileRar"
256
256
  const $e = require("@splunk/react-icons/FileRar");
257
257
  var Be = e.n($e);
@@ -260,10 +260,10 @@
260
260
  var Xe = e.n(Le);
261
261
  // CONCATENATED MODULE: external "@splunk/react-icons/FileSql"
262
262
  const Ue = require("@splunk/react-icons/FileSql");
263
- var We = e.n(Ue);
263
+ var ze = e.n(Ue);
264
264
  // CONCATENATED MODULE: external "@splunk/react-icons/FileSvg"
265
- const ze = require("@splunk/react-icons/FileSvg");
266
- var He = e.n(ze);
265
+ const He = require("@splunk/react-icons/FileSvg");
266
+ var We = e.n(He);
267
267
  // CONCATENATED MODULE: external "@splunk/react-icons/FileText"
268
268
  const Je = require("@splunk/react-icons/FileText");
269
269
  var Ge = e.n(Je);
@@ -341,8 +341,8 @@
341
341
  var xn = {
342
342
  aif: X(),
343
343
  aiff: X(),
344
- css: W(),
345
- csv: H(),
344
+ css: z(),
345
+ csv: W(),
346
346
  dat: G(),
347
347
  db: Z(),
348
348
  dbf: Q(),
@@ -364,12 +364,12 @@
364
364
  mpg: Re(),
365
365
  pdf: Ae(),
366
366
  php: Pe(),
367
- png: Ne(),
367
+ png: De(),
368
368
  ppt: Me(),
369
369
  rar: Be(),
370
370
  rtf: Xe(),
371
- sql: We(),
372
- svg: He(),
371
+ sql: ze(),
372
+ svg: We(),
373
373
  txt: Ge(),
374
374
  tgz: Ze(),
375
375
  tiff: Qe(),
@@ -501,7 +501,7 @@
501
501
  onClick: q,
502
502
  "aria-label": F,
503
503
  appearance: "subtle"
504
- }, t().createElement(N(), {
504
+ }, t().createElement(D(), {
505
505
  "aria-label": (0, m._)("Retry")
506
506
  })), !_ && (p === undefined && !o ? t().createElement(wn, {
507
507
  "data-test": "remove",
@@ -577,12 +577,12 @@
577
577
  search: ""
578
578
  }
579
579
  };
580
- function Nn() {
580
+ function Dn() {
581
581
  var e = typeof document !== "undefined" ? document : jn;
582
582
  return e;
583
583
  }
584
- var Dn = Nn();
585
- /* harmony default export */ const Mn = /* unused pure expression or super */ null && Dn;
584
+ var Nn = Dn();
585
+ /* harmony default export */ const Mn = /* unused pure expression or super */ null && Nn;
586
586
  // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
587
587
  /* eslint-disable @typescript-eslint/no-empty-function */
588
588
  var $n = {
@@ -658,13 +658,13 @@
658
658
  return e;
659
659
  }, Un.apply(null, arguments);
660
660
  }
661
- function Wn(e, n) {
662
- return Vn(e) || Gn(e, n) || Hn(e, n) || zn();
661
+ function zn(e, n) {
662
+ return Vn(e) || Gn(e, n) || Wn(e, n) || Hn();
663
663
  }
664
- function zn() {
664
+ function Hn() {
665
665
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
666
666
  }
667
- function Hn(e, n) {
667
+ function Wn(e, n) {
668
668
  if (e) {
669
669
  if ("string" == typeof e) return Jn(e, n);
670
670
  var r = {}.toString.call(e).slice(8, -1);
@@ -750,13 +750,13 @@
750
750
  * file readers, only a reference to the file. This can be used to post binary content, or
751
751
  * upload using an array buffer.
752
752
  */ function Yn(e) {
753
- var n = e.accept, a = e.allowMultiple, o = e.children, s = e.disabled, u = e.dropAnywhere, d = e.elementRef, p = e.error, b = e.fullscreen, h = e.help, k = e.inputId, S = e.name, q = e.onRequestAdd, w = e.onRequestRemove, C = e.onRequestRetry, x = e.required, j = e.supportsMessage, N = Zn(e, [ "accept", "allowMultiple", "children", "disabled", "dropAnywhere", "elementRef", "error", "fullscreen", "help", "inputId", "name", "onRequestAdd", "onRequestRemove", "onRequestRetry", "required", "supportsMessage" ]);
753
+ var n = e.accept, a = e.allowMultiple, o = e.children, s = e.disabled, u = e.dropAnywhere, d = e.elementRef, p = e.error, b = e.fullscreen, h = e.help, k = e.inputId, S = e.name, q = e.onRequestAdd, w = e.onRequestRemove, C = e.onRequestRetry, x = e.required, j = e.supportsMessage, D = Zn(e, [ "accept", "allowMultiple", "children", "disabled", "dropAnywhere", "elementRef", "error", "fullscreen", "help", "inputId", "name", "onRequestAdd", "onRequestRemove", "onRequestRetry", "required", "supportsMessage" ]);
754
754
  // @docs-props-type FilePropsBase
755
- var D = (0, r.useState)(false), M = Wn(D, 2), $ = M[0], B = M[1];
756
- var L = (0, r.useState)(false), X = Wn(L, 2), U = X[0], W = X[1];
755
+ var N = (0, r.useState)(false), M = zn(N, 2), $ = M[0], B = M[1];
756
+ var L = (0, r.useState)(false), X = zn(L, 2), U = X[0], z = X[1];
757
757
  /* Each time a file is uploaded this is incremented and used to generate the
758
- * file input's key. In this way we get a new input without a value. */ var z = (0,
759
- r.useState)(0), H = Wn(z, 2), J = H[0], G = H[1];
758
+ * file input's key. In this way we get a new input without a value. */ var H = (0,
759
+ r.useState)(0), W = zn(H, 2), J = W[0], G = W[1];
760
760
  var V = (0, r.useMemo)((function() {
761
761
  return k || (0, y.createDOMID)("file");
762
762
  }), [ k ]);
@@ -780,10 +780,10 @@
780
780
  Z((n = e.currentTarget.files) !== null && n !== void 0 ? n : undefined);
781
781
  }), [ Z ]);
782
782
  var Q = (0, r.useCallback)((function() {
783
- W(true);
783
+ z(true);
784
784
  }), []);
785
785
  var Y = (0, r.useCallback)((function() {
786
- W(false);
786
+ z(false);
787
787
  }), []);
788
788
  var ee = (0, r.useCallback)((function(e) {
789
789
  if (!$) {
@@ -856,7 +856,7 @@
856
856
  "data-test": "file",
857
857
  "data-test-disabled": s ? "disabled" : undefined,
858
858
  "data-test-error": !!p
859
- }, N), t().createElement("label", {
859
+ }, D), t().createElement("label", {
860
860
  htmlFor: V,
861
861
  "data-test": "file-label"
862
862
  }, t().createElement(O, {
package/JSONTree.js CHANGED
@@ -89,7 +89,7 @@
89
89
  var y = d().code.withConfig({
90
90
  displayName: "JSONTreeStyles__StyledScrollCode",
91
91
  componentId: "vrdt21-0"
92
- })([ "", ";overflow-x:auto;white-space:nowrap;" ], v);
92
+ })([ "", ";overflow-x:auto;white-space:pre;" ], v);
93
93
  var b = d()(f()).withConfig({
94
94
  displayName: "JSONTreeStyles__StyledTree",
95
95
  componentId: "vrdt21-1"
@@ -115,10 +115,10 @@
115
115
  var I = e.n(E);
116
116
  // CONCATENATED MODULE: external "lodash/keys"
117
117
  const j = require("lodash/keys");
118
- var T = e.n(j);
118
+ var R = e.n(j);
119
119
  // CONCATENATED MODULE: external "lodash/repeat"
120
- const R = require("lodash/repeat");
121
- var A = e.n(R);
120
+ const T = require("lodash/repeat");
121
+ var A = e.n(T);
122
122
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
123
123
  const P = require("@splunk/ui-utils/i18n");
124
124
  // CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
@@ -139,8 +139,8 @@
139
139
  object: p.variables.syntaxGray,
140
140
  array: p.variables.syntaxGray
141
141
  };
142
- var F = (0, c.css)([ "word-break:break-word;word-wrap:break-word;" ]);
143
- var J = (0, c.css)([ "white-space:nowrap;" ]);
142
+ var J = (0, c.css)([ "word-break:break-word;word-wrap:break-word;" ]);
143
+ var F = (0, c.css)([ "white-space:pre;" ]);
144
144
  /* Using this magic number to set the height to be at least the minimum target size of 24 by 24 */ var M = (0,
145
145
  c.css)([ "padding-block:2px;" ]);
146
146
  var B = (0, c.css)([ "font-family:inherit;&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], p.variables.focusShadow, p.variables.neutral50);
@@ -149,7 +149,7 @@
149
149
  return D[n];
150
150
  }), (function(e) {
151
151
  var n = e.overflowType;
152
- return n === "wrap" ? F : J;
152
+ return n === "wrap" ? J : F;
153
153
  }), M);
154
154
  var U = d().span.withConfig({
155
155
  displayName: "JSONTreeItemStyles__StyledContentWrapper",
@@ -411,11 +411,11 @@
411
411
  });
412
412
  }
413
413
  function ge(e) {
414
- var n = e.baseId, r = e.defaultOpen, a = r === void 0 ? false : r, l = e.defaultExpanded, i = l === void 0 ? false : l, u = e.expandChildrenOnShiftKey, c = u === void 0 ? false : u, d = e.indent, s = d === void 0 ? 4 : d, f = e.indentLevel, p = f === void 0 ? 1 : f, v = e.obj, y = e.onClickKey, b = e.onClickValue, m = e.overflow, h = m === void 0 ? "scroll" : m, S = e.path, x = S === void 0 ? [] : S, w = e.shift, E = e.updateShift;
415
- var j = g()(Array(p), A()(" ", s));
416
- var R;
417
- var _;
418
- var K = function e() {
414
+ var n = e.baseId, r = e.defaultOpen, a = r === void 0 ? false : r, l = e.defaultExpanded, i = l === void 0 ? false : l, u = e.expandChildrenOnShiftKey, c = u === void 0 ? false : u, d = e.indent, s = d === void 0 ? 4 : d, f = e.indentLevel, p = f === void 0 ? 1 : f, v = e.obj, y = e.onClickKey, b = e.onClickValue, m = e.overflow, h = m === void 0 ? "scroll" : m, S = e.path, x = S === void 0 ? [] : S, w = e.shift, E = e.stringRenderer, j = E === void 0 ? "literal" : E, T = e.updateShift;
415
+ var _ = g()(Array(p), A()(" ", s));
416
+ var K;
417
+ var N;
418
+ var V = function e() {
419
419
  if (i && w == null) {
420
420
  return true;
421
421
  }
@@ -424,49 +424,49 @@
424
424
  }
425
425
  return a;
426
426
  };
427
- var N = function e(n) {
428
- if (c && E != null) {
429
- E(n.shiftKey);
427
+ var q = function e(n) {
428
+ if (c && T != null) {
429
+ T(n.shiftKey);
430
430
  }
431
431
  };
432
- var V = function e(n, r) {
432
+ var L = function e(n, r) {
433
433
  var t, a;
434
434
  // When rendering a single value key is not present, here we prevent `[undefined]` in path
435
435
  var o = r !== undefined ? [].concat(se(x), [ r ]) : se(x);
436
436
  var l = ".".concat(o.join("."));
437
- (t = _) === null || t === void 0 ? void 0 : (a = t.current) === null || a === void 0 ? void 0 : a.focus();
437
+ (t = N) === null || t === void 0 ? void 0 : (a = t.current) === null || a === void 0 ? void 0 : a.focus();
438
438
  y === null || y === void 0 ? void 0 : y(n, {
439
439
  key: l,
440
440
  keyPath: o
441
441
  });
442
442
  };
443
- var q = function e(n, r) {
443
+ var D = function e(n, r) {
444
444
  var t, a;
445
445
  // When rendering a single value key is not present, here we prevent `[undefined]` in path
446
446
  var o = r !== undefined ? [].concat(se(x), [ r ]) : se(x);
447
447
  var l = ".".concat(o.join("."));
448
- (t = R) === null || t === void 0 ? void 0 : (a = t.current) === null || a === void 0 ? void 0 : a.focus();
448
+ (t = K) === null || t === void 0 ? void 0 : (a = t.current) === null || a === void 0 ? void 0 : a.focus();
449
449
  b === null || b === void 0 ? void 0 : b(n, {
450
450
  key: l,
451
451
  keyPath: o,
452
452
  value: n.target.textContent
453
453
  });
454
454
  };
455
- var L = function e(n, r) {
455
+ var J = function e(n, r) {
456
456
  var t, a;
457
457
  var o = n.key;
458
- if (o === "ArrowLeft" && y && ((t = _) === null || t === void 0 ? void 0 : t.current) && !r) {
458
+ if (o === "ArrowLeft" && y && ((t = N) === null || t === void 0 ? void 0 : t.current) && !r) {
459
459
  var l;
460
460
  n.stopPropagation();
461
- (l = _.current) === null || l === void 0 ? void 0 : l.focus();
461
+ (l = N.current) === null || l === void 0 ? void 0 : l.focus();
462
462
  }
463
- if (o === "ArrowRight" && b && ((a = R) === null || a === void 0 ? void 0 : a.current) && r) {
463
+ if (o === "ArrowRight" && b && ((a = K) === null || a === void 0 ? void 0 : a.current) && r) {
464
464
  var i;
465
465
  n.stopPropagation();
466
- (i = R.current) === null || i === void 0 ? void 0 : i.focus();
466
+ (i = K.current) === null || i === void 0 ? void 0 : i.focus();
467
467
  }
468
468
  };
469
- var D = function e(n) {
469
+ var F = function e(n) {
470
470
  var r = n.onToggleExpansion, a = n.open, o = n.withTooltip, l = n.expandLinkRef;
471
471
  var i = a ? "[-]" : "[+]";
472
472
  var u = a ? (0, P._)("Collapse all") : (0, P._)("Shift click to expand all");
@@ -475,7 +475,7 @@
475
475
  elementRef: l,
476
476
  tabIndex: -1,
477
477
  onClick: function e(n) {
478
- N(n);
478
+ q(n);
479
479
  r === null || r === void 0 ? void 0 : r(n);
480
480
  },
481
481
  "aria-expanded": a,
@@ -497,12 +497,12 @@
497
497
  expandLinkRef: l
498
498
  };
499
499
  };
500
- var F = function e(r) {
500
+ var M = function e(r) {
501
501
  var a = r.value, l = r.key, u = r.clickValueRef;
502
502
  var d;
503
503
  if (!I()(a)) {
504
504
  if (typeof a === "string") {
505
- d = '"'.concat(a, '"');
505
+ d = j === "stringify" ? JSON.stringify(a) : '"'.concat(a, '"');
506
506
  } else if (typeof a === "boolean") {
507
507
  d = a.toString();
508
508
  } else if (a === null) {
@@ -526,7 +526,7 @@
526
526
  path: l !== undefined ? [].concat(se(x), [ l ]) : se(x),
527
527
  indentLevel: p + 1,
528
528
  shift: w,
529
- updateShift: E
529
+ updateShift: T
530
530
  });
531
531
  }
532
532
  if (o()(d) || C()(d)) {
@@ -539,11 +539,11 @@
539
539
  valueType: s,
540
540
  overflowType: h,
541
541
  onClick: function e(n) {
542
- R = u;
543
- q(n, l);
542
+ K = u;
543
+ D(n, l);
544
544
  },
545
545
  onKeyDown: function e(n) {
546
- L(n, false);
546
+ J(n, false);
547
547
  },
548
548
  tabIndex: -1
549
549
  }, d),
@@ -561,18 +561,18 @@
561
561
  representation: d
562
562
  };
563
563
  };
564
- var J = function e(n, r) {
564
+ var B = function e(n, r) {
565
565
  if (y) {
566
566
  return {
567
567
  propertyElement: t().createElement(t().Fragment, null, t().createElement(z, {
568
568
  elementRef: r,
569
569
  tabIndex: -1,
570
570
  onClick: function e(t) {
571
- _ = r;
572
- V(t, n);
571
+ N = r;
572
+ L(t, n);
573
573
  },
574
574
  onKeyDown: function e(n) {
575
- L(n, true);
575
+ J(n, true);
576
576
  }
577
577
  }, n), ":", " "),
578
578
  clickableKeyRef: r
@@ -583,7 +583,7 @@
583
583
  };
584
584
  };
585
585
  if (I()(v) && !O()(v) || k()(v) && v.length > 0) {
586
- var M = T()(v).map((function(e, r, a) {
586
+ var G = R()(v).map((function(e, r, a) {
587
587
  var o = v[e];
588
588
  // TS: should be safe based on (recursive) JSONElement type
589
589
  var l = k()(v) ? parseInt(e, 10) : e;
@@ -598,41 +598,41 @@
598
598
  value: o,
599
599
  properties: a,
600
600
  obj: v,
601
- renderValue: F,
602
- renderKey: J,
603
- getInitialOpenState: K,
604
- indentArray: j,
605
- renderExpandLink: D,
601
+ renderValue: M,
602
+ renderKey: B,
603
+ getInitialOpenState: V,
604
+ indentArray: _,
605
+ renderExpandLink: F,
606
606
  onFocus: function e(n, r) {
607
- _ = n;
608
- R = r;
607
+ N = n;
608
+ K = r;
609
609
  }
610
610
  });
611
611
  }));
612
612
  if (x.length === 0) {
613
- var B = I()(v) && !O()(v) || k()(v) && v.length > 0;
613
+ var U = I()(v) && !O()(v) || k()(v) && v.length > 0;
614
614
 
615
615
  return t().createElement(ce, {
616
616
  id: "".concat(n, "-root"),
617
617
  isRoot: true,
618
618
  propertyDataPath: ".",
619
619
  key: ".",
620
- hasChildren: B,
620
+ hasChildren: U,
621
621
  initialOpenState: a || i,
622
622
  value: v,
623
623
  index: 0,
624
- renderExpandLink: D,
625
- representation: M
624
+ renderExpandLink: F,
625
+ representation: G
626
626
  });
627
627
  }
628
- return M;
628
+ return G;
629
629
  }
630
630
  // edge case: a single number/string/boolean being rendered (still valid JSON)
631
631
 
632
632
  return t().createElement(he, {
633
633
  baseId: n,
634
634
  obj: v,
635
- renderValue: F
635
+ renderValue: M
636
636
  });
637
637
  }
638
638
  // CONCATENATED MODULE: ./src/JSONTree/JSONTree.tsx
@@ -716,7 +716,7 @@
716
716
  }
717
717
  /** @public */
718
718
  /** @public */
719
- /** @public */ var Te = {
719
+ /** @public */ var Re = {
720
720
  elementRef: i().oneOfType([ i().func, i().object ]),
721
721
  defaultExpanded: i().bool,
722
722
  indent: i().number,
@@ -728,45 +728,46 @@
728
728
  };
729
729
  /**
730
730
  * Used to visualize a JSON string.
731
- */ function Re(e) {
732
- var n = e.elementRef, a = e.defaultExpanded, l = a === void 0 ? false : a, i = e.indent, c = i === void 0 ? 4 : i, d = e.json, s = e.onClickKey, f = e.onClickValue, p = e.overflow, v = p === void 0 ? "scroll" : p, h = e.expandChildrenOnShiftKey, g = h === void 0 ? true : h, S = Ie(e, [ "elementRef", "defaultExpanded", "indent", "json", "onClickKey", "onClickValue", "overflow", "expandChildrenOnShiftKey" ]);
731
+ */ function Te(e) {
732
+ var n = e.elementRef, a = e.defaultExpanded, l = a === void 0 ? false : a, i = e.indent, c = i === void 0 ? 4 : i, d = e.json, s = e.onClickKey, f = e.onClickValue, p = e.overflow, v = p === void 0 ? "scroll" : p, h = e.expandChildrenOnShiftKey, g = h === void 0 ? true : h, S = e.stringRenderer, k = S === void 0 ? "literal" : S, x = Ie(e, [ "elementRef", "defaultExpanded", "indent", "json", "onClickKey", "onClickValue", "overflow", "expandChildrenOnShiftKey", "stringRenderer" ]);
733
733
  // @docs-props-type JSONTreePropsBase
734
- var k = (0, r.useMemo)((function() {
735
- return S.id || (0, u.createDOMID)("json-tree");
736
- }), [ S.id ]);
737
- var x = o()(d) ? JSON.parse(d) : d;
738
- var O = v === "wrap" ? m : y;
739
- var w = (0, r.useState)(undefined), C = ke(w, 2), E = C[0], I = C[1];
740
- var j = (0, r.useCallback)((function(e) {
741
- I(e);
734
+ var O = (0, r.useMemo)((function() {
735
+ return x.id || (0, u.createDOMID)("json-tree");
736
+ }), [ x.id ]);
737
+ var w = o()(d) ? JSON.parse(d) : d;
738
+ var C = v === "wrap" ? m : y;
739
+ var E = (0, r.useState)(undefined), I = ke(E, 2), j = I[0], R = I[1];
740
+ var T = (0, r.useCallback)((function(e) {
741
+ R(e);
742
742
  }), []);
743
- var T = (0, r.useMemo)((function() {
743
+ var A = (0, r.useMemo)((function() {
744
744
  return ge({
745
- baseId: k,
745
+ baseId: O,
746
746
  defaultOpen: true,
747
747
  defaultExpanded: l,
748
748
  expandChildrenOnShiftKey: g,
749
749
  indent: c,
750
- obj: x,
750
+ obj: w,
751
751
  onClickKey: s,
752
752
  onClickValue: f,
753
753
  overflow: v,
754
- shift: E,
755
- updateShift: j
754
+ shift: j,
755
+ stringRenderer: k,
756
+ updateShift: T
756
757
  });
757
- }), [ k, l, g, c, x, s, f, v, E, j ]);
758
+ }), [ O, l, g, c, w, s, f, v, j, k, T ]);
758
759
 
759
- return t().createElement(O, Se({
760
+ return t().createElement(C, Se({
760
761
  "data-language": "language-json",
761
762
  "data-test": "json-tree",
762
763
  ref: n,
763
764
  role: "tree"
764
- }, S), t().createElement(b, {
765
+ }, x), t().createElement(b, {
765
766
  defaultIndent: false
766
- }, T));
767
+ }, A));
767
768
  }
768
- Re.propTypes = Te;
769
- /* harmony default export */ const Ae = Re;
769
+ Te.propTypes = Re;
770
+ /* harmony default export */ const Ae = Te;
770
771
  // CONCATENATED MODULE: ./src/JSONTree/index.ts
771
772
  module.exports = n;
772
773
  /******/})();
package/Link.js CHANGED
@@ -117,11 +117,11 @@
117
117
  var w = c()(S()).withConfig({
118
118
  displayName: "LinkStyles__StyledClickable",
119
119
  componentId: "sc-1hhltcf-0"
120
- })([ "", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;color:", ";", " &:not([disabled],[aria-disabled='true']){cursor:pointer;&:hover,&:active,&:focus{color:", ";text-decoration:underline;text-decoration-thickness:2px;}&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}}&[disabled],&[aria-disabled='true']{color:", ";}", "" ], v.mixins.reset("inline"), v.variables.contentColorLink, (0,
120
+ })([ "", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;color:", ";", " &:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}&:not([disabled],[aria-disabled='true']){cursor:pointer;&:hover,&:active,&:focus{color:", ";text-decoration:underline;text-decoration-thickness:2px;}}&[disabled],&[aria-disabled='true']{color:", ";}", "" ], v.mixins.reset("inline"), v.variables.contentColorLink, (0,
121
121
  v.pickVariant)("$appearance", {
122
122
  inline: (0, d.css)([ "text-decoration:underline;" ]),
123
123
  standalone: (0, d.css)([ "font-weight:", ";" ], v.variables.fontWeightSemiBold)
124
- }), v.variables.contentColorLink, v.variables.focusShadow, v.variables.contentColorLinkDisabled, (function(e) {
124
+ }), v.variables.focusShadow, v.variables.contentColorLink, v.variables.contentColorLinkDisabled, (function(e) {
125
125
  var n = e.$enableVisitedStyling;
126
126
  return n && (0, d.css)([ "&:visited{color:", ";}&:where([disabled],[aria-disabled='true']):visited{color:", ";}" ], v.variables.contentColorLinkVisited, v.variables.contentColorLinkVisitedDisabled);
127
127
  }));