@splunk/react-ui 4.33.0 → 4.34.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 (58) hide show
  1. package/Button.js +19 -22
  2. package/ButtonGroup.js +20 -23
  3. package/ButtonSimple.js +33 -34
  4. package/CHANGELOG.md +31 -0
  5. package/Card.js +56 -44
  6. package/Chip.js +2 -6
  7. package/CollapsiblePanel.js +281 -264
  8. package/Color.js +88 -86
  9. package/Concertina.js +7 -7
  10. package/ControlGroup.js +18 -18
  11. package/DualListbox.js +8 -11
  12. package/File.js +25 -30
  13. package/FormRows.js +53 -53
  14. package/Image.js +13 -13
  15. package/JSONTree.js +22 -22
  16. package/MIGRATION.mdx +76 -0
  17. package/Markdown.js +12 -12
  18. package/Menu.js +505 -719
  19. package/Message.js +205 -204
  20. package/MessageBar.js +104 -104
  21. package/Modal.js +2 -2
  22. package/Multiselect.js +36 -39
  23. package/Paginator.js +8 -8
  24. package/Popover.js +53 -54
  25. package/Progress.js +45 -46
  26. package/RadioBar.js +117 -115
  27. package/RadioList.js +8 -5
  28. package/ResultsMenu.js +256 -261
  29. package/Search.js +21 -24
  30. package/Select.js +34 -31
  31. package/Slider.js +9 -9
  32. package/SplitButton.js +1 -4
  33. package/StaticContent.js +1 -1
  34. package/StepBar.js +1 -1
  35. package/Switch.js +169 -171
  36. package/TabBar.js +13 -5
  37. package/Table.js +65 -67
  38. package/Text.js +17 -26
  39. package/TextArea.js +162 -163
  40. package/Tooltip.js +1 -1
  41. package/package.json +5 -5
  42. package/stubs-splunkui.d.ts +11 -0
  43. package/types/src/Card/Card.d.ts +3 -1
  44. package/types/src/Card/Header.d.ts +22 -3
  45. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +5 -0
  46. package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +1 -3
  47. package/types/src/Menu/Item.d.ts +3 -0
  48. package/types/src/Menu/Menu.d.ts +16 -21
  49. package/types/src/Menu/MenuContext.d.ts +3 -2
  50. package/types/src/RadioBar/Option.d.ts +4 -1
  51. package/types/src/RadioBar/RadioBar.d.ts +6 -4
  52. package/types/src/RadioBar/docs/examples/MenuBar.d.ts +2 -0
  53. package/types/src/ResultsMenu/ResultsMenu.d.ts +5 -22
  54. package/types/src/Select/Select.d.ts +2 -2
  55. package/types/src/Select/SelectBase.d.ts +2 -2
  56. package/types/src/Table/Body.d.ts +0 -4
  57. package/useRovingFocus.js +26 -40
  58. package/types/src/Select/docs/examples/prisma/Appearance.d.ts +0 -14
package/Button.js CHANGED
@@ -85,7 +85,7 @@
85
85
  // CONCATENATED MODULE: external "@splunk/themes"
86
86
  const m = require("@splunk/themes");
87
87
  // CONCATENATED MODULE: ./src/Button/ButtonStyles.ts
88
- var v = u().span.withConfig({
88
+ var y = u().span.withConfig({
89
89
  displayName: "ButtonStyles__StyledIcon",
90
90
  componentId: "eqxqs2-0"
91
91
  })([ "display:flex;align-items:center;flex-shrink:0;font-size:", ";", "" ], (0,
@@ -101,7 +101,7 @@
101
101
  prisma: (0, p.css)([ "padding-right:8px;" ])
102
102
  }
103
103
  }));
104
- var y = u()(d()).withConfig({
104
+ var v = u()(d()).withConfig({
105
105
  displayName: "ButtonStyles__StyledButtonSimple",
106
106
  componentId: "eqxqs2-1"
107
107
  })([ "text-decoration:none;white-space:nowrap;flex-grow:1;min-width:0;max-width:100%;line-height:", ";min-height:", ";padding:", ";", " ", " &[data-inline]{:where(:not(a)){display:inline-block;}:where(a){display:inline-flex;}vertical-align:middle;", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}" ], m.variables.lineHeight, m.variables.inputHeight, (0,
@@ -125,15 +125,15 @@
125
125
  return !t && !n && !r && (0, p.css)([ "width:100%;" ]);
126
126
  }), (function(e) {
127
127
  var t = e.$isIconOnly;
128
- return t && (0, p.css)([ "box-sizing:border-box;padding:", ";width:", ";min-width:", ";" ], (0,
128
+ return t && (0, p.css)([ "box-sizing:border-box;", ";width:", ";min-width:", ";" ], (0,
129
129
  m.pick)({
130
130
  enterprise: {
131
- comfortable: "0 5px",
132
- compact: "0 2px"
131
+ comfortable: (0, p.css)([ "padding:0 5px;" ]),
132
+ compact: (0, p.css)([ "padding:0 2px;" ])
133
133
  },
134
134
  prisma: {
135
- comfortable: (0, p.css)([ "0px calc(", " / 2 - 1px)" ], m.variables.inputHeight),
136
- compact: (0, p.css)([ "0px calc(", " / 2 - 1px)" ], m.variables.inputHeight)
135
+ comfortable: (0, p.css)([ "padding:0 calc(", " / 2 - 1px);" ], m.variables.inputHeight),
136
+ compact: (0, p.css)([ "padding:0 calc(", " / 2 - 1px);" ], m.variables.inputHeight)
137
137
  }
138
138
  }), m.variables.inputHeight, m.variables.inputHeight);
139
139
  }), (function(e) {
@@ -141,10 +141,7 @@
141
141
  return t ? null : (0, p.css)([ "width:auto;" ]);
142
142
  }), (function(e) {
143
143
  var t = e.prepend;
144
- return !t && (0, p.css)([ "margin-left:", ";" ], (0, m.pick)({
145
- enterprise: m.variables.spacingHalf,
146
- prisma: m.variables.spacingSmall
147
- }));
144
+ return !t && (0, p.css)([ "margin-left:", ";" ], m.variables.spacingSmall);
148
145
  }));
149
146
  var b = u().span.withConfig({
150
147
  displayName: "ButtonStyles__StyledContentWrapper",
@@ -201,9 +198,9 @@
201
198
  true: (0, p.css)([ "color:", ";" ], m.variables.contentColorInverted),
202
199
  false: (0, p.css)([ "color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}" ], m.variables.contentColorDefault,
203
200
  /* sc-sel */
204
- y,
201
+ v,
205
202
  /* sc-sel */
206
- y, m.variables.contentColorDefault)
203
+ v, m.variables.contentColorDefault)
207
204
  })
208
205
  }
