@vellira-ui/react 2.39.5 → 2.41.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.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +831 -543
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import e from "clsx";
|
|
2
2
|
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
-
import { Children as i, Fragment as a, cloneElement as o, createContext as s, forwardRef as c, isValidElement as l, useCallback as u, useContext as d, useEffect as f, useId as p,
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { Check as
|
|
6
|
-
import { arrow as
|
|
3
|
+
import { Children as i, Fragment as a, cloneElement as o, createContext as s, forwardRef as c, isValidElement as l, useCallback as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
4
|
+
import { createPortal as v } from "react-dom";
|
|
5
|
+
import { Check as y, ChevronDown as b, ChevronRight as x, Close as S, Search as C } from "@vellira-ui/icons";
|
|
6
|
+
import { 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
7
|
//#region src/utils/cn.ts
|
|
8
|
-
var
|
|
8
|
+
var P = (...t) => e(t), F = { arrow: "_arrow_8b0vb_1" }, I = ({ className: e }) => /* @__PURE__ */ n("span", {
|
|
9
9
|
"aria-hidden": "true",
|
|
10
|
-
className:
|
|
10
|
+
className: P(F.arrow, e)
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
I.__velliraDropdownPart = "arrow", I.displayName = "Dropdown.Arrow";
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/components/Dropdown/internal/DropdownCollection.ts
|
|
15
|
-
function
|
|
15
|
+
function L(e, t) {
|
|
16
16
|
let n = () => null;
|
|
17
17
|
return n.__velliraDropdownPart = e, n.displayName = t, n;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function R(e) {
|
|
20
20
|
let t = 0, n, r, a, o, s = [], c = [], u = (e) => `${e}-${t++}`;
|
|
21
21
|
function d(e) {
|
|
22
22
|
c.push(e), s.push({
|
|
@@ -96,7 +96,7 @@ function L(e) {
|
|
|
96
96
|
type: "item",
|
|
97
97
|
id: u("item"),
|
|
98
98
|
props: t,
|
|
99
|
-
label:
|
|
99
|
+
label: B(t.children),
|
|
100
100
|
disabled: t.disabled
|
|
101
101
|
});
|
|
102
102
|
return;
|
|
@@ -107,7 +107,7 @@ function L(e) {
|
|
|
107
107
|
type: "checkbox",
|
|
108
108
|
id: u("checkbox"),
|
|
109
109
|
props: t,
|
|
110
|
-
label:
|
|
110
|
+
label: B(t.children),
|
|
111
111
|
disabled: t.disabled
|
|
112
112
|
});
|
|
113
113
|
return;
|
|
@@ -129,20 +129,20 @@ function L(e) {
|
|
|
129
129
|
props: n,
|
|
130
130
|
groupId: t.radioGroupId ?? u("radio-group"),
|
|
131
131
|
groupProps: t.radioGroupProps,
|
|
132
|
-
label:
|
|
132
|
+
label: B(n.children),
|
|
133
133
|
disabled: n.disabled
|
|
134
134
|
});
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
case "sub": {
|
|
138
|
-
let t = e.props, n =
|
|
138
|
+
let t = e.props, n = ee(t.children);
|
|
139
139
|
if (!n.trigger) return;
|
|
140
|
-
let r = n.trigger.props, i =
|
|
140
|
+
let r = n.trigger.props, i = R(n.content?.props.children);
|
|
141
141
|
d({
|
|
142
142
|
type: "subTrigger",
|
|
143
143
|
id: u("sub"),
|
|
144
144
|
props: r,
|
|
145
|
-
label:
|
|
145
|
+
label: B(r.children),
|
|
146
146
|
disabled: r.disabled,
|
|
147
147
|
content: n.content?.props.children,
|
|
148
148
|
subEntries: i.entries,
|
|
@@ -169,7 +169,7 @@ function L(e) {
|
|
|
169
169
|
trigger: n
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function z(e) {
|
|
173
173
|
let t, n, r, a, o = [];
|
|
174
174
|
return i.forEach(e, (e) => {
|
|
175
175
|
if (!l(e)) {
|
|
@@ -202,7 +202,7 @@ function R(e) {
|
|
|
202
202
|
shortcut: a
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function ee(e) {
|
|
206
206
|
let t, n;
|
|
207
207
|
return i.forEach(e, (e) => {
|
|
208
208
|
if (!l(e)) return;
|
|
@@ -213,7 +213,7 @@ function z(e) {
|
|
|
213
213
|
trigger: t
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function B(e) {
|
|
217
217
|
let t = [];
|
|
218
218
|
function n(e) {
|
|
219
219
|
i.forEach(e, (e) => {
|
|
@@ -230,7 +230,7 @@ function ee(e) {
|
|
|
230
230
|
}
|
|
231
231
|
//#endregion
|
|
232
232
|
//#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
|
|
233
|
-
var
|
|
233
|
+
var te = L("checkboxItem", "Dropdown.CheckboxItem"), ne = ({ active: e, enabled: t, content: n }) => {
|
|
234
234
|
f(() => {
|
|
235
235
|
if (!e || !t || !n) return;
|
|
236
236
|
let r = [], i = n.parentElement;
|
|
@@ -253,7 +253,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
253
253
|
n,
|
|
254
254
|
t
|
|
255
255
|
]);
|
|
256
|
-
},
|
|
256
|
+
}, re = () => {
|
|
257
257
|
let e = !1;
|
|
258
258
|
return {
|
|
259
259
|
preventDefault: () => {
|
|
@@ -263,7 +263,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
263
263
|
return e;
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
|
-
},
|
|
266
|
+
}, ie = (e) => {
|
|
267
267
|
let t = !1;
|
|
268
268
|
return {
|
|
269
269
|
originalEvent: e,
|
|
@@ -274,23 +274,23 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
274
274
|
return t;
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
|
-
},
|
|
277
|
+
}, ae = [
|
|
278
278
|
"a[href]",
|
|
279
279
|
"button:not([disabled])",
|
|
280
280
|
"textarea:not([disabled])",
|
|
281
281
|
"input:not([disabled])",
|
|
282
282
|
"select:not([disabled])",
|
|
283
283
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
284
|
-
].join(","),
|
|
285
|
-
(
|
|
286
|
-
},
|
|
284
|
+
].join(","), oe = (e) => Array.from(e.querySelectorAll(ae)).filter((e) => !e.hasAttribute("disabled")), V = (e) => {
|
|
285
|
+
(oe(e)[0] ?? e).focus();
|
|
286
|
+
}, se = ({ active: e, contentRef: t, enabled: n, initialFocus: r, finalFocus: i, restoreFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s }) => {
|
|
287
287
|
f(() => {
|
|
288
288
|
if (!e) return;
|
|
289
|
-
let n = document.activeElement, c = i?.current, l =
|
|
289
|
+
let n = document.activeElement, c = i?.current, l = re();
|
|
290
290
|
return o?.(l), l.defaultPrevented || queueMicrotask(() => {
|
|
291
|
-
r?.current?.focus(), !r?.current && t.current &&
|
|
291
|
+
r?.current?.focus(), !r?.current && t.current && V(t.current);
|
|
292
292
|
}), () => {
|
|
293
|
-
let e =
|
|
293
|
+
let e = re();
|
|
294
294
|
s?.(e), !(e.defaultPrevented || !a) && queueMicrotask(() => {
|
|
295
295
|
if (c) {
|
|
296
296
|
c.focus();
|
|
@@ -311,7 +311,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
311
311
|
if (!e || !n) return;
|
|
312
312
|
let r = (e) => {
|
|
313
313
|
if (e.key !== "Tab" || !t.current) return;
|
|
314
|
-
let n =
|
|
314
|
+
let n = oe(t.current);
|
|
315
315
|
if (n.length === 0) {
|
|
316
316
|
e.preventDefault(), t.current.focus();
|
|
317
317
|
return;
|
|
@@ -331,8 +331,8 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
331
331
|
t,
|
|
332
332
|
n
|
|
333
333
|
]);
|
|
334
|
-
},
|
|
335
|
-
let u =
|
|
334
|
+
}, ce = ({ active: e, contentRef: t, ignoreRefs: n = [], closeOnEscape: r, closeOnOutsidePress: i, isTopOverlay: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) => {
|
|
335
|
+
let u = g(n);
|
|
336
336
|
u.current = n, f(() => {
|
|
337
337
|
if (!e) return;
|
|
338
338
|
let t = (e) => {
|
|
@@ -351,7 +351,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
351
351
|
if (!e) return;
|
|
352
352
|
let n = (e) => {
|
|
353
353
|
if (!a() || e.target instanceof Node && [t, ...u.current].some((t) => t.current?.contains(e.target))) return;
|
|
354
|
-
let n =
|
|
354
|
+
let n = ie(e);
|
|
355
355
|
s?.(n), c?.(n), !(n.defaultPrevented || !i) && l();
|
|
356
356
|
};
|
|
357
357
|
return document.addEventListener("pointerdown", n), () => {
|
|
@@ -366,45 +366,45 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
366
366
|
s,
|
|
367
367
|
l
|
|
368
368
|
]);
|
|
369
|
-
},
|
|
369
|
+
}, le = [], ue = {
|
|
370
370
|
add(e) {
|
|
371
|
-
|
|
371
|
+
le = le.filter((t) => t !== e), le.push(e);
|
|
372
372
|
},
|
|
373
373
|
remove(e) {
|
|
374
|
-
|
|
374
|
+
le = le.filter((t) => t !== e);
|
|
375
375
|
},
|
|
376
376
|
isTop(e) {
|
|
377
|
-
return
|
|
377
|
+
return le[le.length - 1] === e;
|
|
378
378
|
}
|
|
379
|
-
},
|
|
380
|
-
if (e) return
|
|
381
|
-
|
|
379
|
+
}, de = ({ active: e, id: t }) => (f(() => {
|
|
380
|
+
if (e) return ue.add(t), () => {
|
|
381
|
+
ue.remove(t);
|
|
382
382
|
};
|
|
383
|
-
}, [e, t]), { isTopOverlay: u(() =>
|
|
383
|
+
}, [e, t]), { isTopOverlay: u(() => ue.isTop(t), [t]) }), H = 0, fe = "", pe = {
|
|
384
384
|
lock() {
|
|
385
|
-
typeof document > "u" || (
|
|
385
|
+
typeof document > "u" || (H === 0 && (fe = document.body.style.overflow, document.body.style.overflow = "hidden"), H += 1);
|
|
386
386
|
},
|
|
387
387
|
unlock() {
|
|
388
|
-
typeof document > "u" || (
|
|
388
|
+
typeof document > "u" || (H = Math.max(0, H - 1), H === 0 && (document.body.style.overflow = fe));
|
|
389
389
|
}
|
|
390
|
-
},
|
|
390
|
+
}, me = ({ active: e, enabled: t = !0 }) => {
|
|
391
391
|
f(() => {
|
|
392
|
-
if (!(!e || !t)) return
|
|
393
|
-
|
|
392
|
+
if (!(!e || !t)) return pe.lock(), () => {
|
|
393
|
+
pe.unlock();
|
|
394
394
|
};
|
|
395
395
|
}, [e, t]);
|
|
396
|
-
},
|
|
397
|
-
let [t, n] =
|
|
396
|
+
}, he = () => typeof document > "u" ? null : document.body, ge = ({ container: e } = {}) => {
|
|
397
|
+
let [t, n] = _(!1);
|
|
398
398
|
return f(() => {
|
|
399
399
|
n(!0);
|
|
400
|
-
}, []), t ? e ?? document.getElementById("overlay-root") ??
|
|
400
|
+
}, []), t ? e ?? document.getElementById("overlay-root") ?? he() : null;
|
|
401
401
|
}, U = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
402
|
-
let [r, i] =
|
|
402
|
+
let [r, i] = _(t), a = e !== void 0;
|
|
403
403
|
return [a ? e : r, u((e) => {
|
|
404
404
|
a || i(e), n?.(e);
|
|
405
405
|
}, [a, n])];
|
|
406
|
-
},
|
|
407
|
-
let l =
|
|
406
|
+
}, _e = ({ activeIndex: e, setActiveIndex: t, items: n, isOpen: r, onOpen: i, onSelect: a, onClose: o, getItemText: s, loop: c = !0 }) => {
|
|
407
|
+
let l = g({
|
|
408
408
|
value: "",
|
|
409
409
|
timeoutId: void 0
|
|
410
410
|
});
|
|
@@ -423,7 +423,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
423
423
|
}, [n, c]), p = u(() => n.findIndex((e) => !e.disabled), [n]), m = u(() => {
|
|
424
424
|
for (let e = n.length - 1; e >= 0; e--) if (!n[e].disabled) return e;
|
|
425
425
|
return -1;
|
|
426
|
-
}, [n]),
|
|
426
|
+
}, [n]), h = u((t) => {
|
|
427
427
|
if (!s || !t) return -1;
|
|
428
428
|
let r = t.toLocaleLowerCase(), i = e >= 0 ? e + 1 : 0;
|
|
429
429
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -469,7 +469,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
469
469
|
n.preventDefault(), l.current.timeoutId && clearTimeout(l.current.timeoutId), l.current.value += n.key, l.current.timeoutId = setTimeout(() => {
|
|
470
470
|
l.current.value = "", l.current.timeoutId = void 0;
|
|
471
471
|
}, 700);
|
|
472
|
-
let e =
|
|
472
|
+
let e = h(l.current.value);
|
|
473
473
|
e >= 0 && t(e);
|
|
474
474
|
}
|
|
475
475
|
break;
|
|
@@ -484,10 +484,10 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
484
484
|
d,
|
|
485
485
|
p,
|
|
486
486
|
m,
|
|
487
|
-
|
|
487
|
+
h
|
|
488
488
|
]) };
|
|
489
|
-
},
|
|
490
|
-
let [l, d] =
|
|
489
|
+
}, ve = ({ items: e, open: t, defaultOpen: n = !1, disabled: r = !1, onOpenChange: i, onSelect: a, getItemValue: o, getItemText: s, loop: c = !0 }) => {
|
|
490
|
+
let [l, d] = _(n), [p, m] = _(-1), h = t !== void 0, g = t ?? l, v = u(() => e.findIndex((e) => !e.disabled), [e]), y = u(() => {
|
|
491
491
|
for (let t = e.length - 1; t >= 0; t--) if (!e[t]?.disabled) return t;
|
|
492
492
|
return -1;
|
|
493
493
|
}, [e]), b = u((t, n) => {
|
|
@@ -498,8 +498,8 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
498
498
|
m(-1);
|
|
499
499
|
}, [v, e]);
|
|
500
500
|
f(() => {
|
|
501
|
-
b(
|
|
502
|
-
}, [
|
|
501
|
+
b(g);
|
|
502
|
+
}, [g, b]);
|
|
503
503
|
let x = u((e, t) => {
|
|
504
504
|
h || d(e), i?.(e), b(e, t);
|
|
505
505
|
}, [
|
|
@@ -513,10 +513,10 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
513
513
|
v,
|
|
514
514
|
x
|
|
515
515
|
]), C = u(() => {
|
|
516
|
-
|
|
517
|
-
}, [
|
|
516
|
+
g && x(!1);
|
|
517
|
+
}, [g, x]), w = u(() => {
|
|
518
518
|
if (!r) {
|
|
519
|
-
if (
|
|
519
|
+
if (g) {
|
|
520
520
|
x(!1);
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
@@ -524,7 +524,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
524
524
|
}
|
|
525
525
|
}, [
|
|
526
526
|
r,
|
|
527
|
-
|
|
527
|
+
g,
|
|
528
528
|
S,
|
|
529
529
|
x
|
|
530
530
|
]), T = u((t) => {
|
|
@@ -541,11 +541,11 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
541
541
|
p,
|
|
542
542
|
e,
|
|
543
543
|
T
|
|
544
|
-
]), { onKeyDown: D } =
|
|
544
|
+
]), { onKeyDown: D } = _e({
|
|
545
545
|
activeIndex: p,
|
|
546
546
|
setActiveIndex: m,
|
|
547
547
|
items: e,
|
|
548
|
-
isOpen:
|
|
548
|
+
isOpen: g,
|
|
549
549
|
onOpen: (e) => {
|
|
550
550
|
S(e.key === "ArrowUp" ? y() : v());
|
|
551
551
|
},
|
|
@@ -557,8 +557,8 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
557
557
|
return {
|
|
558
558
|
activeIndex: p,
|
|
559
559
|
setActiveIndex: m,
|
|
560
|
-
isOpen:
|
|
561
|
-
open:
|
|
560
|
+
isOpen: g,
|
|
561
|
+
open: g,
|
|
562
562
|
setOpen: x,
|
|
563
563
|
openDropdown: S,
|
|
564
564
|
closeDropdown: C,
|
|
@@ -570,7 +570,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
570
570
|
getFirstEnabledIndex: v,
|
|
571
571
|
getLastEnabledIndex: y
|
|
572
572
|
};
|
|
573
|
-
},
|
|
573
|
+
}, ye = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
574
574
|
let a = p(), o = p(), s = p(), [c, l] = U({
|
|
575
575
|
value: e,
|
|
576
576
|
defaultValue: t,
|
|
@@ -589,8 +589,8 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
589
589
|
titleId: o,
|
|
590
590
|
descriptionId: s
|
|
591
591
|
};
|
|
592
|
-
},
|
|
593
|
-
let [
|
|
592
|
+
}, be = ({ value: e, defaultValue: t, onValueChange: n, onChange: r, options: i, multiple: a = !1, maxSelected: o, closeOnSelect: s = !a, disabled: c = !1, open: l, defaultOpen: d = !1, onOpenChange: p }) => {
|
|
593
|
+
let [m, g] = U({
|
|
594
594
|
value: e,
|
|
595
595
|
defaultValue: t ?? (a ? [] : ""),
|
|
596
596
|
onChange: n ?? r
|
|
@@ -598,7 +598,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
598
598
|
value: l,
|
|
599
599
|
defaultValue: d,
|
|
600
600
|
onChange: p
|
|
601
|
-
}), [b, x] =
|
|
601
|
+
}), [b, x] = _(-1), S = h(() => Array.isArray(m) ? m : m ? [m] : [], [m]), C = h(() => i.find((e) => S.includes(e.value)), [i, S]), w = h(() => i.filter((e) => S.includes(e.value)), [i, S]), T = u(() => {
|
|
602
602
|
let e = i.findIndex((e) => S.includes(e.value) && !e.disabled);
|
|
603
603
|
return e >= 0 ? e : i.findIndex((e) => !e.disabled);
|
|
604
604
|
}, [i, S]), E = u(() => {
|
|
@@ -635,7 +635,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
635
635
|
]);
|
|
636
636
|
let k = u((e) => {
|
|
637
637
|
if (e === "") {
|
|
638
|
-
|
|
638
|
+
g(a ? [] : ""), D();
|
|
639
639
|
return;
|
|
640
640
|
}
|
|
641
641
|
let t = i.find((t) => t.value === e);
|
|
@@ -643,10 +643,10 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
643
643
|
if (a) {
|
|
644
644
|
if (!S.includes(e) && typeof o == "number" && S.length >= o) return;
|
|
645
645
|
let t = S.includes(e) ? S.filter((t) => t !== e) : [...S, e];
|
|
646
|
-
|
|
646
|
+
g(t), s && D();
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
|
|
649
|
+
g(e), x(i.indexOf(t)), D();
|
|
650
650
|
}
|
|
651
651
|
}, [
|
|
652
652
|
D,
|
|
@@ -655,7 +655,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
655
655
|
a,
|
|
656
656
|
i,
|
|
657
657
|
S,
|
|
658
|
-
|
|
658
|
+
g
|
|
659
659
|
]), A = u(() => {
|
|
660
660
|
let e = i[b];
|
|
661
661
|
e && k(e.value);
|
|
@@ -663,7 +663,7 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
663
663
|
b,
|
|
664
664
|
i,
|
|
665
665
|
k
|
|
666
|
-
]), { onKeyDown: j } =
|
|
666
|
+
]), { onKeyDown: j } = _e({
|
|
667
667
|
activeIndex: b,
|
|
668
668
|
setActiveIndex: x,
|
|
669
669
|
items: i,
|
|
@@ -674,9 +674,9 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
674
674
|
getItemText: (e) => e.label
|
|
675
675
|
});
|
|
676
676
|
return {
|
|
677
|
-
selectedValue:
|
|
677
|
+
selectedValue: m,
|
|
678
678
|
selectedValues: S,
|
|
679
|
-
setSelectedValue:
|
|
679
|
+
setSelectedValue: g,
|
|
680
680
|
selectedOption: C,
|
|
681
681
|
selectedOptions: w,
|
|
682
682
|
isOpen: v,
|
|
@@ -693,71 +693,22 @@ var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled:
|
|
|
693
693
|
selectActiveOption: A,
|
|
694
694
|
onKeyDown: j
|
|
695
695
|
};
|
|
696
|
-
},
|
|
696
|
+
}, W = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
697
697
|
let [r, i] = U({
|
|
698
698
|
value: e,
|
|
699
699
|
defaultValue: t,
|
|
700
700
|
onChange: n
|
|
701
701
|
});
|
|
702
702
|
return {
|
|
703
|
-
|
|
704
|
-
|
|
703
|
+
value: r,
|
|
704
|
+
setValue: i
|
|
705
705
|
};
|
|
706
|
-
},
|
|
707
|
-
let o = (e) => !!(e?.disabled || e?.props?.disabled), s = (e, t) => {
|
|
708
|
-
let r = n.current.length;
|
|
709
|
-
if (!r) return e;
|
|
710
|
-
let i = e;
|
|
711
|
-
for (let e = 0; e < r; e++) {
|
|
712
|
-
i = (i + t + r) % r;
|
|
713
|
-
let e = n.current[i];
|
|
714
|
-
if (e && !o(e)) return i;
|
|
715
|
-
}
|
|
716
|
-
return e;
|
|
717
|
-
}, c = () => n.current.findIndex((e) => e && !o(e)), l = () => {
|
|
718
|
-
for (let e = n.current.length - 1; e >= 0; e--) {
|
|
719
|
-
let t = n.current[e];
|
|
720
|
-
if (t && !o(t)) return e;
|
|
721
|
-
}
|
|
722
|
-
return e;
|
|
723
|
-
}, u = e;
|
|
724
|
-
switch (a.key) {
|
|
725
|
-
case "ArrowLeft":
|
|
726
|
-
r === "horizontal" && (a.preventDefault(), u = s(e, -1));
|
|
727
|
-
break;
|
|
728
|
-
case "ArrowRight":
|
|
729
|
-
r === "horizontal" && (a.preventDefault(), u = s(e, 1));
|
|
730
|
-
break;
|
|
731
|
-
case "ArrowUp":
|
|
732
|
-
r === "vertical" && (a.preventDefault(), u = s(e, -1));
|
|
733
|
-
break;
|
|
734
|
-
case "ArrowDown":
|
|
735
|
-
r === "vertical" && (a.preventDefault(), u = s(e, 1));
|
|
736
|
-
break;
|
|
737
|
-
case "Home": {
|
|
738
|
-
a.preventDefault();
|
|
739
|
-
let t = c();
|
|
740
|
-
u = t === -1 ? e : t;
|
|
741
|
-
break;
|
|
742
|
-
}
|
|
743
|
-
case "End":
|
|
744
|
-
a.preventDefault(), u = l();
|
|
745
|
-
break;
|
|
746
|
-
default: return;
|
|
747
|
-
}
|
|
748
|
-
u !== e && (t(u), i?.(u));
|
|
749
|
-
}, [
|
|
750
|
-
e,
|
|
751
|
-
i,
|
|
752
|
-
r,
|
|
753
|
-
t,
|
|
754
|
-
n
|
|
755
|
-
]) }), xe = s(null), Se = ({ children: e, container: t = null }) => /* @__PURE__ */ n(xe.Provider, {
|
|
706
|
+
}, xe = s(null), Se = ({ children: e, container: t = null }) => /* @__PURE__ */ n(xe.Provider, {
|
|
756
707
|
value: t,
|
|
757
708
|
children: e
|
|
758
709
|
}), Ce = ({ children: e, container: t }) => {
|
|
759
|
-
let n = d(xe), r =
|
|
760
|
-
return r ?
|
|
710
|
+
let n = d(xe), r = ge({ container: t ?? n });
|
|
711
|
+
return r ? v(e, r) : null;
|
|
761
712
|
};
|
|
762
713
|
Ce.__velliraPortal = !0, Ce.displayName = "Portal", Se.displayName = "PortalProvider";
|
|
763
714
|
var we = {
|
|
@@ -772,7 +723,7 @@ var we = {
|
|
|
772
723
|
searchWrap: "_searchWrap_m7rnq_165",
|
|
773
724
|
search: "_search_m7rnq_165",
|
|
774
725
|
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
775
|
-
}, Te =
|
|
726
|
+
}, Te = L("empty", "Dropdown.Empty"), Ee = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
776
727
|
role: "presentation",
|
|
777
728
|
className: we.empty,
|
|
778
729
|
children: e ?? "No actions available"
|
|
@@ -780,7 +731,7 @@ var we = {
|
|
|
780
731
|
Ee.displayName = "DropdownEmptySurface";
|
|
781
732
|
//#endregion
|
|
782
733
|
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
783
|
-
var De =
|
|
734
|
+
var De = L("group", "Dropdown.Group"), Oe = () => null;
|
|
784
735
|
Oe.displayName = "DropdownGroupSurface";
|
|
785
736
|
//#endregion
|
|
786
737
|
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
@@ -821,9 +772,9 @@ var K = {
|
|
|
821
772
|
"dropdown-sub-in": "_dropdown-sub-in_1vj4n_1",
|
|
822
773
|
subLabel: "_subLabel_1vj4n_276",
|
|
823
774
|
subSeparator: "_subSeparator_1vj4n_284"
|
|
824
|
-
}, Fe =
|
|
825
|
-
let a = G(), o =
|
|
826
|
-
if (
|
|
775
|
+
}, Fe = L("item", "Dropdown.Item"), Ie = ({ item: e, itemIndex: i }) => {
|
|
776
|
+
let a = G(), o = g(void 0), [s, c] = _(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), l = a.activeIndex === i, u = a.openSubId === e.id, d = e.type === "checkbox", f = e.type === "radio", p = e.type === "subTrigger", m = d ? e.props.checked ?? s : f ? (e.groupProps?.value ?? a.radioValues[e.groupId]) === e.props.value : !1, h = a.loading || e.disabled, v = e.props, b = z(v.children), S = b.icon ?? v.icon, C = b.description ?? ("description" in v ? v.description : void 0), w = b.badge ?? ("badge" in v ? v.badge : void 0), T = b.shortcut ?? v.shortcut, E = b.content.length ? b.content : v.children, D = "color" in v ? v.color : void 0, O = e.type === "item" ? e.props.href : void 0, k = e.type === "item" ? e.props.target : void 0, A = e.type === "item" ? e.props.download : void 0, j = a.getItemId(i), M = d ? "menuitemcheckbox" : f ? "menuitemradio" : "menuitem", N = e.type === "item" && k === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, F = O ? "a" : "li", I = d || f, L = (t) => {
|
|
777
|
+
if (h) {
|
|
827
778
|
t.preventDefault();
|
|
828
779
|
return;
|
|
829
780
|
}
|
|
@@ -836,25 +787,25 @@ var K = {
|
|
|
836
787
|
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(F, {
|
|
837
788
|
id: j,
|
|
838
789
|
role: M,
|
|
839
|
-
href: F === "a" && !
|
|
840
|
-
target: F === "a" && !
|
|
841
|
-
rel: F === "a" ?
|
|
842
|
-
download: F === "a" && !
|
|
843
|
-
tabIndex:
|
|
844
|
-
"aria-disabled":
|
|
790
|
+
href: F === "a" && !h ? O : void 0,
|
|
791
|
+
target: F === "a" && !h ? k : void 0,
|
|
792
|
+
rel: F === "a" ? N : void 0,
|
|
793
|
+
download: F === "a" && !h ? A : void 0,
|
|
794
|
+
tabIndex: h ? -1 : 0,
|
|
795
|
+
"aria-disabled": h || void 0,
|
|
845
796
|
"aria-checked": d || f ? m : void 0,
|
|
846
797
|
"aria-haspopup": p ? "menu" : void 0,
|
|
847
798
|
"aria-expanded": p ? u : void 0,
|
|
848
799
|
"data-active": l || void 0,
|
|
849
800
|
"data-state": u ? "open" : void 0,
|
|
850
|
-
className:
|
|
801
|
+
className: P(K.item, K[a.size], {
|
|
851
802
|
[K.active]: l,
|
|
852
|
-
[K.disabled]:
|
|
803
|
+
[K.disabled]: h,
|
|
853
804
|
[K.checked]: m
|
|
854
|
-
}, D && D !== "default" ? K[D] : void 0,
|
|
805
|
+
}, D && D !== "default" ? K[D] : void 0, v.className),
|
|
855
806
|
onClick: L,
|
|
856
807
|
onMouseEnter: () => {
|
|
857
|
-
|
|
808
|
+
h || (a.setActiveIndex(i), p ? (window.clearTimeout(o.current), o.current = window.setTimeout(() => a.setOpenSubId(e.id), 120)) : (window.clearTimeout(o.current), a.setOpenSubId(void 0)));
|
|
858
809
|
},
|
|
859
810
|
onMouseLeave: () => {
|
|
860
811
|
window.clearTimeout(o.current);
|
|
@@ -863,7 +814,7 @@ var K = {
|
|
|
863
814
|
I && /* @__PURE__ */ n("span", {
|
|
864
815
|
className: K.indicator,
|
|
865
816
|
"aria-hidden": "true",
|
|
866
|
-
children: m ? /* @__PURE__ */ n(
|
|
817
|
+
children: m ? /* @__PURE__ */ n(y, {}) : null
|
|
867
818
|
}),
|
|
868
819
|
S && /* @__PURE__ */ n("span", {
|
|
869
820
|
className: K.itemIcon,
|
|
@@ -890,7 +841,7 @@ var K = {
|
|
|
890
841
|
p && /* @__PURE__ */ n("span", {
|
|
891
842
|
className: K.itemShortcut,
|
|
892
843
|
"aria-hidden": "true",
|
|
893
|
-
children: /* @__PURE__ */ n(
|
|
844
|
+
children: /* @__PURE__ */ n(x, {})
|
|
894
845
|
})
|
|
895
846
|
]
|
|
896
847
|
}), p && u && e.subEntries.length > 0 && /* @__PURE__ */ n("ul", {
|
|
@@ -925,7 +876,7 @@ function Le(e) {
|
|
|
925
876
|
};
|
|
926
877
|
}
|
|
927
878
|
function Re({ id: e, item: t }) {
|
|
928
|
-
let i = G(), [a, o] =
|
|
879
|
+
let i = G(), [a, o] = _(t.type === "checkbox" ? t.props.defaultChecked ?? !1 : !1), s = t.type === "checkbox", c = t.type === "radio", l = s ? t.props.checked ?? a : c ? (t.groupProps?.value ?? i.radioValues[t.groupId]) === t.props.value : !1, u = t.props, d = z(u.children), f = d.icon ?? u.icon, p = d.description ?? ("description" in u ? u.description : void 0), m = d.badge ?? ("badge" in u ? u.badge : void 0), h = d.shortcut ?? u.shortcut, g = d.content.length ? d.content : u.children, v = "color" in u ? u.color : void 0, b = i.loading || t.disabled, x = t.type === "item" ? t.props.href : void 0, S = t.type === "item" ? t.props.target : void 0, C = t.type === "item" ? t.props.download : void 0, w = s ? "menuitemcheckbox" : c ? "menuitemradio" : "menuitem", T = t.type === "item" && S === "_blank" && !t.props.rel ? "noreferrer noopener" : t.type === "item" ? t.props.rel : void 0, E = x ? "a" : "li", D = s || c, O = (e) => {
|
|
929
880
|
if (b) {
|
|
930
881
|
e.preventDefault();
|
|
931
882
|
return;
|
|
@@ -946,16 +897,16 @@ function Re({ id: e, item: t }) {
|
|
|
946
897
|
tabIndex: b ? -1 : 0,
|
|
947
898
|
"aria-disabled": b || void 0,
|
|
948
899
|
"aria-checked": s || c ? l : void 0,
|
|
949
|
-
className:
|
|
900
|
+
className: P(K.item, K[i.size], {
|
|
950
901
|
[K.disabled]: b,
|
|
951
902
|
[K.checked]: l
|
|
952
|
-
},
|
|
903
|
+
}, v && v !== "default" ? K[v] : void 0),
|
|
953
904
|
onClick: O,
|
|
954
905
|
children: [
|
|
955
906
|
D && /* @__PURE__ */ n("span", {
|
|
956
907
|
className: K.indicator,
|
|
957
908
|
"aria-hidden": "true",
|
|
958
|
-
children: l ? /* @__PURE__ */ n(
|
|
909
|
+
children: l ? /* @__PURE__ */ n(y, {}) : null
|
|
959
910
|
}),
|
|
960
911
|
f && /* @__PURE__ */ n("span", {
|
|
961
912
|
className: K.itemIcon,
|
|
@@ -965,7 +916,7 @@ function Re({ id: e, item: t }) {
|
|
|
965
916
|
className: K.itemText,
|
|
966
917
|
children: [/* @__PURE__ */ n("span", {
|
|
967
918
|
className: K.itemLabel,
|
|
968
|
-
children:
|
|
919
|
+
children: g
|
|
969
920
|
}), p && /* @__PURE__ */ n("span", {
|
|
970
921
|
className: K.itemDescription,
|
|
971
922
|
children: p
|
|
@@ -982,24 +933,24 @@ function Re({ id: e, item: t }) {
|
|
|
982
933
|
]
|
|
983
934
|
});
|
|
984
935
|
}
|
|
985
|
-
var ze = { group: "_group_aviwv_1" }, Be =
|
|
936
|
+
var ze = { group: "_group_aviwv_1" }, Be = L("label", "Dropdown.Label"), Ve = ({ children: e, className: t }) => /* @__PURE__ */ n("li", {
|
|
986
937
|
role: "presentation",
|
|
987
|
-
className:
|
|
938
|
+
className: P(ze.group, t),
|
|
988
939
|
children: e
|
|
989
940
|
});
|
|
990
|
-
|
|
941
|
+
Ve.displayName = "DropdownLabelSurface";
|
|
991
942
|
//#endregion
|
|
992
943
|
//#region src/components/Dropdown/Loading/DropdownLoading.tsx
|
|
993
|
-
var
|
|
944
|
+
var q = L("loading", "Dropdown.Loading"), He = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
994
945
|
role: "presentation",
|
|
995
946
|
"aria-live": "polite",
|
|
996
947
|
className: we.empty,
|
|
997
948
|
children: e ?? "Loading actions..."
|
|
998
949
|
});
|
|
999
950
|
He.displayName = "DropdownLoadingSurface";
|
|
1000
|
-
var Ue = { separator: "_separator_1v11r_1" }, We =
|
|
951
|
+
var Ue = { separator: "_separator_1v11r_1" }, We = L("separator", "Dropdown.Separator"), Ge = ({ className: e }) => /* @__PURE__ */ n("li", {
|
|
1001
952
|
role: "separator",
|
|
1002
|
-
className:
|
|
953
|
+
className: P(Ue.separator, e),
|
|
1003
954
|
"aria-hidden": "true"
|
|
1004
955
|
});
|
|
1005
956
|
Ge.displayName = "DropdownSeparatorSurface";
|
|
@@ -1008,7 +959,7 @@ Ge.displayName = "DropdownSeparatorSurface";
|
|
|
1008
959
|
var Ke = ({ className: e }) => {
|
|
1009
960
|
let t = G();
|
|
1010
961
|
if (!t.isOpen) return null;
|
|
1011
|
-
let i =
|
|
962
|
+
let i = P(we.dropdown, we[t.color], t.contentProps?.className, t.dropdownClassName, e), o = /* @__PURE__ */ r("ul", {
|
|
1012
963
|
ref: t.setContentRef,
|
|
1013
964
|
id: t.contentId,
|
|
1014
965
|
role: "menu",
|
|
@@ -1024,8 +975,8 @@ var Ke = ({ className: e }) => {
|
|
|
1024
975
|
"data-color": t.color,
|
|
1025
976
|
children: [t.searchable && /* @__PURE__ */ r("li", {
|
|
1026
977
|
role: "presentation",
|
|
1027
|
-
className:
|
|
1028
|
-
children: [/* @__PURE__ */ n(
|
|
978
|
+
className: P(we.searchWrap, t.searchProps?.className),
|
|
979
|
+
children: [/* @__PURE__ */ n(C, { "aria-hidden": "true" }), /* @__PURE__ */ n("input", {
|
|
1029
980
|
className: we.search,
|
|
1030
981
|
value: t.searchValue,
|
|
1031
982
|
placeholder: t.searchPlaceholder,
|
|
@@ -1036,7 +987,7 @@ var Ke = ({ className: e }) => {
|
|
|
1036
987
|
e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === "Escape" || e.stopPropagation();
|
|
1037
988
|
}
|
|
1038
989
|
})]
|
|
1039
|
-
}), t.loading ? /* @__PURE__ */ n(He, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(Ee, { children: t.noOptionsText }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ n(Oe, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ n(
|
|
990
|
+
}), t.loading ? /* @__PURE__ */ n(He, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(Ee, { children: t.noOptionsText }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ n(Oe, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ n(Ve, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ n(Ge, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ n(Ee, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ n(He, { children: e.props.children }, e.id) : e.type === "arrow" ? /* @__PURE__ */ n(I, { ...e.props }, e.id) : /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n(Ie, {
|
|
1040
991
|
item: e.item,
|
|
1041
992
|
itemIndex: e.itemIndex
|
|
1042
993
|
}) }, e.item.id)) : /* @__PURE__ */ n(Ee, {})]
|
|
@@ -1046,8 +997,8 @@ var Ke = ({ className: e }) => {
|
|
|
1046
997
|
Ke.__velliraDropdownPart = "content", Ke.displayName = "Dropdown.Content";
|
|
1047
998
|
//#endregion
|
|
1048
999
|
//#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
|
|
1049
|
-
var qe =
|
|
1050
|
-
let [t, n] =
|
|
1000
|
+
var qe = L("itemBadge", "Dropdown.ItemBadge"), Je = L("itemDescription", "Dropdown.ItemDescription"), Ye = L("itemIcon", "Dropdown.ItemIcon"), Xe = L("itemShortcut", "Dropdown.ItemShortcut"), Ze = L("radioGroup", "Dropdown.RadioGroup"), Qe = L("radioItem", "Dropdown.RadioItem"), $e = (e) => {
|
|
1001
|
+
let [t, n] = _(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
1051
1002
|
return f(() => {
|
|
1052
1003
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
1053
1004
|
let t = window.matchMedia(`(max-width: ${e}px)`), r = () => n(t.matches);
|
|
@@ -1056,19 +1007,19 @@ var qe = I("itemBadge", "Dropdown.ItemBadge"), Je = I("itemDescription", "Dropdo
|
|
|
1056
1007
|
};
|
|
1057
1008
|
}, [e]), t;
|
|
1058
1009
|
}, et = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, matchTriggerWidth: a = !1, avoidCollisions: o = !0, mobileSheetBreakpoint: s, middleware: c = [] } = {}) => {
|
|
1059
|
-
let l = $e(s), { refs: u, floatingStyles: d, update: p, context:
|
|
1010
|
+
let l = $e(s), { refs: u, floatingStyles: d, update: p, context: m, middlewareData: g, placement: _ } = A({
|
|
1060
1011
|
open: e,
|
|
1061
1012
|
onOpenChange: t,
|
|
1062
1013
|
placement: n,
|
|
1063
1014
|
strategy: r,
|
|
1064
1015
|
transform: !1,
|
|
1065
|
-
middleware:
|
|
1066
|
-
|
|
1067
|
-
...o ? [
|
|
1068
|
-
|
|
1016
|
+
middleware: h(() => [
|
|
1017
|
+
D(i),
|
|
1018
|
+
...o ? [E()] : [],
|
|
1019
|
+
k({ apply({ rects: e, elements: t }) {
|
|
1069
1020
|
!a || l || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
1070
1021
|
} }),
|
|
1071
|
-
...o ? [
|
|
1022
|
+
...o ? [O({ padding: 8 })] : [],
|
|
1072
1023
|
...c
|
|
1073
1024
|
], [
|
|
1074
1025
|
o,
|
|
@@ -1077,12 +1028,12 @@ var qe = I("itemBadge", "Dropdown.ItemBadge"), Je = I("itemDescription", "Dropdo
|
|
|
1077
1028
|
a,
|
|
1078
1029
|
i
|
|
1079
1030
|
]),
|
|
1080
|
-
whileElementsMounted:
|
|
1031
|
+
whileElementsMounted: T
|
|
1081
1032
|
});
|
|
1082
1033
|
return f(() => {
|
|
1083
1034
|
l && u.floating.current?.style.removeProperty("width");
|
|
1084
1035
|
}, [l, u.floating]), {
|
|
1085
|
-
context:
|
|
1036
|
+
context: m,
|
|
1086
1037
|
placement: _,
|
|
1087
1038
|
middlewareData: g,
|
|
1088
1039
|
floatingStyles: l ? {} : d,
|
|
@@ -1115,18 +1066,18 @@ function nt(...e) {
|
|
|
1115
1066
|
function rt(e) {
|
|
1116
1067
|
return typeof e == "number" ? `${e}px` : e;
|
|
1117
1068
|
}
|
|
1118
|
-
var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultOpen: i = !1, onOpenChange: a, size: o = "md", color: s = "primary", placement: c = "bottom-start", offset: l = 2, matchTriggerWidth: d = !1, minWidth:
|
|
1119
|
-
let ee = p(), B = `${ee}-trigger`, te = `${ee}-menu`, ne =
|
|
1069
|
+
var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultOpen: i = !1, onOpenChange: a, size: o = "md", color: s = "primary", placement: c = "bottom-start", offset: l = 2, matchTriggerWidth: d = !1, minWidth: m, maxWidth: v, portal: y = !0, avoidCollisions: b = !0, modal: x = !1, closeOnSelect: S = !0, loop: C = !0, disabled: w = !1, loading: T = !1, loadingText: E = "Loading actions...", searchable: D = !1, command: O = !1, searchValue: k, defaultSearchValue: A = "", searchPlaceholder: j, onSearch: M, empty: N, noOptionsText: F, triggerClassName: I, dropdownClassName: L, className: z }) => {
|
|
1070
|
+
let ee = p(), B = `${ee}-trigger`, te = `${ee}-menu`, ne = g(null), re = g(null), [ie, ae] = _(), [oe, V] = _({}), [se, le] = _(A), ue = k ?? se, H = h(() => R(e), [e]), fe = H.content?.props.command ?? !1, pe = D || O || fe || !!H.search, he = h(() => st(H.items), [H.items]), ge = h(() => H.items.map((e) => ({
|
|
1120
1071
|
disabled: e.disabled,
|
|
1121
1072
|
label: e.label
|
|
1122
|
-
})), [H.items]),
|
|
1123
|
-
|
|
1073
|
+
})), [H.items]), U = h(() => !pe || !ue.trim() ? H : ct(H, ue), [
|
|
1074
|
+
pe,
|
|
1124
1075
|
H,
|
|
1125
|
-
|
|
1126
|
-
]),
|
|
1076
|
+
ue
|
|
1077
|
+
]), _e = h(() => U.items.map((e) => ({
|
|
1127
1078
|
disabled: e.disabled,
|
|
1128
1079
|
label: e.label
|
|
1129
|
-
})), [
|
|
1080
|
+
})), [U.items]);
|
|
1130
1081
|
f(() => {
|
|
1131
1082
|
V((e) => {
|
|
1132
1083
|
let t = { ...e };
|
|
@@ -1135,13 +1086,13 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1135
1086
|
}), t;
|
|
1136
1087
|
});
|
|
1137
1088
|
}, [he]);
|
|
1138
|
-
let { activeIndex: ye, setActiveIndex: be, isOpen: W, closeDropdown: xe, toggleDropdown: Se, onKeyDown: Ce } =
|
|
1139
|
-
items:
|
|
1089
|
+
let { activeIndex: ye, setActiveIndex: be, isOpen: W, closeDropdown: xe, toggleDropdown: Se, onKeyDown: Ce } = ve({
|
|
1090
|
+
items: pe ? _e : ge,
|
|
1140
1091
|
open: t,
|
|
1141
1092
|
defaultOpen: i,
|
|
1142
1093
|
disabled: w,
|
|
1143
1094
|
onOpenChange: a,
|
|
1144
|
-
getItemValue: (e, t) => (
|
|
1095
|
+
getItemValue: (e, t) => (pe ? U.items : H.items)[t]?.id ?? "",
|
|
1145
1096
|
getItemText: (e) => e.label,
|
|
1146
1097
|
loop: C
|
|
1147
1098
|
}), { floatingStyles: we, setRef: Te, setFloatingRef: Ee } = et({
|
|
@@ -1157,11 +1108,11 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1157
1108
|
M,
|
|
1158
1109
|
k,
|
|
1159
1110
|
be
|
|
1160
|
-
]), { isTopOverlay: Oe } =
|
|
1111
|
+
]), { isTopOverlay: Oe } = de({
|
|
1161
1112
|
active: W,
|
|
1162
1113
|
id: te
|
|
1163
1114
|
});
|
|
1164
|
-
|
|
1115
|
+
me({
|
|
1165
1116
|
active: W,
|
|
1166
1117
|
enabled: x
|
|
1167
1118
|
});
|
|
@@ -1184,7 +1135,7 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1184
1135
|
S,
|
|
1185
1136
|
T
|
|
1186
1137
|
]), je = u((e) => {
|
|
1187
|
-
let t =
|
|
1138
|
+
let t = U.items[ye];
|
|
1188
1139
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1189
1140
|
e.preventDefault(), ae(t.id);
|
|
1190
1141
|
return;
|
|
@@ -1202,7 +1153,7 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1202
1153
|
Ce(e), e.key === "Escape" && ne.current?.focus();
|
|
1203
1154
|
}, [
|
|
1204
1155
|
ye,
|
|
1205
|
-
|
|
1156
|
+
U.items,
|
|
1206
1157
|
Ce,
|
|
1207
1158
|
ie,
|
|
1208
1159
|
Ae
|
|
@@ -1213,7 +1164,7 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1213
1164
|
}, [Te]), K = u((e) => {
|
|
1214
1165
|
re.current = e, Ee(e), e?.focus();
|
|
1215
1166
|
}, [Ee]);
|
|
1216
|
-
|
|
1167
|
+
ce({
|
|
1217
1168
|
active: W,
|
|
1218
1169
|
closeOnEscape: !0,
|
|
1219
1170
|
closeOnOutsidePress: !0,
|
|
@@ -1224,7 +1175,7 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1224
1175
|
});
|
|
1225
1176
|
let Fe = {
|
|
1226
1177
|
...we,
|
|
1227
|
-
minWidth: rt(
|
|
1178
|
+
minWidth: rt(m),
|
|
1228
1179
|
maxWidth: rt(v)
|
|
1229
1180
|
};
|
|
1230
1181
|
return /* @__PURE__ */ n(Ne, {
|
|
@@ -1246,24 +1197,24 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1246
1197
|
contentId: te,
|
|
1247
1198
|
contentProps: H.content?.props,
|
|
1248
1199
|
disabled: w,
|
|
1249
|
-
dropdownClassName:
|
|
1250
|
-
entries:
|
|
1200
|
+
dropdownClassName: L,
|
|
1201
|
+
entries: U.entries,
|
|
1251
1202
|
getItemId: (e) => `${te}-item-${e}`,
|
|
1252
1203
|
isOpen: W,
|
|
1253
|
-
items:
|
|
1204
|
+
items: U.items,
|
|
1254
1205
|
loading: T,
|
|
1255
1206
|
loadingText: E,
|
|
1256
|
-
noOptionsText:
|
|
1207
|
+
noOptionsText: N ?? F,
|
|
1257
1208
|
maxWidth: v,
|
|
1258
|
-
minWidth:
|
|
1209
|
+
minWidth: m,
|
|
1259
1210
|
openSubId: ie,
|
|
1260
1211
|
onKeyDown: je,
|
|
1261
1212
|
portal: !H.portal && y,
|
|
1262
1213
|
radioValues: oe,
|
|
1263
1214
|
searchPlaceholder: H.search?.props.placeholder ?? j ?? (O || fe ? "Type a command..." : "Search actions..."),
|
|
1264
1215
|
searchProps: H.search?.props,
|
|
1265
|
-
searchValue:
|
|
1266
|
-
searchable:
|
|
1216
|
+
searchValue: ue,
|
|
1217
|
+
searchable: pe,
|
|
1267
1218
|
selectItem: Ae,
|
|
1268
1219
|
setActiveIndex: be,
|
|
1269
1220
|
setContentRef: K,
|
|
@@ -1280,9 +1231,9 @@ var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultO
|
|
|
1280
1231
|
triggerId: B
|
|
1281
1232
|
},
|
|
1282
1233
|
children: /* @__PURE__ */ r("div", {
|
|
1283
|
-
className:
|
|
1234
|
+
className: P(it.wrapper, z),
|
|
1284
1235
|
"data-disabled": w || void 0,
|
|
1285
|
-
children: [H.trigger ?? null, H.portal ?? H.content ?? /* @__PURE__ */ n(Ke, { className:
|
|
1236
|
+
children: [H.trigger ?? null, H.portal ?? H.content ?? /* @__PURE__ */ n(Ke, { className: L })]
|
|
1286
1237
|
})
|
|
1287
1238
|
})
|
|
1288
1239
|
});
|
|
@@ -1316,7 +1267,7 @@ function ct(e, t) {
|
|
|
1316
1267
|
}
|
|
1317
1268
|
//#endregion
|
|
1318
1269
|
//#region src/components/Dropdown/Search/DropdownSearch.tsx
|
|
1319
|
-
var lt =
|
|
1270
|
+
var lt = L("search", "Dropdown.Search"), ut = L("subContent", "Dropdown.SubContent"), dt = L("subTrigger", "Dropdown.SubTrigger"), ft = L("sub", "Dropdown.Sub"), pt = {
|
|
1320
1271
|
button: "_button_bb3ib_1",
|
|
1321
1272
|
disabled: "_disabled_bb3ib_63",
|
|
1322
1273
|
arrow: "_arrow_bb3ib_71",
|
|
@@ -1342,7 +1293,7 @@ var ht = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
|
1342
1293
|
"aria-disabled": d || void 0,
|
|
1343
1294
|
"aria-expanded": c.isOpen,
|
|
1344
1295
|
"aria-haspopup": "menu",
|
|
1345
|
-
className:
|
|
1296
|
+
className: P(!u && pt.button, !u && pt[s.size], !u && pt[s.color], c.triggerClassName, a),
|
|
1346
1297
|
"data-state": c.isOpen ? "open" : "closed",
|
|
1347
1298
|
disabled: d || void 0,
|
|
1348
1299
|
onClick: tt(u?.props.onClick, c.onClick),
|
|
@@ -1350,7 +1301,7 @@ var ht = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
|
1350
1301
|
};
|
|
1351
1302
|
return u ? o(u, {
|
|
1352
1303
|
...f,
|
|
1353
|
-
className:
|
|
1304
|
+
className: P(u.props.className, a)
|
|
1354
1305
|
}) : /* @__PURE__ */ r("button", {
|
|
1355
1306
|
type: "button",
|
|
1356
1307
|
...f,
|
|
@@ -1358,9 +1309,9 @@ var ht = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
|
1358
1309
|
className: pt.label,
|
|
1359
1310
|
children: e
|
|
1360
1311
|
}), /* @__PURE__ */ n("span", {
|
|
1361
|
-
className:
|
|
1312
|
+
className: P(pt.arrow, { [pt.open]: c.isOpen }),
|
|
1362
1313
|
"aria-hidden": "true",
|
|
1363
|
-
children: /* @__PURE__ */ n(
|
|
1314
|
+
children: /* @__PURE__ */ n(b, {})
|
|
1364
1315
|
})]
|
|
1365
1316
|
});
|
|
1366
1317
|
};
|
|
@@ -1372,7 +1323,7 @@ var gt = Object.assign(at, {
|
|
|
1372
1323
|
Content: Ke,
|
|
1373
1324
|
Search: lt,
|
|
1374
1325
|
Item: Fe,
|
|
1375
|
-
CheckboxItem:
|
|
1326
|
+
CheckboxItem: te,
|
|
1376
1327
|
RadioGroup: Ze,
|
|
1377
1328
|
RadioItem: Qe,
|
|
1378
1329
|
Group: De,
|
|
@@ -1389,9 +1340,9 @@ var gt = Object.assign(at, {
|
|
|
1389
1340
|
Description: Je,
|
|
1390
1341
|
Badge: qe,
|
|
1391
1342
|
Shortcut: Xe,
|
|
1392
|
-
Arrow:
|
|
1343
|
+
Arrow: I,
|
|
1393
1344
|
Empty: Te,
|
|
1394
|
-
Loading:
|
|
1345
|
+
Loading: q
|
|
1395
1346
|
});
|
|
1396
1347
|
gt.displayName = "Dropdown";
|
|
1397
1348
|
//#endregion
|
|
@@ -1408,7 +1359,7 @@ var Ct = {
|
|
|
1408
1359
|
}, wt = ({ children: e, className: t }) => {
|
|
1409
1360
|
let r = bt();
|
|
1410
1361
|
return /* @__PURE__ */ n("div", {
|
|
1411
|
-
className:
|
|
1362
|
+
className: P(Ct.modalBody, r?.scrollBehavior === "inside" && Ct.inside, t),
|
|
1412
1363
|
children: e
|
|
1413
1364
|
});
|
|
1414
1365
|
};
|
|
@@ -1442,24 +1393,24 @@ var Dt = {
|
|
|
1442
1393
|
}, Ot = ({ asChild: e = !1, children: t, className: r, "aria-label": i }) => {
|
|
1443
1394
|
let a = yt(), s = e && l(t) ? t : void 0, c = {
|
|
1444
1395
|
"aria-label": s ? i : i ?? "Close dialog",
|
|
1445
|
-
className:
|
|
1396
|
+
className: P(!s && Dt.modalHeaderCloseButton, r),
|
|
1446
1397
|
onClick: Tt(s?.props.onClick, a.requestClose)
|
|
1447
1398
|
};
|
|
1448
1399
|
return s ? o(s, {
|
|
1449
1400
|
...c,
|
|
1450
|
-
className:
|
|
1401
|
+
className: P(s.props.className, r),
|
|
1451
1402
|
"aria-label": i ?? s.props["aria-label"]
|
|
1452
1403
|
}) : /* @__PURE__ */ n("button", {
|
|
1453
1404
|
type: "button",
|
|
1454
1405
|
...c,
|
|
1455
|
-
children: /* @__PURE__ */ n(
|
|
1406
|
+
children: /* @__PURE__ */ n(S, { size: 16 })
|
|
1456
1407
|
});
|
|
1457
1408
|
};
|
|
1458
1409
|
Ot.displayName = "Modal.Close";
|
|
1459
1410
|
//#endregion
|
|
1460
1411
|
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1461
1412
|
var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r, isTopModal: i, onEscapeKeyDown: a, onPointerDownOutside: o, onInteractOutside: s, requestClose: c }) => {
|
|
1462
|
-
|
|
1413
|
+
ce({
|
|
1463
1414
|
active: e,
|
|
1464
1415
|
closeOnOutsidePress: r,
|
|
1465
1416
|
closeOnEscape: n,
|
|
@@ -1483,8 +1434,8 @@ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1483
1434
|
inside: "_inside_15uod_70",
|
|
1484
1435
|
outside: "_outside_15uod_74"
|
|
1485
1436
|
}, jt = ({ children: e, size: t = "md", placement: r = "center", scrollBehavior: i = "inside", animated: a = !0, forceMount: o = !1, ariaLabel: s, ariaLabelledBy: c, ariaDescribedBy: l, className: d, style: f }) => {
|
|
1486
|
-
let p = yt(), m = p.open, [h,
|
|
1487
|
-
p.setContentRef(e),
|
|
1437
|
+
let p = yt(), m = p.open, [h, g] = _(null), v = u((e) => {
|
|
1438
|
+
p.setContentRef(e), g(e);
|
|
1488
1439
|
}, [p]);
|
|
1489
1440
|
if (kt({
|
|
1490
1441
|
active: m,
|
|
@@ -1496,7 +1447,7 @@ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1496
1447
|
onInteractOutside: p.onInteractOutside,
|
|
1497
1448
|
onPointerDownOutside: p.onPointerDownOutside,
|
|
1498
1449
|
requestClose: p.requestClose
|
|
1499
|
-
}),
|
|
1450
|
+
}), se({
|
|
1500
1451
|
active: m,
|
|
1501
1452
|
contentRef: p.contentRef,
|
|
1502
1453
|
enabled: p.trapFocus,
|
|
@@ -1505,7 +1456,7 @@ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1505
1456
|
onCloseAutoFocus: p.onCloseAutoFocus,
|
|
1506
1457
|
onOpenAutoFocus: p.onOpenAutoFocus,
|
|
1507
1458
|
restoreFocus: p.restoreFocus
|
|
1508
|
-
}),
|
|
1459
|
+
}), ne({
|
|
1509
1460
|
active: m,
|
|
1510
1461
|
content: h,
|
|
1511
1462
|
enabled: p.modal
|
|
@@ -1517,7 +1468,7 @@ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1517
1468
|
id: p.contentId,
|
|
1518
1469
|
ref: Et(v),
|
|
1519
1470
|
tabIndex: -1,
|
|
1520
|
-
className:
|
|
1471
|
+
className: P(At.content, At[t], At[r], At[i], a && At.animated, d),
|
|
1521
1472
|
style: f,
|
|
1522
1473
|
role: p.role,
|
|
1523
1474
|
"aria-modal": p.modal ? "true" : void 0,
|
|
@@ -1531,7 +1482,7 @@ var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r,
|
|
|
1531
1482
|
};
|
|
1532
1483
|
jt.displayName = "ModalContent";
|
|
1533
1484
|
var Mt = { modalFooter: "_modalFooter_sb1pn_1" }, Nt = ({ children: e, className: t }) => /* @__PURE__ */ n("div", {
|
|
1534
|
-
className:
|
|
1485
|
+
className: P(Mt.modalFooter, t),
|
|
1535
1486
|
children: e
|
|
1536
1487
|
});
|
|
1537
1488
|
Nt.displayName = "ModalFooter";
|
|
@@ -1562,7 +1513,7 @@ Ft.displayName = "Modal.Title";
|
|
|
1562
1513
|
var It = ({ children: e, title: t, description: i, showClose: a = !1, className: o }) => {
|
|
1563
1514
|
let s = t !== void 0 || i !== void 0;
|
|
1564
1515
|
return /* @__PURE__ */ r("div", {
|
|
1565
|
-
className:
|
|
1516
|
+
className: P(Dt.modalHeader, o),
|
|
1566
1517
|
children: [s ? /* @__PURE__ */ r("div", {
|
|
1567
1518
|
className: Dt.modalHeaderText,
|
|
1568
1519
|
children: [t !== void 0 && /* @__PURE__ */ n(Ft, { children: t }), i !== void 0 && /* @__PURE__ */ n(Pt, { children: i })]
|
|
@@ -1577,7 +1528,7 @@ var Lt = {
|
|
|
1577
1528
|
}, Rt = ({ className: e, animated: t = !0, forceMount: r = !1 }) => {
|
|
1578
1529
|
let { open: i } = yt();
|
|
1579
1530
|
return !i && !r ? null : /* @__PURE__ */ n("div", {
|
|
1580
|
-
className:
|
|
1531
|
+
className: P(Lt.overlay, i && Lt["overlay--open"], t && Lt["overlay--animated"], e),
|
|
1581
1532
|
"data-state": i ? "open" : "closed",
|
|
1582
1533
|
"aria-hidden": "true"
|
|
1583
1534
|
});
|
|
@@ -1585,22 +1536,22 @@ var Lt = {
|
|
|
1585
1536
|
Rt.displayName = "ModalOverlay";
|
|
1586
1537
|
//#endregion
|
|
1587
1538
|
//#region src/components/Modal/Root/ModalRoot.tsx
|
|
1588
|
-
var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a = !0, closeOnEscape: o = !0, closeOnOutsidePress: s = !0, preventScroll: c = !0, restoreFocus: l = !0, trapFocus: d = !0, initialFocus: p, finalFocus:
|
|
1589
|
-
let T =
|
|
1539
|
+
var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a = !0, closeOnEscape: o = !0, closeOnOutsidePress: s = !0, preventScroll: c = !0, restoreFocus: l = !0, trapFocus: d = !0, initialFocus: p, finalFocus: m, onOpenAutoFocus: v, onCloseAutoFocus: y, onEscapeKeyDown: b, onPointerDownOutside: x, onInteractOutside: S, role: C = "dialog", className: w }) => {
|
|
1540
|
+
let T = g(null), { contentId: E, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } = ye({
|
|
1590
1541
|
open: t,
|
|
1591
1542
|
defaultOpen: r,
|
|
1592
1543
|
onOpenChange: i,
|
|
1593
1544
|
closeOnEscape: o,
|
|
1594
1545
|
closeOnOutsidePress: s
|
|
1595
|
-
}), [M,
|
|
1546
|
+
}), [M, N] = _(!1), [F, I] = _(!1), L = O, R = u(() => {
|
|
1596
1547
|
k();
|
|
1597
1548
|
}, [k]), z = u((e) => {
|
|
1598
1549
|
T.current = e;
|
|
1599
|
-
}, []), { isTopOverlay: ee } =
|
|
1550
|
+
}, []), { isTopOverlay: ee } = de({
|
|
1600
1551
|
active: O,
|
|
1601
1552
|
id: E
|
|
1602
1553
|
});
|
|
1603
|
-
return
|
|
1554
|
+
return me({
|
|
1604
1555
|
active: O,
|
|
1605
1556
|
enabled: c
|
|
1606
1557
|
}), f(() => {
|
|
@@ -1612,13 +1563,13 @@ var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a
|
|
|
1612
1563
|
O,
|
|
1613
1564
|
C
|
|
1614
1565
|
]), /* @__PURE__ */ n(xt, {
|
|
1615
|
-
value:
|
|
1566
|
+
value: h(() => ({
|
|
1616
1567
|
closeOnEscape: o,
|
|
1617
1568
|
closeOnOutsidePress: s,
|
|
1618
1569
|
contentId: E,
|
|
1619
1570
|
contentRef: T,
|
|
1620
1571
|
descriptionId: D,
|
|
1621
|
-
finalFocus:
|
|
1572
|
+
finalFocus: m,
|
|
1622
1573
|
initialFocus: p,
|
|
1623
1574
|
isTopModal: ee,
|
|
1624
1575
|
modal: a,
|
|
@@ -1635,7 +1586,7 @@ var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a
|
|
|
1635
1586
|
setContentRef: z,
|
|
1636
1587
|
setDescriptionPresent: I,
|
|
1637
1588
|
setOpen: A,
|
|
1638
|
-
setTitlePresent:
|
|
1589
|
+
setTitlePresent: N,
|
|
1639
1590
|
shouldRender: L,
|
|
1640
1591
|
titleId: j,
|
|
1641
1592
|
trapFocus: d
|
|
@@ -1644,7 +1595,7 @@ var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a
|
|
|
1644
1595
|
s,
|
|
1645
1596
|
E,
|
|
1646
1597
|
D,
|
|
1647
|
-
|
|
1598
|
+
m,
|
|
1648
1599
|
p,
|
|
1649
1600
|
ee,
|
|
1650
1601
|
O,
|
|
@@ -1665,7 +1616,7 @@ var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a
|
|
|
1665
1616
|
d
|
|
1666
1617
|
]),
|
|
1667
1618
|
children: /* @__PURE__ */ n("div", {
|
|
1668
|
-
className:
|
|
1619
|
+
className: P(w),
|
|
1669
1620
|
"data-state": O ? "open" : "closed",
|
|
1670
1621
|
children: e
|
|
1671
1622
|
})
|
|
@@ -1680,7 +1631,7 @@ var Bt = ({ children: e, asChild: t = !1, disabled: r = !1, className: i }) => {
|
|
|
1680
1631
|
"aria-disabled": c || void 0,
|
|
1681
1632
|
"aria-expanded": a.open,
|
|
1682
1633
|
"aria-haspopup": "dialog",
|
|
1683
|
-
className:
|
|
1634
|
+
className: P(i),
|
|
1684
1635
|
"data-state": a.open ? "open" : "closed",
|
|
1685
1636
|
disabled: c || void 0,
|
|
1686
1637
|
onClick: Tt(s?.props.onClick, () => {
|
|
@@ -1690,7 +1641,7 @@ var Bt = ({ children: e, asChild: t = !1, disabled: r = !1, className: i }) => {
|
|
|
1690
1641
|
return s ? o(s, {
|
|
1691
1642
|
...u,
|
|
1692
1643
|
ref: Et(s.props.ref),
|
|
1693
|
-
className:
|
|
1644
|
+
className: P(s.props.className, i)
|
|
1694
1645
|
}) : /* @__PURE__ */ n("button", {
|
|
1695
1646
|
type: "button",
|
|
1696
1647
|
...u,
|
|
@@ -1757,7 +1708,7 @@ var J = {
|
|
|
1757
1708
|
value: t,
|
|
1758
1709
|
defaultValue: i,
|
|
1759
1710
|
onChange: u
|
|
1760
|
-
}), j = O ? S.value === e : k, M = !!S?.disabled || a,
|
|
1711
|
+
}), j = O ? S.value === e : k, M = !!S?.disabled || a, N = !!S?.required || o, F = S?.name ?? v, I = !!(l || S?.invalid), L = s ?? S?.size ?? "md", R = c ?? S?.color ?? "primary", z = (t) => {
|
|
1761
1712
|
if (!M) {
|
|
1762
1713
|
if (O) {
|
|
1763
1714
|
S.onValueChange(e);
|
|
@@ -1767,10 +1718,10 @@ var J = {
|
|
|
1767
1718
|
}
|
|
1768
1719
|
};
|
|
1769
1720
|
return /* @__PURE__ */ r("div", {
|
|
1770
|
-
className:
|
|
1721
|
+
className: P(J.root, J[L], I && J.invalid, M && J.disabled, Gt[R], g),
|
|
1771
1722
|
children: [/* @__PURE__ */ r("label", {
|
|
1772
1723
|
htmlFor: w,
|
|
1773
|
-
className:
|
|
1724
|
+
className: P(J.wrapper, h),
|
|
1774
1725
|
children: [
|
|
1775
1726
|
/* @__PURE__ */ n("input", {
|
|
1776
1727
|
...b,
|
|
@@ -1781,7 +1732,7 @@ var J = {
|
|
|
1781
1732
|
value: e,
|
|
1782
1733
|
checked: j,
|
|
1783
1734
|
disabled: M,
|
|
1784
|
-
required:
|
|
1735
|
+
required: N,
|
|
1785
1736
|
"aria-invalid": I || void 0,
|
|
1786
1737
|
"aria-describedby": D,
|
|
1787
1738
|
className: J.input,
|
|
@@ -1791,7 +1742,7 @@ var J = {
|
|
|
1791
1742
|
className: J.control,
|
|
1792
1743
|
"aria-hidden": "true",
|
|
1793
1744
|
children: /* @__PURE__ */ n("span", {
|
|
1794
|
-
className:
|
|
1745
|
+
className: P(J.indicator, m && J.customIcon),
|
|
1795
1746
|
children: m
|
|
1796
1747
|
})
|
|
1797
1748
|
}),
|
|
@@ -1855,12 +1806,12 @@ var $t = {
|
|
|
1855
1806
|
error: "_error_1s3vp_152",
|
|
1856
1807
|
disabled: "_disabled_1s3vp_160",
|
|
1857
1808
|
invalid: "_invalid_1s3vp_176"
|
|
1858
|
-
}, en = c(({ value: e, defaultValue: t = "", onValueChange: i, disabled: a = !1, required: o = !1, size: s = "md", color: c = "primary", name: l, label: u, description: d, error: f, orientation: m = "vertical", children:
|
|
1859
|
-
let S =
|
|
1809
|
+
}, en = c(({ value: e, defaultValue: t = "", onValueChange: i, disabled: a = !1, required: o = !1, size: s = "md", color: c = "primary", name: l, label: u, description: d, error: f, orientation: m = "vertical", children: h, className: _, id: v, onKeyDown: y, ...b }, x) => {
|
|
1810
|
+
let S = g(null), C = p(), w = v ?? C, T = u ? `${w}-label` : void 0, E = d ? `${w}-description` : void 0, D = f ? `${w}-error` : void 0, O = [E, D].filter(Boolean).join(" ") || void 0, k = l ?? `${w}-radio`, [A, j] = U({
|
|
1860
1811
|
value: e,
|
|
1861
1812
|
defaultValue: t,
|
|
1862
1813
|
onChange: i
|
|
1863
|
-
}), M = !!f,
|
|
1814
|
+
}), M = !!f, N = Qt({
|
|
1864
1815
|
rootRef: S,
|
|
1865
1816
|
orientation: m
|
|
1866
1817
|
}), F = (e) => {
|
|
@@ -1881,9 +1832,9 @@ var $t = {
|
|
|
1881
1832
|
"aria-required": o || void 0,
|
|
1882
1833
|
"aria-invalid": M || void 0,
|
|
1883
1834
|
onKeyDown: (e) => {
|
|
1884
|
-
y?.(e), e.defaultPrevented ||
|
|
1835
|
+
y?.(e), e.defaultPrevented || N(e);
|
|
1885
1836
|
},
|
|
1886
|
-
className:
|
|
1837
|
+
className: P($t.root, $t[s], M && $t.invalid, a && $t.disabled, _),
|
|
1887
1838
|
children: [
|
|
1888
1839
|
u && /* @__PURE__ */ r("div", {
|
|
1889
1840
|
id: T,
|
|
@@ -1912,8 +1863,8 @@ var $t = {
|
|
|
1912
1863
|
onValueChange: j
|
|
1913
1864
|
},
|
|
1914
1865
|
children: /* @__PURE__ */ n("div", {
|
|
1915
|
-
className:
|
|
1916
|
-
children:
|
|
1866
|
+
className: P($t.items, $t[m]),
|
|
1867
|
+
children: h
|
|
1917
1868
|
})
|
|
1918
1869
|
}),
|
|
1919
1870
|
f && /* @__PURE__ */ n("div", {
|
|
@@ -1941,7 +1892,7 @@ nn.displayName = "SelectContext";
|
|
|
1941
1892
|
//#endregion
|
|
1942
1893
|
//#region src/components/Select/internal/useSelectVirtualization.ts
|
|
1943
1894
|
function on({ loading: e, options: t, scrollTop: n, virtual: r }) {
|
|
1944
|
-
return
|
|
1895
|
+
return h(() => {
|
|
1945
1896
|
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;
|
|
1946
1897
|
return {
|
|
1947
1898
|
bottomSpacerHeight: o ? Math.max(0, (t.length - s - l.length) * a) : 0,
|
|
@@ -1986,7 +1937,7 @@ var ln = ({ option: e, isSelected: i, isActive: a, optionId: o, renderOption: s,
|
|
|
1986
1937
|
role: "option",
|
|
1987
1938
|
"aria-selected": i,
|
|
1988
1939
|
"aria-disabled": u || void 0,
|
|
1989
|
-
className:
|
|
1940
|
+
className: P(sn.option, {
|
|
1990
1941
|
[sn.selected]: i,
|
|
1991
1942
|
[sn.active]: a,
|
|
1992
1943
|
[sn.disabled]: u,
|
|
@@ -2029,7 +1980,7 @@ var ln = ({ option: e, isSelected: i, isActive: a, optionId: o, renderOption: s,
|
|
|
2029
1980
|
] }), /* @__PURE__ */ n("span", {
|
|
2030
1981
|
className: sn.check,
|
|
2031
1982
|
"aria-hidden": "true",
|
|
2032
|
-
children: i && /* @__PURE__ */ n(
|
|
1983
|
+
children: i && /* @__PURE__ */ n(y, {})
|
|
2033
1984
|
})]
|
|
2034
1985
|
});
|
|
2035
1986
|
};
|
|
@@ -2068,8 +2019,8 @@ var Y = {
|
|
|
2068
2019
|
});
|
|
2069
2020
|
};
|
|
2070
2021
|
un.__velliraSelectPart = "content", un.displayName = "Select.Content";
|
|
2071
|
-
var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style: s, options: c, entries: l, multiple: d, selectedValues: p, color: m = "primary", variant:
|
|
2072
|
-
let B =
|
|
2022
|
+
var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style: s, options: c, entries: l, multiple: d, selectedValues: p, color: m = "primary", variant: h = "outline", searchable: v, command: y, virtual: b, portal: x = !0, searchValue: C = "", searchPlaceholder: w = "Search...", loading: T, loadingText: E = "Loading...", noOptionsText: D, searchSlot: O, headerSlot: k, emptySlot: A, loadingSlot: j, renderOption: M, selectedValue: N, activeIndex: P, visualActiveIndex: F = P, className: I, onSelect: L, onSelectGroup: R, onMouseEnter: z, onSearchChange: ee }) => {
|
|
2023
|
+
let B = g(null), te = g(!1), [ne, re] = _(null), [ie, ae] = _(0), { bottomSpacerHeight: oe, isVirtual: V, itemHeight: se, startIndex: ce, topSpacerHeight: le, viewportHeight: ue, visibleOptions: de } = on({
|
|
2073
2024
|
loading: T,
|
|
2074
2025
|
options: c,
|
|
2075
2026
|
scrollTop: ie,
|
|
@@ -2121,7 +2072,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2121
2072
|
className: [
|
|
2122
2073
|
Y.dropdown,
|
|
2123
2074
|
Y[m],
|
|
2124
|
-
Y[
|
|
2075
|
+
Y[h],
|
|
2125
2076
|
y ? Y.command : void 0,
|
|
2126
2077
|
I
|
|
2127
2078
|
].filter(Boolean).join(" "),
|
|
@@ -2148,7 +2099,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2148
2099
|
onClick: () => {
|
|
2149
2100
|
ee?.(""), B.current?.focus();
|
|
2150
2101
|
},
|
|
2151
|
-
children: /* @__PURE__ */ n(
|
|
2102
|
+
children: /* @__PURE__ */ n(S, {})
|
|
2152
2103
|
})]
|
|
2153
2104
|
})),
|
|
2154
2105
|
/* @__PURE__ */ n("ul", {
|
|
@@ -2233,7 +2184,7 @@ var dn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style:
|
|
|
2233
2184
|
})
|
|
2234
2185
|
]
|
|
2235
2186
|
});
|
|
2236
|
-
return
|
|
2187
|
+
return x ? /* @__PURE__ */ n(Ce, { children: pe }) : pe;
|
|
2237
2188
|
};
|
|
2238
2189
|
dn.displayName = "SelectContentSurface";
|
|
2239
2190
|
function fn(e) {
|
|
@@ -2263,7 +2214,7 @@ hn.__velliraSelectPart = "loading", hn.displayName = "Select.Loading";
|
|
|
2263
2214
|
//#endregion
|
|
2264
2215
|
//#region src/components/Select/Content/SelectSearch.tsx
|
|
2265
2216
|
var gn = ({ placeholder: e, className: t }) => {
|
|
2266
|
-
let { contentProps: i } = an(), a =
|
|
2217
|
+
let { contentProps: i } = an(), a = g(null), o = i.searchValue ?? "";
|
|
2267
2218
|
return f(() => {
|
|
2268
2219
|
if (!i.isOpen) return;
|
|
2269
2220
|
let e = window.setTimeout(() => {
|
|
@@ -2274,7 +2225,7 @@ var gn = ({ placeholder: e, className: t }) => {
|
|
|
2274
2225
|
className: Y.searchWrap,
|
|
2275
2226
|
children: [/* @__PURE__ */ n("input", {
|
|
2276
2227
|
ref: a,
|
|
2277
|
-
className:
|
|
2228
|
+
className: P(Y.search, t),
|
|
2278
2229
|
value: o,
|
|
2279
2230
|
placeholder: e ?? (i.command ? "Type a command..." : "Search..."),
|
|
2280
2231
|
"aria-label": "Search options",
|
|
@@ -2287,7 +2238,7 @@ var gn = ({ placeholder: e, className: t }) => {
|
|
|
2287
2238
|
onClick: () => {
|
|
2288
2239
|
i.onSearchChange?.(""), a.current?.focus();
|
|
2289
2240
|
},
|
|
2290
|
-
children: /* @__PURE__ */ n(
|
|
2241
|
+
children: /* @__PURE__ */ n(S, {})
|
|
2291
2242
|
})]
|
|
2292
2243
|
});
|
|
2293
2244
|
};
|
|
@@ -2339,7 +2290,7 @@ var Cn = s(null), wn = () => d(Cn), Tn = {
|
|
|
2339
2290
|
labelInfo: "_labelInfo_143kr_201",
|
|
2340
2291
|
disabled: "_disabled_143kr_243"
|
|
2341
2292
|
}, En = (...e) => e.filter(Boolean).join(" ") || void 0, Dn = ({ id: e, label: t, description: i, error: a, required: s = !1, disabled: c = !1, invalid: u = !1, orientation: d = "vertical", labelPosition: f = "top", size: m = "md", labelInfo: h, optionalText: g, children: _, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
|
|
2342
|
-
let T = p(), E = e ?? T, D = t ? `${E}-label` : void 0, O = i && E ? `${E}-description` : void 0, k = a && E ? `${E}-error` : void 0, A = u || !!a, j = En(D), M = En(O, k),
|
|
2293
|
+
let T = p(), E = e ?? T, D = t ? `${E}-label` : void 0, O = i && E ? `${E}-description` : void 0, k = a && E ? `${E}-error` : void 0, A = u || !!a, j = En(D), M = En(O, k), N = {
|
|
2343
2294
|
controlId: E,
|
|
2344
2295
|
labelId: D,
|
|
2345
2296
|
descriptionId: O,
|
|
@@ -2361,7 +2312,7 @@ var Cn = s(null), wn = () => d(Cn), Tn = {
|
|
|
2361
2312
|
return /* @__PURE__ */ r("div", {
|
|
2362
2313
|
...w,
|
|
2363
2314
|
"aria-disabled": c || void 0,
|
|
2364
|
-
className:
|
|
2315
|
+
className: P(Tn.wrapper, Tn[d], Tn[f], Tn[m], c && Tn.disabled, y),
|
|
2365
2316
|
"data-disabled": c || void 0,
|
|
2366
2317
|
"data-invalid": A || void 0,
|
|
2367
2318
|
"data-orientation": d,
|
|
@@ -2370,7 +2321,7 @@ var Cn = s(null), wn = () => d(Cn), Tn = {
|
|
|
2370
2321
|
t && /* @__PURE__ */ r("label", {
|
|
2371
2322
|
id: D,
|
|
2372
2323
|
htmlFor: E,
|
|
2373
|
-
className:
|
|
2324
|
+
className: P(Tn.label, x),
|
|
2374
2325
|
children: [
|
|
2375
2326
|
/* @__PURE__ */ n("span", {
|
|
2376
2327
|
className: Tn.labelText,
|
|
@@ -2393,19 +2344,19 @@ var Cn = s(null), wn = () => d(Cn), Tn = {
|
|
|
2393
2344
|
}),
|
|
2394
2345
|
i && /* @__PURE__ */ n("div", {
|
|
2395
2346
|
id: O,
|
|
2396
|
-
className:
|
|
2347
|
+
className: P(Tn.description, S),
|
|
2397
2348
|
children: i
|
|
2398
2349
|
}),
|
|
2399
2350
|
/* @__PURE__ */ n(Cn.Provider, {
|
|
2400
|
-
value:
|
|
2351
|
+
value: N,
|
|
2401
2352
|
children: /* @__PURE__ */ n("div", {
|
|
2402
|
-
className:
|
|
2353
|
+
className: P(Tn.control, b),
|
|
2403
2354
|
children: I
|
|
2404
2355
|
})
|
|
2405
2356
|
}),
|
|
2406
2357
|
a && /* @__PURE__ */ n("div", {
|
|
2407
2358
|
id: k,
|
|
2408
|
-
className:
|
|
2359
|
+
className: P(Tn.errorText, C),
|
|
2409
2360
|
role: "alert",
|
|
2410
2361
|
children: a
|
|
2411
2362
|
})
|
|
@@ -2532,7 +2483,7 @@ function jn(e, t) {
|
|
|
2532
2483
|
//#endregion
|
|
2533
2484
|
//#region src/components/Select/internal/useSelectCollection.ts
|
|
2534
2485
|
function Mn(e) {
|
|
2535
|
-
return
|
|
2486
|
+
return h(() => On(e), [e]);
|
|
2536
2487
|
}
|
|
2537
2488
|
//#endregion
|
|
2538
2489
|
//#region src/components/Select/internal/useSelectPosition.ts
|
|
@@ -2549,7 +2500,7 @@ function Nn({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange:
|
|
|
2549
2500
|
//#endregion
|
|
2550
2501
|
//#region src/components/Select/internal/useSelectSearch.ts
|
|
2551
2502
|
function Pn({ options: e, searchable: t, searchValue: n }) {
|
|
2552
|
-
return
|
|
2503
|
+
return h(() => {
|
|
2553
2504
|
if (!t || !n) return e;
|
|
2554
2505
|
let r = n.toLocaleLowerCase();
|
|
2555
2506
|
return e.filter((e) => `${e.label} ${Fn(e.description)}`.toLocaleLowerCase().includes(r));
|
|
@@ -2597,7 +2548,7 @@ var X = {
|
|
|
2597
2548
|
});
|
|
2598
2549
|
};
|
|
2599
2550
|
In.__velliraSelectPart = "trigger", In.displayName = "Select.Trigger";
|
|
2600
|
-
var Ln = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabled: c, required: l, listboxId: u, activeIndex: d, ariaLabel: f, error: p, displayText: m, isPlaceholder: h, size: g = "md", color: _, variant: v, loading:
|
|
2551
|
+
var Ln = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabled: c, required: l, listboxId: u, activeIndex: d, ariaLabel: f, error: p, displayText: m, isPlaceholder: h, size: g = "md", color: _, variant: v, loading: y, startIcon: x, endIcon: C, prefix: w, suffix: T, clearable: E, onClear: D, className: O, buttonRef: k, onClick: A, onKeyDown: j, onBlur: M, onFocus: N }) => /* @__PURE__ */ n("button", {
|
|
2601
2552
|
id: i,
|
|
2602
2553
|
ref: k,
|
|
2603
2554
|
type: "button",
|
|
@@ -2613,19 +2564,19 @@ var Ln = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2613
2564
|
"aria-controls": s ? u : void 0,
|
|
2614
2565
|
"aria-describedby": a,
|
|
2615
2566
|
"aria-activedescendant": s && d >= 0 ? `${u}-option-${d}` : void 0,
|
|
2616
|
-
className:
|
|
2567
|
+
className: P(X.control, X[g], X[v], X[_], {
|
|
2617
2568
|
[X.error]: !!p,
|
|
2618
2569
|
[X.disabled]: c,
|
|
2619
|
-
[X.loading]:
|
|
2570
|
+
[X.loading]: y
|
|
2620
2571
|
}, O),
|
|
2621
2572
|
onClick: A,
|
|
2622
2573
|
onKeyDown: j,
|
|
2623
2574
|
onBlur: M,
|
|
2624
|
-
onFocus:
|
|
2575
|
+
onFocus: N,
|
|
2625
2576
|
children: e ?? /* @__PURE__ */ r(t, { children: [
|
|
2626
|
-
|
|
2577
|
+
x && /* @__PURE__ */ n("span", {
|
|
2627
2578
|
className: X.adornment,
|
|
2628
|
-
children:
|
|
2579
|
+
children: x
|
|
2629
2580
|
}),
|
|
2630
2581
|
w && /* @__PURE__ */ n("span", {
|
|
2631
2582
|
className: X.affix,
|
|
@@ -2634,7 +2585,7 @@ var Ln = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2634
2585
|
/* @__PURE__ */ n("span", {
|
|
2635
2586
|
className: X.valueWrap,
|
|
2636
2587
|
children: /* @__PURE__ */ n("span", {
|
|
2637
|
-
className:
|
|
2588
|
+
className: P(X.value, { [X.placeholder]: h }),
|
|
2638
2589
|
children: m
|
|
2639
2590
|
})
|
|
2640
2591
|
}),
|
|
@@ -2650,30 +2601,30 @@ var Ln = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabl
|
|
|
2650
2601
|
onClick: (e) => {
|
|
2651
2602
|
e.stopPropagation(), D?.();
|
|
2652
2603
|
},
|
|
2653
|
-
children: /* @__PURE__ */ n(
|
|
2604
|
+
children: /* @__PURE__ */ n(S, {})
|
|
2654
2605
|
}),
|
|
2655
2606
|
/* @__PURE__ */ n("span", {
|
|
2656
|
-
className:
|
|
2607
|
+
className: P(X.arrow, { [X.open]: s }),
|
|
2657
2608
|
"aria-hidden": "true",
|
|
2658
|
-
children:
|
|
2609
|
+
children: y ? /* @__PURE__ */ n("span", { className: X.spinner }) : C ?? /* @__PURE__ */ n(b, {})
|
|
2659
2610
|
})
|
|
2660
2611
|
] })
|
|
2661
2612
|
});
|
|
2662
2613
|
Ln.displayName = "SelectTriggerSurface";
|
|
2663
2614
|
//#endregion
|
|
2664
2615
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
2665
|
-
var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label": c, "aria-describedby": l, "aria-labelledby": d, value:
|
|
2666
|
-
let
|
|
2616
|
+
var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label": c, "aria-describedby": l, "aria-labelledby": d, 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: L = !1, command: R = !1, error: z, placement: ee = "bottom", matchTriggerWidth: B = !0, avoidCollisions: te = !0, portal: ne = !0, open: re, defaultOpen: ie = !1, onOpenChange: ae, onSearch: oe, onClear: V, startIcon: se, endIcon: le, prefix: ue, suffix: H, renderValue: fe, renderOption: pe, onBlur: he, onFocus: ge, className: U, triggerClassName: _e, dropdownClassName: ve }) => {
|
|
2617
|
+
let ye = p(), W = wn(), xe = !!(i || a || z), Se = o ?? (xe ? void 0 : W?.controlId) ?? ye, Ce = `${Se}-listbox`, [we, Te] = _(""), Ee = !!z, De = Ee ? `${Se}-error` : void 0, Oe = a ? `${Se}-description` : void 0, ke = D ?? W?.size ?? "md", Ae = M || Ee || !xe && !!W?.invalid, je = j || !xe && !!W?.disabled, Me = A || !xe && !!W?.required, Ne = [
|
|
2667
2618
|
l,
|
|
2668
2619
|
!xe && !l ? W?.ariaDescribedBy : void 0,
|
|
2669
2620
|
Oe,
|
|
2670
2621
|
De
|
|
2671
|
-
].filter(Boolean).join(" "), G =
|
|
2622
|
+
].filter(Boolean).join(" "), G = g(null), Pe = g(null), [K, Fe] = _(!1), Ie = F || R, { entries: Le, options: Re } = Mn(e), ze = Pn({
|
|
2672
2623
|
options: Re,
|
|
2673
2624
|
searchable: Ie,
|
|
2674
2625
|
searchValue: we
|
|
2675
|
-
}), { selectedValue: Be, selectedValues:
|
|
2676
|
-
value:
|
|
2626
|
+
}), { selectedValue: Be, selectedValues: Ve, isOpen: q, setIsOpen: He, setSelectedValue: Ue, activeIndex: We, setActiveIndex: Ge, closeDropdown: Ke, toggleDropdown: qe, selectValue: Je, onKeyDown: Ye } = be({
|
|
2627
|
+
value: m,
|
|
2677
2628
|
defaultValue: v,
|
|
2678
2629
|
onValueChange: y,
|
|
2679
2630
|
options: ze,
|
|
@@ -2684,8 +2635,8 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2684
2635
|
open: re,
|
|
2685
2636
|
defaultOpen: ie,
|
|
2686
2637
|
onOpenChange: ae
|
|
2687
|
-
}), Xe =
|
|
2688
|
-
isOpen:
|
|
2638
|
+
}), Xe = h(() => Re.find((e) => Ve.includes(e.value)), [Re, Ve]), Ze = h(() => Re.filter((e) => Ve.includes(e.value)), [Re, Ve]), Qe = !!Xe, $e = Array.isArray(Be) ? Be[0] ?? "" : Be, { floatingStyles: et, setRef: tt, setFloatingRef: nt } = Nn({
|
|
2639
|
+
isOpen: q,
|
|
2689
2640
|
onOpenChange: He,
|
|
2690
2641
|
placement: ee,
|
|
2691
2642
|
matchTriggerWidth: B,
|
|
@@ -2694,12 +2645,12 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2694
2645
|
Je(e), G.current?.focus();
|
|
2695
2646
|
}, [Je]), it = u((e) => {
|
|
2696
2647
|
if (!b || e.length === 0) return;
|
|
2697
|
-
let t = e.filter((e) => Re.some((t) => t.value === e && !t.disabled)), n = t.filter((e) =>
|
|
2648
|
+
let t = e.filter((e) => Re.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => Ve.includes(e)), r = Ve.filter((e) => !t.includes(e)).length, i = typeof x == "number" ? Math.max(0, Math.min(t.length, x - r)) : t.length;
|
|
2698
2649
|
if (n.length > 0 && n.length >= i) {
|
|
2699
|
-
Ue(
|
|
2650
|
+
Ue(Ve.filter((e) => !t.includes(e)));
|
|
2700
2651
|
return;
|
|
2701
2652
|
}
|
|
2702
|
-
let a = [...
|
|
2653
|
+
let a = [...Ve];
|
|
2703
2654
|
for (let e of t) if (!a.includes(e)) {
|
|
2704
2655
|
if (typeof x == "number" && a.length >= x) break;
|
|
2705
2656
|
a.push(e);
|
|
@@ -2711,24 +2662,24 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2711
2662
|
x,
|
|
2712
2663
|
b,
|
|
2713
2664
|
Re,
|
|
2714
|
-
|
|
2665
|
+
Ve,
|
|
2715
2666
|
Ue
|
|
2716
2667
|
]), at = u(() => {
|
|
2717
2668
|
Je(""), V?.(), G.current?.focus();
|
|
2718
2669
|
}, [V, Je]), ot = u(() => {
|
|
2719
|
-
|
|
2720
|
-
}, [
|
|
2721
|
-
zn(e,
|
|
2722
|
-
}, [
|
|
2670
|
+
q || Fe(!1), qe();
|
|
2671
|
+
}, [q, qe]), st = u((e) => {
|
|
2672
|
+
zn(e, q) && Fe(!0), Ye(e);
|
|
2673
|
+
}, [q, Ye]), ct = u((e) => {
|
|
2723
2674
|
Fe(!0), Ge(e);
|
|
2724
2675
|
}, [Ge]), lt = u((e) => {
|
|
2725
2676
|
Te(e), oe?.(e);
|
|
2726
|
-
}, [oe]), { isTopOverlay: ut } =
|
|
2727
|
-
active:
|
|
2677
|
+
}, [oe]), { isTopOverlay: ut } = de({
|
|
2678
|
+
active: q,
|
|
2728
2679
|
id: Ce
|
|
2729
2680
|
});
|
|
2730
|
-
|
|
2731
|
-
active:
|
|
2681
|
+
ce({
|
|
2682
|
+
active: q,
|
|
2732
2683
|
closeOnEscape: !0,
|
|
2733
2684
|
closeOnOutsidePress: !0,
|
|
2734
2685
|
contentRef: Pe,
|
|
@@ -2736,22 +2687,22 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2736
2687
|
isTopOverlay: ut,
|
|
2737
2688
|
requestClose: Ke
|
|
2738
2689
|
}), f(() => {
|
|
2739
|
-
|
|
2740
|
-
}, [
|
|
2741
|
-
!
|
|
2742
|
-
}, [
|
|
2743
|
-
active:
|
|
2690
|
+
q || Fe(!1);
|
|
2691
|
+
}, [q]), f(() => {
|
|
2692
|
+
!q && we && Te("");
|
|
2693
|
+
}, [q, we]), me({
|
|
2694
|
+
active: q,
|
|
2744
2695
|
enabled: L
|
|
2745
2696
|
});
|
|
2746
2697
|
let dt = u((e) => {
|
|
2747
2698
|
G.current = e, tt(e);
|
|
2748
2699
|
}, [tt]), ft = u((e) => {
|
|
2749
2700
|
Pe.current = e, nt(e);
|
|
2750
|
-
}, [nt]), pt = fe ? fe(Xe) : b && Ze.length ? Ze.map((e) => e.label).join(", ") : Xe?.label ?? C, mt = w ?? E ?? "No options available", ht = P &&
|
|
2701
|
+
}, [nt]), pt = fe ? fe(Xe) : b && Ze.length ? Ze.map((e) => e.label).join(", ") : Xe?.label ?? C, mt = w ?? E ?? "No options available", ht = P && Ve.length > 0 && !je && !N, gt = {
|
|
2751
2702
|
id: Se,
|
|
2752
2703
|
describedBy: Ne || void 0,
|
|
2753
2704
|
labelledBy: c ? void 0 : d,
|
|
2754
|
-
isOpen:
|
|
2705
|
+
isOpen: q,
|
|
2755
2706
|
disabled: je,
|
|
2756
2707
|
required: Me,
|
|
2757
2708
|
listboxId: Ce,
|
|
@@ -2764,9 +2715,9 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2764
2715
|
size: ke,
|
|
2765
2716
|
color: O,
|
|
2766
2717
|
variant: k,
|
|
2767
|
-
startIcon:
|
|
2718
|
+
startIcon: se,
|
|
2768
2719
|
endIcon: le,
|
|
2769
|
-
prefix:
|
|
2720
|
+
prefix: ue,
|
|
2770
2721
|
suffix: H,
|
|
2771
2722
|
clearable: ht,
|
|
2772
2723
|
className: _e,
|
|
@@ -2775,9 +2726,9 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2775
2726
|
onClick: ot,
|
|
2776
2727
|
onKeyDown: st,
|
|
2777
2728
|
onBlur: he,
|
|
2778
|
-
onFocus:
|
|
2729
|
+
onFocus: ge
|
|
2779
2730
|
}, _t = {
|
|
2780
|
-
isOpen:
|
|
2731
|
+
isOpen: q,
|
|
2781
2732
|
listboxId: Ce,
|
|
2782
2733
|
labelledById: Se,
|
|
2783
2734
|
style: et,
|
|
@@ -2794,9 +2745,9 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2794
2745
|
loading: N,
|
|
2795
2746
|
loadingText: T,
|
|
2796
2747
|
noOptionsText: mt,
|
|
2797
|
-
renderOption:
|
|
2748
|
+
renderOption: pe,
|
|
2798
2749
|
selectedValue: $e,
|
|
2799
|
-
selectedValues:
|
|
2750
|
+
selectedValues: Ve,
|
|
2800
2751
|
activeIndex: We,
|
|
2801
2752
|
visualActiveIndex: K ? We : -1,
|
|
2802
2753
|
className: ve,
|
|
@@ -2805,7 +2756,7 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2805
2756
|
onSelectGroup: it,
|
|
2806
2757
|
onMouseEnter: ct,
|
|
2807
2758
|
onSearchChange: lt
|
|
2808
|
-
}, vt = /* @__PURE__ */ r(t, { children: [s && b &&
|
|
2759
|
+
}, vt = /* @__PURE__ */ r(t, { children: [s && b && Ve.length > 0 && /* @__PURE__ */ n(t, { children: Ve.map((e) => /* @__PURE__ */ n("input", {
|
|
2809
2760
|
type: "hidden",
|
|
2810
2761
|
name: s,
|
|
2811
2762
|
value: e,
|
|
@@ -2840,7 +2791,7 @@ var Rn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label":
|
|
|
2840
2791
|
required: Me,
|
|
2841
2792
|
disabled: je,
|
|
2842
2793
|
bindControl: !1,
|
|
2843
|
-
className:
|
|
2794
|
+
className: U,
|
|
2844
2795
|
children: e ? bt : xt
|
|
2845
2796
|
});
|
|
2846
2797
|
};
|
|
@@ -2853,9 +2804,9 @@ function zn(e, t) {
|
|
|
2853
2804
|
var Bn = ({ children: e, className: t }) => {
|
|
2854
2805
|
let { triggerProps: r } = an();
|
|
2855
2806
|
return /* @__PURE__ */ n("span", {
|
|
2856
|
-
className:
|
|
2807
|
+
className: P(X.arrow, { [X.open]: r.isOpen }, t),
|
|
2857
2808
|
"aria-hidden": "true",
|
|
2858
|
-
children: r.loading ? /* @__PURE__ */ n("span", { className: X.spinner }) : e ?? r.endIcon ?? /* @__PURE__ */ n(
|
|
2809
|
+
children: r.loading ? /* @__PURE__ */ n("span", { className: X.spinner }) : e ?? r.endIcon ?? /* @__PURE__ */ n(b, {})
|
|
2859
2810
|
});
|
|
2860
2811
|
};
|
|
2861
2812
|
Bn.__velliraSelectPart = "icon", Bn.displayName = "Select.Icon";
|
|
@@ -2864,9 +2815,9 @@ Bn.__velliraSelectPart = "icon", Bn.displayName = "Select.Icon";
|
|
|
2864
2815
|
var Vn = ({ children: e, className: t }) => {
|
|
2865
2816
|
let { triggerProps: r } = an();
|
|
2866
2817
|
return /* @__PURE__ */ n("span", {
|
|
2867
|
-
className:
|
|
2818
|
+
className: P(X.valueWrap, t),
|
|
2868
2819
|
children: /* @__PURE__ */ n("span", {
|
|
2869
|
-
className:
|
|
2820
|
+
className: P(X.value, { [X.placeholder]: r.isPlaceholder }),
|
|
2870
2821
|
children: e ?? r.displayText
|
|
2871
2822
|
})
|
|
2872
2823
|
});
|
|
@@ -2892,147 +2843,486 @@ var Hn = Object.assign(Rn, {
|
|
|
2892
2843
|
});
|
|
2893
2844
|
Hn.displayName = "Select";
|
|
2894
2845
|
//#endregion
|
|
2895
|
-
//#region src/components/Tabs/TabsContext.tsx
|
|
2846
|
+
//#region src/components/Tabs/internal/TabsContext.tsx
|
|
2896
2847
|
var Un = s(null), Wn = () => {
|
|
2897
2848
|
let e = d(Un);
|
|
2898
2849
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
2899
2850
|
return e;
|
|
2900
2851
|
}, Gn = {
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2852
|
+
panel: "_panel_1v1a9_1",
|
|
2853
|
+
visible: "_visible_1v1a9_10",
|
|
2854
|
+
vertical: "_vertical_1v1a9_14"
|
|
2855
|
+
}, Kn = ({ value: e, children: t, className: r, forceMount: i = !1, ...a }) => {
|
|
2856
|
+
let { value: o, orientation: s, keepMounted: c, lazyMount: l, registerContent: u, getTriggerId: d, getContentId: p } = Wn(), m = o === e, [h, g] = _(m);
|
|
2857
|
+
return f(() => (u(e, !0), () => {
|
|
2858
|
+
u(e, !1);
|
|
2859
|
+
}), [u, e]), f(() => {
|
|
2860
|
+
m && g(!0);
|
|
2861
|
+
}, [m]), i || m || c && !l || c && l && h ? /* @__PURE__ */ n("div", {
|
|
2862
|
+
...a,
|
|
2863
|
+
role: "tabpanel",
|
|
2864
|
+
id: p(e),
|
|
2865
|
+
"aria-labelledby": d(e),
|
|
2866
|
+
hidden: !m,
|
|
2867
|
+
tabIndex: 0,
|
|
2868
|
+
"data-state": m ? "active" : "inactive",
|
|
2869
|
+
"data-orientation": s,
|
|
2870
|
+
className: P(Gn.panel, m && Gn.visible, s === "vertical" && Gn.vertical, r),
|
|
2871
|
+
children: t
|
|
2872
|
+
}) : null;
|
|
2873
|
+
};
|
|
2874
|
+
Kn.displayName = "Tabs.Content";
|
|
2875
|
+
//#endregion
|
|
2876
|
+
//#region src/components/Tabs/internal/useTabsIndicator.ts
|
|
2877
|
+
var qn = 8, Jn = 360, Yn = () => {
|
|
2878
|
+
let e = g(null), t = g(null), n = g(void 0), r = g(null), [i, a] = _({}), { value: o, orientation: s, variant: c, collectionVersion: l, getTriggerId: u } = Wn();
|
|
2879
|
+
return f(() => () => {
|
|
2880
|
+
r.current?.cancel();
|
|
2881
|
+
}, []), m(() => {
|
|
2882
|
+
let i = e.current;
|
|
2883
|
+
if (!i || !o) {
|
|
2884
|
+
a({});
|
|
2885
|
+
return;
|
|
2886
|
+
}
|
|
2887
|
+
let l = i.parentElement, d = document.getElementById(u(o));
|
|
2888
|
+
if (!l || !d) {
|
|
2889
|
+
a({
|
|
2890
|
+
width: 0,
|
|
2891
|
+
height: 0,
|
|
2892
|
+
transform: "translateX(0)"
|
|
2893
|
+
});
|
|
2894
|
+
return;
|
|
2895
|
+
}
|
|
2896
|
+
let f = (e) => {
|
|
2897
|
+
s === "vertical" ? (i.style.width = "", i.style.height = typeof e.height == "number" ? `${e.height}px` : String(e.height ?? "")) : (i.style.height = "", i.style.width = typeof e.width == "number" ? `${e.width}px` : String(e.width ?? "")), i.style.transform = String(e.transform ?? ""), a(e);
|
|
2898
|
+
}, p = (e = !1) => {
|
|
2899
|
+
let a = l.getBoundingClientRect(), u = d.getBoundingClientRect(), p = {
|
|
2900
|
+
x: u.left - a.left + l.scrollLeft,
|
|
2901
|
+
y: u.top - a.top + l.scrollTop,
|
|
2902
|
+
width: u.width,
|
|
2903
|
+
height: u.height
|
|
2904
|
+
};
|
|
2905
|
+
if (s === "vertical") {
|
|
2906
|
+
let a = {
|
|
2907
|
+
height: u.height,
|
|
2908
|
+
transform: `translate3d(0, ${p.y}px, 0)`
|
|
2909
|
+
};
|
|
2910
|
+
f(a);
|
|
2911
|
+
let s = t.current;
|
|
2912
|
+
if (e && c === "line" && s && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
2913
|
+
r.current?.cancel();
|
|
2914
|
+
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e - qn / 2, a = t - qn / 2;
|
|
2915
|
+
r.current = i.animate([
|
|
2916
|
+
{
|
|
2917
|
+
height: `${s.height}px`,
|
|
2918
|
+
transform: `translate3d(0, ${s.y}px, 0)`,
|
|
2919
|
+
offset: 0
|
|
2920
|
+
},
|
|
2921
|
+
{
|
|
2922
|
+
height: `${qn}px`,
|
|
2923
|
+
transform: `translate3d(0, ${n}px, 0)`,
|
|
2924
|
+
offset: .28
|
|
2925
|
+
},
|
|
2926
|
+
{
|
|
2927
|
+
height: `${qn}px`,
|
|
2928
|
+
transform: `translate3d(0, ${a}px, 0)`,
|
|
2929
|
+
offset: .64
|
|
2930
|
+
},
|
|
2931
|
+
{
|
|
2932
|
+
height: `${p.height}px`,
|
|
2933
|
+
transform: `translate3d(0, ${p.y}px, 0)`,
|
|
2934
|
+
offset: 1
|
|
2935
|
+
}
|
|
2936
|
+
], {
|
|
2937
|
+
duration: Jn,
|
|
2938
|
+
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
2939
|
+
fill: "none"
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
2942
|
+
t.current = p, n.current = o;
|
|
2943
|
+
return;
|
|
2944
|
+
}
|
|
2945
|
+
let m = {
|
|
2946
|
+
width: u.width,
|
|
2947
|
+
transform: `translate3d(${p.x}px, 0, 0)`
|
|
2948
|
+
};
|
|
2949
|
+
f(m);
|
|
2950
|
+
let h = t.current;
|
|
2951
|
+
if (e && c === "line" && h && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
2952
|
+
r.current?.cancel();
|
|
2953
|
+
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e - qn / 2, a = t - qn / 2;
|
|
2954
|
+
r.current = i.animate([
|
|
2955
|
+
{
|
|
2956
|
+
width: `${h.width}px`,
|
|
2957
|
+
transform: `translate3d(${h.x}px, 0, 0)`,
|
|
2958
|
+
offset: 0
|
|
2959
|
+
},
|
|
2960
|
+
{
|
|
2961
|
+
width: `${qn}px`,
|
|
2962
|
+
transform: `translate3d(${n}px, 0, 0)`,
|
|
2963
|
+
offset: .28
|
|
2964
|
+
},
|
|
2965
|
+
{
|
|
2966
|
+
width: `${qn}px`,
|
|
2967
|
+
transform: `translate3d(${a}px, 0, 0)`,
|
|
2968
|
+
offset: .64
|
|
2969
|
+
},
|
|
2970
|
+
{
|
|
2971
|
+
width: `${p.width}px`,
|
|
2972
|
+
transform: `translate3d(${p.x}px, 0, 0)`,
|
|
2973
|
+
offset: 1
|
|
2974
|
+
}
|
|
2975
|
+
], {
|
|
2976
|
+
duration: Jn,
|
|
2977
|
+
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
2978
|
+
fill: "none"
|
|
2979
|
+
});
|
|
2980
|
+
}
|
|
2981
|
+
t.current = p, n.current = o;
|
|
2982
|
+
};
|
|
2983
|
+
p(!0);
|
|
2984
|
+
let m = [];
|
|
2985
|
+
if (typeof ResizeObserver < "u") {
|
|
2986
|
+
let e = new ResizeObserver(() => p(!1)), t = new ResizeObserver(() => p(!1));
|
|
2987
|
+
e.observe(d), t.observe(l), m.push(e, t);
|
|
2988
|
+
}
|
|
2989
|
+
let h = () => p(!1);
|
|
2990
|
+
return l.addEventListener("scroll", h, { passive: !0 }), window.addEventListener("resize", h), document.fonts?.ready.then(h).catch(() => void 0), () => {
|
|
2991
|
+
for (let e of m) e.disconnect();
|
|
2992
|
+
l.removeEventListener("scroll", h), window.removeEventListener("resize", h);
|
|
2993
|
+
};
|
|
2994
|
+
}, [
|
|
2995
|
+
l,
|
|
2996
|
+
u,
|
|
2997
|
+
s,
|
|
2998
|
+
o,
|
|
2999
|
+
c
|
|
3000
|
+
]), h(() => ({
|
|
3001
|
+
ref: e,
|
|
3002
|
+
style: i
|
|
3003
|
+
}), [i]);
|
|
3004
|
+
}, Xn = {
|
|
3005
|
+
list: "_list_qtz5q_1",
|
|
3006
|
+
vertical: "_vertical_qtz5q_10",
|
|
3007
|
+
line: "_line_qtz5q_17",
|
|
3008
|
+
pills: "_pills_qtz5q_25",
|
|
3009
|
+
segmented: "_segmented_qtz5q_29",
|
|
3010
|
+
scrollable: "_scrollable_qtz5q_37",
|
|
3011
|
+
indicator: "_indicator_qtz5q_46"
|
|
3012
|
+
}, Zn = ({ className: e, style: t, ...r }) => {
|
|
3013
|
+
let { ref: i, style: a } = Yn();
|
|
3014
|
+
return /* @__PURE__ */ n("span", {
|
|
2906
3015
|
...r,
|
|
3016
|
+
ref: i,
|
|
3017
|
+
"aria-hidden": "true",
|
|
3018
|
+
className: P(Xn.indicator, e),
|
|
3019
|
+
style: {
|
|
3020
|
+
...a,
|
|
3021
|
+
...t
|
|
3022
|
+
}
|
|
3023
|
+
});
|
|
3024
|
+
};
|
|
3025
|
+
Zn.displayName = "Tabs.Indicator";
|
|
3026
|
+
//#endregion
|
|
3027
|
+
//#region src/components/Tabs/List/TabsList.tsx
|
|
3028
|
+
var Qn = ({ children: e, className: t, scrollable: r, ...i }) => {
|
|
3029
|
+
let { orientation: a, variant: o } = Wn(), s = r ?? !1;
|
|
3030
|
+
return /* @__PURE__ */ n("div", {
|
|
3031
|
+
...i,
|
|
2907
3032
|
role: "tablist",
|
|
2908
|
-
"aria-orientation":
|
|
2909
|
-
|
|
3033
|
+
"aria-orientation": a,
|
|
3034
|
+
"data-orientation": a,
|
|
3035
|
+
"data-variant": o,
|
|
3036
|
+
"data-scrollable": s ? "" : void 0,
|
|
3037
|
+
className: P(Xn.list, a === "vertical" && Xn.vertical, o === "line" && Xn.line, o === "pills" && Xn.pills, o === "segmented" && Xn.segmented, s && Xn.scrollable, t),
|
|
2910
3038
|
children: e
|
|
2911
3039
|
});
|
|
2912
3040
|
};
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
3041
|
+
Qn.displayName = "TabsList";
|
|
3042
|
+
//#endregion
|
|
3043
|
+
//#region src/components/Tabs/internal/useTabsCollection.ts
|
|
3044
|
+
var $n = (e) => [...e].sort((e, t) => {
|
|
3045
|
+
if (e.element === t.element) return 0;
|
|
3046
|
+
let n = e.element.compareDocumentPosition(t.element);
|
|
3047
|
+
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
3048
|
+
}), er = () => {
|
|
3049
|
+
let e = g([]), t = g([]), [n, r] = _(0), i = u(() => {
|
|
3050
|
+
r((e) => e + 1);
|
|
3051
|
+
}, []);
|
|
3052
|
+
return {
|
|
3053
|
+
version: n,
|
|
3054
|
+
triggersRef: e,
|
|
3055
|
+
contentsRef: t,
|
|
3056
|
+
registerTrigger: u((t, n, r = !1) => {
|
|
3057
|
+
if (!n) {
|
|
3058
|
+
let n = e.current.findIndex((e) => e.value === t);
|
|
3059
|
+
n >= 0 && (e.current.splice(n, 1), i());
|
|
3060
|
+
return;
|
|
3061
|
+
}
|
|
3062
|
+
let a = {
|
|
3063
|
+
value: t,
|
|
3064
|
+
element: n,
|
|
3065
|
+
disabled: r
|
|
3066
|
+
}, o = e.current.findIndex((e) => e.element === n);
|
|
3067
|
+
o >= 0 ? e.current[o] = a : e.current.push(a), e.current = $n(e.current), i();
|
|
3068
|
+
}, [i]),
|
|
3069
|
+
registerContent: u((e, n) => {
|
|
3070
|
+
let r = t.current.findIndex((t) => t.value === e);
|
|
3071
|
+
if (!n) {
|
|
3072
|
+
r >= 0 && (t.current.splice(r, 1), i());
|
|
3073
|
+
return;
|
|
3074
|
+
}
|
|
3075
|
+
r < 0 && (t.current.push({ value: e }), i());
|
|
3076
|
+
}, [i])
|
|
3077
|
+
};
|
|
3078
|
+
}, tr = ({ focusedValue: e, setValue: t, setFocusedValue: n, getTabs: r, orientation: i, activationMode: a, dir: o, loop: s }) => ({ onKeyDown: (c) => {
|
|
3079
|
+
let l = r().filter((e) => !e.disabled);
|
|
3080
|
+
if (l.length === 0) return;
|
|
3081
|
+
let u = l.findIndex((e) => e.element === document.activeElement), d = l.findIndex((t) => t.value === e), f = u >= 0 ? u : d >= 0 ? d : 0, p = (e) => {
|
|
3082
|
+
let r = l[e];
|
|
3083
|
+
r && (c.preventDefault(), n(r.value), r.element.focus(), r.element.scrollIntoView?.({
|
|
3084
|
+
block: "nearest",
|
|
3085
|
+
inline: "nearest"
|
|
3086
|
+
}), a === "automatic" && t(r.value));
|
|
3087
|
+
}, m = () => f < l.length - 1 ? f + 1 : s ? 0 : f, h = () => f > 0 ? f - 1 : s ? l.length - 1 : f;
|
|
3088
|
+
switch (c.key) {
|
|
3089
|
+
case "ArrowRight":
|
|
3090
|
+
i === "horizontal" && p(o === "rtl" ? h() : m());
|
|
3091
|
+
break;
|
|
3092
|
+
case "ArrowLeft":
|
|
3093
|
+
i === "horizontal" && p(o === "rtl" ? m() : h());
|
|
3094
|
+
break;
|
|
3095
|
+
case "ArrowDown":
|
|
3096
|
+
i === "vertical" && p(m());
|
|
3097
|
+
break;
|
|
3098
|
+
case "ArrowUp":
|
|
3099
|
+
i === "vertical" && p(h());
|
|
3100
|
+
break;
|
|
3101
|
+
case "Home":
|
|
3102
|
+
p(0);
|
|
3103
|
+
break;
|
|
3104
|
+
case "End":
|
|
3105
|
+
p(l.length - 1);
|
|
3106
|
+
break;
|
|
3107
|
+
case "Enter":
|
|
3108
|
+
case " ":
|
|
3109
|
+
if (a === "manual") {
|
|
3110
|
+
let e = l.find((e) => e.element === document.activeElement);
|
|
3111
|
+
e && (c.preventDefault(), n(e.value), t(e.value));
|
|
3112
|
+
}
|
|
3113
|
+
break;
|
|
3114
|
+
}
|
|
3115
|
+
} }), nr = {
|
|
3116
|
+
tabs: "_tabs_1hj56_1",
|
|
3117
|
+
vertical: "_vertical_1hj56_30"
|
|
3118
|
+
}, rr = ({ children: e, value: t, defaultValue: r, onValueChange: i, orientation: a = "horizontal", activationMode: o = "automatic", dir: s = "ltr", loop: c = !0, variant: l = "line", color: d = "primary", size: m = "md", keepMounted: h = !1, lazyMount: v = !1, disabled: y = !1, className: b, ...x }) => {
|
|
3119
|
+
let S = p(), C = t !== void 0, { value: w, setValue: T } = W({
|
|
3120
|
+
value: t,
|
|
3121
|
+
defaultValue: r,
|
|
3122
|
+
onValueChange: i
|
|
3123
|
+
}), E = g(w), D = g(void 0), O = g(void 0), [k, A] = _(w), { version: j, triggersRef: M, contentsRef: N, registerTrigger: F, registerContent: I } = er(), L = u((e, t, n = !1) => {
|
|
3124
|
+
if (!t) {
|
|
3125
|
+
let t = E.current, n = M.current, r = n.findIndex((t) => t.value === e);
|
|
3126
|
+
if (t === e && r >= 0) {
|
|
3127
|
+
let t = n.filter((t) => !t.disabled && t.value !== e), i = t.find((e) => n.findIndex((t) => t.value === e.value) > r), a = [...t].reverse().find((e) => n.findIndex((t) => t.value === e.value) < r);
|
|
3128
|
+
D.current = i?.value ?? a?.value, !C && D.current && (T(D.current), A(D.current), D.current = void 0);
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
F(e, t, y || n);
|
|
3132
|
+
}, [
|
|
3133
|
+
y,
|
|
3134
|
+
C,
|
|
3135
|
+
F,
|
|
3136
|
+
A,
|
|
3137
|
+
T,
|
|
3138
|
+
M
|
|
3139
|
+
]), { onKeyDown: R } = tr({
|
|
3140
|
+
focusedValue: k,
|
|
3141
|
+
setValue: T,
|
|
3142
|
+
setFocusedValue: A,
|
|
3143
|
+
getTabs: () => M.current,
|
|
3144
|
+
orientation: a,
|
|
3145
|
+
activationMode: o,
|
|
3146
|
+
dir: s,
|
|
3147
|
+
loop: c
|
|
3148
|
+
}), z = {
|
|
3149
|
+
value: w,
|
|
3150
|
+
focusedValue: k,
|
|
3151
|
+
collectionVersion: j,
|
|
3152
|
+
setValue: T,
|
|
3153
|
+
setFocusedValue: A,
|
|
3154
|
+
orientation: a,
|
|
3155
|
+
activationMode: o,
|
|
3156
|
+
dir: s,
|
|
3157
|
+
loop: c,
|
|
3158
|
+
variant: l,
|
|
3159
|
+
color: d,
|
|
3160
|
+
size: m,
|
|
3161
|
+
keepMounted: h,
|
|
3162
|
+
lazyMount: v,
|
|
3163
|
+
disabled: y,
|
|
3164
|
+
registerTrigger: L,
|
|
3165
|
+
registerContent: I,
|
|
3166
|
+
onTriggerKeyDown: R,
|
|
3167
|
+
getTriggerId: u((e) => `${S}-trigger-${e}`, [S]),
|
|
3168
|
+
getContentId: u((e) => `${S}-content-${e}`, [S])
|
|
3169
|
+
};
|
|
2920
3170
|
return f(() => {
|
|
2921
|
-
|
|
2922
|
-
|
|
3171
|
+
E.current = w;
|
|
3172
|
+
}, [w]), f(() => {
|
|
3173
|
+
let e = M.current.filter((e) => !e.disabled), t = e.find((e) => e.value === w), n = M.current.some((e) => e.value === w), r = D.current ?? e[0]?.value;
|
|
3174
|
+
if (D.current = void 0, C) {
|
|
3175
|
+
process.env.NODE_ENV !== "production" && w && !n && M.current.length > 0 && console.warn(`Tabs: value "${w}" does not match any Tabs.Trigger.`), !t && !k && e[0] && A(e[0].value);
|
|
2923
3176
|
return;
|
|
2924
3177
|
}
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
3178
|
+
if (!w || !n) {
|
|
3179
|
+
r ? (T(r), A(r)) : A(void 0);
|
|
3180
|
+
return;
|
|
3181
|
+
}
|
|
3182
|
+
t && O.current !== w && (A(w), O.current = w);
|
|
3183
|
+
}, [
|
|
3184
|
+
k,
|
|
3185
|
+
C,
|
|
3186
|
+
T,
|
|
3187
|
+
M,
|
|
3188
|
+
w,
|
|
3189
|
+
j
|
|
3190
|
+
]), f(() => {
|
|
3191
|
+
if (process.env.NODE_ENV === "production") return;
|
|
3192
|
+
let e = M.current.map((e) => e.value), t = N.current.map((e) => e.value), n = e.find((t, n) => e.indexOf(t) !== n);
|
|
3193
|
+
n && console.warn(`Tabs.Trigger values must be unique. Duplicate value: "${n}".`);
|
|
3194
|
+
for (let n of e) t.includes(n) || console.warn(`Tabs.Trigger value "${n}" does not match any Tabs.Content.`);
|
|
3195
|
+
for (let n of t) e.includes(n) || console.warn(`Tabs.Content value "${n}" does not match any Tabs.Trigger.`);
|
|
3196
|
+
}, [
|
|
3197
|
+
N,
|
|
3198
|
+
M,
|
|
3199
|
+
j
|
|
3200
|
+
]), /* @__PURE__ */ n(Un.Provider, {
|
|
3201
|
+
value: z,
|
|
3202
|
+
children: /* @__PURE__ */ n("div", {
|
|
3203
|
+
...x,
|
|
3204
|
+
className: P(nr.tabs, a === "vertical" && nr.vertical, b),
|
|
3205
|
+
"data-orientation": a,
|
|
3206
|
+
dir: s,
|
|
3207
|
+
"data-variant": l,
|
|
3208
|
+
"data-color": d,
|
|
3209
|
+
"data-size": m,
|
|
3210
|
+
"data-disabled": y ? "" : void 0,
|
|
3211
|
+
children: e
|
|
3212
|
+
})
|
|
2935
3213
|
});
|
|
2936
3214
|
};
|
|
2937
|
-
|
|
2938
|
-
var
|
|
2939
|
-
|
|
2940
|
-
iconOnly: "
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
3215
|
+
rr.displayName = "Tabs";
|
|
3216
|
+
var ir = {
|
|
3217
|
+
trigger: "_trigger_usnq2_1",
|
|
3218
|
+
iconOnly: "_iconOnly_usnq2_30",
|
|
3219
|
+
icon: "_icon_usnq2_30",
|
|
3220
|
+
body: "_body_usnq2_48",
|
|
3221
|
+
label: "_label_usnq2_56",
|
|
3222
|
+
description: "_description_usnq2_63",
|
|
3223
|
+
badge: "_badge_usnq2_69",
|
|
3224
|
+
sm: "_sm_usnq2_84",
|
|
3225
|
+
md: "_md_usnq2_97",
|
|
3226
|
+
lg: "_lg_usnq2_101",
|
|
3227
|
+
segmented: "_segmented_usnq2_118",
|
|
3228
|
+
line: "_line_usnq2_144",
|
|
3229
|
+
pills: "_pills_usnq2_156",
|
|
3230
|
+
vertical: "_vertical_usnq2_179"
|
|
3231
|
+
}, ar = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3232
|
+
className: P(ir.badge, t),
|
|
3233
|
+
children: e
|
|
3234
|
+
});
|
|
3235
|
+
ar.displayName = "Tabs.Badge";
|
|
3236
|
+
//#endregion
|
|
3237
|
+
//#region src/components/Tabs/Trigger/TabsIcon.tsx
|
|
3238
|
+
var or = ({ children: e, className: t }) => /* @__PURE__ */ n("span", {
|
|
3239
|
+
className: P(ir.icon, t),
|
|
3240
|
+
"aria-hidden": "true",
|
|
3241
|
+
children: e
|
|
3242
|
+
});
|
|
3243
|
+
or.displayName = "Tabs.Icon";
|
|
3244
|
+
//#endregion
|
|
3245
|
+
//#region src/components/Tabs/Trigger/TabsTrigger.tsx
|
|
3246
|
+
var sr = c(({ value: e, children: t, className: a, disabled: o = !1, icon: s, badge: c, description: d, onClick: f, onKeyDown: p, ...m }, h) => {
|
|
3247
|
+
let { value: g, focusedValue: _, setValue: v, setFocusedValue: y, orientation: b, variant: x, size: S, disabled: C, registerTrigger: w, onTriggerKeyDown: T, getTriggerId: E, getContentId: D } = Wn(), O = C || o, k = g === e, A = _ === e || !_ && k, j = i.toArray(t).some((e) => l(e) && e.type.displayName === "Tabs.Icon"), M = !!s, N = (M || j) && t == null;
|
|
3248
|
+
process.env.NODE_ENV !== "production" && M && j && console.warn(`Tabs.Trigger value "${e}" received both icon and Tabs.Icon. Tabs.Icon takes precedence.`);
|
|
3249
|
+
let F = u((t) => {
|
|
3250
|
+
w(e, t, O), typeof h == "function" ? h(t) : h && (h.current = t);
|
|
3251
|
+
}, [
|
|
3252
|
+
O,
|
|
3253
|
+
h,
|
|
3254
|
+
w,
|
|
3255
|
+
e
|
|
3256
|
+
]), I = M && !j || c || d;
|
|
2949
3257
|
return /* @__PURE__ */ r("button", {
|
|
3258
|
+
...m,
|
|
3259
|
+
ref: F,
|
|
2950
3260
|
type: "button",
|
|
2951
|
-
ref: u((t) => {
|
|
2952
|
-
g(e, t), typeof d == "function" ? d(t) : d && (d.current = t);
|
|
2953
|
-
}, [
|
|
2954
|
-
g,
|
|
2955
|
-
e,
|
|
2956
|
-
d
|
|
2957
|
-
]),
|
|
2958
3261
|
role: "tab",
|
|
2959
|
-
|
|
2960
|
-
"aria-
|
|
2961
|
-
|
|
2962
|
-
disabled:
|
|
2963
|
-
tabIndex:
|
|
2964
|
-
|
|
3262
|
+
id: E(e),
|
|
3263
|
+
"aria-selected": k,
|
|
3264
|
+
"aria-controls": D(e),
|
|
3265
|
+
disabled: O,
|
|
3266
|
+
tabIndex: A ? 0 : -1,
|
|
3267
|
+
"data-state": k ? "active" : "inactive",
|
|
3268
|
+
"data-orientation": b,
|
|
3269
|
+
"data-disabled": O ? "" : void 0,
|
|
3270
|
+
className: P(ir.trigger, ir[x], ir[S], b === "vertical" && ir.vertical, M && ir.withIcon, N && ir.iconOnly, a),
|
|
2965
3271
|
onClick: (t) => {
|
|
2966
|
-
|
|
3272
|
+
f?.(t), !(t.defaultPrevented || O) && (y(e), v(e));
|
|
2967
3273
|
},
|
|
2968
3274
|
onKeyDown: (e) => {
|
|
2969
|
-
|
|
3275
|
+
p?.(e), !e.defaultPrevented && T(e);
|
|
2970
3276
|
},
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
3277
|
+
children: [
|
|
3278
|
+
M && !j && /* @__PURE__ */ n("span", {
|
|
3279
|
+
className: ir.icon,
|
|
3280
|
+
"aria-hidden": "true",
|
|
3281
|
+
children: s
|
|
3282
|
+
}),
|
|
3283
|
+
t != null && (I ? /* @__PURE__ */ r("span", {
|
|
3284
|
+
className: ir.body,
|
|
3285
|
+
children: [/* @__PURE__ */ n("span", {
|
|
3286
|
+
className: ir.label,
|
|
3287
|
+
children: t
|
|
3288
|
+
}), d != null && /* @__PURE__ */ n("span", {
|
|
3289
|
+
className: ir.description,
|
|
3290
|
+
children: d
|
|
3291
|
+
})]
|
|
3292
|
+
}) : t),
|
|
3293
|
+
c != null && /* @__PURE__ */ n("span", {
|
|
3294
|
+
className: ir.badge,
|
|
3295
|
+
children: c
|
|
3296
|
+
})
|
|
3297
|
+
]
|
|
2980
3298
|
});
|
|
2981
3299
|
});
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
activeIndex: c,
|
|
2995
|
-
setActiveIndex: l,
|
|
2996
|
-
tabRefs: d,
|
|
2997
|
-
orientation: a,
|
|
2998
|
-
onNavigate: (e) => {
|
|
2999
|
-
d.current[e]?.focus();
|
|
3000
|
-
}
|
|
3001
|
-
}), m = {
|
|
3002
|
-
activeIndex: c,
|
|
3003
|
-
setActiveIndex: l,
|
|
3004
|
-
orientation: a,
|
|
3005
|
-
appearance: o,
|
|
3006
|
-
registerTab: f,
|
|
3007
|
-
onTabKeyDown: p
|
|
3008
|
-
};
|
|
3009
|
-
return /* @__PURE__ */ n(Un.Provider, {
|
|
3010
|
-
value: m,
|
|
3011
|
-
children: /* @__PURE__ */ n("div", {
|
|
3012
|
-
className: N(Zn.tabs, a === "vertical" && Zn.vertical, s),
|
|
3013
|
-
children: e
|
|
3014
|
-
})
|
|
3015
|
-
});
|
|
3016
|
-
};
|
|
3017
|
-
Qn.displayName = "Tabs";
|
|
3300
|
+
sr.displayName = "Tabs.Trigger";
|
|
3301
|
+
//#endregion
|
|
3302
|
+
//#region src/components/Tabs/Tabs.tsx
|
|
3303
|
+
var cr = Object.assign(rr, {
|
|
3304
|
+
List: Qn,
|
|
3305
|
+
Trigger: sr,
|
|
3306
|
+
Content: Kn,
|
|
3307
|
+
Indicator: Zn,
|
|
3308
|
+
Icon: or,
|
|
3309
|
+
Badge: ar
|
|
3310
|
+
});
|
|
3311
|
+
cr.displayName = "Tabs";
|
|
3018
3312
|
//#endregion
|
|
3019
|
-
//#region src/components/
|
|
3020
|
-
var
|
|
3021
|
-
List: Kn,
|
|
3022
|
-
Tab: Xn,
|
|
3023
|
-
Panel: Jn
|
|
3024
|
-
}), er = s(null), tr = s({
|
|
3313
|
+
//#region src/components/Tooltip/internal/TooltipContext.tsx
|
|
3314
|
+
var lr = s(null), ur = s({
|
|
3025
3315
|
delay: {
|
|
3026
3316
|
open: 300,
|
|
3027
3317
|
close: 100
|
|
3028
3318
|
},
|
|
3029
3319
|
skipDelay: 300
|
|
3030
|
-
}),
|
|
3320
|
+
}), dr = lr.Provider, fr = ({ children: e, delay: t = 700, skipDelay: r = 300 }) => {
|
|
3031
3321
|
let i = typeof t == "number" ? {
|
|
3032
3322
|
open: t,
|
|
3033
3323
|
close: 100
|
|
3034
3324
|
} : t;
|
|
3035
|
-
return /* @__PURE__ */ n(
|
|
3325
|
+
return /* @__PURE__ */ n(ur.Provider, {
|
|
3036
3326
|
value: {
|
|
3037
3327
|
delay: i,
|
|
3038
3328
|
skipDelay: r
|
|
@@ -3040,21 +3330,19 @@ var $n = Object.assign(Qn, {
|
|
|
3040
3330
|
children: e
|
|
3041
3331
|
});
|
|
3042
3332
|
};
|
|
3043
|
-
function
|
|
3044
|
-
let e = d(
|
|
3333
|
+
function pr() {
|
|
3334
|
+
let e = d(lr);
|
|
3045
3335
|
if (!e) throw Error("Tooltip compound components must be rendered inside Tooltip");
|
|
3046
3336
|
return e;
|
|
3047
3337
|
}
|
|
3048
|
-
function
|
|
3049
|
-
return d(
|
|
3338
|
+
function mr() {
|
|
3339
|
+
return d(ur);
|
|
3050
3340
|
}
|
|
3051
|
-
var
|
|
3052
|
-
tooltip: "
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
}, sr = ({ className: e, style: t, ...r }) => {
|
|
3057
|
-
let i = ir(), a = {
|
|
3341
|
+
var hr = {
|
|
3342
|
+
tooltip: "_tooltip_raj0t_1",
|
|
3343
|
+
arrow: "_arrow_raj0t_25"
|
|
3344
|
+
}, gr = ({ className: e, style: t, ...r }) => {
|
|
3345
|
+
let i = pr(), a = {
|
|
3058
3346
|
top: "bottom",
|
|
3059
3347
|
right: "left",
|
|
3060
3348
|
bottom: "top",
|
|
@@ -3063,24 +3351,24 @@ var or = {
|
|
|
3063
3351
|
return /* @__PURE__ */ n("div", {
|
|
3064
3352
|
...r,
|
|
3065
3353
|
ref: i.arrowRef,
|
|
3066
|
-
className:
|
|
3354
|
+
className: P(hr.arrow, e),
|
|
3067
3355
|
style: {
|
|
3068
3356
|
left: i.arrowX == null ? void 0 : `${i.arrowX}px`,
|
|
3069
3357
|
top: i.arrowY == null ? void 0 : `${i.arrowY}px`,
|
|
3070
|
-
[a]: "-
|
|
3358
|
+
[a]: "calc(var(--tooltip-arrow-size) / -2)",
|
|
3071
3359
|
...t
|
|
3072
3360
|
}
|
|
3073
3361
|
});
|
|
3074
3362
|
};
|
|
3075
|
-
|
|
3363
|
+
gr.displayName = "Tooltip.Arrow";
|
|
3076
3364
|
//#endregion
|
|
3077
3365
|
//#region src/components/Tooltip/internal/composeEventHandlers.ts
|
|
3078
|
-
function
|
|
3366
|
+
function _r(e, t) {
|
|
3079
3367
|
return (n) => {
|
|
3080
3368
|
e?.(n), n.defaultPrevented || t?.(n);
|
|
3081
3369
|
};
|
|
3082
3370
|
}
|
|
3083
|
-
function
|
|
3371
|
+
function vr(...e) {
|
|
3084
3372
|
return (t) => {
|
|
3085
3373
|
e.forEach((e) => {
|
|
3086
3374
|
if (e) {
|
|
@@ -3095,30 +3383,30 @@ function lr(...e) {
|
|
|
3095
3383
|
}
|
|
3096
3384
|
//#endregion
|
|
3097
3385
|
//#region src/components/Tooltip/Content/TooltipContent.tsx
|
|
3098
|
-
var
|
|
3099
|
-
let
|
|
3100
|
-
return !
|
|
3101
|
-
...
|
|
3102
|
-
id:
|
|
3386
|
+
var yr = c(({ children: e, forceMount: t = !1, className: r, style: i, ...a }, o) => {
|
|
3387
|
+
let s = pr();
|
|
3388
|
+
return !t && !s.open ? null : /* @__PURE__ */ n("div", {
|
|
3389
|
+
...s.getContentProps({
|
|
3390
|
+
id: s.contentId,
|
|
3103
3391
|
role: "tooltip",
|
|
3104
|
-
...
|
|
3392
|
+
...a
|
|
3105
3393
|
}),
|
|
3106
|
-
ref:
|
|
3107
|
-
className:
|
|
3108
|
-
"data-placement":
|
|
3109
|
-
"data-state":
|
|
3394
|
+
ref: vr(o, s.setContentRef),
|
|
3395
|
+
className: P(hr.tooltip, r),
|
|
3396
|
+
"data-placement": s.placement,
|
|
3397
|
+
"data-state": s.open ? "open" : "closed",
|
|
3110
3398
|
style: {
|
|
3111
|
-
...
|
|
3112
|
-
...
|
|
3399
|
+
...s.floatingStyles,
|
|
3400
|
+
...i
|
|
3113
3401
|
},
|
|
3114
3402
|
children: e
|
|
3115
3403
|
});
|
|
3116
3404
|
});
|
|
3117
|
-
|
|
3405
|
+
yr.displayName = "Tooltip.Content";
|
|
3118
3406
|
//#endregion
|
|
3119
3407
|
//#region src/components/Tooltip/internal/useTooltipDelay.ts
|
|
3120
|
-
function
|
|
3121
|
-
let n =
|
|
3408
|
+
function br(e, t) {
|
|
3409
|
+
let n = mr();
|
|
3122
3410
|
return e == null ? n.delay : typeof e == "number" ? {
|
|
3123
3411
|
open: e,
|
|
3124
3412
|
close: n.delay.close
|
|
@@ -3129,25 +3417,25 @@ function dr(e, t) {
|
|
|
3129
3417
|
}
|
|
3130
3418
|
//#endregion
|
|
3131
3419
|
//#region src/components/Tooltip/internal/useTooltipInteractions.ts
|
|
3132
|
-
function
|
|
3133
|
-
return
|
|
3420
|
+
function xr({ context: e, delay: t, disabled: n, interactive: r }) {
|
|
3421
|
+
return N([M(e, {
|
|
3134
3422
|
delay: t,
|
|
3135
3423
|
enabled: !n,
|
|
3136
3424
|
move: !1,
|
|
3137
3425
|
handleClose: r ? void 0 : null
|
|
3138
|
-
}),
|
|
3426
|
+
}), j(e, { enabled: !n })]);
|
|
3139
3427
|
}
|
|
3140
3428
|
//#endregion
|
|
3141
3429
|
//#region src/components/Tooltip/internal/useTooltipPosition.ts
|
|
3142
|
-
function
|
|
3143
|
-
let o =
|
|
3430
|
+
function Sr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions: i, matchTriggerWidth: a }) {
|
|
3431
|
+
let o = g(null), s = et({
|
|
3144
3432
|
open: e,
|
|
3145
3433
|
onOpenChange: t,
|
|
3146
3434
|
placement: n,
|
|
3147
3435
|
offset: r,
|
|
3148
3436
|
avoidCollisions: i,
|
|
3149
3437
|
matchTriggerWidth: a,
|
|
3150
|
-
middleware: [
|
|
3438
|
+
middleware: [w({ element: o })]
|
|
3151
3439
|
});
|
|
3152
3440
|
return {
|
|
3153
3441
|
...s,
|
|
@@ -3158,30 +3446,30 @@ function pr({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
3158
3446
|
}
|
|
3159
3447
|
//#endregion
|
|
3160
3448
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
3161
|
-
var
|
|
3162
|
-
let
|
|
3449
|
+
var Cr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placement: a = "top", offset: o = 8, delay: s, skipDelay: c, disabled: l = !1, interactive: u = !1, avoidCollisions: d = !0, matchTriggerWidth: f = !1, modal: m = !1 }) => {
|
|
3450
|
+
let h = `${p()}-content`, _ = g(null), v = g(null), [y, b] = U({
|
|
3163
3451
|
value: t,
|
|
3164
3452
|
defaultValue: r,
|
|
3165
3453
|
onChange: i
|
|
3166
3454
|
}), x = (e) => {
|
|
3167
3455
|
l || b(e);
|
|
3168
|
-
}, S =
|
|
3456
|
+
}, S = Sr({
|
|
3169
3457
|
open: y,
|
|
3170
3458
|
onOpenChange: x,
|
|
3171
3459
|
placement: a,
|
|
3172
3460
|
offset: o,
|
|
3173
3461
|
avoidCollisions: d,
|
|
3174
3462
|
matchTriggerWidth: f
|
|
3175
|
-
}), C =
|
|
3463
|
+
}), C = br(s, c), w = xr({
|
|
3176
3464
|
context: S.context,
|
|
3177
3465
|
delay: C,
|
|
3178
3466
|
disabled: l,
|
|
3179
3467
|
interactive: u
|
|
3180
|
-
}), { isTopOverlay: T } =
|
|
3468
|
+
}), { isTopOverlay: T } = de({
|
|
3181
3469
|
active: y,
|
|
3182
|
-
id:
|
|
3470
|
+
id: h
|
|
3183
3471
|
});
|
|
3184
|
-
return
|
|
3472
|
+
return ce({
|
|
3185
3473
|
active: y,
|
|
3186
3474
|
contentRef: _,
|
|
3187
3475
|
ignoreRefs: [v],
|
|
@@ -3189,9 +3477,9 @@ var mr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3189
3477
|
closeOnOutsidePress: !u,
|
|
3190
3478
|
isTopOverlay: T,
|
|
3191
3479
|
requestClose: () => x(!1)
|
|
3192
|
-
}), /* @__PURE__ */ n(
|
|
3480
|
+
}), /* @__PURE__ */ n(dr, {
|
|
3193
3481
|
value: {
|
|
3194
|
-
contentId:
|
|
3482
|
+
contentId: h,
|
|
3195
3483
|
open: y,
|
|
3196
3484
|
disabled: l,
|
|
3197
3485
|
interactive: u,
|
|
@@ -3202,34 +3490,34 @@ var mr = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, placemen
|
|
|
3202
3490
|
placement: S.placement,
|
|
3203
3491
|
floatingStyles: S.floatingStyles,
|
|
3204
3492
|
setOpen: x,
|
|
3205
|
-
setTriggerRef:
|
|
3206
|
-
setContentRef:
|
|
3493
|
+
setTriggerRef: vr(v, S.setRef),
|
|
3494
|
+
setContentRef: vr(_, S.setFloatingRef),
|
|
3207
3495
|
getTriggerProps: w.getReferenceProps,
|
|
3208
3496
|
getContentProps: w.getFloatingProps
|
|
3209
3497
|
},
|
|
3210
3498
|
children: e
|
|
3211
3499
|
});
|
|
3212
3500
|
};
|
|
3213
|
-
|
|
3501
|
+
Cr.displayName = "Tooltip.Root";
|
|
3214
3502
|
//#endregion
|
|
3215
3503
|
//#region src/components/Tooltip/Trigger/TooltipTrigger.tsx
|
|
3216
|
-
var
|
|
3217
|
-
let s =
|
|
3504
|
+
var wr = ({ asChild: e = !1, children: t, disabled: r = !1, className: i, ...a }) => {
|
|
3505
|
+
let s = pr(), c = e && l(t) ? t : void 0, u = s.disabled || r || c?.props.disabled, d = s.getTriggerProps({
|
|
3218
3506
|
...a,
|
|
3219
3507
|
"aria-describedby": s.open ? s.contentId : void 0,
|
|
3220
3508
|
"aria-disabled": u || void 0,
|
|
3221
3509
|
"data-state": s.open ? "open" : "closed"
|
|
3222
3510
|
}), f = {
|
|
3223
3511
|
...d,
|
|
3224
|
-
ref: c ?
|
|
3225
|
-
className:
|
|
3512
|
+
ref: c ? vr(c.props.ref, s.setTriggerRef) : s.setTriggerRef,
|
|
3513
|
+
className: P(c?.props.className, i),
|
|
3226
3514
|
disabled: u || void 0,
|
|
3227
|
-
onMouseEnter:
|
|
3228
|
-
onMouseLeave:
|
|
3229
|
-
onPointerEnter:
|
|
3230
|
-
onPointerLeave:
|
|
3231
|
-
onFocus:
|
|
3232
|
-
onBlur:
|
|
3515
|
+
onMouseEnter: _r(c?.props.onMouseEnter, d.onMouseEnter),
|
|
3516
|
+
onMouseLeave: _r(c?.props.onMouseLeave, d.onMouseLeave),
|
|
3517
|
+
onPointerEnter: _r(c?.props.onPointerEnter, d.onPointerEnter),
|
|
3518
|
+
onPointerLeave: _r(c?.props.onPointerLeave, d.onPointerLeave),
|
|
3519
|
+
onFocus: _r(c?.props.onFocus, d.onFocus),
|
|
3520
|
+
onBlur: _r(c?.props.onBlur, d.onBlur)
|
|
3233
3521
|
};
|
|
3234
3522
|
return c ? o(c, f) : /* @__PURE__ */ n("button", {
|
|
3235
3523
|
type: "button",
|
|
@@ -3237,19 +3525,19 @@ var hr = ({ asChild: e = !1, children: t, disabled: r = !1, className: i, ...a }
|
|
|
3237
3525
|
children: t
|
|
3238
3526
|
});
|
|
3239
3527
|
};
|
|
3240
|
-
|
|
3528
|
+
wr.displayName = "Tooltip.Trigger";
|
|
3241
3529
|
//#endregion
|
|
3242
3530
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
3243
|
-
var
|
|
3244
|
-
Trigger:
|
|
3245
|
-
Content:
|
|
3246
|
-
Arrow:
|
|
3247
|
-
Provider:
|
|
3531
|
+
var Tr = Object.assign(Cr, {
|
|
3532
|
+
Trigger: wr,
|
|
3533
|
+
Content: yr,
|
|
3534
|
+
Arrow: gr,
|
|
3535
|
+
Provider: fr
|
|
3248
3536
|
});
|
|
3249
|
-
|
|
3537
|
+
Tr.displayName = "Tooltip";
|
|
3250
3538
|
//#endregion
|
|
3251
3539
|
//#region src/utils/devWarning.ts
|
|
3252
|
-
var
|
|
3540
|
+
var Er = (e, t) => {
|
|
3253
3541
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
3254
3542
|
}, Z = {
|
|
3255
3543
|
button: "_button_1b73n_1",
|
|
@@ -3279,14 +3567,14 @@ var _r = (e, t) => {
|
|
|
3279
3567
|
"button-spin": "_button-spin_1b73n_1",
|
|
3280
3568
|
badge: "_badge_1b73n_812",
|
|
3281
3569
|
shortcut: "_shortcut_1b73n_826"
|
|
3282
|
-
},
|
|
3283
|
-
let L = S && l(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(m || h), ee = !!(T || E || L?.props["aria-label"] || L?.props["aria-labelledby"]), B = d || f, te = f && p ? p : R, ne = p && R && !z && (typeof R == "string" || typeof R == "number") && (typeof p == "string" || typeof p == "number") ? String(f ? R : p) : void 0, re = O === "_blank" && !k ? "noreferrer noopener" : k, ie =
|
|
3570
|
+
}, Dr = c(({ children: e, color: i = "primary", appearance: a = "solid", size: s = "md", shape: c = "pill", type: u = "button", disabled: d = !1, loading: f = !1, loadingText: p, iconStart: m, iconEnd: h, spinner: g, badge: _, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: N, ...F }, I) => {
|
|
3571
|
+
let L = S && l(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(m || h), ee = !!(T || E || L?.props["aria-label"] || L?.props["aria-labelledby"]), B = d || f, te = f && p ? p : R, ne = p && R && !z && (typeof R == "string" || typeof R == "number") && (typeof p == "string" || typeof p == "number") ? String(f ? R : p) : void 0, re = O === "_blank" && !k ? "noreferrer noopener" : k, ie = P(Z.button, Z[i], Z[a], Z[s], Z[c], C, {
|
|
3284
3572
|
[Z.disabled]: B,
|
|
3285
3573
|
[Z.loading]: f,
|
|
3286
3574
|
[Z.fullWidth]: b,
|
|
3287
3575
|
[Z.iconOnly]: z
|
|
3288
3576
|
});
|
|
3289
|
-
|
|
3577
|
+
Er(!S || !D, "Button: pass href to the child element when using asChild."), Er(!S || !!L, "Button: asChild requires a single valid React element child."), Er(!z || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
3290
3578
|
let ae = (e) => {
|
|
3291
3579
|
e.preventDefault(), e.stopPropagation();
|
|
3292
3580
|
}, oe = (e) => {
|
|
@@ -3336,7 +3624,7 @@ var _r = (e, t) => {
|
|
|
3336
3624
|
"aria-disabled": B || void 0,
|
|
3337
3625
|
"aria-label": T || L.props["aria-label"] || void 0,
|
|
3338
3626
|
"aria-labelledby": E || L.props["aria-labelledby"] || void 0,
|
|
3339
|
-
className:
|
|
3627
|
+
className: P(L.props.className, ie),
|
|
3340
3628
|
href: B ? void 0 : L.props.href,
|
|
3341
3629
|
onClick: oe,
|
|
3342
3630
|
tabIndex: B ? -1 : L.props.tabIndex,
|
|
@@ -3347,7 +3635,7 @@ var _r = (e, t) => {
|
|
|
3347
3635
|
href: B ? void 0 : D,
|
|
3348
3636
|
id: j,
|
|
3349
3637
|
role: M,
|
|
3350
|
-
tabIndex: B ? -1 :
|
|
3638
|
+
tabIndex: B ? -1 : N,
|
|
3351
3639
|
target: O,
|
|
3352
3640
|
rel: re,
|
|
3353
3641
|
download: A,
|
|
@@ -3364,7 +3652,7 @@ var _r = (e, t) => {
|
|
|
3364
3652
|
ref: I,
|
|
3365
3653
|
id: j,
|
|
3366
3654
|
role: M,
|
|
3367
|
-
tabIndex:
|
|
3655
|
+
tabIndex: N,
|
|
3368
3656
|
type: u,
|
|
3369
3657
|
disabled: B,
|
|
3370
3658
|
onClick: B ? void 0 : w,
|
|
@@ -3376,7 +3664,7 @@ var _r = (e, t) => {
|
|
|
3376
3664
|
children: V
|
|
3377
3665
|
});
|
|
3378
3666
|
});
|
|
3379
|
-
|
|
3667
|
+
Dr.displayName = "Button";
|
|
3380
3668
|
var Q = {
|
|
3381
3669
|
wrapper: "_wrapper_1kk5v_1",
|
|
3382
3670
|
colorPrimary: "_colorPrimary_1kk5v_27",
|
|
@@ -3412,28 +3700,28 @@ var Q = {
|
|
|
3412
3700
|
"checkbox-checkmark-in": "_checkbox-checkmark-in_1kk5v_1",
|
|
3413
3701
|
"checkbox-indeterminate-in": "_checkbox-indeterminate-in_1kk5v_1",
|
|
3414
3702
|
disabled: "_disabled_1kk5v_361"
|
|
3415
|
-
},
|
|
3703
|
+
}, Or = {
|
|
3416
3704
|
sm: Q.labelSm,
|
|
3417
3705
|
md: Q.labelMd,
|
|
3418
3706
|
lg: Q.labelLg
|
|
3419
|
-
},
|
|
3707
|
+
}, kr = {
|
|
3420
3708
|
sm: Q.wrapperSm,
|
|
3421
3709
|
md: Q.wrapperMd,
|
|
3422
3710
|
lg: Q.wrapperLg
|
|
3423
|
-
},
|
|
3711
|
+
}, Ar = {
|
|
3424
3712
|
sm: Q.containerSm,
|
|
3425
3713
|
md: Q.containerMd,
|
|
3426
3714
|
lg: Q.containerLg
|
|
3427
|
-
},
|
|
3715
|
+
}, jr = {
|
|
3428
3716
|
primary: Q.colorPrimary,
|
|
3429
3717
|
neutral: Q.colorNeutral,
|
|
3430
3718
|
success: Q.colorSuccess,
|
|
3431
3719
|
warning: Q.colorWarning,
|
|
3432
3720
|
danger: Q.colorDanger
|
|
3433
|
-
},
|
|
3434
|
-
let k = p(), A = e ?? k, j =
|
|
3721
|
+
}, Mr = c(({ id: e, label: t, description: i, icon: a, indeterminateIcon: o, checked: s, size: c = "md", color: l = "primary", labelPosition: d = "end", defaultChecked: m = !1, disabled: h = !1, required: _ = !1, indeterminate: v = !1, className: b, wrapperClassName: x, onCheckedChange: S, error: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, ...D }, O) => {
|
|
3722
|
+
let k = p(), A = e ?? k, j = g(null), M = !!C, N = i ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
|
|
3435
3723
|
E,
|
|
3436
|
-
|
|
3724
|
+
N,
|
|
3437
3725
|
F
|
|
3438
3726
|
].filter(Boolean).join(" "), [L, R] = U({
|
|
3439
3727
|
value: s,
|
|
@@ -3447,17 +3735,17 @@ var Q = {
|
|
|
3447
3735
|
O && (O.current = e);
|
|
3448
3736
|
}, [O]);
|
|
3449
3737
|
f(() => {
|
|
3450
|
-
j.current && (j.current.indeterminate =
|
|
3451
|
-
}, [
|
|
3738
|
+
j.current && (j.current.indeterminate = v);
|
|
3739
|
+
}, [v]);
|
|
3452
3740
|
let ee = (e) => {
|
|
3453
3741
|
R(e.target.checked);
|
|
3454
3742
|
};
|
|
3455
|
-
return
|
|
3456
|
-
className:
|
|
3743
|
+
return Er(!!(t || w || T), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ r("div", {
|
|
3744
|
+
className: P(Q.container, Ar[c], d === "start" && Q.containerLabelStart, b),
|
|
3457
3745
|
children: [
|
|
3458
3746
|
/* @__PURE__ */ r("label", {
|
|
3459
3747
|
htmlFor: A,
|
|
3460
|
-
className:
|
|
3748
|
+
className: P(Q.wrapper, kr[c], jr[l], d === "start" && Q.labelStart, !t && Q.iconOnly, h && Q.disabled, x),
|
|
3461
3749
|
children: [
|
|
3462
3750
|
/* @__PURE__ */ n("input", {
|
|
3463
3751
|
...D,
|
|
@@ -3465,29 +3753,29 @@ var Q = {
|
|
|
3465
3753
|
id: A,
|
|
3466
3754
|
type: "checkbox",
|
|
3467
3755
|
checked: L,
|
|
3468
|
-
disabled:
|
|
3756
|
+
disabled: h,
|
|
3469
3757
|
required: _,
|
|
3470
3758
|
onChange: ee,
|
|
3471
3759
|
className: Q.input,
|
|
3472
3760
|
"aria-label": w,
|
|
3473
3761
|
"aria-labelledby": T,
|
|
3474
|
-
"aria-checked":
|
|
3762
|
+
"aria-checked": v ? "mixed" : D["aria-checked"],
|
|
3475
3763
|
"aria-invalid": M ? !0 : D["aria-invalid"],
|
|
3476
3764
|
"aria-describedby": I || void 0
|
|
3477
3765
|
}),
|
|
3478
3766
|
/* @__PURE__ */ n("span", {
|
|
3479
|
-
className:
|
|
3767
|
+
className: P(Q.customCheckbox, M && Q.error, v && Q.indeterminate),
|
|
3480
3768
|
"aria-hidden": "true",
|
|
3481
|
-
children:
|
|
3482
|
-
className:
|
|
3769
|
+
children: v ? /* @__PURE__ */ n("span", {
|
|
3770
|
+
className: P(Q.indeterminateMark, o && Q.customMark),
|
|
3483
3771
|
children: o
|
|
3484
3772
|
}) : L && /* @__PURE__ */ n("span", {
|
|
3485
3773
|
className: Q.checkmark,
|
|
3486
|
-
children: a ?? /* @__PURE__ */ n(
|
|
3774
|
+
children: a ?? /* @__PURE__ */ n(y, {})
|
|
3487
3775
|
})
|
|
3488
3776
|
}),
|
|
3489
3777
|
t && /* @__PURE__ */ r("span", {
|
|
3490
|
-
className:
|
|
3778
|
+
className: P(Q.label, Or[c]),
|
|
3491
3779
|
children: [t, _ && /* @__PURE__ */ n("span", {
|
|
3492
3780
|
className: Q.requiredMark,
|
|
3493
3781
|
"aria-hidden": "true",
|
|
@@ -3497,7 +3785,7 @@ var Q = {
|
|
|
3497
3785
|
]
|
|
3498
3786
|
}),
|
|
3499
3787
|
i && /* @__PURE__ */ n("span", {
|
|
3500
|
-
id:
|
|
3788
|
+
id: N,
|
|
3501
3789
|
className: Q.descriptionText,
|
|
3502
3790
|
children: i
|
|
3503
3791
|
}),
|
|
@@ -3509,7 +3797,7 @@ var Q = {
|
|
|
3509
3797
|
]
|
|
3510
3798
|
});
|
|
3511
3799
|
});
|
|
3512
|
-
|
|
3800
|
+
Mr.displayName = "Checkbox";
|
|
3513
3801
|
var $ = {
|
|
3514
3802
|
inputGroup: "_inputGroup_1fjhk_1",
|
|
3515
3803
|
primary: "_primary_1fjhk_29",
|
|
@@ -3551,7 +3839,7 @@ var $ = {
|
|
|
3551
3839
|
toneDanger: "_toneDanger_1fjhk_876",
|
|
3552
3840
|
toneMuted: "_toneMuted_1fjhk_880",
|
|
3553
3841
|
toneInverse: "_toneInverse_1fjhk_884"
|
|
3554
|
-
},
|
|
3842
|
+
}, Nr = {
|
|
3555
3843
|
default: $.toneDefault,
|
|
3556
3844
|
primary: $.tonePrimary,
|
|
3557
3845
|
secondary: $.toneSecondary,
|
|
@@ -3559,7 +3847,7 @@ var $ = {
|
|
|
3559
3847
|
danger: $.toneDanger,
|
|
3560
3848
|
muted: $.toneMuted,
|
|
3561
3849
|
inverse: $.toneInverse
|
|
3562
|
-
},
|
|
3850
|
+
}, Pr = (e = "text", t) => {
|
|
3563
3851
|
if (t) return t;
|
|
3564
3852
|
switch (e) {
|
|
3565
3853
|
case "email": return "email";
|
|
@@ -3569,7 +3857,7 @@ var $ = {
|
|
|
3569
3857
|
case "search": return "off";
|
|
3570
3858
|
default: return;
|
|
3571
3859
|
}
|
|
3572
|
-
},
|
|
3860
|
+
}, Fr = (e, t) => {
|
|
3573
3861
|
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
3574
3862
|
for (let e of t) {
|
|
3575
3863
|
if (e === "#") {
|
|
@@ -3581,21 +3869,21 @@ var $ = {
|
|
|
3581
3869
|
r < n.length && (i += e);
|
|
3582
3870
|
}
|
|
3583
3871
|
return i;
|
|
3584
|
-
},
|
|
3585
|
-
let pe = p(), me = wn(), he = !!(i || o || v),
|
|
3872
|
+
}, Ir = (e, t) => t ? typeof t == "function" ? t(e) : Fr(e, t) : e, Lr = c(({ id: e, label: i, name: a, description: o, placeholder: s, value: c, defaultValue: l, type: d = "text", size: f, color: m = "primary", variant: h = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: S = !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: F, startAddon: I, endAddon: L, prefix: R, suffix: z, clearIcon: ee, mask: B, format: te, parse: ne, startIconTone: re = "default", endIconTone: ie = "default", clearIconTone: ae = "danger", autoFocus: oe, maxLength: V, onMouseEnter: se, onMouseLeave: ce, "aria-describedby": le, "aria-invalid": ue, "aria-labelledby": de, ...H }, fe) => {
|
|
3873
|
+
let pe = p(), me = wn(), he = !!(i || o || v), ge = e ?? (he ? void 0 : me?.controlId) ?? pe, U = g(null), [_e, ve] = _(!1), [ye, be] = _(l ?? ""), W = c !== void 0, xe = String((W ? c : ye) ?? ""), Se = te ? te(xe) : xe, Ce = xe.length > 0, we = f ?? me?.size ?? "md", Te = y || !!v || !he && !!me?.invalid, Ee = b || !he && !!me?.disabled, De = x || !he && !!me?.required, Oe = D || S, ke = d === "password", Ae = ke && j && _e ? "text" : d, je = N ?? (d === "search" ? /* @__PURE__ */ n(C, {}) : null), Me = F, Ne = Pr(d, E), G = S && !Ee, Pe = O && Ce && !Ee && !Oe && !G, K = j && ke && !Ee && !G && !Pe, Fe = !G && !Pe && !K && !!Me, Ie = !!(M && V), Le = o ? `${ge}-description` : void 0, Re = v ? `${ge}-error` : void 0, ze = Ie ? `${ge}-counter` : void 0, Be = [
|
|
3586
3874
|
le,
|
|
3587
3875
|
!he && !le ? me?.ariaDescribedBy : void 0,
|
|
3588
3876
|
Le,
|
|
3589
3877
|
Re,
|
|
3590
3878
|
ze
|
|
3591
|
-
].filter(Boolean).join(" "),
|
|
3592
|
-
if (
|
|
3879
|
+
].filter(Boolean).join(" "), Ve = ee ?? "×", q = !!(je || R), He = !!(Me || z || Pe || K || G), Ue = !!(je && R), We = !!(Me && z), Ge = !!(I || L), Ke = u((e) => {
|
|
3880
|
+
if (U.current = e, typeof fe == "function") {
|
|
3593
3881
|
fe(e);
|
|
3594
3882
|
return;
|
|
3595
3883
|
}
|
|
3596
3884
|
fe && (fe.current = e);
|
|
3597
3885
|
}, [fe]), qe = u((e) => {
|
|
3598
|
-
let t =
|
|
3886
|
+
let t = Ir(ne ? ne(e.target.value) : e.target.value, B);
|
|
3599
3887
|
W || be(t), A?.(t);
|
|
3600
3888
|
}, [
|
|
3601
3889
|
W,
|
|
@@ -3603,13 +3891,13 @@ var $ = {
|
|
|
3603
3891
|
A,
|
|
3604
3892
|
ne
|
|
3605
3893
|
]), Je = u(() => {
|
|
3606
|
-
W || be(""), A?.(""), k?.(),
|
|
3894
|
+
W || be(""), A?.(""), k?.(), U.current?.focus();
|
|
3607
3895
|
}, [
|
|
3608
3896
|
W,
|
|
3609
3897
|
k,
|
|
3610
3898
|
A
|
|
3611
3899
|
]), Ye = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
3612
|
-
className:
|
|
3900
|
+
className: P($.inputGroup, $[h], $[m], {
|
|
3613
3901
|
[$.hasAddons]: Ge,
|
|
3614
3902
|
[$.isDisabled]: Ee,
|
|
3615
3903
|
[$.isInvalid]: Te,
|
|
@@ -3621,8 +3909,8 @@ var $ = {
|
|
|
3621
3909
|
children: I
|
|
3622
3910
|
}),
|
|
3623
3911
|
/* @__PURE__ */ r("div", {
|
|
3624
|
-
className:
|
|
3625
|
-
[$.hasLeftAdornment]:
|
|
3912
|
+
className: P($.inputWrapper, {
|
|
3913
|
+
[$.hasLeftAdornment]: q,
|
|
3626
3914
|
[$.hasRightAdornment]: He,
|
|
3627
3915
|
[$.hasStartIconAndPrefix]: Ue,
|
|
3628
3916
|
[$.hasEndIconAndSuffix]: We
|
|
@@ -3630,7 +3918,7 @@ var $ = {
|
|
|
3630
3918
|
children: [
|
|
3631
3919
|
je && /* @__PURE__ */ n("span", {
|
|
3632
3920
|
"aria-hidden": "true",
|
|
3633
|
-
className:
|
|
3921
|
+
className: P($.startAdornment, Nr[re]),
|
|
3634
3922
|
children: je
|
|
3635
3923
|
}),
|
|
3636
3924
|
R && /* @__PURE__ */ n("span", {
|
|
@@ -3640,11 +3928,11 @@ var $ = {
|
|
|
3640
3928
|
/* @__PURE__ */ n("input", {
|
|
3641
3929
|
...H,
|
|
3642
3930
|
ref: Ke,
|
|
3643
|
-
id:
|
|
3931
|
+
id: ge,
|
|
3644
3932
|
name: a,
|
|
3645
3933
|
type: Ae,
|
|
3646
3934
|
autoComplete: Ne,
|
|
3647
|
-
className:
|
|
3935
|
+
className: P($.input, $[we], { [$.error]: Te }, w),
|
|
3648
3936
|
value: Se,
|
|
3649
3937
|
onChange: qe,
|
|
3650
3938
|
placeholder: s,
|
|
@@ -3656,7 +3944,7 @@ var $ = {
|
|
|
3656
3944
|
"aria-invalid": Te ? !0 : ue,
|
|
3657
3945
|
"aria-labelledby": de ?? (he ? void 0 : me?.ariaLabelledBy),
|
|
3658
3946
|
"aria-describedby": Be || void 0,
|
|
3659
|
-
"aria-busy":
|
|
3947
|
+
"aria-busy": S || void 0,
|
|
3660
3948
|
onMouseEnter: se,
|
|
3661
3949
|
onMouseLeave: ce
|
|
3662
3950
|
}),
|
|
@@ -3681,14 +3969,14 @@ var $ = {
|
|
|
3681
3969
|
}),
|
|
3682
3970
|
Pe && /* @__PURE__ */ n("button", {
|
|
3683
3971
|
type: "button",
|
|
3684
|
-
className:
|
|
3972
|
+
className: P($.clearButton, Nr[ae]),
|
|
3685
3973
|
onClick: Je,
|
|
3686
3974
|
"aria-label": "Clear input",
|
|
3687
|
-
children:
|
|
3975
|
+
children: Ve
|
|
3688
3976
|
}),
|
|
3689
3977
|
Fe && Me && /* @__PURE__ */ n("span", {
|
|
3690
3978
|
"aria-hidden": "true",
|
|
3691
|
-
className:
|
|
3979
|
+
className: P($.endAdornment, Nr[ie]),
|
|
3692
3980
|
children: Me
|
|
3693
3981
|
})
|
|
3694
3982
|
]
|
|
@@ -3710,7 +3998,7 @@ var $ = {
|
|
|
3710
3998
|
]
|
|
3711
3999
|
})] });
|
|
3712
4000
|
return !he && me ? Ye : /* @__PURE__ */ n(Dn, {
|
|
3713
|
-
id:
|
|
4001
|
+
id: ge,
|
|
3714
4002
|
label: i,
|
|
3715
4003
|
description: o,
|
|
3716
4004
|
error: v,
|
|
@@ -3723,15 +4011,15 @@ var $ = {
|
|
|
3723
4011
|
children: Ye
|
|
3724
4012
|
});
|
|
3725
4013
|
});
|
|
3726
|
-
|
|
4014
|
+
Lr.displayName = "Input";
|
|
3727
4015
|
//#endregion
|
|
3728
4016
|
//#region src/theme/ThemeContext.ts
|
|
3729
|
-
var
|
|
4017
|
+
var Rr = s(null), zr = (e) => e === "highContrast" ? "high-contrast" : e, Br = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, children: i }) => {
|
|
3730
4018
|
let [a, o] = U({
|
|
3731
4019
|
value: e,
|
|
3732
4020
|
defaultValue: t,
|
|
3733
4021
|
onChange: r
|
|
3734
|
-
}), s =
|
|
4022
|
+
}), s = zr(a);
|
|
3735
4023
|
f(() => {
|
|
3736
4024
|
if (typeof document > "u") return;
|
|
3737
4025
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -3743,11 +4031,11 @@ var kr = s(null), Ar = (e) => e === "highContrast" ? "high-contrast" : e, jr = (
|
|
|
3743
4031
|
e.dataset.velliraTheme = t;
|
|
3744
4032
|
};
|
|
3745
4033
|
}, [s]);
|
|
3746
|
-
let c =
|
|
4034
|
+
let c = h(() => ({
|
|
3747
4035
|
theme: a,
|
|
3748
4036
|
setTheme: o
|
|
3749
4037
|
}), [a, o]);
|
|
3750
|
-
return /* @__PURE__ */ n(
|
|
4038
|
+
return /* @__PURE__ */ n(Rr.Provider, {
|
|
3751
4039
|
value: c,
|
|
3752
4040
|
children: /* @__PURE__ */ n("div", {
|
|
3753
4041
|
"data-vellira-theme": s,
|
|
@@ -3755,13 +4043,13 @@ var kr = s(null), Ar = (e) => e === "highContrast" ? "high-contrast" : e, jr = (
|
|
|
3755
4043
|
})
|
|
3756
4044
|
});
|
|
3757
4045
|
};
|
|
3758
|
-
|
|
4046
|
+
Br.displayName = "ThemeProvider";
|
|
3759
4047
|
//#endregion
|
|
3760
4048
|
//#region src/theme/useTheme.ts
|
|
3761
|
-
function
|
|
3762
|
-
let e = d(
|
|
4049
|
+
function Vr() {
|
|
4050
|
+
let e = d(Rr);
|
|
3763
4051
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
3764
4052
|
return e;
|
|
3765
4053
|
}
|
|
3766
4054
|
//#endregion
|
|
3767
|
-
export {
|
|
4055
|
+
export { Dr as Button, Mr as Checkbox, gt as Dropdown, Dn as FormField, Lr as Input, Vt as Modal, Ce as Portal, Se as PortalProvider, Kt as Radio, tn as RadioGroup, Hn as Select, cr as Tabs, Br as ThemeProvider, Tr as Tooltip, Vr as useTheme };
|