@splunk/react-ui 4.36.0 → 4.38.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 (39) hide show
  1. package/Button.js +139 -132
  2. package/CHANGELOG.md +32 -0
  3. package/Color.js +1145 -977
  4. package/ComboBox.js +1 -2
  5. package/Date.js +21 -24
  6. package/Menu.js +161 -153
  7. package/Multiselect.js +17 -27
  8. package/Progress.js +202 -149
  9. package/RadioBar.js +18 -14
  10. package/ScreenReaderContent.js +138 -94
  11. package/Search.js +45 -42
  12. package/Select.js +89 -99
  13. package/Slider.js +128 -145
  14. package/Switch.js +123 -119
  15. package/Text.js +202 -199
  16. package/TextArea.js +21 -19
  17. package/package.json +4 -4
  18. package/types/src/Button/Button.d.ts +15 -5
  19. package/types/src/Color/Color.d.ts +3 -0
  20. package/types/src/Color/Palette.d.ts +4 -2
  21. package/types/src/ControlGroup/docs/examples/Error.d.ts +2 -2
  22. package/types/src/Date/Date.d.ts +0 -1
  23. package/types/src/Date/docs/examples/Error.d.ts +2 -0
  24. package/types/src/Link/Link.d.ts +3 -4
  25. package/types/src/Menu/Item.d.ts +6 -3
  26. package/types/src/Progress/Progress.d.ts +1 -1
  27. package/types/src/Search/Option.d.ts +7 -0
  28. package/types/src/Select/Select.d.ts +1 -1
  29. package/types/src/Select/SelectBase.d.ts +0 -1
  30. package/types/src/Slider/Slider.d.ts +0 -1
  31. package/types/src/Slider/docs/examples/Error.d.ts +2 -0
  32. package/types/src/Switch/Switch.d.ts +1 -0
  33. package/types/src/Text/Text.d.ts +6 -4
  34. package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
  35. package/types/src/TextArea/TextArea.d.ts +2 -2
  36. package/types/src/Button/docs/examples/Selected.d.ts +0 -2
  37. package/types/src/Slider/docs/examples/prisma/Error.d.ts +0 -2
  38. /package/types/src/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
  39. /package/types/src/Progress/docs/examples/{prisma/Type.d.ts → Type.d.ts} +0 -0
