@splunk/react-ui 5.8.0 → 5.9.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.
Files changed (69) hide show
  1. package/Anchor.js +2 -1
  2. package/ButtonSimple.js +1 -1
  3. package/CHANGELOG.md +38 -0
  4. package/Calendar.js +134 -134
  5. package/Clickable.js +131 -94
  6. package/Code.js +177 -170
  7. package/CollapsiblePanel.js +173 -135
  8. package/ColumnLayout.js +69 -45
  9. package/ComboBox.js +1 -0
  10. package/Dropdown.js +87 -72
  11. package/File.js +35 -35
  12. package/LICENSE +1 -1
  13. package/MIGRATION.md +40 -0
  14. package/Markdown.js +331 -306
  15. package/Menu.js +259 -215
  16. package/Modal.js +174 -181
  17. package/Monogram.js +2 -2
  18. package/Multiselect.js +414 -334
  19. package/Number.js +237 -242
  20. package/Search.js +15 -14
  21. package/SelectBase.js +777 -719
  22. package/SimpleTable.d.ts +2 -0
  23. package/SimpleTable.js +433 -0
  24. package/SlidingPanels.js +224 -153
  25. package/SpotLight.d.ts +2 -0
  26. package/SpotLight.js +687 -0
  27. package/Table.js +1232 -1238
  28. package/Text.js +26 -26
  29. package/docker-compose.yml +12 -18
  30. package/docs-llm/Avatar.md +2 -8
  31. package/docs-llm/Collapsible Panel.md +11 -57
  32. package/docs-llm/Column Layout.md +2 -2
  33. package/docs-llm/Divider.md +33 -0
  34. package/docs-llm/Message Bar.md +4 -1
  35. package/docs-llm/Multiselect.md +185 -162
  36. package/docs-llm/Notifications.md +46 -0
  37. package/docs-llm/Table.md +7 -7
  38. package/docs-llm/Tree.md +7 -2
  39. package/docs-llm/Typography.md +1 -1
  40. package/docs-llm/llms.txt +7 -3
  41. package/package.json +9 -11
  42. package/test-runner-jest.config.js +4 -53
  43. package/types/src/CollapsiblePanel/docs/examples/Actions.d.ts +1 -1
  44. package/types/src/ColumnLayout/ColumnLayout.d.ts +2 -2
  45. package/types/src/Divider/docs/examples/VerticalWithAlignItems.d.ts +8 -0
  46. package/types/src/Markdown/Markdown.d.ts +14 -2
  47. package/types/src/Markdown/renderers/MarkdownTable.d.ts +2 -22
  48. package/types/src/Markdown/renderers/MarkdownWrapper.d.ts +11 -0
  49. package/types/src/Markdown/renderers/index.d.ts +3 -1
  50. package/types/src/Multiselect/Compact.d.ts +12 -3
  51. package/types/src/Multiselect/Multiselect.d.ts +12 -3
  52. package/types/src/Multiselect/Normal.d.ts +8 -3
  53. package/types/src/Multiselect/Option.d.ts +6 -3
  54. package/types/src/Multiselect/docs/examples/Disabled.d.ts +1 -0
  55. package/types/src/Multiselect/docs/examples/LoadMoreWithSelectAll.d.ts +9 -0
  56. package/types/src/SelectBase/SelectBase.d.ts +5 -1
  57. package/types/src/SimpleTable/Body.d.ts +25 -0
  58. package/types/src/SimpleTable/Cell.d.ts +20 -0
  59. package/types/src/SimpleTable/Head.d.ts +20 -0
  60. package/types/src/SimpleTable/HeadCell.d.ts +20 -0
  61. package/types/src/SimpleTable/Row.d.ts +20 -0
  62. package/types/src/SimpleTable/SimpleTable.d.ts +37 -0
  63. package/types/src/SimpleTable/index.d.ts +3 -0
  64. package/types/src/SpotLight/SpotLight.d.ts +88 -0
  65. package/types/src/SpotLight/index.d.ts +2 -0
  66. package/types/src/Table/Row.d.ts +1 -1
  67. package/types/src/Table/Table.d.ts +1 -1
  68. package/types/src/Typography/Typography.d.ts +1 -1
  69. package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +0 -7
