impact-nova 1.6.3 → 1.6.5

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.
@@ -20,7 +20,7 @@ const Ot = (ge) => {
20
20
  defaultValue: Me,
21
21
  onChange: u,
22
22
  isMulti: f,
23
- isDisabled: A,
23
+ isDisabled: V,
24
24
  isLoading: C,
25
25
  isClearable: ze = !0,
26
26
  isSearchable: q = !0,
@@ -38,7 +38,7 @@ const Ot = (ge) => {
38
38
  isRequired: _e,
39
39
  error: Se,
40
40
  helperText: ye,
41
- id: V,
41
+ id: N,
42
42
  className: qe,
43
43
  parentClassName: Be,
44
44
  onMenuScrollToBottom: se,
@@ -61,14 +61,14 @@ const Ot = (ge) => {
61
61
  trim: Ze,
62
62
  filterOption: et,
63
63
  enableSubMenus: S = !1,
64
- enableGroups: N = !1,
64
+ enableGroups: k = !1,
65
65
  fetchError: R,
66
66
  onRefetch: Oe,
67
67
  menuWidth: tt,
68
68
  onClearAll: Ae,
69
69
  onFocus: lt,
70
70
  onBlur: nt
71
- } = ge, { t: K } = Pt(), ie = Le ?? K("select.placeholder"), [b, Ce] = _(He), [E, Y] = _(""), [Ie, re] = _(void 0), [d, v] = _(Me || (f ? [] : null)), [st, ae] = _(null), U = -2, [k, I] = _(-1), oe = G(!1), ce = G(null), ue = G(null), it = G(null), W = G(null), de = G(null);
71
+ } = ge, { t: K } = Pt(), ie = Le ?? K("select.placeholder"), [b, Ce] = _(He), [E, Y] = _(""), [Ie, re] = _(void 0), [d, v] = _(Me || (f ? [] : null)), [st, ae] = _(null), U = -2, [D, I] = _(-1), oe = G(!1), ce = G(null), ue = G(null), it = G(null), W = G(null), de = G(null);
72
72
  M(() => {
73
73
  ne !== void 0 && v(ne);
74
74
  }, [ne]), M(() => {
@@ -79,7 +79,7 @@ const Ot = (ge) => {
79
79
  e && clearTimeout(e);
80
80
  };
81
81
  }, [b, q, B]);
82
- const { flatOptions: p, isProcessing: P, totalOptionsCount: Te, workerSelectAll: rt } = Nt(z, E, {
82
+ const { flatOptions: p, isProcessing: A, totalOptionsCount: Te, workerSelectAll: rt } = Nt(z, E, {
83
83
  ignoreCase: Xe,
84
84
  ignoreAccents: Ye,
85
85
  matchFrom: Je,
@@ -87,7 +87,7 @@ const Ot = (ge) => {
87
87
  trim: Ze,
88
88
  filterOption: et,
89
89
  enableSubMenus: S,
90
- enableGroups: N
90
+ enableGroups: k
91
91
  }), y = kt(d, f ?? !1), { stats: F, getGroupStats: fe } = Dt(
92
92
  p,
93
93
  Te,
@@ -95,7 +95,7 @@ const Ot = (ge) => {
95
95
  y,
96
96
  d,
97
97
  f ?? !1
98
- ), D = mt({
98
+ ), P = mt({
99
99
  count: p.length,
100
100
  getScrollElement: () => W.current,
101
101
  estimateSize: () => 34,
@@ -105,33 +105,33 @@ const Ot = (ge) => {
105
105
  if (!b)
106
106
  re(void 0), I(-1);
107
107
  else if (oe.current) {
108
- const e = !C && !P && !R && f && X && !h && p.length > 0;
108
+ const e = !C && !A && !R && f && X && !h && p.length > 0;
109
109
  I(e ? U : 0), oe.current = !1;
110
110
  }
111
111
  }, [b]), M(() => {
112
- k !== -1 && I(0);
112
+ D !== -1 && I(0);
113
113
  }, [E]), M(() => {
114
114
  if (!b) return;
115
115
  const e = requestAnimationFrame(() => {
116
- D.measure();
116
+ P.measure();
117
117
  });
118
118
  return () => cancelAnimationFrame(e);
119
- }, [b, D]), M(() => {
120
- if (b && be && !P && p.length > 0) {
119
+ }, [b, P]), M(() => {
120
+ if (b && be && !A && p.length > 0) {
121
121
  const e = p.findIndex((t) => f ? y.mode === "exclude" ? !y.set.has(t.value) : y.set.has(t.value) : d?.value === t.value);
122
122
  if (e !== -1) {
123
123
  const t = setTimeout(() => {
124
- D.scrollToIndex(e, { align: "center" });
124
+ P.scrollToIndex(e, { align: "center" });
125
125
  }, 50);
126
126
  return () => clearTimeout(t);
127
127
  }
128
128
  }
129
- }, [b, be, P, p.length, f, y.mode, y.set, d, D]);
129
+ }, [b, be, A, p.length, f, y.mode, y.set, d, P]);
130
130
  const H = G(null);
131
131
  M(() => {
132
132
  if (!W.current || !se) return;
133
133
  const e = () => {
134
- if (C || P) return;
134
+ if (C || A) return;
135
135
  const { scrollTop: l, scrollHeight: s, clientHeight: n } = W.current;
136
136
  if (s - l - n <= 10) {
137
137
  if (H.current) return;
@@ -140,7 +140,7 @@ const Ot = (ge) => {
140
140
  }, 500);
141
141
  }
142
142
  }, t = W.current;
143
- return t.addEventListener("scroll", e), !C && !P && e(), () => {
143
+ return t.addEventListener("scroll", e), !C && !A && e(), () => {
144
144
  t.removeEventListener("scroll", e), H.current && (clearTimeout(H.current), H.current = null);
145
145
  };
146
146
  }, [
@@ -148,10 +148,10 @@ const Ot = (ge) => {
148
148
  p.length,
149
149
  b,
150
150
  C,
151
- P
151
+ A
152
152
  ]);
153
153
  const J = (e) => {
154
- if (!A)
154
+ if (!V)
155
155
  if (Ce(e), e)
156
156
  We?.();
157
157
  else {
@@ -159,14 +159,14 @@ const Ot = (ge) => {
159
159
  ke?.(t, l), Y(""), ae(null);
160
160
  }
161
161
  }, Q = (e) => {
162
- if (!(A || h || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
162
+ if (!(V || h || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
163
163
  if (f) {
164
164
  const l = d || [];
165
165
  if ("children" in e || "options" in e) {
166
166
  const n = Vt(
167
167
  e,
168
168
  S,
169
- N
169
+ k
170
170
  ).filter((i) => !i.isDisabled);
171
171
  if (T(l)) {
172
172
  const i = l.excludedValues, r = n.every(
@@ -235,7 +235,7 @@ const Ot = (ge) => {
235
235
  option: e
236
236
  }), Fe && (Ce(!1), ke?.(e, void 0), Y(""));
237
237
  }, pe = async () => {
238
- if (!(!f || A || h)) {
238
+ if (!(!f || V || h)) {
239
239
  if (z.length > 3e3) {
240
240
  try {
241
241
  const e = await rt(
@@ -351,7 +351,7 @@ const Ot = (ge) => {
351
351
  if (f) {
352
352
  const t = [], l = (n) => {
353
353
  for (const i of n) {
354
- if (N && "options" in i) {
354
+ if (k && "options" in i) {
355
355
  l(
356
356
  i.options
357
357
  );
@@ -375,7 +375,7 @@ const Ot = (ge) => {
375
375
  const n = (i) => {
376
376
  for (const r of i) {
377
377
  if (s) return;
378
- if (N && "options" in r) {
378
+ if (k && "options" in r) {
379
379
  if (n(
380
380
  r.options
381
381
  ), s) return;
@@ -408,58 +408,58 @@ const Ot = (ge) => {
408
408
  d
409
409
  ), Z = (e) => Ve ? Ve(e) : e.label, Ee = () => {
410
410
  const e = [];
411
- return !C && !P && !R && f && X && !h && p.length > 0 && e.push(U), p.forEach((l, s) => {
411
+ return !C && !A && !R && f && X && !h && p.length > 0 && e.push(U), p.forEach((l, s) => {
412
412
  !l.isGroup && !(S && l.isSubmenuParent) && !l.isDisabled && e.push(s);
413
413
  }), e;
414
414
  }, ct = (e) => {
415
- if (A || h) return;
415
+ if (V || h) return;
416
416
  if (!b) {
417
417
  (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), oe.current = !0, J(!0));
418
418
  return;
419
419
  }
420
420
  const t = Ee();
421
421
  if (t.length === 0) return;
422
- const l = t.indexOf(k);
422
+ const l = t.indexOf(D);
423
423
  if (e.key === "ArrowDown") {
424
424
  e.preventDefault();
425
425
  const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
426
- I(n), n >= 0 && D.scrollToIndex(n, { align: "auto" });
426
+ I(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
427
427
  } else if (e.key === "ArrowUp") {
428
428
  e.preventDefault();
429
429
  const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
430
- I(n), n >= 0 && D.scrollToIndex(n, { align: "auto" });
430
+ I(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
431
431
  } else if (e.key === "Enter" || e.key === " ") {
432
- if (e.preventDefault(), k === U)
432
+ if (e.preventDefault(), D === U)
433
433
  pe();
434
- else if (k >= 0 && k < p.length) {
435
- const s = p[k];
434
+ else if (D >= 0 && D < p.length) {
435
+ const s = p[D];
436
436
  s.isDisabled || Q(s);
437
437
  }
438
438
  } else if (e.key === "Escape")
439
439
  e.preventDefault(), J(!1), ce.current?.focus();
440
440
  else if (e.key === "Home")
441
- e.preventDefault(), t.length > 0 && (I(t[0]), t[0] >= 0 && D.scrollToIndex(t[0], { align: "auto" }));
441
+ e.preventDefault(), t.length > 0 && (I(t[0]), t[0] >= 0 && P.scrollToIndex(t[0], { align: "auto" }));
442
442
  else if (e.key === "End" && (e.preventDefault(), t.length > 0)) {
443
443
  const s = t[t.length - 1];
444
- I(s), s >= 0 && D.scrollToIndex(s, { align: "auto" });
444
+ I(s), s >= 0 && P.scrollToIndex(s, { align: "auto" });
445
445
  }
446
446
  }, ut = (e) => {
447
447
  const t = Ee();
448
448
  if (t.length === 0) return;
449
- const l = t.indexOf(k);
449
+ const l = t.indexOf(D);
450
450
  if (e.key === "ArrowDown") {
451
451
  e.preventDefault();
452
452
  const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
453
- I(n), n >= 0 && D.scrollToIndex(n, { align: "auto" });
453
+ I(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
454
454
  } else if (e.key === "ArrowUp") {
455
455
  e.preventDefault();
456
456
  const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
457
- I(n), n >= 0 && D.scrollToIndex(n, { align: "auto" });
457
+ I(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
458
458
  } else if (e.key === "Enter") {
459
- if (e.preventDefault(), k === U)
459
+ if (e.preventDefault(), D === U)
460
460
  pe();
461
- else if (k >= 0 && k < p.length) {
462
- const s = p[k];
461
+ else if (D >= 0 && D < p.length) {
462
+ const s = p[D];
463
463
  s.isDisabled || Q(s);
464
464
  }
465
465
  } else e.key === "Escape" && (e.preventDefault(), J(!1), ce.current?.focus());
@@ -467,10 +467,10 @@ const Ot = (ge) => {
467
467
  if (f) {
468
468
  const e = d || [];
469
469
  let t = 0;
470
- return T(e) ? t = Te - e.excludedValues.length : w(e) && (t = e.length), t === 0 ? null : t === 1 && w(e) ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: Z(e[0]) }) : /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: K("select.selectedCount", { count: t }) });
470
+ return T(e) ? t = Te - e.excludedValues.length : w(e) && (t = e.length), t === 0 ? null : t === 1 && w(e) ? /* @__PURE__ */ a("span", { className: O("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: Z(e[0]) }) : /* @__PURE__ */ a("span", { className: O("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: K("select.selectedCount", { count: t }) });
471
471
  } else {
472
472
  const e = d;
473
- return e ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: Z(e) }) : null;
473
+ return e ? /* @__PURE__ */ a("span", { className: O("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: Z(e) }) : null;
474
474
  }
475
475
  };
476
476
  return /* @__PURE__ */ g(
@@ -481,7 +481,7 @@ const Ot = (ge) => {
481
481
  De === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
482
482
  Be
483
483
  ),
484
- "data-testid": `select-${V || "default"}`,
484
+ "data-testid": `select-${N || "default"}`,
485
485
  "data-component": "select",
486
486
  children: [
487
487
  L && /* @__PURE__ */ g(
@@ -505,15 +505,15 @@ const Ot = (ge) => {
505
505
  ref: ce,
506
506
  className: O(
507
507
  "relative h-[32px] w-full cursor-pointer rounded-[8px] border border-solid px-3 py-1 text-left shadow-sm sm:text-sm transition-all flex items-center overflow-hidden",
508
- Se ? "border-[#e15554] focus:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500",
509
- A ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
508
+ Se ? "border-[#e15554] focus-visible:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus-visible:border-indigo-500 focus-visible:ring-1 focus-visible:ring-indigo-500",
509
+ V ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
510
510
  h ? "cursor-default bg-[#f2f4fb]" : "",
511
511
  b ? "ring-1 ring-indigo-500 border-indigo-500" : "",
512
- !A && !h && "bg-white",
512
+ !V && !h && "bg-white",
513
513
  qe
514
514
  ),
515
- id: V,
516
- tabIndex: A ? -1 : 0,
515
+ id: N,
516
+ tabIndex: V ? -1 : 0,
517
517
  onFocus: lt,
518
518
  onBlur: nt,
519
519
  role: "combobox",
@@ -521,7 +521,7 @@ const Ot = (ge) => {
521
521
  "aria-haspopup": "listbox",
522
522
  "aria-label": L ? String(L) : ie,
523
523
  "data-component": "select-trigger",
524
- "data-disabled": A || void 0,
524
+ "data-disabled": V || void 0,
525
525
  "data-state": b ? "open" : "closed",
526
526
  onKeyDown: ct,
527
527
  children: /* @__PURE__ */ g("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
@@ -530,13 +530,13 @@ const Ot = (ge) => {
530
530
  "div",
531
531
  {
532
532
  className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
533
- "data-testid": `select-value-${V || "default"}`,
533
+ "data-testid": `select-value-${N || "default"}`,
534
534
  children: [
535
535
  dt() || /* @__PURE__ */ a(
536
536
  "span",
537
537
  {
538
538
  className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
539
- "data-testid": `select-placeholder-${V || "default"}`,
539
+ "data-testid": `select-placeholder-${N || "default"}`,
540
540
  "data-has-value": !1,
541
541
  children: ie
542
542
  }
@@ -557,8 +557,8 @@ const Ot = (ge) => {
557
557
  ]
558
558
  }
559
559
  ),
560
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !b && (C || P) ? /* @__PURE__ */ a(gt, { size: "14px" }) : /* @__PURE__ */ g(pt, { children: [
561
- ze && !h && (f && (T(
560
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !b && (C || A) ? /* @__PURE__ */ a(gt, { size: "14px" }) : /* @__PURE__ */ g(pt, { children: [
561
+ ze && !h && !V && (f && (T(
562
562
  d
563
563
  ) && d.isAllSelected || w(d) && d.length > 0) || !f && d) && /* @__PURE__ */ a(
564
564
  "div",
@@ -603,7 +603,7 @@ const Ot = (ge) => {
603
603
  "z-50 overflow-hidden rounded-[12px] text-base shadow-[0px_1px_6px_0px_rgba(26,39,124,0.14)] focus:outline-none sm:text-sm flex flex-col border-none pointer-events-auto",
604
604
  h ? "bg-[#f5f5f5]" : "bg-white"
605
605
  ),
606
- "data-testid": `select-menu-${V || "default"}`,
606
+ "data-testid": `select-menu-${N || "default"}`,
607
607
  "data-component": "select-menu",
608
608
  children: [
609
609
  /* @__PURE__ */ g(
@@ -619,7 +619,7 @@ const Ot = (ge) => {
619
619
  "div",
620
620
  {
621
621
  className: "p-0",
622
- "data-testid": `select-search-container-${V || "default"}`,
622
+ "data-testid": `select-search-container-${N || "default"}`,
623
623
  children: /* @__PURE__ */ g("div", { className: "relative", children: [
624
624
  /* @__PURE__ */ a("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ a(vt, { size: "14px", color: "#AFAFAF" }) }),
625
625
  /* @__PURE__ */ a(
@@ -636,28 +636,28 @@ const Ot = (ge) => {
636
636
  E === "" && t !== "" ? ue.current && re(ue.current.offsetHeight) : t === "" && re(void 0), Y(t), Ue?.(t);
637
637
  },
638
638
  onClick: (e) => e.stopPropagation(),
639
- "data-testid": `select-search-input-${V || "default"}`
639
+ "data-testid": `select-search-input-${N || "default"}`
640
640
  }
641
641
  )
642
642
  ] })
643
643
  }
644
644
  ),
645
- !C && !P && !R && f && X && !h && p.length > 0 && /* @__PURE__ */ a(
645
+ !C && !A && !R && f && X && !h && p.length > 0 && /* @__PURE__ */ a(
646
646
  "div",
647
647
  {
648
648
  className: "pb-1",
649
- "data-testid": `select-select-all-container-${V || "default"}`,
649
+ "data-testid": `select-select-all-container-${N || "default"}`,
650
650
  children: /* @__PURE__ */ a(
651
651
  "div",
652
652
  {
653
653
  className: O(
654
654
  "flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
655
- k === U && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
655
+ D === U && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
656
656
  ),
657
657
  onClick: pe,
658
658
  role: "option",
659
659
  "aria-selected": !1,
660
- "data-testid": `select-select-all-button-${V || "default"}`,
660
+ "data-testid": `select-select-all-button-${N || "default"}`,
661
661
  children: /* @__PURE__ */ g("div", { className: "flex items-center flex-1", children: [
662
662
  /* @__PURE__ */ a("div", { className: "pointer-events-none flex", children: /* @__PURE__ */ a(
663
663
  Ge,
@@ -668,17 +668,17 @@ const Ot = (ge) => {
668
668
  const l = x ? Math.min(e, x) : e;
669
669
  return t > 0 && t < l ? "indeterminate" : t >= l;
670
670
  })(),
671
- disabled: A || h,
671
+ disabled: V || h,
672
672
  onChange: () => {
673
673
  },
674
- "data-testid": `select-select-all-checkbox-${V || "default"}`
674
+ "data-testid": `select-select-all-checkbox-${N || "default"}`
675
675
  }
676
676
  ) }),
677
677
  /* @__PURE__ */ a(
678
678
  "span",
679
679
  {
680
680
  className: "text-sm font-medium text-gray-700",
681
- "data-testid": `select-select-all-label-${V || "default"}`,
681
+ "data-testid": `select-select-all-label-${N || "default"}`,
682
682
  children: (() => {
683
683
  const { totalVisible: e, selectedVisible: t } = F, l = x ? Math.min(e, x) : e, s = e > 0 && t >= l;
684
684
  return K(s ? "select.unselectAll" : "select.selectAll");
@@ -716,7 +716,7 @@ const Ot = (ge) => {
716
716
  children: "Refetch"
717
717
  }
718
718
  )
719
- ] }) : p.length === 0 && !C && !P ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : C || P ? /* @__PURE__ */ a("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g(
719
+ ] }) : p.length === 0 && !C && !A ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : C || A ? /* @__PURE__ */ a("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g(
720
720
  "div",
721
721
  {
722
722
  className: "flex items-center gap-2 px-3 py-2 animate-pulse",
@@ -730,19 +730,19 @@ const Ot = (ge) => {
730
730
  "div",
731
731
  {
732
732
  style: {
733
- height: `${D.getTotalSize()}px`,
733
+ height: `${P.getTotalSize()}px`,
734
734
  width: "100%",
735
735
  position: "relative"
736
736
  },
737
- children: D.getVirtualItems().map((e) => {
738
- const t = p[e.index], l = f ? y.mode === "exclude" ? !y.set.has(t.value) : y.set.has(t.value) : d?.value === t.value, s = d || [], n = f && x ? T(s) ? !1 : w(s) && s.length >= x : !1, i = t.isDisabled || n && !l && !(N && t.isGroup) && !(S && t.isSubmenuParent), r = N && t.isGroup || S && t.isSubmenuParent ? fe(t.original) : void 0, c = r?.selected || 0, o = r?.total || 0, m = c > 0 && c < o, ee = t.isParentSelectable !== !1, me = V || "default", te = String(t.value || ""), he = Z(
737
+ children: P.getVirtualItems().map((e) => {
738
+ const t = p[e.index], l = f ? y.mode === "exclude" ? !y.set.has(t.value) : y.set.has(t.value) : d?.value === t.value, s = d || [], n = f && x ? T(s) ? !1 : w(s) && s.length >= x : !1, i = t.isDisabled || n && !l && !(k && t.isGroup) && !(S && t.isSubmenuParent), r = k && t.isGroup || S && t.isSubmenuParent ? fe(t.original) : void 0, c = r?.selected || 0, o = r?.total || 0, m = c > 0 && c < o, ee = t.isParentSelectable !== !1, me = N || "default", te = String(t.value || ""), he = Z(
739
739
  t
740
740
  ), ft = typeof he == "string" ? he : te;
741
741
  return /* @__PURE__ */ g(
742
742
  "div",
743
743
  {
744
744
  "data-index": e.index,
745
- ref: D.measureElement,
745
+ ref: P.measureElement,
746
746
  className: "absolute left-0 w-full pb-[2px]",
747
747
  style: {
748
748
  transform: `translateY(${e.start}px)`,
@@ -756,14 +756,14 @@ const Ot = (ge) => {
756
756
  className: O(
757
757
  "cursor-default select-none py-[6px] px-3 flex items-center justify-between transition-colors rounded-md",
758
758
  i ? "opacity-50 cursor-not-allowed bg-[#f5f5f5]" : h ? "cursor-default" : "hover:bg-gray-100 cursor-pointer",
759
- l && !i && !(N && t.isGroup) && !(S && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
760
- k === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
759
+ l && !i && !(k && t.isGroup) && !(S && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
760
+ D === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
761
761
  ),
762
762
  style: {
763
763
  paddingLeft: `${t.depth * 16 + 12}px`
764
764
  },
765
765
  onClick: () => {
766
- i || (N && t.isGroup || S && t.isSubmenuParent) && !ee || Q(t);
766
+ i || (k && t.isGroup || S && t.isSubmenuParent) && !ee || Q(t);
767
767
  },
768
768
  onMouseEnter: ($) => {
769
769
  if (S && t.isSubmenuParent) {
@@ -790,7 +790,7 @@ const Ot = (ge) => {
790
790
  },
791
791
  t
792
792
  ) : /* @__PURE__ */ g("div", { className: "flex items-center flex-1 overflow-hidden", children: [
793
- f && (N && t.isGroup || S && t.isSubmenuParent ? ee : !0) && /* @__PURE__ */ a(
793
+ f && (k && t.isGroup || S && t.isSubmenuParent ? ee : !0) && /* @__PURE__ */ a(
794
794
  Ge,
795
795
  {
796
796
  checked: m ? "indeterminate" : l,
@@ -799,7 +799,7 @@ const Ot = (ge) => {
799
799
  }
800
800
  }
801
801
  ),
802
- ve && !(N && t.isGroup) && !(S && t.isSubmenuParent) ? /* @__PURE__ */ a(
802
+ ve && !(k && t.isGroup) && !(S && t.isSubmenuParent) ? /* @__PURE__ */ a(
803
803
  ht,
804
804
  {
805
805
  label: Z(
@@ -813,8 +813,8 @@ const Ot = (ge) => {
813
813
  {
814
814
  className: O(
815
815
  "block truncate",
816
- N && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(S && t.isSubmenuParent) ? "font-medium" : "font-normal",
817
- !(N && t.isGroup) && "text-[14px]"
816
+ k && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(S && t.isSubmenuParent) ? "font-medium" : "font-normal",
817
+ !(k && t.isGroup) && "text-[14px]"
818
818
  ),
819
819
  "data-testid": `select-option-label-${me}-${te}`,
820
820
  "data-state": l ? "checked" : "unchecked",
@@ -822,7 +822,7 @@ const Ot = (ge) => {
822
822
  children: he
823
823
  }
824
824
  ),
825
- (N && t.isGroup || S && t.isSubmenuParent) && c > 0 && /* @__PURE__ */ a("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800", children: c })
825
+ (k && t.isGroup || S && t.isSubmenuParent) && c > 0 && /* @__PURE__ */ a("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800", children: c })
826
826
  ] }),
827
827
  S && t.isSubmenuParent && /* @__PURE__ */ a(
828
828
  $e,
@@ -847,7 +847,7 @@ const Ot = (ge) => {
847
847
  },
848
848
  getSelectedCount: ($) => fe($)?.selected || 0,
849
849
  handleSelect: Q,
850
- id: V
850
+ id: N
851
851
  }
852
852
  )
853
853
  ]
@@ -33,17 +33,13 @@ interface StatisticsCardRootProps<T = StatisticsCardItem> extends React.HTMLAttr
33
33
  }
34
34
  declare const StatisticsCardRoot: React.ForwardRefExoticComponent<StatisticsCardRootProps<StatisticsCardItem> & React.RefAttributes<HTMLDivElement>>;
35
35
  declare const StatisticsCardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
36
- interface StatisticsCardTitleProps extends React.HTMLAttributes<HTMLDivElement> {
37
- }
38
- declare const StatisticsCardTitle: React.ForwardRefExoticComponent<StatisticsCardTitleProps & React.RefAttributes<HTMLDivElement>>;
36
+ declare const StatisticsCardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
39
37
  interface StatisticsCardTitleIconProps extends React.HTMLAttributes<HTMLDivElement> {
40
38
  icon: React.ReactNode;
41
39
  className?: string;
42
40
  }
43
41
  declare const StatisticsCardTitleIcon: React.ForwardRefExoticComponent<StatisticsCardTitleIconProps & React.RefAttributes<HTMLDivElement>>;
44
- interface StatisticsCardTitleTextProps extends React.HTMLAttributes<HTMLSpanElement> {
45
- }
46
- declare const StatisticsCardTitleText: React.ForwardRefExoticComponent<StatisticsCardTitleTextProps & React.RefAttributes<HTMLSpanElement>>;
42
+ declare const StatisticsCardTitleText: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
47
43
  interface StatisticsCardTitleTooltipProps extends React.HTMLAttributes<HTMLDivElement> {
48
44
  content: string;
49
45
  icon?: React.ReactNode;
@@ -73,9 +69,7 @@ interface StatisticsCardLegendItemProps extends React.HTMLAttributes<HTMLDivElem
73
69
  item?: StatisticsCardItem;
74
70
  }
75
71
  declare const StatisticsCardLegendItem: React.ForwardRefExoticComponent<StatisticsCardLegendItemProps & React.RefAttributes<HTMLDivElement>>;
76
- interface StatisticsCardSummaryProps extends React.HTMLAttributes<HTMLDivElement> {
77
- }
78
- declare const StatisticsCardSummary: React.ForwardRefExoticComponent<StatisticsCardSummaryProps & React.RefAttributes<HTMLDivElement>>;
72
+ declare const StatisticsCardSummary: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
79
73
  interface StatisticsCardSummaryItemProps extends React.HTMLAttributes<HTMLDivElement> {
80
74
  label: string;
81
75
  count: number | string | React.ReactNode;
@@ -83,4 +77,4 @@ interface StatisticsCardSummaryItemProps extends React.HTMLAttributes<HTMLDivEle
83
77
  }
84
78
  declare const StatisticsCardSummaryItem: React.ForwardRefExoticComponent<StatisticsCardSummaryItemProps & React.RefAttributes<HTMLDivElement>>;
85
79
  export { StatisticsCardRoot, StatisticsCardHeader, StatisticsCardTitle, StatisticsCardTitleIcon, StatisticsCardTitleText, StatisticsCardTitleTooltip, StatisticsCardChart, StatisticsCardLegend, StatisticsCardLegendItem, StatisticsCardSummary, StatisticsCardSummaryItem, };
86
- export type { StatisticsCardRootProps, StatisticsCardTitleProps, StatisticsCardTitleIconProps, StatisticsCardTitleTextProps, StatisticsCardTitleTooltipProps, StatisticsCardChartProps, StatisticsCardLegendItemProps, StatisticsCardSummaryProps, StatisticsCardSummaryItemProps };
80
+ export type { StatisticsCardRootProps, StatisticsCardTitleIconProps, StatisticsCardTitleTooltipProps, StatisticsCardChartProps, StatisticsCardLegendItemProps, StatisticsCardSummaryItemProps };
@@ -83,6 +83,7 @@ export declare const useStatisticsChartPlotOptions: (items: StatisticsCardItem[]
83
83
  enabled: boolean;
84
84
  };
85
85
  showInLegend: boolean;
86
+ allowPointSelect: boolean;
86
87
  states: {
87
88
  hover: {
88
89
  enabled: boolean;
@@ -134,6 +135,7 @@ export declare const useStatisticsChartOptions: (items: StatisticsCardItem[], on
134
135
  enabled: boolean;
135
136
  };
136
137
  showInLegend: boolean;
138
+ allowPointSelect: boolean;
137
139
  states: {
138
140
  hover: {
139
141
  enabled: boolean;
@@ -1,17 +1,17 @@
1
1
  import * as a from "react";
2
2
  const f = (e) => {
3
- const s = a.useMemo(
4
- () => e.reduce((o, n) => o + n.value, 0),
3
+ const o = a.useMemo(
4
+ () => e.reduce((s, n) => s + n.value, 0),
5
5
  [e]
6
6
  ), t = a.useMemo(
7
- () => e.reduce((o, n) => o + (n.checked ? n.value : 0), 0),
7
+ () => e.reduce((s, n) => s + (n.checked ? n.value : 0), 0),
8
8
  [e]
9
- ), r = e.some((o) => o.checked);
10
- return { total: s, checkedTotal: t, hasChecked: r };
11
- }, p = (e, s = 0.4) => {
12
- const t = e.replace("#", ""), r = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), n = parseInt(t.substring(4, 6), 16);
13
- return `rgba(${r}, ${o}, ${n}, ${s})`;
14
- }, x = (e, s) => a.useMemo(
9
+ ), r = e.some((s) => s.checked);
10
+ return { total: o, checkedTotal: t, hasChecked: r };
11
+ }, p = (e, o = 0.4) => {
12
+ const t = e.replace("#", ""), r = parseInt(t.substring(0, 2), 16), s = parseInt(t.substring(2, 4), 16), n = parseInt(t.substring(4, 6), 16);
13
+ return `rgba(${r}, ${s}, ${n}, ${o})`;
14
+ }, x = (e, o) => a.useMemo(
15
15
  () => [
16
16
  {
17
17
  type: "pie",
@@ -20,14 +20,14 @@ const f = (e) => {
20
20
  data: e.map((t) => ({
21
21
  name: t.label,
22
22
  y: t.value,
23
- color: s ? t.checked ? t.borderColor : p(t.borderColor, 0.4) : t.borderColor
23
+ color: o ? t.checked ? t.borderColor : p(t.borderColor, 0.4) : t.borderColor
24
24
  }))
25
25
  }
26
26
  ],
27
- [e, s]
28
- ), y = (e, s, t, r) => a.useMemo(
29
- () => e ?? String(s ? t : r),
30
- [e, s, t, r]
27
+ [e, o]
28
+ ), y = (e, o, t, r) => a.useMemo(
29
+ () => e ?? String(o ? t : r),
30
+ [e, o, t, r]
31
31
  ), b = () => a.useMemo(
32
32
  () => ({
33
33
  enabled: !0,
@@ -51,16 +51,18 @@ const f = (e) => {
51
51
  }
52
52
  }),
53
53
  []
54
- ), h = (e, s, t) => {
55
- const r = t?.borderWidth ?? 2, o = t?.borderColor ?? "#F8F9FB", n = t?.borderRadius ?? 4, i = t?.enableHover ?? !0, l = t?.enableClick ?? !0;
54
+ ), h = (e, o, t) => {
55
+ const r = t?.borderWidth ?? 2, s = t?.borderColor ?? "#F8F9FB", n = t?.borderRadius ?? 4, i = t?.enableHover ?? !0, l = t?.enableClick ?? !0;
56
56
  return a.useMemo(
57
57
  () => ({
58
58
  pie: {
59
59
  borderWidth: r,
60
- borderColor: o,
60
+ borderColor: s,
61
61
  borderRadius: n,
62
62
  dataLabels: { enabled: !1 },
63
63
  showInLegend: !1,
64
+ allowPointSelect: !1,
65
+ // Disable pull-out effect on click
64
66
  states: { hover: { enabled: i, brightness: 0.05 } },
65
67
  // Handle slice click to toggle corresponding legend item
66
68
  point: {
@@ -68,16 +70,16 @@ const f = (e) => {
68
70
  click: function() {
69
71
  if (!l) return;
70
72
  const u = this.name, c = e.findIndex((d) => d.label === u);
71
- c !== -1 && s && s(c, !e[c].checked);
73
+ c !== -1 && o && o(c, !e[c].checked);
72
74
  }
73
75
  }
74
76
  }
75
77
  }
76
78
  }),
77
- [e, s, r, o, n, i, l]
79
+ [e, o, r, s, n, i, l]
78
80
  );
79
- }, g = (e, s, t) => {
80
- const r = b(), o = h(e, s, t);
81
+ }, S = (e, o, t) => {
82
+ const r = b(), s = h(e, o, t);
81
83
  return a.useMemo(
82
84
  () => ({
83
85
  chart: {
@@ -85,15 +87,15 @@ const f = (e) => {
85
87
  spacing: [0, 0, 0, 0]
86
88
  },
87
89
  tooltip: r,
88
- plotOptions: o
90
+ plotOptions: s
89
91
  }),
90
- [r, o]
92
+ [r, s]
91
93
  );
92
94
  };
93
95
  export {
94
96
  f as useStatisticsChartData,
95
97
  y as useStatisticsChartLabel,
96
- g as useStatisticsChartOptions,
98
+ S as useStatisticsChartOptions,
97
99
  h as useStatisticsChartPlotOptions,
98
100
  x as useStatisticsChartSeries,
99
101
  b as useStatisticsChartTooltip