@codbex/harmonia 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/harmonia.css +1 -1
- package/dist/harmonia.esm.js +835 -498
- package/dist/harmonia.esm.min.js +3 -3
- package/dist/harmonia.esm.min.js.map +4 -4
- package/dist/harmonia.js +789 -453
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +4 -4
- package/package.json +18 -9
package/dist/harmonia.esm.js
CHANGED
|
@@ -18436,7 +18436,7 @@ function accordion_default(Alpine) {
|
|
|
18436
18436
|
if (!accordion) {
|
|
18437
18437
|
throw new Error("h-accordion-item must be inside an h-accordion");
|
|
18438
18438
|
}
|
|
18439
|
-
el.classList.add("border-b", "last:border-b-0");
|
|
18439
|
+
el.classList.add("border-b", "last:border-b-0", "[[data-variant=header]_&]:data-[state=closed]:border-b-0");
|
|
18440
18440
|
el.setAttribute("data-slot", "accordion-item");
|
|
18441
18441
|
const itemId = expression ?? `ha${v4_default()}`;
|
|
18442
18442
|
function getIsExpanded() {
|
|
@@ -18471,7 +18471,18 @@ function accordion_default(Alpine) {
|
|
|
18471
18471
|
if (!accordionItem || !accordion) {
|
|
18472
18472
|
throw new Error("h-accordion-trigger must be inside an h-accordion-item, which must be inside an h-accordion");
|
|
18473
18473
|
}
|
|
18474
|
-
el.classList.add(
|
|
18474
|
+
el.classList.add(
|
|
18475
|
+
"flex",
|
|
18476
|
+
"h-12",
|
|
18477
|
+
"[[data-size=md]_&]:h-10",
|
|
18478
|
+
"[[data-size=sm]_&]:h-8",
|
|
18479
|
+
"[[data-variant=header]_&]:bg-object-header",
|
|
18480
|
+
"[[data-variant=header]_&]:text-object-header-foreground",
|
|
18481
|
+
"[[data-variant=header]_&]:px-4",
|
|
18482
|
+
"[[data-variant=header]_&]:border-b",
|
|
18483
|
+
"[[data-size=md][data-variant=header]_&]:px-3",
|
|
18484
|
+
"[[data-size=sm][data-variant=header]_&]:px-2.5"
|
|
18485
|
+
);
|
|
18475
18486
|
el.setAttribute("tabIndex", "-1");
|
|
18476
18487
|
const getLabel = evaluateLater(expression);
|
|
18477
18488
|
const chevronDown = (0, import_lucide.createElement)(import_lucide.ChevronDown, {
|
|
@@ -18490,11 +18501,9 @@ function accordion_default(Alpine) {
|
|
|
18490
18501
|
"focus-visible:ring-ring/50",
|
|
18491
18502
|
"flex",
|
|
18492
18503
|
"flex-1",
|
|
18493
|
-
"items-
|
|
18504
|
+
"items-center",
|
|
18494
18505
|
"justify-between",
|
|
18495
18506
|
"gap-4",
|
|
18496
|
-
"rounded-md",
|
|
18497
|
-
"py-4",
|
|
18498
18507
|
"text-left",
|
|
18499
18508
|
"text-sm",
|
|
18500
18509
|
"font-medium",
|
|
@@ -18575,7 +18584,7 @@ function alert_default(Alpine) {
|
|
|
18575
18584
|
"items-center",
|
|
18576
18585
|
"[&>svg]:size-4",
|
|
18577
18586
|
"[&>svg]:text-current",
|
|
18578
|
-
modifiers.includes("floating") ? "shadow-
|
|
18587
|
+
modifiers.includes("floating") ? "shadow-lg" : void 0
|
|
18579
18588
|
);
|
|
18580
18589
|
el.setAttribute("data-slot", "alert");
|
|
18581
18590
|
el.setAttribute("role", "alert");
|
|
@@ -18594,13 +18603,11 @@ function alert_default(Alpine) {
|
|
|
18594
18603
|
}
|
|
18595
18604
|
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
18596
18605
|
const observer = new MutationObserver((mutations) => {
|
|
18597
|
-
mutations.forEach((
|
|
18598
|
-
|
|
18599
|
-
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
18600
|
-
}
|
|
18606
|
+
mutations.forEach(() => {
|
|
18607
|
+
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
18601
18608
|
});
|
|
18602
18609
|
});
|
|
18603
|
-
observer.observe(el, { attributes: true });
|
|
18610
|
+
observer.observe(el, { attributes: true, attributeFilter: ["data-variant"] });
|
|
18604
18611
|
cleanup(() => {
|
|
18605
18612
|
observer.disconnect();
|
|
18606
18613
|
});
|
|
@@ -18627,12 +18634,11 @@ function avatar_default(Alpine) {
|
|
|
18627
18634
|
"bg-secondary",
|
|
18628
18635
|
"text-secondary-foreground",
|
|
18629
18636
|
"fill-secondary-foreground",
|
|
18630
|
-
"hover:bg-secondary-hover",
|
|
18631
|
-
"active:bg-secondary-active",
|
|
18632
18637
|
"[[data-slot=toolbar]:not([data-variant=transparent])_&]:border",
|
|
18633
18638
|
"has-[img]:border-0",
|
|
18634
18639
|
"flex",
|
|
18635
18640
|
"size-8",
|
|
18641
|
+
"aspect-square",
|
|
18636
18642
|
"shrink-0",
|
|
18637
18643
|
"overflow-hidden",
|
|
18638
18644
|
"rounded-full",
|
|
@@ -18645,6 +18651,9 @@ function avatar_default(Alpine) {
|
|
|
18645
18651
|
el._avatar = Alpine2.reactive({
|
|
18646
18652
|
fallback: false
|
|
18647
18653
|
});
|
|
18654
|
+
if (el.tagName === "BUTTON") {
|
|
18655
|
+
el.classList.add("cursor-pointer", "hover:bg-secondary-hover", "active:bg-secondary-active");
|
|
18656
|
+
}
|
|
18648
18657
|
});
|
|
18649
18658
|
Alpine.directive("h-avatar-image", (el, {}, { cleanup }) => {
|
|
18650
18659
|
const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_avatar"));
|
|
@@ -18672,13 +18681,11 @@ function avatar_default(Alpine) {
|
|
|
18672
18681
|
interval = setInterval(completeCheck, 10);
|
|
18673
18682
|
}
|
|
18674
18683
|
const observer = new MutationObserver((mutations) => {
|
|
18675
|
-
mutations.forEach((
|
|
18676
|
-
|
|
18677
|
-
if (mutation.attributeName === "src") interval = setInterval(completeCheck, 10);
|
|
18678
|
-
}
|
|
18684
|
+
mutations.forEach(() => {
|
|
18685
|
+
interval = setInterval(completeCheck, 10);
|
|
18679
18686
|
});
|
|
18680
18687
|
});
|
|
18681
|
-
observer.observe(el, { attributes: true });
|
|
18688
|
+
observer.observe(el, { attributes: true, attributeFilter: ["src"] });
|
|
18682
18689
|
cleanup(() => {
|
|
18683
18690
|
if (interval) clearInterval(interval);
|
|
18684
18691
|
observer.disconnect();
|
|
@@ -18721,12 +18728,6 @@ function badge_default(Alpine) {
|
|
|
18721
18728
|
"focus-visible:border-ring",
|
|
18722
18729
|
"focus-visible:ring-ring/50",
|
|
18723
18730
|
"focus-visible:ring-[3px]",
|
|
18724
|
-
"aria-invalid:ring-negative/20",
|
|
18725
|
-
"dark:aria-invalid:ring-negative/40",
|
|
18726
|
-
"aria-invalid:border-negative",
|
|
18727
|
-
"invalid:ring-negative/20",
|
|
18728
|
-
"dark:invalid:ring-negative/40",
|
|
18729
|
-
"invalid:border-negative",
|
|
18730
18731
|
"transition-[color,box-shadow]",
|
|
18731
18732
|
"overflow-hidden"
|
|
18732
18733
|
);
|
|
@@ -18748,13 +18749,11 @@ function badge_default(Alpine) {
|
|
|
18748
18749
|
}
|
|
18749
18750
|
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
18750
18751
|
const observer = new MutationObserver((mutations) => {
|
|
18751
|
-
mutations.forEach((
|
|
18752
|
-
|
|
18753
|
-
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
18754
|
-
}
|
|
18752
|
+
mutations.forEach(() => {
|
|
18753
|
+
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
18755
18754
|
});
|
|
18756
18755
|
});
|
|
18757
|
-
observer.observe(el, { attributes: true });
|
|
18756
|
+
observer.observe(el, { attributes: true, attributeFilter: ["data-variant"] });
|
|
18758
18757
|
cleanup(() => {
|
|
18759
18758
|
observer.disconnect();
|
|
18760
18759
|
});
|
|
@@ -18762,82 +18761,155 @@ function badge_default(Alpine) {
|
|
|
18762
18761
|
}
|
|
18763
18762
|
|
|
18764
18763
|
// src/components/button.js
|
|
18764
|
+
var buttonVariants = {
|
|
18765
|
+
default: [
|
|
18766
|
+
"bg-secondary",
|
|
18767
|
+
"text-secondary-foreground",
|
|
18768
|
+
"shadow-control",
|
|
18769
|
+
"hover:bg-secondary-hover",
|
|
18770
|
+
"active:bg-secondary-active",
|
|
18771
|
+
"aria-pressed:bg-secondary-active",
|
|
18772
|
+
"active:data-[toggled=true]:bg-secondary-active",
|
|
18773
|
+
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
18774
|
+
"data-[toggled=true]:bg-secondary-active"
|
|
18775
|
+
],
|
|
18776
|
+
primary: [
|
|
18777
|
+
"bg-primary",
|
|
18778
|
+
"text-primary-foreground",
|
|
18779
|
+
"shadow-control",
|
|
18780
|
+
"hover:bg-primary-hover",
|
|
18781
|
+
"active:bg-primary-active",
|
|
18782
|
+
"aria-pressed:bg-primary-active",
|
|
18783
|
+
"active:data-[toggled=true]:bg-primary-active",
|
|
18784
|
+
"hover:data-[toggled=true]:bg-primary-hover",
|
|
18785
|
+
"data-[toggled=true]:bg-primary-active"
|
|
18786
|
+
],
|
|
18787
|
+
positive: [
|
|
18788
|
+
"bg-positive",
|
|
18789
|
+
"text-positive-foreground",
|
|
18790
|
+
"shadow-control",
|
|
18791
|
+
"hover:bg-positive-hover",
|
|
18792
|
+
"active:bg-positive-active",
|
|
18793
|
+
"aria-pressed:bg-positive-active",
|
|
18794
|
+
"active:data-[toggled=true]:bg-positive-active",
|
|
18795
|
+
"hover:data-[toggled=true]:bg-positive-hover",
|
|
18796
|
+
"data-[toggled=true]:bg-positive-active"
|
|
18797
|
+
],
|
|
18798
|
+
negative: [
|
|
18799
|
+
"bg-negative",
|
|
18800
|
+
"text-negative-foreground",
|
|
18801
|
+
"shadow-control",
|
|
18802
|
+
"hover:bg-negative-hover",
|
|
18803
|
+
"active:bg-negative-active",
|
|
18804
|
+
"aria-pressed:bg-negative-active",
|
|
18805
|
+
"active:data-[toggled=true]:bg-negative-active",
|
|
18806
|
+
"hover:data-[toggled=true]:bg-negative-hover",
|
|
18807
|
+
"data-[toggled=true]:bg-negative-active"
|
|
18808
|
+
],
|
|
18809
|
+
warning: [
|
|
18810
|
+
"bg-warning",
|
|
18811
|
+
"text-warning-foreground",
|
|
18812
|
+
"shadow-control",
|
|
18813
|
+
"hover:bg-warning-hover",
|
|
18814
|
+
"active:bg-warning-active",
|
|
18815
|
+
"aria-pressed:bg-warning-active",
|
|
18816
|
+
"active:data-[toggled=true]:bg-warning-active",
|
|
18817
|
+
"hover:data-[toggled=true]:bg-warning-hover",
|
|
18818
|
+
"data-[toggled=true]:bg-warning-active"
|
|
18819
|
+
],
|
|
18820
|
+
outline: [
|
|
18821
|
+
"border",
|
|
18822
|
+
"bg-background",
|
|
18823
|
+
"text-foreground",
|
|
18824
|
+
"hover:bg-secondary",
|
|
18825
|
+
"hover:text-secondary-foreground",
|
|
18826
|
+
"active:bg-secondary-active",
|
|
18827
|
+
"aria-pressed:bg-secondary-active",
|
|
18828
|
+
"active:data-[toggled=true]:bg-secondary-active",
|
|
18829
|
+
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
18830
|
+
"data-[toggled=true]:bg-secondary-active"
|
|
18831
|
+
],
|
|
18832
|
+
transparent: [
|
|
18833
|
+
"bg-transparent",
|
|
18834
|
+
"text-foreground",
|
|
18835
|
+
"shadow-none",
|
|
18836
|
+
"hover:bg-secondary",
|
|
18837
|
+
"hover:text-secondary-foreground",
|
|
18838
|
+
"active:bg-secondary-active",
|
|
18839
|
+
"aria-pressed:bg-secondary-active",
|
|
18840
|
+
"active:data-[toggled=true]:bg-secondary-active",
|
|
18841
|
+
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
18842
|
+
"data-[toggled=true]:bg-secondary-active"
|
|
18843
|
+
],
|
|
18844
|
+
link: ["text-primary", "underline-offset-4", "hover:underline"]
|
|
18845
|
+
};
|
|
18846
|
+
var setButtonClasses = (el) => {
|
|
18847
|
+
el.classList.add(
|
|
18848
|
+
"cursor-pointer",
|
|
18849
|
+
"inline-flex",
|
|
18850
|
+
"items-center",
|
|
18851
|
+
"justify-center",
|
|
18852
|
+
"gap-2",
|
|
18853
|
+
"whitespace-nowrap",
|
|
18854
|
+
"rounded-control",
|
|
18855
|
+
"text-sm",
|
|
18856
|
+
"font-medium",
|
|
18857
|
+
"transition-all",
|
|
18858
|
+
"disabled:pointer-events-none",
|
|
18859
|
+
"disabled:opacity-50",
|
|
18860
|
+
"[&_svg]:pointer-events-none",
|
|
18861
|
+
"[&_svg:not([class*='size-'])]:size-4",
|
|
18862
|
+
"shrink-0",
|
|
18863
|
+
"[&_svg]:shrink-0",
|
|
18864
|
+
"outline-none",
|
|
18865
|
+
"focus-visible:border-ring",
|
|
18866
|
+
"focus-visible:ring-ring/50",
|
|
18867
|
+
"focus-visible:ring-[3px]",
|
|
18868
|
+
"aria-invalid:ring-negative/20",
|
|
18869
|
+
"dark:aria-invalid:ring-negative/40",
|
|
18870
|
+
"aria-invalid:border-negative",
|
|
18871
|
+
"invalid:!ring-negative/20",
|
|
18872
|
+
"dark:invalid:!ring-negative/40",
|
|
18873
|
+
"invalid:!border-negative"
|
|
18874
|
+
);
|
|
18875
|
+
};
|
|
18876
|
+
var getButtonSize = (size3, inGroup = false) => {
|
|
18877
|
+
switch (size3) {
|
|
18878
|
+
case "xs":
|
|
18879
|
+
return inGroup ? ["h-6", "gap-1", "px-2", "[&>svg:not([class*='size-'])]:size-3.5", "has-[>svg]:px-2"] : ["h-6.5", "gap-1.5", "px-2.5", "has-[>svg]:px-2.5"];
|
|
18880
|
+
case "sm":
|
|
18881
|
+
return inGroup ? ["h-8", "px-2.5", "gap-1.5", "has-[>svg]:px-2.5"] : ["h-8", "gap-1.5", "px-3", "has-[>svg]:px-2.5"];
|
|
18882
|
+
case "lg":
|
|
18883
|
+
return ["h-10", "px-6", "has-[>svg]:px-4"];
|
|
18884
|
+
case "icon-xs":
|
|
18885
|
+
return inGroup ? ["size-6", "p-0", "has-[>svg]:p-0"] : ["size-6.5"];
|
|
18886
|
+
case "icon-sm":
|
|
18887
|
+
return inGroup ? ["size-8", "p-0", "has-[>svg]:p-0"] : ["size-8"];
|
|
18888
|
+
case "icon":
|
|
18889
|
+
return ["size-9"];
|
|
18890
|
+
case "icon-lg":
|
|
18891
|
+
return ["size-10"];
|
|
18892
|
+
default:
|
|
18893
|
+
return ["h-9", "px-4", "py-2", "has-[>svg]:px-3"];
|
|
18894
|
+
}
|
|
18895
|
+
};
|
|
18765
18896
|
function button_default(Alpine) {
|
|
18766
18897
|
Alpine.directive("h-button", (el, { modifiers }, { cleanup }) => {
|
|
18767
|
-
el
|
|
18768
|
-
"cursor-pointer",
|
|
18769
|
-
"inline-flex",
|
|
18770
|
-
"items-center",
|
|
18771
|
-
"justify-center",
|
|
18772
|
-
"gap-2",
|
|
18773
|
-
"whitespace-nowrap",
|
|
18774
|
-
"rounded-control",
|
|
18775
|
-
"text-sm",
|
|
18776
|
-
"font-medium",
|
|
18777
|
-
"transition-all",
|
|
18778
|
-
"disabled:pointer-events-none",
|
|
18779
|
-
"disabled:opacity-50",
|
|
18780
|
-
"[&_svg]:pointer-events-none",
|
|
18781
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
18782
|
-
"shrink-0",
|
|
18783
|
-
"[&_svg]:shrink-0",
|
|
18784
|
-
"outline-none",
|
|
18785
|
-
"focus-visible:border-ring",
|
|
18786
|
-
"focus-visible:ring-ring/50",
|
|
18787
|
-
"focus-visible:ring-[3px]",
|
|
18788
|
-
"aria-invalid:ring-negative/20",
|
|
18789
|
-
"dark:aria-invalid:ring-negative/40",
|
|
18790
|
-
"aria-invalid:border-negative",
|
|
18791
|
-
"invalid:ring-negative/20",
|
|
18792
|
-
"dark:invalid:ring-negative/40",
|
|
18793
|
-
"invalid:border-negative"
|
|
18794
|
-
);
|
|
18898
|
+
setButtonClasses(el);
|
|
18795
18899
|
if (!el.hasAttribute("data-slot")) {
|
|
18796
18900
|
el.setAttribute("data-slot", "button");
|
|
18797
18901
|
}
|
|
18798
18902
|
const inGroup = modifiers.includes("group");
|
|
18799
|
-
const variants = {
|
|
18800
|
-
default: ["bg-secondary", "text-secondary-foreground", "shadow-control", "hover:bg-secondary-hover", "active:bg-secondary-active", "aria-pressed:bg-secondary-active"],
|
|
18801
|
-
primary: ["bg-primary", "text-primary-foreground", "shadow-control", "hover:bg-primary-hover", "active:bg-primary-active", "aria-pressed:bg-primary-active"],
|
|
18802
|
-
positive: ["bg-positive", "text-positive-foreground", "shadow-control", "hover:bg-positive-hover", "active:bg-positive-active", "aria-pressed:bg-positive-active"],
|
|
18803
|
-
negative: ["bg-negative", "text-negative-foreground", "shadow-control", "hover:bg-negative-hover", "active:bg-negative-active", "aria-pressed:bg-negative-active"],
|
|
18804
|
-
warning: ["bg-warning", "text-warning-foreground", "shadow-control", "hover:bg-warning-hover", "active:bg-warning-active", "aria-pressed:bg-warning-active"],
|
|
18805
|
-
outline: ["border", "bg-background", "text-foreground", "shadow-none", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active", "aria-pressed:bg-secondary-active"],
|
|
18806
|
-
transparent: ["bg-transparent", "text-foreground", "shadow-none", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active", "aria-pressed:bg-secondary-active"],
|
|
18807
|
-
link: ["text-primary", "underline-offset-4", "hover:underline"]
|
|
18808
|
-
};
|
|
18809
|
-
const sizes = {
|
|
18810
|
-
default: ["h-9", "px-4", "py-2", "has-[>svg]:px-3"],
|
|
18811
|
-
xs: inGroup ? ["h-6", "gap-1", "px-2", "[&>svg:not([class*='size-'])]:size-3.5", "has-[>svg]:px-2"] : ["h-6.5", "gap-1.5", "px-2.5", "has-[>svg]:px-2.5"],
|
|
18812
|
-
sm: inGroup ? ["h-8", "px-2.5", "gap-1.5", "has-[>svg]:px-2.5"] : ["h-8", "gap-1.5", "px-3", "has-[>svg]:px-2.5"],
|
|
18813
|
-
lg: ["h-10", "px-6", "has-[>svg]:px-4"],
|
|
18814
|
-
"icon-xs": inGroup ? ["size-6", "p-0", "has-[>svg]:p-0"] : ["size-6.5"],
|
|
18815
|
-
"icon-sm": inGroup ? ["size-8", "p-0", "has-[>svg]:p-0"] : ["size-8"],
|
|
18816
|
-
icon: ["size-9"],
|
|
18817
|
-
"icon-lg": ["size-10"],
|
|
18818
|
-
"icon-tab": [
|
|
18819
|
-
"group-data-[orientation=horizontal]/tabs:aspect-square",
|
|
18820
|
-
"group-data-[orientation=horizontal]/tabs:w-auto",
|
|
18821
|
-
"group-data-[style=float]/tab-bar:group-data-[orientation=horizontal]/tabs:h-full",
|
|
18822
|
-
"group-data-[style=inline]/tab-bar:group-data-[orientation=horizontal]/tabs:h-[80%]",
|
|
18823
|
-
"group-data-[orientation=vertical]/tabs:h-9",
|
|
18824
|
-
"group-data-[style=float]/tab-bar:group-data-[orientation=vertical]/tabs:w-full",
|
|
18825
|
-
"group-data-[style=inline]/tab-bar:group-data-[orientation=vertical]/tabs:w-[80%]"
|
|
18826
|
-
]
|
|
18827
|
-
};
|
|
18828
18903
|
function setVariant(variant) {
|
|
18829
|
-
for (const [_, value] of Object.entries(
|
|
18904
|
+
for (const [_, value] of Object.entries(buttonVariants)) {
|
|
18830
18905
|
el.classList.remove(...value);
|
|
18831
18906
|
}
|
|
18832
|
-
if (
|
|
18907
|
+
if (buttonVariants.hasOwnProperty(variant)) el.classList.add(...buttonVariants[variant]);
|
|
18833
18908
|
}
|
|
18834
18909
|
function setSize(size3) {
|
|
18835
|
-
|
|
18836
|
-
|
|
18837
|
-
|
|
18838
|
-
if (size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
18839
|
-
console.error('h-button: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute', el);
|
|
18840
|
-
}
|
|
18910
|
+
el.classList.add(...getButtonSize(size3, inGroup));
|
|
18911
|
+
if (size3 && size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
18912
|
+
console.error('h-button: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute', el);
|
|
18841
18913
|
}
|
|
18842
18914
|
}
|
|
18843
18915
|
setVariant(el.getAttribute("data-variant") ?? "default");
|
|
@@ -18852,19 +18924,17 @@ function button_default(Alpine) {
|
|
|
18852
18924
|
if (["date-picker-trigger", "time-picker-trigger"].includes(el.getAttribute("data-slot"))) {
|
|
18853
18925
|
setSize("icon-xs");
|
|
18854
18926
|
} else {
|
|
18855
|
-
setSize(
|
|
18927
|
+
setSize();
|
|
18856
18928
|
}
|
|
18857
18929
|
}
|
|
18858
18930
|
}
|
|
18859
18931
|
const observer = new MutationObserver((mutations) => {
|
|
18860
18932
|
mutations.forEach((mutation) => {
|
|
18861
|
-
if (mutation.
|
|
18862
|
-
|
|
18863
|
-
else if (mutation.attributeName === "data-size") setSize(el.getAttribute("data-size") ?? (inGroup ? "xs" : "default"));
|
|
18864
|
-
}
|
|
18933
|
+
if (mutation.attributeName === "data-variant") setVariant(el.getAttribute("data-variant") ?? "default");
|
|
18934
|
+
else setSize(el.getAttribute("data-size") ?? (inGroup ? "xs" : "default"));
|
|
18865
18935
|
});
|
|
18866
18936
|
});
|
|
18867
|
-
observer.observe(el, { attributes: true });
|
|
18937
|
+
observer.observe(el, { attributes: true, attributeFilter: ["data-variant", "data-size"] });
|
|
18868
18938
|
cleanup(() => {
|
|
18869
18939
|
observer.disconnect();
|
|
18870
18940
|
});
|
|
@@ -18895,10 +18965,6 @@ function button_default(Alpine) {
|
|
|
18895
18965
|
}
|
|
18896
18966
|
setVariant(el.getAttribute("data-orientation") ?? "horizontal");
|
|
18897
18967
|
});
|
|
18898
|
-
Alpine.directive("h-button-group-text", (el) => {
|
|
18899
|
-
el.classList.add("bg-muted", "flex", "items-center", "gap-2", "rounded-control", "border", "px-4", "text-sm", "font-medium", "shadow-xs", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
|
|
18900
|
-
el.setAttribute("data-slot", "button-group-text");
|
|
18901
|
-
});
|
|
18902
18968
|
Alpine.directive("h-button-group-separator", (el) => {
|
|
18903
18969
|
el.classList.add("bg-foreground/20", "shrink-0", "[[data-orientation=vertical]_&]:h-px", "[[data-orientation=vertical]_&]:w-full", "h-auto", "w-px", "relative", "!m-0", "self-stretch");
|
|
18904
18970
|
el.setAttribute("role", "none");
|
|
@@ -18906,9 +18972,6 @@ function button_default(Alpine) {
|
|
|
18906
18972
|
});
|
|
18907
18973
|
}
|
|
18908
18974
|
|
|
18909
|
-
// src/components/calendar.js
|
|
18910
|
-
var import_lucide2 = __toESM(require_lucide(), 1);
|
|
18911
|
-
|
|
18912
18975
|
// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
18913
18976
|
var min = Math.min;
|
|
18914
18977
|
var max = Math.max;
|
|
@@ -20388,6 +20451,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
20388
20451
|
};
|
|
20389
20452
|
|
|
20390
20453
|
// src/components/calendar.js
|
|
20454
|
+
var import_lucide2 = __toESM(require_lucide(), 1);
|
|
20391
20455
|
function calendar_default(Alpine) {
|
|
20392
20456
|
Alpine.directive("h-calendar", (el, { expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
|
|
20393
20457
|
const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_datepicker"));
|
|
@@ -20411,7 +20475,7 @@ function calendar_default(Alpine) {
|
|
|
20411
20475
|
let firstDay = 0;
|
|
20412
20476
|
let minDate = void 0;
|
|
20413
20477
|
let maxDate = void 0;
|
|
20414
|
-
function modelChange() {
|
|
20478
|
+
function modelChange(triggerInput = false) {
|
|
20415
20479
|
Alpine2.nextTick(() => {
|
|
20416
20480
|
el.dispatchEvent(new CustomEvent("change", { detail: { date: selected } }));
|
|
20417
20481
|
});
|
|
@@ -20424,23 +20488,27 @@ function calendar_default(Alpine) {
|
|
|
20424
20488
|
}
|
|
20425
20489
|
if (datepicker) {
|
|
20426
20490
|
datepicker._datepicker.input.value = formatter.format(selected);
|
|
20491
|
+
datepicker._datepicker.input.setCustomValidity("");
|
|
20492
|
+
if (triggerInput) datepicker._datepicker.input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
20427
20493
|
} else {
|
|
20428
20494
|
el.setAttribute("data-invalid", "false");
|
|
20429
20495
|
}
|
|
20430
20496
|
}
|
|
20431
|
-
|
|
20432
|
-
datepicker._datepicker.input.
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20439
|
-
datepicker._datepicker.input.setCustomValidity("");
|
|
20440
|
-
}
|
|
20497
|
+
const onInputChange = () => {
|
|
20498
|
+
const newValue = new Date(datepicker._datepicker.input.value);
|
|
20499
|
+
if (isNaN(newValue)) {
|
|
20500
|
+
console.error(`h-calendar: input value is not a valid date - ${datepicker._datepicker.input.value}`);
|
|
20501
|
+
datepicker._datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
20502
|
+
return;
|
|
20503
|
+
} else if (selected.getTime() !== newValue.getTime()) {
|
|
20504
|
+
selected = newValue;
|
|
20441
20505
|
modelChange();
|
|
20442
20506
|
render();
|
|
20443
|
-
}
|
|
20507
|
+
}
|
|
20508
|
+
datepicker._datepicker.input.setCustomValidity("");
|
|
20509
|
+
};
|
|
20510
|
+
if (datepicker) {
|
|
20511
|
+
datepicker._datepicker.input.addEventListener("change", onInputChange);
|
|
20444
20512
|
}
|
|
20445
20513
|
function checkForModel() {
|
|
20446
20514
|
if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
|
|
@@ -20458,7 +20526,7 @@ function calendar_default(Alpine) {
|
|
|
20458
20526
|
if (event.target.getAttribute("aria-disabled") === "true") return;
|
|
20459
20527
|
focusedDay = new Date(event.target.dataset.year, event.target.dataset.month, event.target.dataset.day);
|
|
20460
20528
|
selected = new Date(focusedDay);
|
|
20461
|
-
modelChange();
|
|
20529
|
+
modelChange(true);
|
|
20462
20530
|
render();
|
|
20463
20531
|
if (datepicker) datepicker._datepicker.expanded = false;
|
|
20464
20532
|
}
|
|
@@ -20621,7 +20689,7 @@ function calendar_default(Alpine) {
|
|
|
20621
20689
|
"align-middle",
|
|
20622
20690
|
"text-center",
|
|
20623
20691
|
"size-8",
|
|
20624
|
-
"rounded-
|
|
20692
|
+
"rounded-control",
|
|
20625
20693
|
"outline-none",
|
|
20626
20694
|
"hover:bg-secondary-hover",
|
|
20627
20695
|
"hover:text-secondary-foreground",
|
|
@@ -20837,6 +20905,9 @@ function calendar_default(Alpine) {
|
|
|
20837
20905
|
for (let d = 0; d < dayCells.length; d++) {
|
|
20838
20906
|
dayCells[d].removeEventListener("click", dayClick);
|
|
20839
20907
|
}
|
|
20908
|
+
if (datepicker) {
|
|
20909
|
+
datepicker._datepicker.input.removeEventListener("change", onInputChange);
|
|
20910
|
+
}
|
|
20840
20911
|
});
|
|
20841
20912
|
});
|
|
20842
20913
|
}
|
|
@@ -20844,7 +20915,7 @@ function calendar_default(Alpine) {
|
|
|
20844
20915
|
// src/components/card.js
|
|
20845
20916
|
function card_default(Alpine) {
|
|
20846
20917
|
Alpine.directive("h-card", (el) => {
|
|
20847
|
-
el.classList.add("bg-card", "text-card-foreground", "vbox", "gap-
|
|
20918
|
+
el.classList.add("bg-card", "text-card-foreground", "vbox", "gap-4", "rounded-xl", "border", "py-6", "shadow-sm");
|
|
20848
20919
|
el.setAttribute("data-slot", "card");
|
|
20849
20920
|
});
|
|
20850
20921
|
Alpine.directive("h-card-header", (el) => {
|
|
@@ -20875,56 +20946,58 @@ function card_default(Alpine) {
|
|
|
20875
20946
|
|
|
20876
20947
|
// src/components/checkbox.js
|
|
20877
20948
|
function checkbox_default(Alpine) {
|
|
20878
|
-
Alpine.directive("h-checkbox", (el
|
|
20949
|
+
Alpine.directive("h-checkbox", (el) => {
|
|
20879
20950
|
el.classList.add(
|
|
20880
|
-
"
|
|
20881
|
-
"
|
|
20882
|
-
"bg-
|
|
20883
|
-
"
|
|
20884
|
-
"
|
|
20885
|
-
"
|
|
20886
|
-
"focus-visible:
|
|
20887
|
-
"focus-visible:ring-ring/50",
|
|
20888
|
-
"
|
|
20889
|
-
"
|
|
20890
|
-
"
|
|
20891
|
-
"
|
|
20892
|
-
"
|
|
20893
|
-
"
|
|
20894
|
-
"size-4",
|
|
20895
|
-
"shrink-0",
|
|
20896
|
-
"rounded-[4px]",
|
|
20897
|
-
"border",
|
|
20898
|
-
"shadow-control",
|
|
20899
|
-
"transition-all",
|
|
20900
|
-
"outline-none",
|
|
20901
|
-
"focus-visible:ring-[3px]",
|
|
20902
|
-
"disabled:cursor-not-allowed",
|
|
20903
|
-
"disabled:opacity-50",
|
|
20904
|
-
"overflow-hidden",
|
|
20905
|
-
"before:block",
|
|
20951
|
+
"[&>input]:absolute",
|
|
20952
|
+
"[&>input]:appearance-none",
|
|
20953
|
+
"[&>input]:bg-transparent",
|
|
20954
|
+
"[&>input]:border-0",
|
|
20955
|
+
"[&>input]:cursor-pointer",
|
|
20956
|
+
"[&>input]:focus-visible:border-ring",
|
|
20957
|
+
"[&>input]:focus-visible:ring-[3px]",
|
|
20958
|
+
"[&>input]:focus-visible:ring-ring/50",
|
|
20959
|
+
"[&>input]:left-0",
|
|
20960
|
+
"[&>input]:outline-none",
|
|
20961
|
+
"[&>input]:rounded-[0.25rem]",
|
|
20962
|
+
"[&>input]:size-full",
|
|
20963
|
+
"[&>input]:top-0",
|
|
20964
|
+
"aspect-square",
|
|
20906
20965
|
"before:bg-transparent",
|
|
20907
|
-
"before:
|
|
20966
|
+
"before:block",
|
|
20908
20967
|
"before:border-b-2",
|
|
20968
|
+
"before:border-l-2",
|
|
20909
20969
|
"before:border-primary-foreground",
|
|
20970
|
+
"before:h-2",
|
|
20971
|
+
"before:invisible",
|
|
20910
20972
|
"before:pointer-events-none",
|
|
20911
|
-
"before:w-2.5",
|
|
20912
|
-
"before:h-1.5",
|
|
20913
|
-
"before:rounded-[0.125rem]",
|
|
20914
20973
|
"before:-rotate-45",
|
|
20915
20974
|
"before:translate-x-0.5",
|
|
20916
20975
|
"before:translate-y-0.75",
|
|
20917
|
-
"
|
|
20976
|
+
"before:w-3.5",
|
|
20977
|
+
"bg-input-inner",
|
|
20978
|
+
"border",
|
|
20979
|
+
"border-input",
|
|
20980
|
+
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
20981
|
+
"dark:has-[input:invalid]:ring-negative/40",
|
|
20982
|
+
"duration-200",
|
|
20983
|
+
"has-[aria-invalid=true]:border-negative",
|
|
20984
|
+
"has-[aria-invalid=true]:ring-negative/20",
|
|
20985
|
+
"has-[input:checked]:before:visible",
|
|
20986
|
+
"has-[input:checked]:bg-primary",
|
|
20987
|
+
"has-[input:checked]:border-primary",
|
|
20988
|
+
"has-[input:disabled]:cursor-not-allowed",
|
|
20989
|
+
"has-[input:disabled]:opacity-50",
|
|
20990
|
+
"has-[input:invalid]:border-negative",
|
|
20991
|
+
"has-[input:invalid]:ring-negative/20",
|
|
20992
|
+
"relative",
|
|
20993
|
+
"rounded-[0.25rem]",
|
|
20994
|
+
"shadow-control",
|
|
20995
|
+
"shrink-0",
|
|
20996
|
+
"size-5",
|
|
20997
|
+
"transition-color"
|
|
20918
20998
|
);
|
|
20999
|
+
el.setAttribute("tabindex", "-1");
|
|
20919
21000
|
el.setAttribute("data-slot", "checkbox");
|
|
20920
|
-
function setState() {
|
|
20921
|
-
el.setAttribute("data-state", el.checked ? "checked" : "unchecked");
|
|
20922
|
-
}
|
|
20923
|
-
setState();
|
|
20924
|
-
el.addEventListener("change", setState);
|
|
20925
|
-
cleanup(() => {
|
|
20926
|
-
el.removeEventListener("change", setState);
|
|
20927
|
-
});
|
|
20928
21001
|
});
|
|
20929
21002
|
}
|
|
20930
21003
|
|
|
@@ -21009,6 +21082,7 @@ function datepicker_default(Alpine) {
|
|
|
21009
21082
|
"border",
|
|
21010
21083
|
"shadow-control",
|
|
21011
21084
|
"transition-[color,box-shadow]",
|
|
21085
|
+
"duration-200",
|
|
21012
21086
|
"outline-none",
|
|
21013
21087
|
"h-9",
|
|
21014
21088
|
"pl-3",
|
|
@@ -21088,8 +21162,8 @@ function dialog_default(Alpine) {
|
|
|
21088
21162
|
el.setAttribute("tabindex", "-1");
|
|
21089
21163
|
el.setAttribute("data-slot", "dialog-overlay");
|
|
21090
21164
|
const observer = new MutationObserver((mutations) => {
|
|
21091
|
-
mutations.forEach((
|
|
21092
|
-
if (
|
|
21165
|
+
mutations.forEach(() => {
|
|
21166
|
+
if (el.getAttribute("data-open") === "true") {
|
|
21093
21167
|
const inputs = el.getElementsByTagName("INPUT");
|
|
21094
21168
|
if (inputs.length) {
|
|
21095
21169
|
for (let i = 0; i < inputs.length; i++) {
|
|
@@ -21108,7 +21182,7 @@ function dialog_default(Alpine) {
|
|
|
21108
21182
|
}
|
|
21109
21183
|
});
|
|
21110
21184
|
});
|
|
21111
|
-
observer.observe(el, { attributes: true });
|
|
21185
|
+
observer.observe(el, { attributes: true, attributeFilter: ["data-open"] });
|
|
21112
21186
|
cleanup(() => {
|
|
21113
21187
|
observer.disconnect();
|
|
21114
21188
|
});
|
|
@@ -21130,7 +21204,7 @@ function dialog_default(Alpine) {
|
|
|
21130
21204
|
"rounded-lg",
|
|
21131
21205
|
"border",
|
|
21132
21206
|
"p-4",
|
|
21133
|
-
"shadow-
|
|
21207
|
+
"shadow-xl",
|
|
21134
21208
|
"sm:max-w-lg"
|
|
21135
21209
|
);
|
|
21136
21210
|
el.setAttribute("role", "dialog");
|
|
@@ -21288,7 +21362,7 @@ function info_page_default(Alpine) {
|
|
|
21288
21362
|
el.setAttribute("data-slot", "info-page-header");
|
|
21289
21363
|
});
|
|
21290
21364
|
Alpine.directive("h-info-page-media", (el, { modifiers }) => {
|
|
21291
|
-
el.classList.add("hbox", "shrink-0", "items-center", "justify-center", "
|
|
21365
|
+
el.classList.add("hbox", "shrink-0", "items-center", "justify-center", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0");
|
|
21292
21366
|
if (modifiers.includes("icon")) el.classList.add("bg-muted", "text-foreground", "size-10", "shrink-0", "items-center", "justify-center", "rounded-lg", "[&_svg:not([class*='size-'])]:size-6");
|
|
21293
21367
|
else el.classList.add("bg-transparent");
|
|
21294
21368
|
el.setAttribute("data-slot", "info-page-media");
|
|
@@ -21348,9 +21422,9 @@ function input_default(Alpine) {
|
|
|
21348
21422
|
"aria-invalid:ring-negative/20",
|
|
21349
21423
|
"dark:aria-invalid:ring-negative/40",
|
|
21350
21424
|
"aria-invalid:border-negative",
|
|
21351
|
-
"invalid
|
|
21352
|
-
"dark:invalid
|
|
21353
|
-
"invalid
|
|
21425
|
+
"invalid:!ring-negative/20",
|
|
21426
|
+
"dark:invalid:!ring-negative/40",
|
|
21427
|
+
"invalid:!border-negative"
|
|
21354
21428
|
);
|
|
21355
21429
|
if (modifiers.includes("group")) {
|
|
21356
21430
|
el.classList.remove("rounded-control", "border", "bg-input-inner", "shadow-control", "focus-visible:ring-[3px]");
|
|
@@ -21481,6 +21555,156 @@ function label_default(Alpine) {
|
|
|
21481
21555
|
});
|
|
21482
21556
|
}
|
|
21483
21557
|
|
|
21558
|
+
// src/components/list.js
|
|
21559
|
+
function list_default(Alpine) {
|
|
21560
|
+
Alpine.directive("h-listbox", (el, {}, { cleanup }) => {
|
|
21561
|
+
el.classList.add(
|
|
21562
|
+
"divide-solid",
|
|
21563
|
+
"divide-y",
|
|
21564
|
+
"bg-input-inner",
|
|
21565
|
+
"border-input",
|
|
21566
|
+
"border",
|
|
21567
|
+
"rounded-control",
|
|
21568
|
+
"shadow-control",
|
|
21569
|
+
"outline-none",
|
|
21570
|
+
"disabled:pointer-events-none",
|
|
21571
|
+
"disabled:cursor-not-allowed",
|
|
21572
|
+
"disabled:opacity-50",
|
|
21573
|
+
"focus-visible:border-ring",
|
|
21574
|
+
"focus-visible:ring-ring/50",
|
|
21575
|
+
"focus-visible:ring-[3px]",
|
|
21576
|
+
"aria-invalid:ring-negative/20",
|
|
21577
|
+
"dark:aria-invalid:ring-negative/40",
|
|
21578
|
+
"aria-invalid:border-negative",
|
|
21579
|
+
"invalid:!ring-negative/20",
|
|
21580
|
+
"dark:invalid:!ring-negative/40",
|
|
21581
|
+
"invalid:!border-negative",
|
|
21582
|
+
"[&>ul:first-child>*:first-child]:rounded-t-control",
|
|
21583
|
+
"[&>ul:last-child>*:last-child]:rounded-b-control"
|
|
21584
|
+
);
|
|
21585
|
+
el.setAttribute("data-slot", "listbox");
|
|
21586
|
+
el.setAttribute("role", "listbox");
|
|
21587
|
+
function focusFirstOption(elem) {
|
|
21588
|
+
const firstOption = elem.querySelector('[role="option"]');
|
|
21589
|
+
if (firstOption) firstOption.focus();
|
|
21590
|
+
}
|
|
21591
|
+
function focusLastOption(elem) {
|
|
21592
|
+
const itemList = elem.querySelectorAll('[role="option"]');
|
|
21593
|
+
if (itemList.length) {
|
|
21594
|
+
itemList[itemList.length - 1].focus();
|
|
21595
|
+
}
|
|
21596
|
+
}
|
|
21597
|
+
function selectOption(option) {
|
|
21598
|
+
const selected = el.querySelector('[aria-selected="true"]');
|
|
21599
|
+
if (selected) selected.removeAttribute("aria-selected");
|
|
21600
|
+
if (selected !== option) option.setAttribute("aria-selected", "true");
|
|
21601
|
+
}
|
|
21602
|
+
function onKeyDown(event) {
|
|
21603
|
+
switch (event.key) {
|
|
21604
|
+
case "PageUp":
|
|
21605
|
+
case "PageDown":
|
|
21606
|
+
event.preventDefault();
|
|
21607
|
+
break;
|
|
21608
|
+
case "Home":
|
|
21609
|
+
focusFirstOption(el);
|
|
21610
|
+
break;
|
|
21611
|
+
case "End":
|
|
21612
|
+
focusLastOption(el);
|
|
21613
|
+
break;
|
|
21614
|
+
case "ArrowUp":
|
|
21615
|
+
let prevElem = event.target.previousElementSibling;
|
|
21616
|
+
if (prevElem && prevElem.getAttribute("data-slot") !== "list-header") {
|
|
21617
|
+
prevElem.focus();
|
|
21618
|
+
} else {
|
|
21619
|
+
prevElem = event.target.parentElement.previousElementSibling;
|
|
21620
|
+
if (prevElem && prevElem.tagName === "UL") {
|
|
21621
|
+
focusLastOption(prevElem);
|
|
21622
|
+
}
|
|
21623
|
+
}
|
|
21624
|
+
break;
|
|
21625
|
+
case "ArrowDown":
|
|
21626
|
+
let nextElem = event.target.nextElementSibling;
|
|
21627
|
+
if (nextElem) {
|
|
21628
|
+
nextElem.focus();
|
|
21629
|
+
} else {
|
|
21630
|
+
nextElem = event.target.parentElement.nextElementSibling;
|
|
21631
|
+
if (nextElem && nextElem.tagName === "UL") {
|
|
21632
|
+
focusFirstOption(nextElem);
|
|
21633
|
+
}
|
|
21634
|
+
}
|
|
21635
|
+
break;
|
|
21636
|
+
case " ":
|
|
21637
|
+
case "Enter":
|
|
21638
|
+
selectOption(event.target);
|
|
21639
|
+
break;
|
|
21640
|
+
default:
|
|
21641
|
+
break;
|
|
21642
|
+
}
|
|
21643
|
+
}
|
|
21644
|
+
function onClick(event) {
|
|
21645
|
+
if (event.target.getAttribute("data-slot") === "list-item") selectOption(event.target);
|
|
21646
|
+
}
|
|
21647
|
+
el.addEventListener("click", onClick);
|
|
21648
|
+
el.addEventListener("keydown", onKeyDown);
|
|
21649
|
+
cleanup(() => {
|
|
21650
|
+
el.removeEventListener("keydown", onKeyDown);
|
|
21651
|
+
el.removeEventListener("click", onClick);
|
|
21652
|
+
});
|
|
21653
|
+
});
|
|
21654
|
+
Alpine.directive("h-list", (el) => {
|
|
21655
|
+
el.classList.add("divide-solid", "divide-y");
|
|
21656
|
+
el.setAttribute("data-slot", "list");
|
|
21657
|
+
el.setAttribute("role", "group");
|
|
21658
|
+
});
|
|
21659
|
+
Alpine.directive("h-list-header", (el, {}, { Alpine: Alpine2 }) => {
|
|
21660
|
+
el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
|
|
21661
|
+
el.setAttribute("role", "presentation");
|
|
21662
|
+
el.setAttribute("data-slot", "list-header");
|
|
21663
|
+
const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
|
|
21664
|
+
if (!list) {
|
|
21665
|
+
throw new Error("h-list-header: must be placed inside an h-list element");
|
|
21666
|
+
}
|
|
21667
|
+
if (el.hasAttribute("id")) {
|
|
21668
|
+
list.setAttribute("aria-labelledby", el.getAttribute("id"));
|
|
21669
|
+
} else {
|
|
21670
|
+
const id = `lbh${v4_default()}`;
|
|
21671
|
+
el.setAttribute("id", id);
|
|
21672
|
+
list.setAttribute("aria-labelledby", id);
|
|
21673
|
+
}
|
|
21674
|
+
});
|
|
21675
|
+
Alpine.directive("h-list-item", (el, { modifiers }) => {
|
|
21676
|
+
el.classList.add("min-h-11", "flex", "items-center", "p-2", "gap-2", "align-middle", "outline-none");
|
|
21677
|
+
el.setAttribute("data-slot", "list-item");
|
|
21678
|
+
const listbox = Alpine.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "listbox");
|
|
21679
|
+
function setInteractive() {
|
|
21680
|
+
el.classList.add(
|
|
21681
|
+
"focus:bg-table-hover",
|
|
21682
|
+
"focus:text-table-hover-foreground",
|
|
21683
|
+
"hover:bg-table-hover",
|
|
21684
|
+
"hover:text-table-hover-foreground",
|
|
21685
|
+
"active:bg-table-active",
|
|
21686
|
+
"active:text-table-active-foreground",
|
|
21687
|
+
"aria-selected:bg-primary",
|
|
21688
|
+
"aria-selected:text-primary-foreground",
|
|
21689
|
+
"[&[aria-selected=true]:hover]:bg-primary-hover",
|
|
21690
|
+
"[&[aria-selected=true]:hover]:text-primary-hover-foreground",
|
|
21691
|
+
"[&[aria-selected=true]:focus]:bg-primary-hover",
|
|
21692
|
+
"[&[aria-selected=true]:focus]:text-primary-hover-foreground"
|
|
21693
|
+
);
|
|
21694
|
+
el.setAttribute("tabindex", "0");
|
|
21695
|
+
}
|
|
21696
|
+
if (listbox) {
|
|
21697
|
+
setInteractive();
|
|
21698
|
+
el.setAttribute("role", "option");
|
|
21699
|
+
el.setAttribute("tabindex", "0");
|
|
21700
|
+
} else if (modifiers.includes("interactive")) {
|
|
21701
|
+
setInteractive();
|
|
21702
|
+
} else {
|
|
21703
|
+
el.setAttribute("tabindex", "-1");
|
|
21704
|
+
}
|
|
21705
|
+
});
|
|
21706
|
+
}
|
|
21707
|
+
|
|
21484
21708
|
// src/components/menu.js
|
|
21485
21709
|
function menu_default(Alpine) {
|
|
21486
21710
|
Alpine.directive("h-menu-trigger", (el, { modifiers }) => {
|
|
@@ -21497,11 +21721,18 @@ function menu_default(Alpine) {
|
|
|
21497
21721
|
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
21498
21722
|
throw new Error('h-menu: must have an "aria-label" or "aria-labelledby" attribute');
|
|
21499
21723
|
}
|
|
21500
|
-
const
|
|
21501
|
-
|
|
21502
|
-
|
|
21724
|
+
const isSubmenu = modifiers.includes("sub");
|
|
21725
|
+
const menuTrigger = (() => {
|
|
21726
|
+
if (isSubmenu) return;
|
|
21727
|
+
let sibling = el.previousElementSibling;
|
|
21728
|
+
while (sibling && !sibling.hasOwnProperty("_menu_trigger")) {
|
|
21729
|
+
sibling = sibling.previousElementSibling;
|
|
21730
|
+
}
|
|
21731
|
+
return sibling;
|
|
21732
|
+
})();
|
|
21733
|
+
if (!isSubmenu && !menuTrigger) {
|
|
21734
|
+
throw new Error("h-menu: menu must be placed after an h-menu-trigger element");
|
|
21503
21735
|
}
|
|
21504
|
-
let isSubmenu = modifiers.includes("sub");
|
|
21505
21736
|
let menuSubItem;
|
|
21506
21737
|
if (isSubmenu) menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
|
|
21507
21738
|
function listenForTrigger(listen) {
|
|
@@ -21560,12 +21791,17 @@ function menu_default(Alpine) {
|
|
|
21560
21791
|
switch (event.key) {
|
|
21561
21792
|
case "Left":
|
|
21562
21793
|
case "ArrowLeft":
|
|
21794
|
+
if (isSubmenu) {
|
|
21795
|
+
Alpine2.nextTick(() => menuSubItem.focus());
|
|
21796
|
+
close();
|
|
21797
|
+
}
|
|
21798
|
+
break;
|
|
21563
21799
|
case "Esc":
|
|
21564
21800
|
case "Escape":
|
|
21565
|
-
close();
|
|
21566
21801
|
if (isSubmenu) {
|
|
21567
|
-
|
|
21802
|
+
Alpine2.nextTick(() => menuSubItem.focus());
|
|
21568
21803
|
}
|
|
21804
|
+
close();
|
|
21569
21805
|
break;
|
|
21570
21806
|
case "Tab":
|
|
21571
21807
|
case " ":
|
|
@@ -21657,16 +21893,19 @@ function menu_default(Alpine) {
|
|
|
21657
21893
|
})
|
|
21658
21894
|
]
|
|
21659
21895
|
}).then(({ x, y }) => {
|
|
21896
|
+
if (!isSubmenu) {
|
|
21897
|
+
Alpine2.nextTick(() => el.focus());
|
|
21898
|
+
listenForTrigger(false);
|
|
21899
|
+
}
|
|
21900
|
+
Alpine2.nextTick(() => {
|
|
21901
|
+
top.addEventListener("contextmenu", onClick);
|
|
21902
|
+
top.addEventListener("click", onClick);
|
|
21903
|
+
el.addEventListener("keydown", onKeydown);
|
|
21904
|
+
});
|
|
21660
21905
|
Object.assign(el.style, {
|
|
21661
21906
|
left: `${x}px`,
|
|
21662
21907
|
top: `${y}px`
|
|
21663
21908
|
});
|
|
21664
|
-
if (!isSubmenu) Alpine2.nextTick(() => el.focus());
|
|
21665
|
-
setTimeout(() => {
|
|
21666
|
-
top.addEventListener("contextmenu", onClick);
|
|
21667
|
-
top.addEventListener("click", onClick);
|
|
21668
|
-
el.addEventListener("keydown", onKeydown);
|
|
21669
|
-
}, 0);
|
|
21670
21909
|
});
|
|
21671
21910
|
}
|
|
21672
21911
|
}
|
|
@@ -21920,27 +22159,19 @@ function menu_default(Alpine) {
|
|
|
21920
22159
|
el.setAttribute("role", "menuitemcheckbox");
|
|
21921
22160
|
el.setAttribute("data-slot", "menu-checkbox-item");
|
|
21922
22161
|
function setState(checked, dispatch = true) {
|
|
21923
|
-
el.setAttribute("aria-checked", checked);
|
|
21924
22162
|
if (dispatch)
|
|
21925
|
-
|
|
22163
|
+
Alpine2.nextTick(() => {
|
|
21926
22164
|
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
21927
|
-
}
|
|
22165
|
+
});
|
|
22166
|
+
el.setAttribute("aria-checked", checked);
|
|
21928
22167
|
}
|
|
21929
22168
|
if (el.hasOwnProperty("_x_model")) {
|
|
21930
|
-
let handler2 = function(
|
|
21931
|
-
if (event.type === "keydown") {
|
|
21932
|
-
if (event.key !== " " && event.key !== "Enter") {
|
|
21933
|
-
return;
|
|
21934
|
-
} else if (event.key === " ") {
|
|
21935
|
-
event.preventDefault();
|
|
21936
|
-
}
|
|
21937
|
-
}
|
|
22169
|
+
let handler2 = function() {
|
|
21938
22170
|
el._x_model.set(!el._x_model.get());
|
|
21939
22171
|
setState(el._x_model.get());
|
|
21940
22172
|
};
|
|
21941
22173
|
setState(el._x_model.get(), false);
|
|
21942
22174
|
el.addEventListener("click", handler2);
|
|
21943
|
-
el.addEventListener("keydown", handler2);
|
|
21944
22175
|
}
|
|
21945
22176
|
const menu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
|
|
21946
22177
|
function focusOut(event) {
|
|
@@ -22146,14 +22377,13 @@ function pagination_default(Alpine) {
|
|
|
22146
22377
|
|
|
22147
22378
|
// src/components/popover.js
|
|
22148
22379
|
function popover_default(Alpine) {
|
|
22149
|
-
Alpine.directive("h-popover", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
22380
|
+
Alpine.directive("h-popover-trigger", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
22150
22381
|
el._popover = Alpine2.reactive({
|
|
22151
22382
|
id: void 0,
|
|
22152
22383
|
controls: `hpc${v4_default()}`,
|
|
22153
|
-
auto:
|
|
22384
|
+
auto: expression ? false : true,
|
|
22154
22385
|
expanded: expression ? evaluate2(expression) : false
|
|
22155
22386
|
});
|
|
22156
|
-
el.setAttribute("data-slot", "popover");
|
|
22157
22387
|
if (expression) {
|
|
22158
22388
|
const getExpanded = evaluateLater(expression);
|
|
22159
22389
|
effect(() => {
|
|
@@ -22162,43 +22392,39 @@ function popover_default(Alpine) {
|
|
|
22162
22392
|
});
|
|
22163
22393
|
});
|
|
22164
22394
|
}
|
|
22165
|
-
});
|
|
22166
|
-
Alpine.directive("h-popover-trigger", (el, { modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
|
|
22167
|
-
const popover = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_popover"));
|
|
22168
|
-
if (!popover) {
|
|
22169
|
-
throw new Error("h-popover-trigger must be inside an h-popover element");
|
|
22170
|
-
}
|
|
22171
22395
|
el.setAttribute("type", "button");
|
|
22172
22396
|
if (modifiers.includes("chevron")) {
|
|
22173
22397
|
el.classList.add("[&_svg]:transition-transform", "[&[data-state=open]>svg:not(:first-child):last-child]:rotate-180");
|
|
22174
22398
|
}
|
|
22175
22399
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "popover-trigger");
|
|
22176
22400
|
if (el.hasAttribute("id")) {
|
|
22177
|
-
|
|
22401
|
+
el._popover.id = el.getAttribute("id");
|
|
22178
22402
|
} else {
|
|
22179
|
-
|
|
22180
|
-
el.setAttribute("id",
|
|
22403
|
+
el._popover.id = `hp${v4_default()}`;
|
|
22404
|
+
el.setAttribute("id", el._popover.id);
|
|
22181
22405
|
}
|
|
22182
|
-
el.setAttribute("aria-controls",
|
|
22406
|
+
el.setAttribute("aria-controls", el._popover.controls);
|
|
22183
22407
|
el.setAttribute("aria-haspopup", "dialog");
|
|
22184
22408
|
const setAttributes = () => {
|
|
22185
|
-
el.setAttribute("data-state",
|
|
22186
|
-
el.setAttribute("aria-expanded",
|
|
22409
|
+
el.setAttribute("data-state", el._popover.expanded ? "open" : "closed");
|
|
22410
|
+
el.setAttribute("aria-expanded", el._popover.expanded);
|
|
22187
22411
|
};
|
|
22188
22412
|
const close = () => {
|
|
22189
|
-
|
|
22413
|
+
el._popover.expanded = false;
|
|
22414
|
+
el.addEventListener("click", handler2);
|
|
22190
22415
|
};
|
|
22191
22416
|
const handler2 = () => {
|
|
22192
|
-
|
|
22417
|
+
el._popover.expanded = !el._popover.expanded;
|
|
22193
22418
|
setAttributes();
|
|
22194
22419
|
Alpine2.nextTick(() => {
|
|
22195
|
-
if (
|
|
22420
|
+
if (el._popover.auto && el._popover.expanded) {
|
|
22196
22421
|
top.addEventListener("click", close, { once: true });
|
|
22422
|
+
el.removeEventListener("click", handler2);
|
|
22197
22423
|
}
|
|
22198
22424
|
});
|
|
22199
22425
|
};
|
|
22200
22426
|
setAttributes();
|
|
22201
|
-
if (
|
|
22427
|
+
if (el._popover.auto) {
|
|
22202
22428
|
el.addEventListener("click", handler2);
|
|
22203
22429
|
cleanup(() => {
|
|
22204
22430
|
el.removeEventListener("click", handler2);
|
|
@@ -22210,13 +22436,19 @@ function popover_default(Alpine) {
|
|
|
22210
22436
|
});
|
|
22211
22437
|
}
|
|
22212
22438
|
});
|
|
22213
|
-
Alpine.directive("h-popover
|
|
22214
|
-
const popover =
|
|
22439
|
+
Alpine.directive("h-popover", (el, { modifiers }, { effect }) => {
|
|
22440
|
+
const popover = (() => {
|
|
22441
|
+
let sibling = el.previousElementSibling;
|
|
22442
|
+
while (sibling && !sibling.hasOwnProperty("_popover")) {
|
|
22443
|
+
sibling = sibling.previousElementSibling;
|
|
22444
|
+
}
|
|
22445
|
+
return sibling;
|
|
22446
|
+
})();
|
|
22215
22447
|
if (!popover) {
|
|
22216
|
-
throw new Error("h-popover-content must be
|
|
22448
|
+
throw new Error("h-popover-content must be placed after an h-popover element");
|
|
22217
22449
|
}
|
|
22218
|
-
el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "top-0", "left-0", "z-50", "min-w-[1rem]", "rounded-
|
|
22219
|
-
el.setAttribute("data-slot", "popover
|
|
22450
|
+
el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "top-0", "left-0", "z-50", "min-w-[1rem]", "rounded-md", "border", "shadow-md", "outline-hidden", "overflow-scroll");
|
|
22451
|
+
el.setAttribute("data-slot", "popover");
|
|
22220
22452
|
el.setAttribute("role", "dialog");
|
|
22221
22453
|
el.setAttribute("tabindex", "-1");
|
|
22222
22454
|
el.setAttribute("id", popover._popover.controls);
|
|
@@ -22227,13 +22459,9 @@ function popover_default(Alpine) {
|
|
|
22227
22459
|
el.classList.remove("overflow-scroll");
|
|
22228
22460
|
el.classList.add("overflow-none");
|
|
22229
22461
|
}
|
|
22230
|
-
const control = popover.querySelector(`#${popover._popover.id}`);
|
|
22231
|
-
if (!control) {
|
|
22232
|
-
throw new Error("h-popover-content: trigger not found");
|
|
22233
|
-
}
|
|
22234
22462
|
let autoUpdateCleanup;
|
|
22235
22463
|
function updatePosition() {
|
|
22236
|
-
computePosition2(
|
|
22464
|
+
computePosition2(popover, el, {
|
|
22237
22465
|
placement: el.getAttribute("data-align") || "bottom-start",
|
|
22238
22466
|
middleware: [
|
|
22239
22467
|
offset2(4),
|
|
@@ -22258,7 +22486,7 @@ function popover_default(Alpine) {
|
|
|
22258
22486
|
effect(() => {
|
|
22259
22487
|
el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
|
|
22260
22488
|
if (popover._popover.expanded) {
|
|
22261
|
-
autoUpdateCleanup = autoUpdate(
|
|
22489
|
+
autoUpdateCleanup = autoUpdate(popover, el, updatePosition);
|
|
22262
22490
|
} else {
|
|
22263
22491
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
22264
22492
|
Object.assign(el.style, {
|
|
@@ -22297,40 +22525,48 @@ function progress_default(Alpine) {
|
|
|
22297
22525
|
function radio_default(Alpine) {
|
|
22298
22526
|
Alpine.directive("h-radio", (el) => {
|
|
22299
22527
|
el.classList.add(
|
|
22300
|
-
"
|
|
22301
|
-
"
|
|
22302
|
-
"bg-
|
|
22303
|
-
"
|
|
22304
|
-
"
|
|
22305
|
-
"focus-visible:
|
|
22306
|
-
"
|
|
22307
|
-
"
|
|
22308
|
-
"
|
|
22309
|
-
"
|
|
22310
|
-
"
|
|
22311
|
-
"
|
|
22528
|
+
"[&>input]:absolute",
|
|
22529
|
+
"[&>input]:appearance-none",
|
|
22530
|
+
"[&>input]:bg-transparent",
|
|
22531
|
+
"[&>input]:border-0",
|
|
22532
|
+
"[&>input]:cursor-pointer",
|
|
22533
|
+
"[&>input]:focus-visible:border-ring",
|
|
22534
|
+
"[&>input]:focus-visible:ring-[3px]",
|
|
22535
|
+
"[&>input]:focus-visible:ring-ring/50",
|
|
22536
|
+
"[&>input]:left-0",
|
|
22537
|
+
"[&>input]:outline-none",
|
|
22538
|
+
"[&>input]:rounded-full",
|
|
22539
|
+
"[&>input]:size-full",
|
|
22540
|
+
"[&>input]:top-0",
|
|
22312
22541
|
"aspect-square",
|
|
22313
|
-
"size-4",
|
|
22314
|
-
"shrink-0",
|
|
22315
|
-
"rounded-full",
|
|
22316
|
-
"border",
|
|
22317
|
-
"shadow-control",
|
|
22318
|
-
"transition-color",
|
|
22319
|
-
"duration-200",
|
|
22320
|
-
"outline-none",
|
|
22321
|
-
"focus-visible:ring-[3px]",
|
|
22322
|
-
"disabled:cursor-not-allowed",
|
|
22323
|
-
"disabled:opacity-50",
|
|
22324
|
-
"before:block",
|
|
22325
22542
|
"before:bg-clip-padding",
|
|
22326
|
-
"before:rounded-full",
|
|
22327
|
-
"before:h-full",
|
|
22328
|
-
"before:w-full",
|
|
22329
22543
|
"before:bg-primary",
|
|
22330
|
-
"before:
|
|
22544
|
+
"before:block",
|
|
22331
22545
|
"before:border-3",
|
|
22332
|
-
"
|
|
22546
|
+
"before:border-transparent",
|
|
22547
|
+
"before:invisible",
|
|
22548
|
+
"before:pointer-events-none",
|
|
22549
|
+
"before:rounded-full",
|
|
22550
|
+
"before:size-full",
|
|
22551
|
+
"bg-input-inner",
|
|
22552
|
+
"border",
|
|
22553
|
+
"border-input",
|
|
22554
|
+
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
22555
|
+
"dark:has-[input:invalid]:ring-negative/40",
|
|
22556
|
+
"has-[aria-invalid=true]:border-negative",
|
|
22557
|
+
"has-[aria-invalid=true]:ring-negative/20",
|
|
22558
|
+
"has-[input:checked]:before:visible",
|
|
22559
|
+
"has-[input:disabled]:cursor-not-allowed",
|
|
22560
|
+
"has-[input:disabled]:opacity-50",
|
|
22561
|
+
"has-[input:invalid]:border-negative",
|
|
22562
|
+
"has-[input:invalid]:ring-negative/20",
|
|
22563
|
+
"relative",
|
|
22564
|
+
"rounded-full",
|
|
22565
|
+
"shadow-control",
|
|
22566
|
+
"shrink-0",
|
|
22567
|
+
"size-5"
|
|
22333
22568
|
);
|
|
22569
|
+
el.setAttribute("tabindex", "-1");
|
|
22334
22570
|
el.setAttribute("data-slot", "radio");
|
|
22335
22571
|
});
|
|
22336
22572
|
}
|
|
@@ -22384,10 +22620,28 @@ function select_default(Alpine) {
|
|
|
22384
22620
|
select._select.multiple = Array.isArray(el._x_model.get());
|
|
22385
22621
|
select._select.model = el._x_model.get();
|
|
22386
22622
|
}
|
|
22623
|
+
setButtonClasses(el);
|
|
22624
|
+
const setVariant = (variant) => {
|
|
22625
|
+
if (variant === "secondary") {
|
|
22626
|
+
el.classList.add(...buttonVariants["default"]);
|
|
22627
|
+
return;
|
|
22628
|
+
} else if (variant === "transparent") {
|
|
22629
|
+
el.classList.add(...buttonVariants["transparent"]);
|
|
22630
|
+
} else el.classList.add("shadow-control", ...buttonVariants["outline"]);
|
|
22631
|
+
};
|
|
22632
|
+
const setSize = (size3) => {
|
|
22633
|
+
const sizes = ["sm", "xs", "lg"];
|
|
22634
|
+
if (sizes.includes(size3)) {
|
|
22635
|
+
el.classList.add(...getButtonSize(size3));
|
|
22636
|
+
} else el.classList.add(...getButtonSize());
|
|
22637
|
+
};
|
|
22638
|
+
setVariant(el.getAttribute("data-variant"));
|
|
22639
|
+
setSize(el.getAttribute("data-size"));
|
|
22640
|
+
el.classList.add("w-full", "[&_svg]:opacity-50", "[&[data-state=open]>svg]:rotate-180");
|
|
22387
22641
|
el.setAttribute("type", "button");
|
|
22388
22642
|
const selectValue = document.createElement("span");
|
|
22389
22643
|
selectValue.setAttribute("data-slot", "select-value");
|
|
22390
|
-
selectValue.classList.add("pointer-events-none");
|
|
22644
|
+
selectValue.classList.add("text-left", "truncate", "pointer-events-none", "w-full");
|
|
22391
22645
|
function getPlaceholder() {
|
|
22392
22646
|
if (!el.value) {
|
|
22393
22647
|
const value = el.getAttribute("placeholder");
|
|
@@ -22402,17 +22656,15 @@ function select_default(Alpine) {
|
|
|
22402
22656
|
getPlaceholder();
|
|
22403
22657
|
const observer = new MutationObserver((mutations) => {
|
|
22404
22658
|
mutations.forEach((mutation) => {
|
|
22405
|
-
if (mutation.
|
|
22406
|
-
|
|
22407
|
-
|
|
22408
|
-
|
|
22409
|
-
|
|
22410
|
-
getPlaceholder();
|
|
22411
|
-
}
|
|
22659
|
+
if (mutation.attributeName === "value") {
|
|
22660
|
+
el.dispatchEvent(new Event("change", { bubbles: true }));
|
|
22661
|
+
if (el.value) selectValue.classList.remove("text-muted-foreground");
|
|
22662
|
+
} else if (mutation.attributeName === "placeholder" && !select._select.label.length) {
|
|
22663
|
+
getPlaceholder();
|
|
22412
22664
|
}
|
|
22413
22665
|
});
|
|
22414
22666
|
});
|
|
22415
|
-
observer.observe(el, { attributes: true });
|
|
22667
|
+
observer.observe(el, { attributes: true, attributeFilter: ["value", "placeholder"] });
|
|
22416
22668
|
effect(() => {
|
|
22417
22669
|
if (select._select.label.length === 1) {
|
|
22418
22670
|
selectValue.innerText = select._select.label[0];
|
|
@@ -22422,48 +22674,6 @@ function select_default(Alpine) {
|
|
|
22422
22674
|
getPlaceholder();
|
|
22423
22675
|
}
|
|
22424
22676
|
});
|
|
22425
|
-
el.classList.add(
|
|
22426
|
-
"[&>*]:pointer-events-none",
|
|
22427
|
-
"cursor-pointer",
|
|
22428
|
-
"border-input",
|
|
22429
|
-
"focus-visible:border-ring",
|
|
22430
|
-
"focus-visible:ring-ring/50",
|
|
22431
|
-
"aria-invalid:ring-negative/20",
|
|
22432
|
-
"dark:aria-invalid:ring-negative/40",
|
|
22433
|
-
"aria-invalid:border-negative",
|
|
22434
|
-
"invalid:ring-negative/20",
|
|
22435
|
-
"dark:invalid:ring-negative/40",
|
|
22436
|
-
"invalid:border-negative",
|
|
22437
|
-
"hover:bg-secondary-hover",
|
|
22438
|
-
"active:bg-secondary-active",
|
|
22439
|
-
"flex",
|
|
22440
|
-
"w-full",
|
|
22441
|
-
"items-center",
|
|
22442
|
-
"justify-between",
|
|
22443
|
-
"gap-2",
|
|
22444
|
-
"rounded-control",
|
|
22445
|
-
"border",
|
|
22446
|
-
"bg-input-inner",
|
|
22447
|
-
"px-3",
|
|
22448
|
-
"text-sm",
|
|
22449
|
-
"whitespace-nowrap",
|
|
22450
|
-
"shadow-control",
|
|
22451
|
-
"transition-[color,box-shadow]",
|
|
22452
|
-
"outline-none",
|
|
22453
|
-
"focus-visible:ring-[3px]",
|
|
22454
|
-
"disabled:cursor-not-allowed",
|
|
22455
|
-
"disabled:opacity-50",
|
|
22456
|
-
"*:data-[slot=select-value]:line-clamp-1",
|
|
22457
|
-
"*:data-[slot=select-value]:flex",
|
|
22458
|
-
"*:data-[slot=select-value]:items-center",
|
|
22459
|
-
"*:data-[slot=select-value]:gap-2",
|
|
22460
|
-
"[&_svg]:pointer-events-none",
|
|
22461
|
-
"[&_svg]:shrink-0",
|
|
22462
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
22463
|
-
"[&_svg]:size-4",
|
|
22464
|
-
"[&_svg]:opacity-50",
|
|
22465
|
-
"[&[data-state=open]>svg]:rotate-180"
|
|
22466
|
-
);
|
|
22467
22677
|
el.setAttribute("data-slot", "select-trigger");
|
|
22468
22678
|
if (el.hasAttribute("id")) {
|
|
22469
22679
|
select._select.id = el.getAttribute("id");
|
|
@@ -22475,21 +22685,6 @@ function select_default(Alpine) {
|
|
|
22475
22685
|
el.setAttribute("aria-haspopup", "listbox");
|
|
22476
22686
|
el.setAttribute("aria-autocomplete", "none");
|
|
22477
22687
|
el.setAttribute("role", "combobox");
|
|
22478
|
-
const sizes = {
|
|
22479
|
-
default: ["h-9", "py-2"],
|
|
22480
|
-
xs: ["h-6.5", "py-[0.188rem]"],
|
|
22481
|
-
sm: ["h-8", "py-1.5"]
|
|
22482
|
-
};
|
|
22483
|
-
function setSize(size3) {
|
|
22484
|
-
for (const [_, value] of Object.entries(sizes)) {
|
|
22485
|
-
el.classList.remove(...value);
|
|
22486
|
-
}
|
|
22487
|
-
if (sizes.hasOwnProperty(size3)) {
|
|
22488
|
-
el.classList.add(...sizes[size3]);
|
|
22489
|
-
}
|
|
22490
|
-
}
|
|
22491
|
-
if (!el.hasAttribute("data-size")) el.setAttribute("data-size", "default");
|
|
22492
|
-
setSize(el.getAttribute("data-size"));
|
|
22493
22688
|
effect(() => {
|
|
22494
22689
|
el.setAttribute("data-state", select._select.expanded ? "open" : "closed");
|
|
22495
22690
|
el.setAttribute("aria-expanded", select._select.expanded);
|
|
@@ -22574,7 +22769,7 @@ function select_default(Alpine) {
|
|
|
22574
22769
|
if (!select) {
|
|
22575
22770
|
throw new Error("h-select-content must be inside an h-select element");
|
|
22576
22771
|
}
|
|
22577
|
-
el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "p-1", "top-0", "left-0", "z-50", "min-w-[1rem]", "overflow-x-hidden", "overflow-y-auto", "rounded-
|
|
22772
|
+
el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "p-1", "top-0", "left-0", "z-50", "min-w-[1rem]", "overflow-x-hidden", "overflow-y-auto", "rounded-md", "border", "shadow-md");
|
|
22578
22773
|
el.setAttribute("data-slot", "select-content");
|
|
22579
22774
|
el.setAttribute("role", "listbox");
|
|
22580
22775
|
el.setAttribute("role", "presentation");
|
|
@@ -22706,7 +22901,7 @@ function select_default(Alpine) {
|
|
|
22706
22901
|
"cursor-default",
|
|
22707
22902
|
"items-center",
|
|
22708
22903
|
"gap-2",
|
|
22709
|
-
"rounded-
|
|
22904
|
+
"rounded-sm",
|
|
22710
22905
|
"py-1.5",
|
|
22711
22906
|
"pr-8",
|
|
22712
22907
|
"pl-2",
|
|
@@ -22852,21 +23047,36 @@ function separator_default(Alpine) {
|
|
|
22852
23047
|
|
|
22853
23048
|
// src/components/sidebar.js
|
|
22854
23049
|
function sidebar_default(Alpine) {
|
|
22855
|
-
Alpine.directive("h-sidebar", (el, { modifiers }) => {
|
|
22856
|
-
el.classList.add("group/sidebar", "bg-sidebar", "text-sidebar-foreground", "border-sidebar-border", "vbox", "h-full", "w-(--sidebar-width,16rem)");
|
|
22857
|
-
if (modifiers.includes("floating")) {
|
|
22858
|
-
el.classList.add("border", "rounded-lg", "shadow-sm", "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]");
|
|
22859
|
-
} else el.classList.add("group-data-[collapsible=icon]:w-(--sidebar-width-icon)");
|
|
23050
|
+
Alpine.directive("h-sidebar", (el, { modifiers }, { cleanup }) => {
|
|
23051
|
+
el.classList.add("group/sidebar", "bg-sidebar", "text-sidebar-foreground", "border-sidebar-border", "vbox", "h-full", "w-(--sidebar-width,16rem)", "data-[collapsed=true]:w-min");
|
|
22860
23052
|
if (modifiers.includes("right")) el.classList.add("border-l");
|
|
22861
23053
|
else el.classList.add("border-r");
|
|
22862
23054
|
el.setAttribute("data-slot", "sidebar");
|
|
23055
|
+
const setFloating = () => {
|
|
23056
|
+
if (el.getAttribute("data-floating") === "true") {
|
|
23057
|
+
el.classList.add("border", "rounded-lg", "shadow-sm");
|
|
23058
|
+
} else {
|
|
23059
|
+
el.classList.remove("border", "rounded-lg", "shadow-sm");
|
|
23060
|
+
}
|
|
23061
|
+
};
|
|
23062
|
+
setFloating();
|
|
23063
|
+
const observer = new MutationObserver((mutations) => {
|
|
23064
|
+
mutations.forEach(() => {
|
|
23065
|
+
setFloating();
|
|
23066
|
+
});
|
|
23067
|
+
});
|
|
23068
|
+
observer.observe(el, { attributes: true, attributeFilter: ["data-floating"] });
|
|
23069
|
+
cleanup(() => {
|
|
23070
|
+
observer.disconnect();
|
|
23071
|
+
});
|
|
22863
23072
|
});
|
|
22864
23073
|
Alpine.directive("h-sidebar-header", (el) => {
|
|
22865
|
-
el.classList.add("vbox", "gap-2", "
|
|
23074
|
+
el.classList.add("vbox", "gap-2", "px-2", "h-12", "justify-center", "border-b");
|
|
23075
|
+
if (el.dataset.borderless && el.dataset.borderless === "true") el.classList.remove("border-b");
|
|
22866
23076
|
el.setAttribute("data-slot", "sidebar-header");
|
|
22867
23077
|
});
|
|
22868
23078
|
Alpine.directive("h-sidebar-content", (el) => {
|
|
22869
|
-
el.classList.add("vbox", "min-h-0", "flex-1", "gap-2", "overflow-auto", "group-data-[
|
|
23079
|
+
el.classList.add("vbox", "min-h-0", "flex-1", "gap-2", "overflow-auto", "group-data-[collapsed=true]/sidebar:overflow-hidden");
|
|
22870
23080
|
el.setAttribute("data-slot", "sidebar-content");
|
|
22871
23081
|
});
|
|
22872
23082
|
Alpine.directive("h-sidebar-group", (el) => {
|
|
@@ -22892,8 +23102,7 @@ function sidebar_default(Alpine) {
|
|
|
22892
23102
|
"focus-visible:ring-2",
|
|
22893
23103
|
"[&>svg]:size-4",
|
|
22894
23104
|
"[&>svg]:shrink-0",
|
|
22895
|
-
"group-data-[
|
|
22896
|
-
"group-data-[collapsible=icon]:opacity-0"
|
|
23105
|
+
"group-data-[collapsed=true]/sidebar:!hidden"
|
|
22897
23106
|
);
|
|
22898
23107
|
if (modifiers.includes("action")) el.classList.add("hover:bg-secondary-hover", "active:bg-secondary-active");
|
|
22899
23108
|
el.setAttribute("data-slot", "sidebar-group-label");
|
|
@@ -22922,7 +23131,7 @@ function sidebar_default(Alpine) {
|
|
|
22922
23131
|
"after:absolute",
|
|
22923
23132
|
"after:-inset-2",
|
|
22924
23133
|
"md:after:hidden",
|
|
22925
|
-
"group-data-[
|
|
23134
|
+
"group-data-[collapsed=true]/sidebar:hidden"
|
|
22926
23135
|
);
|
|
22927
23136
|
el.setAttribute("data-slot", "sidebar-group-action");
|
|
22928
23137
|
});
|
|
@@ -22969,8 +23178,9 @@ function sidebar_default(Alpine) {
|
|
|
22969
23178
|
"data-[active=true]:text-sidebar-primary-foreground",
|
|
22970
23179
|
"data-[state=open]:hover:bg-sidebar-secondary",
|
|
22971
23180
|
"data-[state=open]:hover:text-sidebar-secondary-foreground",
|
|
22972
|
-
"group-data-[
|
|
22973
|
-
"group-data-[
|
|
23181
|
+
"group-data-[collapsed=true]/sidebar:!size-8",
|
|
23182
|
+
"group-data-[collapsed=true]/sidebar:!p-2",
|
|
23183
|
+
"group-data-[collapsed=true]/sidebar:[&>*:not(svg:first-child):not([data-slot=menu])]:!hidden",
|
|
22974
23184
|
"[&>span]:truncate",
|
|
22975
23185
|
"[&>span]:align-middle",
|
|
22976
23186
|
"[&>svg]:size-4",
|
|
@@ -22981,7 +23191,7 @@ function sidebar_default(Alpine) {
|
|
|
22981
23191
|
const sizes = {
|
|
22982
23192
|
default: ["h-8", "text-sm"],
|
|
22983
23193
|
sm: ["h-7", "text-xs"],
|
|
22984
|
-
lg: ["h-12", "text-sm", "group-data-[
|
|
23194
|
+
lg: ["h-12", "text-sm", "group-data-[collapsed=true]/sidebar:p-0!"]
|
|
22985
23195
|
};
|
|
22986
23196
|
function setSize(size3) {
|
|
22987
23197
|
if (sizes.hasOwnProperty(size3)) {
|
|
@@ -23019,7 +23229,7 @@ function sidebar_default(Alpine) {
|
|
|
23019
23229
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
23020
23230
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
23021
23231
|
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
23022
|
-
"group-data-[
|
|
23232
|
+
"group-data-[collapsed=true]/sidebar:hidden"
|
|
23023
23233
|
);
|
|
23024
23234
|
if (modifiers.includes("autohide")) {
|
|
23025
23235
|
el.classList.add("peer-data-[active=true]/menu-button:text-sidebar-secondary-foreground", "group-focus-within/menu-item:opacity-100", "group-hover/menu-item:opacity-100", "data-[state=open]:opacity-100", "md:opacity-0");
|
|
@@ -23048,7 +23258,7 @@ function sidebar_default(Alpine) {
|
|
|
23048
23258
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
23049
23259
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
23050
23260
|
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
23051
|
-
"group-data-[
|
|
23261
|
+
"group-data-[collapsed=true]/sidebar:hidden"
|
|
23052
23262
|
);
|
|
23053
23263
|
el.setAttribute("data-slot", "sidebar-menu-badge");
|
|
23054
23264
|
});
|
|
@@ -23071,7 +23281,7 @@ function sidebar_default(Alpine) {
|
|
|
23071
23281
|
el.setAttribute("role", "none");
|
|
23072
23282
|
});
|
|
23073
23283
|
Alpine.directive("h-sidebar-menu-sub", (el, { modifiers }) => {
|
|
23074
|
-
el.classList.add("vbox", "min-w-0", "translate-x-px", "gap-1", "py-0.5", "group-data-[
|
|
23284
|
+
el.classList.add("vbox", "min-w-0", "translate-x-px", "gap-1", "py-0.5", "group-data-[collapsed=true]/sidebar:hidden");
|
|
23075
23285
|
if (!modifiers.includes("flat")) {
|
|
23076
23286
|
el.classList.add("border-sidebar-border", "mx-3.5", "border-l", "px-2.5");
|
|
23077
23287
|
}
|
|
@@ -23114,7 +23324,7 @@ function sidebar_default(Alpine) {
|
|
|
23114
23324
|
"[&>svg:not(:first-child):last-child]:ml-auto",
|
|
23115
23325
|
"data-[active=true]:bg-sidebar-primary",
|
|
23116
23326
|
"data-[active=true]:text-sidebar-primary-foreground",
|
|
23117
|
-
"group-data-[
|
|
23327
|
+
"group-data-[collapsed=true]/sidebar:hidden"
|
|
23118
23328
|
);
|
|
23119
23329
|
el.setAttribute("data-slot", "sidebar-menu-sub-button");
|
|
23120
23330
|
const sizes = {
|
|
@@ -23130,7 +23340,8 @@ function sidebar_default(Alpine) {
|
|
|
23130
23340
|
setSize(el.getAttribute("data-size"));
|
|
23131
23341
|
});
|
|
23132
23342
|
Alpine.directive("h-sidebar-footer", (el) => {
|
|
23133
|
-
el.classList.add("vbox", "gap-2", "
|
|
23343
|
+
el.classList.add("vbox", "gap-2", "px-2", "h-12", "justify-center", "border-t");
|
|
23344
|
+
if (el.dataset.borderless && el.dataset.borderless === "true") el.classList.remove("border-t");
|
|
23134
23345
|
el.setAttribute("data-slot", "sidebar-footer");
|
|
23135
23346
|
});
|
|
23136
23347
|
}
|
|
@@ -23141,10 +23352,21 @@ function skeleton_default(Alpine) {
|
|
|
23141
23352
|
el.classList.add("bg-secondary", "animate-pulse");
|
|
23142
23353
|
if (modifiers.includes("control")) {
|
|
23143
23354
|
el.classList.add("rounded-control");
|
|
23355
|
+
switch (el.getAttribute("data-size")) {
|
|
23356
|
+
case "xs":
|
|
23357
|
+
el.classList.add("h-6.5");
|
|
23358
|
+
break;
|
|
23359
|
+
case "sm":
|
|
23360
|
+
el.classList.add("h-8");
|
|
23361
|
+
break;
|
|
23362
|
+
default:
|
|
23363
|
+
el.classList.add("h-9");
|
|
23364
|
+
break;
|
|
23365
|
+
}
|
|
23144
23366
|
} else if (modifiers.includes("card")) {
|
|
23145
|
-
el.classList.add("rounded-
|
|
23367
|
+
el.classList.add("rounded-lg");
|
|
23146
23368
|
} else if (modifiers.includes("avatar")) {
|
|
23147
|
-
el.classList.add("rounded-full", "size-8");
|
|
23369
|
+
el.classList.add("rounded-full", "size-8", "aspect-square");
|
|
23148
23370
|
} else el.classList.add("rounded-md");
|
|
23149
23371
|
el.setAttribute("data-slot", "skeleton");
|
|
23150
23372
|
});
|
|
@@ -23162,52 +23384,53 @@ function spinner_default(Alpine) {
|
|
|
23162
23384
|
|
|
23163
23385
|
// src/components/switch.js
|
|
23164
23386
|
function switch_default(Alpine) {
|
|
23165
|
-
Alpine.directive("h-switch", (el
|
|
23387
|
+
Alpine.directive("h-switch", (el) => {
|
|
23166
23388
|
el.classList.add(
|
|
23167
|
-
"
|
|
23168
|
-
"
|
|
23169
|
-
"
|
|
23170
|
-
"
|
|
23171
|
-
"
|
|
23172
|
-
"focus-visible:
|
|
23173
|
-
"
|
|
23174
|
-
"
|
|
23175
|
-
"
|
|
23176
|
-
"
|
|
23177
|
-
"
|
|
23178
|
-
"
|
|
23179
|
-
"
|
|
23180
|
-
"rounded-full",
|
|
23181
|
-
"border",
|
|
23182
|
-
"border-transparent",
|
|
23183
|
-
"shadow-control",
|
|
23184
|
-
"transition-all",
|
|
23185
|
-
"duration-200",
|
|
23186
|
-
"outline-none",
|
|
23187
|
-
"focus-visible:ring-[3px]",
|
|
23188
|
-
"disabled:cursor-not-allowed",
|
|
23189
|
-
"disabled:opacity-50",
|
|
23190
|
-
"before:block",
|
|
23389
|
+
"[&>input]:absolute",
|
|
23390
|
+
"[&>input]:appearance-none",
|
|
23391
|
+
"[&>input]:bg-transparent",
|
|
23392
|
+
"[&>input]:border-0",
|
|
23393
|
+
"[&>input]:cursor-pointer",
|
|
23394
|
+
"[&>input]:focus-visible:border-ring",
|
|
23395
|
+
"[&>input]:focus-visible:ring-[3px]",
|
|
23396
|
+
"[&>input]:focus-visible:ring-ring/50",
|
|
23397
|
+
"[&>input]:left-0",
|
|
23398
|
+
"[&>input]:outline-none",
|
|
23399
|
+
"[&>input]:rounded-full",
|
|
23400
|
+
"[&>input]:size-full",
|
|
23401
|
+
"[&>input]:top-0",
|
|
23191
23402
|
"before:bg-background",
|
|
23403
|
+
"before:duration-200",
|
|
23404
|
+
"before:inline-block",
|
|
23405
|
+
"before:m-[1px]",
|
|
23192
23406
|
"before:pointer-events-none",
|
|
23193
|
-
"data-[size=sm]:before:size-4",
|
|
23194
|
-
"before:size-5",
|
|
23195
|
-
"before:rounded-full",
|
|
23196
23407
|
"before:ring-0",
|
|
23408
|
+
"before:rounded-full",
|
|
23409
|
+
"before:shadow-control",
|
|
23410
|
+
"before:size-5",
|
|
23197
23411
|
"before:transition-transform",
|
|
23198
|
-
"
|
|
23199
|
-
"
|
|
23200
|
-
"data-[
|
|
23412
|
+
"bg-muted",
|
|
23413
|
+
"border",
|
|
23414
|
+
"data-[size=sm]:before:size-4",
|
|
23415
|
+
"data-[size=sm]:h-5",
|
|
23416
|
+
"data-[size=sm]:max-w-8",
|
|
23417
|
+
"data-[size=sm]:min-w-8",
|
|
23418
|
+
"duration-200",
|
|
23419
|
+
"h-6",
|
|
23420
|
+
"has-[input:checked]:before:translate-x-[calc(100%-var(--spacing)*1)]",
|
|
23421
|
+
"has-[input:checked]:bg-primary",
|
|
23422
|
+
"has-[input:checked]:border-primary-active",
|
|
23423
|
+
"has-[input:disabled]:cursor-not-allowed",
|
|
23424
|
+
"has-[input:disabled]:opacity-50",
|
|
23425
|
+
"max-w-10",
|
|
23426
|
+
"min-w-10",
|
|
23427
|
+
"relative",
|
|
23428
|
+
"rounded-full",
|
|
23429
|
+
"shrink-0",
|
|
23430
|
+
"transition-color"
|
|
23201
23431
|
);
|
|
23432
|
+
el.setAttribute("tabindex", "-1");
|
|
23202
23433
|
el.setAttribute("data-slot", "switch");
|
|
23203
|
-
function setState() {
|
|
23204
|
-
el.setAttribute("data-state", el.checked ? "checked" : "unchecked");
|
|
23205
|
-
}
|
|
23206
|
-
setState();
|
|
23207
|
-
el.addEventListener("change", setState);
|
|
23208
|
-
cleanup(() => {
|
|
23209
|
-
el.removeEventListener("change", setState);
|
|
23210
|
-
});
|
|
23211
23434
|
});
|
|
23212
23435
|
}
|
|
23213
23436
|
|
|
@@ -23245,19 +23468,60 @@ function table_default(Alpine) {
|
|
|
23245
23468
|
el.setAttribute("data-slot", "table-header");
|
|
23246
23469
|
});
|
|
23247
23470
|
Alpine.directive("h-table-head", (el) => {
|
|
23248
|
-
el.classList.add(
|
|
23471
|
+
el.classList.add(
|
|
23472
|
+
"text-foreground",
|
|
23473
|
+
"[&[data-hoverable=true]:hover]:bg-table-hover",
|
|
23474
|
+
"[&[data-hoverable=true]:hover]:text-table-hover-foreground",
|
|
23475
|
+
"[&[data-activable=true]:active]:!bg-table-active",
|
|
23476
|
+
"[&[data-activable=true]:active]:!text-table-active-foreground",
|
|
23477
|
+
"h-10",
|
|
23478
|
+
"px-2",
|
|
23479
|
+
"text-left",
|
|
23480
|
+
"align-middle",
|
|
23481
|
+
"font-medium",
|
|
23482
|
+
"whitespace-nowrap",
|
|
23483
|
+
"[&:has([role=checkbox])]:pr-0",
|
|
23484
|
+
"[&>[role=checkbox]]:flex",
|
|
23485
|
+
"[&>[role=checkbox]]:items-center"
|
|
23486
|
+
);
|
|
23249
23487
|
el.setAttribute("data-slot", "table-head");
|
|
23250
23488
|
});
|
|
23251
23489
|
Alpine.directive("h-table-cell", (el) => {
|
|
23252
|
-
el.classList.add(
|
|
23490
|
+
el.classList.add(
|
|
23491
|
+
"p-2",
|
|
23492
|
+
"align-middle",
|
|
23493
|
+
"whitespace-nowrap",
|
|
23494
|
+
"[&:has([role=checkbox])]:pr-0",
|
|
23495
|
+
"[&>[role=checkbox]]:flex",
|
|
23496
|
+
"[&>[role=checkbox]]:items-center",
|
|
23497
|
+
"[&[data-hoverable=true]:hover]:bg-table-hover",
|
|
23498
|
+
"[&[data-hoverable=true]:hover]:text-table-hover-foreground",
|
|
23499
|
+
"[&[data-activable=true]:active]:!bg-table-active",
|
|
23500
|
+
"[&[data-activable=true]:active]:!text-table-active-foreground"
|
|
23501
|
+
);
|
|
23253
23502
|
el.setAttribute("data-slot", "table-cell");
|
|
23254
23503
|
});
|
|
23255
23504
|
Alpine.directive("h-table-body", (el) => {
|
|
23256
|
-
el.classList.add(
|
|
23505
|
+
el.classList.add(
|
|
23506
|
+
"[&_tr:last-child_td]:border-b-0",
|
|
23507
|
+
"[&_tr:last-child_th]:border-b-0",
|
|
23508
|
+
"[&_tr_th]:bg-table-header",
|
|
23509
|
+
"[&_tr[data-hoverable=true]:hover_th]:bg-table-hover",
|
|
23510
|
+
"[&_tr[data-hoverable=true]:hover_th]:text-table-hover-foreground",
|
|
23511
|
+
"[&_tr[data-activable=true]:active_th]:!bg-table-active",
|
|
23512
|
+
"[&_tr[data-activable=true]:active_th]:!text-table-active-foreground"
|
|
23513
|
+
);
|
|
23257
23514
|
el.setAttribute("data-slot", "table-body");
|
|
23258
23515
|
});
|
|
23259
23516
|
Alpine.directive("h-table-row", (el) => {
|
|
23260
|
-
el.classList.add(
|
|
23517
|
+
el.classList.add(
|
|
23518
|
+
"[&[data-hoverable=true]:hover]:bg-table-hover",
|
|
23519
|
+
"[&[data-hoverable=true]:hover]:text-table-hover-foreground",
|
|
23520
|
+
"[&[data-activable=true]:active]:!bg-table-active",
|
|
23521
|
+
"[&[data-activable=true]:active]:!text-table-active-foreground",
|
|
23522
|
+
"data-[state=selected]:bg-table-active",
|
|
23523
|
+
"data-[state=selected]:text-table-active-foreground"
|
|
23524
|
+
);
|
|
23261
23525
|
el.setAttribute("data-slot", "table-row");
|
|
23262
23526
|
});
|
|
23263
23527
|
Alpine.directive("h-table-caption", (el) => {
|
|
@@ -23280,18 +23544,23 @@ function tabs_default(Alpine) {
|
|
|
23280
23544
|
el.classList.add(
|
|
23281
23545
|
"group/tab-bar",
|
|
23282
23546
|
"flex",
|
|
23283
|
-
"gap-1
|
|
23547
|
+
"gap-1",
|
|
23284
23548
|
"bg-object-header",
|
|
23285
23549
|
"text-object-header-foreground",
|
|
23286
23550
|
"group-data-[orientation=horizontal]/tabs:flex-row",
|
|
23287
23551
|
"group-data-[orientation=vertical]/tabs:flex-col",
|
|
23288
|
-
"data-
|
|
23289
|
-
"data-
|
|
23290
|
-
"data-
|
|
23291
|
-
"
|
|
23292
|
-
"data-[
|
|
23293
|
-
"data-[
|
|
23294
|
-
"data-[
|
|
23552
|
+
"[&:not([data-floating=true])]:group-data-[orientation=horizontal]/tabs:inset-shadow-[0_-.063rem_var(--border)]",
|
|
23553
|
+
"[&:not([data-floating=true])]:group-data-[orientation=vertical]/tabs:inset-shadow-[-.063rem_0_var(--border)]",
|
|
23554
|
+
"[&:not([data-floating=true])]:group-data-[orientation=horizontal]/tabs:h-10",
|
|
23555
|
+
"[&:not([data-floating=true])]:group-data-[orientation=horizontal]/tabs:min-h-10",
|
|
23556
|
+
"[&:not([data-floating=true])]:data-[size=sm]:group-data-[orientation=horizontal]/tabs:h-8",
|
|
23557
|
+
"[&:not([data-floating=true])]:data-[size=sm]:group-data-[orientation=horizontal]/tabs:min-h-8",
|
|
23558
|
+
"[&:not([data-floating=true])]:data-[size=lg]:group-data-[orientation=horizontal]/tabs:h-12",
|
|
23559
|
+
"[&:not([data-floating=true])]:data-[size=lg]:group-data-[orientation=horizontal]/tabs:min-h-12",
|
|
23560
|
+
"data-[floating=true]:border",
|
|
23561
|
+
"data-[floating=true]:shadow-xs",
|
|
23562
|
+
"data-[floating=true]:rounded-lg",
|
|
23563
|
+
"data-[floating=true]:p-[0.188rem]"
|
|
23295
23564
|
);
|
|
23296
23565
|
el.setAttribute("data-slot", "tab-bar");
|
|
23297
23566
|
});
|
|
@@ -23304,8 +23573,8 @@ function tabs_default(Alpine) {
|
|
|
23304
23573
|
"group-data-[orientation=horizontal]/tabs:flex-row",
|
|
23305
23574
|
"group-data-[orientation=vertical]/tabs:flex-col",
|
|
23306
23575
|
"group-data-[orientation=vertical]/tabs:h-fit",
|
|
23307
|
-
"
|
|
23308
|
-
"group-data-[
|
|
23576
|
+
"gap-2",
|
|
23577
|
+
"group-data-[floating=true]/tab-bar:gap-1"
|
|
23309
23578
|
);
|
|
23310
23579
|
el.setAttribute("role", "tablist");
|
|
23311
23580
|
el.setAttribute("data-slot", "tab-list");
|
|
@@ -23321,8 +23590,7 @@ function tabs_default(Alpine) {
|
|
|
23321
23590
|
"aria-selected:text-foreground",
|
|
23322
23591
|
"inline-flex",
|
|
23323
23592
|
"group-data-[orientation=vertical]/tabs:w-full",
|
|
23324
|
-
"group-data-[orientation=vertical]/tabs:h-
|
|
23325
|
-
"group-data-[orientation=vertical]/tabs:group-data-[size=sm]/tab-bar:h-8",
|
|
23593
|
+
"group-data-[orientation=vertical]/tabs:h-8",
|
|
23326
23594
|
"group-data-[orientation=horizontal]/tabs:h-full",
|
|
23327
23595
|
"items-center",
|
|
23328
23596
|
"justify-start",
|
|
@@ -23333,21 +23601,21 @@ function tabs_default(Alpine) {
|
|
|
23333
23601
|
"font-medium",
|
|
23334
23602
|
"whitespace-nowrap",
|
|
23335
23603
|
"transition-[color,box-shadow]",
|
|
23336
|
-
"group-data-[
|
|
23337
|
-
"group-data-[
|
|
23338
|
-
"group-data-[
|
|
23339
|
-
"group-data-[
|
|
23340
|
-
"group-data-[
|
|
23341
|
-
"group-data-[
|
|
23342
|
-
"group-data-[
|
|
23343
|
-
"group-data-
|
|
23344
|
-
"group-data-
|
|
23345
|
-
"group-data-
|
|
23346
|
-
"group-data-
|
|
23347
|
-
"group-data-
|
|
23348
|
-
"group-data-
|
|
23349
|
-
"group-data-
|
|
23350
|
-
"group-data-
|
|
23604
|
+
"group-data-[floating=true]/tab-bar:rounded-md",
|
|
23605
|
+
"group-data-[floating=true]/tab-bar:border",
|
|
23606
|
+
"group-data-[floating=true]/tab-bar:border-transparent",
|
|
23607
|
+
"group-data-[floating=true]/tab-bar:aria-selected:bg-background",
|
|
23608
|
+
"group-data-[floating=true]/tab-bar:aria-selected:border-border",
|
|
23609
|
+
"group-data-[floating=true]/tab-bar:hover:bg-background",
|
|
23610
|
+
"group-data-[floating=true]/tab-bar:hover:border-border",
|
|
23611
|
+
"group-[&:not([data-floating=true])]/tab-bar:border-0",
|
|
23612
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:hover:inset-shadow-[0_-.188rem_var(--border)]",
|
|
23613
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:aria-selected:inset-shadow-[0_-.125rem_var(--primary)]",
|
|
23614
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:hover:aria-selected:inset-shadow-[0_-.188rem_var(--primary)]",
|
|
23615
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:px-3",
|
|
23616
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:hover:inset-shadow-[-.188rem_0_var(--border)]",
|
|
23617
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:aria-selected:inset-shadow-[-.125rem_0_var(--primary)]",
|
|
23618
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:hover:aria-selected:inset-shadow-[-.188rem_0_var(--primary)]",
|
|
23351
23619
|
"focus-visible:ring-[3px]",
|
|
23352
23620
|
"focus-visible:outline-1",
|
|
23353
23621
|
"disabled:pointer-events-none",
|
|
@@ -23371,12 +23639,28 @@ function tabs_default(Alpine) {
|
|
|
23371
23639
|
if (modifiers.includes("end"))
|
|
23372
23640
|
el.classList.add(
|
|
23373
23641
|
"group-data-[orientation=horizontal]/tabs:ml-auto",
|
|
23374
|
-
"group-data-
|
|
23642
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:mr-1.5",
|
|
23375
23643
|
"group-data-[orientation=vertical]/tabs:mt-auto",
|
|
23376
|
-
"group-data-
|
|
23644
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:mb-1.5"
|
|
23377
23645
|
);
|
|
23378
23646
|
el.setAttribute("data-slot", "tab-list-actions");
|
|
23379
23647
|
});
|
|
23648
|
+
Alpine.directive("h-tab-list-action", (el) => {
|
|
23649
|
+
setButtonClasses(el);
|
|
23650
|
+
el.classList.add(
|
|
23651
|
+
"group-data-[floating=true]/tab-bar:rounded-md",
|
|
23652
|
+
"group-data-[orientation=horizontal]/tabs:aspect-square",
|
|
23653
|
+
"group-data-[orientation=horizontal]/tabs:w-auto",
|
|
23654
|
+
"group-data-[floating=true]/tab-bar:group-data-[orientation=horizontal]/tabs:h-full",
|
|
23655
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:h-[75%]",
|
|
23656
|
+
"group-data-[orientation=vertical]/tabs:h-9",
|
|
23657
|
+
"group-data-[floating=true]/tab-bar:group-data-[orientation=vertical]/tabs:w-full",
|
|
23658
|
+
"group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:w-[80%]"
|
|
23659
|
+
);
|
|
23660
|
+
el.classList.add(...buttonVariants[el.getAttribute("data-variant") ?? "outline"]);
|
|
23661
|
+
el.setAttribute("role", "button");
|
|
23662
|
+
el.setAttribute("data-slot", "tab-list-action");
|
|
23663
|
+
});
|
|
23380
23664
|
Alpine.directive("h-tabs-content", (el) => {
|
|
23381
23665
|
el.classList.add("flex-1", "outline-none");
|
|
23382
23666
|
el.setAttribute("role", "tabpanel");
|
|
@@ -23445,8 +23729,11 @@ function text_default(Alpine) {
|
|
|
23445
23729
|
case "blockquote":
|
|
23446
23730
|
el.classList.add("mt-6", "border-l-2", "pl-6", "italic");
|
|
23447
23731
|
break;
|
|
23732
|
+
case "code-inline":
|
|
23733
|
+
el.classList.add("bg-muted", "relative", "rounded", "px-[0.3rem]", "py-[0.2rem]", "font-mono", "text-sm", "font-semibold", "whitespace-pre");
|
|
23734
|
+
break;
|
|
23448
23735
|
case "code":
|
|
23449
|
-
el.classList.add("bg-muted", "relative", "rounded", "
|
|
23736
|
+
el.classList.add("bg-muted", "relative", "rounded", "p-3", "font-mono", "text-sm", "font-semibold", "whitespace-pre");
|
|
23450
23737
|
break;
|
|
23451
23738
|
case "lead":
|
|
23452
23739
|
el.classList.add("text-muted-foreground", "text-xl");
|
|
@@ -23480,9 +23767,9 @@ function textarea_default(Alpine) {
|
|
|
23480
23767
|
"aria-invalid:ring-negative/20",
|
|
23481
23768
|
"dark:aria-invalid:ring-negative/40",
|
|
23482
23769
|
"aria-invalid:border-negative",
|
|
23483
|
-
"invalid
|
|
23484
|
-
"dark:invalid
|
|
23485
|
-
"invalid
|
|
23770
|
+
"invalid:!ring-negative/20",
|
|
23771
|
+
"dark:invalid:!ring-negative/40",
|
|
23772
|
+
"invalid:!border-negative",
|
|
23486
23773
|
"bg-input-inner",
|
|
23487
23774
|
"flex",
|
|
23488
23775
|
"field-sizing-content",
|
|
@@ -23522,7 +23809,7 @@ function tile_default(Alpine) {
|
|
|
23522
23809
|
"flex",
|
|
23523
23810
|
"items-center",
|
|
23524
23811
|
"text-sm",
|
|
23525
|
-
"rounded-
|
|
23812
|
+
"rounded-lg",
|
|
23526
23813
|
"transition-colors",
|
|
23527
23814
|
"[a]:hover:bg-secondary-hover",
|
|
23528
23815
|
"[a]:hover:text-secondary-foreground",
|
|
@@ -23570,10 +23857,10 @@ function tile_default(Alpine) {
|
|
|
23570
23857
|
el.setAttribute("data-slot", "tile-media");
|
|
23571
23858
|
switch (el.getAttribute("data-variant")) {
|
|
23572
23859
|
case "icon":
|
|
23573
|
-
el.classList.add("size-8", "border", "rounded-
|
|
23860
|
+
el.classList.add("size-8", "border", "rounded-lg", "bg-muted", "[&_svg:not([class*='size-'])]:size-4");
|
|
23574
23861
|
break;
|
|
23575
23862
|
case "image":
|
|
23576
|
-
el.classList.add("size-10", "rounded-
|
|
23863
|
+
el.classList.add("size-10", "rounded-lg", "overflow-hidden", "[&_img]:size-full", "[&_img]:object-cover");
|
|
23577
23864
|
break;
|
|
23578
23865
|
default:
|
|
23579
23866
|
el.classList.add("bg-transparent");
|
|
@@ -23668,14 +23955,16 @@ function timepicker_default(Alpine) {
|
|
|
23668
23955
|
el.classList.add(
|
|
23669
23956
|
"cursor-pointer",
|
|
23670
23957
|
"border-input",
|
|
23671
|
-
"
|
|
23672
|
-
"focus-visible:
|
|
23673
|
-
"
|
|
23674
|
-
"
|
|
23675
|
-
"aria-invalid:
|
|
23676
|
-
"invalid:ring-negative/
|
|
23677
|
-
"
|
|
23678
|
-
"invalid:
|
|
23958
|
+
"[&>input]:appearance-none",
|
|
23959
|
+
"has-[input:focus-visible]:border-ring",
|
|
23960
|
+
"has-[input:focus-visible]:ring-[3px]",
|
|
23961
|
+
"has-[input:focus-visible]:ring-ring/50",
|
|
23962
|
+
"dark:has-[aria-invalid=true]:ring-negative/40",
|
|
23963
|
+
"dark:has-[input:invalid]:ring-negative/40",
|
|
23964
|
+
"has-[aria-invalid=true]:border-negative",
|
|
23965
|
+
"has-[aria-invalid=true]:ring-negative/20",
|
|
23966
|
+
"has-[input:invalid]:border-negative",
|
|
23967
|
+
"has-[input:invalid]:ring-negative/20",
|
|
23679
23968
|
"hover:bg-secondary-hover",
|
|
23680
23969
|
"active:bg-secondary-active",
|
|
23681
23970
|
"flex",
|
|
@@ -23693,8 +23982,8 @@ function timepicker_default(Alpine) {
|
|
|
23693
23982
|
"whitespace-nowrap",
|
|
23694
23983
|
"shadow-control",
|
|
23695
23984
|
"transition-[color,box-shadow]",
|
|
23985
|
+
"duration-200",
|
|
23696
23986
|
"outline-none",
|
|
23697
|
-
"focus-visible:ring-[3px]",
|
|
23698
23987
|
"has-[input:disabled]:pointer-events-none",
|
|
23699
23988
|
"has-[input:disabled]:opacity-50",
|
|
23700
23989
|
"[&_svg]:pointer-events-none",
|
|
@@ -23703,6 +23992,7 @@ function timepicker_default(Alpine) {
|
|
|
23703
23992
|
"[&_svg]:opacity-50"
|
|
23704
23993
|
);
|
|
23705
23994
|
el.setAttribute("data-slot", "time-picker");
|
|
23995
|
+
el.setAttribute("tabindex", "-1");
|
|
23706
23996
|
el.appendChild(
|
|
23707
23997
|
(0, import_lucide5.createElement)(import_lucide5.Clock, {
|
|
23708
23998
|
class: ["opacity-50 size-4 transition-transform duration-200"],
|
|
@@ -23730,7 +24020,8 @@ function timepicker_default(Alpine) {
|
|
|
23730
24020
|
} else {
|
|
23731
24021
|
el._timepicker.is12Hour = new Intl.DateTimeFormat(el._timepicker.locale, { hour: "numeric" }).resolvedOptions().hour12;
|
|
23732
24022
|
}
|
|
23733
|
-
const handler2 = () => {
|
|
24023
|
+
const handler2 = (event) => {
|
|
24024
|
+
if (event.type === "keydown" && event.key !== "Enter") return;
|
|
23734
24025
|
el._timepicker.expanded = !el._timepicker.expanded;
|
|
23735
24026
|
el.setAttribute("aria-expanded", el._timepicker.expanded);
|
|
23736
24027
|
Alpine2.nextTick(() => {
|
|
@@ -23742,8 +24033,10 @@ function timepicker_default(Alpine) {
|
|
|
23742
24033
|
});
|
|
23743
24034
|
};
|
|
23744
24035
|
el.addEventListener("click", handler2);
|
|
24036
|
+
el.addEventListener("keydown", handler2);
|
|
23745
24037
|
cleanup(() => {
|
|
23746
24038
|
el.removeEventListener("click", handler2);
|
|
24039
|
+
el.removeEventListener("keydown", handler2);
|
|
23747
24040
|
top.removeEventListener("click", el._timepicker.close);
|
|
23748
24041
|
});
|
|
23749
24042
|
});
|
|
@@ -24254,59 +24547,59 @@ function toolbar_default(Alpine) {
|
|
|
24254
24547
|
"hbox",
|
|
24255
24548
|
"shrink-0",
|
|
24256
24549
|
"items-center",
|
|
24257
|
-
"px-
|
|
24550
|
+
"px-1",
|
|
24551
|
+
'has-[>[data-slot="avatar"]:last-child]:pr-2',
|
|
24552
|
+
'has-[>[data-slot="toolbar-image"]:first-child]:pl-2',
|
|
24258
24553
|
"gap-1",
|
|
24259
24554
|
modifiers.includes("footer") ? "border-t" : "border-b",
|
|
24260
24555
|
"w-full",
|
|
24261
|
-
"h-
|
|
24556
|
+
"h-12",
|
|
24262
24557
|
"data-[size=sm]:h-8",
|
|
24558
|
+
"data-[size=md]:h-10",
|
|
24263
24559
|
"data-[variant=transparent]:bg-transparent",
|
|
24264
|
-
"data-[variant=transparent]:text-foreground"
|
|
24560
|
+
"data-[variant=transparent]:text-foreground",
|
|
24561
|
+
"data-[floating=true]:shadow-xs",
|
|
24562
|
+
"data-[floating=true]:rounded-lg",
|
|
24563
|
+
"data-[floating=true]:border"
|
|
24265
24564
|
);
|
|
24266
24565
|
el.setAttribute("data-slot", "toolbar");
|
|
24267
24566
|
});
|
|
24268
24567
|
Alpine.directive("h-toolbar-image", (el) => {
|
|
24269
|
-
el.classList.add("size-8", "[[data-size=sm]_&]:size-6");
|
|
24568
|
+
el.classList.add("size-8", "[[data-size=md]_&]:size-7", "[[data-size=sm]_&]:size-6");
|
|
24270
24569
|
el.setAttribute("data-slot", "toolbar-image");
|
|
24271
24570
|
});
|
|
24272
24571
|
Alpine.directive("h-toolbar-title", (el) => {
|
|
24273
|
-
el.classList.add("text", "[[data-size=sm]_&]:text-sm", "font-medium", "whitespace-nowrap", "text-ellipsis", "overflow-hidden");
|
|
24572
|
+
el.classList.add("text", "[[data-size=sm]_&]:text-sm", "[[data-size=md]_&]:text-sm", "first:pl-2", "font-medium", "whitespace-nowrap", "text-ellipsis", "overflow-hidden");
|
|
24274
24573
|
el.setAttribute("data-slot", "toolbar-title");
|
|
24275
24574
|
});
|
|
24276
24575
|
Alpine.directive("h-toolbar-spacer", (el) => {
|
|
24277
24576
|
el.classList.add("flex-[1_auto]", "h-full");
|
|
24577
|
+
el.setAttribute("tabindex", "-1");
|
|
24278
24578
|
el.setAttribute("data-slot", "toolbar-spacer");
|
|
24279
24579
|
});
|
|
24280
24580
|
Alpine.directive("h-toolbar-separator", (el) => {
|
|
24281
|
-
el.classList.add("w-px", "h-8", "[[data-size=sm]_&]:h-6", "border-l");
|
|
24581
|
+
el.classList.add("w-px", "h-8", "[[data-size=md]_&]:h-6", "[[data-size=sm]_&]:h-6", "border-l");
|
|
24282
24582
|
el.setAttribute("data-slot", "toolbar-separator");
|
|
24283
24583
|
});
|
|
24284
24584
|
}
|
|
24285
24585
|
|
|
24286
24586
|
// src/components/tooltip.js
|
|
24287
24587
|
function tooltip_default(Alpine) {
|
|
24288
|
-
Alpine.directive("h-tooltip", (el, {}, { Alpine: Alpine2 }) => {
|
|
24588
|
+
Alpine.directive("h-tooltip-trigger", (el, {}, { Alpine: Alpine2, cleanup }) => {
|
|
24289
24589
|
el._tooltip = Alpine2.reactive({
|
|
24290
24590
|
id: void 0,
|
|
24291
24591
|
controls: `hpc${v4_default()}`,
|
|
24292
24592
|
shown: false
|
|
24293
24593
|
});
|
|
24294
|
-
el.setAttribute("data-slot", "tooltip");
|
|
24295
|
-
});
|
|
24296
|
-
Alpine.directive("h-tooltip-trigger", (el, {}, { Alpine: Alpine2, cleanup }) => {
|
|
24297
|
-
const tooltip = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_tooltip"));
|
|
24298
|
-
if (!tooltip) {
|
|
24299
|
-
throw new Error("h-tooltip-trigger must be inside an h-tooltip element");
|
|
24300
|
-
}
|
|
24301
24594
|
if (el.hasAttribute("id")) {
|
|
24302
|
-
|
|
24595
|
+
el._tooltip.id = el.getAttribute("id");
|
|
24303
24596
|
} else {
|
|
24304
|
-
|
|
24305
|
-
el.setAttribute("id",
|
|
24597
|
+
el._tooltip.id = `hp${v4_default()}`;
|
|
24598
|
+
el.setAttribute("id", el._tooltip.id);
|
|
24306
24599
|
}
|
|
24307
|
-
el.setAttribute("aria-describedby",
|
|
24600
|
+
el.setAttribute("aria-describedby", el._tooltip.controls);
|
|
24308
24601
|
const handler2 = (event) => {
|
|
24309
|
-
|
|
24602
|
+
el._tooltip.shown = event.type === "pointerenter";
|
|
24310
24603
|
};
|
|
24311
24604
|
el.addEventListener("pointerenter", handler2);
|
|
24312
24605
|
el.addEventListener("pointerleave", handler2);
|
|
@@ -24315,20 +24608,25 @@ function tooltip_default(Alpine) {
|
|
|
24315
24608
|
el.removeEventListener("pointerleave", handler2);
|
|
24316
24609
|
});
|
|
24317
24610
|
});
|
|
24318
|
-
Alpine.directive("h-tooltip
|
|
24319
|
-
const tooltip =
|
|
24611
|
+
Alpine.directive("h-tooltip", (el, {}, { effect }) => {
|
|
24612
|
+
const tooltip = (() => {
|
|
24613
|
+
let sibling = el.previousElementSibling;
|
|
24614
|
+
while (sibling && !sibling.hasOwnProperty("_tooltip")) {
|
|
24615
|
+
sibling = sibling.previousElementSibling;
|
|
24616
|
+
}
|
|
24617
|
+
return sibling;
|
|
24618
|
+
})();
|
|
24320
24619
|
if (!tooltip) {
|
|
24321
|
-
throw new Error("h-tooltip
|
|
24620
|
+
throw new Error("h-tooltip must be placed after an h-tooltip-trigger element");
|
|
24322
24621
|
}
|
|
24323
24622
|
el.classList.add("absolute", "bg-foreground", "text-background", "z-50", "w-fit", "rounded-md", "px-3", "py-1.5", "text-xs", "text-balance");
|
|
24324
|
-
el.setAttribute("data-slot", "tooltip
|
|
24623
|
+
el.setAttribute("data-slot", "tooltip");
|
|
24325
24624
|
el.setAttribute("id", tooltip._tooltip.controls);
|
|
24326
|
-
const control = tooltip.querySelector(`#${tooltip._tooltip.id}`);
|
|
24327
24625
|
const arrowEl = document.createElement("span");
|
|
24328
24626
|
arrowEl.classList.add("absolute", "bg-foreground", "fill-foreground", "z-50", "size-2.5", "rotate-45", "rounded-[2px]");
|
|
24329
24627
|
el.appendChild(arrowEl);
|
|
24330
24628
|
function updatePosition() {
|
|
24331
|
-
computePosition2(
|
|
24629
|
+
computePosition2(tooltip, el, {
|
|
24332
24630
|
placement: "top",
|
|
24333
24631
|
middleware: [offset2(10), flip2(), shift2({ padding: 4 }), arrow2({ element: arrowEl })]
|
|
24334
24632
|
}).then(({ x, y, middlewareData, placement }) => {
|
|
@@ -24362,6 +24660,26 @@ function tooltip_default(Alpine) {
|
|
|
24362
24660
|
});
|
|
24363
24661
|
}
|
|
24364
24662
|
|
|
24663
|
+
// package.json
|
|
24664
|
+
var version = "0.5.0";
|
|
24665
|
+
|
|
24666
|
+
// src/utils/breakpoint-listener.js
|
|
24667
|
+
function getBreakpointListener(handler2, breakpoint = 768) {
|
|
24668
|
+
const mql = top.matchMedia(`(width <= ${breakpoint}px)`);
|
|
24669
|
+
const onWidthChange = (event) => {
|
|
24670
|
+
handler2(event.matches);
|
|
24671
|
+
};
|
|
24672
|
+
mql.addEventListener("change", onWidthChange);
|
|
24673
|
+
handler2(mql.matches);
|
|
24674
|
+
return {
|
|
24675
|
+
_mql: mql,
|
|
24676
|
+
_onWidthChange: onWidthChange,
|
|
24677
|
+
remove() {
|
|
24678
|
+
this._mql.removeEventListener("change", this._onWidthChange);
|
|
24679
|
+
}
|
|
24680
|
+
};
|
|
24681
|
+
}
|
|
24682
|
+
|
|
24365
24683
|
// src/utils/theme.js
|
|
24366
24684
|
var colorSchemeKey = "codbex.harmonia.colorMode";
|
|
24367
24685
|
var savedScheme = localStorage.getItem(colorSchemeKey);
|
|
@@ -24386,62 +24704,75 @@ var initColorScheme = () => {
|
|
|
24386
24704
|
};
|
|
24387
24705
|
var setColorScheme = (mode) => {
|
|
24388
24706
|
if (mode === "dark") {
|
|
24707
|
+
document.documentElement.classList.add("dark");
|
|
24389
24708
|
localStorage.setItem(colorSchemeKey, "dark");
|
|
24390
24709
|
window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change", colorSchemeChange);
|
|
24391
24710
|
} else if (mode === "light") {
|
|
24711
|
+
document.documentElement.classList.remove("dark");
|
|
24392
24712
|
localStorage.setItem(colorSchemeKey, "light");
|
|
24393
24713
|
window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change", colorSchemeChange);
|
|
24394
24714
|
} else {
|
|
24715
|
+
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
24716
|
+
document.documentElement.classList.add("dark");
|
|
24717
|
+
} else {
|
|
24718
|
+
document.documentElement.classList.remove("dark");
|
|
24719
|
+
}
|
|
24395
24720
|
localStorage.setItem(colorSchemeKey, "auto");
|
|
24396
24721
|
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", colorSchemeChange);
|
|
24397
24722
|
}
|
|
24398
24723
|
};
|
|
24724
|
+
var getColorScheme = () => {
|
|
24725
|
+
const theme = localStorage.getItem(colorSchemeKey);
|
|
24726
|
+
if (theme) return theme;
|
|
24727
|
+
else if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
24728
|
+
return "dark";
|
|
24729
|
+
}
|
|
24730
|
+
return "light";
|
|
24731
|
+
};
|
|
24399
24732
|
initColorScheme();
|
|
24400
24733
|
|
|
24401
24734
|
// src/module.js
|
|
24402
|
-
var
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24409
|
-
|
|
24410
|
-
|
|
24411
|
-
|
|
24412
|
-
|
|
24413
|
-
|
|
24414
|
-
|
|
24415
|
-
|
|
24416
|
-
|
|
24417
|
-
|
|
24418
|
-
|
|
24419
|
-
|
|
24420
|
-
|
|
24421
|
-
|
|
24422
|
-
|
|
24423
|
-
|
|
24424
|
-
|
|
24425
|
-
|
|
24426
|
-
|
|
24427
|
-
|
|
24428
|
-
|
|
24429
|
-
|
|
24430
|
-
|
|
24431
|
-
|
|
24432
|
-
|
|
24433
|
-
|
|
24434
|
-
|
|
24435
|
-
|
|
24436
|
-
|
|
24437
|
-
|
|
24438
|
-
|
|
24439
|
-
|
|
24440
|
-
|
|
24441
|
-
},
|
|
24442
|
-
setColorScheme
|
|
24735
|
+
var registerComponents = (registerPlugin) => {
|
|
24736
|
+
registerPlugin(accordion_default);
|
|
24737
|
+
registerPlugin(alert_default);
|
|
24738
|
+
registerPlugin(avatar_default);
|
|
24739
|
+
registerPlugin(badge_default);
|
|
24740
|
+
registerPlugin(button_default);
|
|
24741
|
+
registerPlugin(calendar_default);
|
|
24742
|
+
registerPlugin(card_default);
|
|
24743
|
+
registerPlugin(checkbox_default);
|
|
24744
|
+
registerPlugin(collapsible_default);
|
|
24745
|
+
registerPlugin(datepicker_default);
|
|
24746
|
+
registerPlugin(dialog_default);
|
|
24747
|
+
registerPlugin(fieldset_default);
|
|
24748
|
+
registerPlugin(icon_default);
|
|
24749
|
+
registerPlugin(info_page_default);
|
|
24750
|
+
registerPlugin(input_default);
|
|
24751
|
+
registerPlugin(label_default);
|
|
24752
|
+
registerPlugin(list_default);
|
|
24753
|
+
registerPlugin(menu_default);
|
|
24754
|
+
registerPlugin(pagination_default);
|
|
24755
|
+
registerPlugin(popover_default);
|
|
24756
|
+
registerPlugin(progress_default);
|
|
24757
|
+
registerPlugin(radio_default);
|
|
24758
|
+
registerPlugin(range_default);
|
|
24759
|
+
registerPlugin(select_default);
|
|
24760
|
+
registerPlugin(separator_default);
|
|
24761
|
+
registerPlugin(sidebar_default);
|
|
24762
|
+
registerPlugin(skeleton_default);
|
|
24763
|
+
registerPlugin(spinner_default);
|
|
24764
|
+
registerPlugin(switch_default);
|
|
24765
|
+
registerPlugin(table_default);
|
|
24766
|
+
registerPlugin(tabs_default);
|
|
24767
|
+
registerPlugin(tag_default);
|
|
24768
|
+
registerPlugin(text_default);
|
|
24769
|
+
registerPlugin(textarea_default);
|
|
24770
|
+
registerPlugin(tile_default);
|
|
24771
|
+
registerPlugin(timepicker_default);
|
|
24772
|
+
registerPlugin(toolbar_default);
|
|
24773
|
+
registerPlugin(tooltip_default);
|
|
24443
24774
|
};
|
|
24444
|
-
var module_default =
|
|
24775
|
+
var module_default = registerComponents;
|
|
24445
24776
|
export {
|
|
24446
24777
|
accordion_default as Accordion,
|
|
24447
24778
|
alert_default as Alert,
|
|
@@ -24459,6 +24790,7 @@ export {
|
|
|
24459
24790
|
info_page_default as InfoPage,
|
|
24460
24791
|
input_default as Input,
|
|
24461
24792
|
label_default as Label,
|
|
24793
|
+
list_default as List,
|
|
24462
24794
|
menu_default as Menu,
|
|
24463
24795
|
pagination_default as Pagination,
|
|
24464
24796
|
popover_default as Popover,
|
|
@@ -24480,7 +24812,12 @@ export {
|
|
|
24480
24812
|
timepicker_default as TimePicker,
|
|
24481
24813
|
toolbar_default as Toolbar,
|
|
24482
24814
|
tooltip_default as Tooltip,
|
|
24483
|
-
module_default as default
|
|
24815
|
+
module_default as default,
|
|
24816
|
+
getBreakpointListener,
|
|
24817
|
+
getColorScheme,
|
|
24818
|
+
registerComponents,
|
|
24819
|
+
setColorScheme,
|
|
24820
|
+
version
|
|
24484
24821
|
};
|
|
24485
24822
|
/*! Bundled license information:
|
|
24486
24823
|
|