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