@splunk/react-ui 4.35.0 → 4.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,20 +1,47 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 4.37. 0 - September 9, 2024
5
+ ----------
6
+ New Features:
7
+ * `Progress` supports `success` and `error` values for the `type` prop in Enterprise themes (SUI-6492).
8
+
9
+ Bug Fixes:
10
+ * Updated `Progress` animation and style to improve contrast in Enterprise themes (SUI-6492).
11
+ * `RadioBar`'s active item now has appropriate contrast in the Prisma light theme (SUI-6609).
12
+ * `Switch` now shows the correct cursor type when `appearance="toggle"` is `disabled` (SUI-6612).
13
+ * `TextArea` with `startAdornment` or `endAdornment` will no longer prematurely wrap text (SUI-6613).
14
+
15
+ 4.36.0 - September 3, 2024
16
+ ----------
17
+ New Features:
18
+ * `Resize` now accepts `separator` as a value for the `appearance` prop which makes the resize button span the entire border (SUI-6600)
19
+
20
+ Bug Fixes:
21
+ * `Slider` has increased color contrast in Enterprise themes (SUI-6259).
22
+ * `JSONTree` will no longer crash when the `json` prop changes (SUI-6182).
23
+ * `Multiselect`'s options are no longer clickable when they are fading out (SUI-5901).
24
+ * `Multiselect`'s options are shown again when clicking after being previously dismissed with ESC key (SUI-6128).
25
+ * `TabBar` now correctly handles focus when `Tab` children are reordered (SUI-6599).
26
+
27
+ Deprecations:
28
+ * `ComboBox`, `ControlGroup`, and `StaticContent`'s `size` prop has been deprecated and will be removed in the next major version. It has no effect in `@splunk/react-ui@4` and was incorrectly listed in the API documentation. (SUI-6400).
29
+
4
30
  4.35.0 - August 26, 2024
5
31
  ----------
6
32
  New Features:
7
33
  * `Color`'s `hideInput` prop is now supported in Enterprise themes. Defaults to `true` in Enterprise and `false` in Prisma themes, maintaining existing behavior (SUI-6458).
8
34
  * `Menu.Item` now supports a new `"dimmed"` value for the `disabled` prop (SUI-5671).
9
35
  * `ControlGroup` uses `aria-errormessage` to help associate the input with its error message (SUI-6395).
10
- * Refactored uses of styled-components `withComponent` functionality to increase compatibility with styled-components v6 where it will no longer be available.
36
+ * Refactored uses of styled-components `withComponent` functionality to increase compatibility with styled-components v6 where it will no longer be available (SUI-6285).
37
+ * `Search.Option` now supports the `onClick`, `to`, and `openInNewContext` props (SUI-5249).
11
38
 
12
39
  Bug Fixes:
13
40
  * `Button` with `inline={false}` now aligns correctly with text when set to `display: inline-block` (SUI-6472).
14
41
  * `Text`'s border now shows focus when clicked and has a cursor text when hovering over the border now (SUI-5199).
15
- * `Text`'s nonclickable adornments now shows focus on the input when clicked (SUI-5199).
42
+ * `Text`'s non-clickable adornments now shows focus on the input when clicked (SUI-5199).
16
43
  * Reverted change to `CollapsiblePanel` focus shadow, now uses inset shadow:
17
- * Note `@splunk/themes@0.21.0` should be used to ensure contrast requirements are met.
44
+ * Note `@splunk/themes@0.21.0` should be used to ensure contrast requirements are met.
18
45
  * `Message`'s remove button styling for focus and hover states has been corrected (SUI-6520).
19
46
 
20
47
  Deprecations:
