impact-nova 0.1.13 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/components/layout/dashboard-layout.d.ts +21 -6
  2. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
  3. package/dist/components/ui/accordion.js +25 -23
  4. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
  5. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
  6. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
  7. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
  8. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
  9. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
  10. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
  11. package/dist/components/ui/alert-dialog.js +45 -40
  12. package/dist/components/ui/alert.d.ts +21 -4
  13. package/dist/components/ui/alert.js +45 -25
  14. package/dist/components/ui/avatar.js +19 -16
  15. package/dist/components/ui/badge.js +8 -1
  16. package/dist/components/ui/breadcrumb.js +1 -0
  17. package/dist/components/ui/button-group.d.ts +1 -1
  18. package/dist/components/ui/button-group.js +27 -32
  19. package/dist/components/ui/button-variants.d.ts +1 -1
  20. package/dist/components/ui/button.d.ts +11 -0
  21. package/dist/components/ui/button.js +11 -9
  22. package/dist/components/ui/calendar.d.ts +14 -2
  23. package/dist/components/ui/calendar.js +443 -376
  24. package/dist/components/ui/card.js +7 -6
  25. package/dist/components/ui/checkbox.js +64 -48
  26. package/dist/components/ui/chips.d.ts +1 -0
  27. package/dist/components/ui/chips.js +27 -19
  28. package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
  29. package/dist/components/ui/data-table/data-table-column-list.js +58 -54
  30. package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
  31. package/dist/components/ui/data-table/data-table-sheet.js +43 -40
  32. package/dist/components/ui/data-table/data-table-view-options.js +17 -17
  33. package/dist/components/ui/data-table/data-table.js +21 -20
  34. package/dist/components/ui/date-picker/date-picker.js +83 -87
  35. package/dist/components/ui/date-picker/date-range-picker.js +129 -125
  36. package/dist/components/ui/date-picker/month-picker.js +90 -93
  37. package/dist/components/ui/date-picker/month-range-picker.js +132 -129
  38. package/dist/components/ui/date-picker/multi-date-picker.js +37 -38
  39. package/dist/components/ui/date-picker/multi-month-picker.js +29 -30
  40. package/dist/components/ui/date-picker/multi-week-picker.js +49 -38
  41. package/dist/components/ui/date-picker/week-picker.js +116 -112
  42. package/dist/components/ui/date-picker/week-range-picker.js +153 -142
  43. package/dist/components/ui/dialog.js +15 -6
  44. package/dist/components/ui/drawer.js +16 -13
  45. package/dist/components/ui/dropdown-menu.js +4 -2
  46. package/dist/components/ui/dynamic-layout.d.ts +2 -2
  47. package/dist/components/ui/dynamic-layout.js +18 -15
  48. package/dist/components/ui/empty-container.js +69 -64
  49. package/dist/components/ui/file-upload.js +113 -106
  50. package/dist/components/ui/filter-panel/filter-panel.js +49 -46
  51. package/dist/components/ui/filter-strip/filter-strip.js +41 -37
  52. package/dist/components/ui/header.js +26 -25
  53. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
  54. package/dist/components/ui/hover-card.js +6 -5
  55. package/dist/components/ui/input.d.ts +1 -1
  56. package/dist/components/ui/input.js +79 -68
  57. package/dist/components/ui/loader.d.ts +1 -0
  58. package/dist/components/ui/loader.js +23 -13
  59. package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
  60. package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
  61. package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
  62. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
  63. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
  64. package/dist/components/ui/nested-list/nested-list.js +182 -189
  65. package/dist/components/ui/notification-panel/notification-item.js +19 -17
  66. package/dist/components/ui/notification-panel/notification-list.js +21 -21
  67. package/dist/components/ui/notification-panel/notification-panel.js +25 -25
  68. package/dist/components/ui/popover.js +37 -34
  69. package/dist/components/ui/progress.js +12 -10
  70. package/dist/components/ui/prompt.js +29 -27
  71. package/dist/components/ui/radio-group.js +55 -46
  72. package/dist/components/ui/select/components/Submenu.d.ts +1 -2
  73. package/dist/components/ui/select/components/Submenu.js +52 -48
  74. package/dist/components/ui/select/select.js +321 -324
  75. package/dist/components/ui/sheet.js +18 -15
  76. package/dist/components/ui/sidebar.d.ts +2 -2
  77. package/dist/components/ui/sidebar.js +3 -3
  78. package/dist/components/ui/skeleton.d.ts +2 -1
  79. package/dist/components/ui/skeleton.js +12 -11
  80. package/dist/components/ui/slider.js +39 -12
  81. package/dist/components/ui/smart-input.js +44 -39
  82. package/dist/components/ui/stepper.js +33 -29
  83. package/dist/components/ui/switch.js +6 -4
  84. package/dist/components/ui/tabs.js +50 -45
  85. package/dist/components/ui/tag-group.d.ts +2 -1
  86. package/dist/components/ui/tag-group.js +29 -25
  87. package/dist/components/ui/tag.d.ts +1 -0
  88. package/dist/components/ui/tag.js +26 -20
  89. package/dist/components/ui/textarea.js +18 -17
  90. package/dist/components/ui/toast.d.ts +1 -1
  91. package/dist/components/ui/toast.js +47 -41
  92. package/dist/components/ui/toaster.js +42 -42
  93. package/dist/components/ui/tooltip.js +18 -16
  94. package/dist/components/ui/types/date-picker.types.d.ts +33 -0
  95. package/dist/components/ui/types/empty-container.types.d.ts +5 -0
  96. package/dist/components/ui/types/nested-list.types.d.ts +1 -0
  97. package/dist/components/ui/types/select.types.d.ts +0 -1
  98. package/dist/icons/assets/bookmark.svg.js +4 -0
  99. package/dist/icons/assets/bookmark.svg2.js +5 -0
  100. package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
  101. package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
  102. package/dist/icons/assets/download.svg.js +4 -0
  103. package/dist/icons/assets/download.svg2.js +5 -0
  104. package/dist/icons/index.d.ts +20 -6
  105. package/dist/icons/index.js +398 -370
  106. package/dist/impact-nova.css +1 -1
  107. package/dist/index.d.ts +1 -0
  108. package/dist/index.js +318 -314
  109. package/dist/lib/fiscal-calendar.d.ts +62 -0
  110. package/dist/lib/fiscal-calendar.js +99 -0
  111. package/package.json +5 -5
  112. package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
  113. package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
  114. package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
  115. package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