209
206
  }));
@@ -211,13 +208,13 @@
211
208
  const g = require("@splunk/react-icons/CaretSmallDown");
212
209
  var w = e.n(g);
213
210
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
214
- const k = require("@splunk/react-icons/enterprise/Caret");
215
- var S = e.n(k);
211
+ const S = require("@splunk/react-icons/enterprise/Caret");
212
+ var k = e.n(S);
216
213
  // CONCATENATED MODULE: ./src/Button/icons/CaretSmallDown.tsx
217
214
  var O = function e() {
218
215
  var t = (0, m.useSplunkTheme)(), n = t.isEnterprise, i = t.isCompact;
219
216
  var a = i ? "20px" : "24px";
220
- return n ? r().createElement(S(), {
217
+ return n ? r().createElement(k(), {
221
218
  screenReaderText: null,
222
219
  hideDefaultTooltip: true,
223
220
  size: .5
@@ -435,16 +432,16 @@
435
432
  }, {
436
433
  key: "render",
437
434
  value: function e() {
438
- var t = this.props, n = t.action, i = t.appearance, a = t.append, o = t.className, s = t.classNamePrivate, p = t.disabled, u = t.error, f = t.icon, d = t.inline, m = t.isMenu, g = t.onClick, w = t.openInNewContext, k = t.prepend, S = t.to, O = t.value;
435
+ var t = this.props, n = t.action, i = t.appearance, a = t.append, o = t.className, s = t.classNamePrivate, p = t.disabled, u = t.error, f = t.icon, d = t.inline, m = t.isMenu, g = t.onClick, w = t.openInNewContext, S = t.prepend, k = t.to, O = t.value;
439
436
  var q = this.props, $ = q.children, _ = q.label;
440
437
  if (!_ && l()($)) {
441
438
  _ = $;
442
439
  $ = null;
443
440
  }
444
441
  var I = !!(f && !_ && !m && !$);
445
- var E = S && w || m || !!f;
442
+ var E = k && w || m || !!f;
446
443
 
447
- return r().createElement(y, T({
444
+ return r().createElement(v, T({
448
445
  "aria-haspopup": m || undefined,
449
446
  "aria-invalid": u || undefined,
450
447
  "data-test": "button"
@@ -454,7 +451,7 @@
454
451
  "data-inline": d || null,
455
452
  disabled: p,
456
453
  append: a,
457
- prepend: k,
454
+ prepend: S,
458
455
  $inline: d,
459
456
  $hasPrismaIcon: E,
460
457
  $isIconOnly: I,
@@ -467,7 +464,7 @@
467
464
  }), r().createElement(b, {
468
465
  $appearance: i,
469
466
  $error: u
470
- }, f && r().createElement(v, {
467
+ }, f && r().createElement(y, {
471
468
  $isStartIcon: !I
472
469
  }, f), _ && r().createElement(h, {
473
470
  "data-test": "label",
@@ -475,7 +472,7 @@
475
472
  }, _), $, m && r().createElement(x, {
476
473
  $disabled: p,
477
474
  $primary: i === "primary"
478
- }, r().createElement(C, null)), w && r().createElement(v, {
475
+ }, r().createElement(C, null)), w && r().createElement(y, {
479
476
  $isStartIcon: false
480
477
  }, r().createElement(N, null))));
481
478
  }
package/ButtonGroup.js CHANGED
@@ -68,23 +68,20 @@
68
68
  var n = e.n(t);
69
69
  // CONCATENATED MODULE: external "prop-types"
70
70
  const o = require("prop-types");
71
- var i = e.n(o);
71
+ var l = e.n(o);
72
72
  // CONCATENATED MODULE: external "styled-components"
73
- const a = require("styled-components");
74
- var l = e.n(a);
73
+ const i = require("styled-components");
74
+ var a = e.n(i);
75
75
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
76
76
  const u = require("@splunk/react-ui/Box");
77
77
  var p = e.n(u);
78
78
  // CONCATENATED MODULE: external "@splunk/themes"
79
79
  const c = require("@splunk/themes");
80
80
  // CONCATENATED MODULE: ./src/ButtonGroup/ButtonGroupStyles.ts
81
- var s = l()(p()).withConfig({
81
+ var s = a()(p()).withConfig({
82
82
  displayName: "ButtonGroupStyles__StyledBox",
83
83
  componentId: "sc-14fs2xs-0"
84
- })([ "position:relative;[data-inline] + &{margin-left:", ";}" ], (0, c.pick)({
85
- enterprise: c.variables.spacingHalf,
86
- prisma: c.variables.spacingSmall
87
- }));
84
+ })([ "position:relative;[data-inline] + &{margin-left:", ";}" ], c.variables.spacingSmall);
88
85
  // CONCATENATED MODULE: ./src/ButtonGroup/ButtonGroup.tsx
89
86
  function f() {
90
87
  f = Object.assign || function(e) {
@@ -102,12 +99,12 @@
102
99
  }
103
100
  function d(e, r) {
104
101
  if (e == null) return {};
105
- var t = v(e, r);
102
+ var t = y(e, r);
106
103
  var n, o;
107
104
  if (Object.getOwnPropertySymbols) {
108
- var i = Object.getOwnPropertySymbols(e);
109
- for (o = 0; o < i.length; o++) {
110
- n = i[o];
105
+ var l = Object.getOwnPropertySymbols(e);
106
+ for (o = 0; o < l.length; o++) {
107
+ n = l[o];
111
108
  if (r.indexOf(n) >= 0) continue;
112
109
  if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
113
110
  t[n] = e[n];
@@ -115,28 +112,28 @@
115
112
  }
116
113
  return t;
117
114
  }
118
- function v(e, r) {
115
+ function y(e, r) {
119
116
  if (e == null) return {};
120
117
  var t = {};
121
118
  var n = Object.keys(e);
122
- var o, i;
123
- for (i = 0; i < n.length; i++) {
124
- o = n[i];
119
+ var o, l;
120
+ for (l = 0; l < n.length; l++) {
121
+ o = n[l];
125
122
  if (r.indexOf(o) >= 0) continue;
126
123
  t[o] = e[o];
127
124
  }
128
125
  return t;
129
126
  }
130
- var y = {
131
- children: i().node,
132
- elementRef: i().oneOfType([ i().func, i().object ]),
127
+ var v = {
128
+ children: l().node,
129
+ elementRef: l().oneOfType([ l().func, l().object ]),
133
130
  /** @private */
134
- flex: i().bool
131
+ flex: l().bool
135
132
  };
136
133
  function b(e) {
137
134
  var r = e.children, o = d(e, [ "children" ]);
138
135
  // @docs-props-type ButtonGroupPropsBase
139
- var i = t.Children.toArray(r).filter(t.isValidElement).map((function(e, r, n) {
136
+ var l = t.Children.toArray(r).filter(t.isValidElement).map((function(e, r, n) {
140
137
  var o = n.length;
141
138
 
142
139
  return (0, t.cloneElement)(e, {
@@ -152,9 +149,9 @@
152
149
  flex: true,
153
150
  "data-test": "button-group",
154
151
  role: "menubar"
155
- }, o), i);
152
+ }, o), l);
156
153
  }
157
- b.propTypes = y;
154
+ b.propTypes = v;
158
155
  /* harmony default export */ const m = b;
159
156
  // CONCATENATED MODULE: ./src/ButtonGroup/index.ts
160
157
  module.exports = r;
package/ButtonSimple.js CHANGED
@@ -263,7 +263,7 @@
263
263
  var t = b()(i, o), s = t.background, c = t.backgroundActive, d = t.backgroundDisabled, v = t.backgroundDisabledSelected, f = t.backgroundHover, g = t.backgroundSelected, y = t.borderColor, k = t.borderColorDisabled, m = t.color, C = t.colorDisabled;
264
264
  var x = s != null && s !== "transparent";
265
265
  return function() {
266
- return (0, n.css)([ "border-radius:", ";", ";", " ", " cursor:pointer;position:relative;&:focus,&:hover{z-index:3;}&:not([disabled],[aria-disabled='true']){background-color:", ";color:", ";transition:background-color 0.2s,box-shadow 0.2s,text-decoration 0.2s;&:hover{background-color:", ";}&:active{background-color:", ";transition:none;}", "}&:focus{box-shadow:", ";}&[disabled],&[aria-disabled='true']{border-color:", ";color:", ";cursor:not-allowed;", "}" ], l.variables.borderRadius, (function() {
266
+ return (0, n.css)([ "border-radius:", ";", ";", " ", " cursor:pointer;position:relative;&:focus,&:hover{z-index:3;}&:not([disabled],[aria-disabled='true']){background-color:", ";color:", ";transition:background-color 0.2s,box-shadow 0.2s,text-decoration 0.2s;&:hover{background-color:", ";}&:active{background-color:", ";transition:none;}", "}&:not([disabled]){&:focus{box-shadow:", ";}}&[disabled],&[aria-disabled='true']{border-color:", ";color:", ";cursor:not-allowed;", "}" ], l.variables.borderRadius, (function() {
267
267
  return y && (0, n.css)([ "border:1px solid ", ";" ], y);
268
268
  }), (function(r) {
269
269
  var e = r.$append;
@@ -282,8 +282,18 @@
282
282
  }
283
283
  /* harmony default export */ const m = k;
284
284
  // CONCATENATED MODULE: ./src/ButtonSimple/prismaStyles.ts
285
- var C = (0, n.css)([ "", " &:not([disabled],[aria-disabled='true']){&:focus{background-color:", ";}&:hover{border-color:", ";", "}", " ", "}&[disabled],&[aria-disabled='true']{", "}" ], (0,
285
+ var C = (0, n.css)([ "&:not([disabled],[aria-disabled='true']){&:focus{background-color:", ";}&:hover{border-color:", ";", "}", " ", "}", " &[disabled],&[aria-disabled='true']{", "}" ], l.variables.interactiveColorOverlayHover, l.variables.interactiveColorBorderHover, (0,
286
286
  l.pickVariant)("$variant", {
287
+ secondary: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow),
288
+ default: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow),
289
+ subtle: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow)
290
+ }), (function(r) {
291
+ var e = r.$selected;
292
+ return e && (0, n.css)([ "border-color:", ";&:hover{background-color:", ";}" ], l.variables.interactiveColorBorderDisabled, l.mixins.overlayColors(l.variables.interactiveColorOverlaySelected, l.variables.interactiveColorOverlayHover));
293
+ }), (function(r) {
294
+ var e = r.$error;
295
+ return e && (0, n.css)([ "border-color:", ";&:hover{border-color:", ";}" ], l.variables.accentColorNegative, l.variables.accentColorNegative);
296
+ }), (0, l.pickVariant)("$variant", {
287
297
  secondary: (0, n.css)([ "", " font-weight:", ";" ], m("subtle", {
288
298
  color: l.variables.contentColorActive
289
299
  }), l.variables.fontWeightSemiBold),
@@ -296,23 +306,16 @@
296
306
  toggle: (0, n.css)([ "", " font-weight:normal;" ], m("secondary", {
297
307
  background: "transparent"
298
308
  }))
299
- }), l.variables.interactiveColorOverlayHover, l.variables.interactiveColorBorderHover, (0,
300
- l.pickVariant)("$variant", {
301
- secondary: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow),
302
- default: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow),
303
- subtle: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow)
304
- }), (function(r) {
305
- var e = r.$selected;
306
- return e && (0, n.css)([ "border-color:", ";&:hover{background-color:", ";}" ], l.variables.interactiveColorBorderDisabled, l.mixins.overlayColors(l.variables.interactiveColorOverlaySelected, l.variables.interactiveColorOverlayHover));
307
- }), (function(r) {
308
- var e = r.$error;
309
- return e && (0, n.css)([ "border-color:", ";&:hover{border-color:", ";}" ], l.variables.accentColorNegative, l.variables.accentColorNegative);
310
309
  }), (function(r) {
311
310
  var e = r.$selected;
312
311
  return e && (0, n.css)([ "background-color:", ";" ], l.mixins.overlayColors(l.variables.interactiveColorBackgroundDisabled, l.variables.interactiveColorOverlaySelected));
313
312
  }));
314
- var x = (0, n.css)([ "", " font-weight:", ";&:focus{background-color:", ";}&:hover{box-shadow:", ";}" ], (0,
313
+ var x = (0, n.css)([ "&:not([disabled],[aria-disabled='true']){&:focus{background-color:", ";}&:hover{box-shadow:", ";}}", " font-weight:", ";" ], (0,
315
314
  l.pickVariant)("$variant", {
315
+ primary: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlayHover),
316
+ destructive: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlayHover),
317
+ flat: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlayHover)
318
+ }), l.variables.hoverShadow, (0, l.pickVariant)("$variant", {
316
319
  primary: m("primary"),
317
320
  destructive: m("destructive"),
318
321
  flat: m({
@@ -323,11 +326,7 @@
323
326
  backgroundHover: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlayHover),
324
327
  backgroundSelected: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlaySelected)
325
328
  })
326
- }), l.variables.fontWeightSemiBold, (0, l.pickVariant)("$variant", {
327
- primary: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlayHover),
328
- destructive: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlayHover),
329
- flat: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlayHover)
330
- }), l.variables.hoverShadow);
329
+ }), l.variables.fontWeightSemiBold);
331
330
  // CONCATENATED MODULE: ./src/ButtonSimple/enterpriseStyles.ts
332
331
  var w = "#1A8929";
333
332
  // SUI-2439 to meet WCAG AA compliance
@@ -343,10 +342,10 @@
343
342
  }));
344
343
  var D = "inset 0 -1px 0 rgba(0, 0, 0, 0.1)";
345
344
  var P = "inset 0 1px 0 rgba(0, 0, 0, 0.1)";
346
- var j = (0, n.css)([ "", ";border:", ";", ";font-weight:", ";&:not([disabled],[aria-disabled='true']){background-color:", ";color:", ";transition:background-image 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", ";", " &:hover{background-color:", ";box-shadow:", ";}&:active{transition:none;background-color:", ";border-color:", ";", ";}&:focus{", " ", "}}&:not([disabled]){&:focus{box-shadow:", ",", ";}}&[disabled],&[aria-disabled='true']{cursor:not-allowed;color:", ";background-color:", ";border-color:", ";", "}" ], O, (0,
345
+ var j = (0, n.css)([ "", ";border:1px solid;border-color:", ";", ";font-weight:", ";&:not([disabled],[aria-disabled='true']){background-color:", ";color:", ";transition:background-image 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", ";", " &:hover{background-color:", ";", ";}&:active{transition:none;background-color:", ";border-color:", ";", ";}&:focus{", " ", "}}&:not([disabled]){&:focus{", "}}&[disabled],&[aria-disabled='true']{cursor:not-allowed;color:", ";background-color:", ";border-color:", ";", "}" ], O, (0,
347
346
  l.pick)({
348
- light: (0, n.css)([ "1px solid ", "" ], l.variables.gray60),
349
- dark: l.variables.border
347
+ light: l.variables.gray60,
348
+ dark: l.variables.borderColor
350
349
  }), $, (0, l.pickVariant)("$variant", {
351
350
  default: "normal",
352
351
  secondary: l.variables.fontWeightSemiBold
@@ -361,10 +360,10 @@
361
360
  dark: (0, n.css)([ "box-shadow:inset 0 -1px 0 ", ";" ], l.variables.gray30)
362
361
  }), (function(r) {
363
362
  var e = r.$selected;
364
- return e && (0, n.css)([ "box-shadow:", ";background-color:", ";border-color:", ";" ], (0,
363
+ return e && (0, n.css)([ "", ";background-color:", ";border-color:", ";" ], (0,
365
364
  l.pick)({
366
- light: P,
367
- dark: (0, n.css)([ "inset 0 1px 0 ", "" ], l.variables.black)
365
+ light: (0, n.css)([ "box-shadow:", ";" ], P),
366
+ dark: (0, n.css)([ "box-shadow:inset 0 1px 0 ", ";" ], l.variables.black)
368
367
  }), (0, l.pick)({
369
368
  light: l.variables.gray92,
370
369
  dark: l.variables.gray22
@@ -376,8 +375,8 @@
376
375
  light: "#ebeeef",
377
376
  dark: l.variables.gray30
378
377
  }), (0, l.pick)({
379
- light: D,
380
- dark: (0, n.css)([ "inset 0 -1px 0 ", "" ], l.variables.gray25)
378
+ light: (0, n.css)([ "box-shadow:", ";" ], D),
379
+ dark: (0, n.css)([ "box-shadow:inset 0 -1px 0 ", ";" ], l.variables.gray25)
381
380
  }), (0, l.pick)({
382
381
  light: l.variables.gray92,
383
382
  dark: l.variables.gray22
@@ -388,10 +387,10 @@
388
387
  dark: (0, n.css)([ "box-shadow:inset 0 -1px 0 ", ";" ], l.variables.gray22)
389
388
  }), (function(r) {
390
389
  var e = r.$append;
391
- return e && (0, n.css)([ "box-shadow:", ",", ",inset -1px 0 0 ", ";" ], (0, l.pick)({
392
- light: D,
393
- dark: (0, n.css)([ "inset 0 -1px 0 ", "" ], l.variables.gray30)
394
- }), l.variables.focusShadow, l.variables.borderColor);
390
+ return e && (0, l.pick)({
391
+ light: (0, n.css)([ "box-shadow:", " ", ",inset -1px 0 0 ", ";" ], D, l.variables.focusShadow, l.variables.borderColor),
392
+ dark: (0, n.css)([ "box-shadow:inset 0 -1px 0 ", " ", ",inset -1px 0 0 ", ";" ], l.variables.gray30, l.variables.focusShadow, l.variables.borderColor)
393
+ });
395
394
  }), (function(r) {
396
395
  var e = r.$append, a = r.$selected;
397
396
  return e && a && (0, l.pick)({
@@ -399,9 +398,9 @@
399
398
  dark: (0, n.css)([ "box-shadow:inset 0 1px 0 ", ",", ",inset -1px 0 0 ", ";" ], l.variables.black, l.variables.focusShadow, l.variables.borderColor)
400
399
  });
401
400
  }), (0, l.pick)({
402
- light: D,
403
- dark: (0, n.css)([ "inset 0 -1px 0 ", "" ], l.variables.gray30)
404
- }), l.variables.focusShadow, l.variables.textDisabledColor, (0, l.pick)({
401
+ light: (0, n.css)([ "box-shadow:", ",", ";" ], D, l.variables.focusShadow),
402
+ dark: (0, n.css)([ "box-shadow:inset 0 -1px 0 ", ",", ";" ], l.variables.gray30, l.variables.focusShadow)
403
+ }), l.variables.textDisabledColor, (0, l.pick)({
405
404
  light: l.variables.gray96,
406
405
  dark: l.variables.gray30
407
406
  }), (0, l.pick)({
package/CHANGELOG.md CHANGED
@@ -1,6 +1,36 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 4.34.0 - August 7, 2024
5
+ ----------
6
+ New Features:
7
+ * `RadioBar` supports new prop `role` for either `radiogroup` (default) or `menubar` (SUI-6335).
8
+ * `CollapsiblePanel` has a new `actions` prop for rendering the toggle button and interactive elements separate from `title`, reserving the `title` prop for text only (SUI-5999).
9
+ * If using the new `actions` prop, the toggle button supports `aria-labelledby` with the title and the panel body supports `role='region'`.
10
+ * `Select` now supports `appearance="subtle"` with the same visual appearance as the Enterprise `"pill"` and Prisma `"secondary"` appearances (SUI-6440).
11
+ * `Card` has a new `actions` prop for rendering card actions. This should be used to add unambiguous labels to the secondary actions, see the migration guide for details (SUI-5881).
12
+ * `Card` has a new `tag` prop for overriding the default HTML tag (SUI-5881).
13
+
14
+ Bug Fixes:
15
+ * `CollapsiblePanel` now correctly announces its expanded state to a11y tools in Firefox (SUI-5999).
16
+ * `RadioBar` no longer warns about the deprecated `appearance` prop when the default value is used.
17
+ * `Button` now shows focus styling when hovered (SUI-6357).
18
+ * `Button`s with an `appearance` of `primary` or `destructive` no longer have incorrect background colors on focus when `disabled="dimmed"` (SUI-6357).
19
+ * `JSONTree's` active border has been removed to avoid a layout shift (SUI-6324).
20
+ * `CollapsiblePanel`'s focus shadow has been updated to improve contrast (SUI-6340).
21
+ * `Search`'s `role` has been changed from `"textbox"` to `"searchbox"`.
22
+ * `Search`'s default labels have been removed to avoid redundant screen reader output (SUI-6332).
23
+ * `CollapsiblePanel`'s Enterprise dark theme toggle button is now visible when `disabled` (SUI-6425).
24
+ * `Popover` no longer moves focus to the container when no focusable children exist to ensure the focus indicator remains visible (SUI-6446).
25
+ * `Card` uses the `article` tag instead of `div` by default (SUI-5881).
26
+ * `Menu` no longer takes focus when all `Menu.Item` children are disabled (SUI-6268).
27
+ * `Color`'s textbox swatch in the popover palette is now focusable in Enterprise themes (SUI-6401).
28
+ * `Menu`s last `Item` no longer has an incorrect border radius on hover when a `footerMessage` is set (SUI-6450).
29
+
30
+ Deprecations:
31
+ * `CollapsiblePanel`'s `titleWithActions` prop has been deprecated and will be removed in the next major version. Use the new `actions` prop instead to render the toggle button and interactive elements separate from `title` (SUI-5999).
32
+ * `Select`'s `"flat"`, `"pill"`, and `"toggle"` values of the `appearance` prop have been deprecated and will be removed in the next major version. See the migration guide for details (SUI-6440).
33
+
4
34
  4.33.0 - July 8, 2024
5
35
  ----------
6
36
  New Features:
@@ -17,6 +47,7 @@ Bug Fixes:
17
47
  * `Button`'s text is now centered correctly when combining the `icon` and `to` props (SUI-6331).
18
48
  * `Button`'s external icon now has the same size as an icon rendered by the `icon` prop (SUI-6255).
19
49
  * `Select` now constructs `aria-label` out of the `Option`-s `label`s rather than `children` (SUI-6316).
50
+ * `Search` now allows provided `aria-label` value to override the default `aria-label` value (SUI-6332).
20
51
 
21
52
  Deprecations:
22
53
  * `Button`'s `"flat"`, `"pill"`, and `"toggle"` values of the `appearance` prop have been deprecated and will be removed in the next major version (SUI-6501).
package/Card.js CHANGED
@@ -87,7 +87,7 @@
87
87
  })([ "flex:1 1 auto;overflow:auto;height:100%;", ";", "" ], (function(e) {
88
88
  var r = e.$inset;
89
89
  return r ? (0, a.css)([ "", "" ], (0, u.pick)({
90
- enterprise: (0, a.css)([ "padding:", ";&:not(:first-child){padding-top:0;}" ], u.variables.spacing),
90
+ enterprise: (0, a.css)([ "padding:", ";&:not(:first-child){padding-top:0;}" ], u.variables.spacingLarge),
91
91
  prisma: {
92
92
  comfortable: (0, a.css)([ "padding:12px 24px;&:first-child{padding-top:28px;}&:last-child{padding-bottom:28px;}" ]),
93
93
  compact: (0, a.css)([ "padding:8px 24px;&:first-child{padding-top:20px;}&:last-child{padding-bottom:20px;}" ])
@@ -164,7 +164,7 @@
164
164
  displayName: "FooterStyles__StyledBox",
165
165
  componentId: "sc-1yu3r4s-0"
166
166
  })([ "", ";text-align:right;color:", ";", "" ], (0, u.pick)({
167
- enterprise: (0, a.css)([ "padding:", ";&:first-child{border-top:none;}" ], u.variables.spacing),
167
+ enterprise: (0, a.css)([ "padding:", ";&:first-child{border-top:none;}" ], u.variables.spacingLarge),
168
168
  prisma: {
169
169
  comfortable: (0, a.css)([ "padding:24px;" ]),
170
170
  compact: "padding: 18px 24px"
@@ -242,19 +242,19 @@
242
242
  var P = e.n(C);
243
243
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/MoreVertical"
244
244
  const _ = require("@splunk/react-icons/enterprise/MoreVertical");
245
- var T = e.n(_);
245
+ var E = e.n(_);
246
246
  // CONCATENATED MODULE: external "@splunk/react-ui/Anchor"
247
- const E = require("@splunk/react-ui/Anchor");
248
- var B = e.n(E);
247
+ const T = require("@splunk/react-ui/Anchor");
248
+ var B = e.n(T);
249
249
  // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
250
250
  const R = require("@splunk/react-ui/Dropdown");
251
251
  var I = e.n(R);
252
252
  // CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
253
253
  const q = require("@splunk/react-ui/Tooltip");
254
- var H = e.n(q);
254
+ var N = e.n(q);
255
255
  // CONCATENATED MODULE: external "@splunk/react-ui/Button"
256
- const N = require("@splunk/react-ui/Button");
257
- var $ = e.n(N);
256
+ const H = require("@splunk/react-ui/Button");
257
+ var $ = e.n(H);
258
258
  // CONCATENATED MODULE: ./src/Card/HeaderStyles.ts
259
259
  var A = l().div.withConfig({
260
260
  displayName: "HeaderStyles__StyledTitle",
@@ -282,10 +282,7 @@
282
282
  A,
283
283
  /* sc-sel */
284
284
  W);
285
- }), (0, u.pick)({
286
- enterprise: u.variables.spacingHalf,
287
- prisma: u.variables.spacingSmall
288
- }));
285
+ }), u.variables.spacingSmall);
289
286
  var M = l().div.withConfig({
290
287
  displayName: "HeaderStyles__StyledActionContainer",
291
288
  componentId: "eqi6uk-3"
@@ -300,12 +297,12 @@
300
297
  displayName: "HeaderStyles__StyledSecondaryAction",
301
298
  componentId: "eqi6uk-4"
302
299
  })([ "margin-left:10px;" ]);
303
- var z = l()(s()).withConfig({
300
+ var L = l()(s()).withConfig({
304
301
  displayName: "HeaderStyles__StyledBox",
305
302
  componentId: "eqi6uk-5"
306
303
  })([ "align-items:start;display:flex;flex:0 0 auto;justify-content:space-between;position:relative;min-height:30px;", " ", " >:not(", "):not(", "){flex:1 0 auto;}" ], (0,
307
304
  u.pick)({
308
- enterprise: (0, a.css)([ "padding:", ";" ], u.variables.spacing),
305
+ enterprise: (0, a.css)([ "padding:", ";" ], u.variables.spacingLarge),
309
306
  prisma: {
310
307
  comfortable: (0, a.css)([ "padding:16px 24px;&:last-child{padding-bottom:32px;}" ]),
311
308
  compact: (0, a.css)([ "padding:12px 24px;&:last-child{padding-bottom:24px;}" ])
@@ -318,7 +315,7 @@
318
315
  /* sc-sel */
319
316
  M);
320
317
  // CONCATENATED MODULE: ./src/Card/Header.tsx
321
- function L(e, r) {
318
+ function z(e, r) {
322
319
  if (e == null) return {};
323
320
  var t = V(e, r);
324
321
  var n, o;
@@ -369,6 +366,10 @@
369
366
  title: i().node,
370
367
  truncateTitle: i().bool
371
368
  };
369
+ // The order of the interfaces is necessary to maintain proper error messages: HeaderWithActions then HeaderWithActionsRenderProp
370
+ // If the actions comes first the error will report that actions should be undefined
371
+ // when we want actions to be the intended use case
372
+ // type HeaderProps = ComponentProps<HeaderPropsBase, 'div'>;
372
373
  // `forwardRef` is used to enable focus on toggle when Dropdown is closing
373
374
  var J = n().forwardRef((function(e, r) {
374
375
  var t = (0, u.useSplunkTheme)(), o = t.family, i = t.isCompact;
@@ -376,9 +377,9 @@
376
377
  var l = o === "prisma" ? n().createElement(P(), {
377
378
  height: a,
378
379
  width: a
379
- }) : n().createElement(T(), null);
380
+ }) : n().createElement(E(), null);
380
381
 
381
- return n().createElement(H(), G({
382
+ return n().createElement(N(), G({
382
383
  content: (0, j._)("Actions"),
383
384
  contentRelationship: "label"
384
385
  }, e), n().createElement(F, {
@@ -391,21 +392,28 @@
391
392
  /**
392
393
  * A styled container for `Card` header content.
393
394
  */ function K(e) {
394
- var r = e.actionPrimary, t = e.actionsSecondary, o = e.anchor, i = e.children, a = e.subtitle, l = e.title, c = e.truncateTitle, s = c === void 0 ? true : c, p = L(e, [ "actionPrimary", "actionsSecondary", "anchor", "children", "subtitle", "title", "truncateTitle" ]);
395
+ var r = e.actions, t = e.actionPrimary, o = e.actionsSecondary, i = e.anchor, a = e.children, l = e.subtitle, c = e.title, s = e.truncateTitle, p = s === void 0 ? true : s, d = z(e, [ "actions", "actionPrimary", "actionsSecondary", "anchor", "children", "subtitle", "title", "truncateTitle" ]);
395
396
  // @docs-props-type HeaderPropsBase
396
- var d = (0, u.useSplunkTheme)(), f = d.family;
397
- var b = f === "prisma" ? "right" : "below";
397
+ var f = (0, u.useSplunkTheme)(), b = f.family;
398
+ var v = b === "prisma" ? "right" : "below";
399
+ if (false) {}
400
+ var y;
401
+ if (r) {
402
+ y = r();
403
+ } else if (t || o) {
404
+ y = n().createElement(n().Fragment, null, t, o && n().createElement(I(), {
405
+ defaultPlacement: v,
406
+ toggle: n().createElement(J, null)
407
+ }, o));
408
+ }
398
409
 
399
- return n().createElement(z, G({
410
+ return n().createElement(L, G({
400
411
  "data-test": "header"
401
- }, p), (l || a) && n().createElement(D, {
402
- $truncateTitle: s
403
- }, l && n().createElement(A, null, o ? n().createElement(B(), {
404
- name: o
405
- }, l) : l), a && n().createElement(W, null, a)), i, (r || t) && n().createElement(M, null, r, t && n().createElement(I(), {
406
- defaultPlacement: b,
407
- toggle: n().createElement(J, null)
408
- }, t)));
412
+ }, d), (c || l) && n().createElement(D, {
413
+ $truncateTitle: p
414
+ }, c && n().createElement(A, null, i ? n().createElement(B(), {
415
+ name: i
416
+ }, c) : c), l && n().createElement(W, null, l)), a, y && n().createElement(M, null, y));
409
417
  }
410
418
  K.propTypes = U;
411
419
  /* harmony default export */ const Q = K;
@@ -414,7 +422,7 @@
414
422
  var Y = e.n(X);
415
423
  // CONCATENATED MODULE: ./src/Card/CardStyles.ts
416
424
  var Z = "0.2s";
417
- var ee = l().div.withConfig({
425
+ var ee = l().article.withConfig({
418
426
  displayName: "CardStyles__Styled",
419
427
  componentId: "ola3x0-0"
420
428
  })([ "", ";flex-direction:column;align-items:stretch;min-width:100px;flex:1;vertical-align:top;", " transition:height ", ",width ", ",min-width ", ",max-width ", ",margin ", ",box-shadow ", ",border-color ", ";", " &[data-clickable='true']{cursor:pointer;", " &:hover{", "}&:focus{", "}}" ], u.mixins.reset("inline-flex"), (0,
@@ -691,7 +699,8 @@
691
699
  selected: i().bool,
692
700
  showBorder: i().bool,
693
701
  to: i().string,
694
- value: i().any
702
+ value: i().any,
703
+ tag: i().oneOf([ "article", "div", "aside", "section" ])
695
704
  };
696
705
  var Pe = {
697
706
  openInNewContext: false,
@@ -700,7 +709,7 @@
700
709
  function _e(e) {
701
710
  return !!e.onClick || !!e.to;
702
711
  }
703
- function Te(e) {
712
+ function Ee(e) {
704
713
  var r = e.margin, t = e.maxWidth, n = e.minWidth, o = e.showBorder, i = e.style, a = ke(e, [ "margin", "maxWidth", "minWidth", "showBorder", "style" ]);
705
714
  var l = xe({
706
715
  minWidth: n,
@@ -714,7 +723,7 @@
714
723
  };
715
724
  return [ c, a ];
716
725
  }
717
- var Ee = function(e) {
726
+ var Te = function(e) {
718
727
  be(t, e);
719
728
  var r = ye(t);
720
729
  function t() {
@@ -738,7 +747,7 @@
738
747
  key: "render",
739
748
  value: function e() {
740
749
  if (_e(this.props)) {
741
- var r = Te(this.props), t = ie(r, 2), o = t[0], i = t[1];
750
+ var r = Ee(this.props), t = ie(r, 2), o = t[0], i = t[1];
742
751
  var a = o.showBorder;
743
752
  var l = i.children, c = i.elementRef, s = i.onClick, u = i.openInNewContext, p = i.selected, d = i.to, f = ke(i, [ "children", "elementRef", "onClick", "openInNewContext", "selected", "to" ]);
744
753
 
@@ -753,25 +762,28 @@
753
762
  to: d || undefined
754
763
  }), n().createElement(te, null, l));
755
764
  }
756
- var b = Te(this.props), v = ie(b, 2), y = v[0], m = v[1];
765
+ var b = Ee(this.props), v = ie(b, 2), y = v[0], m = v[1];
757
766
  var h = y.showBorder;
758
- var g = m.children, w = m.elementRef, O = ke(m, [ "children", "elementRef" ]);
767
+ var g = m.children, w = m.elementRef, O = m.tag, x = ke(m, [ "children", "elementRef", "tag" ]);
759
768
 
760
769
  return n().createElement(ee, oe({
761
770
  $selected: false,
762
771
  $cardHasBorder: h,
763
- ref: w
764
- }, y, O), g);
772
+ ref: w,
773
+ as: O
774
+ }, y, x, {
775
+ onClick: undefined
776
+ }), g);
765
777
  }
766
778
  } ]);
767
779
  return t;
768
780
  }(t.Component);
769
- Se(Ee, "propTypes", Ce);
770
- Se(Ee, "defaultProps", Pe);
771
- Se(Ee, "Header", Q);
772
- Se(Ee, "Body", m);
773
- Se(Ee, "Footer", k);
774
- /* harmony default export */ const Be = Ee;
781
+ Se(Te, "propTypes", Ce);
782
+ Se(Te, "defaultProps", Pe);
783
+ Se(Te, "Header", Q);
784
+ Se(Te, "Body", m);
785
+ Se(Te, "Footer", k);
786
+ /* harmony default export */ const Be = Te;
775
787
  // CONCATENATED MODULE: ./src/Card/index.ts
776
788
  module.exports = r;
777
789
  /******/})();