@splunk/react-ui 4.32.0 → 4.33.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 (37) hide show
  1. package/Button.js +42 -45
  2. package/ButtonSimple.js +372 -336
  3. package/CHANGELOG.md +23 -0
  4. package/Clickable.js +21 -19
  5. package/FormRows.js +229 -207
  6. package/MIGRATION.mdx +23 -0
  7. package/Menu.js +1 -1
  8. package/Modal.js +156 -131
  9. package/Multiselect.js +47 -33
  10. package/Select.js +236 -220
  11. package/TabBar.js +1 -1
  12. package/Text.js +13 -11
  13. package/package.json +5 -5
  14. package/types/src/Button/Button.d.ts +4 -4
  15. package/types/src/ButtonSimple/ButtonSimple.d.ts +8 -6
  16. package/types/src/ButtonSimple/mixin.d.ts +2 -2
  17. package/types/src/Clickable/Clickable.d.ts +3 -2
  18. package/types/src/Date/Date.d.ts +2 -2
  19. package/types/src/Menu/Item.d.ts +0 -1
  20. package/types/src/Number/Number.d.ts +2 -2
  21. package/types/src/Select/Select.d.ts +6 -2
  22. package/types/src/Select/SelectBase.d.ts +6 -2
  23. package/types/src/Slider/Slider.d.ts +2 -2
  24. package/types/src/Text/docs/examples/Basic.d.ts +1 -9
  25. package/types/src/Text/docs/examples/Error.d.ts +2 -10
  26. package/types/src/Text/docs/examples/Inline.d.ts +1 -9
  27. package/types/src/Text/docs/examples/Multiline.d.ts +1 -9
  28. package/types/src/Text/docs/examples/Password.d.ts +1 -9
  29. package/types/src/Text/docs/examples/Search.d.ts +1 -9
  30. package/types/src/Button/docs/examples/prisma/Basic.d.ts +0 -2
  31. package/types/src/Button/docs/examples/prisma/Block.d.ts +0 -2
  32. package/types/src/Button/docs/examples/prisma/Disabled.d.ts +0 -2
  33. package/types/src/Button/docs/examples/prisma/Icons.d.ts +0 -2
  34. package/types/src/Button/docs/examples/prisma/Menus.d.ts +0 -2
  35. package/types/src/Button/docs/examples/prisma/To.d.ts +0 -2
  36. package/types/src/Button/docs/examples/prisma/Truncated.d.ts +0 -2
  37. /package/types/src/{Button/docs/examples/prisma → Clickable/docs/examples}/Dimmed.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,29 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 4.33.0 - July 8, 2024
