impact-nova 1.7.5 → 1.7.6

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 (35) hide show
  1. package/dist/components/ui/ag-grid-react/headers/components/truncated-text.d.ts +15 -0
  2. package/dist/components/ui/ag-grid-react/headers/components/truncated-text.js +27 -0
  3. package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +22 -15
  4. package/dist/components/ui/ag-grid-react/headers/custom-header.js +47 -43
  5. package/dist/components/ui/breadcrumb.js +1 -1
  6. package/dist/components/ui/button-group.d.ts +3 -0
  7. package/dist/components/ui/button-group.js +129 -78
  8. package/dist/components/ui/checkbox.d.ts +3 -0
  9. package/dist/components/ui/checkbox.js +64 -53
  10. package/dist/components/ui/date-picker/date-range-picker.js +239 -196
  11. package/dist/components/ui/date-picker/month-range-picker.js +226 -183
  12. package/dist/components/ui/date-picker/week-range-picker.js +265 -222
  13. package/dist/components/ui/dialog.js +6 -6
  14. package/dist/components/ui/filter-panel/filter-panel.js +15 -8
  15. package/dist/components/ui/filter-strip/filter-strip.js +8 -9
  16. package/dist/components/ui/input.d.ts +3 -0
  17. package/dist/components/ui/input.js +107 -43
  18. package/dist/components/ui/notification-panel/notification-panel.d.ts +4 -4
  19. package/dist/components/ui/notification-panel/notification-panel.js +78 -16
  20. package/dist/components/ui/radio-group.d.ts +3 -0
  21. package/dist/components/ui/radio-group.js +101 -52
  22. package/dist/components/ui/select/select.js +579 -554
  23. package/dist/components/ui/textarea.d.ts +3 -0
  24. package/dist/components/ui/textarea.js +104 -58
  25. package/dist/components/ui/types/helper-text.types.d.ts +5 -0
  26. package/dist/components/ui/types/select.types.d.ts +6 -0
  27. package/dist/icons/assets/createNewDocument.svg.js +2 -2
  28. package/dist/icons/assets/drawBrush.svg.js +5 -0
  29. package/dist/icons/assets/info-badge.svg.js +5 -0
  30. package/dist/icons/assets/priority-alert.svg.js +5 -0
  31. package/dist/icons/assets/webp/sales.webp.js +4 -0
  32. package/dist/icons/index.d.ts +4 -0
  33. package/dist/icons/index.js +253 -245
  34. package/dist/impact-nova.css +1 -1
  35. package/package.json +1 -1
@@ -1,77 +1,78 @@
1
- import { jsxs as g, jsx as a, Fragment as pt } from "react/jsx-runtime";
2
- import { useState as K, useRef as z, useEffect as L } from "react";
3
- import * as ne from "@radix-ui/react-popover";
4
- import { useVirtualizer as mt } from "@tanstack/react-virtual";
5
- import ht from "./components/LabelWithSequence.js";
6
- import xt from "./components/Submenu.js";
7
- import { LoadingSpinner as gt, Cross as bt, ChevronRight as $e, Search as vt, Info as xe } from "../../../icons/index.js";
1
+ import { jsxs as x, jsx as r, Fragment as pt } from "react/jsx-runtime";
2
+ import { useState as K, useRef as M, useEffect as L } from "react";
3
+ import * as se from "@radix-ui/react-popover";
4
+ import { useVirtualizer as ht } from "@tanstack/react-virtual";
5
+ import xt from "./components/LabelWithSequence.js";
6
+ import gt from "./components/Submenu.js";
7
+ import { LoadingSpinner as bt, Cross as vt, ChevronRight as ze, Search as yt, Info as ie } from "../../../icons/index.js";
8
8
  import { Checkbox as Ge } from "../checkbox.js";
9
- import { Button as yt } from "../button.js";
10
- import { cn as A } from "../../../lib/utils.js";
11
- import { isInvertedSelection as T, isOptionArray as w, isSelected as St, getSequence as wt, getLeafOptions as Vt } from "./utils/select.js";
12
- import { useFlattenOptions as Nt } from "./hooks/useFlattenOptions.js";
13
- import { useSelectionModel as kt } from "./hooks/useSelectionModel.js";
9
+ import { Button as St } from "../button.js";
10
+ import { cn as w } from "../../../lib/utils.js";
11
+ import { isInvertedSelection as T, isOptionArray as V, isSelected as wt, getSequence as Vt, getLeafOptions as Nt } from "./utils/select.js";
12
+ import { useFlattenOptions as kt } from "./hooks/useFlattenOptions.js";
13
+ import { useSelectionModel as Pt } from "./hooks/useSelectionModel.js";
14
14
  import { useVisibleStats as Dt } from "./hooks/useVisibleStats.js";
