@splunk/react-ui 4.22.0 → 4.22.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  Change Log
2
2
  ============
3
+ 4.22.1 - Nov 14, 2023
4
+ ----------
5
+ Bug Fixes:
6
+ * `Message` should now allow containing elements to be styled to take up the full width of the container (SUI-5843).
7
+ * `ComboBox`, `Date`, `Number`, `Search`, `Text`, and `TextArea` should now provide `name` and `value` to the `onFocus` and `onBlur` callbacks (SUI-5844).
8
+ * `List` will not incorrectly warn for the `type` prop (SUI-5845).
9
+
3
10
  4.22.0 - Nov 7, 2023
4
11
  ----------
5
12
  New Features:
package/ComboBox.js CHANGED
@@ -600,8 +600,8 @@
600
600
  e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
601
601
  }
602
602
  }));
603
- ce(ae(i), "handleInputFocus", (function(e) {
604
- var t, n;
603
+ ce(ae(i), "handleInputFocus", (function(e, t) {
604
+ var n, o;
605
605
  /* SUI-930 On IE 11 this handler is essentially deferred after calling
606
606
  * this.textInput.focus(). this.focusCalledInternally enables the focus event to be ignored
607
607
  * when the menu closes. */ if (i.focusCalledInternally) {
@@ -609,7 +609,7 @@
609
609
  } else {
610
610
  i.open();
611
611
  }
612
- (t = (n = i.props).onFocus) === null || t === void 0 ? void 0 : t.call(n, e);
612
+ (n = (o = i.props).onFocus) === null || n === void 0 ? void 0 : n.call(o, e, t);
613
613
  }));
614
614
  ce(ae(i), "handleChange", (function(e, t) {
615
615
  var n, o;
package/Date.js CHANGED
@@ -385,8 +385,8 @@
385
385
  });
386
386
  }
387
387
  }));
