@owodesign/owoui 0.1.7 → 0.1.8
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/README.md +29 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +246 -7
- package/dist/index.min.js +2177 -784
- package/dist/storybook/catalog.js +50 -4
- package/dist/storybook/catalog.json +50 -4
- package/dist/storybook/index.css +1 -1
- package/dist/storybook/index.min.js +7565 -4997
- package/dist/storybook-static/assets/index-C4vMyVN0.css +1 -0
- package/dist/storybook-static/assets/index-CBlwgC7b.js +178 -0
- package/dist/storybook-static/index.html +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/storybook-static/assets/index-BRZA1IIs.js +0 -178
- package/dist/storybook-static/assets/index-Bb9jxRzx.css +0 -1
package/dist/index.min.js
CHANGED
|
@@ -423,14 +423,27 @@ function R(e) {
|
|
|
423
423
|
}
|
|
424
424
|
//#endregion
|
|
425
425
|
//#region src/contexts/FieldContext.ts
|
|
426
|
-
var
|
|
427
|
-
function
|
|
428
|
-
return a(
|
|
426
|
+
var z = n(void 0);
|
|
427
|
+
function ee() {
|
|
428
|
+
return a(z);
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/hooks/useAccessibilityGuard.ts
|
|
432
|
+
function B({ componentName: e, ariaLabel: t, labelledBy: n, hasVisibleLabel: r = !1, disabled: i = !1 }) {
|
|
433
|
+
o(() => {
|
|
434
|
+
process.env.NODE_ENV !== "production" && (i || t || n || r || console.warn(`${e} requires an accessible name when used outside Field. Provide ariaLabel or wrap it in Field.`));
|
|
435
|
+
}, [
|
|
436
|
+
t,
|
|
437
|
+
e,
|
|
438
|
+
i,
|
|
439
|
+
r,
|
|
440
|
+
n
|
|
441
|
+
]);
|
|
429
442
|
}
|
|
430
443
|
//#endregion
|
|
431
444
|
//#region src/hooks/useFieldProps.ts
|
|
432
|
-
function
|
|
433
|
-
let t =
|
|
445
|
+
function V(e) {
|
|
446
|
+
let t = ee();
|
|
434
447
|
return {
|
|
435
448
|
id: e.id ?? t?.controlId,
|
|
436
449
|
disabled: e.disabled ?? t?.disabled ?? !1,
|
|
@@ -441,83 +454,89 @@ function B(e) {
|
|
|
441
454
|
}
|
|
442
455
|
//#endregion
|
|
443
456
|
//#region src/hooks/useControllableState.ts
|
|
444
|
-
function
|
|
445
|
-
let [
|
|
446
|
-
function
|
|
447
|
-
|
|
457
|
+
function H({ value: e, defaultValue: t, onChange: n, fallback: r, isControlled: i }) {
|
|
458
|
+
let [a, o] = d(t ?? r), s = i ?? e !== void 0, c = s ? e : a;
|
|
459
|
+
function l(e) {
|
|
460
|
+
s || o(e), n?.(e);
|
|
448
461
|
}
|
|
449
|
-
return [
|
|
450
|
-
}
|
|
451
|
-
var
|
|
452
|
-
root: "
|
|
453
|
-
input: "
|
|
454
|
-
control: "
|
|
455
|
-
icon: "
|
|
456
|
-
label: "
|
|
462
|
+
return [c, l];
|
|
463
|
+
}
|
|
464
|
+
var U = {
|
|
465
|
+
root: "_root_ypadq_1",
|
|
466
|
+
input: "_input_ypadq_15",
|
|
467
|
+
control: "_control_ypadq_28",
|
|
468
|
+
icon: "_icon_ypadq_91",
|
|
469
|
+
label: "_label_ypadq_108"
|
|
457
470
|
};
|
|
458
471
|
//#endregion
|
|
459
472
|
//#region src/components/Checkbox.tsx
|
|
460
|
-
function
|
|
461
|
-
let
|
|
473
|
+
function te({ checked: e, defaultChecked: t, onCheckedChange: n, indeterminate: r = !1, disabled: i, required: a, invalid: s, name: c, value: l = "on", id: d, size: f = "md", className: h, ariaLabel: g, children: v, "aria-describedby": y }) {
|
|
474
|
+
let b = ee(), [x, S] = H({
|
|
462
475
|
value: e,
|
|
463
476
|
defaultValue: t,
|
|
464
477
|
onChange: n,
|
|
465
478
|
fallback: !1
|
|
466
|
-
}),
|
|
479
|
+
}), C = V({
|
|
467
480
|
id: d,
|
|
468
481
|
disabled: i,
|
|
469
482
|
required: a,
|
|
470
483
|
invalid: s,
|
|
471
484
|
"aria-describedby": y
|
|
472
|
-
})
|
|
485
|
+
});
|
|
486
|
+
B({
|
|
487
|
+
componentName: "Checkbox",
|
|
488
|
+
ariaLabel: g,
|
|
489
|
+
labelledBy: b?.labelId,
|
|
490
|
+
hasVisibleLabel: v != null,
|
|
491
|
+
disabled: C.disabled
|
|
492
|
+
});
|
|
493
|
+
let w = u(null);
|
|
473
494
|
o(() => {
|
|
474
|
-
|
|
495
|
+
w.current && (w.current.indeterminate = r);
|
|
475
496
|
}, [r]);
|
|
476
|
-
let
|
|
497
|
+
let T = r ? "indeterminate" : x ? "checked" : "unchecked", E = T === "indeterminate" ? "M4 8h8" : "M3.5 8.5l3 3 6-7";
|
|
477
498
|
return /* @__PURE__ */ m("label", {
|
|
478
499
|
"data-scope": "checkbox",
|
|
479
|
-
"data-
|
|
480
|
-
"data-
|
|
481
|
-
|
|
500
|
+
"data-state": T,
|
|
501
|
+
"data-disabled": C.disabled || void 0,
|
|
502
|
+
"data-invalid": C.invalid || void 0,
|
|
503
|
+
className: _("owo-checkbox", U.root, h),
|
|
482
504
|
children: [
|
|
483
505
|
/* @__PURE__ */ p("input", {
|
|
484
|
-
ref:
|
|
485
|
-
id:
|
|
506
|
+
ref: w,
|
|
507
|
+
id: C.id,
|
|
486
508
|
type: "checkbox",
|
|
487
509
|
name: c,
|
|
488
510
|
value: l,
|
|
489
|
-
checked:
|
|
490
|
-
disabled:
|
|
491
|
-
required:
|
|
511
|
+
checked: x,
|
|
512
|
+
disabled: C.disabled,
|
|
513
|
+
required: C.required,
|
|
492
514
|
"aria-label": g,
|
|
493
|
-
"aria-describedby":
|
|
494
|
-
"aria-invalid":
|
|
495
|
-
"aria-checked": r ? "mixed" :
|
|
496
|
-
className:
|
|
515
|
+
"aria-describedby": C["aria-describedby"],
|
|
516
|
+
"aria-invalid": C.invalid || void 0,
|
|
517
|
+
"aria-checked": r ? "mixed" : x,
|
|
518
|
+
className: U.input,
|
|
497
519
|
onChange: (e) => {
|
|
498
|
-
|
|
520
|
+
C.disabled || S(e.target.checked);
|
|
499
521
|
}
|
|
500
522
|
}),
|
|
501
523
|
/* @__PURE__ */ p("span", {
|
|
524
|
+
"data-scope": "checkbox",
|
|
502
525
|
"data-part": "control",
|
|
503
|
-
"data-state":
|
|
526
|
+
"data-state": T,
|
|
504
527
|
"data-size": f,
|
|
505
|
-
className:
|
|
506
|
-
children:
|
|
507
|
-
"aria-hidden": "true",
|
|
508
|
-
viewBox: "0 0 16 16",
|
|
509
|
-
className: H.icon,
|
|
510
|
-
children: /* @__PURE__ */ p("path", { d: "M4 8h8" })
|
|
511
|
-
}) : w === "checked" ? /* @__PURE__ */ p("svg", {
|
|
528
|
+
className: U.control,
|
|
529
|
+
children: /* @__PURE__ */ p("svg", {
|
|
512
530
|
"aria-hidden": "true",
|
|
513
531
|
viewBox: "0 0 16 16",
|
|
514
|
-
className:
|
|
515
|
-
children: /* @__PURE__ */ p("path", { d:
|
|
516
|
-
})
|
|
532
|
+
className: U.icon,
|
|
533
|
+
children: /* @__PURE__ */ p("path", { d: E })
|
|
534
|
+
})
|
|
517
535
|
}),
|
|
518
536
|
v != null && /* @__PURE__ */ p("span", {
|
|
537
|
+
"data-scope": "checkbox",
|
|
519
538
|
"data-part": "label",
|
|
520
|
-
className:
|
|
539
|
+
className: U.label,
|
|
521
540
|
children: v
|
|
522
541
|
})
|
|
523
542
|
]
|
|
@@ -530,9 +549,9 @@ var W = {
|
|
|
530
549
|
triggerIndicator: "_triggerIndicator_bx150_35",
|
|
531
550
|
triggerLabel: "_triggerLabel_bx150_44",
|
|
532
551
|
contentInner: "_contentInner_bx150_50"
|
|
533
|
-
},
|
|
534
|
-
function
|
|
535
|
-
let t = a(
|
|
552
|
+
}, G = n(null);
|
|
553
|
+
function K(e) {
|
|
554
|
+
let t = a(G);
|
|
536
555
|
if (!t) throw Error(`${e} must be used within Collapsible.Root`);
|
|
537
556
|
return t;
|
|
538
557
|
}
|
|
@@ -543,7 +562,7 @@ function ne({ open: e, defaultOpen: t, onOpenChange: n }) {
|
|
|
543
562
|
}
|
|
544
563
|
return [o, s];
|
|
545
564
|
}
|
|
546
|
-
function
|
|
565
|
+
function q({ children: e, open: t, defaultOpen: n, onOpenChange: r, classNames: i, className: a, ...o }) {
|
|
547
566
|
let [c, u] = ne({
|
|
548
567
|
open: t,
|
|
549
568
|
defaultOpen: n,
|
|
@@ -559,7 +578,7 @@ function re({ children: e, open: t, defaultOpen: n, onOpenChange: r, classNames:
|
|
|
559
578
|
u,
|
|
560
579
|
i
|
|
561
580
|
]);
|
|
562
|
-
return /* @__PURE__ */ p(
|
|
581
|
+
return /* @__PURE__ */ p(G.Provider, {
|
|
563
582
|
value: f,
|
|
564
583
|
children: /* @__PURE__ */ p("div", {
|
|
565
584
|
"data-state": c ? "open" : "closed",
|
|
@@ -570,8 +589,8 @@ function re({ children: e, open: t, defaultOpen: n, onOpenChange: r, classNames:
|
|
|
570
589
|
})
|
|
571
590
|
});
|
|
572
591
|
}
|
|
573
|
-
function
|
|
574
|
-
let { open: s, setOpen: c, contentId: l, classNames: u } =
|
|
592
|
+
function J({ children: e, icon: t, indicator: n, iconPosition: r = "start", className: i, onClick: a, ...o }) {
|
|
593
|
+
let { open: s, setOpen: c, contentId: l, classNames: u } = K("Collapsible.Trigger"), d = t !== void 0 || n !== void 0 ? /* @__PURE__ */ m("span", {
|
|
575
594
|
"data-part": "triggerInner",
|
|
576
595
|
className: _(W.triggerInner, u?.triggerInner),
|
|
577
596
|
children: [
|
|
@@ -615,8 +634,8 @@ function K({ children: e, icon: t, indicator: n, iconPosition: r = "start", clas
|
|
|
615
634
|
children: d
|
|
616
635
|
});
|
|
617
636
|
}
|
|
618
|
-
function
|
|
619
|
-
let { open: r, contentId: i, classNames: a } =
|
|
637
|
+
function Y({ children: e, className: t, ...n }) {
|
|
638
|
+
let { open: r, contentId: i, classNames: a } = K("Collapsible.Content"), [s, c] = d(r), l = u(null), f = u(null);
|
|
620
639
|
return o(() => {
|
|
621
640
|
let e = l.current, t = f.current;
|
|
622
641
|
if (!e || !t) return;
|
|
@@ -658,19 +677,19 @@ function ie({ children: e, className: t, ...n }) {
|
|
|
658
677
|
})
|
|
659
678
|
});
|
|
660
679
|
}
|
|
661
|
-
var
|
|
662
|
-
Root:
|
|
663
|
-
Trigger:
|
|
664
|
-
Content:
|
|
665
|
-
}),
|
|
666
|
-
overlay:
|
|
680
|
+
var X = Object.assign(q, {
|
|
681
|
+
Root: q,
|
|
682
|
+
Trigger: J,
|
|
683
|
+
Content: Y
|
|
684
|
+
}), re = "_overlay_1p0ee_1", ie = "_panel_1p0ee_19", ae = "_confirmDescription_1p0ee_64", oe = {
|
|
685
|
+
overlay: re,
|
|
667
686
|
"dialog-backdrop-in": "_dialog-backdrop-in_1p0ee_1",
|
|
668
|
-
panel:
|
|
687
|
+
panel: ie,
|
|
669
688
|
"dialog-in": "_dialog-in_1p0ee_1",
|
|
670
|
-
confirmDescription:
|
|
671
|
-
},
|
|
672
|
-
function
|
|
673
|
-
let r = a(
|
|
689
|
+
confirmDescription: ae
|
|
690
|
+
}, se = n(void 0);
|
|
691
|
+
function ce({ className: e, children: t, ...n }) {
|
|
692
|
+
let r = a(se);
|
|
674
693
|
return /* @__PURE__ */ p("div", {
|
|
675
694
|
"data-scope": "dialog",
|
|
676
695
|
"data-part": "header",
|
|
@@ -679,8 +698,8 @@ function de({ className: e, children: t, ...n }) {
|
|
|
679
698
|
children: t
|
|
680
699
|
});
|
|
681
700
|
}
|
|
682
|
-
function
|
|
683
|
-
let r = a(
|
|
701
|
+
function le({ className: e, children: t, ...n }) {
|
|
702
|
+
let r = a(se);
|
|
684
703
|
return /* @__PURE__ */ p("div", {
|
|
685
704
|
"data-scope": "dialog",
|
|
686
705
|
"data-part": "body",
|
|
@@ -689,8 +708,8 @@ function fe({ className: e, children: t, ...n }) {
|
|
|
689
708
|
children: t
|
|
690
709
|
});
|
|
691
710
|
}
|
|
692
|
-
function
|
|
693
|
-
let r = a(
|
|
711
|
+
function ue({ className: e, children: t, ...n }) {
|
|
712
|
+
let r = a(se);
|
|
694
713
|
return /* @__PURE__ */ p("div", {
|
|
695
714
|
"data-scope": "dialog",
|
|
696
715
|
"data-part": "footer",
|
|
@@ -699,7 +718,7 @@ function pe({ className: e, children: t, ...n }) {
|
|
|
699
718
|
children: t
|
|
700
719
|
});
|
|
701
720
|
}
|
|
702
|
-
function
|
|
721
|
+
function de({ open: e, onClose: t, size: n = "sm", children: r, className: a, overlayClassName: s, panelClassName: c, classNames: l, ...d }) {
|
|
703
722
|
let f = u(null), h = u(null), g = i((e) => {
|
|
704
723
|
e.key === "Escape" && (e.stopPropagation(), t());
|
|
705
724
|
}, [t]);
|
|
@@ -710,13 +729,13 @@ function me({ open: e, onClose: t, size: n = "sm", children: r, className: a, ov
|
|
|
710
729
|
t ? t.focus() : e.focus();
|
|
711
730
|
}), document.addEventListener("keydown", g)) : (document.body.style.overflow = "", h.current?.focus()), () => {
|
|
712
731
|
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
713
|
-
}), [e, g]), e ? /* @__PURE__ */ p(
|
|
732
|
+
}), [e, g]), e ? /* @__PURE__ */ p(se.Provider, {
|
|
714
733
|
value: l,
|
|
715
734
|
children: /* @__PURE__ */ m("div", {
|
|
716
735
|
"data-state": "open",
|
|
717
736
|
"data-scope": "dialog",
|
|
718
737
|
"data-part": "overlay",
|
|
719
|
-
className: _("owo-dialog-overlay",
|
|
738
|
+
className: _("owo-dialog-overlay", oe.overlay, l?.overlay),
|
|
720
739
|
children: [/* @__PURE__ */ p("button", {
|
|
721
740
|
type: "button",
|
|
722
741
|
"aria-label": "Close dialog",
|
|
@@ -732,23 +751,23 @@ function me({ open: e, onClose: t, size: n = "sm", children: r, className: a, ov
|
|
|
732
751
|
tabIndex: -1,
|
|
733
752
|
"data-state": "open",
|
|
734
753
|
"data-size": n,
|
|
735
|
-
className: _("owo-dialog",
|
|
754
|
+
className: _("owo-dialog", oe.panel, c, a),
|
|
736
755
|
...d,
|
|
737
756
|
children: r
|
|
738
757
|
})]
|
|
739
758
|
})
|
|
740
759
|
}) : null;
|
|
741
760
|
}
|
|
742
|
-
|
|
761
|
+
de.Header = ce, de.Body = le, de.Footer = ue;
|
|
743
762
|
//#endregion
|
|
744
763
|
//#region src/components/ConfirmDialog.tsx
|
|
745
|
-
var
|
|
746
|
-
function
|
|
747
|
-
let e = a(
|
|
764
|
+
var fe = n(null);
|
|
765
|
+
function pe() {
|
|
766
|
+
let e = a(fe);
|
|
748
767
|
if (!e) throw Error("useConfirm must be used within <ConfirmProvider>");
|
|
749
768
|
return e;
|
|
750
769
|
}
|
|
751
|
-
function
|
|
770
|
+
function me({ children: e }) {
|
|
752
771
|
let [t, n] = d(null), r = u(null), a = i((e) => (r.current && r.current.resolve(!1), new Promise((t) => {
|
|
753
772
|
let i = {
|
|
754
773
|
options: e,
|
|
@@ -758,18 +777,18 @@ function _e({ children: e }) {
|
|
|
758
777
|
})), []), o = i((e) => {
|
|
759
778
|
r.current &&= (r.current.resolve(e), null), n(null);
|
|
760
779
|
}, []);
|
|
761
|
-
return /* @__PURE__ */ m(
|
|
780
|
+
return /* @__PURE__ */ m(fe.Provider, {
|
|
762
781
|
value: a,
|
|
763
|
-
children: [e, /* @__PURE__ */ p(
|
|
782
|
+
children: [e, /* @__PURE__ */ p(de, {
|
|
764
783
|
open: t !== null,
|
|
765
784
|
onClose: () => o(!1),
|
|
766
785
|
children: t && /* @__PURE__ */ m(f, { children: [
|
|
767
|
-
/* @__PURE__ */ p(
|
|
768
|
-
/* @__PURE__ */ p(
|
|
769
|
-
className:
|
|
786
|
+
/* @__PURE__ */ p(de.Header, { children: t.options.title }),
|
|
787
|
+
/* @__PURE__ */ p(de.Body, { children: typeof t.options.description == "string" ? /* @__PURE__ */ p("p", {
|
|
788
|
+
className: oe.confirmDescription,
|
|
770
789
|
children: t.options.description
|
|
771
790
|
}) : t.options.description }),
|
|
772
|
-
/* @__PURE__ */ m(
|
|
791
|
+
/* @__PURE__ */ m(de.Footer, { children: [/* @__PURE__ */ p(R, {
|
|
773
792
|
variant: "ghost",
|
|
774
793
|
size: "sm",
|
|
775
794
|
onClick: () => o(!1),
|
|
@@ -786,75 +805,75 @@ function _e({ children: e }) {
|
|
|
786
805
|
}
|
|
787
806
|
//#endregion
|
|
788
807
|
//#region node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
789
|
-
var
|
|
808
|
+
var he = Math.min, ge = Math.max, _e = Math.round, ve = Math.floor, Z = (e) => ({
|
|
790
809
|
x: e,
|
|
791
810
|
y: e
|
|
792
|
-
}),
|
|
811
|
+
}), ye = {
|
|
793
812
|
left: "right",
|
|
794
813
|
right: "left",
|
|
795
814
|
bottom: "top",
|
|
796
815
|
top: "bottom"
|
|
797
816
|
};
|
|
798
|
-
function
|
|
799
|
-
return
|
|
817
|
+
function be(e, t, n) {
|
|
818
|
+
return ge(e, he(t, n));
|
|
800
819
|
}
|
|
801
|
-
function
|
|
820
|
+
function xe(e, t) {
|
|
802
821
|
return typeof e == "function" ? e(t) : e;
|
|
803
822
|
}
|
|
804
|
-
function
|
|
823
|
+
function Q(e) {
|
|
805
824
|
return e.split("-")[0];
|
|
806
825
|
}
|
|
807
|
-
function
|
|
826
|
+
function Se(e) {
|
|
808
827
|
return e.split("-")[1];
|
|
809
828
|
}
|
|
810
|
-
function
|
|
829
|
+
function Ce(e) {
|
|
811
830
|
return e === "x" ? "y" : "x";
|
|
812
831
|
}
|
|
813
|
-
function
|
|
832
|
+
function we(e) {
|
|
814
833
|
return e === "y" ? "height" : "width";
|
|
815
834
|
}
|
|
816
|
-
function
|
|
835
|
+
function Te(e) {
|
|
817
836
|
let t = e[0];
|
|
818
837
|
return t === "t" || t === "b" ? "y" : "x";
|
|
819
838
|
}
|
|
820
|
-
function
|
|
821
|
-
return
|
|
839
|
+
function Ee(e) {
|
|
840
|
+
return Ce(Te(e));
|
|
822
841
|
}
|
|
823
|
-
function
|
|
842
|
+
function De(e, t, n) {
|
|
824
843
|
n === void 0 && (n = !1);
|
|
825
|
-
let r =
|
|
826
|
-
return t.reference[a] > t.floating[a] && (o =
|
|
844
|
+
let r = Se(e), i = Ee(e), a = we(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
845
|
+
return t.reference[a] > t.floating[a] && (o = Ie(o)), [o, Ie(o)];
|
|
827
846
|
}
|
|
828
|
-
function
|
|
829
|
-
let t =
|
|
847
|
+
function Oe(e) {
|
|
848
|
+
let t = Ie(e);
|
|
830
849
|
return [
|
|
831
|
-
|
|
850
|
+
ke(e),
|
|
832
851
|
t,
|
|
833
|
-
|
|
852
|
+
ke(t)
|
|
834
853
|
];
|
|
835
854
|
}
|
|
836
|
-
function
|
|
855
|
+
function ke(e) {
|
|
837
856
|
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
838
857
|
}
|
|
839
|
-
var
|
|
840
|
-
function
|
|
858
|
+
var Ae = ["left", "right"], je = ["right", "left"], Me = ["top", "bottom"], Ne = ["bottom", "top"];
|
|
859
|
+
function Pe(e, t, n) {
|
|
841
860
|
switch (e) {
|
|
842
861
|
case "top":
|
|
843
|
-
case "bottom": return n ? t ?
|
|
862
|
+
case "bottom": return n ? t ? je : Ae : t ? Ae : je;
|
|
844
863
|
case "left":
|
|
845
|
-
case "right": return t ?
|
|
864
|
+
case "right": return t ? Me : Ne;
|
|
846
865
|
default: return [];
|
|
847
866
|
}
|
|
848
867
|
}
|
|
849
|
-
function
|
|
850
|
-
let i =
|
|
851
|
-
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(
|
|
868
|
+
function Fe(e, t, n, r) {
|
|
869
|
+
let i = Se(e), a = Pe(Q(e), n === "start", r);
|
|
870
|
+
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(ke)))), a;
|
|
852
871
|
}
|
|
853
|
-
function
|
|
854
|
-
let t =
|
|
855
|
-
return
|
|
872
|
+
function Ie(e) {
|
|
873
|
+
let t = Q(e);
|
|
874
|
+
return ye[t] + e.slice(t.length);
|
|
856
875
|
}
|
|
857
|
-
function
|
|
876
|
+
function Le(e) {
|
|
858
877
|
return {
|
|
859
878
|
top: 0,
|
|
860
879
|
right: 0,
|
|
@@ -863,15 +882,15 @@ function Ve(e) {
|
|
|
863
882
|
...e
|
|
864
883
|
};
|
|
865
884
|
}
|
|
866
|
-
function
|
|
885
|
+
function Re(e) {
|
|
867
886
|
return typeof e == "number" ? {
|
|
868
887
|
top: e,
|
|
869
888
|
right: e,
|
|
870
889
|
bottom: e,
|
|
871
890
|
left: e
|
|
872
|
-
} :
|
|
891
|
+
} : Le(e);
|
|
873
892
|
}
|
|
874
|
-
function
|
|
893
|
+
function ze(e) {
|
|
875
894
|
let { x: t, y: n, width: r, height: i } = e;
|
|
876
895
|
return {
|
|
877
896
|
width: r,
|
|
@@ -886,8 +905,8 @@ function Ue(e) {
|
|
|
886
905
|
}
|
|
887
906
|
//#endregion
|
|
888
907
|
//#region node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
889
|
-
function
|
|
890
|
-
let { reference: r, floating: i } = e, a =
|
|
908
|
+
function Be(e, t, n) {
|
|
909
|
+
let { reference: r, floating: i } = e, a = Te(t), o = Ee(t), s = we(o), c = Q(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
|
|
891
910
|
switch (c) {
|
|
892
911
|
case "top":
|
|
893
912
|
p = {
|
|
@@ -918,7 +937,7 @@ function We(e, t, n) {
|
|
|
918
937
|
y: r.y
|
|
919
938
|
};
|
|
920
939
|
}
|
|
921
|
-
switch (
|
|
940
|
+
switch (Se(t)) {
|
|
922
941
|
case "start":
|
|
923
942
|
p[o] -= f * (n && l ? -1 : 1);
|
|
924
943
|
break;
|
|
@@ -928,9 +947,9 @@ function We(e, t, n) {
|
|
|
928
947
|
}
|
|
929
948
|
return p;
|
|
930
949
|
}
|
|
931
|
-
async function
|
|
950
|
+
async function Ve(e, t) {
|
|
932
951
|
t === void 0 && (t = {});
|
|
933
|
-
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } =
|
|
952
|
+
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = xe(t, e), p = Re(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = ze(await i.getClippingRect({
|
|
934
953
|
element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
|
|
935
954
|
boundary: c,
|
|
936
955
|
rootBoundary: l,
|
|
@@ -943,7 +962,7 @@ async function Ge(e, t) {
|
|
|
943
962
|
} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
|
|
944
963
|
x: 1,
|
|
945
964
|
y: 1
|
|
946
|
-
}, y =
|
|
965
|
+
}, y = ze(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
947
966
|
elements: o,
|
|
948
967
|
rect: g,
|
|
949
968
|
offsetParent: _,
|
|
@@ -956,15 +975,15 @@ async function Ge(e, t) {
|
|
|
956
975
|
right: (y.right - h.right + p.right) / v.x
|
|
957
976
|
};
|
|
958
977
|
}
|
|
959
|
-
var
|
|
978
|
+
var He = 50, Ue = async (e, t, n) => {
|
|
960
979
|
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
|
|
961
980
|
...o,
|
|
962
|
-
detectOverflow:
|
|
981
|
+
detectOverflow: Ve
|
|
963
982
|
}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
964
983
|
reference: e,
|
|
965
984
|
floating: t,
|
|
966
985
|
strategy: i
|
|
967
|
-
}), { x: u, y: d } =
|
|
986
|
+
}), { x: u, y: d } = Be(l, r, c), f = r, p = 0, m = {};
|
|
968
987
|
for (let n = 0; n < a.length; n++) {
|
|
969
988
|
let h = a[n];
|
|
970
989
|
if (!h) continue;
|
|
@@ -985,11 +1004,11 @@ var Ke = 50, qe = async (e, t, n) => {
|
|
|
985
1004
|
u = v ?? u, d = y ?? d, m[g] = {
|
|
986
1005
|
...m[g],
|
|
987
1006
|
...b
|
|
988
|
-
}, x && p <
|
|
1007
|
+
}, x && p < He && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
989
1008
|
reference: e,
|
|
990
1009
|
floating: t,
|
|
991
1010
|
strategy: i
|
|
992
|
-
}) : x.rects), {x: u, y: d} =
|
|
1011
|
+
}) : x.rects), {x: u, y: d} = Be(l, f, c)), n = -1);
|
|
993
1012
|
}
|
|
994
1013
|
return {
|
|
995
1014
|
x: u,
|
|
@@ -998,18 +1017,18 @@ var Ke = 50, qe = async (e, t, n) => {
|
|
|
998
1017
|
strategy: i,
|
|
999
1018
|
middlewareData: m
|
|
1000
1019
|
};
|
|
1001
|
-
},
|
|
1020
|
+
}, We = (e) => ({
|
|
1002
1021
|
name: "arrow",
|
|
1003
1022
|
options: e,
|
|
1004
1023
|
async fn(t) {
|
|
1005
|
-
let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } =
|
|
1024
|
+
let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = xe(e, t) || {};
|
|
1006
1025
|
if (l == null) return {};
|
|
1007
|
-
let d =
|
|
1026
|
+
let d = Re(u), f = {
|
|
1008
1027
|
x: n,
|
|
1009
1028
|
y: r
|
|
1010
|
-
}, p =
|
|
1029
|
+
}, p = Ee(i), m = we(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
|
|
1011
1030
|
(!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
|
|
1012
|
-
let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E =
|
|
1031
|
+
let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = he(d[_], T), D = he(d[v], T), O = E, k = C - h[m] - D, A = C / 2 - h[m] / 2 + w, j = be(O, A, k), M = !c.arrow && Se(i) != null && A !== j && a.reference[m] / 2 - (A < O ? E : D) - h[m] / 2 < 0, N = M ? A < O ? A - O : A - k : 0;
|
|
1013
1032
|
return {
|
|
1014
1033
|
[p]: f[p] + N,
|
|
1015
1034
|
data: {
|
|
@@ -1020,19 +1039,19 @@ var Ke = 50, qe = async (e, t, n) => {
|
|
|
1020
1039
|
reset: M
|
|
1021
1040
|
};
|
|
1022
1041
|
}
|
|
1023
|
-
}),
|
|
1042
|
+
}), Ge = function(e) {
|
|
1024
1043
|
return e === void 0 && (e = {}), {
|
|
1025
1044
|
name: "flip",
|
|
1026
1045
|
options: e,
|
|
1027
1046
|
async fn(t) {
|
|
1028
1047
|
var n;
|
|
1029
|
-
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } =
|
|
1048
|
+
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = xe(e, t);
|
|
1030
1049
|
if ((n = i.arrow) != null && n.alignmentOffset) return {};
|
|
1031
|
-
let g =
|
|
1032
|
-
!d && x && b.push(...
|
|
1050
|
+
let g = Q(r), _ = Te(o), v = Q(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Ie(o)] : Oe(o)), x = p !== "none";
|
|
1051
|
+
!d && x && b.push(...Fe(o, m, p, y));
|
|
1033
1052
|
let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
|
|
1034
1053
|
if (l && w.push(C[g]), u) {
|
|
1035
|
-
let e =
|
|
1054
|
+
let e = De(r, a, y);
|
|
1036
1055
|
w.push(C[e[0]], C[e[1]]);
|
|
1037
1056
|
}
|
|
1038
1057
|
if (T = [...T, {
|
|
@@ -1040,7 +1059,7 @@ var Ke = 50, qe = async (e, t, n) => {
|
|
|
1040
1059
|
overflows: w
|
|
1041
1060
|
}], !w.every((e) => e <= 0)) {
|
|
1042
1061
|
let e = (i.flip?.index || 0) + 1, t = S[e];
|
|
1043
|
-
if (t && (!(u === "alignment" && _ !==
|
|
1062
|
+
if (t && (!(u === "alignment" && _ !== Te(t)) || T.every((e) => Te(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
|
|
1044
1063
|
data: {
|
|
1045
1064
|
index: e,
|
|
1046
1065
|
overflows: T
|
|
@@ -1052,7 +1071,7 @@ var Ke = 50, qe = async (e, t, n) => {
|
|
|
1052
1071
|
case "bestFit": {
|
|
1053
1072
|
let e = T.filter((e) => {
|
|
1054
1073
|
if (x) {
|
|
1055
|
-
let t =
|
|
1074
|
+
let t = Te(e.placement);
|
|
1056
1075
|
return t === _ || t === "y";
|
|
1057
1076
|
}
|
|
1058
1077
|
return !0;
|
|
@@ -1069,9 +1088,9 @@ var Ke = 50, qe = async (e, t, n) => {
|
|
|
1069
1088
|
return {};
|
|
1070
1089
|
}
|
|
1071
1090
|
};
|
|
1072
|
-
},
|
|
1073
|
-
async function
|
|
1074
|
-
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o =
|
|
1091
|
+
}, Ke = /* @__PURE__ */ new Set(["left", "top"]);
|
|
1092
|
+
async function qe(e, t) {
|
|
1093
|
+
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = Q(n), s = Se(n), c = Te(n) === "y", l = Ke.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = xe(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
|
|
1075
1094
|
mainAxis: d,
|
|
1076
1095
|
crossAxis: 0,
|
|
1077
1096
|
alignmentAxis: null
|
|
@@ -1088,13 +1107,13 @@ async function Ze(e, t) {
|
|
|
1088
1107
|
y: p * u
|
|
1089
1108
|
};
|
|
1090
1109
|
}
|
|
1091
|
-
var
|
|
1110
|
+
var Je = function(e) {
|
|
1092
1111
|
return e === void 0 && (e = 0), {
|
|
1093
1112
|
name: "offset",
|
|
1094
1113
|
options: e,
|
|
1095
1114
|
async fn(t) {
|
|
1096
1115
|
var n;
|
|
1097
|
-
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await
|
|
1116
|
+
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await qe(t, e);
|
|
1098
1117
|
return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
|
|
1099
1118
|
x: r + s.x,
|
|
1100
1119
|
y: i + s.y,
|
|
@@ -1105,7 +1124,7 @@ var Qe = function(e) {
|
|
|
1105
1124
|
};
|
|
1106
1125
|
}
|
|
1107
1126
|
};
|
|
1108
|
-
},
|
|
1127
|
+
}, Ye = function(e) {
|
|
1109
1128
|
return e === void 0 && (e = {}), {
|
|
1110
1129
|
name: "shift",
|
|
1111
1130
|
options: e,
|
|
@@ -1116,17 +1135,17 @@ var Qe = function(e) {
|
|
|
1116
1135
|
x: t,
|
|
1117
1136
|
y: n
|
|
1118
1137
|
};
|
|
1119
|
-
} }, ...l } =
|
|
1138
|
+
} }, ...l } = xe(e, t), u = {
|
|
1120
1139
|
x: n,
|
|
1121
1140
|
y: r
|
|
1122
|
-
}, d = await a.detectOverflow(t, l), f =
|
|
1141
|
+
}, d = await a.detectOverflow(t, l), f = Te(Q(i)), p = Ce(f), m = u[p], h = u[f];
|
|
1123
1142
|
if (o) {
|
|
1124
1143
|
let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
|
|
1125
|
-
m =
|
|
1144
|
+
m = be(n, m, r);
|
|
1126
1145
|
}
|
|
1127
1146
|
if (s) {
|
|
1128
1147
|
let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
|
|
1129
|
-
h =
|
|
1148
|
+
h = be(n, h, r);
|
|
1130
1149
|
}
|
|
1131
1150
|
let g = c.fn({
|
|
1132
1151
|
...t,
|
|
@@ -1149,39 +1168,39 @@ var Qe = function(e) {
|
|
|
1149
1168
|
};
|
|
1150
1169
|
//#endregion
|
|
1151
1170
|
//#region node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
1152
|
-
function
|
|
1171
|
+
function Xe() {
|
|
1153
1172
|
return typeof window < "u";
|
|
1154
1173
|
}
|
|
1155
|
-
function
|
|
1156
|
-
return
|
|
1174
|
+
function Ze(e) {
|
|
1175
|
+
return et(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
1157
1176
|
}
|
|
1158
|
-
function
|
|
1177
|
+
function Qe(e) {
|
|
1159
1178
|
var t;
|
|
1160
1179
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
1161
1180
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return ((
|
|
1181
|
+
function $e(e) {
|
|
1182
|
+
return ((et(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
1164
1183
|
}
|
|
1165
|
-
function
|
|
1166
|
-
return
|
|
1184
|
+
function et(e) {
|
|
1185
|
+
return Xe() ? e instanceof Node || e instanceof Qe(e).Node : !1;
|
|
1186
|
+
}
|
|
1187
|
+
function tt(e) {
|
|
1188
|
+
return Xe() ? e instanceof Element || e instanceof Qe(e).Element : !1;
|
|
1167
1189
|
}
|
|
1168
|
-
function
|
|
1169
|
-
return
|
|
1190
|
+
function nt(e) {
|
|
1191
|
+
return Xe() ? e instanceof HTMLElement || e instanceof Qe(e).HTMLElement : !1;
|
|
1170
1192
|
}
|
|
1171
1193
|
function rt(e) {
|
|
1172
|
-
return
|
|
1194
|
+
return !Xe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Qe(e).ShadowRoot;
|
|
1173
1195
|
}
|
|
1174
1196
|
function it(e) {
|
|
1175
|
-
|
|
1197
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = ht(e);
|
|
1198
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
1176
1199
|
}
|
|
1177
1200
|
function at(e) {
|
|
1178
|
-
|
|
1179
|
-
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
1201
|
+
return /^(table|td|th)$/.test(Ze(e));
|
|
1180
1202
|
}
|
|
1181
1203
|
function ot(e) {
|
|
1182
|
-
return /^(table|td|th)$/.test(tt(e));
|
|
1183
|
-
}
|
|
1184
|
-
function st(e) {
|
|
1185
1204
|
try {
|
|
1186
1205
|
if (e.matches(":popover-open")) return !0;
|
|
1187
1206
|
} catch {}
|
|
@@ -1191,31 +1210,31 @@ function st(e) {
|
|
|
1191
1210
|
return !1;
|
|
1192
1211
|
}
|
|
1193
1212
|
}
|
|
1194
|
-
var
|
|
1195
|
-
function
|
|
1196
|
-
let t =
|
|
1197
|
-
return
|
|
1213
|
+
var st = /transform|translate|scale|rotate|perspective|filter/, ct = /paint|layout|strict|content/, lt = (e) => !!e && e !== "none", ut;
|
|
1214
|
+
function dt(e) {
|
|
1215
|
+
let t = tt(e) ? ht(e) : e;
|
|
1216
|
+
return lt(t.transform) || lt(t.translate) || lt(t.scale) || lt(t.rotate) || lt(t.perspective) || !pt() && (lt(t.backdropFilter) || lt(t.filter)) || st.test(t.willChange || "") || ct.test(t.contain || "");
|
|
1198
1217
|
}
|
|
1199
|
-
function
|
|
1218
|
+
function ft(e) {
|
|
1200
1219
|
let t = _t(e);
|
|
1201
|
-
for (;
|
|
1202
|
-
if (
|
|
1203
|
-
if (
|
|
1220
|
+
for (; nt(t) && !mt(t);) {
|
|
1221
|
+
if (dt(t)) return t;
|
|
1222
|
+
if (ot(t)) return null;
|
|
1204
1223
|
t = _t(t);
|
|
1205
1224
|
}
|
|
1206
1225
|
return null;
|
|
1207
1226
|
}
|
|
1208
|
-
function
|
|
1209
|
-
return
|
|
1227
|
+
function pt() {
|
|
1228
|
+
return ut ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), ut;
|
|
1210
1229
|
}
|
|
1211
|
-
function
|
|
1212
|
-
return /^(html|body|#document)$/.test(
|
|
1230
|
+
function mt(e) {
|
|
1231
|
+
return /^(html|body|#document)$/.test(Ze(e));
|
|
1213
1232
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return
|
|
1233
|
+
function ht(e) {
|
|
1234
|
+
return Qe(e).getComputedStyle(e);
|
|
1216
1235
|
}
|
|
1217
1236
|
function gt(e) {
|
|
1218
|
-
return
|
|
1237
|
+
return tt(e) ? {
|
|
1219
1238
|
scrollLeft: e.scrollLeft,
|
|
1220
1239
|
scrollTop: e.scrollTop
|
|
1221
1240
|
} : {
|
|
@@ -1224,20 +1243,20 @@ function gt(e) {
|
|
|
1224
1243
|
};
|
|
1225
1244
|
}
|
|
1226
1245
|
function _t(e) {
|
|
1227
|
-
if (
|
|
1228
|
-
let t = e.assignedSlot || e.parentNode ||
|
|
1229
|
-
return
|
|
1246
|
+
if (Ze(e) === "html") return e;
|
|
1247
|
+
let t = e.assignedSlot || e.parentNode || rt(e) && e.host || $e(e);
|
|
1248
|
+
return rt(t) ? t.host : t;
|
|
1230
1249
|
}
|
|
1231
1250
|
function vt(e) {
|
|
1232
1251
|
let t = _t(e);
|
|
1233
|
-
return
|
|
1252
|
+
return mt(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : nt(t) && it(t) ? t : vt(t);
|
|
1234
1253
|
}
|
|
1235
1254
|
function yt(e, t, n) {
|
|
1236
1255
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
1237
|
-
let r = vt(e), i = r === e.ownerDocument?.body, a =
|
|
1256
|
+
let r = vt(e), i = r === e.ownerDocument?.body, a = Qe(r);
|
|
1238
1257
|
if (i) {
|
|
1239
1258
|
let e = bt(a);
|
|
1240
|
-
return t.concat(a, a.visualViewport || [],
|
|
1259
|
+
return t.concat(a, a.visualViewport || [], it(r) ? r : [], e && n ? yt(e) : []);
|
|
1241
1260
|
} else return t.concat(r, yt(r, [], n));
|
|
1242
1261
|
}
|
|
1243
1262
|
function bt(e) {
|
|
@@ -1246,7 +1265,7 @@ function bt(e) {
|
|
|
1246
1265
|
//#endregion
|
|
1247
1266
|
//#region node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
1248
1267
|
function xt(e) {
|
|
1249
|
-
let t =
|
|
1268
|
+
let t = ht(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = nt(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = _e(n) !== a || _e(r) !== o;
|
|
1250
1269
|
return s && (n = a, r = o), {
|
|
1251
1270
|
width: n,
|
|
1252
1271
|
height: r,
|
|
@@ -1254,41 +1273,41 @@ function xt(e) {
|
|
|
1254
1273
|
};
|
|
1255
1274
|
}
|
|
1256
1275
|
function St(e) {
|
|
1257
|
-
return
|
|
1276
|
+
return tt(e) ? e : e.contextElement;
|
|
1258
1277
|
}
|
|
1259
1278
|
function Ct(e) {
|
|
1260
1279
|
let t = St(e);
|
|
1261
|
-
if (!
|
|
1262
|
-
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = xt(t), o = (a ?
|
|
1280
|
+
if (!nt(t)) return Z(1);
|
|
1281
|
+
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = xt(t), o = (a ? _e(n.width) : n.width) / r, s = (a ? _e(n.height) : n.height) / i;
|
|
1263
1282
|
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
1264
1283
|
x: o,
|
|
1265
1284
|
y: s
|
|
1266
1285
|
};
|
|
1267
1286
|
}
|
|
1268
|
-
var wt = /* @__PURE__ */
|
|
1287
|
+
var wt = /* @__PURE__ */ Z(0);
|
|
1269
1288
|
function Tt(e) {
|
|
1270
|
-
let t =
|
|
1271
|
-
return !
|
|
1289
|
+
let t = Qe(e);
|
|
1290
|
+
return !pt() || !t.visualViewport ? wt : {
|
|
1272
1291
|
x: t.visualViewport.offsetLeft,
|
|
1273
1292
|
y: t.visualViewport.offsetTop
|
|
1274
1293
|
};
|
|
1275
1294
|
}
|
|
1276
1295
|
function Et(e, t, n) {
|
|
1277
|
-
return t === void 0 && (t = !1), !n || t && n !==
|
|
1296
|
+
return t === void 0 && (t = !1), !n || t && n !== Qe(e) ? !1 : t;
|
|
1278
1297
|
}
|
|
1279
1298
|
function Dt(e, t, n, r) {
|
|
1280
1299
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1281
|
-
let i = e.getBoundingClientRect(), a = St(e), o =
|
|
1282
|
-
t && (r ?
|
|
1283
|
-
let s = Et(a, n, r) ? Tt(a) :
|
|
1300
|
+
let i = e.getBoundingClientRect(), a = St(e), o = Z(1);
|
|
1301
|
+
t && (r ? tt(r) && (o = Ct(r)) : o = Ct(e));
|
|
1302
|
+
let s = Et(a, n, r) ? Tt(a) : Z(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
|
|
1284
1303
|
if (a) {
|
|
1285
|
-
let e =
|
|
1304
|
+
let e = Qe(a), t = r && tt(r) ? Qe(r) : r, n = e, i = bt(n);
|
|
1286
1305
|
for (; i && r && t !== n;) {
|
|
1287
|
-
let e = Ct(i), t = i.getBoundingClientRect(), r =
|
|
1288
|
-
c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n =
|
|
1306
|
+
let e = Ct(i), t = i.getBoundingClientRect(), r = ht(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
|
|
1307
|
+
c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = Qe(i), i = bt(n);
|
|
1289
1308
|
}
|
|
1290
1309
|
}
|
|
1291
|
-
return
|
|
1310
|
+
return ze({
|
|
1292
1311
|
width: u,
|
|
1293
1312
|
height: d,
|
|
1294
1313
|
x: c,
|
|
@@ -1297,7 +1316,7 @@ function Dt(e, t, n, r) {
|
|
|
1297
1316
|
}
|
|
1298
1317
|
function Ot(e, t) {
|
|
1299
1318
|
let n = gt(e).scrollLeft;
|
|
1300
|
-
return t ? t.left + n : Dt(
|
|
1319
|
+
return t ? t.left + n : Dt($e(e)).left + n;
|
|
1301
1320
|
}
|
|
1302
1321
|
function kt(e, t) {
|
|
1303
1322
|
let n = e.getBoundingClientRect();
|
|
@@ -1307,17 +1326,17 @@ function kt(e, t) {
|
|
|
1307
1326
|
};
|
|
1308
1327
|
}
|
|
1309
1328
|
function At(e) {
|
|
1310
|
-
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o =
|
|
1329
|
+
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = $e(r), s = t ? ot(t.floating) : !1;
|
|
1311
1330
|
if (r === o || s && a) return n;
|
|
1312
1331
|
let c = {
|
|
1313
1332
|
scrollLeft: 0,
|
|
1314
1333
|
scrollTop: 0
|
|
1315
|
-
}, l =
|
|
1316
|
-
if ((d || !d && !a) && ((
|
|
1334
|
+
}, l = Z(1), u = Z(0), d = nt(r);
|
|
1335
|
+
if ((d || !d && !a) && ((Ze(r) !== "body" || it(o)) && (c = gt(r)), d)) {
|
|
1317
1336
|
let e = Dt(r);
|
|
1318
1337
|
l = Ct(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
|
|
1319
1338
|
}
|
|
1320
|
-
let f = o && !d && !a ? kt(o, c) :
|
|
1339
|
+
let f = o && !d && !a ? kt(o, c) : Z(0);
|
|
1321
1340
|
return {
|
|
1322
1341
|
width: n.width * l.x,
|
|
1323
1342
|
height: n.height * l.y,
|
|
@@ -1329,8 +1348,8 @@ function jt(e) {
|
|
|
1329
1348
|
return Array.from(e.getClientRects());
|
|
1330
1349
|
}
|
|
1331
1350
|
function Mt(e) {
|
|
1332
|
-
let t =
|
|
1333
|
-
return
|
|
1351
|
+
let t = $e(e), n = gt(e), r = e.ownerDocument.body, i = ge(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = ge(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Ot(e), s = -n.scrollTop;
|
|
1352
|
+
return ht(r).direction === "rtl" && (o += ge(t.clientWidth, r.clientWidth) - i), {
|
|
1334
1353
|
width: i,
|
|
1335
1354
|
height: a,
|
|
1336
1355
|
x: o,
|
|
@@ -1339,10 +1358,10 @@ function Mt(e) {
|
|
|
1339
1358
|
}
|
|
1340
1359
|
var Nt = 25;
|
|
1341
1360
|
function Pt(e, t) {
|
|
1342
|
-
let n =
|
|
1361
|
+
let n = Qe(e), r = $e(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
|
|
1343
1362
|
if (i) {
|
|
1344
1363
|
a = i.width, o = i.height;
|
|
1345
|
-
let e =
|
|
1364
|
+
let e = pt();
|
|
1346
1365
|
(!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
|
|
1347
1366
|
}
|
|
1348
1367
|
let l = Ot(r);
|
|
@@ -1358,7 +1377,7 @@ function Pt(e, t) {
|
|
|
1358
1377
|
};
|
|
1359
1378
|
}
|
|
1360
1379
|
function Ft(e, t) {
|
|
1361
|
-
let n = Dt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a =
|
|
1380
|
+
let n = Dt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = nt(e) ? Ct(e) : Z(1);
|
|
1362
1381
|
return {
|
|
1363
1382
|
width: e.clientWidth * a.x,
|
|
1364
1383
|
height: e.clientHeight * a.y,
|
|
@@ -1369,8 +1388,8 @@ function Ft(e, t) {
|
|
|
1369
1388
|
function It(e, t, n) {
|
|
1370
1389
|
let r;
|
|
1371
1390
|
if (t === "viewport") r = Pt(e, n);
|
|
1372
|
-
else if (t === "document") r = Mt(
|
|
1373
|
-
else if (
|
|
1391
|
+
else if (t === "document") r = Mt($e(e));
|
|
1392
|
+
else if (tt(t)) r = Ft(t, n);
|
|
1374
1393
|
else {
|
|
1375
1394
|
let n = Tt(e);
|
|
1376
1395
|
r = {
|
|
@@ -1380,27 +1399,27 @@ function It(e, t, n) {
|
|
|
1380
1399
|
height: t.height
|
|
1381
1400
|
};
|
|
1382
1401
|
}
|
|
1383
|
-
return
|
|
1402
|
+
return ze(r);
|
|
1384
1403
|
}
|
|
1385
1404
|
function Lt(e, t) {
|
|
1386
1405
|
let n = _t(e);
|
|
1387
|
-
return n === t || !
|
|
1406
|
+
return n === t || !tt(n) || mt(n) ? !1 : ht(n).position === "fixed" || Lt(n, t);
|
|
1388
1407
|
}
|
|
1389
1408
|
function Rt(e, t) {
|
|
1390
1409
|
let n = t.get(e);
|
|
1391
1410
|
if (n) return n;
|
|
1392
|
-
let r = yt(e, [], !1).filter((e) =>
|
|
1393
|
-
for (;
|
|
1394
|
-
let t =
|
|
1395
|
-
!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") ||
|
|
1411
|
+
let r = yt(e, [], !1).filter((e) => tt(e) && Ze(e) !== "body"), i = null, a = ht(e).position === "fixed", o = a ? _t(e) : e;
|
|
1412
|
+
for (; tt(o) && !mt(o);) {
|
|
1413
|
+
let t = ht(o), n = dt(o);
|
|
1414
|
+
!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || it(o) && !n && Lt(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = _t(o);
|
|
1396
1415
|
}
|
|
1397
1416
|
return t.set(e, r), r;
|
|
1398
1417
|
}
|
|
1399
1418
|
function zt(e) {
|
|
1400
|
-
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ?
|
|
1419
|
+
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? ot(t) ? [] : Rt(t, this._c) : [].concat(n), r], o = It(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
|
|
1401
1420
|
for (let e = 1; e < a.length; e++) {
|
|
1402
1421
|
let n = It(t, a[e], i);
|
|
1403
|
-
s =
|
|
1422
|
+
s = ge(n.top, s), c = he(n.right, c), l = he(n.bottom, l), u = ge(n.left, u);
|
|
1404
1423
|
}
|
|
1405
1424
|
return {
|
|
1406
1425
|
width: c - u,
|
|
@@ -1417,19 +1436,19 @@ function Bt(e) {
|
|
|
1417
1436
|
};
|
|
1418
1437
|
}
|
|
1419
1438
|
function Vt(e, t, n) {
|
|
1420
|
-
let r =
|
|
1439
|
+
let r = nt(t), i = $e(t), a = n === "fixed", o = Dt(e, !0, a, t), s = {
|
|
1421
1440
|
scrollLeft: 0,
|
|
1422
1441
|
scrollTop: 0
|
|
1423
|
-
}, c =
|
|
1442
|
+
}, c = Z(0);
|
|
1424
1443
|
function l() {
|
|
1425
1444
|
c.x = Ot(i);
|
|
1426
1445
|
}
|
|
1427
|
-
if (r || !r && !a) if ((
|
|
1446
|
+
if (r || !r && !a) if ((Ze(t) !== "body" || it(i)) && (s = gt(t)), r) {
|
|
1428
1447
|
let e = Dt(t, !0, a, t);
|
|
1429
1448
|
c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
|
|
1430
1449
|
} else i && l();
|
|
1431
1450
|
a && !r && i && l();
|
|
1432
|
-
let u = i && !r && !a ? kt(i, s) :
|
|
1451
|
+
let u = i && !r && !a ? kt(i, s) : Z(0);
|
|
1433
1452
|
return {
|
|
1434
1453
|
x: o.left + s.scrollLeft - c.x - u.x,
|
|
1435
1454
|
y: o.top + s.scrollTop - c.y - u.y,
|
|
@@ -1438,28 +1457,28 @@ function Vt(e, t, n) {
|
|
|
1438
1457
|
};
|
|
1439
1458
|
}
|
|
1440
1459
|
function Ht(e) {
|
|
1441
|
-
return
|
|
1460
|
+
return ht(e).position === "static";
|
|
1442
1461
|
}
|
|
1443
1462
|
function Ut(e, t) {
|
|
1444
|
-
if (!
|
|
1463
|
+
if (!nt(e) || ht(e).position === "fixed") return null;
|
|
1445
1464
|
if (t) return t(e);
|
|
1446
1465
|
let n = e.offsetParent;
|
|
1447
|
-
return
|
|
1466
|
+
return $e(e) === n && (n = n.ownerDocument.body), n;
|
|
1448
1467
|
}
|
|
1449
1468
|
function Wt(e, t) {
|
|
1450
|
-
let n =
|
|
1451
|
-
if (
|
|
1452
|
-
if (!
|
|
1469
|
+
let n = Qe(e);
|
|
1470
|
+
if (ot(e)) return n;
|
|
1471
|
+
if (!nt(e)) {
|
|
1453
1472
|
let t = _t(e);
|
|
1454
|
-
for (; t && !
|
|
1455
|
-
if (
|
|
1473
|
+
for (; t && !mt(t);) {
|
|
1474
|
+
if (tt(t) && !Ht(t)) return t;
|
|
1456
1475
|
t = _t(t);
|
|
1457
1476
|
}
|
|
1458
1477
|
return n;
|
|
1459
1478
|
}
|
|
1460
1479
|
let r = Ut(e, t);
|
|
1461
|
-
for (; r &&
|
|
1462
|
-
return r &&
|
|
1480
|
+
for (; r && at(r) && Ht(r);) r = Ut(r, t);
|
|
1481
|
+
return r && mt(r) && Ht(r) && !dt(r) ? n : r || ft(e) || n;
|
|
1463
1482
|
}
|
|
1464
1483
|
var Gt = async function(e) {
|
|
1465
1484
|
let t = this.getOffsetParent || Wt, n = this.getDimensions, r = await n(e.floating);
|
|
@@ -1474,25 +1493,25 @@ var Gt = async function(e) {
|
|
|
1474
1493
|
};
|
|
1475
1494
|
};
|
|
1476
1495
|
function Kt(e) {
|
|
1477
|
-
return
|
|
1496
|
+
return ht(e).direction === "rtl";
|
|
1478
1497
|
}
|
|
1479
1498
|
var qt = {
|
|
1480
1499
|
convertOffsetParentRelativeRectToViewportRelativeRect: At,
|
|
1481
|
-
getDocumentElement:
|
|
1500
|
+
getDocumentElement: $e,
|
|
1482
1501
|
getClippingRect: zt,
|
|
1483
1502
|
getOffsetParent: Wt,
|
|
1484
1503
|
getElementRects: Gt,
|
|
1485
1504
|
getClientRects: jt,
|
|
1486
1505
|
getDimensions: Bt,
|
|
1487
1506
|
getScale: Ct,
|
|
1488
|
-
isElement:
|
|
1507
|
+
isElement: tt,
|
|
1489
1508
|
isRTL: Kt
|
|
1490
1509
|
};
|
|
1491
1510
|
function Jt(e, t) {
|
|
1492
1511
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1493
1512
|
}
|
|
1494
1513
|
function Yt(e, t) {
|
|
1495
|
-
let n = null, r, i =
|
|
1514
|
+
let n = null, r, i = $e(e);
|
|
1496
1515
|
function a() {
|
|
1497
1516
|
var e;
|
|
1498
1517
|
clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
|
|
@@ -1501,9 +1520,9 @@ function Yt(e, t) {
|
|
|
1501
1520
|
s === void 0 && (s = !1), c === void 0 && (c = 1), a();
|
|
1502
1521
|
let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
|
|
1503
1522
|
if (s || t(), !f || !p) return;
|
|
1504
|
-
let m =
|
|
1523
|
+
let m = ve(d), h = ve(i.clientWidth - (u + f)), g = ve(i.clientHeight - (d + p)), _ = ve(u), v = {
|
|
1505
1524
|
rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
|
|
1506
|
-
threshold:
|
|
1525
|
+
threshold: ge(0, he(1, c)) || 1
|
|
1507
1526
|
}, y = !0;
|
|
1508
1527
|
function b(t) {
|
|
1509
1528
|
let n = t[0].intersectionRatio;
|
|
@@ -1554,7 +1573,7 @@ function Xt(e, t, n, r) {
|
|
|
1554
1573
|
}), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
|
|
1555
1574
|
};
|
|
1556
1575
|
}
|
|
1557
|
-
var Zt =
|
|
1576
|
+
var Zt = Je, Qt = Ye, $t = Ge, en = We, tn = (e, t, n) => {
|
|
1558
1577
|
let r = /* @__PURE__ */ new Map(), i = {
|
|
1559
1578
|
platform: qt,
|
|
1560
1579
|
...n
|
|
@@ -1562,11 +1581,11 @@ var Zt = Qe, Qt = $e, $t = Ye, en = Je, tn = (e, t, n) => {
|
|
|
1562
1581
|
...i.platform,
|
|
1563
1582
|
_c: r
|
|
1564
1583
|
};
|
|
1565
|
-
return
|
|
1584
|
+
return Ue(e, t, {
|
|
1566
1585
|
...i,
|
|
1567
1586
|
platform: a
|
|
1568
1587
|
});
|
|
1569
|
-
}, nn = "_trigger_e00wn_1", rn = "_content_e00wn_10", an = "_subTrigger_e00wn_61", on = "_itemMain_e00wn_90", sn = "_itemInset_e00wn_106", cn = "_shortcut_e00wn_118", ln = "_indicator_e00wn_119", un = "_submenuIndicator_e00wn_120",
|
|
1588
|
+
}, nn = "_trigger_e00wn_1", rn = "_content_e00wn_10", an = "_subTrigger_e00wn_61", on = "_itemMain_e00wn_90", sn = "_itemInset_e00wn_106", cn = "_shortcut_e00wn_118", ln = "_indicator_e00wn_119", un = "_submenuIndicator_e00wn_120", dn = {
|
|
1570
1589
|
trigger: nn,
|
|
1571
1590
|
content: rn,
|
|
1572
1591
|
"owo-dropdown-menu-in": "_owo-dropdown-menu-in_e00wn_1",
|
|
@@ -1576,31 +1595,31 @@ var Zt = Qe, Qt = $e, $t = Ye, en = Je, tn = (e, t, n) => {
|
|
|
1576
1595
|
shortcut: cn,
|
|
1577
1596
|
indicator: ln,
|
|
1578
1597
|
submenuIndicator: un
|
|
1579
|
-
},
|
|
1580
|
-
function
|
|
1581
|
-
let t = a(
|
|
1598
|
+
}, fn = n(null), pn = n(null);
|
|
1599
|
+
function mn(e) {
|
|
1600
|
+
let t = a(fn);
|
|
1582
1601
|
if (!t) throw Error(`${e} must be used within DropdownMenu.`);
|
|
1583
1602
|
return t;
|
|
1584
1603
|
}
|
|
1585
|
-
function
|
|
1586
|
-
let t = a(
|
|
1604
|
+
function hn(e) {
|
|
1605
|
+
let t = a(pn);
|
|
1587
1606
|
if (!t) throw Error(`${e} must be used within DropdownMenu.Content.`);
|
|
1588
1607
|
return t;
|
|
1589
1608
|
}
|
|
1590
|
-
function
|
|
1609
|
+
function gn(e, t) {
|
|
1591
1610
|
return (n) => {
|
|
1592
1611
|
e?.(n), t(n);
|
|
1593
1612
|
};
|
|
1594
1613
|
}
|
|
1595
|
-
function
|
|
1614
|
+
function _n(...e) {
|
|
1596
1615
|
return (t) => {
|
|
1597
1616
|
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
1598
1617
|
};
|
|
1599
1618
|
}
|
|
1600
|
-
function _n(e) {
|
|
1601
|
-
return typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(_n).join(" ") : !e || typeof e == "boolean" ? "" : r(e) ? _n(e.props.children) : "";
|
|
1602
|
-
}
|
|
1603
1619
|
function vn(e) {
|
|
1620
|
+
return typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(vn).join(" ") : !e || typeof e == "boolean" ? "" : r(e) ? vn(e.props.children) : "";
|
|
1621
|
+
}
|
|
1622
|
+
function yn(e) {
|
|
1604
1623
|
return [...e].sort((e, t) => {
|
|
1605
1624
|
let n = e.ref.current, r = t.ref.current;
|
|
1606
1625
|
if (!n || !r) return 0;
|
|
@@ -1608,18 +1627,18 @@ function vn(e) {
|
|
|
1608
1627
|
return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
1609
1628
|
});
|
|
1610
1629
|
}
|
|
1611
|
-
function
|
|
1630
|
+
function bn(e, t) {
|
|
1612
1631
|
return t === "center" ? e : `${e}-${t}`;
|
|
1613
1632
|
}
|
|
1614
|
-
function
|
|
1633
|
+
function xn(e) {
|
|
1615
1634
|
let t = e.split("-");
|
|
1616
1635
|
return {
|
|
1617
1636
|
side: t[0],
|
|
1618
1637
|
align: t[1] ?? "center"
|
|
1619
1638
|
};
|
|
1620
1639
|
}
|
|
1621
|
-
function
|
|
1622
|
-
let y = a(
|
|
1640
|
+
function Sn({ open: e, defaultOpen: t = !1, onOpenChange: n, side: r = "bottom", align: o = "start", sideOffset: c = 8, alignOffset: f = 0, collisionPadding: m = 8, portal: h = !0, contentRole: g = "menu", classNames: _, children: v }) {
|
|
1641
|
+
let y = a(pn), [b, x] = d(t), S = e !== void 0, C = S ? e : b, w = u(null), T = u(null), E = u("selected"), D = s(), O = s(), k = i((e) => {
|
|
1623
1642
|
S || x(e), n?.(e);
|
|
1624
1643
|
}, [S, n]), A = i(() => {
|
|
1625
1644
|
k(!1);
|
|
@@ -1670,33 +1689,33 @@ function xn({ open: e, defaultOpen: t = !1, onOpenChange: n, side: r = "bottom",
|
|
|
1670
1689
|
O,
|
|
1671
1690
|
N
|
|
1672
1691
|
]);
|
|
1673
|
-
return /* @__PURE__ */ p(
|
|
1692
|
+
return /* @__PURE__ */ p(fn.Provider, {
|
|
1674
1693
|
value: P,
|
|
1675
1694
|
children: v
|
|
1676
1695
|
});
|
|
1677
1696
|
}
|
|
1678
|
-
function
|
|
1679
|
-
let { open: o, setOpen: s, toggleOpen: c, triggerRef: l, contentRole: u, triggerId: d, contentId: f, focusIntentRef: m, isSubmenu: h, classNames: g } =
|
|
1697
|
+
function Cn({ asChild: n = !1, disabled: r = !1, className: i, children: a }) {
|
|
1698
|
+
let { open: o, setOpen: s, toggleOpen: c, triggerRef: l, contentRole: u, triggerId: d, contentId: f, focusIntentRef: m, isSubmenu: h, classNames: g } = mn("DropdownMenu.Trigger"), v = e.only(a), y = v.props ?? {}, b = typeof y.className == "string" ? y.className : void 0, x = {
|
|
1680
1699
|
id: d,
|
|
1681
1700
|
"data-state": o ? "open" : "closed",
|
|
1682
1701
|
"aria-expanded": o,
|
|
1683
1702
|
"aria-haspopup": u,
|
|
1684
1703
|
"aria-controls": o ? f : void 0,
|
|
1685
|
-
onClick:
|
|
1704
|
+
onClick: gn(y.onClick, (e) => {
|
|
1686
1705
|
if (r) {
|
|
1687
1706
|
e.preventDefault();
|
|
1688
1707
|
return;
|
|
1689
1708
|
}
|
|
1690
1709
|
m.current = "selected", c();
|
|
1691
1710
|
}),
|
|
1692
|
-
onKeyDown:
|
|
1711
|
+
onKeyDown: gn(y.onKeyDown, (e) => {
|
|
1693
1712
|
r || (e.key === "ArrowDown" ? (e.preventDefault(), m.current = "first", s(!0)) : e.key === "ArrowUp" ? (e.preventDefault(), m.current = "last", s(!0)) : !h && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m.current = "selected", c()));
|
|
1694
1713
|
})
|
|
1695
1714
|
};
|
|
1696
1715
|
return n ? t(v, {
|
|
1697
1716
|
...x,
|
|
1698
|
-
ref:
|
|
1699
|
-
className: _(
|
|
1717
|
+
ref: _n(l, y.ref),
|
|
1718
|
+
className: _(dn.trigger, g?.trigger, i, b),
|
|
1700
1719
|
type: v.type === "button" ? y.type ?? "button" : y.type
|
|
1701
1720
|
}) : /* @__PURE__ */ p("button", {
|
|
1702
1721
|
ref: l,
|
|
@@ -1704,32 +1723,32 @@ function Sn({ asChild: n = !1, disabled: r = !1, className: i, children: a }) {
|
|
|
1704
1723
|
type: "button",
|
|
1705
1724
|
"data-scope": "dropdown-menu",
|
|
1706
1725
|
"data-part": "trigger",
|
|
1707
|
-
className: _(
|
|
1726
|
+
className: _(dn.trigger, g?.trigger, i),
|
|
1708
1727
|
...x,
|
|
1709
1728
|
children: v
|
|
1710
1729
|
});
|
|
1711
1730
|
}
|
|
1712
|
-
function
|
|
1713
|
-
let { open: f, setOpen: m, triggerRef: g, contentRef: v, side: y, align: b, sideOffset: x, alignOffset: S, collisionPadding: C, portal: w, contentRole: T, triggerId: E, contentId: D, focusIntentRef: O, parentList: k, isSubmenu: A, closeSelf: j, closeTree: M, focusTrigger: N, classNames: P } =
|
|
1731
|
+
function wn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, maxHeight: a = 320, ...s }) {
|
|
1732
|
+
let { open: f, setOpen: m, triggerRef: g, contentRef: v, side: y, align: b, sideOffset: x, alignOffset: S, collisionPadding: C, portal: w, contentRole: T, triggerId: E, contentId: D, focusIntentRef: O, parentList: k, isSubmenu: A, closeSelf: j, closeTree: M, focusTrigger: N, classNames: P } = mn("DropdownMenu.Content"), F = u([]), [I, L] = d(null), [R, z] = d(null), [ee, B] = d(null), [V, H] = d(!1), U = u(""), te = u(null), W = i((e) => (F.current = [...F.current.filter((t) => t.id !== e.id), e], () => {
|
|
1714
1733
|
F.current = F.current.filter((t) => t.id !== e.id);
|
|
1715
|
-
}), []), G = i(() =>
|
|
1734
|
+
}), []), G = i(() => yn(F.current), []), K = i((e) => {
|
|
1716
1735
|
O.current = e;
|
|
1717
1736
|
}, [O]);
|
|
1718
1737
|
o(() => {
|
|
1719
1738
|
H(!0);
|
|
1720
1739
|
}, []);
|
|
1721
|
-
let
|
|
1740
|
+
let ne = l(() => ({
|
|
1722
1741
|
role: T,
|
|
1723
1742
|
highlightedId: I,
|
|
1724
1743
|
setHighlightedId: L,
|
|
1725
|
-
registerItem:
|
|
1744
|
+
registerItem: W,
|
|
1726
1745
|
getItems: G,
|
|
1727
|
-
requestFocusIntent:
|
|
1746
|
+
requestFocusIntent: K,
|
|
1728
1747
|
closeTree: M,
|
|
1729
1748
|
closeSelf: j,
|
|
1730
1749
|
focusTrigger: N,
|
|
1731
1750
|
activeSubmenuId: R,
|
|
1732
|
-
setActiveSubmenuId:
|
|
1751
|
+
setActiveSubmenuId: z,
|
|
1733
1752
|
contentRef: v
|
|
1734
1753
|
}), [
|
|
1735
1754
|
R,
|
|
@@ -1740,13 +1759,13 @@ function Cn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
|
|
|
1740
1759
|
N,
|
|
1741
1760
|
G,
|
|
1742
1761
|
I,
|
|
1743
|
-
|
|
1744
|
-
|
|
1762
|
+
W,
|
|
1763
|
+
K
|
|
1745
1764
|
]);
|
|
1746
1765
|
c(() => {
|
|
1747
1766
|
if (!(!f || !V || !g.current || !v.current)) return Xt(g.current, v.current, () => {
|
|
1748
1767
|
!g.current || !v.current || tn(g.current, v.current, {
|
|
1749
|
-
placement:
|
|
1768
|
+
placement: bn(y, b),
|
|
1750
1769
|
strategy: "fixed",
|
|
1751
1770
|
middleware: [
|
|
1752
1771
|
Zt({
|
|
@@ -1757,7 +1776,7 @@ function Cn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
|
|
|
1757
1776
|
Qt({ padding: C })
|
|
1758
1777
|
]
|
|
1759
1778
|
}).then(({ x: e, y: t, placement: n }) => {
|
|
1760
|
-
let r =
|
|
1779
|
+
let r = xn(n);
|
|
1761
1780
|
B({
|
|
1762
1781
|
top: t,
|
|
1763
1782
|
left: e,
|
|
@@ -1778,7 +1797,7 @@ function Cn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
|
|
|
1778
1797
|
g
|
|
1779
1798
|
]), o(() => {
|
|
1780
1799
|
if (!f) {
|
|
1781
|
-
L(null),
|
|
1800
|
+
L(null), z(null);
|
|
1782
1801
|
return;
|
|
1783
1802
|
}
|
|
1784
1803
|
let e = G().filter((e) => !e.disabled);
|
|
@@ -1816,64 +1835,64 @@ function Cn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
|
|
|
1816
1835
|
g
|
|
1817
1836
|
]), o(() => {
|
|
1818
1837
|
if (f) return () => {
|
|
1819
|
-
|
|
1838
|
+
te.current && clearTimeout(te.current);
|
|
1820
1839
|
};
|
|
1821
1840
|
}, [f]);
|
|
1822
|
-
let
|
|
1841
|
+
let q = i((e) => {
|
|
1823
1842
|
if (L(e), !e) {
|
|
1824
|
-
|
|
1843
|
+
z(null);
|
|
1825
1844
|
return;
|
|
1826
1845
|
}
|
|
1827
|
-
G().find((t) => t.id === e)?.submenu ||
|
|
1828
|
-
}, [G]),
|
|
1846
|
+
G().find((t) => t.id === e)?.submenu || z(null);
|
|
1847
|
+
}, [G]), J = i((e, t = "first") => {
|
|
1829
1848
|
let n = G().filter((e) => !e.disabled);
|
|
1830
1849
|
if (n.length === 0) return;
|
|
1831
1850
|
let r = n.findIndex((e) => e.id === I);
|
|
1832
1851
|
if (r === -1) {
|
|
1833
|
-
|
|
1852
|
+
q(t === "last" ? n[n.length - 1].id : n[0].id);
|
|
1834
1853
|
return;
|
|
1835
1854
|
}
|
|
1836
1855
|
let i = n[(r + e + n.length) % n.length];
|
|
1837
|
-
|
|
1856
|
+
q(i.id), i.ref.current?.scrollIntoView({ block: "nearest" });
|
|
1838
1857
|
}, [
|
|
1839
1858
|
G,
|
|
1840
1859
|
I,
|
|
1841
|
-
|
|
1842
|
-
]),
|
|
1860
|
+
q
|
|
1861
|
+
]), Y = i((e) => {
|
|
1843
1862
|
let t = e.length === 1 ? e.toLowerCase() : "";
|
|
1844
1863
|
if (!t) return;
|
|
1845
|
-
|
|
1846
|
-
U.current = "",
|
|
1864
|
+
te.current && clearTimeout(te.current), U.current += t, te.current = setTimeout(() => {
|
|
1865
|
+
U.current = "", te.current = null;
|
|
1847
1866
|
}, 350);
|
|
1848
1867
|
let n = G().filter((e) => !e.disabled);
|
|
1849
1868
|
if (n.length === 0) return;
|
|
1850
1869
|
let r = n.findIndex((e) => e.id === I), i = (r >= 0 ? [...n.slice(r + 1), ...n.slice(0, r + 1)] : n).find((e) => e.textValue.toLowerCase().startsWith(U.current));
|
|
1851
|
-
i && (
|
|
1870
|
+
i && (q(i.id), i.ref.current?.scrollIntoView({ block: "nearest" }));
|
|
1852
1871
|
}, [
|
|
1853
1872
|
G,
|
|
1854
1873
|
I,
|
|
1855
|
-
|
|
1856
|
-
]),
|
|
1874
|
+
q
|
|
1875
|
+
]), X = i((e) => {
|
|
1857
1876
|
let t = G(), n = t.find((e) => e.id === I) ?? null;
|
|
1858
1877
|
switch (e.key) {
|
|
1859
1878
|
case "ArrowDown":
|
|
1860
|
-
e.preventDefault(),
|
|
1879
|
+
e.preventDefault(), J(1);
|
|
1861
1880
|
break;
|
|
1862
1881
|
case "ArrowUp":
|
|
1863
|
-
e.preventDefault(),
|
|
1882
|
+
e.preventDefault(), J(-1, "last");
|
|
1864
1883
|
break;
|
|
1865
1884
|
case "Home":
|
|
1866
1885
|
e.preventDefault();
|
|
1867
1886
|
{
|
|
1868
1887
|
let e = t.find((e) => !e.disabled);
|
|
1869
|
-
e &&
|
|
1888
|
+
e && q(e.id);
|
|
1870
1889
|
}
|
|
1871
1890
|
break;
|
|
1872
1891
|
case "End":
|
|
1873
1892
|
e.preventDefault();
|
|
1874
1893
|
{
|
|
1875
1894
|
let e = t.filter((e) => !e.disabled), n = e[e.length - 1];
|
|
1876
|
-
n &&
|
|
1895
|
+
n && q(n.id);
|
|
1877
1896
|
}
|
|
1878
1897
|
break;
|
|
1879
1898
|
case "Enter":
|
|
@@ -1892,23 +1911,23 @@ function Cn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
|
|
|
1892
1911
|
case "Escape":
|
|
1893
1912
|
e.preventDefault(), j(), N(), A && k?.setActiveSubmenuId(null);
|
|
1894
1913
|
break;
|
|
1895
|
-
default:
|
|
1914
|
+
default: Y(e.key);
|
|
1896
1915
|
}
|
|
1897
1916
|
}, [
|
|
1898
1917
|
j,
|
|
1899
1918
|
M,
|
|
1900
1919
|
N,
|
|
1901
1920
|
G,
|
|
1902
|
-
|
|
1921
|
+
Y,
|
|
1903
1922
|
I,
|
|
1904
|
-
|
|
1923
|
+
q,
|
|
1905
1924
|
A,
|
|
1906
|
-
|
|
1925
|
+
J,
|
|
1907
1926
|
k
|
|
1908
1927
|
]);
|
|
1909
1928
|
if (!f || !V) return null;
|
|
1910
|
-
let
|
|
1911
|
-
value:
|
|
1929
|
+
let re = /* @__PURE__ */ p(pn.Provider, {
|
|
1930
|
+
value: ne,
|
|
1912
1931
|
children: /* @__PURE__ */ p("div", {
|
|
1913
1932
|
ref: v,
|
|
1914
1933
|
id: D,
|
|
@@ -1916,28 +1935,28 @@ function Cn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
|
|
|
1916
1935
|
tabIndex: -1,
|
|
1917
1936
|
"aria-labelledby": T === "menu" ? E : void 0,
|
|
1918
1937
|
"data-state": "open",
|
|
1919
|
-
"data-side":
|
|
1920
|
-
"data-align":
|
|
1938
|
+
"data-side": ee?.side ?? y,
|
|
1939
|
+
"data-align": ee?.align ?? b,
|
|
1921
1940
|
"data-scope": "dropdown-menu",
|
|
1922
1941
|
"data-part": "content",
|
|
1923
|
-
className: _(
|
|
1942
|
+
className: _(dn.content, P?.content, e),
|
|
1924
1943
|
style: {
|
|
1925
1944
|
...n,
|
|
1926
1945
|
position: "fixed",
|
|
1927
|
-
top:
|
|
1928
|
-
left:
|
|
1946
|
+
top: ee?.top ?? 0,
|
|
1947
|
+
left: ee?.left ?? 0,
|
|
1929
1948
|
maxHeight: a,
|
|
1930
1949
|
minWidth: r ? g.current?.getBoundingClientRect().width : void 0
|
|
1931
1950
|
},
|
|
1932
|
-
onKeyDown:
|
|
1951
|
+
onKeyDown: X,
|
|
1933
1952
|
...s,
|
|
1934
1953
|
children: t
|
|
1935
1954
|
})
|
|
1936
1955
|
});
|
|
1937
|
-
return w ? h(
|
|
1956
|
+
return w ? h(re, document.body) : re;
|
|
1938
1957
|
}
|
|
1939
|
-
function
|
|
1940
|
-
let { classNames: r } =
|
|
1958
|
+
function Tn({ className: e, children: t, ...n }) {
|
|
1959
|
+
let { classNames: r } = mn("DropdownMenu.Group");
|
|
1941
1960
|
return /* @__PURE__ */ p("div", {
|
|
1942
1961
|
"data-scope": "dropdown-menu",
|
|
1943
1962
|
"data-part": "group",
|
|
@@ -1946,8 +1965,8 @@ function wn({ className: e, children: t, ...n }) {
|
|
|
1946
1965
|
children: t
|
|
1947
1966
|
});
|
|
1948
1967
|
}
|
|
1949
|
-
function
|
|
1950
|
-
let { classNames: r } =
|
|
1968
|
+
function En({ className: e, children: t, ...n }) {
|
|
1969
|
+
let { classNames: r } = mn("DropdownMenu.Label");
|
|
1951
1970
|
return /* @__PURE__ */ p("div", {
|
|
1952
1971
|
"data-scope": "dropdown-menu",
|
|
1953
1972
|
"data-part": "label",
|
|
@@ -1956,8 +1975,8 @@ function Tn({ className: e, children: t, ...n }) {
|
|
|
1956
1975
|
children: t
|
|
1957
1976
|
});
|
|
1958
1977
|
}
|
|
1959
|
-
function
|
|
1960
|
-
let { classNames: n } =
|
|
1978
|
+
function Dn({ className: e, ...t }) {
|
|
1979
|
+
let { classNames: n } = mn("DropdownMenu.Separator");
|
|
1961
1980
|
return /* @__PURE__ */ p("div", {
|
|
1962
1981
|
role: "separator",
|
|
1963
1982
|
"data-scope": "dropdown-menu",
|
|
@@ -1966,8 +1985,8 @@ function En({ className: e, ...t }) {
|
|
|
1966
1985
|
...t
|
|
1967
1986
|
});
|
|
1968
1987
|
}
|
|
1969
|
-
function
|
|
1970
|
-
let x = s(), S = u(null), { role: C, highlightedId: w, setHighlightedId: T, registerItem: E, closeTree: D, setActiveSubmenuId: O } =
|
|
1988
|
+
function On({ className: e, children: t, inset: n = !1, disabled: r = !1, selected: a = !1, destructive: c = !1, closeOnSelect: d = !0, shortcut: f, indicator: h, onSelect: g, onMouseEnter: v, onClick: y, ...b }) {
|
|
1989
|
+
let x = s(), S = u(null), { role: C, highlightedId: w, setHighlightedId: T, registerItem: E, closeTree: D, setActiveSubmenuId: O } = hn("DropdownMenu.Item"), { classNames: k } = mn("DropdownMenu.Item"), A = l(() => vn(t), [t]), j = w === x, M = i(() => {
|
|
1971
1990
|
r || (g?.(), d && D());
|
|
1972
1991
|
}, [
|
|
1973
1992
|
d,
|
|
@@ -2006,32 +2025,32 @@ function Dn({ className: e, children: t, inset: n = !1, disabled: r = !1, select
|
|
|
2006
2025
|
"data-destructive": c || void 0,
|
|
2007
2026
|
"data-scope": "dropdown-menu",
|
|
2008
2027
|
"data-part": "item",
|
|
2009
|
-
className: _(n &&
|
|
2010
|
-
onMouseEnter:
|
|
2028
|
+
className: _(n && dn.itemInset, k?.item, e),
|
|
2029
|
+
onMouseEnter: gn(v, () => {
|
|
2011
2030
|
r || (T(x), O(null));
|
|
2012
2031
|
}),
|
|
2013
|
-
onClick:
|
|
2032
|
+
onClick: gn(y, (e) => {
|
|
2014
2033
|
e.preventDefault(), M();
|
|
2015
2034
|
}),
|
|
2016
2035
|
...b,
|
|
2017
2036
|
children: [
|
|
2018
2037
|
/* @__PURE__ */ p("span", {
|
|
2019
|
-
className:
|
|
2038
|
+
className: dn.itemMain,
|
|
2020
2039
|
children: t
|
|
2021
2040
|
}),
|
|
2022
2041
|
f ? /* @__PURE__ */ p("span", {
|
|
2023
|
-
className:
|
|
2042
|
+
className: dn.shortcut,
|
|
2024
2043
|
children: f
|
|
2025
2044
|
}) : null,
|
|
2026
2045
|
a ? /* @__PURE__ */ p("span", {
|
|
2027
|
-
className:
|
|
2046
|
+
className: dn.indicator,
|
|
2028
2047
|
children: h ?? "✓"
|
|
2029
2048
|
}) : null
|
|
2030
2049
|
]
|
|
2031
2050
|
});
|
|
2032
2051
|
}
|
|
2033
|
-
function
|
|
2034
|
-
return /* @__PURE__ */ p(
|
|
2052
|
+
function kn(e) {
|
|
2053
|
+
return /* @__PURE__ */ p(Sn, {
|
|
2035
2054
|
side: "right",
|
|
2036
2055
|
align: "start",
|
|
2037
2056
|
sideOffset: 6,
|
|
@@ -2039,8 +2058,8 @@ function On(e) {
|
|
|
2039
2058
|
contentRole: "menu"
|
|
2040
2059
|
});
|
|
2041
2060
|
}
|
|
2042
|
-
function
|
|
2043
|
-
let v = s(), y = u(null), b =
|
|
2061
|
+
function An({ className: e, children: t, inset: n = !1, disabled: r = !1, destructive: a = !1, shortcut: c, onSelect: d, onMouseEnter: f, onClick: h, ...g }) {
|
|
2062
|
+
let v = s(), y = u(null), b = mn("DropdownMenu.SubTrigger"), { highlightedId: x, setHighlightedId: S, registerItem: C, setActiveSubmenuId: w, activeSubmenuId: T } = hn("DropdownMenu.SubTrigger"), E = l(() => vn(t), [t]), D = x === v, O = b.open && T === v, k = i(() => {
|
|
2044
2063
|
r || (b.focusIntentRef.current = "first", S(v), w(v), b.setOpen(!0));
|
|
2045
2064
|
}, [
|
|
2046
2065
|
r,
|
|
@@ -2072,7 +2091,7 @@ function kn({ className: e, children: t, inset: n = !1, disabled: r = !1, destru
|
|
|
2072
2091
|
v,
|
|
2073
2092
|
b
|
|
2074
2093
|
]), /* @__PURE__ */ m("button", {
|
|
2075
|
-
ref:
|
|
2094
|
+
ref: _n(y, b.triggerRef),
|
|
2076
2095
|
id: b.triggerId,
|
|
2077
2096
|
type: "button",
|
|
2078
2097
|
role: "menuitem",
|
|
@@ -2084,47 +2103,47 @@ function kn({ className: e, children: t, inset: n = !1, disabled: r = !1, destru
|
|
|
2084
2103
|
"data-state": O ? "open" : "closed",
|
|
2085
2104
|
"data-disabled": r || void 0,
|
|
2086
2105
|
"data-destructive": a || void 0,
|
|
2087
|
-
className: _(
|
|
2088
|
-
onMouseEnter:
|
|
2106
|
+
className: _(dn.subTrigger, n && dn.itemInset, e),
|
|
2107
|
+
onMouseEnter: gn(f, () => {
|
|
2089
2108
|
k();
|
|
2090
2109
|
}),
|
|
2091
|
-
onClick:
|
|
2110
|
+
onClick: gn(h, (e) => {
|
|
2092
2111
|
e.preventDefault(), k(), d?.();
|
|
2093
2112
|
}),
|
|
2094
2113
|
...g,
|
|
2095
2114
|
children: [
|
|
2096
2115
|
/* @__PURE__ */ p("span", {
|
|
2097
|
-
className:
|
|
2116
|
+
className: dn.itemMain,
|
|
2098
2117
|
children: t
|
|
2099
2118
|
}),
|
|
2100
2119
|
c ? /* @__PURE__ */ p("span", {
|
|
2101
|
-
className:
|
|
2120
|
+
className: dn.shortcut,
|
|
2102
2121
|
children: c
|
|
2103
2122
|
}) : null,
|
|
2104
2123
|
/* @__PURE__ */ p("span", {
|
|
2105
|
-
className:
|
|
2124
|
+
className: dn.submenuIndicator,
|
|
2106
2125
|
"aria-hidden": "true",
|
|
2107
2126
|
children: "›"
|
|
2108
2127
|
})
|
|
2109
2128
|
]
|
|
2110
2129
|
});
|
|
2111
2130
|
}
|
|
2112
|
-
var
|
|
2113
|
-
Trigger:
|
|
2114
|
-
Content:
|
|
2115
|
-
Group:
|
|
2116
|
-
Label:
|
|
2117
|
-
Item:
|
|
2118
|
-
Separator:
|
|
2119
|
-
Submenu:
|
|
2120
|
-
SubTrigger:
|
|
2121
|
-
}),
|
|
2131
|
+
var jn = Object.assign(Sn, {
|
|
2132
|
+
Trigger: Cn,
|
|
2133
|
+
Content: wn,
|
|
2134
|
+
Group: Tn,
|
|
2135
|
+
Label: En,
|
|
2136
|
+
Item: On,
|
|
2137
|
+
Separator: Dn,
|
|
2138
|
+
Submenu: kn,
|
|
2139
|
+
SubTrigger: An
|
|
2140
|
+
}), Mn = {
|
|
2122
2141
|
panel: "_panel_7f715_1",
|
|
2123
2142
|
backdrop: "_backdrop_7f715_55"
|
|
2124
2143
|
};
|
|
2125
2144
|
//#endregion
|
|
2126
2145
|
//#region src/components/Drawer.tsx
|
|
2127
|
-
function
|
|
2146
|
+
function Nn({ as: e = "aside", open: t, children: n, side: r = "right", position: i = "fixed", showBackdrop: a = !0, onClose: o, closeLabel: s = "关闭抽屉", backdropClassName: c, className: l, classNames: u, ...d }) {
|
|
2128
2147
|
return /* @__PURE__ */ m(f, { children: [a && t && o && /* @__PURE__ */ p("button", {
|
|
2129
2148
|
type: "button",
|
|
2130
2149
|
"aria-label": s,
|
|
@@ -2132,7 +2151,7 @@ function Mn({ as: e = "aside", open: t, children: n, side: r = "right", position
|
|
|
2132
2151
|
"data-scope": "drawer",
|
|
2133
2152
|
"data-part": "backdrop",
|
|
2134
2153
|
"data-position": i,
|
|
2135
|
-
className: _("owo-drawer-backdrop",
|
|
2154
|
+
className: _("owo-drawer-backdrop", Mn.backdrop, c, u?.backdrop),
|
|
2136
2155
|
onClick: o
|
|
2137
2156
|
}), /* @__PURE__ */ p(e, {
|
|
2138
2157
|
"aria-hidden": !t,
|
|
@@ -2141,12 +2160,12 @@ function Mn({ as: e = "aside", open: t, children: n, side: r = "right", position
|
|
|
2141
2160
|
"data-position": i,
|
|
2142
2161
|
"data-scope": "drawer",
|
|
2143
2162
|
"data-part": "panel",
|
|
2144
|
-
className: _("owo-drawer",
|
|
2163
|
+
className: _("owo-drawer", Mn.panel, l, u?.panel),
|
|
2145
2164
|
...d,
|
|
2146
2165
|
children: n
|
|
2147
2166
|
})] });
|
|
2148
2167
|
}
|
|
2149
|
-
var
|
|
2168
|
+
var Pn = {
|
|
2150
2169
|
root: "_root_38gc5_1",
|
|
2151
2170
|
label: "_label_38gc5_10",
|
|
2152
2171
|
required: "_required_38gc5_18",
|
|
@@ -2156,8 +2175,8 @@ var Nn = {
|
|
|
2156
2175
|
};
|
|
2157
2176
|
//#endregion
|
|
2158
2177
|
//#region src/components/Field.tsx
|
|
2159
|
-
function
|
|
2160
|
-
let g = s(), v = c ?? g, y = `${v}-label`, b = t ? `${v}-description
|
|
2178
|
+
function Fn({ label: e, description: t, error: n, help: r, required: i = !1, disabled: a = !1, invalid: o = !1, htmlFor: c, children: u, className: d, classNames: f, ...h }) {
|
|
2179
|
+
let g = s(), v = c ?? g, y = `${v}-label`, b = t == null ? void 0 : `${v}-description`, x = n == null ? void 0 : `${v}-error`, S = r == null ? void 0 : `${v}-help`, C = [
|
|
2161
2180
|
b,
|
|
2162
2181
|
x,
|
|
2163
2182
|
S
|
|
@@ -2177,7 +2196,7 @@ function Pn({ label: e, description: t, error: n, help: r, required: i = !1, dis
|
|
|
2177
2196
|
i
|
|
2178
2197
|
]);
|
|
2179
2198
|
return /* @__PURE__ */ m("div", {
|
|
2180
|
-
className: _("owo-field",
|
|
2199
|
+
className: _("owo-field", Pn.root, d),
|
|
2181
2200
|
"data-disabled": a || void 0,
|
|
2182
2201
|
"data-invalid": o || void 0,
|
|
2183
2202
|
"data-required": i || void 0,
|
|
@@ -2187,21 +2206,21 @@ function Pn({ label: e, description: t, error: n, help: r, required: i = !1, dis
|
|
|
2187
2206
|
id: y,
|
|
2188
2207
|
htmlFor: v,
|
|
2189
2208
|
"data-part": "label",
|
|
2190
|
-
className: _(
|
|
2209
|
+
className: _(Pn.label, f?.label),
|
|
2191
2210
|
children: [e, i && /* @__PURE__ */ p("span", {
|
|
2192
2211
|
"data-part": "required",
|
|
2193
2212
|
"aria-hidden": "true",
|
|
2194
|
-
className: _(
|
|
2213
|
+
className: _(Pn.required, f?.required),
|
|
2195
2214
|
children: "*"
|
|
2196
2215
|
})]
|
|
2197
2216
|
}),
|
|
2198
2217
|
t != null && /* @__PURE__ */ p("span", {
|
|
2199
2218
|
id: b,
|
|
2200
2219
|
"data-part": "description",
|
|
2201
|
-
className: _(
|
|
2220
|
+
className: _(Pn.description, f?.description),
|
|
2202
2221
|
children: t
|
|
2203
2222
|
}),
|
|
2204
|
-
/* @__PURE__ */ p(
|
|
2223
|
+
/* @__PURE__ */ p(z.Provider, {
|
|
2205
2224
|
value: w,
|
|
2206
2225
|
children: u
|
|
2207
2226
|
}),
|
|
@@ -2209,23 +2228,23 @@ function Pn({ label: e, description: t, error: n, help: r, required: i = !1, dis
|
|
|
2209
2228
|
id: x,
|
|
2210
2229
|
"data-part": "error",
|
|
2211
2230
|
role: "alert",
|
|
2212
|
-
className: _(
|
|
2231
|
+
className: _(Pn.error, f?.error),
|
|
2213
2232
|
children: n
|
|
2214
2233
|
}),
|
|
2215
2234
|
r != null && /* @__PURE__ */ p("span", {
|
|
2216
2235
|
id: S,
|
|
2217
2236
|
"data-part": "help",
|
|
2218
|
-
className: _(
|
|
2237
|
+
className: _(Pn.help, f?.help),
|
|
2219
2238
|
children: r
|
|
2220
2239
|
})
|
|
2221
2240
|
]
|
|
2222
2241
|
});
|
|
2223
2242
|
}
|
|
2224
|
-
var
|
|
2243
|
+
var In = { root: "_root_1hqa8_1" };
|
|
2225
2244
|
//#endregion
|
|
2226
2245
|
//#region src/components/IconButton.tsx
|
|
2227
|
-
function
|
|
2228
|
-
let o = _("owo-icon-button",
|
|
2246
|
+
function Ln({ variant: e = "ghost", size: t = "md", label: n, icon: r, className: i, ...a }) {
|
|
2247
|
+
let o = _("owo-icon-button", In.root, i);
|
|
2229
2248
|
if ("href" in a && a.href) {
|
|
2230
2249
|
let { href: i, ...s } = a;
|
|
2231
2250
|
return /* @__PURE__ */ p("a", {
|
|
@@ -2251,11 +2270,11 @@ function In({ variant: e = "ghost", size: t = "md", label: n, icon: r, className
|
|
|
2251
2270
|
children: r
|
|
2252
2271
|
});
|
|
2253
2272
|
}
|
|
2254
|
-
var
|
|
2273
|
+
var Rn = { root: "_root_8zge1_1" };
|
|
2255
2274
|
//#endregion
|
|
2256
2275
|
//#region src/components/Input.tsx
|
|
2257
|
-
function
|
|
2258
|
-
let a =
|
|
2276
|
+
function zn({ className: e, tone: t = "default", size: n = "md", invalid: r, ...i }) {
|
|
2277
|
+
let a = V({
|
|
2259
2278
|
id: i.id,
|
|
2260
2279
|
disabled: i.disabled,
|
|
2261
2280
|
required: i.required,
|
|
@@ -2272,23 +2291,308 @@ function Rn({ className: e, tone: t = "default", size: n = "md", invalid: r, ...
|
|
|
2272
2291
|
"data-tone": t,
|
|
2273
2292
|
"data-size": n,
|
|
2274
2293
|
"data-invalid": a.invalid || void 0,
|
|
2275
|
-
className: _("owo-input",
|
|
2294
|
+
className: _("owo-input", Rn.root, e)
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2297
|
+
var Bn = {
|
|
2298
|
+
trigger: "_trigger_xunrw_1",
|
|
2299
|
+
content: "_content_xunrw_5",
|
|
2300
|
+
"tooltip-in": "_tooltip-in_xunrw_1"
|
|
2301
|
+
}, Vn = 6, Hn = 8, Un = 4;
|
|
2302
|
+
function Wn(e) {
|
|
2303
|
+
return e.split("-")[0];
|
|
2304
|
+
}
|
|
2305
|
+
var Gn = {
|
|
2306
|
+
top: "",
|
|
2307
|
+
bottom: "rotate(180deg)",
|
|
2308
|
+
left: "rotate(-90deg)",
|
|
2309
|
+
right: "rotate(90deg)"
|
|
2310
|
+
};
|
|
2311
|
+
function Kn({ content: e, placement: t = "top", density: n = "default", showDelay: r = 300, hideDelay: a = 150, arrow: l = !0, renderArrow: g, className: v, children: y, classNames: b }) {
|
|
2312
|
+
let [x, S] = d(!1), [C, w] = d(null), [T, E] = d(t), [D, O] = d({}), k = u(null), A = u(null), j = u(null), M = u(void 0), N = u(void 0), P = s(), F = i(() => {
|
|
2313
|
+
clearTimeout(M.current), clearTimeout(N.current);
|
|
2314
|
+
}, []), I = i(() => {
|
|
2315
|
+
F(), M.current = setTimeout(() => S(!0), r);
|
|
2316
|
+
}, [F, r]), L = i(() => {
|
|
2317
|
+
F(), S(!0);
|
|
2318
|
+
}, [F]), R = i(() => {
|
|
2319
|
+
F(), N.current = setTimeout(() => S(!1), a);
|
|
2320
|
+
}, [F, a]), z = i((e) => {
|
|
2321
|
+
if (e.target === k.current) {
|
|
2322
|
+
I();
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
L();
|
|
2326
|
+
}, [I, L]), ee = i((e) => {
|
|
2327
|
+
e.pointerType !== "mouse" && L();
|
|
2328
|
+
}, [L]), B = i((e) => {
|
|
2329
|
+
e.key === "Escape" && x && S(!1);
|
|
2330
|
+
}, [x]);
|
|
2331
|
+
c(() => {
|
|
2332
|
+
if (!x || !k.current || !A.current) return;
|
|
2333
|
+
let e = [
|
|
2334
|
+
Zt(l ? Hn + Vn : Hn),
|
|
2335
|
+
$t({ padding: Un }),
|
|
2336
|
+
Qt({ padding: Un })
|
|
2337
|
+
];
|
|
2338
|
+
return l && j.current && e.push(en({ element: j.current })), Xt(k.current, A.current, () => {
|
|
2339
|
+
!k.current || !A.current || tn(k.current, A.current, {
|
|
2340
|
+
placement: t,
|
|
2341
|
+
strategy: "fixed",
|
|
2342
|
+
middleware: e
|
|
2343
|
+
}).then(({ x: e, y: t, placement: n, middlewareData: r }) => {
|
|
2344
|
+
w({
|
|
2345
|
+
top: t,
|
|
2346
|
+
left: e
|
|
2347
|
+
}), E(Wn(n)), r.arrow && O({
|
|
2348
|
+
x: r.arrow.x,
|
|
2349
|
+
y: r.arrow.y
|
|
2350
|
+
});
|
|
2351
|
+
});
|
|
2352
|
+
});
|
|
2353
|
+
}, [
|
|
2354
|
+
x,
|
|
2355
|
+
t,
|
|
2356
|
+
l
|
|
2357
|
+
]), o(() => {
|
|
2358
|
+
if (x) return document.addEventListener("keydown", B), () => document.removeEventListener("keydown", B);
|
|
2359
|
+
}, [x, B]), o(() => F, [F]);
|
|
2360
|
+
let V = { position: "absolute" }, H = T;
|
|
2361
|
+
return H === "top" || H === "bottom" ? (V.left = D.x ?? 0, V[H === "top" ? "bottom" : "top"] = -Vn, V.transform = Gn[H] || void 0) : (V.top = D.y ?? 0, V[H === "left" ? "right" : "left"] = -Vn, V.transform = Gn[H]), /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
|
|
2362
|
+
ref: k,
|
|
2363
|
+
"data-state": x ? "open" : "closed",
|
|
2364
|
+
"data-scope": "tooltip",
|
|
2365
|
+
"data-part": "trigger",
|
|
2366
|
+
className: _("owo-tooltip-trigger", Bn.trigger, b?.trigger),
|
|
2367
|
+
onMouseEnter: I,
|
|
2368
|
+
onMouseLeave: R,
|
|
2369
|
+
onFocus: z,
|
|
2370
|
+
onBlur: R,
|
|
2371
|
+
onPointerDown: ee,
|
|
2372
|
+
"aria-describedby": x ? P : void 0,
|
|
2373
|
+
children: y
|
|
2374
|
+
}), x && h(/* @__PURE__ */ m("div", {
|
|
2375
|
+
ref: A,
|
|
2376
|
+
id: P,
|
|
2377
|
+
role: "tooltip",
|
|
2378
|
+
"data-state": x ? "open" : "closed",
|
|
2379
|
+
"data-placement": T,
|
|
2380
|
+
"data-density": n,
|
|
2381
|
+
"data-scope": "tooltip",
|
|
2382
|
+
"data-part": "content",
|
|
2383
|
+
className: _("owo-tooltip", Bn.content, b?.content, v),
|
|
2384
|
+
style: C ? {
|
|
2385
|
+
top: C.top,
|
|
2386
|
+
left: C.left
|
|
2387
|
+
} : { visibility: "hidden" },
|
|
2388
|
+
onMouseEnter: I,
|
|
2389
|
+
onMouseLeave: R,
|
|
2390
|
+
children: [e, l && /* @__PURE__ */ p("span", {
|
|
2391
|
+
ref: j,
|
|
2392
|
+
"data-scope": "tooltip",
|
|
2393
|
+
"data-part": "arrow",
|
|
2394
|
+
className: _(b?.arrow),
|
|
2395
|
+
style: V,
|
|
2396
|
+
children: g ? g({ placement: T }) : /* @__PURE__ */ p("svg", {
|
|
2397
|
+
width: Vn * 2,
|
|
2398
|
+
height: Vn,
|
|
2399
|
+
viewBox: "0 0 12 6",
|
|
2400
|
+
children: /* @__PURE__ */ p("path", {
|
|
2401
|
+
d: "M0 0l6 6 6-6z",
|
|
2402
|
+
fill: "currentColor"
|
|
2403
|
+
})
|
|
2404
|
+
})
|
|
2405
|
+
})]
|
|
2406
|
+
}), document.body)] });
|
|
2407
|
+
}
|
|
2408
|
+
var qn = {
|
|
2409
|
+
root: "_root_56wh4_1",
|
|
2410
|
+
section: "_section_56wh4_21",
|
|
2411
|
+
buttonReset: "_buttonReset_56wh4_31",
|
|
2412
|
+
linkReset: "_linkReset_56wh4_32",
|
|
2413
|
+
item: "_item_56wh4_42",
|
|
2414
|
+
icon: "_icon_56wh4_82",
|
|
2415
|
+
spacer: "_spacer_56wh4_88"
|
|
2416
|
+
}, Jn = n(null);
|
|
2417
|
+
function Yn(e) {
|
|
2418
|
+
let t = a(Jn);
|
|
2419
|
+
if (!t) throw Error(`${e} must be used within NavRail.`);
|
|
2420
|
+
return t;
|
|
2421
|
+
}
|
|
2422
|
+
function Xn({ activeKey: e, onChange: t, classNames: n, orientation: r = "vertical", className: i, children: a, ...o }) {
|
|
2423
|
+
let s = u([]), c = l(() => ({
|
|
2424
|
+
activeKey: e,
|
|
2425
|
+
onChange: t,
|
|
2426
|
+
classNames: n,
|
|
2427
|
+
orientation: r,
|
|
2428
|
+
registerItem: (e) => {
|
|
2429
|
+
let t = s.current.filter((t) => t.value !== e.value);
|
|
2430
|
+
t.push(e), s.current = t;
|
|
2431
|
+
},
|
|
2432
|
+
unregisterItem: (e) => {
|
|
2433
|
+
s.current = s.current.filter((t) => t.value !== e);
|
|
2434
|
+
},
|
|
2435
|
+
moveFocus: (e, t) => {
|
|
2436
|
+
let n = s.current.filter((e) => !e.disabled && e.ref);
|
|
2437
|
+
if (n.length === 0) return;
|
|
2438
|
+
let r = n.findIndex((t) => t.value === e), i = n[0];
|
|
2439
|
+
t === "first" && (i = n[0]), t === "last" && (i = n[n.length - 1]), t === "next" && (i = n[r >= 0 ? (r + 1) % n.length : 0]), t === "prev" && (i = n[r >= 0 ? (r - 1 + n.length) % n.length : n.length - 1]), i?.ref?.focus();
|
|
2440
|
+
}
|
|
2441
|
+
}), [
|
|
2442
|
+
e,
|
|
2443
|
+
n,
|
|
2444
|
+
t,
|
|
2445
|
+
r
|
|
2446
|
+
]);
|
|
2447
|
+
return /* @__PURE__ */ p(Jn.Provider, {
|
|
2448
|
+
value: c,
|
|
2449
|
+
children: /* @__PURE__ */ p("nav", {
|
|
2450
|
+
"aria-label": "Navigation rail",
|
|
2451
|
+
"data-scope": "nav-rail",
|
|
2452
|
+
"data-orientation": r,
|
|
2453
|
+
className: _("owo-nav-rail", qn.root, i),
|
|
2454
|
+
...o,
|
|
2455
|
+
children: a
|
|
2456
|
+
})
|
|
2457
|
+
});
|
|
2458
|
+
}
|
|
2459
|
+
function Zn(e) {
|
|
2460
|
+
let { activeKey: t, onChange: n, classNames: r, orientation: i, registerItem: a, unregisterItem: o, moveFocus: s } = Yn("NavRail.Item"), c = t === e.value, l = (t) => {
|
|
2461
|
+
let n = i === "horizontal" ? {
|
|
2462
|
+
next: "ArrowRight",
|
|
2463
|
+
prev: "ArrowLeft"
|
|
2464
|
+
} : {
|
|
2465
|
+
next: "ArrowDown",
|
|
2466
|
+
prev: "ArrowUp"
|
|
2467
|
+
};
|
|
2468
|
+
switch (t.key) {
|
|
2469
|
+
case n.next:
|
|
2470
|
+
t.preventDefault(), s(e.value, "next");
|
|
2471
|
+
break;
|
|
2472
|
+
case n.prev:
|
|
2473
|
+
t.preventDefault(), s(e.value, "prev");
|
|
2474
|
+
break;
|
|
2475
|
+
case "Home":
|
|
2476
|
+
t.preventDefault(), s(e.value, "first");
|
|
2477
|
+
break;
|
|
2478
|
+
case "End":
|
|
2479
|
+
t.preventDefault(), s(e.value, "last");
|
|
2480
|
+
break;
|
|
2481
|
+
}
|
|
2482
|
+
}, u = /* @__PURE__ */ p("span", {
|
|
2483
|
+
"data-scope": "nav-rail",
|
|
2484
|
+
"data-part": "item",
|
|
2485
|
+
"data-active": c || void 0,
|
|
2486
|
+
"data-disabled": e.disabled || void 0,
|
|
2487
|
+
className: _(qn.item, r?.item, e.className),
|
|
2488
|
+
children: /* @__PURE__ */ p("span", {
|
|
2489
|
+
"aria-hidden": "true",
|
|
2490
|
+
"data-scope": "nav-rail",
|
|
2491
|
+
"data-part": "icon",
|
|
2492
|
+
className: _(qn.icon, r?.icon),
|
|
2493
|
+
children: e.icon
|
|
2494
|
+
})
|
|
2495
|
+
});
|
|
2496
|
+
if ("href" in e && e.href) {
|
|
2497
|
+
let { value: t, icon: r, label: i, disabled: s, className: d, href: f, onClick: m, ...h } = e;
|
|
2498
|
+
return /* @__PURE__ */ p(Kn, {
|
|
2499
|
+
content: i,
|
|
2500
|
+
density: "compact",
|
|
2501
|
+
children: /* @__PURE__ */ p("a", {
|
|
2502
|
+
...h,
|
|
2503
|
+
ref: (e) => {
|
|
2504
|
+
e ? a({
|
|
2505
|
+
value: t,
|
|
2506
|
+
disabled: !!s,
|
|
2507
|
+
ref: e
|
|
2508
|
+
}) : o(t);
|
|
2509
|
+
},
|
|
2510
|
+
href: s ? void 0 : f,
|
|
2511
|
+
"aria-label": i,
|
|
2512
|
+
"aria-disabled": s || void 0,
|
|
2513
|
+
"aria-current": c ? "page" : void 0,
|
|
2514
|
+
tabIndex: s ? -1 : h.tabIndex,
|
|
2515
|
+
className: qn.linkReset,
|
|
2516
|
+
onKeyDown: (e) => {
|
|
2517
|
+
h.onKeyDown?.(e), e.defaultPrevented || l(e);
|
|
2518
|
+
},
|
|
2519
|
+
onClick: (e) => {
|
|
2520
|
+
if (m?.(e), s) {
|
|
2521
|
+
e.preventDefault();
|
|
2522
|
+
return;
|
|
2523
|
+
}
|
|
2524
|
+
e.defaultPrevented || n?.(t);
|
|
2525
|
+
},
|
|
2526
|
+
children: u
|
|
2527
|
+
})
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
let { value: d, icon: f, label: m, disabled: h, className: g, onClick: v, ...y } = e;
|
|
2531
|
+
return /* @__PURE__ */ p(Kn, {
|
|
2532
|
+
content: m,
|
|
2533
|
+
density: "compact",
|
|
2534
|
+
children: /* @__PURE__ */ p("button", {
|
|
2535
|
+
...y,
|
|
2536
|
+
ref: (e) => {
|
|
2537
|
+
e ? a({
|
|
2538
|
+
value: d,
|
|
2539
|
+
disabled: !!h,
|
|
2540
|
+
ref: e
|
|
2541
|
+
}) : o(d);
|
|
2542
|
+
},
|
|
2543
|
+
type: "button",
|
|
2544
|
+
disabled: h,
|
|
2545
|
+
"aria-label": m,
|
|
2546
|
+
className: qn.buttonReset,
|
|
2547
|
+
onKeyDown: (e) => {
|
|
2548
|
+
y.onKeyDown?.(e), e.defaultPrevented || l(e);
|
|
2549
|
+
},
|
|
2550
|
+
onClick: (e) => {
|
|
2551
|
+
v?.(e), !e.defaultPrevented && !h && n?.(d);
|
|
2552
|
+
},
|
|
2553
|
+
children: u
|
|
2554
|
+
})
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
function Qn() {
|
|
2558
|
+
let { classNames: e } = Yn("NavRail.Spacer");
|
|
2559
|
+
return /* @__PURE__ */ p("div", {
|
|
2560
|
+
"aria-hidden": "true",
|
|
2561
|
+
"data-scope": "nav-rail",
|
|
2562
|
+
"data-part": "spacer",
|
|
2563
|
+
className: _(qn.spacer, e?.spacer)
|
|
2276
2564
|
});
|
|
2277
2565
|
}
|
|
2278
|
-
|
|
2566
|
+
function $n({ label: e, className: t, children: n, ...r }) {
|
|
2567
|
+
let { classNames: i } = Yn("NavRail.Section");
|
|
2568
|
+
return /* @__PURE__ */ p("div", {
|
|
2569
|
+
"data-scope": "nav-rail",
|
|
2570
|
+
"data-part": "section",
|
|
2571
|
+
className: _(qn.section, i?.section, t),
|
|
2572
|
+
"aria-label": e,
|
|
2573
|
+
role: e ? "group" : void 0,
|
|
2574
|
+
...r,
|
|
2575
|
+
children: n
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
var er = Object.assign(Xn, {
|
|
2579
|
+
Item: Zn,
|
|
2580
|
+
Section: $n,
|
|
2581
|
+
Spacer: Qn
|
|
2582
|
+
}), tr = { root: "_root_1226l_1" };
|
|
2279
2583
|
//#endregion
|
|
2280
2584
|
//#region src/components/Panel.tsx
|
|
2281
|
-
function
|
|
2585
|
+
function nr({ as: e = "section", variant: t = "default", padding: n = "none", className: r, children: i, ...a }) {
|
|
2282
2586
|
return /* @__PURE__ */ p(e, {
|
|
2283
2587
|
"data-variant": t,
|
|
2284
2588
|
"data-padding": n === "none" ? void 0 : n,
|
|
2285
2589
|
"data-scope": "panel",
|
|
2286
|
-
className: _("owo-panel",
|
|
2590
|
+
className: _("owo-panel", tr.root, r),
|
|
2287
2591
|
...a,
|
|
2288
2592
|
children: i
|
|
2289
2593
|
});
|
|
2290
2594
|
}
|
|
2291
|
-
function
|
|
2595
|
+
function rr({ className: e, children: t, ...n }) {
|
|
2292
2596
|
return /* @__PURE__ */ p("div", {
|
|
2293
2597
|
"data-scope": "panel",
|
|
2294
2598
|
"data-part": "header",
|
|
@@ -2297,7 +2601,7 @@ function Vn({ className: e, children: t, ...n }) {
|
|
|
2297
2601
|
children: t
|
|
2298
2602
|
});
|
|
2299
2603
|
}
|
|
2300
|
-
function
|
|
2604
|
+
function ir({ className: e, children: t, ...n }) {
|
|
2301
2605
|
return /* @__PURE__ */ p("div", {
|
|
2302
2606
|
"data-scope": "panel",
|
|
2303
2607
|
"data-part": "body",
|
|
@@ -2306,7 +2610,7 @@ function Hn({ className: e, children: t, ...n }) {
|
|
|
2306
2610
|
children: t
|
|
2307
2611
|
});
|
|
2308
2612
|
}
|
|
2309
|
-
function
|
|
2613
|
+
function ar({ className: e, children: t, ...n }) {
|
|
2310
2614
|
return /* @__PURE__ */ p("div", {
|
|
2311
2615
|
"data-scope": "panel",
|
|
2312
2616
|
"data-part": "footer",
|
|
@@ -2315,209 +2619,682 @@ function Un({ className: e, children: t, ...n }) {
|
|
|
2315
2619
|
children: t
|
|
2316
2620
|
});
|
|
2317
2621
|
}
|
|
2318
|
-
var
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
defaultValue: t,
|
|
2328
|
-
onChange: n,
|
|
2329
|
-
fallback: r.find((e) => !e.disabled)?.value ?? r[0]?.value ?? ""
|
|
2330
|
-
}), b = B({
|
|
2331
|
-
id: c,
|
|
2332
|
-
disabled: a,
|
|
2333
|
-
required: o,
|
|
2334
|
-
invalid: s,
|
|
2335
|
-
"aria-describedby": h
|
|
2336
|
-
}), x = u([]), S = r.reduce((e, t, n) => (!t.disabled && !b.disabled && e.push(n), e), []), C = r.findIndex((e) => e.value === v), w = C >= 0 ? C : S[0] ?? -1;
|
|
2337
|
-
function T(e, t) {
|
|
2338
|
-
if (S.length === 0) return;
|
|
2339
|
-
let n = S.indexOf(e), i;
|
|
2340
|
-
t === "first" && (i = S[0]), t === "last" && (i = S[S.length - 1]), t === "next" && (i = n >= 0 ? S[(n + 1) % S.length] : S[0]), t === "prev" && (i = n >= 0 ? S[(n - 1 + S.length) % S.length] : S[S.length - 1]), i !== void 0 && (y(r[i].value), x.current[i]?.focus());
|
|
2341
|
-
}
|
|
2342
|
-
return /* @__PURE__ */ m("div", {
|
|
2343
|
-
role: "radiogroup",
|
|
2344
|
-
id: b.id,
|
|
2345
|
-
"aria-label": f,
|
|
2346
|
-
"aria-labelledby": f ? void 0 : g?.labelId,
|
|
2347
|
-
"aria-describedby": b["aria-describedby"],
|
|
2348
|
-
"aria-invalid": b.invalid || void 0,
|
|
2349
|
-
"aria-required": b.required || void 0,
|
|
2350
|
-
"data-size": i,
|
|
2351
|
-
"data-disabled": b.disabled || void 0,
|
|
2352
|
-
"data-invalid": b.invalid || void 0,
|
|
2353
|
-
className: _("owo-segmented-control", Wn.root, d),
|
|
2354
|
-
children: [r.map((e, t) => {
|
|
2355
|
-
let n = e.value === v, r = e.disabled || b.disabled;
|
|
2356
|
-
return /* @__PURE__ */ p("button", {
|
|
2357
|
-
ref: (e) => {
|
|
2358
|
-
x.current[t] = e;
|
|
2359
|
-
},
|
|
2360
|
-
type: "button",
|
|
2361
|
-
role: "radio",
|
|
2362
|
-
"aria-checked": n,
|
|
2363
|
-
disabled: r,
|
|
2364
|
-
tabIndex: r ? -1 : t === w ? 0 : -1,
|
|
2365
|
-
"data-disabled": r || void 0,
|
|
2366
|
-
"data-active": n ? "true" : void 0,
|
|
2367
|
-
className: Wn.item,
|
|
2368
|
-
onClick: () => y(e.value),
|
|
2369
|
-
onKeyDown: (e) => {
|
|
2370
|
-
if (!r) switch (e.key) {
|
|
2371
|
-
case "ArrowRight":
|
|
2372
|
-
case "ArrowDown":
|
|
2373
|
-
e.preventDefault(), T(t, "next");
|
|
2374
|
-
break;
|
|
2375
|
-
case "ArrowLeft":
|
|
2376
|
-
case "ArrowUp":
|
|
2377
|
-
e.preventDefault(), T(t, "prev");
|
|
2378
|
-
break;
|
|
2379
|
-
case "Home":
|
|
2380
|
-
e.preventDefault(), T(t, "first");
|
|
2381
|
-
break;
|
|
2382
|
-
case "End":
|
|
2383
|
-
e.preventDefault(), T(t, "last");
|
|
2384
|
-
break;
|
|
2385
|
-
}
|
|
2386
|
-
},
|
|
2387
|
-
children: e.label
|
|
2388
|
-
}, e.value);
|
|
2389
|
-
}), l != null && /* @__PURE__ */ p("input", {
|
|
2390
|
-
type: "hidden",
|
|
2391
|
-
name: l,
|
|
2392
|
-
value: v,
|
|
2393
|
-
disabled: b.disabled,
|
|
2394
|
-
"aria-hidden": "true"
|
|
2395
|
-
})]
|
|
2396
|
-
});
|
|
2622
|
+
var or = {
|
|
2623
|
+
trigger: "_trigger_93qj8_1",
|
|
2624
|
+
content: "_content_93qj8_10",
|
|
2625
|
+
arrow: "_arrow_93qj8_22"
|
|
2626
|
+
}, sr = n(null);
|
|
2627
|
+
function cr(e) {
|
|
2628
|
+
let t = a(sr);
|
|
2629
|
+
if (!t) throw Error(`${e} must be used within Popover.Root.`);
|
|
2630
|
+
return t;
|
|
2397
2631
|
}
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2632
|
+
function lr(...e) {
|
|
2633
|
+
return (t) => {
|
|
2634
|
+
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
2635
|
+
};
|
|
2636
|
+
}
|
|
2637
|
+
function ur(e, t) {
|
|
2638
|
+
return (n) => {
|
|
2639
|
+
e?.(n), t(n);
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2642
|
+
function dr(e, t) {
|
|
2643
|
+
let n = document.activeElement;
|
|
2644
|
+
return n instanceof Node ? !!(e?.contains(n) || t?.contains(n)) : !1;
|
|
2645
|
+
}
|
|
2646
|
+
function fr(e) {
|
|
2647
|
+
return typeof e.type == "string" && [
|
|
2648
|
+
"button",
|
|
2649
|
+
"a",
|
|
2650
|
+
"input",
|
|
2651
|
+
"select",
|
|
2652
|
+
"textarea",
|
|
2653
|
+
"summary"
|
|
2654
|
+
].includes(e.type);
|
|
2655
|
+
}
|
|
2656
|
+
function pr({ open: e, defaultOpen: t = !1, onOpenChange: n, trigger: r = "click", classNames: a, children: o }) {
|
|
2657
|
+
let [c, f] = d(t), m = e !== void 0, h = m ? e : c, g = u(null), _ = u(null), v = s(), y = s(), b = i((e) => {
|
|
2658
|
+
m || f(e), n?.(e);
|
|
2659
|
+
}, [m, n]), x = l(() => ({
|
|
2660
|
+
open: h,
|
|
2661
|
+
trigger: r,
|
|
2662
|
+
setOpen: b,
|
|
2663
|
+
triggerRef: g,
|
|
2664
|
+
contentRef: _,
|
|
2665
|
+
triggerId: v,
|
|
2666
|
+
contentId: y,
|
|
2667
|
+
classNames: a
|
|
2668
|
+
}), [
|
|
2669
|
+
h,
|
|
2670
|
+
a,
|
|
2671
|
+
b,
|
|
2672
|
+
r,
|
|
2673
|
+
v,
|
|
2674
|
+
y
|
|
2675
|
+
]);
|
|
2676
|
+
return /* @__PURE__ */ p(sr.Provider, {
|
|
2677
|
+
value: x,
|
|
2678
|
+
children: o
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
function mr({ asChild: e = !1, disabled: n = !1, className: a, children: s }) {
|
|
2682
|
+
let { open: c, trigger: l, setOpen: d, triggerRef: f, contentRef: m, triggerId: h, contentId: g, classNames: v } = cr("Popover.Trigger"), y = u(void 0), b = i(() => {
|
|
2683
|
+
clearTimeout(y.current);
|
|
2684
|
+
}, []), x = i(() => {
|
|
2685
|
+
b(), y.current = setTimeout(() => d(!1), 100);
|
|
2686
|
+
}, [b, d]);
|
|
2687
|
+
if (o(() => b, [b]), !r(s)) throw Error("Popover.Trigger expects a single React element child.");
|
|
2688
|
+
let S = {
|
|
2689
|
+
ref: lr(s.ref, f),
|
|
2690
|
+
id: h,
|
|
2691
|
+
"aria-expanded": c,
|
|
2692
|
+
"aria-controls": g,
|
|
2693
|
+
"aria-haspopup": "dialog",
|
|
2694
|
+
"data-state": c ? "open" : "closed",
|
|
2695
|
+
"data-scope": "popover",
|
|
2696
|
+
"data-part": "trigger",
|
|
2697
|
+
className: _(!e && or.trigger, v?.trigger, a, s.props.className),
|
|
2698
|
+
onClick: ur(s.props.onClick, (e) => {
|
|
2699
|
+
n || (l === "click" || (e.detail ?? 0) > 0) && d(!c);
|
|
2700
|
+
}),
|
|
2701
|
+
onMouseEnter: ur(s.props.onMouseEnter, () => {
|
|
2702
|
+
n || l !== "hover" || (b(), d(!0));
|
|
2703
|
+
}),
|
|
2704
|
+
onMouseLeave: ur(s.props.onMouseLeave, () => {
|
|
2705
|
+
if (!(n || l !== "hover")) {
|
|
2706
|
+
if (dr(f.current, m.current)) {
|
|
2707
|
+
b();
|
|
2708
|
+
return;
|
|
2709
|
+
}
|
|
2710
|
+
x();
|
|
2711
|
+
}
|
|
2712
|
+
}),
|
|
2713
|
+
onPointerDown: ur(s.props.onPointerDown, (e) => {
|
|
2714
|
+
n || l !== "hover" || e.pointerType !== "mouse" && d(!0);
|
|
2715
|
+
}),
|
|
2716
|
+
onFocus: ur(s.props.onFocus, () => {
|
|
2717
|
+
n || l !== "hover" || (b(), d(!0));
|
|
2718
|
+
}),
|
|
2719
|
+
onBlur: ur(s.props.onBlur, (e) => {
|
|
2720
|
+
if (n || l !== "hover") return;
|
|
2721
|
+
let t = e.relatedTarget;
|
|
2722
|
+
if (t && m.current?.contains(t)) {
|
|
2723
|
+
b();
|
|
2724
|
+
return;
|
|
2725
|
+
}
|
|
2726
|
+
x();
|
|
2727
|
+
})
|
|
2728
|
+
};
|
|
2729
|
+
return e || fr(s) ? t(s, S) : /* @__PURE__ */ p("button", {
|
|
2730
|
+
type: "button",
|
|
2731
|
+
...S,
|
|
2732
|
+
children: s
|
|
2733
|
+
});
|
|
2407
2734
|
}
|
|
2408
|
-
|
|
2409
|
-
|
|
2735
|
+
var hr = 6;
|
|
2736
|
+
function gr({ placement: e = "bottom", side: t = "bottom", align: n = "center", sideOffset: r = 8, alignOffset: a = 0, collisionPadding: s = 8, portal: l = !0, arrow: f = !0, matchTriggerWidth: g = !1, closeOnInteractOutside: v = !0, closeOnEscape: y = !0, closeOnPointerDownOutside: b = !0, restoreFocus: x = !0, initialFocusRef: S, onInteractOutside: C, onEscapeKeyDown: w, onPointerDownOutside: T, className: E, classNames: D, children: O, onMouseEnter: k, onMouseLeave: A, onFocus: j, onBlur: M, ...N }) {
|
|
2737
|
+
let { open: P, trigger: F, setOpen: I, triggerRef: L, contentRef: R, contentId: z, triggerId: ee, classNames: B } = cr("Popover.Content"), [V, H] = d(null), [U, te] = d("bottom"), [W, G] = d({}), [K, ne] = d(null), q = u(null), J = u(void 0), Y = i(() => {
|
|
2738
|
+
clearTimeout(J.current);
|
|
2739
|
+
}, []), X = i(() => {
|
|
2740
|
+
Y(), J.current = setTimeout(() => I(!1), 100);
|
|
2741
|
+
}, [Y, I]);
|
|
2742
|
+
if (c(() => {
|
|
2743
|
+
if (!P || !L.current || !R.current) return;
|
|
2744
|
+
let i = e === "auto" ? t : e ?? (n === "center" ? t : `${t}-${n}`), o = [
|
|
2745
|
+
Zt({
|
|
2746
|
+
mainAxis: f ? r + hr : r,
|
|
2747
|
+
crossAxis: a
|
|
2748
|
+
}),
|
|
2749
|
+
$t({ padding: s }),
|
|
2750
|
+
Qt({ padding: s })
|
|
2751
|
+
];
|
|
2752
|
+
return f && q.current && o.push(en({ element: q.current })), Xt(L.current, R.current, () => {
|
|
2753
|
+
!L.current || !R.current || tn(L.current, R.current, {
|
|
2754
|
+
placement: i,
|
|
2755
|
+
strategy: "fixed",
|
|
2756
|
+
middleware: o
|
|
2757
|
+
}).then(({ x: e, y: t, placement: n, middlewareData: r }) => {
|
|
2758
|
+
H({
|
|
2759
|
+
top: t,
|
|
2760
|
+
left: e
|
|
2761
|
+
}), te(n), ne(L.current?.offsetWidth ?? null), r.arrow && G({
|
|
2762
|
+
x: r.arrow.x,
|
|
2763
|
+
y: r.arrow.y
|
|
2764
|
+
});
|
|
2765
|
+
});
|
|
2766
|
+
});
|
|
2767
|
+
}, [
|
|
2768
|
+
n,
|
|
2769
|
+
a,
|
|
2770
|
+
f,
|
|
2771
|
+
s,
|
|
2772
|
+
R,
|
|
2773
|
+
g,
|
|
2774
|
+
P,
|
|
2775
|
+
e,
|
|
2776
|
+
t,
|
|
2777
|
+
r,
|
|
2778
|
+
L
|
|
2779
|
+
]), o(() => {
|
|
2780
|
+
if (!P) return;
|
|
2781
|
+
F === "click" && requestAnimationFrame(() => {
|
|
2782
|
+
let e = R.current;
|
|
2783
|
+
if (!e) return;
|
|
2784
|
+
if (S?.current) {
|
|
2785
|
+
S.current.focus();
|
|
2786
|
+
return;
|
|
2787
|
+
}
|
|
2788
|
+
let t = e.querySelector("button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])");
|
|
2789
|
+
if (t) {
|
|
2790
|
+
t.focus();
|
|
2791
|
+
return;
|
|
2792
|
+
}
|
|
2793
|
+
e.focus();
|
|
2794
|
+
});
|
|
2795
|
+
function e(e) {
|
|
2796
|
+
let t = e.target;
|
|
2797
|
+
R.current?.contains(t) || L.current?.contains(t) || (C?.(t), T?.(t), !(!v || !b) && (I(!1), x && L.current?.focus()));
|
|
2798
|
+
}
|
|
2799
|
+
function t(e) {
|
|
2800
|
+
e.key === "Escape" && (w?.(), y && (e.stopPropagation(), I(!1), x && L.current?.focus()));
|
|
2801
|
+
}
|
|
2802
|
+
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
2803
|
+
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
2804
|
+
};
|
|
2805
|
+
}, [
|
|
2806
|
+
y,
|
|
2807
|
+
v,
|
|
2808
|
+
b,
|
|
2809
|
+
R,
|
|
2810
|
+
S,
|
|
2811
|
+
w,
|
|
2812
|
+
C,
|
|
2813
|
+
T,
|
|
2814
|
+
P,
|
|
2815
|
+
x,
|
|
2816
|
+
I,
|
|
2817
|
+
L,
|
|
2818
|
+
F
|
|
2819
|
+
]), o(() => Y, [Y]), !P) return null;
|
|
2820
|
+
let re = U.split("-")[0], ie = { position: "absolute" };
|
|
2821
|
+
re === "top" || re === "bottom" ? (ie.left = W.x ?? 0, ie[re === "top" ? "bottom" : "top"] = -hr) : (ie.top = W.y ?? 0, ie[re === "left" ? "right" : "left"] = -hr);
|
|
2822
|
+
let ae = /* @__PURE__ */ m("div", {
|
|
2823
|
+
ref: R,
|
|
2824
|
+
id: z,
|
|
2825
|
+
role: "dialog",
|
|
2826
|
+
"aria-modal": "false",
|
|
2827
|
+
"aria-labelledby": ee,
|
|
2828
|
+
tabIndex: -1,
|
|
2829
|
+
"data-state": "open",
|
|
2830
|
+
"data-placement": re,
|
|
2831
|
+
"data-scope": "popover",
|
|
2832
|
+
"data-part": "content",
|
|
2833
|
+
className: _("owo-popover", or.content, B?.content, D?.content, E),
|
|
2834
|
+
style: V ? {
|
|
2835
|
+
top: V.top,
|
|
2836
|
+
left: V.left,
|
|
2837
|
+
width: g && K ? K : void 0
|
|
2838
|
+
} : {
|
|
2839
|
+
top: 0,
|
|
2840
|
+
left: 0,
|
|
2841
|
+
width: g && K ? K : void 0
|
|
2842
|
+
},
|
|
2843
|
+
onMouseEnter: (e) => {
|
|
2844
|
+
k?.(e), F === "hover" && Y();
|
|
2845
|
+
},
|
|
2846
|
+
onMouseLeave: (e) => {
|
|
2847
|
+
if (A?.(e), F === "hover") {
|
|
2848
|
+
if (dr(L.current, R.current)) {
|
|
2849
|
+
Y();
|
|
2850
|
+
return;
|
|
2851
|
+
}
|
|
2852
|
+
X();
|
|
2853
|
+
}
|
|
2854
|
+
},
|
|
2855
|
+
onFocus: (e) => {
|
|
2856
|
+
j?.(e), F === "hover" && Y();
|
|
2857
|
+
},
|
|
2858
|
+
onBlur: (e) => {
|
|
2859
|
+
if (M?.(e), F !== "hover") return;
|
|
2860
|
+
let t = e.relatedTarget;
|
|
2861
|
+
if (t && (R.current?.contains(t) || L.current?.contains(t))) {
|
|
2862
|
+
Y();
|
|
2863
|
+
return;
|
|
2864
|
+
}
|
|
2865
|
+
X();
|
|
2866
|
+
},
|
|
2867
|
+
...N,
|
|
2868
|
+
children: [O, f && /* @__PURE__ */ p("span", {
|
|
2869
|
+
ref: q,
|
|
2870
|
+
"data-scope": "popover",
|
|
2871
|
+
"data-part": "arrow",
|
|
2872
|
+
className: _(or.arrow, B?.arrow, D?.arrow),
|
|
2873
|
+
style: ie
|
|
2874
|
+
})]
|
|
2875
|
+
});
|
|
2876
|
+
return l ? h(ae, document.body) : ae;
|
|
2877
|
+
}
|
|
2878
|
+
var _r = Object.assign(pr, {
|
|
2879
|
+
Root: pr,
|
|
2880
|
+
Trigger: mr,
|
|
2881
|
+
Content: gr
|
|
2882
|
+
}), vr = {
|
|
2883
|
+
group: "_group_bhiyd_1",
|
|
2884
|
+
root: "_root_bhiyd_13",
|
|
2885
|
+
input: "_input_bhiyd_27",
|
|
2886
|
+
control: "_control_bhiyd_40",
|
|
2887
|
+
indicator: "_indicator_bhiyd_55",
|
|
2888
|
+
label: "_label_bhiyd_107"
|
|
2889
|
+
}, yr = n(null);
|
|
2890
|
+
function br() {
|
|
2891
|
+
return a(yr);
|
|
2892
|
+
}
|
|
2893
|
+
function xr({ checked: e, defaultChecked: t, onCheckedChange: n, size: r = "md", invalid: i, disabled: a, required: o, id: s, name: c, value: l = "on", className: u, ariaLabel: d, children: f, onKeyDown: h, "aria-describedby": g, ...v }) {
|
|
2894
|
+
let y = br(), b = ee(), x = V({
|
|
2895
|
+
id: s,
|
|
2896
|
+
disabled: a,
|
|
2897
|
+
required: o,
|
|
2898
|
+
invalid: i,
|
|
2899
|
+
"aria-describedby": g
|
|
2900
|
+
}), S = String(l), C = y ? y.value === S : e, [w, T] = H({
|
|
2901
|
+
value: e,
|
|
2902
|
+
defaultValue: t,
|
|
2903
|
+
onChange: n,
|
|
2904
|
+
fallback: !1
|
|
2905
|
+
}), E = y ? C : w, D = y?.disabled ?? x.disabled, O = y?.invalid ?? x.invalid, k = y?.required ?? x.required, A = y?.name ?? c, j = y?.size ?? r, M = y?.describedBy ?? x["aria-describedby"];
|
|
2906
|
+
B({
|
|
2907
|
+
componentName: "Radio",
|
|
2908
|
+
ariaLabel: d,
|
|
2909
|
+
labelledBy: y ? void 0 : b?.labelId,
|
|
2910
|
+
hasVisibleLabel: f != null,
|
|
2911
|
+
disabled: D
|
|
2912
|
+
});
|
|
2913
|
+
function N(e) {
|
|
2914
|
+
if (y) switch (e.key) {
|
|
2915
|
+
case "ArrowRight":
|
|
2916
|
+
case "ArrowDown":
|
|
2917
|
+
e.preventDefault(), y.moveSelection(S, "next");
|
|
2918
|
+
break;
|
|
2919
|
+
case "ArrowLeft":
|
|
2920
|
+
case "ArrowUp":
|
|
2921
|
+
e.preventDefault(), y.moveSelection(S, "prev");
|
|
2922
|
+
break;
|
|
2923
|
+
case "Home":
|
|
2924
|
+
e.preventDefault(), y.moveSelection(S, "first");
|
|
2925
|
+
break;
|
|
2926
|
+
case "End":
|
|
2927
|
+
e.preventDefault(), y.moveSelection(S, "last");
|
|
2928
|
+
break;
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
return /* @__PURE__ */ m("label", {
|
|
2932
|
+
"data-scope": "radio",
|
|
2933
|
+
"data-part": "root",
|
|
2934
|
+
"data-disabled": D || void 0,
|
|
2935
|
+
"data-invalid": O || void 0,
|
|
2936
|
+
className: _("owo-radio", vr.root, u),
|
|
2937
|
+
children: [
|
|
2938
|
+
/* @__PURE__ */ p("input", {
|
|
2939
|
+
...v,
|
|
2940
|
+
ref: (e) => {
|
|
2941
|
+
y != null && (e ? y.registerItem({
|
|
2942
|
+
value: S,
|
|
2943
|
+
disabled: !!a,
|
|
2944
|
+
ref: e
|
|
2945
|
+
}) : y.unregisterItem(S));
|
|
2946
|
+
},
|
|
2947
|
+
id: y ? void 0 : x.id,
|
|
2948
|
+
type: "radio",
|
|
2949
|
+
name: A,
|
|
2950
|
+
value: l,
|
|
2951
|
+
checked: !!E,
|
|
2952
|
+
disabled: D,
|
|
2953
|
+
required: k,
|
|
2954
|
+
"aria-label": d,
|
|
2955
|
+
"aria-describedby": M,
|
|
2956
|
+
"aria-invalid": O || void 0,
|
|
2957
|
+
className: vr.input,
|
|
2958
|
+
onChange: (e) => {
|
|
2959
|
+
if (!D) {
|
|
2960
|
+
if (y) {
|
|
2961
|
+
y.selectValue(String(e.target.value));
|
|
2962
|
+
return;
|
|
2963
|
+
}
|
|
2964
|
+
T(!0);
|
|
2965
|
+
}
|
|
2966
|
+
},
|
|
2967
|
+
onKeyDown: (e) => {
|
|
2968
|
+
h?.(e), e.defaultPrevented || N(e);
|
|
2969
|
+
}
|
|
2970
|
+
}),
|
|
2971
|
+
/* @__PURE__ */ p("span", {
|
|
2972
|
+
"data-scope": "radio",
|
|
2973
|
+
"data-part": "control",
|
|
2974
|
+
"data-size": j,
|
|
2975
|
+
className: vr.control,
|
|
2976
|
+
children: /* @__PURE__ */ p("span", {
|
|
2977
|
+
"data-scope": "radio",
|
|
2978
|
+
"data-part": "indicator",
|
|
2979
|
+
className: vr.indicator
|
|
2980
|
+
})
|
|
2981
|
+
}),
|
|
2982
|
+
f != null && /* @__PURE__ */ p("span", {
|
|
2983
|
+
"data-scope": "radio",
|
|
2984
|
+
"data-part": "label",
|
|
2985
|
+
className: vr.label,
|
|
2986
|
+
children: f
|
|
2987
|
+
})
|
|
2988
|
+
]
|
|
2989
|
+
});
|
|
2990
|
+
}
|
|
2991
|
+
function Sr({ value: e, defaultValue: t, onValueChange: n, options: r, size: i = "md", orientation: a = "vertical", disabled: o, required: s, invalid: c, id: d, name: f, className: m, ariaLabel: h, children: g, "aria-describedby": v }) {
|
|
2992
|
+
let y = ee(), [b, x] = H({
|
|
2410
2993
|
value: e,
|
|
2411
2994
|
defaultValue: t,
|
|
2412
2995
|
onChange: (e) => {
|
|
2413
|
-
e !==
|
|
2996
|
+
e !== void 0 && n?.(e);
|
|
2414
2997
|
},
|
|
2415
|
-
fallback:
|
|
2416
|
-
}),
|
|
2417
|
-
id:
|
|
2418
|
-
disabled:
|
|
2419
|
-
required:
|
|
2420
|
-
invalid:
|
|
2421
|
-
"aria-describedby":
|
|
2422
|
-
})
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2998
|
+
fallback: void 0
|
|
2999
|
+
}), S = V({
|
|
3000
|
+
id: d,
|
|
3001
|
+
disabled: o,
|
|
3002
|
+
required: s,
|
|
3003
|
+
invalid: c,
|
|
3004
|
+
"aria-describedby": v
|
|
3005
|
+
});
|
|
3006
|
+
B({
|
|
3007
|
+
componentName: "RadioGroup",
|
|
3008
|
+
ariaLabel: h,
|
|
3009
|
+
labelledBy: y?.labelId,
|
|
3010
|
+
disabled: S.disabled
|
|
3011
|
+
});
|
|
3012
|
+
let C = u([]), w = l(() => ({
|
|
3013
|
+
name: f,
|
|
3014
|
+
value: b,
|
|
3015
|
+
disabled: S.disabled,
|
|
3016
|
+
invalid: S.invalid,
|
|
3017
|
+
required: S.required,
|
|
3018
|
+
size: i,
|
|
3019
|
+
orientation: a,
|
|
3020
|
+
describedBy: S["aria-describedby"],
|
|
3021
|
+
selectValue: (e) => {
|
|
3022
|
+
x(e);
|
|
3023
|
+
},
|
|
3024
|
+
registerItem: (e) => {
|
|
3025
|
+
let t = C.current.filter((t) => t.value !== e.value);
|
|
3026
|
+
t.push(e), C.current = t;
|
|
3027
|
+
},
|
|
3028
|
+
unregisterItem: (e) => {
|
|
3029
|
+
C.current = C.current.filter((t) => t.value !== e);
|
|
3030
|
+
},
|
|
3031
|
+
moveSelection: (e, t) => {
|
|
3032
|
+
let n = C.current.filter((e) => !e.disabled);
|
|
3033
|
+
if (n.length === 0) return;
|
|
3034
|
+
let r = n.findIndex((t) => t.value === e), i = n[0];
|
|
3035
|
+
t === "first" && (i = n[0]), t === "last" && (i = n[n.length - 1]), t === "next" && (i = n[r >= 0 ? (r + 1) % n.length : 0]), t === "prev" && (i = n[r >= 0 ? (r - 1 + n.length) % n.length : n.length - 1]), x(i.value), i.ref?.focus();
|
|
3036
|
+
}
|
|
3037
|
+
}), [
|
|
3038
|
+
S.disabled,
|
|
3039
|
+
S.invalid,
|
|
3040
|
+
S.required,
|
|
3041
|
+
S["aria-describedby"],
|
|
3042
|
+
f,
|
|
3043
|
+
a,
|
|
3044
|
+
x,
|
|
3045
|
+
i,
|
|
3046
|
+
b
|
|
3047
|
+
]), T = r?.findIndex((e) => e.value === b) ?? -1, E = r?.findIndex((e) => !e.disabled) ?? -1, D = T >= 0 ? r?.[T]?.value : r?.[E]?.value, O = r?.map((e) => /* @__PURE__ */ p(xr, {
|
|
3048
|
+
value: e.value,
|
|
3049
|
+
disabled: e.disabled,
|
|
3050
|
+
ariaLabel: typeof e.label == "string" ? e.label : e.textValue,
|
|
3051
|
+
tabIndex: e.disabled || S.disabled ? -1 : D === e.value ? 0 : -1,
|
|
3052
|
+
children: e.label
|
|
3053
|
+
}, e.value));
|
|
3054
|
+
return /* @__PURE__ */ p(yr.Provider, {
|
|
3055
|
+
value: w,
|
|
3056
|
+
children: /* @__PURE__ */ p("div", {
|
|
3057
|
+
role: "radiogroup",
|
|
3058
|
+
id: S.id,
|
|
3059
|
+
"aria-label": h,
|
|
3060
|
+
"aria-labelledby": h ? void 0 : y?.labelId,
|
|
3061
|
+
"aria-describedby": S["aria-describedby"],
|
|
3062
|
+
"aria-invalid": S.invalid || void 0,
|
|
3063
|
+
"aria-required": S.required || void 0,
|
|
3064
|
+
"data-scope": "radio-group",
|
|
3065
|
+
"data-part": "group",
|
|
3066
|
+
"data-size": i,
|
|
3067
|
+
"data-orientation": a,
|
|
3068
|
+
"data-disabled": S.disabled || void 0,
|
|
3069
|
+
"data-invalid": S.invalid || void 0,
|
|
3070
|
+
className: _("owo-radio-group", vr.group, m),
|
|
3071
|
+
children: r ? O : g
|
|
3072
|
+
})
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
3075
|
+
var Cr = {
|
|
3076
|
+
root: "_root_c2l0v_1",
|
|
3077
|
+
item: "_item_c2l0v_41"
|
|
3078
|
+
};
|
|
3079
|
+
//#endregion
|
|
3080
|
+
//#region src/components/SegmentedControl.tsx
|
|
3081
|
+
function wr({ value: e, defaultValue: t, onValueChange: n, options: r, size: i = "md", disabled: a, required: o, invalid: s, id: c, name: l, className: d, ariaLabel: f, "aria-describedby": h }) {
|
|
3082
|
+
let g = ee(), [v, y] = H({
|
|
3083
|
+
value: e,
|
|
3084
|
+
defaultValue: t,
|
|
3085
|
+
onChange: n,
|
|
3086
|
+
fallback: r.find((e) => !e.disabled)?.value ?? r[0]?.value ?? ""
|
|
3087
|
+
}), b = V({
|
|
3088
|
+
id: c,
|
|
3089
|
+
disabled: a,
|
|
3090
|
+
required: o,
|
|
3091
|
+
invalid: s,
|
|
3092
|
+
"aria-describedby": h
|
|
3093
|
+
});
|
|
3094
|
+
B({
|
|
3095
|
+
componentName: "SegmentedControl",
|
|
3096
|
+
ariaLabel: f,
|
|
3097
|
+
labelledBy: g?.labelId,
|
|
3098
|
+
disabled: b.disabled
|
|
3099
|
+
});
|
|
3100
|
+
let x = u([]), S = r.reduce((e, t, n) => (!t.disabled && !b.disabled && e.push(n), e), []), C = r.findIndex((e) => e.value === v), w = C >= 0 && !r[C]?.disabled ? C : -1, T = w >= 0 ? w : S[0] ?? -1, E = w >= 0 ? v : void 0;
|
|
3101
|
+
function D(e, t) {
|
|
3102
|
+
if (S.length === 0) return;
|
|
3103
|
+
let n = S.indexOf(e), i;
|
|
3104
|
+
t === "first" && (i = S[0]), t === "last" && (i = S[S.length - 1]), t === "next" && (i = n >= 0 ? S[(n + 1) % S.length] : S[0]), t === "prev" && (i = n >= 0 ? S[(n - 1 + S.length) % S.length] : S[S.length - 1]), i !== void 0 && (y(r[i].value), x.current[i]?.focus());
|
|
3105
|
+
}
|
|
3106
|
+
return /* @__PURE__ */ m("div", {
|
|
3107
|
+
role: "radiogroup",
|
|
3108
|
+
id: b.id,
|
|
3109
|
+
"aria-label": f,
|
|
3110
|
+
"aria-labelledby": f ? void 0 : g?.labelId,
|
|
3111
|
+
"aria-describedby": b["aria-describedby"],
|
|
3112
|
+
"aria-invalid": b.invalid || void 0,
|
|
3113
|
+
"aria-required": b.required || void 0,
|
|
3114
|
+
"data-size": i,
|
|
3115
|
+
"data-disabled": b.disabled || void 0,
|
|
3116
|
+
"data-invalid": b.invalid || void 0,
|
|
3117
|
+
className: _("owo-segmented-control", Cr.root, d),
|
|
3118
|
+
children: [r.map((e, t) => {
|
|
3119
|
+
let n = e.value === v, r = e.disabled || b.disabled;
|
|
3120
|
+
return /* @__PURE__ */ p("button", {
|
|
3121
|
+
ref: (e) => {
|
|
3122
|
+
x.current[t] = e;
|
|
3123
|
+
},
|
|
3124
|
+
type: "button",
|
|
3125
|
+
role: "radio",
|
|
3126
|
+
"aria-checked": n,
|
|
3127
|
+
disabled: r,
|
|
3128
|
+
tabIndex: r ? -1 : t === T ? 0 : -1,
|
|
3129
|
+
"data-disabled": r || void 0,
|
|
3130
|
+
"data-active": n ? "true" : void 0,
|
|
3131
|
+
className: Cr.item,
|
|
3132
|
+
onClick: () => y(e.value),
|
|
3133
|
+
onKeyDown: (e) => {
|
|
3134
|
+
if (!r) switch (e.key) {
|
|
3135
|
+
case "ArrowRight":
|
|
3136
|
+
case "ArrowDown":
|
|
3137
|
+
e.preventDefault(), D(t, "next");
|
|
3138
|
+
break;
|
|
3139
|
+
case "ArrowLeft":
|
|
3140
|
+
case "ArrowUp":
|
|
3141
|
+
e.preventDefault(), D(t, "prev");
|
|
3142
|
+
break;
|
|
3143
|
+
case "Home":
|
|
3144
|
+
e.preventDefault(), D(t, "first");
|
|
3145
|
+
break;
|
|
3146
|
+
case "End":
|
|
3147
|
+
e.preventDefault(), D(t, "last");
|
|
3148
|
+
break;
|
|
3149
|
+
}
|
|
3150
|
+
},
|
|
3151
|
+
children: e.label
|
|
3152
|
+
}, e.value);
|
|
3153
|
+
}), l != null && E !== void 0 && /* @__PURE__ */ p("input", {
|
|
3154
|
+
type: "hidden",
|
|
3155
|
+
name: l,
|
|
3156
|
+
value: E,
|
|
3157
|
+
disabled: b.disabled,
|
|
3158
|
+
"aria-hidden": "true"
|
|
3159
|
+
})]
|
|
3160
|
+
});
|
|
3161
|
+
}
|
|
3162
|
+
var Tr = {
|
|
3163
|
+
root: "_root_11cvf_1",
|
|
3164
|
+
nativeControl: "_nativeControl_11cvf_6",
|
|
3165
|
+
valueText: "_valueText_11cvf_109",
|
|
3166
|
+
placeholder: "_placeholder_11cvf_115"
|
|
3167
|
+
}, Er = "";
|
|
3168
|
+
function Dr(e) {
|
|
3169
|
+
return e.textValue ? e.textValue : typeof e.label == "string" ? e.label : "";
|
|
3170
|
+
}
|
|
3171
|
+
function Or({ value: e, defaultValue: t, onValueChange: n, open: r, defaultOpen: a = !1, onOpenChange: c, options: f, placeholder: h = "Select…", size: g = "md", tone: v = "default", disabled: y, required: b, invalid: x, id: S, name: C, className: w, ariaLabel: T, "aria-describedby": E, renderValue: D, renderOption: O, classNames: k }) {
|
|
3172
|
+
let A = ee(), j = e !== void 0, M = e === null ? Er : e ?? void 0, [N, P] = H({
|
|
3173
|
+
value: M === void 0 ? void 0 : M,
|
|
3174
|
+
defaultValue: t ?? Er,
|
|
3175
|
+
onChange: (e) => {
|
|
3176
|
+
n?.(e === "" ? void 0 : e);
|
|
3177
|
+
},
|
|
3178
|
+
fallback: Er,
|
|
3179
|
+
isControlled: j
|
|
3180
|
+
}), F = V({
|
|
3181
|
+
id: S,
|
|
3182
|
+
disabled: y,
|
|
3183
|
+
required: b,
|
|
3184
|
+
invalid: x,
|
|
3185
|
+
"aria-describedby": E
|
|
3186
|
+
}), I = F.disabled;
|
|
3187
|
+
B({
|
|
3188
|
+
componentName: "Select",
|
|
3189
|
+
ariaLabel: T,
|
|
3190
|
+
labelledBy: A?.labelId,
|
|
3191
|
+
disabled: I
|
|
3192
|
+
});
|
|
3193
|
+
let [L, R] = H({
|
|
3194
|
+
value: r,
|
|
3195
|
+
defaultValue: a,
|
|
3196
|
+
onChange: c,
|
|
3197
|
+
fallback: !1,
|
|
3198
|
+
isControlled: r !== void 0
|
|
3199
|
+
}), [z, U] = d(-1), te = u(null), W = u(null), G = s(), K = f.find((e) => e.value === N), ne = K ? N : Er, q = K ? Dr(K) : "", J = l(() => f.reduce((e, t, n) => (t.disabled || e.push(n), e), []), [f]), Y = i(() => {
|
|
3200
|
+
if (I || f.length === 0) return;
|
|
3201
|
+
R(!0);
|
|
3202
|
+
let e = f.findIndex((e) => e.value === N);
|
|
3203
|
+
U(e >= 0 ? e : J[0] ?? -1);
|
|
2427
3204
|
}, [
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
]),
|
|
2433
|
-
|
|
2434
|
-
}, []),
|
|
2435
|
-
e.disabled || (
|
|
2436
|
-
}, [
|
|
3205
|
+
I,
|
|
3206
|
+
f,
|
|
3207
|
+
N,
|
|
3208
|
+
J
|
|
3209
|
+
]), X = i(() => {
|
|
3210
|
+
R(!1), U(-1);
|
|
3211
|
+
}, []), re = i((e) => {
|
|
3212
|
+
e.disabled || (P(e.value), X());
|
|
3213
|
+
}, [P, X]);
|
|
2437
3214
|
o(() => {
|
|
2438
|
-
if (!
|
|
3215
|
+
if (!L) return;
|
|
2439
3216
|
function e(e) {
|
|
2440
|
-
|
|
3217
|
+
te.current && !te.current.contains(e.target) && X();
|
|
2441
3218
|
}
|
|
2442
|
-
return document.addEventListener("
|
|
2443
|
-
}, [
|
|
2444
|
-
!
|
|
2445
|
-
}, [
|
|
2446
|
-
function
|
|
2447
|
-
if (!
|
|
3219
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
3220
|
+
}, [L, X]), o(() => {
|
|
3221
|
+
!L || z < 0 || (W.current?.children[z])?.scrollIntoView?.({ block: "nearest" });
|
|
3222
|
+
}, [L, z]);
|
|
3223
|
+
function ie(e) {
|
|
3224
|
+
if (!I) switch (e.key) {
|
|
2448
3225
|
case "Enter":
|
|
2449
3226
|
case " ":
|
|
2450
|
-
e.preventDefault(),
|
|
3227
|
+
e.preventDefault(), L ? z >= 0 && f[z] && !f[z].disabled && re(f[z]) : Y();
|
|
2451
3228
|
break;
|
|
2452
3229
|
case "ArrowDown":
|
|
2453
|
-
if (e.preventDefault(), !
|
|
3230
|
+
if (e.preventDefault(), !L) Y();
|
|
2454
3231
|
else {
|
|
2455
|
-
let e =
|
|
2456
|
-
e !== void 0 &&
|
|
3232
|
+
let e = J[J.indexOf(z) + 1];
|
|
3233
|
+
e !== void 0 && U(e);
|
|
2457
3234
|
}
|
|
2458
3235
|
break;
|
|
2459
3236
|
case "ArrowUp":
|
|
2460
|
-
if (e.preventDefault(), !
|
|
3237
|
+
if (e.preventDefault(), !L) Y();
|
|
2461
3238
|
else {
|
|
2462
|
-
let e =
|
|
2463
|
-
e !== void 0 &&
|
|
3239
|
+
let e = J[J.indexOf(z) - 1];
|
|
3240
|
+
e !== void 0 && U(e);
|
|
2464
3241
|
}
|
|
2465
3242
|
break;
|
|
2466
3243
|
case "Escape":
|
|
2467
|
-
|
|
3244
|
+
L && (e.preventDefault(), X());
|
|
2468
3245
|
break;
|
|
2469
3246
|
case "Tab":
|
|
2470
|
-
|
|
3247
|
+
L && X();
|
|
2471
3248
|
break;
|
|
2472
3249
|
}
|
|
2473
3250
|
}
|
|
2474
|
-
let
|
|
2475
|
-
open:
|
|
2476
|
-
placeholder:
|
|
2477
|
-
selectedOption:
|
|
3251
|
+
let ae = N !== Er && K, oe = ae ? K.label : null, se = D ? D({
|
|
3252
|
+
open: L,
|
|
3253
|
+
placeholder: h,
|
|
3254
|
+
selectedOption: K
|
|
2478
3255
|
}) : /* @__PURE__ */ p("span", {
|
|
2479
|
-
className: _(
|
|
2480
|
-
children:
|
|
3256
|
+
className: _(Tr.valueText, !ae && Tr.placeholder),
|
|
3257
|
+
children: ae ? oe : h
|
|
2481
3258
|
});
|
|
2482
3259
|
return /* @__PURE__ */ m("div", {
|
|
2483
|
-
ref:
|
|
2484
|
-
"data-state":
|
|
2485
|
-
"data-disabled":
|
|
2486
|
-
"data-invalid":
|
|
2487
|
-
"data-size":
|
|
2488
|
-
"data-tone":
|
|
3260
|
+
ref: te,
|
|
3261
|
+
"data-state": L ? "open" : "closed",
|
|
3262
|
+
"data-disabled": I || void 0,
|
|
3263
|
+
"data-invalid": F.invalid || void 0,
|
|
3264
|
+
"data-size": g,
|
|
3265
|
+
"data-tone": v,
|
|
2489
3266
|
"data-scope": "select",
|
|
2490
|
-
className: _("owo-select",
|
|
3267
|
+
className: _("owo-select", Tr.root, w),
|
|
2491
3268
|
children: [
|
|
2492
3269
|
/* @__PURE__ */ m("button", {
|
|
2493
3270
|
type: "button",
|
|
2494
3271
|
role: "combobox",
|
|
2495
|
-
id:
|
|
2496
|
-
"aria-expanded":
|
|
3272
|
+
id: F.id,
|
|
3273
|
+
"aria-expanded": L,
|
|
2497
3274
|
"aria-haspopup": "listbox",
|
|
2498
|
-
"aria-controls":
|
|
2499
|
-
"aria-label":
|
|
2500
|
-
"aria-describedby":
|
|
2501
|
-
"aria-invalid":
|
|
2502
|
-
"aria-required":
|
|
2503
|
-
"aria-activedescendant":
|
|
2504
|
-
"data-state":
|
|
2505
|
-
"data-disabled":
|
|
2506
|
-
"data-tone":
|
|
2507
|
-
"data-size":
|
|
2508
|
-
"data-has-value":
|
|
3275
|
+
"aria-controls": G,
|
|
3276
|
+
"aria-label": T,
|
|
3277
|
+
"aria-describedby": F["aria-describedby"],
|
|
3278
|
+
"aria-invalid": F.invalid || void 0,
|
|
3279
|
+
"aria-required": F.required || void 0,
|
|
3280
|
+
"aria-activedescendant": L && z >= 0 ? `${G}-opt-${z}` : void 0,
|
|
3281
|
+
"data-state": L ? "open" : "closed",
|
|
3282
|
+
"data-disabled": I || void 0,
|
|
3283
|
+
"data-tone": v,
|
|
3284
|
+
"data-size": g,
|
|
3285
|
+
"data-has-value": ae || void 0,
|
|
2509
3286
|
"data-scope": "select",
|
|
2510
3287
|
"data-part": "trigger",
|
|
2511
|
-
disabled:
|
|
2512
|
-
className: _(
|
|
2513
|
-
onClick: () =>
|
|
2514
|
-
onKeyDown:
|
|
2515
|
-
children: [
|
|
3288
|
+
disabled: I,
|
|
3289
|
+
className: _(k?.trigger),
|
|
3290
|
+
onClick: () => L ? X() : Y(),
|
|
3291
|
+
onKeyDown: ie,
|
|
3292
|
+
children: [se, /* @__PURE__ */ p("svg", {
|
|
2516
3293
|
"aria-hidden": "true",
|
|
2517
|
-
"data-state":
|
|
3294
|
+
"data-state": L ? "open" : "closed",
|
|
2518
3295
|
"data-scope": "select",
|
|
2519
3296
|
"data-part": "chevron",
|
|
2520
|
-
className: _(
|
|
3297
|
+
className: _(k?.chevron),
|
|
2521
3298
|
viewBox: "0 0 16 16",
|
|
2522
3299
|
fill: "none",
|
|
2523
3300
|
stroke: "currentColor",
|
|
@@ -2527,65 +3304,74 @@ function Jn({ value: e, defaultValue: t, onValueChange: n, options: r, placehold
|
|
|
2527
3304
|
children: /* @__PURE__ */ p("path", { d: "M4 6l4 4 4-4" })
|
|
2528
3305
|
})]
|
|
2529
3306
|
}),
|
|
2530
|
-
|
|
2531
|
-
ref:
|
|
2532
|
-
id:
|
|
3307
|
+
L && /* @__PURE__ */ p("ul", {
|
|
3308
|
+
ref: W,
|
|
3309
|
+
id: G,
|
|
2533
3310
|
role: "listbox",
|
|
2534
|
-
"aria-label":
|
|
3311
|
+
"aria-label": T ?? (q || h),
|
|
2535
3312
|
"data-state": "open",
|
|
2536
|
-
"data-size":
|
|
3313
|
+
"data-size": g,
|
|
2537
3314
|
"data-scope": "select",
|
|
2538
3315
|
"data-part": "dropdown",
|
|
2539
|
-
className: _(
|
|
2540
|
-
children:
|
|
2541
|
-
id: `${
|
|
3316
|
+
className: _(k?.dropdown),
|
|
3317
|
+
children: f.map((e, t) => /* @__PURE__ */ p("li", {
|
|
3318
|
+
id: `${G}-opt-${t}`,
|
|
2542
3319
|
role: "option",
|
|
2543
|
-
"aria-selected": e.value ===
|
|
3320
|
+
"aria-selected": e.value === N,
|
|
2544
3321
|
"aria-disabled": e.disabled || void 0,
|
|
2545
|
-
"data-state": e.value ===
|
|
2546
|
-
"data-focused": t ===
|
|
2547
|
-
"data-selected": e.value ===
|
|
3322
|
+
"data-state": e.value === N ? "selected" : t === z ? "highlighted" : "idle",
|
|
3323
|
+
"data-focused": t === z || void 0,
|
|
3324
|
+
"data-selected": e.value === N || void 0,
|
|
2548
3325
|
"data-disabled": e.disabled || void 0,
|
|
2549
|
-
"data-highlighted": t ===
|
|
3326
|
+
"data-highlighted": t === z || void 0,
|
|
2550
3327
|
"data-scope": "select",
|
|
2551
3328
|
"data-part": "option",
|
|
2552
|
-
className: _(
|
|
2553
|
-
onClick: () =>
|
|
2554
|
-
onMouseEnter: () => !e.disabled &&
|
|
2555
|
-
children:
|
|
3329
|
+
className: _(k?.option),
|
|
3330
|
+
onClick: () => re(e),
|
|
3331
|
+
onMouseEnter: () => !e.disabled && U(t),
|
|
3332
|
+
children: O ? O({
|
|
2556
3333
|
option: e,
|
|
2557
3334
|
index: t,
|
|
2558
|
-
selected: e.value ===
|
|
2559
|
-
highlighted: t ===
|
|
3335
|
+
selected: e.value === N,
|
|
3336
|
+
highlighted: t === z
|
|
2560
3337
|
}) : e.label
|
|
2561
3338
|
}, e.value))
|
|
2562
3339
|
}),
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
3340
|
+
(C != null || F.required) && /* @__PURE__ */ m("select", {
|
|
3341
|
+
tabIndex: -1,
|
|
3342
|
+
"aria-hidden": "true",
|
|
3343
|
+
"data-native-control": "true",
|
|
3344
|
+
className: Tr.nativeControl,
|
|
3345
|
+
name: K ? C : void 0,
|
|
3346
|
+
value: ne,
|
|
3347
|
+
disabled: I,
|
|
3348
|
+
required: F.required,
|
|
3349
|
+
onChange: () => {},
|
|
3350
|
+
children: [/* @__PURE__ */ p("option", { value: Er }), f.map((e) => /* @__PURE__ */ p("option", {
|
|
3351
|
+
value: e.value,
|
|
3352
|
+
disabled: e.disabled,
|
|
3353
|
+
children: Dr(e)
|
|
3354
|
+
}, e.value))]
|
|
2569
3355
|
})
|
|
2570
3356
|
]
|
|
2571
3357
|
});
|
|
2572
3358
|
}
|
|
2573
|
-
var
|
|
3359
|
+
var kr = {
|
|
2574
3360
|
root: "_root_1sshx_1",
|
|
2575
3361
|
"owo-skeleton-breathe": "_owo-skeleton-breathe_1sshx_1",
|
|
2576
3362
|
"owo-skeleton-scan": "_owo-skeleton-scan_1sshx_1"
|
|
2577
|
-
},
|
|
3363
|
+
}, Ar = {
|
|
2578
3364
|
slow: "4s",
|
|
2579
3365
|
medium: "3s",
|
|
2580
3366
|
fast: "2s"
|
|
2581
3367
|
};
|
|
2582
|
-
function
|
|
3368
|
+
function jr({ className: e, animation: t = "scan", tone: n = "default", speed: r = "medium", style: i, ...a }) {
|
|
2583
3369
|
let o = n === "warm" ? "emphasis" : n, s = {
|
|
2584
3370
|
...i,
|
|
2585
|
-
"--_owo-skeleton-scan-duration":
|
|
3371
|
+
"--_owo-skeleton-scan-duration": Ar[r]
|
|
2586
3372
|
};
|
|
2587
3373
|
return /* @__PURE__ */ p("div", {
|
|
2588
|
-
className: _("owo-skeleton",
|
|
3374
|
+
className: _("owo-skeleton", kr.root, e),
|
|
2589
3375
|
"data-animation": t,
|
|
2590
3376
|
"data-tone": o,
|
|
2591
3377
|
"aria-hidden": "true",
|
|
@@ -2593,7 +3379,7 @@ function Zn({ className: e, animation: t = "scan", tone: n = "default", speed: r
|
|
|
2593
3379
|
...a
|
|
2594
3380
|
});
|
|
2595
3381
|
}
|
|
2596
|
-
var
|
|
3382
|
+
var Mr = {
|
|
2597
3383
|
root: "_root_h4455_1",
|
|
2598
3384
|
withIcon: "_withIcon_h4455_19",
|
|
2599
3385
|
icon: "_icon_h4455_25",
|
|
@@ -2604,32 +3390,33 @@ var $ = {
|
|
|
2604
3390
|
};
|
|
2605
3391
|
//#endregion
|
|
2606
3392
|
//#region src/components/StatusNotice.tsx
|
|
2607
|
-
function
|
|
3393
|
+
function Nr({ tone: e = "neutral", layout: t = "horizontal", icon: n, title: r, description: i, action: a, className: o, children: s, classNames: c, ...l }) {
|
|
3394
|
+
let u = i ?? s;
|
|
2608
3395
|
if (t === "vertical") {
|
|
2609
3396
|
let t = n || r || i || a;
|
|
2610
3397
|
return /* @__PURE__ */ p("div", {
|
|
2611
3398
|
"data-tone": e,
|
|
2612
3399
|
"data-layout": "vertical",
|
|
2613
|
-
className: _("owo-status-notice",
|
|
3400
|
+
className: _("owo-status-notice", Mr.root, o),
|
|
2614
3401
|
...l,
|
|
2615
3402
|
children: /* @__PURE__ */ p("div", {
|
|
2616
3403
|
"data-part": "body",
|
|
2617
|
-
className: _(
|
|
3404
|
+
className: _(Mr.body, c?.body),
|
|
2618
3405
|
children: t ? /* @__PURE__ */ m(f, { children: [
|
|
2619
3406
|
n ? /* @__PURE__ */ p("div", {
|
|
2620
3407
|
"data-part": "icon",
|
|
2621
|
-
className: _(
|
|
3408
|
+
className: _(Mr.icon, c?.icon),
|
|
2622
3409
|
children: n
|
|
2623
3410
|
}) : null,
|
|
2624
3411
|
r ? /* @__PURE__ */ p("div", {
|
|
2625
3412
|
"data-part": "title",
|
|
2626
|
-
className: _(
|
|
3413
|
+
className: _(Mr.title, c?.title),
|
|
2627
3414
|
children: r
|
|
2628
3415
|
}) : null,
|
|
2629
|
-
i ? /* @__PURE__ */ p("div", { children: i })
|
|
3416
|
+
i == null ? s : /* @__PURE__ */ p("div", { children: i }),
|
|
2630
3417
|
a ? /* @__PURE__ */ p("div", {
|
|
2631
3418
|
"data-part": "action",
|
|
2632
|
-
className: _(
|
|
3419
|
+
className: _(Mr.action, c?.action),
|
|
2633
3420
|
children: a
|
|
2634
3421
|
}) : null
|
|
2635
3422
|
] }) : s
|
|
@@ -2638,77 +3425,82 @@ function Qn({ tone: e = "neutral", layout: t = "horizontal", icon: n, title: r,
|
|
|
2638
3425
|
}
|
|
2639
3426
|
return /* @__PURE__ */ m("div", {
|
|
2640
3427
|
"data-tone": e,
|
|
2641
|
-
className: _("owo-status-notice",
|
|
3428
|
+
className: _("owo-status-notice", Mr.root, n && Mr.withIcon, o),
|
|
2642
3429
|
...l,
|
|
2643
3430
|
children: [n ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
|
|
2644
3431
|
"data-part": "icon",
|
|
2645
|
-
className: _(
|
|
3432
|
+
className: _(Mr.icon, c?.icon),
|
|
2646
3433
|
"aria-hidden": "true",
|
|
2647
3434
|
children: n
|
|
2648
3435
|
}), /* @__PURE__ */ m("div", {
|
|
2649
3436
|
"data-part": "body",
|
|
2650
|
-
className: _(
|
|
3437
|
+
className: _(Mr.text, c?.body),
|
|
2651
3438
|
children: [r ? /* @__PURE__ */ p("div", {
|
|
2652
3439
|
"data-part": "title",
|
|
2653
|
-
className: _(
|
|
3440
|
+
className: _(Mr.title, c?.title),
|
|
2654
3441
|
children: r
|
|
2655
|
-
}) : null,
|
|
3442
|
+
}) : null, u]
|
|
2656
3443
|
})] }) : /* @__PURE__ */ m("div", {
|
|
2657
3444
|
"data-part": "body",
|
|
2658
3445
|
className: _(c?.body),
|
|
2659
3446
|
children: [r ? /* @__PURE__ */ p("div", {
|
|
2660
3447
|
"data-part": "title",
|
|
2661
|
-
className: _(
|
|
3448
|
+
className: _(Mr.title, c?.title),
|
|
2662
3449
|
children: r
|
|
2663
|
-
}) : null,
|
|
3450
|
+
}) : null, u]
|
|
2664
3451
|
}), a ? /* @__PURE__ */ p("div", {
|
|
2665
3452
|
"data-part": "action",
|
|
2666
|
-
className: _(
|
|
3453
|
+
className: _(Mr.action, c?.action),
|
|
2667
3454
|
children: a
|
|
2668
3455
|
}) : null]
|
|
2669
3456
|
});
|
|
2670
3457
|
}
|
|
2671
|
-
var
|
|
3458
|
+
var Pr = {
|
|
2672
3459
|
root: "_root_91dlh_1",
|
|
2673
3460
|
thumb: "_thumb_91dlh_81"
|
|
2674
3461
|
};
|
|
2675
3462
|
//#endregion
|
|
2676
3463
|
//#region src/components/Switch.tsx
|
|
2677
|
-
function
|
|
2678
|
-
let
|
|
3464
|
+
function Fr({ checked: e, defaultChecked: t, onCheckedChange: n, size: r = "md", disabled: i, required: a, invalid: o, id: s, name: c, className: l, ariaLabel: u, "aria-describedby": d }) {
|
|
3465
|
+
let f = ee(), [h, g] = H({
|
|
2679
3466
|
value: e,
|
|
2680
3467
|
defaultValue: t,
|
|
2681
3468
|
onChange: n,
|
|
2682
3469
|
fallback: !1
|
|
2683
|
-
}),
|
|
3470
|
+
}), v = V({
|
|
2684
3471
|
id: s,
|
|
2685
3472
|
disabled: i,
|
|
2686
3473
|
required: a,
|
|
2687
3474
|
invalid: o,
|
|
2688
3475
|
"aria-describedby": d
|
|
2689
3476
|
});
|
|
2690
|
-
return
|
|
3477
|
+
return B({
|
|
3478
|
+
componentName: "Switch",
|
|
3479
|
+
ariaLabel: u,
|
|
3480
|
+
labelledBy: f?.labelId,
|
|
3481
|
+
disabled: v.disabled
|
|
3482
|
+
}), /* @__PURE__ */ m("button", {
|
|
2691
3483
|
type: "button",
|
|
2692
3484
|
role: "switch",
|
|
2693
|
-
id:
|
|
2694
|
-
"aria-checked":
|
|
3485
|
+
id: v.id,
|
|
3486
|
+
"aria-checked": h,
|
|
2695
3487
|
"aria-label": u,
|
|
2696
|
-
"aria-describedby":
|
|
2697
|
-
"aria-invalid":
|
|
2698
|
-
"aria-required":
|
|
2699
|
-
disabled:
|
|
3488
|
+
"aria-describedby": v["aria-describedby"],
|
|
3489
|
+
"aria-invalid": v.invalid || void 0,
|
|
3490
|
+
"aria-required": v.required || void 0,
|
|
3491
|
+
disabled: v.disabled,
|
|
2700
3492
|
"data-size": r,
|
|
2701
|
-
"data-invalid":
|
|
2702
|
-
className: _("owo-switch",
|
|
2703
|
-
onClick: () =>
|
|
3493
|
+
"data-invalid": v.invalid || void 0,
|
|
3494
|
+
className: _("owo-switch", Pr.root, l),
|
|
3495
|
+
onClick: () => g(!h),
|
|
2704
3496
|
children: [/* @__PURE__ */ p("span", {
|
|
2705
3497
|
"aria-hidden": "true",
|
|
2706
|
-
className:
|
|
3498
|
+
className: Pr.thumb
|
|
2707
3499
|
}), c != null && /* @__PURE__ */ p("input", {
|
|
2708
3500
|
type: "checkbox",
|
|
2709
3501
|
name: c,
|
|
2710
|
-
checked:
|
|
2711
|
-
disabled:
|
|
3502
|
+
checked: h,
|
|
3503
|
+
disabled: v.disabled,
|
|
2712
3504
|
hidden: !0,
|
|
2713
3505
|
readOnly: !0,
|
|
2714
3506
|
tabIndex: -1,
|
|
@@ -2716,54 +3508,757 @@ function er({ checked: e, defaultChecked: t, onCheckedChange: n, size: r = "md",
|
|
|
2716
3508
|
})]
|
|
2717
3509
|
});
|
|
2718
3510
|
}
|
|
2719
|
-
var
|
|
2720
|
-
|
|
2721
|
-
|
|
3511
|
+
var $ = {
|
|
3512
|
+
root: "_root_8sfay_1",
|
|
3513
|
+
table: "_table_8sfay_10",
|
|
3514
|
+
header: "_header_8sfay_14",
|
|
3515
|
+
headerSticky: "_headerSticky_8sfay_19",
|
|
3516
|
+
body: "_body_8sfay_25",
|
|
3517
|
+
row: "_row_8sfay_31",
|
|
3518
|
+
stateRow: "_stateRow_8sfay_46",
|
|
3519
|
+
cell: "_cell_8sfay_50",
|
|
3520
|
+
headerCell: "_headerCell_8sfay_70",
|
|
3521
|
+
headerLabel: "_headerLabel_8sfay_76",
|
|
3522
|
+
headerSortButton: "_headerSortButton_8sfay_81",
|
|
3523
|
+
selectionCell: "_selectionCell_8sfay_105",
|
|
3524
|
+
sortIndicator: "_sortIndicator_8sfay_113",
|
|
3525
|
+
resizeHandle: "_resizeHandle_8sfay_117",
|
|
3526
|
+
loadingState: "_loadingState_8sfay_153",
|
|
3527
|
+
stateCell: "_stateCell_8sfay_157",
|
|
3528
|
+
skeletonStack: "_skeletonStack_8sfay_161",
|
|
3529
|
+
skeletonCell: "_skeletonCell_8sfay_166",
|
|
3530
|
+
empty: "_empty_8sfay_175"
|
|
3531
|
+
}, Ir = ["asc", "desc"], Lr = 72, Rr = 16;
|
|
3532
|
+
function zr(e, t) {
|
|
3533
|
+
if (e.size !== t.size) return !1;
|
|
3534
|
+
for (let n of e) if (!t.has(n)) return !1;
|
|
3535
|
+
return !0;
|
|
3536
|
+
}
|
|
3537
|
+
function Br(e, t, n) {
|
|
3538
|
+
return typeof e.accessor == "function" ? e.accessor(t, n) : e.accessor ? t[e.accessor] : t[e.key];
|
|
3539
|
+
}
|
|
3540
|
+
function Vr(e, t) {
|
|
3541
|
+
return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : typeof e == "boolean" && typeof t == "boolean" ? Number(e) - Number(t) : String(e).localeCompare(String(t), void 0, {
|
|
3542
|
+
numeric: !0,
|
|
3543
|
+
sensitivity: "base"
|
|
3544
|
+
});
|
|
3545
|
+
}
|
|
3546
|
+
function Hr(e, t, n) {
|
|
3547
|
+
if (e === "single") return new Set(t.has(n) ? [] : [n]);
|
|
3548
|
+
let r = new Set(t);
|
|
3549
|
+
return r.has(n) ? r.delete(n) : r.add(n), r;
|
|
3550
|
+
}
|
|
3551
|
+
function Ur(e, t) {
|
|
3552
|
+
return e ? t === "ternary" && e === "desc" ? null : Ir[(Ir.indexOf(e) + 1) % Ir.length] : Ir[0];
|
|
3553
|
+
}
|
|
3554
|
+
function Wr(e, t) {
|
|
3555
|
+
if (t.length === 0) return /* @__PURE__ */ new Set();
|
|
3556
|
+
let n = new Set(t), r = new Set(Array.from(e ?? t).filter((e) => n.has(e)));
|
|
3557
|
+
return r.size === 0 && r.add(t[0]), r;
|
|
3558
|
+
}
|
|
3559
|
+
function Gr({ type: e, checked: t, label: n, indeterminate: r = !1, disabled: i = !1, className: a, part: o, name: s, onChange: c, onClick: l }) {
|
|
3560
|
+
return /* @__PURE__ */ p("input", {
|
|
3561
|
+
type: e,
|
|
3562
|
+
name: s,
|
|
3563
|
+
checked: t,
|
|
3564
|
+
disabled: i,
|
|
3565
|
+
"aria-label": n,
|
|
3566
|
+
"aria-checked": e === "checkbox" && r ? "mixed" : void 0,
|
|
3567
|
+
"data-scope": "table",
|
|
3568
|
+
"data-part": o,
|
|
3569
|
+
className: a,
|
|
3570
|
+
ref: (t) => {
|
|
3571
|
+
t && e === "checkbox" && (t.indeterminate = r);
|
|
3572
|
+
},
|
|
3573
|
+
onChange: c,
|
|
3574
|
+
onClick: l
|
|
3575
|
+
});
|
|
3576
|
+
}
|
|
3577
|
+
function Kr({ columns: e, data: t, visibleColumnKeys: n, defaultVisibleColumnKeys: r, columnWidths: i, defaultColumnWidths: a, onColumnWidthsChange: s, getRowId: f, selectionMode: h, selectedRows: g, defaultSelectedRows: v, onSelectionChange: y, sort: b, defaultSort: x = null, onSort: S, onSortChange: C, sortCycle: w = "binary", getSortButtonAriaLabel: T, selectionColumnAriaLabel: E = "Row selection", getRowSelectionAriaLabel: D, getSelectAllAriaLabel: O, isRowSelectable: k, rowHeight: A = "default", stickyHeader: j = !1, virtualized: M = !1, loading: N = !1, loadingState: P, skeletonRows: F = 5, emptyState: I, className: L, classNames: R }) {
|
|
3578
|
+
let [z, ee] = d(r ? new Set(r) : null), [B, V] = d(a ?? {}), [H, U] = d(v ?? /* @__PURE__ */ new Set()), [te, W] = d(x), [G, K] = d(0), [ne, q] = d(0), J = n !== void 0, Y = i !== void 0, X = g !== void 0, re = b !== void 0, ie = !!h, ae = u(null), oe = u(/* @__PURE__ */ new Map()), se = u(!1), ce = u(e.map((e) => e.key)), le = u(null), ue = l(() => e.map((e) => e.key), [e]), de = l(() => Wr(J ? n : z, ue), [
|
|
3579
|
+
ue,
|
|
3580
|
+
z,
|
|
3581
|
+
n,
|
|
3582
|
+
J
|
|
3583
|
+
]), fe = l(() => e.filter((e) => de.has(e.key)), [de, e]), pe = Y ? i : B, me = u(pe);
|
|
3584
|
+
me.current = pe;
|
|
3585
|
+
let he = u(Y);
|
|
3586
|
+
he.current = Y;
|
|
3587
|
+
let ge = u(s);
|
|
3588
|
+
ge.current = s;
|
|
3589
|
+
let _e = X ? g : H, ve = re ? b ?? null : te, Z = ve && de.has(ve.key) ? ve : null, ye = l(() => {
|
|
3590
|
+
if (!Z) return t;
|
|
3591
|
+
let n = e.find((e) => e.key === Z.key);
|
|
3592
|
+
return n ? t.map((e, t) => ({
|
|
3593
|
+
row: e,
|
|
3594
|
+
index: t,
|
|
3595
|
+
sortValue: Br(n, e, t)
|
|
3596
|
+
})).sort((e, t) => {
|
|
3597
|
+
let r = n.compare ? n.compare(e.row, t.row, e.index, t.index) : Vr(e.sortValue, t.sortValue);
|
|
3598
|
+
return r === 0 ? e.index - t.index : Z.direction === "asc" ? r : -r;
|
|
3599
|
+
}).map((e) => e.row) : t;
|
|
3600
|
+
}, [
|
|
3601
|
+
e,
|
|
3602
|
+
t,
|
|
3603
|
+
Z
|
|
3604
|
+
]), be = A === "compact" ? 36 : 44, xe = typeof M == "object" ? M : void 0, Q = !!M, Se = xe?.height ?? 320, Ce = xe?.overscan ?? 4, we = l(() => {
|
|
3605
|
+
let e = fe.map((e) => {
|
|
3606
|
+
let t = pe[e.key];
|
|
3607
|
+
return t == null ? e.width == null ? "minmax(0, 1fr)" : typeof e.width == "number" ? `${e.width}px` : e.width : `${t}px`;
|
|
3608
|
+
});
|
|
3609
|
+
return h && e.unshift("2.75rem"), e.join(" ");
|
|
3610
|
+
}, [
|
|
3611
|
+
pe,
|
|
3612
|
+
h,
|
|
3613
|
+
fe
|
|
3614
|
+
]), Te = ye.length * be, Ee = Q ? Math.ceil(Se / be) + Ce * 2 : ye.length, De = Q ? Math.max(0, Math.floor(G / be) - Ce) : 0, Oe = Q ? Math.min(ye.length, De + Ee) : ye.length, ke = ye.slice(De, Oe), Ae = Q ? De * be : 0, je = Q ? Math.max(0, Te - Ae - ke.length * be) : 0, Me = ye.flatMap((e, t) => h && k && !k(e, t) ? [] : [f?.(e, t) ?? String(e.id ?? t)]), Ne = h === "multiple" && Me.length > 0 && Me.every((e) => _e.has(e)), Pe = h === "multiple" ? Me.filter((e) => _e.has(e)).length : 0, Fe = h === "multiple" && Pe > 0 && !Ne, Ie = fe.length + (h ? 1 : 0), Le = N ? P ? 2 : F + 1 : ye.length === 0 ? 2 : ye.length + 1, Re = ie ? "gridcell" : "cell", ze = l(() => h ? ye.flatMap((e, t) => !k || k(e, t) ? [t] : []) : [], [
|
|
3615
|
+
k,
|
|
3616
|
+
h,
|
|
3617
|
+
ye
|
|
3618
|
+
]), Be = l(() => ye.map((e, t) => f?.(e, t) ?? String(e.id ?? t)), [f, ye]), Ve = ze[0] ?? null, He = Ve == null ? null : Be[Ve] ?? null, [Ue, We] = d(He), Ge = Ue == null ? null : Be.indexOf(Ue);
|
|
3619
|
+
o(() => {
|
|
3620
|
+
if (J) return;
|
|
3621
|
+
let e = new Set(ce.current), t = Wr(z, ue), n = new Set(t);
|
|
3622
|
+
ue.forEach((t) => {
|
|
3623
|
+
e.has(t) || n.add(t);
|
|
3624
|
+
}), n.size === 0 && ue[0] && n.add(ue[0]), ce.current = ue, zr(n, t) || ee(n);
|
|
3625
|
+
}, [
|
|
3626
|
+
ue,
|
|
3627
|
+
z,
|
|
3628
|
+
J
|
|
3629
|
+
]), o(() => {
|
|
3630
|
+
if (Y) return;
|
|
3631
|
+
let e = new Set(ue), t = Object.fromEntries(Object.entries(B).filter(([t]) => e.has(t)));
|
|
3632
|
+
Object.keys(t).length !== Object.keys(B).length && (V(t), s?.(t));
|
|
3633
|
+
}, [
|
|
3634
|
+
ue,
|
|
3635
|
+
Y,
|
|
3636
|
+
s,
|
|
3637
|
+
B
|
|
3638
|
+
]), o(() => {
|
|
3639
|
+
We((e) => {
|
|
3640
|
+
if (He == null) return null;
|
|
3641
|
+
if (e == null) return He;
|
|
3642
|
+
let t = Be.indexOf(e);
|
|
3643
|
+
return t === -1 || !ze.includes(t) ? He : e;
|
|
3644
|
+
});
|
|
3645
|
+
}, [
|
|
3646
|
+
He,
|
|
3647
|
+
ze,
|
|
3648
|
+
Be
|
|
3649
|
+
]), o(() => {
|
|
3650
|
+
ve && !de.has(ve.key) && !re && (W(null), C?.(null), S?.(ve.key, null));
|
|
3651
|
+
}, [
|
|
3652
|
+
ve,
|
|
3653
|
+
de,
|
|
3654
|
+
S,
|
|
3655
|
+
C,
|
|
3656
|
+
re
|
|
3657
|
+
]), o(() => {
|
|
3658
|
+
if (X || !h) return;
|
|
3659
|
+
let e = new Set(Be), t = new Set(Array.from(H).filter((t) => e.has(t)));
|
|
3660
|
+
zr(t, H) || (U(t), y?.(t));
|
|
3661
|
+
}, [
|
|
3662
|
+
y,
|
|
3663
|
+
Be,
|
|
3664
|
+
X,
|
|
3665
|
+
h,
|
|
3666
|
+
H
|
|
3667
|
+
]), o(() => {
|
|
3668
|
+
if (!h || Ge == null || !se.current) return;
|
|
3669
|
+
if (Q && (Ge < De || Ge >= Oe)) {
|
|
3670
|
+
Ze(Ge);
|
|
3671
|
+
return;
|
|
3672
|
+
}
|
|
3673
|
+
let e = oe.current.get(Ge);
|
|
3674
|
+
e && document.activeElement !== e && !e.contains(document.activeElement) && e.focus();
|
|
3675
|
+
}, [
|
|
3676
|
+
Ge,
|
|
3677
|
+
h,
|
|
3678
|
+
De,
|
|
3679
|
+
Oe,
|
|
3680
|
+
Q
|
|
3681
|
+
]), c(() => {
|
|
3682
|
+
if (!Q || !ae.current) {
|
|
3683
|
+
q(0);
|
|
3684
|
+
return;
|
|
3685
|
+
}
|
|
3686
|
+
let e = ae.current, t = () => {
|
|
3687
|
+
q(e.offsetWidth - e.clientWidth);
|
|
3688
|
+
};
|
|
3689
|
+
t();
|
|
3690
|
+
let n = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
3691
|
+
return n?.observe(e), window.addEventListener("resize", t), () => {
|
|
3692
|
+
n?.disconnect(), window.removeEventListener("resize", t);
|
|
3693
|
+
};
|
|
3694
|
+
}, [
|
|
3695
|
+
Q,
|
|
3696
|
+
Se,
|
|
3697
|
+
ye.length
|
|
3698
|
+
]), o(() => {
|
|
3699
|
+
let e = (e) => {
|
|
3700
|
+
let t = le.current;
|
|
3701
|
+
if (!t) return;
|
|
3702
|
+
let n = Math.max(t.minWidth, Math.round(t.startWidth + e.clientX - t.startX)), r = {
|
|
3703
|
+
...me.current,
|
|
3704
|
+
[t.columnKey]: n
|
|
3705
|
+
};
|
|
3706
|
+
he.current || V(r), ge.current?.(r);
|
|
3707
|
+
}, t = () => {
|
|
3708
|
+
le.current = null, document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
3709
|
+
};
|
|
3710
|
+
return window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), () => {
|
|
3711
|
+
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t);
|
|
3712
|
+
};
|
|
3713
|
+
}, []), o(() => () => {
|
|
3714
|
+
le.current = null, document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
3715
|
+
}, []);
|
|
3716
|
+
let Ke = (e) => {
|
|
3717
|
+
X || U(e), y?.(e);
|
|
3718
|
+
}, qe = (e) => {
|
|
3719
|
+
re || W(e), C?.(e), S?.(e?.key ?? Z?.key ?? ve?.key ?? "", e?.direction ?? null);
|
|
3720
|
+
}, Je = (e) => {
|
|
3721
|
+
let t = Ur(Z?.key === e ? Z.direction : void 0, w);
|
|
3722
|
+
qe(t ? {
|
|
3723
|
+
key: e,
|
|
3724
|
+
direction: t
|
|
3725
|
+
} : null);
|
|
3726
|
+
}, Ye = () => {
|
|
3727
|
+
if (h !== "multiple" || Me.length === 0) return;
|
|
3728
|
+
let e = new Set(_e);
|
|
3729
|
+
Ne ? Me.forEach((t) => {
|
|
3730
|
+
e.delete(t);
|
|
3731
|
+
}) : Me.forEach((t) => {
|
|
3732
|
+
e.add(t);
|
|
3733
|
+
}), zr(e, _e) || Ke(e);
|
|
3734
|
+
}, Xe = (e, t) => {
|
|
3735
|
+
let n = {
|
|
3736
|
+
...pe,
|
|
3737
|
+
[e]: t
|
|
3738
|
+
};
|
|
3739
|
+
Y || V(n), s?.(n);
|
|
3740
|
+
}, Ze = (e) => {
|
|
3741
|
+
if (We(Be[e] ?? null), !Q) return;
|
|
3742
|
+
let t = e * be, n = t + be, r = ae.current?.scrollTop ?? G, i = r + Se;
|
|
3743
|
+
if (t < r) {
|
|
3744
|
+
ae.current?.scrollTo?.({ top: t }), K(t);
|
|
3745
|
+
return;
|
|
3746
|
+
}
|
|
3747
|
+
if (n > i) {
|
|
3748
|
+
let e = Math.max(0, n - Se);
|
|
3749
|
+
ae.current?.scrollTo?.({ top: e }), K(e);
|
|
3750
|
+
}
|
|
3751
|
+
}, Qe = (e, t) => {
|
|
3752
|
+
e.preventDefault(), e.stopPropagation();
|
|
3753
|
+
let n = e.currentTarget.closest("[role=\"columnheader\"]");
|
|
3754
|
+
n instanceof HTMLElement && (le.current = {
|
|
3755
|
+
columnKey: t.key,
|
|
3756
|
+
minWidth: t.minWidth ?? Lr,
|
|
3757
|
+
startX: e.clientX,
|
|
3758
|
+
startWidth: pe[t.key] ?? (typeof t.width == "number" ? t.width : void 0) ?? Math.round(n.getBoundingClientRect().width) ?? Lr
|
|
3759
|
+
}, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none");
|
|
3760
|
+
}, $e = (e, t) => {
|
|
3761
|
+
let n = t.minWidth ?? Lr, r = pe[t.key] ?? (typeof t.width == "number" ? t.width : void 0) ?? n;
|
|
3762
|
+
if (e.key === "ArrowLeft") {
|
|
3763
|
+
e.preventDefault(), Xe(t.key, Math.max(n, r - Rr));
|
|
3764
|
+
return;
|
|
3765
|
+
}
|
|
3766
|
+
if (e.key === "ArrowRight") {
|
|
3767
|
+
e.preventDefault(), Xe(t.key, Math.max(n, r + Rr));
|
|
3768
|
+
return;
|
|
3769
|
+
}
|
|
3770
|
+
e.key === "Home" && (e.preventDefault(), Xe(t.key, n));
|
|
3771
|
+
}, et = {
|
|
3772
|
+
"--table-template-columns": we,
|
|
3773
|
+
"--table-row-height": `${be}px`,
|
|
3774
|
+
"--table-scrollbar-width": `${ne}px`
|
|
3775
|
+
};
|
|
3776
|
+
return /* @__PURE__ */ p("div", {
|
|
3777
|
+
"data-scope": "table",
|
|
3778
|
+
"data-row-height": A,
|
|
3779
|
+
className: _("owo-table", $.root, L),
|
|
3780
|
+
style: et,
|
|
3781
|
+
children: /* @__PURE__ */ m("div", {
|
|
3782
|
+
role: ie ? "grid" : "table",
|
|
3783
|
+
"aria-rowcount": Le,
|
|
3784
|
+
"aria-colcount": Ie,
|
|
3785
|
+
"aria-multiselectable": ie && h === "multiple" ? !0 : void 0,
|
|
3786
|
+
"aria-busy": N || void 0,
|
|
3787
|
+
className: $.table,
|
|
3788
|
+
children: [/* @__PURE__ */ p("div", {
|
|
3789
|
+
role: "rowgroup",
|
|
3790
|
+
className: _($.header, j && $.headerSticky),
|
|
3791
|
+
children: /* @__PURE__ */ m("div", {
|
|
3792
|
+
role: "row",
|
|
3793
|
+
"aria-rowindex": 1,
|
|
3794
|
+
className: $.row,
|
|
3795
|
+
children: [
|
|
3796
|
+
h === "multiple" && /* @__PURE__ */ p("div", {
|
|
3797
|
+
role: "columnheader",
|
|
3798
|
+
"aria-label": E,
|
|
3799
|
+
"data-scope": "table",
|
|
3800
|
+
"data-part": "selectionCell",
|
|
3801
|
+
className: _($.cell, $.headerCell, $.selectionCell, R?.selectionCell),
|
|
3802
|
+
children: /* @__PURE__ */ p(Gr, {
|
|
3803
|
+
type: "checkbox",
|
|
3804
|
+
checked: Ne,
|
|
3805
|
+
indeterminate: Fe,
|
|
3806
|
+
disabled: Me.length === 0,
|
|
3807
|
+
label: O?.({
|
|
3808
|
+
allSelected: Ne,
|
|
3809
|
+
partiallySelected: Fe,
|
|
3810
|
+
selectableCount: Me.length
|
|
3811
|
+
}) ?? (Ne ? "Clear row selection" : "Select all rows"),
|
|
3812
|
+
part: "selectionControl",
|
|
3813
|
+
className: R?.selectionControl,
|
|
3814
|
+
onClick: (e) => e.stopPropagation(),
|
|
3815
|
+
onChange: Ye
|
|
3816
|
+
})
|
|
3817
|
+
}),
|
|
3818
|
+
h === "single" && /* @__PURE__ */ p("div", {
|
|
3819
|
+
role: "columnheader",
|
|
3820
|
+
"aria-label": E,
|
|
3821
|
+
"data-scope": "table",
|
|
3822
|
+
"data-part": "selectionCell",
|
|
3823
|
+
className: _($.cell, $.headerCell, $.selectionCell, R?.selectionCell)
|
|
3824
|
+
}),
|
|
3825
|
+
fe.map((e) => {
|
|
3826
|
+
let t = Z?.key === e.key ? Z.direction : void 0, n = !!e.sortable, r = n ? Ur(t, w) : null, i = e.renderHeader?.({
|
|
3827
|
+
column: e,
|
|
3828
|
+
sorted: t,
|
|
3829
|
+
sortable: n
|
|
3830
|
+
}) ?? e.header;
|
|
3831
|
+
return /* @__PURE__ */ m("div", {
|
|
3832
|
+
role: "columnheader",
|
|
3833
|
+
"aria-sort": n ? t === "asc" ? "ascending" : t === "desc" ? "descending" : "none" : void 0,
|
|
3834
|
+
"data-scope": "table",
|
|
3835
|
+
"data-part": "headerCell",
|
|
3836
|
+
"data-align": e.align ?? "start",
|
|
3837
|
+
className: _($.cell, $.headerCell, R?.headerCell, e.headerClassName),
|
|
3838
|
+
children: [n ? /* @__PURE__ */ m("button", {
|
|
3839
|
+
type: "button",
|
|
3840
|
+
"aria-label": T?.({
|
|
3841
|
+
column: e,
|
|
3842
|
+
sorted: t,
|
|
3843
|
+
nextDirection: r
|
|
3844
|
+
}),
|
|
3845
|
+
"data-scope": "table",
|
|
3846
|
+
"data-part": "headerSortButton",
|
|
3847
|
+
className: _($.headerSortButton, R?.headerSortButton),
|
|
3848
|
+
onFocus: () => {
|
|
3849
|
+
se.current = !1;
|
|
3850
|
+
},
|
|
3851
|
+
onClick: () => Je(e.key),
|
|
3852
|
+
children: [/* @__PURE__ */ p("span", {
|
|
3853
|
+
"data-scope": "table",
|
|
3854
|
+
"data-part": "headerLabel",
|
|
3855
|
+
className: _($.headerLabel, R?.headerLabel),
|
|
3856
|
+
children: i
|
|
3857
|
+
}), /* @__PURE__ */ p("span", {
|
|
3858
|
+
"aria-hidden": "true",
|
|
3859
|
+
className: $.sortIndicator,
|
|
3860
|
+
children: t === "asc" ? "↑" : t === "desc" ? "↓" : "↕"
|
|
3861
|
+
})]
|
|
3862
|
+
}) : /* @__PURE__ */ p("span", {
|
|
3863
|
+
"data-scope": "table",
|
|
3864
|
+
"data-part": "headerLabel",
|
|
3865
|
+
className: _($.headerLabel, R?.headerLabel),
|
|
3866
|
+
children: i
|
|
3867
|
+
}), e.resizable && /* @__PURE__ */ p("button", {
|
|
3868
|
+
type: "button",
|
|
3869
|
+
"aria-label": `Resize ${String(e.header)} column`,
|
|
3870
|
+
"data-scope": "table",
|
|
3871
|
+
"data-part": "resizeHandle",
|
|
3872
|
+
className: _($.resizeHandle, R?.resizeHandle),
|
|
3873
|
+
onMouseDown: (t) => Qe(t, e),
|
|
3874
|
+
onKeyDown: (t) => $e(t, e),
|
|
3875
|
+
onClick: (e) => {
|
|
3876
|
+
e.preventDefault(), e.stopPropagation();
|
|
3877
|
+
}
|
|
3878
|
+
})]
|
|
3879
|
+
}, e.key);
|
|
3880
|
+
})
|
|
3881
|
+
]
|
|
3882
|
+
})
|
|
3883
|
+
}), /* @__PURE__ */ p("div", {
|
|
3884
|
+
role: "rowgroup",
|
|
3885
|
+
ref: ae,
|
|
3886
|
+
className: $.body,
|
|
3887
|
+
style: Q ? { maxHeight: Se } : void 0,
|
|
3888
|
+
onScroll: Q ? (e) => K(e.currentTarget.scrollTop) : void 0,
|
|
3889
|
+
children: N ? P ? /* @__PURE__ */ p("div", {
|
|
3890
|
+
role: "row",
|
|
3891
|
+
"aria-rowindex": 2,
|
|
3892
|
+
className: _($.row, $.stateRow),
|
|
3893
|
+
children: /* @__PURE__ */ p("div", {
|
|
3894
|
+
role: Re,
|
|
3895
|
+
"data-scope": "table",
|
|
3896
|
+
"data-part": "loadingState",
|
|
3897
|
+
className: _($.loadingState, $.stateCell, R?.loadingState),
|
|
3898
|
+
children: P
|
|
3899
|
+
})
|
|
3900
|
+
}) : /* @__PURE__ */ p("div", {
|
|
3901
|
+
"data-scope": "table",
|
|
3902
|
+
"data-part": "loadingState",
|
|
3903
|
+
className: _($.loadingState, R?.loadingState),
|
|
3904
|
+
children: /* @__PURE__ */ p("div", {
|
|
3905
|
+
className: $.skeletonStack,
|
|
3906
|
+
children: Array.from({ length: F }, (e, t) => /* @__PURE__ */ m("div", {
|
|
3907
|
+
role: "row",
|
|
3908
|
+
"aria-rowindex": t + 2,
|
|
3909
|
+
className: _($.row, $.stateRow),
|
|
3910
|
+
children: [h && /* @__PURE__ */ p("div", {
|
|
3911
|
+
role: Re,
|
|
3912
|
+
"data-scope": "table",
|
|
3913
|
+
"data-part": "selectionCell",
|
|
3914
|
+
className: _($.cell, $.selectionCell, R?.selectionCell),
|
|
3915
|
+
children: /* @__PURE__ */ p("span", {
|
|
3916
|
+
"aria-hidden": "true",
|
|
3917
|
+
"data-scope": "table",
|
|
3918
|
+
"data-part": "skeletonCell",
|
|
3919
|
+
className: _($.skeletonCell, R?.skeletonCell)
|
|
3920
|
+
})
|
|
3921
|
+
}), fe.map((e) => /* @__PURE__ */ p("div", {
|
|
3922
|
+
role: Re,
|
|
3923
|
+
"data-scope": "table",
|
|
3924
|
+
"data-part": "cell",
|
|
3925
|
+
"data-align": e.align ?? "start",
|
|
3926
|
+
className: _($.cell, R?.cell, e.cellClassName),
|
|
3927
|
+
children: /* @__PURE__ */ p("span", {
|
|
3928
|
+
"aria-hidden": "true",
|
|
3929
|
+
"data-scope": "table",
|
|
3930
|
+
"data-part": "skeletonCell",
|
|
3931
|
+
className: _($.skeletonCell, R?.skeletonCell)
|
|
3932
|
+
})
|
|
3933
|
+
}, `${e.key}-${t}`))]
|
|
3934
|
+
}, `skeleton-row-${t}`))
|
|
3935
|
+
})
|
|
3936
|
+
}) : ye.length === 0 ? /* @__PURE__ */ p("div", {
|
|
3937
|
+
role: "row",
|
|
3938
|
+
"aria-rowindex": 2,
|
|
3939
|
+
className: _($.row, $.stateRow),
|
|
3940
|
+
children: /* @__PURE__ */ p("div", {
|
|
3941
|
+
role: Re,
|
|
3942
|
+
"data-scope": "table",
|
|
3943
|
+
"data-part": "emptyState",
|
|
3944
|
+
className: _($.empty, $.stateCell, R?.emptyState),
|
|
3945
|
+
children: I ?? "No rows to display."
|
|
3946
|
+
})
|
|
3947
|
+
}) : /* @__PURE__ */ p("div", {
|
|
3948
|
+
style: Q ? {
|
|
3949
|
+
paddingTop: Ae,
|
|
3950
|
+
paddingBottom: je
|
|
3951
|
+
} : void 0,
|
|
3952
|
+
children: ke.map((e, t) => {
|
|
3953
|
+
let n = De + t, r = f?.(e, n) ?? String(e.id ?? n), i = _e.has(r), a = h ? k ? k(e, n) : !0 : !1;
|
|
3954
|
+
return /* @__PURE__ */ m("div", {
|
|
3955
|
+
role: "row",
|
|
3956
|
+
"aria-rowindex": n + 2,
|
|
3957
|
+
"aria-selected": h ? i : void 0,
|
|
3958
|
+
"data-selected": i || void 0,
|
|
3959
|
+
className: $.row,
|
|
3960
|
+
ref: (e) => {
|
|
3961
|
+
e ? oe.current.set(n, e) : oe.current.delete(n);
|
|
3962
|
+
},
|
|
3963
|
+
onFocus: () => {
|
|
3964
|
+
a && (se.current = !0, We(r));
|
|
3965
|
+
},
|
|
3966
|
+
onClick: () => {
|
|
3967
|
+
!h || !a || (We(r), Ke(Hr(h, _e, r)));
|
|
3968
|
+
},
|
|
3969
|
+
onKeyDown: (e) => {
|
|
3970
|
+
if (!(!h || !a)) {
|
|
3971
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End") {
|
|
3972
|
+
e.preventDefault();
|
|
3973
|
+
let t = ze.indexOf(n);
|
|
3974
|
+
if (t === -1) return;
|
|
3975
|
+
if (e.key === "ArrowDown") {
|
|
3976
|
+
Ze(ze[t + 1] ?? ze[t]);
|
|
3977
|
+
return;
|
|
3978
|
+
}
|
|
3979
|
+
if (e.key === "ArrowUp") {
|
|
3980
|
+
Ze(ze[t - 1] ?? ze[t]);
|
|
3981
|
+
return;
|
|
3982
|
+
}
|
|
3983
|
+
if (e.key === "Home" && Ve != null) {
|
|
3984
|
+
Ze(Ve);
|
|
3985
|
+
return;
|
|
3986
|
+
}
|
|
3987
|
+
let r = ze[ze.length - 1];
|
|
3988
|
+
e.key === "End" && r != null && Ze(r);
|
|
3989
|
+
return;
|
|
3990
|
+
}
|
|
3991
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), Ke(Hr(h, _e, r)));
|
|
3992
|
+
}
|
|
3993
|
+
},
|
|
3994
|
+
tabIndex: h && a ? Ue === r ? 0 : -1 : void 0,
|
|
3995
|
+
children: [h && /* @__PURE__ */ p("div", {
|
|
3996
|
+
role: Re,
|
|
3997
|
+
"data-scope": "table",
|
|
3998
|
+
"data-part": "selectionCell",
|
|
3999
|
+
className: _($.cell, $.selectionCell, R?.selectionCell),
|
|
4000
|
+
children: /* @__PURE__ */ p(Gr, {
|
|
4001
|
+
type: h === "single" ? "radio" : "checkbox",
|
|
4002
|
+
name: h === "single" ? "table-selection" : void 0,
|
|
4003
|
+
checked: i,
|
|
4004
|
+
disabled: !a,
|
|
4005
|
+
label: a ? D?.({
|
|
4006
|
+
row: e,
|
|
4007
|
+
rowId: r,
|
|
4008
|
+
index: n,
|
|
4009
|
+
selected: i,
|
|
4010
|
+
selectionMode: h
|
|
4011
|
+
}) ?? `Select row ${n + 1}` : `Row ${n + 1} is not selectable`,
|
|
4012
|
+
part: "selectionControl",
|
|
4013
|
+
className: R?.selectionControl,
|
|
4014
|
+
onChange: () => {
|
|
4015
|
+
a && Ke(Hr(h, _e, r));
|
|
4016
|
+
},
|
|
4017
|
+
onClick: (e) => e.stopPropagation()
|
|
4018
|
+
})
|
|
4019
|
+
}), fe.map((t) => {
|
|
4020
|
+
let a = t.cell ? t.cell(e, n) : typeof t.accessor == "function" ? t.accessor(e, n) : t.accessor ? e[t.accessor] : e[t.key], o = t.renderCell?.({
|
|
4021
|
+
column: t,
|
|
4022
|
+
row: e,
|
|
4023
|
+
rowId: r,
|
|
4024
|
+
index: n,
|
|
4025
|
+
selected: i,
|
|
4026
|
+
value: a
|
|
4027
|
+
}) ?? a;
|
|
4028
|
+
return /* @__PURE__ */ p("div", {
|
|
4029
|
+
role: Re,
|
|
4030
|
+
"data-scope": "table",
|
|
4031
|
+
"data-part": "cell",
|
|
4032
|
+
"data-align": t.align ?? "start",
|
|
4033
|
+
className: _($.cell, R?.cell, t.cellClassName),
|
|
4034
|
+
children: o
|
|
4035
|
+
}, t.key);
|
|
4036
|
+
})]
|
|
4037
|
+
}, r);
|
|
4038
|
+
})
|
|
4039
|
+
})
|
|
4040
|
+
})]
|
|
4041
|
+
})
|
|
4042
|
+
});
|
|
4043
|
+
}
|
|
4044
|
+
var qr = {
|
|
4045
|
+
root: "_root_cqty6_1",
|
|
4046
|
+
item: "_item_cqty6_7",
|
|
4047
|
+
button: "_button_cqty6_11",
|
|
4048
|
+
labelText: "_labelText_cqty6_55",
|
|
4049
|
+
chevron: "_chevron_cqty6_59"
|
|
4050
|
+
};
|
|
4051
|
+
//#endregion
|
|
4052
|
+
//#region src/components/Tree.tsx
|
|
4053
|
+
function Jr(e, t) {
|
|
4054
|
+
return t ? (e.textValue ?? (typeof e.label == "string" ? e.label : "")).toLowerCase().includes(t.toLowerCase()) : !0;
|
|
4055
|
+
}
|
|
4056
|
+
function Yr(e, t) {
|
|
4057
|
+
return Jr(e, t) ? !0 : e.children?.some((e) => Yr(e, t)) ?? !1;
|
|
4058
|
+
}
|
|
4059
|
+
function Xr(e, t) {
|
|
4060
|
+
if (!t || typeof e != "string") return e;
|
|
4061
|
+
let n = e.toLowerCase(), r = t.toLowerCase(), i = n.indexOf(r);
|
|
4062
|
+
if (i < 0) return e;
|
|
4063
|
+
let a = i + t.length;
|
|
4064
|
+
return /* @__PURE__ */ m(f, { children: [
|
|
4065
|
+
e.slice(0, i),
|
|
4066
|
+
/* @__PURE__ */ p("mark", { children: e.slice(i, a) }),
|
|
4067
|
+
e.slice(a)
|
|
4068
|
+
] });
|
|
4069
|
+
}
|
|
4070
|
+
function Zr({ nodes: e, expandedKeys: t, defaultExpandedKeys: n, onExpand: r, onExpandedKeysChange: i, selectedKey: a, defaultSelectedKey: o, onSelect: s, renderNode: c, searchQuery: h = "", className: g, ariaLabel: v = "Tree", classNames: y }) {
|
|
4071
|
+
let b = h.trim(), [x, S] = d(n ?? /* @__PURE__ */ new Set()), [C, w] = d(o), T = t ?? x, E = a ?? C, D = u(/* @__PURE__ */ new Map()), O = l(() => {
|
|
4072
|
+
let t = [], n = b.length > 0;
|
|
4073
|
+
function r(e, i, a) {
|
|
4074
|
+
for (let o of e) n && !Yr(o, b) || (t.push({
|
|
4075
|
+
node: o,
|
|
4076
|
+
depth: i,
|
|
4077
|
+
parentKey: a
|
|
4078
|
+
}), (n ? o.children?.length : o.children?.length && T.has(o.key)) && r(o.children ?? [], i + 1, o.key));
|
|
4079
|
+
}
|
|
4080
|
+
return r(e, 0), t;
|
|
4081
|
+
}, [
|
|
4082
|
+
T,
|
|
4083
|
+
e,
|
|
4084
|
+
b
|
|
4085
|
+
]);
|
|
4086
|
+
l(() => new Map(O.map((e, t) => [e.node.key, t])), [O]);
|
|
4087
|
+
let k = l(() => new Map(O.map((e) => [e.node.key, e])), [O]), A = l(() => O.filter((e) => !e.node.disabled), [O]), j = l(() => new Map(A.map((e, t) => [e.node.key, t])), [A]), M = E != null && j.has(E), N = (e, n) => {
|
|
4088
|
+
let a = new Set(T);
|
|
4089
|
+
n ? a.add(e) : a.delete(e), t || S(a), i?.(a), r?.(e, n);
|
|
4090
|
+
}, P = (e) => {
|
|
4091
|
+
a || w(e), s?.(e);
|
|
4092
|
+
}, F = (e) => {
|
|
4093
|
+
e && D.current.get(e)?.focus();
|
|
4094
|
+
}, I = (e, t) => {
|
|
4095
|
+
if (A.length === 0) return;
|
|
4096
|
+
let n = j.get(e) ?? -1;
|
|
4097
|
+
if (t === "first") {
|
|
4098
|
+
F(A[0]?.node.key);
|
|
4099
|
+
return;
|
|
4100
|
+
}
|
|
4101
|
+
if (t === "last") {
|
|
4102
|
+
F(A[A.length - 1]?.node.key);
|
|
4103
|
+
return;
|
|
4104
|
+
}
|
|
4105
|
+
F(A[t === "next" ? n + 1 : n - 1]?.node.key);
|
|
4106
|
+
}, L = (e) => e.children?.find((e) => !e.disabled)?.key, R = (e) => {
|
|
4107
|
+
let t = e;
|
|
4108
|
+
for (; t;) {
|
|
4109
|
+
let e = k.get(t);
|
|
4110
|
+
if (e && !e.node.disabled) return t;
|
|
4111
|
+
t = e?.parentKey;
|
|
4112
|
+
}
|
|
4113
|
+
}, z = (e, t) => {
|
|
4114
|
+
let n = !!t.node.children?.length, r = T.has(t.node.key);
|
|
4115
|
+
switch (e.key) {
|
|
4116
|
+
case "ArrowDown":
|
|
4117
|
+
e.preventDefault(), I(t.node.key, "next");
|
|
4118
|
+
break;
|
|
4119
|
+
case "ArrowUp":
|
|
4120
|
+
e.preventDefault(), I(t.node.key, "prev");
|
|
4121
|
+
break;
|
|
4122
|
+
case "ArrowRight":
|
|
4123
|
+
e.preventDefault(), n && !r ? N(t.node.key, !0) : n && F(L(t.node));
|
|
4124
|
+
break;
|
|
4125
|
+
case "ArrowLeft":
|
|
4126
|
+
e.preventDefault(), n && r ? N(t.node.key, !1) : F(R(t.parentKey));
|
|
4127
|
+
break;
|
|
4128
|
+
case "Home":
|
|
4129
|
+
e.preventDefault(), I(t.node.key, "first");
|
|
4130
|
+
break;
|
|
4131
|
+
case "End":
|
|
4132
|
+
e.preventDefault(), I(t.node.key, "last");
|
|
4133
|
+
break;
|
|
4134
|
+
case "Enter":
|
|
4135
|
+
case " ":
|
|
4136
|
+
e.preventDefault(), P(t.node.key);
|
|
4137
|
+
break;
|
|
4138
|
+
}
|
|
4139
|
+
};
|
|
4140
|
+
return /* @__PURE__ */ p("div", {
|
|
4141
|
+
role: "tree",
|
|
4142
|
+
"aria-label": v,
|
|
4143
|
+
"data-scope": "tree",
|
|
4144
|
+
className: _("owo-tree", qr.root, g),
|
|
4145
|
+
children: O.map((e) => {
|
|
4146
|
+
let { node: t, depth: n } = e, r = E === t.key, i = b.length > 0, a = i ? !!t.children?.length : T.has(t.key), o = !!t.children?.length, s = Jr(t, b), l = !t.disabled && (M ? r : A[0]?.node.key === t.key), u = c?.({
|
|
4147
|
+
node: t,
|
|
4148
|
+
depth: n,
|
|
4149
|
+
expanded: a,
|
|
4150
|
+
selected: r,
|
|
4151
|
+
match: s
|
|
4152
|
+
});
|
|
4153
|
+
return /* @__PURE__ */ p("div", {
|
|
4154
|
+
"data-scope": "tree",
|
|
4155
|
+
"data-part": "item",
|
|
4156
|
+
"data-depth": n,
|
|
4157
|
+
"data-selected": r || void 0,
|
|
4158
|
+
"data-match": s || void 0,
|
|
4159
|
+
className: _(qr.item, y?.item),
|
|
4160
|
+
children: /* @__PURE__ */ p("button", {
|
|
4161
|
+
ref: (e) => {
|
|
4162
|
+
D.current.set(t.key, e);
|
|
4163
|
+
},
|
|
4164
|
+
type: "button",
|
|
4165
|
+
role: "treeitem",
|
|
4166
|
+
"aria-selected": r,
|
|
4167
|
+
"aria-expanded": o ? a : void 0,
|
|
4168
|
+
"aria-level": n + 1,
|
|
4169
|
+
"data-scope": "tree",
|
|
4170
|
+
"data-part": "button",
|
|
4171
|
+
className: _(qr.button, y?.button),
|
|
4172
|
+
disabled: t.disabled,
|
|
4173
|
+
tabIndex: l ? 0 : -1,
|
|
4174
|
+
style: { paddingInlineStart: `${.75 + n * 1.25}rem` },
|
|
4175
|
+
onClick: () => {
|
|
4176
|
+
P(t.key), o && !i && N(t.key, !a);
|
|
4177
|
+
},
|
|
4178
|
+
onKeyDown: (t) => z(t, e),
|
|
4179
|
+
children: c ? u : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
|
|
4180
|
+
"data-scope": "tree",
|
|
4181
|
+
"data-part": "label",
|
|
4182
|
+
className: _(qr.labelText, y?.label),
|
|
4183
|
+
children: Xr(t.label, b)
|
|
4184
|
+
}), o && /* @__PURE__ */ p("span", {
|
|
4185
|
+
"aria-hidden": "true",
|
|
4186
|
+
"data-scope": "tree",
|
|
4187
|
+
"data-part": "chevron",
|
|
4188
|
+
className: _(qr.chevron, y?.chevron),
|
|
4189
|
+
children: a ? "▾" : "▸"
|
|
4190
|
+
})] })
|
|
4191
|
+
})
|
|
4192
|
+
}, t.key);
|
|
4193
|
+
})
|
|
4194
|
+
});
|
|
4195
|
+
}
|
|
4196
|
+
var Qr = { root: "_root_158qs_1" }, $r = n(null);
|
|
4197
|
+
function ei(e) {
|
|
4198
|
+
let t = a($r);
|
|
2722
4199
|
if (!t) throw Error(`${e} must be used within Tabs.Root`);
|
|
2723
4200
|
return t;
|
|
2724
4201
|
}
|
|
2725
|
-
function
|
|
4202
|
+
function ti(e) {
|
|
2726
4203
|
return e.replace(/[^a-zA-Z0-9_-]+/g, "-");
|
|
2727
4204
|
}
|
|
2728
|
-
function
|
|
2729
|
-
let [
|
|
4205
|
+
function ni({ children: e, value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", classNames: a, className: o, ...c }) {
|
|
4206
|
+
let [u, d] = H({
|
|
2730
4207
|
value: t,
|
|
2731
4208
|
defaultValue: n,
|
|
2732
4209
|
onChange: r,
|
|
2733
4210
|
fallback: ""
|
|
2734
|
-
}),
|
|
2735
|
-
value:
|
|
2736
|
-
setValue:
|
|
2737
|
-
baseId:
|
|
4211
|
+
}), f = s(), m = l(() => ({
|
|
4212
|
+
value: u,
|
|
4213
|
+
setValue: d,
|
|
4214
|
+
baseId: f,
|
|
4215
|
+
orientation: i,
|
|
4216
|
+
classNames: a
|
|
2738
4217
|
}), [
|
|
4218
|
+
f,
|
|
4219
|
+
a,
|
|
2739
4220
|
u,
|
|
2740
|
-
|
|
2741
|
-
|
|
4221
|
+
i,
|
|
4222
|
+
d
|
|
2742
4223
|
]);
|
|
2743
|
-
return /* @__PURE__ */ p(
|
|
2744
|
-
value:
|
|
4224
|
+
return /* @__PURE__ */ p($r.Provider, {
|
|
4225
|
+
value: m,
|
|
2745
4226
|
children: /* @__PURE__ */ p("div", {
|
|
2746
4227
|
"data-scope": "tabs",
|
|
2747
|
-
|
|
2748
|
-
|
|
4228
|
+
"data-orientation": i,
|
|
4229
|
+
className: _("owo-tabs", Qr.root, o),
|
|
4230
|
+
...c,
|
|
2749
4231
|
children: e
|
|
2750
4232
|
})
|
|
2751
4233
|
});
|
|
2752
4234
|
}
|
|
2753
|
-
function
|
|
4235
|
+
function ri({ children: e, className: t, ariaLabel: n, ...r }) {
|
|
4236
|
+
let { orientation: i, classNames: a } = ei("Tabs.List");
|
|
2754
4237
|
return /* @__PURE__ */ p("div", {
|
|
2755
4238
|
role: "tablist",
|
|
2756
4239
|
"aria-label": n,
|
|
4240
|
+
"aria-orientation": i,
|
|
2757
4241
|
"data-scope": "tabs",
|
|
2758
4242
|
"data-part": "list",
|
|
2759
|
-
|
|
4243
|
+
"data-orientation": i,
|
|
4244
|
+
className: _(a?.list, t),
|
|
2760
4245
|
...r,
|
|
2761
4246
|
children: e
|
|
2762
4247
|
});
|
|
2763
4248
|
}
|
|
2764
|
-
function
|
|
2765
|
-
let { value:
|
|
2766
|
-
|
|
4249
|
+
function ii({ children: e, className: t, value: n, disabled: r, onClick: i, onKeyDown: a, ...s }) {
|
|
4250
|
+
let { value: c, setValue: l, baseId: d, orientation: f, classNames: m } = ei("Tabs.Trigger"), h = c === n, g = `${d}-trigger-${ti(n)}`, v = `${d}-panel-${ti(n)}`, y = u(null);
|
|
4251
|
+
o(() => {
|
|
4252
|
+
if (r || c !== "") return;
|
|
4253
|
+
let e = y.current, t = e?.closest("[role=\"tablist\"]");
|
|
4254
|
+
!e || !t || t.querySelector("[role=\"tab\"]:not([disabled])") === e && l(n);
|
|
4255
|
+
}, [
|
|
4256
|
+
c,
|
|
4257
|
+
r,
|
|
4258
|
+
l,
|
|
4259
|
+
n
|
|
4260
|
+
]);
|
|
4261
|
+
function b(e, t) {
|
|
2767
4262
|
let n = e.closest("[role=\"tablist\"]");
|
|
2768
4263
|
if (!n) return;
|
|
2769
4264
|
let r = Array.from(n.querySelectorAll("[role=\"tab\"]:not([disabled])")), i = r.indexOf(e);
|
|
@@ -2772,66 +4267,75 @@ function sr({ children: e, className: t, value: n, disabled: r, onClick: i, onKe
|
|
|
2772
4267
|
t === "first" && (a = r[0]), t === "last" && (a = r[r.length - 1]), t === "next" && (a = r[(i + 1) % r.length]), t === "prev" && (a = r[(i - 1 + r.length) % r.length]), a && (a.focus(), a.click());
|
|
2773
4268
|
}
|
|
2774
4269
|
return /* @__PURE__ */ p("button", {
|
|
4270
|
+
ref: y,
|
|
2775
4271
|
type: "button",
|
|
2776
|
-
id:
|
|
4272
|
+
id: g,
|
|
2777
4273
|
role: "tab",
|
|
2778
|
-
"aria-selected":
|
|
2779
|
-
"aria-controls":
|
|
2780
|
-
tabIndex:
|
|
2781
|
-
"data-state":
|
|
4274
|
+
"aria-selected": h,
|
|
4275
|
+
"aria-controls": v,
|
|
4276
|
+
tabIndex: h ? 0 : -1,
|
|
4277
|
+
"data-state": h ? "active" : "inactive",
|
|
2782
4278
|
"data-scope": "tabs",
|
|
2783
4279
|
"data-part": "trigger",
|
|
4280
|
+
"data-orientation": f,
|
|
2784
4281
|
disabled: r,
|
|
2785
|
-
className: _(t),
|
|
4282
|
+
className: _(m?.trigger, t),
|
|
2786
4283
|
onClick: (e) => {
|
|
2787
|
-
i?.(e), !e.defaultPrevented && !r &&
|
|
4284
|
+
i?.(e), !e.defaultPrevented && !r && l(n);
|
|
2788
4285
|
},
|
|
2789
4286
|
onKeyDown: (e) => {
|
|
2790
4287
|
if (a?.(e), e.defaultPrevented || r) return;
|
|
2791
4288
|
let t = e.currentTarget;
|
|
2792
4289
|
switch (e.key) {
|
|
2793
4290
|
case "ArrowRight":
|
|
2794
|
-
e.preventDefault(),
|
|
4291
|
+
f === "horizontal" && (e.preventDefault(), b(t, "next"));
|
|
2795
4292
|
break;
|
|
2796
4293
|
case "ArrowLeft":
|
|
2797
|
-
e.preventDefault(),
|
|
4294
|
+
f === "horizontal" && (e.preventDefault(), b(t, "prev"));
|
|
4295
|
+
break;
|
|
4296
|
+
case "ArrowDown":
|
|
4297
|
+
f === "vertical" && (e.preventDefault(), b(t, "next"));
|
|
4298
|
+
break;
|
|
4299
|
+
case "ArrowUp":
|
|
4300
|
+
f === "vertical" && (e.preventDefault(), b(t, "prev"));
|
|
2798
4301
|
break;
|
|
2799
4302
|
case "Home":
|
|
2800
|
-
e.preventDefault(),
|
|
4303
|
+
e.preventDefault(), b(t, "first");
|
|
2801
4304
|
break;
|
|
2802
4305
|
case "End":
|
|
2803
|
-
e.preventDefault(),
|
|
4306
|
+
e.preventDefault(), b(t, "last");
|
|
2804
4307
|
break;
|
|
2805
4308
|
}
|
|
2806
4309
|
},
|
|
2807
|
-
...
|
|
4310
|
+
...s,
|
|
2808
4311
|
children: e
|
|
2809
4312
|
});
|
|
2810
4313
|
}
|
|
2811
|
-
function
|
|
2812
|
-
let { value: i, baseId: a } =
|
|
2813
|
-
return
|
|
2814
|
-
id:
|
|
4314
|
+
function ai({ children: e, className: t, value: n, ...r }) {
|
|
4315
|
+
let { value: i, baseId: a, orientation: o, classNames: s } = ei("Tabs.Content"), c = i === n, l = `${a}-trigger-${ti(n)}`, u = `${a}-panel-${ti(n)}`;
|
|
4316
|
+
return c ? /* @__PURE__ */ p("div", {
|
|
4317
|
+
id: u,
|
|
2815
4318
|
role: "tabpanel",
|
|
2816
|
-
"aria-labelledby":
|
|
4319
|
+
"aria-labelledby": l,
|
|
2817
4320
|
"data-state": "active",
|
|
2818
4321
|
"data-scope": "tabs",
|
|
2819
4322
|
"data-part": "content",
|
|
2820
|
-
|
|
4323
|
+
"data-orientation": o,
|
|
4324
|
+
className: _(s?.content, t),
|
|
2821
4325
|
...r,
|
|
2822
4326
|
children: e
|
|
2823
4327
|
}) : null;
|
|
2824
4328
|
}
|
|
2825
|
-
var
|
|
2826
|
-
Root:
|
|
2827
|
-
List:
|
|
2828
|
-
Trigger:
|
|
2829
|
-
Content:
|
|
2830
|
-
}),
|
|
4329
|
+
var oi = Object.assign(ni, {
|
|
4330
|
+
Root: ni,
|
|
4331
|
+
List: ri,
|
|
4332
|
+
Trigger: ii,
|
|
4333
|
+
Content: ai
|
|
4334
|
+
}), si = { root: "_root_17j1y_1" };
|
|
2831
4335
|
//#endregion
|
|
2832
4336
|
//#region src/components/Textarea.tsx
|
|
2833
|
-
function
|
|
2834
|
-
let m =
|
|
4337
|
+
function ci({ className: e, tone: t = "default", size: n = "md", resize: r = "vertical", autoResize: a = !1, invalid: s, style: c, onInput: l, rows: d = 3, ...f }) {
|
|
4338
|
+
let m = V({
|
|
2835
4339
|
id: f.id,
|
|
2836
4340
|
disabled: f.disabled,
|
|
2837
4341
|
required: f.required,
|
|
@@ -2870,25 +4374,25 @@ function dr({ className: e, tone: t = "default", size: n = "md", resize: r = "ve
|
|
|
2870
4374
|
"data-size": n,
|
|
2871
4375
|
"data-invalid": m.invalid || void 0,
|
|
2872
4376
|
"data-auto-resize": a || void 0,
|
|
2873
|
-
className: _("owo-input",
|
|
4377
|
+
className: _("owo-input", Rn.root, "owo-textarea", si.root, e),
|
|
2874
4378
|
style: b,
|
|
2875
4379
|
onInput: y
|
|
2876
4380
|
});
|
|
2877
4381
|
}
|
|
2878
4382
|
//#endregion
|
|
2879
4383
|
//#region src/styles/ui/toast.module.css
|
|
2880
|
-
var
|
|
2881
|
-
container:
|
|
2882
|
-
toast:
|
|
4384
|
+
var li = "_container_73rls_1", ui = "_toast_73rls_12", di = "_toastDefault_73rls_32", fi = {
|
|
4385
|
+
container: li,
|
|
4386
|
+
toast: ui,
|
|
2883
4387
|
"toast-in": "_toast-in_73rls_1",
|
|
2884
|
-
toastDefault:
|
|
2885
|
-
},
|
|
2886
|
-
function
|
|
2887
|
-
let e = a(
|
|
4388
|
+
toastDefault: di
|
|
4389
|
+
}, pi = n(null), mi = 5, hi = 4e3;
|
|
4390
|
+
function gi() {
|
|
4391
|
+
let e = a(pi);
|
|
2888
4392
|
if (!e) throw Error("useToast must be used within <ToastProvider>");
|
|
2889
4393
|
return e;
|
|
2890
4394
|
}
|
|
2891
|
-
function
|
|
4395
|
+
function _i({ tone: e }) {
|
|
2892
4396
|
let t = {
|
|
2893
4397
|
width: 16,
|
|
2894
4398
|
height: 16,
|
|
@@ -2930,18 +4434,18 @@ function br({ tone: e }) {
|
|
|
2930
4434
|
});
|
|
2931
4435
|
}
|
|
2932
4436
|
}
|
|
2933
|
-
function
|
|
4437
|
+
function vi(e, t) {
|
|
2934
4438
|
return typeof e == "string" ? {
|
|
2935
4439
|
message: e,
|
|
2936
|
-
duration: t ??
|
|
4440
|
+
duration: t ?? hi
|
|
2937
4441
|
} : {
|
|
2938
4442
|
title: e.title,
|
|
2939
4443
|
message: e.message,
|
|
2940
|
-
duration: e.duration ?? t ??
|
|
4444
|
+
duration: e.duration ?? t ?? hi
|
|
2941
4445
|
};
|
|
2942
4446
|
}
|
|
2943
|
-
function
|
|
2944
|
-
let i = () => t(e.id), a = /* @__PURE__ */ p(
|
|
4447
|
+
function yi({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
|
|
4448
|
+
let i = () => t(e.id), a = /* @__PURE__ */ p(_i, { tone: e.tone });
|
|
2945
4449
|
return n ? /* @__PURE__ */ p("div", {
|
|
2946
4450
|
role: "status",
|
|
2947
4451
|
"aria-live": "polite",
|
|
@@ -2949,7 +4453,7 @@ function Sr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
|
|
|
2949
4453
|
"data-tone": e.tone,
|
|
2950
4454
|
"data-scope": "toast",
|
|
2951
4455
|
"data-part": "toast",
|
|
2952
|
-
className: _("owo-toast",
|
|
4456
|
+
className: _("owo-toast", fi.toast, r?.toast),
|
|
2953
4457
|
children: n({
|
|
2954
4458
|
item: e,
|
|
2955
4459
|
dismiss: i,
|
|
@@ -2962,7 +4466,7 @@ function Sr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
|
|
|
2962
4466
|
"data-tone": e.tone,
|
|
2963
4467
|
"data-scope": "toast",
|
|
2964
4468
|
"data-part": "toast",
|
|
2965
|
-
className: _("owo-toast",
|
|
4469
|
+
className: _("owo-toast", fi.toast, fi.toastDefault, r?.toast),
|
|
2966
4470
|
children: [
|
|
2967
4471
|
/* @__PURE__ */ p("span", {
|
|
2968
4472
|
"data-scope": "toast",
|
|
@@ -3008,7 +4512,7 @@ function Sr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
|
|
|
3008
4512
|
]
|
|
3009
4513
|
});
|
|
3010
4514
|
}
|
|
3011
|
-
function
|
|
4515
|
+
function bi({ children: e, renderToast: t, classNames: n }) {
|
|
3012
4516
|
let [r, a] = d([]), o = u(0), s = u(/* @__PURE__ */ new Map()), c = i((e) => {
|
|
3013
4517
|
let t = s.current.get(e);
|
|
3014
4518
|
t && clearTimeout(t), s.current.delete(e), a((t) => t.filter((t) => t.id !== e));
|
|
@@ -3016,17 +4520,17 @@ function Cr({ children: e, renderToast: t, classNames: n }) {
|
|
|
3016
4520
|
let r = o.current++, i = {
|
|
3017
4521
|
id: r,
|
|
3018
4522
|
tone: e,
|
|
3019
|
-
...
|
|
4523
|
+
...vi(t, n)
|
|
3020
4524
|
};
|
|
3021
4525
|
a((e) => {
|
|
3022
4526
|
let t = [...e, i];
|
|
3023
|
-
if (t.length >
|
|
3024
|
-
let e = t.slice(0, t.length -
|
|
4527
|
+
if (t.length > mi) {
|
|
4528
|
+
let e = t.slice(0, t.length - mi);
|
|
3025
4529
|
for (let t of e) {
|
|
3026
4530
|
let e = s.current.get(t.id);
|
|
3027
4531
|
e && clearTimeout(e), s.current.delete(t.id);
|
|
3028
4532
|
}
|
|
3029
|
-
return t.slice(-
|
|
4533
|
+
return t.slice(-mi);
|
|
3030
4534
|
}
|
|
3031
4535
|
return t;
|
|
3032
4536
|
}), i.duration > 0 && s.current.set(r, setTimeout(() => c(r), i.duration));
|
|
@@ -3036,15 +4540,15 @@ function Cr({ children: e, renderToast: t, classNames: n }) {
|
|
|
3036
4540
|
danger: (e, t) => f("danger", e, t),
|
|
3037
4541
|
info: (e, t) => f("info", e, t)
|
|
3038
4542
|
}), [f]);
|
|
3039
|
-
return /* @__PURE__ */ m(
|
|
4543
|
+
return /* @__PURE__ */ m(pi.Provider, {
|
|
3040
4544
|
value: h,
|
|
3041
4545
|
children: [e, /* @__PURE__ */ p("div", {
|
|
3042
4546
|
"aria-label": "Notifications",
|
|
3043
4547
|
"data-state": r.length > 0 ? "open" : "closed",
|
|
3044
4548
|
"data-scope": "toast",
|
|
3045
4549
|
"data-part": "container",
|
|
3046
|
-
className: _("owo-toast-container",
|
|
3047
|
-
children: r.map((e) => /* @__PURE__ */ p(
|
|
4550
|
+
className: _("owo-toast-container", fi.container, n?.container),
|
|
4551
|
+
children: r.map((e) => /* @__PURE__ */ p(yi, {
|
|
3048
4552
|
item: e,
|
|
3049
4553
|
onDismiss: c,
|
|
3050
4554
|
renderToast: t,
|
|
@@ -3053,116 +4557,5 @@ function Cr({ children: e, renderToast: t, classNames: n }) {
|
|
|
3053
4557
|
})]
|
|
3054
4558
|
});
|
|
3055
4559
|
}
|
|
3056
|
-
var wr = {
|
|
3057
|
-
trigger: "_trigger_xunrw_1",
|
|
3058
|
-
content: "_content_xunrw_5",
|
|
3059
|
-
"tooltip-in": "_tooltip-in_xunrw_1"
|
|
3060
|
-
}, Tr = 6, Er = 8, Dr = 4;
|
|
3061
|
-
function Or(e) {
|
|
3062
|
-
return e.split("-")[0];
|
|
3063
|
-
}
|
|
3064
|
-
var kr = {
|
|
3065
|
-
top: "",
|
|
3066
|
-
bottom: "rotate(180deg)",
|
|
3067
|
-
left: "rotate(-90deg)",
|
|
3068
|
-
right: "rotate(90deg)"
|
|
3069
|
-
};
|
|
3070
|
-
function Ar({ content: e, placement: t = "top", density: n = "default", showDelay: r = 300, hideDelay: a = 150, arrow: l = !0, renderArrow: g, className: v, children: y, classNames: b }) {
|
|
3071
|
-
let [x, S] = d(!1), [C, w] = d(null), [T, E] = d(t), [D, O] = d({}), k = u(null), A = u(null), j = u(null), M = u(void 0), N = u(void 0), P = s(), F = i(() => {
|
|
3072
|
-
clearTimeout(M.current), clearTimeout(N.current);
|
|
3073
|
-
}, []), I = i(() => {
|
|
3074
|
-
F(), M.current = setTimeout(() => S(!0), r);
|
|
3075
|
-
}, [F, r]), L = i(() => {
|
|
3076
|
-
F(), S(!0);
|
|
3077
|
-
}, [F]), R = i(() => {
|
|
3078
|
-
F(), N.current = setTimeout(() => S(!1), a);
|
|
3079
|
-
}, [F, a]), ee = i((e) => {
|
|
3080
|
-
if (e.target === k.current) {
|
|
3081
|
-
I();
|
|
3082
|
-
return;
|
|
3083
|
-
}
|
|
3084
|
-
L();
|
|
3085
|
-
}, [I, L]), z = i((e) => {
|
|
3086
|
-
e.pointerType !== "mouse" && L();
|
|
3087
|
-
}, [L]), B = i((e) => {
|
|
3088
|
-
e.key === "Escape" && x && S(!1);
|
|
3089
|
-
}, [x]);
|
|
3090
|
-
c(() => {
|
|
3091
|
-
if (!x || !k.current || !A.current) return;
|
|
3092
|
-
let e = [
|
|
3093
|
-
Zt(l ? Er + Tr : Er),
|
|
3094
|
-
$t({ padding: Dr }),
|
|
3095
|
-
Qt({ padding: Dr })
|
|
3096
|
-
];
|
|
3097
|
-
return l && j.current && e.push(en({ element: j.current })), Xt(k.current, A.current, () => {
|
|
3098
|
-
!k.current || !A.current || tn(k.current, A.current, {
|
|
3099
|
-
placement: t,
|
|
3100
|
-
strategy: "fixed",
|
|
3101
|
-
middleware: e
|
|
3102
|
-
}).then(({ x: e, y: t, placement: n, middlewareData: r }) => {
|
|
3103
|
-
w({
|
|
3104
|
-
top: t,
|
|
3105
|
-
left: e
|
|
3106
|
-
}), E(Or(n)), r.arrow && O({
|
|
3107
|
-
x: r.arrow.x,
|
|
3108
|
-
y: r.arrow.y
|
|
3109
|
-
});
|
|
3110
|
-
});
|
|
3111
|
-
});
|
|
3112
|
-
}, [
|
|
3113
|
-
x,
|
|
3114
|
-
t,
|
|
3115
|
-
l
|
|
3116
|
-
]), o(() => {
|
|
3117
|
-
if (x) return document.addEventListener("keydown", B), () => document.removeEventListener("keydown", B);
|
|
3118
|
-
}, [x, B]), o(() => F, [F]);
|
|
3119
|
-
let V = { position: "absolute" }, H = T;
|
|
3120
|
-
return H === "top" || H === "bottom" ? (V.left = D.x ?? 0, V[H === "top" ? "bottom" : "top"] = -Tr, V.transform = kr[H] || void 0) : (V.top = D.y ?? 0, V[H === "left" ? "right" : "left"] = -Tr, V.transform = kr[H]), /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
|
|
3121
|
-
ref: k,
|
|
3122
|
-
"data-state": x ? "open" : "closed",
|
|
3123
|
-
"data-scope": "tooltip",
|
|
3124
|
-
"data-part": "trigger",
|
|
3125
|
-
className: _("owo-tooltip-trigger", wr.trigger, b?.trigger),
|
|
3126
|
-
onMouseEnter: I,
|
|
3127
|
-
onMouseLeave: R,
|
|
3128
|
-
onFocus: ee,
|
|
3129
|
-
onBlur: R,
|
|
3130
|
-
onPointerDown: z,
|
|
3131
|
-
"aria-describedby": x ? P : void 0,
|
|
3132
|
-
children: y
|
|
3133
|
-
}), x && h(/* @__PURE__ */ m("div", {
|
|
3134
|
-
ref: A,
|
|
3135
|
-
id: P,
|
|
3136
|
-
role: "tooltip",
|
|
3137
|
-
"data-state": x ? "open" : "closed",
|
|
3138
|
-
"data-placement": T,
|
|
3139
|
-
"data-density": n,
|
|
3140
|
-
"data-scope": "tooltip",
|
|
3141
|
-
"data-part": "content",
|
|
3142
|
-
className: _("owo-tooltip", wr.content, b?.content, v),
|
|
3143
|
-
style: C ? {
|
|
3144
|
-
top: C.top,
|
|
3145
|
-
left: C.left
|
|
3146
|
-
} : { visibility: "hidden" },
|
|
3147
|
-
onMouseEnter: I,
|
|
3148
|
-
onMouseLeave: R,
|
|
3149
|
-
children: [e, l && /* @__PURE__ */ p("span", {
|
|
3150
|
-
ref: j,
|
|
3151
|
-
"data-scope": "tooltip",
|
|
3152
|
-
"data-part": "arrow",
|
|
3153
|
-
className: _(b?.arrow),
|
|
3154
|
-
style: V,
|
|
3155
|
-
children: g ? g({ placement: T }) : /* @__PURE__ */ p("svg", {
|
|
3156
|
-
width: Tr * 2,
|
|
3157
|
-
height: Tr,
|
|
3158
|
-
viewBox: "0 0 12 6",
|
|
3159
|
-
children: /* @__PURE__ */ p("path", {
|
|
3160
|
-
d: "M0 0l6 6 6-6z",
|
|
3161
|
-
fill: "currentColor"
|
|
3162
|
-
})
|
|
3163
|
-
})
|
|
3164
|
-
})]
|
|
3165
|
-
}), document.body)] });
|
|
3166
|
-
}
|
|
3167
4560
|
//#endregion
|
|
3168
|
-
export { b as Avatar, S as Badge, R as Button,
|
|
4561
|
+
export { b as Avatar, S as Badge, R as Button, te as Checkbox, X as Collapsible, Y as CollapsibleContent, q as CollapsibleRoot, J as CollapsibleTrigger, me as ConfirmProvider, de as Dialog, Nn as Drawer, jn as DropdownMenu, Fn as Field, Ln as IconButton, zn as Input, er as NavRail, Zn as NavRailItem, Xn as NavRailRoot, Qn as NavRailSpacer, nr as Panel, ir as PanelBody, ar as PanelFooter, rr as PanelHeader, _r as Popover, gr as PopoverContent, pr as PopoverRoot, mr as PopoverTrigger, xr as Radio, Sr as RadioGroup, wr as SegmentedControl, Or as Select, jr as Skeleton, F as Spinner, Nr as StatusNotice, Fr as Switch, Kr as Table, oi as Tabs, ai as TabsContent, ri as TabsList, ni as TabsRoot, ii as TabsTrigger, ci as Textarea, bi as ToastProvider, Kn as Tooltip, Zr as Tree, L as buttonClassName, pe as useConfirm, gi as useToast };
|