@splunk/react-ui 4.37.0 → 4.39.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 (142) hide show
  1. package/Accordion.js +131 -153
  2. package/Anchor.js +50 -58
  3. package/Animation.js +64 -59
  4. package/AnimationToggle.js +59 -61
  5. package/Box.js +59 -67
  6. package/Breadcrumbs.js +113 -127
  7. package/Button.js +208 -219
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +50 -1
  11. package/Calendar.js +353 -414
  12. package/Card.js +183 -243
  13. package/CardLayout.js +86 -83
  14. package/Chip.js +104 -122
  15. package/Clickable.js +180 -198
  16. package/CloseButton.js +52 -60
  17. package/Code.js +24 -31
  18. package/CollapsiblePanel.js +172 -202
  19. package/Color.js +1107 -980
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +267 -305
  22. package/Concertina.js +406 -454
  23. package/ControlGroup.js +165 -194
  24. package/Date.js +116 -131
  25. package/DefinitionList.js +125 -149
  26. package/Divider.js +81 -79
  27. package/Dropdown.js +226 -237
  28. package/DualListbox.js +150 -186
  29. package/EventListener.js +4 -1
  30. package/File.js +1032 -955
  31. package/FormRows.js +281 -334
  32. package/Heading.js +27 -35
  33. package/Image.js +101 -116
  34. package/JSONTree.js +301 -344
  35. package/Layer.js +118 -126
  36. package/Link.js +141 -159
  37. package/List.js +61 -77
  38. package/MIGRATION.mdx +92 -38
  39. package/Markdown.js +288 -347
  40. package/Menu.js +512 -530
  41. package/Message.js +173 -196
  42. package/MessageBar.js +58 -66
  43. package/Modal.js +241 -290
  44. package/ModalLayer.js +130 -148
  45. package/Monogram.js +138 -138
  46. package/Multiselect.js +1600 -1923
  47. package/Number.js +159 -178
  48. package/Paginator.js +296 -335
  49. package/Paragraph.js +24 -32
  50. package/Popover.js +448 -441
  51. package/Progress.js +65 -75
  52. package/RadioBar.js +301 -303
  53. package/RadioList.js +77 -119
  54. package/Resize.js +105 -127
  55. package/ResultsMenu.js +373 -385
  56. package/ScreenReaderContent.js +130 -94
  57. package/Scroll.js +209 -244
  58. package/Search.js +375 -384
  59. package/Select.js +1076 -1354
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +192 -222
  62. package/SlidingPanels.js +238 -270
  63. package/SplitButton.js +222 -245
  64. package/StaticContent.js +68 -76
  65. package/StepBar.js +206 -205
  66. package/Switch.js +211 -236
  67. package/TabBar.js +222 -258
  68. package/TabLayout.js +114 -139
  69. package/Table.js +2017 -2180
  70. package/Text.js +401 -512
  71. package/TextArea.js +411 -441
  72. package/Tooltip.js +116 -132
  73. package/TransitionOpen.js +160 -178
  74. package/Tree.js +268 -287
  75. package/Typography.js +48 -52
  76. package/WaitSpinner.js +60 -68
  77. package/cypress/support/commands.ts +9 -0
  78. package/cypress/support/index.d.ts +6 -0
  79. package/cypress/tsconfig.cypress.json +1 -0
  80. package/docker-compose.yml +0 -1
  81. package/package.json +17 -17
  82. package/types/src/Button/Button.d.ts +20 -6
  83. package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
  84. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
  85. package/types/src/Color/Color.d.ts +5 -2
  86. package/types/src/Color/Palette.d.ts +6 -2
  87. package/types/src/ComboBox/Option.d.ts +1 -1
  88. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  89. package/types/src/Date/Date.d.ts +2 -3
  90. package/types/src/File/File.d.ts +2 -3
  91. package/types/src/File/Retry.d.ts +1 -2
  92. package/types/src/Link/Link.d.ts +3 -4
  93. package/types/src/Menu/Item.d.ts +24 -8
  94. package/types/src/Menu/Menu.d.ts +3 -3
  95. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  96. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  97. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  98. package/types/src/Multiselect/Option.d.ts +2 -0
  99. package/types/src/Number/Number.d.ts +3 -3
  100. package/types/src/Popover/Popover.d.ts +3 -4
  101. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  102. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  103. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  104. package/types/src/Search/Option.d.ts +16 -3
  105. package/types/src/Select/Option.d.ts +3 -1
  106. package/types/src/Select/OptionBase.d.ts +7 -5
  107. package/types/src/Select/Select.d.ts +2 -2
  108. package/types/src/Select/SelectAllOption.d.ts +4 -4
  109. package/types/src/Select/SelectBase.d.ts +0 -1
  110. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  111. package/types/src/Slider/Slider.d.ts +2 -3
  112. package/types/src/Slider/docs/examples/Error.d.ts +2 -0
  113. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  114. package/types/src/StepBar/Step.d.ts +1 -2
  115. package/types/src/TabBar/Tab.d.ts +1 -1
  116. package/types/src/TabBar/TabBar.d.ts +3 -1
  117. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  118. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  119. package/types/src/Table/Table.d.ts +0 -1
  120. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  121. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  122. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  123. package/types/src/Text/Text.d.ts +6 -4
  124. package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
  125. package/types/src/TextArea/TextArea.d.ts +2 -2
  126. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  127. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  128. package/useForceUpdate.js +30 -32
  129. package/useKeyPress.js +1 -1
  130. package/types/src/Button/docs/examples/Selected.d.ts +0 -2
  131. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  132. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  133. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  134. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  135. package/types/src/Slider/docs/examples/prisma/Error.d.ts +0 -2
  136. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  137. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  138. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  139. /package/types/src/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
  140. /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
  141. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  142. /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Slider.js CHANGED