15
- import { useImpactNovaI18n as Pt } from "../../../i18n/ImpactNovaI18nContext.js";
16
- const At = (ge) => {
15
+ import { useImpactNovaI18n as At } from "../../../i18n/ImpactNovaI18nContext.js";
16
+ const Ot = (Se) => {
17
17
  const {
18
18
  options: F,
19
- value: se,
19
+ value: re,
20
20
  defaultValue: Me,
21
21
  onChange: u,
22
22
  isMulti: f,
23
- isDisabled: V,
23
+ isDisabled: N,
24
24
  isLoading: I,
25
- isClearable: ze = !0,
25
+ isClearable: Le = !0,
26
26
  isSearchable: E = !0,
27
- placeholder: Le,
27
+ placeholder: Fe,
28
28
  // menuPortalTarget is kept for API compatibility but no longer used (Radix handles portalling)
29
- menuPortalTarget: Ot,
30
- autoFocus: Fe,
31
- closeMenuOnSelect: Re = !f,
32
- defaultMenuIsOpen: He = !1,
33
- scrollToSelectedOnOpen: be = !1,
34
- maxSelectableOptions: x,
35
- showSequence: ve,
36
- selectionOrder: je,
29
+ menuPortalTarget: Ct,
30
+ autoFocus: Re,
31
+ closeMenuOnSelect: He = !f,
32
+ defaultMenuIsOpen: je = !1,
33
+ scrollToSelectedOnOpen: we = !1,
34
+ maxSelectableOptions: g,
35
+ showSequence: Ve,
36
+ selectionOrder: qe,
37
37
  label: R,
38
- isRequired: qe,
39
- error: ye,
40
- helperText: Se,
41
- id: N,
42
- className: _e,
43
- parentClassName: Be,
44
- onMenuScrollToBottom: ie,
45
- name: Ke,
46
- isSelectAllEnabled: Y = !0,
47
- isReadOnly: m = !1,
38
+ isRequired: _e,
39
+ error: ae,
40
+ helperText: U,
41
+ helperTextPosition: oe = "absolute",
42
+ id: k,
43
+ className: Be,
44
+ parentClassName: Ke,
45
+ onMenuScrollToBottom: ce,
46
+ name: Ue,
47
+ isSelectAllEnabled: J = !0,
48
+ isReadOnly: p = !1,
48
49
  searchPosition: $ = "menu",
49
- footerContent: we,
50
- onInputChange: Ue,
51
- getOptionLabel: Ve,
52
- renderOption: Ne,
53
- onMenuOpen: We,
54
- onMenuClose: ke,
55
- labelOrientation: De = "top",
56
- leftContent: Pe,
57
- ignoreCase: Xe,
58
- ignoreAccents: Ye,
59
- matchFrom: Je,
60
- stringify: Qe,
61
- trim: Ze,
62
- filterOption: et,
50
+ footerContent: Ne,
51
+ onInputChange: We,
52
+ getOptionLabel: ke,
53
+ renderOption: Pe,
54
+ onMenuOpen: Xe,
55
+ onMenuClose: De,
56
+ labelOrientation: ue = "top",
57
+ leftContent: Ae,
58
+ ignoreCase: Ye,
59
+ ignoreAccents: Je,
60
+ matchFrom: Qe,
61
+ stringify: Ze,
62
+ trim: et,
63
+ filterOption: tt,
63
64
  enableSubMenus: y = !1,
64
- enableGroups: k = !1,
65
+ enableGroups: P = !1,
65
66
  fetchError: H,
66
- onRefetch: Ae,
67
- menuWidth: tt,
68
- onClearAll: Oe,
69
- onFocus: lt,
70
- onBlur: nt
71
- } = ge, { t: U } = Pt(), re = Le ?? U("select.placeholder"), [b, Ce] = K(He), [G, J] = K(""), [Ie, ae] = K(void 0), [d, v] = K(Me || (f ? [] : null)), [st, oe] = K(null), W = -2, [D, C] = K(-1), ce = z(!1), ue = z(null), de = z(null), it = z(null), X = z(null), j = z(null);
67
+ onRefetch: Oe,
68
+ menuWidth: lt,
69
+ onClearAll: Ce,
70
+ onFocus: nt,
71
+ onBlur: st
72
+ } = Se, { t: W } = At(), de = Fe ?? W("select.placeholder"), [b, Ie] = K(je), [z, Q] = K(""), [Te, fe] = K(void 0), [d, v] = K(Me || (f ? [] : null)), [it, me] = K(null), X = -2, [D, C] = K(-1), pe = M(!1), he = M(null), xe = M(null), rt = M(null), Y = M(null), j = M(null);
72
73
  L(() => {
73
- se !== void 0 && v(se);
74
- }, [se]), L(() => {
74
+ re !== void 0 && v(re);
75
+ }, [re]), L(() => {
75
76
  if (!(b && E && $ === "menu")) return;
76
77
  let e = !1;
77
78
  const t = () => {
@@ -83,107 +84,107 @@ const At = (ge) => {
83
84
  e = !0, clearTimeout(l);
84
85
  };
85
86
  }, [b, E, $]);
86
- const { flatOptions: p, isProcessing: O, totalOptionsCount: Te, workerSelectAll: rt } = Nt(F, G, {
87
- ignoreCase: Xe,
88
- ignoreAccents: Ye,
89
- matchFrom: Je,
90
- stringify: Qe,
91
- trim: Ze,
92
- filterOption: et,
87
+ const { flatOptions: m, isProcessing: O, totalOptionsCount: Ee, workerSelectAll: at } = kt(F, z, {
88
+ ignoreCase: Ye,
89
+ ignoreAccents: Je,
90
+ matchFrom: Qe,
91
+ stringify: Ze,
92
+ trim: et,
93
+ filterOption: tt,
93
94
  enableSubMenus: y,
94
- enableGroups: k
95
- }), S = kt(d, f ?? !1), { stats: q, getGroupStats: fe } = Dt(
96
- p,
97
- Te,
98
- G,
95
+ enableGroups: P
96
+ }), S = Pt(d, f ?? !1), { stats: q, getGroupStats: ge } = Dt(
97
+ m,
98
+ Ee,
99
+ z,
99
100
  S,
100
101
  d,
101
102
  f ?? !1
102
- ), P = mt({
103
- count: p.length,
104
- getScrollElement: () => X.current,
103
+ ), A = ht({
104
+ count: m.length,
105
+ getScrollElement: () => Y.current,
105
106
  estimateSize: () => 34,
106
107
  overscan: 5
107
108
  });
108
109
  L(() => {
109
110
  if (!b)
110
- ae(void 0), C(-1);
111
- else if (ce.current)
112
- if (ce.current = !1, E && $ === "menu" && !m)
111
+ fe(void 0), C(-1);
112
+ else if (pe.current)
113
+ if (pe.current = !1, E && $ === "menu" && !p)
113
114
  C(-1);
114
115
  else {
115
- const e = !I && !O && !H && f && Y && !m && p.length > 0;
116
- C(e ? W : 0);
116
+ const e = !I && !O && !H && f && J && !p && m.length > 0;
117
+ C(e ? X : 0);
117
118
  }
118
119
  }, [b]), L(() => {
119
120
  D !== -1 && C(0);
120
- }, [G]), L(() => {
121
+ }, [z]), L(() => {
121
122
  if (!b) return;
122
123
  const e = requestAnimationFrame(() => {
123
- P.measure();
124
+ A.measure();
124
125
  });
125
126
  return () => cancelAnimationFrame(e);
126
- }, [b, P]), L(() => {
127
- if (b && be && !O && p.length > 0) {
128
- const e = p.findIndex((t) => f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value);
127
+ }, [b, A]), L(() => {
128
+ if (b && we && !O && m.length > 0) {
129
+ const e = m.findIndex((t) => f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value);
129
130
  if (e !== -1) {
130
131
  const t = setTimeout(() => {
131
- P.scrollToIndex(e, { align: "center" });
132
+ A.scrollToIndex(e, { align: "center" });
132
133
  }, 50);
133
134
  return () => clearTimeout(t);
134
135
  }
135
136
  }
136
- }, [b, be, O, p.length, f, S.mode, S.set, d, P]);
137
- const _ = z(null);
137
+ }, [b, we, O, m.length, f, S.mode, S.set, d, A]);
138
+ const _ = M(null);
138
139
  L(() => {
139
- if (!X.current || !ie) return;
140
+ if (!Y.current || !ce) return;
140
141
  const e = () => {
141
142
  if (I || O) return;
142
- const { scrollTop: l, scrollHeight: s, clientHeight: n } = X.current;
143
+ const { scrollTop: l, scrollHeight: s, clientHeight: n } = Y.current;
143
144
  if (s - l - n <= 10) {
144
145
  if (_.current) return;
145
- ie(), _.current = setTimeout(() => {
146
+ ce(), _.current = setTimeout(() => {
146
147
  _.current = null;
147
148
  }, 500);
148
149
  }
149
- }, t = X.current;
150
+ }, t = Y.current;
150
151
  return t.addEventListener("scroll", e), !I && !O && e(), () => {
151
152
  t.removeEventListener("scroll", e), _.current && (clearTimeout(_.current), _.current = null);
152
153
  };
153
154
  }, [
154
- ie,
155
- p.length,
155
+ ce,
156
+ m.length,
156
157
  b,
157
158
  I,
158
159
  O
159
160
  ]);
160
- const Q = (e) => {
161
- if (!V)
162
- if (Ce(e), e)
163
- We?.();
161
+ const Z = (e) => {
162
+ if (!N)
163
+ if (Ie(e), e)
164
+ Xe?.();
164
165
  else {
165
- const t = d, l = f && w(d) ? d.map((s) => s.value) : void 0;
166
- ke?.(t, l), J(""), oe(null);
166
+ const t = d, l = f && V(d) ? d.map((s) => s.value) : void 0;
167
+ De?.(t, l), Q(""), me(null);
167
168
  }
168
- }, Z = (e) => {
169
- if (!(V || m || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
169
+ }, ee = (e) => {
170
+ if (!(N || p || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
170
171
  if (f) {
171
172
  const l = d || [];
172
173
  if ("children" in e || "options" in e) {
173
- const n = Vt(
174
+ const n = Nt(
174
175
  e,
175
176
  y,
176
- k
177
+ P
177
178
  ).filter((i) => !i.isDisabled);
178
179
  if (T(l)) {
179
- const i = l.excludedValues, r = n.every(
180
+ const i = l.excludedValues, a = n.every(
180
181
  (h) => !i.includes(h.value)
181
182
  );
182
183
  let c = [...i];
183
- r ? n.forEach((h) => {
184
+ a ? n.forEach((h) => {
184
185
  c.includes(h.value) || c.push(h.value);
185
186
  }) : c = c.filter(
186
- (h) => !n.some((te) => te.value === h)
187
+ (h) => !n.some((le) => le.value === h)
187
188
  );
188
189
  const o = {
189
190
  isAllSelected: !0,
@@ -193,16 +194,16 @@ const At = (ge) => {
193
194
  action: "select-option",
194
195
  option: e
195
196
  });
196
- } else if (w(l)) {
197
- const i = l, r = n.every(
197
+ } else if (V(l)) {
198
+ const i = l, a = n.every(
198
199
  (o) => i.some((h) => h.value === o.value)
199
200
  );
200
201
  let c = [...i];
201
- if (r ? c = c.filter(
202
+ if (a ? c = c.filter(
202
203
  (o) => !n.some((h) => h.value === o.value)
203
204
  ) : n.forEach((o) => {
204
205
  c.some((h) => h.value === o.value) || c.push(o);
205
- }), x && c.length > x)
206
+ }), g && c.length > g)
206
207
  return;
207
208
  v(c), u && u(c, {
208
209
  action: "select-option",
@@ -213,21 +214,21 @@ const At = (ge) => {
213
214
  const s = l.excludedValues, n = s.includes(e.value);
214
215
  let i = [...s];
215
216
  n ? i = i.filter((c) => c !== e.value) : i.push(e.value);
216
- const r = {
217
+ const a = {
217
218
  isAllSelected: !0,
218
219
  excludedValues: i
219
220
  };
220
- v(r), u && u(r, {
221
+ v(a), u && u(a, {
221
222
  action: n ? "select-option" : "deselect-option",
222
223
  option: e
223
224
  });
224
- } else if (w(l)) {
225
+ } else if (V(l)) {
225
226
  const s = l, n = f ? S.mode === "exclude" ? !S.set.has(e.value) : S.set.has(e.value) : d?.value === e.value;
226
227
  let i = [];
227
228
  if (n)
228
- i = s.filter((r) => r.value !== e.value);
229
+ i = s.filter((a) => a.value !== e.value);
229
230
  else {
230
- if (x && l.length >= x)
231
+ if (g && l.length >= g)
231
232
  return;
232
233
  i = [...s, e];
233
234
  }
@@ -240,24 +241,24 @@ const At = (ge) => {
240
241
  v(e), u && u(e, {
241
242
  action: "select-option",
242
243
  option: e
243
- }), Re && (Ce(!1), ke?.(e, void 0), J(""));
244
- }, pe = async () => {
245
- if (!(!f || V || m)) {
244
+ }), He && (Ie(!1), De?.(e, void 0), Q(""));
245
+ }, be = async () => {
246
+ if (!(!f || N || p)) {
246
247
  if (F.length > 3e3) {
247
248
  try {
248
- const e = await rt(
249
+ const e = await at(
249
250
  d,
250
251
  T(d),
251
- x
252
+ g
252
253
  );
253
254
  v(e), u && u(e, { action: "select-option" });
254
255
  } catch {
255
256
  }
256
257
  return;
257
258
  }
258
- if (G) {
259
+ if (z) {
259
260
  let e = !1;
260
- for (const l of p)
261
+ for (const l of m)
261
262
  if (!l.isGroup && !l.isSubmenuParent && !l.isDisabled) {
262
263
  e = !0;
263
264
  break;
@@ -267,52 +268,52 @@ const At = (ge) => {
267
268
  const t = d || [];
268
269
  if (T(t)) {
269
270
  const l = t.excludedValues, { totalVisible: s, selectedVisible: n } = q, i = s > 0 && s === n;
270
- let r = [...l];
271
+ let a = [...l];
271
272
  if (i)
272
- for (const o of p)
273
- !o.isGroup && !o.isSubmenuParent && !o.isDisabled && (r.includes(o.value) || r.push(o.value));
273
+ for (const o of m)
274
+ !o.isGroup && !o.isSubmenuParent && !o.isDisabled && (a.includes(o.value) || a.push(o.value));
274
275
  else {
275
276
  const o = /* @__PURE__ */ new Set();
276
- for (const h of p)
277
+ for (const h of m)
277
278
  !h.isGroup && !h.isSubmenuParent && !h.isDisabled && o.add(h.value);
278
- r = r.filter((h) => !o.has(h));
279
+ a = a.filter((h) => !o.has(h));
279
280
  }
280
281
  const c = {
281
282
  isAllSelected: !0,
282
- excludedValues: r
283
+ excludedValues: a
283
284
  };
284
285
  v(c), u && u(c, { action: "select-option" });
285
- } else if (w(t)) {
286
+ } else if (V(t)) {
286
287
  const l = t, { totalVisible: s, selectedVisible: n } = q, i = s > 0 && s === n;
287
- let r = [...l];
288
+ let a = [...l];
288
289
  if (i) {
289
290
  const c = /* @__PURE__ */ new Set();
290
- for (const o of p)
291
+ for (const o of m)
291
292
  !o.isGroup && !o.isSubmenuParent && !o.isDisabled && c.add(o.value);
292
- r = r.filter((o) => !c.has(o.value));
293
+ a = a.filter((o) => !c.has(o.value));
293
294
  } else {
294
- const c = new Set(r.map((o) => o.value));
295
- for (const o of p)
296
- !o.isGroup && !o.isSubmenuParent && !o.isDisabled && (c.has(o.value) || (r.push(o), c.add(o.value)));
295
+ const c = new Set(a.map((o) => o.value));
296
+ for (const o of m)
297
+ !o.isGroup && !o.isSubmenuParent && !o.isDisabled && (c.has(o.value) || (a.push(o), c.add(o.value)));
297
298
  }
298
- if (x && r.length > x)
299
+ if (g && a.length > g)
299
300
  return;
300
- v(r), u && u(r, { action: "select-option" });
301
+ v(a), u && u(a, { action: "select-option" });
301
302
  }
302
- } else if (x) {
303
- const e = d, { totalVisible: t } = q, l = w(e) ? e.length : 0, s = Math.min(t, x);
304
- if (w(e) && l >= s && l > 0) {
303
+ } else if (g) {
304
+ const e = d, { totalVisible: t } = q, l = V(e) ? e.length : 0, s = Math.min(t, g);
305
+ if (V(e) && l >= s && l > 0) {
305
306
  const n = e.filter((i) => i.isDisabled);
306
307
  v(n), u && u(n, {
307
308
  action: "select-option"
308
309
  });
309
- } else if (w(e)) {
310
+ } else if (V(e)) {
310
311
  const n = e.filter(
311
- (r) => r.isDisabled
312
+ (a) => a.isDisabled
312
313
  );
313
314
  let i = n.length;
314
- for (const r of p)
315
- if (!r.isGroup && !r.isSubmenuParent && !r.isDisabled && (n.push(r), i++, i >= x))
315
+ for (const a of m)
316
+ if (!a.isGroup && !a.isSubmenuParent && !a.isDisabled && (n.push(a), i++, i >= g))
316
317
  break;
317
318
  v(n), u && u(n, {
318
319
  action: "select-option"
@@ -320,17 +321,17 @@ const At = (ge) => {
320
321
  }
321
322
  } else {
322
323
  const e = d, t = T(e) && e.excludedValues.length === 0;
323
- if (ge.enableInvertedSelection)
324
+ if (Se.enableInvertedSelection)
324
325
  if (t) {
325
- const l = w(e) ? e.filter((s) => s.isDisabled) : [];
326
+ const l = V(e) ? e.filter((s) => s.isDisabled) : [];
326
327
  v(l), u && u(l, {
327
328
  action: "select-option"
328
329
  });
329
330
  } else {
330
331
  const s = {
331
332
  isAllSelected: !0,
332
- excludedValues: p.filter(
333
- (n) => n.isDisabled && (w(e) ? !e.some((i) => i.value === n.value) : !0)
333
+ excludedValues: m.filter(
334
+ (n) => n.isDisabled && (V(e) ? !e.some((i) => i.value === n.value) : !0)
334
335
  ).map((n) => n.value)
335
336
  };
336
337
  v(s), u && u(s, { action: "select-option" });
@@ -338,13 +339,13 @@ const At = (ge) => {
338
339
  else {
339
340
  const { totalVisible: l, selectedVisible: s } = q;
340
341
  if (l > 0 && l === s) {
341
- const n = w(e) ? e.filter((i) => i.isDisabled) : [];
342
+ const n = V(e) ? e.filter((i) => i.isDisabled) : [];
342
343
  v(n), u && u(n, {
343
344
  action: "select-option"
344
345
  });
345
346
  } else {
346
- const n = w(e) ? e.filter((i) => i.isDisabled) : [];
347
- for (const i of p)
347
+ const n = V(e) ? e.filter((i) => i.isDisabled) : [];
348
+ for (const i of m)
348
349
  !i.isGroup && !i.isSubmenuParent && !i.isDisabled && n.push(i);
349
350
  v(n), u && u(n, {
350
351
  action: "select-option"
@@ -353,12 +354,12 @@ const At = (ge) => {
353
354
  }
354
355
  }
355
356
  }
356
- }, at = (e) => {
357
- if (e.stopPropagation(), !m)
357
+ }, ot = (e) => {
358
+ if (e.stopPropagation(), !p)
358
359
  if (f) {
359
360
  const t = [], l = (n) => {
360
361
  for (const i of n) {
361
- if (k && "options" in i) {
362
+ if (P && "options" in i) {
362
363
  l(
363
364
  i.options
364
365
  );
@@ -368,33 +369,33 @@ const At = (ge) => {
368
369
  l(i.children);
369
370
  continue;
370
371
  }
371
- const r = i;
372
- r.isDisabled && (S.mode === "exclude" ? !S.set.has(r.value) : S.set.has(r.value)) && t.push(r);
372
+ const a = i;
373
+ a.isDisabled && (S.mode === "exclude" ? !S.set.has(a.value) : S.set.has(a.value)) && t.push(a);
373
374
  }
374
375
  };
375
376
  l(F);
376
377
  const s = t;
377
- v(s), u && u(s, { action: "clear" }), Oe?.();
378
+ v(s), u && u(s, { action: "clear" }), Ce?.();
378
379
  } else {
379
380
  const t = d;
380
381
  if (t) {
381
382
  let s;
382
383
  const n = (i) => {
383
- for (const r of i) {
384
+ for (const a of i) {
384
385
  if (s) return;
385
- if (k && "options" in r) {
386
+ if (P && "options" in a) {
386
387
  if (n(
387
- r.options
388
+ a.options
388
389
  ), s) return;
389
390
  continue;
390
391
  }
391
- if (y && "children" in r && Array.isArray(r.children)) {
392
+ if (y && "children" in a && Array.isArray(a.children)) {
392
393
  if (n(
393
- r.children
394
+ a.children
394
395
  ), s) return;
395
396
  continue;
396
397
  }
397
- const c = r;
398
+ const c = a;
398
399
  if (c.value === t.value) {
399
400
  s = c;
400
401
  return;
@@ -405,496 +406,520 @@ const At = (ge) => {
405
406
  return;
406
407
  }
407
408
  const l = null;
408
- v(l), u && u(l, { action: "clear" }), Oe?.();
409
+ v(l), u && u(l, { action: "clear" }), Ce?.();
409
410
  }
410
- }, ot = (e) => wt(
411
+ }, ct = (e) => Vt(
411
412
  e,
412
- ve ?? !1,
413
+ Ve ?? !1,
413
414
  f ?? !1,
414
- je,
415
+ qe,
415
416
  d
416
- ), ee = (e) => Ve ? Ve(e) : e.label, Ee = () => {
417
+ ), te = (e) => ke ? ke(e) : e.label, $e = () => {
417
418
  const e = [];
418
- return !I && !O && !H && f && Y && !m && p.length > 0 && e.push(W), p.forEach((l, s) => {
419
+ return !I && !O && !H && f && J && !p && m.length > 0 && e.push(X), m.forEach((l, s) => {
419
420
  !l.isGroup && !(y && l.isSubmenuParent) && !l.isDisabled && e.push(s);
420
421
  }), e;
421
- }, ct = (e) => {
422
- if (V || m) return;
422
+ }, ut = (e) => {
423
+ if (N || p) return;
423
424
  if (!b) {
424
- (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), ce.current = !0, Q(!0));
425
+ (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), pe.current = !0, Z(!0));
425
426
  return;
426
427
  }
427
- if (E && $ === "menu" && !m && j.current) {
428
+ if (E && $ === "menu" && !p && j.current) {
428
429
  document.activeElement !== j.current && j.current.focus();
429
430
  return;
430
431
  }
431
- const t = Ee();
432
+ const t = $e();
432
433
  if (t.length === 0) return;
433
434
  const l = t.indexOf(D);
434
435
  if (e.key === "ArrowDown") {
435
436
  e.preventDefault();
436
437
  const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
437
- C(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
438
+ C(n), n >= 0 && A.scrollToIndex(n, { align: "auto" });
438
439
  } else if (e.key === "ArrowUp") {
439
440
  e.preventDefault();
440
441
  const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
441
- C(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
442
+ C(n), n >= 0 && A.scrollToIndex(n, { align: "auto" });
442
443
  } else if (e.key === "Enter" || e.key === " ") {
443
- if (e.preventDefault(), D === W)
444
- pe();
445
- else if (D >= 0 && D < p.length) {
446
- const s = p[D];
447
- s.isDisabled || Z(s);
444
+ if (e.preventDefault(), D === X)
445
+ be();
446
+ else if (D >= 0 && D < m.length) {
447
+ const s = m[D];
448
+ s.isDisabled || ee(s);
448
449
  }
449
450
  } else if (e.key === "Escape")
450
- e.preventDefault(), Q(!1), ue.current?.focus();
451
+ e.preventDefault(), Z(!1), he.current?.focus();
451
452
  else if (e.key === "Home")
452
- e.preventDefault(), t.length > 0 && (C(t[0]), t[0] >= 0 && P.scrollToIndex(t[0], { align: "auto" }));
453
+ e.preventDefault(), t.length > 0 && (C(t[0]), t[0] >= 0 && A.scrollToIndex(t[0], { align: "auto" }));
453
454
  else if (e.key === "End" && (e.preventDefault(), t.length > 0)) {
454
455
  const s = t[t.length - 1];
455
- C(s), s >= 0 && P.scrollToIndex(s, { align: "auto" });
456
+ C(s), s >= 0 && A.scrollToIndex(s, { align: "auto" });
456
457
  }
457
- }, ut = (e) => {
458
- const t = Ee();
458
+ }, dt = (e) => {
459
+ const t = $e();
459
460
  if (t.length === 0) return;
460
461
  const l = t.indexOf(D);
461
462
  if (e.key === "ArrowDown") {
462
463
  e.preventDefault();
463
464
  const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
464
- C(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
465
+ C(n), n >= 0 && A.scrollToIndex(n, { align: "auto" });
465
466
  } else if (e.key === "ArrowUp") {
466
467
  e.preventDefault();
467
468
  const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
468
- C(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
469
+ C(n), n >= 0 && A.scrollToIndex(n, { align: "auto" });
469
470
  } else if (e.key === "Enter") {
470
- if (e.preventDefault(), D === W)
471
- pe();
472
- else if (D >= 0 && D < p.length) {
473
- const s = p[D];
474
- s.isDisabled || Z(s);
471
+ if (e.preventDefault(), D === X)
472
+ be();
473
+ else if (D >= 0 && D < m.length) {
474
+ const s = m[D];
475
+ s.isDisabled || ee(s);
475
476
  }
476
- } else e.key === "Escape" && (e.preventDefault(), Q(!1), ue.current?.focus());
477
- }, dt = () => {
477
+ } else e.key === "Escape" && (e.preventDefault(), Z(!1), he.current?.focus());
478
+ }, ft = () => {
478
479
  if (f) {
479
480
  const e = d || [];
480
481
  let t = 0;
481
- return T(e) ? t = Te - e.excludedValues.length : w(e) && (t = e.length), t === 0 ? null : t === 1 && w(e) ? /* @__PURE__ */ a("span", { className: A("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: ee(e[0]) }) : /* @__PURE__ */ a("span", { className: A("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: U("select.selectedCount", { count: t }) });
482
+ return T(e) ? t = Ee - e.excludedValues.length : V(e) && (t = e.length), t === 0 ? null : t === 1 && V(e) ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", N ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: te(e[0]) }) : /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", N ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: W("select.selectedCount", { count: t }) });
482
483
  } else {
483
484
  const e = d;
484
- return e ? /* @__PURE__ */ a("span", { className: A("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: ee(e) }) : null;
485
+ return e ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", N ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: te(e) }) : null;
485
486
  }
486
487
  };
487
- return /* @__PURE__ */ g(
488
+ return /* @__PURE__ */ x(
488
489
  "div",
489
490
  {
490
- className: A(
491
+ className: w(
491
492
  "flex gap-[6px]",
492
- De === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
493
- Be
493
+ ue === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
494
+ Ke
494
495
  ),
495
- "data-testid": `select-${N || "default"}`,
496
+ "data-testid": `select-${k || "default"}`,
496
497
  "data-component": "select",
497
498
  children: [
498
- R && /* @__PURE__ */ g(
499
+ R && /* @__PURE__ */ x(
499
500
  "label",
500
501
  {
501
- className: A(
502
+ className: w(
502
503
  "text-[12px] font-medium text-[#60697d] leading-[18px]",
503
- De === "left" ? "shrink-0" : ""
504
+ ue === "left" ? "shrink-0" : ""
504
505
  ),
505
506
  children: [
506
507
  R,
507
508
  " ",
508
- qe && /* @__PURE__ */ a("span", { className: "text-[red]", children: "*" })
509
+ _e && /* @__PURE__ */ r("span", { className: "text-[red]", children: "*" })
509
510
  ]
510
511
  }
511
512
  ),
512
- /* @__PURE__ */ g(ne.Root, { open: b, onOpenChange: Q, children: [
513
- /* @__PURE__ */ a(ne.Trigger, { asChild: !0, children: /* @__PURE__ */ a(
514
- "div",
515
- {
516
- ref: ue,
517
- className: A(
518
- "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",
519
- ye ? "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",
520
- V ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
521
- m ? "cursor-default bg-[#f2f4fb]" : "",
522
- b ? "ring-1 ring-indigo-500 border-indigo-500" : "",
523
- !V && !m && "bg-white",
524
- _e
525
- ),
526
- id: N,
527
- tabIndex: V ? -1 : 0,
528
- onFocus: lt,
529
- onBlur: nt,
530
- role: "combobox",
531
- "aria-expanded": b,
532
- "aria-haspopup": "listbox",
533
- "aria-label": R ? String(R) : re,
534
- "data-component": "select-trigger",
535
- "data-disabled": V || void 0,
536
- "data-state": b ? "open" : "closed",
537
- onKeyDown: ct,
538
- children: /* @__PURE__ */ g("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
539
- Pe && /* @__PURE__ */ a("div", { className: "flex items-center text-gray-500 shrink-0", children: Pe }),
540
- /* @__PURE__ */ g(
541
- "div",
542
- {
543
- className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
544
- "data-testid": `select-value-${N || "default"}`,
545
- children: [
546
- dt() || /* @__PURE__ */ a(
547
- "span",
548
- {
549
- className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
550
- "data-testid": `select-placeholder-${N || "default"}`,
551
- "data-has-value": !1,
552
- children: re
553
- }
554
- ),
555
- E && b && $ === "trigger" && !m && /* @__PURE__ */ a(
556
- "input",
557
- {
558
- ref: it,
559
- type: "text",
560
- className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
561
- value: G,
562
- onChange: (e) => J(e.target.value),
563
- onClick: (e) => e.stopPropagation(),
564
- autoFocus: Fe,
565
- name: Ke || void 0
566
- }
567
- )
568
- ]
569
- }
570
- ),
571
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !b && (I || O) ? /* @__PURE__ */ a(gt, { size: "14px" }) : /* @__PURE__ */ g(pt, { children: [
572
- ze && !m && !V && (f && (T(
573
- d
574
- ) && d.isAllSelected || w(d) && d.length > 0) || !f && d) && /* @__PURE__ */ a(
575
- "div",
576
- {
577
- role: "button",
578
- onClick: at,
579
- className: "hover:text-gray-600 p-0.5",
580
- children: /* @__PURE__ */ a(bt, { size: "11px", color: "#758490" })
581
- }
582
- ),
583
- /* @__PURE__ */ a(
584
- $e,
585
- {
586
- size: "16px",
587
- className: A(
588
- "transition-transform duration-200",
589
- b ? "-rotate-90" : "rotate-90"
590
- )
591
- }
592
- )
593
- ] }) })
594
- ] })
595
- }
596
- ) }),
597
- /* @__PURE__ */ a(ne.Portal, { children: /* @__PURE__ */ g(
598
- ne.Content,
599
- {
600
- ref: de,
601
- side: "bottom",
602
- sideOffset: 4,
603
- align: "start",
604
- avoidCollisions: !0,
605
- collisionPadding: 8,
606
- onOpenAutoFocus: (e) => e.preventDefault(),
607
- onWheel: (e) => e.stopPropagation(),
608
- style: {
609
- width: tt || "var(--radix-popover-trigger-width)",
610
- maxHeight: "var(--radix-popover-content-available-height)",
611
- minHeight: Ie ? `${Ie}px` : void 0
612
- },
613
- className: A(
614
- "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",
615
- m ? "bg-[#f5f5f5]" : "bg-white"
616
- ),
617
- "data-testid": `select-menu-${N || "default"}`,
618
- "data-component": "select-menu",
619
- children: [
620
- /* @__PURE__ */ g(
513
+ /* @__PURE__ */ x(
514
+ "div",
515
+ {
516
+ className: w(
517
+ ue === "left" ? "min-w-0 flex-1" : "w-full min-w-0",
518
+ U && oe === "absolute" && "relative"
519
+ ),
520
+ children: [
521
+ /* @__PURE__ */ x(se.Root, { open: b, onOpenChange: Z, children: [
522
+ /* @__PURE__ */ r(se.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
621
523
  "div",
622
524
  {
623
- className: A(
624
- "flex flex-col z-10 sticky top-0 px-[6px] pt-[8px]",
625
- m ? "bg-[#f5f5f5]" : "bg-white",
626
- !H && (E && $ === "menu" && !m || f && Y && !m && p.length > 0) ? "border-b border-solid border-gray-100" : ""
525
+ ref: he,
526
+ className: w(
527
+ "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",
528
+ ae ? "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",
529
+ N ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
530
+ p ? "cursor-default bg-[#f2f4fb]" : "",
531
+ b ? "ring-1 ring-indigo-500 border-indigo-500" : "",
532
+ !N && !p && "bg-white",
533
+ Be
627
534
  ),
628
- children: [
629
- E && $ === "menu" && !m && !H && /* @__PURE__ */ a(
535
+ id: k,
536
+ tabIndex: N ? -1 : 0,
537
+ onFocus: nt,
538
+ onBlur: st,
539
+ role: "combobox",
540
+ "aria-expanded": b,
541
+ "aria-haspopup": "listbox",
542
+ "aria-label": R ? String(R) : de,
543
+ "data-component": "select-trigger",
544
+ "data-disabled": N || void 0,
545
+ "data-state": b ? "open" : "closed",
546
+ onKeyDown: ut,
547
+ children: /* @__PURE__ */ x("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
548
+ Ae && /* @__PURE__ */ r("div", { className: "flex items-center text-gray-500 shrink-0", children: Ae }),
549
+ /* @__PURE__ */ x(
630
550
  "div",
631
551
  {
632
- className: "p-0",
633
- "data-testid": `select-search-container-${N || "default"}`,
634
- children: /* @__PURE__ */ g("div", { className: "relative", children: [
635
- /* @__PURE__ */ a("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ a(vt, { size: "14px", color: "#AFAFAF" }) }),
636
- /* @__PURE__ */ a(
552
+ className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
553
+ "data-testid": `select-value-${k || "default"}`,
554
+ children: [
555
+ ft() || /* @__PURE__ */ r(
556
+ "span",
557
+ {
558
+ className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
559
+ "data-testid": `select-placeholder-${k || "default"}`,
560
+ "data-has-value": !1,
561
+ children: de
562
+ }
563
+ ),
564
+ E && b && $ === "trigger" && !p && /* @__PURE__ */ r(
637
565
  "input",
638
566
  {
639
- ref: j,
567
+ ref: rt,
640
568
  type: "text",
641
- className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus-visible:ring-1 focus-visible:ring-indigo-500 focus-visible:rounded-md",
642
- placeholder: U("select.searchHere"),
643
- value: G,
644
- onKeyDown: ut,
645
- onChange: (e) => {
646
- const t = e.target.value;
647
- G === "" && t !== "" ? de.current && ae(de.current.offsetHeight) : t === "" && ae(void 0), J(t), Ue?.(t);
648
- },
569
+ className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
570
+ value: z,
571
+ onChange: (e) => Q(e.target.value),
649
572
  onClick: (e) => e.stopPropagation(),
650
- "data-testid": `select-search-input-${N || "default"}`
573
+ autoFocus: Re,
574
+ name: Ue || void 0
651
575
  }
652
576
  )
653
- ] })
577
+ ]
654
578
  }
655
579
  ),
656
- !I && !O && !H && f && Y && !m && p.length > 0 && /* @__PURE__ */ a(
580
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !b && (I || O) ? /* @__PURE__ */ r(bt, { size: "14px" }) : /* @__PURE__ */ x(pt, { children: [
581
+ Le && !p && !N && (f && (T(
582
+ d
583
+ ) && d.isAllSelected || V(d) && d.length > 0) || !f && d) && /* @__PURE__ */ r(
584
+ "div",
585
+ {
586
+ role: "button",
587
+ onClick: ot,
588
+ className: "hover:text-gray-600 p-0.5",
589
+ children: /* @__PURE__ */ r(vt, { size: "11px", color: "#758490" })
590
+ }
591
+ ),
592
+ /* @__PURE__ */ r(
593
+ ze,
594
+ {
595
+ size: "16px",
596
+ className: w(
597
+ "transition-transform duration-200",
598
+ b ? "-rotate-90" : "rotate-90"
599
+ )
600
+ }
601
+ )
602
+ ] }) })
603
+ ] })
604
+ }
605
+ ) }),
606
+ /* @__PURE__ */ r(se.Portal, { children: /* @__PURE__ */ x(
607
+ se.Content,
608
+ {
609
+ ref: xe,
610
+ side: "bottom",
611
+ sideOffset: 4,
612
+ align: "start",
613
+ avoidCollisions: !0,
614
+ collisionPadding: 8,
615
+ onOpenAutoFocus: (e) => e.preventDefault(),
616
+ onWheel: (e) => e.stopPropagation(),
617
+ style: {
618
+ width: lt || "var(--radix-popover-trigger-width)",
619
+ maxHeight: "var(--radix-popover-content-available-height)",
620
+ minHeight: Te ? `${Te}px` : void 0
621
+ },
622
+ className: w(
623
+ "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",
624
+ p ? "bg-[#f5f5f5]" : "bg-white"
625
+ ),
626
+ "data-testid": `select-menu-${k || "default"}`,
627
+ "data-component": "select-menu",
628
+ children: [
629
+ /* @__PURE__ */ x(
657
630
  "div",
658
631
  {
659
- className: "pb-1",
660
- "data-testid": `select-select-all-container-${N || "default"}`,
661
- children: /* @__PURE__ */ a(
662
- "div",
663
- {
664
- className: A(
665
- "flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
666
- D === W && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
667
- ),
668
- onClick: pe,
669
- role: "option",
670
- "aria-selected": !1,
671
- "data-testid": `select-select-all-button-${N || "default"}`,
672
- children: /* @__PURE__ */ g("div", { className: "flex items-center flex-1", children: [
673
- /* @__PURE__ */ a("div", { className: "pointer-events-none flex", children: /* @__PURE__ */ a(
674
- Ge,
675
- {
676
- checked: (() => {
677
- const { totalVisible: e, selectedVisible: t } = q;
678
- if (e === 0) return !1;
679
- const l = x ? Math.min(e, x) : e;
680
- return t > 0 && t < l ? "indeterminate" : t >= l;
681
- })(),
682
- disabled: V || m,
683
- onChange: () => {
684
- },
685
- "data-testid": `select-select-all-checkbox-${N || "default"}`
686
- }
687
- ) }),
688
- /* @__PURE__ */ a(
689
- "span",
632
+ className: w(
633
+ "flex flex-col z-10 sticky top-0 px-[6px] pt-[8px]",
634
+ p ? "bg-[#f5f5f5]" : "bg-white",
635
+ !H && (E && $ === "menu" && !p || f && J && !p && m.length > 0) ? "border-b border-solid border-gray-100" : ""
636
+ ),
637
+ children: [
638
+ E && $ === "menu" && !p && !H && /* @__PURE__ */ r(
639
+ "div",
640
+ {
641
+ className: "p-0",
642
+ "data-testid": `select-search-container-${k || "default"}`,
643
+ children: /* @__PURE__ */ x("div", { className: "relative", children: [
644
+ /* @__PURE__ */ r("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ r(yt, { size: "14px", color: "#AFAFAF" }) }),
645
+ /* @__PURE__ */ r(
646
+ "input",
647
+ {
648
+ ref: j,
649
+ type: "text",
650
+ className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus-visible:ring-1 focus-visible:ring-indigo-500 focus-visible:rounded-md",
651
+ placeholder: W("select.searchHere"),
652
+ value: z,
653
+ onKeyDown: dt,
654
+ onChange: (e) => {
655
+ const t = e.target.value;
656
+ z === "" && t !== "" ? xe.current && fe(xe.current.offsetHeight) : t === "" && fe(void 0), Q(t), We?.(t);
657
+ },
658
+ onClick: (e) => e.stopPropagation(),
659
+ "data-testid": `select-search-input-${k || "default"}`
660
+ }
661
+ )
662
+ ] })
663
+ }
664
+ ),
665
+ !I && !O && !H && f && J && !p && m.length > 0 && /* @__PURE__ */ r(
666
+ "div",
667
+ {
668
+ className: "pb-1",
669
+ "data-testid": `select-select-all-container-${k || "default"}`,
670
+ children: /* @__PURE__ */ r(
671
+ "div",
690
672
  {
691
- className: "text-sm font-medium text-gray-700",
692
- "data-testid": `select-select-all-label-${N || "default"}`,
693
- children: (() => {
694
- const { totalVisible: e, selectedVisible: t } = q, l = x ? Math.min(e, x) : e, s = e > 0 && t >= l;
695
- return U(s ? "select.unselectAll" : "select.selectAll");
696
- })()
673
+ className: w(
674
+ "flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
675
+ D === X && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
676
+ ),
677
+ onClick: be,
678
+ role: "option",
679
+ "aria-selected": !1,
680
+ "data-testid": `select-select-all-button-${k || "default"}`,
681
+ children: /* @__PURE__ */ x("div", { className: "flex items-center flex-1", children: [
682
+ /* @__PURE__ */ r("div", { className: "pointer-events-none flex", children: /* @__PURE__ */ r(
683
+ Ge,
684
+ {
685
+ checked: (() => {
686
+ const { totalVisible: e, selectedVisible: t } = q;
687
+ if (e === 0) return !1;
688
+ const l = g ? Math.min(e, g) : e;
689
+ return t > 0 && t < l ? "indeterminate" : t >= l;
690
+ })(),
691
+ disabled: N || p,
692
+ onChange: () => {
693
+ },
694
+ "data-testid": `select-select-all-checkbox-${k || "default"}`
695
+ }
696
+ ) }),
697
+ /* @__PURE__ */ r(
698
+ "span",
699
+ {
700
+ className: "text-sm font-medium text-gray-700",
701
+ "data-testid": `select-select-all-label-${k || "default"}`,
702
+ children: (() => {
703
+ const { totalVisible: e, selectedVisible: t } = q, l = g ? Math.min(e, g) : e, s = e > 0 && t >= l;
704
+ return W(s ? "select.unselectAll" : "select.selectAll");
705
+ })()
706
+ }
707
+ )
708
+ ] })
697
709
  }
698
710
  )
699
- ] })
700
- }
701
- )
711
+ }
712
+ )
713
+ ]
702
714
  }
703
- )
704
- ]
705
- }
706
- ),
707
- /* @__PURE__ */ a(
708
- "div",
709
- {
710
- ref: X,
711
- role: "listbox",
712
- "aria-label": R ? String(R) : re,
713
- className: "flex-1 overflow-auto py-1 px-[6px]",
714
- style: {
715
- maxHeight: "297px",
716
- overscrollBehavior: "contain"
717
- },
718
- onWheel: (e) => e.stopPropagation(),
719
- children: H ? /* @__PURE__ */ g("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
720
- /* @__PURE__ */ a("p", { className: "text-sm text-gray-500 font-medium mb-3", children: "Something went wrong" }),
721
- Ae && /* @__PURE__ */ a(
722
- yt,
715
+ ),
716
+ /* @__PURE__ */ r(
717
+ "div",
723
718
  {
724
- size: "sm",
725
- variant: "outline",
726
- onClick: () => Ae(),
727
- children: "Refetch"
728
- }
729
- )
730
- ] }) : p.length === 0 && !I && !O ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : I || O ? /* @__PURE__ */ a("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g(
731
- "div",
732
- {
733
- className: "flex items-center gap-2 px-3 py-2 animate-pulse",
734
- children: [
735
- f && /* @__PURE__ */ a("div", { className: "w-4 h-4 bg-gray-200 rounded shrink-0" }),
736
- /* @__PURE__ */ a("div", { className: "h-4 bg-gray-200 rounded w-full" })
737
- ]
738
- },
739
- t
740
- )) }) : /* @__PURE__ */ a(
741
- "div",
742
- {
743
- style: {
744
- height: `${P.getTotalSize()}px`,
745
- width: "100%",
746
- position: "relative"
747
- },
748
- children: P.getVirtualItems().map((e) => {
749
- const t = p[e.index], l = f ? S.mode === "exclude" ? !S.set.has(t.value) : S.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) && !(y && t.isSubmenuParent), r = k && t.isGroup || y && t.isSubmenuParent ? fe(t.original) : void 0, c = r?.selected || 0, o = r?.total || 0, h = c > 0 && c < o, te = t.isParentSelectable !== !1, me = N || "default", le = String(t.value || ""), he = ee(
719
+ ref: Y,
720
+ role: "listbox",
721
+ "aria-label": R ? String(R) : de,
722
+ className: "flex-1 overflow-auto py-1 px-[6px]",
723
+ style: {
724
+ maxHeight: "297px",
725
+ overscrollBehavior: "contain"
726
+ },
727
+ onWheel: (e) => e.stopPropagation(),
728
+ children: H ? /* @__PURE__ */ x("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
729
+ /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 font-medium mb-3", children: "Something went wrong" }),
730
+ Oe && /* @__PURE__ */ r(
731
+ St,
732
+ {
733
+ size: "sm",
734
+ variant: "outline",
735
+ onClick: () => Oe(),
736
+ children: "Refetch"
737
+ }
738
+ )
739
+ ] }) : m.length === 0 && !I && !O ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : I || O ? /* @__PURE__ */ r("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ x(
740
+ "div",
741
+ {
742
+ className: "flex items-center gap-2 px-3 py-2 animate-pulse",
743
+ children: [
744
+ f && /* @__PURE__ */ r("div", { className: "w-4 h-4 bg-gray-200 rounded shrink-0" }),
745
+ /* @__PURE__ */ r("div", { className: "h-4 bg-gray-200 rounded w-full" })
746
+ ]
747
+ },
750
748
  t
751
- ), ft = typeof he == "string" ? he : le;
752
- return /* @__PURE__ */ g(
749
+ )) }) : /* @__PURE__ */ r(
753
750
  "div",
754
751
  {
755
- "data-index": e.index,
756
- ref: P.measureElement,
757
- className: "absolute left-0 w-full pb-[2px]",
758
752
  style: {
759
- transform: `translateY(${e.start}px)`,
760
- width: "100%"
753
+ height: `${A.getTotalSize()}px`,
754
+ width: "100%",
755
+ position: "relative"
761
756
  },
762
- "data-testid": `select-option-wrapper-${me}-${le}`,
763
- children: [
764
- /* @__PURE__ */ a(
757
+ children: A.getVirtualItems().map((e) => {
758
+ const t = m[e.index], l = f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value, s = d || [], n = f && g ? T(s) ? !1 : V(s) && s.length >= g : !1, i = t.isDisabled || n && !l && !(P && t.isGroup) && !(y && t.isSubmenuParent), a = P && t.isGroup || y && t.isSubmenuParent ? ge(t.original) : void 0, c = a?.selected || 0, o = a?.total || 0, h = c > 0 && c < o, le = t.isParentSelectable !== !1, ve = k || "default", ne = String(t.value || ""), ye = te(
759
+ t
760
+ ), mt = typeof ye == "string" ? ye : ne;
761
+ return /* @__PURE__ */ x(
765
762
  "div",
766
763
  {
767
- className: A(
768
- "cursor-default select-none py-[6px] px-3 flex items-center justify-between transition-colors rounded-md",
769
- i ? "opacity-50 cursor-not-allowed bg-[#f5f5f5]" : m ? "cursor-default" : "hover:bg-gray-100 cursor-pointer",
770
- l && !i && !(k && t.isGroup) && !(y && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
771
- D === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
772
- ),
764
+ "data-index": e.index,
765
+ ref: A.measureElement,
766
+ className: "absolute left-0 w-full pb-[2px]",
773
767
  style: {
774
- paddingLeft: `${t.depth * 16 + 12}px`
768
+ transform: `translateY(${e.start}px)`,
769
+ width: "100%"
775
770
  },
776
- onClick: () => {
777
- i || (k && t.isGroup || y && t.isSubmenuParent) && !te || Z(t);
778
- },
779
- onMouseEnter: (M) => {
780
- if (y && t.isSubmenuParent) {
781
- oe(t.value);
782
- const B = M.currentTarget.getBoundingClientRect();
783
- t.rect = B;
784
- } else
785
- oe(null);
786
- },
787
- "data-testid": `select-option-${me}-${le}`,
788
- "data-state": l ? "checked" : "unchecked",
789
- "data-disabled": i || void 0,
790
- "data-component": "select-option",
791
- role: "option",
792
- "aria-selected": l,
793
- "aria-disabled": i || void 0,
794
- children: Ne ? Ne(
795
- {
796
- onClick: () => {
797
- },
798
- className: "w-full",
799
- selected: l,
800
- disabled: i
801
- },
802
- t
803
- ) : /* @__PURE__ */ g("div", { className: "flex items-center flex-1 overflow-hidden", children: [
804
- f && (k && t.isGroup || y && t.isSubmenuParent ? te : !0) && /* @__PURE__ */ a(
805
- Ge,
806
- {
807
- checked: h ? "indeterminate" : l,
808
- disabled: i || m,
809
- onChange: () => {
810
- }
811
- }
812
- ),
813
- ve && !(k && t.isGroup) && !(y && t.isSubmenuParent) ? /* @__PURE__ */ a(
814
- ht,
771
+ "data-testid": `select-option-wrapper-${ve}-${ne}`,
772
+ children: [
773
+ /* @__PURE__ */ r(
774
+ "div",
815
775
  {
816
- label: ee(
817
- t
776
+ className: w(
777
+ "cursor-default select-none py-[6px] px-3 flex items-center justify-between transition-colors rounded-md",
778
+ i ? "opacity-50 cursor-not-allowed bg-[#f5f5f5]" : p ? "cursor-default" : "hover:bg-gray-100 cursor-pointer",
779
+ l && !i && !(P && t.isGroup) && !(y && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
780
+ D === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
818
781
  ),
819
- sequence: ot(t)
820
- }
821
- ) : /* @__PURE__ */ g("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
822
- /* @__PURE__ */ a(
823
- "span",
824
- {
825
- className: A(
826
- "block truncate",
827
- k && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(y && t.isSubmenuParent) ? "font-medium" : "font-normal",
828
- !(k && t.isGroup) && "text-[14px]"
782
+ style: {
783
+ paddingLeft: `${t.depth * 16 + 12}px`
784
+ },
785
+ onClick: () => {
786
+ i || (P && t.isGroup || y && t.isSubmenuParent) && !le || ee(t);
787
+ },
788
+ onMouseEnter: (G) => {
789
+ if (y && t.isSubmenuParent) {
790
+ me(t.value);
791
+ const B = G.currentTarget.getBoundingClientRect();
792
+ t.rect = B;
793
+ } else
794
+ me(null);
795
+ },
796
+ "data-testid": `select-option-${ve}-${ne}`,
797
+ "data-state": l ? "checked" : "unchecked",
798
+ "data-disabled": i || void 0,
799
+ "data-component": "select-option",
800
+ role: "option",
801
+ "aria-selected": l,
802
+ "aria-disabled": i || void 0,
803
+ children: Pe ? Pe(
804
+ {
805
+ onClick: () => {
806
+ },
807
+ className: "w-full",
808
+ selected: l,
809
+ disabled: i
810
+ },
811
+ t
812
+ ) : /* @__PURE__ */ x("div", { className: "flex items-center flex-1 overflow-hidden", children: [
813
+ f && (P && t.isGroup || y && t.isSubmenuParent ? le : !0) && /* @__PURE__ */ r(
814
+ Ge,
815
+ {
816
+ checked: h ? "indeterminate" : l,
817
+ disabled: i || p,
818
+ onChange: () => {
819
+ }
820
+ }
829
821
  ),
830
- "data-testid": `select-option-label-${me}-${le}`,
831
- "data-state": l ? "checked" : "unchecked",
832
- title: ft,
833
- children: he
834
- }
835
- ),
836
- (k && t.isGroup || y && 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 })
837
- ] }),
838
- y && t.isSubmenuParent && /* @__PURE__ */ a(
839
- $e,
822
+ Ve && !(P && t.isGroup) && !(y && t.isSubmenuParent) ? /* @__PURE__ */ r(
823
+ xt,
824
+ {
825
+ label: te(
826
+ t
827
+ ),
828
+ sequence: ct(t)
829
+ }
830
+ ) : /* @__PURE__ */ x("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
831
+ /* @__PURE__ */ r(
832
+ "span",
833
+ {
834
+ className: w(
835
+ "block truncate",
836
+ P && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(y && t.isSubmenuParent) ? "font-medium" : "font-normal",
837
+ !(P && t.isGroup) && "text-[14px]"
838
+ ),
839
+ "data-testid": `select-option-label-${ve}-${ne}`,
840
+ "data-state": l ? "checked" : "unchecked",
841
+ title: mt,
842
+ children: ye
843
+ }
844
+ ),
845
+ (P && t.isGroup || y && t.isSubmenuParent) && c > 0 && /* @__PURE__ */ r("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 })
846
+ ] }),
847
+ y && t.isSubmenuParent && /* @__PURE__ */ r(
848
+ ze,
849
+ {
850
+ size: "12px",
851
+ className: "text-gray-400"
852
+ }
853
+ )
854
+ ] })
855
+ }
856
+ ),
857
+ y && it === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ r(
858
+ gt,
840
859
  {
841
- size: "12px",
842
- className: "text-gray-400"
860
+ parentOption: t,
861
+ isMulti: !!f,
862
+ isReadOnly: !!p,
863
+ isSelected: (G) => wt(G, d, !!f),
864
+ getIndeterminateState: (G) => {
865
+ const B = ge(G);
866
+ return B ? B.selected > 0 && B.selected < B.total : !1;
867
+ },
868
+ getSelectedCount: (G) => ge(G)?.selected || 0,
869
+ handleSelect: ee,
870
+ id: k
843
871
  }
844
872
  )
845
- ] })
846
- }
847
- ),
848
- y && st === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ a(
849
- xt,
850
- {
851
- parentOption: t,
852
- isMulti: !!f,
853
- isReadOnly: !!m,
854
- isSelected: (M) => St(M, d, !!f),
855
- getIndeterminateState: (M) => {
856
- const B = fe(M);
857
- return B ? B.selected > 0 && B.selected < B.total : !1;
858
- },
859
- getSelectedCount: (M) => fe(M)?.selected || 0,
860
- handleSelect: Z,
861
- id: N
862
- }
863
- )
864
- ]
865
- },
866
- e.key
867
- );
868
- })
869
- }
870
- )
873
+ ]
874
+ },
875
+ e.key
876
+ );
877
+ })
878
+ }
879
+ )
880
+ }
881
+ ),
882
+ (Ne || g || F.length > 5e3) && /* @__PURE__ */ r("div", { className: "px-3 py-[10px] border-t border-solid border-gray-100 z-10 sticky bottom-0 bg-white", children: g ? /* @__PURE__ */ x("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
883
+ /* @__PURE__ */ r(ie, { size: "12px", className: "text-gray-400" }),
884
+ /* @__PURE__ */ x("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
885
+ "Maximum ",
886
+ g,
887
+ " selections"
888
+ ] })
889
+ ] }) : F.length > 5e3 ? /* @__PURE__ */ x("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
890
+ /* @__PURE__ */ r(ie, { size: "12px", className: "text-gray-400" }),
891
+ /* @__PURE__ */ r("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: "Large dataset detected. Operations might be slower." })
892
+ ] }) : Ne })
893
+ ]
871
894
  }
872
- ),
873
- (we || x || F.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: x ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
874
- /* @__PURE__ */ a(xe, { size: "12px", className: "text-gray-400" }),
875
- /* @__PURE__ */ g("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
876
- "Maximum ",
877
- x,
878
- " selections"
879
- ] })
880
- ] }) : F.length > 5e3 ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
881
- /* @__PURE__ */ a(xe, { size: "12px", className: "text-gray-400" }),
882
- /* @__PURE__ */ a("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: "Large dataset detected. Operations might be slower." })
883
- ] }) : we })
884
- ]
885
- }
886
- ) })
887
- ] }),
888
- Se && /* @__PURE__ */ g(
895
+ ) })
896
+ ] }),
897
+ U && oe === "absolute" && /* @__PURE__ */ x(
898
+ "p",
899
+ {
900
+ className: w(
901
+ "absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-1 text-[12px] font-medium leading-[18px]",
902
+ ae ? "text-[#e15554]" : "text-gray-500"
903
+ ),
904
+ children: [
905
+ /* @__PURE__ */ r(ie, { size: "xs", className: "shrink-0" }),
906
+ /* @__PURE__ */ r("span", { className: "min-w-0", children: U })
907
+ ]
908
+ }
909
+ )
910
+ ]
911
+ }
912
+ ),
913
+ U && oe === "flow" && /* @__PURE__ */ x(
889
914
  "p",
890
915
  {
891
- className: A(
892
- "text-[12px] mt-1 flex items-center gap-1",
893
- ye ? "text-[#e15554]" : "text-gray-500"
916
+ className: w(
917
+ "text-[12px] font-medium leading-[18px] mt-1 flex items-center gap-1",
918
+ ae ? "text-[#e15554]" : "text-gray-500"
894
919
  ),
895
920
  children: [
896
- /* @__PURE__ */ a(xe, { size: "12px" }),
897
- Se
921
+ /* @__PURE__ */ r(ie, { size: "xs" }),
922
+ U
898
923
  ]
899
924
  }
900
925
  )
@@ -902,7 +927,7 @@ const At = (ge) => {
902
927
  }
903
928
  );
904
929
  };
905
- At.displayName = "Select";
930
+ Ot.displayName = "Select";
906
931
  export {
907
- At as default
932
+ Ot as default
908
933
  };