@vellira-ui/react 2.32.0 → 2.34.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,87 +1,497 @@
1
- import { Children as e, cloneElement as t, createContext as n, forwardRef as r, isValidElement as i, useCallback as a, useContext as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
2
- import f from "clsx";
3
- import { createPortal as p } from "react-dom";
4
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
5
- import { FloatingPortal as _, arrow as v, autoUpdate as y, flip as b, offset as x, shift as S, size as C, useFloating as w, useFocus as T, useHover as E, useInteractions as D } from "@floating-ui/react";
6
- import { useControllableState as O, useDropdown as k, useModal as A, useSelect as j, useTabs as M, useTabsKeyboard as N } from "@vellira-ui/core";
7
- import { Check as P, ChevronDown as F, Close as I, Search as L } from "@vellira-ui/icons";
8
- import R from "focus-trap-react";
9
- //#region src/utils/cn.ts
10
- var z = (...e) => f(e), ee = ({ children: e }) => {
11
- let [t, n] = d(!1);
12
- if (s(() => {
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";
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";
9
+ //#region src/components/Dropdown/internal/DropdownCollection.ts
10
+ function B(e, t) {
11
+ let n = () => null;
12
+ return n.__velliraDropdownPart = e, n.displayName = t, n;
13
+ }
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({
18
+ type: "item",
19
+ item: e,
20
+ itemIndex: s.length - 1
21
+ });
22
+ }
23
+ function u(t, n = {}) {
24
+ e.forEach(t, (e) => {
25
+ if (a(e)) switch (e.type.__velliraDropdownPart) {
26
+ case "trigger":
27
+ r = e;
28
+ return;
29
+ case "content":
30
+ i = e, u(e.props.children, n);
31
+ return;
32
+ case "group": {
33
+ let t = c("group"), r = e.props;
34
+ o.push({
35
+ type: "groupStart",
36
+ id: t,
37
+ props: r
38
+ }), u(r.children, n), o.push({
39
+ type: "groupEnd",
40
+ id: t
41
+ });
42
+ return;
43
+ }
44
+ case "label":
45
+ o.push({
46
+ type: "label",
47
+ id: c("label"),
48
+ props: e.props
49
+ });
50
+ return;
51
+ case "separator":
52
+ o.push({
53
+ type: "separator",
54
+ id: c("separator"),
55
+ props: e.props
56
+ });
57
+ return;
58
+ case "empty":
59
+ o.push({
60
+ type: "empty",
61
+ id: c("empty"),
62
+ props: e.props
63
+ });
64
+ return;
65
+ case "loading":
66
+ o.push({
67
+ type: "loading",
68
+ id: c("loading"),
69
+ props: e.props
70
+ });
71
+ return;
72
+ case "item": {
73
+ let t = e.props;
74
+ l({
75
+ type: "item",
76
+ id: c("item"),
77
+ props: t,
78
+ label: ie(t.children),
79
+ disabled: t.disabled
80
+ });
81
+ return;
82
+ }
83
+ case "checkboxItem": {
84
+ let t = e.props;
85
+ l({
86
+ type: "checkbox",
87
+ id: c("checkbox"),
88
+ props: t,
89
+ label: ie(t.children),
90
+ disabled: t.disabled
91
+ });
92
+ return;
93
+ }
94
+ case "radioGroup": {
95
+ let t = e.props, r = c("radio-group");
96
+ u(t.children, {
97
+ ...n,
98
+ radioGroupId: r,
99
+ radioGroupProps: t
100
+ });
101
+ return;
102
+ }
103
+ case "radioItem": {
104
+ let t = e.props;
105
+ l({
106
+ 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
113
+ });
114
+ return;
115
+ }
116
+ case "sub": {
117
+ let t = e.props, n = re(t.children);
118
+ if (!n.trigger) return;
119
+ let r = n.trigger.props, i = te(n.content?.props.children);
120
+ l({
121
+ type: "subTrigger",
122
+ id: c("sub"),
123
+ props: r,
124
+ label: ie(r.children),
125
+ disabled: r.disabled,
126
+ content: n.content?.props.children,
127
+ subEntries: i.entries,
128
+ subItems: i.items
129
+ });
130
+ return;
131
+ }
132
+ case "itemBadge":
133
+ case "itemDescription":
134
+ case "itemIcon":
135
+ case "itemShortcut":
136
+ case "subContent":
137
+ case "subTrigger": return;
138
+ default: u(e.props.children, n);
139
+ }
140
+ });
141
+ }
142
+ return u(t), {
143
+ content: i,
144
+ entries: o,
145
+ items: s,
146
+ trigger: r
147
+ };
148
+ }
149
+ function ne(t) {
150
+ let n, r, i, o, s = [];
151
+ return e.forEach(t, (e) => {
152
+ if (!a(e)) {
153
+ s.push(e);
154
+ return;
155
+ }
156
+ let t = e.type;
157
+ if (t.__velliraDropdownPart === "itemIcon") {
158
+ i = e.props.children;
159
+ return;
160
+ }
161
+ if (t.__velliraDropdownPart === "itemDescription") {
162
+ r = e.props.children;
163
+ return;
164
+ }
165
+ if (t.__velliraDropdownPart === "itemBadge") {
166
+ n = e.props.children;
167
+ return;
168
+ }
169
+ if (t.__velliraDropdownPart === "itemShortcut") {
170
+ o = e.props.children;
171
+ return;
172
+ }
173
+ s.push(e);
174
+ }), {
175
+ badge: n,
176
+ content: s,
177
+ description: r,
178
+ icon: i,
179
+ shortcut: o
180
+ };
181
+ }
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);
188
+ }), {
189
+ content: r,
190
+ trigger: n
191
+ };
192
+ }
193
+ function ie(t) {
194
+ let n = [];
195
+ function r(t) {
196
+ e.forEach(t, (e) => {
197
+ if (typeof e == "string" || typeof e == "number") {
198
+ n.push(String(e));
199
+ return;
200
+ }
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);
204
+ });
205
+ }
206
+ return r(t), n.join("").trim();
207
+ }
208
+ //#endregion
209
+ //#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(() => {
13
213
  n(!0);
14
214
  }, []), !t) return null;
15
215
  let r = document.getElementById("overlay-root") ?? document.body;
16
- return r ? p(e, r) : null;
17
- }, B = {
18
- dropdown: "_dropdown_1rvx9_1",
19
- "dropdown-in": "_dropdown-in_1rvx9_1"
20
- }, te = r(({ children: e, floatingStyles: t, menuId: n, labelledById: r, label: i, activeDescendantId: a, onKeyDown: o, className: s }, c) => /* @__PURE__ */ h(ee, { children: /* @__PURE__ */ h("ul", {
21
- ref: c,
22
- id: n,
23
- role: "menu",
24
- tabIndex: -1,
25
- "aria-labelledby": r,
26
- "aria-label": r ? void 0 : i,
27
- "aria-activedescendant": a,
28
- onKeyDown: o,
29
- style: t,
30
- className: z(B.dropdown, s),
216
+ return r ? m(e, r) : null;
217
+ }, U = {
218
+ dropdown: "_dropdown_fvtv9_1",
219
+ "dropdown-in": "_dropdown-in_fvtv9_1",
220
+ primary: "_primary_fvtv9_42",
221
+ neutral: "_neutral_fvtv9_65",
222
+ success: "_success_fvtv9_88",
223
+ warning: "_warning_fvtv9_111",
224
+ danger: "_danger_fvtv9_134",
225
+ empty: "_empty_fvtv9_157",
226
+ "dropdown-sheet-in": "_dropdown-sheet-in_fvtv9_1"
227
+ }, oe = B("empty", "Dropdown.Empty"), se = ({ children: e }) => /* @__PURE__ */ g("li", {
228
+ role: "presentation",
229
+ className: U.empty,
230
+ children: e ?? "No actions available"
231
+ });
232
+ se.displayName = "DropdownEmptySurface";
233
+ //#endregion
234
+ //#region src/components/Dropdown/Group/DropdownGroup.tsx
235
+ var ce = B("group", "Dropdown.Group"), le = () => null;
236
+ le.displayName = "DropdownGroupSurface";
237
+ //#endregion
238
+ //#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);
243
+ if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
244
+ return e;
245
+ }
246
+ function ge() {
247
+ let e = s(de);
248
+ if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
249
+ return e;
250
+ }
251
+ var W = {
252
+ item: "_item_1e661_1",
253
+ disabled: "_disabled_1e661_22",
254
+ active: "_active_1e661_35",
255
+ itemShortcut: "_itemShortcut_1e661_41",
256
+ itemDescription: "_itemDescription_1e661_42",
257
+ primary: "_primary_1e661_50",
258
+ success: "_success_1e661_68",
259
+ warning: "_warning_1e661_86",
260
+ danger: "_danger_1e661_104",
261
+ itemIcon: "_itemIcon_1e661_127",
262
+ sm: "_sm_1e661_147",
263
+ md: "_md_1e661_153",
264
+ lg: "_lg_1e661_157",
265
+ itemText: "_itemText_1e661_164",
266
+ itemLabel: "_itemLabel_1e661_173",
267
+ itemBadge: "_itemBadge_1e661_199",
268
+ indicator: "_indicator_1e661_226",
269
+ checked: "_checked_1e661_241",
270
+ subContent: "_subContent_1e661_245",
271
+ subLabel: "_subLabel_1e661_268",
272
+ subSeparator: "_subSeparator_1e661_276"
273
+ }, _e = B("item", "Dropdown.Item"), ve = ({ item: e, itemIndex: t }) => {
274
+ let n = he(), [r, i] = f(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), a = n.activeIndex === t, o = n.openSubId === e.id, s = e.type === "checkbox", c = e.type === "radio", l = e.type === "subTrigger", u = s ? e.props.checked ?? r : c ? (e.groupProps?.value ?? n.radioValues[e.groupId]) === e.props.value : !1, d = n.loading || e.disabled, p = e.props, m = ne(p.children), y = m.icon ?? p.icon, x = m.description ?? ("description" in p ? p.description : void 0), S = m.badge ?? ("badge" in p ? p.badge : void 0), C = m.shortcut ?? p.shortcut, w = m.content.length ? m.content : p.children, T = "color" in p ? p.color : void 0, E = e.type === "item" ? e.props.href : void 0, D = e.type === "item" ? e.props.target : void 0, O = e.type === "item" ? e.props.download : void 0, k = n.getItemId(t), A = s ? "menuitemcheckbox" : c ? "menuitemradio" : "menuitem", j = e.type === "item" && D === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, M = E ? "a" : "li", N = s || c, P = (t) => {
275
+ if (d) {
276
+ t.preventDefault();
277
+ return;
278
+ }
279
+ if (s && e.type === "checkbox") {
280
+ let t = !u;
281
+ i(t), e.props.onCheckedChange?.(t);
282
+ }
283
+ n.selectItem(e, ye(t));
284
+ };
285
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(M, {
286
+ id: k,
287
+ role: A,
288
+ href: M === "a" && !d ? E : void 0,
289
+ target: M === "a" && !d ? D : void 0,
290
+ rel: M === "a" ? j : void 0,
291
+ download: M === "a" && !d ? O : void 0,
292
+ tabIndex: d ? -1 : 0,
293
+ "aria-disabled": d || void 0,
294
+ "aria-checked": s || c ? u : void 0,
295
+ "aria-haspopup": l ? "menu" : void 0,
296
+ "aria-expanded": l ? o : void 0,
297
+ "data-active": a || void 0,
298
+ "data-state": o ? "open" : void 0,
299
+ className: V(W.item, W[n.size], {
300
+ [W.active]: a,
301
+ [W.disabled]: d,
302
+ [W.checked]: u
303
+ }, T && T !== "default" ? W[T] : void 0, p.className),
304
+ onClick: P,
305
+ onMouseEnter: () => {
306
+ d || (n.setActiveIndex(t), l && window.setTimeout(() => n.setOpenSubId(e.id), 120));
307
+ },
308
+ children: [
309
+ N && /* @__PURE__ */ g("span", {
310
+ className: W.indicator,
311
+ "aria-hidden": "true",
312
+ children: u ? /* @__PURE__ */ g(v, {}) : null
313
+ }),
314
+ y && /* @__PURE__ */ g("span", {
315
+ className: W.itemIcon,
316
+ children: y
317
+ }),
318
+ /* @__PURE__ */ _("span", {
319
+ className: W.itemText,
320
+ children: [/* @__PURE__ */ g("span", {
321
+ className: W.itemLabel,
322
+ children: w
323
+ }), x && /* @__PURE__ */ g("span", {
324
+ className: W.itemDescription,
325
+ children: x
326
+ })]
327
+ }),
328
+ S && /* @__PURE__ */ g("span", {
329
+ className: W.itemBadge,
330
+ children: S
331
+ }),
332
+ C && /* @__PURE__ */ g("span", {
333
+ className: W.itemShortcut,
334
+ children: C
335
+ }),
336
+ l && /* @__PURE__ */ g("span", {
337
+ className: W.itemShortcut,
338
+ "aria-hidden": "true",
339
+ children: /* @__PURE__ */ g(b, {})
340
+ })
341
+ ]
342
+ }), l && o && e.subEntries.length > 0 && /* @__PURE__ */ g("ul", {
343
+ role: "menu",
344
+ className: W.subContent,
345
+ children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ g("li", {
346
+ role: "presentation",
347
+ className: W.subLabel,
348
+ children: e.props.children
349
+ }, e.id) : e.type === "separator" ? /* @__PURE__ */ g("li", {
350
+ role: "separator",
351
+ className: W.subSeparator,
352
+ "aria-hidden": "true"
353
+ }, e.id) : e.type === "item" ? /* @__PURE__ */ g(be, {
354
+ item: e.item,
355
+ id: `${k}-${e.itemIndex}`
356
+ }, e.item.id) : null)
357
+ })] });
358
+ };
359
+ ve.displayName = "DropdownItemRow";
360
+ function ye(e) {
361
+ let t = !1;
362
+ return {
363
+ originalEvent: e,
364
+ preventDefault: () => {
365
+ t = !0;
366
+ },
367
+ get defaultPrevented() {
368
+ return t;
369
+ }
370
+ };
371
+ }
372
+ function be({ id: e, item: t }) {
373
+ let n = he(), r = t.props, i = ne(r.children), a = i.icon ?? r.icon, o = i.content.length ? i.content : r.children, s = "color" in r ? r.color : void 0, c = n.loading || t.disabled;
374
+ return /* @__PURE__ */ _("li", {
375
+ id: e,
376
+ role: "menuitem",
377
+ tabIndex: c ? -1 : 0,
378
+ "aria-disabled": c || void 0,
379
+ className: V(W.item, W[n.size], { [W.disabled]: c }, s && s !== "default" ? W[s] : void 0),
380
+ onClick: (e) => {
381
+ c || n.selectItem(t, ye(e));
382
+ },
383
+ children: [a && /* @__PURE__ */ g("span", {
384
+ className: W.itemIcon,
385
+ children: a
386
+ }), /* @__PURE__ */ g("span", {
387
+ className: W.itemText,
388
+ children: /* @__PURE__ */ g("span", {
389
+ className: W.itemLabel,
390
+ children: o
391
+ })
392
+ })]
393
+ });
394
+ }
395
+ var xe = { group: "_group_aviwv_1" }, Se = B("label", "Dropdown.Label"), Ce = ({ children: e, className: t }) => /* @__PURE__ */ g("li", {
396
+ role: "presentation",
397
+ className: V(xe.group, t),
31
398
  children: e
32
- }) }));
33
- te.displayName = "DropdownContent";
399
+ });
400
+ Ce.displayName = "DropdownLabelSurface";
34
401
  //#endregion