@@ -1,169 +1,164 @@
1
- import { jsxs as h, jsx as a, Fragment as st } from "react/jsx-runtime";
2
- import { useState as U, useRef as $, useEffect as W } from "react";
3
- import { createPortal as it } from "react-dom";
4
- import { useVirtualizer as at } from "@tanstack/react-virtual";
5
- import rt from "./components/LabelWithSequence.js";
6
- import ot from "./components/Submenu.js";
7
- import { LoadingSpinner as ct, Cross as ut, ChevronRight as Ne, Info as ae, Search as dt } from "../../../icons/index.js";
8
- import { Checkbox as Oe } from "../checkbox.js";
9
- import { Button as ft } from "../button.js";
1
+ import { jsxs as p, jsx as a, Fragment as lt } from "react/jsx-runtime";
2
+ import { useState as W, useRef as M, useEffect as j } from "react";
3
+ import * as Y from "@radix-ui/react-popover";
4
+ import { useVirtualizer as nt } from "@tanstack/react-virtual";
5
+ import st from "./components/LabelWithSequence.js";
6
+ import it from "./components/Submenu.js";
7
+ import { LoadingSpinner as at, Cross as rt, ChevronRight as ye, Search as ot, Info as ne } from "../../../icons/index.js";
8
+ import { Checkbox as we } from "../checkbox.js";
9
+ import { Button as ct } from "../button.js";
10
10
  import { cn as C } from "../../../lib/utils.js";
