@splunk/react-ui 4.21.1 → 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/Color.js CHANGED
@@ -61,9 +61,9 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- default: () => /* reexport */ Le,
65
- defaultPalette: () => /* reexport */ Ve,
66
- isValidHEX: () => /* reexport */ He
64
+ default: () => /* reexport */ Qe,
65
+ defaultPalette: () => /* reexport */ Ne,
66
+ isValidHEX: () => /* reexport */ Fe
67
67
  });
68
68
  // CONCATENATED MODULE: external "react"
69
69
  const r = require("react");
@@ -78,8 +78,8 @@
78
78
  const s = require("lodash/has");
79
79
  var u = e.n(s);
80
80
  // CONCATENATED MODULE: external "lodash/includes"
81
- const p = require("lodash/includes");
82
- var c = e.n(p);
81
+ const c = require("lodash/includes");
82
+ var p = e.n(c);
83
83
  // CONCATENATED MODULE: external "lodash/keys"
84
84
  const d = require("lodash/keys");
85
85
  var f = e.n(d);
@@ -87,8 +87,8 @@
87
87
  const v = require("lodash/omit");
88
88
  var h = e.n(v);
89
89
  // CONCATENATED MODULE: external "lodash/slice"
90
- const y = require("lodash/slice");
91
- var m = e.n(y);
90
+ const m = require("lodash/slice");
91
+ var y = e.n(m);
92
92
  // CONCATENATED MODULE: external "lodash/startsWith"
93
93
  const b = require("lodash/startsWith");
94
94
  var g = e.n(b);
@@ -100,18 +100,18 @@
100
100
  var k = e.n(S);
101
101
  // CONCATENATED MODULE: external "tinycolor2"
102
102
  const C = require("tinycolor2");
103
- var P = e.n(C);
103
+ var E = e.n(C);
104
104
  // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
105
- const E = require("@splunk/react-ui/Dropdown");
106
- var O = e.n(E);
105
+ const P = require("@splunk/react-ui/Dropdown");
106
+ var O = e.n(P);
107
107
  // CONCATENATED MODULE: external "@splunk/themes"
108
108
  const _ = require("@splunk/themes");
109
109
  // CONCATENATED MODULE: external "@splunk/ui-utils/color"
110
110
  const q = require("@splunk/ui-utils/color");
111
111
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
112
- const j = require("@splunk/ui-utils/i18n");
112
+ const I = require("@splunk/ui-utils/i18n");
113
113
  // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
114
- const I = require("@splunk/ui-utils/keyboard");
114
+ const j = require("@splunk/ui-utils/keyboard");
115
115
  // CONCATENATED MODULE: external "styled-components"
116
116
  const T = require("styled-components");
117
117
  var R = e.n(T);
@@ -119,11 +119,11 @@
119
119
  const B = require("@splunk/react-ui/Text");
120
120
  var V = e.n(B);
121
121
  // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
122
- const N = require("@splunk/react-ui/ScreenReaderContent");
123
- var A = e.n(N);
122
+ const A = require("@splunk/react-ui/ScreenReaderContent");
123
+ var D = e.n(A);
124
124
  // CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
125
- const D = require("@splunk/react-icons/Checkmark");
126
- var $ = e.n(D);
125
+ const N = require("@splunk/react-icons/Checkmark");
126
+ var $ = e.n(N);
127
127
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
128
128
  const H = require("@splunk/react-ui/Clickable");
129
129
  var z = e.n(H);
@@ -171,7 +171,7 @@
171
171
  }), _.variables.focusColor, _.variables.focusShadow, (0, _.pick)({
172
172
  enterprise: {
173
173
  comfortable: (0, T.css)([ "width:32px;height:32px;" ]),
174
- compact: (0, T.css)([ "width:28px;height:28px;" ])
174
+ compact: (0, T.css)([ "width:24px;height:24px;" ])
175
175
  },
176
176
  prisma: (0, T.css)([ "width:24px;height:24px;" ])
177
177
  }), (function(e) {
@@ -192,8 +192,8 @@
192
192
  return t && (0, T.css)([ "display:flex;align-items:center;justify-content:center;" ]);
193
193
  }));
194
194
  // CONCATENATED MODULE: ./src/Color/Swatch.tsx
