@vellira-ui/react 2.35.0 → 2.36.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.
package/dist/index.js CHANGED
@@ -1,127 +1,148 @@
1
- import { Children as e, Fragment as t, cloneElement as n, createContext as r, forwardRef as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
2
- import p from "clsx";
3
- import { createPortal as m } from "react-dom";
4
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
1
+ import e from "clsx";
2
+ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import { Children as i, Fragment as a, cloneElement as o, createContext as s, forwardRef as c, isValidElement as l, useCallback as u, useContext as d, useEffect as f, useId as p, useMemo as m, useRef as h, useState as g } from "react";
4
+ import { createPortal as _ } from "react-dom";
5
5
  import { Check as v, ChevronDown as y, ChevronRight as b, Close as x, Search as S } from "@vellira-ui/icons";
6
- import { FloatingPortal as C, arrow as w, autoUpdate as T, flip as E, offset as D, shift as O, size as k, useFloating as A, useFocus as j, useHover as M, useInteractions as N } from "@floating-ui/react";
7
- import { useControllableState as P, useDropdown as F, useModal as I, useSelect as L, useTabs as R, useTabsKeyboard as ee } from "@vellira-ui/core";
8
- import z from "focus-trap-react";
6
+ import { arrow as C, autoUpdate as w, flip as T, offset as E, shift as D, size as O, useFloating as k, useFocus as A, useHover as j, useInteractions as M } from "@floating-ui/react";
7
+ //#region src/utils/cn.ts
8
+ var N = (...t) => e(t), P = { arrow: "_arrow_8b0vb_1" }, F = ({ className: e }) => /* @__PURE__ */ n("span", {
9
+ "aria-hidden": "true",
10
+ className: N(P.arrow, e)
11
+ });
12
+ F.__velliraDropdownPart = "arrow", F.displayName = "Dropdown.Arrow";
13
+ //#endregion
9
14
  //#region src/components/Dropdown/internal/DropdownCollection.ts
10
- function B(e, t) {
15
+ function I(e, t) {
11
16
  let n = () => null;
12
17
  return n.__velliraDropdownPart = e, n.displayName = t, n;
13
18
  }
14
- function te(t) {
15
- let n = 0, r, i, o = [], s = [], c = (e) => `${e}-${n++}`;
16
- function l(e) {
17
- s.push(e), o.push({
19
+ function L(e) {
20
+ let t = 0, n, r, a, o, s = [], c = [], u = (e) => `${e}-${t++}`;
21
+ function d(e) {
22
+ c.push(e), s.push({
18
23
  type: "item",
19
24
  item: e,
20
- itemIndex: s.length - 1
25
+ itemIndex: c.length - 1
21
26
  });
22
27
  }
23
- function u(t, n = {}) {
24
- e.forEach(t, (e) => {
25
- if (a(e)) switch (e.type.__velliraDropdownPart) {
28
+ function f(e, t = {}) {
29
+ i.forEach(e, (e) => {
30
+ if (!l(e)) return;
31
+ let i = e.type;
32
+ if (i.__velliraPortal) {
33
+ a = e, f(e.props.children, t);
34
+ return;
35
+ }
36
+ switch (i.__velliraDropdownPart) {
26
37
  case "trigger":
27
- r = e;
38
+ n = e;
28
39
  return;
29
40
  case "content":
30
- i = e, u(e.props.children, n);
41
+ r = e, f(e.props.children, t);
42
+ return;
43
+ case "search":
44
+ o = e;
45
+ return;
46
+ case "arrow":
47
+ s.push({
48
+ type: "arrow",
49
+ id: u("arrow"),
50
+ props: e.props
51
+ });
31
52
  return;
32
53
  case "group": {
33
- let t = c("group"), r = e.props;
34
- o.push({
54
+ let n = u("group"), r = e.props;
55
+ s.push({
35
56
  type: "groupStart",
36
- id: t,
57
+ id: n,
37
58
  props: r
38
- }), u(r.children, n), o.push({
59
+ }), f(r.children, t), s.push({
39
60
  type: "groupEnd",
40
- id: t
61
+ id: n
41
62
  });
42
63
  return;
43
64
  }
44
65
  case "label":
45
- o.push({
66
+ s.push({
46
67
  type: "label",
47
- id: c("label"),
68
+ id: u("label"),
48
69
  props: e.props
49
70
  });
50
71
  return;
51
72
  case "separator":
52
- o.push({
73
+ s.push({
53
74
  type: "separator",
54
- id: c("separator"),
75
+ id: u("separator"),
55
76
  props: e.props
56
77
  });
57
78
  return;
58
79
  case "empty":
59
- o.push({
80
+ s.push({
60
81
  type: "empty",
61
- id: c("empty"),
82
+ id: u("empty"),
62
83
  props: e.props
63
84
  });
64
85
  return;
65
86
  case "loading":
66
- o.push({
87
+ s.push({
67
88
  type: "loading",
68
- id: c("loading"),
89
+ id: u("loading"),
69
90
  props: e.props
70
91
  });
71
92
  return;
72
93
  case "item": {
73
94
  let t = e.props;
74
- l({
95
+ d({
75
96
  type: "item",
76
- id: c("item"),
97
+ id: u("item"),
77
98
  props: t,
78
- label: ie(t.children),
99
+ label: ee(t.children),
79
100
  disabled: t.disabled
80
101
  });
81
102
  return;
82
103
  }
83
104
  case "checkboxItem": {
84
105
  let t = e.props;
85
- l({
106
+ d({
86
107
  type: "checkbox",
87
- id: c("checkbox"),
108
+ id: u("checkbox"),
88
109
  props: t,
89
- label: ie(t.children),
110
+ label: ee(t.children),
90
111
  disabled: t.disabled
91
112
  });
92
113
  return;
93
114
  }
94
115
  case "radioGroup": {
95
- let t = e.props, r = c("radio-group");
96
- u(t.children, {
97
- ...n,
116
+ let n = e.props, r = u("radio-group");
117
+ f(n.children, {
118
+ ...t,
98
119
  radioGroupId: r,
99
- radioGroupProps: t
120
+ radioGroupProps: n
100
121
  });
101
122
  return;
102
123
  }
103
124
  case "radioItem": {
104
- let t = e.props;
105
- l({
125
+ let n = e.props;
126
+ d({
106
127
  type: "radio",
107
- id: c("radio"),
108
- props: t,
109
- groupId: n.radioGroupId ?? c("radio-group"),
110
- groupProps: n.radioGroupProps,
111
- label: ie(t.children),
112
- disabled: t.disabled
128
+ id: u("radio"),
129
+ props: n,
130
+ groupId: t.radioGroupId ?? u("radio-group"),
131
+ groupProps: t.radioGroupProps,
132
+ label: ee(n.children),
133
+ disabled: n.disabled
113
134
  });
114
135
  return;
115
136
  }
116
137
  case "sub": {
117
- let t = e.props, n = re(t.children);
138
+ let t = e.props, n = z(t.children);
118
139
  if (!n.trigger) return;
119
- let r = n.trigger.props, i = te(n.content?.props.children);
120
- l({
140
+ let r = n.trigger.props, i = L(n.content?.props.children);
141
+ d({
121
142
  type: "subTrigger",
122
- id: c("sub"),
143
+ id: u("sub"),
123
144
  props: r,
124
- label: ie(r.children),
145
+ label: ee(r.children),
125
146
  disabled: r.disabled,
126
147
  content: n.content?.props.children,
127
148
  subEntries: i.entries,
@@ -135,120 +156,647 @@ function te(t) {
135
156
  case "itemShortcut":
136
157
  case "subContent":
137
158
  case "subTrigger": return;
138
- default: u(e.props.children, n);
159
+ default: f(e.props.children, t);
139
160
  }
140
161
  });
141
162
  }
142
- return u(t), {
143
- content: i,
144
- entries: o,
145
- items: s,
146
- trigger: r
163
+ return f(e), {
164
+ content: r,
165
+ entries: s,
166
+ items: c,
167
+ portal: a,
168
+ search: o,
169
+ trigger: n
147
170
  };
148
171
  }
149
- function ne(t) {
150
- let n, r, i, o, s = [];
151
- return e.forEach(t, (e) => {
152
- if (!a(e)) {
153
- s.push(e);
154
- return;
155
- }
156
- let t = e.type;
157
- if (t.__velliraDropdownPart === "itemIcon") {
158
- i = e.props.children;
172
+ function R(e) {
173
+ let t, n, r, a, o = [];
174
+ return i.forEach(e, (e) => {
175
+ if (!l(e)) {
176
+ o.push(e);
159
177
  return;
160
178
  }
161
- if (t.__velliraDropdownPart === "itemDescription") {
179
+ let i = e.type;
180
+ if (i.__velliraDropdownPart === "itemIcon") {
162
181
  r = e.props.children;
163
182
  return;
164
183
  }
165
- if (t.__velliraDropdownPart === "itemBadge") {
184
+ if (i.__velliraDropdownPart === "itemDescription") {
166
185
  n = e.props.children;
167
186
  return;
168
187
  }
169
- if (t.__velliraDropdownPart === "itemShortcut") {
170
- o = e.props.children;
188
+ if (i.__velliraDropdownPart === "itemBadge") {
189
+ t = e.props.children;
190
+ return;
191
+ }
192
+ if (i.__velliraDropdownPart === "itemShortcut") {
193
+ a = e.props.children;
171
194
  return;
172
195
  }
173
- s.push(e);
196
+ o.push(e);
174
197
  }), {
175
- badge: n,
176
- content: s,
177
- description: r,
178
- icon: i,
179
- shortcut: o
198
+ badge: t,
199
+ content: o,
200
+ description: n,
201
+ icon: r,
202
+ shortcut: a
180
203
  };
181
204
  }
182
- function re(t) {
183
- let n, r;
184
- return e.forEach(t, (e) => {
185
- if (!a(e)) return;
186
- let t = e.type;
187
- t.__velliraDropdownPart === "subTrigger" && (n = e), t.__velliraDropdownPart === "subContent" && (r = e);
205
+ function z(e) {
206
+ let t, n;
207
+ return i.forEach(e, (e) => {
208
+ if (!l(e)) return;
209
+ let r = e.type;
210
+ r.__velliraDropdownPart === "subTrigger" && (t = e), r.__velliraDropdownPart === "subContent" && (n = e);
188
211
  }), {
189
- content: r,
190
- trigger: n
212
+ content: n,
213
+ trigger: t
191
214
  };
192
215
  }
193
- function ie(t) {
194
- let n = [];
195
- function r(t) {
196
- e.forEach(t, (e) => {
216
+ function ee(e) {
217
+ let t = [];
218
+ function n(e) {
219
+ i.forEach(e, (e) => {
197
220
  if (typeof e == "string" || typeof e == "number") {
198
- n.push(String(e));
221
+ t.push(String(e));
199
222
  return;
200
223
  }
201
- if (!a(e)) return;
202
- let t = e.type;
203
- t.__velliraDropdownPart === "itemBadge" || t.__velliraDropdownPart === "itemDescription" || t.__velliraDropdownPart === "itemIcon" || t.__velliraDropdownPart === "itemShortcut" || r(e.props.children);
224
+ if (!l(e)) return;
225
+ let r = e.type;
226
+ r.__velliraDropdownPart === "itemBadge" || r.__velliraDropdownPart === "itemDescription" || r.__velliraDropdownPart === "itemIcon" || r.__velliraDropdownPart === "itemShortcut" || n(e.props.children);
204
227
  });
205
228
  }
206
- return r(t), n.join("").trim();
229
+ return n(e), t.join("").trim();
207
230
  }
208
231
  //#endregion
209
232
  //#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
210
- var ae = B("checkboxItem", "Dropdown.CheckboxItem"), V = (...e) => p(e), H = ({ children: e }) => {
211
- let [t, n] = f(!1);
212
- if (c(() => {
233
+ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled: t, content: n }) => {
234
+ f(() => {
235
+ if (!e || !t || !n) return;
236
+ let r = [], i = n.parentElement;
237
+ return Array.from(document.body.children).forEach((e) => {
238
+ e instanceof HTMLElement && (e === i || e.contains(n) || (r.push({
239
+ element: e,
240
+ ariaHidden: e.getAttribute("aria-hidden")
241
+ }), e.setAttribute("aria-hidden", "true")));
242
+ }), () => {
243
+ r.forEach(({ element: e, ariaHidden: t }) => {
244
+ if (t === null) {
245
+ e.removeAttribute("aria-hidden");
246
+ return;
247
+ }
248
+ e.setAttribute("aria-hidden", t);
249
+ });
250
+ };
251
+ }, [
252
+ e,
253
+ n,
254
+ t
255
+ ]);
256
+ }, ne = () => {
257
+ let e = !1;
258
+ return {
259
+ preventDefault: () => {
260
+ e = !0;
261
+ },
262
+ get defaultPrevented() {
263
+ return e;
264
+ }
265
+ };
266
+ }, re = (e) => {
267
+ let t = !1;
268
+ return {
269
+ originalEvent: e,
270
+ preventDefault: () => {
271
+ t = !0;
272
+ },
273
+ get defaultPrevented() {
274
+ return t;
275
+ }
276
+ };
277
+ }, ie = [
278
+ "a[href]",
279
+ "button:not([disabled])",
280
+ "textarea:not([disabled])",
281
+ "input:not([disabled])",
282
+ "select:not([disabled])",
283
+ "[tabindex]:not([tabindex=\"-1\"])"
284
+ ].join(","), ae = (e) => Array.from(e.querySelectorAll(ie)).filter((e) => !e.hasAttribute("disabled")), oe = (e) => {
285
+ (ae(e)[0] ?? e).focus();
286
+ }, V = ({ active: e, contentRef: t, enabled: n, initialFocus: r, finalFocus: i, restoreFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s }) => {
287
+ f(() => {
288
+ if (!e) return;
289
+ let n = document.activeElement, c = i?.current, l = ne();
290
+ return o?.(l), l.defaultPrevented || queueMicrotask(() => {
291
+ r?.current?.focus(), !r?.current && t.current && oe(t.current);
292
+ }), () => {
293
+ let e = ne();
294
+ s?.(e), !(e.defaultPrevented || !a) && queueMicrotask(() => {
295
+ if (c) {
296
+ c.focus();
297
+ return;
298
+ }
299
+ n instanceof HTMLElement && n.focus();
300
+ });
301
+ };
302
+ }, [
303
+ e,
304
+ t,
305
+ i,
306
+ r,
307
+ s,
308
+ o,
309
+ a
310
+ ]), f(() => {
311
+ if (!e || !n) return;
312
+ let r = (e) => {
313
+ if (e.key !== "Tab" || !t.current) return;
314
+ let n = ae(t.current);
315
+ if (n.length === 0) {
316
+ e.preventDefault(), t.current.focus();
317
+ return;
318
+ }
319
+ let r = n[0], i = n[n.length - 1];
320
+ if (e.shiftKey && document.activeElement === r) {
321
+ e.preventDefault(), i?.focus();
322
+ return;
323
+ }
324
+ !e.shiftKey && document.activeElement === i && (e.preventDefault(), r?.focus());
325
+ };
326
+ return document.addEventListener("keydown", r), () => {
327
+ document.removeEventListener("keydown", r);
328
+ };
329
+ }, [
330
+ e,
331
+ t,
332
+ n
333
+ ]);
334
+ }, se = ({ active: e, contentRef: t, ignoreRefs: n = [], closeOnEscape: r, closeOnOutsidePress: i, isTopOverlay: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) => {
335
+ let u = h(n);
336
+ u.current = n, f(() => {
337
+ if (!e) return;
338
+ let t = (e) => {
339
+ e.key !== "Escape" || !a() || (o?.(e), !(e.defaultPrevented || !r) && l());
340
+ };
341
+ return document.addEventListener("keydown", t), () => {
342
+ document.removeEventListener("keydown", t);
343
+ };
344
+ }, [
345
+ e,
346
+ r,
347
+ a,
348
+ o,
349
+ l
350
+ ]), f(() => {
351
+ if (!e) return;
352
+ let n = (e) => {
353
+ if (!a() || e.target instanceof Node && [t, ...u.current].some((t) => t.current?.contains(e.target))) return;
354
+ let n = re(e);
355
+ s?.(n), c?.(n), !(n.defaultPrevented || !i) && l();
356
+ };
357
+ return document.addEventListener("pointerdown", n), () => {
358
+ document.removeEventListener("pointerdown", n);
359
+ };
360
+ }, [
361
+ e,
362
+ i,
363
+ t,
364
+ a,
365
+ c,
366
+ s,
367
+ l
368
+ ]);
369
+ }, ce = [], le = {
370
+ add(e) {
371
+ ce = ce.filter((t) => t !== e), ce.push(e);
372
+ },
373
+ remove(e) {
374
+ ce = ce.filter((t) => t !== e);
375
+ },
376
+ isTop(e) {
377
+ return ce[ce.length - 1] === e;
378
+ }
379
+ }, ue = ({ active: e, id: t }) => (f(() => {
380
+ if (e) return le.add(t), () => {
381
+ le.remove(t);
382
+ };
383
+ }, [e, t]), { isTopOverlay: u(() => le.isTop(t), [t]) }), de = 0, H = "", fe = {
384
+ lock() {
385
+ typeof document > "u" || (de === 0 && (H = document.body.style.overflow, document.body.style.overflow = "hidden"), de += 1);
386
+ },
387
+ unlock() {
388
+ typeof document > "u" || (de = Math.max(0, de - 1), de === 0 && (document.body.style.overflow = H));
389
+ }
390
+ }, pe = ({ active: e, enabled: t = !0 }) => {
391
+ f(() => {
392
+ if (!(!e || !t)) return fe.lock(), () => {
393
+ fe.unlock();
394
+ };
395
+ }, [e, t]);
396
+ }, me = () => typeof document > "u" ? null : document.body, he = ({ container: e } = {}) => {
397
+ let [t, n] = g(!1);
398
+ return f(() => {
213
399
  n(!0);
214
- }, []), !t) return null;
215
- let r = document.getElementById("overlay-root") ?? document.body;
216
- return r ? m(e, r) : null;
217
- }, U = {
218
- dropdown: "_dropdown_g5457_1",
219
- "dropdown-in": "_dropdown-in_g5457_1",
220
- primary: "_primary_g5457_42",
221
- neutral: "_neutral_g5457_65",
222
- success: "_success_g5457_88",
223
- warning: "_warning_g5457_111",
224
- danger: "_danger_g5457_134",
225
- empty: "_empty_g5457_157",
226
- "dropdown-sheet-in": "_dropdown-sheet-in_g5457_1"
227
- }, oe = B("empty", "Dropdown.Empty"), se = ({ children: e }) => /* @__PURE__ */ g("li", {
400
+ }, []), t ? e ?? document.getElementById("overlay-root") ?? me() : null;
401
+ }, ge = ({ value: e, defaultValue: t, onChange: n }) => {
402
+ let [r, i] = g(t), a = e !== void 0;
403
+ return [a ? e : r, u((e) => {
404
+ a || i(e), n?.(e);
405
+ }, [a, n])];
406
+ }, _e = ({ activeIndex: e, setActiveIndex: t, items: n, isOpen: r, onOpen: i, onSelect: a, onClose: o, getItemText: s, loop: c = !0 }) => {
407
+ let l = h({
408
+ value: "",
409
+ timeoutId: void 0
410
+ });
411
+ f(() => () => {
412
+ l.current.timeoutId && clearTimeout(l.current.timeoutId);
413
+ }, []);
414
+ let d = u((e, t) => {
415
+ if (!n.length) return e;
416
+ let r = e;
417
+ for (let i = 0; i < n.length; i++) {
418
+ let i = r + t;
419
+ if (!c && (i < 0 || i >= n.length)) return e;
420
+ if (r = (i + n.length) % n.length, !n[r]?.disabled) return r;
421
+ }
422
+ return e;
423
+ }, [n, c]), p = u(() => n.findIndex((e) => !e.disabled), [n]), m = u(() => {
424
+ for (let e = n.length - 1; e >= 0; e--) if (!n[e].disabled) return e;
425
+ return -1;
426
+ }, [n]), g = u((t) => {
427
+ if (!s || !t) return -1;
428
+ let r = t.toLocaleLowerCase(), i = e >= 0 ? e + 1 : 0;
429
+ for (let e = 0; e < n.length; e++) {
430
+ let t = (i + e) % n.length, a = n[t];
431
+ if (a && !a.disabled && s(a).toLocaleLowerCase().startsWith(r)) return t;
432
+ }
433
+ return -1;
434
+ }, [
435
+ e,
436
+ s,
437
+ n
438
+ ]);
439
+ return { onKeyDown: u((n) => {
440
+ if (!r) {
441
+ (n.key === " " || n.key === "Enter" || n.key === "ArrowDown" || n.key === "ArrowUp") && (n.preventDefault(), i(n));
442
+ return;
443
+ }
444
+ switch (n.key) {
445
+ case "ArrowDown":
446
+ n.preventDefault(), t(d(e, 1));
447
+ break;
448
+ case "ArrowUp":
449
+ n.preventDefault(), t(d(e, -1));
450
+ break;
451
+ case "Enter":
452
+ case " ":
453
+ n.preventDefault(), a?.();
454
+ break;
455
+ case "Escape":
456
+ n.preventDefault(), o?.();
457
+ break;
458
+ case "Home":
459
+ n.preventDefault(), t(p());
460
+ break;
461
+ case "End":
462
+ n.preventDefault(), t(m());
463
+ break;
464
+ case "Tab":
465
+ o?.();
466
+ break;
467
+ default:
468
+ if (n.key.length === 1 && !n.altKey && !n.ctrlKey && !n.metaKey) {
469
+ n.preventDefault(), l.current.timeoutId && clearTimeout(l.current.timeoutId), l.current.value += n.key, l.current.timeoutId = setTimeout(() => {
470
+ l.current.value = "", l.current.timeoutId = void 0;
471
+ }, 700);
472
+ let e = g(l.current.value);
473
+ e >= 0 && t(e);
474
+ }
475
+ break;
476
+ }
477
+ }, [
478
+ e,
479
+ r,
480
+ i,
481
+ a,
482
+ o,
483
+ t,
484
+ d,
485
+ p,
486
+ m,
487
+ g
488
+ ]) };
489
+ }, ve = ({ items: e, open: t, defaultOpen: n = !1, disabled: r = !1, onOpenChange: i, onSelect: a, getItemValue: o, getItemText: s, loop: c = !0 }) => {
490
+ let [l, d] = g(n), [p, m] = g(-1), h = t !== void 0, _ = t ?? l, v = u(() => e.findIndex((e) => !e.disabled), [e]), y = u(() => {
491
+ for (let t = e.length - 1; t >= 0; t--) if (!e[t]?.disabled) return t;
492
+ return -1;
493
+ }, [e]), b = u((t, n) => {
494
+ if (t) {
495
+ m((t) => t >= 0 && !e[t]?.disabled ? t : n ?? v());
496
+ return;
497
+ }
498
+ m(-1);
499
+ }, [v, e]);
500
+ f(() => {
501
+ b(_);
502
+ }, [_, b]);
503
+ let x = u((e, t) => {
504
+ h || d(e), i?.(e), b(e, t);
505
+ }, [
506
+ h,
507
+ i,
508
+ b
509
+ ]), S = u((e = v()) => {
510
+ r || x(!0, e);
511
+ }, [
512
+ r,
513
+ v,
514
+ x
515
+ ]), C = u(() => {
516
+ _ && x(!1);
517
+ }, [_, x]), w = u(() => {
518
+ if (!r) {
519
+ if (_) {
520
+ x(!1);
521
+ return;
522
+ }
523
+ S();
524
+ }
525
+ }, [
526
+ r,
527
+ _,
528
+ S,
529
+ x
530
+ ]), T = u((t) => {
531
+ t.disabled || (a?.(o(t, e.indexOf(t))), C());
532
+ }, [
533
+ C,
534
+ o,
535
+ e,
536
+ a
537
+ ]), E = u(() => {
538
+ let t = e[p];
539
+ t && T(t);
540
+ }, [
541
+ p,
542
+ e,
543
+ T
544
+ ]), { onKeyDown: D } = _e({
545
+ activeIndex: p,
546
+ setActiveIndex: m,
547
+ items: e,
548
+ isOpen: _,
549
+ onOpen: (e) => {
550
+ S(e.key === "ArrowUp" ? y() : v());
551
+ },
552
+ onSelect: E,
553
+ onClose: C,
554
+ getItemText: s,
555
+ loop: c
556
+ });
557
+ return {
558
+ activeIndex: p,
559
+ setActiveIndex: m,
560
+ isOpen: _,
561
+ open: _,
562
+ setOpen: x,
563
+ openDropdown: S,
564
+ closeDropdown: C,
565
+ toggleDropdown: w,
566
+ selectItem: T,
567
+ select: T,
568
+ selectActiveItem: E,
569
+ onKeyDown: D,
570
+ getFirstEnabledIndex: v,
571
+ getLastEnabledIndex: y
572
+ };
573
+ }, ye = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
574
+ let a = p(), o = p(), s = p(), [c, l] = ge({
575
+ value: e,
576
+ defaultValue: t,
577
+ onChange: n
578
+ });
579
+ return {
580
+ open: c,
581
+ shouldRender: c,
582
+ setOpen: l,
583
+ requestClose: u(() => {
584
+ l(!1);
585
+ }, [l]),
586
+ closeOnOutsidePress: i ?? !0,
587
+ closeOnEscape: r ?? !0,
588
+ contentId: a,
589
+ titleId: o,
590
+ descriptionId: s
591
+ };
592
+ }, be = ({ value: e, defaultValue: t, onValueChange: n, onChange: r, options: i, multiple: a = !1, maxSelected: o, closeOnSelect: s = !a, disabled: c = !1, open: l, defaultOpen: d = !1, onOpenChange: p }) => {
593
+ let [h, _] = ge({
594
+ value: e,
595
+ defaultValue: t ?? (a ? [] : ""),
596
+ onChange: n ?? r
597
+ }), [v, y] = ge({
598
+ value: l,
599
+ defaultValue: d,
600
+ onChange: p
601
+ }), [b, x] = g(-1), S = m(() => Array.isArray(h) ? h : h ? [h] : [], [h]), C = m(() => i.find((e) => S.includes(e.value)), [i, S]), w = m(() => i.filter((e) => S.includes(e.value)), [i, S]), T = u(() => {
602
+ let e = i.findIndex((e) => S.includes(e.value) && !e.disabled);
603
+ return e >= 0 ? e : i.findIndex((e) => !e.disabled);
604
+ }, [i, S]), E = u(() => {
605
+ c || (x(T()), y(!0));
606
+ }, [
607
+ c,
608
+ T,
609
+ y
610
+ ]), D = u(() => {
611
+ y(!1);
612
+ }, [y]), O = u(() => {
613
+ if (!c) {
614
+ if (v) {
615
+ D();
616
+ return;
617
+ }
618
+ E();
619
+ }
620
+ }, [
621
+ D,
622
+ c,
623
+ v,
624
+ E
625
+ ]);
626
+ f(() => {
627
+ v && x((e) => {
628
+ let t = i[e];
629
+ return t && !t.disabled ? e : T();
630
+ });
631
+ }, [
632
+ T,
633
+ v,
634
+ i
635
+ ]);
636
+ let k = u((e) => {
637
+ if (e === "") {
638
+ _(a ? [] : ""), D();
639
+ return;
640
+ }
641
+ let t = i.find((t) => t.value === e);
642
+ if (!(!t || t.disabled)) {
643
+ if (a) {
644
+ if (!S.includes(e) && typeof o == "number" && S.length >= o) return;
645
+ let t = S.includes(e) ? S.filter((t) => t !== e) : [...S, e];
646
+ _(t), s && D();
647
+ return;
648
+ }
649
+ _(e), x(i.indexOf(t)), D();
650
+ }
651
+ }, [
652
+ D,
653
+ s,
654
+ o,
655
+ a,
656
+ i,
657
+ S,
658
+ _
659
+ ]), A = u(() => {
660
+ let e = i[b];
661
+ e && k(e.value);
662
+ }, [
663
+ b,
664
+ i,
665
+ k
666
+ ]), { onKeyDown: j } = _e({
667
+ activeIndex: b,
668
+ setActiveIndex: x,
669
+ items: i,
670
+ isOpen: v,
671
+ onOpen: E,
672
+ onClose: D,
673
+ onSelect: A,
674
+ getItemText: (e) => e.label
675
+ });
676
+ return {
677
+ selectedValue: h,
678
+ selectedValues: S,
679
+ setSelectedValue: _,
680
+ selectedOption: C,
681
+ selectedOptions: w,
682
+ isOpen: v,
683
+ open: v,
684
+ setIsOpen: y,
685
+ activeIndex: b,
686
+ setActiveIndex: x,
687
+ getInitialActiveIndex: T,
688
+ openDropdown: E,
689
+ closeDropdown: D,
690
+ toggleDropdown: O,
691
+ selectValue: k,
692
+ select: k,
693
+ selectActiveOption: A,
694
+ onKeyDown: j
695
+ };
696
+ }, xe = ({ activeIndex: e, defaultActiveIndex: t = 0, onChange: n }) => {
697
+ let [r, i] = ge({
698
+ value: e,
699
+ defaultValue: t,
700
+ onChange: n
701
+ });
702
+ return {
703
+ activeIndex: r,
704
+ setActiveIndex: i
705
+ };
706
+ }, U = ({ activeIndex: e, setActiveIndex: t, tabRefs: n, orientation: r = "horizontal", onNavigate: i }) => ({ onKeyDown: u((a) => {
707
+ let o = (e) => !!(e?.disabled || e?.props?.disabled), s = (e, t) => {
708
+ let r = n.current.length;
709
+ if (!r) return e;
710
+ let i = e;
711
+ for (let e = 0; e < r; e++) {
712
+ i = (i + t + r) % r;
713
+ let e = n.current[i];
714
+ if (e && !o(e)) return i;
715
+ }
716
+ return e;
717
+ }, c = () => n.current.findIndex((e) => e && !o(e)), l = () => {
718
+ for (let e = n.current.length - 1; e >= 0; e--) {
719
+ let t = n.current[e];
720
+ if (t && !o(t)) return e;
721
+ }
722
+ return e;
723
+ }, u = e;
724
+ switch (a.key) {
725
+ case "ArrowLeft":
726
+ r === "horizontal" && (a.preventDefault(), u = s(e, -1));
727
+ break;
728
+ case "ArrowRight":
729
+ r === "horizontal" && (a.preventDefault(), u = s(e, 1));
730
+ break;
731
+ case "ArrowUp":
732
+ r === "vertical" && (a.preventDefault(), u = s(e, -1));
733
+ break;
734
+ case "ArrowDown":
735
+ r === "vertical" && (a.preventDefault(), u = s(e, 1));
736
+ break;
737
+ case "Home": {
738
+ a.preventDefault();
739
+ let t = c();
740
+ u = t === -1 ? e : t;
741
+ break;
742
+ }
743
+ case "End":
744
+ a.preventDefault(), u = l();
745
+ break;
746
+ default: return;
747
+ }
748
+ u !== e && (t(u), i?.(u));
749
+ }, [
750
+ e,
751
+ i,
752
+ r,
753
+ t,
754
+ n
755
+ ]) }), Se = s(null), Ce = ({ children: e, container: t = null }) => /* @__PURE__ */ n(Se.Provider, {
756
+ value: t,
757
+ children: e
758
+ }), we = ({ children: e, container: t }) => {
759
+ let n = d(Se), r = he({ container: t ?? n });
760
+ return r ? _(e, r) : null;
761
+ };
762
+ we.__velliraPortal = !0, we.displayName = "Portal", Ce.displayName = "PortalProvider";
763
+ var Te = {
764
+ dropdown: "_dropdown_m7rnq_1",
765
+ "dropdown-in": "_dropdown-in_m7rnq_1",
766
+ primary: "_primary_m7rnq_42",
767
+ neutral: "_neutral_m7rnq_65",
768
+ success: "_success_m7rnq_88",
769
+ warning: "_warning_m7rnq_111",
770
+ danger: "_danger_m7rnq_134",
771
+ empty: "_empty_m7rnq_157",
772
+ searchWrap: "_searchWrap_m7rnq_165",
773
+ search: "_search_m7rnq_165",
774
+ "dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
775
+ }, Ee = I("empty", "Dropdown.Empty"), De = ({ children: e }) => /* @__PURE__ */ n("li", {
228
776
  role: "presentation",
229
- className: U.empty,
777
+ className: Te.empty,
230
778
  children: e ?? "No actions available"
231
779
  });
232
- se.displayName = "DropdownEmptySurface";
780
+ De.displayName = "DropdownEmptySurface";
233
781
  //#endregion
234
782
  //#region src/components/Dropdown/Group/DropdownGroup.tsx
235
- var ce = B("group", "Dropdown.Group"), le = () => null;
236
- le.displayName = "DropdownGroupSurface";
783
+ var Oe = I("group", "Dropdown.Group"), ke = () => null;
784
+ ke.displayName = "DropdownGroupSurface";
237
785
  //#endregion
238
786
  //#region src/components/Dropdown/internal/DropdownContext.tsx
239
- var ue = r(null), de = r(null), fe = r(null), pe = ue.Provider, me = de.Provider;
240
- fe.Provider;
241
- function he() {
242
- let e = s(ue);
787
+ var Ae = s(null), je = s(null), Me = s(null), Ne = Ae.Provider, Pe = je.Provider;
788
+ Me.Provider;
789
+ function W() {
790
+ let e = d(Ae);
243
791
  if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
244
792
  return e;
245
793
  }
246
- function ge() {
247
- let e = s(de);
794
+ function Fe() {
795
+ let e = d(je);
248
796
  if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
249
797
  return e;
250
798
  }
251
- var W = {
799
+ var G = {
252
800
  item: "_item_1vj4n_1",
253
801
  disabled: "_disabled_1vj4n_22",
254
802
  active: "_active_1vj4n_37",
@@ -273,94 +821,98 @@ var W = {
273
821
  "dropdown-sub-in": "_dropdown-sub-in_1vj4n_1",
274
822
  subLabel: "_subLabel_1vj4n_276",
275
823
  subSeparator: "_subSeparator_1vj4n_284"
276
- }, _e = B("item", "Dropdown.Item"), ve = ({ item: e, itemIndex: t }) => {
277
- let n = he(), [r, i] = f(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), a = n.activeIndex === t, o = n.openSubId === e.id, s = e.type === "checkbox", c = e.type === "radio", l = e.type === "subTrigger", u = s ? e.props.checked ?? r : c ? (e.groupProps?.value ?? n.radioValues[e.groupId]) === e.props.value : !1, d = n.loading || e.disabled, p = e.props, m = ne(p.children), y = m.icon ?? p.icon, x = m.description ?? ("description" in p ? p.description : void 0), S = m.badge ?? ("badge" in p ? p.badge : void 0), C = m.shortcut ?? p.shortcut, w = m.content.length ? m.content : p.children, T = "color" in p ? p.color : void 0, E = e.type === "item" ? e.props.href : void 0, D = e.type === "item" ? e.props.target : void 0, O = e.type === "item" ? e.props.download : void 0, k = n.getItemId(t), A = s ? "menuitemcheckbox" : c ? "menuitemradio" : "menuitem", j = e.type === "item" && D === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, M = E ? "a" : "li", N = s || c, P = (t) => {
278
- if (d) {
824
+ }, Ie = I("item", "Dropdown.Item"), Le = ({ item: e, itemIndex: i }) => {
825
+ let a = W(), o = h(void 0), [s, c] = g(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), l = a.activeIndex === i, u = a.openSubId === e.id, d = e.type === "checkbox", f = e.type === "radio", p = e.type === "subTrigger", m = d ? e.props.checked ?? s : f ? (e.groupProps?.value ?? a.radioValues[e.groupId]) === e.props.value : !1, _ = a.loading || e.disabled, y = e.props, x = R(y.children), S = x.icon ?? y.icon, C = x.description ?? ("description" in y ? y.description : void 0), w = x.badge ?? ("badge" in y ? y.badge : void 0), T = x.shortcut ?? y.shortcut, E = x.content.length ? x.content : y.children, D = "color" in y ? y.color : void 0, O = e.type === "item" ? e.props.href : void 0, k = e.type === "item" ? e.props.target : void 0, A = e.type === "item" ? e.props.download : void 0, j = a.getItemId(i), M = d ? "menuitemcheckbox" : f ? "menuitemradio" : "menuitem", P = e.type === "item" && k === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, F = O ? "a" : "li", I = d || f, L = (t) => {
826
+ if (_) {
279
827
  t.preventDefault();
280
828
  return;
281
829
  }
282
- if (s && e.type === "checkbox") {
283
- let t = !u;
284
- i(t), e.props.onCheckedChange?.(t);
830
+ if (d && e.type === "checkbox") {
831
+ let t = !m;
832
+ c(t), e.props.onCheckedChange?.(t);
285
833
  }
286
- n.selectItem(e, ye(t));
834
+ a.selectItem(e, Re(t));
287
835
  };
288
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(M, {
289
- id: k,
290
- role: A,
291
- href: M === "a" && !d ? E : void 0,
292
- target: M === "a" && !d ? D : void 0,
293
- rel: M === "a" ? j : void 0,
294
- download: M === "a" && !d ? O : void 0,
295
- tabIndex: d ? -1 : 0,
296
- "aria-disabled": d || void 0,
297
- "aria-checked": s || c ? u : void 0,
298
- "aria-haspopup": l ? "menu" : void 0,
299
- "aria-expanded": l ? o : void 0,
300
- "data-active": a || void 0,
301
- "data-state": o ? "open" : void 0,
302
- className: V(W.item, W[n.size], {
303
- [W.active]: a,
304
- [W.disabled]: d,
305
- [W.checked]: u
306
- }, T && T !== "default" ? W[T] : void 0, p.className),
307
- onClick: P,
836
+ return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(F, {
837
+ id: j,
838
+ role: M,
839
+ href: F === "a" && !_ ? O : void 0,
840
+ target: F === "a" && !_ ? k : void 0,
841
+ rel: F === "a" ? P : void 0,
842
+ download: F === "a" && !_ ? A : void 0,
843
+ tabIndex: _ ? -1 : 0,
844
+ "aria-disabled": _ || void 0,
845
+ "aria-checked": d || f ? m : void 0,
846
+ "aria-haspopup": p ? "menu" : void 0,
847
+ "aria-expanded": p ? u : void 0,
848
+ "data-active": l || void 0,
849
+ "data-state": u ? "open" : void 0,
850
+ className: N(G.item, G[a.size], {
851
+ [G.active]: l,
852
+ [G.disabled]: _,
853
+ [G.checked]: m
854
+ }, D && D !== "default" ? G[D] : void 0, y.className),
855
+ onClick: L,
308
856
  onMouseEnter: () => {
309
- d || (n.setActiveIndex(t), l && window.setTimeout(() => n.setOpenSubId(e.id), 120));
857
+ _ || (a.setActiveIndex(i), p ? (window.clearTimeout(o.current), o.current = window.setTimeout(() => a.setOpenSubId(e.id), 120)) : (window.clearTimeout(o.current), a.setOpenSubId(void 0)));
858
+ },
859
+ onMouseLeave: () => {
860
+ window.clearTimeout(o.current);
310
861
  },
311
862
  children: [
312
- N && /* @__PURE__ */ g("span", {
313
- className: W.indicator,
863
+ I && /* @__PURE__ */ n("span", {
864
+ className: G.indicator,
314
865
  "aria-hidden": "true",
315
- children: u ? /* @__PURE__ */ g(v, {}) : null
866
+ children: m ? /* @__PURE__ */ n(v, {}) : null
316
867
  }),
317
- y && /* @__PURE__ */ g("span", {
318
- className: W.itemIcon,
319
- children: y
868
+ S && /* @__PURE__ */ n("span", {
869
+ className: G.itemIcon,
870
+ children: S
320
871
  }),
321
- /* @__PURE__ */ _("span", {
322
- className: W.itemText,
323
- children: [/* @__PURE__ */ g("span", {
324
- className: W.itemLabel,
325
- children: w
326
- }), x && /* @__PURE__ */ g("span", {
327
- className: W.itemDescription,
328
- children: x
872
+ /* @__PURE__ */ r("span", {
873
+ className: G.itemText,
874
+ children: [/* @__PURE__ */ n("span", {
875
+ className: G.itemLabel,
876
+ children: E
877
+ }), C && /* @__PURE__ */ n("span", {
878
+ className: G.itemDescription,
879
+ children: C
329
880
  })]
330
881
  }),
331
- S && /* @__PURE__ */ g("span", {
332
- className: W.itemBadge,
333
- children: S
882
+ w && /* @__PURE__ */ n("span", {
883
+ className: G.itemBadge,
884
+ children: w
334
885
  }),
335
- C && /* @__PURE__ */ g("span", {
336
- className: W.itemShortcut,
337
- children: C
886
+ T && /* @__PURE__ */ n("span", {
887
+ className: G.itemShortcut,
888
+ children: T
338
889
  }),
339
- l && /* @__PURE__ */ g("span", {
340
- className: W.itemShortcut,
890
+ p && /* @__PURE__ */ n("span", {
891
+ className: G.itemShortcut,
341
892
  "aria-hidden": "true",
342
- children: /* @__PURE__ */ g(b, {})
893
+ children: /* @__PURE__ */ n(b, {})
343
894
  })
344
895
  ]
345
- }), l && o && e.subEntries.length > 0 && /* @__PURE__ */ g("ul", {
896
+ }), p && u && e.subEntries.length > 0 && /* @__PURE__ */ n("ul", {
346
897
  role: "menu",
347
- className: W.subContent,
348
- children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ g("li", {
898
+ className: G.subContent,
899
+ onMouseEnter: () => a.setOpenSubId(e.id),
900
+ children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ n("li", {
349
901
  role: "presentation",
350
- className: W.subLabel,
902
+ className: G.subLabel,
351
903
  children: e.props.children
352
- }, e.id) : e.type === "separator" ? /* @__PURE__ */ g("li", {
904
+ }, e.id) : e.type === "separator" ? /* @__PURE__ */ n("li", {
353
905
  role: "separator",
354
- className: W.subSeparator,
906
+ className: G.subSeparator,
355
907
  "aria-hidden": "true"
356
- }, e.id) : e.type === "item" ? /* @__PURE__ */ g(be, {
908
+ }, e.id) : e.type === "item" ? /* @__PURE__ */ n(ze, {
357
909
  item: e.item,
358
- id: `${k}-${e.itemIndex}`
910
+ id: `${j}-${e.itemIndex}`
359
911
  }, e.item.id) : null)
360
912
  })] });
361
913
  };
362
- ve.displayName = "DropdownItemRow";
363
- function ye(e) {
914
+ Le.displayName = "DropdownItemRow";
915
+ function Re(e) {
364
916
  let t = !1;
365
917
  return {
366
918
  originalEvent: e,
@@ -372,145 +924,182 @@ function ye(e) {
372
924
  }
373
925
  };
374
926
  }
375
- function be({ id: e, item: t }) {
376
- let n = he(), r = t.props, i = ne(r.children), a = i.icon ?? r.icon, o = i.content.length ? i.content : r.children, s = "color" in r ? r.color : void 0, c = n.loading || t.disabled;
377
- return /* @__PURE__ */ _("li", {
927
+ function ze({ id: e, item: t }) {
928
+ let i = W(), [a, o] = g(t.type === "checkbox" ? t.props.defaultChecked ?? !1 : !1), s = t.type === "checkbox", c = t.type === "radio", l = s ? t.props.checked ?? a : c ? (t.groupProps?.value ?? i.radioValues[t.groupId]) === t.props.value : !1, u = t.props, d = R(u.children), f = d.icon ?? u.icon, p = d.description ?? ("description" in u ? u.description : void 0), m = d.badge ?? ("badge" in u ? u.badge : void 0), h = d.shortcut ?? u.shortcut, _ = d.content.length ? d.content : u.children, y = "color" in u ? u.color : void 0, b = i.loading || t.disabled, x = t.type === "item" ? t.props.href : void 0, S = t.type === "item" ? t.props.target : void 0, C = t.type === "item" ? t.props.download : void 0, w = s ? "menuitemcheckbox" : c ? "menuitemradio" : "menuitem", T = t.type === "item" && S === "_blank" && !t.props.rel ? "noreferrer noopener" : t.type === "item" ? t.props.rel : void 0, E = x ? "a" : "li", D = s || c, O = (e) => {
929
+ if (b) {
930
+ e.preventDefault();
931
+ return;
932
+ }
933
+ if (s && t.type === "checkbox") {
934
+ let e = !l;
935
+ o(e), t.props.onCheckedChange?.(e);
936
+ }
937
+ i.selectItem(t, Re(e));
938
+ };
939
+ return /* @__PURE__ */ r(E, {
378
940
  id: e,
379
- role: "menuitem",
380
- tabIndex: c ? -1 : 0,
381
- "aria-disabled": c || void 0,
382
- className: V(W.item, W[n.size], { [W.disabled]: c }, s && s !== "default" ? W[s] : void 0),
383
- onClick: (e) => {
384
- c || n.selectItem(t, ye(e));
385
- },
386
- children: [a && /* @__PURE__ */ g("span", {
387
- className: W.itemIcon,
388
- children: a
389
- }), /* @__PURE__ */ g("span", {
390
- className: W.itemText,
391
- children: /* @__PURE__ */ g("span", {
392
- className: W.itemLabel,
393
- children: o
941
+ role: w,
942
+ href: E === "a" && !b ? x : void 0,
943
+ target: E === "a" && !b ? S : void 0,
944
+ rel: E === "a" ? T : void 0,
945
+ download: E === "a" && !b ? C : void 0,
946
+ tabIndex: b ? -1 : 0,
947
+ "aria-disabled": b || void 0,
948
+ "aria-checked": s || c ? l : void 0,
949
+ className: N(G.item, G[i.size], {
950
+ [G.disabled]: b,
951
+ [G.checked]: l
952
+ }, y && y !== "default" ? G[y] : void 0),
953
+ onClick: O,
954
+ children: [
955
+ D && /* @__PURE__ */ n("span", {
956
+ className: G.indicator,
957
+ "aria-hidden": "true",
958
+ children: l ? /* @__PURE__ */ n(v, {}) : null
959
+ }),
960
+ f && /* @__PURE__ */ n("span", {
961
+ className: G.itemIcon,
962
+ children: f
963
+ }),
964
+ /* @__PURE__ */ r("span", {
965
+ className: G.itemText,
966
+ children: [/* @__PURE__ */ n("span", {
967
+ className: G.itemLabel,
968
+ children: _
969
+ }), p && /* @__PURE__ */ n("span", {
970
+ className: G.itemDescription,
971
+ children: p
972
+ })]
973
+ }),
974
+ m && /* @__PURE__ */ n("span", {
975
+ className: G.itemBadge,
976
+ children: m
977
+ }),
978
+ h && /* @__PURE__ */ n("span", {
979
+ className: G.itemShortcut,
980
+ children: h
394
981
  })
395
- })]
982
+ ]
396
983
  });
397
984
  }
398
- var xe = { group: "_group_aviwv_1" }, Se = B("label", "Dropdown.Label"), Ce = ({ children: e, className: t }) => /* @__PURE__ */ g("li", {
985
+ var Be = { group: "_group_aviwv_1" }, Ve = I("label", "Dropdown.Label"), K = ({ children: e, className: t }) => /* @__PURE__ */ n("li", {
399
986
  role: "presentation",
400
- className: V(xe.group, t),
987
+ className: N(Be.group, t),
401
988
  children: e
402
989
  });
403
- Ce.displayName = "DropdownLabelSurface";
990
+ K.displayName = "DropdownLabelSurface";
404
991
  //#endregion
405
992
  //#region src/components/Dropdown/Loading/DropdownLoading.tsx
406
- var we = B("loading", "Dropdown.Loading"), Te = ({ children: e }) => /* @__PURE__ */ g("li", {
993
+ var q = I("loading", "Dropdown.Loading"), He = ({ children: e }) => /* @__PURE__ */ n("li", {
407
994
  role: "presentation",
408
995
  "aria-live": "polite",
409
- className: U.empty,
996
+ className: Te.empty,
410
997
  children: e ?? "Loading actions..."
411
998
  });
412
- Te.displayName = "DropdownLoadingSurface";
413
- var Ee = { separator: "_separator_1v11r_1" }, De = B("separator", "Dropdown.Separator"), Oe = ({ className: e }) => /* @__PURE__ */ g("li", {
999
+ He.displayName = "DropdownLoadingSurface";
1000
+ var Ue = { separator: "_separator_1v11r_1" }, We = I("separator", "Dropdown.Separator"), Ge = ({ className: e }) => /* @__PURE__ */ n("li", {
414
1001
  role: "separator",
415
- className: V(Ee.separator, e),
1002
+ className: N(Ue.separator, e),
416
1003
  "aria-hidden": "true"
417
1004
  });
418
- Oe.displayName = "DropdownSeparatorSurface";
1005
+ Ge.displayName = "DropdownSeparatorSurface";
419
1006
  //#endregion
420
1007
  //#region src/components/Dropdown/Content/DropdownContent.tsx
421
- var ke = ({ className: e }) => {
422
- let n = he();
423
- if (!n.isOpen) return null;
424
- let r = V(U.dropdown, U[n.color], n.contentProps?.className, e), i = /* @__PURE__ */ g("ul", {
425
- ref: n.setContentRef,
426
- id: n.contentId,
1008
+ var Ke = ({ className: e }) => {
1009
+ let t = W();
1010
+ if (!t.isOpen) return null;
1011
+ let i = N(Te.dropdown, Te[t.color], t.contentProps?.className, t.dropdownClassName, e), o = /* @__PURE__ */ r("ul", {
1012
+ ref: t.setContentRef,
1013
+ id: t.contentId,
427
1014
  role: "menu",
428
1015
  tabIndex: -1,
429
- "aria-labelledby": n.triggerId,
430
- "aria-activedescendant": n.activeIndex >= 0 ? n.getItemId(n.activeIndex) : void 0,
431
- onKeyDown: n.onKeyDown,
1016
+ "aria-labelledby": t.triggerId,
1017
+ "aria-activedescendant": t.activeIndex >= 0 && t.activeIndex < t.items.length ? t.getItemId(t.activeIndex) : void 0,
1018
+ onKeyDown: t.onKeyDown,
432
1019
  style: {
433
- ...n.surfaceStyle,
434
- ...n.contentProps?.style
1020
+ ...t.surfaceStyle,
1021
+ ...t.contentProps?.style
435
1022
  },
436
- className: r,
437
- "data-color": n.color,
438
- children: n.loading ? /* @__PURE__ */ g(Te, { children: n.loadingText }) : n.entries.length ? n.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ g(le, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ g(Ce, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ g(Oe, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ g(se, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ g(Te, { children: e.props.children }, e.id) : /* @__PURE__ */ g(t, { children: /* @__PURE__ */ g(ve, {
1023
+ className: i,
1024
+ "data-color": t.color,
1025
+ children: [t.searchable && /* @__PURE__ */ r("li", {
1026
+ role: "presentation",
1027
+ className: N(Te.searchWrap, t.searchProps?.className),
1028
+ children: [/* @__PURE__ */ n(S, { "aria-hidden": "true" }), /* @__PURE__ */ n("input", {
1029
+ className: Te.search,
1030
+ value: t.searchValue,
1031
+ placeholder: t.searchPlaceholder,
1032
+ "aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
1033
+ onInput: (e) => t.setSearchValue(e.currentTarget.value),
1034
+ onChange: (e) => t.setSearchValue(e.target.value),
1035
+ onKeyDown: (e) => {
1036
+ e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === "Escape" || e.stopPropagation();
1037
+ }
1038
+ })]
1039
+ }), t.loading ? /* @__PURE__ */ n(He, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(De, { children: t.noOptionsText }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ n(ke, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ n(K, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ n(Ge, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ n(De, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ n(He, { children: e.props.children }, e.id) : e.type === "arrow" ? /* @__PURE__ */ n(F, { ...e.props }, e.id) : /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n(Le, {
439
1040
  item: e.item,
440
1041
  itemIndex: e.itemIndex
441
- }) }, e.item.id)) : /* @__PURE__ */ g(se, {})
1042
+ }) }, e.item.id)) : /* @__PURE__ */ n(De, {})]
442
1043
  });
443
- return n.portal ? /* @__PURE__ */ g(H, { children: i }) : i;
1044
+ return t.portal ? /* @__PURE__ */ n(we, { children: o }) : o;
444
1045
  };
445
- ke.__velliraDropdownPart = "content", ke.displayName = "Dropdown.Content";
1046
+ Ke.__velliraDropdownPart = "content", Ke.displayName = "Dropdown.Content";
446
1047
  //#endregion
447
1048
  //#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
448
- var Ae = B("itemBadge", "Dropdown.ItemBadge"), je = B("itemDescription", "Dropdown.ItemDescription"), Me = B("itemIcon", "Dropdown.ItemIcon"), Ne = B("itemShortcut", "Dropdown.ItemShortcut"), Pe = B("radioGroup", "Dropdown.RadioGroup"), Fe = B("radioItem", "Dropdown.RadioItem"), Ie = (e) => {
449
- let [t, n] = f(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
450
- return c(() => {
1049
+ var qe = I("itemBadge", "Dropdown.ItemBadge"), Je = I("itemDescription", "Dropdown.ItemDescription"), Ye = I("itemIcon", "Dropdown.ItemIcon"), Xe = I("itemShortcut", "Dropdown.ItemShortcut"), Ze = I("radioGroup", "Dropdown.RadioGroup"), Qe = I("radioItem", "Dropdown.RadioItem"), $e = (e) => {
1050
+ let [t, n] = g(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
1051
+ return f(() => {
451
1052
  if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
452
1053
  let t = window.matchMedia(`(max-width: ${e}px)`), r = () => n(t.matches);
453
1054
  return r(), t.addEventListener("change", r), () => {
454
1055
  t.removeEventListener("change", r);
455
1056
  };
456
1057
  }, [e]), t;
457
- }, Le = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, matchTriggerWidth: a = !1, avoidCollisions: o = !0, mobileSheetBreakpoint: s, middleware: l = [] } = {}) => {
458
- let d = Ie(s), { refs: f, floatingStyles: p, update: m, context: h, middlewareData: g, placement: _ } = A({
1058
+ }, et = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, matchTriggerWidth: a = !1, avoidCollisions: o = !0, mobileSheetBreakpoint: s, middleware: c = [] } = {}) => {
1059
+ let l = $e(s), { refs: u, floatingStyles: d, update: p, context: h, middlewareData: g, placement: _ } = k({
459
1060
  open: e,
460
1061
  onOpenChange: t,
461
1062
  placement: n,
462
1063
  strategy: r,
463
1064
  transform: !1,
464
- middleware: u(() => [
465
- D(i),
466
- ...o ? [E()] : [],
467
- k({ apply({ rects: e, elements: t }) {
468
- !a || d || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
1065
+ middleware: m(() => [
1066
+ E(i),
1067
+ ...o ? [T()] : [],
1068
+ O({ apply({ rects: e, elements: t }) {
1069
+ !a || l || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
469
1070
  } }),
470
- ...o ? [O({ padding: 8 })] : [],
471
- ...l
1071
+ ...o ? [D({ padding: 8 })] : [],
1072
+ ...c
472
1073
  ], [
473
1074
  o,
1075
+ c,
474
1076
  l,
475
- d,
476
1077
  a,
477
1078
  i
478
1079
  ]),
479
- whileElementsMounted: T
1080
+ whileElementsMounted: w
480
1081
  });
481
- return c(() => {
482
- d && f.floating.current?.style.removeProperty("width");
483
- }, [d, f.floating]), {
1082
+ return f(() => {
1083
+ l && u.floating.current?.style.removeProperty("width");
1084
+ }, [l, u.floating]), {
484
1085
  context: h,
485
1086
  placement: _,
486
1087
  middlewareData: g,
487
- floatingStyles: d ? {} : p,
488
- isMobileSheet: d,
489
- setRef: f.setReference,
490
- setFloatingRef: f.setFloating,
491
- updatePosition: m
1088
+ floatingStyles: l ? {} : d,
1089
+ isMobileSheet: l,
1090
+ setRef: u.setReference,
1091
+ setFloatingRef: u.setFloating,
1092
+ updatePosition: p
492
1093
  };
493
- }, Re = (e, t, n = !0) => {
494
- let r = d(e);
495
- r.current = e;
496
- let i = d(t);
497
- i.current = t, c(() => {
498
- if (!n) return;
499
- let e = (e) => {
500
- let t = e.target;
501
- r.current.every((e) => e.current && !e.current.contains(t)) && i.current();
502
- };
503
- return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
504
- }, [n]);
505
1094
  };
506
1095
  //#endregion
507
1096
  //#region src/components/Dropdown/internal/composeEventHandlers.ts
508
- function ze(e, t) {
1097
+ function tt(e, t) {
509
1098
  return (n) => {
510
1099
  e?.(n), n.defaultPrevented || t(n);
511
1100
  };
512
1101
  }
513
- function Be(...e) {
1102
+ function nt(...e) {
514
1103
  return (t) => {
515
1104
  e.forEach((e) => {
516
1105
  if (e) {
@@ -523,155 +1112,183 @@ function Be(...e) {
523
1112
  });
524
1113
  };
525
1114
  }
526
- function G(e) {
1115
+ function rt(e) {
527
1116
  return typeof e == "number" ? `${e}px` : e;
528
1117
  }
529
- var K = { wrapper: "_wrapper_14ue8_1" }, Ve = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, size: i = "md", color: a = "primary", placement: s = "bottom-start", offset: p = 2, matchTriggerWidth: m = !1, minWidth: h, maxWidth: v, portal: y = !0, avoidCollisions: b = !0, modal: x = !1, closeOnSelect: S = !0, loop: C = !0, disabled: w = !1, loading: T = !1, loadingText: E = "Loading actions...", className: D }) => {
530
- let O = l(), k = `${O}-trigger`, A = `${O}-menu`, j = d(null), M = d(null), [N, P] = f(), [I, L] = f({}), R = u(() => te(e), [e]), ee = u(() => R.items.map((e) => ({
1118
+ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultOpen: i = !1, onOpenChange: a, size: o = "md", color: s = "primary", placement: c = "bottom-start", offset: l = 2, matchTriggerWidth: d = !1, minWidth: _, maxWidth: v, portal: y = !0, avoidCollisions: b = !0, modal: x = !1, closeOnSelect: S = !0, loop: C = !0, disabled: w = !1, loading: T = !1, loadingText: E = "Loading actions...", searchable: D = !1, command: O = !1, searchValue: k, defaultSearchValue: A = "", searchPlaceholder: j, onSearch: M, empty: P, noOptionsText: F, triggerClassName: I, dropdownClassName: R, className: z }) => {
1119
+ let ee = p(), B = `${ee}-trigger`, te = `${ee}-menu`, ne = h(null), re = h(null), [ie, ae] = g(), [oe, V] = g({}), [ce, le] = g(A), de = k ?? ce, H = m(() => L(e), [e]), fe = H.content?.props.command ?? !1, me = D || O || fe || !!H.search, he = m(() => st(H.items), [H.items]), ge = m(() => H.items.map((e) => ({
531
1120
  disabled: e.disabled,
532
1121
  label: e.label
533
- })), [R.items]);
534
- c(() => {
535
- L((e) => {
1122
+ })), [H.items]), _e = m(() => !me || !de.trim() ? H : ct(H, de), [
1123
+ me,
1124
+ H,
1125
+ de
1126
+ ]), ye = m(() => _e.items.map((e) => ({
1127
+ disabled: e.disabled,
1128
+ label: e.label
1129
+ })), [_e.items]);
1130
+ f(() => {
1131
+ V((e) => {
536
1132
  let t = { ...e };
537
- return R.items.forEach((e) => {
1133
+ return he.forEach((e) => {
538
1134
  e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
539
1135
  }), t;
540
1136
  });
541
- }, [R.items]);
542
- let { floatingStyles: z, setRef: B, setFloatingRef: ne } = Le({
543
- open: t,
544
- onOpenChange: r,
545
- placement: s,
546
- matchTriggerWidth: m,
547
- avoidCollisions: b,
548
- offset: p,
549
- mobileSheetBreakpoint: 640
550
- }), { activeIndex: re, setActiveIndex: ie, isOpen: ae, closeDropdown: H, toggleDropdown: U, onKeyDown: oe } = F({
551
- items: ee,
1137
+ }, [he]);
1138
+ let { activeIndex: be, setActiveIndex: xe, isOpen: U, closeDropdown: Se, toggleDropdown: Ce, onKeyDown: we } = ve({
1139
+ items: me ? ye : ge,
552
1140
  open: t,
553
- defaultOpen: n,
1141
+ defaultOpen: i,
554
1142
  disabled: w,
555
- onOpenChange: r,
556
- getItemValue: (e, t) => R.items[t]?.id ?? "",
1143
+ onOpenChange: a,
1144
+ getItemValue: (e, t) => (me ? _e.items : H.items)[t]?.id ?? "",
557
1145
  getItemText: (e) => e.label,
558
1146
  loop: C
1147
+ }), { floatingStyles: Te, setRef: Ee, setFloatingRef: De } = et({
1148
+ open: U,
1149
+ placement: c,
1150
+ matchTriggerWidth: d,
1151
+ avoidCollisions: b,
1152
+ offset: l,
1153
+ mobileSheetBreakpoint: 640
1154
+ }), Oe = u((e) => {
1155
+ k === void 0 && le(e), M?.(e), xe(0);
1156
+ }, [
1157
+ M,
1158
+ k,
1159
+ xe
1160
+ ]), { isTopOverlay: ke } = ue({
1161
+ active: U,
1162
+ id: te
559
1163
  });
560
- c(() => {
561
- if (!x || !ae) return;
562
- let e = document.body.style.overflow;
563
- return document.body.style.overflow = "hidden", () => {
564
- document.body.style.overflow = e;
565
- };
566
- }, [ae, x]);
567
- let se = o(() => {
568
- H(), j.current?.focus();
569
- }, [H]), ce = o((e, t) => {
1164
+ pe({
1165
+ active: U,
1166
+ enabled: x
1167
+ });
1168
+ let Ae = u(() => {
1169
+ Se(), ne.current?.focus();
1170
+ }, [Se]), je = u((e, t) => {
570
1171
  if (e.disabled || T) return;
571
1172
  if (e.type === "subTrigger") {
572
- P(e.id);
1173
+ ae(e.id);
573
1174
  return;
574
1175
  }
575
- e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (L((t) => ({
1176
+ e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (V((t) => ({
576
1177
  ...t,
577
1178
  [e.groupId]: e.props.value
578
1179
  })), e.groupProps?.onValueChange?.(e.props.value));
579
1180
  let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && S);
580
- !t.defaultPrevented && n && se();
1181
+ !t.defaultPrevented && n && Ae();
581
1182
  }, [
582
- se,
1183
+ Ae,
583
1184
  S,
584
1185
  T
585
- ]), le = o((e) => {
586
- let t = R.items[re];
1186
+ ]), Me = u((e) => {
1187
+ let t = _e.items[be];
587
1188
  if (e.key === "ArrowRight" && t?.type === "subTrigger") {
588
- e.preventDefault(), P(t.id);
1189
+ e.preventDefault(), ae(t.id);
589
1190
  return;
590
1191
  }
591
- if (e.key === "ArrowLeft" && N) {
592
- e.preventDefault(), P(void 0);
1192
+ if (e.key === "ArrowLeft" && ie) {
1193
+ e.preventDefault(), ae(void 0);
593
1194
  return;
594
1195
  }
595
1196
  if ((e.key === "Enter" || e.key === " ") && t) {
596
1197
  e.preventDefault();
597
- let n = He(e);
598
- ce(t, n);
1198
+ let n = ot(e);
1199
+ je(t, n);
599
1200
  return;
600
1201
  }
601
- oe(e), e.key === "Escape" && j.current?.focus();
1202
+ we(e), e.key === "Escape" && ne.current?.focus();
602
1203
  }, [
603
- re,
604
- oe,
605
- N,
606
- R.items,
607
- ce
608
- ]), ue = o((e) => {
609
- e.preventDefault(), U();
610
- }, [U]), de = o((e) => {
611
- j.current = e, B(e);
612
- }, [B]), fe = o((e) => {
613
- M.current = e, ne(e), e?.focus();
614
- }, [ne]);
615
- Re([j, M], H, ae);
616
- let he = {
617
- ...z,
618
- minWidth: G(h),
619
- maxWidth: G(v)
1204
+ be,
1205
+ _e.items,
1206
+ we,
1207
+ ie,
1208
+ je
1209
+ ]), W = u((e) => {
1210
+ e.preventDefault(), Ce();
1211
+ }, [Ce]), Fe = u((e) => {
1212
+ ne.current = e, Ee(e);
1213
+ }, [Ee]), G = u((e) => {
1214
+ re.current = e, De(e), e?.focus();
1215
+ }, [De]);
1216
+ se({
1217
+ active: U,
1218
+ closeOnEscape: !0,
1219
+ closeOnOutsidePress: !0,
1220
+ contentRef: re,
1221
+ ignoreRefs: [ne],
1222
+ isTopOverlay: ke,
1223
+ requestClose: Se
1224
+ });
1225
+ let Ie = {
1226
+ ...Te,
1227
+ minWidth: rt(_),
1228
+ maxWidth: rt(v)
620
1229
  };
621
- return /* @__PURE__ */ g(me, {
1230
+ return /* @__PURE__ */ n(Pe, {
622
1231
  value: {
623
1232
  disabled: w,
624
- isOpen: ae,
625
- contentId: A,
626
- triggerId: k,
627
- setTriggerRef: de,
628
- onClick: ue,
629
- onKeyDown: le
1233
+ isOpen: U,
1234
+ contentId: te,
1235
+ triggerId: B,
1236
+ triggerClassName: I,
1237
+ setTriggerRef: Fe,
1238
+ onClick: W,
1239
+ onKeyDown: Me
630
1240
  },
631
- children: /* @__PURE__ */ g(pe, {
1241
+ children: /* @__PURE__ */ n(Ne, {
632
1242
  value: {
633
- activeIndex: re,
1243
+ activeIndex: be,
634
1244
  closeOnSelect: S,
635
- color: a,
636
- contentId: A,
637
- contentProps: R.content?.props,
1245
+ color: s,
1246
+ contentId: te,
1247
+ contentProps: H.content?.props,
638
1248
  disabled: w,
639
- entries: R.entries,
640
- getItemId: (e) => `${A}-item-${e}`,
641
- isOpen: ae,
642
- items: R.items,
1249
+ dropdownClassName: R,
1250
+ entries: _e.entries,
1251
+ getItemId: (e) => `${te}-item-${e}`,
1252
+ isOpen: U,
1253
+ items: _e.items,
643
1254
  loading: T,
644
1255
  loadingText: E,
1256
+ noOptionsText: P ?? F,
645
1257
  maxWidth: v,
646
- minWidth: h,
647
- openSubId: N,
648
- onKeyDown: le,
649
- portal: y,
650
- radioValues: I,
651
- selectItem: ce,
652
- setActiveIndex: ie,
653
- setContentRef: fe,
654
- setOpenSubId: P,
1258
+ minWidth: _,
1259
+ openSubId: ie,
1260
+ onKeyDown: Me,
1261
+ portal: !H.portal && y,
1262
+ radioValues: oe,
1263
+ searchPlaceholder: H.search?.props.placeholder ?? j ?? (O || fe ? "Type a command..." : "Search actions..."),
1264
+ searchProps: H.search?.props,
1265
+ searchValue: de,
1266
+ searchable: me,
1267
+ selectItem: je,
1268
+ setActiveIndex: xe,
1269
+ setContentRef: G,
1270
+ setOpenSubId: ae,
655
1271
  setRadioValue: (e, t) => {
656
- L((n) => ({
1272
+ V((n) => ({
657
1273
  ...n,
658
1274
  [e]: t
659
1275
  }));
660
1276
  },
661
- size: i,
662
- surfaceStyle: he,
663
- triggerId: k
1277
+ setSearchValue: Oe,
1278
+ size: o,
1279
+ surfaceStyle: Ie,
1280
+ triggerId: B
664
1281
  },
665
- children: /* @__PURE__ */ _("div", {
666
- className: V(K.wrapper, D),
1282
+ children: /* @__PURE__ */ r("div", {
1283
+ className: N(it.wrapper, z),
667
1284
  "data-disabled": w || void 0,
668
- children: [R.trigger ?? null, R.content ?? /* @__PURE__ */ g(ke, {})]
1285
+ children: [H.trigger ?? null, H.portal ?? H.content ?? /* @__PURE__ */ n(Ke, { className: R })]
669
1286
  })
670
1287
  })
671
1288
  });
672
1289
  };
673
- Ve.displayName = "DropdownRoot";
674
- function He(e) {
1290
+ at.displayName = "DropdownRoot";
1291
+ function ot(e) {
675
1292
  let t = !1;
676
1293
  return {
677
1294
  originalEvent: e,
@@ -683,9 +1300,23 @@ function He(e) {
683
1300
  }
684
1301
  };
685
1302
  }
1303
+ function st(e) {
1304
+ let t = [];
1305
+ return e.forEach((e) => {
1306
+ t.push(e), e.type === "subTrigger" && t.push(...st(e.subItems));
1307
+ }), t;
1308
+ }
1309
+ function ct(e, t) {
1310
+ let n = t.trim().toLocaleLowerCase(), r = new Set(e.items.filter((e) => e.label.toLocaleLowerCase().includes(n)).map((e) => e.id)), i = e.items.filter((e) => r.has(e.id));
1311
+ return {
1312
+ ...e,
1313
+ items: i,
1314
+ entries: e.entries.filter((e) => e.type !== "item" || r.has(e.item.id))
1315
+ };
1316
+ }
686
1317
  //#endregion
687
- //#region src/components/Dropdown/SubContent/DropdownSubContent.tsx
688
- var Ue = B("subContent", "Dropdown.SubContent"), We = B("subTrigger", "Dropdown.SubTrigger"), Ge = B("sub", "Dropdown.Sub"), Ke = {
1318
+ //#region src/components/Dropdown/Search/DropdownSearch.tsx
1319
+ var lt = I("search", "Dropdown.Search"), ut = I("subContent", "Dropdown.SubContent"), dt = I("subTrigger", "Dropdown.SubTrigger"), ft = I("sub", "Dropdown.Sub"), pt = {
689
1320
  button: "_button_bb3ib_1",
690
1321
  disabled: "_disabled_bb3ib_63",
691
1322
  arrow: "_arrow_bb3ib_71",
@@ -701,200 +1332,393 @@ var Ue = B("subContent", "Dropdown.SubContent"), We = B("subTrigger", "Dropdown.
701
1332
  lg: "_lg_bb3ib_350",
702
1333
  label: "_label_bb3ib_362",
703
1334
  open: "_open_bb3ib_390"
704
- }, qe = (e) => /* @__PURE__ */ g(Je, { ...e });
705
- qe.__velliraDropdownPart = "trigger", qe.displayName = "Dropdown.Trigger";
706
- var Je = ({ children: e, asChild: t = !1, disabled: r, className: i }) => {
707
- let o = he(), s = ge(), c = t && a(e) ? e : void 0, l = o.disabled || r, u = {
708
- id: s.triggerId,
709
- ref: c ? Be(c.props.ref, s.setTriggerRef) : s.setTriggerRef,
710
- "aria-controls": s.isOpen ? s.contentId : void 0,
711
- "aria-disabled": l || void 0,
712
- "aria-expanded": s.isOpen,
1335
+ }, mt = (e) => /* @__PURE__ */ n(ht, { ...e });
1336
+ mt.__velliraDropdownPart = "trigger", mt.displayName = "Dropdown.Trigger";
1337
+ var ht = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
1338
+ let s = W(), c = Fe(), u = t && l(e) ? e : void 0, d = s.disabled || i, f = {
1339
+ id: c.triggerId,
1340
+ ref: u ? nt(u.props.ref, c.setTriggerRef) : c.setTriggerRef,
1341
+ "aria-controls": c.isOpen ? c.contentId : void 0,
1342
+ "aria-disabled": d || void 0,
1343
+ "aria-expanded": c.isOpen,
713
1344
  "aria-haspopup": "menu",
714
- className: V(!c && Ke.button, !c && Ke[o.size], !c && Ke[o.color], i),
715
- "data-state": s.isOpen ? "open" : "closed",
716
- disabled: l || void 0,
717
- onClick: ze(c?.props.onClick, s.onClick),
718
- onKeyDown: ze(c?.props.onKeyDown, s.onKeyDown)
1345
+ className: N(!u && pt.button, !u && pt[s.size], !u && pt[s.color], c.triggerClassName, a),
1346
+ "data-state": c.isOpen ? "open" : "closed",
1347
+ disabled: d || void 0,
1348
+ onClick: tt(u?.props.onClick, c.onClick),
1349
+ onKeyDown: tt(u?.props.onKeyDown, c.onKeyDown)
719
1350
  };
720
- return c ? n(c, {
721
- ...u,
722
- className: V(c.props.className, i)
723
- }) : /* @__PURE__ */ _("button", {
1351
+ return u ? o(u, {
1352
+ ...f,
1353
+ className: N(u.props.className, a)
1354
+ }) : /* @__PURE__ */ r("button", {
724
1355
  type: "button",
725
- ...u,
726
- children: [/* @__PURE__ */ g("span", {
727
- className: Ke.label,
1356
+ ...f,
1357
+ children: [/* @__PURE__ */ n("span", {
1358
+ className: pt.label,
728
1359
  children: e
729
- }), /* @__PURE__ */ g("span", {
730
- className: V(Ke.arrow, { [Ke.open]: s.isOpen }),
1360
+ }), /* @__PURE__ */ n("span", {
1361
+ className: N(pt.arrow, { [pt.open]: c.isOpen }),
731
1362
  "aria-hidden": "true",
732
- children: /* @__PURE__ */ g(y, {})
1363
+ children: /* @__PURE__ */ n(y, {})
733
1364
  })]
734
1365
  });
735
1366
  };
736
- Je.displayName = "DropdownTriggerSurface";
1367
+ ht.displayName = "DropdownTriggerSurface";
737
1368
  //#endregion
738
1369
  //#region src/components/Dropdown/Dropdown.tsx
739
- var Ye = Object.assign(Ve, {
740
- Trigger: qe,
741
- Content: ke,
742
- Item: _e,
743
- CheckboxItem: ae,
744
- RadioGroup: Pe,
745
- RadioItem: Fe,
746
- Group: ce,
747
- Label: Se,
748
- Separator: De,
749
- Sub: Ge,
750
- SubTrigger: We,
751
- SubContent: Ue,
752
- ItemIcon: Me,
753
- ItemDescription: je,
754
- ItemBadge: Ae,
755
- ItemShortcut: Ne,
756
- Empty: oe,
757
- Loading: we
1370
+ var gt = Object.assign(at, {
1371
+ Trigger: mt,
1372
+ Content: Ke,
1373
+ Search: lt,
1374
+ Item: Ie,
1375
+ CheckboxItem: B,
1376
+ RadioGroup: Ze,
1377
+ RadioItem: Qe,
1378
+ Group: Oe,
1379
+ Label: Ve,
1380
+ Separator: We,
1381
+ Sub: ft,
1382
+ SubTrigger: dt,
1383
+ SubContent: ut,
1384
+ ItemIcon: Ye,
1385
+ ItemDescription: Je,
1386
+ ItemBadge: qe,
1387
+ ItemShortcut: Xe,
1388
+ Icon: Ye,
1389
+ Description: Je,
1390
+ Badge: qe,
1391
+ Shortcut: Xe,
1392
+ Arrow: F,
1393
+ Empty: Ee,
1394
+ Loading: q
758
1395
  });
759
- Ye.displayName = "Dropdown";
1396
+ gt.displayName = "Dropdown";
760
1397
  //#endregion
761
- //#region src/components/Modal/ModalContext.tsx
762
- var Xe = r(void 0), Ze = () => {
763
- let e = s(Xe);
1398
+ //#region src/components/Modal/internal/ModalContext.tsx
1399
+ var _t = s(void 0), vt = s(void 0), yt = () => {
1400
+ let e = d(_t);
764
1401
  if (e === void 0) throw Error("Modal compound components must be used inside Modal");
765
1402
  return e;
766
- };
767
- Xe.displayName = "ModalContext";
768
- var Qe = { modalBody: "_modalBody_iv33a_1" }, $e = ({ children: e }) => {
769
- let { descriptionId: t } = Ze();
770
- return /* @__PURE__ */ g("div", {
771
- id: t,
772
- className: Qe.modalBody,
1403
+ }, bt = () => d(vt), xt = _t.Provider, St = vt.Provider;
1404
+ _t.displayName = "ModalContext", vt.displayName = "ModalContentContext";
1405
+ var Ct = {
1406
+ modalBody: "_modalBody_ou4ff_1",
1407
+ inside: "_inside_ou4ff_6"
1408
+ }, wt = ({ children: e, className: t }) => {
1409
+ let r = bt();
1410
+ return /* @__PURE__ */ n("div", {
1411
+ className: N(Ct.modalBody, r?.scrollBehavior === "inside" && Ct.inside, t),
773
1412
  children: e
774
1413
  });
775
1414
  };
776
- $e.displayName = "ModalBody";
777
- var et = { content: "_content_k44g7_1" }, tt = ({ children: e }) => /* @__PURE__ */ g("div", {
778
- className: et.content,
779
- children: e
780
- });
781
- tt.displayName = "ModalContent";
782
- var nt = { modalFooter: "_modalFooter_ezys6_1" }, rt = ({ children: e }) => /* @__PURE__ */ g("div", {
783
- className: nt.modalFooter,
1415
+ wt.displayName = "ModalBody";
1416
+ //#endregion
1417
+ //#region src/components/Modal/internal/composeEventHandlers.ts
1418
+ function Tt(e, t) {
1419
+ return (n) => {
1420
+ e?.(n), n.defaultPrevented || t(n);
1421
+ };
1422
+ }
1423
+ function Et(...e) {
1424
+ return (t) => {
1425
+ e.forEach((e) => {
1426
+ if (e) {
1427
+ if (typeof e == "function") {
1428
+ e(t);
1429
+ return;
1430
+ }
1431
+ e.current = t;
1432
+ }
1433
+ });
1434
+ };
1435
+ }
1436
+ var Dt = {
1437
+ modalHeader: "_modalHeader_hw9hl_1",
1438
+ modalHeaderText: "_modalHeaderText_hw9hl_8",
1439
+ modalHeaderTitle: "_modalHeaderTitle_hw9hl_13",
1440
+ modalHeaderDescription: "_modalHeaderDescription_hw9hl_20",
1441
+ modalHeaderCloseButton: "_modalHeaderCloseButton_hw9hl_26"
1442
+ }, Ot = ({ asChild: e = !1, children: t, className: r, "aria-label": i }) => {
1443
+ let a = yt(), s = e && l(t) ? t : void 0, c = {
1444
+ "aria-label": s ? i : i ?? "Close dialog",
1445
+ className: N(!s && Dt.modalHeaderCloseButton, r),
1446
+ onClick: Tt(s?.props.onClick, a.requestClose)
1447
+ };
1448
+ return s ? o(s, {
1449
+ ...c,
1450
+ className: N(s.props.className, r),
1451
+ "aria-label": i ?? s.props["aria-label"]
1452
+ }) : /* @__PURE__ */ n("button", {
1453
+ type: "button",
1454
+ ...c,
1455
+ children: /* @__PURE__ */ n(x, { size: 16 })
1456
+ });
1457
+ };
1458
+ Ot.displayName = "Modal.Close";
1459
+ //#endregion
1460
+ //#region src/components/Modal/internal/useModalDismiss.ts
1461
+ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r, isTopModal: i, onEscapeKeyDown: a, onPointerDownOutside: o, onInteractOutside: s, requestClose: c }) => {
1462
+ se({
1463
+ active: e,
1464
+ closeOnOutsidePress: r,
1465
+ closeOnEscape: n,
1466
+ contentRef: t,
1467
+ isTopOverlay: i,
1468
+ onEscapeKeyDown: a ? (e) => a(e) : void 0,
1469
+ onInteractOutside: s ? (e) => s(e) : void 0,
1470
+ onPointerDownOutside: o ? (e) => o(e) : void 0,
1471
+ requestClose: c
1472
+ });
1473
+ }, At = {
1474
+ content: "_content_15uod_1",
1475
+ animated: "_animated_15uod_23",
1476
+ center: "_center_15uod_30",
1477
+ top: "_top_15uod_39",
1478
+ sm: "_sm_15uod_48",
1479
+ md: "_md_15uod_52",
1480
+ lg: "_lg_15uod_56",
1481
+ xl: "_xl_15uod_60",
1482
+ full: "_full_15uod_64",
1483
+ inside: "_inside_15uod_70",
1484
+ outside: "_outside_15uod_74"
1485
+ }, jt = ({ children: e, size: t = "md", placement: r = "center", scrollBehavior: i = "inside", animated: a = !0, forceMount: o = !1, ariaLabel: s, ariaLabelledBy: c, ariaDescribedBy: l, className: d, style: f }) => {
1486
+ let p = yt(), m = p.open, [h, _] = g(null), v = u((e) => {
1487
+ p.setContentRef(e), _(e);
1488
+ }, [p]);
1489
+ if (kt({
1490
+ active: m,
1491
+ contentRef: p.contentRef,
1492
+ closeOnEscape: p.closeOnEscape,
1493
+ closeOnOutsidePress: p.closeOnOutsidePress,
1494
+ isTopModal: p.isTopModal,
1495
+ onEscapeKeyDown: p.onEscapeKeyDown,
1496
+ onInteractOutside: p.onInteractOutside,
1497
+ onPointerDownOutside: p.onPointerDownOutside,
1498
+ requestClose: p.requestClose
1499
+ }), V({
1500
+ active: m,
1501
+ contentRef: p.contentRef,
1502
+ enabled: p.trapFocus,
1503
+ finalFocus: p.finalFocus,
1504
+ initialFocus: p.initialFocus,
1505
+ onCloseAutoFocus: p.onCloseAutoFocus,
1506
+ onOpenAutoFocus: p.onOpenAutoFocus,
1507
+ restoreFocus: p.restoreFocus
1508
+ }), te({
1509
+ active: m,
1510
+ content: h,
1511
+ enabled: p.modal
1512
+ }), !m && !o) return null;
1513
+ let y = c ?? (s ? void 0 : p.titleId), b = l ?? p.descriptionId;
1514
+ return /* @__PURE__ */ n(St, {
1515
+ value: { scrollBehavior: i },
1516
+ children: /* @__PURE__ */ n("div", {
1517
+ id: p.contentId,
1518
+ ref: Et(v),
1519
+ tabIndex: -1,
1520
+ className: N(At.content, At[t], At[r], At[i], a && At.animated, d),
1521
+ style: f,
1522
+ role: p.role,
1523
+ "aria-modal": p.modal ? "true" : void 0,
1524
+ "aria-label": s,
1525
+ "aria-labelledby": y,
1526
+ "aria-describedby": b,
1527
+ "data-state": m ? "open" : "closed",
1528
+ children: e
1529
+ })
1530
+ });
1531
+ };
1532
+ jt.displayName = "ModalContent";
1533
+ var Mt = { modalFooter: "_modalFooter_sb1pn_1" }, Nt = ({ children: e, className: t }) => /* @__PURE__ */ n("div", {
1534
+ className: N(Mt.modalFooter, t),
784
1535
  children: e
785
1536
  });
786
- rt.displayName = "ModalFooter";
787
- var it = {
788
- modalHeader: "_modalHeader_p8xf1_1",
789
- modalHeaderTitle: "_modalHeaderTitle_p8xf1_7",
790
- modalHeaderCloseButton: "_modalHeaderCloseButton_p8xf1_14"
791
- }, at = ({ children: e }) => {
792
- let { onClose: t, titleId: n } = Ze();
793
- return /* @__PURE__ */ _("div", {
794
- className: it.modalHeader,
795
- children: [/* @__PURE__ */ g("h2", {
796
- id: n,
797
- className: it.modalHeaderTitle,
798
- children: e
799
- }), t && /* @__PURE__ */ g("button", {
800
- type: "button",
801
- className: it.modalHeaderCloseButton,
802
- onClick: t,
803
- "aria-label": "Close modal",
804
- children: /* @__PURE__ */ g(x, { size: 16 })
805
- })]
1537
+ Nt.displayName = "ModalFooter";
1538
+ //#endregion
1539
+ //#region src/components/Modal/Header/ModalDescription.tsx
1540
+ var Pt = ({ children: e }) => {
1541
+ let { descriptionId: t, setDescriptionPresent: r } = yt();
1542
+ return f(() => (r(!0), () => r(!1)), [r]), /* @__PURE__ */ n("p", {
1543
+ id: t,
1544
+ className: Dt.modalHeaderDescription,
1545
+ children: e
806
1546
  });
807
1547
  };
808
- at.displayName = "ModalHeader";
1548
+ Pt.displayName = "Modal.Description";
809
1549
  //#endregion
810
- //#region src/hooks/useModalKeyboard.ts
811
- var ot = ({ isOpen: e, onClose: t }) => {
812
- let n = o((n) => {
813
- e && n.key === "Escape" && (n.preventDefault(), t?.());
814
- }, [e, t]);
815
- c(() => (document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n)), [n]);
816
- }, st = {
817
- overlay: "_overlay_dcudn_1",
818
- "overlay--open": "_overlay--open_dcudn_14",
819
- modal: "_modal_dcudn_20",
820
- "overlay--animated": "_overlay--animated_dcudn_28"
821
- }, ct = 0, lt = "", ut = ({ children: e, onClose: t, isOpen: n, className: r, closeOnBackdrop: i, closeOnClick: a, closeOnEsc: s = !0, zIndex: l = 1e3, animated: u = !0 }) => {
822
- let f = i ?? a ?? !0, p = d(null), { titleId: m, descriptionId: h } = Ze(), _ = o((e) => {
823
- f && e.target === e.currentTarget && t?.();
824
- }, [f, t]);
825
- return ot({
826
- isOpen: n,
827
- onClose: s ? t : void 0
828
- }), c(() => {
829
- if (n) return ct === 0 && (lt = document.body.style.overflow), ct += 1, document.body.style.overflow = "hidden", () => {
830
- ct = Math.max(0, ct - 1), ct === 0 && (document.body.style.overflow = lt);
831
- };
832
- }, [n]), !n && !u ? null : /* @__PURE__ */ g(H, { children: /* @__PURE__ */ g("div", {
833
- className: V(st.overlay, n && st["overlay--open"], u && st["overlay--animated"], r),
834
- onClick: _,
835
- tabIndex: -1,
836
- role: "presentation",
837
- "aria-hidden": !n,
838
- style: { zIndex: l },
839
- children: /* @__PURE__ */ g(z, {
840
- active: n,
841
- focusTrapOptions: {
842
- fallbackFocus: () => p.current,
843
- returnFocusOnDeactivate: !0,
844
- allowOutsideClick: !0
845
- },
846
- children: /* @__PURE__ */ g("div", {
847
- ref: p,
848
- tabIndex: -1,
849
- className: st.modal,
850
- role: "dialog",
851
- "aria-modal": "true",
852
- "aria-labelledby": m,
853
- "aria-describedby": h,
854
- children: e
855
- })
856
- })
857
- }) });
1550
+ //#region src/components/Modal/Header/ModalTitle.tsx
1551
+ var Ft = ({ children: e }) => {
1552
+ let { setTitlePresent: t, titleId: r } = yt();
1553
+ return f(() => (t(!0), () => t(!1)), [t]), /* @__PURE__ */ n("h2", {
1554
+ id: r,
1555
+ className: Dt.modalHeaderTitle,
1556
+ children: e
1557
+ });
858
1558
  };
859
- ut.displayName = "ModalOverlay";
1559
+ Ft.displayName = "Modal.Title";
860
1560
  //#endregion
861
- //#region src/components/Modal/Modal.tsx
862
- var dt = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: a = !0 }) => {
863
- let o = I({
864
- isOpen: e,
865
- onClose: n,
866
- closeOnBackdrop: r,
867
- closeOnClick: i,
868
- closeOnEsc: a
1561
+ //#region src/components/Modal/Header/ModalHeader.tsx
1562
+ var It = ({ children: e, title: t, description: i, showClose: a = !1, className: o }) => {
1563
+ let s = t !== void 0 || i !== void 0;
1564
+ return /* @__PURE__ */ r("div", {
1565
+ className: N(Dt.modalHeader, o),
1566
+ children: [s ? /* @__PURE__ */ r("div", {
1567
+ className: Dt.modalHeaderText,
1568
+ children: [t !== void 0 && /* @__PURE__ */ n(Ft, { children: t }), i !== void 0 && /* @__PURE__ */ n(Pt, { children: i })]
1569
+ }) : e, a && /* @__PURE__ */ n(Ot, {})]
869
1570
  });
870
- return o.shouldRender ? /* @__PURE__ */ g(Xe.Provider, {
871
- value: {
872
- onClose: o.onClose,
873
- titleId: o.titleId,
874
- descriptionId: o.descriptionId
875
- },
876
- children: /* @__PURE__ */ g(ut, {
877
- isOpen: o.isOpen,
878
- onClose: o.onClose,
879
- closeOnBackdrop: o.closeOnBackdrop,
880
- closeOnEsc: o.closeOnEsc,
881
- children: /* @__PURE__ */ g(tt, { children: t })
1571
+ };
1572
+ It.displayName = "ModalHeader";
1573
+ var Lt = {
1574
+ overlay: "_overlay_57sfi_1",
1575
+ "overlay--open": "_overlay--open_57sfi_11",
1576
+ "overlay--animated": "_overlay--animated_57sfi_18"
1577
+ }, Rt = ({ className: e, animated: t = !0, forceMount: r = !1 }) => {
1578
+ let { open: i } = yt();
1579
+ return !i && !r ? null : /* @__PURE__ */ n("div", {
1580
+ className: N(Lt.overlay, i && Lt["overlay--open"], t && Lt["overlay--animated"], e),
1581
+ "data-state": i ? "open" : "closed",
1582
+ "aria-hidden": "true"
1583
+ });
1584
+ };
1585
+ Rt.displayName = "ModalOverlay";
1586
+ //#endregion
1587
+ //#region src/components/Modal/Root/ModalRoot.tsx
1588
+ var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a = !0, closeOnEscape: o = !0, closeOnOutsidePress: s = !0, preventScroll: c = !0, restoreFocus: l = !0, trapFocus: d = !0, initialFocus: p, finalFocus: _, onOpenAutoFocus: v, onCloseAutoFocus: y, onEscapeKeyDown: b, onPointerDownOutside: x, onInteractOutside: S, role: C = "dialog", className: w }) => {
1589
+ let T = h(null), { contentId: E, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } = ye({
1590
+ open: t,
1591
+ defaultOpen: r,
1592
+ onOpenChange: i,
1593
+ closeOnEscape: o,
1594
+ closeOnOutsidePress: s
1595
+ }), [M, P] = g(!1), [F, I] = g(!1), L = O, R = u(() => {
1596
+ k();
1597
+ }, [k]), z = u((e) => {
1598
+ T.current = e;
1599
+ }, []), { isTopOverlay: ee } = ue({
1600
+ active: O,
1601
+ id: E
1602
+ });
1603
+ return pe({
1604
+ active: O,
1605
+ enabled: c
1606
+ }), f(() => {
1607
+ process.env.NODE_ENV === "production" || !O || M || T.current?.hasAttribute("aria-label") || console.warn("Modal.Content requires Modal.Title or ariaLabel.");
1608
+ }, [O, M]), f(() => {
1609
+ process.env.NODE_ENV === "production" || !O || C !== "alertdialog" || F || console.warn("Modal with role=\"alertdialog\" requires Modal.Description.");
1610
+ }, [
1611
+ F,
1612
+ O,
1613
+ C
1614
+ ]), /* @__PURE__ */ n(xt, {
1615
+ value: m(() => ({
1616
+ closeOnEscape: o,
1617
+ closeOnOutsidePress: s,
1618
+ contentId: E,
1619
+ contentRef: T,
1620
+ descriptionId: D,
1621
+ finalFocus: _,
1622
+ initialFocus: p,
1623
+ isTopModal: ee,
1624
+ modal: a,
1625
+ onCloseAutoFocus: y,
1626
+ onEscapeKeyDown: b,
1627
+ onInteractOutside: S,
1628
+ onOpenAutoFocus: v,
1629
+ onPointerDownOutside: x,
1630
+ open: O,
1631
+ preventScroll: c,
1632
+ requestClose: R,
1633
+ restoreFocus: l,
1634
+ role: C,
1635
+ setContentRef: z,
1636
+ setDescriptionPresent: I,
1637
+ setOpen: A,
1638
+ setTitlePresent: P,
1639
+ shouldRender: L,
1640
+ titleId: j,
1641
+ trapFocus: d
1642
+ }), [
1643
+ o,
1644
+ s,
1645
+ E,
1646
+ D,
1647
+ _,
1648
+ p,
1649
+ ee,
1650
+ O,
1651
+ a,
1652
+ y,
1653
+ b,
1654
+ S,
1655
+ v,
1656
+ x,
1657
+ c,
1658
+ R,
1659
+ l,
1660
+ C,
1661
+ z,
1662
+ A,
1663
+ L,
1664
+ j,
1665
+ d
1666
+ ]),
1667
+ children: /* @__PURE__ */ n("div", {
1668
+ className: N(w),
1669
+ "data-state": O ? "open" : "closed",
1670
+ children: e
882
1671
  })
883
- }) : null;
1672
+ });
884
1673
  };
885
- dt.displayName = "Modal";
1674
+ zt.displayName = "ModalRoot";
886
1675
  //#endregion
887
- //#region src/components/Modal/index.ts
888
- var ft = Object.assign(dt, {
889
- Header: at,
890
- Body: $e,
891
- Content: tt,
892
- Footer: rt
893
- }), pt = r(null), mt = pt.Provider;
894
- function ht() {
895
- return s(pt);
1676
+ //#region src/components/Modal/Trigger/ModalTrigger.tsx
1677
+ var Bt = ({ children: e, asChild: t = !1, disabled: r = !1, className: i }) => {
1678
+ let a = yt(), s = t && l(e) ? e : void 0, c = r, u = {
1679
+ "aria-controls": a.contentId,
1680
+ "aria-disabled": c || void 0,
1681
+ "aria-expanded": a.open,
1682
+ "aria-haspopup": "dialog",
1683
+ className: N(i),
1684
+ "data-state": a.open ? "open" : "closed",
1685
+ disabled: c || void 0,
1686
+ onClick: Tt(s?.props.onClick, () => {
1687
+ c || a.setOpen(!0);
1688
+ })
1689
+ };
1690
+ return s ? o(s, {
1691
+ ...u,
1692
+ ref: Et(s.props.ref),
1693
+ className: N(s.props.className, i)
1694
+ }) : /* @__PURE__ */ n("button", {
1695
+ type: "button",
1696
+ ...u,
1697
+ children: e
1698
+ });
1699
+ };
1700
+ Bt.displayName = "Modal.Trigger";
1701
+ //#endregion
1702
+ //#region src/components/Modal/Modal.tsx
1703
+ var Vt = Object.assign(zt, {
1704
+ Trigger: Bt,
1705
+ Overlay: Rt,
1706
+ Content: jt,
1707
+ Header: It,
1708
+ Title: Ft,
1709
+ Description: Pt,
1710
+ Body: wt,
1711
+ Footer: Nt,
1712
+ Close: Ot
1713
+ });
1714
+ Vt.displayName = "Modal";
1715
+ //#endregion
1716
+ //#region src/components/RadioGroup/RadioGroupContext.ts
1717
+ var Ht = s(null), Ut = Ht.Provider;
1718
+ function Wt() {
1719
+ return d(Ht);
896
1720
  }
897
- var gt = {
1721
+ var Gt = {
898
1722
  root: "_root_1n02e_1",
899
1723
  label: "_label_1n02e_9",
900
1724
  required: "_required_1n02e_21",
@@ -905,77 +1729,77 @@ var gt = {
905
1729
  error: "_error_1n02e_51",
906
1730
  disabled: "_disabled_1n02e_59",
907
1731
  invalid: "_invalid_1n02e_75"
908
- }, _t = i(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", name: s, label: c, description: u, error: d, orientation: f = "vertical", children: p, className: m, id: h, ...v }, y) => {
909
- let b = l(), x = h ?? b, S = c ? `${x}-label` : void 0, C = u ? `${x}-description` : void 0, w = d ? `${x}-error` : void 0, T = [C, w].filter(Boolean).join(" ") || void 0, E = s ?? `${x}-radio`, [D, O] = P({
1732
+ }, Kt = c(({ value: e, defaultValue: t = "", onValueChange: i, disabled: a = !1, required: o = !1, size: s = "md", color: c = "primary", name: l, label: u, description: d, error: f, orientation: m = "vertical", children: h, className: g, id: _, ...v }, y) => {
1733
+ let b = p(), x = _ ?? b, S = u ? `${x}-label` : void 0, C = d ? `${x}-description` : void 0, w = f ? `${x}-error` : void 0, T = [C, w].filter(Boolean).join(" ") || void 0, E = l ?? `${x}-radio`, [D, O] = ge({
910
1734
  value: e,
911
1735
  defaultValue: t,
912
- onChange: n
913
- }), k = !!d;
914
- return /* @__PURE__ */ _("div", {
1736
+ onChange: i
1737
+ }), k = !!f;
1738
+ return /* @__PURE__ */ r("div", {
915
1739
  ...v,
916
1740
  ref: y,
917
1741
  id: x,
918
1742
  role: "radiogroup",
919
1743
  "aria-labelledby": S,
920
1744
  "aria-describedby": T,
921
- "aria-disabled": r || void 0,
922
- "aria-required": i || void 0,
1745
+ "aria-disabled": a || void 0,
1746
+ "aria-required": o || void 0,
923
1747
  "aria-invalid": k || void 0,
924
- className: V(gt.root, k && gt.invalid, r && gt.disabled, m),
1748
+ className: N(Gt.root, k && Gt.invalid, a && Gt.disabled, g),
925
1749
  children: [
926
- c && /* @__PURE__ */ _("div", {
1750
+ u && /* @__PURE__ */ r("div", {
927
1751
  id: S,
928
- className: gt.label,
929
- children: [c, i && /* @__PURE__ */ g("span", {
930
- className: gt.required,
1752
+ className: Gt.label,
1753
+ children: [u, o && /* @__PURE__ */ n("span", {
1754
+ className: Gt.required,
931
1755
  "aria-hidden": "true",
932
1756
  children: "*"
933
1757
  })]
934
1758
  }),
935
- u && /* @__PURE__ */ g("div", {
1759
+ d && /* @__PURE__ */ n("div", {
936
1760
  id: C,
937
- className: gt.description,
938
- children: u
1761
+ className: Gt.description,
1762
+ children: d
939
1763
  }),
940
- /* @__PURE__ */ g(mt, {
1764
+ /* @__PURE__ */ n(Ut, {
941
1765
  value: {
942
1766
  name: E,
943
1767
  value: D,
944
- disabled: r,
945
- required: i,
1768
+ disabled: a,
1769
+ required: o,
946
1770
  invalid: k,
947
- size: a,
948
- color: o,
1771
+ size: s,
1772
+ color: c,
949
1773
  describedBy: T,
950
1774
  onValueChange: O
951
1775
  },
952
- children: /* @__PURE__ */ g("div", {
953
- className: V(gt.items, gt[f]),
954
- children: p
1776
+ children: /* @__PURE__ */ n("div", {
1777
+ className: N(Gt.items, Gt[m]),
1778
+ children: h
955
1779
  })
956
1780
  }),
957
- d && /* @__PURE__ */ g("div", {
1781
+ f && /* @__PURE__ */ n("div", {
958
1782
  id: w,
959
- className: gt.error,
960
- children: d
1783
+ className: Gt.error,
1784
+ children: f
961
1785
  })
962
1786
  ]
963
1787
  });
964
1788
  });
965
- _t.displayName = "RadioGroup";
1789
+ Kt.displayName = "RadioGroup";
966
1790
  //#endregion
967
1791
  //#region src/components/Select/internal/SelectContext.tsx
968
- var vt = r(null), yt = vt.Provider;
969
- function bt() {
970
- let e = s(vt);
1792
+ var qt = s(null), Jt = qt.Provider;
1793
+ function Yt() {
1794
+ let e = d(qt);
971
1795
  if (!e) throw Error("Select compound components must be used inside <Select>");
972
1796
  return e;
973
1797
  }
974
- vt.displayName = "SelectContext";
1798
+ qt.displayName = "SelectContext";
975
1799
  //#endregion
976
1800
  //#region src/components/Select/internal/useSelectVirtualization.ts
977
- function xt({ loading: e, options: t, scrollTop: n, virtual: r }) {
978
- return u(() => {
1801
+ function Xt({ loading: e, options: t, scrollTop: n, virtual: r }) {
1802
+ return m(() => {
979
1803
  let i = typeof r == "object" ? r : r ? {} : void 0, a = i?.itemHeight ?? 40, o = !!(i && t.length > 0 && !e), s = o ? Math.max(0, Math.floor(n / a) - 2) : 0, c = o ? Math.ceil(300 / a) + 4 : t.length, l = o ? t.slice(s, s + c) : t, u = o ? s * a : 0;
980
1804
  return {
981
1805
  bottomSpacerHeight: o ? Math.max(0, (t.length - s - l.length) * a) : 0,
@@ -993,7 +1817,7 @@ function xt({ loading: e, options: t, scrollTop: n, virtual: r }) {
993
1817
  r
994
1818
  ]);
995
1819
  }
996
- var q = {
1820
+ var Zt = {
997
1821
  option: "_option_1l7x7_1",
998
1822
  selected: "_selected_1l7x7_19",
999
1823
  disabled: "_disabled_1l7x7_19",
@@ -1011,63 +1835,63 @@ var q = {
1011
1835
  danger: "_danger_1l7x7_283",
1012
1836
  check: "_check_1l7x7_347",
1013
1837
  checkPop: "_checkPop_1l7x7_1"
1014
- }, St = () => null;
1015
- St.__velliraSelectPart = "item", St.displayName = "Select.Item";
1016
- var Ct = ({ option: e, isSelected: t, isActive: n, optionId: r, renderOption: i, onSelect: a, onMouseEnter: o }) => {
1017
- let s = !!e.disabled;
1018
- return /* @__PURE__ */ _("li", {
1019
- id: r,
1838
+ }, Qt = () => null;
1839
+ Qt.__velliraSelectPart = "item", Qt.displayName = "Select.Item";
1840
+ var $t = ({ option: e, isSelected: i, isActive: a, optionId: o, renderOption: s, onSelect: c, onMouseEnter: l }) => {
1841
+ let u = !!e.disabled;
1842
+ return /* @__PURE__ */ r("li", {
1843
+ id: o,
1020
1844
  role: "option",
1021
- "aria-selected": t,
1022
- "aria-disabled": s || void 0,
1023
- className: V(q.option, {
1024
- [q.selected]: t,
1025
- [q.active]: n,
1026
- [q.disabled]: s,
1027
- [q.success]: e.color === "success",
1028
- [q.warning]: e.color === "warning",
1029
- [q.danger]: e.color === "danger"
1845
+ "aria-selected": i,
1846
+ "aria-disabled": u || void 0,
1847
+ className: N(Zt.option, {
1848
+ [Zt.selected]: i,
1849
+ [Zt.active]: a,
1850
+ [Zt.disabled]: u,
1851
+ [Zt.success]: e.color === "success",
1852
+ [Zt.warning]: e.color === "warning",
1853
+ [Zt.danger]: e.color === "danger"
1030
1854
  }),
1031
1855
  onClick: () => {
1032
- s || a(e.value);
1856
+ u || c(e.value);
1033
1857
  },
1034
1858
  onMouseEnter: () => {
1035
- s || o();
1859
+ u || l();
1036
1860
  },
1037
- children: [i ? /* @__PURE__ */ g("span", {
1038
- className: q.custom,
1039
- children: i(e)
1040
- }) : /* @__PURE__ */ _(h, { children: [
1041
- e.icon && /* @__PURE__ */ g("span", {
1042
- className: q.icon,
1861
+ children: [s ? /* @__PURE__ */ n("span", {
1862
+ className: Zt.custom,
1863
+ children: s(e)
1864
+ }) : /* @__PURE__ */ r(t, { children: [
1865
+ e.icon && /* @__PURE__ */ n("span", {
1866
+ className: Zt.icon,
1043
1867
  children: e.icon
1044
1868
  }),
1045
- /* @__PURE__ */ _("span", {
1046
- className: q.content,
1047
- children: [/* @__PURE__ */ g("span", {
1048
- className: q.label,
1869
+ /* @__PURE__ */ r("span", {
1870
+ className: Zt.content,
1871
+ children: [/* @__PURE__ */ n("span", {
1872
+ className: Zt.label,
1049
1873
  children: e.label
1050
- }), e.description && /* @__PURE__ */ g("span", {
1051
- className: q.description,
1874
+ }), e.description && /* @__PURE__ */ n("span", {
1875
+ className: Zt.description,
1052
1876
  children: e.description
1053
1877
  })]
1054
1878
  }),
1055
- e.badge && /* @__PURE__ */ g("span", {
1056
- className: q.badge,
1879
+ e.badge && /* @__PURE__ */ n("span", {
1880
+ className: Zt.badge,
1057
1881
  children: e.badge
1058
1882
  }),
1059
- e.shortcut && /* @__PURE__ */ g("kbd", {
1060
- className: q.shortcut,
1883
+ e.shortcut && /* @__PURE__ */ n("kbd", {
1884
+ className: Zt.shortcut,
1061
1885
  children: e.shortcut
1062
1886
  })
1063
- ] }), /* @__PURE__ */ g("span", {
1064
- className: q.check,
1887
+ ] }), /* @__PURE__ */ n("span", {
1888
+ className: Zt.check,
1065
1889
  "aria-hidden": "true",
1066
- children: t && /* @__PURE__ */ g(v, {})
1890
+ children: i && /* @__PURE__ */ n(v, {})
1067
1891
  })]
1068
1892
  });
1069
1893
  };
1070
- Ct.displayName = "SelectItemRow";
1894
+ $t.displayName = "SelectItemRow";
1071
1895
  var J = {
1072
1896
  dropdown: "_dropdown_k5nye_1",
1073
1897
  dropdownIn: "_dropdownIn_k5nye_1",
@@ -1093,134 +1917,134 @@ var J = {
1093
1917
  separator: "_separator_k5nye_1556",
1094
1918
  virtualSpacer: "_virtualSpacer_k5nye_1562",
1095
1919
  mobileDropdownIn: "_mobileDropdownIn_k5nye_1"
1096
- }, wt = ({ children: e, className: t }) => {
1097
- let { contentProps: n } = bt(), r = Et(e);
1098
- return /* @__PURE__ */ g(Tt, {
1099
- ...n,
1920
+ }, en = ({ children: e, className: t }) => {
1921
+ let { contentProps: r } = Yt(), i = nn(e);
1922
+ return /* @__PURE__ */ n(tn, {
1100
1923
  ...r,
1101
- className: [n.className, t].filter(Boolean).join(" ")
1924
+ ...i,
1925
+ className: [r.className, t].filter(Boolean).join(" ")
1102
1926
  });
1103
1927
  };
1104
- wt.__velliraSelectPart = "content", wt.displayName = "Select.Content";
1105
- var Tt = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, entries: s, multiple: l, selectedValues: u, color: p = "primary", variant: m = "outline", searchable: v, command: y, virtual: b, portal: S = !0, searchValue: C = "", searchPlaceholder: w = "Search...", loading: T, loadingText: E = "Loading...", noOptionsText: D, searchSlot: O, headerSlot: k, emptySlot: A, loadingSlot: j, renderOption: M, selectedValue: N, activeIndex: P, visualActiveIndex: F = P, className: I, onSelect: L, onSelectGroup: R, onMouseEnter: ee, onSearchChange: z }) => {
1106
- let B = d(null), te = d(!1), [ne, re] = f(null), [ie, ae] = f(0), { bottomSpacerHeight: V, isVirtual: U, itemHeight: oe, startIndex: se, topSpacerHeight: ce, viewportHeight: le, visibleOptions: ue } = xt({
1928
+ en.__velliraSelectPart = "content", en.displayName = "Select.Content";
1929
+ var tn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style: s, options: c, entries: l, multiple: d, selectedValues: p, color: m = "primary", variant: _ = "outline", searchable: v, command: y, virtual: b, portal: S = !0, searchValue: C = "", searchPlaceholder: w = "Search...", loading: T, loadingText: E = "Loading...", noOptionsText: D, searchSlot: O, headerSlot: k, emptySlot: A, loadingSlot: j, renderOption: M, selectedValue: N, activeIndex: P, visualActiveIndex: F = P, className: I, onSelect: L, onSelectGroup: R, onMouseEnter: z, onSearchChange: ee }) => {
1930
+ let B = h(null), te = h(!1), [ne, re] = g(null), [ie, ae] = g(0), { bottomSpacerHeight: oe, isVirtual: V, itemHeight: se, startIndex: ce, topSpacerHeight: le, viewportHeight: ue, visibleOptions: de } = Xt({
1107
1931
  loading: T,
1108
- options: a,
1932
+ options: c,
1109
1933
  scrollTop: ie,
1110
1934
  virtual: b
1111
- }), de = o((e) => {
1112
- re(e), r(e);
1113
- }, [r]);
1114
- if (c(() => {
1935
+ }), H = u((e) => {
1936
+ re(e), o(e);
1937
+ }, [o]);
1938
+ if (f(() => {
1115
1939
  e || (te.current = !1, ae(0));
1116
- }, [e, C]), c(() => {
1940
+ }, [e, C]), f(() => {
1117
1941
  if (!e || !v) return;
1118
1942
  let t = window.setTimeout(() => {
1119
1943
  B.current?.focus({ preventScroll: !0 });
1120
1944
  }, 0);
1121
1945
  return () => window.clearTimeout(t);
1122
- }, [e, v]), c(() => {
1946
+ }, [e, v]), f(() => {
1123
1947
  if (!e || T || !ne || te.current) return;
1124
- let n = a.findIndex((e) => u ? u.includes(e.value) : e.value === N), r = n >= 0 ? n : P;
1125
- if (r < 0) {
1948
+ let t = c.findIndex((e) => p ? p.includes(e.value) : e.value === N), n = t >= 0 ? t : P;
1949
+ if (n < 0) {
1126
1950
  te.current = !0;
1127
1951
  return;
1128
1952
  }
1129
- if (te.current = !0, U) {
1130
- let e = Math.max(0, r * oe - (le - oe) / 2);
1953
+ if (te.current = !0, V) {
1954
+ let e = Math.max(0, n * se - (ue - se) / 2);
1131
1955
  ae(e), ne.scrollTop = e;
1132
1956
  return;
1133
1957
  }
1134
- document.getElementById(`${t}-option-${r}`)?.scrollIntoView?.({ block: "nearest" });
1958
+ document.getElementById(`${i}-option-${n}`)?.scrollIntoView?.({ block: "nearest" });
1135
1959
  }, [
1136
1960
  P,
1137
1961
  ne,
1138
1962
  e,
1139
- U,
1140
- oe,
1141
- t,
1963
+ V,
1964
+ se,
1965
+ i,
1142
1966
  T,
1143
- a,
1967
+ c,
1144
1968
  N,
1145
- u
1969
+ p
1146
1970
  ]), !e) return null;
1147
- let fe = s && !U ? s : ue.map((e, t) => ({
1971
+ let fe = l && !V ? l : de.map((e, t) => ({
1148
1972
  type: "option",
1149
1973
  option: e,
1150
- optionIndex: se + t
1151
- })), pe = /* @__PURE__ */ _("div", {
1152
- ref: de,
1974
+ optionIndex: ce + t
1975
+ })), pe = /* @__PURE__ */ r("div", {
1976
+ ref: H,
1153
1977
  tabIndex: 0,
1154
1978
  className: [
1155
1979
  J.dropdown,
1156
- J[p],
1157
1980
  J[m],
1981
+ J[_],
1158
1982
  y ? J.command : void 0,
1159
1983
  I
1160
1984
  ].filter(Boolean).join(" "),
1161
- style: i,
1985
+ style: s,
1162
1986
  onScroll: (e) => {
1163
- U && ae(e.currentTarget.scrollTop);
1987
+ V && ae(e.currentTarget.scrollTop);
1164
1988
  },
1165
1989
  children: [
1166
1990
  k,
1167
- O ?? (v && /* @__PURE__ */ _("div", {
1991
+ O ?? (v && /* @__PURE__ */ r("div", {
1168
1992
  className: J.searchWrap,
1169
- children: [/* @__PURE__ */ g("input", {
1993
+ children: [/* @__PURE__ */ n("input", {
1170
1994
  ref: B,
1171
1995
  className: J.search,
1172
1996
  value: C,
1173
1997
  placeholder: y ? "Type a command..." : w,
1174
1998
  "aria-label": "Search options",
1175
- onInput: (e) => z?.(e.currentTarget.value),
1176
- onChange: (e) => z?.(e.target.value)
1177
- }), C && /* @__PURE__ */ g("button", {
1999
+ onInput: (e) => ee?.(e.currentTarget.value),
2000
+ onChange: (e) => ee?.(e.target.value)
2001
+ }), C && /* @__PURE__ */ n("button", {
1178
2002
  type: "button",
1179
2003
  className: J.searchClear,
1180
2004
  "aria-label": "Clear search",
1181
2005
  onClick: () => {
1182
- z?.(""), B.current?.focus();
2006
+ ee?.(""), B.current?.focus();
1183
2007
  },
1184
- children: /* @__PURE__ */ g(x, {})
2008
+ children: /* @__PURE__ */ n(x, {})
1185
2009
  })]
1186
2010
  })),
1187
- /* @__PURE__ */ g("ul", {
1188
- id: t,
2011
+ /* @__PURE__ */ n("ul", {
2012
+ id: i,
1189
2013
  role: "listbox",
1190
- "aria-multiselectable": l || void 0,
1191
- "aria-labelledby": n,
1192
- children: T ? /* @__PURE__ */ g("li", {
2014
+ "aria-multiselectable": d || void 0,
2015
+ "aria-labelledby": a,
2016
+ children: T ? /* @__PURE__ */ n("li", {
1193
2017
  role: "option",
1194
2018
  "aria-disabled": "true",
1195
2019
  "aria-selected": "false",
1196
2020
  className: J.empty,
1197
2021
  children: j ?? E
1198
- }) : a.length ? /* @__PURE__ */ _(h, { children: [
1199
- U && /* @__PURE__ */ g("li", {
2022
+ }) : c.length ? /* @__PURE__ */ r(t, { children: [
2023
+ V && /* @__PURE__ */ n("li", {
1200
2024
  "aria-hidden": "true",
1201
2025
  className: J.virtualSpacer,
1202
- style: { height: ce }
2026
+ style: { height: le }
1203
2027
  }),
1204
2028
  fe.map((e) => {
1205
2029
  if (e.type === "group") {
1206
- if (e.selectable && l) {
1207
- let t = e.itemValues.filter((e) => a.some((t) => t.value === e && !t.disabled)), n = u ? t.filter((e) => u.includes(e)).length : 0, r = t.length > 0 && n === t.length, i = n > 0 && n < t.length;
1208
- return /* @__PURE__ */ g("li", {
2030
+ if (e.selectable && d) {
2031
+ let t = e.itemValues.filter((e) => c.some((t) => t.value === e && !t.disabled)), i = p ? t.filter((e) => p.includes(e)).length : 0, a = t.length > 0 && i === t.length, o = i > 0 && i < t.length;
2032
+ return /* @__PURE__ */ n("li", {
1209
2033
  role: "presentation",
1210
- children: /* @__PURE__ */ _("button", {
2034
+ children: /* @__PURE__ */ r("button", {
1211
2035
  type: "button",
1212
2036
  className: J.groupAction,
1213
- "aria-label": Dt(e.selectLabel ?? e.label),
1214
- "aria-pressed": i ? "mixed" : r ? "true" : "false",
2037
+ "aria-label": rn(e.selectLabel ?? e.label),
2038
+ "aria-pressed": o ? "mixed" : a ? "true" : "false",
1215
2039
  disabled: t.length === 0,
1216
2040
  onClick: () => R(t),
1217
- children: [/* @__PURE__ */ g("span", {
2041
+ children: [/* @__PURE__ */ n("span", {
1218
2042
  className: J.groupActionText,
1219
2043
  children: e.selectLabel ?? e.label
1220
- }), /* @__PURE__ */ _("span", {
2044
+ }), /* @__PURE__ */ r("span", {
1221
2045
  className: J.groupActionMeta,
1222
2046
  children: [
1223
- n,
2047
+ i,
1224
2048
  "/",
1225
2049
  t.length
1226
2050
  ]
@@ -1228,35 +2052,35 @@ var Tt = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
1228
2052
  })
1229
2053
  }, e.id);
1230
2054
  }
1231
- return /* @__PURE__ */ g("li", {
2055
+ return /* @__PURE__ */ n("li", {
1232
2056
  role: "presentation",
1233
2057
  className: J.groupLabel,
1234
2058
  children: e.label
1235
2059
  }, e.id);
1236
2060
  }
1237
- if (e.type === "separator") return /* @__PURE__ */ g("li", {
2061
+ if (e.type === "separator") return /* @__PURE__ */ n("li", {
1238
2062
  role: "presentation",
1239
2063
  "aria-hidden": "true",
1240
2064
  className: J.separator,
1241
2065
  "data-vellira-select-separator": "true"
1242
2066
  }, e.id);
1243
- let { option: n, optionIndex: r } = e;
1244
- return /* @__PURE__ */ g(Ct, {
1245
- option: n,
1246
- isSelected: u ? u.includes(n.value) : n.value === N,
1247
- isActive: r === F,
1248
- optionId: `${t}-option-${r}`,
2067
+ let { option: t, optionIndex: a } = e;
2068
+ return /* @__PURE__ */ n($t, {
2069
+ option: t,
2070
+ isSelected: p ? p.includes(t.value) : t.value === N,
2071
+ isActive: a === F,
2072
+ optionId: `${i}-option-${a}`,
1249
2073
  renderOption: M,
1250
2074
  onSelect: L,
1251
- onMouseEnter: () => ee(r)
1252
- }, n.value);
2075
+ onMouseEnter: () => z(a)
2076
+ }, t.value);
1253
2077
  }),
1254
- U && /* @__PURE__ */ g("li", {
2078
+ V && /* @__PURE__ */ n("li", {
1255
2079
  "aria-hidden": "true",
1256
2080
  className: J.virtualSpacer,
1257
- style: { height: V }
2081
+ style: { height: oe }
1258
2082
  })
1259
- ] }) : /* @__PURE__ */ g("li", {
2083
+ ] }) : /* @__PURE__ */ n("li", {
1260
2084
  role: "option",
1261
2085
  "aria-disabled": "true",
1262
2086
  "aria-selected": "false",
@@ -1266,96 +2090,96 @@ var Tt = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
1266
2090
  })
1267
2091
  ]
1268
2092
  });
1269
- return S ? /* @__PURE__ */ g(H, { children: pe }) : pe;
2093
+ return S ? /* @__PURE__ */ n(we, { children: pe }) : pe;
1270
2094
  };
1271
- Tt.displayName = "SelectContentSurface";
1272
- function Et(t) {
1273
- let n, r, i, o;
1274
- return e.forEach(t, (e) => {
1275
- if (!a(e)) return;
1276
- let t = e.type;
1277
- t.__velliraSelectPart === "label" && (n = e), t.__velliraSelectPart === "search" && (r = e), t.__velliraSelectPart === "empty" && (i = e), t.__velliraSelectPart === "loading" && (o = e);
2095
+ tn.displayName = "SelectContentSurface";
2096
+ function nn(e) {
2097
+ let t, n, r, a;
2098
+ return i.forEach(e, (e) => {
2099
+ if (!l(e)) return;
2100
+ let i = e.type;
2101
+ i.__velliraSelectPart === "label" && (t = e), i.__velliraSelectPart === "search" && (n = e), i.__velliraSelectPart === "empty" && (r = e), i.__velliraSelectPart === "loading" && (a = e);
1278
2102
  }), {
1279
- emptySlot: i,
1280
- headerSlot: n,
1281
- loadingSlot: o,
1282
- searchSlot: r
2103
+ emptySlot: r,
2104
+ headerSlot: t,
2105
+ loadingSlot: a,
2106
+ searchSlot: n
1283
2107
  };
1284
2108
  }
1285
- function Dt(e) {
2109
+ function rn(e) {
1286
2110
  return typeof e == "string" || typeof e == "number" ? String(e) : "Select group";
1287
2111
  }
1288
2112
  //#endregion
1289
2113
  //#region src/components/Select/Content/SelectEmpty.tsx
1290
- var Ot = ({ children: e }) => /* @__PURE__ */ g(h, { children: e });
1291
- Ot.__velliraSelectPart = "empty", Ot.displayName = "Select.Empty";
2114
+ var an = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
2115
+ an.__velliraSelectPart = "empty", an.displayName = "Select.Empty";
1292
2116
  //#endregion
1293
2117
  //#region src/components/Select/Content/SelectLoading.tsx
1294
- var kt = ({ children: e }) => /* @__PURE__ */ g(h, { children: e });
1295
- kt.__velliraSelectPart = "loading", kt.displayName = "Select.Loading";
2118
+ var on = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
2119
+ on.__velliraSelectPart = "loading", on.displayName = "Select.Loading";
1296
2120
  //#endregion
1297
2121
  //#region src/components/Select/Content/SelectSearch.tsx
1298
- var At = ({ placeholder: e, className: t }) => {
1299
- let { contentProps: n } = bt(), r = d(null), i = n.searchValue ?? "";
1300
- return c(() => {
1301
- if (!n.isOpen) return;
2122
+ var sn = ({ placeholder: e, className: t }) => {
2123
+ let { contentProps: i } = Yt(), a = h(null), o = i.searchValue ?? "";
2124
+ return f(() => {
2125
+ if (!i.isOpen) return;
1302
2126
  let e = window.setTimeout(() => {
1303
- r.current?.focus({ preventScroll: !0 });
2127
+ a.current?.focus({ preventScroll: !0 });
1304
2128
  }, 0);
1305
2129
  return () => window.clearTimeout(e);
1306
- }, [n.isOpen]), /* @__PURE__ */ _("div", {
2130
+ }, [i.isOpen]), /* @__PURE__ */ r("div", {
1307
2131
  className: J.searchWrap,
1308
- children: [/* @__PURE__ */ g("input", {
1309
- ref: r,
1310
- className: V(J.search, t),
1311
- value: i,
1312
- placeholder: e ?? (n.command ? "Type a command..." : "Search..."),
2132
+ children: [/* @__PURE__ */ n("input", {
2133
+ ref: a,
2134
+ className: N(J.search, t),
2135
+ value: o,
2136
+ placeholder: e ?? (i.command ? "Type a command..." : "Search..."),
1313
2137
  "aria-label": "Search options",
1314
- onInput: (e) => n.onSearchChange?.(e.currentTarget.value),
1315
- onChange: (e) => n.onSearchChange?.(e.target.value)
1316
- }), i && /* @__PURE__ */ g("button", {
2138
+ onInput: (e) => i.onSearchChange?.(e.currentTarget.value),
2139
+ onChange: (e) => i.onSearchChange?.(e.target.value)
2140
+ }), o && /* @__PURE__ */ n("button", {
1317
2141
  type: "button",
1318
2142
  className: J.searchClear,
1319
2143
  "aria-label": "Clear search",
1320
2144
  onClick: () => {
1321
- n.onSearchChange?.(""), r.current?.focus();
2145
+ i.onSearchChange?.(""), a.current?.focus();
1322
2146
  },
1323
- children: /* @__PURE__ */ g(x, {})
2147
+ children: /* @__PURE__ */ n(x, {})
1324
2148
  })]
1325
2149
  });
1326
2150
  };
1327
- At.__velliraSelectPart = "search", At.displayName = "Select.Search";
2151
+ sn.__velliraSelectPart = "search", sn.displayName = "Select.Search";
1328
2152
  //#endregion
1329
2153
  //#region src/components/Select/Group/SelectGroup.tsx
1330
- var jt = () => null;
1331
- jt.__velliraSelectPart = "group", jt.displayName = "Select.Group";
2154
+ var cn = () => null;
2155
+ cn.__velliraSelectPart = "group", cn.displayName = "Select.Group";
1332
2156
  //#endregion
1333
2157
  //#region src/components/Select/Group/SelectLabel.tsx
1334
- var Mt = ({ children: e }) => /* @__PURE__ */ g("div", {
2158
+ var ln = ({ children: e }) => /* @__PURE__ */ n("div", {
1335
2159
  role: "presentation",
1336
2160
  className: J.groupLabel,
1337
2161
  children: e
1338
2162
  });
1339
- Mt.__velliraSelectPart = "label", Mt.displayName = "Select.Label";
2163
+ ln.__velliraSelectPart = "label", ln.displayName = "Select.Label";
1340
2164
  //#endregion
1341
2165
  //#region src/components/Select/Group/SelectSeparator.tsx
1342
- var Nt = () => null;
1343
- Nt.__velliraSelectPart = "separator", Nt.displayName = "Select.Separator";
2166
+ var un = () => null;
2167
+ un.__velliraSelectPart = "separator", un.displayName = "Select.Separator";
1344
2168
  //#endregion
1345
2169
  //#region src/components/Select/Item/SelectItemBadge.tsx
1346
- var Pt = () => null;
1347
- Pt.__velliraSelectPart = "itemBadge", Pt.displayName = "Select.ItemBadge";
2170
+ var dn = () => null;
2171
+ dn.__velliraSelectPart = "itemBadge", dn.displayName = "Select.ItemBadge";
1348
2172
  //#endregion
1349
2173
  //#region src/components/Select/Item/SelectItemDescription.tsx
1350
- var Ft = () => null;
1351
- Ft.__velliraSelectPart = "itemDescription", Ft.displayName = "Select.ItemDescription";
2174
+ var fn = () => null;
2175
+ fn.__velliraSelectPart = "itemDescription", fn.displayName = "Select.ItemDescription";
1352
2176
  //#endregion
1353
2177
  //#region src/components/Select/Item/SelectItemIcon.tsx
1354
- var It = () => null;
1355
- It.__velliraSelectPart = "itemIcon", It.displayName = "Select.ItemIcon";
2178
+ var pn = () => null;
2179
+ pn.__velliraSelectPart = "itemIcon", pn.displayName = "Select.ItemIcon";
1356
2180
  //#endregion
1357
2181
  //#region src/patterns/FormField/FormFieldContext.ts
1358
- var Lt = r(null), Rt = () => s(Lt), zt = {
2182
+ var mn = s(null), hn = () => d(mn), gn = {
1359
2183
  wrapper: "_wrapper_143kr_1",
1360
2184
  sm: "_sm_143kr_41",
1361
2185
  md: "_md_143kr_78",
@@ -1371,206 +2195,206 @@ var Lt = r(null), Rt = () => s(Lt), zt = {
1371
2195
  optional: "_optional_143kr_194",
1372
2196
  labelInfo: "_labelInfo_143kr_201",
1373
2197
  disabled: "_disabled_143kr_243"
1374
- }, Bt = (...e) => e.filter(Boolean).join(" ") || void 0, Vt = ({ id: e, label: t, description: r, error: i, required: o = !1, disabled: s = !1, invalid: c = !1, orientation: u = "vertical", labelPosition: d = "top", size: f = "md", labelInfo: p, optionalText: m, children: h, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
1375
- let T = l(), E = e ?? T, D = t ? `${E}-label` : void 0, O = r && E ? `${E}-description` : void 0, k = i && E ? `${E}-error` : void 0, A = c || !!i, j = Bt(D), M = Bt(O, k), N = {
2198
+ }, _n = (...e) => e.filter(Boolean).join(" ") || void 0, vn = ({ id: e, label: t, description: i, error: a, required: s = !1, disabled: c = !1, invalid: u = !1, orientation: d = "vertical", labelPosition: f = "top", size: m = "md", labelInfo: h, optionalText: g, children: _, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
2199
+ let T = p(), E = e ?? T, D = t ? `${E}-label` : void 0, O = i && E ? `${E}-description` : void 0, k = a && E ? `${E}-error` : void 0, A = u || !!a, j = _n(D), M = _n(O, k), P = {
1376
2200
  controlId: E,
1377
2201
  labelId: D,
1378
2202
  descriptionId: O,
1379
2203
  errorId: k,
1380
- required: o,
1381
- disabled: s,
2204
+ required: s,
2205
+ disabled: c,
1382
2206
  invalid: A,
1383
- size: f,
2207
+ size: m,
1384
2208
  ariaLabelledBy: j,
1385
2209
  ariaDescribedBy: M
1386
- }, P = a(h) ? h : void 0, F = v && P ? n(P, {
1387
- id: P.props.id ?? E,
1388
- required: P.props.required ?? o,
1389
- disabled: P.props.disabled ?? s,
1390
- "aria-invalid": P.props["aria-invalid"] ?? (A || void 0),
1391
- "aria-labelledby": Bt(P.props["aria-labelledby"], j),
1392
- "aria-describedby": Bt(P.props["aria-describedby"], M)
1393
- }) : h;
1394
- return /* @__PURE__ */ _("div", {
2210
+ }, F = l(_) ? _ : void 0, I = v && F ? o(F, {
2211
+ id: F.props.id ?? E,
2212
+ required: F.props.required ?? s,
2213
+ disabled: F.props.disabled ?? c,
2214
+ "aria-invalid": F.props["aria-invalid"] ?? (A || void 0),
2215
+ "aria-labelledby": _n(F.props["aria-labelledby"], j),
2216
+ "aria-describedby": _n(F.props["aria-describedby"], M)
2217
+ }) : _;
2218
+ return /* @__PURE__ */ r("div", {
1395
2219
  ...w,
1396
- "aria-disabled": s || void 0,
1397
- className: V(zt.wrapper, zt[u], zt[d], zt[f], s && zt.disabled, y),
1398
- "data-disabled": s || void 0,
2220
+ "aria-disabled": c || void 0,
2221
+ className: N(gn.wrapper, gn[d], gn[f], gn[m], c && gn.disabled, y),
2222
+ "data-disabled": c || void 0,
1399
2223
  "data-invalid": A || void 0,
1400
- "data-orientation": u,
1401
- "data-size": f,
2224
+ "data-orientation": d,
2225
+ "data-size": m,
1402
2226
  children: [
1403
- t && /* @__PURE__ */ _("label", {
2227
+ t && /* @__PURE__ */ r("label", {
1404
2228
  id: D,
1405
2229
  htmlFor: E,
1406
- className: V(zt.label, x),
2230
+ className: N(gn.label, x),
1407
2231
  children: [
1408
- /* @__PURE__ */ g("span", {
1409
- className: zt.labelText,
2232
+ /* @__PURE__ */ n("span", {
2233
+ className: gn.labelText,
1410
2234
  children: t
1411
2235
  }),
1412
- o && /* @__PURE__ */ g("span", {
1413
- className: zt.required,
2236
+ s && /* @__PURE__ */ n("span", {
2237
+ className: gn.required,
1414
2238
  "aria-hidden": "true",
1415
2239
  children: "*"
1416
2240
  }),
1417
- !o && m && /* @__PURE__ */ g("span", {
1418
- className: zt.optional,
1419
- children: m
2241
+ !s && g && /* @__PURE__ */ n("span", {
2242
+ className: gn.optional,
2243
+ children: g
1420
2244
  }),
1421
- p && /* @__PURE__ */ g("span", {
1422
- className: zt.labelInfo,
1423
- children: p
2245
+ h && /* @__PURE__ */ n("span", {
2246
+ className: gn.labelInfo,
2247
+ children: h
1424
2248
  })
1425
2249
  ]
1426
2250
  }),
1427
- r && /* @__PURE__ */ g("div", {
2251
+ i && /* @__PURE__ */ n("div", {
1428
2252
  id: O,
1429
- className: V(zt.description, S),
1430
- children: r
2253
+ className: N(gn.description, S),
2254
+ children: i
1431
2255
  }),
1432
- /* @__PURE__ */ g(Lt.Provider, {
1433
- value: N,
1434
- children: /* @__PURE__ */ g("div", {
1435
- className: V(zt.control, b),
1436
- children: F
2256
+ /* @__PURE__ */ n(mn.Provider, {
2257
+ value: P,
2258
+ children: /* @__PURE__ */ n("div", {
2259
+ className: N(gn.control, b),
2260
+ children: I
1437
2261
  })
1438
2262
  }),
1439
- i && /* @__PURE__ */ g("div", {
2263
+ a && /* @__PURE__ */ n("div", {
1440
2264
  id: k,
1441
- className: V(zt.errorText, C),
2265
+ className: N(gn.errorText, C),
1442
2266
  role: "alert",
1443
- children: i
2267
+ children: a
1444
2268
  })
1445
2269
  ]
1446
2270
  });
1447
2271
  };
1448
2272
  //#endregion
1449
2273
  //#region src/components/Select/internal/SelectCollection.ts
1450
- function Ht(t) {
1451
- let n = [], r = [], i = 0;
1452
- function o(t) {
1453
- e.forEach(t, (e) => {
1454
- if (!a(e)) return;
1455
- let t = e.type;
1456
- if (t.__velliraSelectPart === "group") {
1457
- let t = e.props, r = Wt(t.children);
1458
- n.push({
2274
+ function yn(e) {
2275
+ let t = [], n = [], r = 0;
2276
+ function a(e) {
2277
+ i.forEach(e, (e) => {
2278
+ if (!l(e)) return;
2279
+ let i = e.type;
2280
+ if (i.__velliraSelectPart === "group") {
2281
+ let n = e.props, i = xn(n.children);
2282
+ t.push({
1459
2283
  type: "group",
1460
- id: `group-${i++}`,
1461
- label: t.label,
1462
- selectable: t.selectable,
1463
- selectLabel: t.selectLabel,
1464
- itemValues: r
1465
- }), o(t.children);
2284
+ id: `group-${r++}`,
2285
+ label: n.label,
2286
+ selectable: n.selectable,
2287
+ selectLabel: n.selectLabel,
2288
+ itemValues: i
2289
+ }), a(n.children);
1466
2290
  return;
1467
2291
  }
1468
- if (t.__velliraSelectPart === "item") {
1469
- let t = e.props, i = Gt(t.children, t.value), a = t.label ?? i.label, o = r.length, s = {
2292
+ if (i.__velliraSelectPart === "item") {
2293
+ let r = e.props, i = Sn(r.children, r.value), a = r.label ?? i.label, o = n.length, s = {
1470
2294
  label: a,
1471
- value: t.value,
1472
- disabled: t.disabled,
1473
- description: t.description ?? i.description,
1474
- icon: t.icon ?? i.icon,
1475
- badge: t.badge ?? i.badge,
1476
- shortcut: t.shortcut,
1477
- color: t.color
2295
+ value: r.value,
2296
+ disabled: r.disabled,
2297
+ description: r.description ?? i.description,
2298
+ icon: r.icon ?? i.icon,
2299
+ badge: r.badge ?? i.badge,
2300
+ shortcut: r.shortcut,
2301
+ color: r.color
1478
2302
  };
1479
- r.push(s), n.push({
2303
+ n.push(s), t.push({
1480
2304
  type: "option",
1481
2305
  option: s,
1482
2306
  optionIndex: o
1483
2307
  });
1484
2308
  return;
1485
2309
  }
1486
- if (t.__velliraSelectPart === "separator") {
1487
- n.push({
2310
+ if (i.__velliraSelectPart === "separator") {
2311
+ t.push({
1488
2312
  type: "separator",
1489
- id: `separator-${i++}`
2313
+ id: `separator-${r++}`
1490
2314
  });
1491
2315
  return;
1492
2316
  }
1493
- t.__velliraSelectPart === "empty" || t.__velliraSelectPart === "icon" || t.__velliraSelectPart === "itemBadge" || t.__velliraSelectPart === "itemDescription" || t.__velliraSelectPart === "itemIcon" || t.__velliraSelectPart === "label" || t.__velliraSelectPart === "loading" || t.__velliraSelectPart === "search" || t.__velliraSelectPart === "value" || o(e.props.children);
2317
+ i.__velliraSelectPart === "empty" || i.__velliraSelectPart === "icon" || i.__velliraSelectPart === "itemBadge" || i.__velliraSelectPart === "itemDescription" || i.__velliraSelectPart === "itemIcon" || i.__velliraSelectPart === "label" || i.__velliraSelectPart === "loading" || i.__velliraSelectPart === "search" || i.__velliraSelectPart === "value" || a(e.props.children);
1494
2318
  });
1495
2319
  }
1496
- return o(t), {
1497
- entries: n,
1498
- options: r
2320
+ return a(e), {
2321
+ entries: t,
2322
+ options: n
1499
2323
  };
1500
2324
  }
1501
- function Ut(t) {
1502
- let n = !1;
1503
- function r(t) {
1504
- e.forEach(t, (e) => {
1505
- if (!a(e) || n) return;
1506
- let t = e.type;
1507
- if (t.__velliraSelectPart === "trigger" || t.__velliraSelectPart === "content") {
1508
- n = !0;
2325
+ function bn(e) {
2326
+ let t = !1;
2327
+ function n(e) {
2328
+ i.forEach(e, (e) => {
2329
+ if (!l(e) || t) return;
2330
+ let r = e.type;
2331
+ if (r.__velliraSelectPart === "trigger" || r.__velliraSelectPart === "content") {
2332
+ t = !0;
1509
2333
  return;
1510
2334
  }
1511
- r(e.props.children);
2335
+ n(e.props.children);
1512
2336
  });
1513
2337
  }
1514
- return r(t), n;
2338
+ return n(e), t;
1515
2339
  }
1516
- function Wt(t) {
1517
- let n = [];
1518
- function r(t) {
1519
- e.forEach(t, (e) => {
1520
- if (a(e)) {
2340
+ function xn(e) {
2341
+ let t = [];
2342
+ function n(e) {
2343
+ i.forEach(e, (e) => {
2344
+ if (l(e)) {
1521
2345
  if (e.type.__velliraSelectPart === "item") {
1522
- n.push(e.props.value);
2346
+ t.push(e.props.value);
1523
2347
  return;
1524
2348
  }
1525
- r(e.props.children);
2349
+ n(e.props.children);
1526
2350
  }
1527
2351
  });
1528
2352
  }
1529
- return r(t), n;
2353
+ return n(e), t;
1530
2354
  }
1531
- function Gt(t, n) {
1532
- let r, i, o, s = [];
1533
- function c(t) {
1534
- e.forEach(t, (e) => {
2355
+ function Sn(e, t) {
2356
+ let n, r, a, o = [];
2357
+ function s(e) {
2358
+ i.forEach(e, (e) => {
1535
2359
  if (typeof e == "string" || typeof e == "number") {
1536
- s.push(String(e));
2360
+ o.push(String(e));
1537
2361
  return;
1538
2362
  }
1539
- if (!a(e)) return;
2363
+ if (!l(e)) return;
1540
2364
  let t = e.type;
1541
2365
  if (t.__velliraSelectPart === "itemBadge") {
1542
- r = e.props.children;
2366
+ n = e.props.children;
1543
2367
  return;
1544
2368
  }
1545
2369
  if (t.__velliraSelectPart === "itemIcon") {
1546
- o = e.props.children;
2370
+ a = e.props.children;
1547
2371
  return;
1548
2372
  }
1549
2373
  if (t.__velliraSelectPart === "itemDescription") {
1550
- i = e.props.children;
2374
+ r = e.props.children;
1551
2375
  return;
1552
2376
  }
1553
- c(e.props.children);
2377
+ s(e.props.children);
1554
2378
  });
1555
2379
  }
1556
- c(t);
1557
- let l = s.join("").trim();
2380
+ s(e);
2381
+ let c = o.join("").trim();
1558
2382
  return {
1559
- badge: r,
1560
- description: i,
1561
- icon: o,
1562
- label: l || n
2383
+ badge: n,
2384
+ description: r,
2385
+ icon: a,
2386
+ label: c || t
1563
2387
  };
1564
2388
  }
1565
2389
  //#endregion
1566
2390
  //#region src/components/Select/internal/useSelectCollection.ts
1567
- function Kt(e) {
1568
- return u(() => Ht(e), [e]);
2391
+ function Cn(e) {
2392
+ return m(() => yn(e), [e]);
1569
2393
  }
1570
2394
  //#endregion
1571
2395
  //#region src/components/Select/internal/useSelectPosition.ts
1572
- function qt({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
1573
- return Le({
2396
+ function wn({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
2397
+ return et({
1574
2398
  open: t,
1575
2399
  onOpenChange: r,
1576
2400
  placement: i === "bottom" || i === "top" ? `${i}-start` : i,
@@ -1581,18 +2405,18 @@ function qt({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange:
1581
2405
  }
1582
2406
  //#endregion
1583
2407
  //#region src/components/Select/internal/useSelectSearch.ts
1584
- function Jt({ options: e, searchable: t, searchValue: n }) {
1585
- return u(() => {
2408
+ function Tn({ options: e, searchable: t, searchValue: n }) {
2409
+ return m(() => {
1586
2410
  if (!t || !n) return e;
1587
2411
  let r = n.toLocaleLowerCase();
1588
- return e.filter((e) => `${e.label} ${Yt(e.description)}`.toLocaleLowerCase().includes(r));
2412
+ return e.filter((e) => `${e.label} ${En(e.description)}`.toLocaleLowerCase().includes(r));
1589
2413
  }, [
1590
2414
  e,
1591
2415
  n,
1592
2416
  t
1593
2417
  ]);
1594
2418
  }
1595
- function Yt(e) {
2419
+ function En(e) {
1596
2420
  return typeof e == "string" || typeof e == "number" ? String(e) : "";
1597
2421
  }
1598
2422
  var Y = {
@@ -1621,61 +2445,61 @@ var Y = {
1621
2445
  spin: "_spin_x5w2h_818",
1622
2446
  loading: "_loading_x5w2h_827",
1623
2447
  open: "_open_x5w2h_846"
1624
- }, Xt = ({ children: e, className: t }) => {
1625
- let { triggerProps: n } = bt();
1626
- return /* @__PURE__ */ g(Zt, {
1627
- ...n,
1628
- className: [n.className, t].filter(Boolean).join(" "),
2448
+ }, Dn = ({ children: e, className: t }) => {
2449
+ let { triggerProps: r } = Yt();
2450
+ return /* @__PURE__ */ n(On, {
2451
+ ...r,
2452
+ className: [r.className, t].filter(Boolean).join(" "),
1629
2453
  children: e
1630
2454
  });
1631
2455
  };
1632
- Xt.__velliraSelectPart = "trigger", Xt.displayName = "Select.Trigger";
1633
- var Zt = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabled: a, required: o, listboxId: s, activeIndex: c, ariaLabel: l, error: u, displayText: d, isPlaceholder: f, size: p = "md", color: m, variant: v, loading: b, startIcon: S, endIcon: C, prefix: w, suffix: T, clearable: E, onClear: D, className: O, buttonRef: k, onClick: A, onKeyDown: j, onBlur: M, onFocus: N }) => /* @__PURE__ */ g("button", {
1634
- id: t,
2456
+ Dn.__velliraSelectPart = "trigger", Dn.displayName = "Select.Trigger";
2457
+ var On = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabled: c, required: l, listboxId: u, activeIndex: d, ariaLabel: f, error: p, displayText: m, isPlaceholder: h, size: g = "md", color: _, variant: v, loading: b, startIcon: S, endIcon: C, prefix: w, suffix: T, clearable: E, onClear: D, className: O, buttonRef: k, onClick: A, onKeyDown: j, onBlur: M, onFocus: P }) => /* @__PURE__ */ n("button", {
2458
+ id: i,
1635
2459
  ref: k,
1636
2460
  type: "button",
1637
2461
  role: "combobox",
1638
- disabled: a,
1639
- "aria-disabled": a || void 0,
1640
- "aria-required": o || void 0,
1641
- "aria-expanded": i,
2462
+ disabled: c,
2463
+ "aria-disabled": c || void 0,
2464
+ "aria-required": l || void 0,
2465
+ "aria-expanded": s,
1642
2466
  "aria-haspopup": "listbox",
1643
- "aria-label": l,
1644
- "aria-labelledby": r,
1645
- "aria-invalid": u || void 0,
1646
- "aria-controls": i ? s : void 0,
1647
- "aria-describedby": n,
1648
- "aria-activedescendant": i && c >= 0 ? `${s}-option-${c}` : void 0,
1649
- className: V(Y.control, Y[p], Y[v], Y[m], {
1650
- [Y.error]: !!u,
1651
- [Y.disabled]: a,
2467
+ "aria-label": f,
2468
+ "aria-labelledby": o,
2469
+ "aria-invalid": p || void 0,
2470
+ "aria-controls": s ? u : void 0,
2471
+ "aria-describedby": a,
2472
+ "aria-activedescendant": s && d >= 0 ? `${u}-option-${d}` : void 0,
2473
+ className: N(Y.control, Y[g], Y[v], Y[_], {
2474
+ [Y.error]: !!p,
2475
+ [Y.disabled]: c,
1652
2476
  [Y.loading]: b
1653
2477
  }, O),
1654
2478
  onClick: A,
1655
2479
  onKeyDown: j,
1656
2480
  onBlur: M,
1657
- onFocus: N,
1658
- children: e ?? /* @__PURE__ */ _(h, { children: [
1659
- S && /* @__PURE__ */ g("span", {
2481
+ onFocus: P,
2482
+ children: e ?? /* @__PURE__ */ r(t, { children: [
2483
+ S && /* @__PURE__ */ n("span", {
1660
2484
  className: Y.adornment,
1661
2485
  children: S
1662
2486
  }),
1663
- w && /* @__PURE__ */ g("span", {
2487
+ w && /* @__PURE__ */ n("span", {
1664
2488
  className: Y.affix,
1665
2489
  children: w
1666
2490
  }),
1667
- /* @__PURE__ */ g("span", {
2491
+ /* @__PURE__ */ n("span", {
1668
2492
  className: Y.valueWrap,
1669
- children: /* @__PURE__ */ g("span", {
1670
- className: V(Y.value, { [Y.placeholder]: f }),
1671
- children: d
2493
+ children: /* @__PURE__ */ n("span", {
2494
+ className: N(Y.value, { [Y.placeholder]: h }),
2495
+ children: m
1672
2496
  })
1673
2497
  }),
1674
- T && /* @__PURE__ */ g("span", {
2498
+ T && /* @__PURE__ */ n("span", {
1675
2499
  className: Y.affix,
1676
2500
  children: T
1677
2501
  }),
1678
- E && /* @__PURE__ */ g("span", {
2502
+ E && /* @__PURE__ */ n("span", {
1679
2503
  role: "button",
1680
2504
  "aria-label": "Clear selection",
1681
2505
  tabIndex: -1,
@@ -1683,282 +2507,292 @@ var Zt = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabl
1683
2507
  onClick: (e) => {
1684
2508
  e.stopPropagation(), D?.();
1685
2509
  },
1686
- children: /* @__PURE__ */ g(x, {})
2510
+ children: /* @__PURE__ */ n(x, {})
1687
2511
  }),
1688
- /* @__PURE__ */ g("span", {
1689
- className: V(Y.arrow, { [Y.open]: i }),
2512
+ /* @__PURE__ */ n("span", {
2513
+ className: N(Y.arrow, { [Y.open]: s }),
1690
2514
  "aria-hidden": "true",
1691
- children: b ? /* @__PURE__ */ g("span", { className: Y.spinner }) : C ?? /* @__PURE__ */ g(y, {})
2515
+ children: b ? /* @__PURE__ */ n("span", { className: Y.spinner }) : C ?? /* @__PURE__ */ n(y, {})
1692
2516
  })
1693
2517
  ] })
1694
2518
  });
1695
- Zt.displayName = "SelectTriggerSurface";
2519
+ On.displayName = "SelectTriggerSurface";
1696
2520
  //#endregion
1697
2521
  //#region src/components/Select/Root/SelectRoot.tsx
1698
- var Qt = 0, $t = "", en = ({ children: e, label: t, description: n, id: r, name: i, "aria-label": a, "aria-describedby": s, "aria-labelledby": p, value: m, defaultValue: v, onValueChange: y, multiple: b = !1, maxSelected: x, closeOnSelect: S, placeholder: C = "Select...", empty: w, loadingText: T = "Loading...", noOptionsText: E, size: D, color: O = "primary", variant: k = "outline", required: A = !1, disabled: j = !1, invalid: M = !1, loading: N = !1, clearable: P = !1, searchable: F = !1, virtual: I, modal: R = !1, command: ee = !1, error: z, placement: B = "bottom", matchTriggerWidth: te = !0, avoidCollisions: ne = !0, portal: re = !0, open: ie, defaultOpen: ae = !1, onOpenChange: V, onSearch: H, onClear: U, startIcon: oe, endIcon: se, prefix: ce, suffix: le, renderValue: ue, renderOption: de, onBlur: fe, onFocus: pe, className: me, triggerClassName: he, dropdownClassName: ge }) => {
1699
- let W = l(), _e = Rt(), ve = !!(t || n || z), ye = r ?? (ve ? void 0 : _e?.controlId) ?? W, be = `${ye}-listbox`, [xe, Se] = f(""), Ce = !!z, we = Ce ? `${ye}-error` : void 0, Te = n ? `${ye}-description` : void 0, Ee = D ?? _e?.size ?? "md", De = M || Ce || !ve && !!_e?.invalid, Oe = j || !ve && !!_e?.disabled, ke = A || !ve && !!_e?.required, Ae = [
1700
- s,
1701
- !ve && !s ? _e?.ariaDescribedBy : void 0,
1702
- Te,
1703
- we
1704
- ].filter(Boolean).join(" "), je = d(null), Me = d(null), [Ne, Pe] = f(!1), Fe = F || ee, { entries: Ie, options: Le } = Kt(e), ze = Jt({
1705
- options: Le,
1706
- searchable: Fe,
1707
- searchValue: xe
1708
- }), { selectedValue: Be, selectedValues: G, isOpen: K, setIsOpen: Ve, setSelectedValue: He, activeIndex: Ue, setActiveIndex: We, closeDropdown: Ge, toggleDropdown: Ke, selectValue: qe, onKeyDown: Je } = L({
1709
- value: m,
2522
+ var kn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label": c, "aria-describedby": l, "aria-labelledby": d, value: _, defaultValue: v, onValueChange: y, multiple: b = !1, maxSelected: x, closeOnSelect: S, placeholder: C = "Select...", empty: w, loadingText: T = "Loading...", noOptionsText: E, size: D, color: O = "primary", variant: k = "outline", required: A = !1, disabled: j = !1, invalid: M = !1, loading: N = !1, clearable: P = !1, searchable: F = !1, virtual: I, modal: L = !1, command: R = !1, error: z, placement: ee = "bottom", matchTriggerWidth: B = !0, avoidCollisions: te = !0, portal: ne = !0, open: re, defaultOpen: ie = !1, onOpenChange: ae, onSearch: oe, onClear: V, startIcon: ce, endIcon: le, prefix: de, suffix: H, renderValue: fe, renderOption: me, onBlur: he, onFocus: ge, className: _e, triggerClassName: ve, dropdownClassName: ye }) => {
2523
+ let xe = p(), U = hn(), Se = !!(i || a || z), Ce = o ?? (Se ? void 0 : U?.controlId) ?? xe, we = `${Ce}-listbox`, [Te, Ee] = g(""), De = !!z, Oe = De ? `${Ce}-error` : void 0, ke = a ? `${Ce}-description` : void 0, Ae = D ?? U?.size ?? "md", je = M || De || !Se && !!U?.invalid, Me = j || !Se && !!U?.disabled, Ne = A || !Se && !!U?.required, Pe = [
2524
+ l,
2525
+ !Se && !l ? U?.ariaDescribedBy : void 0,
2526
+ ke,
2527
+ Oe
2528
+ ].filter(Boolean).join(" "), W = h(null), Fe = h(null), [G, Ie] = g(!1), Le = F || R, { entries: Re, options: ze } = Cn(e), Be = Tn({
2529
+ options: ze,
2530
+ searchable: Le,
2531
+ searchValue: Te
2532
+ }), { selectedValue: Ve, selectedValues: K, isOpen: q, setIsOpen: He, setSelectedValue: Ue, activeIndex: We, setActiveIndex: Ge, closeDropdown: Ke, toggleDropdown: qe, selectValue: Je, onKeyDown: Ye } = be({
2533
+ value: _,
1710
2534
  defaultValue: v,
1711
2535
  onValueChange: y,
1712
- options: ze,
2536
+ options: Be,
1713
2537
  multiple: b,
1714
2538
  maxSelected: x,
1715
2539
  closeOnSelect: S,
1716
- disabled: Oe,
1717
- open: ie,
1718
- defaultOpen: ae,
1719
- onOpenChange: V
1720
- }), Ye = u(() => Le.find((e) => G.includes(e.value)), [Le, G]), Xe = u(() => Le.filter((e) => G.includes(e.value)), [Le, G]), Ze = !!Ye, Qe = Array.isArray(Be) ? Be[0] ?? "" : Be, { floatingStyles: $e, setRef: et, setFloatingRef: tt } = qt({
1721
- isOpen: K,
1722
- onOpenChange: Ve,
1723
- placement: B,
1724
- matchTriggerWidth: te,
1725
- avoidCollisions: ne
1726
- }), nt = o((e) => {
1727
- qe(e), je.current?.focus();
1728
- }, [qe]), rt = o((e) => {
2540
+ disabled: Me,
2541
+ open: re,
2542
+ defaultOpen: ie,
2543
+ onOpenChange: ae
2544
+ }), Xe = m(() => ze.find((e) => K.includes(e.value)), [ze, K]), Ze = m(() => ze.filter((e) => K.includes(e.value)), [ze, K]), Qe = !!Xe, $e = Array.isArray(Ve) ? Ve[0] ?? "" : Ve, { floatingStyles: et, setRef: tt, setFloatingRef: nt } = wn({
2545
+ isOpen: q,
2546
+ onOpenChange: He,
2547
+ placement: ee,
2548
+ matchTriggerWidth: B,
2549
+ avoidCollisions: te
2550
+ }), rt = u((e) => {
2551
+ Je(e), W.current?.focus();
2552
+ }, [Je]), it = u((e) => {
1729
2553
  if (!b || e.length === 0) return;
1730
- let t = e.filter((e) => Le.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => G.includes(e)), r = G.filter((e) => !t.includes(e)).length, i = typeof x == "number" ? Math.max(0, Math.min(t.length, x - r)) : t.length;
2554
+ let t = e.filter((e) => ze.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => K.includes(e)), r = K.filter((e) => !t.includes(e)).length, i = typeof x == "number" ? Math.max(0, Math.min(t.length, x - r)) : t.length;
1731
2555
  if (n.length > 0 && n.length >= i) {
1732
- He(G.filter((e) => !t.includes(e)));
2556
+ Ue(K.filter((e) => !t.includes(e)));
1733
2557
  return;
1734
2558
  }
1735
- let a = [...G];
2559
+ let a = [...K];
1736
2560
  for (let e of t) if (!a.includes(e)) {
1737
2561
  if (typeof x == "number" && a.length >= x) break;
1738
2562
  a.push(e);
1739
2563
  }
1740
- He(a), S && (Ge(), je.current?.focus());
2564
+ Ue(a), S && (Ke(), W.current?.focus());
1741
2565
  }, [
1742
- Ge,
2566
+ Ke,
1743
2567
  S,
1744
2568
  x,
1745
2569
  b,
1746
- Le,
1747
- G,
1748
- He
1749
- ]), it = o(() => {
1750
- qe(""), U?.(), je.current?.focus();
1751
- }, [U, qe]), at = o(() => {
1752
- K || Pe(!1), Ke();
1753
- }, [K, Ke]), ot = o((e) => {
1754
- tn(e, K) && Pe(!0), Je(e);
1755
- }, [K, Je]), st = o((e) => {
1756
- Pe(!0), We(e);
1757
- }, [We]), ct = o((e) => {
1758
- Se(e), H?.(e);
1759
- }, [H]);
1760
- Re([je, Me], Ge, K), c(() => {
1761
- K || Pe(!1);
1762
- }, [K]), c(() => {
1763
- !K && xe && Se("");
1764
- }, [K, xe]), c(() => {
1765
- if (!(!R || !K)) return Qt === 0 && ($t = document.body.style.overflow), Qt += 1, document.body.style.overflow = "hidden", () => {
1766
- Qt = Math.max(0, Qt - 1), Qt === 0 && (document.body.style.overflow = $t);
1767
- };
1768
- }, [K, R]);
1769
- let lt = o((e) => {
1770
- je.current = e, et(e);
1771
- }, [et]), ut = o((e) => {
1772
- Me.current = e, tt(e);
1773
- }, [tt]), dt = ue ? ue(Ye) : b && Xe.length ? Xe.map((e) => e.label).join(", ") : Ye?.label ?? C, ft = w ?? E ?? "No options available", pt = P && G.length > 0 && !Oe && !N, mt = {
1774
- id: ye,
1775
- describedBy: Ae || void 0,
1776
- labelledBy: a ? void 0 : p,
1777
- isOpen: K,
1778
- disabled: Oe,
1779
- required: ke,
1780
- listboxId: be,
1781
- activeIndex: Ue,
1782
- ariaLabel: a ?? (!t && !_e?.labelId ? Ye?.label || C : void 0),
1783
- error: De,
2570
+ ze,
2571
+ K,
2572
+ Ue
2573
+ ]), at = u(() => {
2574
+ Je(""), V?.(), W.current?.focus();
2575
+ }, [V, Je]), ot = u(() => {
2576
+ q || Ie(!1), qe();
2577
+ }, [q, qe]), st = u((e) => {
2578
+ An(e, q) && Ie(!0), Ye(e);
2579
+ }, [q, Ye]), ct = u((e) => {
2580
+ Ie(!0), Ge(e);
2581
+ }, [Ge]), lt = u((e) => {
2582
+ Ee(e), oe?.(e);
2583
+ }, [oe]), { isTopOverlay: ut } = ue({
2584
+ active: q,
2585
+ id: we
2586
+ });
2587
+ se({
2588
+ active: q,
2589
+ closeOnEscape: !0,
2590
+ closeOnOutsidePress: !0,
2591
+ contentRef: Fe,
2592
+ ignoreRefs: [W],
2593
+ isTopOverlay: ut,
2594
+ requestClose: Ke
2595
+ }), f(() => {
2596
+ q || Ie(!1);
2597
+ }, [q]), f(() => {
2598
+ !q && Te && Ee("");
2599
+ }, [q, Te]), pe({
2600
+ active: q,
2601
+ enabled: L
2602
+ });
2603
+ let dt = u((e) => {
2604
+ W.current = e, tt(e);
2605
+ }, [tt]), ft = u((e) => {
2606
+ Fe.current = e, nt(e);
2607
+ }, [nt]), pt = fe ? fe(Xe) : b && Ze.length ? Ze.map((e) => e.label).join(", ") : Xe?.label ?? C, mt = w ?? E ?? "No options available", ht = P && K.length > 0 && !Me && !N, gt = {
2608
+ id: Ce,
2609
+ describedBy: Pe || void 0,
2610
+ labelledBy: c ? void 0 : d,
2611
+ isOpen: q,
2612
+ disabled: Me,
2613
+ required: Ne,
2614
+ listboxId: we,
2615
+ activeIndex: We,
2616
+ ariaLabel: c ?? (!i && !U?.labelId ? Xe?.label || C : void 0),
2617
+ error: je,
1784
2618
  loading: N,
1785
- displayText: dt,
1786
- isPlaceholder: !Ze,
1787
- size: Ee,
2619
+ displayText: pt,
2620
+ isPlaceholder: !Qe,
2621
+ size: Ae,
1788
2622
  color: O,
1789
2623
  variant: k,
1790
- startIcon: oe,
1791
- endIcon: se,
1792
- prefix: ce,
1793
- suffix: le,
1794
- clearable: pt,
1795
- className: he,
1796
- buttonRef: lt,
1797
- onClear: it,
1798
- onClick: at,
1799
- onKeyDown: ot,
1800
- onBlur: fe,
1801
- onFocus: pe
1802
- }, ht = {
1803
- isOpen: K,
1804
- listboxId: be,
1805
- labelledById: ye,
1806
- style: $e,
1807
- options: ze,
1808
- entries: Fe || xe ? void 0 : Ie,
2624
+ startIcon: ce,
2625
+ endIcon: le,
2626
+ prefix: de,
2627
+ suffix: H,
2628
+ clearable: ht,
2629
+ className: ve,
2630
+ buttonRef: dt,
2631
+ onClear: at,
2632
+ onClick: ot,
2633
+ onKeyDown: st,
2634
+ onBlur: he,
2635
+ onFocus: ge
2636
+ }, _t = {
2637
+ isOpen: q,
2638
+ listboxId: we,
2639
+ labelledById: Ce,
2640
+ style: et,
2641
+ options: Be,
2642
+ entries: Le || Te ? void 0 : Re,
1809
2643
  multiple: b,
1810
2644
  color: O,
1811
2645
  variant: k,
1812
- searchable: Fe,
1813
- command: ee,
2646
+ searchable: Le,
2647
+ command: R,
1814
2648
  virtual: I,
1815
- portal: re,
1816
- searchValue: xe,
2649
+ portal: ne,
2650
+ searchValue: Te,
1817
2651
  loading: N,
1818
2652
  loadingText: T,
1819
- noOptionsText: ft,
1820
- renderOption: de,
1821
- selectedValue: Qe,
1822
- selectedValues: G,
1823
- activeIndex: Ue,
1824
- visualActiveIndex: Ne ? Ue : -1,
1825
- className: ge,
1826
- setDropdownRef: ut,
1827
- onSelect: nt,
1828
- onSelectGroup: rt,
1829
- onMouseEnter: st,
1830
- onSearchChange: ct
1831
- }, gt = /* @__PURE__ */ _(h, { children: [i && b && G.length > 0 && /* @__PURE__ */ g(h, { children: G.map((e) => /* @__PURE__ */ g("input", {
2653
+ noOptionsText: mt,
2654
+ renderOption: me,
2655
+ selectedValue: $e,
2656
+ selectedValues: K,
2657
+ activeIndex: We,
2658
+ visualActiveIndex: G ? We : -1,
2659
+ className: ye,
2660
+ setDropdownRef: ft,
2661
+ onSelect: rt,
2662
+ onSelectGroup: it,
2663
+ onMouseEnter: ct,
2664
+ onSearchChange: lt
2665
+ }, vt = /* @__PURE__ */ r(t, { children: [s && b && K.length > 0 && /* @__PURE__ */ n(t, { children: K.map((e) => /* @__PURE__ */ n("input", {
1832
2666
  type: "hidden",
1833
- name: i,
2667
+ name: s,
1834
2668
  value: e,
1835
- disabled: Oe
1836
- }, e)) }), i && !b && /* @__PURE__ */ g("input", {
2669
+ disabled: Me
2670
+ }, e)) }), s && !b && /* @__PURE__ */ n("input", {
1837
2671
  type: "hidden",
1838
- name: i,
1839
- value: Qe,
1840
- disabled: Oe
1841
- })] }), _t = Ut(e), vt = /* @__PURE__ */ _(yt, {
2672
+ name: s,
2673
+ value: $e,
2674
+ disabled: Me
2675
+ })] }), yt = bn(e), bt = /* @__PURE__ */ r(Jt, {
1842
2676
  value: {
1843
- triggerProps: mt,
1844
- contentProps: ht
2677
+ triggerProps: gt,
2678
+ contentProps: _t
1845
2679
  },
1846
- children: [gt, _t ? e : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Xt, {}), /* @__PURE__ */ g(wt, { children: e })] })]
1847
- }), bt = /* @__PURE__ */ _(yt, {
2680
+ children: [vt, yt ? e : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(Dn, {}), /* @__PURE__ */ n(en, { children: e })] })]
2681
+ }), xt = /* @__PURE__ */ r(Jt, {
1848
2682
  value: {
1849
- triggerProps: mt,
1850
- contentProps: ht
2683
+ triggerProps: gt,
2684
+ contentProps: _t
1851
2685
  },
1852
2686
  children: [
1853
- gt,
1854
- /* @__PURE__ */ g(Zt, { ...mt }),
1855
- /* @__PURE__ */ g(Tt, { ...ht })
2687
+ vt,
2688
+ /* @__PURE__ */ n(On, { ...gt }),
2689
+ /* @__PURE__ */ n(tn, { ..._t })
1856
2690
  ]
1857
2691
  });
1858
- return !ve && _e ? e ? vt : bt : /* @__PURE__ */ g(Vt, {
1859
- id: ye,
1860
- label: t,
1861
- description: n,
2692
+ return !Se && U ? e ? bt : xt : /* @__PURE__ */ n(vn, {
2693
+ id: Ce,
2694
+ label: i,
2695
+ description: a,
1862
2696
  error: z,
1863
- required: ke,
1864
- disabled: Oe,
2697
+ required: Ne,
2698
+ disabled: Me,
1865
2699
  bindControl: !1,
1866
- className: me,
1867
- children: e ? vt : bt
2700
+ className: _e,
2701
+ children: e ? bt : xt
1868
2702
  });
1869
2703
  };
1870
- en.displayName = "SelectRoot";
1871
- function tn(e, t) {
2704
+ kn.displayName = "SelectRoot";
2705
+ function An(e, t) {
1872
2706
  return e.altKey || e.ctrlKey || e.metaKey ? !1 : t ? e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" || e.key === "Enter" || e.key === " " || e.key.length === 1 : e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === " ";
1873
2707
  }
1874
2708
  //#endregion
1875
2709
  //#region src/components/Select/Trigger/SelectIcon.tsx
1876
- var nn = ({ children: e, className: t }) => {
1877
- let { triggerProps: n } = bt();
1878
- return /* @__PURE__ */ g("span", {
1879
- className: V(Y.arrow, { [Y.open]: n.isOpen }, t),
2710
+ var jn = ({ children: e, className: t }) => {
2711
+ let { triggerProps: r } = Yt();
2712
+ return /* @__PURE__ */ n("span", {
2713
+ className: N(Y.arrow, { [Y.open]: r.isOpen }, t),
1880
2714
  "aria-hidden": "true",
1881
- children: n.loading ? /* @__PURE__ */ g("span", { className: Y.spinner }) : e ?? n.endIcon ?? /* @__PURE__ */ g(y, {})
2715
+ children: r.loading ? /* @__PURE__ */ n("span", { className: Y.spinner }) : e ?? r.endIcon ?? /* @__PURE__ */ n(y, {})
1882
2716
  });
1883
2717
  };
1884
- nn.__velliraSelectPart = "icon", nn.displayName = "Select.Icon";
2718
+ jn.__velliraSelectPart = "icon", jn.displayName = "Select.Icon";
1885
2719
  //#endregion
1886
2720
  //#region src/components/Select/Trigger/SelectValue.tsx
1887
- var rn = ({ children: e, className: t }) => {
1888
- let { triggerProps: n } = bt();
1889
- return /* @__PURE__ */ g("span", {
1890
- className: V(Y.valueWrap, t),
1891
- children: /* @__PURE__ */ g("span", {
1892
- className: V(Y.value, { [Y.placeholder]: n.isPlaceholder }),
1893
- children: e ?? n.displayText
2721
+ var Mn = ({ children: e, className: t }) => {
2722
+ let { triggerProps: r } = Yt();
2723
+ return /* @__PURE__ */ n("span", {
2724
+ className: N(Y.valueWrap, t),
2725
+ children: /* @__PURE__ */ n("span", {
2726
+ className: N(Y.value, { [Y.placeholder]: r.isPlaceholder }),
2727
+ children: e ?? r.displayText
1894
2728
  })
1895
2729
  });
1896
2730
  };
1897
- rn.__velliraSelectPart = "value", rn.displayName = "Select.Value";
2731
+ Mn.__velliraSelectPart = "value", Mn.displayName = "Select.Value";
1898
2732
  //#endregion
1899
2733
  //#region src/components/Select/Select.tsx
1900
- var an = Object.assign(en, {
1901
- Trigger: Xt,
1902
- Value: rn,
1903
- Icon: nn,
1904
- Content: wt,
1905
- Search: At,
1906
- Group: jt,
1907
- Label: Mt,
1908
- Item: St,
1909
- ItemIcon: It,
1910
- ItemDescription: Ft,
1911
- ItemBadge: Pt,
1912
- Separator: Nt,
1913
- Empty: Ot,
1914
- Loading: kt
2734
+ var Nn = Object.assign(kn, {
2735
+ Trigger: Dn,
2736
+ Value: Mn,
2737
+ Icon: jn,
2738
+ Content: en,
2739
+ Search: sn,
2740
+ Group: cn,
2741
+ Label: ln,
2742
+ Item: Qt,
2743
+ ItemIcon: pn,
2744
+ ItemDescription: fn,
2745
+ ItemBadge: dn,
2746
+ Separator: un,
2747
+ Empty: an,
2748
+ Loading: on
1915
2749
  });
1916
- an.displayName = "Select";
2750
+ Nn.displayName = "Select";
1917
2751
  //#endregion
1918
2752
  //#region src/components/Tabs/TabsContext.tsx
1919
- var on = r(null), sn = () => {
1920
- let e = s(on);
2753
+ var Pn = s(null), Fn = () => {
2754
+ let e = d(Pn);
1921
2755
  if (!e) throw Error("Tabs components must be used inside Tabs");
1922
2756
  return e;
1923
- }, cn = {
2757
+ }, In = {
1924
2758
  list: "_list_13hkl_1",
1925
2759
  vertical: "_vertical_13hkl_8"
1926
- }, ln = ({ children: e, className: t, ...n }) => {
1927
- let { orientation: r, appearance: i } = sn();
1928
- return /* @__PURE__ */ g("div", {
1929
- ...n,
2760
+ }, Ln = ({ children: e, className: t, ...r }) => {
2761
+ let { orientation: i, appearance: a } = Fn();
2762
+ return /* @__PURE__ */ n("div", {
2763
+ ...r,
1930
2764
  role: "tablist",
1931
- "aria-orientation": r,
1932
- className: V(cn.list, r === "vertical" && cn.vertical, i === "underline" && cn.underline, i === "pills" && cn.pills, t),
2765
+ "aria-orientation": i,
2766
+ className: N(In.list, i === "vertical" && In.vertical, a === "underline" && In.underline, a === "pills" && In.pills, t),
1933
2767
  children: e
1934
2768
  });
1935
2769
  };
1936
- ln.displayName = "TabsList";
1937
- var un = {
2770
+ Ln.displayName = "TabsList";
2771
+ var Rn = {
1938
2772
  panel: "_panel_1v1a9_1",
1939
2773
  visible: "_visible_1v1a9_10",
1940
2774
  vertical: "_vertical_1v1a9_14"
1941
- }, dn = ({ index: e, children: t, className: n }) => {
1942
- let { activeIndex: r, orientation: i } = sn(), [a, o] = f(!1), s = r === e;
1943
- return c(() => {
1944
- if (!s) {
1945
- o(!1);
2775
+ }, zn = ({ index: e, children: t, className: r }) => {
2776
+ let { activeIndex: i, orientation: a } = Fn(), [o, s] = g(!1), c = i === e;
2777
+ return f(() => {
2778
+ if (!c) {
2779
+ s(!1);
1946
2780
  return;
1947
2781
  }
1948
- let e = setTimeout(() => o(!0), 10);
2782
+ let e = setTimeout(() => s(!0), 10);
1949
2783
  return () => clearTimeout(e);
1950
- }, [s]), /* @__PURE__ */ g("div", {
2784
+ }, [c]), /* @__PURE__ */ n("div", {
1951
2785
  role: "tabpanel",
1952
2786
  id: `tab-panel-${e}`,
1953
2787
  "aria-labelledby": `tab-${e}`,
1954
- hidden: !s,
2788
+ hidden: !c,
1955
2789
  tabIndex: 0,
1956
- className: V(un.panel, a && un.visible, i === "vertical" && un.vertical, n),
2790
+ className: N(Rn.panel, o && Rn.visible, a === "vertical" && Rn.vertical, r),
1957
2791
  children: t
1958
2792
  });
1959
2793
  };
1960
- dn.displayName = "TabsPanel";
1961
- var fn = {
2794
+ zn.displayName = "TabsPanel";
2795
+ var Bn = {
1962
2796
  tab: "_tab_qe8xc_1",
1963
2797
  iconOnly: "_iconOnly_qe8xc_27",
1964
2798
  tabIcon: "_tabIcon_qe8xc_31",
@@ -1967,285 +2801,285 @@ var fn = {
1967
2801
  underline: "_underline_qe8xc_60",
1968
2802
  pills: "_pills_qe8xc_92",
1969
2803
  vertical: "_vertical_qe8xc_106"
1970
- }, pn = i(({ index: e, children: t, className: n, disabled: r = !1, icon: i, onClick: a, onKeyDown: s, ...c }, l) => {
1971
- let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: m, onTabKeyDown: h } = sn(), v = u === e, y = !!i, b = y && t == null;
1972
- return /* @__PURE__ */ _("button", {
2804
+ }, Vn = c(({ index: e, children: t, className: i, disabled: a = !1, icon: o, onClick: s, onKeyDown: c, ...l }, d) => {
2805
+ let { activeIndex: f, setActiveIndex: p, orientation: m, appearance: h = "default", registerTab: g, onTabKeyDown: _ } = Fn(), v = f === e, y = !!o, b = y && t == null;
2806
+ return /* @__PURE__ */ r("button", {
1973
2807
  type: "button",
1974
- ref: o((t) => {
1975
- m(e, t), typeof l == "function" ? l(t) : l && (l.current = t);
2808
+ ref: u((t) => {
2809
+ g(e, t), typeof d == "function" ? d(t) : d && (d.current = t);
1976
2810
  }, [
1977
- m,
2811
+ g,
1978
2812
  e,
1979
- l
2813
+ d
1980
2814
  ]),
1981
2815
  role: "tab",
1982
2816
  "aria-selected": v,
1983
2817
  "aria-controls": `tab-panel-${e}`,
1984
2818
  id: `tab-${e}`,
1985
- disabled: r,
2819
+ disabled: a,
1986
2820
  tabIndex: v ? 0 : -1,
1987
- className: V(fn.tab, fn[p], f === "vertical" && fn.vertical, y && fn.withIcon, b && fn.iconOnly, n),
2821
+ className: N(Bn.tab, Bn[h], m === "vertical" && Bn.vertical, y && Bn.withIcon, b && Bn.iconOnly, i),
1988
2822
  onClick: (t) => {
1989
- r || (d(e), a?.(t));
2823
+ a || (p(e), s?.(t));
1990
2824
  },
1991
2825
  onKeyDown: (e) => {
1992
- h(e), s?.(e);
2826
+ _(e), c?.(e);
1993
2827
  },
1994
- ...c,
1995
- children: [y && /* @__PURE__ */ g("span", {
1996
- className: fn.tabIcon,
2828
+ ...l,
2829
+ children: [y && /* @__PURE__ */ n("span", {
2830
+ className: Bn.tabIcon,
1997
2831
  "aria-hidden": "true",
1998
- children: i
1999
- }), t != null && /* @__PURE__ */ g("span", {
2000
- className: fn.label,
2832
+ children: o
2833
+ }), t != null && /* @__PURE__ */ n("span", {
2834
+ className: Bn.label,
2001
2835
  children: t
2002
2836
  })]
2003
2837
  });
2004
2838
  });
2005
- pn.displayName = "Tab";
2006
- var mn = {
2839
+ Vn.displayName = "Tab";
2840
+ var Hn = {
2007
2841
  tabs: "_tabs_uqy7q_1",
2008
2842
  vertical: "_vertical_uqy7q_5"
2009
- }, hn = ({ children: e, activeIndex: t, defaultActiveIndex: n = 0, onChange: r, orientation: i = "horizontal", appearance: a = "default", className: s }) => {
2010
- let { activeIndex: c, setActiveIndex: l } = R({
2843
+ }, Un = ({ children: e, activeIndex: t, defaultActiveIndex: r = 0, onChange: i, orientation: a = "horizontal", appearance: o = "default", className: s }) => {
2844
+ let { activeIndex: c, setActiveIndex: l } = xe({
2011
2845
  activeIndex: t,
2012
- defaultActiveIndex: n,
2013
- onChange: r
2014
- }), u = d([]), f = o((e, t) => {
2015
- u.current[e] = t;
2016
- }, []), { onKeyDown: p } = ee({
2846
+ defaultActiveIndex: r,
2847
+ onChange: i
2848
+ }), d = h([]), f = u((e, t) => {
2849
+ d.current[e] = t;
2850
+ }, []), { onKeyDown: p } = U({
2017
2851
  activeIndex: c,
2018
2852
  setActiveIndex: l,
2019
- tabRefs: u,
2020
- orientation: i,
2853
+ tabRefs: d,
2854
+ orientation: a,
2021
2855
  onNavigate: (e) => {
2022
- u.current[e]?.focus();
2856
+ d.current[e]?.focus();
2023
2857
  }
2024
2858
  }), m = {
2025
2859
  activeIndex: c,
2026
2860
  setActiveIndex: l,
2027
- orientation: i,
2028
- appearance: a,
2861
+ orientation: a,
2862
+ appearance: o,
2029
2863
  registerTab: f,
2030
2864
  onTabKeyDown: p
2031
2865
  };
2032
- return /* @__PURE__ */ g(on.Provider, {
2866
+ return /* @__PURE__ */ n(Pn.Provider, {
2033
2867
  value: m,
2034
- children: /* @__PURE__ */ g("div", {
2035
- className: V(mn.tabs, i === "vertical" && mn.vertical, s),
2868
+ children: /* @__PURE__ */ n("div", {
2869
+ className: N(Hn.tabs, a === "vertical" && Hn.vertical, s),
2036
2870
  children: e
2037
2871
  })
2038
2872
  });
2039
2873
  };
2040
- hn.displayName = "Tabs";
2874
+ Un.displayName = "Tabs";
2041
2875
  //#endregion
2042
2876
  //#region src/components/Tabs/index.ts
2043
- var gn = Object.assign(hn, {
2044
- List: ln,
2045
- Tab: pn,
2046
- Panel: dn
2047
- }), _n = {
2877
+ var Wn = Object.assign(Un, {
2878
+ List: Ln,
2879
+ Tab: Vn,
2880
+ Panel: zn
2881
+ }), Gn = {
2048
2882
  tooltip: "_tooltip_10opu_1",
2049
2883
  arrow: "_arrow_10opu_25"
2050
- }, vn = i(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
2051
- let l = {
2884
+ }, Kn = c(({ content: e, placement: t = "top", arrowRef: i, arrowX: a, arrowY: o, className: s, style: c, ...l }, u) => {
2885
+ let d = {
2052
2886
  top: "bottom",
2053
2887
  right: "left",
2054
2888
  bottom: "top",
2055
2889
  left: "right"
2056
- }[t.split("-")[0]], u = {
2890
+ }[t.split("-")[0]], f = {
2057
2891
  position: "absolute",
2058
2892
  pointerEvents: "none",
2059
- left: r == null ? "" : `${r}px`,
2060
- top: i == null ? "" : `${i}px`,
2061
- [l]: "-5px"
2893
+ left: a == null ? "" : `${a}px`,
2894
+ top: o == null ? "" : `${o}px`,
2895
+ [d]: "-5px"
2062
2896
  };
2063
- return /* @__PURE__ */ _("div", {
2064
- ref: c,
2065
- className: V(_n.tooltip, a),
2897
+ return /* @__PURE__ */ r("div", {
2898
+ ref: u,
2899
+ className: N(Gn.tooltip, s),
2066
2900
  "data-placement": t,
2067
2901
  "data-state": "open",
2068
- style: o,
2069
- ...s,
2070
- children: [e, /* @__PURE__ */ g("div", {
2071
- ref: n,
2072
- className: _n.arrow,
2073
- style: u
2902
+ style: c,
2903
+ ...l,
2904
+ children: [e, /* @__PURE__ */ n("div", {
2905
+ ref: i,
2906
+ className: Gn.arrow,
2907
+ style: f
2074
2908
  })]
2075
2909
  });
2076
2910
  });
2077
- vn.displayName = "TooltipContent";
2911
+ Kn.displayName = "TooltipContent";
2078
2912
  //#endregion
2079
2913
  //#region src/components/Tooltip/Tooltip.tsx
2080
- var yn = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
2914
+ var qn = ({ children: e, placement: i = "top", content: a, disabled: o = !1, delay: s = {
2081
2915
  open: 300,
2082
2916
  close: 100
2083
- }, maxWidth: a = 250, className: o, onOpenChange: s }) => {
2084
- let [c, u] = f(!1), p = d(null), m = l(), { context: v, floatingStyles: y, middlewareData: b, setRef: x, setFloatingRef: S, placement: T } = Le({
2085
- open: c,
2917
+ }, maxWidth: c = 250, className: l, onOpenChange: u }) => {
2918
+ let [d, f] = g(!1), m = h(null), _ = p(), { context: v, floatingStyles: y, middlewareData: b, setRef: x, setFloatingRef: S, placement: w } = et({
2919
+ open: d,
2086
2920
  onOpenChange: (e) => {
2087
- r || (u(e), s?.(e));
2921
+ o || (f(e), u?.(e));
2088
2922
  },
2089
- placement: t,
2090
- middleware: [w({ element: p })]
2091
- }), E = b.arrow?.x, D = b.arrow?.y, { getReferenceProps: O, getFloatingProps: k } = N([M(v, { delay: {
2092
- open: i.open,
2093
- close: i.close
2094
- } }), j(v)]);
2095
- return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
2923
+ placement: i,
2924
+ middleware: [C({ element: m })]
2925
+ }), T = b.arrow?.x, E = b.arrow?.y, { getReferenceProps: D, getFloatingProps: O } = M([j(v, { delay: {
2926
+ open: s.open,
2927
+ close: s.close
2928
+ } }), A(v)]);
2929
+ return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("div", {
2096
2930
  ref: x,
2097
2931
  style: { display: "inline-flex" },
2098
- "aria-describedby": c ? m : void 0,
2099
- ...O(),
2932
+ "aria-describedby": d ? _ : void 0,
2933
+ ...D(),
2100
2934
  children: e
2101
- }), /* @__PURE__ */ g(C, { children: c && n && /* @__PURE__ */ g(vn, {
2102
- id: m,
2935
+ }), /* @__PURE__ */ n(we, { children: d && a && /* @__PURE__ */ n(Kn, {
2936
+ id: _,
2103
2937
  ref: S,
2104
- content: n,
2105
- arrowRef: p,
2106
- arrowX: E,
2107
- arrowY: D,
2938
+ content: a,
2939
+ arrowRef: m,
2940
+ arrowX: T,
2941
+ arrowY: E,
2108
2942
  role: "tooltip",
2109
2943
  style: {
2110
2944
  ...y,
2111
- maxWidth: typeof a == "number" ? `${a}px` : a
2945
+ maxWidth: typeof c == "number" ? `${c}px` : c
2112
2946
  },
2113
- placement: T,
2114
- className: o,
2115
- ...k()
2947
+ placement: w,
2948
+ className: l,
2949
+ ...O()
2116
2950
  }) })] });
2117
2951
  };
2118
- yn.displayName = "Tooltip";
2952
+ qn.displayName = "Tooltip";
2119
2953
  //#endregion
2120
2954
  //#region src/utils/devWarning.ts
2121
- var bn = (e, t) => {
2955
+ var Jn = (e, t) => {
2122
2956
  process.env.NODE_ENV !== "production" && !e && console.warn(t);
2123
2957
  }, X = {
2124
- button: "_button_wwfj5_1",
2125
- link: "_link_wwfj5_35",
2126
- solid: "_solid_wwfj5_39",
2127
- primary: "_primary_wwfj5_39",
2128
- loading: "_loading_wwfj5_39",
2129
- neutral: "_neutral_wwfj5_74",
2130
- success: "_success_wwfj5_109",
2131
- warning: "_warning_wwfj5_144",
2132
- danger: "_danger_wwfj5_179",
2133
- outline: "_outline_wwfj5_214",
2134
- ghost: "_ghost_wwfj5_389",
2135
- soft: "_soft_wwfj5_564",
2136
- square: "_square_wwfj5_957",
2137
- rounded: "_rounded_wwfj5_961",
2138
- pill: "_pill_wwfj5_965",
2139
- sm: "_sm_wwfj5_969",
2140
- md: "_md_wwfj5_975",
2141
- lg: "_lg_wwfj5_981",
2142
- fullWidth: "_fullWidth_wwfj5_987",
2143
- iconOnly: "_iconOnly_wwfj5_991",
2144
- label: "_label_wwfj5_995",
2145
- labelText: "_labelText_wwfj5_1017",
2146
- icon: "_icon_wwfj5_991",
2147
- spinner: "_spinner_wwfj5_1036",
2148
- "button-spin": "_button-spin_wwfj5_1",
2149
- badge: "_badge_wwfj5_1058",
2150
- shortcut: "_shortcut_wwfj5_1072"
2151
- }, xn = i(({ children: e, color: t = "primary", appearance: r = "solid", size: i = "md", shape: o = "pill", type: s = "button", disabled: c = !1, loading: l = !1, loadingText: u, iconStart: d, iconEnd: f, spinner: p, badge: m, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: N, ...P }, F) => {
2152
- let I = S && a(e) ? e : void 0, L = I ? I.props.children : e, R = x || !L && !!(d || f), ee = !!(T || E || I?.props["aria-label"] || I?.props["aria-labelledby"]), z = c || l, B = l && u ? u : L, te = u && L && !R && (typeof L == "string" || typeof L == "number") && (typeof u == "string" || typeof u == "number") ? String(l ? L : u) : void 0, ne = O === "_blank" && !k ? "noreferrer noopener" : k, re = V(X.button, X[t], X[r], X[i], X[o], C, {
2153
- [X.disabled]: z,
2154
- [X.loading]: l,
2958
+ button: "_button_1b73n_1",
2959
+ solid: "_solid_1b73n_23",
2960
+ primary: "_primary_1b73n_23",
2961
+ loading: "_loading_1b73n_23",
2962
+ neutral: "_neutral_1b73n_49",
2963
+ success: "_success_1b73n_75",
2964
+ warning: "_warning_1b73n_101",
2965
+ danger: "_danger_1b73n_127",
2966
+ outline: "_outline_1b73n_153",
2967
+ ghost: "_ghost_1b73n_283",
2968
+ soft: "_soft_1b73n_413",
2969
+ link: "_link_1b73n_543",
2970
+ square: "_square_1b73n_711",
2971
+ rounded: "_rounded_1b73n_715",
2972
+ pill: "_pill_1b73n_719",
2973
+ sm: "_sm_1b73n_723",
2974
+ md: "_md_1b73n_729",
2975
+ lg: "_lg_1b73n_735",
2976
+ fullWidth: "_fullWidth_1b73n_741",
2977
+ iconOnly: "_iconOnly_1b73n_745",
2978
+ label: "_label_1b73n_749",
2979
+ labelText: "_labelText_1b73n_771",
2980
+ icon: "_icon_1b73n_745",
2981
+ spinner: "_spinner_1b73n_790",
2982
+ "button-spin": "_button-spin_1b73n_1",
2983
+ badge: "_badge_1b73n_812",
2984
+ shortcut: "_shortcut_1b73n_826"
2985
+ }, Yn = c(({ children: e, color: i = "primary", appearance: a = "solid", size: s = "md", shape: c = "pill", type: u = "button", disabled: d = !1, loading: f = !1, loadingText: p, iconStart: m, iconEnd: h, spinner: g, badge: _, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: P, ...F }, I) => {
2986
+ let L = S && l(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(m || h), ee = !!(T || E || L?.props["aria-label"] || L?.props["aria-labelledby"]), B = d || f, te = f && p ? p : R, ne = p && R && !z && (typeof R == "string" || typeof R == "number") && (typeof p == "string" || typeof p == "number") ? String(f ? R : p) : void 0, re = O === "_blank" && !k ? "noreferrer noopener" : k, ie = N(X.button, X[i], X[a], X[s], X[c], C, {
2987
+ [X.disabled]: B,
2988
+ [X.loading]: f,
2155
2989
  [X.fullWidth]: b,
2156
- [X.iconOnly]: R
2990
+ [X.iconOnly]: z
2157
2991
  });
2158
- bn(!S || !D, "Button: pass href to the child element when using asChild."), bn(!S || !!I, "Button: asChild requires a single valid React element child."), bn(!R || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
2159
- let ie = (e) => {
2992
+ Jn(!S || !D, "Button: pass href to the child element when using asChild."), Jn(!S || !!L, "Button: asChild requires a single valid React element child."), Jn(!z || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
2993
+ let ae = (e) => {
2160
2994
  e.preventDefault(), e.stopPropagation();
2161
- }, ae = (e) => {
2162
- if (z) {
2163
- ie(e);
2995
+ }, oe = (e) => {
2996
+ if (B) {
2997
+ ae(e);
2164
2998
  return;
2165
2999
  }
2166
- I?.props.onClick?.(e), e.defaultPrevented || w?.(e);
2167
- }, H = /* @__PURE__ */ _(h, { children: [
2168
- l && (p ? /* @__PURE__ */ g("span", {
3000
+ L?.props.onClick?.(e), e.defaultPrevented || w?.(e);
3001
+ }, V = /* @__PURE__ */ r(t, { children: [
3002
+ f && (g ? /* @__PURE__ */ n("span", {
2169
3003
  className: X.icon,
2170
3004
  "aria-hidden": "true",
2171
- children: p
2172
- }) : /* @__PURE__ */ g("span", {
3005
+ children: g
3006
+ }) : /* @__PURE__ */ n("span", {
2173
3007
  className: X.spinner,
2174
3008
  "aria-hidden": "true"
2175
3009
  })),
2176
- !l && d && /* @__PURE__ */ g("span", {
3010
+ !f && m && /* @__PURE__ */ n("span", {
2177
3011
  className: X.icon,
2178
- children: d
3012
+ children: m
2179
3013
  }),
2180
- B && !R && /* @__PURE__ */ g("span", {
3014
+ te && !z && /* @__PURE__ */ n("span", {
2181
3015
  className: X.label,
2182
- "data-measure": te,
2183
- children: /* @__PURE__ */ g("span", {
3016
+ "data-measure": ne,
3017
+ children: /* @__PURE__ */ n("span", {
2184
3018
  className: X.labelText,
2185
- children: B
3019
+ children: te
2186
3020
  })
2187
3021
  }),
2188
- m && !R && /* @__PURE__ */ g("span", {
3022
+ _ && !z && /* @__PURE__ */ n("span", {
2189
3023
  className: X.badge,
2190
- children: m
3024
+ children: _
2191
3025
  }),
2192
- v && !R && /* @__PURE__ */ g("span", {
3026
+ v && !z && /* @__PURE__ */ n("span", {
2193
3027
  className: X.shortcut,
2194
3028
  children: v
2195
3029
  }),
2196
- !l && f && /* @__PURE__ */ g("span", {
3030
+ !f && h && /* @__PURE__ */ n("span", {
2197
3031
  className: X.icon,
2198
- children: f
3032
+ children: h
2199
3033
  })
2200
3034
  ] });
2201
- return I ? n(I, {
2202
- ...P,
2203
- ref: F,
2204
- "aria-busy": l || void 0,
2205
- "aria-disabled": z || void 0,
2206
- "aria-label": T || I.props["aria-label"] || void 0,
2207
- "aria-labelledby": E || I.props["aria-labelledby"] || void 0,
2208
- className: V(I.props.className, re),
2209
- href: z ? void 0 : I.props.href,
2210
- onClick: ae,
2211
- tabIndex: z ? -1 : I.props.tabIndex,
2212
- title: y || I.props.title,
2213
- children: H
2214
- }) : D ? /* @__PURE__ */ g("a", {
2215
- ref: F,
2216
- href: z ? void 0 : D,
3035
+ return L ? o(L, {
3036
+ ...F,
3037
+ ref: I,
3038
+ "aria-busy": f || void 0,
3039
+ "aria-disabled": B || void 0,
3040
+ "aria-label": T || L.props["aria-label"] || void 0,
3041
+ "aria-labelledby": E || L.props["aria-labelledby"] || void 0,
3042
+ className: N(L.props.className, ie),
3043
+ href: B ? void 0 : L.props.href,
3044
+ onClick: oe,
3045
+ tabIndex: B ? -1 : L.props.tabIndex,
3046
+ title: y || L.props.title,
3047
+ children: V
3048
+ }) : D ? /* @__PURE__ */ n("a", {
3049
+ ref: I,
3050
+ href: B ? void 0 : D,
2217
3051
  id: j,
2218
3052
  role: M,
2219
- tabIndex: z ? -1 : N,
3053
+ tabIndex: B ? -1 : P,
2220
3054
  target: O,
2221
- rel: ne,
3055
+ rel: re,
2222
3056
  download: A,
2223
- onClick: z ? ie : w,
2224
- "aria-disabled": z || void 0,
3057
+ onClick: B ? ae : w,
3058
+ "aria-disabled": B || void 0,
2225
3059
  "aria-label": T || void 0,
2226
3060
  "aria-labelledby": E || void 0,
2227
- "aria-busy": l || void 0,
2228
- className: re,
3061
+ "aria-busy": f || void 0,
3062
+ className: ie,
2229
3063
  title: y,
2230
- children: H
2231
- }) : /* @__PURE__ */ g("button", {
2232
- ...P,
2233
- ref: F,
3064
+ children: V
3065
+ }) : /* @__PURE__ */ n("button", {
3066
+ ...F,
3067
+ ref: I,
2234
3068
  id: j,
2235
3069
  role: M,
2236
- tabIndex: N,
2237
- type: s,
2238
- disabled: z,
2239
- onClick: z ? void 0 : w,
3070
+ tabIndex: P,
3071
+ type: u,
3072
+ disabled: B,
3073
+ onClick: B ? void 0 : w,
2240
3074
  "aria-label": T || void 0,
2241
3075
  "aria-labelledby": E || void 0,
2242
- "aria-busy": l || void 0,
2243
- className: re,
3076
+ "aria-busy": f || void 0,
3077
+ className: ie,
2244
3078
  title: y,
2245
- children: H
3079
+ children: V
2246
3080
  });
2247
3081
  });
2248
- xn.displayName = "Button";
3082
+ Yn.displayName = "Button";
2249
3083
  var Z = {
2250
3084
  wrapper: "_wrapper_1kk5v_1",
2251
3085
  colorPrimary: "_colorPrimary_1kk5v_27",
@@ -2281,62 +3115,62 @@ var Z = {
2281
3115
  "checkbox-checkmark-in": "_checkbox-checkmark-in_1kk5v_1",
2282
3116
  "checkbox-indeterminate-in": "_checkbox-indeterminate-in_1kk5v_1",
2283
3117
  disabled: "_disabled_1kk5v_361"
2284
- }, Sn = {
3118
+ }, Xn = {
2285
3119
  sm: Z.labelSm,
2286
3120
  md: Z.labelMd,
2287
3121
  lg: Z.labelLg
2288
- }, Cn = {
3122
+ }, Zn = {
2289
3123
  sm: Z.wrapperSm,
2290
3124
  md: Z.wrapperMd,
2291
3125
  lg: Z.wrapperLg
2292
- }, wn = {
3126
+ }, Qn = {
2293
3127
  sm: Z.containerSm,
2294
3128
  md: Z.containerMd,
2295
3129
  lg: Z.containerLg
2296
- }, Tn = {
3130
+ }, $n = {
2297
3131
  primary: Z.colorPrimary,
2298
3132
  neutral: Z.colorNeutral,
2299
3133
  success: Z.colorSuccess,
2300
3134
  warning: Z.colorWarning,
2301
3135
  danger: Z.colorDanger
2302
- }, En = i(({ id: e, label: t, description: n, icon: r, indeterminateIcon: i, checked: a, size: s = "md", color: u = "primary", labelPosition: f = "end", defaultChecked: p = !1, disabled: m = !1, required: h = !1, indeterminate: y = !1, className: b, wrapperClassName: x, onCheckedChange: S, error: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, ...D }, O) => {
2303
- let k = l(), A = e ?? k, j = d(null), M = !!C, N = n ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
3136
+ }, er = c(({ id: e, label: t, description: i, icon: a, indeterminateIcon: o, checked: s, size: c = "md", color: l = "primary", labelPosition: d = "end", defaultChecked: m = !1, disabled: g = !1, required: _ = !1, indeterminate: y = !1, className: b, wrapperClassName: x, onCheckedChange: S, error: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, ...D }, O) => {
3137
+ let k = p(), A = e ?? k, j = h(null), M = !!C, P = i ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
2304
3138
  E,
2305
- N,
3139
+ P,
2306
3140
  F
2307
- ].filter(Boolean).join(" "), [L, R] = P({
2308
- value: a,
2309
- defaultValue: p,
3141
+ ].filter(Boolean).join(" "), [L, R] = ge({
3142
+ value: s,
3143
+ defaultValue: m,
2310
3144
  onChange: S
2311
- }), ee = o((e) => {
3145
+ }), z = u((e) => {
2312
3146
  if (j.current = e, typeof O == "function") {
2313
3147
  O(e);
2314
3148
  return;
2315
3149
  }
2316
3150
  O && (O.current = e);
2317
3151
  }, [O]);
2318
- c(() => {
3152
+ f(() => {
2319
3153
  j.current && (j.current.indeterminate = y);
2320
3154
  }, [y]);
2321
- let z = (e) => {
3155
+ let ee = (e) => {
2322
3156
  R(e.target.checked);
2323
3157
  };
2324
- return bn(!!(t || w || T), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ _("div", {
2325
- className: V(Z.container, wn[s], f === "start" && Z.containerLabelStart, b),
3158
+ return Jn(!!(t || w || T), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ r("div", {
3159
+ className: N(Z.container, Qn[c], d === "start" && Z.containerLabelStart, b),
2326
3160
  children: [
2327
- /* @__PURE__ */ _("label", {
3161
+ /* @__PURE__ */ r("label", {
2328
3162
  htmlFor: A,
2329
- className: V(Z.wrapper, Cn[s], Tn[u], f === "start" && Z.labelStart, !t && Z.iconOnly, m && Z.disabled, x),
3163
+ className: N(Z.wrapper, Zn[c], $n[l], d === "start" && Z.labelStart, !t && Z.iconOnly, g && Z.disabled, x),
2330
3164
  children: [
2331
- /* @__PURE__ */ g("input", {
3165
+ /* @__PURE__ */ n("input", {
2332
3166
  ...D,
2333
- ref: ee,
3167
+ ref: z,
2334
3168
  id: A,
2335
3169
  type: "checkbox",
2336
3170
  checked: L,
2337
- disabled: m,
2338
- required: h,
2339
- onChange: z,
3171
+ disabled: g,
3172
+ required: _,
3173
+ onChange: ee,
2340
3174
  className: Z.input,
2341
3175
  "aria-label": w,
2342
3176
  "aria-labelledby": T,
@@ -2344,20 +3178,20 @@ var Z = {
2344
3178
  "aria-invalid": M ? !0 : D["aria-invalid"],
2345
3179
  "aria-describedby": I || void 0
2346
3180
  }),
2347
- /* @__PURE__ */ g("span", {
2348
- className: V(Z.customCheckbox, M && Z.error, y && Z.indeterminate),
3181
+ /* @__PURE__ */ n("span", {
3182
+ className: N(Z.customCheckbox, M && Z.error, y && Z.indeterminate),
2349
3183
  "aria-hidden": "true",
2350
- children: y ? /* @__PURE__ */ g("span", {
2351
- className: V(Z.indeterminateMark, i && Z.customMark),
2352
- children: i
2353
- }) : L && /* @__PURE__ */ g("span", {
3184
+ children: y ? /* @__PURE__ */ n("span", {
3185
+ className: N(Z.indeterminateMark, o && Z.customMark),
3186
+ children: o
3187
+ }) : L && /* @__PURE__ */ n("span", {
2354
3188
  className: Z.checkmark,
2355
- children: r ?? /* @__PURE__ */ g(v, {})
3189
+ children: a ?? /* @__PURE__ */ n(v, {})
2356
3190
  })
2357
3191
  }),
2358
- t && /* @__PURE__ */ _("span", {
2359
- className: V(Z.label, Sn[s]),
2360
- children: [t, h && /* @__PURE__ */ g("span", {
3192
+ t && /* @__PURE__ */ r("span", {
3193
+ className: N(Z.label, Xn[c]),
3194
+ children: [t, _ && /* @__PURE__ */ n("span", {
2361
3195
  className: Z.requiredMark,
2362
3196
  "aria-hidden": "true",
2363
3197
  children: "*"
@@ -2365,12 +3199,12 @@ var Z = {
2365
3199
  })
2366
3200
  ]
2367
3201
  }),
2368
- n && /* @__PURE__ */ g("span", {
2369
- id: N,
3202
+ i && /* @__PURE__ */ n("span", {
3203
+ id: P,
2370
3204
  className: Z.descriptionText,
2371
- children: n
3205
+ children: i
2372
3206
  }),
2373
- M && /* @__PURE__ */ g("span", {
3207
+ M && /* @__PURE__ */ n("span", {
2374
3208
  id: F,
2375
3209
  className: Z.errorText,
2376
3210
  children: C
@@ -2378,7 +3212,7 @@ var Z = {
2378
3212
  ]
2379
3213
  });
2380
3214
  });
2381
- En.displayName = "Checkbox";
3215
+ er.displayName = "Checkbox";
2382
3216
  var Q = {
2383
3217
  inputGroup: "_inputGroup_1fjhk_1",
2384
3218
  primary: "_primary_1fjhk_29",
@@ -2420,7 +3254,7 @@ var Q = {
2420
3254
  toneDanger: "_toneDanger_1fjhk_876",
2421
3255
  toneMuted: "_toneMuted_1fjhk_880",
2422
3256
  toneInverse: "_toneInverse_1fjhk_884"
2423
- }, Dn = {
3257
+ }, tr = {
2424
3258
  default: Q.toneDefault,
2425
3259
  primary: Q.tonePrimary,
2426
3260
  secondary: Q.toneSecondary,
@@ -2428,7 +3262,7 @@ var Q = {
2428
3262
  danger: Q.toneDanger,
2429
3263
  muted: Q.toneMuted,
2430
3264
  inverse: Q.toneInverse
2431
- }, On = (e = "text", t) => {
3265
+ }, nr = (e = "text", t) => {
2432
3266
  if (t) return t;
2433
3267
  switch (e) {
2434
3268
  case "email": return "email";
@@ -2438,7 +3272,7 @@ var Q = {
2438
3272
  case "search": return "off";
2439
3273
  default: return;
2440
3274
  }
2441
- }, kn = (e, t) => {
3275
+ }, rr = (e, t) => {
2442
3276
  let n = e.replace(/\D/g, ""), r = 0, i = "";
2443
3277
  for (let e of t) {
2444
3278
  if (e === "#") {
@@ -2450,149 +3284,149 @@ var Q = {
2450
3284
  r < n.length && (i += e);
2451
3285
  }
2452
3286
  return i;
2453
- }, An = (e, t) => t ? typeof t == "function" ? t(e) : kn(e, t) : e, jn = i(({ id: e, label: t, name: n, description: r, placeholder: i, value: a, defaultValue: s, type: c = "text", size: u, color: p = "primary", variant: m = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: C = !1, className: w, wrapperClassName: T, autoComplete: E, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter: M = !1, startIcon: N, endIcon: P, startAddon: F, endAddon: I, prefix: L, suffix: R, clearIcon: ee, mask: z, format: B, parse: te, startIconTone: ne = "default", endIconTone: re = "default", clearIconTone: ie = "danger", autoFocus: ae, maxLength: H, onMouseEnter: U, onMouseLeave: oe, "aria-describedby": se, "aria-invalid": ce, "aria-labelledby": le, ...ue }, de) => {
2454
- let fe = l(), pe = Rt(), me = !!(t || r || v), he = e ?? (me ? void 0 : pe?.controlId) ?? fe, ge = d(null), [W, _e] = f(!1), [ve, ye] = f(s ?? ""), be = a !== void 0, xe = String((be ? a : ve) ?? ""), Se = B ? B(xe) : xe, Ce = xe.length > 0, we = u ?? pe?.size ?? "md", Te = y || !!v || !me && !!pe?.invalid, Ee = b || !me && !!pe?.disabled, De = x || !me && !!pe?.required, Oe = D || C, ke = c === "password", Ae = ke && j && W ? "text" : c, je = N ?? (c === "search" ? /* @__PURE__ */ g(S, {}) : null), Me = P, Ne = On(c, E), Pe = C && !Ee, Fe = O && Ce && !Ee && !Oe && !Pe, Ie = j && ke && !Ee && !Pe && !Fe, Le = !Pe && !Fe && !Ie && !!Me, Re = !!(M && H), ze = r ? `${he}-description` : void 0, Be = v ? `${he}-error` : void 0, G = Re ? `${he}-counter` : void 0, K = [
2455
- se,
2456
- !me && !se ? pe?.ariaDescribedBy : void 0,
3287
+ }, ir = (e, t) => t ? typeof t == "function" ? t(e) : rr(e, t) : e, ar = c(({ id: e, label: i, name: a, description: o, placeholder: s, value: c, defaultValue: l, type: d = "text", size: f, color: m = "primary", variant: _ = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: C = !1, className: w, wrapperClassName: T, autoComplete: E, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter: M = !1, startIcon: P, endIcon: F, startAddon: I, endAddon: L, prefix: R, suffix: z, clearIcon: ee, mask: B, format: te, parse: ne, startIconTone: re = "default", endIconTone: ie = "default", clearIconTone: ae = "danger", autoFocus: oe, maxLength: V, onMouseEnter: se, onMouseLeave: ce, "aria-describedby": le, "aria-invalid": ue, "aria-labelledby": de, ...H }, fe) => {
3288
+ let pe = p(), me = hn(), he = !!(i || o || v), ge = e ?? (he ? void 0 : me?.controlId) ?? pe, _e = h(null), [ve, ye] = g(!1), [be, xe] = g(l ?? ""), U = c !== void 0, Se = String((U ? c : be) ?? ""), Ce = te ? te(Se) : Se, we = Se.length > 0, Te = f ?? me?.size ?? "md", Ee = y || !!v || !he && !!me?.invalid, De = b || !he && !!me?.disabled, Oe = x || !he && !!me?.required, ke = D || C, Ae = d === "password", je = Ae && j && ve ? "text" : d, Me = P ?? (d === "search" ? /* @__PURE__ */ n(S, {}) : null), Ne = F, Pe = nr(d, E), W = C && !De, Fe = O && we && !De && !ke && !W, G = j && Ae && !De && !W && !Fe, Ie = !W && !Fe && !G && !!Ne, Le = !!(M && V), Re = o ? `${ge}-description` : void 0, ze = v ? `${ge}-error` : void 0, Be = Le ? `${ge}-counter` : void 0, Ve = [
3289
+ le,
3290
+ !he && !le ? me?.ariaDescribedBy : void 0,
3291
+ Re,
2457
3292
  ze,
2458
- Be,
2459
- G
2460
- ].filter(Boolean).join(" "), Ve = ee ?? "×", He = !!(je || L), Ue = !!(Me || R || Fe || Ie || Pe), We = !!(je && L), Ge = !!(Me && R), Ke = !!(F || I), qe = o((e) => {
2461
- if (ge.current = e, typeof de == "function") {
2462
- de(e);
3293
+ Be
3294
+ ].filter(Boolean).join(" "), K = ee ?? "×", q = !!(Me || R), He = !!(Ne || z || Fe || G || W), Ue = !!(Me && R), We = !!(Ne && z), Ge = !!(I || L), Ke = u((e) => {
3295
+ if (_e.current = e, typeof fe == "function") {
3296
+ fe(e);
2463
3297
  return;
2464
3298
  }
2465
- de && (de.current = e);
2466
- }, [de]), Je = o((e) => {
2467
- let t = An(te ? te(e.target.value) : e.target.value, z);
2468
- be || ye(t), A?.(t);
3299
+ fe && (fe.current = e);
3300
+ }, [fe]), qe = u((e) => {
3301
+ let t = ir(ne ? ne(e.target.value) : e.target.value, B);
3302
+ U || xe(t), A?.(t);
2469
3303
  }, [
2470
- be,
2471
- z,
3304
+ U,
3305
+ B,
2472
3306
  A,
2473
- te
2474
- ]), Ye = o(() => {
2475
- be || ye(""), A?.(""), k?.(), ge.current?.focus();
3307
+ ne
3308
+ ]), Je = u(() => {
3309
+ U || xe(""), A?.(""), k?.(), _e.current?.focus();
2476
3310
  }, [
2477
- be,
3311
+ U,
2478
3312
  k,
2479
3313
  A
2480
- ]), Xe = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
2481
- className: V(Q.inputGroup, Q[m], Q[p], {
2482
- [Q.hasAddons]: Ke,
2483
- [Q.isDisabled]: Ee,
2484
- [Q.isInvalid]: Te,
2485
- [Q.isLoading]: Pe
3314
+ ]), Ye = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
3315
+ className: N(Q.inputGroup, Q[_], Q[m], {
3316
+ [Q.hasAddons]: Ge,
3317
+ [Q.isDisabled]: De,
3318
+ [Q.isInvalid]: Ee,
3319
+ [Q.isLoading]: W
2486
3320
  }),
2487
3321
  children: [
2488
- F && /* @__PURE__ */ g("span", {
3322
+ I && /* @__PURE__ */ n("span", {
2489
3323
  className: Q.addon,
2490
- children: F
3324
+ children: I
2491
3325
  }),
2492
- /* @__PURE__ */ _("div", {
2493
- className: V(Q.inputWrapper, {
2494
- [Q.hasLeftAdornment]: He,
2495
- [Q.hasRightAdornment]: Ue,
2496
- [Q.hasStartIconAndPrefix]: We,
2497
- [Q.hasEndIconAndSuffix]: Ge
3326
+ /* @__PURE__ */ r("div", {
3327
+ className: N(Q.inputWrapper, {
3328
+ [Q.hasLeftAdornment]: q,
3329
+ [Q.hasRightAdornment]: He,
3330
+ [Q.hasStartIconAndPrefix]: Ue,
3331
+ [Q.hasEndIconAndSuffix]: We
2498
3332
  }),
2499
3333
  children: [
2500
- je && /* @__PURE__ */ g("span", {
3334
+ Me && /* @__PURE__ */ n("span", {
2501
3335
  "aria-hidden": "true",
2502
- className: V(Q.startAdornment, Dn[ne]),
2503
- children: je
3336
+ className: N(Q.startAdornment, tr[re]),
3337
+ children: Me
2504
3338
  }),
2505
- L && /* @__PURE__ */ g("span", {
3339
+ R && /* @__PURE__ */ n("span", {
2506
3340
  className: Q.prefix,
2507
- children: L
3341
+ children: R
2508
3342
  }),
2509
- /* @__PURE__ */ g("input", {
2510
- ...ue,
2511
- ref: qe,
2512
- id: he,
2513
- name: n,
2514
- type: Ae,
2515
- autoComplete: Ne,
2516
- className: V(Q.input, Q[we], { [Q.error]: Te }, w),
2517
- value: Se,
2518
- onChange: Je,
2519
- placeholder: i,
2520
- disabled: Ee,
2521
- readOnly: Oe,
2522
- required: De,
2523
- autoFocus: ae,
2524
- maxLength: H,
2525
- "aria-invalid": Te ? !0 : ce,
2526
- "aria-labelledby": le ?? (me ? void 0 : pe?.ariaLabelledBy),
2527
- "aria-describedby": K || void 0,
3343
+ /* @__PURE__ */ n("input", {
3344
+ ...H,
3345
+ ref: Ke,
3346
+ id: ge,
3347
+ name: a,
3348
+ type: je,
3349
+ autoComplete: Pe,
3350
+ className: N(Q.input, Q[Te], { [Q.error]: Ee }, w),
3351
+ value: Ce,
3352
+ onChange: qe,
3353
+ placeholder: s,
3354
+ disabled: De,
3355
+ readOnly: ke,
3356
+ required: Oe,
3357
+ autoFocus: oe,
3358
+ maxLength: V,
3359
+ "aria-invalid": Ee ? !0 : ue,
3360
+ "aria-labelledby": de ?? (he ? void 0 : me?.ariaLabelledBy),
3361
+ "aria-describedby": Ve || void 0,
2528
3362
  "aria-busy": C || void 0,
2529
- onMouseEnter: U,
2530
- onMouseLeave: oe
3363
+ onMouseEnter: se,
3364
+ onMouseLeave: ce
2531
3365
  }),
2532
- R && /* @__PURE__ */ g("span", {
3366
+ z && /* @__PURE__ */ n("span", {
2533
3367
  className: Q.suffix,
2534
- children: R
3368
+ children: z
2535
3369
  }),
2536
- /* @__PURE__ */ _("div", {
3370
+ /* @__PURE__ */ r("div", {
2537
3371
  className: Q.endSlot,
2538
3372
  children: [
2539
- Pe && /* @__PURE__ */ g("span", {
3373
+ W && /* @__PURE__ */ n("span", {
2540
3374
  className: Q.spinner,
2541
3375
  "aria-hidden": "true",
2542
3376
  "data-testid": "input-spinner"
2543
3377
  }),
2544
- Ie && /* @__PURE__ */ g("button", {
3378
+ G && /* @__PURE__ */ n("button", {
2545
3379
  type: "button",
2546
3380
  className: Q.iconButton,
2547
- onClick: () => _e((e) => !e),
2548
- "aria-label": W ? "Hide password" : "Show password",
2549
- children: W ? "Hide" : "Show"
3381
+ onClick: () => ye((e) => !e),
3382
+ "aria-label": ve ? "Hide password" : "Show password",
3383
+ children: ve ? "Hide" : "Show"
2550
3384
  }),
2551
- Fe && /* @__PURE__ */ g("button", {
3385
+ Fe && /* @__PURE__ */ n("button", {
2552
3386
  type: "button",
2553
- className: V(Q.clearButton, Dn[ie]),
2554
- onClick: Ye,
3387
+ className: N(Q.clearButton, tr[ae]),
3388
+ onClick: Je,
2555
3389
  "aria-label": "Clear input",
2556
- children: Ve
3390
+ children: K
2557
3391
  }),
2558
- Le && Me && /* @__PURE__ */ g("span", {
3392
+ Ie && Ne && /* @__PURE__ */ n("span", {
2559
3393
  "aria-hidden": "true",
2560
- className: V(Q.endAdornment, Dn[re]),
2561
- children: Me
3394
+ className: N(Q.endAdornment, tr[ie]),
3395
+ children: Ne
2562
3396
  })
2563
3397
  ]
2564
3398
  })
2565
3399
  ]
2566
3400
  }),
2567
- I && /* @__PURE__ */ g("span", {
3401
+ L && /* @__PURE__ */ n("span", {
2568
3402
  className: Q.addon,
2569
- children: I
3403
+ children: L
2570
3404
  })
2571
3405
  ]
2572
- }), Re && /* @__PURE__ */ _("div", {
2573
- id: G,
3406
+ }), Le && /* @__PURE__ */ r("div", {
3407
+ id: Be,
2574
3408
  className: Q.counter,
2575
3409
  children: [
2576
- xe.length,
3410
+ Se.length,
2577
3411
  " / ",
2578
- H
3412
+ V
2579
3413
  ]
2580
3414
  })] });
2581
- return !me && pe ? Xe : /* @__PURE__ */ g(Vt, {
2582
- id: he,
2583
- label: t,
2584
- description: r,
3415
+ return !he && me ? Ye : /* @__PURE__ */ n(vn, {
3416
+ id: ge,
3417
+ label: i,
3418
+ description: o,
2585
3419
  error: v,
2586
- required: De,
2587
- disabled: Ee,
2588
- invalid: Te,
2589
- size: we,
3420
+ required: Oe,
3421
+ disabled: De,
3422
+ invalid: Ee,
3423
+ size: Te,
2590
3424
  className: T,
2591
3425
  bindControl: !1,
2592
- children: Xe
3426
+ children: Ye
2593
3427
  });
2594
3428
  });
2595
- jn.displayName = "Input";
3429
+ ar.displayName = "Input";
2596
3430
  var $ = {
2597
3431
  root: "_root_1avxs_1",
2598
3432
  invalid: "_invalid_1avxs_27",
@@ -2616,23 +3450,23 @@ var $ = {
2616
3450
  "radio-indicator-in": "_radio-indicator-in_1avxs_1",
2617
3451
  content: "_content_1avxs_339",
2618
3452
  error: "_error_1avxs_356"
2619
- }, Mn = {
3453
+ }, or = {
2620
3454
  primary: $.colorPrimary,
2621
3455
  neutral: $.colorNeutral,
2622
3456
  success: $.colorSuccess,
2623
3457
  warning: $.colorWarning,
2624
3458
  danger: $.colorDanger
2625
- }, Nn = i(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: a, color: o, error: s, onCheckedChange: c, label: u, description: d, icon: f, wrapperClassName: p, className: m, id: h, name: v, "aria-describedby": y, ...b }, x) => {
2626
- let S = ht(), C = l(), w = h ?? C, T = d ? `${w}-description` : void 0, E = s ? `${w}-error` : void 0, D = [
3459
+ }, sr = c(({ value: e, checked: t, defaultChecked: i = !1, disabled: a = !1, required: o = !1, size: s, color: c, error: l, onCheckedChange: u, label: d, description: f, icon: m, wrapperClassName: h, className: g, id: _, name: v, "aria-describedby": y, ...b }, x) => {
3460
+ let S = Wt(), C = p(), w = _ ?? C, T = f ? `${w}-description` : void 0, E = l ? `${w}-error` : void 0, D = [
2627
3461
  T,
2628
3462
  E,
2629
3463
  S?.describedBy,
2630
3464
  y
2631
- ].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = P({
3465
+ ].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = ge({
2632
3466
  value: t,
2633
- defaultValue: n,
2634
- onChange: c
2635
- }), j = O ? S.value === e : k, M = !!S?.disabled || r, N = !!S?.required || i, F = S?.name ?? v, I = !!(s || S?.invalid), L = a ?? S?.size ?? "md", R = o ?? S?.color ?? "primary", ee = (t) => {
3467
+ defaultValue: i,
3468
+ onChange: u
3469
+ }), j = O ? S.value === e : k, M = !!S?.disabled || a, P = !!S?.required || o, F = S?.name ?? v, I = !!(l || S?.invalid), L = s ?? S?.size ?? "md", R = c ?? S?.color ?? "primary", z = (t) => {
2636
3470
  if (!M) {
2637
3471
  if (O) {
2638
3472
  S.onValueChange(e);
@@ -2641,13 +3475,13 @@ var $ = {
2641
3475
  A(t.currentTarget.checked);
2642
3476
  }
2643
3477
  };
2644
- return /* @__PURE__ */ _("div", {
2645
- className: V($.root, $[L], I && $.invalid, M && $.disabled, Mn[R], m),
2646
- children: [/* @__PURE__ */ _("label", {
3478
+ return /* @__PURE__ */ r("div", {
3479
+ className: N($.root, $[L], I && $.invalid, M && $.disabled, or[R], g),
3480
+ children: [/* @__PURE__ */ r("label", {
2647
3481
  htmlFor: w,
2648
- className: V($.wrapper, p),
3482
+ className: N($.wrapper, h),
2649
3483
  children: [
2650
- /* @__PURE__ */ g("input", {
3484
+ /* @__PURE__ */ n("input", {
2651
3485
  ...b,
2652
3486
  ref: x,
2653
3487
  id: w,
@@ -2656,78 +3490,78 @@ var $ = {
2656
3490
  value: e,
2657
3491
  checked: j,
2658
3492
  disabled: M,
2659
- required: N,
3493
+ required: P,
2660
3494
  "aria-invalid": I || void 0,
2661
3495
  "aria-describedby": D,
2662
3496
  className: $.input,
2663
- onChange: ee
3497
+ onChange: z
2664
3498
  }),
2665
- /* @__PURE__ */ g("span", {
3499
+ /* @__PURE__ */ n("span", {
2666
3500
  className: $.control,
2667
3501
  "aria-hidden": "true",
2668
- children: /* @__PURE__ */ g("span", {
2669
- className: V($.indicator, f && $.customIcon),
2670
- children: f
3502
+ children: /* @__PURE__ */ n("span", {
3503
+ className: N($.indicator, m && $.customIcon),
3504
+ children: m
2671
3505
  })
2672
3506
  }),
2673
- (u || d) && /* @__PURE__ */ _("span", {
3507
+ (d || f) && /* @__PURE__ */ r("span", {
2674
3508
  className: $.content,
2675
- children: [u && /* @__PURE__ */ g("span", {
3509
+ children: [d && /* @__PURE__ */ n("span", {
2676
3510
  className: $.label,
2677
- children: u
2678
- }), d && /* @__PURE__ */ g("span", {
3511
+ children: d
3512
+ }), f && /* @__PURE__ */ n("span", {
2679
3513
  id: T,
2680
3514
  className: $.description,
2681
- children: d
3515
+ children: f
2682
3516
  })]
2683
3517
  })
2684
3518
  ]
2685
- }), s && /* @__PURE__ */ g("div", {
3519
+ }), l && /* @__PURE__ */ n("div", {
2686
3520
  id: E,
2687
3521
  className: $.error,
2688
- children: s
3522
+ children: l
2689
3523
  })]
2690
3524
  });
2691
3525
  });
2692
- Nn.displayName = "Radio";
3526
+ sr.displayName = "Radio";
2693
3527
  //#endregion
2694
3528
  //#region src/theme/ThemeContext.ts
2695
- var Pn = r(null), Fn = (e) => e === "highContrast" ? "high-contrast" : e, In = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
2696
- let [i, a] = P({
3529
+ var cr = s(null), lr = (e) => e === "highContrast" ? "high-contrast" : e, ur = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, children: i }) => {
3530
+ let [a, o] = ge({
2697
3531
  value: e,
2698
3532
  defaultValue: t,
2699
- onChange: n
2700
- }), o = Fn(i);
2701
- c(() => {
3533
+ onChange: r
3534
+ }), s = lr(a);
3535
+ f(() => {
2702
3536
  if (typeof document > "u") return;
2703
3537
  let { documentElement: e } = document, t = e.dataset.velliraTheme;
2704
- return e.dataset.velliraTheme = o, () => {
3538
+ return e.dataset.velliraTheme = s, () => {
2705
3539
  if (t === void 0) {
2706
3540
  delete e.dataset.velliraTheme;
2707
3541
  return;
2708
3542
  }
2709
3543
  e.dataset.velliraTheme = t;
2710
3544
  };
2711
- }, [o]);
2712
- let s = u(() => ({
2713
- theme: i,
2714
- setTheme: a
2715
- }), [i, a]);
2716
- return /* @__PURE__ */ g(Pn.Provider, {
2717
- value: s,
2718
- children: /* @__PURE__ */ g("div", {
2719
- "data-vellira-theme": o,
2720
- children: r
3545
+ }, [s]);
3546
+ let c = m(() => ({
3547
+ theme: a,
3548
+ setTheme: o
3549
+ }), [a, o]);
3550
+ return /* @__PURE__ */ n(cr.Provider, {
3551
+ value: c,
3552
+ children: /* @__PURE__ */ n("div", {
3553
+ "data-vellira-theme": s,
3554
+ children: i
2721
3555
  })
2722
3556
  });
2723
3557
  };
2724
- In.displayName = "ThemeProvider";
3558
+ ur.displayName = "ThemeProvider";
2725
3559
  //#endregion
2726
3560
  //#region src/theme/useTheme.ts
2727
- function Ln() {
2728
- let e = s(Pn);
3561
+ function dr() {
3562
+ let e = d(cr);
2729
3563
  if (!e) throw Error("useTheme must be used within ThemeProvider.");
2730
3564
  return e;
2731
3565
  }
2732
3566
  //#endregion
2733
- export { xn as Button, En as Checkbox, Ye as Dropdown, Vt as FormField, jn as Input, ft as Modal, Nn as Radio, _t as RadioGroup, an as Select, gn as Tabs, In as ThemeProvider, yn as Tooltip, Ln as useTheme };
3567
+ export { Yn as Button, er as Checkbox, gt as Dropdown, vn as FormField, ar as Input, Vt as Modal, we as Portal, Ce as PortalProvider, sr as Radio, Kt as RadioGroup, Nn as Select, Wn as Tabs, ur as ThemeProvider, qn as Tooltip, dr as useTheme };