11
- import { isInvertedSelection as P, isOptionArray as y, isSelected as mt, getSequence as pt, getLeafOptions as xt } from "./utils/select.js";
12
- import { useClickOutside as ht } from "./hooks/useClickOutside.js";
13
- import { useFlattenOptions as bt } from "./hooks/useFlattenOptions.js";
14
- import { useSelectionModel as gt } from "./hooks/useSelectionModel.js";
15
- import { useVisibleStats as vt } from "./hooks/useVisibleStats.js";
16
- import { useMenuPosition as St } from "./hooks/useMenuPosition.js";
17
- const yt = (re) => {
11
+ import { isInvertedSelection as k, isOptionArray as y, isSelected as ut, getSequence as dt, getLeafOptions as ft } from "./utils/select.js";
12
+ import { useFlattenOptions as mt } from "./hooks/useFlattenOptions.js";
13
+ import { useSelectionModel as pt } from "./hooks/useSelectionModel.js";
14
+ import { useVisibleStats as ht } from "./hooks/useVisibleStats.js";
15
+ const xt = (se) => {
18
16
  const {
19
- options: G,
20
- value: Y,
21
- defaultValue: Ce,
17
+ options: $,
18
+ value: J,
19
+ defaultValue: Ve,
22
20
  onChange: u,
23
21
  isMulti: f,
24
- isDisabled: k,
22
+ isDisabled: P,
25
23
  isLoading: A,
26
- isClearable: Pe = !0,
27
- isSearchable: T = !0,
28
- placeholder: ke = "Select...",
29
- menuPortalTarget: oe = typeof document < "u" ? document.body : null,
30
- autoFocus: Ae,
31
- closeMenuOnSelect: De = !f,
32
- defaultMenuIsOpen: $e = !1,
33
- scrollToSelectedOnOpen: ce = !1,
34
- maxSelectableOptions: p,
35
- showSequence: ue,
36
- selectionOrder: Ge,
37
- label: de,
38
- isRequired: Ie,
39
- error: Z,
40
- helperText: fe,
24
+ isClearable: Ne = !0,
25
+ isSearchable: E = !0,
26
+ placeholder: Oe = "Select...",
27
+ // menuPortalTarget is kept for API compatibility but no longer used (Radix handles portalling)
28
+ menuPortalTarget: bt,
29
+ autoFocus: Ce,
30
+ closeMenuOnSelect: Pe = !f,
31
+ defaultMenuIsOpen: ke = !1,
32
+ scrollToSelectedOnOpen: ie = !1,
33
+ maxSelectableOptions: h,
34
+ showSequence: ae,
35
+ selectionOrder: Ae,
36
+ label: re,
37
+ isRequired: De,
38
+ error: K,
39
+ helperText: oe,
41
40
  id: w,
42
- className: Me,
43
- parentClassName: ze,
44
- onMenuScrollToBottom: J,
45
- name: Te,
46
- isSelectAllEnabled: me = !0,
41
+ className: Te,
42
+ parentClassName: $e,
43
+ onMenuScrollToBottom: Q,
44
+ name: Ge,
45
+ isSelectAllEnabled: ce = !0,
47
46
  isReadOnly: b = !1,
48
47
  searchPosition: R = "menu",
49
- footerContent: pe,
50
- onInputChange: Re,
51
- getOptionLabel: xe,
52
- renderOption: he,
53
- onMenuOpen: Ee,
54
- onMenuClose: K,
55
- labelOrientation: be = "top",
56
- leftContent: ge,
57
- ignoreCase: Le,
58
- ignoreAccents: Fe,
59
- matchFrom: je,
60
- stringify: qe,
61
- trim: _e,
62
- filterOption: Be,
48
+ footerContent: ue,
49
+ onInputChange: ze,
50
+ getOptionLabel: de,
51
+ renderOption: fe,
52
+ onMenuOpen: Ie,
53
+ onMenuClose: me,
54
+ labelOrientation: pe = "top",
55
+ leftContent: he,
56
+ ignoreCase: Me,
57
+ ignoreAccents: Ee,
58
+ matchFrom: Re,
59
+ stringify: Fe,
60
+ trim: Le,
61
+ filterOption: je,
63
62
  enableSubMenus: v = !1,
64
63
  enableGroups: V = !1,
65
- fetchError: j,
66
- onRefetch: ve,
67
- dropdownZIndex: He = 20,
68
- menuWidth: Ue,
69
- onClearAll: Se,
70
- onFocus: We,
71
- onBlur: Ye
72
- } = re, [N, Q] = U($e), [E, q] = U(""), [d, g] = U(Ce || (f ? [] : null)), [Ze, X] = U(null), Je = $(null), ee = $(null), te = $(null), Ke = $(null), L = $(null), le = $(null);
73
- W(() => {
74
- Y !== void 0 && g(Y);
75
- }, [Y]), W(() => {
64
+ fetchError: q,
65
+ onRefetch: xe,
66
+ menuWidth: qe,
67
+ onClearAll: be,
68
+ onFocus: _e,
69
+ onBlur: Be
70
+ } = se, [N, ge] = W(ke), [F, _] = W(""), [d, g] = W(Ve || (f ? [] : null)), [He, X] = W(null), Ue = M(null), We = M(null), Ye = M(null), L = M(null), Z = M(null);
71
+ j(() => {
72
+ J !== void 0 && g(J);
73
+ }, [J]), j(() => {
76
74
  let e;
77
- return N && T && R === "menu" && le.current && (e = setTimeout(() => {
78
- le.current?.focus();
75
+ return N && E && R === "menu" && Z.current && (e = setTimeout(() => {
76
+ Z.current?.focus();
79
77
  }, 50)), () => {
80
78
  e && clearTimeout(e);
81
79
  };
82
- }, [N, T, R]);
83
- const { flatOptions: x, isProcessing: O, totalOptionsCount: ye, workerSelectAll: Qe } = bt(G, E, {
84
- ignoreCase: Le,
85
- ignoreAccents: Fe,
86
- matchFrom: je,
87
- stringify: qe,
88
- trim: _e,
89
- filterOption: Be,
80
+ }, [N, E, R]);
81
+ const { flatOptions: x, isProcessing: O, totalOptionsCount: ve, workerSelectAll: Je } = mt($, F, {
82
+ ignoreCase: Me,
83
+ ignoreAccents: Ee,
84
+ matchFrom: Re,
85
+ stringify: Fe,
86
+ trim: Le,
87
+ filterOption: je,
90
88
  enableSubMenus: v,
91
89
  enableGroups: V
92
- }), S = gt(d, f ?? !1), { stats: I, getGroupStats: ne } = vt(
90
+ }), S = pt(d, f ?? !1), { stats: G, getGroupStats: ee } = ht(
93
91
  x,
94
- ye,
95
- E,
92
+ ve,
93
+ F,
96
94
  S,
97
95
  d,
98
96
  f ?? !1
99
- ), F = at({
97
+ ), D = nt({
100
98
  count: x.length,
101
99
  getScrollElement: () => L.current,
102
100
  estimateSize: () => 40,
103
101
  overscan: 5
104
102
  });
105
- W(() => {
106
- if (N && ce && !O && x.length > 0) {
103
+ j(() => {
104
+ if (!N) return;
105
+ const e = requestAnimationFrame(() => {
106
+ D.measure();
107
+ });
108
+ return () => cancelAnimationFrame(e);
109
+ }, [N, D]), j(() => {
110
+ if (N && ie && !O && x.length > 0) {
107
111
  const e = x.findIndex((t) => f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value);
108
112
  if (e !== -1) {
109
113
  const t = setTimeout(() => {
110
- F.scrollToIndex(e, { align: "center" });
114
+ D.scrollToIndex(e, { align: "center" });
111
115
  }, 50);
112
116
  return () => clearTimeout(t);
113
117
  }
114
118
  }
115
- }, [N, ce, O, x.length, f, S.mode, S.set, d, F]);
116
- const M = $(null);
117
- W(() => {
118
- if (!L.current || !J) return;
119
+ }, [N, ie, O, x.length, f, S.mode, S.set, d, D]);
120
+ const z = M(null);
121
+ j(() => {
122
+ if (!L.current || !Q) return;
119
123
  const e = () => {
120
124
  if (A || O) return;
121
125
  const { scrollTop: n, scrollHeight: r, clientHeight: s } = L.current;
122
126
  if (r - n - s <= 10) {
123
- if (M.current) return;
124
- J(), M.current = setTimeout(() => {
125
- M.current = null;
127
+ if (z.current) return;
128
+ Q(), z.current = setTimeout(() => {
129
+ z.current = null;
126
130
  }, 500);
127
131
  }
128
132
  }, t = L.current;
129
133
  return t.addEventListener("scroll", e), !A && !O && e(), () => {
130
- t.removeEventListener("scroll", e), M.current && (clearTimeout(M.current), M.current = null);
134
+ t.removeEventListener("scroll", e), z.current && (clearTimeout(z.current), z.current = null);
131
135
  };
132
136
  }, [
133
- J,
137
+ Q,
134
138
  x.length,
135
139
  N,
136
140
  A,
137
141
  O
138
- ]), ht({
139
- isOpen: N,
140
- setIsOpen: Q,
141
- triggerRef: ee,
142
- menuRef: te,
143
- onMenuClose: K,
144
- internalValue: d,
145
- isMulti: f ?? !1,
146
- setSearchValue: q,
147
- setActiveSubmenu: X
148
- });
149
- const we = St(
150
- N,
151
- ee,
152
- te,
153
- x.length,
154
- O,
155
- He
156
- ), Ve = (e) => {
157
- if (!(k || b || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
142
+ ]);
143
+ const Ke = (e) => {
144
+ if (!P)
145
+ if (ge(e), e)
146
+ Ie?.();
147
+ else {
148
+ const t = d, n = f && y(d) ? d.map((r) => r.value) : void 0;
149
+ me?.(t, n), _(""), X(null);
150
+ }
151
+ }, Se = (e) => {
152
+ if (!(P || b || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
158
153
  if (f) {
159
154
  const n = d || [];
160
155
  if ("children" in e || "options" in e) {
161
- const s = xt(
156
+ const s = ft(
162
157
  e,
163
158
  v,
164
159
  V
165
160
  ).filter((l) => !l.isDisabled);
166
- if (P(n)) {
161
+ if (k(n)) {
167
162
  const l = n.excludedValues, i = s.every(
168
163
  (m) => !l.includes(m.value)
169
164
  );
@@ -171,7 +166,7 @@ const yt = (re) => {
171
166
  i ? s.forEach((m) => {
172
167
  c.includes(m.value) || c.push(m.value);
173
168
  }) : c = c.filter(
174
- (m) => !s.some((B) => B.value === m)
169
+ (m) => !s.some((H) => H.value === m)
175
170
  );
176
171
  const o = {
177
172
  isAllSelected: !0,
@@ -190,14 +185,14 @@ const yt = (re) => {
190
185
  (o) => !s.some((m) => m.value === o.value)
191
186
  ) : s.forEach((o) => {
192
187
  c.some((m) => m.value === o.value) || c.push(o);
193
- }), p && c.length > p)
188
+ }), h && c.length > h)
194
189
  return;
195
190
  g(c), u && u(c, {
196
191
  action: "select-option",
197
192
  option: e
198
193
  });
199
194
  }
200
- } else if (P(n)) {
195
+ } else if (k(n)) {
201
196
  const r = n.excludedValues, s = r.includes(e.value);
202
197
  let l = [...r];
203
198
  s ? l = l.filter((c) => c !== e.value) : l.push(e.value);
@@ -215,7 +210,7 @@ const yt = (re) => {
215
210
  if (s)
216
211
  l = r.filter((i) => i.value !== e.value);
217
212
  else {
218
- if (p && n.length >= p)
213
+ if (h && n.length >= h)
219
214
  return;
220
215
  l = [...r, e];
221
216
  }
@@ -228,22 +223,22 @@ const yt = (re) => {
228
223
  g(e), u && u(e, {
229
224
  action: "select-option",
230
225
  option: e
231
- }), De && (Q(!1), K?.(e, void 0), q(""));
232
- }, Xe = async () => {
233
- if (!(!f || k || b)) {
234
- if (G.length > 3e3) {
226
+ }), Pe && (ge(!1), me?.(e, void 0), _(""));
227
+ }, Qe = async () => {
228
+ if (!(!f || P || b)) {
229
+ if ($.length > 3e3) {
235
230
  try {
236
- const e = await Qe(
231
+ const e = await Je(
237
232
  d,
238
- P(d),
239
- p
233
+ k(d),
234
+ h
240
235
  );
241
236
  g(e), u && u(e, { action: "select-option" });
242
237
  } catch {
243
238
  }
244
239
  return;
245
240
  }
246
- if (E) {
241
+ if (F) {
247
242
  let e = !1;
248
243
  for (const n of x)
249
244
  if (!n.isGroup && !n.isSubmenuParent && !n.isDisabled) {
@@ -253,8 +248,8 @@ const yt = (re) => {
253
248
  if (!e)
254
249
  return;
255
250
  const t = d || [];
256
- if (P(t)) {
257
- const n = t.excludedValues, { totalVisible: r, selectedVisible: s } = I, l = r > 0 && r === s;
251
+ if (k(t)) {
252
+ const n = t.excludedValues, { totalVisible: r, selectedVisible: s } = G, l = r > 0 && r === s;
258
253
  let i = [...n];
259
254
  if (l)
260
255
  for (const o of x)
@@ -271,7 +266,7 @@ const yt = (re) => {
271
266
  };
272
267
  g(c), u && u(c, { action: "select-option" });
273
268
  } else if (y(t)) {
274
- const n = t, { totalVisible: r, selectedVisible: s } = I, l = r > 0 && r === s;
269
+ const n = t, { totalVisible: r, selectedVisible: s } = G, l = r > 0 && r === s;
275
270
  let i = [...n];
276
271
  if (l) {
277
272
  const c = /* @__PURE__ */ new Set();
@@ -283,12 +278,12 @@ const yt = (re) => {
283
278
  for (const o of x)
284
279
  !o.isGroup && !o.isSubmenuParent && !o.isDisabled && (c.has(o.value) || (i.push(o), c.add(o.value)));
285
280
  }
286
- if (p && i.length > p)
281
+ if (h && i.length > h)
287
282
  return;
288
283
  g(i), u && u(i, { action: "select-option" });
289
284
  }
290
- } else if (p) {
291
- const e = d, { totalVisible: t } = I, n = y(e) ? e.length : 0, r = Math.min(t, p);
285
+ } else if (h) {
286
+ const e = d, { totalVisible: t } = G, n = y(e) ? e.length : 0, r = Math.min(t, h);
292
287
  if (y(e) && n >= r && n > 0) {
293
288
  const s = e.filter((l) => l.isDisabled);
294
289
  g(s), u && u(s, {
@@ -300,15 +295,15 @@ const yt = (re) => {
300
295
  );
301
296
  let l = s.length;
302
297
  for (const i of x)
303
- if (!i.isGroup && !i.isSubmenuParent && !i.isDisabled && (s.push(i), l++, l >= p))
298
+ if (!i.isGroup && !i.isSubmenuParent && !i.isDisabled && (s.push(i), l++, l >= h))
304
299
  break;
305
300
  g(s), u && u(s, {
306
301
  action: "select-option"
307
302
  });
308
303
  }
309
304
  } else {
310
- const e = d, t = P(e) && e.excludedValues.length === 0;
311
- if (re.enableInvertedSelection)
305
+ const e = d, t = k(e) && e.excludedValues.length === 0;
306
+ if (se.enableInvertedSelection)
312
307
  if (t) {
313
308
  const n = y(e) ? e.filter((r) => r.isDisabled) : [];
314
309
  g(n), u && u(n, {
@@ -324,7 +319,7 @@ const yt = (re) => {
324
319
  g(r), u && u(r, { action: "select-option" });
325
320
  }
326
321
  else {
327
- const { totalVisible: n, selectedVisible: r } = I;
322
+ const { totalVisible: n, selectedVisible: r } = G;
328
323
  if (n > 0 && n === r) {
329
324
  const s = y(e) ? e.filter((l) => l.isDisabled) : [];
330
325
  g(s), u && u(s, {
@@ -341,7 +336,7 @@ const yt = (re) => {
341
336
  }
342
337
  }
343
338
  }
344
- }, et = (e) => {
339
+ }, Xe = (e) => {
345
340
  if (e.stopPropagation(), !b)
346
341
  if (f) {
347
342
  const t = [], n = (s) => {
@@ -360,9 +355,9 @@ const yt = (re) => {
360
355
  i.isDisabled && (S.mode === "exclude" ? !S.set.has(i.value) : S.set.has(i.value)) && t.push(i);
361
356
  }
362
357
  };
363
- n(G);
358
+ n($);
364
359
  const r = t;
365
- g(r), u && u(r, { action: "clear" }), Se?.();
360
+ g(r), u && u(r, { action: "clear" }), be?.();
366
361
  } else {
367
362
  const t = d;
368
363
  if (t) {
@@ -389,195 +384,185 @@ const yt = (re) => {
389
384
  }
390
385
  }
391
386
  };
392
- if (s(G), r?.isDisabled)
387
+ if (s($), r?.isDisabled)
393
388
  return;
394
389
  }
395
390
  const n = null;
396
- g(n), u && u(n, { action: "clear" }), Se?.();
391
+ g(n), u && u(n, { action: "clear" }), be?.();
397
392
  }
398
- }, tt = (e) => pt(
393
+ }, Ze = (e) => dt(
399
394
  e,
400
- ue ?? !1,
395
+ ae ?? !1,
401
396
  f ?? !1,
402
- Ge,
397
+ Ae,
403
398
  d
404
- ), _ = (e) => xe ? xe(e) : e.label, lt = () => {
399
+ ), B = (e) => de ? de(e) : e.label, et = () => {
405
400
  if (f) {
406
401
  const e = d || [];
407
402
  let t = 0;
408
- return P(e) ? t = ye - e.excludedValues.length : y(e) && (t = e.length), t === 0 ? null : t === 1 && y(e) ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: _(e[0]) }) : /* @__PURE__ */ h("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: [
403
+ return k(e) ? t = ve - e.excludedValues.length : y(e) && (t = e.length), t === 0 ? null : t === 1 && y(e) ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: B(e[0]) }) : /* @__PURE__ */ p("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: [
409
404
  "Selected (",
410
405
  t,
411
406
  ")"
412
407
  ] });
413
408
  } else {
414
409
  const e = d;
415
- return e ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: _(e) }) : null;
410
+ return e ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: B(e) }) : null;
416
411
  }
417
412
  };
418
- return /* @__PURE__ */ h(
413
+ return /* @__PURE__ */ p(
419
414
  "div",
420
415
  {
421
416
  className: C(
422
417
  "flex gap-[6px]",
423
- be === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
424
- ze
418
+ pe === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
419
+ $e
425
420
  ),
426
- ref: Je,
427
- onFocus: We,
428
- onBlur: Ye,
429
- tabIndex: k ? -1 : 0,
421
+ onFocus: _e,
422
+ onBlur: Be,
423
+ tabIndex: P ? -1 : 0,
430
424
  "data-testid": `select-${w || "default"}`,
425
+ "data-component": "select",
431
426
  children: [
432
- de && /* @__PURE__ */ h(
427
+ re && /* @__PURE__ */ p(
433
428
  "label",
434
429
  {
435
430
  className: C(
436
431
  "text-[12px] font-medium text-[#60697d] leading-[18px]",
437
- be === "left" ? "shrink-0" : ""
432
+ pe === "left" ? "shrink-0" : ""
438
433
  ),
439
434
  children: [
440
- de,
435
+ re,
441
436
  " ",
442
- Ie && /* @__PURE__ */ a("span", { className: "text-[red]", children: "*" })
437
+ De && /* @__PURE__ */ a("span", { className: "text-[red]", children: "*" })
443
438
  ]
444
439
  }
445
440
  ),
446
- /* @__PURE__ */ a(
447
- "div",
448
- {
449
- ref: ee,
450
- className: C(
451
- "relative h-[32px] w-full cursor-pointer rounded-[8px] border border-solid px-3 py-1 text-left shadow-sm focus:outline-none sm:text-sm transition-all flex items-center overflow-hidden",
452
- Z ? "border-[#e15554] focus:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500",
453
- k ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
454
- b ? "cursor-default bg-[#f2f4fb]" : "",
455
- N ? "ring-1 ring-indigo-500 border-indigo-500" : "",
456
- !k && !b && "bg-white",
457
- Me
458
- ),
459
- onClick: () => {
460
- if (!k) {
461
- const e = !N;
462
- if (Q(e), e)
463
- Ee?.();
464
- else {
465
- const t = d, n = f && y(d) ? d.map((r) => r.value) : void 0;
466
- K?.(t, n);
467
- }
468
- }
469
- },
470
- id: w,
471
- children: /* @__PURE__ */ h("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
472
- ge && /* @__PURE__ */ a("div", { className: "flex items-center text-gray-500 shrink-0", children: ge }),
473
- /* @__PURE__ */ h(
474
- "div",
475
- {
476
- className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
477
- "data-testid": `select-value-${w || "default"}`,
478
- children: [
479
- lt() || /* @__PURE__ */ a(
480
- "span",
481
- {
482
- className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
483
- "data-testid": `select-placeholder-${w || "default"}`,
484
- "data-has-value": !1,
485
- children: ke
486
- }
487
- ),
488
- T && N && R === "trigger" && !b && /* @__PURE__ */ a(
489
- "input",
490
- {
491
- ref: Ke,
492
- type: "text",
493
- className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
494
- value: E,
495
- onChange: (e) => q(e.target.value),
496
- onClick: (e) => e.stopPropagation(),
497
- autoFocus: Ae,
498
- name: Te || void 0
499
- }
500
- )
501
- ]
502
- }
441
+ /* @__PURE__ */ p(Y.Root, { open: N, onOpenChange: Ke, children: [
442
+ /* @__PURE__ */ a(Y.Trigger, { asChild: !0, children: /* @__PURE__ */ a(
443
+ "div",
444
+ {
445
+ ref: Ue,
446
+ className: C(
447
+ "relative h-[32px] w-full cursor-pointer rounded-[8px] border border-solid px-3 py-1 text-left shadow-sm focus:outline-none sm:text-sm transition-all flex items-center overflow-hidden",
448
+ K ? "border-[#e15554] focus:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500",
449
+ P ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
450
+ b ? "cursor-default bg-[#f2f4fb]" : "",
451
+ N ? "ring-1 ring-indigo-500 border-indigo-500" : "",
452
+ !P && !b && "bg-white",
453
+ Te
503
454
  ),
504
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !N && (A || O) ? /* @__PURE__ */ a(ct, { size: "14px" }) : /* @__PURE__ */ h(st, { children: [
505
- Pe && !b && (f && (P(
506
- d
507
- ) && d.isAllSelected || y(d) && d.length > 0) || !f && d) && /* @__PURE__ */ a(
455
+ id: w,
456
+ "data-component": "select-trigger",
457
+ "data-disabled": P || void 0,
458
+ "data-state": N ? "open" : "closed",
459
+ children: /* @__PURE__ */ p("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
460
+ he && /* @__PURE__ */ a("div", { className: "flex items-center text-gray-500 shrink-0", children: he }),
461
+ /* @__PURE__ */ p(
508
462
  "div",
509
463
  {
510
- role: "button",
511
- onClick: et,
512
- className: "hover:text-gray-600 p-0.5",
513
- children: /* @__PURE__ */ a(ut, { size: "11px", color: "#758490" })
464
+ className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
465
+ "data-testid": `select-value-${w || "default"}`,
466
+ children: [
467
+ et() || /* @__PURE__ */ a(
468
+ "span",
469
+ {
470
+ className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
471
+ "data-testid": `select-placeholder-${w || "default"}`,
472
+ "data-has-value": !1,
473
+ children: Oe
474
+ }
475
+ ),
476
+ E && N && R === "trigger" && !b && /* @__PURE__ */ a(
477
+ "input",
478
+ {
479
+ ref: Ye,
480
+ type: "text",
481
+ className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
482
+ value: F,
483
+ onChange: (e) => _(e.target.value),
484
+ onClick: (e) => e.stopPropagation(),
485
+ autoFocus: Ce,
486
+ name: Ge || void 0
487
+ }
488
+ )
489
+ ]
514
490
  }
515
491
  ),
516
- /* @__PURE__ */ a(
517
- Ne,
518
- {
519
- size: "16px",
520
- className: C(
521
- "transition-transform duration-200",
522
- N ? "-rotate-90" : "rotate-90"
523
- )
524
- }
525
- )
526
- ] }) })
527
- ] })
528
- }
529
- ),
530
- fe && /* @__PURE__ */ h(
531
- "p",
532
- {
533
- className: C(
534
- "text-[12px] mt-1 flex items-center gap-1",
535
- Z ? "text-[#e15554]" : "text-gray-500"
536
- ),
537
- children: [
538
- Z && /* @__PURE__ */ a(ae, { size: "12px" }),
539
- fe
540
- ]
541
- }
542
- ),
543
- N && oe && it(
544
- /* @__PURE__ */ h(
545
- "div",
492
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !N && (A || O) ? /* @__PURE__ */ a(at, { size: "14px" }) : /* @__PURE__ */ p(lt, { children: [
493
+ Ne && !b && (f && (k(
494
+ d
495
+ ) && d.isAllSelected || y(d) && d.length > 0) || !f && d) && /* @__PURE__ */ a(
496
+ "div",
497
+ {
498
+ role: "button",
499
+ onClick: Xe,
500
+ className: "hover:text-gray-600 p-0.5",
501
+ children: /* @__PURE__ */ a(rt, { size: "11px", color: "#758490" })
502
+ }
503
+ ),
504
+ /* @__PURE__ */ a(
505
+ ye,
506
+ {
507
+ size: "16px",
508
+ className: C(
509
+ "transition-transform duration-200",
510
+ N ? "-rotate-90" : "rotate-90"
511
+ )
512
+ }
513
+ )
514
+ ] }) })
515
+ ] })
516
+ }
517
+ ) }),
518
+ /* @__PURE__ */ a(Y.Portal, { children: /* @__PURE__ */ p(
519
+ Y.Content,
546
520
  {
547
- ref: te,
548
- style: { ...we, width: Ue || we.width },
521
+ ref: We,
522
+ side: "bottom",
523
+ sideOffset: 4,
524
+ align: "start",
525
+ avoidCollisions: !0,
526
+ collisionPadding: 8,
527
+ onOpenAutoFocus: (e) => e.preventDefault(),
528
+ onInteractOutside: () => {
529
+ },
530
+ style: {
531
+ width: qe || "var(--radix-popover-trigger-width)"
532
+ },
549
533
  className: C(
550
- "absolute z-20 mt-[2px] max-h-80 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",
534
+ "z-50 max-h-80 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",
551
535
  b ? "bg-[#f5f5f5]" : "bg-white"
552
536
  ),
553
537
  "data-testid": `select-menu-${w || "default"}`,
538
+ "data-component": "select-menu",
554
539
  children: [
555
- /* @__PURE__ */ h(
540
+ /* @__PURE__ */ p(
556
541
  "div",
557
542
  {
558
543
  className: C(
559
544
  "flex flex-col z-10 sticky top-0 px-[6px] pt-[8px]",
560
545
  b ? "bg-[#f5f5f5]" : "bg-white",
561
- !j && (T && R === "menu" && !b || f && me && !b && x.length > 0) ? "border-b border-solid border-gray-100" : ""
546
+ !q && (E && R === "menu" && !b || f && ce && !b && x.length > 0) ? "border-b border-solid border-gray-100" : ""
562
547
  ),
563
548
  children: [
564
- T && R === "menu" && !b && !j && /* @__PURE__ */ a(
549
+ E && R === "menu" && !b && !q && /* @__PURE__ */ a(
565
550
  "div",
566
551
  {
567
552
  className: "p-0",
568
553
  "data-testid": `select-search-container-${w || "default"}`,
569
- children: /* @__PURE__ */ h("div", { className: "relative", children: [
570
- /* @__PURE__ */ a("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ a(dt, { size: "14px", color: "#AFAFAF" }) }),
554
+ children: /* @__PURE__ */ p("div", { className: "relative", children: [
555
+ /* @__PURE__ */ a("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ a(ot, { size: "14px", color: "#AFAFAF" }) }),
571
556
  /* @__PURE__ */ a(
572
557
  "input",
573
558
  {
574
- ref: le,
559
+ ref: Z,
575
560
  type: "text",
576
561
  className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus:ring-0",
577
562
  placeholder: "Search here...",
578
- value: E,
563
+ value: F,
579
564
  onChange: (e) => {
580
- q(e.target.value), Re?.(e.target.value);
565
+ _(e.target.value), ze?.(e.target.value);
581
566
  },
582
567
  onClick: (e) => e.stopPropagation(),
583
568
  "data-testid": `select-search-input-${w || "default"}`
@@ -586,7 +571,7 @@ const yt = (re) => {
586
571
  ] })
587
572
  }
588
573
  ),
589
- !A && !O && !j && f && me && !b && x.length > 0 && /* @__PURE__ */ a(
574
+ !A && !O && !q && f && ce && !b && x.length > 0 && /* @__PURE__ */ a(
590
575
  "div",
591
576
  {
592
577
  className: "pb-1",
@@ -595,19 +580,19 @@ const yt = (re) => {
595
580
  "div",
596
581
  {
597
582
  className: "flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
598
- onClick: Xe,
583
+ onClick: Qe,
599
584
  "data-testid": `select-select-all-button-${w || "default"}`,
600
- children: /* @__PURE__ */ h("div", { className: "flex items-center flex-1", children: [
585
+ children: /* @__PURE__ */ p("div", { className: "flex items-center flex-1", children: [
601
586
  /* @__PURE__ */ a("div", { className: "pointer-events-none flex", children: /* @__PURE__ */ a(
602
- Oe,
587
+ we,
603
588
  {
604
589
  checked: (() => {
605
- const { totalVisible: e, selectedVisible: t } = I;
590
+ const { totalVisible: e, selectedVisible: t } = G;
606
591
  if (e === 0) return !1;
607
- const n = p ? Math.min(e, p) : e;
592
+ const n = h ? Math.min(e, h) : e;
608
593
  return t > 0 && t < n ? "indeterminate" : t >= n;
609
594
  })(),
610
- disabled: k || b,
595
+ disabled: P || b,
611
596
  onChange: () => {
612
597
  },
613
598
  "data-testid": `select-select-all-checkbox-${w || "default"}`
@@ -619,7 +604,7 @@ const yt = (re) => {
619
604
  className: "text-sm font-medium text-gray-700",
620
605
  "data-testid": `select-select-all-label-${w || "default"}`,
621
606
  children: (() => {
622
- const { totalVisible: e, selectedVisible: t } = I, n = p ? Math.min(e, p) : e;
607
+ const { totalVisible: e, selectedVisible: t } = G, n = h ? Math.min(e, h) : e;
623
608
  return e > 0 && t >= n ? "Unselect All" : "Select All";
624
609
  })()
625
610
  }
@@ -638,18 +623,18 @@ const yt = (re) => {
638
623
  ref: L,
639
624
  className: "flex-1 overflow-auto py-1 px-[6px]",
640
625
  style: { maxHeight: "300px" },
641
- children: j ? /* @__PURE__ */ h("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
626
+ children: q ? /* @__PURE__ */ p("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
642
627
  /* @__PURE__ */ a("p", { className: "text-sm text-gray-500 font-medium mb-3", children: "Something went wrong" }),
643
- ve && /* @__PURE__ */ a(
644
- ft,
628
+ xe && /* @__PURE__ */ a(
629
+ ct,
645
630
  {
646
631
  size: "sm",
647
632
  variant: "outline",
648
- onClick: () => ve(),
633
+ onClick: () => xe(),
649
634
  children: "Refetch"
650
635
  }
651
636
  )
652
- ] }) : x.length === 0 && !A && !O ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : A || O ? /* @__PURE__ */ a("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ h(
637
+ ] }) : x.length === 0 && !A && !O ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : A || O ? /* @__PURE__ */ a("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ p(
653
638
  "div",
654
639
  {
655
640
  className: "flex items-center gap-2 px-3 py-2 animate-pulse",
@@ -663,25 +648,25 @@ const yt = (re) => {
663
648
  "div",
664
649
  {
665
650
  style: {
666
- height: `${F.getTotalSize()}px`,
651
+ height: `${D.getTotalSize()}px`,
667
652
  width: "100%",
668
653
  position: "relative"
669
654
  },
670
- children: F.getVirtualItems().map((e) => {
671
- const t = x[e.index], n = f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value, r = d || [], s = f && p ? P(r) ? !1 : y(r) && r.length >= p : !1, l = t.isDisabled || s && !n && !(V && t.isGroup) && !(v && t.isSubmenuParent), i = V && t.isGroup || v && t.isSubmenuParent ? ne(t.original) : void 0, c = i?.selected || 0, o = i?.total || 0, m = c > 0 && c < o, B = t.isParentSelectable !== !1, se = w || "default", H = String(t.value || ""), ie = _(
655
+ children: D.getVirtualItems().map((e) => {
656
+ const t = x[e.index], n = f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value, r = d || [], s = f && h ? k(r) ? !1 : y(r) && r.length >= h : !1, l = t.isDisabled || s && !n && !(V && t.isGroup) && !(v && t.isSubmenuParent), i = V && t.isGroup || v && t.isSubmenuParent ? ee(t.original) : void 0, c = i?.selected || 0, o = i?.total || 0, m = c > 0 && c < o, H = t.isParentSelectable !== !1, te = w || "default", U = String(t.value || ""), le = B(
672
657
  t
673
- ), nt = typeof ie == "string" ? ie : H;
674
- return /* @__PURE__ */ h(
658
+ ), tt = typeof le == "string" ? le : U;
659
+ return /* @__PURE__ */ p(
675
660
  "div",
676
661
  {
677
662
  "data-index": e.index,
678
- ref: F.measureElement,
663
+ ref: D.measureElement,
679
664
  className: "absolute left-0 w-full pb-[2px]",
680
665
  style: {
681
666
  transform: `translateY(${e.start}px)`,
682
667
  width: "100%"
683
668
  },
684
- "data-testid": `select-option-wrapper-${se}-${H}`,
669
+ "data-testid": `select-option-wrapper-${te}-${U}`,
685
670
  children: [
686
671
  /* @__PURE__ */ a(
687
672
  "div",
@@ -695,20 +680,21 @@ const yt = (re) => {
695
680
  paddingLeft: `${t.depth * 16 + 12}px`
696
681
  },
697
682
  onClick: () => {
698
- l || (V && t.isGroup || v && t.isSubmenuParent) && !B || Ve(t);
683
+ l || (V && t.isGroup || v && t.isSubmenuParent) && !H || Se(t);
699
684
  },
700
- onMouseEnter: (D) => {
685
+ onMouseEnter: (T) => {
701
686
  if (v && t.isSubmenuParent) {
702
687
  X(t.value);
703
- const z = D.currentTarget.getBoundingClientRect();
704
- t.rect = z;
688
+ const I = T.currentTarget.getBoundingClientRect();
689
+ t.rect = I;
705
690
  } else
706
691
  X(null);
707
692
  },
708
- "data-testid": `select-option-${se}-${H}`,
709
- "data-selected": n,
710
- "data-disabled": l,
711
- children: he ? he(
693
+ "data-testid": `select-option-${te}-${U}`,
694
+ "data-state": n ? "checked" : "unchecked",
695
+ "data-disabled": l || void 0,
696
+ "data-component": "select-option",
697
+ children: fe ? fe(
712
698
  {
713
699
  onClick: () => {
714
700
  },
@@ -717,9 +703,9 @@ const yt = (re) => {
717
703
  disabled: l
718
704
  },
719
705
  t
720
- ) : /* @__PURE__ */ h("div", { className: "flex items-center flex-1 overflow-hidden pointer-events-none", children: [
721
- f && (V && t.isGroup || v && t.isSubmenuParent ? B : !0) && /* @__PURE__ */ a(
722
- Oe,
706
+ ) : /* @__PURE__ */ p("div", { className: "flex items-center flex-1 overflow-hidden", children: [
707
+ f && (V && t.isGroup || v && t.isSubmenuParent ? H : !0) && /* @__PURE__ */ a(
708
+ we,
723
709
  {
724
710
  checked: m ? "indeterminate" : n,
725
711
  disabled: l || b,
@@ -727,15 +713,15 @@ const yt = (re) => {
727
713
  }
728
714
  }
729
715
  ),
730
- ue && !(V && t.isGroup) && !(v && t.isSubmenuParent) ? /* @__PURE__ */ a(
731
- rt,
716
+ ae && !(V && t.isGroup) && !(v && t.isSubmenuParent) ? /* @__PURE__ */ a(
717
+ st,
732
718
  {
733
- label: _(
719
+ label: B(
734
720
  t
735
721
  ),
736
- sequence: tt(t)
722
+ sequence: Ze(t)
737
723
  }
738
- ) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
724
+ ) : /* @__PURE__ */ p("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
739
725
  /* @__PURE__ */ a(
740
726
  "span",
741
727
  {
@@ -744,16 +730,16 @@ const yt = (re) => {
744
730
  V && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : n && !(v && t.isSubmenuParent) ? "font-medium" : "font-normal",
745
731
  !(V && t.isGroup) && "text-[14px]"
746
732
  ),
747
- "data-testid": `select-option-label-${se}-${H}`,
748
- "data-selected": n,
749
- title: nt,
750
- children: ie
733
+ "data-testid": `select-option-label-${te}-${U}`,
734
+ "data-state": n ? "checked" : "unchecked",
735
+ title: tt,
736
+ children: le
751
737
  }
752
738
  ),
753
739
  (V && t.isGroup || v && 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 })
754
740
  ] }),
755
741
  v && t.isSubmenuParent && /* @__PURE__ */ a(
756
- Ne,
742
+ ye,
757
743
  {
758
744
  size: "12px",
759
745
  className: "text-gray-400"
@@ -762,20 +748,19 @@ const yt = (re) => {
762
748
  ] })
763
749
  }
764
750
  ),
765
- v && Ze === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ a(
766
- ot,
751
+ v && He === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ a(
752
+ it,
767
753
  {
768
754
  parentOption: t,
769
- parentRect: t.rect,
770
755
  isMulti: !!f,
771
756
  isReadOnly: !!b,
772
- isSelected: (D) => mt(D, d, !!f),
773
- getIndeterminateState: (D) => {
774
- const z = ne(D);
775
- return z ? z.selected > 0 && z.selected < z.total : !1;
757
+ isSelected: (T) => ut(T, d, !!f),
758
+ getIndeterminateState: (T) => {
759
+ const I = ee(T);
760
+ return I ? I.selected > 0 && I.selected < I.total : !1;
776
761
  },
777
- getSelectedCount: (D) => ne(D)?.selected || 0,
778
- handleSelect: Ve,
762
+ getSelectedCount: (T) => ee(T)?.selected || 0,
763
+ handleSelect: Se,
779
764
  id: w
780
765
  }
781
766
  )
@@ -788,27 +773,39 @@ const yt = (re) => {
788
773
  )
789
774
  }
790
775
  ),
791
- (pe || p || G.length > 5e3) && /* @__PURE__ */ a("div", { className: "px-3 py-[10px] border-t border-solid border-gray-100 z-10 sticky bottom-0 bg-white", children: p ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
792
- /* @__PURE__ */ a(ae, { size: "12px", className: "text-gray-400" }),
793
- /* @__PURE__ */ h("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
776
+ (ue || h || $.length > 5e3) && /* @__PURE__ */ a("div", { className: "px-3 py-[10px] border-t border-solid border-gray-100 z-10 sticky bottom-0 bg-white", children: h ? /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
777
+ /* @__PURE__ */ a(ne, { size: "12px", className: "text-gray-400" }),
778
+ /* @__PURE__ */ p("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
794
779
  "Maximum ",
795
- p,
780
+ h,
796
781
  " selections"
797
782
  ] })
798
- ] }) : G.length > 5e3 ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
799
- /* @__PURE__ */ a(ae, { size: "12px", className: "text-gray-400" }),
783
+ ] }) : $.length > 5e3 ? /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
784
+ /* @__PURE__ */ a(ne, { size: "12px", className: "text-gray-400" }),
800
785
  /* @__PURE__ */ a("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: "Large dataset detected. Operations might be slower." })
801
- ] }) : pe })
786
+ ] }) : ue })
802
787
  ]
803
788
  }
804
- ),
805
- oe
789
+ ) })
790
+ ] }),
791
+ oe && /* @__PURE__ */ p(
792
+ "p",
793
+ {
794
+ className: C(
795
+ "text-[12px] mt-1 flex items-center gap-1",
796
+ K ? "text-[#e15554]" : "text-gray-500"
797
+ ),
798
+ children: [
799
+ K && /* @__PURE__ */ a(ne, { size: "12px" }),
800
+ oe
801
+ ]
802
+ }
806
803
  )
807
804
  ]
808
805
  }
809
806
  );
810
807
  };
811
- yt.displayName = "Select";
808
+ xt.displayName = "Select";
812
809
  export {
813
- yt as default
810
+ xt as default
814
811
  };