@@ -61,7 +61,7 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- default: () => /* reexport */ ne
64
+ default: () => /* reexport */ te
65
65
  });
66
66
  // CONCATENATED MODULE: external "react"
67
67
  const r = require("react");
@@ -71,10 +71,10 @@
71
71
  var a = e.n(i);
72
72
  // CONCATENATED MODULE: external "decimal.js-light"
73
73
  const o = require("decimal.js-light");
74
- var s = e.n(o);
74
+ var l = e.n(o);
75
75
  // CONCATENATED MODULE: external "lodash/has"
76
- const l = require("lodash/has");
77
- var u = e.n(l);
76
+ const s = require("lodash/has");
77
+ var u = e.n(s);
78
78
  // CONCATENATED MODULE: external "lodash/keys"
79
79
  const c = require("lodash/keys");
80
80
  var p = e.n(c);
@@ -86,68 +86,31 @@
86
86
  // CONCATENATED MODULE: external "@splunk/themes"
87
87
  const h = require("@splunk/themes");
88
88
  // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
89
- const m = require("@splunk/react-ui/EventListener");
90
- var b = e.n(m);
89
+ const b = require("@splunk/react-ui/EventListener");
90
+ var m = e.n(b);
91
91
  // CONCATENATED MODULE: external "@splunk/react-ui/Popover"
92
92
  const y = require("@splunk/react-ui/Popover");
93
93
  var g = e.n(y);
94
94
  // CONCATENATED MODULE: external "styled-components"
95
95
  const k = require("styled-components");
96
- var x = e.n(k);
96
+ var w = e.n(k);
97
97
  // CONCATENATED MODULE: external "tinycolor2"
98
- const w = require("tinycolor2");
99
- var S = e.n(w);
98
+ const x = require("tinycolor2");
99
+ var S = e.n(x);
100
100
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
101
101
  const T = require("@splunk/react-ui/Box");
102
102
  var C = e.n(T);
103
103
  // CONCATENATED MODULE: ./src/Slider/SliderStyles.ts