package/Color.js CHANGED
@@ -1,34 +1,159 @@
1
1
  /******/ (() => {
2
2
  // webpackBootstrap
3
3
  /******/ "use strict";
4
- /******/ // The require scope
5
- /******/ var e = {};
4
+ /******/ var e = {
5
+ /***/ 6165:
6
+ /***/ (e, t, r) => {
7
+ // EXPORTS
8
+ r.d(t, {
9
+ default: () => /* reexport */ y
10
+ });
11
+ // EXTERNAL MODULE: external "react"
12
+ var n = r(9497);
13
+ var a = r.n(n);
14
+ // EXTERNAL MODULE: external "prop-types"
15
+ var o = r(23);
16
+ var l = r.n(o);
17
+ // EXTERNAL MODULE: external "styled-components"
18
+ var i = r(232);
19
+ var s = r.n(i);
20
+ // EXTERNAL MODULE: external "@splunk/themes"
21
+ var c = r(3563);
22
+ // CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContentStyles.ts
23
+ var u = s().span.withConfig({
24
+ displayName: "ScreenReaderContentStyles__Styled",
25
+ componentId: "sc-1lnohwp-0"
26
+ })([ "", ";" ], c.mixins.screenReaderContent());
27
+ // CONCATENATED MODULE: ./src/ScreenReaderContent/ScreenReaderContent.tsx
28
+ function p() {
29
+ p = Object.assign || function(e) {
30
+ for (var t = 1; t < arguments.length; t++) {
31
+ var r = arguments[t];
32
+ for (var n in r) {
33
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
34
+ e[n] = r[n];
35
+ }
36
+ }
37
+ }
38
+ return e;
39
+ };
40
+ return p.apply(this, arguments);
41
+ }
42
+ function d(e, t) {
43
+ if (e == null) return {};
44
+ var r = f(e, t);
45
+ var n, a;
46
+ if (Object.getOwnPropertySymbols) {
47
+ var o = Object.getOwnPropertySymbols(e);
48
+ for (a = 0; a < o.length; a++) {
49
+ n = o[a];
50
+ if (t.indexOf(n) >= 0) continue;
51
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
52
+ r[n] = e[n];
53
+ }
54
+ }
55
+ return r;
56
+ }
57
+ function f(e, t) {
58
+ if (e == null) return {};
59
+ var r = {};
60
+ var n = Object.keys(e);
61
+ var a, o;
62
+ for (o = 0; o < n.length; o++) {
63
+ a = n[o];
64
+ if (t.indexOf(a) >= 0) continue;
65
+ r[a] = e[a];
66
+ }
67
+ return r;
68
+ }
69
+ var v = {
70
+ children: l().node.isRequired,
71
+ elementRef: l().oneOfType([ l().func, l().object ])
72
+ };
73
+ /**
74
+ * The screen reader text is used to wrap content that
75
+ * is only accessible through screen readers.
76
+ */ function h(e) {
77
+ var t = e.children, r = e.elementRef, n = d(e, [ "children", "elementRef" ]);
78
+ // @docs-props-type ScreenReaderContentPropsBase
79
+
80
+ return a().createElement(u, p({
81
+ "data-test": "screen-reader-content",
82
+ ref: r
83
+ }, n), t);
84
+ }
85
+ h.propTypes = v;
86
+ /* harmony default export */ const y = h;
87
+ } // CONCATENATED MODULE: ./src/ScreenReaderContent/index.ts
88
+ /***/ ,
89
+ /***/ 3563:
90
+ /***/ e => {
91
+ e.exports = require("@splunk/themes");
92
+ /***/ },
93
+ /***/ 23:
94
+ /***/ e => {
95
+ e.exports = require("prop-types");
96
+ /***/ },
97
+ /***/ 9497:
98
+ /***/ e => {
99
+ e.exports = require("react");
100
+ /***/ },
101
+ /***/ 232:
102
+ /***/ e => {
103
+ e.exports = require("styled-components");
104
+ /***/
105
+ /******/ }
106
+ };
107
+ /************************************************************************/
108
+ /******/ // The module cache
109
+ /******/ var t = {};
110
+ /******/
111
+ /******/ // The require function
112
+ /******/ function r(n) {
113
+ /******/ // Check if module is in cache
114
+ /******/ var a = t[n];
115
+ /******/ if (a !== undefined) {
116
+ /******/ return a.exports;
117
+ /******/ }
118
+ /******/ // Create a new module (and put it into the cache)
119
+ /******/ var o = t[n] = {
120
+ /******/ // no module.id needed
121
+ /******/ // no module.loaded needed
122
+ /******/ exports: {}
123
+ /******/ };
124
+ /******/
125
+ /******/ // Execute the module function
126
+ /******/ e[n](o, o.exports, r);
127
+ /******/
128
+ /******/ // Return the exports of the module
129
+ /******/ return o.exports;
130
+ /******/ }
6
131
  /******/
7
132
  /************************************************************************/
8
133
  /******/ /* webpack/runtime/compat get default export */
9
134
  /******/ (() => {
10
135
  /******/ // getDefaultExport function for compatibility with non-harmony modules
11
- /******/ e.n = t => {
12
- /******/ var r = t && t.__esModule ?
13
- /******/ () => t["default"]
14
- /******/ : () => t
136
+ /******/ r.n = e => {
137
+ /******/ var t = e && e.__esModule ?
138
+ /******/ () => e["default"]
139
+ /******/ : () => e
15
140
  /******/;
16
- e.d(r, {
17
- a: r
141
+ r.d(t, {
142
+ a: t
18
143
  });
19
- /******/ return r;
144
+ /******/ return t;
20
145
  /******/ };
21
146
  /******/ })();
22
147
  /******/
23
148
  /******/ /* webpack/runtime/define property getters */
24
149
  /******/ (() => {
25
150
  /******/ // define getter functions for harmony exports
26
- /******/ e.d = (t, r) => {
27
- /******/ for (var n in r) {
28
- /******/ if (e.o(r, n) && !e.o(t, n)) {
29
- /******/ Object.defineProperty(t, n, {
151
+ /******/ r.d = (e, t) => {
152
+ /******/ for (var n in t) {
153
+ /******/ if (r.o(t, n) && !r.o(e, n)) {
154
+ /******/ Object.defineProperty(e, n, {
30
155
  enumerable: true,
31
- get: r[n]
156
+ get: t[n]
32
157
  });
33
158
  /******/ }
34
159
  /******/ }
@@ -37,14 +162,14 @@
37
162
  /******/
38
163
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
164
  /******/ (() => {
40
- /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
165
+ /******/ r.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
41
166
  /******/;
42
167
  })();
43
168
  /******/
44
169
  /******/ /* webpack/runtime/make namespace object */
45
170
  /******/ (() => {
46
171
  /******/ // define __esModule on exports
47
- /******/ e.r = e => {
172
+ /******/ r.r = e => {
48
173
  /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
174
  /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
175
  value: "Module"
@@ -56,1044 +181,1087 @@
56
181
  /******/ };
57
182
  /******/ })();
58
183
  /******/
59
- /************************************************************************/ var t = {};
60
- // ESM COMPAT FLAG
61
- e.r(t);
62
- // EXPORTS
63
- e.d(t, {
64
- default: () => /* reexport */ Ue,
65
- defaultPalette: () => /* reexport */ Ae,
66
- isValidHEX: () => /* reexport */ ze
67
- });
68
- // CONCATENATED MODULE: external "react"
69
- const r = require("react");
70
- var n = e.n(r);
71
- // CONCATENATED MODULE: external "prop-types"
72
- const a = require("prop-types");
73
- var o = e.n(a);
74
- // CONCATENATED MODULE: external "lodash/has"
75
- const l = require("lodash/has");
76
- var i = e.n(l);
77
- // CONCATENATED MODULE: external "lodash/includes"
78
- const s = require("lodash/includes");
79
- var u = e.n(s);
80
- // CONCATENATED MODULE: external "lodash/keys"
81
- const c = require("lodash/keys");
82
- var p = e.n(c);
83
- // CONCATENATED MODULE: external "lodash/omit"
84
- const d = require("lodash/omit");
85
- var f = e.n(d);
86
- // CONCATENATED MODULE: external "lodash/slice"
87
- const v = require("lodash/slice");
88
- var h = e.n(v);
89
- // CONCATENATED MODULE: external "lodash/startsWith"
90
- const m = require("lodash/startsWith");
91
- var y = e.n(m);
92
- // CONCATENATED MODULE: external "lodash/toLower"
93
- const b = require("lodash/toLower");
94
- var g = e.n(b);
95
- // CONCATENATED MODULE: external "lodash/memoize"
96
- const x = require("lodash/memoize");
97
- var S = e.n(x);
98
- // CONCATENATED MODULE: external "tinycolor2"
99
- const w = require("tinycolor2");
100
- var k = e.n(w);
101
- // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
102
- const C = require("@splunk/react-ui/Dropdown");
103
- var E = e.n(C);
104
- // CONCATENATED MODULE: external "@splunk/themes"
105
- const P = require("@splunk/themes");
106
- // CONCATENATED MODULE: external "@splunk/ui-utils/color"
107
- const O = require("@splunk/ui-utils/color");
108
- // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
109
- const _ = require("@splunk/ui-utils/i18n");
110
- // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
111
- const q = require("@splunk/ui-utils/keyboard");
112
- // CONCATENATED MODULE: external "styled-components"
113
- const j = require("styled-components");
114
- var I = e.n(j);
115
- // CONCATENATED MODULE: external "@splunk/react-ui/Text"
116
- const T = require("@splunk/react-ui/Text");
117
- var R = e.n(T);
118
- // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
119
- const B = require("@splunk/react-ui/ScreenReaderContent");
120
- var V = e.n(B);
121
- // CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
122
- const A = require("@splunk/react-icons/Checkmark");
123
- var D = e.n(A);
124
- // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
125
- const N = require("@splunk/react-ui/Clickable");
126
- var $ = e.n(N);
127
- // CONCATENATED MODULE: ./src/Color/SwatchStyles.ts
128
- var H = (0, P.pick)({
129
- enterprise: P.variables.gray80,
130
- prisma: "rgba(0, 0, 0, 0.2)"
131
- });
132
- var z = (0, j.css)([ "background-image:linear-gradient( 45deg,", " 25%,transparent 25%,transparent 75%,", " 75%,", " ),linear-gradient( 45deg,", " 25%,transparent 25%,transparent 75%,", " 75%,", " );background-size:10px 10px;background-position:0 0,5px 5px;background-color:", ";" ], H, H, H, H, H, H, (0,
133
- P.pick)({
134
- enterprise: "transparent",
135
- prisma: P.variables.white
136
- }));
137
- var K = I()(D()).withConfig({
138
- displayName: "SwatchStyles__StyledCheck",
139
- componentId: "sc-1wxunhq-0"
140
- })([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;" ]);
141
- var F = I()($()).withConfig({
142
- displayName: "SwatchStyles__StyledClickable",
143
- componentId: "sc-1wxunhq-1"
144
- })([ "display:block;flex:0 0 auto;border:1px solid;border-color:", ";", ";", ";", ";", " &:focus{border-color:", ";box-shadow:", ";", "}", " ", " ", " &[disabled]{background-image:linear-gradient(rgba(255,255,255,0.8),rgba(255,255,255,0.8));}", " ", "" ], (0,
145
- P.pick)({
146
- enterprise: {
147
- light: P.variables.gray60,
148
- dark: P.variables.borderColor
149
- },
150
- prisma: P.variables.interactiveColorBorder
151
- }), (0, P.pick)({
152
- prisma: (0, j.css)([ "border-radius:2px;" ])
153
- }), (function(e) {
154
- var t = e.$value;
155
- return t === null && (0, j.css)([ "background-image:linear-gradient( to bottom right,transparent 48%,", ",transparent 52% );", ";" ], (0,
156
- P.pick)({
157
- enterprise: "#ed1e24",
158
- prisma: P.variables.accentColorNegative
159
- }), (0, P.pick)({
160
- prisma: (0, j.css)([ "background-color:", ";" ], P.variables.white)
184
+ /************************************************************************/ var n = {};
185
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
186
+ (() => {
187
+ // ESM COMPAT FLAG
188
+ r.r(n);
189
+ // EXPORTS
190
+ r.d(n, {
191
+ default: () => /* reexport */ Je,
192
+ defaultPalette: () => /* reexport */ He,
193
+ isValidHEX: () => /* reexport */ Le
194
+ });
195
+ // EXTERNAL MODULE: external "react"
196
+ var e = r(9497);
197
+ var t = r.n(e);
198
+ // EXTERNAL MODULE: external "prop-types"
199
+ var a = r(23);
200
+ var o = r.n(a);
201
+ // CONCATENATED MODULE: external "lodash/has"
202
+ const l = require("lodash/has");
203
+ var i = r.n(l);
204
+ // CONCATENATED MODULE: external "lodash/includes"
205
+ const s = require("lodash/includes");
206
+ var c = r.n(s);
207
+ // CONCATENATED MODULE: external "lodash/keys"
208
+ const u = require("lodash/keys");
209
+ var p = r.n(u);
210
+ // CONCATENATED MODULE: external "lodash/omit"
211
+ const d = require("lodash/omit");
212
+ var f = r.n(d);
213
+ // CONCATENATED MODULE: external "lodash/slice"
214
+ const v = require("lodash/slice");
215
+ var h = r.n(v);
216
+ // CONCATENATED MODULE: external "lodash/startsWith"
217
+ const y = require("lodash/startsWith");
218
+ var m = r.n(y);
219
+ // CONCATENATED MODULE: external "lodash/toLower"
220
+ const b = require("lodash/toLower");
221
+ var g = r.n(b);
222
+ // CONCATENATED MODULE: external "lodash/memoize"
223
+ const x = require("lodash/memoize");
224
+ var w = r.n(x);
225
+ // CONCATENATED MODULE: external "tinycolor2"
226
+ const S = require("tinycolor2");
227
+ var k = r.n(S);
228
+ // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
229
+ const C = require("@splunk/react-ui/Dropdown");
230
+ var O = r.n(C);
231
+ // EXTERNAL MODULE: external "@splunk/themes"
232
+ var E = r(3563);
233
+ // CONCATENATED MODULE: external "@splunk/ui-utils/color"
234
+ const P = require("@splunk/ui-utils/color");
235
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
236
+ const I = require("@splunk/ui-utils/i18n");
237
+ // CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
238
+ const _ = require("@splunk/ui-utils/keyboard");
239
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
240
+ const j = require("@splunk/ui-utils/id");
241
+ // EXTERNAL MODULE: external "styled-components"
242
+ var q = r(232);
243
+ var R = r.n(q);
244
+ // CONCATENATED MODULE: external "@splunk/react-ui/Text"
245
+ const T = require("@splunk/react-ui/Text");
246
+ var B = r.n(T);
247
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
248
+ const V = require("@splunk/react-ui/ScreenReaderContent");
249
+ var D = r.n(V);
250
+ // CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
251
+ const A = require("@splunk/react-icons/Checkmark");
252
+ var N = r.n(A);
253
+ // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
254
+ const $ = require("@splunk/react-ui/Clickable");
255
+ var H = r.n($);
256
+ // CONCATENATED MODULE: ./src/Color/SwatchStyles.ts
257
+ var z = (0, E.pick)({
258
+ enterprise: E.variables.gray80,
259
+ prisma: "rgba(0, 0, 0, 0.2)"
260
+ });
261
+ var K = (0, q.css)([ "background-image:linear-gradient( 45deg,", " 25%,transparent 25%,transparent 75%,", " 75%,", " ),linear-gradient( 45deg,", " 25%,transparent 25%,transparent 75%,", " 75%,", " );background-size:10px 10px;background-position:0 0,5px 5px;background-color:", ";" ], z, z, z, z, z, z, (0,
262
+ E.pick)({
263
+ enterprise: "transparent",
264
+ prisma: E.variables.white
161
265
  }));
162
- }), (function(e) {
163
- var t = e.$value;
164
- return t && (t === "transparent" ? z : "background-color: ".concat(t));
165
- }), (function(e) {
166
- var t = e.$noBorder;
167
- return t && (0, j.css)([ "border:none;" ]);
168
- }), P.variables.focusColor, P.variables.focusShadow, (0, P.pick)({
169
- // Fixes focus shadow being cut off by input (SUI-6401)
170
- enterprise: (0, j.css)([ "z-index:1;" ])
171
- }), (0, P.pick)({
172
- enterprise: {
173
- comfortable: (0, j.css)([ "width:32px;height:32px;" ]),
174
- compact: (0, j.css)([ "width:24px;height:24px;" ])
175
- },
176
- prisma: (0, j.css)([ "width:24px;height:24px;" ])
177
- }), (function(e) {
178
- var t = e.$prepend;
179
- return t && (0, j.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
180
- }), (function(e) {
181
- var t = e.$append;
182
- return t && (0, j.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
183
- }), (function(e) {
184
- var t = e.$hasError;
185
- return t && (0, j.css)([ "box-shadow:inset 0 0 0 2px white;border-color:", ";" ], (0,
186
- P.pick)({
187
- enterprise: P.variables.errorColor,
188
- prisma: P.variables.accentColorNegative
266
+ var F = R()(N()).withConfig({
267
+ displayName: "SwatchStyles__StyledCheck",
268
+ componentId: "sc-1wxunhq-0"
269
+ })([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;" ]);
270
+ var M = R()(H()).withConfig({
271
+ displayName: "SwatchStyles__StyledClickable",
272
+ componentId: "sc-1wxunhq-1"
273
+ })([ "display:block;flex:0 0 auto;border:1px solid;border-color:", ";", ";", ";", ";", " &:focus{border-color:", ";box-shadow:", ";", "}", " ", " ", " &[disabled]{background-image:linear-gradient(rgba(255,255,255,0.8),rgba(255,255,255,0.8));}", " ", "" ], (0,
274
+ E.pick)({
275
+ enterprise: {
276
+ light: E.variables.gray60,
277
+ dark: E.variables.borderColor
278
+ },
279
+ prisma: E.variables.interactiveColorBorder
280
+ }), (0, E.pick)({
281
+ prisma: (0, q.css)([ "border-radius:2px;" ])
282
+ }), (function(e) {
283
+ var t = e.$value;
284
+ return t === null && (0, q.css)([ "background-image:linear-gradient( to bottom right,transparent 48%,", ",transparent 52% );", ";" ], (0,
285
+ E.pick)({
286
+ enterprise: "#ed1e24",
287
+ prisma: E.variables.accentColorNegative
288
+ }), (0, E.pick)({
289
+ prisma: (0, q.css)([ "background-color:", ";" ], E.variables.white)
290
+ }));
291
+ }), (function(e) {
292
+ var t = e.$value;
293
+ return t && (t === "transparent" ? K : "background-color: ".concat(t));
294
+ }), (function(e) {
295
+ var t = e.$noBorder;
296
+ return t && (0, q.css)([ "border:none;" ]);
297
+ }), E.variables.focusColor, E.variables.focusShadow, (0, E.pick)({
298
+ // Fixes focus shadow being cut off by input (SUI-6401)
299
+ enterprise: (0, q.css)([ "z-index:1;" ])
300
+ }), (0, E.pick)({
301
+ enterprise: {
302
+ comfortable: (0, q.css)([ "width:32px;height:32px;" ]),
303
+ compact: (0, q.css)([ "width:24px;height:24px;" ])
304
+ },
305
+ prisma: (0, q.css)([ "width:24px;height:24px;" ])
306
+ }), (function(e) {
307
+ var t = e.$prepend;
308
+ return t && (0, q.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
309
+ }), (function(e) {
310
+ var t = e.$append;
311
+ return t && (0, q.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
312
+ }), (function(e) {
313
+ var t = e.$hasError;
314
+ return t && (0, q.css)([ "box-shadow:inset 0 0 0 2px white;border-color:", ";" ], (0,
315
+ E.pick)({
316
+ enterprise: E.variables.errorColor,
317
+ prisma: E.variables.accentColorNegative
318
+ }));
319
+ }), (function(e) {
320
+ var t = e.$showSelected;
321
+ return t && (0, q.css)([ "display:flex;align-items:center;justify-content:center;" ]);
189
322
  }));
190
- }), (function(e) {
191
- var t = e.$showSelected;
192
- return t && (0, j.css)([ "display:flex;align-items:center;justify-content:center;" ]);
193
- }));
194
- // CONCATENATED MODULE: ./src/Color/Swatch.tsx
195
- function M() {
196
- M = Object.assign || function(e) {
197
- for (var t = 1; t < arguments.length; t++) {
198
- var r = arguments[t];
199
- for (var n in r) {
200
- if (Object.prototype.hasOwnProperty.call(r, n)) {
201
- e[n] = r[n];
323
+ // CONCATENATED MODULE: ./src/Color/Swatch.tsx
324
+ function L() {
325
+ L = Object.assign || function(e) {
326
+ for (var t = 1; t < arguments.length; t++) {
327
+ var r = arguments[t];
328
+ for (var n in r) {
329
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
330
+ e[n] = r[n];
331
+ }
202
332
  }
203
333
  }
334
+ return e;
335
+ };
336
+ return L.apply(this, arguments);
337
+ }
338
+ function U(e, t) {
339
+ if (e == null) return {};
340
+ var r = W(e, t);
341
+ var n, a;
342
+ if (Object.getOwnPropertySymbols) {
343
+ var o = Object.getOwnPropertySymbols(e);
344
+ for (a = 0; a < o.length; a++) {
345
+ n = o[a];
346
+ if (t.indexOf(n) >= 0) continue;
347
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
348
+ r[n] = e[n];
349
+ }
204
350
  }
205
- return e;
206
- };
207
- return M.apply(this, arguments);
208
- }
209
- function L(e, t) {
210
- if (e == null) return {};
211
- var r = U(e, t);
212
- var n, a;
213
- if (Object.getOwnPropertySymbols) {
214
- var o = Object.getOwnPropertySymbols(e);
215
- for (a = 0; a < o.length; a++) {
216
- n = o[a];
217
- if (t.indexOf(n) >= 0) continue;
218
- if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
219
- r[n] = e[n];
220
- }
351
+ return r;
221
352
  }
222
- return r;
223
- }
224
- function U(e, t) {
225
- if (e == null) return {};
226
- var r = {};
227
- var n = Object.keys(e);
228
- var a, o;
229
- for (o = 0; o < n.length; o++) {
230
- a = n[o];
231
- if (t.indexOf(a) >= 0) continue;
232
- r[a] = e[a];
353
+ function W(e, t) {
354
+ if (e == null) return {};
355
+ var r = {};
356
+ var n = Object.keys(e);
357
+ var a, o;
358
+ for (o = 0; o < n.length; o++) {
359
+ a = n[o];
360
+ if (t.indexOf(a) >= 0) continue;
361
+ r[a] = e[a];
362
+ }
363
+ return r;
233
364
  }
234
- return r;
235
- }
236
- var W = {
237
- append: o().bool,
238
- elementRef: o().oneOfType([ o().func, o().object ]),
239
- /** @private */
240
- error: o().bool,
241
- /** @private */
242
- noBorder: o().bool,
243
- /** @private. Call back function when activated. */
244
- onClick: o().func,
245
- prepend: o().bool,
246
- value: o().string,
247
- /** @private */
248
- showSelected: o().bool
249
- };
250
- var X = 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, c = e.showSelected, p = L(e, [ "append", "error", "onClick", "prepend", "value", "noBorder", "showSelected" ]);
252
- var d = s === null || s === undefined ? (0, _._)("No color") : s;
365
+ var X = {
366
+ append: o().bool,
367
+ elementRef: o().oneOfType([ o().func, o().object ]),
368
+ /** @private */
369
+ error: o().bool,
370
+ /** @private */
371
+ noBorder: o().bool,
372
+ /** @private. Call back function when activated. */
373
+ onClick: o().func,
374
+ prepend: o().bool,
375
+ value: o().string,
376
+ /** @private */
377
+ showSelected: o().bool
378
+ };
379
+ var G = t().forwardRef((function(e, r) {
380
+ var n = e.append, a = e.error, o = a === void 0 ? false : a, l = e.onClick, i = e.prepend, s = e.value, c = e.noBorder, u = e.showSelected, p = U(e, [ "append", "error", "onClick", "prepend", "value", "noBorder", "showSelected" ]);
381
+ var d = s === null || s === undefined ? (0, I._)("No color") : s;
253
382
  // Only valid hexadecimal strings, 'transparent' and `null` are allowed for background colors
254
- // Invalid values are converted to `undefined`
255
- var f = s;
256
- if (!(typeof f === "string" && ((0, O.isValidHexColor)(f) || f === "transparent")) && f !== null && f !== undefined) {
257
- f = undefined;
258
- }
259
-
260
- return n().createElement(F, M({
261
- onClick: function e(t) {
262
- return l === null || l === void 0 ? void 0 : l(t, {
263
- value: s
264
- });
383
+ // Invalid values are converted to `undefined`
384
+ var f = s;
385
+ if (!(typeof f === "string" && ((0, P.isValidHexColor)(f) || f === "transparent")) && f !== null && f !== undefined) {
386
+ f = undefined;
387
+ }
388
+
389
+ return t().createElement(M, L({
390
+ onClick: function e(t) {
391
+ return l === null || l === void 0 ? void 0 : l(t, {
392
+ value: s
393
+ });
394
+ },
395
+ ref: r,
396
+ $value: f,
397
+ $append: n,
398
+ $prepend: i,
399
+ $hasError: o,
400
+ $noBorder: c,
401
+ $showSelected: u,
402
+ "data-test": "swatch",
403
+ "data-test-value": s
404
+ }, p), u && t().createElement(F, {
405
+ "aria-label": (0, I._)("Selected"),
406
+ role: "presentation"
407
+ }), t().createElement(D(), null, d));
408
+ }));
409
+ G.propTypes = X;
410
+ /* harmony default export */ const J = G;
411
+ // CONCATENATED MODULE: ./src/Color/ColorStyles.ts
412
+ var Q = R().div.withConfig({
413
+ displayName: "ColorStyles__StyledColor",
414
+ componentId: "jxrost-0"
415
+ })([ "", ";flex-direction:row;" ], E.mixins.reset("flex"));
416
+ var Y = R()(J).withConfig({
417
+ displayName: "ColorStyles__StyledInputSwatch",
418
+ componentId: "jxrost-1"
419
+ })([ "", ";" ], (0, E.pick)({
420
+ compact: (0, q.css)([ "width:28px;height:28px;" ])
421
+ }));
422
+ var Z = R().div.withConfig({
423
+ displayName: "ColorStyles__StyledInput",
424
+ componentId: "jxrost-2"
425
+ })([ "", ";", "" ], (0, E.pick)({
426
+ enterprise: (0, q.css)([ "display:flex;" ]),
427
+ prisma: (0, q.css)([ "position:relative;" ])
428
+ }), (function(e) {
429
+ var t = e.$inDropdown;
430
+ return t ? (0, q.css)([ "width:", ";" ], (0, E.pick)({
431
+ enterprise: "100%",
432
+ prisma: "80px"
433
+ })) : (0, q.css)([ "flex:0 1 auto;min-width:0;" ]);
434
+ }));
435
+ var ee = R()(B()).withConfig({
436
+ displayName: "ColorStyles__StyledInputText",
437
+ componentId: "jxrost-3"
438
+ })([ "", "" ], (function(e) {
439
+ var t = e.$inDropdown;
440
+ return t && (0, q.css)([ "font-size:12px;" ]);
441
+ }));
442
+ var te = R()(J).withConfig({
443
+ displayName: "ColorStyles__StyledToggleSwatch",
444
+ componentId: "jxrost-4"
445
+ })([ "", "" ], (0, E.pick)({
446
+ prisma: {
447
+ comfortable: (0, q.css)([ "width:40px;height:40px;" ]),
448
+ compact: (0, q.css)([ "width:32px;height:32px;" ])
449
+ },
450
+ enterprise: {
451
+ comfortable: (0, q.css)([ "width:32px;height:32px;" ]),
452
+ compact: (0, q.css)([ "width:28px;height:28px;" ])
453
+ }
454
+ }));
455
+ // CONCATENATED MODULE: external "@splunk/react-icons/ChevronDown"
456
+ const re = require("@splunk/react-icons/ChevronDown");
457
+ var ne = r.n(re);
458
+ // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
459
+ const ae = require("@splunk/react-ui/Divider");
460
+ var oe = r.n(ae);
461
+ // CONCATENATED MODULE: ./src/Color/PaletteStyles.ts
462
+ var le = R().div.withConfig({
463
+ displayName: "PaletteStyles__StyledPalette",
464
+ componentId: "qgv9v9-0"
465
+ })([ "width:220px;padding:", ";" ], E.variables.spacingSmall);
466
+ var ie = R().ul.withConfig({
467
+ displayName: "PaletteStyles__StyledSwatches",
468
+ componentId: "qgv9v9-1"
469
+ })([ "", ";", "" ], E.mixins.reset("block"), (0, E.pick)({
470
+ enterprise: (0, q.css)([ "margin-bottom:", ";" ], E.variables.spacingXSmall)
471
+ }));
472
+ var se = R().li.withConfig({
473
+ displayName: "PaletteStyles__StyledSwatch",
474
+ componentId: "qgv9v9-2"
475
+ })([ "", ";margin-right:4px;margin-bottom:4px;vertical-align:top;", "" ], E.mixins.reset("inline-block"), (0,
476
+ E.pick)({
477
+ enterprise: {
478
+ compact: (0, q.css)([ "&:nth-child(8n){margin-right:0;}" ])
265
479
  },
266
- ref: t,
267
- $value: f,
268
- $append: r,
269
- $prepend: i,
270
- $hasError: o,
271
- $noBorder: u,
272
- $showSelected: c,
273
- "data-test": "swatch",
274
- "data-test-value": s
275
- }, p), c && n().createElement(K, {
276
- "aria-label": (0, _._)("Selected"),
277
- role: "presentation"
278
- }), n().createElement(V(), null, d));
279
- }));
280
- X.propTypes = W;
281
- /* harmony default export */ const G = X;
282
- // CONCATENATED MODULE: ./src/Color/ColorStyles.ts
283
- var J = I().div.withConfig({
284
- displayName: "ColorStyles__StyledColor",
285
- componentId: "jxrost-0"
286
- })([ "", ";flex-direction:row;" ], P.mixins.reset("flex"));
287
- var Q = I()(G).withConfig({
288
- displayName: "ColorStyles__StyledInputSwatch",
289
- componentId: "jxrost-1"
290
- })([ "", ";" ], (0, P.pick)({
291
- compact: (0, j.css)([ "width:28px;height:28px;" ])
292
- }));
293
- var Y = I().div.withConfig({
294
- displayName: "ColorStyles__StyledInput",
295
- componentId: "jxrost-2"
296
- })([ "", ";", "" ], (0, P.pick)({
297
- enterprise: (0, j.css)([ "display:flex;" ]),
298
- prisma: (0, j.css)([ "position:relative;" ])
299
- }), (function(e) {
300
- var t = e.$inDropdown;
301
- return t ? (0, j.css)([ "width:", ";" ], (0, P.pick)({
302
- enterprise: "100%",
303
- prisma: "80px"
304
- })) : (0, j.css)([ "flex:0 1 auto;min-width:0;" ]);
305
- }));
306
- var Z = I()(R()).withConfig({
307
- displayName: "ColorStyles__StyledInputText",
308
- componentId: "jxrost-3"
309
- })([ "", "" ], (function(e) {
310
- var t = e.$inDropdown;
311
- return t && (0, j.css)([ "font-size:12px;" ]);
312
- }));
313
- var ee = I()(G).withConfig({
314
- displayName: "ColorStyles__StyledToggleSwatch",
315
- componentId: "jxrost-4"
316
- })([ "", "" ], (0, P.pick)({
317
- prisma: {
318
- comfortable: (0, j.css)([ "width:40px;height:40px;" ]),
319
- compact: (0, j.css)([ "width:32px;height:32px;" ])
320
- },
321
- enterprise: {
322
- comfortable: (0, j.css)([ "width:32px;height:32px;" ]),
323
- compact: (0, j.css)([ "width:28px;height:28px;" ])
480
+ prisma: (0, q.css)([ "&:nth-child(8n){margin-right:0;}" ])
481
+ }));
482
+ var ce = R().div.withConfig({
483
+ displayName: "PaletteStyles__StyledToolBar",
484
+ componentId: "qgv9v9-3"
485
+ })([ "position:relative;display:flex;align-items:center;padding:0;margin-top:", ";", " gap:4px;" ], E.variables.spacingSmall, (0,
486
+ E.pick)({
487
+ enterprise: (0, q.css)([ "margin-bottom:", ";" ], E.variables.spacingSmall)
488
+ }));
489
+ var ue = R()(H()).withConfig({
490
+ displayName: "PaletteStyles__StyledExpandButton",
491
+ componentId: "qgv9v9-4"
492
+ })([ "position:absolute;bottom:4px;right:4px;padding:2px 4px;border-radius:2px;&:focus{box-shadow:", ";}", "" ], E.variables.focusShadow, (function(e) {
493
+ var t = e.$expanded;
494
+ return t && (0, q.css)([ "transform:rotate(180deg);" ]);
495
+ }));
496
+ var pe = R().div.withConfig({
497
+ displayName: "PaletteStyles__StyledSystemColorPickerWrapper",
498
+ componentId: "qgv9v9-5"
499
+ })([ "position:relative;" ]);
500
+ var de = R().input.withConfig({
501
+ displayName: "PaletteStyles__StyledSystemColorPicker",
502
+ componentId: "qgv9v9-6"
503
+ })([ "box-sizing:border-box;", " ", ";", ";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,
504
+ E.pick)({
505
+ enterprise: {
506
+ comfortable: (0, q.css)([ "width:32px;height:32px;" ]),
507
+ compact: (0, q.css)([ "width:24px;height:24px;" ])
508
+ },
509
+ prisma: (0, q.css)([ "width:24px;height:24px;" ])
510
+ }), (0, E.pick)({
511
+ enterprise: {
512
+ light: (0, q.css)([ "border:1px solid ", ";" ], E.variables.gray60),
513
+ dark: (0, q.css)([ "border:1px solid ", ";" ], E.variables.borderColor)
514
+ },
515
+ prisma: (0, q.css)([ "border:none;" ])
516
+ }), (0, E.pick)({
517
+ prisma: (0, q.css)([ "border-radius:2px;" ])
518
+ }), (0, E.pick)({
519
+ enterprise: {
520
+ comfortable: (0, q.css)([ "padding:1px 14px;" ])
521
+ }
522
+ }), E.variables.focusShadow);
523
+ var fe = R()(N()).withConfig({
524
+ displayName: "PaletteStyles__StyledCheck",
525
+ componentId: "qgv9v9-7"
526
+ })([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;position:absolute;top:0;left:0;pointer-events:none;" ]);
527
+ // CONCATENATED MODULE: ./src/Color/Palette.tsx
528
+ function ve(e, t) {
529
+ if (e == null) return {};
530
+ var r = he(e, t);
531
+ var n, a;
532
+ if (Object.getOwnPropertySymbols) {
533
+ var o = Object.getOwnPropertySymbols(e);
534
+ for (a = 0; a < o.length; a++) {
535
+ n = o[a];
536
+ if (t.indexOf(n) >= 0) continue;
537
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
538
+ r[n] = e[n];
539
+ }
540
+ }
541
+ return r;
324
542
  }
325
- }));
326
- // CONCATENATED MODULE: external "@splunk/react-icons/ChevronDown"
327
- const te = require("@splunk/react-icons/ChevronDown");
328
- var re = e.n(te);
329
- // CONCATENATED MODULE: external "@splunk/react-ui/Divider"
330
- const ne = require("@splunk/react-ui/Divider");
331
- var ae = e.n(ne);
332
- // CONCATENATED MODULE: ./src/Color/PaletteStyles.ts
333
- var oe = I().div.withConfig({
334
- displayName: "PaletteStyles__StyledPalette",
335
- componentId: "qgv9v9-0"
336
- })([ "width:220px;padding:", ";" ], P.variables.spacingSmall);
337
- var le = I().ul.withConfig({
338
- displayName: "PaletteStyles__StyledSwatches",
339
- componentId: "qgv9v9-1"
340
- })([ "", ";", "" ], P.mixins.reset("block"), (0, P.pick)({
341
- enterprise: (0, j.css)([ "margin-bottom:", ";" ], P.variables.spacingXSmall)
342
- }));
343
- var ie = I().li.withConfig({
344
- displayName: "PaletteStyles__StyledSwatch",
345
- componentId: "qgv9v9-2"
346
- })([ "", ";margin-right:4px;margin-bottom:4px;vertical-align:top;", "" ], P.mixins.reset("inline-block"), (0,
347
- P.pick)({
348
- enterprise: {
349
- compact: (0, j.css)([ "&:nth-child(8n){margin-right:0;}" ])
350
- },
351
- prisma: (0, j.css)([ "&:nth-child(8n){margin-right:0;}" ])
352
- }));
353
- var se = I().div.withConfig({
354
- displayName: "PaletteStyles__StyledToolBar",
355
- componentId: "qgv9v9-3"
356
- })([ "position:relative;display:flex;align-items:center;padding:0;margin-top:", ";", " gap:4px;" ], P.variables.spacingSmall, (0,
357
- P.pick)({
358
- enterprise: (0, j.css)([ "margin-bottom:", ";" ], P.variables.spacingSmall)
359
- }));
360
- var ue = I()($()).withConfig({
361
- displayName: "PaletteStyles__StyledExpandButton",
362
- componentId: "qgv9v9-4"
363
- })([ "position:absolute;bottom:4px;right:4px;padding:2px 4px;border-radius:2px;&:focus{box-shadow:", ";}", "" ], P.variables.focusShadow, (function(e) {
364
- var t = e.$expanded;
365
- return t && (0, j.css)([ "transform:rotate(180deg);" ]);
366
- }));
367
- var ce = I().div.withConfig({
368
- displayName: "PaletteStyles__StyledSystemColorPickerWrapper",
369
- componentId: "qgv9v9-5"
370
- })([ "position:relative;" ]);
371
- var pe = I().input.withConfig({
372
- displayName: "PaletteStyles__StyledSystemColorPicker",
373
- componentId: "qgv9v9-6"
374
- })([ "box-sizing:border-box;", " ", ";", ";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,
375
- P.pick)({
376
- enterprise: {
377
- comfortable: (0, j.css)([ "width:32px;height:32px;" ]),
378
- compact: (0, j.css)([ "width:24px;height:24px;" ])
379
- },
380
- prisma: (0, j.css)([ "width:24px;height:24px;" ])
381
- }), (0, P.pick)({
382
- enterprise: {
383
- light: (0, j.css)([ "border:1px solid ", ";" ], P.variables.gray60),
384
- dark: (0, j.css)([ "border:1px solid ", ";" ], P.variables.borderColor)
385
- },
386
- prisma: (0, j.css)([ "border:none;" ])
387
- }), (0, P.pick)({
388
- prisma: (0, j.css)([ "border-radius:2px;" ])
389
- }), (0, P.pick)({
390
- enterprise: {
391
- comfortable: (0, j.css)([ "padding:1px 14px;" ])
543
+ function he(e, t) {
544
+ if (e == null) return {};
545
+ var r = {};
546
+ var n = Object.keys(e);
547
+ var a, o;
548
+ for (o = 0; o < n.length; o++) {
549
+ a = n[o];
550
+ if (t.indexOf(a) >= 0) continue;
551
+ r[a] = e[a];
552
+ }
553
+ return r;
392
554
  }
393
- }), P.variables.focusShadow);
394
- var de = I()(D()).withConfig({
395
- displayName: "PaletteStyles__StyledCheck",
396
- componentId: "qgv9v9-7"
397
- })([ "box-sizing:border-box;color:#d3d3d3;height:100%;width:100%;position:absolute;top:0;left:0;pointer-events:none;" ]);
398
- // CONCATENATED MODULE: ./src/Color/Palette.tsx
399
- function fe(e) {
400
- var t = e.expanded, r = e.palette, a = e.value, o = e.swatchToFocusRef, l = e.onSwatchClick, i = e.expandButtonRef, s = e.onPaletteExpand, c = e.onSystemColorPickerChange, p = e.renderInput;
401
- var d = (0, P.useSplunkTheme)(), f = d.isPrisma, v = d.isLight;
402
- var m = u()(r.map((function(e) {
403
- return e && g()(e);
404
- })), a);
405
- var y = r.map((function(e, t) {
406
- var r = e === null ? null : g()(e);
407
- var i = r === a;
408
- var s = !m && t === 0 || m && i;
409
-
410
- return n().createElement(ie, {
411
- key: r || "null"
412
- }, n().createElement(G, {
413
- value: r,
414
- ref: s ? o : null,
415
- onClick: l,
416
- noBorder: f,
417
- showSelected: i
555
+ function ye(e) {
556
+ var r = e.expanded, n = e.palette, a = e.value, o = e.swatchToFocusRef, l = e.onSwatchClick, i = e.expandButtonRef, s = e.onPaletteExpand, u = e.onSystemColorPickerChange, p = e.renderInput, d = ve(e, [ "expanded", "palette", "value", "swatchToFocusRef", "onSwatchClick", "expandButtonRef", "onPaletteExpand", "onSystemColorPickerChange", "renderInput" ]);
557
+ var f = (0, E.useSplunkTheme)(), v = f.isPrisma, y = f.isLight;
558
+ var m = c()(n.map((function(e) {
559
+ return e && g()(e);
560
+ })), a);
561
+ var b = n.map((function(e, r) {
562
+ var n = e === null ? null : g()(e);
563
+ var i = n === a;
564
+ var s = !m && r === 0 || m && i;
565
+
566
+ return t().createElement(se, {
567
+ key: n || "null"
568
+ }, t().createElement(J, {
569
+ value: n,
570
+ ref: s ? o : null,
571
+ onClick: l,
572
+ noBorder: v,
573
+ showSelected: i
574
+ }));
418
575
  }));
419
- }));
420
- var b = function e() {
421
- var t = !m && a !== "#ffffff" && a !== "#000000" && a !== null && a !== "";
422
-
423
- return n().createElement(se, {
424
- "data-test": "tool-bar"
425
- }, f && n().createElement(P.SplunkThemeProvider, {
426
- density: "compact"
427
- }, p && p()), n().createElement(G, {
428
- value: null,
429
- ref: a === null ? o : null,
430
- onClick: l,
431
- noBorder: f && !v,
432
- showSelected: a === null
433
- }), n().createElement(G, {
434
- value: "#ffffff",
435
- ref: a === "#ffffff" ? o : null,
436
- onClick: l,
437
- noBorder: f && !v,
438
- showSelected: a === "#ffffff"
439
- }), n().createElement(G, {
440
- value: "#000000",
441
- ref: a === "#000000" ? o : null,
442
- onClick: l,
443
- noBorder: f,
444
- showSelected: a === "#000000"
445
- }), n().createElement(ce, null, n().createElement(pe, {
446
- type: "color",
447
- value: a === null ? "" : a,
448
- onChange: c,
449
- ref: t ? o : null
450
- }), t && n().createElement(de, {
451
- "aria-label": (0, _._)("Selected"),
452
- role: "presentation"
453
- })));
454
- };
455
- var x = y.length === 8 ? 7 : 15;
456
- var S = h()(y, 0, x);
457
- var w = h()(y, x);
458
- if (f) {
576
+ var x = function e() {
577
+ var r = !m && a !== "#ffffff" && a !== "#000000" && a !== null && a !== "";
578
+
579
+ return t().createElement(ce, {
580
+ "data-test": "tool-bar"
581
+ }, v && t().createElement(E.SplunkThemeProvider, {
582
+ density: "compact"
583
+ }, p && p()), t().createElement(J, {
584
+ value: null,
585
+ ref: a === null ? o : null,
586
+ onClick: l,
587
+ noBorder: v && !y,
588
+ showSelected: a === null
589
+ }), t().createElement(J, {
590
+ value: "#ffffff",
591
+ ref: a === "#ffffff" ? o : null,
592
+ onClick: l,
593
+ noBorder: v && !y,
594
+ showSelected: a === "#ffffff"
595
+ }), t().createElement(J, {
596
+ value: "#000000",
597
+ ref: a === "#000000" ? o : null,
598
+ onClick: l,
599
+ noBorder: v,
600
+ showSelected: a === "#000000"
601
+ }), t().createElement(pe, null, t().createElement(de, {
602
+ type: "color",
603
+ value: a === null ? "" : a,
604
+ onChange: u,
605
+ ref: r ? o : null
606
+ }), r && t().createElement(fe, {
607
+ "aria-label": (0, I._)("Selected"),
608
+ role: "presentation"
609
+ })));
610
+ };
611
+ var w = b.length === 8 ? 7 : 15;
612
+ var S = h()(b, 0, w);
613
+ var k = h()(b, w);
614
+ if (v) {
615
+
616
+ return t().createElement(le, d, t().createElement("div", {
617
+ style: {
618
+ position: "relative"
619
+ }
620
+ }, t().createElement(ie, null, S, r && k), r && x(), t().createElement(ue, {
621
+ ref: i,
622
+ $expanded: r,
623
+ onClick: s,
624
+ "data-test": "expand-button"
625
+ }, t().createElement(ne(), null))));
626
+ }
459
627
 
460
- return n().createElement(oe, null, n().createElement("div", {
461
- style: {
462
- position: "relative"
463
- }
464
- }, n().createElement(le, null, S, t && w), t && b(), n().createElement(ue, {
465
- ref: i,
466
- $expanded: t,
467
- onClick: s,
468
- "data-test": "expand-button"
469
- }, n().createElement(re(), null))));
628
+ return t().createElement(le, d, t().createElement(ie, null, b), t().createElement(oe(), null), x(), p && p());
470
629
  }
471
-
472
- return n().createElement(oe, null, n().createElement(le, null, y), n().createElement(ae(), null), b(), p && p());
473
- }
474
- /* harmony default export */ const ve = fe;
475
- // CONCATENATED MODULE: ./src/Color/Color.tsx
476
- function he(e) {
477
- "@babel/helpers - typeof";
478
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
479
- he = function e(t) {
480
- return typeof t;
481
- };
482
- } else {
483
- he = function e(t) {
484
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
485
- };
630
+ /* harmony default export */ const me = ye;
631
+ // EXTERNAL MODULE: ./src/ScreenReaderContent/index.ts + 2 modules
632
+ var be = r(6165);
633
+ // CONCATENATED MODULE: ./src/Color/Color.tsx
634
+ function ge(e) {
635
+ "@babel/helpers - typeof";
636
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
637
+ ge = function e(t) {
638
+ return typeof t;
639
+ };
640
+ } else {
641
+ ge = function e(t) {
642
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
643
+ };
644
+ }
645
+ return ge(e);
486
646
  }
487
- return he(e);
488
- }
489
- function me() {
490
- me = Object.assign || function(e) {
491
- for (var t = 1; t < arguments.length; t++) {
492
- var r = arguments[t];
493
- for (var n in r) {
494
- if (Object.prototype.hasOwnProperty.call(r, n)) {
495
- e[n] = r[n];
647
+ function xe() {
648
+ xe = Object.assign || function(e) {
649
+ for (var t = 1; t < arguments.length; t++) {
650
+ var r = arguments[t];
651
+ for (var n in r) {
652
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
653
+ e[n] = r[n];
654
+ }
496
655
  }
497
656
  }
657
+ return e;
658
+ };
659
+ return xe.apply(this, arguments);
660
+ }
661
+ function we(e) {
662
+ return Oe(e) || Ce(e) || ke(e) || Se();
663
+ }
664
+ function Se() {
665
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
666
+ }
667
+ function ke(e, t) {
668
+ if (!e) return;
669
+ if (typeof e === "string") return Ee(e, t);
670
+ var r = Object.prototype.toString.call(e).slice(8, -1);
671
+ if (r === "Object" && e.constructor) r = e.constructor.name;
672
+ if (r === "Map" || r === "Set") return Array.from(e);
673
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Ee(e, t);
674
+ }
675
+ function Ce(e) {
676
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
677
+ }
678
+ function Oe(e) {
679
+ if (Array.isArray(e)) return Ee(e);
680
+ }
681
+ function Ee(e, t) {
682
+ if (t == null || t > e.length) t = e.length;
683
+ for (var r = 0, n = new Array(t); r < t; r++) {
684
+ n[r] = e[r];
498
685
  }
499
- return e;
500
- };
501
- return me.apply(this, arguments);
502
- }
503
- function ye(e) {
504
- return Se(e) || xe(e) || ge(e) || be();
505
- }
506
- function be() {
507
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
508
- }
509
- function ge(e, t) {
510
- if (!e) return;
511
- if (typeof e === "string") return we(e, t);
512
- var r = Object.prototype.toString.call(e).slice(8, -1);
513
- if (r === "Object" && e.constructor) r = e.constructor.name;
514
- if (r === "Map" || r === "Set") return Array.from(e);
515
- if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return we(e, t);
516
- }
517
- function xe(e) {
518
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
519
- }
520
- function Se(e) {
521
- if (Array.isArray(e)) return we(e);
522
- }
523
- function we(e, t) {
524
- if (t == null || t > e.length) t = e.length;
525
- for (var r = 0, n = new Array(t); r < t; r++) {
526
- n[r] = e[r];
686
+ return n;
527
687
  }
528
- return n;
529
- }
530
- function ke(e, t) {
531
- if (e == null) return {};
532
- var r = Ce(e, t);
533
- var n, a;
534
- if (Object.getOwnPropertySymbols) {
535
- var o = Object.getOwnPropertySymbols(e);
536
- for (a = 0; a < o.length; a++) {
537
- n = o[a];
538
- if (t.indexOf(n) >= 0) continue;
539
- if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
540
- r[n] = e[n];
688
+ function Pe(e, t) {
689
+ if (e == null) return {};
690
+ var r = Ie(e, t);
691
+ var n, a;
692
+ if (Object.getOwnPropertySymbols) {
693
+ var o = Object.getOwnPropertySymbols(e);
694
+ for (a = 0; a < o.length; a++) {
695
+ n = o[a];
696
+ if (t.indexOf(n) >= 0) continue;
697
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
698
+ r[n] = e[n];
699
+ }
541
700
  }
701
+ return r;
542
702
  }
543
- return r;
544
- }
545
- function Ce(e, t) {
546
- if (e == null) return {};
547
- var r = {};
548
- var n = Object.keys(e);
549
- var a, o;
550
- for (o = 0; o < n.length; o++) {
551
- a = n[o];
552
- if (t.indexOf(a) >= 0) continue;
553
- r[a] = e[a];
703
+ function Ie(e, t) {
704
+ if (e == null) return {};
705
+ var r = {};
706
+ var n = Object.keys(e);
707
+ var a, o;
708
+ for (o = 0; o < n.length; o++) {
709
+ a = n[o];
710
+ if (t.indexOf(a) >= 0) continue;
711
+ r[a] = e[a];
712
+ }
713
+ return r;
554
714
  }
555
- return r;
556
- }
557
- function Ee(e, t) {
558
- if (!(e instanceof t)) {
559
- throw new TypeError("Cannot call a class as a function");
715
+ function _e(e, t) {
716
+ if (!(e instanceof t)) {
717
+ throw new TypeError("Cannot call a class as a function");
718
+ }
560
719
  }
561
- }
562
- function Pe(e, t) {
563
- for (var r = 0; r < t.length; r++) {
564
- var n = t[r];
565
- n.enumerable = n.enumerable || false;
566
- n.configurable = true;
567
- if ("value" in n) n.writable = true;
568
- Object.defineProperty(e, n.key, n);
720
+ function je(e, t) {
721
+ for (var r = 0; r < t.length; r++) {
722
+ var n = t[r];
723
+ n.enumerable = n.enumerable || false;
724
+ n.configurable = true;
725
+ if ("value" in n) n.writable = true;
726
+ Object.defineProperty(e, n.key, n);
727
+ }
569
728
  }
570
- }
571
- function Oe(e, t, r) {
572
- if (t) Pe(e.prototype, t);
573
- if (r) Pe(e, r);
574
- return e;
575
- }
576
- function _e(e, t) {
577
- if (typeof t !== "function" && t !== null) {
578
- throw new TypeError("Super expression must either be null or a function");
729
+ function qe(e, t, r) {
730
+ if (t) je(e.prototype, t);
731
+ if (r) je(e, r);
732
+ return e;
579
733
  }
580
- e.prototype = Object.create(t && t.prototype, {
581
- constructor: {
582
- value: e,
583
- writable: true,
584
- configurable: true
734
+ function Re(e, t) {
735
+ if (typeof t !== "function" && t !== null) {
736
+ throw new TypeError("Super expression must either be null or a function");
585
737
  }
586
- });
587
- if (t) qe(e, t);
588
- }
589
- function qe(e, t) {
590
- qe = Object.setPrototypeOf || function e(t, r) {
591
- t.__proto__ = r;
592
- return t;
593
- };
594
- return qe(e, t);
595
- }
596
- function je(e) {
597
- var t = Re();
598
- return function r() {
599
- var n = Be(e), a;
600
- if (t) {
601
- var o = Be(this).constructor;
602
- a = Reflect.construct(n, arguments, o);
603
- } else {
604
- a = n.apply(this, arguments);
738
+ e.prototype = Object.create(t && t.prototype, {
739
+ constructor: {
740
+ value: e,
741
+ writable: true,
742
+ configurable: true
743
+ }
744
+ });
745
+ if (t) Te(e, t);
746
+ }
747
+ function Te(e, t) {
748
+ Te = Object.setPrototypeOf || function e(t, r) {
749
+ t.__proto__ = r;
750
+ return t;
751
+ };
752
+ return Te(e, t);
753
+ }
754
+ function Be(e) {
755
+ var t = Ae();
756
+ return function r() {
757
+ var n = Ne(e), a;
758
+ if (t) {
759
+ var o = Ne(this).constructor;
760
+ a = Reflect.construct(n, arguments, o);
761
+ } else {
762
+ a = n.apply(this, arguments);
763
+ }
764
+ return Ve(this, a);
765
+ };
766
+ }
767
+ function Ve(e, t) {
768
+ if (t && (ge(t) === "object" || typeof t === "function")) {
769
+ return t;
605
770
  }
606
- return Ie(this, a);
607
- };
608
- }
609
- function Ie(e, t) {
610
- if (t && (he(t) === "object" || typeof t === "function")) {
611
- return t;
771
+ return De(e);
612
772
  }
613
- return Te(e);
614
- }
615
- function Te(e) {
616
- if (e === void 0) {
617
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
773
+ function De(e) {
774
+ if (e === void 0) {
775
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
776
+ }
777
+ return e;
618
778
  }
619
- return e;
620
- }
621
- function Re() {
622
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
623
- if (Reflect.construct.sham) return false;
624
- if (typeof Proxy === "function") return true;
625
- try {
626
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
627
- return true;
628
- } catch (e) {
629
- return false;
779
+ function Ae() {
780
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
781
+ if (Reflect.construct.sham) return false;
782
+ if (typeof Proxy === "function") return true;
783
+ try {
784
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
785
+ return true;
786
+ } catch (e) {
787
+ return false;
788
+ }
630
789
  }
631
- }
632
- function Be(e) {
633
- Be = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
634
- return t.__proto__ || Object.getPrototypeOf(t);
635
- };
636
- return Be(e);
637
- }
638
- function Ve(e, t, r) {
639
- if (t in e) {
640
- Object.defineProperty(e, t, {
641
- value: r,
642
- enumerable: true,
643
- configurable: true,
644
- writable: true
645
- });
646
- } else {
647
- e[t] = r;
790
+ function Ne(e) {
791
+ Ne = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
792
+ return t.__proto__ || Object.getPrototypeOf(t);
793
+ };
794
+ return Ne(e);
648
795
  }
649
- return e;
650
- }
651
- // The default palette in Prisma theme.
652
- var Ae = [ "#912344", "#D44C20", "#C0891E", "#26AA92", "#2F8AA7", "#2E49AA", "#602CA1", "#BA4ABD" ];
653
- var De = S()((function(e) {
654
- var t = [];
655
- for (var r = 1; r <= e.length * 4; r += 1) {
656
- var n = e[(r - 1) % e.length];
657
- if (r > e.length * 3) {
658
- t.push(n);
796
+ function $e(e, t, r) {
797
+ if (t in e) {
798
+ Object.defineProperty(e, t, {
799
+ value: r,
800
+ enumerable: true,
801
+ configurable: true,
802
+ writable: true
803
+ });
659
804
  } else {
660
- var a = 40 - 10 * (r / e.length);
661
- t.push(k()(n).lighten(a).toString());
805
+ e[t] = r;
662
806
  }
807
+ return e;
663
808
  }
664
- return t;
665
- }));
809
+ /** @public */
810
+ // The default palette in Prisma theme.
811
+ var He = [ "#912344", "#D44C20", "#C0891E", "#26AA92", "#2F8AA7", "#2E49AA", "#602CA1", "#BA4ABD" ];
812
+ var ze = w()((function(e) {
813
+ var t = [];
814
+ for (var r = 1; r <= e.length * 4; r += 1) {
815
+ var n = e[(r - 1) % e.length];
816
+ if (r > e.length * 3) {
817
+ t.push(n);
818
+ } else {
819
+ var a = 40 - 10 * (r / e.length);
820
+ t.push(k()(n).lighten(a).toString());
821
+ }
822
+ }
823
+ return t;
824
+ }));
666
825
  // The tool palette in Prisma theme.
667
- var Ne = [ "#ffffff", "#000000", null ];
668
- var $e = {
669
- append: o().bool,
670
- defaultValue: o().string,
671
- describedBy: o().string,
672
- disabled: o().bool,
673
- elementRef: o().oneOfType([ o().func, o().object ]),
674
- error: o().bool,
675
- hideInput: o().bool,
676
- labelledBy: o().string,
677
- name: o().string,
678
- onChange: o().func,
679
- palette: o().array,
680
- prepend: o().bool,
681
- /** @private */
682
- required: o().bool,
683
- /** @private */
684
- splunkTheme: o().object,
685
- value: o().string
686
- };
687
- var He = {
688
- append: false,
689
- disabled: false,
690
- error: false,
691
- palette: De(Ae),
692
- prepend: false
693
- };
694
- // TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
695
- var ze = function e(t) {
696
- return (0, O.isValidHexColor)(t);
697
- };
698
- var Ke = "N/A";
699
- var Fe = "n/a";
700
- /*
826
+ var Ke = [ "#ffffff", "#000000", null ];
827
+ var Fe = {
828
+ append: o().bool,
829
+ defaultValue: o().string,
830
+ describedBy: o().string,
831
+ disabled: o().bool,
832
+ elementRef: o().oneOfType([ o().func, o().object ]),
833
+ error: o().bool,
834
+ hideInput: o().bool,
835
+ labelledBy: o().string,
836
+ name: o().string,
837
+ onChange: o().func,
838
+ palette: o().array,
839
+ prepend: o().bool,
840
+ /** @private */
841
+ required: o().bool,
842
+ /** @private */
843
+ splunkTheme: o().object,
844
+ value: o().string
845
+ };
846
+ var Me = {
847
+ append: false,
848
+ disabled: false,
849
+ error: false,
850
+ palette: ze(He),
851
+ prepend: false
852
+ };
853
+ // TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
854
+ var Le = function e(t) {
855
+ return (0, P.isValidHexColor)(t);
856
+ };
857
+ var Ue = "N/A";
858
+ var We = "n/a";
859
+ /*
701
860
  * When the dropdown opens:
702
861
  * 1. If palette contains the color and the color is selected, the dropdown focus the color.
703
862
  * 2. If palette doesn't contain the color:
704
863
  * 1. If the current theme `family` is `prisma` the input receives focus.
705
864
  * 2. Otherwise the first color swatch receives focus.
706
- */ var Me = function(e) {
707
- _e(r, e);
708
- var t = je(r);
709
- Oe(r, null, [ {
710
- key: "hasNull",
711
- // @docs-props-type ColorPropsBase
712
- value: function e(t) {
713
- return t.some((function(e) {
714
- return e === null;
715
- }));
716
- }
717
- }, {
718
- key: "hasTransparent",
719
- value: function e(t) {
720
- return t.some((function(e) {
721
- return e !== null && g()(e) === "transparent";
722
- }));
723
- }
724
- } ]);
725
- function r(e) {
726
- var a;
727
- Ee(this, r);
728
- a = t.call(this, e);
729
- Ve(Te(a), "focusSwatch", void 0);
730
- Ve(Te(a), "focusExpandButton", void 0);
731
- Ve(Te(a), "controlledExternally", void 0);
732
- Ve(Te(a), "dropdown", null);
733
- Ve(Te(a), "handleSwatchClick", (function(e, t) {
734
- var r = t.value;
735
- e.preventDefault();
736
- var n = a.props, o = n.name, l = n.onChange;
737
- var i = a.getValue();
738
- var s = r !== i;
739
- var u = r === null ? Ke : r;
740
- if (!a.isControlled()) {
741
- a.setState({
742
- value: r
743
- });
865
+ */ var Xe = function(e) {
866
+ Re(n, e);
867
+ var r = Be(n);
868
+ qe(n, null, [ {
869
+ key: "hasNull",
870
+ // @docs-props-type ColorPropsBase
871
+ value: function e(t) {
872
+ return t.some((function(e) {
873
+ return e === null;
874
+ }));
744
875
  }
745
- a.setState({
746
- displayValue: u,
747
- open: false
748
- });
749
- if (s) {
750
- l === null || l === void 0 ? void 0 : l({
751
- value: r,
752
- name: o
753
- });
876
+ }, {
877
+ key: "hasTransparent",
878
+ value: function e(t) {
879
+ return t.some((function(e) {
880
+ return e !== null && g()(e) === "transparent";
881
+ }));
754
882
  }
755
- a.focus();
756
- }));
757
- Ve(Te(a), "handlePaletteExpand", (function() {
758
- a.setState((function(e) {
759
- return {
760
- expanded: !e.expanded
761
- };
762
- }));
763
- }));
764
- Ve(Te(a), "handleTextChange", (function(e, t) {
765
- var r = t.value;
766
- a.setState({
767
- displayValue: r
768
- });
769
- }));
770
- Ve(Te(a), "handleTextKeyDown", (function(e) {
771
- if ((0, q.keycode)(e.nativeEvent) === "enter") {
883
+ } ]);
884
+ function n(e) {
885
+ var a;
886
+ _e(this, n);
887
+ a = r.call(this, e);
888
+ $e(De(a), "focusSwatch", void 0);
889
+ $e(De(a), "focusExpandButton", void 0);
890
+ $e(De(a), "controlledExternally", void 0);
891
+ $e(De(a), "dropdown", null);
892
+ $e(De(a), "swatchToggleReaderContentId", (0, j.createDOMID)("swatch-reader-content"));
893
+ $e(De(a), "hexInputReaderContentId", (0, j.createDOMID)("hex-input-reader-content"));
894
+ $e(De(a), "handleSwatchClick", (function(e, t) {
895
+ var r = t.value;
772
896
  e.preventDefault();
773
- a.handleRequestClose({
774
- reason: "enterKey"
897
+ var n = a.props, o = n.name, l = n.onChange;
898
+ var i = a.getValue();
899
+ var s = r !== i;
900
+ var c = r === null ? Ue : r;
901
+ if (!a.isControlled()) {
902
+ a.setState({
903
+ value: r
904
+ });
905
+ }
906
+ a.setState({
907
+ displayValue: c,
908
+ open: false
775
909
  });
910
+ if (s) {
911
+ l === null || l === void 0 ? void 0 : l({
912
+ value: r,
913
+ name: o
914
+ });
915
+ }
776
916
  a.focus();
777
- }
778
- }));
779
- Ve(Te(a), "handleButtonClick", (function(e) {
780
- e.preventDefault();
781
- a.handleRequestClose({
782
- reason: "buttonClick"
783
- });
784
- a.focus();
785
- }));
786
- Ve(Te(a), "handleRequestClose", (function(e) {
787
- var t = e.reason;
788
- var r = a.state.displayValue;
789
- var n = a.state.value;
790
- if (g()(r) === Fe) {
791
- r = Ke;
917
+ }));
918
+ $e(De(a), "handlePaletteExpand", (function() {
919
+ a.setState((function(e) {
920
+ return {
921
+ expanded: !e.expanded
922
+ };
923
+ }));
924
+ }));
925
+ $e(De(a), "handleTextChange", (function(e, t) {
926
+ var r = t.value;
792
927
  a.setState({
793
928
  displayValue: r
794
929
  });
795
- } else if (g()(r) === "transparent") {
796
- r = "transparent";
797
- a.setState({
798
- displayValue: r
930
+ }));
931
+ $e(De(a), "handleTextKeyDown", (function(e) {
932
+ if ((0, _.keycode)(e.nativeEvent) === "enter") {
933
+ e.preventDefault();
934
+ a.handleRequestClose({
935
+ reason: "enterKey"
936
+ });
937
+ a.focus();
938
+ }
939
+ }));
940
+ $e(De(a), "handleButtonClick", (function(e) {
941
+ e.preventDefault();
942
+ a.handleRequestClose({
943
+ reason: "buttonClick"
799
944
  });
800
- }
945
+ a.focus();
946
+ }));
947
+ $e(De(a), "handleRequestClose", (function(e) {
948
+ var t = e.reason;
949
+ var r = a.state.displayValue;
950
+ var n = a.state.value;
951
+ if (g()(r) === We) {
952
+ r = Ue;
953
+ a.setState({
954
+ displayValue: r
955
+ });
956
+ } else if (g()(r) === "transparent") {
957
+ r = "transparent";
958
+ a.setState({
959
+ displayValue: r
960
+ });
961
+ }
801
962
  // If the user types in the hexadecimal number without # in front,
802
- // we add # automatically.
803
- if (r !== Ke && g()(r) !== "transparent" && !y()(r, "#")) {
804
- r = "#".concat(r);
805
- if (t === "escapeKey") {
806
- if (n == null) {
807
- a.setState({
808
- displayValue: Ke
809
- });
963
+ // we add # automatically.
964
+ if (r !== Ue && g()(r) !== "transparent" && !m()(r, "#")) {
965
+ r = "#".concat(r);
966
+ if (t === "escapeKey") {
967
+ if (n == null) {
968
+ a.setState({
969
+ displayValue: Ue
970
+ });
971
+ } else {
972
+ a.setState({
973
+ displayValue: n
974
+ });
975
+ }
810
976
  } else {
811
977
  a.setState({
812
- displayValue: n
978
+ displayValue: r
813
979
  });
814
980
  }
815
- } else {
981
+ }
982
+ if (t !== "contentClick") {
816
983
  a.setState({
817
- displayValue: r
984
+ open: false
818
985
  });
819
986
  }
820
- }
821
- if (t !== "contentClick") {
822
- a.setState({
823
- open: false
824
- });
825
- }
826
- if (t !== "escapeKey") {
827
- a.submitValue(r);
828
- }
829
- }));
830
- Ve(Te(a), "handleRequestOpen", (function() {
831
- var e = a.props, t = e.splunkTheme, r = e.palette;
832
- var n = t.isPrisma;
833
- var o = a.getValue();
834
- var l = o === null ? Ke : o;
835
- a.setState({
836
- displayValue: l,
837
- open: true
838
- }, (function() {
839
- if (a.focusSwatch.current && a.focusSwatch.current.focus) {
840
- a.focusSwatch.current.focus();
987
+ if (t !== "escapeKey") {
988
+ a.submitValue(r);
841
989
  }
842
990
  }));
843
- var i = n ? h()(r, 15) : r;
844
- var s = !u()(r.map((function(e) {
845
- return e && g()(e);
846
- })), o);
847
- var c = s || u()(i.map((function(e) {
848
- return e && g()(e);
849
- })), o) || u()(Ne, o);
850
- if (c && !a.state.expanded) {
991
+ $e(De(a), "handleRequestOpen", (function() {
992
+ var e = a.props, t = e.splunkTheme, r = e.palette;
993
+ var n = t.isPrisma;
994
+ var o = a.getValue();
995
+ var l = o === null ? Ue : o;
851
996
  a.setState({
852
- expanded: true
853
- });
854
- }
855
- }));
856
- Ve(Te(a), "handleSystemColorPickerChange", (function(e) {
857
- var t = a.getValue();
858
- var r = e !== t;
859
- var n = a.props.name;
860
- var o = e === null ? Ke : e;
861
- if (!a.isControlled()) {
997
+ displayValue: l,
998
+ open: true
999
+ }, (function() {
1000
+ if (a.focusSwatch.current && a.focusSwatch.current.focus) {
1001
+ a.focusSwatch.current.focus();
1002
+ }
1003
+ }));
1004
+ var i = n ? h()(r, 15) : r;
1005
+ var s = !c()(r.map((function(e) {
1006
+ return e && g()(e);
1007
+ })), o);
1008
+ var u = s || c()(i.map((function(e) {
1009
+ return e && g()(e);
1010
+ })), o) || c()(Ke, o);
1011
+ if (u && !a.state.expanded) {
1012
+ a.setState({
1013
+ expanded: true
1014
+ });
1015
+ }
1016
+ }));
1017
+ $e(De(a), "handleSystemColorPickerChange", (function(e) {
1018
+ var t = a.getValue();
1019
+ var r = e !== t;
1020
+ var n = a.props.name;
1021
+ var o = e === null ? Ue : e;
1022
+ if (!a.isControlled()) {
1023
+ a.setState({
1024
+ value: e
1025
+ });
1026
+ }
862
1027
  a.setState({
863
- value: e
1028
+ displayValue: o
864
1029
  });
865
- }
866
- a.setState({
867
- displayValue: o
868
- });
869
- if (r) {
870
- var l, i;
871
- (l = (i = a.props).onChange) === null || l === void 0 ? void 0 : l.call(i, {
872
- value: e,
873
- name: n
874
- });
875
- }
876
- }));
877
- a.focusSwatch = n().createRef();
878
- a.focusExpandButton = n().createRef();
879
- a.controlledExternally = i()(e, "value");
1030
+ if (r) {
1031
+ var l, i;
1032
+ (l = (i = a.props).onChange) === null || l === void 0 ? void 0 : l.call(i, {
1033
+ value: e,
1034
+ name: n
1035
+ });
1036
+ }
1037
+ }));
1038
+ a.focusSwatch = t().createRef();
1039
+ a.focusExpandButton = t().createRef();
1040
+ a.controlledExternally = i()(e, "value");
880
1041
  // value can be hexadecimal color, 'transparent' or null
881
- var o = a.controlledExternally ? (0, O.expandShortHandHex)(e.value) : (0,
882
- O.expandShortHandHex)(e.defaultValue);
883
- if (o !== null) {
884
- o = g()(o);
885
- }
1042
+ var o = a.controlledExternally ? (0, P.expandShortHandHex)(e.value) : (0,
1043
+ P.expandShortHandHex)(e.defaultValue);
1044
+ if (o !== null) {
1045
+ o = g()(o);
1046
+ }
886
1047
  // displayValue can be hexadecimal color or 'transparent' to represent 'transparent' or 'N/A' to represent null
887
- var l = o === null ? Ke : o;
888
- a.state = {
889
- displayValue: l,
890
- open: false,
891
- value: o,
892
- expanded: false
893
- };
894
- if (false) {}
895
- if (false) {
896
- var s;
897
- }
898
- return a;
899
- }
900
- Oe(r, [ {
901
- key: "componentDidUpdate",
902
- value: function e(t) {
903
- if (false) {}
1048
+ var l = o === null ? Ue : o;
1049
+ a.state = {
1050
+ displayValue: l,
1051
+ open: false,
1052
+ value: o,
1053
+ expanded: false
1054
+ };
904
1055
  if (false) {}
1056
+ if (false) {
1057
+ var s;
1058
+ }
1059
+ return a;
905
1060
  }
906
- /**
1061
+ qe(n, [ {
1062
+ key: "componentDidUpdate",
1063
+ value: function e(t) {
1064
+ if (false) {}
1065
+ if (false) {}
1066
+ }
1067
+ /**
907
1068
  * Standardizes the current value of the Color:
908
1069
  * returns based on the input being controlled or uncontrolled
909
1070
  * returns controlled component's value as formatted.
910
- */ }, {
911
- key: "getValue",
912
- value: function e() {
913
- var t = function e(t) {
914
- return t === null ? null : g()(t);
915
- };
916
- var r = (0, O.expandShortHandHex)(this.props.value);
917
- if (this.isControlled()) {
918
- return t(r);
919
- }
920
- return this.state.value;
921
- }
922
- }, {
923
- key: "submitValue",
924
- value: function e(t) {
925
- if (t) {
926
- var n = ze(t);
927
- if (!n && t !== "transparent" && t !== Ke) {
928
- // eslint-disable-next-line no-console
929
- console.warn('"'.concat(t, '" is not a valid hex color.'));
1071
+ */ }, {
1072
+ key: "getValue",
1073
+ value: function e() {
1074
+ var t = function e(t) {
1075
+ return t === null ? null : g()(t);
1076
+ };
1077
+ var r = (0, P.expandShortHandHex)(this.props.value);
1078
+ if (this.isControlled()) {
1079
+ return t(r);
930
1080
  }
931
- if (n || r.hasTransparent(this.props.palette) && t === "transparent" || t === Ke) {
932
- var a = (0, O.expandShortHandHex)(t);
933
- this.setState({
934
- displayValue: a
935
- });
936
- var o = t !== (this.props.value && g()(this.props.value));
937
- var l = this.props.name;
938
- var i = t === Ke ? null : t;
939
- var s = (0, O.expandShortHandHex)(i);
940
- if (t && !this.isControlled()) {
941
- this.setState({
942
- value: s
943
- });
1081
+ return this.state.value;
1082
+ }
1083
+ }, {
1084
+ key: "submitValue",
1085
+ value: function e(t) {
1086
+ if (t) {
1087
+ var r = Le(t);
1088
+ if (!r && t !== "transparent" && t !== Ue) {
1089
+ // eslint-disable-next-line no-console
1090
+ console.warn('"'.concat(t, '" is not a valid hex color.'));
944
1091
  }
945
- if (o) {
946
- var u, c;
947
- (u = (c = this.props).onChange) === null || u === void 0 ? void 0 : u.call(c, {
948
- value: s,
949
- name: l
1092
+ if (r || n.hasTransparent(this.props.palette) && t === "transparent" || t === Ue) {
1093
+ var a = (0, P.expandShortHandHex)(t);
1094
+ this.setState({
1095
+ displayValue: a
950
1096
  });
1097
+ var o = t !== (this.props.value && g()(this.props.value));
1098
+ var l = this.props.name;
1099
+ var i = t === Ue ? null : t;
1100
+ var s = (0, P.expandShortHandHex)(i);
1101
+ if (t && !this.isControlled()) {
1102
+ this.setState({
1103
+ value: s
1104
+ });
1105
+ }
1106
+ if (o) {
1107
+ var c, u;
1108
+ (c = (u = this.props).onChange) === null || c === void 0 ? void 0 : c.call(u, {
1109
+ value: s,
1110
+ name: l
1111
+ });
1112
+ }
951
1113
  }
952
1114
  }
953
1115
  }
954
- }
955
- /**
1116
+ /**
956
1117
  * Place focus on the input.
957
- */ }, {
958
- key: "focus",
959
- value: function e() {
960
- var t;
961
- (t = this.dropdown) === null || t === void 0 ? void 0 : t.focus();
962
- }
963
- }, {
964
- key: "isControlled",
965
- value: function e() {
966
- return this.controlledExternally;
967
- }
968
- }, {
969
- key: "renderInput",
970
- value: function e(t) {
971
- var a = t.textAppend, o = t.textPrepend, l = t.textInline, i = t.inDropdown;
972
- var s = this.props, u = s.splunkTheme, c = s.required;
973
- var p = this.state.displayValue;
974
- var d = u.isPrisma;
975
- var f = r.hasTransparent(this.props.palette) && g()(p) === "transparent";
976
- var v = g()(p) === Fe;
977
- var h = p;
978
- if (!y()(p, "#")) {
979
- h = "#".concat(p);
1118
+ */ }, {
1119
+ key: "focus",
1120
+ value: function e() {
1121
+ var t;
1122
+ (t = this.dropdown) === null || t === void 0 ? void 0 : t.focus();
980
1123
  }
981
- h = f ? "transparent" : h;
982
- h = v ? null : h;
983
-
984
- return n().createElement(Y, {
985
- $inDropdown: i
986
- }, n().createElement(Z, {
987
- $inDropdown: i,
988
- append: a,
989
- autoCapitalize: "off",
990
- autoComplete: "off",
991
- autoCorrect: "off",
992
- "aria-label": (0, _._)("Hexadecimal color value"),
993
- inline: l,
994
- prepend: o,
995
- onKeyDown: this.handleTextKeyDown,
996
- onChange: this.handleTextChange,
997
- required: c,
998
- spellCheck: false,
999
- value: p
1000
- }), !d && i && n().createElement(Q, {
1001
- "data-test": "textbox-swatch",
1002
- onClick: this.handleButtonClick,
1003
- value: h,
1004
- style: {
1005
- marginLeft: "1px"
1006
- }
1007
- }));
1008
- }
1009
- }, {
1010
- key: "renderPalette",
1011
- value: function e() {
1012
- var t = this;
1013
- var r = this.props, a = r.splunkTheme, o = r.palette;
1014
- var l = this.state.expanded;
1015
- var i = a.isPrisma;
1016
-
1017
- return n().createElement(ve, {
1018
- palette: o,
1019
- value: this.getValue(),
1020
- swatchToFocusRef: this.focusSwatch,
1021
- renderInput: function e() {
1022
- return i ? t.renderInput({
1023
- textAppend: false,
1024
- textPrepend: false,
1025
- textInline: true,
1026
- inDropdown: true
1027
- }) : t.renderInput({
1028
- textAppend: true,
1029
- textPrepend: true,
1030
- textInline: true,
1031
- inDropdown: true
1032
- });
1033
- },
1034
- expandButtonRef: this.focusExpandButton,
1035
- onSwatchClick: this.handleSwatchClick,
1036
- expanded: l,
1037
- onPaletteExpand: this.handlePaletteExpand,
1038
- onSystemColorPickerChange: function e(r) {
1039
- return t.handleSystemColorPickerChange(r.target.value);
1124
+ }, {
1125
+ key: "isControlled",
1126
+ value: function e() {
1127
+ return this.controlledExternally;
1128
+ }
1129
+ }, {
1130
+ key: "renderInput",
1131
+ value: function e(r) {
1132
+ var a = r.textAppend, o = r.textPrepend, l = r.textInline, i = r.inDropdown;
1133
+ var s = this.props, c = s.splunkTheme, u = s.required, p = s.labelledBy;
1134
+ var d = this.state.displayValue;
1135
+ var f = c.isPrisma;
1136
+ var v = n.hasTransparent(this.props.palette) && g()(d) === "transparent";
1137
+ var h = g()(d) === We;
1138
+ var y = d;
1139
+ if (!m()(d, "#")) {
1140
+ y = "#".concat(d);
1040
1141
  }
1041
- });
1042
- }
1043
- }, {
1044
- key: "render",
1045
- value: function e() {
1046
- var t = this;
1047
- var a = this.props, o = a.append, l = a.disabled, i = a.describedBy, s = a.elementRef, u = a.error, c = a.hideInput, d = a.labelledBy, v = a.name, h = a.prepend, m = a.splunkTheme, y = ke(a, [ "append", "disabled", "describedBy", "elementRef", "error", "hideInput", "labelledBy", "name", "prepend", "splunkTheme" ]);
1048
- var b = m.isPrisma;
1049
- var g = this.getValue();
1050
- var x = this.state.displayValue;
1142
+ y = v ? "transparent" : y;
1143
+ y = h ? null : y;
1144
+
1145
+ return t().createElement(Z, {
1146
+ $inDropdown: i
1147
+ }, t().createElement(be["default"], {
1148
+ id: this.hexInputReaderContentId
1149
+ }, (0, I._)("Hexadecimal color value")), t().createElement(ee, {
1150
+ $inDropdown: i,
1151
+ append: a,
1152
+ autoCapitalize: "off",
1153
+ autoComplete: "off",
1154
+ autoCorrect: "off",
1155
+ inline: l,
1156
+ prepend: o,
1157
+ onKeyDown: this.handleTextKeyDown,
1158
+ onChange: this.handleTextChange,
1159
+ required: u,
1160
+ spellCheck: false,
1161
+ value: d,
1162
+ labelledBy: p ? "".concat(p, " ").concat(this.hexInputReaderContentId) : this.hexInputReaderContentId
1163
+ }), !f && i && t().createElement(Y, {
1164
+ "data-test": "textbox-swatch",
1165
+ onClick: this.handleButtonClick,
1166
+ value: y,
1167
+ style: {
1168
+ marginLeft: "1px"
1169
+ }
1170
+ }));
1171
+ }
1172
+ }, {
1173
+ key: "renderPalette",
1174
+ value: function e() {
1175
+ var r = this;
1176
+ var n = this.props, a = n.splunkTheme, o = n.palette;
1177
+ var l = this.state.expanded;
1178
+ var i = a.isPrisma;
1179
+
1180
+ return t().createElement(me, {
1181
+ role: "dialog",
1182
+ "aria-label": (0, I._)("Choose color"),
1183
+ palette: o,
1184
+ value: this.getValue(),
1185
+ swatchToFocusRef: this.focusSwatch,
1186
+ renderInput: function e() {
1187
+ return i ? r.renderInput({
1188
+ textAppend: false,
1189
+ textPrepend: false,
1190
+ textInline: true,
1191
+ inDropdown: true
1192
+ }) : r.renderInput({
1193
+ textAppend: true,
1194
+ textPrepend: true,
1195
+ textInline: true,
1196
+ inDropdown: true
1197
+ });
1198
+ },
1199
+ expandButtonRef: this.focusExpandButton,
1200
+ onSwatchClick: this.handleSwatchClick,
1201
+ expanded: l,
1202
+ onPaletteExpand: this.handlePaletteExpand,
1203
+ onSystemColorPickerChange: function e(t) {
1204
+ return r.handleSystemColorPickerChange(t.target.value);
1205
+ }
1206
+ });
1207
+ }
1208
+ }, {
1209
+ key: "render",
1210
+ value: function e() {
1211
+ var r = this;
1212
+ var a = this.props, o = a.append, l = a.disabled, i = a.describedBy, s = a.elementRef, c = a.error, u = a.hideInput, d = a.labelledBy, v = a.name, h = a.prepend, y = a.splunkTheme, m = Pe(a, [ "append", "disabled", "describedBy", "elementRef", "error", "hideInput", "labelledBy", "name", "prepend", "splunkTheme" ]);
1213
+ var b = y.isPrisma;
1214
+ var g = this.getValue();
1215
+ var x = this.state.displayValue;
1051
1216
  // hideInput defaults to true in Enterprise if prop is not provided
1052
- var S = c !== null && c !== void 0 ? c : true;
1053
- var w = b ? c : S;
1054
- var k = n().createElement(ee, me({
1055
- append: !w ? true : o,
1056
- "data-test": "color",
1057
- "data-test-value": x,
1058
- "aria-describedby": i,
1059
- "aria-labelledby": d,
1060
- "aria-invalid": u || undefined,
1061
- disabled: l,
1062
- error: u,
1063
- elementRef: s,
1064
- name: v,
1065
- prepend: h,
1066
- value: g
1067
- }, f()(y, [].concat(ye(p()(r.propTypes)), [ // TS: trick omit
1068
- "onChange" ]))));
1069
-
1070
- return n().createElement(J, null, n().createElement(E(), {
1071
- closeReasons: [ "clickAway", "escapeKey", "offScreen", "toggleClick" ],
1072
- onRequestClose: this.handleRequestClose,
1073
- onRequestOpen: this.handleRequestOpen,
1074
- open: this.state.open,
1075
- ref: function e(r) {
1076
- t.dropdown = r;
1077
- },
1078
- retainFocus: true,
1079
- takeFocus: false,
1080
- toggle: k
1081
- }, this.renderPalette()), !w && this.renderInput({
1082
- textAppend: false,
1083
- textPrepend: true,
1084
- textInline: true,
1085
- inDropdown: false
1086
- }));
1087
- }
1088
- } ]);
1089
- return r;
1090
- }(r.Component);
1091
- Ve(Me, "propTypes", $e);
1092
- Ve(Me, "defaultProps", He);
1093
- var Le = (0, P.withSplunkTheme)(Me);
1094
- Le.propTypes = Me.propTypes;
1095
- // TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
1096
- /* harmony default export */ const Ue = Le;
1097
- // CONCATENATED MODULE: ./src/Color/index.ts
1098
- module.exports = t;
1217
+ var w = u !== null && u !== void 0 ? u : true;
1218
+ var S = b ? u : w;
1219
+ var k = t().createElement(te, xe({
1220
+ append: !S ? true : o,
1221
+ "data-test": "color",
1222
+ "data-test-value": x,
1223
+ "aria-describedby": i,
1224
+ "aria-labelledby": d ? "".concat(d, " ").concat(this.swatchToggleReaderContentId) : this.swatchToggleReaderContentId,
1225
+ "aria-invalid": c || undefined,
1226
+ disabled: l,
1227
+ error: c,
1228
+ elementRef: s,
1229
+ name: v,
1230
+ prepend: h,
1231
+ value: g
1232
+ }, f()(m, [].concat(we(p()(n.propTypes)), [ // TS: trick omit
1233
+ "onChange" ]))));
1234
+
1235
+ return t().createElement(Q, null, t().createElement(be["default"], {
1236
+ id: this.swatchToggleReaderContentId
1237
+ }, (0, I._)("Color picker")), t().createElement(O(), {
1238
+ closeReasons: [ "clickAway", "escapeKey", "offScreen", "toggleClick" ],
1239
+ onRequestClose: this.handleRequestClose,
1240
+ onRequestOpen: this.handleRequestOpen,
1241
+ open: this.state.open,
1242
+ ref: function e(t) {
1243
+ r.dropdown = t;
1244
+ },
1245
+ retainFocus: true,
1246
+ takeFocus: false,
1247
+ toggle: k
1248
+ }, this.renderPalette()), !S && this.renderInput({
1249
+ textAppend: false,
1250
+ textPrepend: true,
1251
+ textInline: true,
1252
+ inDropdown: false
1253
+ }));
1254
+ }
1255
+ } ]);
1256
+ return n;
1257
+ }(e.Component);
1258
+ $e(Xe, "propTypes", Fe);
1259
+ $e(Xe, "defaultProps", Me);
1260
+ var Ge = (0, E.withSplunkTheme)(Xe);
1261
+ Ge.propTypes = Xe.propTypes;
1262
+ // TODO: SUI-2551 Deprecate this in favor of ui-utils implementation
1263
+ /* harmony default export */ const Je = Ge;
1264
+ }) // CONCATENATED MODULE: ./src/Color/index.ts
1265
+ ();
1266
+ module.exports = n;
1099
1267
  /******/})();