package/Calendar.js CHANGED
@@ -761,7 +761,7 @@
761
761
  return n().createElement(y.SplunkThemeProvider, {
762
762
  density: d ? "comfortable" : i.density
763
763
  }, n().createElement(Z, c()(u, "onChange"), n().createElement(J(), {
764
- appearance: "pill",
764
+ appearance: "subtle",
765
765
  icon: s ? n().createElement(L(), {
766
766
  hideDefaultTooltip: true,
767
767
  screenReaderText: m,
@@ -778,7 +778,7 @@
778
778
  id: a,
779
779
  "data-test": "header-label"
780
780
  }, v), n().createElement(J(), {
781
- appearance: "pill",
781
+ appearance: "subtle",
782
782
  icon: s ? n().createElement(X(), {
783
783
  hideDefaultTooltip: true,
784
784
  screenReaderText: b,
@@ -772,7 +772,7 @@
772
772
  }, c()(this.props, l()(n.propTypes))), g || o != null ? r().createElement(W, {
773
773
  $disabled: p
774
774
  }, r().createElement(B, ue({
775
- appearance: "pill",
775
+ appearance: "subtle",
776
776
  "aria-label": (0, v._)("Panel"),
777
777
  "aria-labelledby": x
778
778
  }, S), r().createElement(U, {
package/ComboBox.js CHANGED
@@ -552,8 +552,7 @@
552
552
  inline: false,
553
553
  isLoadingOptions: false,
554
554
  menuStyle: {},
555
- placeholder: (0, O._)("Select..."),
556
- size: "medium"
555
+ placeholder: (0, O._)("Select...")
557
556
  };
558
557
  function pe(e, t) {
559
558
  var n = t.clientX, o = t.clientY;
@@ -821,6 +820,7 @@
821
820
  i.activeItemId = (0, g.createDOMID)("active-item");
822
821
  if (false) {}
823
822
  if (false) {}
823
+ if (false) {}
824
824
  return i;
825
825
  }
826
826
  te(r, [ {
package/ControlGroup.js CHANGED
@@ -281,7 +281,7 @@
281
281
  return r;
282
282
  }
283
283
  function $(e, t) {
284
- return z(e) || N(e, t) || G(e, t) || A();
284
+ return R(e) || N(e, t) || G(e, t) || A();
285
285
  }
286
286
  function A() {
287
287
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
@@ -324,15 +324,15 @@
324
324
  }
325
325
  return r;
326
326
  }
327
- function z(e) {
327
+ function R(e) {
328
328
  if (Array.isArray(e)) return e;
329
329
  }
330
- function R(e, t) {
330
+ function W(e, t) {
331
331
  if (!(e instanceof t)) {
332
332
  throw new TypeError("Cannot call a class as a function");
333
333
  }
334
334
  }
335
- function W(e, t) {
335
+ function z(e, t) {
336
336
  for (var r = 0; r < t.length; r++) {
337
337
  var n = t[r];
338
338
  n.enumerable = n.enumerable || false;
@@ -342,8 +342,8 @@
342
342
  }
343
343
  }
344
344
  function F(e, t, r) {
345
- if (t) W(e.prototype, t);
346
- if (r) W(e, r);
345
+ if (t) z(e.prototype, t);
346
+ if (r) z(e, r);
347
347
  return e;
348
348
  }
349
349
  function J(e, t) {
@@ -446,8 +446,7 @@
446
446
  hideLabel: false,
447
447
  labelPosition: "left",
448
448
  labelWidth: 120,
449
- required: false,
450
- size: "medium"
449
+ required: false
451
450
  };
452
451
  // Style cloned onto child elements when fill behavior set.
453
452
  var re = {
@@ -480,7 +479,7 @@
480
479
  // @docs-props-type ControlGroupPropsBase
481
480
  function o(e) {
482
481
  var r;
483
- R(this, o);
482
+ W(this, o);
484
483
  r = t.call(this, e);
485
484
  Z(K(r), "errorId", void 0);
486
485
  Z(K(r), "helpId", void 0);
@@ -539,6 +538,7 @@
539
538
  r.childIds = {};
540
539
  r.stackLayoutChildStyle = {};
541
540
  if (false) {}
541
+ if (false) {}
542
542
  return r;
543
543
  }
544
544
  F(o, [ {
@@ -572,14 +572,14 @@
572
572
  key: "render",
573
573
  value: function e() {
574
574
  var t = this;
575
- var o = this.props, i = o.children, l = o.controlsLayout, a = o.error, s = o.help, c = o.hideLabel, u = o.label, f = o.labelFor, y = o.labelPosition, h = o.labelWidth, m = o.required, v = o.size, g = o.splunkTheme, _ = o.tooltip, T = o.tooltipDefaultPlacement, D = M(o, [ "children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "required", "size", "splunkTheme", "tooltip", "tooltipDefaultPlacement" ]);
576
- var V = g.isPrisma, $ = g.isCompact;
577
- var A = r.Children.toArray(i).filter(r.isValidElement);
578
- var G = A.length;
579
- var B = D;
580
- var N = typeof a === "string";
581
- var z = N && a !== "";
582
- var R = N || a === true;
575
+ var o = this.props, i = o.children, l = o.controlsLayout, a = o.error, s = o.help, c = o.hideLabel, u = o.label, f = o.labelFor, y = o.labelPosition, h = o.labelWidth, m = o.required, v = o.splunkTheme, g = o.tooltip, _ = o.tooltipDefaultPlacement, T = M(o, [ "children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "required", "splunkTheme", "tooltip", "tooltipDefaultPlacement" ]);
576
+ var D = v.isPrisma, V = v.isCompact;
577
+ var $ = r.Children.toArray(i).filter(r.isValidElement);
578
+ var A = $.length;
579
+ var G = T;
580
+ var B = typeof a === "string";
581
+ var N = B && a !== "";
582
+ var R = B || a === true;
583
583
  // Clean the Children
584
584
  var W = function e(n, o) {
585
585
  var i = {
@@ -589,21 +589,21 @@
589
589
  if (o > 0) {
590
590
  i.prepend = true;
591
591
  }
592
- if (o < G - 1) {
592
+ if (o < A - 1) {
593
593
  i.append = true;
594
594
  }
595
595
  if (i.prepend || i.append) {
596
596
  i.inline = false;
597
597
  }
598
598
  }
599
- if (l === "fill" && G > 1) {
599
+ if (l === "fill" && A > 1) {
600
600
  i.inline = true;
601
601
  }
602
602
  if (l === "stack") {
603
603
  i.inline = false;
604
- if (o < G - 1) {
604
+ if (o < A - 1) {
605
605
  // The spread operator is used as css styles are not nested, so there is no need for a deep copy.
606
- var a = t.getStackLayoutChildStyle(V, $);
606
+ var a = t.getStackLayoutChildStyle(D, V);
607
607
  i.style = n.props.style ? q(q({}, n.props.style), a) : a;
608
608
  }
609
609
  }
@@ -627,7 +627,7 @@
627
627
  } else {
628
628
  i.labelText = u;
629
629
  }
630
- if (G === 1 && (l === "fillJoin" || l === "fill")) {
630
+ if (A === 1 && (l === "fillJoin" || l === "fill")) {
631
631
  // Some controls like Select do not grow by default, so flexGrow is applied
632
632
  // The spread operator is used as css styles are not nested, so there is no need for a deep copy.
633
633
  i.style = n.props.style ? q(q({}, n.props.style), re) : re;
@@ -639,43 +639,42 @@
639
639
  i.id = n.props.id || t.getChildID("id", o);
640
640
  }
641
641
  }
642
- if (z && n.props.error === true) {
642
+ if (N && n.props.error === true) {
643
643
  i["aria-errormessage"] = t.errorId;
644
644
  }
645
645
 
646
646
  return (0, r.cloneElement)(n, i);
647
647
  };
648
- var F = A.map(W);
649
- var J = this.getLinkedId(F);
648
+ var z = $.map(W);
649
+ var F = this.getLinkedId(z);
650
650
  if (a) {
651
- B["aria-invalid"] = true;
651
+ G["aria-invalid"] = true;
652
652
  }
653
- var H = y === "left" ? {
653
+ var J = y === "left" ? {
654
654
  width: h
655
655
  } : undefined;
656
- var U = p()(h) ? "".concat(h, "px") : h;
657
- var X = V ? "16px" : "20px";
658
- var K = y === "left" ? {
659
- marginLeft: "calc(".concat(U, " + ").concat(X, ")")
656
+ var H = p()(h) ? "".concat(h, "px") : h;
657
+ var U = D ? "16px" : "20px";
658
+ var X = y === "left" ? {
659
+ marginLeft: "calc(".concat(H, " + ").concat(U, ")")
660
660
  } : undefined;
661
- var Q = l === "stack" ? S : d();
662
- var Y = y === "left" ? I : x;
663
- var Z = n().createElement(Y, {
664
- style: H,
661
+ var K = l === "stack" ? S : d();
662
+ var Q = y === "left" ? I : x;
663
+ var Y = n().createElement(Q, {
664
+ style: J,
665
665
  $labelPosition: y
666
666
  }, n().createElement(C, {
667
- "data-size": v,
668
667
  "data-test": "label",
669
668
  id: this.labelId,
670
- htmlFor: f || J,
671
- $tooltip: !!_
669
+ htmlFor: f || F,
670
+ $tooltip: !!g
672
671
  }, m && n().createElement(P, {
673
672
  "aria-hidden": "true"
674
- }, "*"), u, !V && !c && _ && n().createElement("span", null, " "), !c && _ && n().createElement(b(), null, _)), !c && _ && n().createElement(k, {
673
+ }, "*"), u, !D && !c && g && n().createElement("span", null, " "), !c && g && n().createElement(b(), null, g)), !c && g && n().createElement(k, {
675
674
  $labelPosition: y,
676
675
  closeWhen: "notOnClick",
677
- content: _,
678
- defaultPlacement: T,
676
+ content: g,
677
+ defaultPlacement: _,
679
678
  "aria-hidden": "true"
680
679
  }));
681
680
 
@@ -683,21 +682,21 @@
683
682
  "data-test": "control-group",
684
683
  "data-test-required": m,
685
684
  $error: R
686
- }, B), n().createElement(L.Provider, {
685
+ }, G), n().createElement(L.Provider, {
687
686
  value: this.getContextValue()
688
- }, c ? n().createElement(b(), null, Z) : Z, n().createElement(Q, {
687
+ }, c ? n().createElement(b(), null, Y) : Y, n().createElement(K, {
689
688
  "data-test": "controls",
690
689
  flex: l !== "none",
691
- style: K
692
- }, F), s && n().createElement(w, {
690
+ style: X
691
+ }, z), s && n().createElement(w, {
693
692
  "data-test": "help",
694
693
  id: this.helpId,
695
- style: K,
696
- $error: R && !z
697
- }, s), z && n().createElement(j, {
694
+ style: X,
695
+ $error: R && !N
696
+ }, s), N && n().createElement(j, {
698
697
  "data-test": "error",
699
698
  id: this.errorId,
700
- style: K,
699
+ style: X,
701
700
  $help: !!s
702
701
  }, a)));
703
702
  }
package/Date.js CHANGED
@@ -250,16 +250,16 @@
250
250
  } else {
251
251
  o = a.apply(this, arguments);
252
252
  }
253
- return E(this, o);
253
+ return R(this, o);
254
254
  };
255
255
  }
256
- function E(e, t) {
256
+ function R(e, t) {
257
257
  if (t && (w(t) === "object" || typeof t === "function")) {
258
258
  return t;
259
259
  }
260
- return R(e);
260
+ return E(e);
261
261
  }
262
- function R(e) {
262
+ function E(e) {
263
263
  if (e === void 0) {
264
264
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
265
265
  }
@@ -343,12 +343,12 @@
343
343
  var a;
344
344
  j(this, n);
345
345
  a = t.call(this, e);
346
- W(R(a), "controlledExternally", void 0);
347
- W(R(a), "focusCalledInternally", false);
348
- W(R(a), "popoverId", void 0);
349
- W(R(a), "calendar", null);
350
- W(R(a), "openWithFocus", false);
351
- W(R(a), "applyTextChange", (function(e) {
346
+ W(E(a), "controlledExternally", void 0);
347
+ W(E(a), "focusCalledInternally", false);
348
+ W(E(a), "popoverId", void 0);
349
+ W(E(a), "calendar", null);
350
+ W(E(a), "openWithFocus", false);
351
+ W(E(a), "applyTextChange", (function(e) {
352
352
  var t = p()(a.state.tempTextInputDate, "l", a.props.locale);
353
353
  if (t.isValid()) {
354
354
  a.handleDateChange(e, {
@@ -361,7 +361,7 @@
361
361
  });
362
362
  }
363
363
  }));
364
- W(R(a), "handleDateChange", (function(e, t, n) {
364
+ W(E(a), "handleDateChange", (function(e, t, n) {
365
365
  var o = t.value;
366
366
  if (n !== "textInput") {
367
367
  a.focusCalledInternally = true;
@@ -385,7 +385,7 @@
385
385
  });
386
386
  }
387
387
  }));
388
- W(R(a), "handleFocus", (function(e, t) {
388
+ W(E(a), "handleFocus", (function(e, t) {
389
389
  var n, o;
390
390
  if (a.focusCalledInternally) {
391
391
  a.focusCalledInternally = false;
@@ -396,26 +396,23 @@
396
396
  }
397
397
  (n = (o = a.props).onFocus) === null || n === void 0 ? void 0 : n.call(o, e, t);
398
398
  }));
399
- W(R(a), "handleClick", (function(e) {
400
- var t, n, o;
401
- if (document.activeElement !== a.state.input && ((t = a.state.anchor) === null || t === void 0 ? void 0 : t.contains(e.target))) {
402
- a.focus();
403
- }
399
+ W(E(a), "handleClick", (function(e) {
400
+ var t, n;
404
401
  if (!a.props.inputOnly && !a.state.calendarOpen) {
405
402
  a.setState({
406
403
  calendarOpen: true
407
404
  });
408
405
  }
409
- (n = (o = a.props).onClick) === null || n === void 0 ? void 0 : n.call(o, e);
406
+ (t = (n = a.props).onClick) === null || t === void 0 ? void 0 : t.call(n, e);
410
407
  }));
411
- W(R(a), "handleInputChange", (function(e, t) {
408
+ W(E(a), "handleInputChange", (function(e, t) {
412
409
  var n = t.value;
413
410
  a.setState({
414
411
  tempTextInputDate: n,
415
412
  calendarOpen: !a.props.inputOnly
416
413
  });
417
414
  }));
418
- W(R(a), "handleKeyDown", (function(e) {
415
+ W(E(a), "handleKeyDown", (function(e) {
419
416
  var t, n;
420
417
  var o = (0, d.keycode)(e.nativeEvent);
421
418
  if (o === "enter" || o === "tab") {
@@ -439,21 +436,21 @@
439
436
  }
440
437
  (t = (n = a.props).onKeyDown) === null || t === void 0 ? void 0 : t.call(n, e);
441
438
  }));
442
- W(R(a), "handleMount", (function(e) {
439
+ W(E(a), "handleMount", (function(e) {
443
440
  a.setState({
444
441
  anchor: e
445
442
  });
446
443
  S(a.props.elementRef, e);
447
444
  }));
448
- W(R(a), "handleInputMount", (function(e) {
445
+ W(E(a), "handleInputMount", (function(e) {
449
446
  a.setState({
450
447
  input: e
451
448
  });
452
449
  }));
453
- W(R(a), "handleCalendarMount", (function(e) {
450
+ W(E(a), "handleCalendarMount", (function(e) {
454
451
  a.calendar = e;
455
452
  }));
456
- W(R(a), "handleRequestClose", (function(e) {
453
+ W(E(a), "handleRequestClose", (function(e) {
457
454
  var t = e.event, n = e.reason;
458
455
  if ((n === "clickAway" || n === "escapeKey") && t !== undefined && t.target !== a.state.anchor) {
459
456
  a.applyTextChange(t);
package/FormRows.js CHANGED
@@ -284,7 +284,7 @@
284
284
  ref: t,
285
285
  onKeyDown: R
286
286
  }, h()(f, [ "onKeyDown", "onRequestRemove" ])), u && u(), o, k && n().createElement(B, null, n().createElement(N, {
287
- appearance: "pill",
287
+ appearance: "subtle",
288
288
  "aria-label": (0, a._)("Remove Row"),
289
289
  "data-test": "remove",
290
290
  disabled: m,
@@ -858,7 +858,7 @@
858
858
  onSortEnd: this.handleSortEnd
859
859
  }, o)), l || v && n().createElement(I, {
860
860
  disabled: i,
861
- appearance: "pill",
861
+ appearance: "subtle",
862
862
  "data-test": "add-row",
863
863
  icon: n().createElement(b, null),
864
864
  label: r,