@splunk/react-ui 5.6.0 → 5.7.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/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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -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>;