35
- //#region src/hooks/useFloatingPosition.ts
36
- var ne = (e) => {
37
- let [t, n] = d(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
38
- return s(() => {
402
+ //#region src/components/Dropdown/Loading/DropdownLoading.tsx
403
+ var we = B("loading", "Dropdown.Loading"), Te = ({ children: e }) => /* @__PURE__ */ g("li", {
404
+ role: "presentation",
405
+ "aria-live": "polite",
406
+ className: U.empty,
407
+ children: e ?? "Loading actions..."
408
+ });
409
+ Te.displayName = "DropdownLoadingSurface";
410
+ var Ee = { separator: "_separator_1v11r_1" }, De = B("separator", "Dropdown.Separator"), Oe = ({ className: e }) => /* @__PURE__ */ g("li", {
411
+ role: "separator",
412
+ className: V(Ee.separator, e),
413
+ "aria-hidden": "true"
414
+ });
415
+ Oe.displayName = "DropdownSeparatorSurface";
416
+ //#endregion
417
+ //#region src/components/Dropdown/Content/DropdownContent.tsx
418
+ var ke = ({ className: e }) => {
419
+ let n = he();
420
+ if (!n.isOpen) return null;
421
+ let r = V(U.dropdown, U[n.color], n.contentProps?.className, e), i = /* @__PURE__ */ g("ul", {
422
+ ref: n.setContentRef,
423
+ id: n.contentId,
424
+ role: "menu",
425
+ tabIndex: -1,
426
+ "aria-labelledby": n.triggerId,
427
+ "aria-activedescendant": n.activeIndex >= 0 ? n.getItemId(n.activeIndex) : void 0,
428
+ onKeyDown: n.onKeyDown,
429
+ style: {
430
+ ...n.surfaceStyle,
431
+ ...n.contentProps?.style
432
+ },
433
+ className: r,
434
+ "data-color": n.color,
435
+ 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, {
436
+ item: e.item,
437
+ itemIndex: e.itemIndex
438
+ }) }, e.item.id)) : /* @__PURE__ */ g(se, {})
439
+ });
440
+ return n.portal ? /* @__PURE__ */ g(H, { children: i }) : i;
441
+ };
442
+ ke.__velliraDropdownPart = "content", ke.displayName = "Dropdown.Content";
443
+ //#endregion
444
+ //#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
445
+ 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) => {
446
+ let [t, n] = f(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
447
+ return c(() => {
39
448
  if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
40
449
  let t = window.matchMedia(`(max-width: ${e}px)`), r = () => n(t.matches);
41
450
  return r(), t.addEventListener("change", r), () => {
42
451
  t.removeEventListener("change", r);
43
452
  };
44
453
  }, [e]), t;
45
- }, re = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", matchTriggerWidth: i = !1, avoidCollisions: a = !0, mobileSheetBreakpoint: o, middleware: c = [] } = {}) => {
46
- let u = ne(o), { refs: d, floatingStyles: f, update: p, context: m, middlewareData: h, placement: g } = w({
454
+ }, 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 = [] } = {}) => {
455
+ let d = Ie(s), { refs: f, floatingStyles: p, update: m, context: h, middlewareData: g, placement: _ } = A({
47
456
  open: e,
48
457
  onOpenChange: t,
49
458
  placement: n,
50
459
  strategy: r,
51
460
  transform: !1,
52
- middleware: l(() => [
53
- x(2),
54
- ...a ? [b()] : [],
55
- C({ apply({ rects: e, elements: t }) {
56
- !i || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
461
+ middleware: u(() => [
462
+ D(i),
463
+ ...o ? [E()] : [],
464
+ k({ apply({ rects: e, elements: t }) {
465
+ !a || d || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
57
466
  } }),
58
- ...a ? [S({ padding: 8 })] : [],
59
- ...c
467
+ ...o ? [O({ padding: 8 })] : [],
468
+ ...l
60
469
  ], [
470
+ o,
471
+ l,
472
+ d,
61
473
  a,
62
- c,
63
- u,
64
474
  i
65
475
  ]),
66
- whileElementsMounted: y
476
+ whileElementsMounted: T
67
477
  });
68
- return s(() => {
69
- u && d.floating.current?.style.removeProperty("width");
70
- }, [u, d.floating]), {
71
- context: m,
72
- placement: g,
73
- middlewareData: h,
74
- floatingStyles: u ? {} : f,
75
- isMobileSheet: u,
76
- setRef: d.setReference,
77
- setFloatingRef: d.setFloating,
78
- updatePosition: p
478
+ return c(() => {
479
+ d && f.floating.current?.style.removeProperty("width");
480
+ }, [d, f.floating]), {
481
+ context: h,
482
+ placement: _,
483
+ middlewareData: g,
484
+ floatingStyles: d ? {} : p,
485
+ isMobileSheet: d,
486
+ setRef: f.setReference,
487
+ setFloatingRef: f.setFloating,
488
+ updatePosition: m
79
489
  };
80
- }, ie = (e, t, n = !0) => {
81
- let r = u(e);
490
+ }, Re = (e, t, n = !0) => {
491
+ let r = d(e);
82
492
  r.current = e;
83
- let i = u(t);
84
- i.current = t, s(() => {
493
+ let i = d(t);
494
+ i.current = t, c(() => {
85
495
  if (!n) return;
86
496
  let e = (e) => {
87
497
  let t = e.target;
@@ -89,316 +499,399 @@ var ne = (e) => {
89
499
  };
90
500
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
91
501
  }, [n]);
92
- }, ae = { group: "_group_aviwv_1" }, oe = ({ label: e }) => /* @__PURE__ */ h("li", {
93
- role: "presentation",
94
- className: ae.group,
95
- children: e
96
- }), V = {
97
- item: "_item_re11y_1",
98
- disabled: "_disabled_re11y_21",
99
- active: "_active_re11y_34",
100
- danger: "_danger_re11y_40",
101
- itemIcon: "_itemIcon_re11y_62",
102
- itemShortcut: "_itemShortcut_re11y_63",
103
- itemText: "_itemText_re11y_82",
104
- "itemText--truncate": "_itemText--truncate_re11y_88",
105
- "itemText--wrap": "_itemText--wrap_re11y_93",
106
- "itemText--nowrap": "_itemText--nowrap_re11y_97"
107
- }, se = ({ id: e, children: t, label: n, icon: r, danger: i, disabled: a, active: o, onClick: s, onMouseEnter: c, shortcut: l, textWrap: u = "truncate", className: d }) => {
108
- let f = t || n;
109
- return /* @__PURE__ */ g("li", {
110
- id: e,
111
- role: "menuitem",
112
- tabIndex: -1,
113
- "aria-disabled": a || void 0,
114
- "data-active": o || void 0,
115
- "data-danger": i || void 0,
116
- onClick: a ? void 0 : s,
117
- onMouseEnter: a ? void 0 : c,
118
- className: z(V.item, {
119
- [V.active]: o,
120
- [V.disabled]: a,
121
- [V.danger]: i
122
- }, d),
123
- children: [
124
- r && /* @__PURE__ */ h("span", {
125
- "aria-hidden": "true",
126
- className: V.itemIcon,
127
- children: r
128
- }),
129
- f && /* @__PURE__ */ h("span", {
130
- className: z(V.itemText, V[`itemText--${u}`]),
131
- children: f
132
- }),
133
- l && /* @__PURE__ */ h("span", {
134
- className: V.itemShortcut,
135
- children: l
502
+ };
503
+ //#endregion
504
+ //#region src/components/Dropdown/internal/composeEventHandlers.ts
505
+ function ze(e, t) {
506
+ return (n) => {
507
+ e?.(n), n.defaultPrevented || t(n);
508
+ };
509
+ }
510
+ function Be(...e) {
511
+ return (t) => {
512
+ e.forEach((e) => {
513
+ if (e) {
514
+ if (typeof e == "function") {
515
+ e(t);
516
+ return;
517
+ }
518
+ e.current = t;
519
+ }
520
+ });
521
+ };
522
+ }
523
+ function G(e) {
524
+ return typeof e == "number" ? `${e}px` : e;
525
+ }
526
+ 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 }) => {
527
+ let O = l(), k = `${O}-trigger`, A = `${O}-menu`, j = d(null), M = d(null), [N, P] = f(), [I, L] = f({}), R = u(() => te(e), [e]), ee = u(() => R.items.map((e) => ({
528
+ disabled: e.disabled,
529
+ label: e.label
530
+ })), [R.items]);
531
+ c(() => {
532
+ L((e) => {
533
+ let t = { ...e };
534
+ return R.items.forEach((e) => {
535
+ e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
536
+ }), t;
537
+ });
538
+ }, [R.items]);
539
+ let { floatingStyles: z, setRef: B, setFloatingRef: ne } = Le({
540
+ open: t,
541
+ onOpenChange: r,
542
+ placement: s,
543
+ matchTriggerWidth: m,
544
+ avoidCollisions: b,
545
+ offset: p,
546
+ mobileSheetBreakpoint: 640
547
+ }), { activeIndex: re, setActiveIndex: ie, isOpen: ae, closeDropdown: H, toggleDropdown: U, onKeyDown: oe } = F({
548
+ items: ee,
549
+ open: t,
550
+ defaultOpen: n,
551
+ disabled: w,
552
+ onOpenChange: r,
553
+ getItemValue: (e, t) => R.items[t]?.id ?? "",
554
+ getItemText: (e) => e.label,
555
+ loop: C
556
+ });
557
+ c(() => {
558
+ if (!x || !ae) return;
559
+ let e = document.body.style.overflow;
560
+ return document.body.style.overflow = "hidden", () => {
561
+ document.body.style.overflow = e;
562
+ };
563
+ }, [ae, x]);
564
+ let se = o(() => {
565
+ H(), j.current?.focus();
566
+ }, [H]), ce = o((e, t) => {
567
+ if (e.disabled || T) return;
568
+ if (e.type === "subTrigger") {
569
+ P(e.id);
570
+ return;
571
+ }
572
+ e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (L((t) => ({
573
+ ...t,
574
+ [e.groupId]: e.props.value
575
+ })), e.groupProps?.onValueChange?.(e.props.value));
576
+ let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && S);
577
+ !t.defaultPrevented && n && se();
578
+ }, [
579
+ se,
580
+ S,
581
+ T
582
+ ]), le = o((e) => {
583
+ let t = R.items[re];
584
+ if (e.key === "ArrowRight" && t?.type === "subTrigger") {
585
+ e.preventDefault(), P(t.id);
586
+ return;
587
+ }
588
+ if (e.key === "ArrowLeft" && N) {
589
+ e.preventDefault(), P(void 0);
590
+ return;
591
+ }
592
+ if ((e.key === "Enter" || e.key === " ") && t) {
593
+ e.preventDefault();
594
+ let n = He(e);
595
+ ce(t, n);
596
+ return;
597
+ }
598
+ oe(e), e.key === "Escape" && j.current?.focus();
599
+ }, [
600
+ re,
601
+ oe,
602
+ N,
603
+ R.items,
604
+ ce
605
+ ]), ue = o((e) => {
606
+ e.preventDefault(), U();
607
+ }, [U]), de = o((e) => {
608
+ j.current = e, B(e);
609
+ }, [B]), fe = o((e) => {
610
+ M.current = e, ne(e), e?.focus();
611
+ }, [ne]);
612
+ Re([j, M], H, ae);
613
+ let he = {
614
+ ...z,
615
+ minWidth: G(h),
616
+ maxWidth: G(v)
617
+ };
618
+ return /* @__PURE__ */ g(me, {
619
+ value: {
620
+ disabled: w,
621
+ isOpen: ae,
622
+ contentId: A,
623
+ triggerId: k,
624
+ setTriggerRef: de,
625
+ onClick: ue,
626
+ onKeyDown: le
627
+ },
628
+ children: /* @__PURE__ */ g(pe, {
629
+ value: {
630
+ activeIndex: re,
631
+ closeOnSelect: S,
632
+ color: a,
633
+ contentId: A,
634
+ contentProps: R.content?.props,
635
+ disabled: w,
636
+ entries: R.entries,
637
+ getItemId: (e) => `${A}-item-${e}`,
638
+ isOpen: ae,
639
+ items: R.items,
640
+ loading: T,
641
+ loadingText: E,
642
+ maxWidth: v,
643
+ minWidth: h,
644
+ openSubId: N,
645
+ onKeyDown: le,
646
+ portal: y,
647
+ radioValues: I,
648
+ selectItem: ce,
649
+ setActiveIndex: ie,
650
+ setContentRef: fe,
651
+ setOpenSubId: P,
652
+ setRadioValue: (e, t) => {
653
+ L((n) => ({
654
+ ...n,
655
+ [e]: t
656
+ }));
657
+ },
658
+ size: i,
659
+ surfaceStyle: he,
660
+ triggerId: k
661
+ },
662
+ children: /* @__PURE__ */ _("div", {
663
+ className: V(K.wrapper, D),
664
+ "data-disabled": w || void 0,
665
+ children: [R.trigger ?? null, R.content ?? /* @__PURE__ */ g(ke, {})]
136
666
  })
137
- ]
667
+ })
138
668
  });
139
- }, ce = { separator: "_separator_1v11r_1" }, le = () => /* @__PURE__ */ h("li", {
140
- role: "separator",
141
- className: ce.separator,
142
- "aria-hidden": "true"
143
- }), ue = {
144
- button: "_button_18ucr_1",
145
- disabled: "_disabled_18ucr_20",
146
- iconLeft: "_iconLeft_18ucr_32",
147
- arrow: "_arrow_18ucr_44",
148
- iconOnly: "_iconOnly_18ucr_47",
149
- sm: "_sm_18ucr_60",
150
- md: "_md_18ucr_72",
151
- lg: "_lg_18ucr_84",
152
- open: "_open_18ucr_123"
153
- }, de = r(({ children: e, isOpen: t, icon: n, arrowIcon: r, showArrow: i = !0, rotateAngle: a = 90, size: o = "md", label: s, ariaLabel: c, className: l, ...u }, d) => {
154
- let f = !!n, p = !!e, m = f && !p, _ = i && p, v = r ?? /* @__PURE__ */ h(F, {}), y = c ?? (m ? typeof s == "string" ? s : "Open menu" : void 0);
155
- return /* @__PURE__ */ g("button", {
669
+ };
670
+ Ve.displayName = "DropdownRoot";
671
+ function He(e) {
672
+ let t = !1;
673
+ return {
674
+ originalEvent: e,
675
+ preventDefault: () => {
676
+ t = !0;
677
+ },
678
+ get defaultPrevented() {
679
+ return t;
680
+ }
681
+ };
682
+ }
683
+ //#endregion
684
+ //#region src/components/Dropdown/SubContent/DropdownSubContent.tsx
685
+ var Ue = B("subContent", "Dropdown.SubContent"), We = B("subTrigger", "Dropdown.SubTrigger"), Ge = B("sub", "Dropdown.Sub"), Ke = {
686
+ button: "_button_xvcvl_1",
687
+ disabled: "_disabled_xvcvl_49",
688
+ arrow: "_arrow_xvcvl_56",
689
+ iconLeft: "_iconLeft_xvcvl_67",
690
+ iconOnly: "_iconOnly_xvcvl_82",
691
+ primary: "_primary_xvcvl_95",
692
+ neutral: "_neutral_xvcvl_135",
693
+ success: "_success_xvcvl_175",
694
+ warning: "_warning_xvcvl_215",
695
+ danger: "_danger_xvcvl_255",
696
+ sm: "_sm_xvcvl_295",
697
+ md: "_md_xvcvl_307",
698
+ lg: "_lg_xvcvl_319",
699
+ label: "_label_xvcvl_331",
700
+ open: "_open_xvcvl_359"
701
+ }, qe = (e) => /* @__PURE__ */ g(Je, { ...e });
702
+ qe.__velliraDropdownPart = "trigger", qe.displayName = "Dropdown.Trigger";
703
+ var Je = ({ children: e, asChild: t = !1, disabled: r, className: i }) => {
704
+ let o = he(), s = ge(), c = t && a(e) ? e : void 0, l = o.disabled || r, u = {
705
+ id: s.triggerId,
706
+ ref: c ? Be(c.props.ref, s.setTriggerRef) : s.setTriggerRef,
707
+ "aria-controls": s.isOpen ? s.contentId : void 0,
708
+ "aria-disabled": l || void 0,
709
+ "aria-expanded": s.isOpen,
710
+ "aria-haspopup": "menu",
711
+ className: V(!c && Ke.button, !c && Ke[o.size], !c && Ke[o.color], i),
712
+ "data-state": s.isOpen ? "open" : "closed",
713
+ disabled: l || void 0,
714
+ onClick: ze(c?.props.onClick, s.onClick),
715
+ onKeyDown: ze(c?.props.onKeyDown, s.onKeyDown)
716
+ };
717
+ return c ? n(c, {
156
718
  ...u,
157
- ref: d,
719
+ className: V(c.props.className, i)
720
+ }) : /* @__PURE__ */ _("button", {
158
721
  type: "button",
159
- className: z(ue.button, ue[o], {
160
- [ue.disabled]: u.disabled,
161
- [ue.iconOnly]: m
162
- }, l),
163
- "aria-label": y,
164
- "aria-expanded": t,
165
- "aria-haspopup": "menu",
166
- style: { "--dropdown-rotate-angle": `${a}deg` },
167
- children: [
168
- f && /* @__PURE__ */ h("span", {
169
- "aria-hidden": "true",
170
- className: ue.iconLeft,
171
- children: n
172
- }),
173
- e,
174
- _ && /* @__PURE__ */ h("span", {
175
- "aria-hidden": "true",
176
- className: z(ue.arrow, { [ue.open]: t }),
177
- children: v
178
- })
179
- ]
722
+ ...u,
723
+ children: [/* @__PURE__ */ g("span", {
724
+ className: Ke.label,
725
+ children: e
726
+ }), /* @__PURE__ */ g("span", {
727
+ className: V(Ke.arrow, { [Ke.open]: s.isOpen }),
728
+ "aria-hidden": "true",
729
+ children: /* @__PURE__ */ g(y, {})
730
+ })]
180
731
  });
732
+ };
733
+ Je.displayName = "DropdownTriggerSurface";
734
+ //#endregion
735
+ //#region src/components/Dropdown/Dropdown.tsx
736
+ var Ye = Object.assign(Ve, {
737
+ Trigger: qe,
738
+ Content: ke,
739
+ Item: _e,
740
+ CheckboxItem: ae,
741
+ RadioGroup: Pe,
742
+ RadioItem: Fe,
743
+ Group: ce,
744
+ Label: Se,
745
+ Separator: De,
746
+ Sub: Ge,
747
+ SubTrigger: We,
748
+ SubContent: Ue,
749
+ ItemIcon: Me,
750
+ ItemDescription: je,
751
+ ItemBadge: Ae,
752
+ ItemShortcut: Ne,
753
+ Empty: oe,
754
+ Loading: we
181
755
  });
182
- de.displayName = "DropdownTrigger";
756
+ Ye.displayName = "Dropdown";
183
757
  //#endregion
184
- //#region src/components/Dropdown/types.ts
185
- var fe = (e) => e.type === void 0 || e.type === "item", pe = (e) => e.type === "group", me = (e) => e.type === "separator", he = { wrapper: "_wrapper_14ue8_1" }, ge = ({ label: e, ariaLabel: t, icon: n, trigger: r, items: i = [], onSelect: o, open: s, defaultOpen: d = !1, onOpenChange: f, size: p = "md", className: m, triggerClassName: _, contentClassName: v, itemClassName: y, disabled: b, rotateAngle: x = 90, placement: S, matchTriggerWidth: C, textWrap: w, showArrow: T = !0, arrowIcon: E }) => {
186
- let D = u(null), O = u(null), A = c(), j = `${A}-trigger`, { floatingStyles: M, setRef: N, setFloatingRef: P } = re({
187
- placement: S,
188
- matchTriggerWidth: C,
189
- mobileSheetBreakpoint: 640
190
- }), F = l(() => i.flatMap((e, t) => fe(e) ? [{
191
- item: e,
192
- itemIndex: t
193
- }] : []), [i]), I = l(() => F.map(({ item: e }) => e), [F]), L = l(() => new Map(F.map(({ itemIndex: e }, t) => [e, t])), [F]), { activeIndex: R, setActiveIndex: ee, isOpen: B, closeDropdown: ne, toggleDropdown: ae, selectItem: V, onKeyDown: ce } = k({
194
- items: I,
195
- open: s,
196
- defaultOpen: d,
197
- disabled: b,
198
- onOpenChange: f,
199
- onSelect: a((e) => {
200
- o?.(e), D.current?.focus();
201
- }, [o]),
202
- getItemValue: (e) => e.value,
203
- getItemText: (e) => typeof e.label == "string" ? e.label : e.value
204
- }), ue = B && R >= 0 ? `${A}-item-${R}` : void 0;
205
- ie([D, O], ne, B);
206
- let ge = a((e) => {
207
- ce(e), B && e.key === "Escape" && D.current?.focus();
208
- }, [B, ce]), _e = a((e) => {
209
- D.current = e, N(e);
210
- }, [N]), ve = a((e) => {
211
- O.current = e, P(e), e?.focus();
212
- }, [P]);
213
- return /* @__PURE__ */ g("div", {
214
- className: z(he.wrapper, m),
215
- children: [/* @__PURE__ */ h(de, {
216
- ref: _e,
217
- id: j,
218
- isOpen: B,
219
- disabled: b,
220
- size: p,
221
- icon: n,
222
- label: e,
223
- ariaLabel: t,
224
- showArrow: T,
225
- arrowIcon: E,
226
- rotateAngle: x,
227
- className: _,
228
- onClick: ae,
229
- onKeyDown: ge,
230
- "aria-expanded": B,
231
- "aria-haspopup": "menu",
232
- ...B && { "aria-controls": A },
233
- children: r
234
- }), B && /* @__PURE__ */ h(te, {
235
- ref: ve,
236
- floatingStyles: M,
237
- menuId: A,
238
- labelledById: r ? j : void 0,
239
- label: t ?? (!r && typeof e == "string" ? e : void 0),
240
- activeDescendantId: ue,
241
- onKeyDown: ge,
242
- className: v,
243
- children: i.map((e, t) => {
244
- if (pe(e)) return /* @__PURE__ */ h(oe, { label: e.label }, `group-${e.label}`);
245
- if (me(e)) return /* @__PURE__ */ h(le, {}, `separator-${t}`);
246
- if (fe(e)) {
247
- let n = L.get(t) ?? -1;
248
- return /* @__PURE__ */ h(se, {
249
- id: `${A}-item-${n}`,
250
- ...e,
251
- active: R === n,
252
- textWrap: e.textWrap || w,
253
- className: y,
254
- onClick: () => {
255
- V(e), D.current?.focus();
256
- },
257
- onMouseEnter: () => {
258
- n < 0 || e.disabled || ee(n);
259
- },
260
- children: e.label
261
- }, `${e.value}-${t}`);
262
- }
263
- })
264
- })]
265
- });
266
- }, _e = n(void 0), ve = () => {
267
- let e = o(_e);
758
+ //#region src/components/Modal/ModalContext.tsx
759
+ var Xe = r(void 0), Ze = () => {
760
+ let e = s(Xe);
268
761
  if (e === void 0) throw Error("Modal compound components must be used inside Modal");
269
762
  return e;
270
763
  };
271
- _e.displayName = "ModalContext";
272
- var ye = { modalBody: "_modalBody_iv33a_1" }, be = ({ children: e }) => {
273
- let { descriptionId: t } = ve();
274
- return /* @__PURE__ */ h("div", {
764
+ Xe.displayName = "ModalContext";
765
+ var Qe = { modalBody: "_modalBody_iv33a_1" }, $e = ({ children: e }) => {
766
+ let { descriptionId: t } = Ze();
767
+ return /* @__PURE__ */ g("div", {
275
768
  id: t,
276
- className: ye.modalBody,
769
+ className: Qe.modalBody,
277
770
  children: e
278
771
  });
279
772
  };
280
- be.displayName = "ModalBody";
281
- var xe = { content: "_content_k44g7_1" }, H = ({ children: e }) => /* @__PURE__ */ h("div", {
282
- className: xe.content,
773
+ $e.displayName = "ModalBody";
774
+ var et = { content: "_content_k44g7_1" }, tt = ({ children: e }) => /* @__PURE__ */ g("div", {
775
+ className: et.content,
283
776
  children: e
284
777
  });
285
- H.displayName = "ModalContent";
286
- var U = { modalFooter: "_modalFooter_ezys6_1" }, W = ({ children: e }) => /* @__PURE__ */ h("div", {
287
- className: U.modalFooter,
778
+ tt.displayName = "ModalContent";
779
+ var nt = { modalFooter: "_modalFooter_ezys6_1" }, rt = ({ children: e }) => /* @__PURE__ */ g("div", {
780
+ className: nt.modalFooter,
288
781
  children: e
289
782
  });
290
- W.displayName = "ModalFooter";
291
- var Se = {
783
+ rt.displayName = "ModalFooter";
784
+ var it = {
292
785
  modalHeader: "_modalHeader_p8xf1_1",
293
786
  modalHeaderTitle: "_modalHeaderTitle_p8xf1_7",
294
787
  modalHeaderCloseButton: "_modalHeaderCloseButton_p8xf1_14"
295
- }, Ce = ({ children: e }) => {
296
- let { onClose: t, titleId: n } = ve();
297
- return /* @__PURE__ */ g("div", {
298
- className: Se.modalHeader,
299
- children: [/* @__PURE__ */ h("h2", {
788
+ }, at = ({ children: e }) => {
789
+ let { onClose: t, titleId: n } = Ze();
790
+ return /* @__PURE__ */ _("div", {
791
+ className: it.modalHeader,
792
+ children: [/* @__PURE__ */ g("h2", {
300
793
  id: n,
301
- className: Se.modalHeaderTitle,
794
+ className: it.modalHeaderTitle,
302
795
  children: e
303
- }), t && /* @__PURE__ */ h("button", {
796
+ }), t && /* @__PURE__ */ g("button", {
304
797
  type: "button",
305
- className: Se.modalHeaderCloseButton,
798
+ className: it.modalHeaderCloseButton,
306
799
  onClick: t,
307
800
  "aria-label": "Close modal",
308
- children: /* @__PURE__ */ h(I, { size: 16 })
801
+ children: /* @__PURE__ */ g(x, { size: 16 })
309
802
  })]
310
803
  });
311
804
  };
312
- Ce.displayName = "ModalHeader";
805
+ at.displayName = "ModalHeader";
313
806
  //#endregion
314
807
  //#region src/hooks/useModalKeyboard.ts
315
- var we = ({ isOpen: e, onClose: t }) => {
316
- let n = a((n) => {
808
+ var ot = ({ isOpen: e, onClose: t }) => {
809
+ let n = o((n) => {
317
810
  e && n.key === "Escape" && (n.preventDefault(), t?.());
318
811
  }, [e, t]);
319
- s(() => (document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n)), [n]);
320
- }, Te = {
812
+ c(() => (document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n)), [n]);
813
+ }, st = {
321
814
  overlay: "_overlay_dcudn_1",
322
815
  "overlay--open": "_overlay--open_dcudn_14",
323
816
  modal: "_modal_dcudn_20",
324
817
  "overlay--animated": "_overlay--animated_dcudn_28"
325
- }, Ee = 0, De = "", Oe = ({ children: e, onClose: t, isOpen: n, className: r, closeOnBackdrop: i, closeOnClick: o, closeOnEsc: c = !0, zIndex: l = 1e3, animated: d = !0 }) => {
326
- let f = i ?? o ?? !0, p = u(null), { titleId: m, descriptionId: g } = ve(), _ = a((e) => {
818
+ }, ct = 0, lt = "", ut = ({ children: e, onClose: t, isOpen: n, className: r, closeOnBackdrop: i, closeOnClick: a, closeOnEsc: s = !0, zIndex: l = 1e3, animated: u = !0 }) => {
819
+ let f = i ?? a ?? !0, p = d(null), { titleId: m, descriptionId: h } = Ze(), _ = o((e) => {
327
820
  f && e.target === e.currentTarget && t?.();
328
821
  }, [f, t]);
329
- return we({
822
+ return ot({
330
823
  isOpen: n,
331
- onClose: c ? t : void 0
332
- }), s(() => {
333
- if (n) return Ee === 0 && (De = document.body.style.overflow), Ee += 1, document.body.style.overflow = "hidden", () => {
334
- Ee = Math.max(0, Ee - 1), Ee === 0 && (document.body.style.overflow = De);
824
+ onClose: s ? t : void 0
825
+ }), c(() => {
826
+ if (n) return ct === 0 && (lt = document.body.style.overflow), ct += 1, document.body.style.overflow = "hidden", () => {
827
+ ct = Math.max(0, ct - 1), ct === 0 && (document.body.style.overflow = lt);
335
828
  };
336
- }, [n]), !n && !d ? null : /* @__PURE__ */ h(ee, { children: /* @__PURE__ */ h("div", {
337
- className: z(Te.overlay, n && Te["overlay--open"], d && Te["overlay--animated"], r),
829
+ }, [n]), !n && !u ? null : /* @__PURE__ */ g(H, { children: /* @__PURE__ */ g("div", {
830
+ className: V(st.overlay, n && st["overlay--open"], u && st["overlay--animated"], r),
338
831
  onClick: _,
339
832
  tabIndex: -1,
340
833
  role: "presentation",
341
834
  "aria-hidden": !n,
342
835
  style: { zIndex: l },
343
- children: /* @__PURE__ */ h(R, {
836
+ children: /* @__PURE__ */ g(z, {
344
837
  active: n,
345
838
  focusTrapOptions: {
346
839
  fallbackFocus: () => p.current,
347
840
  returnFocusOnDeactivate: !0,
348
841
  allowOutsideClick: !0
349
842
  },
350
- children: /* @__PURE__ */ h("div", {
843
+ children: /* @__PURE__ */ g("div", {
351
844
  ref: p,
352
845
  tabIndex: -1,
353
- className: Te.modal,
846
+ className: st.modal,
354
847
  role: "dialog",
355
848
  "aria-modal": "true",
356
849
  "aria-labelledby": m,
357
- "aria-describedby": g,
850
+ "aria-describedby": h,
358
851
  children: e
359
852
  })
360
853
  })
361
854
  }) });
362
855
  };
363
- Oe.displayName = "ModalOverlay";
856
+ ut.displayName = "ModalOverlay";
364
857
  //#endregion
365
858
  //#region src/components/Modal/Modal.tsx
366
- var ke = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: a = !0 }) => {
367
- let o = A({
859
+ var dt = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: a = !0 }) => {
860
+ let o = I({
368
861
  isOpen: e,
369
862
  onClose: n,
370
863
  closeOnBackdrop: r,
371
864
  closeOnClick: i,
372
865
  closeOnEsc: a
373
866
  });
374
- return o.shouldRender ? /* @__PURE__ */ h(_e.Provider, {
867
+ return o.shouldRender ? /* @__PURE__ */ g(Xe.Provider, {
375
868
  value: {
376
869
  onClose: o.onClose,
377
870
  titleId: o.titleId,
378
871
  descriptionId: o.descriptionId
379
872
  },
380
- children: /* @__PURE__ */ h(Oe, {
873
+ children: /* @__PURE__ */ g(ut, {
381
874
  isOpen: o.isOpen,
382
875
  onClose: o.onClose,
383
876
  closeOnBackdrop: o.closeOnBackdrop,
384
877
  closeOnEsc: o.closeOnEsc,
385
- children: /* @__PURE__ */ h(H, { children: t })
878
+ children: /* @__PURE__ */ g(tt, { children: t })
386
879
  })
387
880
  }) : null;
388
881
  };
389
- ke.displayName = "Modal";
882
+ dt.displayName = "Modal";
390
883
  //#endregion
391
884
  //#region src/components/Modal/index.ts
392
- var Ae = Object.assign(ke, {
393
- Header: Ce,
394
- Body: be,
395
- Content: H,
396
- Footer: W
397
- }), je = n(null), Me = je.Provider;
398
- function Ne() {
399
- return o(je);
885
+ var ft = Object.assign(dt, {
886
+ Header: at,
887
+ Body: $e,
888
+ Content: tt,
889
+ Footer: rt
890
+ }), pt = r(null), mt = pt.Provider;
891
+ function ht() {
892
+ return s(pt);
400
893
  }
401
- var G = {
894
+ var gt = {
402
895
  root: "_root_1n02e_1",
403
896
  label: "_label_1n02e_9",
404
897
  required: "_required_1n02e_21",
@@ -409,13 +902,13 @@ var G = {
409
902
  error: "_error_1n02e_51",
410
903
  disabled: "_disabled_1n02e_59",
411
904
  invalid: "_invalid_1n02e_75"
412
- }, Pe = r(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", name: s, label: l, description: u, error: d, orientation: f = "vertical", children: p, className: m, id: _, ...v }, y) => {
413
- let b = c(), x = _ ?? b, S = l ? `${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, k] = O({
905
+ }, _t = i(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", name: s, label: c, description: u, error: d, orientation: f = "vertical", children: p, className: m, id: h, ...v }, y) => {
906
+ 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({
414
907
  value: e,
415
908
  defaultValue: t,
416
909
  onChange: n
417
- }), A = !!d;
418
- return /* @__PURE__ */ g("div", {
910
+ }), k = !!d;
911
+ return /* @__PURE__ */ _("div", {
419
912
  ...v,
420
913
  ref: y,
421
914
  id: x,
@@ -424,165 +917,106 @@ var G = {
424
917
  "aria-describedby": T,
425
918
  "aria-disabled": r || void 0,
426
919
  "aria-required": i || void 0,
427
- "aria-invalid": A || void 0,
428
- className: z(G.root, A && G.invalid, r && G.disabled, m),
920
+ "aria-invalid": k || void 0,
921
+ className: V(gt.root, k && gt.invalid, r && gt.disabled, m),
429
922
  children: [
430
- l && /* @__PURE__ */ g("div", {
923
+ c && /* @__PURE__ */ _("div", {
431
924
  id: S,
432
- className: G.label,
433
- children: [l, i && /* @__PURE__ */ h("span", {
434
- className: G.required,
925
+ className: gt.label,
926
+ children: [c, i && /* @__PURE__ */ g("span", {
927
+ className: gt.required,
435
928
  "aria-hidden": "true",
436
929
  children: "*"
437
930
  })]
438
931
  }),
439
- u && /* @__PURE__ */ h("div", {
932
+ u && /* @__PURE__ */ g("div", {
440
933
  id: C,
441
- className: G.description,
934
+ className: gt.description,
442
935
  children: u
443
936
  }),
444
- /* @__PURE__ */ h(Me, {
937
+ /* @__PURE__ */ g(mt, {
445
938
  value: {
446
939
  name: E,
447
940
  value: D,
448
941
  disabled: r,
449
942
  required: i,
450
- invalid: A,
943
+ invalid: k,
451
944
  size: a,
452
945
  color: o,
453
946
  describedBy: T,
454
- onValueChange: k
947
+ onValueChange: O
455
948
  },
456
- children: /* @__PURE__ */ h("div", {
457
- className: z(G.items, G[f]),
949
+ children: /* @__PURE__ */ g("div", {
950
+ className: V(gt.items, gt[f]),
458
951
  children: p
459
952
  })
460
953
  }),
461
- d && /* @__PURE__ */ h("div", {
954
+ d && /* @__PURE__ */ g("div", {
462
955
  id: w,
463
- className: G.error,
956
+ className: gt.error,
464
957
  children: d
465
958
  })
466
959
  ]
467
960
  });
468
961
  });
469
- Pe.displayName = "RadioGroup";
962
+ _t.displayName = "RadioGroup";
470
963
  //#endregion
471
- //#region src/patterns/FormField/FormFieldContext.ts
472
- var Fe = n(null), Ie = () => o(Fe), K = {
473
- wrapper: "_wrapper_143kr_1",
474
- sm: "_sm_143kr_41",
475
- md: "_md_143kr_78",
476
- lg: "_lg_143kr_115",
477
- horizontal: "_horizontal_143kr_152",
478
- start: "_start_143kr_153",
479
- description: "_description_143kr_160",
480
- control: "_control_143kr_161",
481
- errorText: "_errorText_143kr_162",
482
- label: "_label_143kr_169",
483
- labelText: "_labelText_143kr_186",
484
- required: "_required_143kr_190",
485
- optional: "_optional_143kr_194",
486
- labelInfo: "_labelInfo_143kr_201",
487
- disabled: "_disabled_143kr_243"
488
- }, Le = (...e) => e.filter(Boolean).join(" ") || void 0, Re = ({ id: e, label: n, description: r, error: a, required: o = !1, disabled: s = !1, invalid: l = !1, orientation: u = "vertical", labelPosition: d = "top", size: f = "md", labelInfo: p, optionalText: m, children: _, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
489
- let T = c(), E = e ?? T, D = n ? `${E}-label` : void 0, O = r && E ? `${E}-description` : void 0, k = a && E ? `${E}-error` : void 0, A = l || !!a, j = Le(D), M = Le(O, k), N = {
490
- controlId: E,
491
- labelId: D,
492
- descriptionId: O,
493
- errorId: k,
494
- required: o,
495
- disabled: s,
496
- invalid: A,
497
- size: f,
498
- ariaLabelledBy: j,
499
- ariaDescribedBy: M
500
- }, P = i(_) ? _ : void 0, F = v && P ? t(P, {
501
- id: P.props.id ?? E,
502
- required: P.props.required ?? o,
503
- disabled: P.props.disabled ?? s,
504
- "aria-invalid": P.props["aria-invalid"] ?? (A || void 0),
505
- "aria-labelledby": Le(P.props["aria-labelledby"], j),
506
- "aria-describedby": Le(P.props["aria-describedby"], M)
507
- }) : _;
508
- return /* @__PURE__ */ g("div", {
509
- ...w,
510
- "aria-disabled": s || void 0,
511
- className: z(K.wrapper, K[u], K[d], K[f], s && K.disabled, y),
512
- "data-disabled": s || void 0,
513
- "data-invalid": A || void 0,
514
- "data-orientation": u,
515
- "data-size": f,
516
- children: [
517
- n && /* @__PURE__ */ g("label", {
518
- id: D,
519
- htmlFor: E,
520
- className: z(K.label, x),
521
- children: [
522
- /* @__PURE__ */ h("span", {
523
- className: K.labelText,
524
- children: n
525
- }),
526
- o && /* @__PURE__ */ h("span", {
527
- className: K.required,
528
- "aria-hidden": "true",
529
- children: "*"
530
- }),
531
- !o && m && /* @__PURE__ */ h("span", {
532
- className: K.optional,
533
- children: m
534
- }),
535
- p && /* @__PURE__ */ h("span", {
536
- className: K.labelInfo,
537
- children: p
538
- })
539
- ]
540
- }),
541
- r && /* @__PURE__ */ h("div", {
542
- id: O,
543
- className: z(K.description, S),
544
- children: r
545
- }),
546
- /* @__PURE__ */ h(Fe.Provider, {
547
- value: N,
548
- children: /* @__PURE__ */ h("div", {
549
- className: z(K.control, b),
550
- children: F
551
- })
552
- }),
553
- a && /* @__PURE__ */ h("div", {
554
- id: k,
555
- className: z(K.errorText, C),
556
- role: "alert",
557
- children: a
558
- })
559
- ]
560
- });
561
- }, q = {
562
- option: "_option_8aali_1",
563
- selected: "_selected_8aali_18",
564
- disabled: "_disabled_8aali_18",
565
- active: "_active_8aali_37",
566
- label: "_label_8aali_51",
567
- content: "_content_8aali_60",
568
- custom: "_custom_8aali_61",
569
- description: "_description_8aali_66",
570
- icon: "_icon_8aali_77",
571
- badge: "_badge_8aali_87",
572
- shortcut: "_shortcut_8aali_88",
573
- success: "_success_8aali_108",
574
- warning: "_warning_8aali_112",
575
- danger: "_danger_8aali_116",
576
- check: "_check_8aali_120",
577
- checkPop: "_checkPop_8aali_1"
578
- }, ze = ({ option: e, isSelected: t, isActive: n, optionId: r, renderOption: i, onSelect: a, onMouseEnter: o }) => {
964
+ //#region src/components/Select/internal/SelectContext.tsx
965
+ var vt = r(null), yt = vt.Provider;
966
+ function bt() {
967
+ let e = s(vt);
968
+ if (!e) throw Error("Select compound components must be used inside <Select>");
969
+ return e;
970
+ }
971
+ vt.displayName = "SelectContext";
972
+ //#endregion
973
+ //#region src/components/Select/internal/useSelectVirtualization.ts
974
+ function xt({ loading: e, options: t, scrollTop: n, virtual: r }) {
975
+ return u(() => {
976
+ 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;
977
+ return {
978
+ bottomSpacerHeight: o ? Math.max(0, (t.length - s - l.length) * a) : 0,
979
+ isVirtual: o,
980
+ itemHeight: a,
981
+ startIndex: s,
982
+ topSpacerHeight: u,
983
+ viewportHeight: 300,
984
+ visibleOptions: l
985
+ };
986
+ }, [
987
+ e,
988
+ t,
989
+ n,
990
+ r
991
+ ]);
992
+ }
993
+ var q = {
994
+ option: "_option_1jnhn_1",
995
+ selected: "_selected_1jnhn_19",
996
+ disabled: "_disabled_1jnhn_19",
997
+ description: "_description_1jnhn_38",
998
+ icon: "_icon_1jnhn_42",
999
+ active: "_active_1jnhn_46",
1000
+ label: "_label_1jnhn_89",
1001
+ content: "_content_1jnhn_98",
1002
+ custom: "_custom_1jnhn_99",
1003
+ badge: "_badge_1jnhn_133",
1004
+ shortcut: "_shortcut_1jnhn_134",
1005
+ success: "_success_1jnhn_154",
1006
+ warning: "_warning_1jnhn_218",
1007
+ danger: "_danger_1jnhn_282",
1008
+ check: "_check_1jnhn_346",
1009
+ checkPop: "_checkPop_1jnhn_1"
1010
+ }, St = () => null;
1011
+ St.__velliraSelectPart = "item", St.displayName = "Select.Item";
1012
+ var Ct = ({ option: e, isSelected: t, isActive: n, optionId: r, renderOption: i, onSelect: a, onMouseEnter: o }) => {
579
1013
  let s = !!e.disabled;
580
- return /* @__PURE__ */ g("li", {
1014
+ return /* @__PURE__ */ _("li", {
581
1015
  id: r,
582
1016
  role: "option",
583
1017
  "aria-selected": t,
584
1018
  "aria-disabled": s || void 0,
585
- className: z(q.option, {
1019
+ className: V(q.option, {
586
1020
  [q.selected]: t,
587
1021
  [q.active]: n,
588
1022
  [q.disabled]: s,
@@ -596,397 +1030,445 @@ var Fe = n(null), Ie = () => o(Fe), K = {
596
1030
  onMouseEnter: () => {
597
1031
  s || o();
598
1032
  },
599
- children: [i ? /* @__PURE__ */ h("span", {
1033
+ children: [i ? /* @__PURE__ */ g("span", {
600
1034
  className: q.custom,
601
1035
  children: i(e)
602
- }) : /* @__PURE__ */ g(m, { children: [
603
- e.icon && /* @__PURE__ */ h("span", {
1036
+ }) : /* @__PURE__ */ _(h, { children: [
1037
+ e.icon && /* @__PURE__ */ g("span", {
604
1038
  className: q.icon,
605
1039
  children: e.icon
606
1040
  }),
607
- /* @__PURE__ */ g("span", {
1041
+ /* @__PURE__ */ _("span", {
608
1042
  className: q.content,
609
- children: [/* @__PURE__ */ h("span", {
1043
+ children: [/* @__PURE__ */ g("span", {
610
1044
  className: q.label,
611
1045
  children: e.label
612
- }), e.description && /* @__PURE__ */ h("span", {
1046
+ }), e.description && /* @__PURE__ */ g("span", {
613
1047
  className: q.description,
614
1048
  children: e.description
615
1049
  })]
616
1050
  }),
617
- e.badge && /* @__PURE__ */ h("span", {
1051
+ e.badge && /* @__PURE__ */ g("span", {
618
1052
  className: q.badge,
619
1053
  children: e.badge
620
1054
  }),
621
- e.shortcut && /* @__PURE__ */ h("kbd", {
1055
+ e.shortcut && /* @__PURE__ */ g("kbd", {
622
1056
  className: q.shortcut,
623
1057
  children: e.shortcut
624
1058
  })
625
- ] }), /* @__PURE__ */ h("span", {
1059
+ ] }), /* @__PURE__ */ g("span", {
626
1060
  className: q.check,
627
1061
  "aria-hidden": "true",
628
- children: t && /* @__PURE__ */ h(P, {})
1062
+ children: t && /* @__PURE__ */ g(v, {})
629
1063
  })]
630
1064
  });
631
1065
  };
632
- ze.displayName = "SelectOption";
1066
+ Ct.displayName = "SelectItemRow";
633
1067
  var J = {
634
- dropdown: "_dropdown_1yn7p_1",
635
- dropdownIn: "_dropdownIn_1yn7p_1",
636
- primary: "_primary_1yn7p_73",
637
- outline: "_outline_1yn7p_73",
638
- filled: "_filled_1yn7p_130",
639
- soft: "_soft_1yn7p_187",
640
- neutral: "_neutral_1yn7p_244",
641
- success: "_success_1yn7p_415",
642
- warning: "_warning_1yn7p_586",
643
- danger: "_danger_1yn7p_757",
644
- listReveal: "_listReveal_1yn7p_1",
645
- command: "_command_1yn7p_935",
646
- searchWrap: "_searchWrap_1yn7p_940",
647
- searchReveal: "_searchReveal_1yn7p_1",
648
- search: "_search_1yn7p_940",
649
- searchClear: "_searchClear_1yn7p_969",
650
- empty: "_empty_1yn7p_1002",
651
- groupLabel: "_groupLabel_1yn7p_1010",
652
- separator: "_separator_1yn7p_1020",
653
- virtualSpacer: "_virtualSpacer_1yn7p_1026",
654
- mobileDropdownIn: "_mobileDropdownIn_1yn7p_1"
655
- }, Be = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: o, entries: c, multiple: l, selectedValues: f, color: p = "primary", variant: _ = "outline", searchable: v, command: y, virtual: b, portal: x = !0, searchValue: S = "", searchPlaceholder: C = "Search...", loading: w, loadingText: T = "Loading...", noOptionsText: E, searchSlot: D, headerSlot: O, emptySlot: k, loadingSlot: A, renderOption: j, selectedValue: M, activeIndex: N, className: P, onSelect: F, onMouseEnter: L, onSearchChange: R }) => {
656
- let z = u(null), B = u(!1), [te, ne] = d(null), [re, ie] = d(0), ae = typeof b == "object" ? b : b ? {} : void 0, oe = ae?.itemHeight ?? 40, V = !!(ae && o.length > 0 && !w), se = a((e) => {
657
- ne(e), r(e);
1068
+ dropdown: "_dropdown_13hyp_1",
1069
+ dropdownIn: "_dropdownIn_13hyp_1",
1070
+ primary: "_primary_13hyp_103",
1071
+ outline: "_outline_13hyp_103",
1072
+ filled: "_filled_13hyp_190",
1073
+ soft: "_soft_13hyp_277",
1074
+ neutral: "_neutral_13hyp_364",
1075
+ success: "_success_13hyp_625",
1076
+ warning: "_warning_13hyp_886",
1077
+ danger: "_danger_13hyp_1147",
1078
+ listReveal: "_listReveal_13hyp_1",
1079
+ groupAction: "_groupAction_13hyp_1415",
1080
+ groupActionText: "_groupActionText_13hyp_1447",
1081
+ groupActionMeta: "_groupActionMeta_13hyp_1455",
1082
+ command: "_command_13hyp_1461",
1083
+ searchWrap: "_searchWrap_13hyp_1466",
1084
+ searchReveal: "_searchReveal_13hyp_1",
1085
+ search: "_search_13hyp_1466",
1086
+ searchClear: "_searchClear_13hyp_1495",
1087
+ empty: "_empty_13hyp_1531",
1088
+ groupLabel: "_groupLabel_13hyp_1539",
1089
+ separator: "_separator_13hyp_1549",
1090
+ virtualSpacer: "_virtualSpacer_13hyp_1555",
1091
+ mobileDropdownIn: "_mobileDropdownIn_13hyp_1"
1092
+ }, wt = ({ children: e, className: t }) => {
1093
+ let { contentProps: n } = bt(), r = Et(e);
1094
+ return /* @__PURE__ */ g(Tt, {
1095
+ ...n,
1096
+ ...r,
1097
+ className: [n.className, t].filter(Boolean).join(" ")
1098
+ });
1099
+ };
1100
+ wt.__velliraSelectPart = "content", wt.displayName = "Select.Content";
1101
+ var Tt = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, entries: s, multiple: l, selectedValues: u, color: p = "primary", variant: m = "outline", searchable: v, command: y, virtual: b, portal: S = !0, searchValue: C = "", searchPlaceholder: w = "Search...", loading: T, loadingText: E = "Loading...", noOptionsText: D, searchSlot: O, headerSlot: k, emptySlot: A, loadingSlot: j, renderOption: M, selectedValue: N, activeIndex: P, visualActiveIndex: F = P, className: I, onSelect: L, onSelectGroup: R, onMouseEnter: ee, onSearchChange: z }) => {
1102
+ let B = d(null), te = d(!1), [ne, re] = f(null), [ie, ae] = f(0), { bottomSpacerHeight: V, isVirtual: U, itemHeight: oe, startIndex: se, topSpacerHeight: ce, viewportHeight: le, visibleOptions: ue } = xt({
1103
+ loading: T,
1104
+ options: a,
1105
+ scrollTop: ie,
1106
+ virtual: b
1107
+ }), de = o((e) => {
1108
+ re(e), r(e);
658
1109
  }, [r]);
659
- if (s(() => {
660
- e || (B.current = !1, ie(0));
661
- }, [e, S]), s(() => {
662
- if (!e || w || !te || B.current) return;
663
- let n = o.findIndex((e) => f ? f.includes(e.value) : e.value === M), r = n >= 0 ? n : N;
1110
+ if (c(() => {
1111
+ e || (te.current = !1, ae(0));
1112
+ }, [e, C]), c(() => {
1113
+ if (!e || !v) return;
1114
+ let t = window.setTimeout(() => {
1115
+ B.current?.focus({ preventScroll: !0 });
1116
+ }, 0);
1117
+ return () => window.clearTimeout(t);
1118
+ }, [e, v]), c(() => {
1119
+ if (!e || T || !ne || te.current) return;
1120
+ let n = a.findIndex((e) => u ? u.includes(e.value) : e.value === N), r = n >= 0 ? n : P;
664
1121
  if (r < 0) {
665
- B.current = !0;
1122
+ te.current = !0;
666
1123
  return;
667
1124
  }
668
- if (B.current = !0, V) {
669
- let e = Math.max(0, r * oe - (300 - oe) / 2);
670
- ie(e), te.scrollTop = e;
1125
+ if (te.current = !0, U) {
1126
+ let e = Math.max(0, r * oe - (le - oe) / 2);
1127
+ ae(e), ne.scrollTop = e;
671
1128
  return;
672
1129
  }
673
1130
  document.getElementById(`${t}-option-${r}`)?.scrollIntoView?.({ block: "nearest" });
674
1131
  }, [
675
- N,
676
- te,
1132
+ P,
1133
+ ne,
677
1134
  e,
678
- V,
1135
+ U,
679
1136
  oe,
680
1137
  t,
681
- w,
682
- o,
683
- M,
684
- f
1138
+ T,
1139
+ a,
1140
+ N,
1141
+ u
685
1142
  ]), !e) return null;
686
- let ce = V ? Math.max(0, Math.floor(re / oe) - 2) : 0, le = V ? Math.ceil(300 / oe) + 4 : o.length, ue = V ? o.slice(ce, ce + le) : o, de = c && !V ? c : ue.map((e, t) => ({
1143
+ let fe = s && !U ? s : ue.map((e, t) => ({
687
1144
  type: "option",
688
1145
  option: e,
689
- optionIndex: ce + t
690
- })), fe = V ? ce * oe : 0, pe = V ? Math.max(0, (o.length - ce - ue.length) * oe) : 0, me = /* @__PURE__ */ g("div", {
691
- ref: se,
1146
+ optionIndex: se + t
1147
+ })), pe = /* @__PURE__ */ _("div", {
1148
+ ref: de,
692
1149
  tabIndex: 0,
693
1150
  className: [
694
1151
  J.dropdown,
695
1152
  J[p],
696
- J[_],
1153
+ J[m],
697
1154
  y ? J.command : void 0,
698
- P
1155
+ I
699
1156
  ].filter(Boolean).join(" "),
700
1157
  style: i,
701
1158
  onScroll: (e) => {
702
- V && ie(e.currentTarget.scrollTop);
1159
+ U && ae(e.currentTarget.scrollTop);
703
1160
  },
704
1161
  children: [
705
- O,
706
- D ?? (v && /* @__PURE__ */ g("div", {
1162
+ k,
1163
+ O ?? (v && /* @__PURE__ */ _("div", {
707
1164
  className: J.searchWrap,
708
- children: [/* @__PURE__ */ h("input", {
709
- ref: z,
1165
+ children: [/* @__PURE__ */ g("input", {
1166
+ ref: B,
710
1167
  className: J.search,
711
- value: S,
712
- placeholder: y ? "Type a command..." : C,
1168
+ value: C,
1169
+ placeholder: y ? "Type a command..." : w,
713
1170
  "aria-label": "Search options",
714
- onInput: (e) => R?.(e.currentTarget.value),
715
- onChange: (e) => R?.(e.target.value)
716
- }), S && /* @__PURE__ */ h("button", {
1171
+ onInput: (e) => z?.(e.currentTarget.value),
1172
+ onChange: (e) => z?.(e.target.value)
1173
+ }), C && /* @__PURE__ */ g("button", {
717
1174
  type: "button",
718
1175
  className: J.searchClear,
719
1176
  "aria-label": "Clear search",
720
1177
  onClick: () => {
721
- R?.(""), z.current?.focus();
1178
+ z?.(""), B.current?.focus();
722
1179
  },
723
- children: /* @__PURE__ */ h(I, {})
1180
+ children: /* @__PURE__ */ g(x, {})
724
1181
  })]
725
1182
  })),
726
- /* @__PURE__ */ h("ul", {
1183
+ /* @__PURE__ */ g("ul", {
727
1184
  id: t,
728
1185
  role: "listbox",
729
1186
  "aria-multiselectable": l || void 0,
730
1187
  "aria-labelledby": n,
731
- className: P,
732
- children: w ? /* @__PURE__ */ h("li", {
1188
+ children: T ? /* @__PURE__ */ g("li", {
733
1189
  role: "option",
734
1190
  "aria-disabled": "true",
735
1191
  "aria-selected": "false",
736
1192
  className: J.empty,
737
- children: A ?? T
738
- }) : o.length ? /* @__PURE__ */ g(m, { children: [
739
- V && /* @__PURE__ */ h("li", {
1193
+ children: j ?? E
1194
+ }) : a.length ? /* @__PURE__ */ _(h, { children: [
1195
+ U && /* @__PURE__ */ g("li", {
740
1196
  "aria-hidden": "true",
741
1197
  className: J.virtualSpacer,
742
- style: { height: fe }
1198
+ style: { height: ce }
743
1199
  }),
744
- de.map((e) => {
745
- if (e.type === "group") return /* @__PURE__ */ h("li", {
746
- role: "presentation",
747
- className: J.groupLabel,
748
- children: e.label
749
- }, e.id);
750
- if (e.type === "separator") return /* @__PURE__ */ h("li", {
1200
+ fe.map((e) => {
1201
+ if (e.type === "group") {
1202
+ if (e.selectable && l) {
1203
+ 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;
1204
+ return /* @__PURE__ */ g("li", {
1205
+ role: "presentation",
1206
+ children: /* @__PURE__ */ _("button", {
1207
+ type: "button",
1208
+ className: J.groupAction,
1209
+ "aria-label": Dt(e.selectLabel ?? e.label),
1210
+ "aria-pressed": i ? "mixed" : r ? "true" : "false",
1211
+ disabled: t.length === 0,
1212
+ onClick: () => R(t),
1213
+ children: [/* @__PURE__ */ g("span", {
1214
+ className: J.groupActionText,
1215
+ children: e.selectLabel ?? e.label
1216
+ }), /* @__PURE__ */ _("span", {
1217
+ className: J.groupActionMeta,
1218
+ children: [
1219
+ n,
1220
+ "/",
1221
+ t.length
1222
+ ]
1223
+ })]
1224
+ })
1225
+ }, e.id);
1226
+ }
1227
+ return /* @__PURE__ */ g("li", {
1228
+ role: "presentation",
1229
+ className: J.groupLabel,
1230
+ children: e.label
1231
+ }, e.id);
1232
+ }
1233
+ if (e.type === "separator") return /* @__PURE__ */ g("li", {
751
1234
  role: "presentation",
752
1235
  "aria-hidden": "true",
753
1236
  className: J.separator,
754
1237
  "data-vellira-select-separator": "true"
755
1238
  }, e.id);
756
1239
  let { option: n, optionIndex: r } = e;
757
- return /* @__PURE__ */ h(ze, {
1240
+ return /* @__PURE__ */ g(Ct, {
758
1241
  option: n,
759
- isSelected: f ? f.includes(n.value) : n.value === M,
760
- isActive: r === N,
1242
+ isSelected: u ? u.includes(n.value) : n.value === N,
1243
+ isActive: r === F,
761
1244
  optionId: `${t}-option-${r}`,
762
- renderOption: j,
763
- onSelect: F,
764
- onMouseEnter: () => L(r)
1245
+ renderOption: M,
1246
+ onSelect: L,
1247
+ onMouseEnter: () => ee(r)
765
1248
  }, n.value);
766
1249
  }),
767
- V && /* @__PURE__ */ h("li", {
1250
+ U && /* @__PURE__ */ g("li", {
768
1251
  "aria-hidden": "true",
769
1252
  className: J.virtualSpacer,
770
- style: { height: pe }
1253
+ style: { height: V }
771
1254
  })
772
- ] }) : /* @__PURE__ */ h("li", {
1255
+ ] }) : /* @__PURE__ */ g("li", {
773
1256
  role: "option",
774
1257
  "aria-disabled": "true",
775
1258
  "aria-selected": "false",
776
1259
  className: J.empty,
777
- children: k ?? E
1260
+ children: A ?? D
778
1261
  })
779
1262
  })
780
1263
  ]
781
1264
  });
782
- return x ? /* @__PURE__ */ h(ee, { children: me }) : me;
1265
+ return S ? /* @__PURE__ */ g(H, { children: pe }) : pe;
783
1266
  };
784
- Be.displayName = "SelectDropdown";
785
- var Y = {
786
- control: "_control_1m1fn_1",
787
- disabled: "_disabled_1m1fn_41",
788
- arrow: "_arrow_1m1fn_46",
789
- primary: "_primary_1m1fn_60",
790
- outline: "_outline_1m1fn_60",
791
- filled: "_filled_1m1fn_101",
792
- soft: "_soft_1m1fn_142",
793
- neutral: "_neutral_1m1fn_183",
794
- success: "_success_1m1fn_306",
795
- warning: "_warning_1m1fn_429",
796
- danger: "_danger_1m1fn_552",
797
- sm: "_sm_1m1fn_675",
798
- md: "_md_1m1fn_682",
799
- lg: "_lg_1m1fn_689",
800
- valueWrap: "_valueWrap_1m1fn_696",
801
- value: "_value_1m1fn_696",
802
- adornment: "_adornment_1m1fn_710",
803
- clear: "_clear_1m1fn_711",
804
- affix: "_affix_1m1fn_712",
805
- placeholder: "_placeholder_1m1fn_748",
806
- error: "_error_1m1fn_752",
807
- spinner: "_spinner_1m1fn_787",
808
- spin: "_spin_1m1fn_787",
809
- loading: "_loading_1m1fn_796",
810
- open: "_open_1m1fn_808"
811
- }, Ve = ({ 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: _, variant: v, loading: y, startIcon: b, endIcon: x, prefix: S, suffix: C, clearable: w, onClear: T, className: E, buttonRef: D, onClick: O, onKeyDown: k, onBlur: A, onFocus: j }) => /* @__PURE__ */ h("button", {
812
- id: t,
813
- ref: D,
814
- type: "button",
815
- role: "combobox",
816
- disabled: a,
817
- "aria-disabled": a || void 0,
818
- "aria-required": o || void 0,
819
- "aria-expanded": i,
820
- "aria-haspopup": "listbox",
821
- "aria-label": l,
822
- "aria-labelledby": r,
823
- "aria-invalid": u || void 0,
824
- "aria-controls": i ? s : void 0,
825
- "aria-describedby": n,
826
- "aria-activedescendant": i && c >= 0 ? `${s}-option-${c}` : void 0,
827
- className: z(Y.control, Y[p], Y[v], Y[_], {
828
- [Y.error]: !!u,
829
- [Y.disabled]: a,
830
- [Y.loading]: y
831
- }, E),
832
- onClick: O,
833
- onKeyDown: k,
834
- onBlur: A,
835
- onFocus: j,
836
- children: e ?? /* @__PURE__ */ g(m, { children: [
837
- b && /* @__PURE__ */ h("span", {
838
- className: Y.adornment,
839
- children: b
840
- }),
841
- S && /* @__PURE__ */ h("span", {
842
- className: Y.affix,
843
- children: S
844
- }),
845
- /* @__PURE__ */ h("span", {
846
- className: Y.valueWrap,
847
- children: /* @__PURE__ */ h("span", {
848
- className: z(Y.value, { [Y.placeholder]: f }),
849
- children: d
850
- })
851
- }),
852
- C && /* @__PURE__ */ h("span", {
853
- className: Y.affix,
854
- children: C
855
- }),
856
- w && /* @__PURE__ */ h("span", {
857
- role: "button",
858
- "aria-label": "Clear selection",
859
- tabIndex: -1,
860
- className: Y.clear,
861
- onClick: (e) => {
862
- e.stopPropagation(), T?.();
863
- },
864
- children: /* @__PURE__ */ h(I, {})
865
- }),
866
- /* @__PURE__ */ h("span", {
867
- className: z(Y.arrow, { [Y.open]: i }),
868
- "aria-hidden": "true",
869
- children: y ? /* @__PURE__ */ h("span", { className: Y.spinner }) : x ?? /* @__PURE__ */ h(F, {})
870
- })
871
- ] })
872
- });
873
- Ve.displayName = "SelectTrigger";
874
- //#endregion
875
- //#region src/components/Select/SelectContext.tsx
876
- var He = n(null), Ue = He.Provider;
877
- function We() {
878
- let e = o(He);
879
- if (!e) throw Error("Select compound components must be used inside Select");
880
- return e;
1267
+ Tt.displayName = "SelectContentSurface";
1268
+ function Et(t) {
1269
+ let n, r, i, o;
1270
+ return e.forEach(t, (e) => {
1271
+ if (!a(e)) return;
1272
+ let t = e.type;
1273
+ t.__velliraSelectPart === "label" && (n = e), t.__velliraSelectPart === "search" && (r = e), t.__velliraSelectPart === "empty" && (i = e), t.__velliraSelectPart === "loading" && (o = e);
1274
+ }), {
1275
+ emptySlot: i,
1276
+ headerSlot: n,
1277
+ loadingSlot: o,
1278
+ searchSlot: r
1279
+ };
1280
+ }
1281
+ function Dt(e) {
1282
+ return typeof e == "string" || typeof e == "number" ? String(e) : "Select group";
881
1283
  }
882
- He.displayName = "SelectContext";
883
1284
  //#endregion
884
- //#region src/components/Select/SelectCompound.tsx
885
- var Ge = ({ children: e, className: t }) => {
886
- let { triggerProps: n } = We();
887
- return /* @__PURE__ */ h(Ve, {
888
- ...n,
889
- className: [n.className, t].filter(Boolean).join(" "),
890
- children: e
891
- });
892
- };
893
- Ge.__velliraSelectPart = "trigger", Ge.displayName = "Select.Trigger";
894
- var Ke = ({ children: e, className: t }) => {
895
- let { dropdownProps: n } = We(), r = ot(e);
896
- return /* @__PURE__ */ h(Be, {
897
- ...n,
898
- ...r,
899
- className: [n.className, t].filter(Boolean).join(" ")
900
- });
901
- };
902
- Ke.__velliraSelectPart = "content", Ke.displayName = "Select.Content";
903
- var qe = ({ children: e, className: t }) => {
904
- let { triggerProps: n } = We();
905
- return /* @__PURE__ */ h("span", {
906
- className: z(Y.valueWrap, t),
907
- children: /* @__PURE__ */ h("span", {
908
- className: z(Y.value, { [Y.placeholder]: n.isPlaceholder }),
909
- children: e ?? n.displayText
910
- })
911
- });
912
- };
913
- qe.__velliraSelectPart = "value", qe.displayName = "Select.Value";
914
- var Je = ({ children: e, className: t }) => {
915
- let { triggerProps: n } = We();
916
- return /* @__PURE__ */ h("span", {
917
- className: z(Y.arrow, { [Y.open]: n.isOpen }, t),
918
- "aria-hidden": "true",
919
- children: n.loading ? /* @__PURE__ */ h("span", { className: Y.spinner }) : e ?? n.endIcon ?? /* @__PURE__ */ h(F, {})
920
- });
921
- };
922
- Je.__velliraSelectPart = "icon", Je.displayName = "Select.Icon";
923
- var Ye = ({ placeholder: e, className: t }) => {
924
- let { dropdownProps: n } = We(), r = u(null), i = n.searchValue ?? "";
925
- return /* @__PURE__ */ g("div", {
1285
+ //#region src/components/Select/Content/SelectEmpty.tsx
1286
+ var Ot = ({ children: e }) => /* @__PURE__ */ g(h, { children: e });
1287
+ Ot.__velliraSelectPart = "empty", Ot.displayName = "Select.Empty";
1288
+ //#endregion
1289
+ //#region src/components/Select/Content/SelectLoading.tsx
1290
+ var kt = ({ children: e }) => /* @__PURE__ */ g(h, { children: e });
1291
+ kt.__velliraSelectPart = "loading", kt.displayName = "Select.Loading";
1292
+ //#endregion
1293
+ //#region src/components/Select/Content/SelectSearch.tsx
1294
+ var At = ({ placeholder: e, className: t }) => {
1295
+ let { contentProps: n } = bt(), r = d(null), i = n.searchValue ?? "";
1296
+ return c(() => {
1297
+ if (!n.isOpen) return;
1298
+ let e = window.setTimeout(() => {
1299
+ r.current?.focus({ preventScroll: !0 });
1300
+ }, 0);
1301
+ return () => window.clearTimeout(e);
1302
+ }, [n.isOpen]), /* @__PURE__ */ _("div", {
926
1303
  className: J.searchWrap,
927
- children: [/* @__PURE__ */ h("input", {
1304
+ children: [/* @__PURE__ */ g("input", {
928
1305
  ref: r,
929
- className: z(J.search, t),
1306
+ className: V(J.search, t),
930
1307
  value: i,
931
1308
  placeholder: e ?? (n.command ? "Type a command..." : "Search..."),
932
1309
  "aria-label": "Search options",
933
1310
  onInput: (e) => n.onSearchChange?.(e.currentTarget.value),
934
1311
  onChange: (e) => n.onSearchChange?.(e.target.value)
935
- }), i && /* @__PURE__ */ h("button", {
1312
+ }), i && /* @__PURE__ */ g("button", {
936
1313
  type: "button",
937
1314
  className: J.searchClear,
938
1315
  "aria-label": "Clear search",
939
1316
  onClick: () => {
940
1317
  n.onSearchChange?.(""), r.current?.focus();
941
1318
  },
942
- children: /* @__PURE__ */ h(I, {})
1319
+ children: /* @__PURE__ */ g(x, {})
943
1320
  })]
944
1321
  });
945
1322
  };
946
- Ye.__velliraSelectPart = "search", Ye.displayName = "Select.Search";
947
- var Xe = () => null;
948
- Xe.__velliraSelectPart = "group", Xe.displayName = "Select.Group";
949
- var Ze = ({ children: e }) => /* @__PURE__ */ h("div", {
1323
+ At.__velliraSelectPart = "search", At.displayName = "Select.Search";
1324
+ //#endregion
1325
+ //#region src/components/Select/Group/SelectGroup.tsx
1326
+ var jt = () => null;
1327
+ jt.__velliraSelectPart = "group", jt.displayName = "Select.Group";
1328
+ //#endregion
1329
+ //#region src/components/Select/Group/SelectLabel.tsx
1330
+ var Mt = ({ children: e }) => /* @__PURE__ */ g("div", {
950
1331
  role: "presentation",
951
1332
  className: J.groupLabel,
952
1333
  children: e
953
1334
  });
954
- Ze.__velliraSelectPart = "label", Ze.displayName = "Select.Label";
955
- var Qe = () => null;
956
- Qe.__velliraSelectPart = "item", Qe.displayName = "Select.Item";
957
- var $e = () => null;
958
- $e.__velliraSelectPart = "itemIcon", $e.displayName = "Select.ItemIcon";
959
- var et = () => null;
960
- et.__velliraSelectPart = "itemDescription", et.displayName = "Select.ItemDescription";
961
- var tt = () => null;
962
- tt.__velliraSelectPart = "separator", tt.displayName = "Select.Separator";
963
- var nt = ({ children: e }) => /* @__PURE__ */ h(m, { children: e });
964
- nt.__velliraSelectPart = "empty", nt.displayName = "Select.Empty";
965
- var rt = ({ children: e }) => /* @__PURE__ */ h(m, { children: e });
966
- rt.__velliraSelectPart = "loading", rt.displayName = "Select.Loading";
967
- function it(t) {
968
- let n = [], r = [], a = 0;
1335
+ Mt.__velliraSelectPart = "label", Mt.displayName = "Select.Label";
1336
+ //#endregion
1337
+ //#region src/components/Select/Group/SelectSeparator.tsx
1338
+ var Nt = () => null;
1339
+ Nt.__velliraSelectPart = "separator", Nt.displayName = "Select.Separator";
1340
+ //#endregion
1341
+ //#region src/components/Select/Item/SelectItemBadge.tsx
1342
+ var Pt = () => null;
1343
+ Pt.__velliraSelectPart = "itemBadge", Pt.displayName = "Select.ItemBadge";
1344
+ //#endregion
1345
+ //#region src/components/Select/Item/SelectItemDescription.tsx
1346
+ var Ft = () => null;
1347
+ Ft.__velliraSelectPart = "itemDescription", Ft.displayName = "Select.ItemDescription";
1348
+ //#endregion
1349
+ //#region src/components/Select/Item/SelectItemIcon.tsx
1350
+ var It = () => null;
1351
+ It.__velliraSelectPart = "itemIcon", It.displayName = "Select.ItemIcon";
1352
+ //#endregion
1353
+ //#region src/patterns/FormField/FormFieldContext.ts
1354
+ var Lt = r(null), Rt = () => s(Lt), zt = {
1355
+ wrapper: "_wrapper_143kr_1",
1356
+ sm: "_sm_143kr_41",
1357
+ md: "_md_143kr_78",
1358
+ lg: "_lg_143kr_115",
1359
+ horizontal: "_horizontal_143kr_152",
1360
+ start: "_start_143kr_153",
1361
+ description: "_description_143kr_160",
1362
+ control: "_control_143kr_161",
1363
+ errorText: "_errorText_143kr_162",
1364
+ label: "_label_143kr_169",
1365
+ labelText: "_labelText_143kr_186",
1366
+ required: "_required_143kr_190",
1367
+ optional: "_optional_143kr_194",
1368
+ labelInfo: "_labelInfo_143kr_201",
1369
+ disabled: "_disabled_143kr_243"
1370
+ }, Bt = (...e) => e.filter(Boolean).join(" ") || void 0, Vt = ({ id: e, label: t, description: r, error: i, required: o = !1, disabled: s = !1, invalid: c = !1, orientation: u = "vertical", labelPosition: d = "top", size: f = "md", labelInfo: p, optionalText: m, children: h, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
1371
+ let T = l(), E = e ?? T, D = t ? `${E}-label` : void 0, O = r && E ? `${E}-description` : void 0, k = i && E ? `${E}-error` : void 0, A = c || !!i, j = Bt(D), M = Bt(O, k), N = {
1372
+ controlId: E,
1373
+ labelId: D,
1374
+ descriptionId: O,
1375
+ errorId: k,
1376
+ required: o,
1377
+ disabled: s,
1378
+ invalid: A,
1379
+ size: f,
1380
+ ariaLabelledBy: j,
1381
+ ariaDescribedBy: M
1382
+ }, P = a(h) ? h : void 0, F = v && P ? n(P, {
1383
+ id: P.props.id ?? E,
1384
+ required: P.props.required ?? o,
1385
+ disabled: P.props.disabled ?? s,
1386
+ "aria-invalid": P.props["aria-invalid"] ?? (A || void 0),
1387
+ "aria-labelledby": Bt(P.props["aria-labelledby"], j),
1388
+ "aria-describedby": Bt(P.props["aria-describedby"], M)
1389
+ }) : h;
1390
+ return /* @__PURE__ */ _("div", {
1391
+ ...w,
1392
+ "aria-disabled": s || void 0,
1393
+ className: V(zt.wrapper, zt[u], zt[d], zt[f], s && zt.disabled, y),
1394
+ "data-disabled": s || void 0,
1395
+ "data-invalid": A || void 0,
1396
+ "data-orientation": u,
1397
+ "data-size": f,
1398
+ children: [
1399
+ t && /* @__PURE__ */ _("label", {
1400
+ id: D,
1401
+ htmlFor: E,
1402
+ className: V(zt.label, x),
1403
+ children: [
1404
+ /* @__PURE__ */ g("span", {
1405
+ className: zt.labelText,
1406
+ children: t
1407
+ }),
1408
+ o && /* @__PURE__ */ g("span", {
1409
+ className: zt.required,
1410
+ "aria-hidden": "true",
1411
+ children: "*"
1412
+ }),
1413
+ !o && m && /* @__PURE__ */ g("span", {
1414
+ className: zt.optional,
1415
+ children: m
1416
+ }),
1417
+ p && /* @__PURE__ */ g("span", {
1418
+ className: zt.labelInfo,
1419
+ children: p
1420
+ })
1421
+ ]
1422
+ }),
1423
+ r && /* @__PURE__ */ g("div", {
1424
+ id: O,
1425
+ className: V(zt.description, S),
1426
+ children: r
1427
+ }),
1428
+ /* @__PURE__ */ g(Lt.Provider, {
1429
+ value: N,
1430
+ children: /* @__PURE__ */ g("div", {
1431
+ className: V(zt.control, b),
1432
+ children: F
1433
+ })
1434
+ }),
1435
+ i && /* @__PURE__ */ g("div", {
1436
+ id: k,
1437
+ className: V(zt.errorText, C),
1438
+ role: "alert",
1439
+ children: i
1440
+ })
1441
+ ]
1442
+ });
1443
+ };
1444
+ //#endregion
1445
+ //#region src/components/Select/internal/SelectCollection.ts
1446
+ function Ht(t) {
1447
+ let n = [], r = [], i = 0;
969
1448
  function o(t) {
970
1449
  e.forEach(t, (e) => {
971
- if (!i(e)) return;
1450
+ if (!a(e)) return;
972
1451
  let t = e.type;
973
1452
  if (t.__velliraSelectPart === "group") {
974
- let t = e.props;
1453
+ let t = e.props, r = Wt(t.children);
975
1454
  n.push({
976
1455
  type: "group",
977
- id: `group-${a++}`,
978
- label: t.label
1456
+ id: `group-${i++}`,
1457
+ label: t.label,
1458
+ selectable: t.selectable,
1459
+ selectLabel: t.selectLabel,
1460
+ itemValues: r
979
1461
  }), o(t.children);
980
1462
  return;
981
1463
  }
982
1464
  if (t.__velliraSelectPart === "item") {
983
- let t = e.props, i = st(t.children, t.value), a = t.label ?? i.label, o = r.length, s = {
1465
+ let t = e.props, i = Gt(t.children, t.value), a = t.label ?? i.label, o = r.length, s = {
984
1466
  label: a,
985
1467
  value: t.value,
986
1468
  disabled: t.disabled,
987
1469
  description: t.description ?? i.description,
988
1470
  icon: t.icon ?? i.icon,
989
- badge: t.badge,
1471
+ badge: t.badge ?? i.badge,
990
1472
  shortcut: t.shortcut,
991
1473
  color: t.color
992
1474
  };
@@ -1000,11 +1482,11 @@ function it(t) {
1000
1482
  if (t.__velliraSelectPart === "separator") {
1001
1483
  n.push({
1002
1484
  type: "separator",
1003
- id: `separator-${a++}`
1485
+ id: `separator-${i++}`
1004
1486
  });
1005
1487
  return;
1006
1488
  }
1007
- t.__velliraSelectPart === "empty" || t.__velliraSelectPart === "icon" || t.__velliraSelectPart === "itemDescription" || t.__velliraSelectPart === "itemIcon" || t.__velliraSelectPart === "label" || t.__velliraSelectPart === "loading" || t.__velliraSelectPart === "search" || t.__velliraSelectPart === "value" || o(e.props.children);
1489
+ 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);
1008
1490
  });
1009
1491
  }
1010
1492
  return o(t), {
@@ -1012,11 +1494,11 @@ function it(t) {
1012
1494
  options: r
1013
1495
  };
1014
1496
  }
1015
- function at(t) {
1497
+ function Ut(t) {
1016
1498
  let n = !1;
1017
1499
  function r(t) {
1018
1500
  e.forEach(t, (e) => {
1019
- if (!i(e) || n) return;
1501
+ if (!a(e) || n) return;
1020
1502
  let t = e.type;
1021
1503
  if (t.__velliraSelectPart === "trigger" || t.__velliraSelectPart === "content") {
1022
1504
  n = !0;
@@ -1027,257 +1509,452 @@ function at(t) {
1027
1509
  }
1028
1510
  return r(t), n;
1029
1511
  }
1030
- function ot(t) {
1031
- let n, r, a, o;
1032
- return e.forEach(t, (e) => {
1033
- if (!i(e)) return;
1034
- let t = e.type;
1035
- t.__velliraSelectPart === "label" && (n = e), t.__velliraSelectPart === "search" && (r = e), t.__velliraSelectPart === "empty" && (a = e), t.__velliraSelectPart === "loading" && (o = e);
1036
- }), {
1037
- emptySlot: a,
1038
- headerSlot: n,
1039
- loadingSlot: o,
1040
- searchSlot: r
1041
- };
1512
+ function Wt(t) {
1513
+ let n = [];
1514
+ function r(t) {
1515
+ e.forEach(t, (e) => {
1516
+ if (a(e)) {
1517
+ if (e.type.__velliraSelectPart === "item") {
1518
+ n.push(e.props.value);
1519
+ return;
1520
+ }
1521
+ r(e.props.children);
1522
+ }
1523
+ });
1524
+ }
1525
+ return r(t), n;
1042
1526
  }
1043
- function st(t, n) {
1044
- let r, a, o = [];
1045
- function s(t) {
1527
+ function Gt(t, n) {
1528
+ let r, i, o, s = [];
1529
+ function c(t) {
1046
1530
  e.forEach(t, (e) => {
1047
1531
  if (typeof e == "string" || typeof e == "number") {
1048
- o.push(String(e));
1532
+ s.push(String(e));
1049
1533
  return;
1050
1534
  }
1051
- if (!i(e)) return;
1535
+ if (!a(e)) return;
1052
1536
  let t = e.type;
1053
- if (t.__velliraSelectPart === "itemIcon") {
1537
+ if (t.__velliraSelectPart === "itemBadge") {
1054
1538
  r = e.props.children;
1055
1539
  return;
1056
1540
  }
1541
+ if (t.__velliraSelectPart === "itemIcon") {
1542
+ o = e.props.children;
1543
+ return;
1544
+ }
1057
1545
  if (t.__velliraSelectPart === "itemDescription") {
1058
- a = e.props.children;
1546
+ i = e.props.children;
1059
1547
  return;
1060
1548
  }
1061
- s(e.props.children);
1549
+ c(e.props.children);
1062
1550
  });
1063
1551
  }
1064
- s(t);
1065
- let c = o.join("").trim();
1552
+ c(t);
1553
+ let l = s.join("").trim();
1066
1554
  return {
1067
- description: a,
1068
- icon: r,
1069
- label: c || n
1555
+ badge: r,
1556
+ description: i,
1557
+ icon: o,
1558
+ label: l || n
1070
1559
  };
1071
1560
  }
1072
1561
  //#endregion
1073
- //#region src/components/Select/Select.tsx
1074
- var ct = 0, lt = "", ut = Object.assign(({ children: e, label: t, description: n, id: r, name: i, "aria-label": o, "aria-describedby": f, "aria-labelledby": p, 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: M = !1, invalid: N = !1, loading: P = !1, clearable: F = !1, searchable: I = !1, virtual: L, modal: R = !1, command: z = !1, error: ee, placement: B = "bottom", matchTriggerWidth: te = !0, avoidCollisions: ne = !0, portal: ae = !0, open: oe, defaultOpen: V = !1, onOpenChange: se, onSearch: ce, onClear: le, startIcon: ue, endIcon: de, prefix: fe, suffix: pe, renderValue: me, renderOption: he, onBlur: ge, onFocus: _e, className: ve, triggerClassName: ye, dropdownClassName: be }) => {
1075
- let xe = c(), H = Ie(), U = !!(t || n || ee), W = r ?? (U ? void 0 : H?.controlId) ?? xe, Se = `${W}-listbox`, [Ce, we] = d(""), Te = !!ee, Ee = Te ? `${W}-error` : void 0, De = n ? `${W}-description` : void 0, Oe = D ?? H?.size ?? "md", ke = N || Te || !U && !!H?.invalid, Ae = M || !U && !!H?.disabled, je = A || !U && !!H?.required, Me = [
1076
- f,
1077
- !U && !f ? H?.ariaDescribedBy : void 0,
1078
- De,
1079
- Ee
1080
- ].filter(Boolean).join(" "), Ne = u(null), G = u(null), Pe = I || z, { entries: Fe, options: K } = l(() => it(e), [e]), Le = l(() => {
1081
- if (!Pe || !Ce) return K;
1082
- let e = Ce.toLocaleLowerCase();
1083
- return K.filter((t) => `${t.label} ${dt(t.description)}`.toLocaleLowerCase().includes(e));
1562
+ //#region src/components/Select/internal/useSelectCollection.ts
1563
+ function Kt(e) {
1564
+ return u(() => Ht(e), [e]);
1565
+ }
1566
+ //#endregion
1567
+ //#region src/components/Select/internal/useSelectPosition.ts
1568
+ function qt({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
1569
+ return Le({
1570
+ open: t,
1571
+ onOpenChange: r,
1572
+ placement: i === "bottom" || i === "top" ? `${i}-start` : i,
1573
+ matchTriggerWidth: n,
1574
+ avoidCollisions: e,
1575
+ mobileSheetBreakpoint: 640
1576
+ });
1577
+ }
1578
+ //#endregion
1579
+ //#region src/components/Select/internal/useSelectSearch.ts
1580
+ function Jt({ options: e, searchable: t, searchValue: n }) {
1581
+ return u(() => {
1582
+ if (!t || !n) return e;
1583
+ let r = n.toLocaleLowerCase();
1584
+ return e.filter((e) => `${e.label} ${Yt(e.description)}`.toLocaleLowerCase().includes(r));
1084
1585
  }, [
1085
- Pe,
1086
- K,
1087
- Ce
1088
- ]), { selectedValue: q, selectedValues: ze, selectedOption: J, selectedOptions: Y, isOpen: He, setIsOpen: We, activeIndex: qe, setActiveIndex: Je, closeDropdown: Ye, toggleDropdown: Xe, selectValue: Ze, onKeyDown: Qe } = j({
1089
- value: _,
1586
+ e,
1587
+ n,
1588
+ t
1589
+ ]);
1590
+ }
1591
+ function Yt(e) {
1592
+ return typeof e == "string" || typeof e == "number" ? String(e) : "";
1593
+ }
1594
+ var Y = {
1595
+ control: "_control_swenc_1",
1596
+ disabled: "_disabled_swenc_41",
1597
+ arrow: "_arrow_swenc_46",
1598
+ primary: "_primary_swenc_60",
1599
+ outline: "_outline_swenc_60",
1600
+ filled: "_filled_swenc_101",
1601
+ soft: "_soft_swenc_142",
1602
+ neutral: "_neutral_swenc_183",
1603
+ success: "_success_swenc_306",
1604
+ warning: "_warning_swenc_429",
1605
+ danger: "_danger_swenc_552",
1606
+ sm: "_sm_swenc_675",
1607
+ md: "_md_swenc_682",
1608
+ lg: "_lg_swenc_689",
1609
+ valueWrap: "_valueWrap_swenc_696",
1610
+ value: "_value_swenc_696",
1611
+ adornment: "_adornment_swenc_710",
1612
+ clear: "_clear_swenc_711",
1613
+ affix: "_affix_swenc_712",
1614
+ placeholder: "_placeholder_swenc_751",
1615
+ error: "_error_swenc_755",
1616
+ spinner: "_spinner_swenc_790",
1617
+ spin: "_spin_swenc_790",
1618
+ loading: "_loading_swenc_799",
1619
+ open: "_open_swenc_811"
1620
+ }, Xt = ({ children: e, className: t }) => {
1621
+ let { triggerProps: n } = bt();
1622
+ return /* @__PURE__ */ g(Zt, {
1623
+ ...n,
1624
+ className: [n.className, t].filter(Boolean).join(" "),
1625
+ children: e
1626
+ });
1627
+ };
1628
+ Xt.__velliraSelectPart = "trigger", Xt.displayName = "Select.Trigger";
1629
+ var Zt = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabled: a, required: o, listboxId: s, activeIndex: c, ariaLabel: l, error: u, displayText: d, isPlaceholder: f, size: p = "md", color: m, variant: v, loading: b, startIcon: S, endIcon: C, prefix: w, suffix: T, clearable: E, onClear: D, className: O, buttonRef: k, onClick: A, onKeyDown: j, onBlur: M, onFocus: N }) => /* @__PURE__ */ g("button", {
1630
+ id: t,
1631
+ ref: k,
1632
+ type: "button",
1633
+ role: "combobox",
1634
+ disabled: a,
1635
+ "aria-disabled": a || void 0,
1636
+ "aria-required": o || void 0,
1637
+ "aria-expanded": i,
1638
+ "aria-haspopup": "listbox",
1639
+ "aria-label": l,
1640
+ "aria-labelledby": r,
1641
+ "aria-invalid": u || void 0,
1642
+ "aria-controls": i ? s : void 0,
1643
+ "aria-describedby": n,
1644
+ "aria-activedescendant": i && c >= 0 ? `${s}-option-${c}` : void 0,
1645
+ className: V(Y.control, Y[p], Y[v], Y[m], {
1646
+ [Y.error]: !!u,
1647
+ [Y.disabled]: a,
1648
+ [Y.loading]: b
1649
+ }, O),
1650
+ onClick: A,
1651
+ onKeyDown: j,
1652
+ onBlur: M,
1653
+ onFocus: N,
1654
+ children: e ?? /* @__PURE__ */ _(h, { children: [
1655
+ S && /* @__PURE__ */ g("span", {
1656
+ className: Y.adornment,
1657
+ children: S
1658
+ }),
1659
+ w && /* @__PURE__ */ g("span", {
1660
+ className: Y.affix,
1661
+ children: w
1662
+ }),
1663
+ /* @__PURE__ */ g("span", {
1664
+ className: Y.valueWrap,
1665
+ children: /* @__PURE__ */ g("span", {
1666
+ className: V(Y.value, { [Y.placeholder]: f }),
1667
+ children: d
1668
+ })
1669
+ }),
1670
+ T && /* @__PURE__ */ g("span", {
1671
+ className: Y.affix,
1672
+ children: T
1673
+ }),
1674
+ E && /* @__PURE__ */ g("span", {
1675
+ role: "button",
1676
+ "aria-label": "Clear selection",
1677
+ tabIndex: -1,
1678
+ className: Y.clear,
1679
+ onClick: (e) => {
1680
+ e.stopPropagation(), D?.();
1681
+ },
1682
+ children: /* @__PURE__ */ g(x, {})
1683
+ }),
1684
+ /* @__PURE__ */ g("span", {
1685
+ className: V(Y.arrow, { [Y.open]: i }),
1686
+ "aria-hidden": "true",
1687
+ children: b ? /* @__PURE__ */ g("span", { className: Y.spinner }) : C ?? /* @__PURE__ */ g(y, {})
1688
+ })
1689
+ ] })
1690
+ });
1691
+ Zt.displayName = "SelectTriggerSurface";
1692
+ //#endregion
1693
+ //#region src/components/Select/Root/SelectRoot.tsx
1694
+ var Qt = 0, $t = "", en = ({ children: e, label: t, description: n, id: r, name: i, "aria-label": a, "aria-describedby": s, "aria-labelledby": p, value: m, defaultValue: v, onValueChange: y, multiple: b = !1, maxSelected: x, closeOnSelect: S, placeholder: C = "Select...", empty: w, loadingText: T = "Loading...", noOptionsText: E, size: D, color: O = "primary", variant: k = "outline", required: A = !1, disabled: j = !1, invalid: M = !1, loading: N = !1, clearable: P = !1, searchable: F = !1, virtual: I, modal: R = !1, command: ee = !1, error: z, placement: B = "bottom", matchTriggerWidth: te = !0, avoidCollisions: ne = !0, portal: re = !0, open: ie, defaultOpen: ae = !1, onOpenChange: V, onSearch: H, onClear: U, startIcon: oe, endIcon: se, prefix: ce, suffix: le, renderValue: ue, renderOption: de, onBlur: fe, onFocus: pe, className: me, triggerClassName: he, dropdownClassName: ge }) => {
1695
+ let W = l(), _e = Rt(), ve = !!(t || n || z), ye = r ?? (ve ? void 0 : _e?.controlId) ?? W, be = `${ye}-listbox`, [xe, Se] = f(""), Ce = !!z, we = Ce ? `${ye}-error` : void 0, Te = n ? `${ye}-description` : void 0, Ee = D ?? _e?.size ?? "md", De = M || Ce || !ve && !!_e?.invalid, Oe = j || !ve && !!_e?.disabled, ke = A || !ve && !!_e?.required, Ae = [
1696
+ s,
1697
+ !ve && !s ? _e?.ariaDescribedBy : void 0,
1698
+ Te,
1699
+ we
1700
+ ].filter(Boolean).join(" "), je = d(null), Me = d(null), [Ne, Pe] = f(!1), Fe = F || ee, { entries: Ie, options: Le } = Kt(e), ze = Jt({
1701
+ options: Le,
1702
+ searchable: Fe,
1703
+ searchValue: xe
1704
+ }), { selectedValue: Be, selectedValues: G, isOpen: K, setIsOpen: Ve, setSelectedValue: He, activeIndex: Ue, setActiveIndex: We, closeDropdown: Ge, toggleDropdown: Ke, selectValue: qe, onKeyDown: Je } = L({
1705
+ value: m,
1090
1706
  defaultValue: v,
1091
1707
  onValueChange: y,
1092
- options: Le,
1708
+ options: ze,
1093
1709
  multiple: b,
1094
1710
  maxSelected: x,
1095
1711
  closeOnSelect: S,
1096
- disabled: Ae,
1097
- open: oe,
1098
- defaultOpen: V,
1099
- onOpenChange: se
1100
- }), $e = !!J, et = Array.isArray(q) ? q[0] ?? "" : q, { floatingStyles: tt, setRef: nt, setFloatingRef: rt } = re({
1101
- open: He,
1102
- onOpenChange: We,
1103
- placement: B === "bottom" || B === "top" ? `${B}-start` : B,
1712
+ disabled: Oe,
1713
+ open: ie,
1714
+ defaultOpen: ae,
1715
+ onOpenChange: V
1716
+ }), Ye = u(() => Le.find((e) => G.includes(e.value)), [Le, G]), Xe = u(() => Le.filter((e) => G.includes(e.value)), [Le, G]), Ze = !!Ye, Qe = Array.isArray(Be) ? Be[0] ?? "" : Be, { floatingStyles: $e, setRef: et, setFloatingRef: tt } = qt({
1717
+ isOpen: K,
1718
+ onOpenChange: Ve,
1719
+ placement: B,
1104
1720
  matchTriggerWidth: te,
1105
- avoidCollisions: ne,
1106
- mobileSheetBreakpoint: 640
1107
- }), ot = a((e) => {
1108
- Ze(e), Ne.current?.focus();
1109
- }, [Ze]), st = a(() => {
1110
- Ze(""), le?.(), Ne.current?.focus();
1111
- }, [le, Ze]), ut = a((e) => {
1112
- we(e), ce?.(e);
1113
- }, [ce]);
1114
- ie([Ne, G], Ye, He), s(() => {
1115
- if (!(!R || !He)) return ct === 0 && (lt = document.body.style.overflow), ct += 1, document.body.style.overflow = "hidden", () => {
1116
- ct = Math.max(0, ct - 1), ct === 0 && (document.body.style.overflow = lt);
1721
+ avoidCollisions: ne
1722
+ }), nt = o((e) => {
1723
+ qe(e), je.current?.focus();
1724
+ }, [qe]), rt = o((e) => {
1725
+ if (!b || e.length === 0) return;
1726
+ 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;
1727
+ if (n.length > 0 && n.length >= i) {
1728
+ He(G.filter((e) => !t.includes(e)));
1729
+ return;
1730
+ }
1731
+ let a = [...G];
1732
+ for (let e of t) if (!a.includes(e)) {
1733
+ if (typeof x == "number" && a.length >= x) break;
1734
+ a.push(e);
1735
+ }
1736
+ He(a), S && (Ge(), je.current?.focus());
1737
+ }, [
1738
+ Ge,
1739
+ S,
1740
+ x,
1741
+ b,
1742
+ Le,
1743
+ G,
1744
+ He
1745
+ ]), it = o(() => {
1746
+ qe(""), U?.(), je.current?.focus();
1747
+ }, [U, qe]), at = o(() => {
1748
+ K || Pe(!1), Ke();
1749
+ }, [K, Ke]), ot = o((e) => {
1750
+ tn(e, K) && Pe(!0), Je(e);
1751
+ }, [K, Je]), st = o((e) => {
1752
+ Pe(!0), We(e);
1753
+ }, [We]), ct = o((e) => {
1754
+ Se(e), H?.(e);
1755
+ }, [H]);
1756
+ Re([je, Me], Ge, K), c(() => {
1757
+ K || Pe(!1);
1758
+ }, [K]), c(() => {
1759
+ !K && xe && Se("");
1760
+ }, [K, xe]), c(() => {
1761
+ if (!(!R || !K)) return Qt === 0 && ($t = document.body.style.overflow), Qt += 1, document.body.style.overflow = "hidden", () => {
1762
+ Qt = Math.max(0, Qt - 1), Qt === 0 && (document.body.style.overflow = $t);
1117
1763
  };
1118
- }, [He, R]);
1119
- let ft = a((e) => {
1120
- Ne.current = e, nt(e);
1121
- }, [nt]), pt = a((e) => {
1122
- G.current = e, rt(e);
1123
- }, [rt]), mt = me ? me(J) : b && Y.length ? Y.map((e) => e.label).join(", ") : J?.label ?? C, ht = w ?? E ?? "No options available", gt = F && ze.length > 0 && !Ae && !P, _t = {
1124
- id: W,
1125
- describedBy: Me || void 0,
1126
- labelledBy: o ? void 0 : p,
1127
- isOpen: He,
1128
- disabled: Ae,
1129
- required: je,
1130
- listboxId: Se,
1131
- activeIndex: qe,
1132
- ariaLabel: o ?? (!t && !H?.labelId ? J?.label || C : void 0),
1133
- error: ke,
1134
- loading: P,
1135
- displayText: mt,
1136
- isPlaceholder: !$e,
1137
- size: Oe,
1764
+ }, [K, R]);
1765
+ let lt = o((e) => {
1766
+ je.current = e, et(e);
1767
+ }, [et]), ut = o((e) => {
1768
+ Me.current = e, tt(e);
1769
+ }, [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 = {
1770
+ id: ye,
1771
+ describedBy: Ae || void 0,
1772
+ labelledBy: a ? void 0 : p,
1773
+ isOpen: K,
1774
+ disabled: Oe,
1775
+ required: ke,
1776
+ listboxId: be,
1777
+ activeIndex: Ue,
1778
+ ariaLabel: a ?? (!t && !_e?.labelId ? Ye?.label || C : void 0),
1779
+ error: De,
1780
+ loading: N,
1781
+ displayText: dt,
1782
+ isPlaceholder: !Ze,
1783
+ size: Ee,
1138
1784
  color: O,
1139
1785
  variant: k,
1140
- startIcon: ue,
1141
- endIcon: de,
1142
- prefix: fe,
1143
- suffix: pe,
1144
- clearable: gt,
1145
- className: ye,
1146
- buttonRef: ft,
1147
- onClear: st,
1148
- onClick: Xe,
1149
- onKeyDown: Qe,
1150
- onBlur: ge,
1151
- onFocus: _e
1152
- }, vt = {
1153
- isOpen: He,
1154
- listboxId: Se,
1155
- labelledById: W,
1156
- style: tt,
1157
- options: Le,
1158
- entries: Pe || Ce ? void 0 : Fe,
1786
+ startIcon: oe,
1787
+ endIcon: se,
1788
+ prefix: ce,
1789
+ suffix: le,
1790
+ clearable: pt,
1791
+ className: he,
1792
+ buttonRef: lt,
1793
+ onClear: it,
1794
+ onClick: at,
1795
+ onKeyDown: ot,
1796
+ onBlur: fe,
1797
+ onFocus: pe
1798
+ }, ht = {
1799
+ isOpen: K,
1800
+ listboxId: be,
1801
+ labelledById: ye,
1802
+ style: $e,
1803
+ options: ze,
1804
+ entries: Fe || xe ? void 0 : Ie,
1159
1805
  multiple: b,
1160
1806
  color: O,
1161
1807
  variant: k,
1162
- searchable: Pe,
1163
- command: z,
1164
- virtual: L,
1165
- portal: ae,
1166
- searchValue: Ce,
1167
- loading: P,
1808
+ searchable: Fe,
1809
+ command: ee,
1810
+ virtual: I,
1811
+ portal: re,
1812
+ searchValue: xe,
1813
+ loading: N,
1168
1814
  loadingText: T,
1169
- noOptionsText: ht,
1170
- renderOption: he,
1171
- selectedValue: et,
1172
- selectedValues: ze,
1173
- activeIndex: qe,
1174
- className: be,
1175
- setDropdownRef: pt,
1176
- onSelect: ot,
1177
- onMouseEnter: Je,
1178
- onSearchChange: ut
1179
- }, yt = /* @__PURE__ */ g(m, { children: [i && b && ze.length > 0 && /* @__PURE__ */ h(m, { children: ze.map((e) => /* @__PURE__ */ h("input", {
1815
+ noOptionsText: ft,
1816
+ renderOption: de,
1817
+ selectedValue: Qe,
1818
+ selectedValues: G,
1819
+ activeIndex: Ue,
1820
+ visualActiveIndex: Ne ? Ue : -1,
1821
+ className: ge,
1822
+ setDropdownRef: ut,
1823
+ onSelect: nt,
1824
+ onSelectGroup: rt,
1825
+ onMouseEnter: st,
1826
+ onSearchChange: ct
1827
+ }, gt = /* @__PURE__ */ _(h, { children: [i && b && G.length > 0 && /* @__PURE__ */ g(h, { children: G.map((e) => /* @__PURE__ */ g("input", {
1180
1828
  type: "hidden",
1181
1829
  name: i,
1182
1830
  value: e,
1183
- disabled: Ae
1184
- }, e)) }), i && !b && /* @__PURE__ */ h("input", {
1831
+ disabled: Oe
1832
+ }, e)) }), i && !b && /* @__PURE__ */ g("input", {
1185
1833
  type: "hidden",
1186
1834
  name: i,
1187
- value: et,
1188
- disabled: Ae
1189
- })] }), bt = at(e), xt = /* @__PURE__ */ g(Ue, {
1835
+ value: Qe,
1836
+ disabled: Oe
1837
+ })] }), _t = Ut(e), vt = /* @__PURE__ */ _(yt, {
1190
1838
  value: {
1191
- triggerProps: _t,
1192
- dropdownProps: vt
1839
+ triggerProps: mt,
1840
+ contentProps: ht
1193
1841
  },
1194
- children: [yt, bt ? e : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Ge, {}), /* @__PURE__ */ h(Ke, { children: e })] })]
1195
- }), St = /* @__PURE__ */ g(Ue, {
1842
+ children: [gt, _t ? e : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Xt, {}), /* @__PURE__ */ g(wt, { children: e })] })]
1843
+ }), bt = /* @__PURE__ */ _(yt, {
1196
1844
  value: {
1197
- triggerProps: _t,
1198
- dropdownProps: vt
1845
+ triggerProps: mt,
1846
+ contentProps: ht
1199
1847
  },
1200
1848
  children: [
1201
- yt,
1202
- /* @__PURE__ */ h(Ve, { ..._t }),
1203
- /* @__PURE__ */ h(Be, { ...vt })
1849
+ gt,
1850
+ /* @__PURE__ */ g(Zt, { ...mt }),
1851
+ /* @__PURE__ */ g(Tt, { ...ht })
1204
1852
  ]
1205
1853
  });
1206
- return !U && H ? e ? xt : St : /* @__PURE__ */ h(Re, {
1207
- id: W,
1854
+ return !ve && _e ? e ? vt : bt : /* @__PURE__ */ g(Vt, {
1855
+ id: ye,
1208
1856
  label: t,
1209
1857
  description: n,
1210
- error: ee,
1211
- required: je,
1212
- disabled: Ae,
1858
+ error: z,
1859
+ required: ke,
1860
+ disabled: Oe,
1213
1861
  bindControl: !1,
1214
- className: ve,
1215
- children: e ? xt : St
1862
+ className: me,
1863
+ children: e ? vt : bt
1216
1864
  });
1217
- }, {
1218
- Trigger: Ge,
1219
- Value: qe,
1220
- Icon: Je,
1221
- Content: Ke,
1222
- Search: Ye,
1223
- Group: Xe,
1224
- Label: Ze,
1225
- Item: Qe,
1226
- ItemIcon: $e,
1227
- ItemDescription: et,
1228
- Separator: tt,
1229
- Empty: nt,
1230
- Loading: rt
1231
- });
1232
- ut.displayName = "Select";
1233
- function dt(e) {
1234
- return typeof e == "string" || typeof e == "number" ? String(e) : "";
1865
+ };
1866
+ en.displayName = "SelectRoot";
1867
+ function tn(e, t) {
1868
+ 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 === " ";
1235
1869
  }
1236
1870
  //#endregion
1871
+ //#region src/components/Select/Trigger/SelectIcon.tsx
1872
+ var nn = ({ children: e, className: t }) => {
1873
+ let { triggerProps: n } = bt();
1874
+ return /* @__PURE__ */ g("span", {
1875
+ className: V(Y.arrow, { [Y.open]: n.isOpen }, t),
1876
+ "aria-hidden": "true",
1877
+ children: n.loading ? /* @__PURE__ */ g("span", { className: Y.spinner }) : e ?? n.endIcon ?? /* @__PURE__ */ g(y, {})
1878
+ });
1879
+ };
1880
+ nn.__velliraSelectPart = "icon", nn.displayName = "Select.Icon";
1881
+ //#endregion
1882
+ //#region src/components/Select/Trigger/SelectValue.tsx
1883
+ var rn = ({ children: e, className: t }) => {
1884
+ let { triggerProps: n } = bt();
1885
+ return /* @__PURE__ */ g("span", {
1886
+ className: V(Y.valueWrap, t),
1887
+ children: /* @__PURE__ */ g("span", {
1888
+ className: V(Y.value, { [Y.placeholder]: n.isPlaceholder }),
1889
+ children: e ?? n.displayText
1890
+ })
1891
+ });
1892
+ };
1893
+ rn.__velliraSelectPart = "value", rn.displayName = "Select.Value";
1894
+ //#endregion
1895
+ //#region src/components/Select/Select.tsx
1896
+ var an = Object.assign(en, {
1897
+ Trigger: Xt,
1898
+ Value: rn,
1899
+ Icon: nn,
1900
+ Content: wt,
1901
+ Search: At,
1902
+ Group: jt,
1903
+ Label: Mt,
1904
+ Item: St,
1905
+ ItemIcon: It,
1906
+ ItemDescription: Ft,
1907
+ ItemBadge: Pt,
1908
+ Separator: Nt,
1909
+ Empty: Ot,
1910
+ Loading: kt
1911
+ });
1912
+ an.displayName = "Select";
1913
+ //#endregion
1237
1914
  //#region src/components/Tabs/TabsContext.tsx
1238
- var ft = n(null), pt = () => {
1239
- let e = o(ft);
1915
+ var on = r(null), sn = () => {
1916
+ let e = s(on);
1240
1917
  if (!e) throw Error("Tabs components must be used inside Tabs");
1241
1918
  return e;
1242
- }, mt = {
1919
+ }, cn = {
1243
1920
  list: "_list_13hkl_1",
1244
1921
  vertical: "_vertical_13hkl_8"
1245
- }, ht = ({ children: e, className: t, ...n }) => {
1246
- let { orientation: r, appearance: i } = pt();
1247
- return /* @__PURE__ */ h("div", {
1922
+ }, ln = ({ children: e, className: t, ...n }) => {
1923
+ let { orientation: r, appearance: i } = sn();
1924
+ return /* @__PURE__ */ g("div", {
1248
1925
  ...n,
1249
1926
  role: "tablist",
1250
1927
  "aria-orientation": r,
1251
- className: z(mt.list, r === "vertical" && mt.vertical, i === "underline" && mt.underline, i === "pills" && mt.pills, t),
1928
+ className: V(cn.list, r === "vertical" && cn.vertical, i === "underline" && cn.underline, i === "pills" && cn.pills, t),
1252
1929
  children: e
1253
1930
  });
1254
1931
  };
1255
- ht.displayName = "TabsList";
1256
- var gt = {
1932
+ ln.displayName = "TabsList";
1933
+ var un = {
1257
1934
  panel: "_panel_1v1a9_1",
1258
1935
  visible: "_visible_1v1a9_10",
1259
1936
  vertical: "_vertical_1v1a9_14"
1260
- }, _t = ({ index: e, children: t, className: n }) => {
1261
- let { activeIndex: r, orientation: i } = pt(), [a, o] = d(!1), c = r === e;
1262
- return s(() => {
1263
- if (!c) {
1937
+ }, dn = ({ index: e, children: t, className: n }) => {
1938
+ let { activeIndex: r, orientation: i } = sn(), [a, o] = f(!1), s = r === e;
1939
+ return c(() => {
1940
+ if (!s) {
1264
1941
  o(!1);
1265
1942
  return;
1266
1943
  }
1267
1944
  let e = setTimeout(() => o(!0), 10);
1268
1945
  return () => clearTimeout(e);
1269
- }, [c]), /* @__PURE__ */ h("div", {
1946
+ }, [s]), /* @__PURE__ */ g("div", {
1270
1947
  role: "tabpanel",
1271
1948
  id: `tab-panel-${e}`,
1272
1949
  "aria-labelledby": `tab-${e}`,
1273
- hidden: !c,
1950
+ hidden: !s,
1274
1951
  tabIndex: 0,
1275
- className: z(gt.panel, a && gt.visible, i === "vertical" && gt.vertical, n),
1952
+ className: V(un.panel, a && un.visible, i === "vertical" && un.vertical, n),
1276
1953
  children: t
1277
1954
  });
1278
1955
  };
1279
- _t.displayName = "TabsPanel";
1280
- var vt = {
1956
+ dn.displayName = "TabsPanel";
1957
+ var fn = {
1281
1958
  tab: "_tab_qe8xc_1",
1282
1959
  iconOnly: "_iconOnly_qe8xc_27",
1283
1960
  tabIcon: "_tabIcon_qe8xc_31",
@@ -1286,11 +1963,11 @@ var vt = {
1286
1963
  underline: "_underline_qe8xc_60",
1287
1964
  pills: "_pills_qe8xc_92",
1288
1965
  vertical: "_vertical_qe8xc_106"
1289
- }, yt = r(({ index: e, children: t, className: n, disabled: r = !1, icon: i, onClick: o, onKeyDown: s, ...c }, l) => {
1290
- let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: m, onTabKeyDown: _ } = pt(), v = u === e, y = !!i, b = y && t == null;
1291
- return /* @__PURE__ */ g("button", {
1966
+ }, pn = i(({ index: e, children: t, className: n, disabled: r = !1, icon: i, onClick: a, onKeyDown: s, ...c }, l) => {
1967
+ let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: m, onTabKeyDown: h } = sn(), v = u === e, y = !!i, b = y && t == null;
1968
+ return /* @__PURE__ */ _("button", {
1292
1969
  type: "button",
1293
- ref: a((t) => {
1970
+ ref: o((t) => {
1294
1971
  m(e, t), typeof l == "function" ? l(t) : l && (l.current = t);
1295
1972
  }, [
1296
1973
  m,
@@ -1303,70 +1980,70 @@ var vt = {
1303
1980
  id: `tab-${e}`,
1304
1981
  disabled: r,
1305
1982
  tabIndex: v ? 0 : -1,
1306
- className: z(vt.tab, vt[p], f === "vertical" && vt.vertical, y && vt.withIcon, b && vt.iconOnly, n),
1983
+ className: V(fn.tab, fn[p], f === "vertical" && fn.vertical, y && fn.withIcon, b && fn.iconOnly, n),
1307
1984
  onClick: (t) => {
1308
- r || (d(e), o?.(t));
1985
+ r || (d(e), a?.(t));
1309
1986
  },
1310
1987
  onKeyDown: (e) => {
1311
- _(e), s?.(e);
1988
+ h(e), s?.(e);
1312
1989
  },
1313
1990
  ...c,
1314
- children: [y && /* @__PURE__ */ h("span", {
1315
- className: vt.tabIcon,
1991
+ children: [y && /* @__PURE__ */ g("span", {
1992
+ className: fn.tabIcon,
1316
1993
  "aria-hidden": "true",
1317
1994
  children: i
1318
- }), t != null && /* @__PURE__ */ h("span", {
1319
- className: vt.label,
1995
+ }), t != null && /* @__PURE__ */ g("span", {
1996
+ className: fn.label,
1320
1997
  children: t
1321
1998
  })]
1322
1999
  });
1323
2000
  });
1324
- yt.displayName = "Tab";
1325
- var bt = {
2001
+ pn.displayName = "Tab";
2002
+ var mn = {
1326
2003
  tabs: "_tabs_uqy7q_1",
1327
2004
  vertical: "_vertical_uqy7q_5"
1328
- }, xt = ({ children: e, activeIndex: t, defaultActiveIndex: n = 0, onChange: r, orientation: i = "horizontal", appearance: o = "default", className: s }) => {
1329
- let { activeIndex: c, setActiveIndex: l } = M({
2005
+ }, hn = ({ children: e, activeIndex: t, defaultActiveIndex: n = 0, onChange: r, orientation: i = "horizontal", appearance: a = "default", className: s }) => {
2006
+ let { activeIndex: c, setActiveIndex: l } = R({
1330
2007
  activeIndex: t,
1331
2008
  defaultActiveIndex: n,
1332
2009
  onChange: r
1333
- }), d = u([]), f = a((e, t) => {
1334
- d.current[e] = t;
1335
- }, []), { onKeyDown: p } = N({
2010
+ }), u = d([]), f = o((e, t) => {
2011
+ u.current[e] = t;
2012
+ }, []), { onKeyDown: p } = ee({
1336
2013
  activeIndex: c,
1337
2014
  setActiveIndex: l,
1338
- tabRefs: d,
2015
+ tabRefs: u,
1339
2016
  orientation: i,
1340
2017
  onNavigate: (e) => {
1341
- d.current[e]?.focus();
2018
+ u.current[e]?.focus();
1342
2019
  }
1343
2020
  }), m = {
1344
2021
  activeIndex: c,
1345
2022
  setActiveIndex: l,
1346
2023
  orientation: i,
1347
- appearance: o,
2024
+ appearance: a,
1348
2025
  registerTab: f,
1349
2026
  onTabKeyDown: p
1350
2027
  };
1351
- return /* @__PURE__ */ h(ft.Provider, {
2028
+ return /* @__PURE__ */ g(on.Provider, {
1352
2029
  value: m,
1353
- children: /* @__PURE__ */ h("div", {
1354
- className: z(bt.tabs, i === "vertical" && bt.vertical, s),
2030
+ children: /* @__PURE__ */ g("div", {
2031
+ className: V(mn.tabs, i === "vertical" && mn.vertical, s),
1355
2032
  children: e
1356
2033
  })
1357
2034
  });
1358
2035
  };
1359
- xt.displayName = "Tabs";
2036
+ hn.displayName = "Tabs";
1360
2037
  //#endregion
1361
2038
  //#region src/components/Tabs/index.ts
1362
- var St = Object.assign(xt, {
1363
- List: ht,
1364
- Tab: yt,
1365
- Panel: _t
1366
- }), Ct = {
2039
+ var gn = Object.assign(hn, {
2040
+ List: ln,
2041
+ Tab: pn,
2042
+ Panel: dn
2043
+ }), _n = {
1367
2044
  tooltip: "_tooltip_10opu_1",
1368
2045
  arrow: "_arrow_10opu_25"
1369
- }, wt = r(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
2046
+ }, vn = i(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
1370
2047
  let l = {
1371
2048
  top: "bottom",
1372
2049
  right: "left",
@@ -1379,65 +2056,65 @@ var St = Object.assign(xt, {
1379
2056
  top: i == null ? "" : `${i}px`,
1380
2057
  [l]: "-5px"
1381
2058
  };
1382
- return /* @__PURE__ */ g("div", {
2059
+ return /* @__PURE__ */ _("div", {
1383
2060
  ref: c,
1384
- className: z(Ct.tooltip, a),
2061
+ className: V(_n.tooltip, a),
1385
2062
  "data-placement": t,
1386
2063
  "data-state": "open",
1387
2064
  style: o,
1388
2065
  ...s,
1389
- children: [e, /* @__PURE__ */ h("div", {
2066
+ children: [e, /* @__PURE__ */ g("div", {
1390
2067
  ref: n,
1391
- className: Ct.arrow,
2068
+ className: _n.arrow,
1392
2069
  style: u
1393
2070
  })]
1394
2071
  });
1395
2072
  });
1396
- wt.displayName = "TooltipContent";
2073
+ vn.displayName = "TooltipContent";
1397
2074
  //#endregion
1398
2075
  //#region src/components/Tooltip/Tooltip.tsx
1399
- var Tt = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
2076
+ var yn = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
1400
2077
  open: 300,
1401
2078
  close: 100
1402
2079
  }, maxWidth: a = 250, className: o, onOpenChange: s }) => {
1403
- let [l, f] = d(!1), p = u(null), y = c(), { context: b, floatingStyles: x, middlewareData: S, setRef: C, setFloatingRef: w, placement: O } = re({
1404
- open: l,
2080
+ let [c, u] = f(!1), p = d(null), m = l(), { context: v, floatingStyles: y, middlewareData: b, setRef: x, setFloatingRef: S, placement: T } = Le({
2081
+ open: c,
1405
2082
  onOpenChange: (e) => {
1406
- r || (f(e), s?.(e));
2083
+ r || (u(e), s?.(e));
1407
2084
  },
1408
2085
  placement: t,
1409
- middleware: [v({ element: p })]
1410
- }), k = S.arrow?.x, A = S.arrow?.y, { getReferenceProps: j, getFloatingProps: M } = D([E(b, { delay: {
2086
+ middleware: [w({ element: p })]
2087
+ }), E = b.arrow?.x, D = b.arrow?.y, { getReferenceProps: O, getFloatingProps: k } = N([M(v, { delay: {
1411
2088
  open: i.open,
1412
2089
  close: i.close
1413
- } }), T(b)]);
1414
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
1415
- ref: C,
2090
+ } }), j(v)]);
2091
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
2092
+ ref: x,
1416
2093
  style: { display: "inline-flex" },
1417
- "aria-describedby": l ? y : void 0,
1418
- ...j(),
2094
+ "aria-describedby": c ? m : void 0,
2095
+ ...O(),
1419
2096
  children: e
1420
- }), /* @__PURE__ */ h(_, { children: l && n && /* @__PURE__ */ h(wt, {
1421
- id: y,
1422
- ref: w,
2097
+ }), /* @__PURE__ */ g(C, { children: c && n && /* @__PURE__ */ g(vn, {
2098
+ id: m,
2099
+ ref: S,
1423
2100
  content: n,
1424
2101
  arrowRef: p,
1425
- arrowX: k,
1426
- arrowY: A,
2102
+ arrowX: E,
2103
+ arrowY: D,
1427
2104
  role: "tooltip",
1428
2105
  style: {
1429
- ...x,
2106
+ ...y,
1430
2107
  maxWidth: typeof a == "number" ? `${a}px` : a
1431
2108
  },
1432
- placement: O,
2109
+ placement: T,
1433
2110
  className: o,
1434
- ...M()
2111
+ ...k()
1435
2112
  }) })] });
1436
2113
  };
1437
- Tt.displayName = "Tooltip";
2114
+ yn.displayName = "Tooltip";
1438
2115
  //#endregion
1439
2116
  //#region src/utils/devWarning.ts
1440
- var Et = (e, t) => {
2117
+ var bn = (e, t) => {
1441
2118
  process.env.NODE_ENV !== "production" && !e && console.warn(t);
1442
2119
  }, X = {
1443
2120
  button: "_button_2nghu_1",
@@ -1467,104 +2144,104 @@ var Et = (e, t) => {
1467
2144
  "button-spin": "_button-spin_2nghu_1",
1468
2145
  badge: "_badge_2nghu_786",
1469
2146
  shortcut: "_shortcut_2nghu_800"
1470
- }, Dt = r(({ children: e, color: n = "primary", appearance: r = "solid", size: a = "md", shape: o = "pill", type: s = "button", disabled: c = !1, loading: l = !1, loadingText: u, iconStart: d, iconEnd: f, spinner: p, 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: N, ...P }, F) => {
1471
- let I = S && i(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"]), B = c || l, te = l && u ? u : L, ne = u && L && !R && (typeof L == "string" || typeof L == "number") && (typeof u == "string" || typeof u == "number") ? String(l ? L : u) : void 0, re = O === "_blank" && !k ? "noreferrer noopener" : k, ie = z(X.button, X[n], X[r], X[a], X[o], C, {
1472
- [X.disabled]: B,
2147
+ }, xn = i(({ children: e, color: t = "primary", appearance: r = "solid", size: i = "md", shape: o = "pill", type: s = "button", disabled: c = !1, loading: l = !1, loadingText: u, iconStart: d, iconEnd: f, spinner: p, badge: m, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: N, ...P }, F) => {
2148
+ 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, {
2149
+ [X.disabled]: z,
1473
2150
  [X.loading]: l,
1474
2151
  [X.fullWidth]: b,
1475
2152
  [X.iconOnly]: R
1476
2153
  });
1477
- Et(!S || !D, "Button: pass href to the child element when using asChild."), Et(!S || !!I, "Button: asChild requires a single valid React element child."), Et(!R || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
1478
- let ae = (e) => {
2154
+ bn(!S || !D, "Button: pass href to the child element when using asChild."), bn(!S || !!I, "Button: asChild requires a single valid React element child."), bn(!R || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
2155
+ let ie = (e) => {
1479
2156
  e.preventDefault(), e.stopPropagation();
1480
- }, oe = (e) => {
1481
- if (B) {
1482
- ae(e);
2157
+ }, ae = (e) => {
2158
+ if (z) {
2159
+ ie(e);
1483
2160
  return;
1484
2161
  }
1485
2162
  I?.props.onClick?.(e), e.defaultPrevented || w?.(e);
1486
- }, V = /* @__PURE__ */ g(m, { children: [
1487
- l && (p ? /* @__PURE__ */ h("span", {
2163
+ }, H = /* @__PURE__ */ _(h, { children: [
2164
+ l && (p ? /* @__PURE__ */ g("span", {
1488
2165
  className: X.icon,
1489
2166
  "aria-hidden": "true",
1490
2167
  children: p
1491
- }) : /* @__PURE__ */ h("span", {
2168
+ }) : /* @__PURE__ */ g("span", {
1492
2169
  className: X.spinner,
1493
2170
  "aria-hidden": "true"
1494
2171
  })),
1495
- !l && d && /* @__PURE__ */ h("span", {
2172
+ !l && d && /* @__PURE__ */ g("span", {
1496
2173
  className: X.icon,
1497
2174
  children: d
1498
2175
  }),
1499
- te && !R && /* @__PURE__ */ h("span", {
2176
+ B && !R && /* @__PURE__ */ g("span", {
1500
2177
  className: X.label,
1501
- "data-measure": ne,
1502
- children: /* @__PURE__ */ h("span", {
2178
+ "data-measure": te,
2179
+ children: /* @__PURE__ */ g("span", {
1503
2180
  className: X.labelText,
1504
- children: te
2181
+ children: B
1505
2182
  })
1506
2183
  }),
1507
- _ && !R && /* @__PURE__ */ h("span", {
2184
+ m && !R && /* @__PURE__ */ g("span", {
1508
2185
  className: X.badge,
1509
- children: _
2186
+ children: m
1510
2187
  }),
1511
- v && !R && /* @__PURE__ */ h("span", {
2188
+ v && !R && /* @__PURE__ */ g("span", {
1512
2189
  className: X.shortcut,
1513
2190
  children: v
1514
2191
  }),
1515
- !l && f && /* @__PURE__ */ h("span", {
2192
+ !l && f && /* @__PURE__ */ g("span", {
1516
2193
  className: X.icon,
1517
2194
  children: f
1518
2195
  })
1519
2196
  ] });
1520
- return I ? t(I, {
2197
+ return I ? n(I, {
1521
2198
  ...P,
1522
2199
  ref: F,
1523
2200
  "aria-busy": l || void 0,
1524
- "aria-disabled": B || void 0,
2201
+ "aria-disabled": z || void 0,
1525
2202
  "aria-label": T || I.props["aria-label"] || void 0,
1526
2203
  "aria-labelledby": E || I.props["aria-labelledby"] || void 0,
1527
- className: z(I.props.className, ie),
1528
- href: B ? void 0 : I.props.href,
1529
- onClick: oe,
1530
- tabIndex: B ? -1 : I.props.tabIndex,
2204
+ className: V(I.props.className, re),
2205
+ href: z ? void 0 : I.props.href,
2206
+ onClick: ae,
2207
+ tabIndex: z ? -1 : I.props.tabIndex,
1531
2208
  title: y || I.props.title,
1532
- children: V
1533
- }) : D ? /* @__PURE__ */ h("a", {
2209
+ children: H
2210
+ }) : D ? /* @__PURE__ */ g("a", {
1534
2211
  ref: F,
1535
- href: B ? void 0 : D,
2212
+ href: z ? void 0 : D,
1536
2213
  id: j,
1537
2214
  role: M,
1538
- tabIndex: B ? -1 : N,
2215
+ tabIndex: z ? -1 : N,
1539
2216
  target: O,
1540
- rel: re,
2217
+ rel: ne,
1541
2218
  download: A,
1542
- onClick: B ? ae : w,
1543
- "aria-disabled": B || void 0,
2219
+ onClick: z ? ie : w,
2220
+ "aria-disabled": z || void 0,
1544
2221
  "aria-label": T || void 0,
1545
2222
  "aria-labelledby": E || void 0,
1546
2223
  "aria-busy": l || void 0,
1547
- className: ie,
2224
+ className: re,
1548
2225
  title: y,
1549
- children: V
1550
- }) : /* @__PURE__ */ h("button", {
2226
+ children: H
2227
+ }) : /* @__PURE__ */ g("button", {
1551
2228
  ...P,
1552
2229
  ref: F,
1553
2230
  id: j,
1554
2231
  role: M,
1555
2232
  tabIndex: N,
1556
2233
  type: s,
1557
- disabled: B,
1558
- onClick: B ? void 0 : w,
2234
+ disabled: z,
2235
+ onClick: z ? void 0 : w,
1559
2236
  "aria-label": T || void 0,
1560
2237
  "aria-labelledby": E || void 0,
1561
2238
  "aria-busy": l || void 0,
1562
- className: ie,
2239
+ className: re,
1563
2240
  title: y,
1564
- children: V
2241
+ children: H
1565
2242
  });
1566
2243
  });
1567
- Dt.displayName = "Button";
2244
+ xn.displayName = "Button";
1568
2245
  var Z = {
1569
2246
  wrapper: "_wrapper_877rr_1",
1570
2247
  colorPrimary: "_colorPrimary_877rr_27",
@@ -1598,83 +2275,83 @@ var Z = {
1598
2275
  indeterminate: "_indeterminate_877rr_226",
1599
2276
  "checkbox-pop": "_checkbox-pop_877rr_1",
1600
2277
  disabled: "_disabled_877rr_354"
1601
- }, Ot = {
2278
+ }, Sn = {
1602
2279
  sm: Z.labelSm,
1603
2280
  md: Z.labelMd,
1604
2281
  lg: Z.labelLg
1605
- }, kt = {
2282
+ }, Cn = {
1606
2283
  sm: Z.wrapperSm,
1607
2284
  md: Z.wrapperMd,
1608
2285
  lg: Z.wrapperLg
1609
- }, At = {
2286
+ }, wn = {
1610
2287
  sm: Z.containerSm,
1611
2288
  md: Z.containerMd,
1612
2289
  lg: Z.containerLg
1613
- }, jt = {
2290
+ }, Tn = {
1614
2291
  primary: Z.colorPrimary,
1615
2292
  neutral: Z.colorNeutral,
1616
2293
  success: Z.colorSuccess,
1617
2294
  warning: Z.colorWarning,
1618
2295
  danger: Z.colorDanger
1619
- }, Mt = r(({ id: e, label: t, description: n, icon: r, indeterminateIcon: i, checked: o, size: l = "md", color: d = "primary", labelPosition: f = "end", defaultChecked: p = !1, disabled: m = !1, required: _ = !1, indeterminate: v = !1, className: y, wrapperClassName: b, onCheckedChange: x, error: S, "aria-label": C, "aria-labelledby": w, "aria-describedby": T, ...E }, D) => {
1620
- let k = c(), A = e ?? k, j = u(null), M = !!S, N = n ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
1621
- T,
2296
+ }, En = i(({ id: e, label: t, description: n, icon: r, indeterminateIcon: i, checked: a, size: s = "md", color: u = "primary", labelPosition: f = "end", defaultChecked: p = !1, disabled: m = !1, required: h = !1, indeterminate: y = !1, className: b, wrapperClassName: x, onCheckedChange: S, error: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, ...D }, O) => {
2297
+ let k = l(), A = e ?? k, j = d(null), M = !!C, N = n ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
2298
+ E,
1622
2299
  N,
1623
2300
  F
1624
- ].filter(Boolean).join(" "), [L, R] = O({
1625
- value: o,
2301
+ ].filter(Boolean).join(" "), [L, R] = P({
2302
+ value: a,
1626
2303
  defaultValue: p,
1627
- onChange: x
1628
- }), ee = a((e) => {
1629
- if (j.current = e, typeof D == "function") {
1630
- D(e);
2304
+ onChange: S
2305
+ }), ee = o((e) => {
2306
+ if (j.current = e, typeof O == "function") {
2307
+ O(e);
1631
2308
  return;
1632
2309
  }
1633
- D && (D.current = e);
1634
- }, [D]);
1635
- s(() => {
1636
- j.current && (j.current.indeterminate = v);
1637
- }, [v]);
1638
- let B = (e) => {
2310
+ O && (O.current = e);
2311
+ }, [O]);
2312
+ c(() => {
2313
+ j.current && (j.current.indeterminate = y);
2314
+ }, [y]);
2315
+ let z = (e) => {
1639
2316
  R(e.target.checked);
1640
2317
  };
1641
- return Et(!!(t || C || w), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ g("div", {
1642
- className: z(Z.container, At[l], f === "start" && Z.containerLabelStart, y),
2318
+ return bn(!!(t || w || T), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ _("div", {
2319
+ className: V(Z.container, wn[s], f === "start" && Z.containerLabelStart, b),
1643
2320
  children: [
1644
- /* @__PURE__ */ g("label", {
2321
+ /* @__PURE__ */ _("label", {
1645
2322
  htmlFor: A,
1646
- className: z(Z.wrapper, kt[l], jt[d], f === "start" && Z.labelStart, !t && Z.iconOnly, m && Z.disabled, b),
2323
+ className: V(Z.wrapper, Cn[s], Tn[u], f === "start" && Z.labelStart, !t && Z.iconOnly, m && Z.disabled, x),
1647
2324
  children: [
1648
- /* @__PURE__ */ h("input", {
1649
- ...E,
2325
+ /* @__PURE__ */ g("input", {
2326
+ ...D,
1650
2327
  ref: ee,
1651
2328
  id: A,
1652
2329
  type: "checkbox",
1653
2330
  checked: L,
1654
2331
  disabled: m,
1655
- required: _,
1656
- onChange: B,
2332
+ required: h,
2333
+ onChange: z,
1657
2334
  className: Z.input,
1658
- "aria-label": C,
1659
- "aria-labelledby": w,
1660
- "aria-checked": v ? "mixed" : E["aria-checked"],
1661
- "aria-invalid": M ? !0 : E["aria-invalid"],
2335
+ "aria-label": w,
2336
+ "aria-labelledby": T,
2337
+ "aria-checked": y ? "mixed" : D["aria-checked"],
2338
+ "aria-invalid": M ? !0 : D["aria-invalid"],
1662
2339
  "aria-describedby": I || void 0
1663
2340
  }),
1664
- /* @__PURE__ */ h("span", {
1665
- className: z(Z.customCheckbox, M && Z.error, v && Z.indeterminate),
2341
+ /* @__PURE__ */ g("span", {
2342
+ className: V(Z.customCheckbox, M && Z.error, y && Z.indeterminate),
1666
2343
  "aria-hidden": "true",
1667
- children: v ? /* @__PURE__ */ h("span", {
1668
- className: z(Z.indeterminateMark, i && Z.customMark),
2344
+ children: y ? /* @__PURE__ */ g("span", {
2345
+ className: V(Z.indeterminateMark, i && Z.customMark),
1669
2346
  children: i
1670
- }) : L && /* @__PURE__ */ h("span", {
2347
+ }) : L && /* @__PURE__ */ g("span", {
1671
2348
  className: Z.checkmark,
1672
- children: r ?? /* @__PURE__ */ h(P, {})
2349
+ children: r ?? /* @__PURE__ */ g(v, {})
1673
2350
  })
1674
2351
  }),
1675
- t && /* @__PURE__ */ g("span", {
1676
- className: z(Z.label, Ot[l]),
1677
- children: [t, _ && /* @__PURE__ */ h("span", {
2352
+ t && /* @__PURE__ */ _("span", {
2353
+ className: V(Z.label, Sn[s]),
2354
+ children: [t, h && /* @__PURE__ */ g("span", {
1678
2355
  className: Z.requiredMark,
1679
2356
  "aria-hidden": "true",
1680
2357
  children: "*"
@@ -1682,20 +2359,20 @@ var Z = {
1682
2359
  })
1683
2360
  ]
1684
2361
  }),
1685
- n && /* @__PURE__ */ h("span", {
2362
+ n && /* @__PURE__ */ g("span", {
1686
2363
  id: N,
1687
2364
  className: Z.descriptionText,
1688
2365
  children: n
1689
2366
  }),
1690
- M && /* @__PURE__ */ h("span", {
2367
+ M && /* @__PURE__ */ g("span", {
1691
2368
  id: F,
1692
2369
  className: Z.errorText,
1693
- children: S
2370
+ children: C
1694
2371
  })
1695
2372
  ]
1696
2373
  });
1697
2374
  });
1698
- Mt.displayName = "Checkbox";
2375
+ En.displayName = "Checkbox";
1699
2376
  var Q = {
1700
2377
  inputGroup: "_inputGroup_151bq_1",
1701
2378
  primary: "_primary_151bq_29",
@@ -1737,7 +2414,7 @@ var Q = {
1737
2414
  toneDanger: "_toneDanger_151bq_873",
1738
2415
  toneMuted: "_toneMuted_151bq_877",
1739
2416
  toneInverse: "_toneInverse_151bq_881"
1740
- }, Nt = {
2417
+ }, Dn = {
1741
2418
  default: Q.toneDefault,
1742
2419
  primary: Q.tonePrimary,
1743
2420
  secondary: Q.toneSecondary,
@@ -1745,7 +2422,7 @@ var Q = {
1745
2422
  danger: Q.toneDanger,
1746
2423
  muted: Q.toneMuted,
1747
2424
  inverse: Q.toneInverse
1748
- }, Pt = (e = "text", t) => {
2425
+ }, On = (e = "text", t) => {
1749
2426
  if (t) return t;
1750
2427
  switch (e) {
1751
2428
  case "email": return "email";
@@ -1755,7 +2432,7 @@ var Q = {
1755
2432
  case "search": return "off";
1756
2433
  default: return;
1757
2434
  }
1758
- }, Ft = (e, t) => {
2435
+ }, kn = (e, t) => {
1759
2436
  let n = e.replace(/\D/g, ""), r = 0, i = "";
1760
2437
  for (let e of t) {
1761
2438
  if (e === "#") {
@@ -1767,136 +2444,136 @@ var Q = {
1767
2444
  r < n.length && (i += e);
1768
2445
  }
1769
2446
  return i;
1770
- }, It = (e, t) => t ? typeof t == "function" ? t(e) : Ft(e, t) : e, Lt = r(({ id: e, label: t, name: n, description: r, placeholder: i, value: o, defaultValue: s, type: l = "text", size: f, color: p = "primary", variant: _ = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: S = !1, className: C, wrapperClassName: w, autoComplete: T, readOnly: E = !1, clearable: D = !1, onClear: O, onValueChange: k, revealPassword: A = !1, showCounter: j = !1, startIcon: M, endIcon: N, startAddon: P, endAddon: F, prefix: I, suffix: R, 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, ...fe }, pe) => {
1771
- let me = c(), he = Ie(), ge = !!(t || r || v), _e = e ?? (ge ? void 0 : he?.controlId) ?? me, ve = u(null), [ye, be] = d(!1), [xe, H] = d(s ?? ""), U = o !== void 0, W = String((U ? o : xe) ?? ""), Se = te ? te(W) : W, Ce = W.length > 0, we = f ?? he?.size ?? "md", Te = y || !!v || !ge && !!he?.invalid, Ee = b || !ge && !!he?.disabled, De = x || !ge && !!he?.required, Oe = E || S, ke = l === "password", Ae = ke && A && ye ? "text" : l, je = M ?? (l === "search" ? /* @__PURE__ */ h(L, {}) : null), Me = N, Ne = Pt(l, T), G = S && !Ee, Pe = D && Ce && !Ee && !Oe && !G, Fe = A && ke && !Ee && !G && !Pe, K = !G && !Pe && !Fe && !!Me, Le = !!(j && V), q = r ? `${_e}-description` : void 0, ze = v ? `${_e}-error` : void 0, J = Le ? `${_e}-counter` : void 0, Be = [
1772
- le,
1773
- !ge && !le ? he?.ariaDescribedBy : void 0,
1774
- q,
2447
+ }, An = (e, t) => t ? typeof t == "function" ? t(e) : kn(e, t) : e, jn = i(({ id: e, label: t, name: n, description: r, placeholder: i, value: a, defaultValue: s, type: c = "text", size: u, color: p = "primary", variant: m = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: C = !1, className: w, wrapperClassName: T, autoComplete: E, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter: M = !1, startIcon: N, endIcon: P, startAddon: F, endAddon: I, prefix: L, suffix: R, clearIcon: ee, mask: z, format: B, parse: te, startIconTone: ne = "default", endIconTone: re = "default", clearIconTone: ie = "danger", autoFocus: ae, maxLength: H, onMouseEnter: U, onMouseLeave: oe, "aria-describedby": se, "aria-invalid": ce, "aria-labelledby": le, ...ue }, de) => {
2448
+ let fe = l(), pe = Rt(), me = !!(t || r || v), he = e ?? (me ? void 0 : pe?.controlId) ?? fe, ge = d(null), [W, _e] = f(!1), [ve, ye] = f(s ?? ""), be = a !== void 0, xe = String((be ? a : ve) ?? ""), Se = B ? B(xe) : xe, Ce = xe.length > 0, we = u ?? pe?.size ?? "md", Te = y || !!v || !me && !!pe?.invalid, Ee = b || !me && !!pe?.disabled, De = x || !me && !!pe?.required, Oe = D || C, ke = c === "password", Ae = ke && j && W ? "text" : c, je = N ?? (c === "search" ? /* @__PURE__ */ g(S, {}) : null), Me = P, Ne = On(c, E), Pe = C && !Ee, Fe = O && Ce && !Ee && !Oe && !Pe, Ie = j && ke && !Ee && !Pe && !Fe, Le = !Pe && !Fe && !Ie && !!Me, Re = !!(M && H), ze = r ? `${he}-description` : void 0, Be = v ? `${he}-error` : void 0, G = Re ? `${he}-counter` : void 0, K = [
2449
+ se,
2450
+ !me && !se ? pe?.ariaDescribedBy : void 0,
1775
2451
  ze,
1776
- J
1777
- ].filter(Boolean).join(" "), Y = ee ?? "×", Ve = !!(je || I), He = !!(Me || R || Pe || Fe || G), Ue = !!(je && I), We = !!(Me && R), Ge = !!(P || F), Ke = a((e) => {
1778
- if (ve.current = e, typeof pe == "function") {
1779
- pe(e);
2452
+ Be,
2453
+ G
2454
+ ].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) => {
2455
+ if (ge.current = e, typeof de == "function") {
2456
+ de(e);
1780
2457
  return;
1781
2458
  }
1782
- pe && (pe.current = e);
1783
- }, [pe]), qe = a((e) => {
1784
- let t = It(ne ? ne(e.target.value) : e.target.value, B);
1785
- U || H(t), k?.(t);
2459
+ de && (de.current = e);
2460
+ }, [de]), Je = o((e) => {
2461
+ let t = An(te ? te(e.target.value) : e.target.value, z);
2462
+ be || ye(t), A?.(t);
1786
2463
  }, [
1787
- U,
1788
- B,
1789
- k,
1790
- ne
1791
- ]), Je = a(() => {
1792
- U || H(""), k?.(""), O?.(), ve.current?.focus();
2464
+ be,
2465
+ z,
2466
+ A,
2467
+ te
2468
+ ]), Ye = o(() => {
2469
+ be || ye(""), A?.(""), k?.(), ge.current?.focus();
1793
2470
  }, [
1794
- U,
1795
- O,
1796
- k
1797
- ]), Ye = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
1798
- className: z(Q.inputGroup, Q[_], Q[p], {
1799
- [Q.hasAddons]: Ge,
2471
+ be,
2472
+ k,
2473
+ A
2474
+ ]), Xe = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
2475
+ className: V(Q.inputGroup, Q[m], Q[p], {
2476
+ [Q.hasAddons]: Ke,
1800
2477
  [Q.isDisabled]: Ee,
1801
2478
  [Q.isInvalid]: Te,
1802
- [Q.isLoading]: G
2479
+ [Q.isLoading]: Pe
1803
2480
  }),
1804
2481
  children: [
1805
- P && /* @__PURE__ */ h("span", {
2482
+ F && /* @__PURE__ */ g("span", {
1806
2483
  className: Q.addon,
1807
- children: P
2484
+ children: F
1808
2485
  }),
1809
- /* @__PURE__ */ g("div", {
1810
- className: z(Q.inputWrapper, {
1811
- [Q.hasLeftAdornment]: Ve,
1812
- [Q.hasRightAdornment]: He,
1813
- [Q.hasStartIconAndPrefix]: Ue,
1814
- [Q.hasEndIconAndSuffix]: We
2486
+ /* @__PURE__ */ _("div", {
2487
+ className: V(Q.inputWrapper, {
2488
+ [Q.hasLeftAdornment]: He,
2489
+ [Q.hasRightAdornment]: Ue,
2490
+ [Q.hasStartIconAndPrefix]: We,
2491
+ [Q.hasEndIconAndSuffix]: Ge
1815
2492
  }),
1816
2493
  children: [
1817
- je && /* @__PURE__ */ h("span", {
2494
+ je && /* @__PURE__ */ g("span", {
1818
2495
  "aria-hidden": "true",
1819
- className: z(Q.startAdornment, Nt[re]),
2496
+ className: V(Q.startAdornment, Dn[ne]),
1820
2497
  children: je
1821
2498
  }),
1822
- I && /* @__PURE__ */ h("span", {
2499
+ L && /* @__PURE__ */ g("span", {
1823
2500
  className: Q.prefix,
1824
- children: I
2501
+ children: L
1825
2502
  }),
1826
- /* @__PURE__ */ h("input", {
1827
- ...fe,
1828
- ref: Ke,
1829
- id: _e,
2503
+ /* @__PURE__ */ g("input", {
2504
+ ...ue,
2505
+ ref: qe,
2506
+ id: he,
1830
2507
  name: n,
1831
2508
  type: Ae,
1832
2509
  autoComplete: Ne,
1833
- className: z(Q.input, Q[we], { [Q.error]: Te }, C),
2510
+ className: V(Q.input, Q[we], { [Q.error]: Te }, w),
1834
2511
  value: Se,
1835
- onChange: qe,
2512
+ onChange: Je,
1836
2513
  placeholder: i,
1837
2514
  disabled: Ee,
1838
2515
  readOnly: Oe,
1839
2516
  required: De,
1840
- autoFocus: oe,
1841
- maxLength: V,
1842
- "aria-invalid": Te ? !0 : ue,
1843
- "aria-labelledby": de ?? (ge ? void 0 : he?.ariaLabelledBy),
1844
- "aria-describedby": Be || void 0,
1845
- "aria-busy": S || void 0,
1846
- onMouseEnter: se,
1847
- onMouseLeave: ce
2517
+ autoFocus: ae,
2518
+ maxLength: H,
2519
+ "aria-invalid": Te ? !0 : ce,
2520
+ "aria-labelledby": le ?? (me ? void 0 : pe?.ariaLabelledBy),
2521
+ "aria-describedby": K || void 0,
2522
+ "aria-busy": C || void 0,
2523
+ onMouseEnter: U,
2524
+ onMouseLeave: oe
1848
2525
  }),
1849
- R && /* @__PURE__ */ h("span", {
2526
+ R && /* @__PURE__ */ g("span", {
1850
2527
  className: Q.suffix,
1851
2528
  children: R
1852
2529
  }),
1853
- /* @__PURE__ */ g("div", {
2530
+ /* @__PURE__ */ _("div", {
1854
2531
  className: Q.endSlot,
1855
2532
  children: [
1856
- G && /* @__PURE__ */ h("span", {
2533
+ Pe && /* @__PURE__ */ g("span", {
1857
2534
  className: Q.spinner,
1858
2535
  "aria-hidden": "true",
1859
2536
  "data-testid": "input-spinner"
1860
2537
  }),
1861
- Fe && /* @__PURE__ */ h("button", {
2538
+ Ie && /* @__PURE__ */ g("button", {
1862
2539
  type: "button",
1863
2540
  className: Q.iconButton,
1864
- onClick: () => be((e) => !e),
1865
- "aria-label": ye ? "Hide password" : "Show password",
1866
- children: ye ? "Hide" : "Show"
2541
+ onClick: () => _e((e) => !e),
2542
+ "aria-label": W ? "Hide password" : "Show password",
2543
+ children: W ? "Hide" : "Show"
1867
2544
  }),
1868
- Pe && /* @__PURE__ */ h("button", {
2545
+ Fe && /* @__PURE__ */ g("button", {
1869
2546
  type: "button",
1870
- className: z(Q.clearButton, Nt[ae]),
1871
- onClick: Je,
2547
+ className: V(Q.clearButton, Dn[ie]),
2548
+ onClick: Ye,
1872
2549
  "aria-label": "Clear input",
1873
- children: Y
2550
+ children: Ve
1874
2551
  }),
1875
- K && Me && /* @__PURE__ */ h("span", {
2552
+ Le && Me && /* @__PURE__ */ g("span", {
1876
2553
  "aria-hidden": "true",
1877
- className: z(Q.endAdornment, Nt[ie]),
2554
+ className: V(Q.endAdornment, Dn[re]),
1878
2555
  children: Me
1879
2556
  })
1880
2557
  ]
1881
2558
  })
1882
2559
  ]
1883
2560
  }),
1884
- F && /* @__PURE__ */ h("span", {
2561
+ I && /* @__PURE__ */ g("span", {
1885
2562
  className: Q.addon,
1886
- children: F
2563
+ children: I
1887
2564
  })
1888
2565
  ]
1889
- }), Le && /* @__PURE__ */ g("div", {
1890
- id: J,
2566
+ }), Re && /* @__PURE__ */ _("div", {
2567
+ id: G,
1891
2568
  className: Q.counter,
1892
2569
  children: [
1893
- W.length,
2570
+ xe.length,
1894
2571
  " / ",
1895
- V
2572
+ H
1896
2573
  ]
1897
2574
  })] });
1898
- return !ge && he ? Ye : /* @__PURE__ */ h(Re, {
1899
- id: _e,
2575
+ return !me && pe ? Xe : /* @__PURE__ */ g(Vt, {
2576
+ id: he,
1900
2577
  label: t,
1901
2578
  description: r,
1902
2579
  error: v,
@@ -1904,12 +2581,12 @@ var Q = {
1904
2581
  disabled: Ee,
1905
2582
  invalid: Te,
1906
2583
  size: we,
1907
- className: w,
2584
+ className: T,
1908
2585
  bindControl: !1,
1909
- children: Ye
2586
+ children: Xe
1910
2587
  });
1911
2588
  });
1912
- Lt.displayName = "Input";
2589
+ jn.displayName = "Input";
1913
2590
  var $ = {
1914
2591
  root: "_root_qb9nm_1",
1915
2592
  invalid: "_invalid_qb9nm_27",
@@ -1931,89 +2608,89 @@ var $ = {
1931
2608
  customIcon: "_customIcon_qb9nm_216",
1932
2609
  content: "_content_qb9nm_335",
1933
2610
  error: "_error_qb9nm_352"
1934
- }, Rt = {
2611
+ }, Mn = {
1935
2612
  primary: $.colorPrimary,
1936
2613
  neutral: $.colorNeutral,
1937
2614
  success: $.colorSuccess,
1938
2615
  warning: $.colorWarning,
1939
2616
  danger: $.colorDanger
1940
- }, zt = r(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: a, color: o, error: s, onCheckedChange: l, label: u, description: d, icon: f, wrapperClassName: p, className: m, id: _, name: v, "aria-describedby": y, ...b }, x) => {
1941
- let S = Ne(), C = c(), w = _ ?? C, T = d ? `${w}-description` : void 0, E = s ? `${w}-error` : void 0, D = [
2617
+ }, Nn = i(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: a, color: o, error: s, onCheckedChange: c, label: u, description: d, icon: f, wrapperClassName: p, className: m, id: h, name: v, "aria-describedby": y, ...b }, x) => {
2618
+ let S = ht(), C = l(), w = h ?? C, T = d ? `${w}-description` : void 0, E = s ? `${w}-error` : void 0, D = [
1942
2619
  T,
1943
2620
  E,
1944
2621
  S?.describedBy,
1945
2622
  y
1946
- ].filter(Boolean).join(" ") || void 0, k = S !== null, [A, j] = O({
2623
+ ].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = P({
1947
2624
  value: t,
1948
2625
  defaultValue: n,
1949
- onChange: l
1950
- }), M = k ? S.value === e : A, N = !!S?.disabled || r, P = !!S?.required || i, F = S?.name ?? v, I = !!(s || S?.invalid), L = a ?? S?.size ?? "md", R = o ?? S?.color ?? "primary", ee = (t) => {
1951
- if (!N) {
1952
- if (k) {
2626
+ onChange: c
2627
+ }), 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) => {
2628
+ if (!M) {
2629
+ if (O) {
1953
2630
  S.onValueChange(e);
1954
2631
  return;
1955
2632
  }
1956
- j(t.currentTarget.checked);
2633
+ A(t.currentTarget.checked);
1957
2634
  }
1958
2635
  };
1959
- return /* @__PURE__ */ g("div", {
1960
- className: z($.root, $[L], I && $.invalid, N && $.disabled, Rt[R], m),
1961
- children: [/* @__PURE__ */ g("label", {
2636
+ return /* @__PURE__ */ _("div", {
2637
+ className: V($.root, $[L], I && $.invalid, M && $.disabled, Mn[R], m),
2638
+ children: [/* @__PURE__ */ _("label", {
1962
2639
  htmlFor: w,
1963
- className: z($.wrapper, p),
2640
+ className: V($.wrapper, p),
1964
2641
  children: [
1965
- /* @__PURE__ */ h("input", {
2642
+ /* @__PURE__ */ g("input", {
1966
2643
  ...b,
1967
2644
  ref: x,
1968
2645
  id: w,
1969
2646
  type: "radio",
1970
2647
  name: F,
1971
2648
  value: e,
1972
- checked: M,
1973
- disabled: N,
1974
- required: P,
2649
+ checked: j,
2650
+ disabled: M,
2651
+ required: N,
1975
2652
  "aria-invalid": I || void 0,
1976
2653
  "aria-describedby": D,
1977
2654
  className: $.input,
1978
2655
  onChange: ee
1979
2656
  }),
1980
- /* @__PURE__ */ h("span", {
2657
+ /* @__PURE__ */ g("span", {
1981
2658
  className: $.control,
1982
2659
  "aria-hidden": "true",
1983
- children: /* @__PURE__ */ h("span", {
1984
- className: z($.indicator, f && $.customIcon),
2660
+ children: /* @__PURE__ */ g("span", {
2661
+ className: V($.indicator, f && $.customIcon),
1985
2662
  children: f
1986
2663
  })
1987
2664
  }),
1988
- (u || d) && /* @__PURE__ */ g("span", {
2665
+ (u || d) && /* @__PURE__ */ _("span", {
1989
2666
  className: $.content,
1990
- children: [u && /* @__PURE__ */ h("span", {
2667
+ children: [u && /* @__PURE__ */ g("span", {
1991
2668
  className: $.label,
1992
2669
  children: u
1993
- }), d && /* @__PURE__ */ h("span", {
2670
+ }), d && /* @__PURE__ */ g("span", {
1994
2671
  id: T,
1995
2672
  className: $.description,
1996
2673
  children: d
1997
2674
  })]
1998
2675
  })
1999
2676
  ]
2000
- }), s && /* @__PURE__ */ h("div", {
2677
+ }), s && /* @__PURE__ */ g("div", {
2001
2678
  id: E,
2002
2679
  className: $.error,
2003
2680
  children: s
2004
2681
  })]
2005
2682
  });
2006
2683
  });
2007
- zt.displayName = "Radio";
2684
+ Nn.displayName = "Radio";
2008
2685
  //#endregion
2009
2686
  //#region src/theme/ThemeContext.ts
2010
- var Bt = n(null), Vt = (e) => e === "highContrast" ? "high-contrast" : e, Ht = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
2011
- let [i, a] = O({
2687
+ var Pn = r(null), Fn = (e) => e === "highContrast" ? "high-contrast" : e, In = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
2688
+ let [i, a] = P({
2012
2689
  value: e,
2013
2690
  defaultValue: t,
2014
2691
  onChange: n
2015
- }), o = Vt(i);
2016
- s(() => {
2692
+ }), o = Fn(i);
2693
+ c(() => {
2017
2694
  if (typeof document > "u") return;
2018
2695
  let { documentElement: e } = document, t = e.dataset.velliraTheme;
2019
2696
  return e.dataset.velliraTheme = o, () => {
@@ -2024,25 +2701,25 @@ var Bt = n(null), Vt = (e) => e === "highContrast" ? "high-contrast" : e, Ht = (
2024
2701
  e.dataset.velliraTheme = t;
2025
2702
  };
2026
2703
  }, [o]);
2027
- let c = l(() => ({
2704
+ let s = u(() => ({
2028
2705
  theme: i,
2029
2706
  setTheme: a
2030
2707
  }), [i, a]);
2031
- return /* @__PURE__ */ h(Bt.Provider, {
2032
- value: c,
2033
- children: /* @__PURE__ */ h("div", {
2708
+ return /* @__PURE__ */ g(Pn.Provider, {
2709
+ value: s,
2710
+ children: /* @__PURE__ */ g("div", {
2034
2711
  "data-vellira-theme": o,
2035
2712
  children: r
2036
2713
  })
2037
2714
  });
2038
2715
  };
2039
- Ht.displayName = "ThemeProvider";
2716
+ In.displayName = "ThemeProvider";
2040
2717
  //#endregion
2041
2718
  //#region src/theme/useTheme.ts
2042
- function Ut() {
2043
- let e = o(Bt);
2719
+ function Ln() {
2720
+ let e = s(Pn);
2044
2721
  if (!e) throw Error("useTheme must be used within ThemeProvider.");
2045
2722
  return e;
2046
2723
  }
2047
2724
  //#endregion
2048
- export { Dt as Button, Mt as Checkbox, ge as Dropdown, Re as FormField, Lt as Input, Ae as Modal, zt as Radio, Pe as RadioGroup, ut as Select, St as Tabs, Ht as ThemeProvider, Tt as Tooltip, Ut as useTheme };
2725
+ export { xn as Button, En as Checkbox, Ye as Dropdown, Vt as FormField, jn as Input, ft as Modal, Nn as Radio, _t as RadioGroup, an as Select, gn as Tabs, In as ThemeProvider, yn as Tooltip, Ln as useTheme };