package/SpotLight.js ADDED
@@ -0,0 +1,687 @@
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var t = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ t.n = e => {
12
+ /******/ var r = e && e.__esModule ?
13
+ /******/ () => e["default"]
14
+ /******/ : () => e
15
+ /******/;
16
+ t.d(r, {
17
+ a: r
18
+ });
19
+ /******/ return r;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ t.d = (e, r) => {
27
+ /******/ for (var n in r) {
28
+ /******/ if (t.o(r, n) && !t.o(e, n)) {
29
+ /******/ Object.defineProperty(e, n, {
30
+ enumerable: true,
31
+ get: r[n]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ t.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ t.r = t => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(t, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(t, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var e = {};
60
+ // ESM COMPAT FLAG
61
+ t.r(e);
62
+ // EXPORTS
63
+ t.d(e, {
64
+ SpotLight: () => /* reexport */ tt,
65
+ default: () => /* reexport */ et
66
+ });
67
+ // CONCATENATED MODULE: external "react"
68
+ const r = require("react");
69
+ var n = t.n(r);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const o = require("prop-types");
72
+ var i = t.n(o);
73
+ // CONCATENATED MODULE: external "styled-components"
74
+ const u = require("styled-components");
75
+ var a = t.n(u);
76
+ // CONCATENATED MODULE: external "@splunk/themes"
77
+ const c = require("@splunk/themes");
78
+ // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
79
+ /* eslint-disable @typescript-eslint/no-empty-function */
80
+ var l = {
81
+ body: {
82
+ appendChild: function t() {
83
+ return [];
84
+ }
85
+ },
86
+ addEventListener: function t() {},
87
+ removeEventListener: function t() {},
88
+ activeElement: {
89
+ blur: function t() {},
90
+ nodeName: ""
91
+ },
92
+ querySelector: function t() {
93
+ return null;
94
+ },
95
+ querySelectorAll: function t() {
96
+ return [];
97
+ },
98
+ getElementById: function t() {
99
+ return null;
100
+ },
101
+ createEvent: function t() {
102
+ return {
103
+ initEvent: function t() {}
104
+ };
105
+ },
106
+ createElement: function t() {
107
+ return {
108
+ children: [],
109
+ childNodes: [],
110
+ style: {},
111
+ setAttribute: function t() {},
112
+ getElementsByTagName: function t() {
113
+ return [];
114
+ }
115
+ };
116
+ },
117
+ createElementNS: function t() {
118
+ return {};
119
+ },
120
+ importNode: function t() {
121
+ return null;
122
+ },
123
+ location: {
124
+ hash: "",
125
+ host: "",
126
+ hostname: "",
127
+ href: "",
128
+ origin: "",
129
+ pathname: "",
130
+ protocol: "",
131
+ search: ""
132
+ }
133
+ };
134
+ function f() {
135
+ var t = typeof document !== "undefined" ? document : l;
136
+ return t;
137
+ }
138
+ var s = f();
139
+ /* harmony default export */ const v = /* unused pure expression or super */ null && s;
140
+ // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
141
+ /* eslint-disable @typescript-eslint/no-empty-function */
142
+ var d = {
143
+ document: l,
144
+ navigator: {
145
+ userAgent: ""
146
+ },
147
+ location: {
148
+ hash: "",
149
+ host: "",
150
+ hostname: "",
151
+ href: "",
152
+ origin: "",
153
+ pathname: "",
154
+ protocol: "",
155
+ search: ""
156
+ },
157
+ history: {
158
+ replaceState: function t() {},
159
+ pushState: function t() {},
160
+ go: function t() {},
161
+ back: function t() {}
162
+ },
163
+ CustomEvent: function t() {
164
+ return this;
165
+ },
166
+ addEventListener: function t() {},
167
+ removeEventListener: function t() {},
168
+ getComputedStyle: function t() {
169
+ return {
170
+ getPropertyValue: function t() {
171
+ return "";
172
+ }
173
+ };
174
+ },
175
+ Image: function t() {},
176
+ Date: function t() {},
177
+ screen: {},
178
+ setTimeout: function t() {},
179
+ clearTimeout: function t() {},
180
+ matchMedia: function t() {
181
+ return {};
182
+ },
183
+ requestAnimationFrame: function t(e) {
184
+ if (typeof setTimeout === "undefined") {
185
+ e();
186
+ return null;
187
+ }
188
+ return setTimeout(e, 0);
189
+ },
190
+ cancelAnimationFrame: function t(e) {
191
+ if (typeof setTimeout === "undefined") {
192
+ return;
193
+ }
194
+ clearTimeout(e);
195
+ }
196
+ };
197
+ function h() {
198
+ var t = typeof window !== "undefined" ? window : d;
199
+ return t;
200
+ }
201
+ var p = h();
202
+ /* harmony default export */ const y = /* unused pure expression or super */ null && p;
203
+ // CONCATENATED MODULE: ./src/utils/getBoundingClientRect.ts
204
+ function m(t) {
205
+ "@babel/helpers - typeof";
206
+ return m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
207
+ return typeof t;
208
+ } : function(t) {
209
+ return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
210
+ }, m(t);
211
+ }
212
+ function b(t, e) {
213
+ var r = Object.keys(t);
214
+ if (Object.getOwnPropertySymbols) {
215
+ var n = Object.getOwnPropertySymbols(t);
216
+ e && (n = n.filter((function(e) {
217
+ return Object.getOwnPropertyDescriptor(t, e).enumerable;
218
+ }))), r.push.apply(r, n);
219
+ }
220
+ return r;
221
+ }
222
+ function g(t) {
223
+ for (var e = 1; e < arguments.length; e++) {
224
+ var r = null != arguments[e] ? arguments[e] : {};
225
+ e % 2 ? b(Object(r), !0).forEach((function(e) {
226
+ w(t, e, r[e]);
227
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : b(Object(r)).forEach((function(e) {
228
+ Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
229
+ }));
230
+ }
231
+ return t;
232
+ }
233
+ function w(t, e, r) {
234
+ return (e = O(e)) in t ? Object.defineProperty(t, e, {
235
+ value: r,
236
+ enumerable: !0,
237
+ configurable: !0,
238
+ writable: !0
239
+ }) : t[e] = r, t;
240
+ }
241
+ function O(t) {
242
+ var e = j(t, "string");
243
+ return "symbol" == m(e) ? e : e + "";
244
+ }
245
+ function j(t, e) {
246
+ if ("object" != m(t) || !t) return t;
247
+ var r = t[Symbol.toPrimitive];
248
+ if (void 0 !== r) {
249
+ var n = r.call(t, e || "default");
250
+ if ("object" != m(n)) return n;
251
+ throw new TypeError("@@toPrimitive must return a primitive value.");
252
+ }
253
+ return ("string" === e ? String : Number)(t);
254
+ }
255
+ // Checks if browser is Safari
256
+ function S() {
257
+ return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
258
+ }
259
+ // Formats return value to DOMRect
260
+ function x(t) {
261
+ return g(g({}, t), {}, {
262
+ top: t.y,
263
+ left: t.x,
264
+ right: t.x + t.width,
265
+ bottom: t.y + t.height
266
+ });
267
+ }
268
+ /**
269
+ * Provides DOMRect information about the size of an element and its position relative to the viewport.
270
+ * Accounts for Safari's use of visual viewport and adds offsets to set as layout viewport.
271
+ * @param {Element} element - The element to be evaluated
272
+ * @param {boolean} offsets - Use when position of element relative to the layout viewport offsets are needed for Safari.
273
+ * @returns {Omit<DOMRect, 'toJSON'>}
274
+ * @public
275
+ */ function P(t, e) {
276
+ var r, n;
277
+ var o = t.getBoundingClientRect();
278
+ var i = S();
279
+ if (!e || !i) {
280
+ return o;
281
+ }
282
+ var u = h();
283
+ var a = o.left + (((r = u.visualViewport) === null || r === void 0 ? void 0 : r.offsetLeft) || 0);
284
+ var c = o.top + (((n = u.visualViewport) === null || n === void 0 ? void 0 : n.offsetTop) || 0);
285
+ var l = o.width, f = o.height;
286
+ return x({
287
+ width: l,
288
+ height: f,
289
+ x: a,
290
+ y: c
291
+ });
292
+ }
293
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
294
+ /**
295
+ * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
296
+ *
297
+ * @param ref - The React callback or object ref. Can be `null` or `undefined`.
298
+ * @param current - The new value of the ref.
299
+ */
300
+ function E(t, e) {
301
+ if (t) {
302
+ if (typeof t === "function") {
303
+ t(e);
304
+ } else {
305
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
306
+ // the intention here is to signal "we will take care of setting 'current', not you".
307
+ t.current = e;
308
+ // eslint-disable-line no-param-reassign
309
+ }
310
+ }
311
+ }
312
+ // CONCATENATED MODULE: ./src/SpotLight/SpotLight.tsx
313
+ function q(t) {
314
+ "@babel/helpers - typeof";
315
+ return q = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
316
+ return typeof t;
317
+ } : function(t) {
318
+ return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
319
+ }, q(t);
320
+ }
321
+ function T() {
322
+ return T = Object.assign ? Object.assign.bind() : function(t) {
323
+ for (var e = 1; e < arguments.length; e++) {
324
+ var r = arguments[e];
325
+ for (var n in r) {
326
+ ({}).hasOwnProperty.call(r, n) && (t[n] = r[n]);
327
+ }
328
+ }
329
+ return t;
330
+ }, T.apply(null, arguments);
331
+ }
332
+ function R(t, e) {
333
+ var r = Object.keys(t);
334
+ if (Object.getOwnPropertySymbols) {
335
+ var n = Object.getOwnPropertySymbols(t);
336
+ e && (n = n.filter((function(e) {
337
+ return Object.getOwnPropertyDescriptor(t, e).enumerable;
338
+ }))), r.push.apply(r, n);
339
+ }
340
+ return r;
341
+ }
342
+ function A(t) {
343
+ for (var e = 1; e < arguments.length; e++) {
344
+ var r = null != arguments[e] ? arguments[e] : {};
345
+ e % 2 ? R(Object(r), !0).forEach((function(e) {
346
+ L(t, e, r[e]);
347
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : R(Object(r)).forEach((function(e) {
348
+ Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
349
+ }));
350
+ }
351
+ return t;
352
+ }
353
+ function L(t, e, r) {
354
+ return (e = N(e)) in t ? Object.defineProperty(t, e, {
355
+ value: r,
356
+ enumerable: !0,
357
+ configurable: !0,
358
+ writable: !0
359
+ }) : t[e] = r, t;
360
+ }
361
+ function N(t) {
362
+ var e = k(t, "string");
363
+ return "symbol" == q(e) ? e : e + "";
364
+ }
365
+ function k(t, e) {
366
+ if ("object" != q(t) || !t) return t;
367
+ var r = t[Symbol.toPrimitive];
368
+ if (void 0 !== r) {
369
+ var n = r.call(t, e || "default");
370
+ if ("object" != q(n)) return n;
371
+ throw new TypeError("@@toPrimitive must return a primitive value.");
372
+ }
373
+ return ("string" === e ? String : Number)(t);
374
+ }
375
+ function D(t, e) {
376
+ return z(t) || $(t, e) || I(t, e) || C();
377
+ }
378
+ function C() {
379
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
380
+ }
381
+ function I(t, e) {
382
+ if (t) {
383
+ if ("string" == typeof t) return M(t, e);
384
+ var r = {}.toString.call(t).slice(8, -1);
385
+ return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? M(t, e) : void 0;
386
+ }
387
+ }
388
+ function M(t, e) {
389
+ (null == e || e > t.length) && (e = t.length);
390
+ for (var r = 0, n = Array(e); r < e; r++) {
391
+ n[r] = t[r];
392
+ }
393
+ return n;
394
+ }
395
+ function $(t, e) {
396
+ var r = null == t ? null : "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
397
+ if (null != r) {
398
+ var n, o, i, u, a = [], c = !0, l = !1;
399
+ try {
400
+ if (i = (r = r.call(t)).next, 0 === e) {
401
+ if (Object(r) !== r) return;
402
+ c = !1;
403
+ } else for (;!(c = (n = i.call(r)).done) && (a.push(n.value), a.length !== e); c = !0) {
404
+ }
405
+ } catch (t) {
406
+ l = !0, o = t;
407
+ } finally {
408
+ try {
409
+ if (!c && null != r["return"] && (u = r["return"](), Object(u) !== u)) return;
410
+ } finally {
411
+ if (l) throw o;
412
+ }
413
+ }
414
+ return a;
415
+ }
416
+ }
417
+ function z(t) {
418
+ if (Array.isArray(t)) return t;
419
+ }
420
+ function _(t, e) {
421
+ if (null == t) return {};
422
+ var r, n, o = F(t, e);
423
+ if (Object.getOwnPropertySymbols) {
424
+ var i = Object.getOwnPropertySymbols(t);
425
+ for (n = 0; n < i.length; n++) {
426
+ r = i[n], -1 === e.indexOf(r) && {}.propertyIsEnumerable.call(t, r) && (o[r] = t[r]);
427
+ }
428
+ }
429
+ return o;
430
+ }
431
+ function F(t, e) {
432
+ if (null == t) return {};
433
+ var r = {};
434
+ for (var n in t) {
435
+ if ({}.hasOwnProperty.call(t, n)) {
436
+ if (-1 !== e.indexOf(n)) continue;
437
+ r[n] = t[n];
438
+ }
439
+ }
440
+ return r;
441
+ }
442
+ var B = {
443
+ blur: i().string,
444
+ elementRef: i().oneOfType([ i().func, i().object ]),
445
+ layers: i().arrayOf(i().exact({
446
+ anchor: i().exact({
447
+ edge: i().oneOf([ "top", "right", "bottom", "left" ]).isRequired,
448
+ element: i().any,
449
+ inset: i().string,
450
+ offset: i().string
451
+ }),
452
+ height: i().string.isRequired,
453
+ stops: i().arrayOf(i().exact({
454
+ at: i().string,
455
+ color: i().oneOfType([ i().string, i().func ]).isRequired,
456
+ opacity: i().string
457
+ }).isRequired).isRequired,
458
+ width: i().string.isRequired,
459
+ x: i().string,
460
+ y: i().string
461
+ }).isRequired).isRequired
462
+ };
463
+ var V = "50%";
464
+ var U = /^(-?\d*\.?\d+)%$/;
465
+ var G = /^(\d*\.?\d+)%$/;
466
+ // Builds the final CSS position from a measured pixel coordinate and a relative offset.
467
+ var H = function t(e) {
468
+ var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "0px";
469
+ return "calc(".concat(e, "px + ").concat(r, ")");
470
+ };
471
+ // Keeps generated CSS stable and easier to compare in tests by trimming noisy float precision.
472
+ var J = function t(e) {
473
+ return Math.round(e * 100) / 100;
474
+ };
475
+ var K = function t(e, r) {
476
+ // Percentage offsets are relative to half the anchor dimension so 100% reaches the edge.
477
+ var n = e && e.trim() ? e.trim() : "0px";
478
+ var o = n.match(U);
479
+ if (!o) {
480
+ return n;
481
+ }
482
+ var i = Number(o[1]);
483
+ return "".concat(J(r * i / 200), "px");
484
+ };
485
+ var Q = function t(e, r) {
486
+ // Anchored percentage sizes resolve against the anchor element instead of the host container.
487
+ var n = e.trim();
488
+ var o = n.match(G);
489
+ if (!o) {
490
+ return n;
491
+ }
492
+ var i = Number(o[1]);
493
+ return "".concat(J(r * i / 100), "px");
494
+ };
495
+ // Theme interpolations are allowed in stop colors, so resolve them before serializing the gradient.
496
+ var W = function t(e, r) {
497
+ return typeof e === "function" ? e({
498
+ theme: r
499
+ }) : e;
500
+ };
501
+ // Serializes the stop list into the radial-gradient color-stop segment.
502
+ var X = function t(e) {
503
+ var r = e.stops, n = e.theme;
504
+ return r.map((function(t) {
505
+ var e = t.at, r = e === void 0 ? "0%" : e, o = t.color, i = t.opacity, u = i === void 0 ? "100%" : i;
506
+ var a = W(o, n);
507
+ return "color-mix(in srgb, ".concat(a, " ").concat(u, ", transparent) ").concat(r);
508
+ })).join(", ");
509
+ };
510
+ var Y = function t(e, r, n) {
511
+ var o;
512
+ var i = (o = e.element) !== null && o !== void 0 ? o : n;
513
+ var u = P(n, true);
514
+ var a = P(i, true);
515
+ var c = a.left - u.left;
516
+ var l = a.top - u.top;
517
+ var f = a.right - u.left;
518
+ var s = a.bottom - u.top;
519
+ var v = c + a.width / 2;
520
+ var d = l + a.height / 2;
521
+ var h = e.edge === "top" || e.edge === "bottom" ? K(e.offset, a.width) : K(e.inset, a.width);
522
+ var p = e.edge === "left" || e.edge === "right" ? K(e.offset, a.height) : K(e.inset, a.height);
523
+ var y = Q(r.width, a.width);
524
+ var m = Q(r.height, a.height);
525
+ switch (e.edge) {
526
+ case "top":
527
+ return {
528
+ height: m,
529
+ width: y,
530
+ x: H(J(v), h),
531
+ y: H(J(l), "calc(".concat(p, " * -1)"))
532
+ };
533
+
534
+ case "right":
535
+ return {
536
+ height: m,
537
+ width: y,
538
+ x: H(J(f), h),
539
+ y: H(J(d), p)
540
+ };
541
+
542
+ case "bottom":
543
+ return {
544
+ height: m,
545
+ width: y,
546
+ x: H(J(v), h),
547
+ y: H(J(s), p)
548
+ };
549
+
550
+ case "left":
551
+ return {
552
+ height: m,
553
+ width: y,
554
+ x: H(J(c), "calc(".concat(h, " * -1)")),
555
+ y: H(J(d), p)
556
+ };
557
+
558
+ default:
559
+ return null;
560
+ }
561
+ };
562
+ var Z = a().div.withConfig({
563
+ displayName: "SpotLight__Styled",
564
+ componentId: "sc-1g47fv3-0"
565
+ })([ "", ";position:absolute;inset:0;overflow:visible;pointer-events:none;z-index:0;&::before{content:'';position:absolute;inset:0;z-index:0;border-radius:inherit;pointer-events:none;filter:", ";background-repeat:no-repeat;", "}" ], c.mixins.reset("block"), (function(t) {
566
+ var e = t.$blur;
567
+ return e ? "blur(".concat(e, ")") : "none";
568
+ }), (function(t) {
569
+ var e = t.theme, r = t.$layers;
570
+ if (r.length === 0) {
571
+ return (0, u.css)([ "background-image:none;" ]);
572
+ }
573
+ var n = r.map((function(t) {
574
+ var r = t.height, n = t.stops, o = t.width, i = t.x, u = t.y;
575
+ var a = X({
576
+ stops: n,
577
+ theme: e
578
+ });
579
+ return "radial-gradient(ellipse ".concat(o, " ").concat(r, " at ").concat(i, " ").concat(u, ", ").concat(a, ")");
580
+ })).join(", ");
581
+ return (0, u.css)([ "background-image:", ";" ], n);
582
+ }));
583
+ /**
584
+ * SpotLight renders decorative radial gradients as a positioned sibling layer.
585
+ */ function tt(t) {
586
+ var e = t.blur, r = t.elementRef, o = t.layers, i = _(t, [ "blur", "elementRef", "layers" ]);
587
+ // @docs-props-type SpotLightPropsBase
588
+ var u = n().useRef(null);
589
+ var a = n().useState([]), c = D(a, 2), l = c[0], f = c[1];
590
+ var s = n().useState({
591
+ width: 0,
592
+ height: 0
593
+ }), v = D(s, 2), d = v[0], p = v[1];
594
+ var y = n().useCallback((function(t) {
595
+ E(u, t);
596
+ E(r, t);
597
+ }), [ r ]);
598
+ n().useLayoutEffect((function() {
599
+ if (false) {}
600
+ var t = h();
601
+ var e = 0;
602
+ var r = function t() {
603
+ var e = u.current;
604
+ if (!e) {
605
+ return;
606
+ }
607
+ var r = P(e, true);
608
+ var n = o.map((function(t) {
609
+ return t.anchor ? Y(t.anchor, t, e) : null;
610
+ }));
611
+ p((function(t) {
612
+ return t.width !== r.width || t.height !== r.height ? {
613
+ width: r.width,
614
+ height: r.height
615
+ } : t;
616
+ }));
617
+ f((function(t) {
618
+ var e = t.length !== n.length || t.some((function(t, e) {
619
+ var r = n[e];
620
+ return (t === null || t === void 0 ? void 0 : t.height) !== (r === null || r === void 0 ? void 0 : r.height) || (t === null || t === void 0 ? void 0 : t.width) !== (r === null || r === void 0 ? void 0 : r.width) || (t === null || t === void 0 ? void 0 : t.x) !== (r === null || r === void 0 ? void 0 : r.x) || (t === null || t === void 0 ? void 0 : t.y) !== (r === null || r === void 0 ? void 0 : r.y);
621
+ }));
622
+ return e ? n : t;
623
+ }));
624
+ };
625
+ var n = "ResizeObserver" in t ? new ResizeObserver((function() {
626
+ e = t.requestAnimationFrame(r);
627
+ })) : null;
628
+ var i = new Set;
629
+ n === null || n === void 0 ? void 0 : n.observe(u.current);
630
+ i.add(u.current);
631
+ o.forEach((function(t) {
632
+ var e = t.anchor ? t.anchor.element : null;
633
+ if (e && !i.has(e)) {
634
+ n === null || n === void 0 ? void 0 : n.observe(e);
635
+ i.add(e);
636
+ }
637
+ }));
638
+ t.addEventListener("resize", r);
639
+ t.addEventListener("scroll", r, true);
640
+ r();
641
+ return function() {
642
+ if (e) {
643
+ t.cancelAnimationFrame(e);
644
+ }
645
+ t.removeEventListener("resize", r);
646
+ t.removeEventListener("scroll", r, true);
647
+ n === null || n === void 0 ? void 0 : n.disconnect();
648
+ };
649
+ }), [ o ]);
650
+ var m = n().useMemo((function() {
651
+ return o.reduce((function(t, e, r) {
652
+ var n, o;
653
+ if (e.anchor) {
654
+ var i = l[r];
655
+ if (!i) {
656
+ return t;
657
+ }
658
+ t.push(A(A({}, e), {}, {
659
+ height: i.height,
660
+ width: i.width,
661
+ x: i.x,
662
+ y: i.y
663
+ }));
664
+ return t;
665
+ }
666
+ t.push(A(A({}, e), {}, {
667
+ height: Q(e.height, d.height),
668
+ width: Q(e.width, d.width),
669
+ x: (n = e.x) !== null && n !== void 0 ? n : V,
670
+ y: (o = e.y) !== null && o !== void 0 ? o : V
671
+ }));
672
+ return t;
673
+ }), []);
674
+ }), [ l, d.height, d.width, o ]);
675
+
676
+ return n().createElement(Z, T({
677
+ "data-test": "spot-light",
678
+ ref: y,
679
+ $blur: e,
680
+ $layers: m
681
+ }, i));
682
+ }
683
+ tt.propTypes = B;
684
+ /* harmony default export */ const et = tt;
685
+ // CONCATENATED MODULE: ./src/SpotLight/index.ts
686
+ module.exports = e;
687
+ /******/})();