104
- var M = x()(C()).withConfig({
104
+ var O = w()(C()).withConfig({
105
105
  displayName: "SliderStyles__StyledBox",
106
106
  componentId: "sc-16ooit4-0"
107
107
  })([ "", ";flex:1 1 auto;&[data-inline]{width:300px;}" ], h.mixins.reset("block"));
108
- var V = x().div.withConfig({
108
+ var E = w().div.withConfig({
109
109
  displayName: "SliderStyles__StyledInput",
110
110
  componentId: "sc-16ooit4-1"
111
111
  })([ "flex:1 0 0;vertical-align:middle;position:relative;cursor:default;height:", ";max-width:100%;" ], h.variables.inputHeight);
112
- var E = "1px";
113
- var O = function e(t) {
114
- var r = t.$error;
115
- return (0, h.pick)({
116
- enterprise: {
117
- light: h.variables.gray22,
118
- dark: h.variables.white
119
- },
120
- prisma: r ? h.variables.accentColorNegative : h.variables.contentColorActive
121
- });
122
- };
123
- var B = (0, h.pick)({
124
- enterprise: {
125
- dark: h.variables.gray20,
126
- light: h.variables.gray96
127
- },
128
- prisma: h.variables.neutral100
129
- });
130
- var $ = (0, h.pick)({
131
- enterprise: h.variables.gray60,
132
- prisma: h.variables.interactiveColorBorder
133
- });
134
- var _ = function e(t) {
135
- var r = t.$error, n = t.$position, i = t.$stepMarksWidth;
136
- /* stylelint-disable indentation */ return i !== undefined ? (0, k.css)([ "background-image:linear-gradient( to right,", ",", " ", ",transparent ", ",transparent 100% ),repeating-linear-gradient( to right,", ",", " ", ",transparent ", ",transparent ", "% ),linear-gradient( to right,", ",", " ", "%,", " ", "%,", " );" ], O({
137
- $error: r
138
- }), O({
139
- $error: r
140
- }), E, E, B, B, E, E, i, O({
141
- $error: r
142
- }), O({
143
- $error: r
144
- }), n, $, n, $) : (0, k.css)([ "background-image:linear-gradient( to right,", ",", " ", "%,", " ", "%,", " );" ], O({
145
- $error: r
146
- }), O({
147
- $error: r
148
- }), n, $, n, $);
149
- /* stylelint-enable indentation */ };
150
- var P = x().div.withConfig({
112
+ var V = "1px";
113
+ var B = w().div.withConfig({
151
114
  displayName: "SliderStyles__StyledSliderBar",
152
115
  componentId: "sc-16ooit4-2"
153
116
  })([ "position:absolute;top:", ";left:0;height:", ";width:100%;border-radius:2.5px;", "" ], (0,
@@ -159,23 +122,41 @@
159
122
  prisma: "4px"
160
123
  }), (function(e) {
161
124
  var t = e.$disabled, r = e.$error, n = e.$position, i = e.$stepMarksWidth;
162
- return t ? (0, k.css)([ "background-color:", ";" ], (0, h.pick)({
163
- enterprise: h.variables.gray92,
164
- prisma: h.variables.contentColorDisabled
165
- })) : _({
166
- $error: r,
167
- $position: n,
168
- $stepMarksWidth: i
125
+ if (t) {
126
+ return (0, k.css)([ "background-color:", ";" ], (0, h.pick)({
127
+ enterprise: h.variables.gray92,
128
+ prisma: h.variables.contentColorDisabled
129
+ }));
130
+ }
131
+ var a = r ? h.variables.accentColorNegative : (0, h.pick)({
132
+ prisma: h.variables.contentColorActive,
133
+ enterprise: {
134
+ light: h.variables.gray22,
135
+ dark: h.variables.white
136
+ }
137
+ });
138
+ var o = (0, h.pick)({
139
+ enterprise: {
140
+ dark: h.variables.gray20,
141
+ light: h.variables.gray96
142
+ },
143
+ prisma: h.variables.neutral100
169
144
  });
145
+ var l = (0, h.pick)({
146
+ enterprise: h.variables.gray60,
147
+ prisma: h.variables.interactiveColorBorder
148
+ });
149
+ return i !== undefined ? (0, k.css)([ "background-image:linear-gradient( to right,", ",", " ", ",transparent ", ",transparent 100% ),repeating-linear-gradient( to right,", ",", " ", ",transparent ", ",transparent ", "% ),linear-gradient( to right,", ",", " ", "%,", " ", "%,", " );" ], a, a, V, V, o, o, V, V, i, a, a, n, l, n, l) : (0,
150
+ k.css)([ "background-image:linear-gradient( to right,", ",", " ", "%,", " ", "%,", " );" ], a, a, n, l, n, l);
170
151
  }));
171
- var j = (0, h.pick)({
152
+ var M = (0, h.pick)({
172
153
  enterprise: 18,
173
154
  prisma: 20
174
155
  });
175
- var q = x().button.withConfig({
156
+ var _ = w().button.withConfig({
176
157
  displayName: "SliderStyles__StyledSliderThumb",
177
158
  componentId: "sc-16ooit4-3"
178
- })([ "", ";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:", ";}", "" ], h.mixins.reset("inline"), j, j, (0,
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:", ";}", "" ], h.mixins.reset("inline"), M, M, (0,
179
160
  h.pick)({
180
161
  enterprise: "9px",
181
162
  prisma: "10px"
@@ -201,13 +182,15 @@
201
182
  }), (0, h.pick)({
202
183
  enterprise: h.variables.gray92,
203
184
  prisma: h.variables.neutral400
204
- }), (0, h.pick)({
205
- prisma: function e(t) {
206
- var r = t.$error;
207
- return r && (0, k.css)([ "background-color:", ";&:focus:not([disabled]),&:active{background-color:", ";}" ], h.variables.accentColorNegative, h.mixins.overlayColors(h.variables.accentColorNegative, h.variables.interactiveColorOverlayActive));
208
- }
185
+ }), (function(e) {
186
+ var t = e.$error;
187
+ return t && (0, k.css)([ "background-color:", ";&:focus:not([disabled]),&:active{background-color:", ";}" ], h.variables.accentColorNegative, (0,
188
+ h.pick)({
189
+ enterprise: h.variables.errorColorD40,
190
+ prisma: h.mixins.overlayColors(h.variables.accentColorNegative, h.variables.interactiveColorOverlayActive)
191
+ }));
209
192
  }));
210
- var D = x().div.withConfig({
193
+ var P = w().div.withConfig({
211
194
  displayName: "SliderStyles__StyledPopoverContent",
212
195
  componentId: "sc-16ooit4-4"
213
196
  })([ "padding:", ";font-size:", ";line-height:", ";" ], (0, h.pick)({
@@ -220,150 +203,135 @@
220
203
  enterprise: "18px",
221
204
  prisma: "24px"
222
205
  }));
223
- var N = (0, k.css)([ "flex:0 0 auto;line-height:", ";", "" ], h.variables.inputHeight, (function(e) {
206
+ var j = (0, k.css)([ "flex:0 0 auto;line-height:", ";", "" ], h.variables.inputHeight, (function(e) {
224
207
  var t = e.$disabled;
225
208
  return t && (0, k.css)([ "color:", ";" ], (0, h.pick)({
226
209
  enterprise: h.variables.textDisabledColor,
227
210
  prisma: h.variables.contentColorDisabled
228
211
  }));
229
212
  }));
230
- var R = x()(C()).withConfig({
213
+ var q = w()(C()).withConfig({
231
214
  displayName: "SliderStyles__StyledMinLabelBox",
232
215
  componentId: "sc-16ooit4-5"
233
- })([ "", ";margin-right:", ";text-align:right;" ], N, (0, h.pick)({
216
+ })([ "", ";margin-right:", ";text-align:right;" ], j, (0, h.pick)({
234
217
  enterprise: "15px",
235
218
  prisma: "16px"
236
219
  }));
237
- var F = x()(C()).withConfig({
220
+ var D = w()(C()).withConfig({
238
221
  displayName: "SliderStyles__StyledMaxLabelBox",
239
222
  componentId: "sc-16ooit4-6"
240
- })([ "", ";margin-left:", ";text-align:left;" ], N, (0, h.pick)({
223
+ })([ "", ";margin-left:", ";text-align:left;" ], j, (0, h.pick)({
241
224
  enterprise: "15px",
242
225
  prisma: "16px"
243
226
  }));
244
227
  // CONCATENATED MODULE: ./src/Slider/Slider.tsx
245
- function I(e) {
228
+ function N(e) {
246
229
  "@babel/helpers - typeof";
247
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
248
- I = function e(t) {
249
- return typeof t;
250
- };
251
- } else {
252
- I = function e(t) {
253
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
254
- };
255
- }
256
- return I(e);
230
+ return N = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
231
+ return typeof e;
232
+ } : function(e) {
233
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
234
+ }, N(e);
257
235
  }
258
- function L() {
259
- L = Object.assign || function(e) {
236
+ function $() {
237
+ return $ = Object.assign ? Object.assign.bind() : function(e) {
260
238
  for (var t = 1; t < arguments.length; t++) {
261
239
  var r = arguments[t];
262
240
  for (var n in r) {
263
- if (Object.prototype.hasOwnProperty.call(r, n)) {
264
- e[n] = r[n];
265
- }
241
+ ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
266
242
  }
267
243
  }
268
244
  return e;
269
- };
270
- return L.apply(this, arguments);
245
+ }, $.apply(null, arguments);
271
246
  }
272
- function W(e, t) {
273
- if (!(e instanceof t)) {
274
- throw new TypeError("Cannot call a class as a function");
275
- }
247
+ function F(e, t) {
248
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
276
249
  }
277
- function A(e, t) {
250
+ function I(e, t) {
278
251
  for (var r = 0; r < t.length; r++) {
279
252
  var n = t[r];
280
- n.enumerable = n.enumerable || false;
281
- n.configurable = true;
282
- if ("value" in n) n.writable = true;
283
- Object.defineProperty(e, n.key, n);
253
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
254
+ Object.defineProperty(e, G(n.key), n);
284
255
  }
285
256
  }
286
- function z(e, t, r) {
287
- if (t) A(e.prototype, t);
288
- if (r) A(e, r);
289
- return e;
257
+ function L(e, t, r) {
258
+ return t && I(e.prototype, t), r && I(e, r), Object.defineProperty(e, "prototype", {
259
+ writable: !1
260
+ }), e;
290
261
  }
291
- function K(e, t) {
292
- if (typeof t !== "function" && t !== null) {
293
- throw new TypeError("Super expression must either be null or a function");
294
- }
262
+ function R(e, t) {
263
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
295
264
  e.prototype = Object.create(t && t.prototype, {
296
265
  constructor: {
297
266
  value: e,
298
- writable: true,
299
- configurable: true
267
+ writable: !0,
268
+ configurable: !0
300
269
  }
301
- });
302
- if (t) U(e, t);
270
+ }), Object.defineProperty(e, "prototype", {
271
+ writable: !1
272
+ }), t && A(e, t);
303
273
  }
304
- function U(e, t) {
305
- U = Object.setPrototypeOf || function e(t, r) {
306
- t.__proto__ = r;
307
- return t;
308
- };
309
- return U(e, t);
274
+ function A(e, t) {
275
+ return A = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
276
+ return e.__proto__ = t, e;
277
+ }, A(e, t);
310
278
  }
311
- function H(e) {
312
- var t = J();
313
- return function r() {
314
- var n = Q(e), i;
279
+ function W(e) {
280
+ var t = U();
281
+ return function() {
282
+ var r, n = H(e);
315
283
  if (t) {
316
- var a = Q(this).constructor;
317
- i = Reflect.construct(n, arguments, a);
318
- } else {
319
- i = n.apply(this, arguments);
320
- }
321
- return X(this, i);
284
+ var i = H(this).constructor;
285
+ r = Reflect.construct(n, arguments, i);
286
+ } else r = n.apply(this, arguments);
287
+ return z(this, r);
322
288
  };
323
289
  }
324
- function X(e, t) {
325
- if (t && (I(t) === "object" || typeof t === "function")) {
326
- return t;
327
- }
328
- return G(e);
290
+ function z(e, t) {
291
+ if (t && ("object" == N(t) || "function" == typeof t)) return t;
292
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
293
+ return K(e);
329
294
  }
330
- function G(e) {
331
- if (e === void 0) {
332
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
333
- }
295
+ function K(e) {
296
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
334
297
  return e;
335
298
  }
336
- function J() {
337
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
338
- if (Reflect.construct.sham) return false;
339
- if (typeof Proxy === "function") return true;
299
+ function U() {
340
300
  try {
341
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
342
- return true;
343
- } catch (e) {
344
- return false;
345
- }
301
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
302
+ } catch (e) {}
303
+ return (U = function t() {
304
+ return !!e;
305
+ })();
346
306
  }
347
- function Q(e) {
348
- Q = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
349
- return t.__proto__ || Object.getPrototypeOf(t);
350
- };
351
- return Q(e);
307
+ function H(e) {
308
+ return H = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
309
+ return e.__proto__ || Object.getPrototypeOf(e);
310
+ }, H(e);
352
311
  }
353
- function Y(e, t, r) {
354
- if (t in e) {
355
- Object.defineProperty(e, t, {
356
- value: r,
357
- enumerable: true,
358
- configurable: true,
359
- writable: true
360
- });
361
- } else {
362
- e[t] = r;
312
+ function X(e, t, r) {
313
+ return (t = G(t)) in e ? Object.defineProperty(e, t, {
314
+ value: r,
315
+ enumerable: !0,
316
+ configurable: !0,
317
+ writable: !0
318
+ }) : e[t] = r, e;
319
+ }
320
+ function G(e) {
321
+ var t = J(e, "string");
322
+ return "symbol" == N(t) ? t : t + "";
323
+ }
324
+ function J(e, t) {
325
+ if ("object" != N(e) || !e) return e;
326
+ var r = e[Symbol.toPrimitive];
327
+ if (void 0 !== r) {
328
+ var n = r.call(e, t || "default");
329
+ if ("object" != N(n)) return n;
330
+ throw new TypeError("@@toPrimitive must return a primitive value.");
363
331
  }
364
- return e;
332
+ return ("string" === t ? String : Number)(e);
365
333
  }
366
- var Z = {
334
+ /** @public */ var Q = {
367
335
  defaultValue: a().number,
368
336
  describedBy: a().string,
369
337
  disabled: a().bool,
@@ -386,7 +354,7 @@
386
354
  splunkTheme: a().object,
387
355
  value: a().number
388
356
  };
389
- var ee = {
357
+ var Y = {
390
358
  disabled: false,
391
359
  error: false,
392
360
  inline: false,
@@ -395,17 +363,17 @@
395
363
  step: 1,
396
364
  stepMarks: "focus"
397
365
  };
398
- var te = function(e) {
399
- K(r, e);
400
- var t = H(r);
366
+ var Z = function(e) {
367
+ R(r, e);
368
+ var t = W(r);
401
369
  // @docs-props-type SliderPropsBase
402
370
  function r(e) {
403
371
  var n;
404
- W(this, r);
372
+ F(this, r);
405
373
  n = t.call(this, e);
406
- Y(G(n), "controlledExternally", void 0);
407
- Y(G(n), "sliderThumb", null);
408
- Y(G(n), "checkPositionBounds", (function(e) {
374
+ X(K(n), "controlledExternally", void 0);
375
+ X(K(n), "sliderThumb", null);
376
+ X(K(n), "checkPositionBounds", (function(e) {
409
377
  if (e > 100) {
410
378
  return 100;
411
379
  }
@@ -414,7 +382,7 @@
414
382
  }
415
383
  return e;
416
384
  }));
417
- Y(G(n), "checkValueBounds", (function(e) {
385
+ X(K(n), "checkValueBounds", (function(e) {
418
386
  if (e > n.props.max) {
419
387
  return n.props.max;
420
388
  }
@@ -423,13 +391,13 @@
423
391
  }
424
392
  return e;
425
393
  }));
426
- Y(G(n), "handleBlur", (function() {
394
+ X(K(n), "handleBlur", (function() {
427
395
  n.setState({
428
396
  isFocused: false,
429
397
  showTooltip: false
430
398
  });
431
399
  }));
432
- Y(G(n), "handleClick", (function(e) {
400
+ X(K(n), "handleClick", (function(e) {
433
401
  var t = n.percentageFromEvent(e);
434
402
  if (t !== undefined) {
435
403
  var r = n.roundValueToStep(n.positionToValue(t));
@@ -438,21 +406,21 @@
438
406
  });
439
407
  }
440
408
  }));
441
- Y(G(n), "handleFocus", (function() {
409
+ X(K(n), "handleFocus", (function() {
442
410
  n.setState({
443
411
  isFocused: true,
444
412
  showTooltip: true
445
413
  });
446
414
  }));
447
- Y(G(n), "getValueOffset", (function(e, t) {
415
+ X(K(n), "getValueOffset", (function(e, t) {
448
416
  var r = n.props, i = r.min, a = r.step;
449
- var o = new (s())(e).minus(i).modulo(a).toNumber();
417
+ var o = new (l())(e).minus(i).modulo(a).toNumber();
450
418
  if (o > 0) {
451
419
  return t === "forward" ? a - o : o;
452
420
  }
453
421
  return a;
454
422
  }));
455
- Y(G(n), "handleKeyDown", (function(e) {
423
+ X(K(n), "handleKeyDown", (function(e) {
456
424
  var t = n.getValue();
457
425
  if (t !== undefined) {
458
426
  if ((0, v.keycode)(e.nativeEvent) === "right") {
@@ -474,12 +442,12 @@
474
442
  });
475
443
  }
476
444
  }));
477
- Y(G(n), "handleMount", (function(e) {
445
+ X(K(n), "handleMount", (function(e) {
478
446
  n.setState({
479
447
  sliderBar: e
480
448
  });
481
449
  }));
482
- Y(G(n), "handleMouseDown", (function(e) {
450
+ X(K(n), "handleMouseDown", (function(e) {
483
451
  e.preventDefault();
484
452
  n.focus();
485
453
  n.setState({
@@ -487,19 +455,19 @@
487
455
  showTooltip: true
488
456
  });
489
457
  }));
490
- Y(G(n), "handleMouseEnter", (function() {
458
+ X(K(n), "handleMouseEnter", (function() {
491
459
  n.setState({
492
460
  showTooltip: true
493
461
  });
494
462
  }));
495
- Y(G(n), "handleMouseLeave", (function() {
463
+ X(K(n), "handleMouseLeave", (function() {
496
464
  if (!n.state.selected) {
497
465
  n.setState({
498
466
  showTooltip: false
499
467
  });
500
468
  }
501
469
  }));
502
- Y(G(n), "handleMouseMove", (function(e) {
470
+ X(K(n), "handleMouseMove", (function(e) {
503
471
  if (n.state.selected) {
504
472
  var t = n.percentageFromEvent(e);
505
473
  if (t !== undefined) {
@@ -510,13 +478,13 @@
510
478
  }
511
479
  }
512
480
  }));
513
- Y(G(n), "handleMouseUp", (function() {
481
+ X(K(n), "handleMouseUp", (function() {
514
482
  n.setState({
515
483
  selected: false,
516
484
  showTooltip: false
517
485
  });
518
486
  }));
519
- Y(G(n), "percentageFromEvent", (function(e) {
487
+ X(K(n), "percentageFromEvent", (function(e) {
520
488
  if (n.state.sliderBar === null) {
521
489
  return undefined;
522
490
  }
@@ -524,19 +492,19 @@
524
492
  var r = e.clientX - t.left;
525
493
  return n.checkPositionBounds(r / t.width * 100);
526
494
  }));
527
- Y(G(n), "positionToValue", (function(e) {
495
+ X(K(n), "positionToValue", (function(e) {
528
496
  var t = n.props.max - n.props.min;
529
497
  return e / 100 * t + n.props.min;
530
498
  }));
531
- Y(G(n), "roundValueToStep", (function(e) {
499
+ X(K(n), "roundValueToStep", (function(e) {
532
500
  var t = n.props, r = t.step, i = t.min, a = t.max;
533
501
  // Handles if the max is in between steps but val is larger than the halfway point between last step mark and max
534
502
  if (e > a - (a - i) % r / 2) {
535
503
  return a;
536
504
  }
537
- return new (s())(e).minus(i).div(r).todp(0).mul(r).add(i).toNumber();
505
+ return new (l())(e).minus(i).div(r).todp(0).mul(r).add(i).toNumber();
538
506
  }));
539
- Y(G(n), "valueToPosition", (function(e) {
507
+ X(K(n), "valueToPosition", (function(e) {
540
508
  if (e === undefined) {
541
509
  return undefined;
542
510
  }
@@ -556,7 +524,7 @@
556
524
  if (e.min >= e.max && process.env.NODE_ENV !== "production") {}
557
525
  return n;
558
526
  }
559
- z(r, [ {
527
+ L(r, [ {
560
528
  key: "componentDidUpdate",
561
529
  value: function e(t) {
562
530
  if (false) {}
@@ -574,8 +542,8 @@
574
542
  var i = this.getValue();
575
543
  var a = this.props.name;
576
544
  if (i !== n) {
577
- var o, s;
578
- (o = (s = this.props).onChange) === null || o === void 0 ? void 0 : o.call(s, t, {
545
+ var o, l;
546
+ (o = (l = this.props).onChange) === null || o === void 0 ? void 0 : o.call(l, t, {
579
547
  value: n,
580
548
  name: a
581
549
  });
@@ -586,7 +554,9 @@
586
554
  }
587
555
  }
588
556
  }
589
- }, {
557
+ // If the current value is in between a step, i.e. defaultValue is not at a
558
+ // step mark, this function handles navigating to the next correct step
559
+ }, {
590
560
  key: "focus",
591
561
  /**
592
562
  * Places focus on the slider.
@@ -610,10 +580,10 @@
610
580
  if (o === null) {
611
581
  return undefined;
612
582
  }
613
- var s = Math.round((r - n) / i);
614
- var l = o.getBoundingClientRect();
615
- var u = j(a);
616
- return l.width / s > u / 2 ? this.stepWidthInPercentage() : undefined;
583
+ var l = Math.round((r - n) / i);
584
+ var s = o.getBoundingClientRect();
585
+ var u = M(a);
586
+ return s.width / l > u / 2 ? this.stepWidthInPercentage() : undefined;
617
587
  }
618
588
  }, {
619
589
  key: "isControlled",
@@ -624,48 +594,48 @@
624
594
  key: "render",
625
595
  value: function e() {
626
596
  var t = this;
627
- var i = this.props, a = i.describedBy, o = i.disabled, s = i.displayValue, l = i.elementRef, u = i.error, c = i.inline, d = i.labelledBy, v = i.max, h = i.maxLabel, m = i.min, y = i.minLabel, k = i.required, x = i.stepMarks;
628
- var w = this.state, S = w.isFocused, T = w.selected, C = w.sliderBar;
629
- var E = this.getValue();
630
- var O = this.valueToPosition(E);
631
- var B = x === "focus" && S || x === "always";
632
- var $ = B && C ? this.stepMarksWidth() : undefined;
633
- var _ = f()(this.props, p()(r.propTypes));
597
+ var i = this.props, a = i.describedBy, o = i.disabled, l = i.displayValue, s = i.elementRef, u = i.error, c = i.inline, d = i.labelledBy, v = i.max, h = i.maxLabel, b = i.min, y = i.minLabel, k = i.required, w = i.stepMarks;
598
+ var x = this.state, S = x.isFocused, T = x.selected, C = x.sliderBar;
599
+ var V = this.getValue();
600
+ var M = this.valueToPosition(V);
601
+ var j = w === "focus" && S || w === "always";
602
+ var N = j && C ? this.stepMarksWidth() : undefined;
603
+ var F = f()(this.props, p()(r.propTypes));
634
604
  /* eslint-disable jsx-a11y/no-static-element-interactions */
635
- return n().createElement(M, L({
605
+ return n().createElement(O, $({
636
606
  "data-test": "slider",
637
- "data-test-value": E,
638
- elementRef: l,
607
+ "data-test-value": V,
608
+ elementRef: s,
639
609
  flex: true,
640
610
  inline: c
641
- }, _), T && n().createElement(n().Fragment, null, n().createElement(b(), {
611
+ }, F), T && n().createElement(n().Fragment, null, n().createElement(m(), {
642
612
  target: window,
643
613
  eventType: "mouseup",
644
614
  listener: this.handleMouseUp
645
- }), n().createElement(b(), {
615
+ }), n().createElement(m(), {
646
616
  target: window,
647
617
  eventType: "mousemove",
648
618
  listener: this.handleMouseMove
649
- })), y !== null && n().createElement(R, {
619
+ })), y !== null && n().createElement(q, {
650
620
  "data-test": "min-label",
651
621
  $disabled: o
652
- }, y || m), n().createElement(V, {
622
+ }, y || b), n().createElement(E, {
653
623
  onClick: o ? undefined : this.handleClick
654
- }, n().createElement(P, {
624
+ }, n().createElement(B, {
655
625
  "aria-required": k,
656
626
  "data-test": "bar",
657
627
  $disabled: o,
658
628
  ref: this.handleMount,
659
629
  $error: u,
660
- $position: O,
661
- $stepMarksWidth: $
662
- }), n().createElement(q, {
630
+ $position: M,
631
+ $stepMarksWidth: N
632
+ }), n().createElement(_, {
663
633
  "aria-describedby": a,
664
634
  "aria-labelledby": d,
665
635
  "aria-invalid": u,
666
636
  "aria-valuemax": v,
667
- "aria-valuemin": m,
668
- "aria-valuenow": E,
637
+ "aria-valuemin": b,
638
+ "aria-valuenow": V,
669
639
  "data-test": "handle",
670
640
  onBlur: this.handleBlur,
671
641
  onMouseEnter: this.handleMouseEnter,
@@ -679,13 +649,13 @@
679
649
  role: "slider",
680
650
  disabled: o,
681
651
  $error: u,
682
- $position: O
652
+ $position: M
683
653
  }), n().createElement(g(), {
684
654
  open: this.state.showTooltip,
685
655
  anchor: this.sliderThumb,
686
656
  appearance: "inverted",
687
657
  align: "center"
688
- }, n().createElement(D, null, s || E))), h !== null && n().createElement(F, {
658
+ }, n().createElement(P, null, l || V))), h !== null && n().createElement(D, {
689
659
  "data-test": "max-label",
690
660
  $disabled: o
691
661
  }, h || v));
@@ -693,11 +663,11 @@
693
663
  } ]);
694
664
  return r;
695
665
  }(r.Component);
696
- Y(te, "propTypes", Z);
697
- Y(te, "defaultProps", ee);
698
- var re = (0, h.withSplunkTheme)(te);
699
- re.propTypes = te.propTypes;
700
- /* harmony default export */ const ne = re;
666
+ X(Z, "propTypes", Q);
667
+ X(Z, "defaultProps", Y);
668
+ var ee = (0, h.withSplunkTheme)(Z);
669
+ ee.propTypes = Z.propTypes;
670
+ /* harmony default export */ const te = ee;
701
671
  // CONCATENATED MODULE: ./src/Slider/index.ts
702
672
  module.exports = t;
703
673
  /******/})();