388
- W(R(a), "handleFocus", (function(e) {
389
- var t, n;
388
+ W(R(a), "handleFocus", (function(e, t) {
389
+ var n, o;
390
390
  if (a.focusCalledInternally) {
391
391
  a.focusCalledInternally = false;
392
392
  } else if (!a.props.inputOnly) {
@@ -394,7 +394,7 @@
394
394
  calendarOpen: true
395
395
  });
396
396
  }
397
- (t = (n = a.props).onFocus) === null || t === void 0 ? void 0 : t.call(n, e);
397
+ (n = (o = a.props).onFocus) === null || n === void 0 ? void 0 : n.call(o, e, t);
398
398
  }));
399
399
  W(R(a), "handleClick", (function(e) {
400
400
  var t, n, o;
package/List.js CHANGED
@@ -62,7 +62,7 @@
62
62
  // EXPORTS
63
63
  e.d(t, {
64
64
  Item: () => /* reexport */ v,
65
- default: () => /* reexport */ S
65
+ default: () => /* reexport */ P
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
68
  const r = require("react");
@@ -76,11 +76,11 @@
76
76
  // CONCATENATED MODULE: external "@splunk/themes"
77
77
  const c = require("@splunk/themes");
78
78
  // CONCATENATED MODULE: ./src/List/ListStyles.ts
79
- var f = a().ol.withConfig({
80
- displayName: "ListStyles__StyledOl",
79
+ var f = a().ul.withConfig({
80
+ displayName: "ListStyles__StyledUl",
81
81
  componentId: "sc-1yyh8l9-0"
82
82
  })([ "", ";", ";list-style-type:", ";padding-left:40px;margin-bottom:1.3em;margin-top:1em;" ], c.mixins.reset("block"), c.mixins.typography("body"), (function(e) {
83
- var t = e.$type;
83
+ var t = e.$listStyleType;
84
84
  return t;
85
85
  }));
86
86
  var p = a().li.withConfig({
@@ -194,21 +194,26 @@
194
194
  ordered: i().bool,
195
195
  type: i().oneOf([ "disc", "decimal", "lower-alpha", "upper-alpha" ])
196
196
  };
197
- function j(e) {
198
- var t = e.children, r = e.elementRef, o = e.type, i = o === void 0 ? "disc" : o, l = e.ordered, a = O(e, [ "children", "elementRef", "type", "ordered" ]);
197
+ var j = {
198
+ type: "disc"
199
+ };
200
+ function S(e) {
201
+ var t = e.children, r = e.elementRef, o = e.type, i = e.ordered, l = O(e, [ "children", "elementRef", "type", "ordered" ]);
199
202
  // @docs-props-type ListPropsBase
203
+ // Default prop value is "disc", we cannot determine if user or defaultProps is setting the value
200
204
  if (false) {}
201
205
 
202
206
  return n().createElement(f, b({
203
- as: !l && i === "disc" ? "ul" : "ol",
207
+ as: i || o !== "disc" ? "ol" : "ul",
204
208
  "data-test": "list",
205
209
  ref: r,
206
- $type: l || i === "decimal" ? "decimal" || 0 || 0 : i
207
- }, a), t);
210
+ $listStyleType: i ? "decimal" : o
211
+ }, l), t);
208
212
  }
209
- j.propTypes = g;
210
- j.Item = v;
211
- /* harmony default export */ const S = j;
213
+ S.propTypes = g;
214
+ S.defaultProps = j;
215
+ S.Item = v;
216
+ /* harmony default export */ const P = S;
212
217
  // CONCATENATED MODULE: ./src/List/index.ts
213
218
  module.exports = t;
214
219
  /******/})();
package/Message.js CHANGED
@@ -180,7 +180,7 @@
180
180
  var D = I().div.withConfig({
181
181
  displayName: "MessageStyles__StyledContent",
182
182
  componentId: "eg66af-0"
183
- })([ "display:flex;align-items:baseline;", ";", " ", ";" ], (0, E.pick)({
183
+ })([ "display:flex;align-items:baseline;flex:1;", ";", " ", ";" ], (0, E.pick)({
184
184
  prisma: (0, P.css)([ "padding:", " 0;color:", ";" ], E.variables.spacingMedium, E.variables.contentColorActive),
185
185
  enterprise: (0, P.css)([ "padding:12px 0;" ])
186
186
  }), (0, E.pick)({
package/Number.js CHANGED
@@ -481,10 +481,10 @@
481
481
  n = t.call(this, e);
482
482
  Q(H(n), "controlledExternally", void 0);
483
483
  Q(H(n), "text", null);
484
- Q(H(n), "handleInputBlur", (function(e) {
485
- var t, r;
484
+ Q(H(n), "handleInputBlur", (function(e, t) {
485
+ var r, o;
486
486
  n.updateString();
487
- (t = (r = n.props).onBlur) === null || t === void 0 ? void 0 : t.call(r, e);
487
+ (r = (o = n.props).onBlur) === null || r === void 0 ? void 0 : r.call(o, e, t);
488
488
  }));
489
489
  Q(H(n), "handleInputChange", (function(e, t) {
490
490
  var r = t.value;
package/Search.js CHANGED
@@ -582,7 +582,7 @@
582
582
  var r;
583
583
  (r = ye.current) === null || r === void 0 ? void 0 : r.focus();
584
584
  };
585
- var qe = function e(r) {
585
+ var qe = function e(r, t) {
586
586
  /* SUI-930 On IE 11 this handler is essentially deferred after calling
587
587
  * this.textInput.focus(). this.focusCalledInternally enables the focus event to be ignored
588
588
  * when the menu closes. */
@@ -591,7 +591,7 @@
591
591
  } else {
592
592
  Ee();
593
593
  }
594
- V === null || V === void 0 ? void 0 : V(r);
594
+ V === null || V === void 0 ? void 0 : V(r, t);
595
595
  };
596
596
  var Ie = function e(r, t) {
597
597
  var n = t.value;
package/Text.js CHANGED
@@ -84,8 +84,8 @@
84
84
  // CONCATENATED MODULE: external "@splunk/react-ui/ControlGroup"
85
85
  const m = require("@splunk/react-ui/ControlGroup");
86
86
  // CONCATENATED MODULE: external "@splunk/react-icons/Cross"
87
- const h = require("@splunk/react-icons/Cross");
88
- var v = e.n(h);
87
+ const v = require("@splunk/react-icons/Cross");
88
+ var h = e.n(v);
89
89
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Close"
90
90
  const b = require("@splunk/react-icons/enterprise/Close");
91
91
  var y = e.n(b);
@@ -622,7 +622,7 @@
622
622
  }
623
623
  function me(e, t) {
624
624
  if (e == null) return {};
625
- var r = he(e, t);
625
+ var r = ve(e, t);
626
626
  var n, i;
627
627
  if (Object.getOwnPropertySymbols) {
628
628
  var a = Object.getOwnPropertySymbols(e);
@@ -635,7 +635,7 @@
635
635
  }
636
636
  return r;
637
637
  }
638
- function he(e, t) {
638
+ function ve(e, t) {
639
639
  if (e == null) return {};
640
640
  var r = {};
641
641
  var n = Object.keys(e);
@@ -647,7 +647,7 @@
647
647
  }
648
648
  return r;
649
649
  }
650
- function ve(e, t) {
650
+ function he(e, t) {
651
651
  if (!(e instanceof t)) {
652
652
  throw new TypeError("Cannot call a class as a function");
653
653
  }
@@ -819,7 +819,7 @@
819
819
  } ]);
820
820
  function r(e) {
821
821
  var i;
822
- ve(this, r);
822
+ he(this, r);
823
823
  i = t.call(this, e);
824
824
  Ee(ke(i), "controlledExternally", void 0);
825
825
  Ee(ke(i), "input", null);
@@ -873,11 +873,21 @@
873
873
  }));
874
874
  Ee(ke(i), "handleInputFocus", (function(e) {
875
875
  var t, r;
876
- (t = (r = i.props).onFocus) === null || t === void 0 ? void 0 : t.call(r, e);
876
+ var n = e.target.value;
877
+ var a = i.props.name;
878
+ (t = (r = i.props).onFocus) === null || t === void 0 ? void 0 : t.call(r, e, {
879
+ value: n,
880
+ name: a
881
+ });
877
882
  }));
878
883
  Ee(ke(i), "handleInputBlur", (function(e) {
879
884
  var t, r;
880
- (t = (r = i.props).onBlur) === null || t === void 0 ? void 0 : t.call(r, e);
885
+ var n = e.target.value;
886
+ var a = i.props.name;
887
+ (t = (r = i.props).onBlur) === null || t === void 0 ? void 0 : t.call(r, e, {
888
+ value: n,
889
+ name: a
890
+ });
881
891
  }));
882
892
  Ee(ke(i), "handleClear", (function(e) {
883
893
  var t, r;
@@ -919,7 +929,7 @@
919
929
  return n().createElement(re, m, a);
920
930
  }
921
931
  if (o && !l) {
922
- var h = i.state.hideVisibility ? n().createElement(B, null) : n().createElement(P, null);
932
+ var v = i.state.hideVisibility ? n().createElement(B, null) : n().createElement(P, null);
923
933
 
924
934
  return n().createElement(re, m, n().createElement(Q, {
925
935
  appearance: p ? "secondary" : "pill",
@@ -927,7 +937,7 @@
927
937
  inline: false,
928
938
  onClick: i.handleVisibilityToggle,
929
939
  type: "button",
930
- icon: h
940
+ icon: v
931
941
  }));
932
942
  }
933
943
  var b = i.context;
@@ -954,7 +964,7 @@
954
964
  icon: u ? n().createElement(y(), {
955
965
  size: 1,
956
966
  screenReaderText: x
957
- }) : n().createElement(v(), {
967
+ }) : n().createElement(h(), {
958
968
  "aria-label": x
959
969
  }),
960
970
  onClick: i.handleClear
@@ -979,7 +989,7 @@
979
989
  icon: u ? n().createElement(y(), {
980
990
  inline: false,
981
991
  screenReaderText: x
982
- }) : n().createElement(v(), {
992
+ }) : n().createElement(h(), {
983
993
  "aria-label": x,
984
994
  height: f,
985
995
  inline: false,
@@ -1077,13 +1087,13 @@
1077
1087
  }, {
1078
1088
  key: "render",
1079
1089
  value: function e() {
1080
- var t = this.props, r = t.append, i = t.autoCapitalize, a = t.autoComplete, o = t.autoCorrect, l = t.autoFocus, s = t.children, p = t.className, u = t.classNamePrivate, m = t.disabled, h = t.describedBy, v = t.elementRef, b = t.error, y = t.inline, C = t.inputClassName, g = t.inputId, x = t.labelledBy, w = t.multiline, k = t.maxLength, S = t.name, A = t.passwordVisibilityToggle, T = t.placeholder, I = t.prepend, j = t.required, M = t.spellCheck, R = t.tabIndex, P = t.title, $ = t.type, _ = t.useSyntheticPlaceholder, B = me(t, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "multiline", "maxLength", "name", "passwordVisibilityToggle", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title", "type", "useSyntheticPlaceholder" ]);
1090
+ var t = this.props, r = t.append, i = t.autoCapitalize, a = t.autoComplete, o = t.autoCorrect, l = t.autoFocus, s = t.children, p = t.className, u = t.classNamePrivate, m = t.disabled, v = t.describedBy, h = t.elementRef, b = t.error, y = t.inline, C = t.inputClassName, g = t.inputId, x = t.labelledBy, w = t.multiline, k = t.maxLength, S = t.name, A = t.passwordVisibilityToggle, T = t.placeholder, I = t.prepend, j = t.required, M = t.spellCheck, R = t.tabIndex, P = t.title, $ = t.type, _ = t.useSyntheticPlaceholder, B = me(t, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "multiline", "maxLength", "name", "passwordVisibilityToggle", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title", "type", "useSyntheticPlaceholder" ]);
1081
1091
  var D = fe(fe({
1082
1092
  role: "textbox"
1083
1093
  }, f()(B, (function(e, t) {
1084
1094
  return t === "role" || t.indexOf("aria-") === 0;
1085
1095
  }))), {}, {
1086
- "aria-describedby": h,
1096
+ "aria-describedby": v,
1087
1097
  "aria-labelledby": x,
1088
1098
  "aria-invalid": b || undefined
1089
1099
  });
@@ -1143,7 +1153,7 @@
1143
1153
  className: (0, O.toClassName)(p, u),
1144
1154
  "data-test": "text",
1145
1155
  "data-test-value": H,
1146
- elementRef: v,
1156
+ elementRef: h,
1147
1157
  flex: true,
1148
1158
  inline: y
1149
1159
  }, N), this.renderStartAdornment(), n().createElement(U, ae({
package/TextArea.js CHANGED
@@ -83,10 +83,10 @@
83
83
  var f = e.n(u);
84
84
  // CONCATENATED MODULE: external "lodash/omit"
85
85
  const h = require("lodash/omit");
86
- var m = e.n(h);
86
+ var v = e.n(h);
87
87
  // CONCATENATED MODULE: external "lodash/pickBy"
88
- const v = require("lodash/pickBy");
89
- var b = e.n(v);
88
+ const m = require("lodash/pickBy");
89
+ var b = e.n(m);
90
90
  // CONCATENATED MODULE: external "lodash/throttle"
91
91
  const y = require("lodash/throttle");
92
92
  var g = e.n(y);
@@ -609,12 +609,12 @@
609
609
  Object.defineProperty(e, n.key, n);
610
610
  }
611
611
  }
612
- function me(e, t, r) {
612
+ function ve(e, t, r) {
613
613
  if (t) he(e.prototype, t);
614
614
  if (r) he(e, r);
615
615
  return e;
616
616
  }
617
- function ve(e, t) {
617
+ function me(e, t) {
618
618
  if (typeof t !== "function" && t !== null) {
619
619
  throw new TypeError("Super expression must either be null or a function");
620
620
  }
@@ -748,9 +748,9 @@
748
748
  tabIndex: 0
749
749
  };
750
750
  /** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */ var Oe = function(e) {
751
- ve(r, e);
751
+ me(r, e);
752
752
  var t = ye(r);
753
- me(r, null, [ {
753
+ ve(r, null, [ {
754
754
  key: "validateRows",
755
755
  // @docs-props-type TextAreaPropsBase
756
756
  value: function e(t) {
@@ -818,11 +818,21 @@
818
818
  }));
819
819
  ke(xe(a), "handleInputFocus", (function(e) {
820
820
  var t, r;
821
- (t = (r = a.props).onFocus) === null || t === void 0 ? void 0 : t.call(r, e);
821
+ var n = e.target.value;
822
+ var i = a.props.name;
823
+ (t = (r = a.props).onFocus) === null || t === void 0 ? void 0 : t.call(r, e, {
824
+ value: n,
825
+ name: i
826
+ });
822
827
  }));
823
828
  ke(xe(a), "handleInputBlur", (function(e) {
824
829
  var t, r;
825
- (t = (r = a.props).onBlur) === null || t === void 0 ? void 0 : t.call(r, e);
830
+ var n = e.target.value;
831
+ var i = a.props.name;
832
+ (t = (r = a.props).onBlur) === null || t === void 0 ? void 0 : t.call(r, e, {
833
+ value: n,
834
+ name: i
835
+ });
826
836
  }));
827
837
  ke(xe(a), "handleClear", (function(e) {
828
838
  var t, r;
@@ -870,8 +880,8 @@
870
880
  return n().createElement(Y, f, i);
871
881
  }
872
882
  var h = a.context;
873
- var m = (e = h.labelAttrs) === null || e === void 0 ? void 0 : e.text;
874
- var v = m ? (0, M._)("Clear ".concat(m, " text field")) : (0, M._)("Clear text field");
883
+ var v = (e = h.labelAttrs) === null || e === void 0 ? void 0 : e.text;
884
+ var m = v ? (0, M._)("Clear ".concat(v, " text field")) : (0, M._)("Clear text field");
875
885
  if (!c && r === "search") {
876
886
 
877
887
  return n().createElement(Y, f, n().createElement(F, {
@@ -880,7 +890,7 @@
880
890
  inline: false,
881
891
  icon: n().createElement(S(), {
882
892
  size: 1,
883
- screenReaderText: v
893
+ screenReaderText: m
884
894
  }),
885
895
  onClick: a.handleClear
886
896
  }), n().createElement(H, {
@@ -903,7 +913,7 @@
903
913
  appearance: "secondary",
904
914
  onClick: a.handleClear,
905
915
  icon: n().createElement(C(), {
906
- "aria-label": v,
916
+ "aria-label": m,
907
917
  inline: false,
908
918
  width: u,
909
919
  height: u
@@ -954,7 +964,7 @@
954
964
  a.handleResize = g()(a.handleResize, 100);
955
965
  return a;
956
966
  }
957
- me(r, [ {
967
+ ve(r, [ {
958
968
  key: "componentDidMount",
959
969
  value: function e() {
960
970
  l()(this.syncHeightWithShadow);
@@ -999,16 +1009,16 @@
999
1009
  key: "render",
1000
1010
  value: function e() {
1001
1011
  var t = this;
1002
- var r = this.props, a = r.append, i = r.autoCapitalize, o = r.autoComplete, l = r.autoCorrect, s = r.autoFocus, c = r.children, p = r.className, u = r.classNamePrivate, h = r.disabled, v = r.describedBy, y = r.elementRef, g = r.error, x = r.inline, w = r.inputClassName, C = r.inputId, k = r.labelledBy, S = r.maxLength, A = r.name, O = r.placeholder, I = r.prepend, j = r.required, P = r.spellCheck, _ = r.tabIndex, M = r.title, $ = de(r, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "maxLength", "name", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title" ]);
1012
+ var r = this.props, a = r.append, i = r.autoCapitalize, o = r.autoComplete, l = r.autoCorrect, s = r.autoFocus, c = r.children, p = r.className, u = r.classNamePrivate, h = r.disabled, m = r.describedBy, y = r.elementRef, g = r.error, x = r.inline, w = r.inputClassName, C = r.inputId, k = r.labelledBy, S = r.maxLength, A = r.name, O = r.placeholder, I = r.prepend, j = r.required, P = r.spellCheck, _ = r.tabIndex, M = r.title, $ = de(r, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "maxLength", "name", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title" ]);
1003
1013
  var D = pe(pe({}, b()($, (function(e, t) {
1004
1014
  return t === "role" || t.indexOf("aria-") === 0;
1005
1015
  }))), {}, {
1006
- "aria-describedby": v,
1016
+ "aria-describedby": m,
1007
1017
  "aria-labelledby": k,
1008
1018
  "aria-invalid": g || undefined,
1009
1019
  "aria-multiline": true
1010
1020
  });
1011
- var N = m()($, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick", "rowsMax", "rowsMin" ].concat(ne(d()(D))));
1021
+ var N = v()($, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick", "rowsMax", "rowsMin" ].concat(ne(d()(D))));
1012
1022
  var R = this.getDisplayValue();
1013
1023
  var q = {
1014
1024
  className: (0, T.toClassName)(p, w),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.22.0",
3
+ "version": "4.22.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.",
@@ -9,6 +9,16 @@ declare type ComboBoxChangeHandler = (event: React.ChangeEvent<HTMLInputElement
9
9
  }) => void;
10
10
  /** @public */
11
11
  declare type ComboBoxScrollBottomHandler = (event: React.UIEvent<HTMLDivElement> | React.KeyboardEvent<HTMLInputElement> | null) => void;
12
+ /** @public */
13
+ declare type ComboBoxBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
14
+ name?: string;
15
+ value: string;
16
+ }) => void;
17
+ /** @public */
18
+ declare type ComboBoxFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
19
+ name?: string;
20
+ value: string;
21
+ }) => void;
12
22
  interface ComboBoxPropsBase {
13
23
  animateLoading?: boolean;
14
24
  /** Append removes rounded borders and border from the right side. */
@@ -68,9 +78,9 @@ interface ComboBoxPropsBase {
68
78
  * for example: "No matching dashboards". You can insert content such as an error message or
69
79
  * communicate a minimum number of characters to enter to see results. */
70
80
  noOptionsMessage?: React.ReactNode;
71
- onBlur?: React.FocusEventHandler<HTMLInputElement>;
81
+ onBlur?: ComboBoxBlurHandler;
72
82
  onChange?: ComboBoxChangeHandler;
73
- onFocus?: React.FocusEventHandler<HTMLInputElement>;
83
+ onFocus?: ComboBoxFocusHandler;
74
84
  onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
75
85
  onSelect?: React.ReactEventHandler<HTMLInputElement>;
76
86
  /**
@@ -165,4 +175,4 @@ declare class ComboBox extends Component<ComboBoxProps, ComboBoxState> {
165
175
  render(): JSX.Element;
166
176
  }
167
177
  export default ComboBox;
168
- export { ComboBoxChangeHandler, Option, Divider, Heading };
178
+ export { ComboBoxBlurHandler, ComboBoxChangeHandler, ComboBoxFocusHandler, Option, Divider, Heading, };
@@ -7,6 +7,16 @@ declare type DateChangeHandler = (event: React.MouseEvent<HTMLButtonElement | HT
7
7
  name?: string;
8
8
  value: string;
9
9
  }) => void;
10
+ /** @public */
11
+ declare type DateBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
12
+ name?: string;
13
+ value: string;
14
+ }) => void;
15
+ /** @public */
16
+ declare type DateFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
17
+ name?: string;
18
+ value: string;
19
+ }) => void;
10
20
  interface DatePropsBase {
11
21
  /** Default date to display. Set this instead of value to make the Date uncontrolled. */
12
22
  defaultValue?: string;
@@ -50,14 +60,14 @@ interface DatePropsBase {
50
60
  * control when multiple controls share an onChange callback. */
51
61
  name?: string;
52
62
  /** A callback for when the input loses focus. */
53
- onBlur?: React.FocusEventHandler<HTMLInputElement>;
63
+ onBlur?: DateBlurHandler;
54
64
  /**
55
65
  * Return event and data object with date string (in YYYY-MM-DD format) when a date is
56
66
  * selected.
57
67
  */
58
68
  onChange?: DateChangeHandler;
59
69
  onClick?: React.MouseEventHandler<HTMLDivElement>;
60
- onFocus?: React.FocusEventHandler<HTMLInputElement>;
70
+ onFocus?: DateFocusHandler;
61
71
  onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
62
72
  /** @private */
63
73
  splunkTheme: AnyTheme;
@@ -140,5 +150,5 @@ declare const DateWithTheme: React.ForwardRefExoticComponent<Pick<Pick<Pick<Date
140
150
  };
141
151
  export default DateWithTheme;
142
152
  export { Date as DateWithoutTheme };
143
- export { DateChangeHandler };
153
+ export { DateBlurHandler, DateChangeHandler, DateFocusHandler };
144
154
  export type { DatePropsBase, DatePropsBaseControlled, DatePropsBaseUncontrolled };
@@ -18,17 +18,23 @@ interface ListPropsBase {
18
18
  */
19
19
  type?: 'disc' | 'decimal' | 'lower-alpha' | 'upper-alpha';
20
20
  }
21
+ declare const defaultProps: Required<Pick<ListPropsBase, 'type'>>;
21
22
  interface ListOrderedPropsBase extends ListPropsBase {
22
23
  elementRef?: React.Ref<HTMLOListElement>;
23
- ordered?: boolean;
24
- type: 'decimal' | 'lower-alpha' | 'upper-alpha';
24
+ ordered: true;
25
+ type?: never;
26
+ }
27
+ interface ListOrderedTypePropsBase extends ListPropsBase {
28
+ elementRef?: React.Ref<HTMLOListElement>;
29
+ ordered?: never;
30
+ type?: 'decimal' | 'lower-alpha' | 'upper-alpha';
25
31
  }
26
32
  interface ListUnorderedPropsBase extends ListPropsBase {
27
33
  elementRef?: React.Ref<HTMLUListElement>;
28
34
  type?: 'disc';
29
35
  }
30
- declare type ListOrderedProps = ComponentProps<ListOrderedPropsBase, 'ol'>;
31
- declare type ListUnorderedProps = ComponentProps<ListUnorderedPropsBase, 'ul'>;
36
+ declare type ListOrderedProps = ComponentProps<ListOrderedPropsBase | ListOrderedTypePropsBase, 'ol'> & typeof defaultProps;
37
+ declare type ListUnorderedProps = ComponentProps<ListUnorderedPropsBase, 'ul'> & typeof defaultProps;
32
38
  declare type ListProps = ListOrderedProps | ListUnorderedProps;
33
39
  declare function List({ children, elementRef, type, ordered, ...otherProps }: ListProps): JSX.Element;
34
40
  declare namespace List {
@@ -38,6 +44,7 @@ declare namespace List {
38
44
  ordered: PropTypes.Requireable<boolean>;
39
45
  type: PropTypes.Requireable<string>;
40
46
  };
47
+ var defaultProps: Required<Pick<ListPropsBase, "type">>;
41
48
  var Item: typeof import("./Item").default;
42
49
  }
43
50
  export default List;
@@ -8,6 +8,16 @@ declare type NumberChangeHandler = (event: React.ChangeEvent<HTMLInputElement |
8
8
  name?: string;
9
9
  value?: number;
10
10
  }) => void;
11
+ /** @public */
12
+ declare type NumberBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
13
+ name?: string;
14
+ value: string;
15
+ }) => void;
16
+ /** @public */
17
+ declare type NumberFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
18
+ name?: string;
19
+ value: string;
20
+ }) => void;
11
21
  interface NumberPropsBase {
12
22
  /** Append removes the rounded borders and the border from the right side and moves the
13
23
  * increment and decrement buttons to the left. */
@@ -65,7 +75,7 @@ interface NumberPropsBase {
65
75
  * control when multiple controls share an onChange callback. */
66
76
  name?: string;
67
77
  /** A callback for when the input loses focus. */
68
- onBlur?: React.FocusEventHandler<HTMLInputElement>;
78
+ onBlur?: NumberBlurHandler;
69
79
  /**
70
80
  * This is equivalent to onInput which is called on keydown, paste, and so on.
71
81
  * If value is set, this callback is required. This must set the value prop to retain the
@@ -73,7 +83,7 @@ interface NumberPropsBase {
73
83
  */
74
84
  onChange?: NumberChangeHandler;
75
85
  /** A callback for when the input takes focus. */
76
- onFocus?: React.FocusEventHandler<HTMLInputElement>;
86
+ onFocus?: NumberFocusHandler;
77
87
  /** A keydown callback can be used to prevent a certain input by utilizing the event argument. */
78
88
  onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
79
89
  /** A keyup callback. */
@@ -159,5 +169,5 @@ declare const NumberWithTheme: React.ForwardRefExoticComponent<Pick<Pick<Pick<Nu
159
169
  }, "ref" | "slot" | "style" | "title" | "children" | "value" | "onChange" | "onPause" | "name" | "className" | "color" | "id" | "lang" | "max" | "min" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "disabled" | "step" | "inline" | "elementRef" | "error" | "inputId" | "append" | "prepend" | "inputRef" | "labelledBy" | "locale" | "describedBy" | "useSyntheticPlaceholder" | "hideStepButtons" | "roundTo">>;
160
170
  export default NumberWithTheme;
161
171
  export type { Number as NumberWithoutTheme };
162
- export { NumberChangeHandler };
172
+ export { NumberBlurHandler, NumberChangeHandler, NumberFocusHandler };
163
173
  export type { NumberPropsBase, NumberPropsBaseControlled, NumberPropsBaseUncontrolled };
@@ -7,6 +7,16 @@ declare type SearchChangeHandler = (event: React.ChangeEvent<HTMLInputElement |
7
7
  name?: string;
8
8
  value: string;
9
9
  }) => void;
10
+ /** @public */
11
+ declare type SearchBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
12
+ name?: string;
13
+ value: string;
14
+ }) => void;
15
+ /** @public */
16
+ declare type SearchFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
17
+ name?: string;
18
+ value: string;
19
+ }) => void;
10
20
  interface SearchPropsBase {
11
21
  animateLoading?: boolean;
12
22
  /** All children must be instances of `Search.Option`. */
@@ -59,9 +69,9 @@ interface SearchPropsBase {
59
69
  * for example: "No matching dashboards". You can insert content such as an error message or
60
70
  * communicate a minimum number of characters to enter to see results. */
61
71
  noOptionsMessage?: React.ReactNode;
62
- onBlur?: React.FocusEventHandler<HTMLInputElement>;
72
+ onBlur?: SearchBlurHandler;
63
73
  onChange?: SearchChangeHandler;
64
- onFocus?: React.FocusEventHandler<HTMLInputElement>;
74
+ onFocus?: SearchFocusHandler;
65
75
  onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
66
76
  /**
67
77
  * A callback function invoked when the menu is scrolled.
@@ -98,4 +108,4 @@ declare namespace Search {
98
108
  var Heading: typeof import("../Menu/Heading").default;
99
109
  }
100
110
  export default Search;
101
- export { SearchChangeHandler, Option, Divider, Heading, SearchProps, SearchPropsBase, SearchPropsBaseControlled, SearchPropsBaseUncontrolled, };
111
+ export { SearchBlurHandler, SearchChangeHandler, SearchFocusHandler, Option, Divider, Heading, SearchProps, SearchPropsBase, SearchPropsBaseControlled, SearchPropsBaseUncontrolled, };
@@ -8,6 +8,16 @@ declare type TextChangeHandler = (event: React.ChangeEvent<HTMLInputElement | HT
8
8
  name?: string;
9
9
  value: string;
10
10
  }) => void;
11
+ /** @public */
12
+ declare type TextBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
13
+ name?: string;
14
+ value: string;
15
+ }) => void;
16
+ /** @public */
17
+ declare type TextFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
18
+ name?: string;
19
+ value: string;
20
+ }) => void;
11
21
  interface TextPropsBase {
12
22
  /** Setting the appearance to search will create a rounded input. */
13
23
  appearance?: 'default' | 'search';
@@ -88,7 +98,7 @@ interface TextPropsBase {
88
98
  * control when multiple controls share an onChange callback. */
89
99
  name?: string;
90
100
  /** A callback for when the input loses focus. */
91
- onBlur?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
101
+ onBlur?: TextBlurHandler;
92
102
  /**
93
103
  * This is equivalent to onInput which is called on keydown, paste, and so on.
94
104
  * If value is set, this callback is required. This must set the value prop to retain the
@@ -96,7 +106,7 @@ interface TextPropsBase {
96
106
  */
97
107
  onChange?: TextChangeHandler;
98
108
  /** A callback for when the input takes focus. */
99
- onFocus?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
109
+ onFocus?: TextFocusHandler;
100
110
  /** A keydown callback can be used to prevent a certain input by utilizing the event argument. */
101
111
  onKeyDown?: React.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
102
112
  /** A callback for when the text selection or cursor position changes. */
@@ -221,5 +231,5 @@ declare const TextWithTheme: React.ForwardRefExoticComponent<Pick<Pick<Pick<Text
221
231
  };
222
232
  export default TextWithTheme;
223
233
  export type { Text as TextWithoutTheme };
224
- export { TextChangeHandler };
234
+ export { TextBlurHandler, TextChangeHandler, TextFocusHandler };
225
235
  export type { TextPropsBase, TextPropsBaseControlled, TextPropsBaseUncontrolled };
@@ -8,6 +8,16 @@ declare type TextAreaChangeHandler = (event: React.ChangeEvent<HTMLTextAreaEleme
8
8
  name?: string;
9
9
  value: string;
10
10
  }) => void;
11
+ /** @public */
12
+ declare type TextAreaBlurHandler = (event: React.FocusEvent<HTMLTextAreaElement>, data: {
13
+ name?: string;
14
+ value: string;
15
+ }) => void;
16
+ /** @public */
17
+ declare type TextAreaFocusHandler = (event: React.FocusEvent<HTMLTextAreaElement>, data: {
18
+ name?: string;
19
+ value: string;
20
+ }) => void;
11
21
  interface TextAreaPropsBase {
12
22
  /**
13
23
  * @deprecated The `search` appearance has been marked for deprecation and will be removed in a future major version.
@@ -89,7 +99,7 @@ interface TextAreaPropsBase {
89
99
  * control when multiple controls share an onChange callback. */
90
100
  name?: string;
91
101
  /** A callback for when the input loses focus. */
92
- onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
102
+ onBlur?: TextAreaBlurHandler;
93
103
  /**
94
104
  * This is equivalent to onInput which is called on keydown, paste, and so on.
95
105
  * If value is set, this callback is required. This must set the value prop to retain the
@@ -97,7 +107,7 @@ interface TextAreaPropsBase {
97
107
  */
98
108
  onChange?: TextAreaChangeHandler;
99
109
  /** A callback for when the input takes focus. */
100
- onFocus?: React.FocusEventHandler<HTMLTextAreaElement>;
110
+ onFocus?: TextAreaFocusHandler;
101
111
  /** A keydown callback can be used to prevent a certain input by utilizing the event argument. */
102
112
  onKeyDown?: React.KeyboardEventHandler<HTMLTextAreaElement>;
103
113
  /** A callback for when the user clicks the textbox.
@@ -201,5 +211,5 @@ declare const TextAreaWithTheme: React.ForwardRefExoticComponent<Pick<Pick<Pick<
201
211
  };
202
212
  export default TextAreaWithTheme;
203
213
  export type { TextArea as TextAreaWithoutTheme };
204
- export { TextAreaChangeHandler };
214
+ export { TextAreaBlurHandler, TextAreaChangeHandler, TextAreaFocusHandler };
205
215
  export type { TextAreaPropsBase, TextAreaPropsBaseControlled, TextAreaPropsBaseUncontrolled };