@splunk/react-ui 4.43.0 → 4.44.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/Slider.js CHANGED
@@ -108,7 +108,10 @@
108
108
  var O = w().div.withConfig({
109
109
  displayName: "SliderStyles__StyledInput",
110
110
  componentId: "sc-16ooit4-1"
111
- })([ "flex:1 0 0;vertical-align:middle;position:relative;cursor:default;height:", ";max-width:100%;" ], m.variables.inputHeight);
111
+ })([ "flex:1 0 0;vertical-align:middle;position:relative;cursor:default;height:", ";max-width:100%;", "" ], m.variables.inputHeight, (function(e) {
112
+ var r = e.$disabled;
113
+ return r && (0, x.css)([ "cursor:not-allowed;" ]);
114
+ }));
112
115
  var _ = "1px";
113
116
  var B = w().div.withConfig({
114
117
  displayName: "SliderStyles__StyledSliderBar",
@@ -156,7 +159,7 @@
156
159
  var j = w().button.withConfig({
157
160
  displayName: "SliderStyles__StyledSliderThumb",
158
161
  componentId: "sc-16ooit4-3"
159
- })([ "", ";display:block;position:absolute;cursor:pointer;width:", "px;height:", "px;border-radius:", ";border-width:0;background-color:", ";margin-left:-8px;top:", ";left:", "%;&:hover:not([disabled]){outline:0;z-index:1;", "}&:focus:not([disabled]),&:active{outline:0;box-shadow:", ";z-index:1;", "}&[disabled]{cursor:not-allowed;background-color:", ";}", "" ], m.mixins.reset("inline"), E, E, (0,
162
+ })([ "", ";display:block;position:absolute;cursor:pointer;width:", "px;height:", "px;border-radius:", ";border-width:0;background-color:", ";margin-left:-8px;top:", ";left:", "%;&:hover:not([disabled]){outline:0;z-index:1;", "}&:focus:not([disabled]),&:active:not([disabled]){outline:0;box-shadow:", ";z-index:1;", "}&[disabled]{cursor:not-allowed;background-color:", ";}", "" ], m.mixins.reset("inline"), E, E, (0,
160
163
  m.pick)({
161
164
  enterprise: "9px",
162
165
  prisma: "10px"
@@ -203,24 +206,24 @@
203
206
  enterprise: "18px",
204
207
  prisma: "24px"
205
208
  }));
206
- var q = (0, x.css)([ "flex:0 0 auto;line-height:", ";", "" ], m.variables.inputHeight, (function(e) {
209
+ var $ = (0, x.css)([ "flex:0 0 auto;line-height:", ";", "" ], m.variables.inputHeight, (function(e) {
207
210
  var r = e.$disabled;
208
211
  return r && (0, x.css)([ "color:", ";" ], (0, m.pick)({
209
212
  enterprise: m.variables.textDisabledColor,
210
213
  prisma: m.variables.contentColorDisabled
211
214
  }));
212
215
  }));
213
- var D = w()(T()).withConfig({
216
+ var q = w()(T()).withConfig({
214
217
  displayName: "SliderStyles__StyledMinLabelBox",
215
218
  componentId: "sc-16ooit4-5"
216
- })([ "", ";margin-right:", ";text-align:right;" ], q, (0, m.pick)({
219
+ })([ "", ";margin-right:", ";text-align:right;" ], $, (0, m.pick)({
217
220
  enterprise: "15px",
218
221
  prisma: "16px"
219
222
  }));
220
- var $ = w()(T()).withConfig({
223
+ var D = w()(T()).withConfig({
221
224
  displayName: "SliderStyles__StyledMaxLabelBox",
222
225
  componentId: "sc-16ooit4-6"
223
- })([ "", ";margin-left:", ";text-align:left;" ], q, (0, m.pick)({
226
+ })([ "", ";margin-left:", ";text-align:left;" ], $, (0, m.pick)({
224
227
  enterprise: "15px",
225
228
  prisma: "16px"
226
229
  }));
@@ -631,7 +634,7 @@
631
634
  value: function e() {
632
635
  var r = this;
633
636
  var i = this.props, a = i.describedBy, o = i.disabled, l = i.displayValue, s = i.elementRef, u = i.error, c = i.inline, p = i.labelledBy, f = i.max, m = i.maxLabel, b = i.min, y = i.minLabel, x = i.required, w = i.step, k = i.stepMarks, S = i.splunkTheme;
634
- var C = this.state, T = C.isFocused, _ = C.selected, q = C.sliderBar;
637
+ var C = this.state, T = C.isFocused, _ = C.selected, $ = C.sliderBar;
635
638
  var N = this.getValue();
636
639
  var L = ae({
637
640
  value: N,
@@ -639,10 +642,10 @@
639
642
  max: f
640
643
  });
641
644
  var R = k === "focus" && T || k === "always";
642
- var F = R && q ? ie({
645
+ var F = R && $ ? ie({
643
646
  max: f,
644
647
  min: b,
645
- sliderBar: q,
648
+ sliderBar: $,
646
649
  step: w,
647
650
  thumbWidth: E(S)
648
651
  }) : undefined;
@@ -662,11 +665,12 @@
662
665
  target: window,
663
666
  eventType: "mousemove",
664
667
  listener: this.handleMouseMove
665
- })), y !== null && n().createElement(D, {
668
+ })), y !== null && n().createElement(q, {
666
669
  "data-test": "min-label",
667
670
  $disabled: o
668
671
  }, y || b), n().createElement(O, {
669
- onClick: o ? undefined : this.handleClick
672
+ onClick: o ? undefined : this.handleClick,
673
+ $disabled: o
670
674
  }, n().createElement(B, {
671
675
  "aria-required": x,
672
676
  "data-test": "bar",
@@ -701,7 +705,7 @@
701
705
  anchor: this.sliderThumb,
702
706
  appearance: "inverted",
703
707
  align: "center"
704
- }, n().createElement(P, null, l || N))), m !== null && n().createElement($, {
708
+ }, n().createElement(P, null, l || N))), m !== null && n().createElement(D, {
705
709
  "data-test": "max-label",
706
710
  $disabled: o
707
711
  }, m || f));
package/StaticContent.js CHANGED
@@ -61,7 +61,7 @@
61
61
  e.r(r);
62
62
  // EXPORTS
63
63
  e.d(r, {
64
- default: () => /* reexport */ y
64
+ default: () => /* reexport */ v
65
65
  });
66
66
  // CONCATENATED MODULE: external "react"
67
67
  const n = require("react");
@@ -70,15 +70,15 @@
70
70
  const i = require("prop-types");
71
71
  var a = e.n(i);
72
72
  // CONCATENATED MODULE: external "styled-components"
73
- const o = require("styled-components");
74
- var l = e.n(o);
73
+ const l = require("styled-components");
74
+ var o = e.n(l);
75
75
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
76
76
  const s = require("@splunk/react-ui/Box");
77
77
  var c = e.n(s);
78
78
  // CONCATENATED MODULE: external "@splunk/themes"
79
79
  const p = require("@splunk/themes");
80
80
  // CONCATENATED MODULE: ./src/StaticContent/StaticContentStyles.ts
81
- var u = l()(c()).withConfig({
81
+ var u = o()(c()).withConfig({
82
82
  displayName: "StaticContentStyles__StyledBox",
83
83
  componentId: "sxqyrp-0"
84
84
  })([ "", ";position:relative;margin:0;font-weight:", ";word-wrap:break-word;min-height:", ";padding:", ";[data-inline] + &[data-inline]{margin-left:", ";}" ], p.mixins.reset("flex"), p.variables.fontWeightSemiBold, p.variables.inputHeight, (0,
@@ -109,7 +109,7 @@
109
109
  }
110
110
  function d(e, r) {
111
111
  if (null == e) return {};
112
- var n, t, i = m(e, r);
112
+ var n, t, i = b(e, r);
113
113
  if (Object.getOwnPropertySymbols) {
114
114
  var a = Object.getOwnPropertySymbols(e);
115
115
  for (t = 0; t < a.length; t++) {
@@ -118,7 +118,7 @@
118
118
  }
119
119
  return i;
120
120
  }
121
- function m(e, r) {
121
+ function b(e, r) {
122
122
  if (null == e) return {};
123
123
  var n = {};
124
124
  for (var t in e) {
@@ -129,29 +129,31 @@
129
129
  }
130
130
  return n;
131
131
  }
132
- var v = {
132
+ var m = {
133
133
  children: a().node,
134
134
  elementRef: a().oneOfType([ a().func, a().object ]),
135
135
  inline: a().bool,
136
- size: a().oneOf([ "small", "medium" ])
136
+ size: a().oneOf([ "small", "medium" ]),
137
+ labelledBy: a().string
137
138
  };
138
139
  /**
139
140
  * This component is intended for use in a control group, either to display a static value or
140
141
  * between two controls.
141
- */ function b(e) {
142
- var r = e.children, i = e.inline, a = i === void 0 ? false : i, o = e.size, l = d(e, [ "children", "inline", "size" ]);
142
+ */ function y(e) {
143
+ var r = e.children, i = e.inline, a = i === void 0 ? false : i, l = e.labelledBy, o = e.size, s = d(e, [ "children", "inline", "labelledBy", "size" ]);
143
144
  // @docs-props-type StaticContentPropsBase
144
145
  (0, n.useEffect)((function() {
145
146
  if (false) {}
146
147
  }), [ o ]);
147
148
 
148
149
  return t().createElement(u, f({
150
+ "aria-labelledby": l,
149
151
  "data-test": "static-content",
150
152
  inline: a
151
- }, l), r);
153
+ }, s), r);
152
154
  }
153
- b.propTypes = v;
154
- /* harmony default export */ const y = b;
155
+ y.propTypes = m;
156
+ /* harmony default export */ const v = y;
155
157
  // CONCATENATED MODULE: ./src/StaticContent/index.ts
156
158
  module.exports = r;
157
159
  /******/})();
package/Table.js CHANGED
@@ -386,7 +386,7 @@
386
386
  return (0, z.createDOMID)();
387
387
  })) : undefined;
388
388
  }));
389
- }), []);
389
+ }), [ w ]);
390
390
  w.forEach((function(e, r) {
391
391
  if (e) {
392
392
  if (false) {}
@@ -1424,6 +1424,10 @@
1424
1424
  width: u
1425
1425
  });
1426
1426
  }
1427
+ if (n === "enter") {
1428
+ e.preventDefault();
1429
+ // SUI-7320: prevent sorting and dropdown opening
1430
+ }
1427
1431
  }), [ i, c, t, x, s ]);
