@vellira-ui/react 2.59.0 → 2.59.1
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.js +1379 -1340
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,22 +4,22 @@ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
|
4
4
|
import { Children as p, Fragment as m, cloneElement as h, createContext as g, forwardRef as _, isValidElement as v, useCallback as y, useContext as b, useEffect as x, useId as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E, useSyncExternalStore as D } from "react";
|
|
5
5
|
import { createPortal as O } from "react-dom";
|
|
6
6
|
import { FloatingArrow as k, arrow as A, autoUpdate as j, flip as M, offset as N, shift as P, size as F, useFloating as I, useFocus as L, useHover as R, useInteractions as z } from "@floating-ui/react";
|
|
7
|
-
import {
|
|
8
|
-
import { Check as
|
|
7
|
+
import { controlSizes as B, lightTheme as ee } from "@vellira-ui/tokens";
|
|
8
|
+
import { Check as V, ChevronDown as H, ChevronRight as te, Close as ne, Search as re } from "@vellira-ui/icons";
|
|
9
9
|
//#region src/utils/cn.ts
|
|
10
|
-
var U = (...t) => e(t),
|
|
10
|
+
var U = (...t) => e(t), ie = { arrow: "_arrow_8b0vb_1" }, W = ({ className: e }) => /* @__PURE__ */ d("span", {
|
|
11
11
|
"aria-hidden": "true",
|
|
12
|
-
className: U(
|
|
12
|
+
className: U(ie.arrow, e)
|
|
13
13
|
});
|
|
14
14
|
s(W, "arrow"), W.displayName = "Dropdown.Arrow";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/components/Dropdown/internal/types.ts
|
|
17
|
-
function
|
|
17
|
+
function G(e) {
|
|
18
18
|
return o(e);
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/components/Dropdown/internal/DropdownCollection.ts
|
|
22
|
-
function
|
|
22
|
+
function K(e, t) {
|
|
23
23
|
let n = () => null;
|
|
24
24
|
return s(n, e), n.displayName = t, n;
|
|
25
25
|
}
|
|
@@ -35,7 +35,7 @@ function ae(e) {
|
|
|
35
35
|
function u(e, t = {}) {
|
|
36
36
|
p.forEach(e, (e) => {
|
|
37
37
|
if (!v(e)) return;
|
|
38
|
-
let s =
|
|
38
|
+
let s = G(e.type);
|
|
39
39
|
if (e.type.__velliraPortal) {
|
|
40
40
|
i = e, u(e.props.children, t);
|
|
41
41
|
return;
|
|
@@ -183,7 +183,7 @@ function oe(e) {
|
|
|
183
183
|
a.push(e);
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
let o =
|
|
186
|
+
let o = G(e.type);
|
|
187
187
|
if (o === "itemIcon") {
|
|
188
188
|
r = e.props.children;
|
|
189
189
|
return;
|
|
@@ -213,7 +213,7 @@ function se(e) {
|
|
|
213
213
|
let t, n;
|
|
214
214
|
return p.forEach(e, (e) => {
|
|
215
215
|
if (!v(e)) return;
|
|
216
|
-
let r =
|
|
216
|
+
let r = G(e.type);
|
|
217
217
|
r === "subTrigger" && (t = e), r === "subContent" && (n = e);
|
|
218
218
|
}), {
|
|
219
219
|
content: n,
|
|
@@ -229,15 +229,15 @@ function ce(e) {
|
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
if (!v(e)) return;
|
|
232
|
-
let r =
|
|
233
|
-
r
|
|
232
|
+
let r = G(e.type);
|
|
233
|
+
r !== "itemBadge" && r !== "itemDescription" && r !== "itemIcon" && r !== "itemShortcut" && n(e.props.children);
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
return n(e), t.join("").trim();
|
|
237
237
|
}
|
|
238
238
|
//#endregion
|
|
239
239
|
//#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
|
|
240
|
-
var
|
|
240
|
+
var q = K("checkboxItem", "Dropdown.CheckboxItem"), le = ({ active: e, enabled: t, content: n }) => {
|
|
241
241
|
x(() => {
|
|
242
242
|
if (!e || !t || !n) return;
|
|
243
243
|
let r = [], i = n.parentElement;
|
|
@@ -303,7 +303,7 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
303
303
|
return e;
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
},
|
|
306
|
+
}, J = (e) => {
|
|
307
307
|
let t = !1;
|
|
308
308
|
return {
|
|
309
309
|
originalEvent: e,
|
|
@@ -314,16 +314,16 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
314
314
|
return t;
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
},
|
|
317
|
+
}, pe = [
|
|
318
318
|
"a[href]",
|
|
319
319
|
"button:not([disabled])",
|
|
320
320
|
"textarea:not([disabled])",
|
|
321
321
|
"input:not([disabled])",
|
|
322
322
|
"select:not([disabled])",
|
|
323
323
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
324
|
-
].join(","),
|
|
325
|
-
(
|
|
326
|
-
},
|
|
324
|
+
].join(","), me = (e) => Array.from(e.querySelectorAll(pe)).filter((e) => !e.hasAttribute("disabled")), he = (e) => {
|
|
325
|
+
(me(e)[0] ?? e).focus();
|
|
326
|
+
}, ge = ({ active: e, contentRef: t, enabled: n, initialFocus: r, finalFocus: i, restoreFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s }) => {
|
|
327
327
|
de({
|
|
328
328
|
active: e,
|
|
329
329
|
enabled: a,
|
|
@@ -333,7 +333,7 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
333
333
|
if (!e) return;
|
|
334
334
|
let n = fe();
|
|
335
335
|
o?.(n), n.defaultPrevented || queueMicrotask(() => {
|
|
336
|
-
r?.current?.focus(), !r?.current && t.current &&
|
|
336
|
+
r?.current?.focus(), !r?.current && t.current && he(t.current);
|
|
337
337
|
});
|
|
338
338
|
}, [
|
|
339
339
|
e,
|
|
@@ -344,7 +344,7 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
344
344
|
if (!e || !n) return;
|
|
345
345
|
let r = (e) => {
|
|
346
346
|
if (e.key !== "Tab" || !t.current) return;
|
|
347
|
-
let n =
|
|
347
|
+
let n = me(t.current);
|
|
348
348
|
if (n.length === 0) {
|
|
349
349
|
e.preventDefault(), t.current.focus();
|
|
350
350
|
return;
|
|
@@ -364,7 +364,7 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
364
364
|
t,
|
|
365
365
|
n
|
|
366
366
|
]);
|
|
367
|
-
},
|
|
367
|
+
}, _e = (e) => {
|
|
368
368
|
let [t, n] = E(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
369
369
|
return x(() => {
|
|
370
370
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
@@ -373,55 +373,55 @@ var de = ({ active: e, enabled: t = !0, finalFocus: n, onCloseAutoFocus: r }) =>
|
|
|
373
373
|
t.removeEventListener("change", r);
|
|
374
374
|
};
|
|
375
375
|
}, [e]), t;
|
|
376
|
-
},
|
|
377
|
-
let u =
|
|
376
|
+
}, ve = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, collisionPadding: a = 8, matchTriggerWidth: o = !1, avoidCollisions: s = !0, mobileSheetBreakpoint: c, middleware: l = [] } = {}) => {
|
|
377
|
+
let u = _e(c), d = w(() => [
|
|
378
|
+
N(i),
|
|
379
|
+
...s ? [M({ padding: a })] : [],
|
|
380
|
+
F({ apply({ rects: e, elements: t }) {
|
|
381
|
+
!o || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
382
|
+
} }),
|
|
383
|
+
...s ? [P({ padding: a })] : [],
|
|
384
|
+
...l
|
|
385
|
+
], [
|
|
386
|
+
s,
|
|
387
|
+
a,
|
|
388
|
+
l,
|
|
389
|
+
u,
|
|
390
|
+
o,
|
|
391
|
+
i
|
|
392
|
+
]), { refs: f, floatingStyles: p, isPositioned: m, update: h, context: g, middlewareData: _, placement: v } = I({
|
|
378
393
|
open: e,
|
|
379
394
|
onOpenChange: t,
|
|
380
395
|
placement: n,
|
|
381
396
|
strategy: r,
|
|
382
397
|
transform: !1,
|
|
383
|
-
middleware:
|
|
384
|
-
N(i),
|
|
385
|
-
...s ? [M({ padding: a })] : [],
|
|
386
|
-
F({ apply({ rects: e, elements: t }) {
|
|
387
|
-
!o || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
388
|
-
} }),
|
|
389
|
-
...s ? [P({ padding: a })] : [],
|
|
390
|
-
...l
|
|
391
|
-
], [
|
|
392
|
-
s,
|
|
393
|
-
a,
|
|
394
|
-
l,
|
|
395
|
-
u,
|
|
396
|
-
o,
|
|
397
|
-
i
|
|
398
|
-
]),
|
|
398
|
+
middleware: d,
|
|
399
399
|
whileElementsMounted: j
|
|
400
400
|
});
|
|
401
401
|
return x(() => {
|
|
402
|
-
u &&
|
|
403
|
-
}, [u,
|
|
404
|
-
context:
|
|
405
|
-
placement:
|
|
406
|
-
middlewareData:
|
|
407
|
-
isPositioned:
|
|
402
|
+
u && f.floating.current?.style.removeProperty("width");
|
|
403
|
+
}, [u, f.floating]), {
|
|
404
|
+
context: g,
|
|
405
|
+
placement: v,
|
|
406
|
+
middlewareData: _,
|
|
407
|
+
isPositioned: m,
|
|
408
408
|
floatingStyles: u ? {} : {
|
|
409
|
-
...
|
|
410
|
-
visibility: e && !
|
|
409
|
+
...p,
|
|
410
|
+
visibility: e && !m ? "hidden" : p.visibility
|
|
411
411
|
},
|
|
412
412
|
isMobileSheet: u,
|
|
413
|
-
setRef:
|
|
414
|
-
setFloatingRef:
|
|
415
|
-
updatePosition:
|
|
413
|
+
setRef: f.setReference,
|
|
414
|
+
setFloatingRef: f.setFloating,
|
|
415
|
+
updatePosition: h
|
|
416
416
|
};
|
|
417
|
-
},
|
|
417
|
+
}, ye = r({
|
|
418
418
|
defaultLevel: "popover",
|
|
419
|
-
levels:
|
|
420
|
-
}),
|
|
421
|
-
function
|
|
419
|
+
levels: ee.tokens.zIndex
|
|
420
|
+
}), be = t("WebOverlayManager");
|
|
421
|
+
function xe() {
|
|
422
422
|
let e = n({
|
|
423
|
-
diagnostics:
|
|
424
|
-
policy:
|
|
423
|
+
diagnostics: be,
|
|
424
|
+
policy: ye
|
|
425
425
|
}), t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
426
426
|
return {
|
|
427
427
|
register(t) {
|
|
@@ -481,8 +481,8 @@ function Se() {
|
|
|
481
481
|
}
|
|
482
482
|
};
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
let i =
|
|
484
|
+
var Se = xe(), Ce = g(null), we = () => b(Ce) ?? Se, Te = ({ active: e, id: t, zIndexLevel: n, zIndex: r }) => {
|
|
485
|
+
let i = we(), a = D(i.subscribe, i.getSnapshot, i.getSnapshot);
|
|
486
486
|
x(() => {
|
|
487
487
|
if (e) return i.register({
|
|
488
488
|
id: t,
|
|
@@ -505,7 +505,7 @@ var Ce = Se(), we = g(null), Te = () => b(we) ?? Ce, Ee = ({ active: e, id: t, z
|
|
|
505
505
|
order: s?.order,
|
|
506
506
|
zIndex: i.getZIndex(t)
|
|
507
507
|
};
|
|
508
|
-
},
|
|
508
|
+
}, Ee = i((e) => {
|
|
509
509
|
if (typeof document > "u") return;
|
|
510
510
|
let t = (t) => {
|
|
511
511
|
t.key === "Escape" && e.dispatchEscapeKeyDown(t);
|
|
@@ -513,7 +513,7 @@ var Ce = Se(), we = g(null), Te = () => b(we) ?? Ce, Ee = ({ active: e, id: t, z
|
|
|
513
513
|
return document.addEventListener("keydown", t), () => {
|
|
514
514
|
document.removeEventListener("keydown", t);
|
|
515
515
|
};
|
|
516
|
-
}),
|
|
516
|
+
}), De = i((e) => {
|
|
517
517
|
if (typeof document > "u") return;
|
|
518
518
|
let t = (t) => {
|
|
519
519
|
e.dispatchPointerDownOutside(t);
|
|
@@ -522,14 +522,14 @@ var Ce = Se(), we = g(null), Te = () => b(we) ?? Ce, Ee = ({ active: e, id: t, z
|
|
|
522
522
|
document.removeEventListener("pointerdown", t);
|
|
523
523
|
};
|
|
524
524
|
});
|
|
525
|
+
function Oe(e) {
|
|
526
|
+
return Ee.retain(e);
|
|
527
|
+
}
|
|
525
528
|
function ke(e) {
|
|
526
529
|
return De.retain(e);
|
|
527
530
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
var je = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registered: i = !1, zIndex: a, contentRef: o, ignoreRefs: s = [], closeOnEscape: c, closeOnOutsidePress: l, onEscapeKeyDown: u, onPointerDownOutside: d, onInteractOutside: f, requestClose: p }) => {
|
|
532
|
-
let m = Te(), h = Ee({
|
|
531
|
+
var Ae = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registered: i = !1, zIndex: a, contentRef: o, ignoreRefs: s = [], closeOnEscape: c, closeOnOutsidePress: l, onEscapeKeyDown: u, onPointerDownOutside: d, onInteractOutside: f, requestClose: p }) => {
|
|
532
|
+
let m = we(), h = Te({
|
|
533
533
|
active: r && !i,
|
|
534
534
|
id: t,
|
|
535
535
|
zIndexLevel: n,
|
|
@@ -537,7 +537,7 @@ var je = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registe
|
|
|
537
537
|
}), g = T(s);
|
|
538
538
|
return g.current = s, x(() => {
|
|
539
539
|
if (!e) return;
|
|
540
|
-
let n =
|
|
540
|
+
let n = Oe(m), r = m.registerEscapeHandler(t, (e) => {
|
|
541
541
|
u?.(e), !(e.defaultPrevented || !c) && p("escape-key", e);
|
|
542
542
|
});
|
|
543
543
|
return () => {
|
|
@@ -552,9 +552,9 @@ var je = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registe
|
|
|
552
552
|
p
|
|
553
553
|
]), x(() => {
|
|
554
554
|
if (!e) return;
|
|
555
|
-
let n =
|
|
555
|
+
let n = ke(m), r = m.registerPointerDownOutsideHandler(t, (e) => {
|
|
556
556
|
if (e.target instanceof Node && [o, ...g.current].some((t) => t.current?.contains(e.target))) return;
|
|
557
|
-
let t =
|
|
557
|
+
let t = J(e);
|
|
558
558
|
d?.(t), f?.(t), !(t.defaultPrevented || !l) && p("outside-press", e);
|
|
559
559
|
});
|
|
560
560
|
return () => {
|
|
@@ -570,8 +570,8 @@ var je = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registe
|
|
|
570
570
|
d,
|
|
571
571
|
p
|
|
572
572
|
]), h;
|
|
573
|
-
},
|
|
574
|
-
...
|
|
573
|
+
}, je = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r, portal: i = !0, presentation: a, animationStyle: o, offset: s, collisionPadding: l, matchTriggerWidth: u, avoidCollisions: d, mobileSheetBreakpoint: f, middleware: p } = {}) => ({
|
|
574
|
+
...ve({
|
|
575
575
|
open: e,
|
|
576
576
|
onOpenChange: t,
|
|
577
577
|
placement: n,
|
|
@@ -588,29 +588,29 @@ var je = ({ active: e, id: t, zIndexLevel: n, registrationActive: r = e, registe
|
|
|
588
588
|
presentation: a,
|
|
589
589
|
defaultPresentation: i ? "floating" : "inline"
|
|
590
590
|
})
|
|
591
|
-
}),
|
|
591
|
+
}), Me = 0, Ne = "", Pe = {
|
|
592
592
|
lock() {
|
|
593
|
-
typeof document > "u" || (
|
|
593
|
+
typeof document > "u" || (Me === 0 && (Ne = document.body.style.overflow, document.body.style.overflow = "hidden"), Me += 1);
|
|
594
594
|
},
|
|
595
595
|
unlock() {
|
|
596
|
-
typeof document > "u" || (
|
|
596
|
+
typeof document > "u" || (Me = Math.max(0, Me - 1), Me === 0 && (document.body.style.overflow = Ne));
|
|
597
597
|
}
|
|
598
|
-
},
|
|
598
|
+
}, Fe = ({ active: e, enabled: t = !0 }) => {
|
|
599
599
|
x(() => {
|
|
600
|
-
if (!(!e || !t)) return
|
|
601
|
-
|
|
600
|
+
if (!(!e || !t)) return Pe.lock(), () => {
|
|
601
|
+
Pe.unlock();
|
|
602
602
|
};
|
|
603
603
|
}, [e, t]);
|
|
604
|
-
},
|
|
604
|
+
}, Ie = () => typeof document > "u" ? null : document.body, Le = ({ container: e } = {}) => {
|
|
605
605
|
let [t, n] = E(!1);
|
|
606
606
|
return x(() => {
|
|
607
607
|
n(!0);
|
|
608
|
-
}, []), t ? e ?? document.getElementById("overlay-root") ??
|
|
608
|
+
}, []), t ? e ?? document.getElementById("overlay-root") ?? Ie() : null;
|
|
609
609
|
};
|
|
610
610
|
//#endregion
|
|
611
611
|
//#region src/hooks/behavior/select/useSelectPosition.ts
|
|
612
|
-
function
|
|
613
|
-
return
|
|
612
|
+
function Re({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
|
|
613
|
+
return je({
|
|
614
614
|
open: t,
|
|
615
615
|
onOpenChange: r,
|
|
616
616
|
placement: i === "bottom" || i === "top" ? `${i}-start` : i,
|
|
@@ -621,12 +621,12 @@ function ze({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange:
|
|
|
621
621
|
}
|
|
622
622
|
//#endregion
|
|
623
623
|
//#region src/hooks/useControllableState.ts
|
|
624
|
-
var
|
|
624
|
+
var Y = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
625
625
|
let [r, i] = E(t), a = e !== void 0;
|
|
626
626
|
return [a ? e : r, y((e) => {
|
|
627
627
|
a || i(e), n?.(e);
|
|
628
628
|
}, [a, n])];
|
|
629
|
-
},
|
|
629
|
+
}, ze = ({ activeIndex: e, setActiveIndex: t, items: n, isOpen: r, onOpen: i, onSelect: a, onClose: o, getItemText: s, loop: c = !0 }) => {
|
|
630
630
|
let l = T({
|
|
631
631
|
value: "",
|
|
632
632
|
timeoutId: void 0
|
|
@@ -687,15 +687,13 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
687
687
|
case "Tab":
|
|
688
688
|
o?.();
|
|
689
689
|
break;
|
|
690
|
-
default:
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
}
|
|
698
|
-
break;
|
|
690
|
+
default: if (n.key.length === 1 && !n.altKey && !n.ctrlKey && !n.metaKey) {
|
|
691
|
+
n.preventDefault(), l.current.timeoutId && clearTimeout(l.current.timeoutId), l.current.value += n.key, l.current.timeoutId = setTimeout(() => {
|
|
692
|
+
l.current.value = "", l.current.timeoutId = void 0;
|
|
693
|
+
}, 700);
|
|
694
|
+
let e = p(l.current.value);
|
|
695
|
+
e >= 0 && t(e);
|
|
696
|
+
}
|
|
699
697
|
}
|
|
700
698
|
}, [
|
|
701
699
|
e,
|
|
@@ -709,7 +707,7 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
709
707
|
f,
|
|
710
708
|
p
|
|
711
709
|
]) };
|
|
712
|
-
},
|
|
710
|
+
}, Be = ({ items: e, open: t, defaultOpen: n = !1, disabled: r = !1, onOpenChange: i, onSelect: a, getItemValue: o, getItemText: s, loop: c = !0 }) => {
|
|
713
711
|
let [l, u] = E(n), [d, f] = E(-1), p = t !== void 0, m = t ?? l, h = y(() => e.findIndex((e) => !e.disabled), [e]), g = y(() => {
|
|
714
712
|
for (let t = e.length - 1; t >= 0; t--) if (!e[t]?.disabled) return t;
|
|
715
713
|
return -1;
|
|
@@ -764,7 +762,7 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
764
762
|
d,
|
|
765
763
|
e,
|
|
766
764
|
w
|
|
767
|
-
]), { onKeyDown: D } =
|
|
765
|
+
]), { onKeyDown: D } = ze({
|
|
768
766
|
activeIndex: d,
|
|
769
767
|
setActiveIndex: f,
|
|
770
768
|
items: e,
|
|
@@ -793,8 +791,8 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
793
791
|
getFirstEnabledIndex: h,
|
|
794
792
|
getLastEnabledIndex: g
|
|
795
793
|
};
|
|
796
|
-
},
|
|
797
|
-
let a = S(), o = S(), s = S(), [c, l] =
|
|
794
|
+
}, Ve = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
795
|
+
let a = S(), o = S(), s = S(), [c, l] = Y({
|
|
798
796
|
value: e,
|
|
799
797
|
defaultValue: t,
|
|
800
798
|
onChange: n
|
|
@@ -812,7 +810,7 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
812
810
|
titleId: o,
|
|
813
811
|
descriptionId: s
|
|
814
812
|
};
|
|
815
|
-
},
|
|
813
|
+
}, He = ({ value: e, defaultValue: t, onValueChange: n, options: r, multiple: i = !1, maxSelected: a, closeOnSelect: o = !i, disabled: s = !1, open: c, defaultOpen: l = !1, onOpenChange: u }) => {
|
|
816
814
|
let d = y((e) => {
|
|
817
815
|
if (n) {
|
|
818
816
|
if (i) {
|
|
@@ -825,11 +823,11 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
825
823
|
}
|
|
826
824
|
n(Array.isArray(e) ? e[0] ?? "" : e);
|
|
827
825
|
}
|
|
828
|
-
}, [i, n]), [f, p] =
|
|
826
|
+
}, [i, n]), [f, p] = Y({
|
|
829
827
|
value: e,
|
|
830
828
|
defaultValue: t ?? (i ? [] : ""),
|
|
831
829
|
onChange: d
|
|
832
|
-
}), [m, h] =
|
|
830
|
+
}), [m, h] = Y({
|
|
833
831
|
value: c,
|
|
834
832
|
defaultValue: l,
|
|
835
833
|
onChange: u
|
|
@@ -898,7 +896,7 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
898
896
|
g,
|
|
899
897
|
r,
|
|
900
898
|
k
|
|
901
|
-
]), { onKeyDown: j } =
|
|
899
|
+
]), { onKeyDown: j } = ze({
|
|
902
900
|
activeIndex: g,
|
|
903
901
|
setActiveIndex: _,
|
|
904
902
|
items: r,
|
|
@@ -928,8 +926,8 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
928
926
|
selectActiveOption: A,
|
|
929
927
|
onKeyDown: j
|
|
930
928
|
};
|
|
931
|
-
},
|
|
932
|
-
let [r, i] =
|
|
929
|
+
}, Ue = ({ value: e, defaultValue: t = "", onValueChange: n }) => {
|
|
930
|
+
let [r, i] = Y({
|
|
933
931
|
value: e,
|
|
934
932
|
defaultValue: t,
|
|
935
933
|
onChange: n
|
|
@@ -938,15 +936,15 @@ var q = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
|
938
936
|
value: r,
|
|
939
937
|
setValue: i
|
|
940
938
|
};
|
|
941
|
-
},
|
|
939
|
+
}, We = g(null), Ge = ({ children: e, container: t = null }) => /* @__PURE__ */ d(We.Provider, {
|
|
942
940
|
value: t,
|
|
943
941
|
children: e
|
|
944
|
-
}),
|
|
945
|
-
let n = b(
|
|
942
|
+
}), Ke = ({ children: e, container: t }) => {
|
|
943
|
+
let n = b(We), r = Le({ container: t ?? n });
|
|
946
944
|
return r ? O(e, r) : null;
|
|
947
945
|
};
|
|
948
|
-
|
|
949
|
-
var
|
|
946
|
+
Ke.__velliraPortal = !0, Ke.displayName = "Portal", Ge.displayName = "PortalProvider";
|
|
947
|
+
var qe = {
|
|
950
948
|
dropdown: "_dropdown_m7rnq_1",
|
|
951
949
|
"dropdown-in": "_dropdown-in_m7rnq_1",
|
|
952
950
|
primary: "_primary_m7rnq_42",
|
|
@@ -958,35 +956,35 @@ var Je = {
|
|
|
958
956
|
searchWrap: "_searchWrap_m7rnq_165",
|
|
959
957
|
search: "_search_m7rnq_165",
|
|
960
958
|
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
961
|
-
},
|
|
959
|
+
}, Je = K("empty", "Dropdown.Empty"), Ye = ({ children: e }) => /* @__PURE__ */ d("li", {
|
|
962
960
|
role: "presentation",
|
|
963
|
-
className:
|
|
961
|
+
className: qe.empty,
|
|
964
962
|
children: e ?? "No actions available"
|
|
965
963
|
});
|
|
966
|
-
|
|
964
|
+
Ye.displayName = "DropdownEmptySurface";
|
|
967
965
|
//#endregion
|
|
968
966
|
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
969
|
-
var
|
|
970
|
-
|
|
967
|
+
var Xe = K("group", "Dropdown.Group"), Ze = () => null;
|
|
968
|
+
Ze.displayName = "DropdownGroupSurface";
|
|
971
969
|
//#endregion
|
|
972
970
|
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
973
|
-
var
|
|
974
|
-
|
|
975
|
-
function
|
|
976
|
-
let e = b(
|
|
971
|
+
var Qe = g(null), $e = g(null), et = g(null), tt = Qe.Provider, nt = $e.Provider;
|
|
972
|
+
et.Provider;
|
|
973
|
+
function rt() {
|
|
974
|
+
let e = b(Qe);
|
|
977
975
|
if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
|
|
978
976
|
return e;
|
|
979
977
|
}
|
|
980
|
-
function
|
|
981
|
-
let e = b(
|
|
978
|
+
function it() {
|
|
979
|
+
let e = b($e);
|
|
982
980
|
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
983
981
|
return e;
|
|
984
982
|
}
|
|
985
983
|
//#endregion
|
|
986
984
|
//#region src/utils/devWarning.ts
|
|
987
|
-
var
|
|
985
|
+
var at = (e, t) => {
|
|
988
986
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
989
|
-
},
|
|
987
|
+
}, X = {
|
|
990
988
|
item: "_item_xmygj_1",
|
|
991
989
|
disabled: "_disabled_xmygj_35",
|
|
992
990
|
active: "_active_xmygj_53",
|
|
@@ -1011,13 +1009,13 @@ var ot = (e, t) => {
|
|
|
1011
1009
|
"dropdown-sub-in": "_dropdown-sub-in_xmygj_1",
|
|
1012
1010
|
subLabel: "_subLabel_xmygj_300",
|
|
1013
1011
|
subSeparator: "_subSeparator_xmygj_308"
|
|
1014
|
-
},
|
|
1015
|
-
let n =
|
|
1016
|
-
[
|
|
1017
|
-
[
|
|
1018
|
-
[
|
|
1019
|
-
}, D && D !== "default" ?
|
|
1020
|
-
|
|
1012
|
+
}, ot = K("item", "Dropdown.Item"), st = ({ item: e, itemIndex: t }) => {
|
|
1013
|
+
let n = rt(), r = T(void 0), [i, a] = E(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), o = n.activeIndex === t, s = n.openSubId === e.id, c = e.type === "checkbox", l = e.type === "radio", p = e.type === "subTrigger", m = c ? e.props.checked ?? i : l ? (e.groupProps?.value ?? n.radioValues[e.groupId]) === e.props.value : !1, g = n.loading || e.disabled, _ = e.props, y = oe(_.children), b = y.icon ?? _.icon, x = y.description ?? ("description" in _ ? _.description : void 0), S = y.badge ?? ("badge" in _ ? _.badge : void 0), C = y.shortcut ?? _.shortcut, w = y.content.length ? y.content : _.children, D = "color" in _ ? _.color : void 0, O = e.type === "item" ? e.props.href : void 0, k = e.type === "item" ? e.props.target : void 0, A = e.type === "item" ? e.props.download : void 0, j = n.getItemId(t), M = c ? "menuitemcheckbox" : l ? "menuitemradio" : "menuitem", N = e.type === "item" && k === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, P = O ? "a" : "li", F = c || l, I = _.asChild && v(_.children) ? _.children : void 0, L = U(X.item, X[n.size], {
|
|
1014
|
+
[X.active]: o,
|
|
1015
|
+
[X.disabled]: g,
|
|
1016
|
+
[X.checked]: m
|
|
1017
|
+
}, D && D !== "default" ? X[D] : void 0, _.className);
|
|
1018
|
+
at(!_.asChild || !!I, "Dropdown.Item: asChild requires a single valid React element child.");
|
|
1021
1019
|
let R = (t) => {
|
|
1022
1020
|
if (g) {
|
|
1023
1021
|
t.preventDefault();
|
|
@@ -1027,7 +1025,7 @@ var ot = (e, t) => {
|
|
|
1027
1025
|
let t = !m;
|
|
1028
1026
|
a(t), e.props.onCheckedChange?.(t);
|
|
1029
1027
|
}
|
|
1030
|
-
n.selectItem(e,
|
|
1028
|
+
n.selectItem(e, ct(t));
|
|
1031
1029
|
}, z = () => {
|
|
1032
1030
|
g || (n.setActiveIndex(t), p ? (window.clearTimeout(r.current), r.current = window.setTimeout(() => n.setOpenSubId(e.id), 120)) : (window.clearTimeout(r.current), n.setOpenSubId(void 0)));
|
|
1033
1031
|
}, B = () => {
|
|
@@ -1053,7 +1051,7 @@ var ot = (e, t) => {
|
|
|
1053
1051
|
onMouseLeave: (e) => {
|
|
1054
1052
|
I.props.onMouseLeave?.(e), e.defaultPrevented || B(e);
|
|
1055
1053
|
}
|
|
1056
|
-
}),
|
|
1054
|
+
}), lt(e, j, p, s, () => n.setOpenSubId(e.id))] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f(P, {
|
|
1057
1055
|
id: j,
|
|
1058
1056
|
role: M,
|
|
1059
1057
|
href: P === "a" && !g ? O : void 0,
|
|
@@ -1073,42 +1071,42 @@ var ot = (e, t) => {
|
|
|
1073
1071
|
onMouseLeave: B,
|
|
1074
1072
|
children: [
|
|
1075
1073
|
b && /* @__PURE__ */ d("span", {
|
|
1076
|
-
className:
|
|
1074
|
+
className: X.itemIcon,
|
|
1077
1075
|
children: b
|
|
1078
1076
|
}),
|
|
1079
1077
|
/* @__PURE__ */ f("span", {
|
|
1080
|
-
className:
|
|
1078
|
+
className: X.itemText,
|
|
1081
1079
|
children: [/* @__PURE__ */ d("span", {
|
|
1082
|
-
className:
|
|
1080
|
+
className: X.itemLabel,
|
|
1083
1081
|
children: w
|
|
1084
1082
|
}), x && /* @__PURE__ */ d("span", {
|
|
1085
|
-
className:
|
|
1083
|
+
className: X.itemDescription,
|
|
1086
1084
|
children: x
|
|
1087
1085
|
})]
|
|
1088
1086
|
}),
|
|
1089
1087
|
S && /* @__PURE__ */ d("span", {
|
|
1090
|
-
className:
|
|
1088
|
+
className: X.itemBadge,
|
|
1091
1089
|
children: S
|
|
1092
1090
|
}),
|
|
1093
1091
|
C && /* @__PURE__ */ d("span", {
|
|
1094
|
-
className:
|
|
1092
|
+
className: X.itemShortcut,
|
|
1095
1093
|
children: C
|
|
1096
1094
|
}),
|
|
1097
1095
|
F && /* @__PURE__ */ d("span", {
|
|
1098
|
-
className:
|
|
1096
|
+
className: X.indicator,
|
|
1099
1097
|
"aria-hidden": "true",
|
|
1100
|
-
children: m ? /* @__PURE__ */ d(
|
|
1098
|
+
children: m ? /* @__PURE__ */ d(V, {}) : null
|
|
1101
1099
|
}),
|
|
1102
1100
|
p && /* @__PURE__ */ d("span", {
|
|
1103
|
-
className:
|
|
1101
|
+
className: X.itemShortcut,
|
|
1104
1102
|
"aria-hidden": "true",
|
|
1105
|
-
children: /* @__PURE__ */ d(
|
|
1103
|
+
children: /* @__PURE__ */ d(te, {})
|
|
1106
1104
|
})
|
|
1107
1105
|
]
|
|
1108
|
-
}),
|
|
1106
|
+
}), lt(e, j, p, s, () => n.setOpenSubId(e.id))] });
|
|
1109
1107
|
};
|
|
1110
|
-
|
|
1111
|
-
function
|
|
1108
|
+
st.displayName = "DropdownItemRow";
|
|
1109
|
+
function ct(e) {
|
|
1112
1110
|
let t = !1;
|
|
1113
1111
|
return {
|
|
1114
1112
|
originalEvent: e,
|
|
@@ -1120,27 +1118,27 @@ function lt(e) {
|
|
|
1120
1118
|
}
|
|
1121
1119
|
};
|
|
1122
1120
|
}
|
|
1123
|
-
function
|
|
1121
|
+
function lt(e, t, n, r, i) {
|
|
1124
1122
|
return !n || !r || e.type !== "subTrigger" || e.subEntries.length === 0 ? null : /* @__PURE__ */ d("ul", {
|
|
1125
1123
|
role: "menu",
|
|
1126
|
-
className:
|
|
1124
|
+
className: X.subContent,
|
|
1127
1125
|
onMouseEnter: i,
|
|
1128
1126
|
children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ d("li", {
|
|
1129
1127
|
role: "presentation",
|
|
1130
|
-
className:
|
|
1128
|
+
className: X.subLabel,
|
|
1131
1129
|
children: e.props.children
|
|
1132
1130
|
}, e.id) : e.type === "separator" ? /* @__PURE__ */ d("li", {
|
|
1133
1131
|
role: "separator",
|
|
1134
|
-
className:
|
|
1132
|
+
className: X.subSeparator,
|
|
1135
1133
|
"aria-hidden": "true"
|
|
1136
|
-
}, e.id) : e.type === "item" ? /* @__PURE__ */ d(
|
|
1134
|
+
}, e.id) : e.type === "item" ? /* @__PURE__ */ d(ut, {
|
|
1137
1135
|
item: e.item,
|
|
1138
1136
|
id: `${t}-${e.itemIndex}`
|
|
1139
1137
|
}, e.item.id) : null)
|
|
1140
1138
|
});
|
|
1141
1139
|
}
|
|
1142
|
-
function
|
|
1143
|
-
let n =
|
|
1140
|
+
function ut({ id: e, item: t }) {
|
|
1141
|
+
let n = rt(), [r, i] = E(t.type === "checkbox" ? t.props.defaultChecked ?? !1 : !1), a = t.type === "checkbox", o = t.type === "radio", s = a ? t.props.checked ?? r : o ? (t.groupProps?.value ?? n.radioValues[t.groupId]) === t.props.value : !1, c = t.props, l = oe(c.children), u = l.icon ?? c.icon, p = l.description ?? ("description" in c ? c.description : void 0), m = l.badge ?? ("badge" in c ? c.badge : void 0), h = l.shortcut ?? c.shortcut, g = l.content.length ? l.content : c.children, _ = "color" in c ? c.color : void 0, v = n.loading || t.disabled, y = t.type === "item" ? t.props.href : void 0, b = t.type === "item" ? t.props.target : void 0, x = t.type === "item" ? t.props.download : void 0, S = a ? "menuitemcheckbox" : o ? "menuitemradio" : "menuitem", C = t.type === "item" && b === "_blank" && !t.props.rel ? "noreferrer noopener" : t.type === "item" ? t.props.rel : void 0, w = y ? "a" : "li", T = a || o, D = (e) => {
|
|
1144
1142
|
if (v) {
|
|
1145
1143
|
e.preventDefault();
|
|
1146
1144
|
return;
|
|
@@ -1149,7 +1147,7 @@ function dt({ id: e, item: t }) {
|
|
|
1149
1147
|
let e = !s;
|
|
1150
1148
|
i(e), t.props.onCheckedChange?.(e);
|
|
1151
1149
|
}
|
|
1152
|
-
n.selectItem(t,
|
|
1150
|
+
n.selectItem(t, ct(e));
|
|
1153
1151
|
};
|
|
1154
1152
|
return /* @__PURE__ */ f(w, {
|
|
1155
1153
|
id: e,
|
|
@@ -1161,74 +1159,74 @@ function dt({ id: e, item: t }) {
|
|
|
1161
1159
|
tabIndex: v ? -1 : 0,
|
|
1162
1160
|
"aria-disabled": v || void 0,
|
|
1163
1161
|
"aria-checked": a || o ? s : void 0,
|
|
1164
|
-
className: U(
|
|
1165
|
-
[
|
|
1166
|
-
[
|
|
1167
|
-
}, _ && _ !== "default" ?
|
|
1162
|
+
className: U(X.item, X[n.size], {
|
|
1163
|
+
[X.disabled]: v,
|
|
1164
|
+
[X.checked]: s
|
|
1165
|
+
}, _ && _ !== "default" ? X[_] : void 0),
|
|
1168
1166
|
onClick: D,
|
|
1169
1167
|
children: [
|
|
1170
1168
|
T && /* @__PURE__ */ d("span", {
|
|
1171
|
-
className:
|
|
1169
|
+
className: X.indicator,
|
|
1172
1170
|
"aria-hidden": "true",
|
|
1173
|
-
children: s ? /* @__PURE__ */ d(
|
|
1171
|
+
children: s ? /* @__PURE__ */ d(V, {}) : null
|
|
1174
1172
|
}),
|
|
1175
1173
|
u && /* @__PURE__ */ d("span", {
|
|
1176
|
-
className:
|
|
1174
|
+
className: X.itemIcon,
|
|
1177
1175
|
children: u
|
|
1178
1176
|
}),
|
|
1179
1177
|
/* @__PURE__ */ f("span", {
|
|
1180
|
-
className:
|
|
1178
|
+
className: X.itemText,
|
|
1181
1179
|
children: [/* @__PURE__ */ d("span", {
|
|
1182
|
-
className:
|
|
1180
|
+
className: X.itemLabel,
|
|
1183
1181
|
children: g
|
|
1184
1182
|
}), p && /* @__PURE__ */ d("span", {
|
|
1185
|
-
className:
|
|
1183
|
+
className: X.itemDescription,
|
|
1186
1184
|
children: p
|
|
1187
1185
|
})]
|
|
1188
1186
|
}),
|
|
1189
1187
|
m && /* @__PURE__ */ d("span", {
|
|
1190
|
-
className:
|
|
1188
|
+
className: X.itemBadge,
|
|
1191
1189
|
children: m
|
|
1192
1190
|
}),
|
|
1193
1191
|
h && /* @__PURE__ */ d("span", {
|
|
1194
|
-
className:
|
|
1192
|
+
className: X.itemShortcut,
|
|
1195
1193
|
children: h
|
|
1196
1194
|
})
|
|
1197
1195
|
]
|
|
1198
1196
|
});
|
|
1199
1197
|
}
|
|
1200
|
-
var
|
|
1198
|
+
var dt = { group: "_group_aviwv_1" }, ft = K("label", "Dropdown.Label"), pt = ({ children: e, className: t }) => /* @__PURE__ */ d("li", {
|
|
1201
1199
|
role: "presentation",
|
|
1202
|
-
className: U(
|
|
1200
|
+
className: U(dt.group, t),
|
|
1203
1201
|
children: e
|
|
1204
1202
|
});
|
|
1205
|
-
|
|
1203
|
+
pt.displayName = "DropdownLabelSurface";
|
|
1206
1204
|
//#endregion
|
|
1207
1205
|
//#region src/components/Dropdown/Loading/DropdownLoading.tsx
|
|
1208
|
-
var
|
|
1206
|
+
var mt = K("loading", "Dropdown.Loading"), ht = ({ children: e }) => /* @__PURE__ */ d("li", {
|
|
1209
1207
|
role: "presentation",
|
|
1210
1208
|
"aria-live": "polite",
|
|
1211
|
-
className:
|
|
1209
|
+
className: qe.empty,
|
|
1212
1210
|
children: e ?? "Loading actions..."
|
|
1213
1211
|
});
|
|
1214
|
-
|
|
1215
|
-
var
|
|
1212
|
+
ht.displayName = "DropdownLoadingSurface";
|
|
1213
|
+
var gt = { separator: "_separator_1v11r_1" }, _t = K("separator", "Dropdown.Separator"), vt = ({ className: e }) => /* @__PURE__ */ d("li", {
|
|
1216
1214
|
role: "separator",
|
|
1217
|
-
className: U(
|
|
1215
|
+
className: U(gt.separator, e),
|
|
1218
1216
|
"aria-hidden": "true"
|
|
1219
1217
|
});
|
|
1220
|
-
|
|
1218
|
+
vt.displayName = "DropdownSeparatorSurface";
|
|
1221
1219
|
//#endregion
|
|
1222
1220
|
//#region src/components/Dropdown/Content/DropdownContent.tsx
|
|
1223
|
-
var
|
|
1224
|
-
let t =
|
|
1221
|
+
var yt = ({ className: e }) => {
|
|
1222
|
+
let t = rt(), { contentReadyToFocus: n, isOpen: r, setContentRef: i } = t, a = T(null), o = y((e) => {
|
|
1225
1223
|
a.current = e, i(e);
|
|
1226
1224
|
}, [i]);
|
|
1227
1225
|
if (x(() => {
|
|
1228
1226
|
let e = a.current;
|
|
1229
1227
|
!r || !n || !e || e.contains(document.activeElement) || e.focus({ preventScroll: !0 });
|
|
1230
1228
|
}, [n, r]), !r) return null;
|
|
1231
|
-
let s = U(
|
|
1229
|
+
let s = U(qe.dropdown, qe[t.color], t.contentProps?.className, e), c = /* @__PURE__ */ f("ul", {
|
|
1232
1230
|
ref: o,
|
|
1233
1231
|
id: t.contentId,
|
|
1234
1232
|
role: "menu",
|
|
@@ -1245,37 +1243,37 @@ var bt = ({ className: e }) => {
|
|
|
1245
1243
|
"data-color": t.color,
|
|
1246
1244
|
children: [t.searchable && /* @__PURE__ */ f("li", {
|
|
1247
1245
|
role: "presentation",
|
|
1248
|
-
className: U(
|
|
1249
|
-
children: [/* @__PURE__ */ d(
|
|
1250
|
-
className:
|
|
1246
|
+
className: U(qe.searchWrap, t.searchProps?.className),
|
|
1247
|
+
children: [/* @__PURE__ */ d(re, { "aria-hidden": "true" }), /* @__PURE__ */ d("input", {
|
|
1248
|
+
className: qe.search,
|
|
1251
1249
|
value: t.searchValue,
|
|
1252
1250
|
placeholder: t.searchPlaceholder,
|
|
1253
1251
|
"aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
|
|
1254
1252
|
onInput: (e) => t.setSearchValue(e.currentTarget.value),
|
|
1255
1253
|
onChange: (e) => t.setSearchValue(e.target.value),
|
|
1256
1254
|
onKeyDown: (e) => {
|
|
1257
|
-
e.key
|
|
1255
|
+
e.key !== "ArrowDown" && e.key !== "ArrowUp" && e.key !== "Enter" && e.key !== "Escape" && e.stopPropagation();
|
|
1258
1256
|
}
|
|
1259
1257
|
})]
|
|
1260
|
-
}), t.loading ? /* @__PURE__ */ d(
|
|
1258
|
+
}), t.loading ? /* @__PURE__ */ d(ht, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ d(Ye, { children: t.empty }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ d(Ze, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ d(pt, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ d(vt, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ d(Ye, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ d(ht, { children: e.props.children }, e.id) : e.type === "arrow" ? /* @__PURE__ */ d(W, { ...e.props }, e.id) : /* @__PURE__ */ d(m, { children: /* @__PURE__ */ d(st, {
|
|
1261
1259
|
item: e.item,
|
|
1262
1260
|
itemIndex: e.itemIndex
|
|
1263
|
-
}) }, e.item.id)) : /* @__PURE__ */ d(
|
|
1261
|
+
}) }, e.item.id)) : /* @__PURE__ */ d(Ye, {})]
|
|
1264
1262
|
});
|
|
1265
|
-
return t.portal ? /* @__PURE__ */ d(
|
|
1263
|
+
return t.portal ? /* @__PURE__ */ d(Ke, { children: c }) : c;
|
|
1266
1264
|
};
|
|
1267
|
-
s(
|
|
1265
|
+
s(yt, "content"), yt.displayName = "Dropdown.Content";
|
|
1268
1266
|
//#endregion
|
|
1269
1267
|
//#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
|
|
1270
|
-
var
|
|
1268
|
+
var bt = K("itemBadge", "Dropdown.ItemBadge"), xt = K("itemDescription", "Dropdown.ItemDescription"), St = K("itemIcon", "Dropdown.ItemIcon"), Ct = K("itemShortcut", "Dropdown.ItemShortcut"), wt = K("radioGroup", "Dropdown.RadioGroup"), Tt = K("radioItem", "Dropdown.RadioItem");
|
|
1271
1269
|
//#endregion
|
|
1272
1270
|
//#region src/components/Dropdown/internal/composeEventHandlers.ts
|
|
1273
|
-
function
|
|
1271
|
+
function Et(e, t) {
|
|
1274
1272
|
return (n) => {
|
|
1275
1273
|
e?.(n), n.defaultPrevented || t(n);
|
|
1276
1274
|
};
|
|
1277
1275
|
}
|
|
1278
|
-
function
|
|
1276
|
+
function Dt(...e) {
|
|
1279
1277
|
return (t) => {
|
|
1280
1278
|
e.forEach((e) => {
|
|
1281
1279
|
if (e) {
|
|
@@ -1288,40 +1286,40 @@ function Ot(...e) {
|
|
|
1288
1286
|
});
|
|
1289
1287
|
};
|
|
1290
1288
|
}
|
|
1291
|
-
function
|
|
1289
|
+
function Ot(e) {
|
|
1292
1290
|
return typeof e == "number" ? `${e}px` : e;
|
|
1293
1291
|
}
|
|
1294
|
-
var
|
|
1295
|
-
let L = S(), R = `${L}-trigger`, z = `${L}-menu`, B = T(null), ee = T(null), [V, H] = E(), [te, ne] = E({}), [re,
|
|
1292
|
+
var kt = { wrapper: "_wrapper_14ue8_1" }, At = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, size: i = "md", color: a = "primary", placement: o = "bottom-start", strategy: s, offset: c = 2, collisionPadding: l = 8, matchTriggerWidth: u = !1, minWidth: p, maxWidth: m, portal: h = !0, avoidCollisions: g = !0, modal: _ = !1, closeOnSelect: v = !0, loop: b = !0, disabled: C = !1, loading: D = !1, loadingText: O = "Loading actions...", searchable: k = !1, command: A = !1, searchValue: j, defaultSearchValue: M = "", searchPlaceholder: N, onSearch: P, empty: F, className: I }) => {
|
|
1293
|
+
let L = S(), R = `${L}-trigger`, z = `${L}-menu`, B = T(null), ee = T(null), [V, H] = E(), [te, ne] = E({}), [re, ie] = E(M), W = j ?? re, G = w(() => ae(e), [e]), K = G.content?.props.command ?? !1, oe = k || A || K || !!G.search, se = w(() => Mt(G.items), [G.items]), ce = w(() => G.items.map((e) => ({
|
|
1296
1294
|
disabled: e.disabled,
|
|
1297
1295
|
label: e.label
|
|
1298
|
-
})), [G.items]),
|
|
1299
|
-
|
|
1296
|
+
})), [G.items]), q = w(() => !oe || !W.trim() ? G : Nt(G, W), [
|
|
1297
|
+
oe,
|
|
1300
1298
|
G,
|
|
1301
|
-
|
|
1302
|
-
]),
|
|
1299
|
+
W
|
|
1300
|
+
]), le = w(() => q.items.map((e) => ({
|
|
1303
1301
|
disabled: e.disabled,
|
|
1304
1302
|
label: e.label
|
|
1305
|
-
})), [
|
|
1303
|
+
})), [q.items]);
|
|
1306
1304
|
x(() => {
|
|
1307
1305
|
ne((e) => {
|
|
1308
1306
|
let t = { ...e };
|
|
1309
|
-
return
|
|
1307
|
+
return se.forEach((e) => {
|
|
1310
1308
|
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
1311
1309
|
}), t;
|
|
1312
1310
|
});
|
|
1313
|
-
}, [
|
|
1314
|
-
let { activeIndex:
|
|
1315
|
-
items:
|
|
1311
|
+
}, [se]);
|
|
1312
|
+
let { activeIndex: ue, setActiveIndex: de, isOpen: fe, closeDropdown: J, toggleDropdown: pe, onKeyDown: me } = Be({
|
|
1313
|
+
items: oe ? le : ce,
|
|
1316
1314
|
open: t,
|
|
1317
1315
|
defaultOpen: n,
|
|
1318
1316
|
disabled: C,
|
|
1319
1317
|
onOpenChange: r,
|
|
1320
|
-
getItemValue: (e, t) => (
|
|
1318
|
+
getItemValue: (e, t) => (oe ? q.items : G.items)[t]?.id ?? "",
|
|
1321
1319
|
getItemText: (e) => e.label,
|
|
1322
1320
|
loop: b
|
|
1323
|
-
}), { floatingStyles:
|
|
1324
|
-
open:
|
|
1321
|
+
}), { floatingStyles: he, isMobileSheet: ge, isPositioned: _e, setRef: ve, setFloatingRef: ye } = je({
|
|
1322
|
+
open: fe,
|
|
1325
1323
|
placement: o,
|
|
1326
1324
|
strategy: s,
|
|
1327
1325
|
portal: h,
|
|
@@ -1330,20 +1328,20 @@ var At = { wrapper: "_wrapper_14ue8_1" }, jt = ({ children: e, open: t, defaultO
|
|
|
1330
1328
|
offset: c,
|
|
1331
1329
|
collisionPadding: l,
|
|
1332
1330
|
mobileSheetBreakpoint: 640
|
|
1333
|
-
}),
|
|
1334
|
-
j === void 0 &&
|
|
1331
|
+
}), be = y((e) => {
|
|
1332
|
+
j === void 0 && ie(e), P?.(e), de(0);
|
|
1335
1333
|
}, [
|
|
1336
1334
|
P,
|
|
1337
1335
|
j,
|
|
1338
|
-
|
|
1336
|
+
de
|
|
1339
1337
|
]);
|
|
1340
|
-
|
|
1341
|
-
active:
|
|
1338
|
+
Fe({
|
|
1339
|
+
active: fe,
|
|
1342
1340
|
enabled: _
|
|
1343
1341
|
});
|
|
1344
|
-
let
|
|
1345
|
-
|
|
1346
|
-
}, [
|
|
1342
|
+
let xe = y(() => {
|
|
1343
|
+
J(), B.current?.focus();
|
|
1344
|
+
}, [J]), Se = y((e, t) => {
|
|
1347
1345
|
if (e.disabled || D) return;
|
|
1348
1346
|
if (e.type === "subTrigger") {
|
|
1349
1347
|
H(e.id);
|
|
@@ -1354,13 +1352,13 @@ var At = { wrapper: "_wrapper_14ue8_1" }, jt = ({ children: e, open: t, defaultO
|
|
|
1354
1352
|
[e.groupId]: e.props.value
|
|
1355
1353
|
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
1356
1354
|
let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && v);
|
|
1357
|
-
!t.defaultPrevented && n &&
|
|
1355
|
+
!t.defaultPrevented && n && xe();
|
|
1358
1356
|
}, [
|
|
1359
|
-
|
|
1357
|
+
xe,
|
|
1360
1358
|
v,
|
|
1361
1359
|
D
|
|
1362
|
-
]),
|
|
1363
|
-
let t =
|
|
1360
|
+
]), Ce = y((e) => {
|
|
1361
|
+
let t = q.items[ue];
|
|
1364
1362
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
1365
1363
|
e.preventDefault(), H(t.id);
|
|
1366
1364
|
return;
|
|
@@ -1371,99 +1369,99 @@ var At = { wrapper: "_wrapper_14ue8_1" }, jt = ({ children: e, open: t, defaultO
|
|
|
1371
1369
|
}
|
|
1372
1370
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
1373
1371
|
e.preventDefault();
|
|
1374
|
-
let n =
|
|
1375
|
-
|
|
1372
|
+
let n = jt(e);
|
|
1373
|
+
Se(t, n);
|
|
1376
1374
|
return;
|
|
1377
1375
|
}
|
|
1378
|
-
|
|
1376
|
+
me(e), e.key === "Escape" && B.current?.focus();
|
|
1379
1377
|
}, [
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1378
|
+
ue,
|
|
1379
|
+
q.items,
|
|
1380
|
+
me,
|
|
1383
1381
|
V,
|
|
1384
|
-
|
|
1385
|
-
]),
|
|
1386
|
-
e.preventDefault(),
|
|
1387
|
-
}, [
|
|
1388
|
-
B.current = e,
|
|
1389
|
-
}, [
|
|
1390
|
-
ee.current = e,
|
|
1391
|
-
}, [
|
|
1392
|
-
active:
|
|
1382
|
+
Se
|
|
1383
|
+
]), we = y((e) => {
|
|
1384
|
+
e.preventDefault(), pe();
|
|
1385
|
+
}, [pe]), Te = y((e) => {
|
|
1386
|
+
B.current = e, ve(e);
|
|
1387
|
+
}, [ve]), Ee = y((e) => {
|
|
1388
|
+
ee.current = e, ye(e), ge && e?.focus({ preventScroll: !0 });
|
|
1389
|
+
}, [ge, ye]), De = Ae({
|
|
1390
|
+
active: fe,
|
|
1393
1391
|
id: z,
|
|
1394
1392
|
zIndexLevel: "dropdown",
|
|
1395
1393
|
closeOnEscape: !0,
|
|
1396
1394
|
closeOnOutsidePress: !0,
|
|
1397
1395
|
contentRef: ee,
|
|
1398
1396
|
ignoreRefs: [B],
|
|
1399
|
-
requestClose: () =>
|
|
1400
|
-
}),
|
|
1401
|
-
...
|
|
1402
|
-
zIndex:
|
|
1403
|
-
minWidth:
|
|
1404
|
-
maxWidth:
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1397
|
+
requestClose: () => J()
|
|
1398
|
+
}), Oe = {
|
|
1399
|
+
...he,
|
|
1400
|
+
zIndex: De.zIndex,
|
|
1401
|
+
minWidth: Ot(p),
|
|
1402
|
+
maxWidth: Ot(m)
|
|
1403
|
+
}, ke = {
|
|
1404
|
+
disabled: C,
|
|
1405
|
+
isOpen: fe,
|
|
1406
|
+
contentId: z,
|
|
1407
|
+
triggerId: R,
|
|
1408
|
+
setTriggerRef: Te,
|
|
1409
|
+
onClick: we,
|
|
1410
|
+
onKeyDown: Ce
|
|
1411
|
+
}, Me = {
|
|
1412
|
+
activeIndex: ue,
|
|
1413
|
+
closeOnSelect: v,
|
|
1414
|
+
color: a,
|
|
1415
|
+
contentReadyToFocus: ge || _e,
|
|
1416
|
+
contentId: z,
|
|
1417
|
+
contentProps: G.content?.props,
|
|
1418
|
+
disabled: C,
|
|
1419
|
+
entries: q.entries,
|
|
1420
|
+
getItemId: (e) => `${z}-item-${e}`,
|
|
1421
|
+
isOpen: fe,
|
|
1422
|
+
items: q.items,
|
|
1423
|
+
loading: D,
|
|
1424
|
+
loadingText: O,
|
|
1425
|
+
empty: F,
|
|
1426
|
+
maxWidth: m,
|
|
1427
|
+
minWidth: p,
|
|
1428
|
+
openSubId: V,
|
|
1429
|
+
onKeyDown: Ce,
|
|
1430
|
+
portal: !G.portal && h,
|
|
1431
|
+
radioValues: te,
|
|
1432
|
+
searchPlaceholder: G.search?.props.placeholder ?? N ?? (A || K ? "Type a command..." : "Search actions..."),
|
|
1433
|
+
searchProps: G.search?.props,
|
|
1434
|
+
searchValue: W,
|
|
1435
|
+
searchable: oe,
|
|
1436
|
+
selectItem: Se,
|
|
1437
|
+
setActiveIndex: de,
|
|
1438
|
+
setContentRef: Ee,
|
|
1439
|
+
setOpenSubId: H,
|
|
1440
|
+
setRadioValue: (e, t) => {
|
|
1441
|
+
ne((n) => ({
|
|
1442
|
+
...n,
|
|
1443
|
+
[e]: t
|
|
1444
|
+
}));
|
|
1415
1445
|
},
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
entries: K.entries,
|
|
1426
|
-
getItemId: (e) => `${z}-item-${e}`,
|
|
1427
|
-
isOpen: pe,
|
|
1428
|
-
items: K.items,
|
|
1429
|
-
loading: D,
|
|
1430
|
-
loadingText: O,
|
|
1431
|
-
empty: F,
|
|
1432
|
-
maxWidth: m,
|
|
1433
|
-
minWidth: p,
|
|
1434
|
-
openSubId: V,
|
|
1435
|
-
onKeyDown: Te,
|
|
1436
|
-
portal: !G.portal && h,
|
|
1437
|
-
radioValues: te,
|
|
1438
|
-
searchPlaceholder: G.search?.props.placeholder ?? N ?? (A || oe ? "Type a command..." : "Search actions..."),
|
|
1439
|
-
searchProps: G.search?.props,
|
|
1440
|
-
searchValue: ie,
|
|
1441
|
-
searchable: se,
|
|
1442
|
-
selectItem: we,
|
|
1443
|
-
setActiveIndex: fe,
|
|
1444
|
-
setContentRef: Oe,
|
|
1445
|
-
setOpenSubId: H,
|
|
1446
|
-
setRadioValue: (e, t) => {
|
|
1447
|
-
ne((n) => ({
|
|
1448
|
-
...n,
|
|
1449
|
-
[e]: t
|
|
1450
|
-
}));
|
|
1451
|
-
},
|
|
1452
|
-
setSearchValue: Se,
|
|
1453
|
-
size: i,
|
|
1454
|
-
surfaceStyle: Ae,
|
|
1455
|
-
triggerId: R
|
|
1456
|
-
},
|
|
1446
|
+
setSearchValue: be,
|
|
1447
|
+
size: i,
|
|
1448
|
+
surfaceStyle: Oe,
|
|
1449
|
+
triggerId: R
|
|
1450
|
+
};
|
|
1451
|
+
return /* @__PURE__ */ d(nt, {
|
|
1452
|
+
value: ke,
|
|
1453
|
+
children: /* @__PURE__ */ d(tt, {
|
|
1454
|
+
value: Me,
|
|
1457
1455
|
children: /* @__PURE__ */ f("div", {
|
|
1458
|
-
className: U(
|
|
1456
|
+
className: U(kt.wrapper, I),
|
|
1459
1457
|
"data-disabled": C || void 0,
|
|
1460
|
-
children: [G.trigger ?? null, G.portal ?? G.content ?? /* @__PURE__ */ d(
|
|
1458
|
+
children: [G.trigger ?? null, G.portal ?? G.content ?? /* @__PURE__ */ d(yt, {})]
|
|
1461
1459
|
})
|
|
1462
1460
|
})
|
|
1463
1461
|
});
|
|
1464
1462
|
};
|
|
1465
|
-
|
|
1466
|
-
function
|
|
1463
|
+
At.displayName = "DropdownRoot";
|
|
1464
|
+
function jt(e) {
|
|
1467
1465
|
let t = !1;
|
|
1468
1466
|
return {
|
|
1469
1467
|
originalEvent: e,
|
|
@@ -1475,13 +1473,13 @@ function Mt(e) {
|
|
|
1475
1473
|
}
|
|
1476
1474
|
};
|
|
1477
1475
|
}
|
|
1478
|
-
function
|
|
1476
|
+
function Mt(e) {
|
|
1479
1477
|
let t = [];
|
|
1480
1478
|
return e.forEach((e) => {
|
|
1481
|
-
t.push(e), e.type === "subTrigger" && t.push(...
|
|
1479
|
+
t.push(e), e.type === "subTrigger" && t.push(...Mt(e.subItems));
|
|
1482
1480
|
}), t;
|
|
1483
1481
|
}
|
|
1484
|
-
function
|
|
1482
|
+
function Nt(e, t) {
|
|
1485
1483
|
let n = t.trim().toLocaleLowerCase(), r = new Set(e.items.filter((e) => e.label.toLocaleLowerCase().includes(n)).map((e) => e.id)), i = e.items.filter((e) => r.has(e.id));
|
|
1486
1484
|
return {
|
|
1487
1485
|
...e,
|
|
@@ -1491,7 +1489,7 @@ function Pt(e, t) {
|
|
|
1491
1489
|
}
|
|
1492
1490
|
//#endregion
|
|
1493
1491
|
//#region src/components/Dropdown/Search/DropdownSearch.tsx
|
|
1494
|
-
var
|
|
1492
|
+
var Pt = K("search", "Dropdown.Search"), Ft = K("subContent", "Dropdown.SubContent"), It = K("subTrigger", "Dropdown.SubTrigger"), Lt = K("sub", "Dropdown.Sub"), Rt = {
|
|
1495
1493
|
button: "_button_bb3ib_1",
|
|
1496
1494
|
disabled: "_disabled_bb3ib_63",
|
|
1497
1495
|
arrow: "_arrow_bb3ib_71",
|
|
@@ -1507,21 +1505,21 @@ var Ft = G("search", "Dropdown.Search"), It = G("subContent", "Dropdown.SubConte
|
|
|
1507
1505
|
lg: "_lg_bb3ib_350",
|
|
1508
1506
|
label: "_label_bb3ib_362",
|
|
1509
1507
|
open: "_open_bb3ib_390"
|
|
1510
|
-
},
|
|
1511
|
-
s(
|
|
1512
|
-
var
|
|
1513
|
-
let i =
|
|
1508
|
+
}, zt = (e) => /* @__PURE__ */ d(Bt, { ...e });
|
|
1509
|
+
s(zt, "trigger"), zt.displayName = "Dropdown.Trigger";
|
|
1510
|
+
var Bt = ({ children: e, asChild: t = !1, disabled: n, className: r }) => {
|
|
1511
|
+
let i = rt(), a = it(), o = t && v(e) ? e : void 0, s = i.disabled || n, c = {
|
|
1514
1512
|
id: a.triggerId,
|
|
1515
|
-
ref: o ?
|
|
1513
|
+
ref: o ? Dt(o.props.ref, a.setTriggerRef) : a.setTriggerRef,
|
|
1516
1514
|
"aria-controls": a.isOpen ? a.contentId : void 0,
|
|
1517
1515
|
"aria-disabled": s || void 0,
|
|
1518
1516
|
"aria-expanded": a.isOpen,
|
|
1519
1517
|
"aria-haspopup": "menu",
|
|
1520
|
-
className: U(!o &&
|
|
1518
|
+
className: U(!o && Rt.button, !o && Rt[i.size], !o && Rt[i.color], r),
|
|
1521
1519
|
"data-state": a.isOpen ? "open" : "closed",
|
|
1522
1520
|
disabled: s || void 0,
|
|
1523
|
-
onClick:
|
|
1524
|
-
onKeyDown:
|
|
1521
|
+
onClick: Et(o?.props.onClick, a.onClick),
|
|
1522
|
+
onKeyDown: Et(o?.props.onKeyDown, a.onKeyDown)
|
|
1525
1523
|
};
|
|
1526
1524
|
return o ? h(o, {
|
|
1527
1525
|
...c,
|
|
@@ -1530,68 +1528,68 @@ var Vt = ({ children: e, asChild: t = !1, disabled: n, className: r }) => {
|
|
|
1530
1528
|
type: "button",
|
|
1531
1529
|
...c,
|
|
1532
1530
|
children: [/* @__PURE__ */ d("span", {
|
|
1533
|
-
className:
|
|
1531
|
+
className: Rt.label,
|
|
1534
1532
|
children: e
|
|
1535
1533
|
}), /* @__PURE__ */ d("span", {
|
|
1536
|
-
className: U(
|
|
1534
|
+
className: U(Rt.arrow, { [Rt.open]: a.isOpen }),
|
|
1537
1535
|
"aria-hidden": "true",
|
|
1538
|
-
children: /* @__PURE__ */ d(
|
|
1536
|
+
children: /* @__PURE__ */ d(H, {})
|
|
1539
1537
|
})]
|
|
1540
1538
|
});
|
|
1541
1539
|
};
|
|
1542
|
-
|
|
1540
|
+
Bt.displayName = "DropdownTriggerSurface";
|
|
1543
1541
|
//#endregion
|
|
1544
1542
|
//#region src/components/Dropdown/Dropdown.tsx
|
|
1545
|
-
var
|
|
1546
|
-
Trigger:
|
|
1547
|
-
Content:
|
|
1548
|
-
Search:
|
|
1549
|
-
Item:
|
|
1550
|
-
CheckboxItem:
|
|
1551
|
-
RadioGroup:
|
|
1552
|
-
RadioItem:
|
|
1553
|
-
Group:
|
|
1554
|
-
Label:
|
|
1555
|
-
Separator:
|
|
1556
|
-
Sub:
|
|
1557
|
-
SubTrigger:
|
|
1558
|
-
SubContent:
|
|
1559
|
-
ItemIcon:
|
|
1560
|
-
ItemDescription:
|
|
1561
|
-
ItemBadge:
|
|
1562
|
-
ItemShortcut:
|
|
1543
|
+
var Vt = Object.assign(At, {
|
|
1544
|
+
Trigger: zt,
|
|
1545
|
+
Content: yt,
|
|
1546
|
+
Search: Pt,
|
|
1547
|
+
Item: ot,
|
|
1548
|
+
CheckboxItem: q,
|
|
1549
|
+
RadioGroup: wt,
|
|
1550
|
+
RadioItem: Tt,
|
|
1551
|
+
Group: Xe,
|
|
1552
|
+
Label: ft,
|
|
1553
|
+
Separator: _t,
|
|
1554
|
+
Sub: Lt,
|
|
1555
|
+
SubTrigger: It,
|
|
1556
|
+
SubContent: Ft,
|
|
1557
|
+
ItemIcon: St,
|
|
1558
|
+
ItemDescription: xt,
|
|
1559
|
+
ItemBadge: bt,
|
|
1560
|
+
ItemShortcut: Ct,
|
|
1563
1561
|
Arrow: W,
|
|
1564
|
-
Empty:
|
|
1565
|
-
Loading:
|
|
1562
|
+
Empty: Je,
|
|
1563
|
+
Loading: mt
|
|
1566
1564
|
});
|
|
1567
|
-
|
|
1565
|
+
Vt.displayName = "Dropdown";
|
|
1568
1566
|
//#endregion
|
|
1569
1567
|
//#region src/components/Modal/internal/ModalContext.tsx
|
|
1570
|
-
var
|
|
1571
|
-
let e = b(
|
|
1568
|
+
var Ht = g(void 0), Ut = g(void 0), Wt = () => {
|
|
1569
|
+
let e = b(Ht);
|
|
1572
1570
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
1573
1571
|
return e;
|
|
1574
|
-
},
|
|
1575
|
-
|
|
1576
|
-
var
|
|
1572
|
+
}, Gt = () => b(Ut), Kt = Ht.Provider, qt = Ut.Provider;
|
|
1573
|
+
Ht.displayName = "ModalContext", Ut.displayName = "ModalContentContext";
|
|
1574
|
+
var Jt = {
|
|
1577
1575
|
modalBody: "_modalBody_ou4ff_1",
|
|
1578
1576
|
inside: "_inside_ou4ff_6"
|
|
1579
|
-
},
|
|
1580
|
-
let n =
|
|
1577
|
+
}, Yt = ({ children: e, className: t }) => {
|
|
1578
|
+
let n = Gt();
|
|
1581
1579
|
return /* @__PURE__ */ d("div", {
|
|
1582
|
-
className: U(
|
|
1580
|
+
className: U(Jt.modalBody, n?.scrollBehavior === "inside" && Jt.inside, t),
|
|
1583
1581
|
children: e
|
|
1584
1582
|
});
|
|
1585
1583
|
};
|
|
1586
|
-
|
|
1584
|
+
Yt.displayName = "ModalBody";
|
|
1587
1585
|
//#endregion
|
|
1588
1586
|
//#region src/components/Modal/internal/composeEventHandlers.ts
|
|
1589
|
-
function
|
|
1587
|
+
function Xt(e, t) {
|
|
1590
1588
|
return (n) => {
|
|
1591
1589
|
e?.(n), n.defaultPrevented || t(n);
|
|
1592
1590
|
};
|
|
1593
1591
|
}
|
|
1594
|
-
function
|
|
1592
|
+
function Zt(...e) {
|
|
1595
1593
|
return (t) => {
|
|
1596
1594
|
e.forEach((e) => {
|
|
1597
1595
|
if (e) {
|
|
@@ -1604,17 +1602,17 @@ function Qt(...e) {
|
|
|
1604
1602
|
});
|
|
1605
1603
|
};
|
|
1606
1604
|
}
|
|
1607
|
-
var
|
|
1605
|
+
var Qt = {
|
|
1608
1606
|
modalHeader: "_modalHeader_hw9hl_1",
|
|
1609
1607
|
modalHeaderText: "_modalHeaderText_hw9hl_8",
|
|
1610
1608
|
modalHeaderTitle: "_modalHeaderTitle_hw9hl_13",
|
|
1611
1609
|
modalHeaderDescription: "_modalHeaderDescription_hw9hl_20",
|
|
1612
1610
|
modalHeaderCloseButton: "_modalHeaderCloseButton_hw9hl_26"
|
|
1613
|
-
},
|
|
1614
|
-
let i =
|
|
1611
|
+
}, $t = ({ asChild: e = !1, children: t, className: n, "aria-label": r }) => {
|
|
1612
|
+
let i = Wt(), a = e && v(t) ? t : void 0, o = {
|
|
1615
1613
|
"aria-label": a ? r : r ?? "Close dialog",
|
|
1616
|
-
className: U(!a &&
|
|
1617
|
-
onClick:
|
|
1614
|
+
className: U(!a && Qt.modalHeaderCloseButton, n),
|
|
1615
|
+
onClick: Xt(a?.props.onClick, i.requestClose)
|
|
1618
1616
|
};
|
|
1619
1617
|
return a ? h(a, {
|
|
1620
1618
|
...o,
|
|
@@ -1623,11 +1621,11 @@ var $t = {
|
|
|
1623
1621
|
}) : /* @__PURE__ */ d("button", {
|
|
1624
1622
|
type: "button",
|
|
1625
1623
|
...o,
|
|
1626
|
-
children: /* @__PURE__ */ d(
|
|
1624
|
+
children: /* @__PURE__ */ d(ne, { size: 16 })
|
|
1627
1625
|
});
|
|
1628
1626
|
};
|
|
1629
|
-
|
|
1630
|
-
var
|
|
1627
|
+
$t.displayName = "Modal.Close";
|
|
1628
|
+
var en = {
|
|
1631
1629
|
content: "_content_1tnw8_1",
|
|
1632
1630
|
animated: "_animated_1tnw8_24",
|
|
1633
1631
|
"modal-content-open": "_modal-content-open_1tnw8_1",
|
|
@@ -1641,11 +1639,11 @@ var tn = {
|
|
|
1641
1639
|
full: "_full_1tnw8_107",
|
|
1642
1640
|
inside: "_inside_1tnw8_113",
|
|
1643
1641
|
outside: "_outside_1tnw8_117"
|
|
1644
|
-
},
|
|
1645
|
-
let f =
|
|
1642
|
+
}, tn = ({ children: e, size: t = "md", placement: n = "center", scrollBehavior: r = "inside", animated: i = !0, forceMount: a = !1, ariaLabel: o, ariaLabelledBy: s, ariaDescribedBy: c, className: l, style: u }) => {
|
|
1643
|
+
let f = Wt(), p = f.open, m = p && f.shouldRender, [h, g] = E(null), _ = y((e) => {
|
|
1646
1644
|
f.setContentRef(e), g(e);
|
|
1647
1645
|
}, [f]);
|
|
1648
|
-
if (
|
|
1646
|
+
if (ge({
|
|
1649
1647
|
active: m,
|
|
1650
1648
|
contentRef: f.contentRef,
|
|
1651
1649
|
enabled: f.trapFocus,
|
|
@@ -1654,19 +1652,19 @@ var tn = {
|
|
|
1654
1652
|
onCloseAutoFocus: f.onCloseAutoFocus,
|
|
1655
1653
|
onOpenAutoFocus: f.onOpenAutoFocus,
|
|
1656
1654
|
restoreFocus: f.restoreFocus
|
|
1657
|
-
}),
|
|
1655
|
+
}), le({
|
|
1658
1656
|
active: p,
|
|
1659
1657
|
content: h,
|
|
1660
1658
|
enabled: f.modal
|
|
1661
1659
|
}), !f.shouldRender && !a) return null;
|
|
1662
1660
|
let v = s ?? (o ? void 0 : f.titleId), b = c ?? f.descriptionId;
|
|
1663
|
-
return /* @__PURE__ */ d(
|
|
1661
|
+
return /* @__PURE__ */ d(qt, {
|
|
1664
1662
|
value: { scrollBehavior: r },
|
|
1665
1663
|
children: /* @__PURE__ */ d("div", {
|
|
1666
1664
|
id: f.contentId,
|
|
1667
|
-
ref:
|
|
1665
|
+
ref: Zt(_),
|
|
1668
1666
|
tabIndex: -1,
|
|
1669
|
-
className: U(
|
|
1667
|
+
className: U(en.content, en[t], en[n], en[r], i && en.animated, l),
|
|
1670
1668
|
style: {
|
|
1671
1669
|
...f.animationStyle,
|
|
1672
1670
|
...u
|
|
@@ -1682,61 +1680,61 @@ var tn = {
|
|
|
1682
1680
|
})
|
|
1683
1681
|
});
|
|
1684
1682
|
};
|
|
1685
|
-
|
|
1686
|
-
var
|
|
1687
|
-
className: U(
|
|
1683
|
+
tn.displayName = "ModalContent";
|
|
1684
|
+
var nn = { modalFooter: "_modalFooter_sb1pn_1" }, rn = ({ children: e, className: t }) => /* @__PURE__ */ d("div", {
|
|
1685
|
+
className: U(nn.modalFooter, t),
|
|
1688
1686
|
children: e
|
|
1689
1687
|
});
|
|
1690
|
-
|
|
1688
|
+
rn.displayName = "ModalFooter";
|
|
1691
1689
|
//#endregion
|
|
1692
1690
|
//#region src/components/Modal/Header/ModalDescription.tsx
|
|
1693
|
-
var
|
|
1694
|
-
let { descriptionId: t, setDescriptionPresent: n } =
|
|
1691
|
+
var an = ({ children: e }) => {
|
|
1692
|
+
let { descriptionId: t, setDescriptionPresent: n } = Wt();
|
|
1695
1693
|
return x(() => (n(!0), () => n(!1)), [n]), /* @__PURE__ */ d("p", {
|
|
1696
1694
|
id: t,
|
|
1697
|
-
className:
|
|
1695
|
+
className: Qt.modalHeaderDescription,
|
|
1698
1696
|
children: e
|
|
1699
1697
|
});
|
|
1700
1698
|
};
|
|
1701
|
-
|
|
1699
|
+
an.displayName = "Modal.Description";
|
|
1702
1700
|
//#endregion
|
|
1703
1701
|
//#region src/components/Modal/Header/ModalHeader.tsx
|
|
1704
|
-
var
|
|
1705
|
-
className: U(
|
|
1702
|
+
var on = ({ children: e, className: t }) => /* @__PURE__ */ d("div", {
|
|
1703
|
+
className: U(Qt.modalHeader, t),
|
|
1706
1704
|
children: e
|
|
1707
1705
|
});
|
|
1708
|
-
|
|
1706
|
+
on.displayName = "ModalHeader";
|
|
1709
1707
|
//#endregion
|
|
1710
1708
|
//#region src/components/Modal/Header/ModalTitle.tsx
|
|
1711
|
-
var
|
|
1712
|
-
let { setTitlePresent: t, titleId: n } =
|
|
1713
|
-
return
|
|
1709
|
+
var sn = ({ children: e }) => {
|
|
1710
|
+
let { setTitlePresent: t, titleId: n } = Wt();
|
|
1711
|
+
return C(() => (t(!0), () => t(!1)), [t]), /* @__PURE__ */ d("h2", {
|
|
1714
1712
|
id: n,
|
|
1715
|
-
className:
|
|
1713
|
+
className: Qt.modalHeaderTitle,
|
|
1716
1714
|
children: e
|
|
1717
1715
|
});
|
|
1718
1716
|
};
|
|
1719
|
-
|
|
1720
|
-
var
|
|
1717
|
+
sn.displayName = "Modal.Title";
|
|
1718
|
+
var cn = {
|
|
1721
1719
|
overlay: "_overlay_d6wdf_1",
|
|
1722
1720
|
"overlay--open": "_overlay--open_d6wdf_10",
|
|
1723
1721
|
"overlay--animated": "_overlay--animated_d6wdf_15",
|
|
1724
1722
|
"modal-overlay-open": "_modal-overlay-open_d6wdf_1",
|
|
1725
1723
|
"modal-overlay-close": "_modal-overlay-close_d6wdf_1"
|
|
1726
|
-
},
|
|
1727
|
-
let { animation: r, animationStyle: i, open: a, shouldRender: o } =
|
|
1724
|
+
}, ln = ({ className: e, animated: t = !0, forceMount: n = !1 }) => {
|
|
1725
|
+
let { animation: r, animationStyle: i, open: a, shouldRender: o } = Wt();
|
|
1728
1726
|
return !o && !n ? null : /* @__PURE__ */ d("div", {
|
|
1729
|
-
className: U(
|
|
1727
|
+
className: U(cn.overlay, a && cn["overlay--open"], t && cn["overlay--animated"], e),
|
|
1730
1728
|
style: i,
|
|
1731
1729
|
"data-state": a ? "open" : "closed",
|
|
1732
1730
|
"data-animation": r,
|
|
1733
1731
|
"aria-hidden": "true"
|
|
1734
1732
|
});
|
|
1735
1733
|
};
|
|
1736
|
-
|
|
1734
|
+
ln.displayName = "ModalOverlay";
|
|
1737
1735
|
//#endregion
|
|
1738
1736
|
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1739
|
-
var
|
|
1737
|
+
var un = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnEscape: i, closeOnOutsidePress: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) => Ae({
|
|
1740
1738
|
active: e,
|
|
1741
1739
|
registrationActive: t,
|
|
1742
1740
|
id: n,
|
|
@@ -1748,55 +1746,55 @@ var dn = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1748
1746
|
onInteractOutside: c ? (e) => c(e) : void 0,
|
|
1749
1747
|
onPointerDownOutside: s ? (e) => s(e) : void 0,
|
|
1750
1748
|
requestClose: l
|
|
1751
|
-
}),
|
|
1752
|
-
standard:
|
|
1749
|
+
}), dn = {
|
|
1750
|
+
standard: ee.components.modal.motion.easing,
|
|
1753
1751
|
linear: "linear",
|
|
1754
1752
|
ease: "ease",
|
|
1755
1753
|
"ease-in": "ease-in",
|
|
1756
1754
|
"ease-out": "ease-out",
|
|
1757
1755
|
"ease-in-out": "ease-in-out"
|
|
1758
|
-
},
|
|
1756
|
+
}, fn = (e) => Number.parseFloat(e), pn = (e) => typeof e == "number" ? {
|
|
1759
1757
|
close: e,
|
|
1760
1758
|
open: e
|
|
1761
1759
|
} : {
|
|
1762
|
-
close: e?.close ??
|
|
1763
|
-
open: e?.open ??
|
|
1764
|
-
},
|
|
1765
|
-
let S = T(null), { contentId: C, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } =
|
|
1760
|
+
close: e?.close ?? fn(ee.components.modal.motion.closeDuration),
|
|
1761
|
+
open: e?.open ?? fn(ee.components.modal.motion.openDuration)
|
|
1762
|
+
}, mn = ({ open: e, defaultOpen: t = !1, onOpenChange: n, animation: r = "scale", duration: i, easing: a = "standard", modal: o = !0, closeOnEscape: s = !0, closeOnOutsidePress: c = !0, preventScroll: l = !0, restoreFocus: u = !0, trapFocus: d = !0, initialFocus: f, finalFocus: p, onOpenAutoFocus: m, onCloseAutoFocus: h, onEscapeKeyDown: g, onPointerDownOutside: _, onInteractOutside: v, role: b = "dialog" }) => {
|
|
1763
|
+
let S = T(null), { contentId: C, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } = Ve({
|
|
1766
1764
|
open: e,
|
|
1767
1765
|
defaultOpen: t,
|
|
1768
1766
|
onOpenChange: n,
|
|
1769
1767
|
closeOnEscape: s,
|
|
1770
1768
|
closeOnOutsidePress: c
|
|
1771
|
-
}), [M, N] = E(!1), [P, F] = E(!1), I =
|
|
1769
|
+
}), [M, N] = E(!1), [P, F] = E(!1), [I, L] = E(0), R = pn(i), z = r === "none" ? 0 : R.close, [B, ee] = E(O);
|
|
1772
1770
|
x(() => {
|
|
1773
1771
|
if (O) {
|
|
1774
|
-
|
|
1772
|
+
ee(!0);
|
|
1775
1773
|
return;
|
|
1776
1774
|
}
|
|
1777
|
-
if (
|
|
1778
|
-
|
|
1775
|
+
if (z === 0) {
|
|
1776
|
+
ee(!1);
|
|
1779
1777
|
return;
|
|
1780
1778
|
}
|
|
1781
1779
|
let e = window.setTimeout(() => {
|
|
1782
|
-
|
|
1783
|
-
},
|
|
1780
|
+
ee(!1);
|
|
1781
|
+
}, z);
|
|
1784
1782
|
return () => {
|
|
1785
1783
|
window.clearTimeout(e);
|
|
1786
1784
|
};
|
|
1787
|
-
}, [
|
|
1788
|
-
let
|
|
1785
|
+
}, [z, O]);
|
|
1786
|
+
let V = y(() => {
|
|
1789
1787
|
k();
|
|
1790
|
-
}, [k]),
|
|
1791
|
-
S.current = e;
|
|
1788
|
+
}, [k]), H = y((e) => {
|
|
1789
|
+
S.current !== e && (S.current = e, L((e) => e + 1));
|
|
1792
1790
|
}, []);
|
|
1793
|
-
|
|
1791
|
+
Fe({
|
|
1794
1792
|
active: O,
|
|
1795
1793
|
enabled: l
|
|
1796
1794
|
});
|
|
1797
|
-
let
|
|
1795
|
+
let te = un({
|
|
1798
1796
|
active: O,
|
|
1799
|
-
registrationActive:
|
|
1797
|
+
registrationActive: B,
|
|
1800
1798
|
id: C,
|
|
1801
1799
|
contentRef: S,
|
|
1802
1800
|
closeOnEscape: s,
|
|
@@ -1804,24 +1802,35 @@ var dn = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1804
1802
|
onEscapeKeyDown: g,
|
|
1805
1803
|
onInteractOutside: v,
|
|
1806
1804
|
onPointerDownOutside: _,
|
|
1807
|
-
requestClose:
|
|
1808
|
-
}),
|
|
1809
|
-
"--modal-animation-close-duration": `${
|
|
1810
|
-
"--modal-animation-easing":
|
|
1811
|
-
"--modal-animation-open-duration": `${
|
|
1812
|
-
"--z-index-modal":
|
|
1805
|
+
requestClose: V
|
|
1806
|
+
}), ne = w(() => ({
|
|
1807
|
+
"--modal-animation-close-duration": `${R.close}ms`,
|
|
1808
|
+
"--modal-animation-easing": dn[a],
|
|
1809
|
+
"--modal-animation-open-duration": `${R.open}ms`,
|
|
1810
|
+
"--z-index-modal": te.zIndex === void 0 ? void 0 : `${te.zIndex}`
|
|
1813
1811
|
}), [
|
|
1814
|
-
|
|
1815
|
-
|
|
1812
|
+
R.close,
|
|
1813
|
+
R.open,
|
|
1816
1814
|
a,
|
|
1817
|
-
|
|
1818
|
-
]),
|
|
1815
|
+
te.zIndex
|
|
1816
|
+
]), re = je({
|
|
1819
1817
|
presentation: "modal",
|
|
1820
|
-
animationStyle:
|
|
1821
|
-
}).animationStyle ??
|
|
1818
|
+
animationStyle: ne
|
|
1819
|
+
}).animationStyle ?? ne;
|
|
1822
1820
|
return x(() => {
|
|
1823
|
-
process.env.NODE_ENV === "production" || !O || M || S.current
|
|
1824
|
-
|
|
1821
|
+
if (process.env.NODE_ENV === "production" || !O || M || !S.current) return;
|
|
1822
|
+
let e = window.setTimeout(() => {
|
|
1823
|
+
let e = S.current, t = e?.getAttribute("aria-labelledby"), n = t ? !!document.getElementById(t) : !1;
|
|
1824
|
+
!O || M || !e || e.hasAttribute("aria-label") || n || console.warn("Modal.Content requires Modal.Title or ariaLabel.");
|
|
1825
|
+
}, 0);
|
|
1826
|
+
return () => {
|
|
1827
|
+
window.clearTimeout(e);
|
|
1828
|
+
};
|
|
1829
|
+
}, [
|
|
1830
|
+
I,
|
|
1831
|
+
O,
|
|
1832
|
+
M
|
|
1833
|
+
]), x(() => {
|
|
1825
1834
|
process.env.NODE_ENV === "production" || !O || b !== "alertdialog" || P || console.warn("Modal with role=\"alertdialog\" requires Modal.Description.");
|
|
1826
1835
|
}, [
|
|
1827
1836
|
P,
|
|
@@ -1830,7 +1839,7 @@ var dn = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1830
1839
|
]), {
|
|
1831
1840
|
context: w(() => ({
|
|
1832
1841
|
animation: r,
|
|
1833
|
-
animationStyle:
|
|
1842
|
+
animationStyle: re,
|
|
1834
1843
|
closeOnEscape: s,
|
|
1835
1844
|
closeOnOutsidePress: c,
|
|
1836
1845
|
contentId: C,
|
|
@@ -1838,7 +1847,7 @@ var dn = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1838
1847
|
descriptionId: D,
|
|
1839
1848
|
finalFocus: p,
|
|
1840
1849
|
initialFocus: f,
|
|
1841
|
-
zIndex:
|
|
1850
|
+
zIndex: te.zIndex,
|
|
1842
1851
|
modal: o,
|
|
1843
1852
|
onCloseAutoFocus: h,
|
|
1844
1853
|
onEscapeKeyDown: g,
|
|
@@ -1847,26 +1856,26 @@ var dn = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1847
1856
|
onPointerDownOutside: _,
|
|
1848
1857
|
open: O,
|
|
1849
1858
|
preventScroll: l,
|
|
1850
|
-
requestClose:
|
|
1859
|
+
requestClose: V,
|
|
1851
1860
|
restoreFocus: u,
|
|
1852
1861
|
role: b,
|
|
1853
|
-
setContentRef:
|
|
1862
|
+
setContentRef: H,
|
|
1854
1863
|
setDescriptionPresent: F,
|
|
1855
1864
|
setOpen: A,
|
|
1856
1865
|
setTitlePresent: N,
|
|
1857
|
-
shouldRender:
|
|
1866
|
+
shouldRender: B,
|
|
1858
1867
|
titleId: j,
|
|
1859
1868
|
trapFocus: d
|
|
1860
1869
|
}), [
|
|
1861
1870
|
r,
|
|
1862
|
-
|
|
1871
|
+
re,
|
|
1863
1872
|
s,
|
|
1864
1873
|
c,
|
|
1865
1874
|
C,
|
|
1866
1875
|
D,
|
|
1867
1876
|
p,
|
|
1868
1877
|
f,
|
|
1869
|
-
|
|
1878
|
+
te.zIndex,
|
|
1870
1879
|
O,
|
|
1871
1880
|
o,
|
|
1872
1881
|
h,
|
|
@@ -1875,20 +1884,20 @@ var dn = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1875
1884
|
m,
|
|
1876
1885
|
_,
|
|
1877
1886
|
l,
|
|
1878
|
-
|
|
1887
|
+
V,
|
|
1879
1888
|
u,
|
|
1880
1889
|
b,
|
|
1881
|
-
|
|
1890
|
+
H,
|
|
1882
1891
|
A,
|
|
1883
|
-
|
|
1892
|
+
B,
|
|
1884
1893
|
j,
|
|
1885
1894
|
d
|
|
1886
1895
|
]),
|
|
1887
1896
|
open: O
|
|
1888
1897
|
};
|
|
1889
|
-
},
|
|
1890
|
-
let { context: r, open: i } =
|
|
1891
|
-
return /* @__PURE__ */ d(
|
|
1898
|
+
}, hn = ({ children: e, className: t, ...n }) => {
|
|
1899
|
+
let { context: r, open: i } = mn(n);
|
|
1900
|
+
return /* @__PURE__ */ d(Kt, {
|
|
1892
1901
|
value: r,
|
|
1893
1902
|
children: /* @__PURE__ */ d("div", {
|
|
1894
1903
|
className: U(t),
|
|
@@ -1897,11 +1906,11 @@ var dn = ({ active: e, registrationActive: t = e, id: n, contentRef: r, closeOnE
|
|
|
1897
1906
|
})
|
|
1898
1907
|
});
|
|
1899
1908
|
};
|
|
1900
|
-
|
|
1909
|
+
hn.displayName = "ModalRoot";
|
|
1901
1910
|
//#endregion
|
|
1902
1911
|
//#region src/components/Modal/Trigger/ModalTrigger.tsx
|
|
1903
|
-
var
|
|
1904
|
-
let i =
|
|
1912
|
+
var gn = ({ children: e, asChild: t = !1, disabled: n = !1, className: r }) => {
|
|
1913
|
+
let i = Wt(), a = t && v(e) ? e : void 0, o = n, s = {
|
|
1905
1914
|
"aria-controls": i.contentId,
|
|
1906
1915
|
"aria-disabled": o || void 0,
|
|
1907
1916
|
"aria-expanded": i.open,
|
|
@@ -1909,13 +1918,13 @@ var _n = ({ children: e, asChild: t = !1, disabled: n = !1, className: r }) => {
|
|
|
1909
1918
|
className: U(r),
|
|
1910
1919
|
"data-state": i.open ? "open" : "closed",
|
|
1911
1920
|
disabled: o || void 0,
|
|
1912
|
-
onClick:
|
|
1921
|
+
onClick: Xt(a?.props.onClick, () => {
|
|
1913
1922
|
o || i.setOpen(!0);
|
|
1914
1923
|
})
|
|
1915
1924
|
};
|
|
1916
1925
|
return a ? h(a, {
|
|
1917
1926
|
...s,
|
|
1918
|
-
ref:
|
|
1927
|
+
ref: Zt(a.props.ref),
|
|
1919
1928
|
className: U(a.props.className, r)
|
|
1920
1929
|
}) : /* @__PURE__ */ d("button", {
|
|
1921
1930
|
type: "button",
|
|
@@ -1923,50 +1932,50 @@ var _n = ({ children: e, asChild: t = !1, disabled: n = !1, className: r }) => {
|
|
|
1923
1932
|
children: e
|
|
1924
1933
|
});
|
|
1925
1934
|
};
|
|
1926
|
-
|
|
1935
|
+
gn.displayName = "Modal.Trigger";
|
|
1927
1936
|
//#endregion
|
|
1928
1937
|
//#region src/components/Modal/Modal.tsx
|
|
1929
|
-
var
|
|
1930
|
-
Trigger:
|
|
1931
|
-
Overlay:
|
|
1932
|
-
Content:
|
|
1933
|
-
Header:
|
|
1934
|
-
Title:
|
|
1935
|
-
Description:
|
|
1936
|
-
Body:
|
|
1937
|
-
Footer:
|
|
1938
|
-
Close:
|
|
1938
|
+
var _n = Object.assign(hn, {
|
|
1939
|
+
Trigger: gn,
|
|
1940
|
+
Overlay: ln,
|
|
1941
|
+
Content: tn,
|
|
1942
|
+
Header: on,
|
|
1943
|
+
Title: sn,
|
|
1944
|
+
Description: an,
|
|
1945
|
+
Body: Yt,
|
|
1946
|
+
Footer: rn,
|
|
1947
|
+
Close: $t
|
|
1939
1948
|
});
|
|
1940
|
-
|
|
1949
|
+
_n.displayName = "Modal";
|
|
1941
1950
|
//#endregion
|
|
1942
1951
|
//#region src/components/Popover/Context/PopoverContext.tsx
|
|
1943
|
-
var
|
|
1944
|
-
function
|
|
1945
|
-
return /* @__PURE__ */ d(
|
|
1952
|
+
var vn = g(null);
|
|
1953
|
+
function yn({ children: e, value: t }) {
|
|
1954
|
+
return /* @__PURE__ */ d(vn.Provider, {
|
|
1946
1955
|
value: t,
|
|
1947
1956
|
children: e
|
|
1948
1957
|
});
|
|
1949
1958
|
}
|
|
1950
|
-
function
|
|
1951
|
-
let t = b(
|
|
1959
|
+
function bn(e) {
|
|
1960
|
+
let t = b(vn);
|
|
1952
1961
|
if (!t) throw Error(`${e} must be used within Popover.Root`);
|
|
1953
1962
|
return t;
|
|
1954
1963
|
}
|
|
1955
1964
|
//#endregion
|
|
1956
1965
|
//#region src/components/Popover/Anchor/PopoverAnchor.tsx
|
|
1957
|
-
function
|
|
1966
|
+
function xn(e, t) {
|
|
1958
1967
|
if (typeof e == "function") {
|
|
1959
1968
|
e(t);
|
|
1960
1969
|
return;
|
|
1961
1970
|
}
|
|
1962
1971
|
e && (e.current = t);
|
|
1963
1972
|
}
|
|
1964
|
-
function
|
|
1965
|
-
let { setAnchorRef: i } =
|
|
1973
|
+
function Sn({ children: e, asChild: t = !1, className: n, ...r }) {
|
|
1974
|
+
let { setAnchorRef: i } = bn("Popover.Anchor"), a = t && v(e) ? e : void 0;
|
|
1966
1975
|
return a ? h(a, {
|
|
1967
1976
|
...r,
|
|
1968
1977
|
ref: (e) => {
|
|
1969
|
-
|
|
1978
|
+
xn(a.props.ref, e), i(e);
|
|
1970
1979
|
},
|
|
1971
1980
|
className: U(a.props.className, n)
|
|
1972
1981
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -1976,14 +1985,14 @@ function Cn({ children: e, asChild: t = !1, className: n, ...r }) {
|
|
|
1976
1985
|
children: e
|
|
1977
1986
|
});
|
|
1978
1987
|
}
|
|
1979
|
-
|
|
1980
|
-
var
|
|
1988
|
+
Sn.displayName = "Popover.Anchor";
|
|
1989
|
+
var Cn = { arrow: "_arrow_6lbs0_1" }, wn = {
|
|
1981
1990
|
start: "20%",
|
|
1982
1991
|
center: null,
|
|
1983
1992
|
end: "80%"
|
|
1984
1993
|
};
|
|
1985
|
-
function
|
|
1986
|
-
let { arrowRef: s, floatingContext: c, placement: l } =
|
|
1994
|
+
function Tn({ width: e = 14, height: t = 7, tipRadius: n = 1, align: r = "center", offset: i, className: a, ...o }) {
|
|
1995
|
+
let { arrowRef: s, floatingContext: c, placement: l } = bn("Popover.Arrow"), u = i ?? wn[r], f = l.split("-")[0];
|
|
1987
1996
|
return /* @__PURE__ */ d(k, {
|
|
1988
1997
|
...o,
|
|
1989
1998
|
ref: s,
|
|
@@ -1996,14 +2005,14 @@ function En({ width: e = 14, height: t = 7, tipRadius: n = 1, align: r = "center
|
|
|
1996
2005
|
stroke: "var(--border-muted)",
|
|
1997
2006
|
strokeWidth: 1,
|
|
1998
2007
|
"data-side": f,
|
|
1999
|
-
className: U(
|
|
2008
|
+
className: U(Cn.arrow, a)
|
|
2000
2009
|
});
|
|
2001
2010
|
}
|
|
2002
|
-
|
|
2011
|
+
Tn.displayName = "Popover.Arrow";
|
|
2003
2012
|
//#endregion
|
|
2004
2013
|
//#region src/components/Popover/Close/PopoverClose.tsx
|
|
2005
|
-
function
|
|
2006
|
-
let { setOpen: o } =
|
|
2014
|
+
function En({ children: e, asChild: t = !1, className: n, disabled: r, onClick: i, ...a }) {
|
|
2015
|
+
let { setOpen: o } = bn("Popover.Close"), s = t && v(e) ? e : void 0, c = r || s?.props.disabled === !0, l = (e) => {
|
|
2007
2016
|
s?.props.onClick?.(e), i?.(e), !(e.defaultPrevented || c) && o(!1, {
|
|
2008
2017
|
reason: "close",
|
|
2009
2018
|
event: e.nativeEvent
|
|
@@ -2024,20 +2033,20 @@ function Dn({ children: e, asChild: t = !1, className: n, disabled: r, onClick:
|
|
|
2024
2033
|
children: e
|
|
2025
2034
|
});
|
|
2026
2035
|
}
|
|
2027
|
-
|
|
2028
|
-
var
|
|
2036
|
+
En.displayName = "Popover.Close";
|
|
2037
|
+
var Dn = {
|
|
2029
2038
|
content: "_content_1jzfn_1",
|
|
2030
2039
|
"popover-in": "_popover-in_1jzfn_1"
|
|
2031
2040
|
};
|
|
2032
2041
|
//#endregion
|
|
2033
2042
|
//#region src/components/Popover/Content/PopoverContent.tsx
|
|
2034
|
-
function
|
|
2035
|
-
let { open: g, modal: _, portal: b, triggerRef: x, anchorRef: S, contentRef: C, contentId: w, titleId: T, descriptionId: D, placement: O, floatingStyles: k, setOpen: A, setContentRef: j } =
|
|
2043
|
+
function On({ children: e, asChild: t = !1, className: n, style: r, initialFocus: i, returnFocus: a = !0, closeOnEscape: o = !0, closeOnOutsidePress: s = !0, onEscapeKeyDown: c, onPointerDownOutside: l, onInteractOutside: u, onOpenAutoFocus: f, onCloseAutoFocus: p, ...m }) {
|
|
2044
|
+
let { open: g, modal: _, portal: b, triggerRef: x, anchorRef: S, contentRef: C, contentId: w, titleId: T, descriptionId: D, placement: O, floatingStyles: k, setOpen: A, setContentRef: j } = bn("Popover.Content"), [M, N] = E(null), P = y((e, t) => {
|
|
2036
2045
|
A(!1, {
|
|
2037
2046
|
reason: e,
|
|
2038
2047
|
event: t
|
|
2039
2048
|
});
|
|
2040
|
-
}, [A]), F =
|
|
2049
|
+
}, [A]), F = Ae({
|
|
2041
2050
|
active: g,
|
|
2042
2051
|
id: w,
|
|
2043
2052
|
zIndexLevel: "popover",
|
|
@@ -2050,7 +2059,7 @@ function kn({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2050
2059
|
onInteractOutside: u,
|
|
2051
2060
|
requestClose: P
|
|
2052
2061
|
});
|
|
2053
|
-
|
|
2062
|
+
ge({
|
|
2054
2063
|
active: g,
|
|
2055
2064
|
contentRef: C,
|
|
2056
2065
|
enabled: _,
|
|
@@ -2065,10 +2074,10 @@ function kn({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2065
2074
|
f
|
|
2066
2075
|
]),
|
|
2067
2076
|
onCloseAutoFocus: p
|
|
2068
|
-
}),
|
|
2077
|
+
}), Fe({
|
|
2069
2078
|
active: g,
|
|
2070
2079
|
enabled: _
|
|
2071
|
-
}),
|
|
2080
|
+
}), le({
|
|
2072
2081
|
active: g,
|
|
2073
2082
|
enabled: _,
|
|
2074
2083
|
content: M
|
|
@@ -2086,7 +2095,7 @@ function kn({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2086
2095
|
"aria-describedby": D,
|
|
2087
2096
|
"data-state": "open",
|
|
2088
2097
|
"data-side": L,
|
|
2089
|
-
className: U(
|
|
2098
|
+
className: U(Dn.content, n),
|
|
2090
2099
|
style: {
|
|
2091
2100
|
...k,
|
|
2092
2101
|
zIndex: F.zIndex,
|
|
@@ -2095,7 +2104,7 @@ function kn({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2095
2104
|
}, z = t && v(e) ? e : void 0, B = z ? h(z, {
|
|
2096
2105
|
...R,
|
|
2097
2106
|
ref: I,
|
|
2098
|
-
className: U(z.props.className,
|
|
2107
|
+
className: U(z.props.className, Dn.content, n),
|
|
2099
2108
|
style: {
|
|
2100
2109
|
...k,
|
|
2101
2110
|
zIndex: F.zIndex,
|
|
@@ -2107,33 +2116,33 @@ function kn({ children: e, asChild: t = !1, className: n, style: r, initialFocus
|
|
|
2107
2116
|
...R,
|
|
2108
2117
|
children: e
|
|
2109
2118
|
});
|
|
2110
|
-
return b ? /* @__PURE__ */ d(
|
|
2119
|
+
return b ? /* @__PURE__ */ d(Ke, { children: B }) : B;
|
|
2111
2120
|
}
|
|
2112
|
-
|
|
2113
|
-
var
|
|
2121
|
+
On.displayName = "Popover.Content";
|
|
2122
|
+
var kn = { description: "_description_hji8o_1" };
|
|
2114
2123
|
//#endregion
|
|
2115
2124
|
//#region src/components/Popover/Description/PopoverDescription.tsx
|
|
2116
|
-
function
|
|
2117
|
-
let { descriptionId: i } =
|
|
2125
|
+
function An({ children: e, asChild: t = !1, className: n, ...r }) {
|
|
2126
|
+
let { descriptionId: i } = bn("Popover.Description"), a = t && v(e) ? e : void 0;
|
|
2118
2127
|
return a ? h(a, {
|
|
2119
2128
|
...r,
|
|
2120
2129
|
id: i,
|
|
2121
|
-
className: U(a.props.className,
|
|
2130
|
+
className: U(a.props.className, kn.description, n)
|
|
2122
2131
|
}) : /* @__PURE__ */ d("p", {
|
|
2123
2132
|
...r,
|
|
2124
2133
|
id: i,
|
|
2125
|
-
className: U(
|
|
2134
|
+
className: U(kn.description, n),
|
|
2126
2135
|
children: e
|
|
2127
2136
|
});
|
|
2128
2137
|
}
|
|
2129
|
-
|
|
2138
|
+
An.displayName = "Popover.Description";
|
|
2130
2139
|
//#endregion
|
|
2131
2140
|
//#region src/components/Popover/Root/PopoverRoot.tsx
|
|
2132
|
-
function
|
|
2141
|
+
function jn(e, t) {
|
|
2133
2142
|
return t === "center" ? e : `${e}-${t}`;
|
|
2134
2143
|
}
|
|
2135
|
-
function
|
|
2136
|
-
let m = T(null), h = T(null), g = T(null), _ = T({ reason: "programmatic" }), v = S(), b = `vellira-popover-trigger-${v}`, x = `vellira-popover-content-${v}`, C = `vellira-popover-title-${v}`, E = `vellira-popover-description-${v}`, [D, O] =
|
|
2144
|
+
function Mn({ children: e, open: t, defaultOpen: n = !1, modal: r = !1, onOpenChange: i, side: a = "bottom", align: o = "center", sideOffset: s = 8, alignOffset: c = 0, collisionPadding: l = 8, avoidCollisions: u = !0, portal: f = !0, strategy: p }) {
|
|
2145
|
+
let m = T(null), h = T(null), g = T(null), _ = T({ reason: "programmatic" }), v = S(), b = `vellira-popover-trigger-${v}`, x = `vellira-popover-content-${v}`, C = `vellira-popover-title-${v}`, E = `vellira-popover-description-${v}`, [D, O] = Y({
|
|
2137
2146
|
value: t,
|
|
2138
2147
|
defaultValue: n,
|
|
2139
2148
|
onChange: (e) => {
|
|
@@ -2144,17 +2153,23 @@ function Nn({ children: e, open: t, defaultOpen: n = !1, modal: r = !1, onOpenCh
|
|
|
2144
2153
|
}, [O]), j = T(null), M = w(() => [A({
|
|
2145
2154
|
element: j,
|
|
2146
2155
|
padding: 8
|
|
2147
|
-
})], []), { context: N, floatingStyles: P, isPositioned: F, placement: I, setFloatingRef: L, setRef: R } =
|
|
2156
|
+
})], []), { context: N, floatingStyles: P, isPositioned: F, placement: I, setFloatingRef: L, setRef: R } = je({
|
|
2148
2157
|
open: D,
|
|
2149
|
-
placement:
|
|
2158
|
+
placement: jn(a, o),
|
|
2150
2159
|
strategy: p,
|
|
2151
2160
|
portal: f,
|
|
2152
2161
|
offset: s + 7,
|
|
2153
2162
|
collisionPadding: l,
|
|
2154
2163
|
avoidCollisions: u,
|
|
2155
2164
|
middleware: M
|
|
2156
|
-
})
|
|
2157
|
-
|
|
2165
|
+
}), z = y((e) => {
|
|
2166
|
+
m.current = e, h.current || R(e);
|
|
2167
|
+
}, [R]), B = y((e) => {
|
|
2168
|
+
h.current = e, R(e ?? m.current);
|
|
2169
|
+
}, [R]), ee = y((e) => {
|
|
2170
|
+
g.current = e, L(e);
|
|
2171
|
+
}, [L]);
|
|
2172
|
+
return /* @__PURE__ */ d(yn, {
|
|
2158
2173
|
value: {
|
|
2159
2174
|
open: D,
|
|
2160
2175
|
modal: r,
|
|
@@ -2171,41 +2186,35 @@ function Nn({ children: e, open: t, defaultOpen: n = !1, modal: r = !1, onOpenCh
|
|
|
2171
2186
|
isPositioned: F,
|
|
2172
2187
|
floatingContext: N,
|
|
2173
2188
|
arrowRef: j,
|
|
2174
|
-
setTriggerRef:
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
setAnchorRef: y((e) => {
|
|
2178
|
-
h.current = e, R(e ?? m.current);
|
|
2179
|
-
}, [R]),
|
|
2180
|
-
setContentRef: y((e) => {
|
|
2181
|
-
g.current = e, L(e);
|
|
2182
|
-
}, [L]),
|
|
2189
|
+
setTriggerRef: z,
|
|
2190
|
+
setAnchorRef: B,
|
|
2191
|
+
setContentRef: ee,
|
|
2183
2192
|
setOpen: k
|
|
2184
2193
|
},
|
|
2185
2194
|
children: e
|
|
2186
2195
|
});
|
|
2187
2196
|
}
|
|
2188
|
-
var
|
|
2197
|
+
var Nn = { title: "_title_1gham_1" };
|
|
2189
2198
|
//#endregion
|
|
2190
2199
|
//#region src/components/Popover/Title/PopoverTitle.tsx
|
|
2191
|
-
function
|
|
2192
|
-
let { titleId: i } =
|
|
2200
|
+
function Pn({ children: e, asChild: t = !1, className: n, ...r }) {
|
|
2201
|
+
let { titleId: i } = bn("Popover.Title"), a = t && v(e) ? e : void 0;
|
|
2193
2202
|
return a ? h(a, {
|
|
2194
2203
|
...r,
|
|
2195
2204
|
id: i,
|
|
2196
|
-
className: U(a.props.className,
|
|
2205
|
+
className: U(a.props.className, Nn.title, n)
|
|
2197
2206
|
}) : /* @__PURE__ */ d("h2", {
|
|
2198
2207
|
...r,
|
|
2199
2208
|
id: i,
|
|
2200
|
-
className: U(
|
|
2209
|
+
className: U(Nn.title, n),
|
|
2201
2210
|
children: e
|
|
2202
2211
|
});
|
|
2203
2212
|
}
|
|
2204
|
-
|
|
2213
|
+
Pn.displayName = "Popover.Title";
|
|
2205
2214
|
//#endregion
|
|
2206
2215
|
//#region src/components/Popover/Trigger/PopoverTrigger.tsx
|
|
2207
|
-
function
|
|
2208
|
-
let { open: o, triggerId: s, contentId: c, setOpen: l, setTriggerRef: u } =
|
|
2216
|
+
function Fn({ children: e, asChild: t = !1, disabled: n = !1, className: r, onClick: i, ...a }) {
|
|
2217
|
+
let { open: o, triggerId: s, contentId: c, setOpen: l, setTriggerRef: u } = bn("Popover.Trigger"), f = t && v(e) ? e : void 0, p = n || f?.props.disabled === !0, m = {
|
|
2209
2218
|
id: s,
|
|
2210
2219
|
"aria-controls": o ? c : void 0,
|
|
2211
2220
|
"aria-expanded": o,
|
|
@@ -2238,22 +2247,22 @@ function In({ children: e, asChild: t = !1, disabled: n = !1, className: r, onCl
|
|
|
2238
2247
|
children: e
|
|
2239
2248
|
});
|
|
2240
2249
|
}
|
|
2241
|
-
|
|
2250
|
+
Fn.displayName = "Popover.Trigger";
|
|
2242
2251
|
//#endregion
|
|
2243
2252
|
//#region src/components/Popover/Popover.tsx
|
|
2244
|
-
var
|
|
2245
|
-
Anchor:
|
|
2246
|
-
Arrow:
|
|
2247
|
-
Close:
|
|
2248
|
-
Content:
|
|
2249
|
-
Description:
|
|
2250
|
-
Title:
|
|
2251
|
-
Trigger:
|
|
2252
|
-
}),
|
|
2253
|
-
function
|
|
2254
|
-
return b(
|
|
2253
|
+
var In = Object.assign(Mn, {
|
|
2254
|
+
Anchor: Sn,
|
|
2255
|
+
Arrow: Tn,
|
|
2256
|
+
Close: En,
|
|
2257
|
+
Content: On,
|
|
2258
|
+
Description: An,
|
|
2259
|
+
Title: Pn,
|
|
2260
|
+
Trigger: Fn
|
|
2261
|
+
}), Ln = g(null), Rn = Ln.Provider;
|
|
2262
|
+
function zn() {
|
|
2263
|
+
return b(Ln);
|
|
2255
2264
|
}
|
|
2256
|
-
var
|
|
2265
|
+
var Bn = {
|
|
2257
2266
|
root: "_root_7yrws_1",
|
|
2258
2267
|
invalid: "_invalid_7yrws_34",
|
|
2259
2268
|
control: "_control_7yrws_34",
|
|
@@ -2276,19 +2285,19 @@ var Vn = {
|
|
|
2276
2285
|
"radio-indicator-in": "_radio-indicator-in_7yrws_1",
|
|
2277
2286
|
content: "_content_7yrws_346",
|
|
2278
2287
|
error: "_error_7yrws_363"
|
|
2279
|
-
},
|
|
2280
|
-
primary:
|
|
2281
|
-
neutral:
|
|
2282
|
-
success:
|
|
2283
|
-
warning:
|
|
2284
|
-
danger:
|
|
2285
|
-
},
|
|
2286
|
-
let x =
|
|
2288
|
+
}, Vn = {
|
|
2289
|
+
primary: Bn.colorPrimary,
|
|
2290
|
+
neutral: Bn.colorNeutral,
|
|
2291
|
+
success: Bn.colorSuccess,
|
|
2292
|
+
warning: Bn.colorWarning,
|
|
2293
|
+
danger: Bn.colorDanger
|
|
2294
|
+
}, Hn = _(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: a, color: o, error: s, onCheckedChange: c, label: l, description: u, icon: p, wrapperClassName: m, className: h, id: g, name: _, "aria-describedby": v, ...y }, b) => {
|
|
2295
|
+
let x = zn(), C = S(), w = g ?? C, T = u ? `${w}-description` : void 0, E = s ? `${w}-error` : void 0, D = [
|
|
2287
2296
|
T,
|
|
2288
2297
|
E,
|
|
2289
2298
|
x?.describedBy,
|
|
2290
2299
|
v
|
|
2291
|
-
].filter(Boolean).join(" ") || void 0, O = x !== null, [k, A] =
|
|
2300
|
+
].filter(Boolean).join(" ") || void 0, O = x !== null, [k, A] = Y({
|
|
2292
2301
|
value: t,
|
|
2293
2302
|
defaultValue: n,
|
|
2294
2303
|
onChange: c
|
|
@@ -2302,10 +2311,10 @@ var Vn = {
|
|
|
2302
2311
|
}
|
|
2303
2312
|
};
|
|
2304
2313
|
return /* @__PURE__ */ f("div", {
|
|
2305
|
-
className: U(
|
|
2314
|
+
className: U(Bn.root, Bn[I], F && Bn.invalid, M && Bn.disabled, Vn[L], h),
|
|
2306
2315
|
children: [/* @__PURE__ */ f("label", {
|
|
2307
2316
|
htmlFor: w,
|
|
2308
|
-
className: U(
|
|
2317
|
+
className: U(Bn.wrapper, m),
|
|
2309
2318
|
children: [
|
|
2310
2319
|
/* @__PURE__ */ d("input", {
|
|
2311
2320
|
...y,
|
|
@@ -2319,55 +2328,55 @@ var Vn = {
|
|
|
2319
2328
|
required: N,
|
|
2320
2329
|
"aria-invalid": F || void 0,
|
|
2321
2330
|
"aria-describedby": D,
|
|
2322
|
-
className:
|
|
2331
|
+
className: Bn.input,
|
|
2323
2332
|
onChange: R
|
|
2324
2333
|
}),
|
|
2325
2334
|
/* @__PURE__ */ d("span", {
|
|
2326
|
-
className:
|
|
2335
|
+
className: Bn.control,
|
|
2327
2336
|
"aria-hidden": "true",
|
|
2328
2337
|
children: /* @__PURE__ */ d("span", {
|
|
2329
|
-
className: U(
|
|
2338
|
+
className: U(Bn.indicator, p && Bn.customIcon),
|
|
2330
2339
|
children: p
|
|
2331
2340
|
})
|
|
2332
2341
|
}),
|
|
2333
2342
|
(l || u) && /* @__PURE__ */ f("span", {
|
|
2334
|
-
className:
|
|
2343
|
+
className: Bn.content,
|
|
2335
2344
|
children: [l && /* @__PURE__ */ d("span", {
|
|
2336
|
-
className:
|
|
2345
|
+
className: Bn.label,
|
|
2337
2346
|
children: l
|
|
2338
2347
|
}), u && /* @__PURE__ */ d("span", {
|
|
2339
2348
|
id: T,
|
|
2340
|
-
className:
|
|
2349
|
+
className: Bn.description,
|
|
2341
2350
|
children: u
|
|
2342
2351
|
})]
|
|
2343
2352
|
})
|
|
2344
2353
|
]
|
|
2345
2354
|
}), s && /* @__PURE__ */ d("div", {
|
|
2346
2355
|
id: E,
|
|
2347
|
-
className:
|
|
2356
|
+
className: Bn.error,
|
|
2348
2357
|
children: s
|
|
2349
2358
|
})]
|
|
2350
2359
|
});
|
|
2351
2360
|
});
|
|
2352
|
-
|
|
2361
|
+
Hn.displayName = "Radio";
|
|
2353
2362
|
//#endregion
|
|
2354
2363
|
//#region src/components/RadioGroup/Item/RadioGroupItem.tsx
|
|
2355
|
-
var
|
|
2364
|
+
var Un = _((e, t) => /* @__PURE__ */ d(Hn, {
|
|
2356
2365
|
...e,
|
|
2357
2366
|
ref: t
|
|
2358
2367
|
}));
|
|
2359
|
-
|
|
2368
|
+
Un.displayName = "RadioGroup.Item";
|
|
2360
2369
|
//#endregion
|
|
2361
2370
|
//#region src/components/RadioGroup/internal/useRadioGroupCollection.ts
|
|
2362
|
-
var
|
|
2371
|
+
var Wn = (e) => {
|
|
2363
2372
|
let t = e.current;
|
|
2364
2373
|
return t ? Array.from(t.querySelectorAll("input[type=\"radio\"]")) : [];
|
|
2365
|
-
},
|
|
2366
|
-
function
|
|
2374
|
+
}, Gn = (e) => Wn(e).filter((e) => !e.disabled), Kn = ["ArrowLeft", "ArrowRight"], qn = ["ArrowUp", "ArrowDown"];
|
|
2375
|
+
function Jn({ rootRef: e, orientation: t }) {
|
|
2367
2376
|
return y((n) => {
|
|
2368
|
-
let r =
|
|
2377
|
+
let r = Kn.includes(n.key), i = qn.includes(n.key), a = n.key === "Home" || n.key === "End";
|
|
2369
2378
|
if (!r && !i && !a || t === "horizontal" && i || t === "vertical" && r) return;
|
|
2370
|
-
let o =
|
|
2379
|
+
let o = Gn(e);
|
|
2371
2380
|
if (o.length === 0) return;
|
|
2372
2381
|
n.preventDefault();
|
|
2373
2382
|
let s = document.activeElement, c = o.findIndex((e) => e === s), l = o.findIndex((e) => e.checked), u = c >= 0 ? c : Math.max(l, 0), d = u;
|
|
@@ -2376,7 +2385,7 @@ function Yn({ rootRef: e, orientation: t }) {
|
|
|
2376
2385
|
f?.focus(), f?.click();
|
|
2377
2386
|
}, [t, e]);
|
|
2378
2387
|
}
|
|
2379
|
-
var
|
|
2388
|
+
var Yn = {
|
|
2380
2389
|
root: "_root_1s3vp_1",
|
|
2381
2390
|
sm: "_sm_1s3vp_32",
|
|
2382
2391
|
md: "_md_1s3vp_58",
|
|
@@ -2390,12 +2399,12 @@ var Xn = {
|
|
|
2390
2399
|
error: "_error_1s3vp_152",
|
|
2391
2400
|
disabled: "_disabled_1s3vp_160",
|
|
2392
2401
|
invalid: "_invalid_1s3vp_176"
|
|
2393
|
-
},
|
|
2394
|
-
let b = T(null), x = S(), C = g ?? x, w = c ? `${C}-label` : void 0, E = l ? `${C}-description` : void 0, D = u ? `${C}-error` : void 0, O = [E, D].filter(Boolean).join(" ") || void 0, k = s ?? `${C}-radio`, [A, j] =
|
|
2402
|
+
}, Xn = _(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", name: s, label: c, description: l, error: u, orientation: p = "vertical", children: m, className: h, id: g, onKeyDown: _, ...v }, y) => {
|
|
2403
|
+
let b = T(null), x = S(), C = g ?? x, w = c ? `${C}-label` : void 0, E = l ? `${C}-description` : void 0, D = u ? `${C}-error` : void 0, O = [E, D].filter(Boolean).join(" ") || void 0, k = s ?? `${C}-radio`, [A, j] = Y({
|
|
2395
2404
|
value: e,
|
|
2396
2405
|
defaultValue: t,
|
|
2397
2406
|
onChange: n
|
|
2398
|
-
}), M = !!u, N =
|
|
2407
|
+
}), M = !!u, N = Jn({
|
|
2399
2408
|
rootRef: b,
|
|
2400
2409
|
orientation: p
|
|
2401
2410
|
}), P = (e) => {
|
|
@@ -2418,23 +2427,23 @@ var Xn = {
|
|
|
2418
2427
|
onKeyDown: (e) => {
|
|
2419
2428
|
_?.(e), e.defaultPrevented || N(e);
|
|
2420
2429
|
},
|
|
2421
|
-
className: U(
|
|
2430
|
+
className: U(Yn.root, Yn[a], M && Yn.invalid, r && Yn.disabled, h),
|
|
2422
2431
|
children: [
|
|
2423
2432
|
c && /* @__PURE__ */ f("div", {
|
|
2424
2433
|
id: w,
|
|
2425
|
-
className:
|
|
2434
|
+
className: Yn.label,
|
|
2426
2435
|
children: [c, i && /* @__PURE__ */ d("span", {
|
|
2427
|
-
className:
|
|
2436
|
+
className: Yn.required,
|
|
2428
2437
|
"aria-hidden": "true",
|
|
2429
2438
|
children: "*"
|
|
2430
2439
|
})]
|
|
2431
2440
|
}),
|
|
2432
2441
|
l && /* @__PURE__ */ d("div", {
|
|
2433
2442
|
id: E,
|
|
2434
|
-
className:
|
|
2443
|
+
className: Yn.description,
|
|
2435
2444
|
children: l
|
|
2436
2445
|
}),
|
|
2437
|
-
/* @__PURE__ */ d(
|
|
2446
|
+
/* @__PURE__ */ d(Rn, {
|
|
2438
2447
|
value: {
|
|
2439
2448
|
name: k,
|
|
2440
2449
|
value: A,
|
|
@@ -2447,35 +2456,35 @@ var Xn = {
|
|
|
2447
2456
|
onValueChange: j
|
|
2448
2457
|
},
|
|
2449
2458
|
children: /* @__PURE__ */ d("div", {
|
|
2450
|
-
className: U(
|
|
2459
|
+
className: U(Yn.items, Yn[p]),
|
|
2451
2460
|
children: m
|
|
2452
2461
|
})
|
|
2453
2462
|
}),
|
|
2454
2463
|
u && /* @__PURE__ */ d("div", {
|
|
2455
2464
|
id: D,
|
|
2456
|
-
className:
|
|
2465
|
+
className: Yn.error,
|
|
2457
2466
|
children: u
|
|
2458
2467
|
})
|
|
2459
2468
|
]
|
|
2460
2469
|
});
|
|
2461
2470
|
});
|
|
2462
|
-
|
|
2471
|
+
Xn.displayName = "RadioGroup.Root";
|
|
2463
2472
|
//#endregion
|
|
2464
2473
|
//#region src/components/RadioGroup/RadioGroup.tsx
|
|
2465
|
-
var
|
|
2466
|
-
|
|
2474
|
+
var Zn = Object.assign(Xn, { Item: Un });
|
|
2475
|
+
Zn.displayName = "RadioGroup";
|
|
2467
2476
|
//#endregion
|
|
2468
2477
|
//#region src/components/Select/internal/SelectContext.tsx
|
|
2469
|
-
var
|
|
2470
|
-
function
|
|
2471
|
-
let e = b(
|
|
2478
|
+
var Qn = g(null), $n = Qn.Provider;
|
|
2479
|
+
function er() {
|
|
2480
|
+
let e = b(Qn);
|
|
2472
2481
|
if (!e) throw Error("Select compound components must be used inside <Select>");
|
|
2473
2482
|
return e;
|
|
2474
2483
|
}
|
|
2475
|
-
|
|
2484
|
+
Qn.displayName = "SelectContext";
|
|
2476
2485
|
//#endregion
|
|
2477
2486
|
//#region src/components/Select/internal/SelectVirtualization.ts
|
|
2478
|
-
function
|
|
2487
|
+
function tr({ loading: e, options: t, scrollTop: n, virtual: r, viewportHeight: i }) {
|
|
2479
2488
|
let a = typeof r == "object" ? r : r ? {} : void 0, o = a?.itemHeight ?? 40, s = a?.overscan ?? 2, c = i ?? a?.viewportHeight ?? 300, l = !!(a && t.length > 0 && !e), u = l ? Math.max(0, Math.floor(n / o) - s) : 0, d = l ? Math.ceil(c / o) + s * 2 : t.length, f = l ? t.slice(u, u + d) : t, p = l ? u * o : 0;
|
|
2480
2489
|
return {
|
|
2481
2490
|
bottomSpacerHeight: l ? Math.max(0, (t.length - u - f.length) * o) : 0,
|
|
@@ -2491,13 +2500,13 @@ function nr({ loading: e, options: t, scrollTop: n, virtual: r, viewportHeight:
|
|
|
2491
2500
|
}
|
|
2492
2501
|
//#endregion
|
|
2493
2502
|
//#region src/components/Select/internal/types.ts
|
|
2494
|
-
function
|
|
2503
|
+
function nr(e, t) {
|
|
2495
2504
|
return s(e, t);
|
|
2496
2505
|
}
|
|
2497
|
-
function
|
|
2506
|
+
function rr(e) {
|
|
2498
2507
|
return o(e);
|
|
2499
2508
|
}
|
|
2500
|
-
var
|
|
2509
|
+
var ir = {
|
|
2501
2510
|
option: "_option_7msws_1",
|
|
2502
2511
|
selected: "_selected_7msws_38",
|
|
2503
2512
|
disabled: "_disabled_7msws_38",
|
|
@@ -2515,18 +2524,18 @@ var ar = {
|
|
|
2515
2524
|
danger: "_danger_7msws_313",
|
|
2516
2525
|
check: "_check_7msws_377",
|
|
2517
2526
|
checkPop: "_checkPop_7msws_1"
|
|
2518
|
-
},
|
|
2519
|
-
|
|
2520
|
-
var
|
|
2521
|
-
let p = !!e.disabled, m = e.asChild && v(e.children) ? e.children : void 0, g = U(
|
|
2522
|
-
[
|
|
2523
|
-
[
|
|
2524
|
-
[
|
|
2525
|
-
[
|
|
2526
|
-
[
|
|
2527
|
-
[
|
|
2527
|
+
}, ar = () => null;
|
|
2528
|
+
nr(ar, "item"), ar.displayName = "Select.Item";
|
|
2529
|
+
var or = ({ option: e, isSelected: t, isActive: n, optionId: r, optionIndex: i, selectedValues: a, multiple: o, renderOption: s, onSelect: c, onMouseEnter: l }) => {
|
|
2530
|
+
let p = !!e.disabled, m = e.asChild && v(e.children) ? e.children : void 0, g = U(ir.option, {
|
|
2531
|
+
[ir.selected]: t,
|
|
2532
|
+
[ir.active]: n,
|
|
2533
|
+
[ir.disabled]: p,
|
|
2534
|
+
[ir.success]: e.color === "success",
|
|
2535
|
+
[ir.warning]: e.color === "warning",
|
|
2536
|
+
[ir.danger]: e.color === "danger"
|
|
2528
2537
|
});
|
|
2529
|
-
|
|
2538
|
+
at(!e.asChild || !!m, "Select.Item: asChild requires a single valid React element child.");
|
|
2530
2539
|
let _ = (t) => {
|
|
2531
2540
|
if (p) {
|
|
2532
2541
|
t.preventDefault();
|
|
@@ -2558,7 +2567,7 @@ var sr = ({ option: e, isSelected: t, isActive: n, optionId: r, optionIndex: i,
|
|
|
2558
2567
|
onClick: _,
|
|
2559
2568
|
onMouseEnter: y,
|
|
2560
2569
|
children: [s ? /* @__PURE__ */ d("span", {
|
|
2561
|
-
className:
|
|
2570
|
+
className: ir.custom,
|
|
2562
2571
|
children: s({
|
|
2563
2572
|
option: e,
|
|
2564
2573
|
selected: t,
|
|
@@ -2571,36 +2580,36 @@ var sr = ({ option: e, isSelected: t, isActive: n, optionId: r, optionIndex: i,
|
|
|
2571
2580
|
})
|
|
2572
2581
|
}) : /* @__PURE__ */ f(u, { children: [
|
|
2573
2582
|
e.icon && /* @__PURE__ */ d("span", {
|
|
2574
|
-
className:
|
|
2583
|
+
className: ir.icon,
|
|
2575
2584
|
children: e.icon
|
|
2576
2585
|
}),
|
|
2577
2586
|
/* @__PURE__ */ f("span", {
|
|
2578
|
-
className:
|
|
2587
|
+
className: ir.content,
|
|
2579
2588
|
children: [/* @__PURE__ */ d("span", {
|
|
2580
|
-
className:
|
|
2589
|
+
className: ir.label,
|
|
2581
2590
|
children: e.label
|
|
2582
2591
|
}), e.description && /* @__PURE__ */ d("span", {
|
|
2583
|
-
className:
|
|
2592
|
+
className: ir.description,
|
|
2584
2593
|
children: e.description
|
|
2585
2594
|
})]
|
|
2586
2595
|
}),
|
|
2587
2596
|
e.badge && /* @__PURE__ */ d("span", {
|
|
2588
|
-
className:
|
|
2597
|
+
className: ir.badge,
|
|
2589
2598
|
children: e.badge
|
|
2590
2599
|
}),
|
|
2591
2600
|
e.shortcut && /* @__PURE__ */ d("kbd", {
|
|
2592
|
-
className:
|
|
2601
|
+
className: ir.shortcut,
|
|
2593
2602
|
children: e.shortcut
|
|
2594
2603
|
})
|
|
2595
2604
|
] }), /* @__PURE__ */ d("span", {
|
|
2596
|
-
className:
|
|
2605
|
+
className: ir.check,
|
|
2597
2606
|
"aria-hidden": "true",
|
|
2598
|
-
children: t && /* @__PURE__ */ d(
|
|
2607
|
+
children: t && /* @__PURE__ */ d(V, {})
|
|
2599
2608
|
})]
|
|
2600
2609
|
});
|
|
2601
2610
|
};
|
|
2602
|
-
|
|
2603
|
-
var
|
|
2611
|
+
or.displayName = "SelectItemRow";
|
|
2612
|
+
var sr = {
|
|
2604
2613
|
dropdown: "_dropdown_1lvgh_1",
|
|
2605
2614
|
dropdownIn: "_dropdownIn_1lvgh_1",
|
|
2606
2615
|
primary: "_primary_1lvgh_103",
|
|
@@ -2626,36 +2635,36 @@ var Y = {
|
|
|
2626
2635
|
virtualSpacer: "_virtualSpacer_1lvgh_1581",
|
|
2627
2636
|
mobileDropdownIn: "_mobileDropdownIn_1lvgh_1"
|
|
2628
2637
|
}, cr = ({ children: e, className: t }) => {
|
|
2629
|
-
let { contentProps: n } =
|
|
2638
|
+
let { contentProps: n } = er(), r = ur(e);
|
|
2630
2639
|
return /* @__PURE__ */ d(lr, {
|
|
2631
2640
|
...n,
|
|
2632
2641
|
...r,
|
|
2633
2642
|
className: [n.className, t].filter(Boolean).join(" ")
|
|
2634
2643
|
});
|
|
2635
2644
|
};
|
|
2636
|
-
|
|
2645
|
+
nr(cr, "content"), cr.displayName = "Select.Content";
|
|
2637
2646
|
var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, entries: o, multiple: s, selectedValues: c, color: l = "primary", variant: p = "outline", searchable: m, command: h, virtual: g, portal: _ = !0, searchValue: v = "", searchPlaceholder: b = "Search...", loading: S, loadingText: C = "Loading...", emptyText: 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: B }) => {
|
|
2638
|
-
let ee = T(null), V = T(!1), [H,
|
|
2647
|
+
let ee = T(null), V = T(!1), [H, te] = E(null), [re, U] = E(0), [ie, W] = E(), { bottomSpacerHeight: G, isVirtual: K, itemHeight: ae, maxHeight: oe, startIndex: se, topSpacerHeight: ce, viewportHeight: q, visibleOptions: le } = w(() => tr({
|
|
2639
2648
|
loading: S,
|
|
2640
2649
|
options: a,
|
|
2641
|
-
scrollTop:
|
|
2650
|
+
scrollTop: re,
|
|
2642
2651
|
virtual: g,
|
|
2643
|
-
viewportHeight:
|
|
2652
|
+
viewportHeight: ie
|
|
2644
2653
|
}), [
|
|
2645
2654
|
S,
|
|
2646
2655
|
a,
|
|
2647
|
-
|
|
2648
|
-
|
|
2656
|
+
re,
|
|
2657
|
+
ie,
|
|
2649
2658
|
g
|
|
2650
|
-
]),
|
|
2651
|
-
|
|
2659
|
+
]), ue = y((e) => {
|
|
2660
|
+
te(e), r(e), e && W(e.clientHeight || void 0);
|
|
2652
2661
|
}, [r]);
|
|
2653
2662
|
x(() => {
|
|
2654
|
-
e || (V.current = !1,
|
|
2663
|
+
e || (V.current = !1, U(0), W(void 0));
|
|
2655
2664
|
}, [e, v]), x(() => {
|
|
2656
|
-
if (!e || !H || (
|
|
2665
|
+
if (!e || !H || (W(H.clientHeight || void 0), !("ResizeObserver" in window))) return;
|
|
2657
2666
|
let t = new ResizeObserver(([e]) => {
|
|
2658
|
-
|
|
2667
|
+
W(e?.contentRect.height || void 0);
|
|
2659
2668
|
});
|
|
2660
2669
|
return t.observe(H), () => t.disconnect();
|
|
2661
2670
|
}, [H, e]), x(() => {
|
|
@@ -2671,9 +2680,9 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2671
2680
|
V.current = !0;
|
|
2672
2681
|
return;
|
|
2673
2682
|
}
|
|
2674
|
-
if (V.current = !0,
|
|
2675
|
-
let e = Math.max(0, r *
|
|
2676
|
-
|
|
2683
|
+
if (V.current = !0, K) {
|
|
2684
|
+
let e = Math.max(0, r * ae - (q - ae) / 2);
|
|
2685
|
+
U(e), H.scrollTop = e;
|
|
2677
2686
|
return;
|
|
2678
2687
|
}
|
|
2679
2688
|
document.getElementById(`${t}-option-${r}`)?.scrollIntoView?.({ block: "nearest" });
|
|
@@ -2681,45 +2690,45 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2681
2690
|
P,
|
|
2682
2691
|
H,
|
|
2683
2692
|
e,
|
|
2693
|
+
K,
|
|
2684
2694
|
ae,
|
|
2685
|
-
oe,
|
|
2686
2695
|
t,
|
|
2687
2696
|
S,
|
|
2688
2697
|
a,
|
|
2689
2698
|
N,
|
|
2690
2699
|
c,
|
|
2691
|
-
|
|
2700
|
+
q
|
|
2692
2701
|
]);
|
|
2693
|
-
let
|
|
2702
|
+
let de = w(() => ({
|
|
2694
2703
|
...i,
|
|
2695
|
-
"--select-dropdown-max-height": typeof
|
|
2696
|
-
}), [
|
|
2704
|
+
"--select-dropdown-max-height": typeof oe == "number" ? `${oe}px` : oe
|
|
2705
|
+
}), [oe, i]);
|
|
2697
2706
|
if (!e) return null;
|
|
2698
|
-
let
|
|
2707
|
+
let fe = o && !K ? o : le.map((e, t) => ({
|
|
2699
2708
|
type: "option",
|
|
2700
2709
|
option: e,
|
|
2701
|
-
optionIndex:
|
|
2702
|
-
})),
|
|
2703
|
-
ref:
|
|
2710
|
+
optionIndex: se + t
|
|
2711
|
+
})), J = /* @__PURE__ */ f("div", {
|
|
2712
|
+
ref: ue,
|
|
2704
2713
|
tabIndex: 0,
|
|
2705
2714
|
className: [
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
h ?
|
|
2715
|
+
sr.dropdown,
|
|
2716
|
+
sr[l],
|
|
2717
|
+
sr[p],
|
|
2718
|
+
h ? sr.command : void 0,
|
|
2710
2719
|
I
|
|
2711
2720
|
].filter(Boolean).join(" "),
|
|
2712
|
-
style:
|
|
2721
|
+
style: de,
|
|
2713
2722
|
onScroll: (e) => {
|
|
2714
|
-
|
|
2723
|
+
K && U(e.currentTarget.scrollTop);
|
|
2715
2724
|
},
|
|
2716
2725
|
children: [
|
|
2717
2726
|
k,
|
|
2718
2727
|
O ?? (m && /* @__PURE__ */ f("div", {
|
|
2719
|
-
className:
|
|
2728
|
+
className: sr.searchWrap,
|
|
2720
2729
|
children: [/* @__PURE__ */ d("input", {
|
|
2721
2730
|
ref: ee,
|
|
2722
|
-
className:
|
|
2731
|
+
className: sr.search,
|
|
2723
2732
|
value: v,
|
|
2724
2733
|
placeholder: h ? "Type a command..." : b,
|
|
2725
2734
|
"aria-label": "Search options",
|
|
@@ -2727,12 +2736,12 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2727
2736
|
onChange: (e) => B?.(e.target.value)
|
|
2728
2737
|
}), v && /* @__PURE__ */ d("button", {
|
|
2729
2738
|
type: "button",
|
|
2730
|
-
className:
|
|
2739
|
+
className: sr.searchClear,
|
|
2731
2740
|
"aria-label": "Clear search",
|
|
2732
2741
|
onClick: () => {
|
|
2733
2742
|
B?.(""), ee.current?.focus();
|
|
2734
2743
|
},
|
|
2735
|
-
children: /* @__PURE__ */ d(
|
|
2744
|
+
children: /* @__PURE__ */ d(ne, {})
|
|
2736
2745
|
})]
|
|
2737
2746
|
})),
|
|
2738
2747
|
/* @__PURE__ */ d("ul", {
|
|
@@ -2744,15 +2753,15 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2744
2753
|
role: "option",
|
|
2745
2754
|
"aria-disabled": "true",
|
|
2746
2755
|
"aria-selected": "false",
|
|
2747
|
-
className:
|
|
2756
|
+
className: sr.empty,
|
|
2748
2757
|
children: j ?? C
|
|
2749
2758
|
}) : a.length ? /* @__PURE__ */ f(u, { children: [
|
|
2750
|
-
|
|
2759
|
+
K && /* @__PURE__ */ d("li", {
|
|
2751
2760
|
"aria-hidden": "true",
|
|
2752
|
-
className:
|
|
2753
|
-
style: { height:
|
|
2761
|
+
className: sr.virtualSpacer,
|
|
2762
|
+
style: { height: ce }
|
|
2754
2763
|
}),
|
|
2755
|
-
|
|
2764
|
+
fe.map((e) => {
|
|
2756
2765
|
if (e.type === "group") {
|
|
2757
2766
|
if (e.selectable && s) {
|
|
2758
2767
|
let t = e.itemValues.filter((e) => a.some((t) => t.value === e && !t.disabled)), n = c ? t.filter((e) => c.includes(e)).length : 0, r = t.length > 0 && n === t.length, i = n > 0 && n < t.length;
|
|
@@ -2760,16 +2769,16 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2760
2769
|
role: "presentation",
|
|
2761
2770
|
children: /* @__PURE__ */ f("button", {
|
|
2762
2771
|
type: "button",
|
|
2763
|
-
className:
|
|
2772
|
+
className: sr.groupAction,
|
|
2764
2773
|
"aria-label": dr(e.selectLabel ?? e.label),
|
|
2765
2774
|
"aria-pressed": i ? "mixed" : r ? "true" : "false",
|
|
2766
2775
|
disabled: t.length === 0,
|
|
2767
2776
|
onClick: () => R(t),
|
|
2768
2777
|
children: [/* @__PURE__ */ d("span", {
|
|
2769
|
-
className:
|
|
2778
|
+
className: sr.groupActionText,
|
|
2770
2779
|
children: e.selectLabel ?? e.label
|
|
2771
2780
|
}), /* @__PURE__ */ f("span", {
|
|
2772
|
-
className:
|
|
2781
|
+
className: sr.groupActionMeta,
|
|
2773
2782
|
children: [
|
|
2774
2783
|
n,
|
|
2775
2784
|
"/",
|
|
@@ -2781,18 +2790,18 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2781
2790
|
}
|
|
2782
2791
|
return /* @__PURE__ */ d("li", {
|
|
2783
2792
|
role: "presentation",
|
|
2784
|
-
className:
|
|
2793
|
+
className: sr.groupLabel,
|
|
2785
2794
|
children: e.label
|
|
2786
2795
|
}, e.id);
|
|
2787
2796
|
}
|
|
2788
2797
|
if (e.type === "separator") return /* @__PURE__ */ d("li", {
|
|
2789
2798
|
role: "presentation",
|
|
2790
2799
|
"aria-hidden": "true",
|
|
2791
|
-
className:
|
|
2800
|
+
className: sr.separator,
|
|
2792
2801
|
"data-vellira-select-separator": "true"
|
|
2793
2802
|
}, e.id);
|
|
2794
2803
|
let { option: n, optionIndex: r } = e;
|
|
2795
|
-
return /* @__PURE__ */ d(
|
|
2804
|
+
return /* @__PURE__ */ d(or, {
|
|
2796
2805
|
option: n,
|
|
2797
2806
|
isSelected: c ? c.includes(n.value) : n.value === N,
|
|
2798
2807
|
isActive: r === F,
|
|
@@ -2805,29 +2814,29 @@ var lr = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
2805
2814
|
onMouseEnter: () => z(r)
|
|
2806
2815
|
}, n.value);
|
|
2807
2816
|
}),
|
|
2808
|
-
|
|
2817
|
+
K && /* @__PURE__ */ d("li", {
|
|
2809
2818
|
"aria-hidden": "true",
|
|
2810
|
-
className:
|
|
2819
|
+
className: sr.virtualSpacer,
|
|
2811
2820
|
style: { height: G }
|
|
2812
2821
|
})
|
|
2813
2822
|
] }) : /* @__PURE__ */ d("li", {
|
|
2814
2823
|
role: "option",
|
|
2815
2824
|
"aria-disabled": "true",
|
|
2816
2825
|
"aria-selected": "false",
|
|
2817
|
-
className:
|
|
2826
|
+
className: sr.empty,
|
|
2818
2827
|
children: A ?? D
|
|
2819
2828
|
})
|
|
2820
2829
|
})
|
|
2821
2830
|
]
|
|
2822
2831
|
});
|
|
2823
|
-
return _ ? /* @__PURE__ */ d(
|
|
2832
|
+
return _ ? /* @__PURE__ */ d(Ke, { children: J }) : J;
|
|
2824
2833
|
};
|
|
2825
2834
|
lr.displayName = "SelectContentSurface";
|
|
2826
2835
|
function ur(e) {
|
|
2827
2836
|
let t, n, r, i;
|
|
2828
2837
|
return p.forEach(e, (e) => {
|
|
2829
2838
|
if (!v(e)) return;
|
|
2830
|
-
let a =
|
|
2839
|
+
let a = rr(e.type);
|
|
2831
2840
|
a === "label" && (t = e), a === "search" && (n = e), a === "empty" && (r = e), a === "loading" && (i = e);
|
|
2832
2841
|
}), {
|
|
2833
2842
|
emptySlot: r,
|
|
@@ -2842,75 +2851,75 @@ function dr(e) {
|
|
|
2842
2851
|
//#endregion
|
|
2843
2852
|
//#region src/components/Select/Empty/SelectEmpty.tsx
|
|
2844
2853
|
var fr = ({ children: e }) => /* @__PURE__ */ d(u, { children: e });
|
|
2845
|
-
|
|
2854
|
+
nr(fr, "empty"), fr.displayName = "Select.Empty";
|
|
2846
2855
|
//#endregion
|
|
2847
2856
|
//#region src/components/Select/Group/SelectGroup.tsx
|
|
2848
2857
|
var pr = () => null;
|
|
2849
|
-
|
|
2850
|
-
var
|
|
2851
|
-
root: "
|
|
2852
|
-
control: "
|
|
2853
|
-
disabled: "
|
|
2854
|
-
arrow: "
|
|
2855
|
-
withClear: "
|
|
2856
|
-
primary: "
|
|
2857
|
-
outline: "
|
|
2858
|
-
filled: "
|
|
2859
|
-
soft: "
|
|
2860
|
-
neutral: "
|
|
2861
|
-
success: "
|
|
2862
|
-
warning: "
|
|
2863
|
-
danger: "
|
|
2864
|
-
sm: "
|
|
2865
|
-
md: "
|
|
2866
|
-
lg: "
|
|
2867
|
-
valueWrap: "
|
|
2868
|
-
value: "
|
|
2869
|
-
adornment: "
|
|
2870
|
-
affix: "
|
|
2871
|
-
clear: "
|
|
2872
|
-
placeholder: "
|
|
2873
|
-
error: "
|
|
2874
|
-
spinner: "
|
|
2875
|
-
spin: "
|
|
2876
|
-
loading: "
|
|
2877
|
-
open: "
|
|
2858
|
+
nr(pr, "group"), pr.displayName = "Select.Group";
|
|
2859
|
+
var Z = {
|
|
2860
|
+
root: "_root_jn0gk_1",
|
|
2861
|
+
control: "_control_jn0gk_8",
|
|
2862
|
+
disabled: "_disabled_jn0gk_50",
|
|
2863
|
+
arrow: "_arrow_jn0gk_56",
|
|
2864
|
+
withClear: "_withClear_jn0gk_71",
|
|
2865
|
+
primary: "_primary_jn0gk_75",
|
|
2866
|
+
outline: "_outline_jn0gk_75",
|
|
2867
|
+
filled: "_filled_jn0gk_116",
|
|
2868
|
+
soft: "_soft_jn0gk_157",
|
|
2869
|
+
neutral: "_neutral_jn0gk_198",
|
|
2870
|
+
success: "_success_jn0gk_321",
|
|
2871
|
+
warning: "_warning_jn0gk_444",
|
|
2872
|
+
danger: "_danger_jn0gk_567",
|
|
2873
|
+
sm: "_sm_jn0gk_690",
|
|
2874
|
+
md: "_md_jn0gk_697",
|
|
2875
|
+
lg: "_lg_jn0gk_704",
|
|
2876
|
+
valueWrap: "_valueWrap_jn0gk_711",
|
|
2877
|
+
value: "_value_jn0gk_711",
|
|
2878
|
+
adornment: "_adornment_jn0gk_725",
|
|
2879
|
+
affix: "_affix_jn0gk_726",
|
|
2880
|
+
clear: "_clear_jn0gk_741",
|
|
2881
|
+
placeholder: "_placeholder_jn0gk_777",
|
|
2882
|
+
error: "_error_jn0gk_781",
|
|
2883
|
+
spinner: "_spinner_jn0gk_817",
|
|
2884
|
+
spin: "_spin_jn0gk_817",
|
|
2885
|
+
loading: "_loading_jn0gk_826",
|
|
2886
|
+
open: "_open_jn0gk_845"
|
|
2878
2887
|
}, mr = ({ children: e, className: t }) => {
|
|
2879
|
-
let { triggerProps: n } =
|
|
2888
|
+
let { triggerProps: n } = er();
|
|
2880
2889
|
return /* @__PURE__ */ d("span", {
|
|
2881
|
-
className: U(
|
|
2890
|
+
className: U(Z.arrow, { [Z.open]: n.isOpen }, t),
|
|
2882
2891
|
"aria-hidden": "true",
|
|
2883
|
-
children: n.loading ? /* @__PURE__ */ d("span", { className:
|
|
2892
|
+
children: n.loading ? /* @__PURE__ */ d("span", { className: Z.spinner }) : e ?? n.endIcon ?? /* @__PURE__ */ d(H, {})
|
|
2884
2893
|
});
|
|
2885
2894
|
};
|
|
2886
|
-
|
|
2895
|
+
nr(mr, "icon"), mr.displayName = "Select.Icon";
|
|
2887
2896
|
//#endregion
|
|
2888
2897
|
//#region src/components/Select/ItemBadge/SelectItemBadge.tsx
|
|
2889
2898
|
var hr = () => null;
|
|
2890
|
-
|
|
2899
|
+
nr(hr, "itemBadge"), hr.displayName = "Select.ItemBadge";
|
|
2891
2900
|
//#endregion
|
|
2892
2901
|
//#region src/components/Select/ItemDescription/SelectItemDescription.tsx
|
|
2893
2902
|
var gr = () => null;
|
|
2894
|
-
|
|
2903
|
+
nr(gr, "itemDescription"), gr.displayName = "Select.ItemDescription";
|
|
2895
2904
|
//#endregion
|
|
2896
2905
|
//#region src/components/Select/ItemIcon/SelectItemIcon.tsx
|
|
2897
2906
|
var _r = () => null;
|
|
2898
|
-
|
|
2907
|
+
nr(_r, "itemIcon"), _r.displayName = "Select.ItemIcon";
|
|
2899
2908
|
//#endregion
|
|
2900
2909
|
//#region src/components/Select/Label/SelectLabel.tsx
|
|
2901
2910
|
var vr = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
2902
2911
|
role: "presentation",
|
|
2903
|
-
className:
|
|
2912
|
+
className: sr.groupLabel,
|
|
2904
2913
|
children: e
|
|
2905
2914
|
});
|
|
2906
|
-
|
|
2915
|
+
nr(vr, "label"), vr.displayName = "Select.Label";
|
|
2907
2916
|
//#endregion
|
|
2908
2917
|
//#region src/components/Select/Loading/SelectLoading.tsx
|
|
2909
2918
|
var yr = ({ children: e }) => /* @__PURE__ */ d(u, { children: e });
|
|
2910
|
-
|
|
2919
|
+
nr(yr, "loading"), yr.displayName = "Select.Loading";
|
|
2911
2920
|
//#endregion
|
|
2912
2921
|
//#region src/patterns/FormField/FormFieldContext.ts
|
|
2913
|
-
var br = g(null), xr = () => b(br),
|
|
2922
|
+
var br = g(null), xr = () => b(br), Sr = {
|
|
2914
2923
|
wrapper: "_wrapper_r078u_1",
|
|
2915
2924
|
sm: "_sm_r078u_41",
|
|
2916
2925
|
md: "_md_r078u_78",
|
|
@@ -2932,12 +2941,12 @@ var br = g(null), xr = () => b(br), Z = {
|
|
|
2932
2941
|
messageToneWarning: "_messageToneWarning_r078u_257",
|
|
2933
2942
|
messageToneDanger: "_messageToneDanger_r078u_261",
|
|
2934
2943
|
disabled: "_disabled_r078u_274"
|
|
2935
|
-
},
|
|
2936
|
-
function
|
|
2944
|
+
}, Cr = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
2945
|
+
function wr(e, t) {
|
|
2937
2946
|
let n = () => null;
|
|
2938
2947
|
return n.__velliraFormFieldPart = e, n.displayName = t, n;
|
|
2939
2948
|
}
|
|
2940
|
-
function
|
|
2949
|
+
function Tr(e) {
|
|
2941
2950
|
let t = [], n = { hasSlots: !1 };
|
|
2942
2951
|
return p.forEach(e, (e) => {
|
|
2943
2952
|
if (!v(e)) {
|
|
@@ -2961,109 +2970,109 @@ function wr(e) {
|
|
|
2961
2970
|
}
|
|
2962
2971
|
}), t.length > 0 && (n.fallbackChildren = t.length === 1 ? t[0] : t), n;
|
|
2963
2972
|
}
|
|
2964
|
-
var
|
|
2965
|
-
let j =
|
|
2966
|
-
neutral:
|
|
2967
|
-
success:
|
|
2968
|
-
warning:
|
|
2969
|
-
danger:
|
|
2970
|
-
}[
|
|
2973
|
+
var Er = ({ id: e, label: t, description: n, error: r, message: i, messageTone: a, messageLive: o, required: s = !1, disabled: c = !1, invalid: l = !1, orientation: u = "vertical", labelPosition: p = "top", size: g = "md", labelInfo: _, labelAction: y, optionalText: b, children: x, bindControl: C = !0, className: w, controlClassName: T, labelClassName: E, descriptionClassName: D, errorClassName: O, messageClassName: k, ...A }) => {
|
|
2974
|
+
let j = Tr(x), M = t ?? j.label?.children, N = n ?? j.description?.children, P = i ?? j.message?.children, F = a ?? j.message?.tone ?? "neutral", I = o ?? j.message?.live ?? "off", L = _ ?? j.label?.info, R = y ?? j.label?.action, z = b ?? j.label?.optionalText, B = j.hasSlots ? j.control?.children ?? j.fallbackChildren : x, ee = j.control?.bindControl ?? C, V = S(), H = e ?? V, te = M ? `${H}-label` : void 0, ne = N && H ? `${H}-description` : void 0, re = r && H ? `${H}-error` : void 0, ie = !r && P && H ? `${H}-message` : void 0, W = l || !!r, G = r ?? P, K = r ? "danger" : F, ae = {
|
|
2975
|
+
neutral: Sr.messageToneNeutral,
|
|
2976
|
+
success: Sr.messageToneSuccess,
|
|
2977
|
+
warning: Sr.messageToneWarning,
|
|
2978
|
+
danger: Sr.messageToneDanger
|
|
2979
|
+
}[K], oe = Cr(te), se = Cr(ne, re, ie), ce = {
|
|
2971
2980
|
controlId: H,
|
|
2972
2981
|
labelId: te,
|
|
2973
2982
|
descriptionId: ne,
|
|
2974
2983
|
errorId: re,
|
|
2975
|
-
messageId:
|
|
2984
|
+
messageId: ie,
|
|
2976
2985
|
required: s,
|
|
2977
2986
|
disabled: c,
|
|
2978
|
-
invalid:
|
|
2987
|
+
invalid: W,
|
|
2979
2988
|
size: g,
|
|
2980
|
-
ariaLabelledBy:
|
|
2981
|
-
ariaDescribedBy:
|
|
2982
|
-
},
|
|
2983
|
-
id:
|
|
2984
|
-
required:
|
|
2985
|
-
disabled:
|
|
2986
|
-
"aria-invalid":
|
|
2987
|
-
"aria-labelledby":
|
|
2988
|
-
"aria-describedby":
|
|
2989
|
+
ariaLabelledBy: oe,
|
|
2990
|
+
ariaDescribedBy: se
|
|
2991
|
+
}, q = v(B) && B.type !== m ? B : void 0, le = ee && q ? h(q, {
|
|
2992
|
+
id: q.props.id ?? H,
|
|
2993
|
+
required: q.props.required ?? s,
|
|
2994
|
+
disabled: q.props.disabled ?? c,
|
|
2995
|
+
"aria-invalid": q.props["aria-invalid"] ?? (W || void 0),
|
|
2996
|
+
"aria-labelledby": Cr(q.props["aria-labelledby"], oe),
|
|
2997
|
+
"aria-describedby": Cr(q.props["aria-describedby"], se)
|
|
2989
2998
|
}) : B;
|
|
2990
2999
|
return /* @__PURE__ */ f("div", {
|
|
2991
3000
|
...A,
|
|
2992
3001
|
"aria-disabled": c || void 0,
|
|
2993
|
-
className: U(
|
|
3002
|
+
className: U(Sr.wrapper, Sr[u], Sr[p], Sr[g], c && Sr.disabled, w),
|
|
2994
3003
|
"data-disabled": c || void 0,
|
|
2995
|
-
"data-invalid":
|
|
3004
|
+
"data-invalid": W || void 0,
|
|
2996
3005
|
"data-orientation": u,
|
|
2997
3006
|
"data-size": g,
|
|
2998
3007
|
children: [
|
|
2999
3008
|
(M || R) && /* @__PURE__ */ f("div", {
|
|
3000
|
-
className:
|
|
3009
|
+
className: Sr.labelRow,
|
|
3001
3010
|
children: [M && /* @__PURE__ */ f("label", {
|
|
3002
3011
|
id: te,
|
|
3003
3012
|
htmlFor: H,
|
|
3004
|
-
className: U(
|
|
3013
|
+
className: U(Sr.label, j.label?.className, E),
|
|
3005
3014
|
children: [
|
|
3006
3015
|
/* @__PURE__ */ d("span", {
|
|
3007
|
-
className:
|
|
3016
|
+
className: Sr.labelText,
|
|
3008
3017
|
children: M
|
|
3009
3018
|
}),
|
|
3010
3019
|
s && /* @__PURE__ */ d("span", {
|
|
3011
|
-
className:
|
|
3020
|
+
className: Sr.required,
|
|
3012
3021
|
"aria-hidden": "true",
|
|
3013
3022
|
children: "*"
|
|
3014
3023
|
}),
|
|
3015
3024
|
!s && z && /* @__PURE__ */ d("span", {
|
|
3016
|
-
className:
|
|
3025
|
+
className: Sr.optional,
|
|
3017
3026
|
children: z
|
|
3018
3027
|
}),
|
|
3019
3028
|
L && /* @__PURE__ */ d("span", {
|
|
3020
|
-
className:
|
|
3029
|
+
className: Sr.labelInfo,
|
|
3021
3030
|
children: L
|
|
3022
3031
|
})
|
|
3023
3032
|
]
|
|
3024
3033
|
}), R && /* @__PURE__ */ d("div", {
|
|
3025
|
-
className:
|
|
3034
|
+
className: Sr.labelAction,
|
|
3026
3035
|
children: R
|
|
3027
3036
|
})]
|
|
3028
3037
|
}),
|
|
3029
3038
|
N && /* @__PURE__ */ d("div", {
|
|
3030
3039
|
id: ne,
|
|
3031
|
-
className: U(
|
|
3040
|
+
className: U(Sr.description, j.description?.className, D),
|
|
3032
3041
|
children: N
|
|
3033
3042
|
}),
|
|
3034
3043
|
/* @__PURE__ */ d(br.Provider, {
|
|
3035
|
-
value:
|
|
3044
|
+
value: ce,
|
|
3036
3045
|
children: /* @__PURE__ */ d("div", {
|
|
3037
|
-
className: U(
|
|
3038
|
-
children:
|
|
3046
|
+
className: U(Sr.control, j.control?.className, T),
|
|
3047
|
+
children: le
|
|
3039
3048
|
})
|
|
3040
3049
|
}),
|
|
3041
3050
|
G && /* @__PURE__ */ d("div", {
|
|
3042
|
-
id: r ? re :
|
|
3043
|
-
className: U(
|
|
3051
|
+
id: r ? re : ie,
|
|
3052
|
+
className: U(Sr.message, ae, !r && j.message?.className, r ? O : k),
|
|
3044
3053
|
role: r ? "alert" : void 0,
|
|
3045
3054
|
"aria-live": !r && I === "polite" ? "polite" : void 0,
|
|
3046
3055
|
children: G
|
|
3047
3056
|
})
|
|
3048
3057
|
]
|
|
3049
3058
|
});
|
|
3050
|
-
},
|
|
3051
|
-
Label:
|
|
3052
|
-
Description:
|
|
3053
|
-
Control:
|
|
3054
|
-
Message:
|
|
3059
|
+
}, Dr = wr("label", "FormField.Label"), Or = wr("description", "FormField.Description"), kr = wr("control", "FormField.Control"), Ar = wr("message", "FormField.Message"), jr = Object.assign(Er, {
|
|
3060
|
+
Label: Dr,
|
|
3061
|
+
Description: Or,
|
|
3062
|
+
Control: kr,
|
|
3063
|
+
Message: Ar,
|
|
3055
3064
|
displayName: "FormField"
|
|
3056
|
-
}),
|
|
3057
|
-
let { triggerProps: n } =
|
|
3058
|
-
return /* @__PURE__ */ d(
|
|
3065
|
+
}), Mr = ({ children: e, className: t }) => {
|
|
3066
|
+
let { triggerProps: n } = er();
|
|
3067
|
+
return /* @__PURE__ */ d(Nr, {
|
|
3059
3068
|
...n,
|
|
3060
3069
|
className: [n.className, t].filter(Boolean).join(" "),
|
|
3061
3070
|
children: e
|
|
3062
3071
|
});
|
|
3063
3072
|
};
|
|
3064
|
-
|
|
3065
|
-
var
|
|
3066
|
-
className:
|
|
3073
|
+
nr(Mr, "trigger"), Mr.displayName = "Select.Trigger";
|
|
3074
|
+
var Nr = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabled: a, required: o, listboxId: s, activeIndex: c, ariaLabel: l, error: p, displayText: m, isPlaceholder: h, size: g = "md", color: _, variant: v, loading: y, startIcon: b, endIcon: x, prefix: S, suffix: C, clearable: w, onClear: T, className: E, buttonRef: D, onClick: O, onKeyDown: k, onBlur: A, onFocus: j }) => /* @__PURE__ */ f("span", {
|
|
3075
|
+
className: Z.root,
|
|
3067
3076
|
children: [/* @__PURE__ */ d("button", {
|
|
3068
3077
|
id: t,
|
|
3069
3078
|
ref: D,
|
|
@@ -3080,11 +3089,11 @@ var Mr = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabl
|
|
|
3080
3089
|
"aria-controls": i ? s : void 0,
|
|
3081
3090
|
"aria-describedby": n,
|
|
3082
3091
|
"aria-activedescendant": i && c >= 0 ? `${s}-option-${c}` : void 0,
|
|
3083
|
-
className: U(
|
|
3084
|
-
[
|
|
3085
|
-
[
|
|
3086
|
-
[
|
|
3087
|
-
[
|
|
3092
|
+
className: U(Z.control, Z[g], Z[v], Z[_], {
|
|
3093
|
+
[Z.error]: !!p,
|
|
3094
|
+
[Z.disabled]: a,
|
|
3095
|
+
[Z.loading]: y,
|
|
3096
|
+
[Z.withClear]: w
|
|
3088
3097
|
}, E),
|
|
3089
3098
|
onClick: O,
|
|
3090
3099
|
onKeyDown: k,
|
|
@@ -3092,51 +3101,51 @@ var Mr = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabl
|
|
|
3092
3101
|
onFocus: j,
|
|
3093
3102
|
children: e ?? /* @__PURE__ */ f(u, { children: [
|
|
3094
3103
|
b && /* @__PURE__ */ d("span", {
|
|
3095
|
-
className:
|
|
3104
|
+
className: Z.adornment,
|
|
3096
3105
|
children: b
|
|
3097
3106
|
}),
|
|
3098
3107
|
S && /* @__PURE__ */ d("span", {
|
|
3099
|
-
className:
|
|
3108
|
+
className: Z.affix,
|
|
3100
3109
|
children: S
|
|
3101
3110
|
}),
|
|
3102
3111
|
/* @__PURE__ */ d("span", {
|
|
3103
|
-
className:
|
|
3112
|
+
className: Z.valueWrap,
|
|
3104
3113
|
children: /* @__PURE__ */ d("span", {
|
|
3105
|
-
className: U(
|
|
3114
|
+
className: U(Z.value, { [Z.placeholder]: h }),
|
|
3106
3115
|
children: m
|
|
3107
3116
|
})
|
|
3108
3117
|
}),
|
|
3109
3118
|
C && /* @__PURE__ */ d("span", {
|
|
3110
|
-
className:
|
|
3119
|
+
className: Z.affix,
|
|
3111
3120
|
children: C
|
|
3112
3121
|
}),
|
|
3113
3122
|
/* @__PURE__ */ d("span", {
|
|
3114
|
-
className: U(
|
|
3123
|
+
className: U(Z.arrow, { [Z.open]: i }),
|
|
3115
3124
|
"aria-hidden": "true",
|
|
3116
|
-
children: y ? /* @__PURE__ */ d("span", { className:
|
|
3125
|
+
children: y ? /* @__PURE__ */ d("span", { className: Z.spinner }) : x ?? /* @__PURE__ */ d(H, {})
|
|
3117
3126
|
})
|
|
3118
3127
|
] })
|
|
3119
3128
|
}), w && !e && /* @__PURE__ */ d("button", {
|
|
3120
3129
|
type: "button",
|
|
3121
3130
|
"aria-label": "Clear selection",
|
|
3122
|
-
className:
|
|
3131
|
+
className: Z.clear,
|
|
3123
3132
|
onClick: (e) => {
|
|
3124
3133
|
e.stopPropagation(), T?.();
|
|
3125
3134
|
},
|
|
3126
|
-
children: /* @__PURE__ */ d(
|
|
3135
|
+
children: /* @__PURE__ */ d(ne, {})
|
|
3127
3136
|
})]
|
|
3128
3137
|
});
|
|
3129
|
-
|
|
3138
|
+
Nr.displayName = "SelectTriggerSurface";
|
|
3130
3139
|
//#endregion
|
|
3131
3140
|
//#region src/components/Select/internal/SelectCollection.ts
|
|
3132
|
-
function
|
|
3141
|
+
function Pr(e) {
|
|
3133
3142
|
let t = [], n = [], r = 0;
|
|
3134
3143
|
function i(e) {
|
|
3135
3144
|
p.forEach(e, (e) => {
|
|
3136
3145
|
if (!v(e)) return;
|
|
3137
|
-
let a =
|
|
3146
|
+
let a = rr(e.type);
|
|
3138
3147
|
if (a === "group") {
|
|
3139
|
-
let n = e.props, a =
|
|
3148
|
+
let n = e.props, a = Ir(n.children);
|
|
3140
3149
|
t.push({
|
|
3141
3150
|
type: "group",
|
|
3142
3151
|
id: `group-${r++}`,
|
|
@@ -3148,7 +3157,7 @@ function Nr(e) {
|
|
|
3148
3157
|
return;
|
|
3149
3158
|
}
|
|
3150
3159
|
if (a === "item") {
|
|
3151
|
-
let r = e.props, i =
|
|
3160
|
+
let r = e.props, i = Lr(r.children, r.value), a = r.label ?? i.label, o = n.length, s = {
|
|
3152
3161
|
asChild: r.asChild,
|
|
3153
3162
|
children: r.children,
|
|
3154
3163
|
label: a,
|
|
@@ -3174,7 +3183,7 @@ function Nr(e) {
|
|
|
3174
3183
|
});
|
|
3175
3184
|
return;
|
|
3176
3185
|
}
|
|
3177
|
-
a
|
|
3186
|
+
a !== "empty" && a !== "icon" && a !== "itemBadge" && a !== "itemDescription" && a !== "itemIcon" && a !== "label" && a !== "loading" && a !== "search" && a !== "value" && i(e.props.children);
|
|
3178
3187
|
});
|
|
3179
3188
|
}
|
|
3180
3189
|
return i(e), {
|
|
@@ -3182,12 +3191,12 @@ function Nr(e) {
|
|
|
3182
3191
|
options: n
|
|
3183
3192
|
};
|
|
3184
3193
|
}
|
|
3185
|
-
function
|
|
3194
|
+
function Fr(e) {
|
|
3186
3195
|
let t = !1;
|
|
3187
3196
|
function n(e) {
|
|
3188
3197
|
p.forEach(e, (e) => {
|
|
3189
3198
|
if (!v(e) || t) return;
|
|
3190
|
-
let r =
|
|
3199
|
+
let r = rr(e.type);
|
|
3191
3200
|
if (r === "trigger" || r === "content") {
|
|
3192
3201
|
t = !0;
|
|
3193
3202
|
return;
|
|
@@ -3197,12 +3206,12 @@ function Pr(e) {
|
|
|
3197
3206
|
}
|
|
3198
3207
|
return n(e), t;
|
|
3199
3208
|
}
|
|
3200
|
-
function
|
|
3209
|
+
function Ir(e) {
|
|
3201
3210
|
let t = [];
|
|
3202
3211
|
function n(e) {
|
|
3203
3212
|
p.forEach(e, (e) => {
|
|
3204
3213
|
if (v(e)) {
|
|
3205
|
-
if (
|
|
3214
|
+
if (rr(e.type) === "item") {
|
|
3206
3215
|
t.push(e.props.value);
|
|
3207
3216
|
return;
|
|
3208
3217
|
}
|
|
@@ -3212,7 +3221,7 @@ function Fr(e) {
|
|
|
3212
3221
|
}
|
|
3213
3222
|
return n(e), t;
|
|
3214
3223
|
}
|
|
3215
|
-
function
|
|
3224
|
+
function Lr(e, t) {
|
|
3216
3225
|
let n, r, i, a = [];
|
|
3217
3226
|
function o(e) {
|
|
3218
3227
|
p.forEach(e, (e) => {
|
|
@@ -3221,7 +3230,7 @@ function Ir(e, t) {
|
|
|
3221
3230
|
return;
|
|
3222
3231
|
}
|
|
3223
3232
|
if (!v(e)) return;
|
|
3224
|
-
let t =
|
|
3233
|
+
let t = rr(e.type);
|
|
3225
3234
|
if (t === "itemBadge") {
|
|
3226
3235
|
n = e.props.children;
|
|
3227
3236
|
return;
|
|
@@ -3248,326 +3257,328 @@ function Ir(e, t) {
|
|
|
3248
3257
|
}
|
|
3249
3258
|
//#endregion
|
|
3250
3259
|
//#region src/components/Select/internal/SelectSearch.ts
|
|
3251
|
-
function
|
|
3260
|
+
function Rr({ options: e, searchable: t, searchValue: n }) {
|
|
3252
3261
|
if (!t || !n) return e;
|
|
3253
3262
|
let r = n.toLocaleLowerCase();
|
|
3254
|
-
return e.filter((e) => `${e.label} ${
|
|
3263
|
+
return e.filter((e) => `${e.label} ${zr(e.description)}`.toLocaleLowerCase().includes(r));
|
|
3255
3264
|
}
|
|
3256
|
-
function
|
|
3265
|
+
function zr(e) {
|
|
3257
3266
|
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
3258
3267
|
}
|
|
3259
3268
|
//#endregion
|
|
3260
3269
|
//#region src/components/Select/internal/useSelectCollection.ts
|
|
3261
|
-
function
|
|
3262
|
-
return w(() =>
|
|
3270
|
+
function Br(e) {
|
|
3271
|
+
return w(() => Pr(e), [e]);
|
|
3263
3272
|
}
|
|
3264
3273
|
//#endregion
|
|
3265
3274
|
//#region src/components/Select/Root/useSelectRootState.tsx
|
|
3266
|
-
function
|
|
3267
|
-
let { children: t, label: n, description: r, id: i, name: a, "aria-label": o, "aria-describedby": s, "aria-labelledby": c, value: l, defaultValue: p, onValueChange: m, multiple: h = !1, maxSelected: g, closeOnSelect: _, placeholder: v = "Select...", empty: b, loadingText: C = "Loading...", 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: B = "bottom", matchTriggerWidth: ee = !0, avoidCollisions: V = !0, portal: H = !0, open: te, defaultOpen: ne = !1, onOpenChange:
|
|
3275
|
+
function Vr(e) {
|
|
3276
|
+
let { children: t, label: n, description: r, id: i, name: a, "aria-label": o, "aria-describedby": s, "aria-labelledby": c, value: l, defaultValue: p, onValueChange: m, multiple: h = !1, maxSelected: g, closeOnSelect: _, placeholder: v = "Select...", empty: b, loadingText: C = "Loading...", 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: B = "bottom", matchTriggerWidth: ee = !0, avoidCollisions: V = !0, portal: H = !0, open: te, defaultOpen: ne = !1, onOpenChange: re, onSearch: U, onClear: ie, startIcon: W, endIcon: G, prefix: K, suffix: ae, renderValue: oe, renderOption: se, onBlur: ce, onFocus: q, className: le, triggerClassName: ue, dropdownClassName: de } = e, fe = S(), J = xr(), pe = !!(n || r || z), me = i ?? (pe ? void 0 : J?.controlId) ?? fe, he = `${me}-listbox`, [ge, _e] = E(""), ve = !!z, ye = ve ? `${me}-error` : void 0, be = r ? `${me}-description` : void 0, xe = D ?? J?.size ?? "md", Se = M || ve || !pe && !!J?.invalid, Ce = j || !pe && !!J?.disabled, we = A || !pe && !!J?.required, Te = [
|
|
3268
3277
|
s,
|
|
3269
|
-
!
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
].filter(Boolean).join(" "),
|
|
3273
|
-
options:
|
|
3274
|
-
searchable:
|
|
3275
|
-
searchValue:
|
|
3278
|
+
!pe && !s ? J?.ariaDescribedBy : void 0,
|
|
3279
|
+
be,
|
|
3280
|
+
ye
|
|
3281
|
+
].filter(Boolean).join(" "), Ee = T(null), De = T(null), [Oe, ke] = E(!1), je = F || R, { entries: Me, options: Ne } = Br(t), Pe = w(() => Rr({
|
|
3282
|
+
options: Ne,
|
|
3283
|
+
searchable: je,
|
|
3284
|
+
searchValue: ge
|
|
3276
3285
|
}), [
|
|
3286
|
+
je,
|
|
3277
3287
|
Ne,
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
]), { selectedValue: Re, selectedValues: q, isOpen: Be, setIsOpen: Ve, setSelectedValue: He, activeIndex: We, setActiveIndex: Ge, closeDropdown: Ke, toggleDropdown: qe, selectValue: Je, onKeyDown: Ye } = Ue({
|
|
3288
|
+
ge
|
|
3289
|
+
]), { selectedValue: Ie, selectedValues: Le, isOpen: Y, setIsOpen: ze, setSelectedValue: Be, activeIndex: Ve, setActiveIndex: Ue, closeDropdown: We, toggleDropdown: Ge, selectValue: Ke, onKeyDown: qe } = He({
|
|
3281
3290
|
value: l,
|
|
3282
3291
|
defaultValue: p,
|
|
3283
3292
|
onValueChange: m,
|
|
3284
|
-
options:
|
|
3293
|
+
options: Pe,
|
|
3285
3294
|
multiple: h,
|
|
3286
3295
|
maxSelected: g,
|
|
3287
3296
|
closeOnSelect: _,
|
|
3288
|
-
disabled:
|
|
3297
|
+
disabled: Ce,
|
|
3289
3298
|
open: te,
|
|
3290
3299
|
defaultOpen: ne,
|
|
3291
|
-
onOpenChange:
|
|
3292
|
-
}),
|
|
3293
|
-
isOpen:
|
|
3294
|
-
onOpenChange:
|
|
3300
|
+
onOpenChange: re
|
|
3301
|
+
}), Je = w(() => Ne.find((e) => Le.includes(e.value)), [Ne, Le]), Ye = w(() => Ne.filter((e) => Le.includes(e.value)), [Ne, Le]), Xe = !!Je, Ze = Array.isArray(Ie) ? Ie[0] ?? "" : Ie, { floatingStyles: Qe, setRef: $e, setFloatingRef: et } = Re({
|
|
3302
|
+
isOpen: Y,
|
|
3303
|
+
onOpenChange: ze,
|
|
3295
3304
|
placement: B,
|
|
3296
3305
|
matchTriggerWidth: ee,
|
|
3297
3306
|
avoidCollisions: V
|
|
3298
|
-
}),
|
|
3299
|
-
|
|
3300
|
-
}, [
|
|
3307
|
+
}), tt = y((e) => {
|
|
3308
|
+
Ke(e), Ee.current?.focus();
|
|
3309
|
+
}, [Ke]), nt = y((e) => {
|
|
3301
3310
|
if (!h || e.length === 0) return;
|
|
3302
|
-
let t = e.filter((e) =>
|
|
3311
|
+
let t = e.filter((e) => Ne.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => Le.includes(e)), r = Le.filter((e) => !t.includes(e)).length, i = typeof g == "number" ? Math.max(0, Math.min(t.length, g - r)) : t.length;
|
|
3303
3312
|
if (n.length > 0 && n.length >= i) {
|
|
3304
|
-
|
|
3313
|
+
Be(Le.filter((e) => !t.includes(e)));
|
|
3305
3314
|
return;
|
|
3306
3315
|
}
|
|
3307
|
-
let a = [...
|
|
3316
|
+
let a = [...Le];
|
|
3308
3317
|
for (let e of t) if (!a.includes(e)) {
|
|
3309
3318
|
if (typeof g == "number" && a.length >= g) break;
|
|
3310
3319
|
a.push(e);
|
|
3311
3320
|
}
|
|
3312
|
-
|
|
3321
|
+
Be(a), _ && (We(), Ee.current?.focus());
|
|
3313
3322
|
}, [
|
|
3314
|
-
|
|
3323
|
+
We,
|
|
3315
3324
|
_,
|
|
3316
3325
|
g,
|
|
3317
3326
|
h,
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
]),
|
|
3322
|
-
|
|
3323
|
-
}, [
|
|
3324
|
-
|
|
3325
|
-
}, [
|
|
3326
|
-
|
|
3327
|
-
}, [
|
|
3328
|
-
|
|
3329
|
-
}, [
|
|
3330
|
-
|
|
3331
|
-
}, [
|
|
3332
|
-
active:
|
|
3333
|
-
id:
|
|
3327
|
+
Ne,
|
|
3328
|
+
Le,
|
|
3329
|
+
Be
|
|
3330
|
+
]), rt = y(() => {
|
|
3331
|
+
Ke(""), ie?.(), Ee.current?.focus();
|
|
3332
|
+
}, [ie, Ke]), it = y(() => {
|
|
3333
|
+
Y || ke(!1), Ge();
|
|
3334
|
+
}, [Y, Ge]), at = y((e) => {
|
|
3335
|
+
Hr(e, Y) && ke(!0), qe(e);
|
|
3336
|
+
}, [Y, qe]), X = y((e) => {
|
|
3337
|
+
ke(!0), Ue(e);
|
|
3338
|
+
}, [Ue]), ot = y((e) => {
|
|
3339
|
+
_e(e), U?.(e);
|
|
3340
|
+
}, [U]), st = Ae({
|
|
3341
|
+
active: Y,
|
|
3342
|
+
id: he,
|
|
3334
3343
|
zIndexLevel: "dropdown",
|
|
3335
3344
|
closeOnEscape: !0,
|
|
3336
3345
|
closeOnOutsidePress: !0,
|
|
3337
|
-
contentRef:
|
|
3338
|
-
ignoreRefs: [
|
|
3339
|
-
requestClose:
|
|
3346
|
+
contentRef: De,
|
|
3347
|
+
ignoreRefs: [Ee],
|
|
3348
|
+
requestClose: We
|
|
3340
3349
|
});
|
|
3341
3350
|
x(() => {
|
|
3342
|
-
|
|
3343
|
-
}, [
|
|
3344
|
-
!
|
|
3345
|
-
}, [
|
|
3346
|
-
active:
|
|
3351
|
+
Y || ke(!1);
|
|
3352
|
+
}, [Y]), x(() => {
|
|
3353
|
+
!Y && ge && _e("");
|
|
3354
|
+
}, [Y, ge]), Fe({
|
|
3355
|
+
active: Y,
|
|
3347
3356
|
enabled: L
|
|
3348
3357
|
});
|
|
3349
|
-
let
|
|
3350
|
-
|
|
3351
|
-
}, [
|
|
3352
|
-
|
|
3353
|
-
}, [
|
|
3358
|
+
let ct = y((e) => {
|
|
3359
|
+
Ee.current = e, $e(e);
|
|
3360
|
+
}, [$e]), lt = y((e) => {
|
|
3361
|
+
De.current = e, et(e);
|
|
3362
|
+
}, [et]), ut = w(() => oe ? oe({
|
|
3354
3363
|
multiple: h,
|
|
3355
|
-
option:
|
|
3356
|
-
options:
|
|
3357
|
-
value:
|
|
3358
|
-
values:
|
|
3359
|
-
}) : h &&
|
|
3364
|
+
option: Je,
|
|
3365
|
+
options: Ye,
|
|
3366
|
+
value: Ze,
|
|
3367
|
+
values: Le
|
|
3368
|
+
}) : h && Ye.length ? Ye.map((e) => e.label).join(", ") : Je?.label ?? v, [
|
|
3360
3369
|
h,
|
|
3361
3370
|
v,
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
]),
|
|
3368
|
-
...
|
|
3369
|
-
zIndex:
|
|
3370
|
-
}), [
|
|
3371
|
-
id:
|
|
3372
|
-
describedBy:
|
|
3371
|
+
oe,
|
|
3372
|
+
Je,
|
|
3373
|
+
Ye,
|
|
3374
|
+
Le,
|
|
3375
|
+
Ze
|
|
3376
|
+
]), dt = b ?? "No options available", ft = P && Le.length > 0 && !Ce && !N, pt = w(() => ({
|
|
3377
|
+
...Qe,
|
|
3378
|
+
zIndex: st.zIndex
|
|
3379
|
+
}), [st.zIndex, Qe]), mt = w(() => ({
|
|
3380
|
+
id: me,
|
|
3381
|
+
describedBy: Te || void 0,
|
|
3373
3382
|
labelledBy: o ? void 0 : c,
|
|
3374
|
-
isOpen:
|
|
3375
|
-
disabled:
|
|
3376
|
-
required:
|
|
3377
|
-
listboxId:
|
|
3378
|
-
activeIndex:
|
|
3379
|
-
ariaLabel: o ?? (!n && !
|
|
3380
|
-
error:
|
|
3383
|
+
isOpen: Y,
|
|
3384
|
+
disabled: Ce,
|
|
3385
|
+
required: we,
|
|
3386
|
+
listboxId: he,
|
|
3387
|
+
activeIndex: Ve,
|
|
3388
|
+
ariaLabel: o ?? (!n && !J?.labelId ? Je?.label || v : void 0),
|
|
3389
|
+
error: Se,
|
|
3381
3390
|
loading: N,
|
|
3382
|
-
displayText:
|
|
3383
|
-
isPlaceholder: !
|
|
3384
|
-
size:
|
|
3391
|
+
displayText: ut,
|
|
3392
|
+
isPlaceholder: !Xe,
|
|
3393
|
+
size: xe,
|
|
3385
3394
|
color: O,
|
|
3386
3395
|
variant: k,
|
|
3387
|
-
startIcon:
|
|
3396
|
+
startIcon: W,
|
|
3388
3397
|
endIcon: G,
|
|
3389
|
-
prefix:
|
|
3390
|
-
suffix:
|
|
3391
|
-
clearable:
|
|
3392
|
-
className:
|
|
3393
|
-
buttonRef:
|
|
3394
|
-
onClear:
|
|
3395
|
-
onClick:
|
|
3396
|
-
onKeyDown:
|
|
3397
|
-
onBlur:
|
|
3398
|
-
onFocus:
|
|
3398
|
+
prefix: K,
|
|
3399
|
+
suffix: ae,
|
|
3400
|
+
clearable: ft,
|
|
3401
|
+
className: ue,
|
|
3402
|
+
buttonRef: ct,
|
|
3403
|
+
onClear: rt,
|
|
3404
|
+
onClick: it,
|
|
3405
|
+
onKeyDown: at,
|
|
3406
|
+
onBlur: ce,
|
|
3407
|
+
onFocus: q
|
|
3399
3408
|
}), [
|
|
3400
|
-
|
|
3409
|
+
Ve,
|
|
3401
3410
|
o,
|
|
3402
3411
|
c,
|
|
3403
3412
|
O,
|
|
3404
|
-
|
|
3413
|
+
Te,
|
|
3405
3414
|
G,
|
|
3406
|
-
|
|
3415
|
+
J?.labelId,
|
|
3416
|
+
rt,
|
|
3417
|
+
it,
|
|
3407
3418
|
at,
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3419
|
+
Xe,
|
|
3420
|
+
Ce,
|
|
3421
|
+
Se,
|
|
3422
|
+
Y,
|
|
3412
3423
|
we,
|
|
3413
|
-
Be,
|
|
3414
|
-
Ee,
|
|
3415
3424
|
n,
|
|
3416
|
-
|
|
3425
|
+
he,
|
|
3417
3426
|
N,
|
|
3418
|
-
|
|
3419
|
-
|
|
3427
|
+
ce,
|
|
3428
|
+
q,
|
|
3420
3429
|
v,
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
ft,
|
|
3424
|
-
Xe?.label,
|
|
3430
|
+
K,
|
|
3431
|
+
xe,
|
|
3425
3432
|
ut,
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3433
|
+
Je?.label,
|
|
3434
|
+
ct,
|
|
3435
|
+
ft,
|
|
3436
|
+
W,
|
|
3437
|
+
ae,
|
|
3438
|
+
ue,
|
|
3439
|
+
me,
|
|
3431
3440
|
k
|
|
3432
|
-
]),
|
|
3433
|
-
isOpen:
|
|
3434
|
-
listboxId:
|
|
3435
|
-
labelledById:
|
|
3436
|
-
style:
|
|
3437
|
-
options:
|
|
3438
|
-
entries:
|
|
3441
|
+
]), ht = w(() => ({
|
|
3442
|
+
isOpen: Y,
|
|
3443
|
+
listboxId: he,
|
|
3444
|
+
labelledById: me,
|
|
3445
|
+
style: pt,
|
|
3446
|
+
options: Pe,
|
|
3447
|
+
entries: je || ge ? void 0 : Me,
|
|
3439
3448
|
multiple: h,
|
|
3440
3449
|
color: O,
|
|
3441
3450
|
variant: k,
|
|
3442
|
-
searchable:
|
|
3451
|
+
searchable: je,
|
|
3443
3452
|
command: R,
|
|
3444
3453
|
virtual: I,
|
|
3445
3454
|
portal: H,
|
|
3446
|
-
searchValue:
|
|
3455
|
+
searchValue: ge,
|
|
3447
3456
|
loading: N,
|
|
3448
3457
|
loadingText: C,
|
|
3449
|
-
emptyText:
|
|
3450
|
-
renderOption:
|
|
3451
|
-
selectedValue:
|
|
3452
|
-
selectedValues:
|
|
3453
|
-
activeIndex:
|
|
3454
|
-
visualActiveIndex:
|
|
3455
|
-
className:
|
|
3456
|
-
setDropdownRef:
|
|
3457
|
-
onSelect:
|
|
3458
|
-
onSelectGroup:
|
|
3459
|
-
onMouseEnter:
|
|
3460
|
-
onSearchChange:
|
|
3458
|
+
emptyText: dt,
|
|
3459
|
+
renderOption: se,
|
|
3460
|
+
selectedValue: Ze,
|
|
3461
|
+
selectedValues: Le,
|
|
3462
|
+
activeIndex: Ve,
|
|
3463
|
+
visualActiveIndex: Oe ? Ve : -1,
|
|
3464
|
+
className: de,
|
|
3465
|
+
setDropdownRef: lt,
|
|
3466
|
+
onSelect: tt,
|
|
3467
|
+
onSelectGroup: nt,
|
|
3468
|
+
onMouseEnter: X,
|
|
3469
|
+
onSearchChange: ot
|
|
3461
3470
|
}), [
|
|
3462
|
-
|
|
3471
|
+
Ve,
|
|
3463
3472
|
O,
|
|
3464
3473
|
R,
|
|
3465
|
-
ht,
|
|
3466
|
-
fe,
|
|
3467
3474
|
pt,
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3475
|
+
de,
|
|
3476
|
+
dt,
|
|
3477
|
+
Pe,
|
|
3478
|
+
X,
|
|
3479
|
+
ot,
|
|
3480
|
+
tt,
|
|
3481
|
+
nt,
|
|
3482
|
+
Oe,
|
|
3483
|
+
Y,
|
|
3484
|
+
je,
|
|
3485
|
+
he,
|
|
3477
3486
|
N,
|
|
3478
3487
|
C,
|
|
3479
3488
|
h,
|
|
3480
3489
|
H,
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
ve,
|
|
3484
|
-
q,
|
|
3485
|
-
dt,
|
|
3486
|
-
$e,
|
|
3490
|
+
se,
|
|
3491
|
+
Me,
|
|
3487
3492
|
ge,
|
|
3493
|
+
Le,
|
|
3494
|
+
lt,
|
|
3495
|
+
Ze,
|
|
3496
|
+
me,
|
|
3488
3497
|
k,
|
|
3489
3498
|
I
|
|
3490
|
-
]),
|
|
3491
|
-
triggerProps:
|
|
3492
|
-
contentProps:
|
|
3493
|
-
}), [
|
|
3499
|
+
]), gt = w(() => ({
|
|
3500
|
+
triggerProps: mt,
|
|
3501
|
+
contentProps: ht
|
|
3502
|
+
}), [ht, mt]), _t = w(() => /* @__PURE__ */ f(u, { children: [a && h && Le.length > 0 && /* @__PURE__ */ d(u, { children: Le.map((e) => /* @__PURE__ */ d("input", {
|
|
3494
3503
|
type: "hidden",
|
|
3495
3504
|
name: a,
|
|
3496
3505
|
value: e,
|
|
3497
|
-
disabled:
|
|
3506
|
+
disabled: Ce
|
|
3498
3507
|
}, e)) }), a && !h && /* @__PURE__ */ d("input", {
|
|
3499
3508
|
type: "hidden",
|
|
3500
3509
|
name: a,
|
|
3501
|
-
value:
|
|
3502
|
-
disabled:
|
|
3510
|
+
value: Ze,
|
|
3511
|
+
disabled: Ce
|
|
3503
3512
|
})] }), [
|
|
3504
|
-
|
|
3513
|
+
Ce,
|
|
3505
3514
|
h,
|
|
3506
3515
|
a,
|
|
3507
|
-
|
|
3508
|
-
|
|
3516
|
+
Le,
|
|
3517
|
+
Ze
|
|
3509
3518
|
]);
|
|
3510
3519
|
return {
|
|
3511
3520
|
children: t,
|
|
3512
|
-
className:
|
|
3513
|
-
contentProps:
|
|
3514
|
-
contextValue:
|
|
3521
|
+
className: le,
|
|
3522
|
+
contentProps: ht,
|
|
3523
|
+
contextValue: gt,
|
|
3515
3524
|
description: r,
|
|
3516
3525
|
error: z,
|
|
3517
|
-
hasCompoundLayout: w(() =>
|
|
3518
|
-
hasExternalField: !
|
|
3519
|
-
hiddenInputs:
|
|
3520
|
-
isDisabled:
|
|
3521
|
-
isRequired:
|
|
3526
|
+
hasCompoundLayout: w(() => Fr(t), [t]),
|
|
3527
|
+
hasExternalField: !pe && !!J,
|
|
3528
|
+
hiddenInputs: _t,
|
|
3529
|
+
isDisabled: Ce,
|
|
3530
|
+
isRequired: we,
|
|
3522
3531
|
label: n,
|
|
3523
|
-
|
|
3524
|
-
|
|
3532
|
+
resolvedSize: xe,
|
|
3533
|
+
triggerId: me,
|
|
3534
|
+
triggerProps: mt
|
|
3525
3535
|
};
|
|
3526
3536
|
}
|
|
3527
|
-
function
|
|
3537
|
+
function Hr(e, t) {
|
|
3528
3538
|
return e.altKey || e.ctrlKey || e.metaKey ? !1 : t ? e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" || e.key === "Enter" || e.key === " " || e.key.length === 1 : e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === " ";
|
|
3529
3539
|
}
|
|
3530
3540
|
//#endregion
|
|
3531
3541
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
3532
|
-
var
|
|
3533
|
-
let { children: t, className: n, contentProps: r, contextValue: i, description: a, error: o, hasCompoundLayout: s, hasExternalField: c, hiddenInputs: l, isDisabled: p, isRequired: m, label: h,
|
|
3542
|
+
var Ur = (e) => {
|
|
3543
|
+
let { children: t, className: n, contentProps: r, contextValue: i, description: a, error: o, hasCompoundLayout: s, hasExternalField: c, hiddenInputs: l, isDisabled: p, isRequired: m, label: h, resolvedSize: g, triggerId: _, triggerProps: v } = Vr(e), y = w(() => /* @__PURE__ */ f($n, {
|
|
3534
3544
|
value: i,
|
|
3535
|
-
children: [l, s ? t : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
3545
|
+
children: [l, s ? t : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(Mr, {}), /* @__PURE__ */ d(cr, { children: t })] })]
|
|
3536
3546
|
}), [
|
|
3537
3547
|
t,
|
|
3538
3548
|
i,
|
|
3539
3549
|
s,
|
|
3540
3550
|
l
|
|
3541
|
-
]),
|
|
3551
|
+
]), b = w(() => /* @__PURE__ */ f($n, {
|
|
3542
3552
|
value: i,
|
|
3543
3553
|
children: [
|
|
3544
3554
|
l,
|
|
3545
|
-
/* @__PURE__ */ d(
|
|
3555
|
+
/* @__PURE__ */ d(Nr, { ...v }),
|
|
3546
3556
|
/* @__PURE__ */ d(lr, { ...r })
|
|
3547
3557
|
]
|
|
3548
3558
|
}), [
|
|
3549
3559
|
r,
|
|
3550
3560
|
i,
|
|
3551
3561
|
l,
|
|
3552
|
-
|
|
3562
|
+
v
|
|
3553
3563
|
]);
|
|
3554
|
-
return c ? t ?
|
|
3555
|
-
id:
|
|
3564
|
+
return c ? t ? y : b : /* @__PURE__ */ d(jr, {
|
|
3565
|
+
id: _,
|
|
3556
3566
|
label: h,
|
|
3557
3567
|
description: a,
|
|
3558
3568
|
error: o,
|
|
3559
3569
|
required: m,
|
|
3560
3570
|
disabled: p,
|
|
3561
3571
|
bindControl: !1,
|
|
3572
|
+
size: g,
|
|
3562
3573
|
className: n,
|
|
3563
|
-
children: t ?
|
|
3574
|
+
children: t ? y : b
|
|
3564
3575
|
});
|
|
3565
3576
|
};
|
|
3566
|
-
|
|
3577
|
+
Ur.displayName = "SelectRoot";
|
|
3567
3578
|
//#endregion
|
|
3568
3579
|
//#region src/components/Select/Search/SelectSearch.tsx
|
|
3569
|
-
var
|
|
3570
|
-
let { contentProps: n } =
|
|
3580
|
+
var Wr = ({ placeholder: e, className: t }) => {
|
|
3581
|
+
let { contentProps: n } = er(), r = T(null), i = n.searchValue ?? "";
|
|
3571
3582
|
return x(() => {
|
|
3572
3583
|
if (!n.isOpen) return;
|
|
3573
3584
|
let e = window.setTimeout(() => {
|
|
@@ -3575,10 +3586,10 @@ var Ur = ({ placeholder: e, className: t }) => {
|
|
|
3575
3586
|
}, 0);
|
|
3576
3587
|
return () => window.clearTimeout(e);
|
|
3577
3588
|
}, [n.isOpen]), /* @__PURE__ */ f("div", {
|
|
3578
|
-
className:
|
|
3589
|
+
className: sr.searchWrap,
|
|
3579
3590
|
children: [/* @__PURE__ */ d("input", {
|
|
3580
3591
|
ref: r,
|
|
3581
|
-
className: U(
|
|
3592
|
+
className: U(sr.search, t),
|
|
3582
3593
|
value: i,
|
|
3583
3594
|
placeholder: e ?? (n.command ? "Type a command..." : "Search..."),
|
|
3584
3595
|
"aria-label": "Search options",
|
|
@@ -3586,64 +3597,64 @@ var Ur = ({ placeholder: e, className: t }) => {
|
|
|
3586
3597
|
onChange: (e) => n.onSearchChange?.(e.target.value)
|
|
3587
3598
|
}), i && /* @__PURE__ */ d("button", {
|
|
3588
3599
|
type: "button",
|
|
3589
|
-
className:
|
|
3600
|
+
className: sr.searchClear,
|
|
3590
3601
|
"aria-label": "Clear search",
|
|
3591
3602
|
onClick: () => {
|
|
3592
3603
|
n.onSearchChange?.(""), r.current?.focus();
|
|
3593
3604
|
},
|
|
3594
|
-
children: /* @__PURE__ */ d(
|
|
3605
|
+
children: /* @__PURE__ */ d(ne, {})
|
|
3595
3606
|
})]
|
|
3596
3607
|
});
|
|
3597
3608
|
};
|
|
3598
|
-
|
|
3609
|
+
nr(Wr, "search"), Wr.displayName = "Select.Search";
|
|
3599
3610
|
//#endregion
|
|
3600
3611
|
//#region src/components/Select/Separator/SelectSeparator.tsx
|
|
3601
|
-
var
|
|
3602
|
-
|
|
3612
|
+
var Gr = () => null;
|
|
3613
|
+
nr(Gr, "separator"), Gr.displayName = "Select.Separator";
|
|
3603
3614
|
//#endregion
|
|
3604
3615
|
//#region src/components/Select/Value/SelectValue.tsx
|
|
3605
|
-
var
|
|
3606
|
-
let { triggerProps: n } =
|
|
3616
|
+
var Kr = ({ children: e, className: t }) => {
|
|
3617
|
+
let { triggerProps: n } = er();
|
|
3607
3618
|
return /* @__PURE__ */ d("span", {
|
|
3608
|
-
className: U(
|
|
3619
|
+
className: U(Z.valueWrap, t),
|
|
3609
3620
|
children: /* @__PURE__ */ d("span", {
|
|
3610
|
-
className: U(
|
|
3621
|
+
className: U(Z.value, { [Z.placeholder]: n.isPlaceholder }),
|
|
3611
3622
|
children: e ?? n.displayText
|
|
3612
3623
|
})
|
|
3613
3624
|
});
|
|
3614
3625
|
};
|
|
3615
|
-
|
|
3626
|
+
nr(Kr, "value"), Kr.displayName = "Select.Value";
|
|
3616
3627
|
//#endregion
|
|
3617
3628
|
//#region src/components/Select/Select.tsx
|
|
3618
|
-
var
|
|
3619
|
-
Trigger:
|
|
3620
|
-
Value:
|
|
3629
|
+
var qr = Object.assign(Ur, {
|
|
3630
|
+
Trigger: Mr,
|
|
3631
|
+
Value: Kr,
|
|
3621
3632
|
Icon: mr,
|
|
3622
3633
|
Content: cr,
|
|
3623
|
-
Search:
|
|
3634
|
+
Search: Wr,
|
|
3624
3635
|
Group: pr,
|
|
3625
3636
|
Label: vr,
|
|
3626
|
-
Item:
|
|
3637
|
+
Item: ar,
|
|
3627
3638
|
ItemIcon: _r,
|
|
3628
3639
|
ItemDescription: gr,
|
|
3629
3640
|
ItemBadge: hr,
|
|
3630
|
-
Separator:
|
|
3641
|
+
Separator: Gr,
|
|
3631
3642
|
Empty: fr,
|
|
3632
3643
|
Loading: yr
|
|
3633
3644
|
});
|
|
3634
|
-
|
|
3645
|
+
qr.displayName = "Select";
|
|
3635
3646
|
//#endregion
|
|
3636
3647
|
//#region src/components/Tabs/internal/TabsContext.tsx
|
|
3637
|
-
var
|
|
3638
|
-
let e = b(
|
|
3648
|
+
var Jr = g(null), Yr = () => {
|
|
3649
|
+
let e = b(Jr);
|
|
3639
3650
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
3640
3651
|
return e;
|
|
3641
|
-
},
|
|
3652
|
+
}, Xr = {
|
|
3642
3653
|
panel: "_panel_1v1a9_1",
|
|
3643
3654
|
visible: "_visible_1v1a9_10",
|
|
3644
3655
|
vertical: "_vertical_1v1a9_14"
|
|
3645
|
-
},
|
|
3646
|
-
let { value: a, orientation: o, keepMounted: s, lazyMount: c, registerContent: l, getTriggerId: u, getContentId: f } =
|
|
3656
|
+
}, Zr = ({ value: e, children: t, className: n, forceMount: r = !1, ...i }) => {
|
|
3657
|
+
let { value: a, orientation: o, keepMounted: s, lazyMount: c, registerContent: l, getTriggerId: u, getContentId: f } = Yr(), p = a === e, [m, h] = E(p);
|
|
3647
3658
|
return x(() => (l(e, !0), () => {
|
|
3648
3659
|
l(e, !1);
|
|
3649
3660
|
}), [l, e]), x(() => {
|
|
@@ -3657,15 +3668,15 @@ var qr = g(null), Jr = () => {
|
|
|
3657
3668
|
tabIndex: 0,
|
|
3658
3669
|
"data-state": p ? "active" : "inactive",
|
|
3659
3670
|
"data-orientation": o,
|
|
3660
|
-
className: U(
|
|
3671
|
+
className: U(Xr.panel, p && Xr.visible, o === "vertical" && Xr.vertical, n),
|
|
3661
3672
|
children: t
|
|
3662
3673
|
}) : null;
|
|
3663
3674
|
};
|
|
3664
|
-
|
|
3675
|
+
Zr.displayName = "Tabs.Content";
|
|
3665
3676
|
//#endregion
|
|
3666
3677
|
//#region src/components/Tabs/internal/useTabsIndicator.ts
|
|
3667
|
-
var
|
|
3668
|
-
let e = T(null), t = T(null), n = T(void 0), r = T(null), [i, a] = E({}), { value: o, orientation: s, variant: c, collectionVersion: l, getTriggerId: u } =
|
|
3678
|
+
var Qr = 8, $r = 360, ei = () => {
|
|
3679
|
+
let e = T(null), t = T(null), n = T(void 0), r = T(null), [i, a] = E({}), { value: o, orientation: s, variant: c, collectionVersion: l, getTriggerId: u } = Yr();
|
|
3669
3680
|
return x(() => () => {
|
|
3670
3681
|
r.current?.cancel();
|
|
3671
3682
|
}, []), C(() => {
|
|
@@ -3701,7 +3712,7 @@ var Zr = 8, Qr = 360, $r = () => {
|
|
|
3701
3712
|
let s = t.current;
|
|
3702
3713
|
if (e && c === "line" && s && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
3703
3714
|
r.current?.cancel();
|
|
3704
|
-
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e -
|
|
3715
|
+
let e = s.y + s.height / 2, t = p.y + p.height / 2, n = e - Qr / 2, a = t - Qr / 2;
|
|
3705
3716
|
r.current = i.animate([
|
|
3706
3717
|
{
|
|
3707
3718
|
height: `${s.height}px`,
|
|
@@ -3709,12 +3720,12 @@ var Zr = 8, Qr = 360, $r = () => {
|
|
|
3709
3720
|
offset: 0
|
|
3710
3721
|
},
|
|
3711
3722
|
{
|
|
3712
|
-
height: `${
|
|
3723
|
+
height: `${Qr}px`,
|
|
3713
3724
|
transform: `translate3d(0, ${n}px, 0)`,
|
|
3714
3725
|
offset: .28
|
|
3715
3726
|
},
|
|
3716
3727
|
{
|
|
3717
|
-
height: `${
|
|
3728
|
+
height: `${Qr}px`,
|
|
3718
3729
|
transform: `translate3d(0, ${a}px, 0)`,
|
|
3719
3730
|
offset: .64
|
|
3720
3731
|
},
|
|
@@ -3724,7 +3735,7 @@ var Zr = 8, Qr = 360, $r = () => {
|
|
|
3724
3735
|
offset: 1
|
|
3725
3736
|
}
|
|
3726
3737
|
], {
|
|
3727
|
-
duration:
|
|
3738
|
+
duration: $r,
|
|
3728
3739
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
3729
3740
|
fill: "none"
|
|
3730
3741
|
});
|
|
@@ -3740,7 +3751,7 @@ var Zr = 8, Qr = 360, $r = () => {
|
|
|
3740
3751
|
let h = t.current;
|
|
3741
3752
|
if (e && c === "line" && h && n.current !== o && !(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && typeof i.animate == "function") {
|
|
3742
3753
|
r.current?.cancel();
|
|
3743
|
-
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e -
|
|
3754
|
+
let e = h.x + h.width / 2, t = p.x + p.width / 2, n = e - Qr / 2, a = t - Qr / 2;
|
|
3744
3755
|
r.current = i.animate([
|
|
3745
3756
|
{
|
|
3746
3757
|
width: `${h.width}px`,
|
|
@@ -3748,12 +3759,12 @@ var Zr = 8, Qr = 360, $r = () => {
|
|
|
3748
3759
|
offset: 0
|
|
3749
3760
|
},
|
|
3750
3761
|
{
|
|
3751
|
-
width: `${
|
|
3762
|
+
width: `${Qr}px`,
|
|
3752
3763
|
transform: `translate3d(${n}px, 0, 0)`,
|
|
3753
3764
|
offset: .28
|
|
3754
3765
|
},
|
|
3755
3766
|
{
|
|
3756
|
-
width: `${
|
|
3767
|
+
width: `${Qr}px`,
|
|
3757
3768
|
transform: `translate3d(${a}px, 0, 0)`,
|
|
3758
3769
|
offset: .64
|
|
3759
3770
|
},
|
|
@@ -3763,7 +3774,7 @@ var Zr = 8, Qr = 360, $r = () => {
|
|
|
3763
3774
|
offset: 1
|
|
3764
3775
|
}
|
|
3765
3776
|
], {
|
|
3766
|
-
duration:
|
|
3777
|
+
duration: $r,
|
|
3767
3778
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
3768
3779
|
fill: "none"
|
|
3769
3780
|
});
|
|
@@ -3791,7 +3802,7 @@ var Zr = 8, Qr = 360, $r = () => {
|
|
|
3791
3802
|
ref: e,
|
|
3792
3803
|
style: i
|
|
3793
3804
|
}), [i]);
|
|
3794
|
-
},
|
|
3805
|
+
}, ti = {
|
|
3795
3806
|
list: "_list_j3cp3_1",
|
|
3796
3807
|
vertical: "_vertical_j3cp3_10",
|
|
3797
3808
|
line: "_line_j3cp3_17",
|
|
@@ -3799,24 +3810,24 @@ var Zr = 8, Qr = 360, $r = () => {
|
|
|
3799
3810
|
segmented: "_segmented_j3cp3_29",
|
|
3800
3811
|
scrollable: "_scrollable_j3cp3_37",
|
|
3801
3812
|
indicator: "_indicator_j3cp3_46"
|
|
3802
|
-
},
|
|
3803
|
-
let { ref: r, style: i } =
|
|
3813
|
+
}, ni = ({ className: e, style: t, ...n }) => {
|
|
3814
|
+
let { ref: r, style: i } = ei();
|
|
3804
3815
|
return /* @__PURE__ */ d("span", {
|
|
3805
3816
|
...n,
|
|
3806
3817
|
ref: r,
|
|
3807
3818
|
"aria-hidden": "true",
|
|
3808
|
-
className: U(
|
|
3819
|
+
className: U(ti.indicator, e),
|
|
3809
3820
|
style: {
|
|
3810
3821
|
...i,
|
|
3811
3822
|
...t
|
|
3812
3823
|
}
|
|
3813
3824
|
});
|
|
3814
3825
|
};
|
|
3815
|
-
|
|
3826
|
+
ni.displayName = "Tabs.Indicator";
|
|
3816
3827
|
//#endregion
|
|
3817
3828
|
//#region src/components/Tabs/List/TabsList.tsx
|
|
3818
|
-
var
|
|
3819
|
-
let { orientation: i, variant: a } =
|
|
3829
|
+
var ri = ({ children: e, className: t, scrollable: n, ...r }) => {
|
|
3830
|
+
let { orientation: i, variant: a } = Yr(), o = n ?? !1;
|
|
3820
3831
|
return /* @__PURE__ */ d("div", {
|
|
3821
3832
|
...r,
|
|
3822
3833
|
role: "tablist",
|
|
@@ -3824,18 +3835,18 @@ var ni = ({ children: e, className: t, scrollable: n, ...r }) => {
|
|
|
3824
3835
|
"data-orientation": i,
|
|
3825
3836
|
"data-variant": a,
|
|
3826
3837
|
"data-scrollable": o ? "" : void 0,
|
|
3827
|
-
className: U(
|
|
3838
|
+
className: U(ti.list, i === "vertical" && ti.vertical, a === "line" && ti.line, a === "pills" && ti.pills, a === "segmented" && ti.segmented, o && ti.scrollable, t),
|
|
3828
3839
|
children: e
|
|
3829
3840
|
});
|
|
3830
3841
|
};
|
|
3831
|
-
|
|
3842
|
+
ri.displayName = "TabsList";
|
|
3832
3843
|
//#endregion
|
|
3833
3844
|
//#region src/components/Tabs/internal/useTabsCollection.ts
|
|
3834
|
-
var
|
|
3845
|
+
var ii = (e) => [...e].sort((e, t) => {
|
|
3835
3846
|
if (e.element === t.element) return 0;
|
|
3836
3847
|
let n = e.element.compareDocumentPosition(t.element);
|
|
3837
3848
|
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
3838
|
-
}),
|
|
3849
|
+
}), ai = () => {
|
|
3839
3850
|
let e = T([]), t = T([]), [n, r] = E(0), i = y(() => {
|
|
3840
3851
|
r((e) => e + 1);
|
|
3841
3852
|
}, []);
|
|
@@ -3854,7 +3865,7 @@ var ri = (e) => [...e].sort((e, t) => {
|
|
|
3854
3865
|
element: n,
|
|
3855
3866
|
disabled: r
|
|
3856
3867
|
}, o = e.current.findIndex((e) => e.element === n);
|
|
3857
|
-
o >= 0 ? e.current[o] = a : e.current.push(a), e.current =
|
|
3868
|
+
o >= 0 ? e.current[o] = a : e.current.push(a), e.current = ii(e.current), i();
|
|
3858
3869
|
}, [i]),
|
|
3859
3870
|
registerContent: y((e, n) => {
|
|
3860
3871
|
let r = t.current.findIndex((t) => t.value === e);
|
|
@@ -3865,7 +3876,7 @@ var ri = (e) => [...e].sort((e, t) => {
|
|
|
3865
3876
|
r < 0 && (t.current.push({ value: e }), i());
|
|
3866
3877
|
}, [i])
|
|
3867
3878
|
};
|
|
3868
|
-
},
|
|
3879
|
+
}, oi = ({ focusedValue: e, setValue: t, setFocusedValue: n, getTabs: r, orientation: i, activationMode: a, dir: o, loop: s }) => ({ onKeyDown: (c) => {
|
|
3869
3880
|
let l = r().filter((e) => !e.disabled);
|
|
3870
3881
|
if (l.length === 0) return;
|
|
3871
3882
|
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) => {
|
|
@@ -3895,22 +3906,20 @@ var ri = (e) => [...e].sort((e, t) => {
|
|
|
3895
3906
|
p(l.length - 1);
|
|
3896
3907
|
break;
|
|
3897
3908
|
case "Enter":
|
|
3898
|
-
case " ":
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
}
|
|
3903
|
-
break;
|
|
3909
|
+
case " ": if (a === "manual") {
|
|
3910
|
+
let e = l.find((e) => e.element === document.activeElement);
|
|
3911
|
+
e && (c.preventDefault(), n(e.value), t(e.value));
|
|
3912
|
+
}
|
|
3904
3913
|
}
|
|
3905
|
-
} }),
|
|
3914
|
+
} }), si = {
|
|
3906
3915
|
tabs: "_tabs_1hj56_1",
|
|
3907
3916
|
vertical: "_vertical_1hj56_30"
|
|
3908
|
-
},
|
|
3909
|
-
let _ = S(), v = t !== void 0, { value: b, setValue: C } =
|
|
3917
|
+
}, ci = ({ children: e, value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", activationMode: a = "automatic", dir: o = "ltr", loop: s = !0, variant: c = "line", color: l = "primary", size: u = "md", keepMounted: f = !1, lazyMount: p = !1, disabled: m = !1, className: h, ...g }) => {
|
|
3918
|
+
let _ = S(), v = t !== void 0, { value: b, setValue: C } = Ue({
|
|
3910
3919
|
value: t,
|
|
3911
3920
|
defaultValue: n,
|
|
3912
3921
|
onValueChange: r
|
|
3913
|
-
}), w = T(b), D = T(void 0), O = T(void 0), [k, A] = E(b), { version: j, triggersRef: M, contentsRef: N, registerTrigger: P, registerContent: F } =
|
|
3922
|
+
}), w = T(b), D = T(void 0), O = T(void 0), [k, A] = E(b), { version: j, triggersRef: M, contentsRef: N, registerTrigger: P, registerContent: F } = ai(), I = y((e, t, n = !1) => {
|
|
3914
3923
|
if (!t) {
|
|
3915
3924
|
let t = w.current, n = M.current, r = n.findIndex((t) => t.value === e);
|
|
3916
3925
|
if (t === e && r >= 0) {
|
|
@@ -3926,7 +3935,7 @@ var ri = (e) => [...e].sort((e, t) => {
|
|
|
3926
3935
|
A,
|
|
3927
3936
|
C,
|
|
3928
3937
|
M
|
|
3929
|
-
]), { onKeyDown: L } =
|
|
3938
|
+
]), { onKeyDown: L } = oi({
|
|
3930
3939
|
focusedValue: k,
|
|
3931
3940
|
setValue: C,
|
|
3932
3941
|
setFocusedValue: A,
|
|
@@ -3987,11 +3996,11 @@ var ri = (e) => [...e].sort((e, t) => {
|
|
|
3987
3996
|
N,
|
|
3988
3997
|
M,
|
|
3989
3998
|
j
|
|
3990
|
-
]), /* @__PURE__ */ d(
|
|
3999
|
+
]), /* @__PURE__ */ d(Jr.Provider, {
|
|
3991
4000
|
value: R,
|
|
3992
4001
|
children: /* @__PURE__ */ d("div", {
|
|
3993
4002
|
...g,
|
|
3994
|
-
className: U(
|
|
4003
|
+
className: U(si.tabs, i === "vertical" && si.vertical, h),
|
|
3995
4004
|
"data-orientation": i,
|
|
3996
4005
|
dir: o,
|
|
3997
4006
|
"data-variant": c,
|
|
@@ -4002,8 +4011,8 @@ var ri = (e) => [...e].sort((e, t) => {
|
|
|
4002
4011
|
})
|
|
4003
4012
|
});
|
|
4004
4013
|
};
|
|
4005
|
-
|
|
4006
|
-
var
|
|
4014
|
+
ci.displayName = "Tabs";
|
|
4015
|
+
var li = {
|
|
4007
4016
|
trigger: "_trigger_uc2y5_1",
|
|
4008
4017
|
iconOnly: "_iconOnly_uc2y5_49",
|
|
4009
4018
|
icon: "_icon_uc2y5_49",
|
|
@@ -4018,23 +4027,23 @@ var ci = {
|
|
|
4018
4027
|
line: "_line_uc2y5_194",
|
|
4019
4028
|
pills: "_pills_uc2y5_209",
|
|
4020
4029
|
vertical: "_vertical_uc2y5_235"
|
|
4021
|
-
},
|
|
4022
|
-
className: U(
|
|
4030
|
+
}, ui = ({ children: e, className: t }) => /* @__PURE__ */ d("span", {
|
|
4031
|
+
className: U(li.badge, t),
|
|
4023
4032
|
children: e
|
|
4024
4033
|
});
|
|
4025
|
-
|
|
4034
|
+
ui.displayName = "Tabs.Badge";
|
|
4026
4035
|
//#endregion
|
|
4027
4036
|
//#region src/components/Tabs/Trigger/TabsIcon.tsx
|
|
4028
|
-
var
|
|
4029
|
-
className: U(
|
|
4037
|
+
var di = ({ children: e, className: t }) => /* @__PURE__ */ d("span", {
|
|
4038
|
+
className: U(li.icon, t),
|
|
4030
4039
|
"aria-hidden": "true",
|
|
4031
4040
|
children: e
|
|
4032
4041
|
});
|
|
4033
|
-
|
|
4042
|
+
di.displayName = "Tabs.Icon";
|
|
4034
4043
|
//#endregion
|
|
4035
4044
|
//#region src/components/Tabs/Trigger/TabsTrigger.tsx
|
|
4036
|
-
var
|
|
4037
|
-
let { value: m, focusedValue: h, setValue: g, setFocusedValue: _, orientation: b, variant: x, size: S, disabled: C, registerTrigger: w, onTriggerKeyDown: T, getTriggerId: E, getContentId: D } =
|
|
4045
|
+
var fi = _(({ value: e, children: t, className: n, disabled: r = !1, icon: i, badge: a, description: o, onClick: s, onKeyDown: c, ...l }, u) => {
|
|
4046
|
+
let { value: m, focusedValue: h, setValue: g, setFocusedValue: _, orientation: b, variant: x, size: S, disabled: C, registerTrigger: w, onTriggerKeyDown: T, getTriggerId: E, getContentId: D } = Yr(), O = C || r, k = m === e, A = h === e || !h && k, j = p.toArray(t), M = j.some((e) => v(e) && e.type.displayName === "Tabs.Icon"), N = !!i, P = (N || M) && t == null;
|
|
4038
4047
|
process.env.NODE_ENV !== "production" && N && M && console.warn(`Tabs.Trigger value "${e}" received both icon and Tabs.Icon. Tabs.Icon takes precedence.`);
|
|
4039
4048
|
let F = y((t) => {
|
|
4040
4049
|
w(e, t, O), typeof u == "function" ? u(t) : u && (u.current = t);
|
|
@@ -4057,7 +4066,7 @@ var di = _(({ value: e, children: t, className: n, disabled: r = !1, icon: i, ba
|
|
|
4057
4066
|
"data-state": k ? "active" : "inactive",
|
|
4058
4067
|
"data-orientation": b,
|
|
4059
4068
|
"data-disabled": O ? "" : void 0,
|
|
4060
|
-
className: U(
|
|
4069
|
+
className: U(li.trigger, li[x], li[S], b === "vertical" && li.vertical, N && li.withIcon, P && li.iconOnly, n),
|
|
4061
4070
|
onClick: (t) => {
|
|
4062
4071
|
s?.(t), !(t.defaultPrevented || O) && (_(e), g(e));
|
|
4063
4072
|
},
|
|
@@ -4066,50 +4075,50 @@ var di = _(({ value: e, children: t, className: n, disabled: r = !1, icon: i, ba
|
|
|
4066
4075
|
},
|
|
4067
4076
|
children: [
|
|
4068
4077
|
N && !M && /* @__PURE__ */ d("span", {
|
|
4069
|
-
className:
|
|
4078
|
+
className: li.icon,
|
|
4070
4079
|
"aria-hidden": "true",
|
|
4071
4080
|
children: i
|
|
4072
4081
|
}),
|
|
4073
4082
|
t != null && (I ? /* @__PURE__ */ f("span", {
|
|
4074
|
-
className:
|
|
4083
|
+
className: li.body,
|
|
4075
4084
|
children: [/* @__PURE__ */ d("span", {
|
|
4076
|
-
className:
|
|
4085
|
+
className: li.label,
|
|
4077
4086
|
children: t
|
|
4078
4087
|
}), o != null && /* @__PURE__ */ d("span", {
|
|
4079
|
-
className:
|
|
4088
|
+
className: li.description,
|
|
4080
4089
|
children: o
|
|
4081
4090
|
})]
|
|
4082
4091
|
}) : L ? /* @__PURE__ */ d("span", {
|
|
4083
|
-
className:
|
|
4092
|
+
className: li.label,
|
|
4084
4093
|
children: t
|
|
4085
4094
|
}) : t),
|
|
4086
4095
|
a != null && /* @__PURE__ */ d("span", {
|
|
4087
|
-
className:
|
|
4096
|
+
className: li.badge,
|
|
4088
4097
|
children: a
|
|
4089
4098
|
})
|
|
4090
4099
|
]
|
|
4091
4100
|
});
|
|
4092
4101
|
});
|
|
4093
|
-
|
|
4102
|
+
fi.displayName = "Tabs.Trigger";
|
|
4094
4103
|
//#endregion
|
|
4095
4104
|
//#region src/components/Tabs/Tabs.tsx
|
|
4096
|
-
var
|
|
4097
|
-
List:
|
|
4098
|
-
Trigger:
|
|
4099
|
-
Content:
|
|
4100
|
-
Indicator:
|
|
4101
|
-
Icon:
|
|
4102
|
-
Badge:
|
|
4105
|
+
var pi = Object.assign(ci, {
|
|
4106
|
+
List: ri,
|
|
4107
|
+
Trigger: fi,
|
|
4108
|
+
Content: Zr,
|
|
4109
|
+
Indicator: ni,
|
|
4110
|
+
Icon: di,
|
|
4111
|
+
Badge: ui
|
|
4103
4112
|
});
|
|
4104
|
-
|
|
4113
|
+
pi.displayName = "Tabs";
|
|
4105
4114
|
//#endregion
|
|
4106
4115
|
//#region src/components/Tooltip/internal/composeEventHandlers.ts
|
|
4107
|
-
function
|
|
4116
|
+
function mi(e, t) {
|
|
4108
4117
|
return (n) => {
|
|
4109
4118
|
e?.(n), n.defaultPrevented || t?.(n);
|
|
4110
4119
|
};
|
|
4111
4120
|
}
|
|
4112
|
-
function
|
|
4121
|
+
function hi(...e) {
|
|
4113
4122
|
return (t) => {
|
|
4114
4123
|
e.forEach((e) => {
|
|
4115
4124
|
if (e) {
|
|
@@ -4124,18 +4133,18 @@ function mi(...e) {
|
|
|
4124
4133
|
}
|
|
4125
4134
|
//#endregion
|
|
4126
4135
|
//#region src/components/Tooltip/internal/TooltipContext.tsx
|
|
4127
|
-
var
|
|
4136
|
+
var gi = g(null), _i = g({
|
|
4128
4137
|
delay: {
|
|
4129
4138
|
open: 300,
|
|
4130
4139
|
close: 100
|
|
4131
4140
|
},
|
|
4132
4141
|
skipDelay: 300
|
|
4133
|
-
}),
|
|
4142
|
+
}), vi = gi.Provider, yi = ({ children: e, delay: t = 700, skipDelay: n = 300 }) => {
|
|
4134
4143
|
let r = typeof t == "number" ? {
|
|
4135
4144
|
open: t,
|
|
4136
4145
|
close: 100
|
|
4137
4146
|
} : t;
|
|
4138
|
-
return /* @__PURE__ */ d(
|
|
4147
|
+
return /* @__PURE__ */ d(_i.Provider, {
|
|
4139
4148
|
value: {
|
|
4140
4149
|
delay: r,
|
|
4141
4150
|
skipDelay: n
|
|
@@ -4143,39 +4152,41 @@ var hi = g(null), gi = g({
|
|
|
4143
4152
|
children: e
|
|
4144
4153
|
});
|
|
4145
4154
|
};
|
|
4146
|
-
function
|
|
4147
|
-
let e = b(
|
|
4155
|
+
function bi() {
|
|
4156
|
+
let e = b(gi);
|
|
4148
4157
|
if (!e) throw Error("Tooltip compound components must be rendered inside Tooltip");
|
|
4149
4158
|
return e;
|
|
4150
4159
|
}
|
|
4151
|
-
function
|
|
4152
|
-
return b(
|
|
4160
|
+
function xi() {
|
|
4161
|
+
return b(_i);
|
|
4153
4162
|
}
|
|
4154
|
-
var
|
|
4163
|
+
var Si = {
|
|
4155
4164
|
tooltip: "_tooltip_raj0t_1",
|
|
4156
4165
|
arrow: "_arrow_raj0t_25"
|
|
4157
|
-
},
|
|
4158
|
-
let s =
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4166
|
+
}, Ci = _(({ children: e, forceMount: t = !1, withArrow: n = !1, className: r, style: i, ...a }, o) => {
|
|
4167
|
+
let s = bi();
|
|
4168
|
+
if (!t && !s.open) return null;
|
|
4169
|
+
let c = s.getContentProps({
|
|
4170
|
+
id: s.contentId,
|
|
4171
|
+
role: "tooltip",
|
|
4172
|
+
...a
|
|
4173
|
+
});
|
|
4174
|
+
return /* @__PURE__ */ f("div", {
|
|
4175
|
+
...c,
|
|
4176
|
+
ref: hi(o, s.setContentRef),
|
|
4177
|
+
className: U(Si.tooltip, r),
|
|
4167
4178
|
"data-placement": s.placement,
|
|
4168
4179
|
"data-state": s.open ? "open" : "closed",
|
|
4169
4180
|
style: {
|
|
4170
4181
|
...s.floatingStyles,
|
|
4171
4182
|
...i
|
|
4172
4183
|
},
|
|
4173
|
-
children: [e, n && /* @__PURE__ */ d(
|
|
4184
|
+
children: [e, n && /* @__PURE__ */ d(wi, {})]
|
|
4174
4185
|
});
|
|
4175
4186
|
});
|
|
4176
|
-
|
|
4177
|
-
function
|
|
4178
|
-
let e =
|
|
4187
|
+
Ci.displayName = "Tooltip.Content";
|
|
4188
|
+
function wi() {
|
|
4189
|
+
let e = bi(), t = {
|
|
4179
4190
|
top: "bottom",
|
|
4180
4191
|
right: "left",
|
|
4181
4192
|
bottom: "top",
|
|
@@ -4183,7 +4194,7 @@ function Ci() {
|
|
|
4183
4194
|
}[e.placement.split("-")[0]];
|
|
4184
4195
|
return /* @__PURE__ */ d("div", {
|
|
4185
4196
|
ref: e.arrowRef,
|
|
4186
|
-
className:
|
|
4197
|
+
className: Si.arrow,
|
|
4187
4198
|
style: {
|
|
4188
4199
|
left: e.arrowX == null ? void 0 : `${e.arrowX}px`,
|
|
4189
4200
|
top: e.arrowY == null ? void 0 : `${e.arrowY}px`,
|
|
@@ -4193,8 +4204,8 @@ function Ci() {
|
|
|
4193
4204
|
}
|
|
4194
4205
|
//#endregion
|
|
4195
4206
|
//#region src/components/Tooltip/internal/useTooltipDelay.ts
|
|
4196
|
-
function
|
|
4197
|
-
let n =
|
|
4207
|
+
function Ti(e, t) {
|
|
4208
|
+
let n = xi();
|
|
4198
4209
|
return e == null ? n.delay : typeof e == "number" ? {
|
|
4199
4210
|
open: e,
|
|
4200
4211
|
close: n.delay.close
|
|
@@ -4205,18 +4216,19 @@ function wi(e, t) {
|
|
|
4205
4216
|
}
|
|
4206
4217
|
//#endregion
|
|
4207
4218
|
//#region src/components/Tooltip/internal/useTooltipInteractions.ts
|
|
4208
|
-
function
|
|
4209
|
-
|
|
4219
|
+
function Ei({ context: e, delay: t, disabled: n, interactive: r }) {
|
|
4220
|
+
let i = R(e, {
|
|
4210
4221
|
delay: t,
|
|
4211
4222
|
enabled: !n,
|
|
4212
4223
|
move: !1,
|
|
4213
4224
|
handleClose: r ? void 0 : null
|
|
4214
|
-
}), L(e, { enabled: !n })
|
|
4225
|
+
}), a = L(e, { enabled: !n });
|
|
4226
|
+
return z([i, a]);
|
|
4215
4227
|
}
|
|
4216
4228
|
//#endregion
|
|
4217
4229
|
//#region src/components/Tooltip/internal/useTooltipPosition.ts
|
|
4218
|
-
function
|
|
4219
|
-
let o = T(null), s =
|
|
4230
|
+
function Di({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions: i, matchTriggerWidth: a }) {
|
|
4231
|
+
let o = T(null), s = je({
|
|
4220
4232
|
open: e,
|
|
4221
4233
|
onOpenChange: t,
|
|
4222
4234
|
placement: n,
|
|
@@ -4234,26 +4246,26 @@ function Ei({ open: e, onOpenChange: t, placement: n, offset: r, avoidCollisions
|
|
|
4234
4246
|
}
|
|
4235
4247
|
//#endregion
|
|
4236
4248
|
//#region src/components/Tooltip/Root/TooltipRoot.tsx
|
|
4237
|
-
var
|
|
4238
|
-
let m = `${S()}-content`, h = T(null), g = T(null), [_, v] =
|
|
4249
|
+
var Oi = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, placement: i = "top", offset: a = 8, delay: o, skipDelay: s, disabled: c = !1, interactive: l = !1, avoidCollisions: u = !0, matchTriggerWidth: f = !1, modal: p = !1 }) => {
|
|
4250
|
+
let m = `${S()}-content`, h = T(null), g = T(null), [_, v] = Y({
|
|
4239
4251
|
value: t,
|
|
4240
4252
|
defaultValue: n,
|
|
4241
4253
|
onChange: r
|
|
4242
4254
|
}), y = (e) => {
|
|
4243
4255
|
c || v(e);
|
|
4244
|
-
}, b =
|
|
4256
|
+
}, b = Di({
|
|
4245
4257
|
open: _,
|
|
4246
4258
|
onOpenChange: y,
|
|
4247
4259
|
placement: i,
|
|
4248
4260
|
offset: a,
|
|
4249
4261
|
avoidCollisions: u,
|
|
4250
4262
|
matchTriggerWidth: f
|
|
4251
|
-
}), x =
|
|
4263
|
+
}), x = Ti(o, s), C = Ei({
|
|
4252
4264
|
context: b.context,
|
|
4253
4265
|
delay: x,
|
|
4254
4266
|
disabled: c,
|
|
4255
4267
|
interactive: l
|
|
4256
|
-
}), w =
|
|
4268
|
+
}), w = Ae({
|
|
4257
4269
|
active: _,
|
|
4258
4270
|
id: m,
|
|
4259
4271
|
zIndexLevel: "tooltip",
|
|
@@ -4263,7 +4275,7 @@ var Di = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, placemen
|
|
|
4263
4275
|
closeOnOutsidePress: !l,
|
|
4264
4276
|
requestClose: () => y(!1)
|
|
4265
4277
|
});
|
|
4266
|
-
return /* @__PURE__ */ d(
|
|
4278
|
+
return /* @__PURE__ */ d(vi, {
|
|
4267
4279
|
value: {
|
|
4268
4280
|
contentId: m,
|
|
4269
4281
|
open: _,
|
|
@@ -4279,34 +4291,34 @@ var Di = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, placemen
|
|
|
4279
4291
|
zIndex: w.zIndex
|
|
4280
4292
|
},
|
|
4281
4293
|
setOpen: y,
|
|
4282
|
-
setTriggerRef:
|
|
4283
|
-
setContentRef:
|
|
4294
|
+
setTriggerRef: hi(g, b.setRef),
|
|
4295
|
+
setContentRef: hi(h, b.setFloatingRef),
|
|
4284
4296
|
getTriggerProps: C.getReferenceProps,
|
|
4285
4297
|
getContentProps: C.getFloatingProps
|
|
4286
4298
|
},
|
|
4287
4299
|
children: e
|
|
4288
4300
|
});
|
|
4289
4301
|
};
|
|
4290
|
-
|
|
4302
|
+
Oi.displayName = "Tooltip.Root";
|
|
4291
4303
|
//#endregion
|
|
4292
4304
|
//#region src/components/Tooltip/Trigger/TooltipTrigger.tsx
|
|
4293
|
-
var
|
|
4294
|
-
let a =
|
|
4305
|
+
var ki = ({ asChild: e = !1, children: t, disabled: n = !1, className: r, ...i }) => {
|
|
4306
|
+
let a = bi(), o = e && v(t) ? t : void 0, s = a.disabled || n || o?.props.disabled, c = a.getTriggerProps({
|
|
4295
4307
|
...i,
|
|
4296
4308
|
"aria-describedby": a.open ? a.contentId : void 0,
|
|
4297
4309
|
"aria-disabled": s || void 0,
|
|
4298
4310
|
"data-state": a.open ? "open" : "closed"
|
|
4299
4311
|
}), l = {
|
|
4300
4312
|
...c,
|
|
4301
|
-
ref: o ?
|
|
4313
|
+
ref: o ? hi(o.props.ref, a.setTriggerRef) : a.setTriggerRef,
|
|
4302
4314
|
className: U(o?.props.className, r),
|
|
4303
4315
|
disabled: s || void 0,
|
|
4304
|
-
onMouseEnter:
|
|
4305
|
-
onMouseLeave:
|
|
4306
|
-
onPointerEnter:
|
|
4307
|
-
onPointerLeave:
|
|
4308
|
-
onFocus:
|
|
4309
|
-
onBlur:
|
|
4316
|
+
onMouseEnter: mi(o?.props.onMouseEnter, c.onMouseEnter),
|
|
4317
|
+
onMouseLeave: mi(o?.props.onMouseLeave, c.onMouseLeave),
|
|
4318
|
+
onPointerEnter: mi(o?.props.onPointerEnter, c.onPointerEnter),
|
|
4319
|
+
onPointerLeave: mi(o?.props.onPointerLeave, c.onPointerLeave),
|
|
4320
|
+
onFocus: mi(o?.props.onFocus, c.onFocus),
|
|
4321
|
+
onBlur: mi(o?.props.onBlur, c.onBlur)
|
|
4310
4322
|
};
|
|
4311
4323
|
return o ? h(o, l) : /* @__PURE__ */ d("button", {
|
|
4312
4324
|
type: "button",
|
|
@@ -4314,200 +4326,218 @@ var Oi = ({ asChild: e = !1, children: t, disabled: n = !1, className: r, ...i }
|
|
|
4314
4326
|
children: t
|
|
4315
4327
|
});
|
|
4316
4328
|
};
|
|
4317
|
-
|
|
4329
|
+
ki.displayName = "Tooltip.Trigger";
|
|
4318
4330
|
//#endregion
|
|
4319
4331
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
4320
|
-
var
|
|
4321
|
-
Trigger:
|
|
4322
|
-
Content:
|
|
4323
|
-
Provider:
|
|
4332
|
+
var Ai = Object.assign(Oi, {
|
|
4333
|
+
Trigger: ki,
|
|
4334
|
+
Content: Ci,
|
|
4335
|
+
Provider: yi
|
|
4324
4336
|
});
|
|
4325
|
-
|
|
4326
|
-
var
|
|
4327
|
-
button: "
|
|
4328
|
-
solid: "
|
|
4329
|
-
primary: "
|
|
4330
|
-
loading: "
|
|
4331
|
-
neutral: "
|
|
4332
|
-
success: "
|
|
4333
|
-
warning: "
|
|
4334
|
-
danger: "
|
|
4335
|
-
outline: "
|
|
4336
|
-
ghost: "
|
|
4337
|
-
soft: "
|
|
4338
|
-
link: "
|
|
4339
|
-
square: "
|
|
4340
|
-
rounded: "
|
|
4341
|
-
pill: "
|
|
4342
|
-
sm: "
|
|
4343
|
-
md: "
|
|
4344
|
-
lg: "
|
|
4345
|
-
fullWidth: "
|
|
4346
|
-
iconOnly: "
|
|
4347
|
-
label: "
|
|
4348
|
-
labelText: "
|
|
4349
|
-
icon: "
|
|
4350
|
-
spinner: "
|
|
4351
|
-
"button-spin": "_button-
|
|
4352
|
-
badge: "
|
|
4353
|
-
shortcut: "
|
|
4354
|
-
},
|
|
4355
|
-
let
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4337
|
+
Ai.displayName = "Tooltip";
|
|
4338
|
+
var ji = {
|
|
4339
|
+
button: "_button_tqwey_1",
|
|
4340
|
+
solid: "_solid_tqwey_26",
|
|
4341
|
+
primary: "_primary_tqwey_26",
|
|
4342
|
+
loading: "_loading_tqwey_26",
|
|
4343
|
+
neutral: "_neutral_tqwey_52",
|
|
4344
|
+
success: "_success_tqwey_78",
|
|
4345
|
+
warning: "_warning_tqwey_104",
|
|
4346
|
+
danger: "_danger_tqwey_130",
|
|
4347
|
+
outline: "_outline_tqwey_156",
|
|
4348
|
+
ghost: "_ghost_tqwey_286",
|
|
4349
|
+
soft: "_soft_tqwey_416",
|
|
4350
|
+
link: "_link_tqwey_546",
|
|
4351
|
+
square: "_square_tqwey_714",
|
|
4352
|
+
rounded: "_rounded_tqwey_718",
|
|
4353
|
+
pill: "_pill_tqwey_722",
|
|
4354
|
+
sm: "_sm_tqwey_726",
|
|
4355
|
+
md: "_md_tqwey_730",
|
|
4356
|
+
lg: "_lg_tqwey_734",
|
|
4357
|
+
fullWidth: "_fullWidth_tqwey_738",
|
|
4358
|
+
iconOnly: "_iconOnly_tqwey_742",
|
|
4359
|
+
label: "_label_tqwey_748",
|
|
4360
|
+
labelText: "_labelText_tqwey_758",
|
|
4361
|
+
icon: "_icon_tqwey_742",
|
|
4362
|
+
spinner: "_spinner_tqwey_777",
|
|
4363
|
+
"button-spin": "_button-spin_tqwey_1",
|
|
4364
|
+
badge: "_badge_tqwey_799",
|
|
4365
|
+
shortcut: "_shortcut_tqwey_813"
|
|
4366
|
+
}, Mi = _(({ children: e, color: t = "primary", appearance: n = "solid", size: r = "md", shape: i = "pill", type: a = "button", disabled: o = !1, loading: s = !1, loadingText: c, iconStart: l, iconEnd: p, spinner: m, badge: g, shortcut: _, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, style: w, onClick: T, "aria-label": E, "aria-labelledby": D, href: O, target: k, rel: A, download: j, id: M, role: N, tabIndex: P, ...F }, I) => {
|
|
4367
|
+
let L = S && v(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(l || p), ee = !!(E || D || L?.props["aria-label"] || L?.props["aria-labelledby"]), V = o || s, H = B[r], te = {
|
|
4368
|
+
"--button-height": `${H.height}px`,
|
|
4369
|
+
"--button-font-size": `${H.fontSize}px`,
|
|
4370
|
+
"--button-line-height": `${H.lineHeight}px`,
|
|
4371
|
+
"--icon-size": `${H.iconSize}px`
|
|
4372
|
+
}, ne = s && c ? c : R, re = c && R && !z && (typeof R == "string" || typeof R == "number") && (typeof c == "string" || typeof c == "number") ? String(s ? R : c) : void 0, ie = k === "_blank" && !A ? "noreferrer noopener" : A, W = U(ji.button, ji[t], ji[n], ji[r], ji[i], C, {
|
|
4373
|
+
[ji.disabled]: V,
|
|
4374
|
+
[ji.loading]: s,
|
|
4375
|
+
[ji.fullWidth]: b,
|
|
4376
|
+
[ji.iconOnly]: z
|
|
4360
4377
|
});
|
|
4361
|
-
|
|
4362
|
-
let
|
|
4378
|
+
at(!S || !O, "Button: pass href to the child element when using asChild."), at(!S || !!L, "Button: asChild requires a single valid React element child."), at(!z || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
4379
|
+
let G = (e) => {
|
|
4363
4380
|
e.preventDefault(), e.stopPropagation();
|
|
4364
|
-
},
|
|
4365
|
-
if (
|
|
4366
|
-
|
|
4381
|
+
}, K = (e) => {
|
|
4382
|
+
if (V) {
|
|
4383
|
+
G(e);
|
|
4367
4384
|
return;
|
|
4368
4385
|
}
|
|
4369
|
-
|
|
4370
|
-
},
|
|
4386
|
+
L?.props.onClick?.(e), e.defaultPrevented || T?.(e);
|
|
4387
|
+
}, ae = /* @__PURE__ */ f(u, { children: [
|
|
4371
4388
|
s && (m ? /* @__PURE__ */ d("span", {
|
|
4372
|
-
className:
|
|
4389
|
+
className: ji.icon,
|
|
4373
4390
|
"aria-hidden": "true",
|
|
4374
4391
|
children: m
|
|
4375
4392
|
}) : /* @__PURE__ */ d("span", {
|
|
4376
|
-
className:
|
|
4393
|
+
className: ji.spinner,
|
|
4377
4394
|
"aria-hidden": "true"
|
|
4378
4395
|
})),
|
|
4379
4396
|
!s && l && /* @__PURE__ */ d("span", {
|
|
4380
|
-
className:
|
|
4397
|
+
className: ji.icon,
|
|
4381
4398
|
children: l
|
|
4382
4399
|
}),
|
|
4383
|
-
|
|
4384
|
-
className:
|
|
4385
|
-
"data-measure":
|
|
4400
|
+
ne && !z && /* @__PURE__ */ d("span", {
|
|
4401
|
+
className: ji.label,
|
|
4402
|
+
"data-measure": re,
|
|
4386
4403
|
children: /* @__PURE__ */ d("span", {
|
|
4387
|
-
className:
|
|
4388
|
-
children:
|
|
4404
|
+
className: ji.labelText,
|
|
4405
|
+
children: ne
|
|
4389
4406
|
})
|
|
4390
4407
|
}),
|
|
4391
|
-
g && !
|
|
4392
|
-
className:
|
|
4408
|
+
g && !z && /* @__PURE__ */ d("span", {
|
|
4409
|
+
className: ji.badge,
|
|
4393
4410
|
children: g
|
|
4394
4411
|
}),
|
|
4395
|
-
_ && !
|
|
4396
|
-
className:
|
|
4412
|
+
_ && !z && /* @__PURE__ */ d("span", {
|
|
4413
|
+
className: ji.shortcut,
|
|
4397
4414
|
children: _
|
|
4398
4415
|
}),
|
|
4399
4416
|
!s && p && /* @__PURE__ */ d("span", {
|
|
4400
|
-
className:
|
|
4417
|
+
className: ji.icon,
|
|
4401
4418
|
children: p
|
|
4402
4419
|
})
|
|
4403
4420
|
] });
|
|
4404
|
-
return
|
|
4405
|
-
...
|
|
4406
|
-
ref:
|
|
4421
|
+
return L ? h(L, {
|
|
4422
|
+
...F,
|
|
4423
|
+
ref: I,
|
|
4424
|
+
style: {
|
|
4425
|
+
...te,
|
|
4426
|
+
...L.props.style,
|
|
4427
|
+
...w
|
|
4428
|
+
},
|
|
4407
4429
|
"aria-busy": s || void 0,
|
|
4408
|
-
"aria-disabled":
|
|
4409
|
-
"aria-label":
|
|
4410
|
-
"aria-labelledby":
|
|
4411
|
-
className: U(
|
|
4412
|
-
href:
|
|
4413
|
-
onClick:
|
|
4414
|
-
tabIndex:
|
|
4415
|
-
title: y ||
|
|
4416
|
-
children:
|
|
4417
|
-
}) :
|
|
4418
|
-
ref:
|
|
4419
|
-
href:
|
|
4420
|
-
id:
|
|
4421
|
-
role:
|
|
4422
|
-
tabIndex:
|
|
4423
|
-
target:
|
|
4424
|
-
rel:
|
|
4425
|
-
download:
|
|
4426
|
-
onClick:
|
|
4427
|
-
"aria-disabled":
|
|
4428
|
-
"aria-label":
|
|
4429
|
-
"aria-labelledby":
|
|
4430
|
+
"aria-disabled": V || void 0,
|
|
4431
|
+
"aria-label": E || L.props["aria-label"] || void 0,
|
|
4432
|
+
"aria-labelledby": D || L.props["aria-labelledby"] || void 0,
|
|
4433
|
+
className: U(L.props.className, W),
|
|
4434
|
+
href: V ? void 0 : L.props.href,
|
|
4435
|
+
onClick: K,
|
|
4436
|
+
tabIndex: V ? -1 : L.props.tabIndex,
|
|
4437
|
+
title: y || L.props.title,
|
|
4438
|
+
children: ae
|
|
4439
|
+
}) : O ? /* @__PURE__ */ d("a", {
|
|
4440
|
+
ref: I,
|
|
4441
|
+
href: V ? void 0 : O,
|
|
4442
|
+
id: M,
|
|
4443
|
+
role: N,
|
|
4444
|
+
tabIndex: V ? -1 : P,
|
|
4445
|
+
target: k,
|
|
4446
|
+
rel: ie,
|
|
4447
|
+
download: j,
|
|
4448
|
+
onClick: V ? G : T,
|
|
4449
|
+
"aria-disabled": V || void 0,
|
|
4450
|
+
"aria-label": E || void 0,
|
|
4451
|
+
"aria-labelledby": D || void 0,
|
|
4430
4452
|
"aria-busy": s || void 0,
|
|
4431
|
-
className:
|
|
4453
|
+
className: W,
|
|
4432
4454
|
title: y,
|
|
4433
|
-
|
|
4455
|
+
style: {
|
|
4456
|
+
...te,
|
|
4457
|
+
...w
|
|
4458
|
+
},
|
|
4459
|
+
children: ae
|
|
4434
4460
|
}) : /* @__PURE__ */ d("button", {
|
|
4435
|
-
...
|
|
4436
|
-
ref:
|
|
4437
|
-
id:
|
|
4438
|
-
role:
|
|
4439
|
-
tabIndex:
|
|
4461
|
+
...F,
|
|
4462
|
+
ref: I,
|
|
4463
|
+
id: M,
|
|
4464
|
+
role: N,
|
|
4465
|
+
tabIndex: P,
|
|
4440
4466
|
type: a,
|
|
4441
|
-
disabled:
|
|
4442
|
-
onClick:
|
|
4443
|
-
"aria-label":
|
|
4444
|
-
"aria-labelledby":
|
|
4467
|
+
disabled: V,
|
|
4468
|
+
onClick: V ? void 0 : T,
|
|
4469
|
+
"aria-label": E || void 0,
|
|
4470
|
+
"aria-labelledby": D || void 0,
|
|
4445
4471
|
"aria-busy": s || void 0,
|
|
4446
|
-
className:
|
|
4472
|
+
className: W,
|
|
4447
4473
|
title: y,
|
|
4448
|
-
|
|
4474
|
+
style: {
|
|
4475
|
+
...te,
|
|
4476
|
+
...w
|
|
4477
|
+
},
|
|
4478
|
+
children: ae
|
|
4449
4479
|
});
|
|
4450
4480
|
});
|
|
4451
|
-
|
|
4481
|
+
Mi.displayName = "Button";
|
|
4452
4482
|
var Q = {
|
|
4453
|
-
wrapper: "
|
|
4454
|
-
colorPrimary: "
|
|
4455
|
-
colorNeutral: "
|
|
4456
|
-
colorSuccess: "
|
|
4457
|
-
colorWarning: "
|
|
4458
|
-
colorDanger: "
|
|
4459
|
-
labelStart: "
|
|
4460
|
-
wrapperSm: "
|
|
4461
|
-
wrapperMd: "
|
|
4462
|
-
wrapperLg: "
|
|
4463
|
-
iconOnly: "
|
|
4464
|
-
container: "
|
|
4465
|
-
containerSm: "
|
|
4466
|
-
containerMd: "
|
|
4467
|
-
containerLg: "
|
|
4468
|
-
containerLabelStart: "
|
|
4469
|
-
descriptionText: "
|
|
4470
|
-
errorText: "
|
|
4471
|
-
input: "
|
|
4472
|
-
customCheckbox: "
|
|
4473
|
-
requiredMark: "
|
|
4474
|
-
error: "
|
|
4475
|
-
checkmark: "
|
|
4476
|
-
indeterminateMark: "
|
|
4477
|
-
customMark: "
|
|
4478
|
-
label: "
|
|
4479
|
-
labelSm: "
|
|
4480
|
-
labelMd: "
|
|
4481
|
-
labelLg: "
|
|
4482
|
-
indeterminate: "
|
|
4483
|
-
"checkbox-pop": "_checkbox-
|
|
4484
|
-
"checkbox-checkmark-in": "_checkbox-checkmark-
|
|
4485
|
-
"checkbox-indeterminate-in": "_checkbox-indeterminate-
|
|
4486
|
-
disabled: "
|
|
4487
|
-
},
|
|
4483
|
+
wrapper: "_wrapper_jq9wv_1",
|
|
4484
|
+
colorPrimary: "_colorPrimary_jq9wv_36",
|
|
4485
|
+
colorNeutral: "_colorNeutral_jq9wv_54",
|
|
4486
|
+
colorSuccess: "_colorSuccess_jq9wv_72",
|
|
4487
|
+
colorWarning: "_colorWarning_jq9wv_90",
|
|
4488
|
+
colorDanger: "_colorDanger_jq9wv_108",
|
|
4489
|
+
labelStart: "_labelStart_jq9wv_124",
|
|
4490
|
+
wrapperSm: "_wrapperSm_jq9wv_128",
|
|
4491
|
+
wrapperMd: "_wrapperMd_jq9wv_134",
|
|
4492
|
+
wrapperLg: "_wrapperLg_jq9wv_140",
|
|
4493
|
+
iconOnly: "_iconOnly_jq9wv_146",
|
|
4494
|
+
container: "_container_jq9wv_152",
|
|
4495
|
+
containerSm: "_containerSm_jq9wv_159",
|
|
4496
|
+
containerMd: "_containerMd_jq9wv_163",
|
|
4497
|
+
containerLg: "_containerLg_jq9wv_167",
|
|
4498
|
+
containerLabelStart: "_containerLabelStart_jq9wv_171",
|
|
4499
|
+
descriptionText: "_descriptionText_jq9wv_171",
|
|
4500
|
+
errorText: "_errorText_jq9wv_172",
|
|
4501
|
+
input: "_input_jq9wv_176",
|
|
4502
|
+
customCheckbox: "_customCheckbox_jq9wv_188",
|
|
4503
|
+
requiredMark: "_requiredMark_jq9wv_203",
|
|
4504
|
+
error: "_error_jq9wv_172",
|
|
4505
|
+
checkmark: "_checkmark_jq9wv_219",
|
|
4506
|
+
indeterminateMark: "_indeterminateMark_jq9wv_235",
|
|
4507
|
+
customMark: "_customMark_jq9wv_248",
|
|
4508
|
+
label: "_label_jq9wv_124",
|
|
4509
|
+
labelSm: "_labelSm_jq9wv_279",
|
|
4510
|
+
labelMd: "_labelMd_jq9wv_283",
|
|
4511
|
+
labelLg: "_labelLg_jq9wv_287",
|
|
4512
|
+
indeterminate: "_indeterminate_jq9wv_235",
|
|
4513
|
+
"checkbox-pop": "_checkbox-pop_jq9wv_1",
|
|
4514
|
+
"checkbox-checkmark-in": "_checkbox-checkmark-in_jq9wv_1",
|
|
4515
|
+
"checkbox-indeterminate-in": "_checkbox-indeterminate-in_jq9wv_1",
|
|
4516
|
+
disabled: "_disabled_jq9wv_370"
|
|
4517
|
+
}, Ni = {
|
|
4488
4518
|
sm: Q.labelSm,
|
|
4489
4519
|
md: Q.labelMd,
|
|
4490
4520
|
lg: Q.labelLg
|
|
4491
|
-
},
|
|
4521
|
+
}, Pi = {
|
|
4492
4522
|
sm: Q.wrapperSm,
|
|
4493
4523
|
md: Q.wrapperMd,
|
|
4494
4524
|
lg: Q.wrapperLg
|
|
4495
|
-
},
|
|
4525
|
+
}, Fi = {
|
|
4496
4526
|
sm: Q.containerSm,
|
|
4497
4527
|
md: Q.containerMd,
|
|
4498
4528
|
lg: Q.containerLg
|
|
4499
|
-
},
|
|
4529
|
+
}, Ii = {
|
|
4500
4530
|
primary: Q.colorPrimary,
|
|
4501
4531
|
neutral: Q.colorNeutral,
|
|
4502
4532
|
success: Q.colorSuccess,
|
|
4503
4533
|
warning: Q.colorWarning,
|
|
4504
4534
|
danger: Q.colorDanger
|
|
4505
|
-
},
|
|
4535
|
+
}, Li = _(({ id: e, label: t, description: n, icon: r, indeterminateIcon: i, checked: a, size: o = "md", color: s = "primary", labelPosition: c = "end", defaultChecked: l = !1, disabled: u = !1, required: p = !1, indeterminate: m = !1, className: h, wrapperClassName: g, onCheckedChange: _, error: v, "aria-label": b, "aria-labelledby": C, "aria-describedby": w, ...E }, D) => {
|
|
4506
4536
|
let O = S(), k = e ?? O, A = T(null), j = !!v, M = n ? `${k}-description` : void 0, N = j ? `${k}-error` : void 0, P = [
|
|
4507
4537
|
w,
|
|
4508
4538
|
M,
|
|
4509
4539
|
N
|
|
4510
|
-
].filter(Boolean).join(" "), [F, I] =
|
|
4540
|
+
].filter(Boolean).join(" "), [F, I] = Y({
|
|
4511
4541
|
value: a,
|
|
4512
4542
|
defaultValue: l,
|
|
4513
4543
|
onChange: _
|
|
@@ -4524,12 +4554,12 @@ var Q = {
|
|
|
4524
4554
|
let R = (e) => {
|
|
4525
4555
|
I(e.target.checked);
|
|
4526
4556
|
};
|
|
4527
|
-
return
|
|
4528
|
-
className: U(Q.container,
|
|
4557
|
+
return at(!!(t || b || C), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ f("div", {
|
|
4558
|
+
className: U(Q.container, Fi[o], c === "start" && Q.containerLabelStart, h),
|
|
4529
4559
|
children: [
|
|
4530
4560
|
/* @__PURE__ */ f("label", {
|
|
4531
4561
|
htmlFor: k,
|
|
4532
|
-
className: U(Q.wrapper,
|
|
4562
|
+
className: U(Q.wrapper, Pi[o], Ii[s], c === "start" && Q.labelStart, !t && Q.iconOnly, u && Q.disabled, g),
|
|
4533
4563
|
children: [
|
|
4534
4564
|
/* @__PURE__ */ d("input", {
|
|
4535
4565
|
...E,
|
|
@@ -4555,11 +4585,11 @@ var Q = {
|
|
|
4555
4585
|
children: i
|
|
4556
4586
|
}) : F && /* @__PURE__ */ d("span", {
|
|
4557
4587
|
className: Q.checkmark,
|
|
4558
|
-
children: r ?? /* @__PURE__ */ d(
|
|
4588
|
+
children: r ?? /* @__PURE__ */ d(V, {})
|
|
4559
4589
|
})
|
|
4560
4590
|
}),
|
|
4561
4591
|
t && /* @__PURE__ */ f("span", {
|
|
4562
|
-
className: U(Q.label,
|
|
4592
|
+
className: U(Q.label, Ni[o]),
|
|
4563
4593
|
children: [t, p && /* @__PURE__ */ d("span", {
|
|
4564
4594
|
className: Q.requiredMark,
|
|
4565
4595
|
"aria-hidden": "true",
|
|
@@ -4581,49 +4611,49 @@ var Q = {
|
|
|
4581
4611
|
]
|
|
4582
4612
|
});
|
|
4583
4613
|
});
|
|
4584
|
-
|
|
4614
|
+
Li.displayName = "Checkbox";
|
|
4585
4615
|
var $ = {
|
|
4586
|
-
inputGroup: "
|
|
4587
|
-
primary: "
|
|
4588
|
-
outline: "
|
|
4589
|
-
filled: "
|
|
4590
|
-
soft: "
|
|
4591
|
-
neutral: "
|
|
4592
|
-
success: "
|
|
4593
|
-
warning: "
|
|
4594
|
-
danger: "
|
|
4595
|
-
inputWrapper: "
|
|
4596
|
-
input: "
|
|
4597
|
-
error: "
|
|
4598
|
-
sm: "
|
|
4599
|
-
md: "
|
|
4600
|
-
lg: "
|
|
4601
|
-
isInvalid: "
|
|
4602
|
-
hasLeftAdornment: "
|
|
4603
|
-
hasRightAdornment: "
|
|
4604
|
-
hasStartIconAndPrefix: "
|
|
4605
|
-
hasEndIconAndSuffix: "
|
|
4606
|
-
startAdornment: "
|
|
4607
|
-
endAdornment: "
|
|
4608
|
-
prefix: "
|
|
4609
|
-
suffix: "
|
|
4610
|
-
endSlot: "
|
|
4611
|
-
isLoading: "
|
|
4612
|
-
clearButton: "
|
|
4613
|
-
iconButton: "
|
|
4614
|
-
spinner: "
|
|
4615
|
-
"input-spin": "_input-
|
|
4616
|
-
addon: "
|
|
4617
|
-
hasAddons: "
|
|
4618
|
-
counter: "
|
|
4619
|
-
toneDefault: "
|
|
4620
|
-
tonePrimary: "
|
|
4621
|
-
toneSecondary: "
|
|
4622
|
-
toneSuccess: "
|
|
4623
|
-
toneDanger: "
|
|
4624
|
-
toneMuted: "
|
|
4625
|
-
toneInverse: "
|
|
4626
|
-
},
|
|
4616
|
+
inputGroup: "_inputGroup_10dlc_1",
|
|
4617
|
+
primary: "_primary_10dlc_29",
|
|
4618
|
+
outline: "_outline_10dlc_29",
|
|
4619
|
+
filled: "_filled_10dlc_62",
|
|
4620
|
+
soft: "_soft_10dlc_95",
|
|
4621
|
+
neutral: "_neutral_10dlc_128",
|
|
4622
|
+
success: "_success_10dlc_227",
|
|
4623
|
+
warning: "_warning_10dlc_326",
|
|
4624
|
+
danger: "_danger_10dlc_425",
|
|
4625
|
+
inputWrapper: "_inputWrapper_10dlc_524",
|
|
4626
|
+
input: "_input_10dlc_1",
|
|
4627
|
+
error: "_error_10dlc_578",
|
|
4628
|
+
sm: "_sm_10dlc_586",
|
|
4629
|
+
md: "_md_10dlc_589",
|
|
4630
|
+
lg: "_lg_10dlc_592",
|
|
4631
|
+
isInvalid: "_isInvalid_10dlc_607",
|
|
4632
|
+
hasLeftAdornment: "_hasLeftAdornment_10dlc_637",
|
|
4633
|
+
hasRightAdornment: "_hasRightAdornment_10dlc_641",
|
|
4634
|
+
hasStartIconAndPrefix: "_hasStartIconAndPrefix_10dlc_645",
|
|
4635
|
+
hasEndIconAndSuffix: "_hasEndIconAndSuffix_10dlc_649",
|
|
4636
|
+
startAdornment: "_startAdornment_10dlc_653",
|
|
4637
|
+
endAdornment: "_endAdornment_10dlc_654",
|
|
4638
|
+
prefix: "_prefix_10dlc_672",
|
|
4639
|
+
suffix: "_suffix_10dlc_673",
|
|
4640
|
+
endSlot: "_endSlot_10dlc_700",
|
|
4641
|
+
isLoading: "_isLoading_10dlc_711",
|
|
4642
|
+
clearButton: "_clearButton_10dlc_748",
|
|
4643
|
+
iconButton: "_iconButton_10dlc_763",
|
|
4644
|
+
spinner: "_spinner_10dlc_789",
|
|
4645
|
+
"input-spin": "_input-spin_10dlc_1",
|
|
4646
|
+
addon: "_addon_10dlc_798",
|
|
4647
|
+
hasAddons: "_hasAddons_10dlc_819",
|
|
4648
|
+
counter: "_counter_10dlc_833",
|
|
4649
|
+
toneDefault: "_toneDefault_10dlc_861",
|
|
4650
|
+
tonePrimary: "_tonePrimary_10dlc_865",
|
|
4651
|
+
toneSecondary: "_toneSecondary_10dlc_869",
|
|
4652
|
+
toneSuccess: "_toneSuccess_10dlc_873",
|
|
4653
|
+
toneDanger: "_toneDanger_10dlc_877",
|
|
4654
|
+
toneMuted: "_toneMuted_10dlc_881",
|
|
4655
|
+
toneInverse: "_toneInverse_10dlc_885"
|
|
4656
|
+
}, Ri = {
|
|
4627
4657
|
default: $.toneDefault,
|
|
4628
4658
|
primary: $.tonePrimary,
|
|
4629
4659
|
secondary: $.toneSecondary,
|
|
@@ -4631,7 +4661,7 @@ var $ = {
|
|
|
4631
4661
|
danger: $.toneDanger,
|
|
4632
4662
|
muted: $.toneMuted,
|
|
4633
4663
|
inverse: $.toneInverse
|
|
4634
|
-
},
|
|
4664
|
+
}, zi = (e = "text", t) => {
|
|
4635
4665
|
if (t) return t;
|
|
4636
4666
|
switch (e) {
|
|
4637
4667
|
case "email": return "email";
|
|
@@ -4641,7 +4671,7 @@ var $ = {
|
|
|
4641
4671
|
case "search": return "off";
|
|
4642
4672
|
default: return;
|
|
4643
4673
|
}
|
|
4644
|
-
},
|
|
4674
|
+
}, Bi = (e, t) => {
|
|
4645
4675
|
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
4646
4676
|
for (let e of t) {
|
|
4647
4677
|
if (e === "#") {
|
|
@@ -4653,157 +4683,166 @@ var $ = {
|
|
|
4653
4683
|
r < n.length && (i += e);
|
|
4654
4684
|
}
|
|
4655
4685
|
return i;
|
|
4656
|
-
},
|
|
4657
|
-
let
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4686
|
+
}, Vi = (e, t) => t ? typeof t == "function" ? t(e) : Bi(e, t) : e, Hi = _(({ id: e, label: t, name: n, description: r, placeholder: i, value: a, defaultValue: o, type: s = "text", size: c, color: l = "primary", variant: p = "outline", error: m, invalid: h = !1, disabled: g = !1, required: _ = !1, loading: v = !1, className: b, style: x, wrapperClassName: C, autoComplete: w, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter: M = !1, startIcon: N, endIcon: P, startAddon: F, endAddon: I, prefix: L, suffix: R, clearIcon: z, mask: ee, format: V, parse: H, startIconTone: te = "default", endIconTone: ne = "default", clearIconTone: ie = "danger", autoFocus: W, maxLength: G, onMouseEnter: K, onMouseLeave: ae, "aria-describedby": oe, "aria-invalid": se, "aria-labelledby": ce, ...q }, le) => {
|
|
4687
|
+
let ue = S(), de = xr(), fe = !!(t || r || m), J = e ?? (fe ? void 0 : de?.controlId) ?? ue, pe = T(null), [me, he] = E(!1), [ge, _e] = E(o ?? ""), ve = a !== void 0, ye = String((ve ? a : ge) ?? ""), be = V ? V(ye) : ye, xe = ye.length > 0, Se = c ?? de?.size ?? "md", Ce = B[Se], we = {
|
|
4688
|
+
"--input-height": `${Ce.height}px`,
|
|
4689
|
+
"--input-font-size": `${Ce.fontSize}px`,
|
|
4690
|
+
"--input-line-height": `${Ce.lineHeight}px`,
|
|
4691
|
+
"--input-icon-size": `${Ce.iconSize}px`
|
|
4692
|
+
}, Te = h || !!m || !fe && !!de?.invalid, Ee = g || !fe && !!de?.disabled, De = _ || !fe && !!de?.required, Oe = D || v, ke = s === "password", Ae = ke && j && me ? "text" : s, je = N ?? (s === "search" ? /* @__PURE__ */ d(re, {}) : null), Me = P, Ne = zi(s, w), Pe = v && !Ee, Fe = O && xe && !Ee && !Oe && !Pe, Ie = j && ke && !Ee && !Pe && !Fe, Le = !Pe && !Fe && !Ie && !!Me, Re = !!(M && G), Y = r ? `${J}-description` : void 0, ze = m ? `${J}-error` : void 0, Be = Re ? `${J}-counter` : void 0, Ve = [
|
|
4693
|
+
oe,
|
|
4694
|
+
!fe && !oe ? de?.ariaDescribedBy : void 0,
|
|
4695
|
+
Y,
|
|
4696
|
+
ze,
|
|
4697
|
+
Be
|
|
4698
|
+
].filter(Boolean).join(" "), He = z ?? "×", Ue = !!(je || L), We = !!(Me || R || Fe || Ie || Pe), Ge = !!(je && L), Ke = !!(Me && R), qe = !!(F || I), Je = y((e) => {
|
|
4664
4699
|
if (pe.current = e, typeof le == "function") {
|
|
4665
4700
|
le(e);
|
|
4666
4701
|
return;
|
|
4667
4702
|
}
|
|
4668
4703
|
le && (le.current = e);
|
|
4669
|
-
}, [le]),
|
|
4670
|
-
let t =
|
|
4671
|
-
ve || _e(t),
|
|
4704
|
+
}, [le]), Ye = y((e) => {
|
|
4705
|
+
let t = Vi(H ? H(e.target.value) : e.target.value, ee);
|
|
4706
|
+
ve || _e(t), A?.(t);
|
|
4672
4707
|
}, [
|
|
4673
4708
|
ve,
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
]),
|
|
4678
|
-
ve || _e(""),
|
|
4709
|
+
ee,
|
|
4710
|
+
A,
|
|
4711
|
+
H
|
|
4712
|
+
]), Xe = y(() => {
|
|
4713
|
+
ve || _e(""), A?.(""), k?.(), pe.current?.focus();
|
|
4679
4714
|
}, [
|
|
4680
4715
|
ve,
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
]),
|
|
4716
|
+
k,
|
|
4717
|
+
A
|
|
4718
|
+
]), Ze = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("div", {
|
|
4684
4719
|
className: U($.inputGroup, $[p], $[l], {
|
|
4685
|
-
[$.hasAddons]:
|
|
4686
|
-
[$.isDisabled]:
|
|
4687
|
-
[$.isInvalid]:
|
|
4688
|
-
[$.isLoading]:
|
|
4720
|
+
[$.hasAddons]: qe,
|
|
4721
|
+
[$.isDisabled]: Ee,
|
|
4722
|
+
[$.isInvalid]: Te,
|
|
4723
|
+
[$.isLoading]: Pe
|
|
4689
4724
|
}),
|
|
4690
4725
|
children: [
|
|
4691
|
-
|
|
4726
|
+
F && /* @__PURE__ */ d("span", {
|
|
4692
4727
|
className: $.addon,
|
|
4693
|
-
children:
|
|
4728
|
+
children: F
|
|
4694
4729
|
}),
|
|
4695
4730
|
/* @__PURE__ */ f("div", {
|
|
4696
4731
|
className: U($.inputWrapper, {
|
|
4697
|
-
[$.hasLeftAdornment]:
|
|
4698
|
-
[$.hasRightAdornment]:
|
|
4699
|
-
[$.hasStartIconAndPrefix]:
|
|
4700
|
-
[$.hasEndIconAndSuffix]:
|
|
4732
|
+
[$.hasLeftAdornment]: Ue,
|
|
4733
|
+
[$.hasRightAdornment]: We,
|
|
4734
|
+
[$.hasStartIconAndPrefix]: Ge,
|
|
4735
|
+
[$.hasEndIconAndSuffix]: Ke
|
|
4701
4736
|
}),
|
|
4702
4737
|
children: [
|
|
4703
|
-
|
|
4738
|
+
je && /* @__PURE__ */ d("span", {
|
|
4704
4739
|
"aria-hidden": "true",
|
|
4705
|
-
className: U($.startAdornment,
|
|
4706
|
-
children:
|
|
4740
|
+
className: U($.startAdornment, Ri[te]),
|
|
4741
|
+
children: je
|
|
4707
4742
|
}),
|
|
4708
|
-
|
|
4743
|
+
L && /* @__PURE__ */ d("span", {
|
|
4709
4744
|
className: $.prefix,
|
|
4710
|
-
children:
|
|
4745
|
+
children: L
|
|
4711
4746
|
}),
|
|
4712
4747
|
/* @__PURE__ */ d("input", {
|
|
4713
|
-
...
|
|
4714
|
-
ref:
|
|
4715
|
-
id:
|
|
4748
|
+
...q,
|
|
4749
|
+
ref: Je,
|
|
4750
|
+
id: J,
|
|
4716
4751
|
name: n,
|
|
4717
|
-
type:
|
|
4718
|
-
autoComplete:
|
|
4719
|
-
className: U($.input, $[Se], { [$.error]:
|
|
4752
|
+
type: Ae,
|
|
4753
|
+
autoComplete: Ne,
|
|
4754
|
+
className: U($.input, $[Se], { [$.error]: Te }, b),
|
|
4755
|
+
style: {
|
|
4756
|
+
...we,
|
|
4757
|
+
...x
|
|
4758
|
+
},
|
|
4720
4759
|
value: be,
|
|
4721
|
-
onChange:
|
|
4760
|
+
onChange: Ye,
|
|
4722
4761
|
placeholder: i,
|
|
4723
|
-
disabled:
|
|
4724
|
-
readOnly:
|
|
4725
|
-
required:
|
|
4726
|
-
autoFocus:
|
|
4727
|
-
maxLength:
|
|
4728
|
-
"aria-invalid":
|
|
4729
|
-
"aria-labelledby":
|
|
4730
|
-
"aria-describedby":
|
|
4762
|
+
disabled: Ee,
|
|
4763
|
+
readOnly: Oe,
|
|
4764
|
+
required: De,
|
|
4765
|
+
autoFocus: W,
|
|
4766
|
+
maxLength: G,
|
|
4767
|
+
"aria-invalid": Te ? !0 : se,
|
|
4768
|
+
"aria-labelledby": ce ?? (fe ? void 0 : de?.ariaLabelledBy),
|
|
4769
|
+
"aria-describedby": Ve || void 0,
|
|
4731
4770
|
"aria-busy": v || void 0,
|
|
4732
|
-
onMouseEnter:
|
|
4733
|
-
onMouseLeave:
|
|
4771
|
+
onMouseEnter: K,
|
|
4772
|
+
onMouseLeave: ae
|
|
4734
4773
|
}),
|
|
4735
|
-
|
|
4774
|
+
R && /* @__PURE__ */ d("span", {
|
|
4736
4775
|
className: $.suffix,
|
|
4737
|
-
children:
|
|
4776
|
+
children: R
|
|
4738
4777
|
}),
|
|
4739
4778
|
/* @__PURE__ */ f("div", {
|
|
4740
4779
|
className: $.endSlot,
|
|
4741
4780
|
children: [
|
|
4742
|
-
|
|
4781
|
+
Pe && /* @__PURE__ */ d("span", {
|
|
4743
4782
|
className: $.spinner,
|
|
4744
4783
|
"aria-hidden": "true",
|
|
4745
4784
|
"data-testid": "input-spinner"
|
|
4746
4785
|
}),
|
|
4747
|
-
|
|
4786
|
+
Ie && /* @__PURE__ */ d("button", {
|
|
4748
4787
|
type: "button",
|
|
4749
4788
|
className: $.iconButton,
|
|
4750
4789
|
onClick: () => he((e) => !e),
|
|
4751
4790
|
"aria-label": me ? "Hide password" : "Show password",
|
|
4752
4791
|
children: me ? "Hide" : "Show"
|
|
4753
4792
|
}),
|
|
4754
|
-
|
|
4793
|
+
Fe && /* @__PURE__ */ d("button", {
|
|
4755
4794
|
type: "button",
|
|
4756
|
-
className: U($.clearButton,
|
|
4757
|
-
onClick:
|
|
4795
|
+
className: U($.clearButton, Ri[ie]),
|
|
4796
|
+
onClick: Xe,
|
|
4758
4797
|
"aria-label": "Clear input",
|
|
4759
|
-
children:
|
|
4798
|
+
children: He
|
|
4760
4799
|
}),
|
|
4761
|
-
|
|
4800
|
+
Le && Me && /* @__PURE__ */ d("span", {
|
|
4762
4801
|
"aria-hidden": "true",
|
|
4763
|
-
className: U($.endAdornment,
|
|
4764
|
-
children:
|
|
4802
|
+
className: U($.endAdornment, Ri[ne]),
|
|
4803
|
+
children: Me
|
|
4765
4804
|
})
|
|
4766
4805
|
]
|
|
4767
4806
|
})
|
|
4768
4807
|
]
|
|
4769
4808
|
}),
|
|
4770
|
-
|
|
4809
|
+
I && /* @__PURE__ */ d("span", {
|
|
4771
4810
|
className: $.addon,
|
|
4772
|
-
children:
|
|
4811
|
+
children: I
|
|
4773
4812
|
})
|
|
4774
4813
|
]
|
|
4775
|
-
}),
|
|
4776
|
-
id:
|
|
4814
|
+
}), Re && /* @__PURE__ */ f("div", {
|
|
4815
|
+
id: Be,
|
|
4777
4816
|
className: $.counter,
|
|
4778
4817
|
children: [
|
|
4779
4818
|
ye.length,
|
|
4780
4819
|
" / ",
|
|
4781
|
-
|
|
4820
|
+
G
|
|
4782
4821
|
]
|
|
4783
4822
|
})] });
|
|
4784
|
-
return !
|
|
4785
|
-
id:
|
|
4823
|
+
return !fe && de ? Ze : /* @__PURE__ */ d(jr, {
|
|
4824
|
+
id: J,
|
|
4786
4825
|
label: t,
|
|
4787
4826
|
description: r,
|
|
4788
4827
|
error: m,
|
|
4789
|
-
required:
|
|
4790
|
-
disabled:
|
|
4791
|
-
invalid:
|
|
4828
|
+
required: De,
|
|
4829
|
+
disabled: Ee,
|
|
4830
|
+
invalid: Te,
|
|
4792
4831
|
size: Se,
|
|
4793
|
-
className:
|
|
4832
|
+
className: C,
|
|
4794
4833
|
bindControl: !1,
|
|
4795
|
-
children:
|
|
4834
|
+
children: Ze
|
|
4796
4835
|
});
|
|
4797
4836
|
});
|
|
4798
|
-
|
|
4837
|
+
Hi.displayName = "Input";
|
|
4799
4838
|
//#endregion
|
|
4800
4839
|
//#region src/theme/ThemeContext.ts
|
|
4801
|
-
var
|
|
4802
|
-
let [a, o] =
|
|
4840
|
+
var Ui = g(null), Wi = (e) => e === "highContrast" ? "high-contrast" : e, Gi = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, syncDocument: r = !0, children: i }) => {
|
|
4841
|
+
let [a, o] = Y({
|
|
4803
4842
|
value: e,
|
|
4804
4843
|
defaultValue: t,
|
|
4805
4844
|
onChange: n
|
|
4806
|
-
}), s =
|
|
4845
|
+
}), s = Wi(a);
|
|
4807
4846
|
x(() => {
|
|
4808
4847
|
if (!r || typeof document > "u") return;
|
|
4809
4848
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -4819,7 +4858,7 @@ var Hi = g(null), Ui = (e) => e === "highContrast" ? "high-contrast" : e, Wi = (
|
|
|
4819
4858
|
theme: a,
|
|
4820
4859
|
setTheme: o
|
|
4821
4860
|
}), [a, o]);
|
|
4822
|
-
return /* @__PURE__ */ d(
|
|
4861
|
+
return /* @__PURE__ */ d(Ui.Provider, {
|
|
4823
4862
|
value: c,
|
|
4824
4863
|
children: /* @__PURE__ */ d("div", {
|
|
4825
4864
|
"data-vellira-theme": s,
|
|
@@ -4827,13 +4866,13 @@ var Hi = g(null), Ui = (e) => e === "highContrast" ? "high-contrast" : e, Wi = (
|
|
|
4827
4866
|
})
|
|
4828
4867
|
});
|
|
4829
4868
|
};
|
|
4830
|
-
|
|
4869
|
+
Gi.displayName = "ThemeProvider";
|
|
4831
4870
|
//#endregion
|
|
4832
4871
|
//#region src/theme/useTheme.ts
|
|
4833
|
-
function
|
|
4834
|
-
let e = b(
|
|
4872
|
+
function Ki() {
|
|
4873
|
+
let e = b(Ui);
|
|
4835
4874
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
4836
4875
|
return e;
|
|
4837
4876
|
}
|
|
4838
4877
|
//#endregion
|
|
4839
|
-
export {
|
|
4878
|
+
export { Mi as Button, Li as Checkbox, Vt as Dropdown, jr as FormField, Hi as Input, _n as Modal, In as Popover, Ke as Portal, Ge as PortalProvider, Hn as Radio, Zn as RadioGroup, qr as Select, pi as Tabs, Gi as ThemeProvider, Ai as Tooltip, Ki as useTheme };
|