@splunk/react-ui 5.6.0 → 5.7.1

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/Menu.js CHANGED
@@ -103,11 +103,11 @@
103
103
  componentId: "sc-4kc053-1"
104
104
  })([ "", ";display:flex;align-self:flex-start;align-items:center;float:right;padding-left:", ";max-width:50%;min-height:20px;text-align:right;" ], y, p.variables.spacingLarge);
105
105
  var w = (0, c.css)([ "", " flex:0 0 auto;& > svg{height:20px;}" ], p.mixins.reset("inline-flex"));
106
- var O = u().div.withConfig({
106
+ var k = u().div.withConfig({
107
107
  displayName: "ItemStyles__StyledItemSelectedAdornment",
108
108
  componentId: "sc-4kc053-2"
109
109
  })([ "", ";padding-left:", ";align-items:flex-start;color:", ";" ], w, p.variables.spacingLarge, p.variables.contentColorActive);
110
- var k = u().span.withConfig({
110
+ var O = u().span.withConfig({
111
111
  displayName: "ItemStyles__StyledItemAdornment",
112
112
  componentId: "sc-4kc053-3"
113
113
  })([ "", ";", " padding-right:", ";align-items:center;color:", ";" ], w, (function(e) {
@@ -139,7 +139,7 @@
139
139
  var t = e.$selected, r = e.$active;
140
140
  return t && (0, c.css)([ "font-weight:", ";", "" ], p.variables.fontWeightSemiBold, r && (0,
141
141
  c.css)([ "font-weight:", ";" ], p.variables.fontWeightBold));
142
- }), p.variables.focusShadowInset, p.variables.interactiveColorOverlayHover, p.variables.contentColorDisabled, /* sc-sel */ h, /* sc-sel */ S, /* sc-sel */ O, /* sc-sel */ k, p.variables.contentColorDisabled);
142
+ }), p.variables.focusShadowInset, p.variables.interactiveColorOverlayHover, p.variables.contentColorDisabled, /* sc-sel */ h, /* sc-sel */ S, /* sc-sel */ k, /* sc-sel */ O, p.variables.contentColorDisabled);
143
143
  var I = u().span.withConfig({
144
144
  displayName: "ItemStyles__StyledInnerWrapper",
145
145
  componentId: "sc-4kc053-6"
@@ -426,7 +426,7 @@
426
426
  openInNewContext: l().oneOfType([ l().bool, l().string ]),
427
427
  /** @private */
428
428
  preventFocus: l().bool,
429
- role: l().oneOf([ "menuitem", "menuitemradio", "menuitemcheckbox", "listboxitem", "option" ]),
429
+ role: l().oneOf([ "menuitem", "menuitemradio", "menuitemcheckbox", "listboxitem", "link", "option" ]),
430
430
  selectable: l().bool,
431
431
  selectableAppearance: l().oneOf([ "checkmark", "checkbox" ]),
432
432
  selected: l().oneOfType([ l().bool, l().oneOf([ "some" ]) ]),
@@ -497,7 +497,7 @@
497
497
  }
498
498
  var Q = l && c === "right";
499
499
  var U = l && !Q;
500
- var Y = q && N === "checkmark" && n().createElement(O, null, n().createElement(ne(), {
500
+ var Y = q && N === "checkmark" && n().createElement(k, null, n().createElement(ne(), {
501
501
  "data-test": "selected-checkmark",
502
502
  inline: true
503
503
  }));
@@ -531,7 +531,7 @@
531
531
  checked: q === "some" ? "indeterminate" : q,
532
532
  disabled: !!u,
533
533
  inert: true
534
- }), $ && n().createElement(k, null, $), n().createElement(E, {
534
+ }), $ && n().createElement(O, null, $), n().createElement(E, {
535
535
  $descriptionBottom: !!U,
536
536
  $truncate: R !== null && R !== void 0 ? R : false
537
537
  }, n().createElement(_, {
@@ -541,7 +541,7 @@
541
541
  "data-test": "description"
542
542
  }, l), Q && n().createElement(S, {
543
543
  "data-test": "description"
544
- }, l)), d && n().createElement(k, {
544
+ }, l)), d && n().createElement(O, {
545
545
  endAdornment: d
546
546
  }, d), Y));