195
- function Q() {
196
- Q = Object.assign || function(e) {
195
+ function U() {
196
+ U = Object.assign || function(e) {
197
197
  for (var t = 1; t < arguments.length; t++) {
198
198
  var r = arguments[t];
199
199
  for (var n in r) {
@@ -204,11 +204,11 @@
204
204
  }
205
205
  return e;
206
206
  };
207
- return Q.apply(this, arguments);
207
+ return U.apply(this, arguments);
208
208
  }
209
- function U(e, t) {
209
+ function W(e, t) {
210
210
  if (e == null) return {};
211
- var r = W(e, t);
211
+ var r = Q(e, t);
212
212
  var n, a;
213
213
  if (Object.getOwnPropertySymbols) {
214
214
  var o = Object.getOwnPropertySymbols(e);
@@ -221,7 +221,7 @@
221
221
  }
222
222
  return r;
223
223
  }
224
- function W(e, t) {
224
+ function Q(e, t) {
225
225
  if (e == null) return {};
226
226
  var r = {};
227
227
  var n = Object.keys(e);
@@ -248,8 +248,8 @@
248
248
  showSelected: o().bool
249
249
  };
250
250
  var G = n().forwardRef((function(e, t) {
251
- var r = e.append, a = e.error, o = a === void 0 ? false : a, l = e.onClick, i = e.prepend, s = e.value, u = e.noBorder, p = e.showSelected, c = U(e, [ "append", "error", "onClick", "prepend", "value", "noBorder", "showSelected" ]);
252
- var d = s === null || s === undefined ? (0, j._)("No color") : s;
251
+ var r = e.append, a = e.error, o = a === void 0 ? false : a, l = e.onClick, i = e.prepend, s = e.value, u = e.noBorder, c = e.showSelected, p = W(e, [ "append", "error", "onClick", "prepend", "value", "noBorder", "showSelected" ]);
252
+ var d = s === null || s === undefined ? (0, I._)("No color") : s;
253
253
  // Only valid hexadecimal strings, 'transparent' and `null` are allowed for background colors
254
254
  // Invalid values are converted to `undefined`
255
255
  var f = s;
@@ -257,7 +257,7 @@
257
257
  f = undefined;
258
258
  }
259
259
 
260
- return n().createElement(L, Q({
260
+ return n().createElement(L, U({
261
261
  onClick: function e(t) {
262
262
  return l === null || l === void 0 ? void 0 : l(t, {
263
263
  value: s
@@ -269,13 +269,13 @@
269
269
  $prepend: i,
270
270
  $hasError: o,
271
271
  $noBorder: u,
272
- $showSelected: p,
272
+ $showSelected: c,
273
273
  "data-test": "swatch",
274
274
  "data-test-value": s
275
- }, c), p && n().createElement(M, {
276
- "aria-label": (0, j._)("Selected"),
275
+ }, p), c && n().createElement(M, {
276
+ "aria-label": (0, I._)("Selected"),
277
277
  role: "presentation"
278
- }), n().createElement(A(), null, d));
278
+ }), n().createElement(D(), null, d));
279
279
  }));
280
280
  G.propTypes = X;
281
281
  /* harmony default export */ const J = G;
@@ -284,9 +284,15 @@
284
284
  displayName: "ColorStyles__StyledColor",
285
285
  componentId: "jxrost-0"
286
286
  })([ "", ";flex-direction:row;" ], _.mixins.reset("flex"));
287
- var Z = R().div.withConfig({
288
- displayName: "ColorStyles__StyledInput",
287
+ var Z = R()(J).withConfig({
288
+ displayName: "ColorStyles__StyledInputSwatch",
289
289
  componentId: "jxrost-1"
290
+ })([ "", "" ], (0, _.pick)({
291
+ compact: (0, T.css)([ "width:28px;height:28px;" ])
292
+ }));
293
+ var ee = R().div.withConfig({
294
+ displayName: "ColorStyles__StyledInput",
295
+ componentId: "jxrost-2"
290
296
  })([ "", ";" ], (0, _.pick)({
291
297
  enterprise: (0, T.css)([ "display:flex;width:100%;" ]),
292
298
  prisma: (0, T.css)([ "position:relative;", "" ], (function(e) {
@@ -294,16 +300,16 @@
294
300
  return t ? (0, T.css)([ "width:80px;" ]) : (0, T.css)([ "flex:0 1 auto;min-width:0;" ]);
295
301
  }))
296
302
  }));
297
- var ee = R()(V()).withConfig({
303
+ var te = R()(V()).withConfig({
298
304
  displayName: "ColorStyles__StyledInputText",
299
- componentId: "jxrost-2"
305
+ componentId: "jxrost-3"
300
306
  })([ "", "" ], (function(e) {
301
307
  var t = e.$inDropdown;
302
308
  return t && (0, T.css)([ "font-size:12px;" ]);
303
309
  }));
304
- var te = R()(J).withConfig({
310
+ var re = R()(J).withConfig({
305
311
  displayName: "ColorStyles__StyledToggleSwatch",
306
- componentId: "jxrost-3"
312
+ componentId: "jxrost-4"
307
313
  })([ "", "" ], (0, _.pick)({
308
314
  prisma: {
309
315
  comfortable: (0, T.css)([ "width:40px;height:40px;" ]),
@@ -315,157 +321,165 @@
315
321
  }
316
322
  }));
317
323
  // CONCATENATED MODULE: external "@splunk/react-icons/ChevronDown"
318
- const re = require("@splunk/react-icons/ChevronDown");
319
- var ne = e.n(re);
324
+ const ne = require("@splunk/react-icons/ChevronDown");
325
+ var ae = e.n(ne);
326
+ // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
327
+ const oe = require("@splunk/react-ui/Divider");
328
+ var le = e.n(oe);
320
329
  // CONCATENATED MODULE: ./src/Color/PaletteStyles.ts
321
- var ae = R().div.withConfig({
330
+ var ie = R().div.withConfig({
322
331
  displayName: "PaletteStyles__StyledPalette",
323
332
  componentId: "qgv9v9-0"
324
- })([ "width:", ";padding:", ";", "" ], (0, _.pick)({
325
- enterprise: "180px",
326
- prisma: "224px"
327
- }), (0, _.pick)({
328
- enterprise: _.variables.spacingHalf,
329
- prisma: "8px"
330
- }), (0, _.pick)({
331
- prisma: (0, T.css)([ "display:flex;flex-direction:column;border-radius:2px;" ])
332
- }));
333
- var oe = R().ul.withConfig({
333
+ })([ "width:220px;padding:", ";" ], _.variables.spacingSmall);
334
+ var se = R().ul.withConfig({
334
335
  displayName: "PaletteStyles__StyledSwatches",
335
336
  componentId: "qgv9v9-1"
336
- })([ "", ";margin-bottom:", ";margin-right:", ";", "" ], _.mixins.reset("block"), (0,
337
- _.pick)({
338
- enterprise: "6px"
339
- }), (0, _.pick)({
340
- enterprise: "-6px"
341
- }), (0, _.pick)({
342
- prisma: (0, T.css)([ "position:relative;" ])
343
- }));
344
- var le = R().li.withConfig({
337
+ })([ "", ";margin-bottom:", ";" ], _.mixins.reset("block"), _.variables.spacingQuarter);
338
+ var ue = R().li.withConfig({
345
339
  displayName: "PaletteStyles__StyledSwatch",
346
340
  componentId: "qgv9v9-2"
347
- })([ "", ";margin-right:", ";margin-bottom:", ";", "" ], _.mixins.reset("inline-block"), (0,
341
+ })([ "", ";margin-right:4px;margin-bottom:4px;vertical-align:top;", "" ], _.mixins.reset("inline-block"), (0,
348
342
  _.pick)({
349
- enterprise: _.variables.spacingQuarter,
350
- prisma: "4px"
351
- }), (0, _.pick)({
352
- enterprise: _.variables.spacingQuarter,
353
- prisma: "4px"
354
- }), (0, _.pick)({
355
- prisma: (0, T.css)([ "vertical-align:top;&:nth-child(8n){margin-right:0;}" ])
343
+ enterprise: {
344
+ compact: (0, T.css)([ "&:nth-child(8n){margin-right:0;}" ])
345
+ },
346
+ prisma: (0, T.css)([ "&:nth-child(8n){margin-right:0;}" ])
356
347
  }));
357
- var ie = R().div.withConfig({
358
- displayName: "PaletteStyles__StyledToolBarPrisma",
348
+ var ce = R().div.withConfig({
349
+ displayName: "PaletteStyles__StyledToolBar",
359
350
  componentId: "qgv9v9-3"
360
- })([ "position:relative;display:flex;align-items:center;padding:0;margin-top:12px;gap:4px;" ]);
361
- var se = R()(z()).withConfig({
351
+ })([ "position:relative;display:flex;align-items:center;padding:0;margin-top:", ";margin-bottom:", ";gap:4px;" ], _.variables.spacingSmall, _.variables.spacingHalf);
352
+ var pe = R()(z()).withConfig({
362
353
  displayName: "PaletteStyles__StyledExpandButton",
363
354
  componentId: "qgv9v9-4"
364
355
  })([ "position:absolute;bottom:4px;right:4px;padding:2px 4px;border-radius:2px;&:focus{box-shadow:", ";}", "" ], _.variables.focusShadow, (function(e) {
365
356
  var t = e.$expanded;
366
357
  return t && (0, T.css)([ "transform:rotate(180deg);" ]);
367
358
  }));
368
- var ue = R().div.withConfig({
359
+ var de = R().div.withConfig({
369
360
  displayName: "PaletteStyles__StyledSystemColorPickerWrapper",
370
361
  componentId: "qgv9v9-5"
371
362
  })([ "position:relative;" ]);
372
- var pe = R().input.withConfig({
363
+ var fe = R().input.withConfig({
373
364
  displayName: "PaletteStyles__StyledSystemColorPicker",
374
365
  componentId: "qgv9v9-6"
375
- })([ "box-sizing:border-box;height:24px;width:24px;border:none;border-radius:2px;outline:none;appearance:none;padding:12px;margin:0;background:conic-gradient( #ef3434,#ef9a34,#deef34,#78ef34,#34ef56,#34efbc,#34bcef,#3456ef,#7834ef,#de34ef,#ef349a,#ef3434 );background-repeat:no-repeat;background-position:-6px -6px;background-size:36px 36px;cursor:pointer;&::-webkit-color-swatch{border:none;border-radius:2px;}&::-moz-color-swatch{opacity:0;}&:focus{box-shadow:", ";}" ], _.variables.focusShadow);
376
- var ce = R()($()).withConfig({
366
+ })([ "box-sizing:border-box;", " border:", ";", ";outline:none;appearance:none;padding:1px 10px;", " margin:0;background:conic-gradient( #ef3434,#ef9a34,#deef34,#78ef34,#34ef56,#34efbc,#34bcef,#3456ef,#7834ef,#de34ef,#ef349a,#ef3434 );background-repeat:no-repeat;cursor:pointer;&::-webkit-color-swatch{border:none;border-radius:2px;}&::-moz-color-swatch{opacity:0;}&:focus{box-shadow:", ";}" ], (0,
367
+ _.pick)({
368
+ enterprise: {
369
+ comfortable: (0, T.css)([ "width:32px;height:32px;" ]),
370
+ compact: (0, T.css)([ "width:24px;height:24px;" ])
371
+ },
372
+ prisma: (0, T.css)([ "width:24px;height:24px;" ])
373
+ }), (0, _.pick)({
374
+ enterprise: {
375
+ light: (0, T.css)([ "1px solid ", "" ], _.variables.gray60),
376
+ dark: _.variables.border
377
+ },
378
+ prisma: "none"
379
+ }), (0, _.pick)({
380
+ prisma: (0, T.css)([ "border-radius:2px;" ])
381
+ }), (0, _.pick)({
382
+ enterprise: {
383
+ comfortable: (0, T.css)([ "padding:1px 14px;" ])
384
+ }
385
+ }), _.variables.focusShadow);
386
+ var ve = R()($()).withConfig({
377
387
  displayName: "PaletteStyles__StyledCheck",
378
388
  componentId: "qgv9v9-7"
379
389
  })([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;position:absolute;top:0;left:0;pointer-events:none;" ]);
380
390
  // CONCATENATED MODULE: ./src/Color/Palette.tsx
381
- function de(e) {
382
- var t = e.expanded, r = e.palette, a = e.value, o = e.swatchToFocusRef, l = e.onSwatchClick, i = e.expandButtonRef, s = e.onPaletteExpand, u = e.onSystemColorPickerChange, p = e.renderInput;
391
+ function he(e) {
392
+ var t = e.expanded, r = e.palette, a = e.value, o = e.swatchToFocusRef, l = e.onSwatchClick, i = e.expandButtonRef, s = e.onPaletteExpand, u = e.onSystemColorPickerChange, c = e.renderInput;
383
393
  var d = (0, _.useSplunkTheme)(), f = d.isPrisma, v = d.isLight;
384
- var h = c()(r.map((function(e) {
394
+ var h = p()(r.map((function(e) {
385
395
  return e && w()(e);
386
396
  })), a);
387
- var y = r.map((function(e, t) {
397
+ var m = r.map((function(e, t) {
388
398
  var r = e === null ? null : w()(e);
389
399
  var i = r === a;
390
400
  var s = !h && t === 0 || h && i;
391
401
 
392
- return n().createElement(le, {
402
+ return n().createElement(ue, {
393
403
  key: r || "null"
394
404
  }, n().createElement(J, {
395
405
  value: r,
396
406
  ref: s ? o : null,
397
407
  onClick: l,
398
408
  noBorder: f,
399
- showSelected: f && i
409
+ showSelected: i
400
410
  }));
401
411
  }));
402
- if (f) {
403
- var b = !h && a !== "#ffffff" && a !== "#000000" && a !== null && a !== "";
404
- var g = y.length === 8 ? 7 : 15;
405
- var x = m()(y, 0, g);
406
- var S = m()(y, g);
412
+ var b = function e() {
413
+ var t = !h && a !== "#ffffff" && a !== "#000000" && a !== null && a !== "";
407
414
 
408
- return n().createElement(ae, null, n().createElement("div", {
409
- style: {
410
- position: "relative"
411
- }
412
- }, n().createElement(oe, null, x, t && S), t && n().createElement(ie, {
415
+ return n().createElement(ce, {
413
416
  "data-test": "tool-bar"
414
- }, n().createElement(_.SplunkThemeProvider, {
417
+ }, f && n().createElement(_.SplunkThemeProvider, {
415
418
  density: "compact"
416
- }, p && p()), n().createElement(J, {
419
+ }, c && c()), n().createElement(J, {
417
420
  value: null,
418
421
  ref: a === null ? o : null,
419
422
  onClick: l,
420
- noBorder: !v,
423
+ noBorder: f && !v,
421
424
  showSelected: a === null
422
425
  }), n().createElement(J, {
423
426
  value: "#ffffff",
424
427
  ref: a === "#ffffff" ? o : null,
425
428
  onClick: l,
426
- noBorder: !v,
429
+ noBorder: f && !v,
427
430
  showSelected: a === "#ffffff"
428
431
  }), n().createElement(J, {
429
432
  value: "#000000",
430
433
  ref: a === "#000000" ? o : null,
431
434
  onClick: l,
432
- noBorder: true,
435
+ noBorder: f,
433
436
  showSelected: a === "#000000"
434
- }), n().createElement(ue, null, n().createElement(pe, {
437
+ }), n().createElement(de, null, n().createElement(fe, {
435
438
  type: "color",
436
439
  value: a === null ? "" : a,
437
440
  onChange: u,
438
- ref: b ? o : null
439
- }), b && n().createElement(ce, {
440
- "aria-label": (0, j._)("Selected"),
441
+ ref: t ? o : null
442
+ }), t && n().createElement(ve, {
443
+ "aria-label": (0, I._)("Selected"),
441
444
  role: "presentation"
442
- }))), n().createElement(se, {
445
+ })));
446
+ };
447
+ var g = m.length === 8 ? 7 : 15;
448
+ var x = y()(m, 0, g);
449
+ var S = y()(m, g);
450
+ if (f) {
451
+
452
+ return n().createElement(ie, null, n().createElement("div", {
453
+ style: {
454
+ position: "relative"
455
+ }
456
+ }, n().createElement(se, null, x, t && S), t && b(), n().createElement(pe, {
443
457
  ref: i,
444
458
  $expanded: t,
445
459
  onClick: s,
446
460
  "data-test": "expand-button"
447
- }, n().createElement(ne(), null))));
461
+ }, n().createElement(ae(), null))));
448
462
  }
449
463
 
450
- return n().createElement(ae, null, n().createElement(oe, null, y), p && p());
464
+ return n().createElement(ie, null, n().createElement(se, null, m), n().createElement(le(), null), b(), c && c());
451
465
  }
452
- /* harmony default export */ const fe = de;
466
+ /* harmony default export */ const me = he;
453
467
  // CONCATENATED MODULE: ./src/Color/Color.tsx
454
- function ve(e) {
468
+ function ye(e) {
455
469
  "@babel/helpers - typeof";
456
470
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
457
- ve = function e(t) {
471
+ ye = function e(t) {
458
472
  return typeof t;
459
473
  };
460
474
  } else {
461
- ve = function e(t) {
475
+ ye = function e(t) {
462
476
  return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
463
477
  };
464
478
  }
465
- return ve(e);
479
+ return ye(e);
466
480
  }
467
- function he() {
468
- he = Object.assign || function(e) {
481
+ function be() {
482
+ be = Object.assign || function(e) {
469
483
  for (var t = 1; t < arguments.length; t++) {
470
484
  var r = arguments[t];
471
485
  for (var n in r) {
@@ -476,38 +490,38 @@
476
490
  }
477
491
  return e;
478
492
  };
479
- return he.apply(this, arguments);
493
+ return be.apply(this, arguments);
480
494
  }
481
- function ye(e) {
482
- return xe(e) || ge(e) || be(e) || me();
495
+ function ge(e) {
496
+ return ke(e) || Se(e) || we(e) || xe();
483
497
  }
484
- function me() {
498
+ function xe() {
485
499
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
486
500
  }
487
- function be(e, t) {
501
+ function we(e, t) {
488
502
  if (!e) return;
489
- if (typeof e === "string") return we(e, t);
503
+ if (typeof e === "string") return Ce(e, t);
490
504
  var r = Object.prototype.toString.call(e).slice(8, -1);
491
505
  if (r === "Object" && e.constructor) r = e.constructor.name;
492
506
  if (r === "Map" || r === "Set") return Array.from(e);
493
- if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return we(e, t);
507
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Ce(e, t);
494
508
  }
495
- function ge(e) {
509
+ function Se(e) {
496
510
  if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
497
511
  }
498
- function xe(e) {
499
- if (Array.isArray(e)) return we(e);
512
+ function ke(e) {
513
+ if (Array.isArray(e)) return Ce(e);
500
514
  }
501
- function we(e, t) {
515
+ function Ce(e, t) {
502
516
  if (t == null || t > e.length) t = e.length;
503
517
  for (var r = 0, n = new Array(t); r < t; r++) {
504
518
  n[r] = e[r];
505
519
  }
506
520
  return n;
507
521
  }
508
- function Se(e, t) {
522
+ function Ee(e, t) {
509
523
  if (e == null) return {};
510
- var r = ke(e, t);
524
+ var r = Pe(e, t);
511
525
  var n, a;
512
526
  if (Object.getOwnPropertySymbols) {
513
527
  var o = Object.getOwnPropertySymbols(e);
@@ -520,7 +534,7 @@
520
534
  }
521
535
  return r;
522
536
  }
523
- function ke(e, t) {
537
+ function Pe(e, t) {
524
538
  if (e == null) return {};
525
539
  var r = {};
526
540
  var n = Object.keys(e);
@@ -532,12 +546,12 @@
532
546
  }
533
547
  return r;
534
548
  }
535
- function Ce(e, t) {
549
+ function Oe(e, t) {
536
550
  if (!(e instanceof t)) {
537
551
  throw new TypeError("Cannot call a class as a function");
538
552
  }
539
553
  }
540
- function Pe(e, t) {
554
+ function _e(e, t) {
541
555
  for (var r = 0; r < t.length; r++) {
542
556
  var n = t[r];
543
557
  n.enumerable = n.enumerable || false;
@@ -546,12 +560,12 @@
546
560
  Object.defineProperty(e, n.key, n);
547
561
  }
548
562
  }
549
- function Ee(e, t, r) {
550
- if (t) Pe(e.prototype, t);
551
- if (r) Pe(e, r);
563
+ function qe(e, t, r) {
564
+ if (t) _e(e.prototype, t);
565
+ if (r) _e(e, r);
552
566
  return e;
553
567
  }
554
- function Oe(e, t) {
568
+ function Ie(e, t) {
555
569
  if (typeof t !== "function" && t !== null) {
556
570
  throw new TypeError("Super expression must either be null or a function");
557
571
  }
@@ -562,41 +576,41 @@
562
576
  configurable: true
563
577
  }
564
578
  });
565
- if (t) _e(e, t);
579
+ if (t) je(e, t);
566
580
  }
567
- function _e(e, t) {
568
- _e = Object.setPrototypeOf || function e(t, r) {
581
+ function je(e, t) {
582
+ je = Object.setPrototypeOf || function e(t, r) {
569
583
  t.__proto__ = r;
570
584
  return t;
571
585
  };
572
- return _e(e, t);
586
+ return je(e, t);
573
587
  }
574
- function qe(e) {
575
- var t = Te();
588
+ function Te(e) {
589
+ var t = Ve();
576
590
  return function r() {
577
- var n = Re(e), a;
591
+ var n = Ae(e), a;
578
592
  if (t) {
579
- var o = Re(this).constructor;
593
+ var o = Ae(this).constructor;
580
594
  a = Reflect.construct(n, arguments, o);
581
595
  } else {
582
596
  a = n.apply(this, arguments);
583
597
  }
584
- return je(this, a);
598
+ return Re(this, a);
585
599
  };
586
600
  }
587
- function je(e, t) {
588
- if (t && (ve(t) === "object" || typeof t === "function")) {
601
+ function Re(e, t) {
602
+ if (t && (ye(t) === "object" || typeof t === "function")) {
589
603
  return t;
590
604
  }
591
- return Ie(e);
605
+ return Be(e);
592
606
  }
593
- function Ie(e) {
607
+ function Be(e) {
594
608
  if (e === void 0) {
595
609
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
596
610
  }
597
611
  return e;
598
612
  }
599
- function Te() {
613
+ function Ve() {
600
614
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
601
615
  if (Reflect.construct.sham) return false;
602
616
  if (typeof Proxy === "function") return true;
@@ -607,13 +621,13 @@
607
621
  return false;
608
622
  }
609
623
  }
610
- function Re(e) {
611
- Re = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
624
+ function Ae(e) {
625
+ Ae = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
612
626
  return t.__proto__ || Object.getPrototypeOf(t);
613
627
  };
614
- return Re(e);
628
+ return Ae(e);
615
629
  }
616
- function Be(e, t, r) {
630
+ function De(e, t, r) {
617
631
  if (t in e) {
618
632
  Object.defineProperty(e, t, {
619
633
  value: r,
@@ -627,8 +641,8 @@
627
641
  return e;
628
642
  }
629
643
  // The default palette in Prisma theme.
630
- var Ve = [ "#912344", "#D44C20", "#C0891E", "#26AA92", "#2F8AA7", "#2E49AA", "#602CA1", "#BA4ABD" ];
631
- var Ne = k()((function(e) {
644
+ var Ne = [ "#912344", "#D44C20", "#C0891E", "#26AA92", "#2F8AA7", "#2E49AA", "#602CA1", "#BA4ABD" ];
645
+ var $e = k()((function(e) {
632
646
  var t = [];
633
647
  for (var r = 1; r <= e.length * 4; r += 1) {
634
648
  var n = e[(r - 1) % e.length];
@@ -636,14 +650,14 @@
636
650
  t.push(n);
637
651
  } else {
638
652
  var a = 40 - 10 * (r / e.length);
639
- t.push(P()(n).lighten(a).toString());
653
+ t.push(E()(n).lighten(a).toString());
640
654
  }
641
655
  }
642
656
  return t;
643
657
  }));
644
658
  // The tool palette in Prisma theme.
645
- var Ae = [ "#ffffff", "#000000", null ];
646
- var De = {
659
+ var He = [ "#ffffff", "#000000", null ];
660
+ var ze = {
647
661
  append: o().bool,
648
662
  defaultValue: o().string,
649
663
  describedBy: o().string,
@@ -660,30 +674,30 @@
660
674
  splunkTheme: o().object,
661
675
  value: o().string
662
676
  };
663
- var $e = {
677
+ var Ke = {
664
678
  append: false,
665
679
  disabled: false,
666
680
  error: false,
667
681
  hideInput: false,
668
- palette: Ne(Ve),
682
+ palette: $e(Ne),
669
683
  prepend: false
670
684
  };
671
685
  // TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
672
- var He = function e(t) {
686
+ var Fe = function e(t) {
673
687
  return (0, q.isValidHexColor)(t);
674
688
  };
675
- var ze = "N/A";
676
- var Ke = "n/a";
689
+ var Me = "N/A";
690
+ var Le = "n/a";
677
691
  /*
678
692
  * When the dropdown opens:
679
693
  * 1. If palette contains the color and the color is selected, the dropdown focus the color.
680
694
  * 2. If palette doesn't contain the color:
681
695
  * 1. If the current theme `family` is `prisma` the input receives focus.
682
696
  * 2. Otherwise the first color swatch receives focus.
683
- */ var Fe = function(e) {
684
- Oe(r, e);
685
- var t = qe(r);
686
- Ee(r, null, [ {
697
+ */ var Ue = function(e) {
698
+ Ie(r, e);
699
+ var t = Te(r);
700
+ qe(r, null, [ {
687
701
  key: "hasNull",
688
702
  // @docs-props-type ColorPropsBase
689
703
  value: function e(t) {
@@ -701,19 +715,19 @@
701
715
  } ]);
702
716
  function r(e) {
703
717
  var a;
704
- Ce(this, r);
718
+ Oe(this, r);
705
719
  a = t.call(this, e);
706
- Be(Ie(a), "focusSwatch", void 0);
707
- Be(Ie(a), "focusExpandButton", void 0);
708
- Be(Ie(a), "controlledExternally", void 0);
709
- Be(Ie(a), "dropdown", null);
710
- Be(Ie(a), "handleSwatchClick", (function(e, t) {
720
+ De(Be(a), "focusSwatch", void 0);
721
+ De(Be(a), "focusExpandButton", void 0);
722
+ De(Be(a), "controlledExternally", void 0);
723
+ De(Be(a), "dropdown", null);
724
+ De(Be(a), "handleSwatchClick", (function(e, t) {
711
725
  var r = t.value;
712
726
  e.preventDefault();
713
727
  var n = a.props, o = n.name, l = n.onChange;
714
728
  var i = a.getValue();
715
729
  var s = r !== i;
716
- var u = r === null ? ze : r;
730
+ var u = r === null ? Me : r;
717
731
  if (!a.isControlled()) {
718
732
  a.setState({
719
733
  value: r
@@ -731,21 +745,21 @@
731
745
  }
732
746
  a.focus();
733
747
  }));
734
- Be(Ie(a), "handlePaletteExpand", (function() {
748
+ De(Be(a), "handlePaletteExpand", (function() {
735
749
  a.setState((function(e) {
736
750
  return {
737
751
  expanded: !e.expanded
738
752
  };
739
753
  }));
740
754
  }));
741
- Be(Ie(a), "handleTextChange", (function(e, t) {
755
+ De(Be(a), "handleTextChange", (function(e, t) {
742
756
  var r = t.value;
743
757
  a.setState({
744
758
  displayValue: r
745
759
  });
746
760
  }));
747
- Be(Ie(a), "handleTextKeyDown", (function(e) {
748
- if ((0, I.keycode)(e.nativeEvent) === "enter") {
761
+ De(Be(a), "handleTextKeyDown", (function(e) {
762
+ if ((0, j.keycode)(e.nativeEvent) === "enter") {
749
763
  e.preventDefault();
750
764
  a.handleRequestClose({
751
765
  reason: "enterKey"
@@ -753,19 +767,19 @@
753
767
  a.focus();
754
768
  }
755
769
  }));
756
- Be(Ie(a), "handleButtonClick", (function(e) {
770
+ De(Be(a), "handleButtonClick", (function(e) {
757
771
  e.preventDefault();
758
772
  a.handleRequestClose({
759
773
  reason: "buttonClick"
760
774
  });
761
775
  a.focus();
762
776
  }));
763
- Be(Ie(a), "handleRequestClose", (function(e) {
777
+ De(Be(a), "handleRequestClose", (function(e) {
764
778
  var t = e.reason;
765
779
  var r = a.state.displayValue;
766
780
  var n = a.state.value;
767
- if (w()(r) === Ke) {
768
- r = ze;
781
+ if (w()(r) === Le) {
782
+ r = Me;
769
783
  a.setState({
770
784
  displayValue: r
771
785
  });
@@ -777,12 +791,12 @@
777
791
  }
778
792
  // If the user types in the hexadecimal number without # in front,
779
793
  // we add # automatically.
780
- if (r !== ze && w()(r) !== "transparent" && !g()(r, "#")) {
794
+ if (r !== Me && w()(r) !== "transparent" && !g()(r, "#")) {
781
795
  r = "#".concat(r);
782
796
  if (t === "escapeKey") {
783
797
  if (n == null) {
784
798
  a.setState({
785
- displayValue: ze
799
+ displayValue: Me
786
800
  });
787
801
  } else {
788
802
  a.setState({
@@ -804,11 +818,11 @@
804
818
  a.submitValue(r);
805
819
  }
806
820
  }));
807
- Be(Ie(a), "handleRequestOpen", (function() {
821
+ De(Be(a), "handleRequestOpen", (function() {
808
822
  var e = a.props, t = e.splunkTheme, r = e.palette;
809
823
  var n = t.isPrisma;
810
824
  var o = a.getValue();
811
- var l = o === null ? ze : o;
825
+ var l = o === null ? Me : o;
812
826
  a.setState({
813
827
  displayValue: l,
814
828
  open: true
@@ -817,24 +831,24 @@
817
831
  a.focusSwatch.current.focus();
818
832
  }
819
833
  }));
820
- var i = n ? m()(r, 15) : r;
821
- var s = n && !c()(r.map((function(e) {
834
+ var i = n ? y()(r, 15) : r;
835
+ var s = !p()(r.map((function(e) {
822
836
  return e && w()(e);
823
837
  })), o);
824
- var u = s || c()(i.map((function(e) {
838
+ var u = s || p()(i.map((function(e) {
825
839
  return e && w()(e);
826
- })), o) || c()(Ae, o);
840
+ })), o) || p()(He, o);
827
841
  if (u && !a.state.expanded) {
828
842
  a.setState({
829
843
  expanded: true
830
844
  });
831
845
  }
832
846
  }));
833
- Be(Ie(a), "handleSystemColorPickerChange", i()((function(e) {
847
+ De(Be(a), "handleSystemColorPickerChange", i()((function(e) {
834
848
  var t = a.getValue();
835
849
  var r = e !== t;
836
850
  var n = a.props.name;
837
- var o = e === null ? ze : e;
851
+ var o = e === null ? Me : e;
838
852
  if (!a.isControlled()) {
839
853
  a.setState({
840
854
  value: e
@@ -862,7 +876,7 @@
862
876
  o = w()(o);
863
877
  }
864
878
  // displayValue can be hexadecimal color or 'transparent' to represent 'transparent' or 'N/A' to represent null
865
- var l = o === null ? ze : o;
879
+ var l = o === null ? Me : o;
866
880
  a.state = {
867
881
  displayValue: l,
868
882
  open: false,
@@ -875,18 +889,12 @@
875
889
  }
876
890
  return a;
877
891
  }
878
- Ee(r, [ {
892
+ qe(r, [ {
879
893
  key: "componentDidUpdate",
880
894
  value: function e(t) {
881
895
  if (false) {}
882
896
  if (false) {}
883
897
  }
884
- }, {
885
- key: "showNull",
886
- value: function e() {
887
- var t = this.props.splunkTheme.isPrisma;
888
- return r.hasNull(this.props.palette) || t;
889
- }
890
898
  /**
891
899
  * Standardizes the current value of the Color:
892
900
  * returns based on the input being controlled or uncontrolled
@@ -898,9 +906,6 @@
898
906
  return t === null ? null : w()(t);
899
907
  };
900
908
  var r = (0, q.expandShortHandHex)(this.props.value);
901
- if (this.props.value === null && !this.showNull()) {
902
- return undefined;
903
- }
904
909
  if (this.isControlled()) {
905
910
  return t(r);
906
911
  }
@@ -909,33 +914,31 @@
909
914
  }, {
910
915
  key: "submitValue",
911
916
  value: function e(t) {
912
- var n = this.props.splunkTheme;
913
- var a = n.isPrisma;
914
917
  if (t) {
915
- var o = He(t);
916
- if (!o && t !== "transparent" && t !== ze) {
918
+ var n = Fe(t);
919
+ if (!n && t !== "transparent" && t !== Me) {
917
920
  // eslint-disable-next-line no-console
918
921
  console.warn('"'.concat(t, '" is not a valid hex color.'));
919
922
  }
920
- if (o || r.hasTransparent(this.props.palette) && t === "transparent" || (r.hasNull(this.props.palette) || a) && t === ze) {
921
- var l = (0, q.expandShortHandHex)(t);
923
+ if (n || r.hasTransparent(this.props.palette) && t === "transparent" || t === Me) {
924
+ var a = (0, q.expandShortHandHex)(t);
922
925
  this.setState({
923
- displayValue: l
926
+ displayValue: a
924
927
  });
925
- var i = t !== (this.props.value && w()(this.props.value));
926
- var s = this.props.name;
927
- var u = t === ze ? null : t;
928
- var p = (0, q.expandShortHandHex)(u);
928
+ var o = t !== (this.props.value && w()(this.props.value));
929
+ var l = this.props.name;
930
+ var i = t === Me ? null : t;
931
+ var s = (0, q.expandShortHandHex)(i);
929
932
  if (t && !this.isControlled()) {
930
933
  this.setState({
931
- value: p
934
+ value: s
932
935
  });
933
936
  }
934
- if (i) {
935
- var c, d;
936
- (c = (d = this.props).onChange) === null || c === void 0 ? void 0 : c.call(d, {
937
- value: p,
938
- name: s
937
+ if (o) {
938
+ var u, c;
939
+ (u = (c = this.props).onChange) === null || u === void 0 ? void 0 : u.call(c, {
940
+ value: s,
941
+ name: l
939
942
  });
940
943
  }
941
944
  }
@@ -960,32 +963,32 @@
960
963
  var a = t.textAppend, o = t.textPrepend, l = t.textInline, i = t.inDropdown;
961
964
  var s = this.props.splunkTheme;
962
965
  var u = this.state.displayValue;
963
- var p = s.isPrisma;
964
- var c = r.hasTransparent(this.props.palette) && w()(u) === "transparent";
965
- var d = this.showNull() && w()(u) === Ke;
966
+ var c = s.isPrisma;
967
+ var p = r.hasTransparent(this.props.palette) && w()(u) === "transparent";
968
+ var d = w()(u) === Le;
966
969
  var f = u;
967
970
  if (!g()(u, "#")) {
968
971
  f = "#".concat(u);
969
972
  }
970
- f = c ? "transparent" : f;
973
+ f = p ? "transparent" : f;
971
974
  f = d ? null : f;
972
975
 
973
- return n().createElement(Z, {
976
+ return n().createElement(ee, {
974
977
  $inDropdown: i
975
- }, n().createElement(ee, {
978
+ }, n().createElement(te, {
976
979
  $inDropdown: i,
977
980
  append: a,
978
981
  autoCapitalize: "off",
979
982
  autoComplete: "off",
980
983
  autoCorrect: "off",
981
984
  spellCheck: false,
982
- "aria-label": (0, j._)("Hexadecimal color value"),
985
+ "aria-label": (0, I._)("Hexadecimal color value"),
983
986
  prepend: o,
984
987
  inline: l,
985
988
  onKeyDown: this.handleTextKeyDown,
986
989
  onChange: this.handleTextChange,
987
990
  value: u
988
- }), !p && n().createElement(J, {
991
+ }), !c && n().createElement(Z, {
989
992
  "data-test": "textbox-swatch",
990
993
  onClick: this.handleButtonClick,
991
994
  value: f,
@@ -1003,7 +1006,7 @@
1003
1006
  var l = this.state.expanded;
1004
1007
  var i = a.isPrisma;
1005
1008
 
1006
- return n().createElement(fe, {
1009
+ return n().createElement(me, {
1007
1010
  palette: o,
1008
1011
  value: this.getValue(),
1009
1012
  swatchToFocusRef: this.focusSwatch,
@@ -1033,16 +1036,16 @@
1033
1036
  key: "render",
1034
1037
  value: function e() {
1035
1038
  var t = this;
1036
- var a = this.props, o = a.append, l = a.disabled, i = a.describedBy, s = a.elementRef, u = a.error, p = a.hideInput, c = a.labelledBy, d = a.name, v = a.prepend, y = a.splunkTheme, m = Se(a, [ "append", "disabled", "describedBy", "elementRef", "error", "hideInput", "labelledBy", "name", "prepend", "splunkTheme" ]);
1037
- var b = y.isPrisma;
1039
+ var a = this.props, o = a.append, l = a.disabled, i = a.describedBy, s = a.elementRef, u = a.error, c = a.hideInput, p = a.labelledBy, d = a.name, v = a.prepend, m = a.splunkTheme, y = Ee(a, [ "append", "disabled", "describedBy", "elementRef", "error", "hideInput", "labelledBy", "name", "prepend", "splunkTheme" ]);
1040
+ var b = m.isPrisma;
1038
1041
  var g = this.getValue();
1039
1042
  var x = this.state.displayValue;
1040
- var w = n().createElement(te, he({
1041
- append: b && !p ? true : o,
1043
+ var w = n().createElement(re, be({
1044
+ append: b && !c ? true : o,
1042
1045
  "data-test": "color",
1043
1046
  "data-test-value": x,
1044
1047
  "aria-describedby": i,
1045
- "aria-labelledby": c,
1048
+ "aria-labelledby": p,
1046
1049
  "aria-invalid": u || undefined,
1047
1050
  disabled: l,
1048
1051
  error: u,
@@ -1050,7 +1053,7 @@
1050
1053
  name: d,
1051
1054
  prepend: v,
1052
1055
  value: g
1053
- }, h()(m, [].concat(ye(f()(r.propTypes)), [ // TS: trick omit
1056
+ }, h()(y, [].concat(ge(f()(r.propTypes)), [ // TS: trick omit
1054
1057
  "onChange" ]))));
1055
1058
 
1056
1059
  return n().createElement(Y, null, n().createElement(O(), {
@@ -1064,7 +1067,7 @@
1064
1067
  retainFocus: true,
1065
1068
  takeFocus: false,
1066
1069
  toggle: w
1067
- }, this.renderPalette()), b && !p && this.renderInput({
1070
+ }, this.renderPalette()), b && !c && this.renderInput({
1068
1071
  textAppend: false,
1069
1072
  textPrepend: true,
1070
1073
  textInline: true,
@@ -1074,12 +1077,12 @@
1074
1077
  } ]);
1075
1078
  return r;
1076
1079
  }(r.Component);
1077
- Be(Fe, "propTypes", De);
1078
- Be(Fe, "defaultProps", $e);
1079
- var Me = (0, _.withSplunkTheme)(Fe);
1080
- Me.propTypes = Fe.propTypes;
1080
+ De(Ue, "propTypes", ze);
1081
+ De(Ue, "defaultProps", Ke);
1082
+ var We = (0, _.withSplunkTheme)(Ue);
1083
+ We.propTypes = Ue.propTypes;
1081
1084
  // TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
1082
- /* harmony default export */ const Le = Me;
1085
+ /* harmony default export */ const Qe = We;
1083
1086
  // CONCATENATED MODULE: ./src/Color/index.ts
1084
1087
  module.exports = t;
1085
1088
  /******/})();