@epam/statgpt-ui-components 0.5.0 → 0.6.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx as r, jsxs as m, Fragment as q } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as u, Fragment as q } from "react/jsx-runtime";
2
2
  import * as ue from "react";
3
3
  import { useEffect as O, useState as j, useRef as W, useCallback as P, useMemo as U, useId as me, createContext as Q, useContext as K } from "react";
4
4
  import g from "classnames";
@@ -35,33 +35,33 @@ const ze = 3e4, bt = ({
35
35
  errorIcon: s,
36
36
  onClose: l,
37
37
  closeButtonTitle: a,
38
- children: c
38
+ children: i
39
39
  }) => {
40
- const i = e?.type, h = i === _.IN_PROGRESS || i === _.INFO, d = () => h ? "alert-in-progress" : i === _.SUCCESS ? "alert-success" : "alert-error", p = h ? t : i === _.SUCCESS ? n : i === _.ERROR ? s : null, f = e?.text;
40
+ const m = e?.type, h = m === _.IN_PROGRESS || m === _.INFO, c = () => h ? "alert-in-progress" : m === _.SUCCESS ? "alert-success" : "alert-error", f = h ? t : m === _.SUCCESS ? n : m === _.ERROR ? s : null, p = e?.text;
41
41
  return O(() => {
42
42
  if (!e || h)
43
43
  return;
44
- const v = setTimeout(() => {
44
+ const N = setTimeout(() => {
45
45
  l?.();
46
46
  }, ze);
47
- return () => clearTimeout(v);
47
+ return () => clearTimeout(N);
48
48
  }, [e, h, l]), /* @__PURE__ */ r(
49
49
  "div",
50
50
  {
51
51
  className: g(
52
52
  "alert alert-shadow fixed bottom-3 right-3 z-10 w-[min(380px,calc(100vw-24px))] max-w-[calc(100vw-24px)]",
53
- d()
53
+ c()
54
54
  ),
55
- children: /* @__PURE__ */ m("div", { className: "alert-content flex items-start", children: [
56
- p && /* @__PURE__ */ r("div", { className: "alert-icon", children: p }),
57
- /* @__PURE__ */ m("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
55
+ children: /* @__PURE__ */ u("div", { className: "alert-content flex items-start", children: [
56
+ f && /* @__PURE__ */ r("div", { className: "alert-icon", children: f }),
57
+ /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
58
58
  /* @__PURE__ */ r("h3", { className: "alert-title truncate", children: e?.title }),
59
- c ?? (f && /* @__PURE__ */ r(
59
+ i ?? (p && /* @__PURE__ */ r(
60
60
  "div",
61
61
  {
62
62
  className: "alert-text whitespace-pre-line break-words",
63
- title: f,
64
- children: f
63
+ title: p,
64
+ children: p
65
65
  }
66
66
  ))
67
67
  ] }),
@@ -96,17 +96,17 @@ const Ge = ({
96
96
  title: s,
97
97
  disabled: l,
98
98
  iconAfter: a,
99
- iconBefore: c,
100
- onClick: i,
99
+ iconBefore: i,
100
+ onClick: m,
101
101
  isSmallButton: h
102
102
  }) => {
103
- const d = F([
103
+ const c = F([
104
104
  h ? "font-semibold" : "",
105
105
  a ? "mr-2" : "",
106
- c ? "ml-2" : "",
106
+ i ? "ml-2" : "",
107
107
  t
108
108
  ]);
109
- return /* @__PURE__ */ m(
109
+ return /* @__PURE__ */ u(
110
110
  "button",
111
111
  {
112
112
  type: "button",
@@ -117,12 +117,12 @@ const Ge = ({
117
117
  ),
118
118
  disabled: l || n,
119
119
  "aria-label": "button",
120
- onClick: (p) => i?.(p),
120
+ onClick: (f) => m?.(f),
121
121
  title: s,
122
122
  children: [
123
- c,
123
+ i,
124
124
  n && /* @__PURE__ */ r(He, {}),
125
- s ? h ? /* @__PURE__ */ r("h4", { className: d, children: s }) : /* @__PURE__ */ r("h3", { className: d, children: s }) : null,
125
+ s ? h ? /* @__PURE__ */ r("h4", { className: c, children: s }) : /* @__PURE__ */ r("h3", { className: c, children: s }) : null,
126
126
  a
127
127
  ]
128
128
  }
@@ -157,61 +157,61 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
157
157
  options: s,
158
158
  calendarResolution: l = A.DAY,
159
159
  id: a,
160
- icon: c,
161
- isEndDate: i
160
+ icon: i,
161
+ isEndDate: m
162
162
  }) => {
163
- const h = W(null), d = Be();
163
+ const h = W(null), c = Be();
164
164
  O(() => {
165
- const N = h?.current;
166
- N && N.querySelector("input")?.setAttribute("aria-label", e);
165
+ const w = h?.current;
166
+ w && w.querySelector("input")?.setAttribute("aria-label", e);
167
167
  }, [e]);
168
- const p = {
168
+ const f = {
169
169
  ...s,
170
170
  disableMobile: !0,
171
171
  defaultDate: l === A.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n
172
- }, f = (N, C, b) => {
173
- const u = `calendar__${l === A.MONTH ? "month" : "day"}`;
174
- b.calendarContainer && b.calendarContainer.classList.add(u);
175
- }, v = (N, C, b) => {
176
- if (l === A.MONTH && N.length > 0) {
177
- const u = s.minDate, o = s.maxDate, x = N[0].getFullYear(), w = b.calendarContainer, S = "flatpickr-disabled", y = w.querySelectorAll(
172
+ }, p = (w, C, b) => {
173
+ const d = `calendar__${l === A.MONTH ? "month" : "day"}`;
174
+ b.calendarContainer && b.calendarContainer.classList.add(d);
175
+ }, N = (w, C, b) => {
176
+ if (l === A.MONTH && w.length > 0) {
177
+ const d = s.minDate, o = s.maxDate, x = w[0].getFullYear(), v = b.calendarContainer, S = "flatpickr-disabled", y = v.querySelectorAll(
178
178
  ".flatpickr-monthSelect-month"
179
- ), E = w.querySelectorAll(
179
+ ), E = v.querySelectorAll(
180
180
  ".flatpickr-next-month"
181
- )[0], D = w.querySelectorAll(
181
+ )[0], D = v.querySelectorAll(
182
182
  ".flatpickr-prev-month"
183
183
  )[0];
184
- x === o.getFullYear() && E.classList.add(S), x === u.getFullYear() && D.classList.add(S), (x === u.getFullYear() || x === o.getFullYear()) && y.forEach((k) => {
184
+ x === o.getFullYear() && E.classList.add(S), x === d.getFullYear() && D.classList.add(S), (x === d.getFullYear() || x === o.getFullYear()) && y.forEach((k) => {
185
185
  k.classList.remove(S);
186
- const I = new Date(k.getAttribute("aria-label")), R = I.getFullYear() === u.getFullYear() && I.getMonth() === u.getMonth(), z = I.getFullYear() === o.getFullYear() && I.getMonth() === o.getMonth();
187
- R || z || (I < u || I > o) && k.classList.add(S);
186
+ const I = new Date(k.getAttribute("aria-label")), R = I.getFullYear() === d.getFullYear() && I.getMonth() === d.getMonth(), z = I.getFullYear() === o.getFullYear() && I.getMonth() === o.getMonth();
187
+ R || z || (I < d || I > o) && k.classList.add(S);
188
188
  });
189
189
  }
190
190
  setTimeout(() => {
191
- const u = b.calendarContainer, o = b._input?.getBoundingClientRect();
192
- u && (u.style.top = `${o.top - u.offsetHeight - 8}px`, u.style.width = `${u.style.width}px`, i ? (u.style.right = `${window.innerWidth - o.right - (d ? We : 0)}px`, u.style.left = "auto") : u.style.left = `${o.left}px`);
191
+ const d = b.calendarContainer, o = b._input?.getBoundingClientRect();
192
+ d && (d.style.top = `${o.top - d.offsetHeight - 8}px`, d.style.width = `${d.style.width}px`, m ? (d.style.right = `${window.innerWidth - o.right - (c ? We : 0)}px`, d.style.left = "auto") : d.style.left = `${o.left}px`);
193
193
  }, 0);
194
194
  };
195
- return /* @__PURE__ */ m("div", { className: "calendar relative", ref: h, children: [
195
+ return /* @__PURE__ */ u("div", { className: "calendar relative", ref: h, children: [
196
196
  /* @__PURE__ */ r("div", { className: "calendar-title mb-1", children: e }),
197
197
  /* @__PURE__ */ r(
198
198
  "label",
199
199
  {
200
200
  htmlFor: a,
201
201
  className: "absolute right-[11px] top-[29px] cursor-pointer",
202
- children: c || /* @__PURE__ */ r(fe, {})
202
+ children: i || /* @__PURE__ */ r(fe, {})
203
203
  }
204
204
  ),
205
205
  /* @__PURE__ */ r(
206
206
  Ne,
207
207
  {
208
208
  defaultValue: (l === A.MONTH ? new Date(n.getFullYear(), n.getMonth()) : n)?.toDateString(),
209
- options: p,
210
- onChange: (N) => {
211
- t(N[0]);
209
+ options: f,
210
+ onChange: (w) => {
211
+ t(w[0]);
212
212
  },
213
- onOpen: [v],
214
- onReady: [f],
213
+ onOpen: [N],
214
+ onReady: [p],
215
215
  id: a
216
216
  }
217
217
  )
@@ -223,39 +223,42 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
223
223
  checkboxIcon: s,
224
224
  onChange: l,
225
225
  disabled: a = !1,
226
- className: c,
227
- stopPropagation: i = !0
226
+ disabledScope: i = "full",
227
+ className: m,
228
+ stopPropagation: h = !0
228
229
  }) => {
229
- const h = P(
230
- (f) => {
231
- i && f.stopPropagation();
230
+ const c = P(
231
+ (N) => {
232
+ h && N.stopPropagation();
232
233
  },
233
- [i]
234
- ), d = P(
235
- (f) => {
236
- i && f.stopPropagation(), l?.(t, f.target.checked);
234
+ [h]
235
+ ), f = P(
236
+ (N) => {
237
+ h && N.stopPropagation(), l?.(t, N.target.checked);
237
238
  },
238
- [l, t, i]
239
+ [l, t, h]
239
240
  ), p = () => {
240
241
  if (n)
241
242
  return s || /* @__PURE__ */ r(pe, { className: "absolute size-4" });
242
243
  };
243
- return /* @__PURE__ */ m(
244
+ return /* @__PURE__ */ u(
244
245
  "label",
245
246
  {
246
247
  htmlFor: t,
247
- onClick: h,
248
+ onClick: c,
248
249
  className: F(
249
250
  "flex min-w-0 items-center py-1 shrink-0",
250
- a ? "cursor-not-allowed opacity-50" : "cursor-pointer",
251
- c
251
+ a ? "cursor-not-allowed" : "cursor-pointer",
252
+ a && i === "full" && "opacity-50",
253
+ m
252
254
  ),
253
255
  children: [
254
256
  /* @__PURE__ */ r(
255
257
  "span",
256
258
  {
257
259
  className: g(
258
- "checkbox-button relative flex size-[14px] items-center justify-center"
260
+ "checkbox-button relative flex size-[14px] items-center justify-center",
261
+ a && i === "icon" && "opacity-50"
259
262
  ),
260
263
  "aria-hidden": !0,
261
264
  children: p()
@@ -278,7 +281,7 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
278
281
  type: "checkbox",
279
282
  checked: n,
280
283
  disabled: a,
281
- onChange: d,
284
+ onChange: f,
282
285
  className: "hidden"
283
286
  }
284
287
  )
@@ -292,19 +295,19 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
292
295
  value: s
293
296
  }) => {
294
297
  const [l, a] = j(!1);
295
- return /* @__PURE__ */ m(
298
+ return /* @__PURE__ */ u(
296
299
  "div",
297
300
  {
298
301
  className: `collapsible-block flex flex-col border-t-2 border-neutrals-600 ${l ? "collapsible-block-open" : ""}`,
299
302
  children: [
300
- /* @__PURE__ */ m(
303
+ /* @__PURE__ */ u(
301
304
  "div",
302
305
  {
303
306
  className: "collapsible-block-title flex cursor-pointer items-center py-4",
304
307
  onClick: () => a(!l),
305
308
  children: [
306
309
  /* @__PURE__ */ r("div", { className: `${l ? "rotate-180" : ""} transition-transform`, children: t || /* @__PURE__ */ r(ge, { className: "mr-3 size-5" }) }),
307
- /* @__PURE__ */ m("div", { className: "flex flex-1 items-center justify-between", children: [
310
+ /* @__PURE__ */ u("div", { className: "flex flex-1 items-center justify-between", children: [
308
311
  /* @__PURE__ */ r("span", { children: e }),
309
312
  s && /* @__PURE__ */ r("p", { className: "body-1 text-neutrals-800", children: s })
310
313
  ] })
@@ -321,23 +324,23 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
321
324
  if (!t)
322
325
  return [{ id: 0, text: e, highlight: !1 }];
323
326
  const l = t?.toLowerCase() || "", a = e?.toLowerCase()?.split(l) || "";
324
- for (let c = 0, i = 0; c < a?.length; c++) {
325
- const h = a?.[c], d = h.length;
327
+ for (let i = 0, m = 0; i < a?.length; i++) {
328
+ const h = a?.[i], c = h.length;
326
329
  h !== "" && s.push({
327
330
  id: s.length,
328
331
  highlight: !1,
329
332
  text: e?.substring(
330
- i,
331
- i + d
333
+ m,
334
+ m + c
332
335
  )
333
- }), i += d, c !== a?.length - 1 && (s.push({
336
+ }), m += c, i !== a?.length - 1 && (s.push({
334
337
  id: s.length,
335
338
  highlight: !0,
336
339
  text: e?.substring(
337
- i,
338
- i + t.length
340
+ m,
341
+ m + t.length
339
342
  )
340
- }), i += t.length);
343
+ }), m += t.length);
341
344
  }
342
345
  return s;
343
346
  }, [t, e]);
@@ -364,7 +367,7 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
364
367
  a && "base-icon-button",
365
368
  n
366
369
  ),
367
- onClick: (c) => t?.(c),
370
+ onClick: (i) => t?.(i),
368
371
  disabled: s,
369
372
  title: l,
370
373
  "aria-label": "button",
@@ -377,16 +380,16 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
377
380
  cssClass: s = "",
378
381
  type: l = "text",
379
382
  disabled: a,
380
- readonly: c,
381
- onChange: i,
383
+ readonly: i,
384
+ onChange: m,
382
385
  onKeyDown: h,
383
- onFocus: d,
384
- onBlur: p
386
+ onFocus: c,
387
+ onBlur: f
385
388
  }) => {
386
- const f = g(
389
+ const p = g(
387
390
  "truncate outline-none shadow-none body-1",
388
391
  s,
389
- c ? "pointer-events-none" : ""
392
+ i ? "pointer-events-none" : ""
390
393
  );
391
394
  return /* @__PURE__ */ r(
392
395
  "input",
@@ -398,11 +401,11 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
398
401
  value: e || "",
399
402
  title: e ? String(e) : "",
400
403
  disabled: a,
401
- className: f,
404
+ className: p,
402
405
  onKeyDown: h,
403
- onFocus: d,
404
- onBlur: p,
405
- onChange: (v) => i?.(v.currentTarget.value)
406
+ onFocus: c,
407
+ onBlur: f,
408
+ onChange: (N) => m?.(N.currentTarget.value)
406
409
  }
407
410
  );
408
411
  }, St = ({
@@ -411,7 +414,7 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
411
414
  containerClasses: n,
412
415
  cssClass: s,
413
416
  ...l
414
- }) => /* @__PURE__ */ m("div", { className: g("input w-full flex flex-row", n), children: [
417
+ }) => /* @__PURE__ */ u("div", { className: g("input w-full flex flex-row", n), children: [
415
418
  e,
416
419
  /* @__PURE__ */ r(
417
420
  Ue,
@@ -435,7 +438,7 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
435
438
  l ? "mr-2" : "",
436
439
  s ? "ml-2" : ""
437
440
  );
438
- return /* @__PURE__ */ m(
441
+ return /* @__PURE__ */ u(
439
442
  "a",
440
443
  {
441
444
  href: e,
@@ -471,19 +474,19 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
471
474
  description: l,
472
475
  onChange: a
473
476
  }) => {
474
- const c = P(
475
- (i) => {
476
- i.stopPropagation(), a?.(t, i.target.checked);
477
+ const i = P(
478
+ (m) => {
479
+ m.stopPropagation(), a?.(t, m.target.checked);
477
480
  },
478
481
  [a, t]
479
482
  );
480
- return /* @__PURE__ */ m(
483
+ return /* @__PURE__ */ u(
481
484
  "label",
482
485
  {
483
486
  className: "flex min-w-0 cursor-pointer flex-col py-[6px]",
484
487
  htmlFor: t,
485
488
  children: [
486
- /* @__PURE__ */ m("p", { className: "radio-label flex min-w-0 items-center", children: [
489
+ /* @__PURE__ */ u("p", { className: "radio-label flex min-w-0 items-center", children: [
487
490
  /* @__PURE__ */ r(
488
491
  "span",
489
492
  {
@@ -516,7 +519,7 @@ const wt = 24, vt = 24, V = 1e3, We = 24, Ct = ({
516
519
  "input",
517
520
  {
518
521
  type: "radio",
519
- onChange: c,
522
+ onChange: i,
520
523
  id: t,
521
524
  checked: n,
522
525
  className: "hidden"
@@ -534,17 +537,17 @@ const Ve = ({
534
537
  size: s,
535
538
  onClose: l,
536
539
  children: a,
537
- overlayClassName: c,
538
- containerClassName: i,
540
+ overlayClassName: i,
541
+ containerClassName: m,
539
542
  dividers: h = !0,
540
- closeButtonTitle: d
543
+ closeButtonTitle: c
541
544
  }) => {
542
- const { refs: p, context: f } = J({
545
+ const { refs: f, context: p } = J({
543
546
  open: t !== T.Closed && !!t,
544
547
  onOpenChange: l
545
- }), v = we(f, { role: "dialog" }), N = ee(f, { outsidePress: !0 }), { getFloatingProps: C } = te([v, N]), b = P(
546
- (u) => {
547
- u?.preventDefault(), u?.stopPropagation(), l();
548
+ }), N = we(p, { role: "dialog" }), w = ee(p, { outsidePress: !0 }), { getFloatingProps: C } = te([N, w]), b = P(
549
+ (d) => {
550
+ d?.preventDefault(), d?.stopPropagation(), l();
548
551
  },
549
552
  [l]
550
553
  );
@@ -553,9 +556,9 @@ const Ve = ({
553
556
  {
554
557
  className: g(
555
558
  "z-modal flex items-center justify-center bg-blackout p-4",
556
- c
559
+ i
557
560
  ),
558
- children: /* @__PURE__ */ r(Ce, { context: f, children: /* @__PURE__ */ m(
561
+ children: /* @__PURE__ */ r(Ce, { context: p, children: /* @__PURE__ */ u(
559
562
  "div",
560
563
  {
561
564
  className: g(
@@ -563,28 +566,28 @@ const Ve = ({
563
566
  s === G.LG && "max-w-[65%]",
564
567
  s === G.SM && "max-w-[30%]",
565
568
  h && "divide-neutrals-400 divide-y",
566
- i,
569
+ m,
567
570
  "sm:w-full sm:max-w-full sm:px-4 sm:py-6"
568
571
  ),
569
- ref: p.setFloating,
572
+ ref: f.setFloating,
570
573
  ...C({
571
- onClick(u) {
572
- u.stopPropagation();
574
+ onClick(d) {
575
+ d.stopPropagation();
573
576
  }
574
577
  }),
575
578
  children: [
576
- /* @__PURE__ */ m("div", { className: "modal-heading flex flex-row items-center justify-between px-6 py-5 sm:p-0 sm:pb-2", children: [
579
+ /* @__PURE__ */ u("div", { className: "modal-heading flex flex-row items-center justify-between px-6 py-5 sm:p-0 sm:pb-2", children: [
577
580
  n && (typeof n == "string" ? /* @__PURE__ */ r("h2", { className: "modal-heading-title sm:h3 mr-3 min-w-0 flex-1", children: n }) : n),
578
581
  /* @__PURE__ */ r(
579
582
  re,
580
583
  {
581
- title: d,
584
+ title: c,
582
585
  onClick: b,
583
586
  btnClassNames: "sm:h-[24px] sm:w-[24px] sm:top-4"
584
587
  }
585
588
  )
586
589
  ] }),
587
- a.map((u) => u)
590
+ a.map((d) => d)
588
591
  ]
589
592
  }
590
593
  ) })
@@ -610,12 +613,12 @@ const Ve = ({
610
613
  selectedOption: s,
611
614
  disabled: l,
612
615
  containerClassName: a,
613
- openedClassName: c,
614
- onOptionSelect: i
616
+ openedClassName: i,
617
+ onOptionSelect: m
615
618
  }) => {
616
- const h = me(), [d, p] = j(!1), { refs: f, floatingStyles: v, context: N } = J({
617
- open: d,
618
- onOpenChange: l ? void 0 : p,
619
+ const h = me(), [c, f] = j(!1), { refs: p, floatingStyles: N, context: w } = J({
620
+ open: c,
621
+ onOpenChange: l ? void 0 : f,
619
622
  placement: "bottom-end",
620
623
  strategy: "fixed",
621
624
  middleware: [
@@ -623,8 +626,8 @@ const Ve = ({
623
626
  Ie({ padding: L }),
624
627
  Se({
625
628
  padding: L,
626
- apply({ availableHeight: x, elements: w }) {
627
- w.floating.style.maxHeight = `${Math.max(
629
+ apply({ availableHeight: x, elements: v }) {
630
+ v.floating.style.maxHeight = `${Math.max(
628
631
  0,
629
632
  x
630
633
  )}px`;
@@ -634,42 +637,42 @@ const Ve = ({
634
637
  qe
635
638
  ],
636
639
  whileElementsMounted: ye
637
- }), C = De(N), b = ee(N, { outsidePress: !0 }), { getReferenceProps: u, getFloatingProps: o } = te([
640
+ }), C = De(w), b = ee(w, { outsidePress: !0 }), { getReferenceProps: d, getFloatingProps: o } = te([
638
641
  C,
639
642
  b
640
643
  ]);
641
644
  return O(() => {
642
- d && window.dispatchEvent(
645
+ c && window.dispatchEvent(
643
646
  new CustomEvent(H, { detail: h })
644
647
  );
645
- }, [h, d]), O(() => {
646
- const x = (w) => {
647
- w instanceof CustomEvent && w.detail !== h && p(!1);
648
+ }, [h, c]), O(() => {
649
+ const x = (v) => {
650
+ v instanceof CustomEvent && v.detail !== h && f(!1);
648
651
  };
649
652
  return window.addEventListener(H, x), () => {
650
653
  window.removeEventListener(H, x);
651
654
  };
652
655
  }, [h]), O(() => {
653
- l && p(!1);
654
- }, [l]), /* @__PURE__ */ m(q, { children: [
656
+ l && f(!1);
657
+ }, [l]), /* @__PURE__ */ u(q, { children: [
655
658
  /* @__PURE__ */ r(
656
659
  "div",
657
660
  {
658
- ref: f.setReference,
659
- ...u({
661
+ ref: p.setReference,
662
+ ...d({
660
663
  onClick(x) {
661
664
  x.stopPropagation();
662
665
  }
663
666
  }),
664
- className: g(a, d && c),
667
+ className: g(a, c && i),
665
668
  children: e
666
669
  }
667
670
  ),
668
- d && /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ m(
671
+ c && /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ u(
669
672
  "div",
670
673
  {
671
- ref: f.setFloating,
672
- style: { ...v, overflowY: "auto" },
674
+ ref: p.setFloating,
675
+ style: { ...N, overflowY: "auto" },
673
676
  className: "dropdown-menu-shadow dropdown-container z-dropdown flex flex-col rounded bg-white",
674
677
  ...o(),
675
678
  children: [
@@ -677,14 +680,14 @@ const Ve = ({
677
680
  t && t.map((x) => /* @__PURE__ */ r(
678
681
  "div",
679
682
  {
680
- onClick: (w) => {
681
- w.stopPropagation(), i?.(x.key), p(!1);
683
+ onClick: (v) => {
684
+ v.stopPropagation(), m?.(x.key), f(!1);
682
685
  },
683
686
  className: g(
684
687
  "text-neutrals-900 body-3 cursor-pointer dropdown-item min-w-[200px]",
685
688
  s === x.key && "bg-hues-100"
686
689
  ),
687
- children: /* @__PURE__ */ m(
690
+ children: /* @__PURE__ */ u(
688
691
  "div",
689
692
  {
690
693
  className: "dropdown-item-text flex h-full items-center gap-x-2 p-2 hover:bg-hues-100",
@@ -702,15 +705,15 @@ const Ve = ({
702
705
  }
703
706
  ) })
704
707
  ] });
705
- }, Rt = ({ limitMessages: e, query: t }) => /* @__PURE__ */ m("div", { className: "flex flex-wrap items-center justify-between bg-hues-100 px-2 py-1", children: [
706
- /* @__PURE__ */ r("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ r("div", { className: "flex flex-col", children: /* @__PURE__ */ m("div", { className: "flex gap-x-[4px]", children: [
707
- /* @__PURE__ */ m("span", { className: "h5 text-primary", children: [
708
+ }, Rt = ({ limitMessages: e, query: t }) => /* @__PURE__ */ u("div", { className: "flex flex-wrap items-center justify-between bg-hues-100 px-2 py-1", children: [
709
+ /* @__PURE__ */ r("div", { className: "flex gap-x-[4px]", children: /* @__PURE__ */ r("div", { className: "flex flex-col", children: /* @__PURE__ */ u("div", { className: "flex gap-x-[4px]", children: [
710
+ /* @__PURE__ */ u("span", { className: "h5 text-primary", children: [
708
711
  e?.excelFormatTitle,
709
712
  " "
710
713
  ] }),
711
714
  /* @__PURE__ */ r("span", { className: "body-3 text-neutrals-800", children: e?.excelFormatText })
712
715
  ] }) }) }),
713
- /* @__PURE__ */ r("a", { href: t, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ m("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
716
+ /* @__PURE__ */ r("a", { href: t, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ u("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
714
717
  e?.dataExplorerIcon,
715
718
  e?.dataExplorer
716
719
  ] }) })
@@ -720,7 +723,7 @@ const Ve = ({
720
723
  showAdvancedViewButton: n,
721
724
  onAdvancedViewClick: s,
722
725
  query: l
723
- }) => /* @__PURE__ */ m(
726
+ }) => /* @__PURE__ */ u(
724
727
  "div",
725
728
  {
726
729
  className: g(
@@ -728,11 +731,11 @@ const Ve = ({
728
731
  e?.containerClassName
729
732
  ),
730
733
  children: [
731
- /* @__PURE__ */ m("div", { className: "flex items-center gap-x-2", children: [
734
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-x-2", children: [
732
735
  /* @__PURE__ */ r("span", { children: e?.warningIcon }),
733
- /* @__PURE__ */ m("div", { className: "flex flex-col gap-1", children: [
734
- /* @__PURE__ */ m("div", { className: "flex gap-x-[4px]", children: [
735
- /* @__PURE__ */ m(
736
+ /* @__PURE__ */ u("div", { className: "flex flex-col gap-1", children: [
737
+ /* @__PURE__ */ u("div", { className: "flex gap-x-[4px]", children: [
738
+ /* @__PURE__ */ u(
736
739
  "span",
737
740
  {
738
741
  className: g(
@@ -769,7 +772,7 @@ const Ve = ({
769
772
  )
770
773
  ] })
771
774
  ] }),
772
- n && /* @__PURE__ */ m(
775
+ n && /* @__PURE__ */ u(
773
776
  "span",
774
777
  {
775
778
  onClick: () => s?.(),
@@ -780,7 +783,7 @@ const Ve = ({
780
783
  ]
781
784
  }
782
785
  ),
783
- t && /* @__PURE__ */ r("a", { href: l || "", target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ m("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
786
+ t && /* @__PURE__ */ r("a", { href: l || "", target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ u("span", { className: "body-3 flex cursor-pointer items-center gap-x-[4px]", children: [
784
787
  e?.dataExplorerIcon,
785
788
  e?.dataExplorer
786
789
  ] }) })
@@ -811,14 +814,14 @@ function Mt({
811
814
  className: s,
812
815
  contentClassName: l
813
816
  }) {
814
- const a = Qe(), c = t ?? a?.icons?.[e], i = a?.classes?.container ?? Je, h = a?.classes?.types?.[e] ?? Ke[e], d = F(i, h, s), p = F(Xe, a?.classes?.icon), f = F(
817
+ const a = Qe(), i = t ?? a?.icons?.[e], m = a?.classes?.container ?? Je, h = a?.classes?.types?.[e] ?? Ke[e], c = F(m, h, s), f = F(Xe, a?.classes?.icon), p = F(
815
818
  Ze,
816
819
  a?.classes?.content,
817
820
  l
818
821
  );
819
- return /* @__PURE__ */ m("div", { "data-type": e, className: d, children: [
820
- c ? /* @__PURE__ */ r("span", { className: p, children: c }) : null,
821
- n ? /* @__PURE__ */ r("div", { className: f, children: n }) : null
822
+ return /* @__PURE__ */ u("div", { "data-type": e, className: c, children: [
823
+ i ? /* @__PURE__ */ r("span", { className: f, children: i }) : null,
824
+ n ? /* @__PURE__ */ r("div", { className: p, children: n }) : null
822
825
  ] });
823
826
  }
824
827
  const Tt = ({
@@ -828,34 +831,34 @@ const Tt = ({
828
831
  hoverTooltip: s,
829
832
  icon: l,
830
833
  copiedIcon: a,
831
- className: c,
832
- buttonTextClassName: i,
834
+ className: i,
835
+ buttonTextClassName: m,
833
836
  onClick: h
834
837
  }) => {
835
- const [d, p] = j(!1), f = W(null), v = () => {
836
- h(), p(!0), f.current && clearTimeout(f.current), f.current = setTimeout(() => {
837
- p(!1);
838
+ const [c, f] = j(!1), p = W(null), N = () => {
839
+ h(), f(!0), p.current && clearTimeout(p.current), p.current = setTimeout(() => {
840
+ f(!1);
838
841
  }, 1e3);
839
842
  };
840
843
  return O(() => () => {
841
- f.current && clearTimeout(f.current);
842
- }, []), /* @__PURE__ */ m("div", { className: "relative w-fit", title: s, children: [
844
+ p.current && clearTimeout(p.current);
845
+ }, []), /* @__PURE__ */ u("div", { className: "relative w-fit", title: s, children: [
843
846
  /* @__PURE__ */ r(
844
847
  Ge,
845
848
  {
846
- title: d ? t : e,
849
+ title: c ? t : e,
847
850
  isSmallButton: !0,
848
- disabled: d,
851
+ disabled: c,
849
852
  buttonClassName: F([
850
853
  "text-button-tertiary small-icon-button !h-6 !p-0",
851
- c
854
+ i
852
855
  ]),
853
- textClassName: F(["ml-1", i]),
854
- onClick: v,
855
- iconBefore: d ? a : l
856
+ textClassName: F(["ml-1", m]),
857
+ onClick: N,
858
+ iconBefore: c ? a : l
856
859
  }
857
860
  ),
858
- n && d && /* @__PURE__ */ r("div", { className: "h4 absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2 whitespace-nowrap rounded border border-neutrals-400 bg-white px-3 py-4 text-neutrals-900 shadow", children: n })
861
+ n && c && /* @__PURE__ */ r("div", { className: "h4 absolute left-1/2 top-full z-50 mt-1 -translate-x-1/2 whitespace-nowrap rounded border border-neutrals-400 bg-white px-3 py-4 text-neutrals-900 shadow", children: n })
859
862
  ] });
860
863
  };
861
864
  function et({
@@ -865,13 +868,13 @@ function et({
865
868
  showDragHandle: s,
866
869
  showCheckbox: l,
867
870
  isChecked: a,
868
- isExpanded: c
871
+ isExpanded: i
869
872
  }) {
870
- return /* @__PURE__ */ m("div", { className: "relative cursor-grabbing rounded bg-neutrals-200 shadow", children: [
873
+ return /* @__PURE__ */ u("div", { className: "relative cursor-grabbing rounded bg-neutrals-200 shadow", children: [
871
874
  /* @__PURE__ */ r("div", { className: "absolute -left-[0.5px] top-0.5 h-5 w-0.5 rounded-full bg-gradients-light" }),
872
- /* @__PURE__ */ m("div", { className: "flex items-stretch overflow-hidden rounded", children: [
875
+ /* @__PURE__ */ u("div", { className: "flex items-stretch overflow-hidden rounded", children: [
873
876
  s ? /* @__PURE__ */ r("div", { className: "flex w-6 items-center justify-center", children: /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "rounded p-1", children: /* @__PURE__ */ r(X, { size: 16 }) }) }) : null,
874
- /* @__PURE__ */ m("div", { className: "flex min-w-0 flex-1 items-center gap-2 p-1", children: [
877
+ /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 items-center gap-2 p-1", children: [
875
878
  l ? /* @__PURE__ */ r(se, { id: e, checked: !!a, className: "p-0" }) : null,
876
879
  /* @__PURE__ */ r("span", { className: "body-3 truncate", children: t })
877
880
  ] }),
@@ -881,7 +884,7 @@ function et({
881
884
  "aria-hidden": !0,
882
885
  className: g(
883
886
  "transition-transform",
884
- c ? "rotate-90" : "rotate-0"
887
+ i ? "rotate-90" : "rotate-0"
885
888
  ),
886
889
  children: /* @__PURE__ */ r(Z, { size: 16 })
887
890
  }
@@ -931,23 +934,23 @@ function nt({
931
934
  showCheckbox: s,
932
935
  renderLabel: l,
933
936
  onItemClick: a,
934
- onToggleExpanded: c,
935
- onToggleChecked: i
937
+ onToggleExpanded: i,
938
+ onToggleChecked: m
936
939
  }) {
937
- const h = !!t.items?.length, d = !!t.isExpanded, p = t.isDisabled ? !1 : t.draggable ?? !0, f = t.isDisabled ? !1 : t.checkable ?? !0, v = ae(e, t.id), {
938
- attributes: N,
940
+ const h = !!t.items?.length, c = !!t.isExpanded, f = t.isDisabled ? !1 : t.draggable ?? !0, p = t.isDisabled ? !1 : t.checkable ?? !0, N = ae(e, t.id), {
941
+ attributes: w,
939
942
  listeners: C,
940
943
  setNodeRef: b,
941
- setActivatorNodeRef: u,
944
+ setActivatorNodeRef: d,
942
945
  transform: o,
943
946
  transition: x,
944
- isDragging: w
945
- } = Me({ id: v, disabled: !p }), S = {
947
+ isDragging: v
948
+ } = Me({ id: N, disabled: !f }), S = {
946
949
  transform: je.Transform.toString(o),
947
950
  transition: x,
948
- opacity: w ? 0.6 : void 0
949
- }, y = !!t.isDisabled, E = y || !f, D = [...e, t.id];
950
- return /* @__PURE__ */ m(
951
+ opacity: v ? 0.6 : void 0
952
+ }, y = !!t.isDisabled, E = y || !p, D = [...e, t.id];
953
+ return /* @__PURE__ */ u(
951
954
  "div",
952
955
  {
953
956
  ref: b,
@@ -968,15 +971,15 @@ function nt({
968
971
  children: /* @__PURE__ */ r(
969
972
  "span",
970
973
  {
971
- ref: u,
974
+ ref: d,
972
975
  "aria-hidden": !0,
973
976
  className: g([
974
977
  "rounded p-1",
975
- p ? "cursor-grab" : "cursor-default",
978
+ f ? "cursor-grab" : "cursor-default",
976
979
  "transition-opacity"
977
980
  ]),
978
- ...p ? C : {},
979
- ...p ? N : {},
981
+ ...f ? C : {},
982
+ ...f ? w : {},
980
983
  children: /* @__PURE__ */ r(
981
984
  X,
982
985
  {
@@ -988,7 +991,7 @@ function nt({
988
991
  )
989
992
  }
990
993
  ) : null,
991
- /* @__PURE__ */ m(
994
+ /* @__PURE__ */ u(
992
995
  "button",
993
996
  {
994
997
  type: "button",
@@ -1013,10 +1016,10 @@ function nt({
1013
1016
  {
1014
1017
  id: `draggable-list-${D.join("-")}`,
1015
1018
  checked: !!t.isChecked,
1016
- disabled: !f,
1019
+ disabled: !p,
1017
1020
  className: "p-0",
1018
1021
  stopPropagation: !0,
1019
- onChange: (k, I) => i?.({
1022
+ onChange: (k, I) => m?.({
1020
1023
  itemId: t.id,
1021
1024
  path: D,
1022
1025
  nextChecked: !!I
@@ -1033,13 +1036,13 @@ function nt({
1033
1036
  type: "button",
1034
1037
  disabled: y,
1035
1038
  onClick: (k) => {
1036
- k.stopPropagation(), c?.({
1039
+ k.stopPropagation(), i?.({
1037
1040
  itemId: t.id,
1038
1041
  path: D,
1039
- nextExpanded: !d
1042
+ nextExpanded: !c
1040
1043
  });
1041
1044
  },
1042
- "aria-label": d ? "Collapse" : "Expand",
1045
+ "aria-label": c ? "Collapse" : "Expand",
1043
1046
  className: g([
1044
1047
  "flex w-8 items-center justify-center rounded",
1045
1048
  y ? "" : "hover:bg-neutrals-100",
@@ -1051,7 +1054,7 @@ function nt({
1051
1054
  "aria-hidden": !0,
1052
1055
  className: g(
1053
1056
  "transition-transform duration-150 ease-out",
1054
- d ? "rotate-90" : "rotate-0"
1057
+ c ? "rotate-90" : "rotate-0"
1055
1058
  ),
1056
1059
  children: /* @__PURE__ */ r(Z, { size: 16 })
1057
1060
  }
@@ -1069,36 +1072,36 @@ function Pt({
1069
1072
  onItemsChange: s,
1070
1073
  onToggleExpanded: l,
1071
1074
  onToggleChecked: a,
1072
- onItemClick: c,
1073
- renderLabel: i
1075
+ onItemClick: i,
1076
+ renderLabel: m
1074
1077
  }) {
1075
1078
  const h = Le(
1076
1079
  Oe(Fe, { activationConstraint: { distance: 6 } })
1077
- ), [d, p] = ue.useState(null), f = (C) => {
1078
- const b = String(C.active.id), u = $(b);
1079
- if (!u) return;
1080
- const o = tt(e, u.parentPath, u.itemId);
1081
- !o || o.type !== "item" || p({
1080
+ ), [c, f] = ue.useState(null), p = (C) => {
1081
+ const b = String(C.active.id), d = $(b);
1082
+ if (!d) return;
1083
+ const o = tt(e, d.parentPath, d.itemId);
1084
+ !o || o.type !== "item" || f({
1082
1085
  id: b,
1083
1086
  label: o.label,
1084
1087
  hasChildren: !!o.items?.length,
1085
1088
  isChecked: o.isChecked,
1086
1089
  isExpanded: o.isExpanded
1087
1090
  });
1088
- }, v = (C) => {
1089
- p(null);
1091
+ }, N = (C) => {
1092
+ f(null);
1090
1093
  const b = C.over;
1091
1094
  if (!b) return;
1092
- const u = $(String(C.active.id)), o = $(String(b.id));
1093
- if (!u || !o || u.parentPath.join("/") !== o.parentPath.join("/")) return;
1094
- const x = oe(e, u.parentPath);
1095
+ const d = $(String(C.active.id)), o = $(String(b.id));
1096
+ if (!d || !o || d.parentPath.join("/") !== o.parentPath.join("/")) return;
1097
+ const x = oe(e, d.parentPath);
1095
1098
  if (!x) return;
1096
- const w = x.findIndex((E) => E.id === u.itemId), S = x.findIndex((E) => E.id === o.itemId);
1097
- if (w === -1 || S === -1 || w === S) return;
1098
- const y = ce(e, u.parentPath, (E) => {
1099
+ const v = x.findIndex((E) => E.id === d.itemId), S = x.findIndex((E) => E.id === o.itemId);
1100
+ if (v === -1 || S === -1 || v === S) return;
1101
+ const y = ce(e, d.parentPath, (E) => {
1099
1102
  const D = E.filter(
1100
1103
  (R) => R.type === "item"
1101
- ), k = Ye(D, w, S);
1104
+ ), k = Ye(D, v, S);
1102
1105
  let I = 0;
1103
1106
  return E.map((R) => {
1104
1107
  if (R.type !== "item") return R;
@@ -1107,27 +1110,27 @@ function Pt({
1107
1110
  });
1108
1111
  });
1109
1112
  s(y);
1110
- }, N = (C, b = []) => {
1111
- const u = C.filter((o) => o.type === "item").map((o) => ae(b, o.id));
1113
+ }, w = (C, b = []) => {
1114
+ const d = C.filter((o) => o.type === "item").map((o) => ae(b, o.id));
1112
1115
  return /* @__PURE__ */ r(
1113
1116
  Te,
1114
1117
  {
1115
- items: u,
1118
+ items: d,
1116
1119
  strategy: Pe,
1117
- children: /* @__PURE__ */ r("ul", { className: "m-0 flex list-none flex-col gap-2 p-0", children: C.map((o) => o.type === "group" ? /* @__PURE__ */ m(
1120
+ children: /* @__PURE__ */ r("ul", { className: "m-0 flex list-none flex-col gap-2 p-0", children: C.map((o) => o.type === "group" ? /* @__PURE__ */ u(
1118
1121
  "li",
1119
1122
  {
1120
1123
  className: "m-0 mt-2 flex flex-col gap-2 p-0 first:mt-0",
1121
1124
  children: [
1122
- /* @__PURE__ */ m("div", { className: "h5 flex items-center gap-2 py-1 text-neutrals-1000", children: [
1125
+ /* @__PURE__ */ u("div", { className: "h5 flex items-center gap-2 py-1 text-neutrals-1000", children: [
1123
1126
  /* @__PURE__ */ r(xe, { size: 12, className: "shrink-0" }),
1124
1127
  o.label
1125
1128
  ] }),
1126
- /* @__PURE__ */ r("div", { className: "border-l border-neutrals-600 pl-2", children: N(o.items, [...b, o.id]) })
1129
+ /* @__PURE__ */ r("div", { className: "border-l border-neutrals-600 pl-2", children: w(o.items, [...b, o.id]) })
1127
1130
  ]
1128
1131
  },
1129
1132
  o.id
1130
- ) : /* @__PURE__ */ m("li", { className: "m-0 flex flex-col gap-2 p-0", children: [
1133
+ ) : /* @__PURE__ */ u("li", { className: "m-0 flex flex-col gap-2 p-0", children: [
1131
1134
  /* @__PURE__ */ r(
1132
1135
  nt,
1133
1136
  {
@@ -1135,36 +1138,36 @@ function Pt({
1135
1138
  item: o,
1136
1139
  showDragHandle: t,
1137
1140
  showCheckbox: n,
1138
- renderLabel: i,
1139
- onItemClick: c,
1141
+ renderLabel: m,
1142
+ onItemClick: i,
1140
1143
  onToggleExpanded: l,
1141
1144
  onToggleChecked: a
1142
1145
  }
1143
1146
  ),
1144
- o.items?.length && o.isExpanded ? /* @__PURE__ */ r("div", { className: "pl-7", children: N(o.items, [...b, o.id]) }) : null
1147
+ o.items?.length && o.isExpanded ? /* @__PURE__ */ r("div", { className: "pl-7", children: w(o.items, [...b, o.id]) }) : null
1145
1148
  ] }, o.id)) })
1146
1149
  }
1147
1150
  );
1148
1151
  };
1149
- return /* @__PURE__ */ m(
1152
+ return /* @__PURE__ */ u(
1150
1153
  Re,
1151
1154
  {
1152
1155
  sensors: h,
1153
1156
  collisionDetection: _e,
1154
- onDragStart: f,
1155
- onDragEnd: v,
1157
+ onDragStart: p,
1158
+ onDragEnd: N,
1156
1159
  children: [
1157
- /* @__PURE__ */ r("div", { className: "flex flex-col", children: N(e) }),
1158
- /* @__PURE__ */ r(Ae, { children: d ? /* @__PURE__ */ r(
1160
+ /* @__PURE__ */ r("div", { className: "flex flex-col", children: w(e) }),
1161
+ /* @__PURE__ */ r(Ae, { children: c ? /* @__PURE__ */ r(
1159
1162
  et,
1160
1163
  {
1161
- id: d.id,
1162
- label: d.label,
1163
- hasChildren: d.hasChildren,
1164
+ id: c.id,
1165
+ label: c.label,
1166
+ hasChildren: c.hasChildren,
1164
1167
  showDragHandle: t,
1165
1168
  showCheckbox: n,
1166
- isChecked: d.isChecked,
1167
- isExpanded: d.isExpanded
1169
+ isChecked: c.isChecked,
1170
+ isExpanded: c.isExpanded
1168
1171
  }
1169
1172
  ) : null })
1170
1173
  ]
@@ -1179,14 +1182,14 @@ function Yt(e, t, n = {}) {
1179
1182
  const {
1180
1183
  expandMatchedBranches: l = !0,
1181
1184
  includeGroupDescendantsOnMatch: a = !0,
1182
- includeItemDescendantsOnMatch: c = !1,
1183
- match: i = rt
1185
+ includeItemDescendantsOnMatch: i = !1,
1186
+ match: m = rt
1184
1187
  } = n;
1185
1188
  return B(e, s, {
1186
1189
  expandMatchedBranches: l,
1187
1190
  includeGroupDescendantsOnMatch: a,
1188
- includeItemDescendantsOnMatch: c,
1189
- match: i
1191
+ includeItemDescendantsOnMatch: i,
1192
+ match: m
1190
1193
  }) ?? [];
1191
1194
  }
1192
1195
  function B(e, t, n) {
@@ -1202,10 +1205,10 @@ function st(e, t, n) {
1202
1205
  if (e.type === "group") {
1203
1206
  if (s && n.includeGroupDescendantsOnMatch)
1204
1207
  return Y(e, n.expandMatchedBranches);
1205
- const c = e.items?.length ? B(e.items, t, n) : null;
1206
- return !s && !c ? null : {
1208
+ const i = e.items?.length ? B(e.items, t, n) : null;
1209
+ return !s && !i ? null : {
1207
1210
  ...e,
1208
- items: c ?? []
1211
+ items: i ?? []
1209
1212
  };
1210
1213
  }
1211
1214
  const l = e.items?.length ? B(e.items, t, n) : null;