1428
1432
  var be = (0, n.useCallback)((function(e) {
1429
1433
  if (s === "auto") {
@@ -5041,19 +5045,24 @@
5041
5045
  return l;
5042
5046
  };
5043
5047
  var Je = function e(r) {
5044
- var o = (t === null || t === void 0 ? void 0 : t.filter(n.isValidElement)) || [];
5048
+ var i = (t === null || t === void 0 ? void 0 : t.filter(n.isValidElement).length) > 0;
5049
+ var a = false;
5045
5050
  n.Children.toArray(r === null || r === void 0 ? void 0 : r.props.children).filter(n.isValidElement).forEach((function(e, t) {
5046
- var r;
5047
- var o = e.key || ((r = e.props) === null || r === void 0 ? void 0 : r.dataId) || t + 1;
5051
+ var r, o, i;
5052
+ var l = e.key || ((r = e.props) === null || r === void 0 ? void 0 : r.dataId) || t + 1;
5053
+ if (((o = e.props) === null || o === void 0 ? void 0 : o.actionPrimary) || ((i = e.props) === null || i === void 0 ? void 0 : i.actionsSecondary)) {
5054
+ a = true;
5055
+ }
5048
5056
  je.push( (0, n.cloneElement)(e, {
5049
5057
  index: t,
5050
- dataId: o
5058
+ dataId: l
5051
5059
  }));
5052
- Ie.push(o);
5060
+ Ie.push(l);
5053
5061
  }));
5062
+ var l = i || a || !!o;
5054
5063
 
5055
5064
  return (0, n.cloneElement)(r, {
5056
- actions: o.length > 0,
5065
+ actions: l,
5057
5066
  movableColumns: !!b,
5058
5067
  onRequestMoveRow: h,
5059
5068
  primaryColumnIndex: j,
package/Tree.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './types/src/Tree';
2
+ export * from './types/src/Tree';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.43.0",
3
+ "version": "4.44.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.",
@@ -44,7 +44,7 @@
44
44
  "@dnd-kit/modifiers": "^7.0.0",
45
45
  "@dnd-kit/sortable": "^8.0.0",
46
46
  "@dnd-kit/utilities": "^3.2.2",
47
- "@splunk/react-icons": "^4.12.0",
47
+ "@splunk/react-icons": "^4.13.0",
48
48
  "@splunk/themes": "^0.23.0",
49
49
  "@splunk/ui-utils": "^1.8.0",
50
50
  "commonmark": "^0.30.0",
@@ -70,9 +70,10 @@ interface DatePropsBase {
70
70
  onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
71
71
  /** @private */
72
72
  splunkTheme: AnyTheme;
73
- /** Setting this value makes the property controlled. An onChange callback is required.
73
+ /**
74
+ * Setting this value makes the property controlled. An onChange callback is required.
74
75
  *
75
- * The value must be in the format 'YYYY-MM-DD'. To simplify creation of these strings,
76
+ * The value must be "" or in the format 'YYYY-MM-DD'. To simplify creation of these strings,
76
77
  * Date provides a Moment.js formatting string:
77
78
  * ```
78
79
  * moment().format(Date.momentFormat);
@@ -6,6 +6,7 @@ import { ClassComponentProps } from '../utils/types';
6
6
  type NumberChangeHandler = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>, data: {
7
7
  name?: string;
8
8
  value?: number;
9
+ reason: 'input' | 'stepButton';
9
10
  }) => void;
10
11
  /** @public */
11
12
  type NumberBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
@@ -44,7 +44,7 @@ interface SliderPropsBase {
44
44
  /** The maximum value of the Slider input. */
45
45
  max?: number;
46
46
  /**
47
- * The label shown to the left of the slider. Defaults to the max value.
47
+ * The label shown to the right of the slider. Defaults to the max value.
48
48
  * Set to null to remove.
49
49
  */
50
50
  maxLabel?: React.ReactNode;
@@ -15,19 +15,21 @@ interface StaticContentPropsBase {
15
15
  * The small size will align with small Text, Select and other controls.
16
16
  * @themeNotes Supported by the `enterprise` theme only. */
17
17
  size?: 'small' | 'medium';
18
+ labelledBy?: string;
18
19
  }
19
20
  type StaticContentProps = ComponentProps<StaticContentPropsBase, 'div'>;
20
21
  /**
21
22
  * This component is intended for use in a control group, either to display a static value or
22
23
  * between two controls.
23
24
  */
24
- declare function StaticContent({ children, inline, size, ...otherProps }: StaticContentProps): JSX.Element;
25
+ declare function StaticContent({ children, inline, labelledBy, size, ...otherProps }: StaticContentProps): JSX.Element;
25
26
  declare namespace StaticContent {
26
27
  var propTypes: {
27
28
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
28
29
  elementRef: PropTypes.Requireable<object>;
29
30
  inline: PropTypes.Requireable<boolean>;
30
31
  size: PropTypes.Requireable<string>;
32
+ labelledBy: PropTypes.Requireable<string>;
31
33
  };
32
34
  }
33
35
  export default StaticContent;