5
+ ----------
6
+ New Features:
7
+ * `Clickable` now supports the `"dimmed"` value for the `disabled` prop (SUI-5819).
8
+ * If set to `"dimmed"`, the component does not respond to mouse events and `aria-disabled` is set to `true`.
9
+ * `Button` now supports `appearance="subtle"` with a visual appearance similar to the Enterprise `"pill"` and Prisma `"secondary"` appearances (SUI-6051).
10
+ * `Button` now sets the `aria-pressed` attribute appropriately when the `selected` prop is provided (SUI-2791).
11
+ * `Select` has a new `toggleContent` prop that specifies whether the children (`"optionChildren"`) or label (`"optionLabel"`) of the matched `Option` are rendered in the toggle button (SUI-6316).
12
+ * `Menu.Item` now supports `descriptionPosition="right"` for Prisma themes (SUI-5664).
13
+
14
+ Bug Fixes:
15
+ * `Modal.Header` uses semantic HTML elements for the `title` and `subtitle` props to improve accessibility.
16
+ * `TabBar.Tab` has a correctly sized active indicator when vertical and the `to` prop is passed (SUI-6205).
17
+ * `Button`'s text is now centered correctly when combining the `icon` and `to` props (SUI-6331).
18
+ * `Button`'s external icon now has the same size as an icon rendered by the `icon` prop (SUI-6255).
19
+ * `Select` now constructs `aria-label` out of the `Option`-s `label`s rather than `children` (SUI-6316).
20
+
21
+ Deprecations:
22
+ * `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).
23
+
24
+ Docs:
25
+ * Fixed an issue where `SidePanel`'s Test Hooks content was not shown (SUI-6322).
26
+
4
27
  4.32.0 - June 4, 2024
5
28
  ----------
6
29
  New Features:
package/Clickable.js CHANGED
@@ -87,12 +87,12 @@
87
87
  const p = require("styled-components");
88
88
  var d = e.n(p);
89
89
  // CONCATENATED MODULE: external "@splunk/themes"
90
- const v = require("@splunk/themes");
90
+ const b = require("@splunk/themes");
91
91
  // CONCATENATED MODULE: ./src/Clickable/ClickableStyles.ts
92
- var b = d().a.withConfig({
92
+ var v = d().a.withConfig({
93
93
  displayName: "ClickableStyles__StyledA",
94
94
  componentId: "sc-7al1vw-0"
95
- })([ "", " cursor:pointer;&[disabled],&[aria-disabled='true']{color:", ";}&::-moz-focus-inner{border:0;padding:0;}" ], v.mixins.reset("inline"), v.variables.contentColorDisabled);
95
+ })([ "", " cursor:pointer;&[disabled],&[aria-disabled='true']{color:", ";}&::-moz-focus-inner{border:0;padding:0;}" ], b.mixins.reset("inline"), b.variables.contentColorDisabled);
96
96
  // CONCATENATED MODULE: ./src/Clickable/NavigationProvider.tsx
97
97
  /** @public */
98
98
  var y = {
@@ -257,16 +257,16 @@
257
257
  } else {
258
258
  o = r.apply(this, arguments);
259
259
  }
260
- return I(this, o);
260
+ return T(this, o);
261
261
  };
262
262
  }
263
- function I(e, t) {
263
+ function T(e, t) {
264
264
  if (t && (g(t) === "object" || typeof t === "function")) {
265
265
  return t;
266
266
  }
267
- return T(e);
267
+ return I(e);
268
268
  }
269
- function T(e) {
269
+ function I(e) {
270
270
  if (e === void 0) {
271
271
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
272
272
  }
@@ -315,7 +315,7 @@
315
315
  /** @private */
316
316
  allowDisabledLink: i().bool,
317
317
  children: i().node,
318
- disabled: i().bool,
318
+ disabled: i().oneOfType([ i().bool, i().oneOf([ "dimmed" ]) ]),
319
319
  elementRef: i().oneOfType([ i().func, i().object ]),
320
320
  onClick: i().func,
321
321
  openInNewContext: i().bool,
@@ -341,12 +341,12 @@
341
341
  var r;
342
342
  x(this, n);
343
343
  r = t.call(this, e);
344
- M(T(r), "el", null);
345
- M(T(r), "handleMount", (function(e) {
344
+ M(I(r), "el", null);
345
+ M(I(r), "handleMount", (function(e) {
346
346
  r.el = e;
347
347
  k(r.props.elementRef, e);
348
348
  }));
349
- M(T(r), "createHandleOnClick", (function() {
349
+ M(I(r), "createHandleOnClick", (function() {
350
350
  var e = r.context, t = e.onClick, n = e.onLinkClick;
351
351
  return function(e) {
352
352
  if (A(r.props)) {
@@ -382,7 +382,7 @@
382
382
  }
383
383
  };
384
384
  }));
385
- M(T(r), "getTransformedUrl", (function(e) {
385
+ M(I(r), "getTransformedUrl", (function(e) {
386
386
  var t = r.context.transformUrl;
387
387
  return t != null ? t(e, {
388
388
  isInternal: z(e),
@@ -411,7 +411,7 @@
411
411
  var u = i ? "_blank" : undefined;
412
412
  var c = i && z(l) ? "noopener noreferrer" : undefined;
413
413
 
414
- return r().createElement(b, C({
414
+ return r().createElement(v, C({
415
415
  "data-test": "clickable",
416
416
  ref: this.handleMount,
417
417
  href: this.getTransformedUrl(this.props.to),
@@ -424,7 +424,7 @@
424
424
  var s = this.props, p = s.children, d = O(s, [ "children" ]);
425
425
  if (this.props.disabled && this.props.to != null) {
426
426
 
427
- return r().createElement(b, C({
427
+ return r().createElement(v, C({
428
428
  "data-test": "clickable",
429
429
  ref: this.handleMount,
430
430
  role: "link",
@@ -433,15 +433,17 @@
433
433
  }
434
434
  }
435
435
  // button variant
436
- var v = this.props, y = v.children, h = v.type, m = O(v, [ "children", "type" ]);
436
+ var b = this.props, y = b.children, h = b.onClick, m = b.disabled, k = b.type, g = O(b, [ "children", "onClick", "disabled", "type" ]);
437
437
 
438
- return r().createElement(b, C({
438
+ return r().createElement(v, C({
439
439
  as: "button",
440
+ "aria-disabled": m === "dimmed" || undefined,
440
441
  "data-test": "clickable",
441
442
  ref: this.handleMount,
442
- type: h || "button",
443
- onClick: t
444
- }, f()(m, "elementRef", "onClick", "openInNewContext", "to")), y);
443
+ type: k || "button",
444
+ disabled: m === true,
445
+ onClick: h && !m ? t : undefined
446
+ }, f()(g, "elementRef", "openInNewContext", "to")), y);
445
447
  }
446
448
  } ]);
447
449
  return n;