@splunk/react-ui 4.35.0 → 4.36.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,36 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 4.36.0 - September 3, 2024
5
+ ----------
6
+ New Features:
7
+ * `Resize` now accepts `separator` as a value for the `appearance` prop which makes the resize button span the entire border (SUI-6600)
8
+
9
+ Bug Fixes:
10
+ * `Slider` has increased color contrast in Enterprise themes (SUI-6259).
11
+ * `JSONTree` will no longer crash when the `json` prop changes (SUI-6182).
12
+ * `Multiselect`'s options are no longer clickable when they are fading out (SUI-5901).
13
+ * `Multiselect`'s options are shown again when clicking after being previously dismissed with ESC key (SUI-6128).
14
+ * `TabBar` now correctly handles focus when `Tab` children are reordered (SUI-6599).
15
+
16
+ Deprecations:
17
+ * `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).
18
+
4
19
  4.35.0 - August 26, 2024
5
20
  ----------
6
21
  New Features:
7
22
  * `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
23
  * `Menu.Item` now supports a new `"dimmed"` value for the `disabled` prop (SUI-5671).
9
24
  * `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.
25
+ * Refactored uses of styled-components `withComponent` functionality to increase compatibility with styled-components v6 where it will no longer be available (SUI-6285).
26
+ * `Search.Option` now supports the `onClick`, `to`, and `openInNewContext` props (SUI-5249).
11
27
 
12
28
  Bug Fixes:
13
29
  * `Button` with `inline={false}` now aligns correctly with text when set to `display: inline-block` (SUI-6472).
14
30
  * `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).
31
+ * `Text`'s non-clickable adornments now shows focus on the input when clicked (SUI-5199).
16
32
  * 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.
33
+ * Note `@splunk/themes@0.21.0` should be used to ensure contrast requirements are met.
18
34
  * `Message`'s remove button styling for focus and hover states has been corrected (SUI-6520).
19
35
 
20
36
  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/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,