547
547
  }
@@ -551,18 +551,18 @@
551
551
  // only for styled components using Item
552
552
  // CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
553
553
  const we = require("@splunk/react-ui/Scroll");
554
- var Oe = e.n(we);
554
+ var ke = e.n(we);
555
555
  // CONCATENATED MODULE: ./src/Menu/MenuStyles.ts
556
- var ke = (0, c.css)([ "border-top:1px solid ", ";" ], p.variables.borderColor);
557
- var xe = (0, c.css)([ "", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;padding:", " 0;&:focus{outline:0;box-shadow:", ";background:", ";}& + &{", "}" ], p.mixins.reset("block"), p.variables.backgroundColorPopup, p.variables.borderRadius, p.variables.spacingSmall, p.variables.focusShadowInset, p.variables.interactiveColorOverlayHover, ke);
556
+ var Oe = (0, c.css)([ "border-top:1px solid ", ";" ], p.variables.borderColor);
557
+ var xe = (0, c.css)([ "", ";background-color:", ";border-radius:", ";min-width:60px;overflow:auto;position:relative;padding:", " 0;&:focus{outline:0;box-shadow:", ";background:", ";}& + &{", "}" ], p.mixins.reset("block"), p.variables.backgroundColorPopup, p.variables.borderRadius, p.variables.spacingSmall, p.variables.focusShadowInset, p.variables.interactiveColorOverlayHover, Oe);
558
558
  var Ce = u().div.withConfig({
559
559
  displayName: "MenuStyles__Styled",
560
560
  componentId: "sc-1olffp9-0"
561
561
  })([ "", "" ], xe);
562
- var Ie = u()(Oe()).withConfig({
562
+ var Ie = u()(ke()).withConfig({
563
563
  displayName: "MenuStyles__StyledScroll",
564
564
  componentId: "sc-1olffp9-1"
565
- })([ "", " ", " + &,& + ", "{", "}" ], xe, /* sc-sel */ Ce, /* sc-sel */ Ce, ke);
565
+ })([ "", " ", " + &,& + ", "{", "}" ], xe, /* sc-sel */ Ce, /* sc-sel */ Ce, Oe);
566
566
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
567
567
  /**
568
568
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
package/Multiselect.js CHANGED
@@ -130,6 +130,9 @@
130
130
  description: i().string,
131
131
  descriptionPosition: i().oneOf([ "right", "bottom" ]),
132
132
  disabled: i().bool,
133
+ /**
134
+ * @private Undocumented due to limitations in supporting in compact `Multiselect` (see SUI-8286 notes for more info).
135
+ */
133
136
  elementRef: i().oneOfType([ i().func, i().object ]),
134
137
  hidden: i().bool,
135
138
  icon: i().node,
package/Slider.js CHANGED
@@ -782,6 +782,7 @@
782
782
  onFocus: ge,
783
783
  ref: Ce,
784
784
  role: "slider",
785
+ type: "button",
785
786
  disabled: i,
786
787
  $thumbPosition: Ve,
787
788
  $stepWidth: Be,
package/TransitionOpen.js CHANGED
@@ -9,26 +9,26 @@
9
9
  /******/ (() => {
10
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
11
11
  /******/ e.n = t => {
12
- /******/ var r = t && t.__esModule ?
12
+ /******/ var n = t && t.__esModule ?
13
13
  /******/ () => t["default"]
14
14
  /******/ : () => t
15
15
  /******/;
16
- e.d(r, {
17
- a: r
16
+ e.d(n, {
17
+ a: n
18
18
  });
19
- /******/ return r;
19
+ /******/ return n;
20
20
  /******/ };
21
21
  /******/ })();
22
22
  /******/
23
23
  /******/ /* webpack/runtime/define property getters */
24
24
  /******/ (() => {
25
25
  /******/ // define getter functions for harmony exports
26
- /******/ e.d = (t, r) => {
27
- /******/ for (var n in r) {
28
- /******/ if (e.o(r, n) && !e.o(t, n)) {
29
- /******/ Object.defineProperty(t, n, {
26
+ /******/ e.d = (t, n) => {
27
+ /******/ for (var r in n) {
28
+ /******/ if (e.o(n, r) && !e.o(t, r)) {
29
+ /******/ Object.defineProperty(t, r, {
30
30
  enumerable: true,
31
- get: r[n]
31
+ get: n[r]
32
32
  });
33
33
  /******/ }
34
34
  /******/ }
@@ -64,8 +64,8 @@
64
64
  default: () => /* reexport */ H
65
65
  });
66
66
  // CONCATENATED MODULE: external "react"
67
- const r = require("react");
68
- var n = e.n(r);
67
+ const n = require("react");
68
+ var r = e.n(n);
69
69
  // CONCATENATED MODULE: external "prop-types"
70
70
  const o = require("prop-types");
71
71
  var i = e.n(o);
@@ -128,9 +128,9 @@
128
128
  function g() {
129
129
  return g = Object.assign ? Object.assign.bind() : function(e) {
130
130
  for (var t = 1; t < arguments.length; t++) {
131
- var r = arguments[t];
132
- for (var n in r) {
133
- ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
131
+ var n = arguments[t];
132
+ for (var r in n) {
133
+ ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
134
134
  }
135
135
  }
136
136
  return e;
@@ -145,32 +145,32 @@
145
145
  function j(e, t) {
146
146
  if (e) {
147
147
  if ("string" == typeof e) return w(e, t);
148
- var r = {}.toString.call(e).slice(8, -1);
149
- 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) ? w(e, t) : void 0;
148
+ var n = {}.toString.call(e).slice(8, -1);
149
+ return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? w(e, t) : void 0;
150
150
  }
151
151
  }
152
152
  function w(e, t) {
153
153
  (null == t || t > e.length) && (t = e.length);
154
- for (var r = 0, n = Array(t); r < t; r++) {
155
- n[r] = e[r];
154
+ for (var n = 0, r = Array(t); n < t; n++) {
155
+ r[n] = e[n];
156
156
  }
157
- return n;
157
+ return r;
158
158
  }
159
159
  function P(e, t) {
160
- var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
161
- if (null != r) {
162
- var n, o, i, a, u = [], l = !0, s = !1;
160
+ var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
161
+ if (null != n) {
162
+ var r, o, i, a, u = [], l = !0, s = !1;
163
163
  try {
164
- if (i = (r = r.call(e)).next, 0 === t) {
165
- if (Object(r) !== r) return;
164
+ if (i = (n = n.call(e)).next, 0 === t) {
165
+ if (Object(n) !== n) return;
166
166
  l = !1;
167
- } else for (;!(l = (n = i.call(r)).done) && (u.push(n.value), u.length !== t); l = !0) {
167
+ } else for (;!(l = (r = i.call(n)).done) && (u.push(r.value), u.length !== t); l = !0) {
168
168
  }
169
169
  } catch (e) {
170
170
  s = !0, o = e;
171
171
  } finally {
172
172
  try {
173
- if (!l && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
173
+ if (!l && null != n["return"] && (a = n["return"](), Object(a) !== a)) return;
174
174
  } finally {
175
175
  if (s) throw o;
176
176
  }
@@ -181,56 +181,56 @@
181
181
  function k(e) {
182
182
  if (Array.isArray(e)) return e;
183
183
  }
184
- function F(e, t) {
184
+ function x(e, t) {
185
185
  if (null == e) return {};
186
- var r, n, o = x(e, t);
186
+ var n, r, o = C(e, t);
187
187
  if (Object.getOwnPropertySymbols) {
188
188
  var i = Object.getOwnPropertySymbols(e);
189
- for (n = 0; n < i.length; n++) {
190
- r = i[n], -1 === t.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
189
+ for (r = 0; r < i.length; r++) {
190
+ n = i[r], -1 === t.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
191
191
  }
192
192
  }
193
193
  return o;
194
194
  }
195
- function x(e, t) {
195
+ function C(e, t) {
196
196
  if (null == e) return {};
197
- var r = {};
198
- for (var n in e) {
199
- if ({}.hasOwnProperty.call(e, n)) {
200
- if (-1 !== t.indexOf(n)) continue;
201
- r[n] = e[n];
197
+ var n = {};
198
+ for (var r in e) {
199
+ if ({}.hasOwnProperty.call(e, r)) {
200
+ if (-1 !== t.indexOf(r)) continue;
201
+ n[r] = e[r];
202
202
  }
203
203
  }
204
- return r;
204
+ return n;
205
205
  }
206
- function C(e, t) {
207
- var r = Object.keys(e);
206
+ function F(e, t) {
207
+ var n = Object.keys(e);
208
208
  if (Object.getOwnPropertySymbols) {
209
- var n = Object.getOwnPropertySymbols(e);
210
- t && (n = n.filter((function(t) {
209
+ var r = Object.getOwnPropertySymbols(e);
210
+ t && (r = r.filter((function(t) {
211
211
  return Object.getOwnPropertyDescriptor(e, t).enumerable;
212
- }))), r.push.apply(r, n);
212
+ }))), n.push.apply(n, r);
213
213
  }
214
- return r;
214
+ return n;
215
215
  }
216
216
  function N(e) {
217
217
  for (var t = 1; t < arguments.length; t++) {
218
- var r = null != arguments[t] ? arguments[t] : {};
219
- t % 2 ? C(Object(r), !0).forEach((function(t) {
220
- A(e, t, r[t]);
221
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : C(Object(r)).forEach((function(t) {
222
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
218
+ var n = null != arguments[t] ? arguments[t] : {};
219
+ t % 2 ? F(Object(n), !0).forEach((function(t) {
220
+ A(e, t, n[t]);
221
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : F(Object(n)).forEach((function(t) {
222
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
223
223
  }));
224
224
  }
225
225
  return e;
226
226
  }
227
- function A(e, t, r) {
227
+ function A(e, t, n) {
228
228
  return (t = T(t)) in e ? Object.defineProperty(e, t, {
229
- value: r,
229
+ value: n,
230
230
  enumerable: !0,
231
231
  configurable: !0,
232
232
  writable: !0
233
- }) : e[t] = r, e;
233
+ }) : e[t] = n, e;
234
234
  }
235
235
  function T(e) {
236
236
  var t = E(e, "string");
@@ -238,10 +238,10 @@
238
238
  }
239
239
  function E(e, t) {
240
240
  if ("object" != h(e) || !e) return e;
241
- var r = e[Symbol.toPrimitive];
242
- if (void 0 !== r) {
243
- var n = r.call(e, t || "default");
244
- if ("object" != h(n)) return n;
241
+ var n = e[Symbol.toPrimitive];
242
+ if (void 0 !== n) {
243
+ var r = n.call(e, t || "default");
244
+ if ("object" != h(r)) return r;
245
245
  throw new TypeError("@@toPrimitive must return a primitive value.");
246
246
  }
247
247
  return ("string" === t ? String : Number)(e);
@@ -266,40 +266,40 @@
266
266
  takeFocus: i().bool
267
267
  };
268
268
  var q = function e(t) {
269
- var r;
269
+ var n;
270
270
  switch (t) {
271
271
  case "slideFromTop":
272
272
  case "slideFromBottom":
273
273
  case "expandHeight":
274
274
  case "none":
275
- r = "height";
275
+ n = "height";
276
276
  break;
277
277
 
278
278
  case "slideFromLeft":
279
279
  case "slideFromRight":
280
280
  case "expandWidth":
281
- r = "width";
281
+ n = "width";
282
282
  break;
283
283
 
284
284
  default:
285
285
  // Intentionally left empty.
286
286
  }
287
- return r;
287
+ return n;
288
288
  };
289
289
  var M = function e(t) {
290
- var r = t.animation, n = t.open, o = t.value;
290
+ var n = t.animation, r = t.open, o = t.value;
291
291
  var i = {
292
- value: n ? o : 0
292
+ value: r ? o : 0
293
293
  };
294
294
  var a = {
295
- value: n ? 0 : o
295
+ value: r ? 0 : o
296
296
  };
297
297
  var u = {
298
298
  precision: 1
299
299
  };
300
300
  // Only use precision when not using transform, otherwise transform animation will break
301
301
  // Expansion doesn't require a valid value; the subsequent render animates it.
302
- if (r === "expandWidth" || r === "expandHeight" || r === "none") {
302
+ if (n === "expandWidth" || n === "expandHeight" || n === "none") {
303
303
  return {
304
304
  to: i,
305
305
  config: u
@@ -309,7 +309,7 @@
309
309
  if (!o) {
310
310
  return null;
311
311
  }
312
- if (r !== "slideFromTop" && r !== "slideFromLeft") {
312
+ if (n !== "slideFromTop" && n !== "slideFromLeft") {
313
313
  // Return the standard transition if not using a transform.
314
314
  return {
315
315
  to: i,
@@ -319,9 +319,9 @@
319
319
  }
320
320
  // The top and left directions require an additional transform of their inner content to match the outer dimension animation.
321
321
  // This is needed to achieve a clipping effect from the outer div, rather than the consumer providing their own.
322
- var l = r === "slideFromTop" ? "Y" : "X";
323
- var s = "translate".concat(l, "(").concat(n ? 0 : -o, "px)");
324
- var c = "translate".concat(l, "(").concat(n ? -o : 0, "px)");
322
+ var l = n === "slideFromTop" ? "Y" : "X";
323
+ var s = "translate".concat(l, "(").concat(r ? 0 : -o, "px)");
324
+ var c = "translate".concat(l, "(").concat(r ? -o : 0, "px)");
325
325
  return {
326
326
  to: N({
327
327
  transform: s
@@ -331,21 +331,21 @@
331
331
  }, a)
332
332
  };
333
333
  };
334
- var W = function e(t) {
335
- var r = t.animation, n = t.el, o = t.takeFocusProp;
334
+ var _ = function e(t) {
335
+ var n = t.animation, r = t.el, o = t.takeFocusProp;
336
336
  var i = 0;
337
- if (n) {
337
+ if (r) {
338
338
  if (o) {
339
- (0, s.takeFocus)(n, "container");
339
+ (0, s.takeFocus)(r, "container");
340
340
  }
341
- var a = q(r);
341
+ var a = q(n);
342
342
  switch (a) {
343
343
  case "height":
344
- i = n.offsetHeight;
344
+ i = r.offsetHeight;
345
345
  break;
346
346
 
347
347
  case "width":
348
- i = n.offsetWidth;
348
+ i = r.offsetWidth;
349
349
  break;
350
350
 
351
351
  default:
@@ -354,24 +354,26 @@
354
354
  }
355
355
  return i;
356
356
  };
357
- var _ = {};
358
357
  var R = {};
358
+ var W = {};
359
359
  function D(e) {
360
- var t = e.animation, o = t === void 0 ? "expandHeight" : t, i = e.animateOnMount, u = e.children, f = e.className, d = e.elementRef, m = e.id, p = e.innerClassName, h = e.innerStyle, S = h === void 0 ? _ : h, j = e.onAnimationEnd, w = e.onAnimationStart, P = e.open, k = e.outerClassName, x = e.outerId, C = e.outerStyle, T = C === void 0 ? R : C, E = e.renderChildrenWhenCollapsed, I = e.retainFocus, D = e.takeFocus, H = F(e, [ "animation", "animateOnMount", "children", "className", "elementRef", "id", "innerClassName", "innerStyle", "onAnimationEnd", "onAnimationStart", "open", "outerClassName", "outerId", "outerStyle", "renderChildrenWhenCollapsed", "retainFocus", "takeFocus" ]);
360
+ var t = e.animation, o = t === void 0 ? "expandHeight" : t, i = e.animateOnMount, u = e.children, f = e.className, d = e.elementRef, m = e.id, p = e.innerClassName, h = e.innerStyle, S = h === void 0 ? R : h, j = e.onAnimationEnd, w = e.onAnimationStart, P = e.open, k = e.outerClassName, C = e.outerId, F = e.outerStyle, T = F === void 0 ? W : F, E = e.renderChildrenWhenCollapsed, I = e.retainFocus, D = e.takeFocus, H = x(e, [ "animation", "animateOnMount", "children", "className", "elementRef", "id", "innerClassName", "innerStyle", "onAnimationEnd", "onAnimationStart", "open", "outerClassName", "outerId", "outerStyle", "renderChildrenWhenCollapsed", "retainFocus", "takeFocus" ]);
361
361
  // @docs-props-type TransitionOpenPropsBase
362
362
  var L = l()(P);
363
- var $ = (0, r.useRef)(true);
364
- var B = (0, r.useState)(i ? P : false), K = O(B, 2), U = K[0], X = K[1];
365
- var Y = (0, r.useState)(null), z = O(Y, 2), G = z[0], J = z[1];
366
- var Q = (0, r.useState)(0), V = O(Q, 2), Z = V[0], ee = V[1];
367
- (0, r.useEffect)((function() {
363
+ var $ = (0, n.useRef)(true);
364
+ var B = (0, n.useState)(i ? P : false), K = O(B, 2), U = K[0], X = K[1];
365
+ var Y = (0, n.useState)(null), z = O(Y, 2), G = z[0], J = z[1];
366
+ var Q = (0, n.useState)(0), V = O(Q, 2), Z = V[0], ee = V[1];
367
+ var te = (0, n.useState)(P), ne = O(te, 2), re = ne[0], oe = ne[1];
368
+ (0, n.useLayoutEffect)((function() {
368
369
  // prevOpen starts undefined, and we don't want to make the comparison in that situation
369
370
  if (L !== undefined && P !== L) {
370
371
  X(true);
372
+ oe(P);
371
373
  }
372
374
  }), [ P, L ]);
373
375
  // equivalent to componentDidMount and componentWillUnmount
374
- (0, r.useEffect)((function() {
376
+ (0, n.useEffect)((function() {
375
377
  // we need to set this to true on every mount because React.StrictMode will call the effect twice
376
378
  // and we need to ensure that allowAnimationUpdates is true while the component is mounted
377
379
  $.current = true;
@@ -379,70 +381,68 @@
379
381
  $.current = false;
380
382
  };
381
383
  }), []);
382
- var te = (0, r.useCallback)((function(e) {
384
+ var ie = (0, n.useCallback)((function(e) {
383
385
  J(e);
384
- ee(W({
386
+ ee(_({
385
387
  animation: o,
386
388
  el: e,
387
389
  takeFocusProp: D
388
390
  }));
389
391
  b(d, e);
390
392
  }), [ o, D, d ]);
391
- var re = (0, r.useCallback)((function() {
393
+ var ae = (0, n.useCallback)((function() {
392
394
  w === null || w === void 0 ? void 0 : w();
393
395
  }), [ w ]);
394
- var ne = (0, r.useCallback)((function() {
396
+ var ue = (0, n.useCallback)((function() {
395
397
  if ($.current) {
396
398
  X(false);
397
399
  }
398
400
  j === null || j === void 0 ? void 0 : j();
399
401
  }), [ j ]);
400
- var oe = (0, r.useCallback)((function(e) {
402
+ var le = (0, n.useCallback)((function(e) {
401
403
  if (G) {
402
404
  (0, s.handleTab)(G, e);
403
405
  }
404
406
  }), [ G ]);
405
- var ie = (0, a.useAnimation)(N(N({}, M({
407
+ var se = (0, a.useAnimation)(N(N({}, M({
406
408
  animation: o,
407
- open: P,
409
+ open: re,
408
410
  value: Z
409
411
  })), {}, {
410
412
  immediate: o === "none",
411
- onRest: ne,
412
- onStart: re
413
- })), ae = ie.value, ue = ie.transform;
414
- var le;
415
- /* to avoid setting and unsetting dimension which causes flickering
416
- we always set the dimension if it is a slide animation
417
- else only set it when animating || renderChildrenWhenCollapsed */ if (o.startsWith("slideFrom") || U || E) {
418
- le = q(o);
413
+ onRest: ue,
414
+ onStart: ae
415
+ })), ce = se.value, fe = se.transform;
416
+ var de;
417
+ if (U || E) {
418
+ de = q(o);
419
419
  }
420
420
  // if renderChildrenWhenCollapsed is true, we hide the content by setting the height of the wrapper to 0
421
- var se = E && !P && !U ? 0 : ae;
422
- var ce = (0, r.useMemo)((function() {
423
- return N(N({}, T), le && A({}, le, se));
424
- }), [ le, se, T ]);
425
- var fe = (0, r.useMemo)((function() {
421
+ var me = E && !re && !U ? 0 : ce;
422
+ var pe = (0, n.useMemo)((function() {
423
+ return N(N({}, T), de && A({}, de, me));
424
+ }), [ de, me, T ]);
425
+ var ve = (0, n.useMemo)((function() {
426
426
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
427
427
  return N(N({}, S), {}, {
428
- transform: ue
428
+ transform: fe
429
429
  });
430
- }), [ S, ue ]);
430
+ }), [ S, fe ]);
431
431
 
432
- return n().createElement(v, {
433
- $hideOverflow: !P || U || false,
432
+ return r().createElement(v, {
433
+ $hideOverflow: !re || U || false,
434
434
  className: (0, c.toClassName)(f, k),
435
- style: ce,
436
- id: x
437
- }, (P || U || E) && n().createElement(y, g({
435
+ style: pe,
436
+ id: C
437
+ }, (re || U || E) && r().createElement(y, g({
438
438
  "data-test": "transition-open"
439
439
  }, H, {
440
- ref: te,
440
+ ref: ie,
441
441
  tabIndex: -1,
442
442
  className: p,
443
443
  id: m,
444
- onKeyDown: I ? oe : undefined,
445
- style: fe
444
+ onKeyDown: I ? le : undefined,
445
+ style: ve
446
446
  }), u));
447
447
  }
448
448
  D.propTypes = I;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "5.6.0",
3
+ "version": "5.7.1",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -45,7 +45,7 @@
45
45
  "@dnd-kit/sortable": "^8.0.0",
46
46
  "@dnd-kit/utilities": "^3.2.2",
47
47
  "@react-spring/web": "^9.7.5",
48
- "@splunk/react-icons": "^5.6.0",
48
+ "@splunk/react-icons": "^5.7.0",
49
49
  "@splunk/themes": "^1.4.1",
50
50
  "@splunk/ui-utils": "^1.12.0",
51
51
  "decimal.js-light": "^2.5.1",
@@ -63,7 +63,7 @@
63
63
  "@babel/core": "^7.28.0",
64
64
  "@babel/plugin-transform-runtime": "^7.28.0",
65
65
  "@splunk/babel-preset": "^4.0.0",
66
- "@splunk/docs-gen": "^1.2.0",
66
+ "@splunk/docs-gen": "^1.3.0",
67
67
  "@splunk/eslint-config": "^5.0.0",
68
68
  "@splunk/react-docs": "^1.4.0",
69
69
  "@splunk/stylelint-config": "^5.0.0",
@@ -50,11 +50,11 @@ interface ButtonPropsBase {
50
50
  * its container. */
51
51
  inline?: boolean;
52
52
  /**
53
- * Displays the chevron-down icon to indicate that the button behaves as a menu.
53
+ * Uses interactive styling and adds the chevron-down icon to indicate menu behavior.
54
54
  *
55
- * To meet accessibility requirements, this prop should be used together with the `Dropdown` component.
56
- *
57
- * If `Dropdown` is not used, this prop should be used together with `aria-controls` and `aria-expanded`.
55
+ * **Accessibility:** This prop should be used with the `Dropdown` component, which manages
56
+ * the required `aria-controls` and `aria-expanded` attributes. If not using `Dropdown`,
57
+ * you must manually provide these ARIA attributes.
58
58
  */
59
59
  isMenu?: boolean;
60
60
  /**
@@ -28,9 +28,7 @@ interface ButtonSimplePropsBase {
28
28
  */
29
29
  elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
30
30
  /**
31
- * Converts the component from an action element (Button) into a control element (toggle).
32
- * When `isMenu` is set to `true`, the styles of the default or subtle appearances are overridden
33
- * to adapt the Button for use as a toggle for Dropdown/Select.
31
+ * Uses interactive styling for menu toggle behavior.
34
32
  */
35
33
  isMenu?: boolean;
36
34
  /** Opens the 'to' link in a new tab. */
@@ -30,6 +30,10 @@ interface HeaderPropsBase {
30
30
  * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
31
31
  */
32
32
  elementRef?: React.Ref<HTMLDivElement>;
33
+ /**
34
+ * The icon to show before the title.
35
+ */
36
+ icon?: React.ReactNode;
33
37
  /**
34
38
  * Used as the subheading.
35
39
  */
@@ -57,7 +61,7 @@ type HeaderProps = ComponentProps<HeaderWithActions | HeaderWithActionsRenderPro
57
61
  /**
58
62
  * A styled container for `Card` header content.
59
63
  */
60
- declare function Header({ actions, actionPrimary, actionsSecondary, anchor, children, subtitle, title, truncateTitle, ...otherProps }: HeaderProps): React.JSX.Element;
64
+ declare function Header({ actions, actionPrimary, actionsSecondary, anchor, children, icon, subtitle, title, truncateTitle, ...otherProps }: HeaderProps): React.JSX.Element;
61
65
  declare namespace Header {
62
66
  var propTypes: {
63
67
  actionPrimary: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -65,6 +69,7 @@ declare namespace Header {
65
69
  anchor: PropTypes.Requireable<string>;
66
70
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
67
71
  elementRef: PropTypes.Requireable<object>;
72
+ icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
68
73
  subtitle: PropTypes.Requireable<PropTypes.ReactNodeLike>;
69
74
  title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
70
75
  truncateTitle: PropTypes.Requireable<boolean>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ /**
3
+ * @name Card with icon
4
+ * @description A Card can have an icon in the header.
5
+ */
6
+ declare function WithIcon(): React.JSX.Element;
7
+ export default WithIcon;
@@ -30,6 +30,7 @@ interface OptionPropsBase {
30
30
  */
31
31
  disabled?: boolean;
32
32
  /**
33
+ * @private Undocumented due to limitations in supporting in compact `Multiselect` (see SUI-8286 notes for more info).
33
34
  * A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
34
35
  */
35
36
  elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
@@ -99,6 +100,9 @@ declare namespace Option {
99
100
  description: PropTypes.Requireable<string>;
100
101
  descriptionPosition: PropTypes.Requireable<string>;
101
102
  disabled: PropTypes.Requireable<boolean>;
103
+ /**
104
+ * @private Undocumented due to limitations in supporting in compact `Multiselect` (see SUI-8286 notes for more info).
105
+ */
102
106
  elementRef: PropTypes.Requireable<object>;
103
107
  hidden: PropTypes.Requireable<boolean>;
104
108
  icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;