@codbex/harmonia 1.7.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harmonia.css +1 -1
- package/dist/harmonia.esm.js +770 -186
- package/dist/harmonia.esm.min.js +2 -2
- package/dist/harmonia.esm.min.js.map +4 -4
- package/dist/harmonia.js +769 -185
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +4 -4
- package/package.json +1 -1
package/dist/harmonia.js
CHANGED
|
@@ -597,12 +597,12 @@
|
|
|
597
597
|
}) : { single: false };
|
|
598
598
|
el.setAttribute("data-slot", "accordion");
|
|
599
599
|
});
|
|
600
|
-
Alpine.directive("h-accordion-item", (el, { original: original2, expression, modifiers }, {
|
|
600
|
+
Alpine.directive("h-accordion-item", (el, { original: original2, expression, modifiers }, { Alpine: Alpine2 }) => {
|
|
601
601
|
const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
|
|
602
602
|
if (!accordion) {
|
|
603
603
|
throw new Error(`${original2} must be inside an accordion`);
|
|
604
604
|
}
|
|
605
|
-
el.classList.add("border-b", "last:border-b-0"
|
|
605
|
+
el.classList.add("border-b", "last:border-b-0");
|
|
606
606
|
el.setAttribute("data-slot", "accordion-item");
|
|
607
607
|
const itemId = expression ?? `ha${uuid_default()}`;
|
|
608
608
|
function getIsExpanded() {
|
|
@@ -622,11 +622,6 @@
|
|
|
622
622
|
controls: `ha${uuid_default()}`,
|
|
623
623
|
expanded: getIsExpanded()
|
|
624
624
|
});
|
|
625
|
-
const setAttributes = () => {
|
|
626
|
-
el.setAttribute("data-state", el._h_accordionItem.expanded ? "open" : "closed");
|
|
627
|
-
};
|
|
628
|
-
setAttributes();
|
|
629
|
-
effect(setAttributes);
|
|
630
625
|
});
|
|
631
626
|
Alpine.directive("h-accordion-trigger", (el, { original: original2, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
632
627
|
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
@@ -637,23 +632,12 @@
|
|
|
637
632
|
if (!accordionItem || !accordion) {
|
|
638
633
|
throw new Error(`${original2} must have an accordion and accordion item parent elements`);
|
|
639
634
|
}
|
|
640
|
-
el.classList.add(
|
|
641
|
-
"flex",
|
|
642
|
-
"h-12",
|
|
643
|
-
"[[data-size=md]_&]:h-10",
|
|
644
|
-
"[[data-size=sm]_&]:h-8",
|
|
645
|
-
"[[data-variant=header]_&]:bg-object-header",
|
|
646
|
-
"[[data-variant=header]_&]:text-object-header-foreground",
|
|
647
|
-
"[[data-variant=header]_&]:px-4",
|
|
648
|
-
"[[data-variant=header]_&]:border-b",
|
|
649
|
-
"[[data-size=md][data-variant=header]_&]:px-3",
|
|
650
|
-
"[[data-size=sm][data-variant=header]_&]:px-2.5"
|
|
651
|
-
);
|
|
635
|
+
el.classList.add("flex", "h-12", "min-h-12", "[[data-size=md]_&]:h-10", "[[data-size=md]_&]:min-h-10", "[[data-size=sm]_&]:h-8", "[[data-size=sm]_&]:min-h-8");
|
|
652
636
|
el.setAttribute("tabIndex", "-1");
|
|
653
637
|
const getLabel = evaluateLater(expression);
|
|
654
638
|
const chevronDown = createSvg({
|
|
655
639
|
icon: ChevronDown,
|
|
656
|
-
classes: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200",
|
|
640
|
+
classes: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform motion-reduce:transition-none duration-200",
|
|
657
641
|
attrs: {
|
|
658
642
|
"aria-hidden": true,
|
|
659
643
|
role: "presentation"
|
|
@@ -675,12 +659,13 @@
|
|
|
675
659
|
"text-sm",
|
|
676
660
|
"font-medium",
|
|
677
661
|
"transition-all",
|
|
662
|
+
"motion-reduce:transition-none",
|
|
678
663
|
"outline-none",
|
|
679
664
|
"hover:underline",
|
|
680
665
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
681
666
|
"disabled:pointer-events-none",
|
|
682
667
|
"disabled:opacity-50",
|
|
683
|
-
"[&[
|
|
668
|
+
"[&[aria-expanded=true]>svg]:rotate-180"
|
|
684
669
|
);
|
|
685
670
|
el.appendChild(button);
|
|
686
671
|
effect(() => {
|
|
@@ -692,7 +677,6 @@
|
|
|
692
677
|
button.setAttribute("id", accordionItem._h_accordionItem.id);
|
|
693
678
|
button.setAttribute("aria-controls", accordionItem._h_accordionItem.controls);
|
|
694
679
|
const setAttributes = () => {
|
|
695
|
-
button.setAttribute("data-state", accordionItem._h_accordionItem.expanded ? "open" : "closed");
|
|
696
680
|
button.setAttribute("aria-expanded", accordionItem._h_accordionItem.expanded);
|
|
697
681
|
};
|
|
698
682
|
const handler = () => {
|
|
@@ -716,16 +700,46 @@
|
|
|
716
700
|
});
|
|
717
701
|
}
|
|
718
702
|
});
|
|
719
|
-
Alpine.directive("h-accordion-content", (el, _, { effect, Alpine: Alpine2 }) => {
|
|
720
|
-
el.classList.add("
|
|
703
|
+
Alpine.directive("h-accordion-content", (el, _, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
704
|
+
el.classList.add("pb-0", "overflow-hidden", "text-sm", "hidden", "transition-[opacity,max-height,padding-bottom]", "motion-reduce:transition-none", "duration-200", "ease-out", "opacity-0");
|
|
721
705
|
el.setAttribute("data-slot", "accordion-content");
|
|
722
706
|
const parent = Alpine2.findClosest(el.parentElement, (parent2) => parent2.hasOwnProperty("_h_accordionItem"));
|
|
723
707
|
if (parent) {
|
|
708
|
+
let onTransitionEnd = function(event) {
|
|
709
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
710
|
+
el.classList.add("hidden");
|
|
711
|
+
}
|
|
712
|
+
};
|
|
724
713
|
el.setAttribute("id", parent._h_accordionItem.controls);
|
|
725
714
|
el.setAttribute("aria-labelledby", parent._h_accordionItem.id);
|
|
726
|
-
el.setAttribute("data-state", parent._h_accordionItem.expanded ? "open" : "closed");
|
|
727
715
|
effect(() => {
|
|
728
|
-
|
|
716
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
717
|
+
el.style.removeProperty("max-height");
|
|
718
|
+
if (parent._h_accordionItem.expanded) {
|
|
719
|
+
el.classList.add("pb-4", "[[data-size=md]_&]:pb-3", "[[data-size=sm]_&]:pb-2");
|
|
720
|
+
el.classList.remove("hidden", "pb-0", "opacity-0");
|
|
721
|
+
} else {
|
|
722
|
+
el.classList.add("hidden", "pb-0", "opacity-0");
|
|
723
|
+
el.classList.remove("pb-4", "[[data-size=md]_&]:pb-3", "[[data-size=sm]_&]:pb-2");
|
|
724
|
+
}
|
|
725
|
+
} else if (parent._h_accordionItem.expanded) {
|
|
726
|
+
if (el.classList.contains("hidden")) {
|
|
727
|
+
el.classList.add("pb-4", "[[data-size=md]_&]:pb-3", "[[data-size=sm]_&]:pb-2");
|
|
728
|
+
el.classList.remove("hidden", "pb-0");
|
|
729
|
+
Alpine2.nextTick(() => {
|
|
730
|
+
el.style.maxHeight = `${el.scrollHeight}px`;
|
|
731
|
+
el.classList.remove("opacity-0");
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
} else {
|
|
735
|
+
el.style.maxHeight = "0px";
|
|
736
|
+
el.classList.add("opacity-0", "pb-0");
|
|
737
|
+
el.classList.remove("pb-4", "[[data-size=md]_&]:pb-3", "[[data-size=sm]_&]:pb-2");
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
741
|
+
cleanup(() => {
|
|
742
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
729
743
|
});
|
|
730
744
|
}
|
|
731
745
|
});
|
|
@@ -918,7 +932,9 @@
|
|
|
918
932
|
"focus-visible:border-ring",
|
|
919
933
|
"focus-visible:ring-ring/50",
|
|
920
934
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
921
|
-
"transition-
|
|
935
|
+
"transition-colors",
|
|
936
|
+
"transition-shadow",
|
|
937
|
+
"motion-reduce:transition-none",
|
|
922
938
|
"overflow-hidden"
|
|
923
939
|
);
|
|
924
940
|
el.setAttribute("data-slot", "badge");
|
|
@@ -1006,6 +1022,7 @@
|
|
|
1006
1022
|
default: [
|
|
1007
1023
|
"bg-secondary",
|
|
1008
1024
|
"text-secondary-foreground",
|
|
1025
|
+
"fill-secondary-foreground",
|
|
1009
1026
|
"shadow-button",
|
|
1010
1027
|
"hover:bg-secondary-hover",
|
|
1011
1028
|
"active:bg-secondary-active",
|
|
@@ -1017,6 +1034,7 @@
|
|
|
1017
1034
|
primary: [
|
|
1018
1035
|
"bg-primary",
|
|
1019
1036
|
"text-primary-foreground",
|
|
1037
|
+
"fill-primary-foreground",
|
|
1020
1038
|
"shadow-button",
|
|
1021
1039
|
"focus-visible:outline-primary/50",
|
|
1022
1040
|
"hover:bg-primary-hover",
|
|
@@ -1029,6 +1047,7 @@
|
|
|
1029
1047
|
positive: [
|
|
1030
1048
|
"bg-positive",
|
|
1031
1049
|
"text-positive-foreground",
|
|
1050
|
+
"fill-positive-foreground",
|
|
1032
1051
|
"shadow-button",
|
|
1033
1052
|
"focus-visible:outline-positive/50",
|
|
1034
1053
|
"hover:bg-positive-hover",
|
|
@@ -1041,6 +1060,7 @@
|
|
|
1041
1060
|
negative: [
|
|
1042
1061
|
"bg-negative",
|
|
1043
1062
|
"text-negative-foreground",
|
|
1063
|
+
"fill-negative-foreground",
|
|
1044
1064
|
"shadow-button",
|
|
1045
1065
|
"focus-visible:outline-negative/50",
|
|
1046
1066
|
"hover:bg-negative-hover",
|
|
@@ -1053,6 +1073,7 @@
|
|
|
1053
1073
|
warning: [
|
|
1054
1074
|
"bg-warning",
|
|
1055
1075
|
"text-warning-foreground",
|
|
1076
|
+
"fill-warning-foreground",
|
|
1056
1077
|
"shadow-button",
|
|
1057
1078
|
"focus-visible:outline-warning/50",
|
|
1058
1079
|
"hover:bg-warning-hover",
|
|
@@ -1065,6 +1086,7 @@
|
|
|
1065
1086
|
information: [
|
|
1066
1087
|
"bg-information",
|
|
1067
1088
|
"text-information-foreground",
|
|
1089
|
+
"fill-information-foreground",
|
|
1068
1090
|
"shadow-button",
|
|
1069
1091
|
"focus-visible:outline-information/50",
|
|
1070
1092
|
"hover:bg-information-hover",
|
|
@@ -1078,25 +1100,49 @@
|
|
|
1078
1100
|
"border",
|
|
1079
1101
|
"bg-background",
|
|
1080
1102
|
"text-foreground",
|
|
1103
|
+
"fill-foreground",
|
|
1081
1104
|
"hover:bg-secondary",
|
|
1082
1105
|
"hover:text-secondary-foreground",
|
|
1106
|
+
"hover:fill-secondary-foreground",
|
|
1083
1107
|
"active:bg-secondary-active",
|
|
1108
|
+
"active:text-secondary-foreground",
|
|
1109
|
+
"active:fill-secondary-foreground",
|
|
1084
1110
|
"aria-pressed:bg-secondary-active",
|
|
1111
|
+
"aria-pressed:text-secondary-foreground",
|
|
1112
|
+
"aria-pressed:fill-secondary-foreground",
|
|
1085
1113
|
"active:data-[toggled=true]:bg-secondary-active",
|
|
1114
|
+
"active:data-[toggled=true]:text-secondary-foreground",
|
|
1115
|
+
"active:data-[toggled=true]:fill-secondary-foreground",
|
|
1086
1116
|
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
1087
|
-
"data-[toggled=true]:
|
|
1117
|
+
"hover:data-[toggled=true]:text-secondary-foreground",
|
|
1118
|
+
"hover:data-[toggled=true]:fill-secondary-foreground",
|
|
1119
|
+
"data-[toggled=true]:bg-secondary-active",
|
|
1120
|
+
"data-[toggled=true]:text-secondary-foreground",
|
|
1121
|
+
"data-[toggled=true]:fill-secondary-foreground"
|
|
1088
1122
|
],
|
|
1089
1123
|
transparent: [
|
|
1090
1124
|
"bg-transparent",
|
|
1091
1125
|
"text-foreground",
|
|
1126
|
+
"fill-foreground",
|
|
1092
1127
|
"shadow-none",
|
|
1093
1128
|
"hover:bg-secondary",
|
|
1094
1129
|
"hover:text-secondary-foreground",
|
|
1130
|
+
"hover:fill-secondary-foreground",
|
|
1095
1131
|
"active:bg-secondary-active",
|
|
1132
|
+
"active:text-secondary-foreground",
|
|
1133
|
+
"active:fill-secondary-foreground",
|
|
1096
1134
|
"aria-pressed:bg-secondary-active",
|
|
1135
|
+
"aria-pressed:text-secondary-foreground",
|
|
1136
|
+
"aria-pressed:fill-secondary-foreground",
|
|
1097
1137
|
"active:data-[toggled=true]:bg-secondary-active",
|
|
1138
|
+
"active:data-[toggled=true]:text-secondary-foreground",
|
|
1139
|
+
"active:data-[toggled=true]:fill-secondary-foreground",
|
|
1098
1140
|
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
1099
|
-
"data-[toggled=true]:
|
|
1141
|
+
"hover:data-[toggled=true]:text-secondary-foreground",
|
|
1142
|
+
"hover:data-[toggled=true]:fill-secondary-foreground",
|
|
1143
|
+
"data-[toggled=true]:bg-secondary-active",
|
|
1144
|
+
"data-[toggled=true]:text-secondary-foreground",
|
|
1145
|
+
"data-[toggled=true]:fill-secondary-foreground"
|
|
1100
1146
|
],
|
|
1101
1147
|
link: ["text-primary", "underline-offset-4", "hover:underline"]
|
|
1102
1148
|
};
|
|
@@ -1112,6 +1158,8 @@
|
|
|
1112
1158
|
"text-sm",
|
|
1113
1159
|
"font-medium",
|
|
1114
1160
|
"transition-all",
|
|
1161
|
+
"duration-100",
|
|
1162
|
+
"motion-reduce:transition-none",
|
|
1115
1163
|
"disabled:pointer-events-none",
|
|
1116
1164
|
"disabled:opacity-50",
|
|
1117
1165
|
"[&_svg]:pointer-events-none",
|
|
@@ -2722,11 +2770,25 @@
|
|
|
2722
2770
|
el.classList.add("border", "rounded-control", "gap-2", "p-2");
|
|
2723
2771
|
el.setAttribute("tabindex", "-1");
|
|
2724
2772
|
if (datepicker) {
|
|
2725
|
-
el.classList.add(
|
|
2773
|
+
el.classList.add(
|
|
2774
|
+
"absolute",
|
|
2775
|
+
"bg-popover",
|
|
2776
|
+
"text-popover-foreground",
|
|
2777
|
+
"flex",
|
|
2778
|
+
"flex-col",
|
|
2779
|
+
"hidden",
|
|
2780
|
+
"z-50",
|
|
2781
|
+
"shadow-md",
|
|
2782
|
+
"transition-[opacity,scale]",
|
|
2783
|
+
"motion-reduce:transition-none",
|
|
2784
|
+
"duration-100",
|
|
2785
|
+
"ease-out",
|
|
2786
|
+
"opacity-0",
|
|
2787
|
+
"scale-95"
|
|
2788
|
+
);
|
|
2726
2789
|
el.setAttribute("role", "dialog");
|
|
2727
2790
|
el.setAttribute("aria-modal", "true");
|
|
2728
2791
|
el.setAttribute("data-slot", "date-picker-calendar");
|
|
2729
|
-
el.setAttribute("data-state", datepicker._h_datepicker.state.expanded ? "open" : "closed");
|
|
2730
2792
|
} else {
|
|
2731
2793
|
el.classList.add("shadow-input", "data-[invalid=true]:border-negative", "data-[invalid=true]:ring-negative/20", "dark:data-[invalid=true]:ring-negative/40");
|
|
2732
2794
|
}
|
|
@@ -2774,16 +2836,19 @@
|
|
|
2774
2836
|
if (datepicker) {
|
|
2775
2837
|
datepicker._h_datepicker.input.addEventListener("change", onInputChange);
|
|
2776
2838
|
}
|
|
2839
|
+
function setFromModel() {
|
|
2840
|
+
selected = new Date(el._x_model.get());
|
|
2841
|
+
if (isNaN(selected)) {
|
|
2842
|
+
console.error(`${original2}: input value is not a valid date - ${el._x_model.get()}`);
|
|
2843
|
+
if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
2844
|
+
else el.setAttribute("data-invalid", "true");
|
|
2845
|
+
} else if (datepicker) {
|
|
2846
|
+
datepicker._h_datepicker.input.value = formatter.format(selected);
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2777
2849
|
function checkForModel() {
|
|
2778
2850
|
if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
|
|
2779
|
-
|
|
2780
|
-
if (isNaN(selected)) {
|
|
2781
|
-
console.error(`${original2}: input value is not a valid date - ${el._x_model.get()}`);
|
|
2782
|
-
if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
2783
|
-
else el.setAttribute("data-invalid", "true");
|
|
2784
|
-
} else if (datepicker) {
|
|
2785
|
-
datepicker._h_datepicker.input.value = formatter.format(selected);
|
|
2786
|
-
}
|
|
2851
|
+
setFromModel();
|
|
2787
2852
|
}
|
|
2788
2853
|
}
|
|
2789
2854
|
function dayClick(event) {
|
|
@@ -2830,6 +2895,7 @@
|
|
|
2830
2895
|
"text-sm",
|
|
2831
2896
|
"font-medium",
|
|
2832
2897
|
"transition-all",
|
|
2898
|
+
"motion-reduce:transition-none",
|
|
2833
2899
|
"outline-none",
|
|
2834
2900
|
"focus-visible:border-ring",
|
|
2835
2901
|
"focus-visible:ring-ring/50",
|
|
@@ -2959,6 +3025,9 @@
|
|
|
2959
3025
|
"size-8",
|
|
2960
3026
|
"rounded-control",
|
|
2961
3027
|
"outline-none",
|
|
3028
|
+
"duration-100",
|
|
3029
|
+
"transition-all",
|
|
3030
|
+
"motion-reduce:transition-none",
|
|
2962
3031
|
"hover:bg-secondary-hover",
|
|
2963
3032
|
"hover:text-secondary-foreground",
|
|
2964
3033
|
"focus:bg-secondary-hover",
|
|
@@ -3162,25 +3231,59 @@
|
|
|
3162
3231
|
left: `${x}px`,
|
|
3163
3232
|
top: `${y}px`
|
|
3164
3233
|
});
|
|
3234
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
3165
3235
|
});
|
|
3166
3236
|
}
|
|
3167
3237
|
if (datepicker) {
|
|
3168
3238
|
effect(() => {
|
|
3169
|
-
el.setAttribute("data-state", datepicker._h_datepicker.state.expanded ? "open" : "closed");
|
|
3170
3239
|
if (datepicker._h_datepicker.state.expanded) {
|
|
3240
|
+
el.classList.remove("hidden");
|
|
3171
3241
|
autoUpdateCleanup = autoUpdate(datepicker, el, updatePosition);
|
|
3172
3242
|
Alpine2.nextTick(() => {
|
|
3173
3243
|
focusDay();
|
|
3174
3244
|
});
|
|
3175
3245
|
} else {
|
|
3246
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
3247
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
3248
|
+
Object.assign(el.style, {
|
|
3249
|
+
left: "0px",
|
|
3250
|
+
top: "0px"
|
|
3251
|
+
});
|
|
3252
|
+
} else {
|
|
3253
|
+
el.classList.add("scale-95", "opacity-0");
|
|
3254
|
+
}
|
|
3176
3255
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
3177
|
-
Object.assign(el.style, {
|
|
3178
|
-
left: "0px",
|
|
3179
|
-
top: "0px"
|
|
3180
|
-
});
|
|
3181
3256
|
}
|
|
3182
3257
|
});
|
|
3183
3258
|
}
|
|
3259
|
+
function onTransitionEnd(event) {
|
|
3260
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
3261
|
+
el.classList.add("hidden");
|
|
3262
|
+
Object.assign(el.style, {
|
|
3263
|
+
left: "0px",
|
|
3264
|
+
top: "0px"
|
|
3265
|
+
});
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
if (datepicker) {
|
|
3269
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
3270
|
+
}
|
|
3271
|
+
if (el.hasOwnProperty("_x_model")) {
|
|
3272
|
+
const modelExpression = el.getAttribute("x-model");
|
|
3273
|
+
const evaluateModel = evaluateLater(modelExpression);
|
|
3274
|
+
effect(() => {
|
|
3275
|
+
evaluateModel((value) => {
|
|
3276
|
+
if (!selected && value || value && selected.getTime() !== new Date(value).getTime()) {
|
|
3277
|
+
setFromModel();
|
|
3278
|
+
render();
|
|
3279
|
+
} else if (!value) {
|
|
3280
|
+
if (datepicker) datepicker._h_datepicker.input.value = "";
|
|
3281
|
+
selected = void 0;
|
|
3282
|
+
render();
|
|
3283
|
+
}
|
|
3284
|
+
});
|
|
3285
|
+
});
|
|
3286
|
+
}
|
|
3184
3287
|
cleanup(() => {
|
|
3185
3288
|
el.removeEventListener("keydown", onKeyDown);
|
|
3186
3289
|
for (let d = 0; d < dayCells.length; d++) {
|
|
@@ -3188,6 +3291,7 @@
|
|
|
3188
3291
|
}
|
|
3189
3292
|
if (datepicker) {
|
|
3190
3293
|
datepicker._h_datepicker.input.removeEventListener("change", onInputChange);
|
|
3294
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
3191
3295
|
}
|
|
3192
3296
|
});
|
|
3193
3297
|
});
|
|
@@ -3262,7 +3366,8 @@
|
|
|
3262
3366
|
"shadow-input",
|
|
3263
3367
|
"shrink-0",
|
|
3264
3368
|
"size-5",
|
|
3265
|
-
"transition-
|
|
3369
|
+
"transition-colors",
|
|
3370
|
+
"motion-reduce:transition-none"
|
|
3266
3371
|
);
|
|
3267
3372
|
el.setAttribute("tabindex", "-1");
|
|
3268
3373
|
el.setAttribute("data-slot", "checkbox");
|
|
@@ -3271,57 +3376,6 @@
|
|
|
3271
3376
|
});
|
|
3272
3377
|
}
|
|
3273
3378
|
|
|
3274
|
-
// src/components/collapsible.js
|
|
3275
|
-
function collapsible_default(Alpine) {
|
|
3276
|
-
Alpine.directive("h-collapsible", (el, { expression }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
3277
|
-
el._h_collapsible = Alpine2.reactive({
|
|
3278
|
-
expanded: expression ? evaluate2(expression) : false
|
|
3279
|
-
});
|
|
3280
|
-
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible");
|
|
3281
|
-
if (expression) {
|
|
3282
|
-
const getExpanded = evaluateLater(expression);
|
|
3283
|
-
effect(() => {
|
|
3284
|
-
getExpanded((expanded) => {
|
|
3285
|
-
el._h_collapsible.expanded = expanded;
|
|
3286
|
-
});
|
|
3287
|
-
});
|
|
3288
|
-
}
|
|
3289
|
-
});
|
|
3290
|
-
Alpine.directive("h-collapsible-trigger", (el, { original: original2, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
|
|
3291
|
-
const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
|
|
3292
|
-
if (!collapsible) {
|
|
3293
|
-
throw new Error(`${original2} must be inside a collapsible element`);
|
|
3294
|
-
}
|
|
3295
|
-
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-trigger");
|
|
3296
|
-
if (modifiers.includes("chevron")) {
|
|
3297
|
-
el.classList.add("[&_svg]:transition-transform");
|
|
3298
|
-
if (modifiers.includes("90")) el.classList.add("[&[data-state=open]>svg:not(:first-child):last-child]:rotate-90", "[&[data-state=open]>svg:only-child]:rotate-90");
|
|
3299
|
-
else el.classList.add("[&[data-state=open]>svg:not(:first-child):last-child]:rotate-180", "[&[data-state=open]>svg:only-child]:rotate-180");
|
|
3300
|
-
}
|
|
3301
|
-
const handler = () => {
|
|
3302
|
-
collapsible._h_collapsible.expanded = !collapsible._h_collapsible.expanded;
|
|
3303
|
-
};
|
|
3304
|
-
effect(() => {
|
|
3305
|
-
el.setAttribute("data-state", collapsible._h_collapsible.expanded ? "open" : "closed");
|
|
3306
|
-
});
|
|
3307
|
-
el.addEventListener("click", handler);
|
|
3308
|
-
cleanup(() => {
|
|
3309
|
-
el.removeEventListener("click", handler);
|
|
3310
|
-
});
|
|
3311
|
-
});
|
|
3312
|
-
Alpine.directive("h-collapsible-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
|
|
3313
|
-
const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
|
|
3314
|
-
if (!collapsible) {
|
|
3315
|
-
throw new Error(`${original2} must be inside an h-collapsible element`);
|
|
3316
|
-
}
|
|
3317
|
-
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-content");
|
|
3318
|
-
el.classList.add("data-[state=closed]:!hidden");
|
|
3319
|
-
effect(() => {
|
|
3320
|
-
el.setAttribute("data-state", collapsible._h_collapsible.expanded ? "open" : "closed");
|
|
3321
|
-
});
|
|
3322
|
-
});
|
|
3323
|
-
}
|
|
3324
|
-
|
|
3325
3379
|
// src/common/input-size.js
|
|
3326
3380
|
function setSize(el, size3) {
|
|
3327
3381
|
if (size3 === "sm") {
|
|
@@ -3369,7 +3423,9 @@
|
|
|
3369
3423
|
"border-input",
|
|
3370
3424
|
"flex",
|
|
3371
3425
|
"items-center",
|
|
3372
|
-
"transition-
|
|
3426
|
+
"transition-colors",
|
|
3427
|
+
"transition-shadow",
|
|
3428
|
+
"motion-reduce:transition-none",
|
|
3373
3429
|
"duration-200",
|
|
3374
3430
|
"outline-none",
|
|
3375
3431
|
"pl-3",
|
|
@@ -3444,7 +3500,20 @@
|
|
|
3444
3500
|
if (!datepicker) {
|
|
3445
3501
|
throw new Error(`${original2} must be inside an date-picker element`);
|
|
3446
3502
|
}
|
|
3447
|
-
el.classList.add(
|
|
3503
|
+
el.classList.add(
|
|
3504
|
+
"cursor-pointer",
|
|
3505
|
+
"inline-flex",
|
|
3506
|
+
"items-center",
|
|
3507
|
+
"justify-center",
|
|
3508
|
+
"h-full",
|
|
3509
|
+
"aspect-square",
|
|
3510
|
+
"bg-transparent",
|
|
3511
|
+
"hover:bg-secondary",
|
|
3512
|
+
"hover:text-secondary-foreground",
|
|
3513
|
+
"active:bg-secondary-active",
|
|
3514
|
+
"active:text-secondary-foreground",
|
|
3515
|
+
"outline-none"
|
|
3516
|
+
);
|
|
3448
3517
|
if (datepicker._h_datepicker.inTable) {
|
|
3449
3518
|
el.classList.add(
|
|
3450
3519
|
"focus-visible:inset-ring-ring/50",
|
|
@@ -3475,7 +3544,7 @@
|
|
|
3475
3544
|
el.appendChild(
|
|
3476
3545
|
createSvg({
|
|
3477
3546
|
icon: Calendar,
|
|
3478
|
-
classes: "opacity-70 text-
|
|
3547
|
+
classes: "opacity-70 text-inherit size-4",
|
|
3479
3548
|
attrs: {
|
|
3480
3549
|
"aria-hidden": true,
|
|
3481
3550
|
role: "presentation"
|
|
@@ -3510,11 +3579,20 @@
|
|
|
3510
3579
|
// src/components/dialog.js
|
|
3511
3580
|
function dialog_default(Alpine) {
|
|
3512
3581
|
Alpine.directive("h-dialog-overlay", (el, _, { cleanup }) => {
|
|
3513
|
-
el.classList.add("hidden", "
|
|
3582
|
+
el.classList.add("hidden", "fixed", "inset-0", "z-50", "bg-black/60", "transition-[opacity,scale]", "motion-reduce:transition-none", "duration-200", "ease-out", "opacity-0", "*:scale-95");
|
|
3514
3583
|
el.setAttribute("tabindex", "-1");
|
|
3515
3584
|
el.setAttribute("data-slot", "dialog-overlay");
|
|
3516
3585
|
const observer = new MutationObserver(() => {
|
|
3517
3586
|
if (el.getAttribute("data-open") === "true") {
|
|
3587
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
3588
|
+
el.classList.remove("hidden", "*:scale-95", "opacity-0");
|
|
3589
|
+
} else {
|
|
3590
|
+
el.classList.remove("hidden");
|
|
3591
|
+
Alpine.nextTick(() => {
|
|
3592
|
+
el.offsetHeight;
|
|
3593
|
+
el.classList.remove("*:scale-95", "opacity-0");
|
|
3594
|
+
});
|
|
3595
|
+
}
|
|
3518
3596
|
const inputs = el.getElementsByTagName("INPUT");
|
|
3519
3597
|
if (inputs.length) {
|
|
3520
3598
|
for (let i = 0; i < inputs.length; i++) {
|
|
@@ -3542,11 +3620,24 @@
|
|
|
3542
3620
|
if (buttons.length) {
|
|
3543
3621
|
buttons[0].focus();
|
|
3544
3622
|
}
|
|
3623
|
+
} else {
|
|
3624
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
3625
|
+
el.classList.add("hidden", "*:scale-95", "opacity-0");
|
|
3626
|
+
} else {
|
|
3627
|
+
el.classList.add("*:scale-95", "opacity-0");
|
|
3628
|
+
}
|
|
3545
3629
|
}
|
|
3546
3630
|
});
|
|
3631
|
+
function onTransitionEnd(event) {
|
|
3632
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
3633
|
+
el.classList.add("hidden");
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
3547
3637
|
observer.observe(el, { attributes: true, attributeFilter: ["data-open"] });
|
|
3548
3638
|
cleanup(() => {
|
|
3549
3639
|
observer.disconnect();
|
|
3640
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
3550
3641
|
});
|
|
3551
3642
|
});
|
|
3552
3643
|
Alpine.directive("h-dialog", (el) => {
|
|
@@ -3569,7 +3660,11 @@
|
|
|
3569
3660
|
"p-4",
|
|
3570
3661
|
"shadow-xl",
|
|
3571
3662
|
"sm:max-w-lg",
|
|
3572
|
-
"outline-none"
|
|
3663
|
+
"outline-none",
|
|
3664
|
+
"transition-[opacity,scale]",
|
|
3665
|
+
"motion-reduce:transition-none",
|
|
3666
|
+
"duration-200",
|
|
3667
|
+
"ease-out"
|
|
3573
3668
|
);
|
|
3574
3669
|
el.setAttribute("role", "dialog");
|
|
3575
3670
|
el.setAttribute("data-slot", "dialog");
|
|
@@ -3598,6 +3693,7 @@
|
|
|
3598
3693
|
"rounded-xs",
|
|
3599
3694
|
"opacity-70",
|
|
3600
3695
|
"transition-opacity",
|
|
3696
|
+
"motion-reduce:transition-none",
|
|
3601
3697
|
"hover:opacity-100",
|
|
3602
3698
|
"focus:ring-2",
|
|
3603
3699
|
"focus:ring-offset-2",
|
|
@@ -3628,6 +3724,161 @@
|
|
|
3628
3724
|
});
|
|
3629
3725
|
}
|
|
3630
3726
|
|
|
3727
|
+
// src/components/expansion-panel.js
|
|
3728
|
+
function expansion_panel_default(Alpine) {
|
|
3729
|
+
Alpine.directive("h-exp-panel", (el) => {
|
|
3730
|
+
el.classList.add("vbox", "h-full", "group/exp", "data-[floating=true]:gap-2", "data-[floating=true]:overflow-visible");
|
|
3731
|
+
el.setAttribute("data-slot", "exp-panel");
|
|
3732
|
+
});
|
|
3733
|
+
Alpine.directive("h-exp-panel-item", (el, { expression }, { evaluate: evaluate2, evaluateLater, effect, Alpine: Alpine2 }) => {
|
|
3734
|
+
el.classList.add(
|
|
3735
|
+
"flex",
|
|
3736
|
+
"flex-col",
|
|
3737
|
+
"overflow-hidden",
|
|
3738
|
+
"transition-all",
|
|
3739
|
+
"motion-reduce:transition-none",
|
|
3740
|
+
"duration-300",
|
|
3741
|
+
"ease-out",
|
|
3742
|
+
"h-full",
|
|
3743
|
+
"border-b",
|
|
3744
|
+
"last:border-b-0",
|
|
3745
|
+
"min-h-12",
|
|
3746
|
+
"[[data-size=md]_&]:min-h-10",
|
|
3747
|
+
"[[data-size=sm]_&]:min-h-8",
|
|
3748
|
+
"[[data-floating=true]_&]:border-b-0",
|
|
3749
|
+
"[[data-floating=true]_&]:overflow-visible"
|
|
3750
|
+
);
|
|
3751
|
+
el.setAttribute("data-slot", "exp-panel-item");
|
|
3752
|
+
let itemId;
|
|
3753
|
+
if (el.hasAttribute("id")) {
|
|
3754
|
+
itemId = el.getAttribute("id");
|
|
3755
|
+
} else {
|
|
3756
|
+
itemId = `epi${uuid_default()}`;
|
|
3757
|
+
}
|
|
3758
|
+
function setExpanded(expanded) {
|
|
3759
|
+
if (expanded) {
|
|
3760
|
+
el.classList.add("flex-[1_1_0]");
|
|
3761
|
+
el.classList.remove("flex-[0_1_0]");
|
|
3762
|
+
} else {
|
|
3763
|
+
el.classList.add("flex-[0_1_0]");
|
|
3764
|
+
el.classList.remove("flex-[1_1_0]");
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
el._h_expPanelItem = Alpine2.reactive({
|
|
3768
|
+
controls: itemId,
|
|
3769
|
+
expanded: evaluate2(expression || "false")
|
|
3770
|
+
});
|
|
3771
|
+
if (expression !== "" && expression !== void 0 && expression !== null && expression !== "true" && expression !== "false") {
|
|
3772
|
+
const getIsExpanded = evaluateLater(expression);
|
|
3773
|
+
effect(() => {
|
|
3774
|
+
getIsExpanded((expanded) => {
|
|
3775
|
+
setExpanded(expanded);
|
|
3776
|
+
});
|
|
3777
|
+
});
|
|
3778
|
+
effect(() => {
|
|
3779
|
+
if (evaluate2(expression) !== el._h_expPanelItem.expanded) {
|
|
3780
|
+
evaluate2(`${expression} = ${el._h_expPanelItem.expanded}`);
|
|
3781
|
+
}
|
|
3782
|
+
});
|
|
3783
|
+
} else {
|
|
3784
|
+
effect(() => {
|
|
3785
|
+
setExpanded(el._h_expPanelItem.expanded);
|
|
3786
|
+
});
|
|
3787
|
+
}
|
|
3788
|
+
});
|
|
3789
|
+
Alpine.directive("h-exp-panel-trigger", (el, { original: original2, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
3790
|
+
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
3791
|
+
throw new Error(`${original2} must be a header element`);
|
|
3792
|
+
}
|
|
3793
|
+
const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_expPanelItem"));
|
|
3794
|
+
if (!expPanelItem) {
|
|
3795
|
+
throw new Error(`${original2} must have an exp-panel-item parent element`);
|
|
3796
|
+
}
|
|
3797
|
+
el.classList.add(
|
|
3798
|
+
"bg-object-header",
|
|
3799
|
+
"border-b",
|
|
3800
|
+
"[[data-slot=exp-panel-item]:last-child>&]:not-has-[button[aria-expanded=true]]:group-has-[button[aria-expanded=true]]/exp:border-b-0",
|
|
3801
|
+
"flex",
|
|
3802
|
+
"h-12",
|
|
3803
|
+
"min-h-12",
|
|
3804
|
+
"px-4",
|
|
3805
|
+
"text-object-header-foreground",
|
|
3806
|
+
"[[data-floating=true]_&]:border",
|
|
3807
|
+
"[[data-floating=true]_&]:!border-b",
|
|
3808
|
+
"[[data-floating=true]_&]:rounded-lg",
|
|
3809
|
+
"[[data-floating=true]_&]:shadow-xs",
|
|
3810
|
+
"[[data-size=md]_&]:h-10",
|
|
3811
|
+
"[[data-size=md]_&]:min-h-10",
|
|
3812
|
+
"[[data-size=md]_&]:px-3",
|
|
3813
|
+
"[[data-size=sm]_&]:h-8",
|
|
3814
|
+
"[[data-size=sm]_&]:min-h-8",
|
|
3815
|
+
"[[data-size=sm]_&]:px-2.5",
|
|
3816
|
+
"[[data-variant=transparent]_&]:bg-transparent",
|
|
3817
|
+
"[[data-variant=transparent]_&]:text-foreground"
|
|
3818
|
+
);
|
|
3819
|
+
el.setAttribute("tabIndex", "-1");
|
|
3820
|
+
const getLabel = evaluateLater(expression);
|
|
3821
|
+
const chevronDown = createSvg({
|
|
3822
|
+
icon: ChevronDown,
|
|
3823
|
+
classes: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform motion-reduce:transition-none duration-200",
|
|
3824
|
+
attrs: {
|
|
3825
|
+
"aria-hidden": true,
|
|
3826
|
+
role: "presentation"
|
|
3827
|
+
}
|
|
3828
|
+
});
|
|
3829
|
+
const button = document.createElement("button");
|
|
3830
|
+
button.setAttribute("type", "button");
|
|
3831
|
+
button.setAttribute("tabIndex", "0");
|
|
3832
|
+
button.setAttribute("data-slot", "exp-panel-trigger");
|
|
3833
|
+
button.classList.add(
|
|
3834
|
+
"cursor-pointer",
|
|
3835
|
+
"focus-visible:border-ring",
|
|
3836
|
+
"focus-visible:ring-ring/50",
|
|
3837
|
+
"flex",
|
|
3838
|
+
"flex-1",
|
|
3839
|
+
"items-center",
|
|
3840
|
+
"justify-between",
|
|
3841
|
+
"gap-4",
|
|
3842
|
+
"text-left",
|
|
3843
|
+
"text-sm",
|
|
3844
|
+
"font-medium",
|
|
3845
|
+
"transition-all",
|
|
3846
|
+
"motion-reduce:transition-none",
|
|
3847
|
+
"outline-none",
|
|
3848
|
+
"hover:underline",
|
|
3849
|
+
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
3850
|
+
"disabled:pointer-events-none",
|
|
3851
|
+
"disabled:opacity-50",
|
|
3852
|
+
"[&[aria-expanded=true]>svg]:rotate-180"
|
|
3853
|
+
);
|
|
3854
|
+
el.appendChild(button);
|
|
3855
|
+
effect(() => {
|
|
3856
|
+
getLabel((label) => {
|
|
3857
|
+
button.innerText = label;
|
|
3858
|
+
button.appendChild(chevronDown);
|
|
3859
|
+
});
|
|
3860
|
+
});
|
|
3861
|
+
button.setAttribute("id", expPanelItem._h_expPanelItem.id);
|
|
3862
|
+
button.setAttribute("aria-controls", expPanelItem._h_expPanelItem.controls);
|
|
3863
|
+
const setAttributes = () => {
|
|
3864
|
+
button.setAttribute("aria-expanded", expPanelItem._h_expPanelItem.expanded);
|
|
3865
|
+
};
|
|
3866
|
+
const handler = () => {
|
|
3867
|
+
expPanelItem._h_expPanelItem.expanded = !expPanelItem._h_expPanelItem.expanded;
|
|
3868
|
+
setAttributes();
|
|
3869
|
+
};
|
|
3870
|
+
setAttributes();
|
|
3871
|
+
el.addEventListener("click", handler);
|
|
3872
|
+
cleanup(() => {
|
|
3873
|
+
el.removeEventListener("click", handler);
|
|
3874
|
+
});
|
|
3875
|
+
});
|
|
3876
|
+
Alpine.directive("h-exp-panel-content", (el) => {
|
|
3877
|
+
el.classList.add("flex-1", "overflow-scroll");
|
|
3878
|
+
el.setAttribute("data-slot", "exp-panel-content");
|
|
3879
|
+
});
|
|
3880
|
+
}
|
|
3881
|
+
|
|
3631
3882
|
// src/components/fieldset.js
|
|
3632
3883
|
function fieldset_default(Alpine) {
|
|
3633
3884
|
Alpine.directive("h-fieldset", (el) => {
|
|
@@ -3800,7 +4051,9 @@
|
|
|
3800
4051
|
"[&::-webkit-color-swatch-wrapper]:rounded-0",
|
|
3801
4052
|
"[&::-webkit-color-swatch-wrapper]:p-0",
|
|
3802
4053
|
"text-base",
|
|
3803
|
-
"transition-
|
|
4054
|
+
"transition-colors",
|
|
4055
|
+
"transition-shadow",
|
|
4056
|
+
"motion-reduce:transition-none",
|
|
3804
4057
|
"outline-none",
|
|
3805
4058
|
"file:inline-flex",
|
|
3806
4059
|
"file:h-7",
|
|
@@ -3857,7 +4110,9 @@
|
|
|
3857
4110
|
"rounded-control",
|
|
3858
4111
|
"border",
|
|
3859
4112
|
"shadow-input",
|
|
3860
|
-
"transition-
|
|
4113
|
+
"transition-colors",
|
|
4114
|
+
"transition-shadow",
|
|
4115
|
+
"motion-reduce:transition-none",
|
|
3861
4116
|
"outline-none",
|
|
3862
4117
|
"min-w-0",
|
|
3863
4118
|
"has-[>textarea]:h-auto",
|
|
@@ -3958,7 +4213,10 @@
|
|
|
3958
4213
|
"rounded-control",
|
|
3959
4214
|
"border",
|
|
3960
4215
|
"shadow-input",
|
|
3961
|
-
"transition-
|
|
4216
|
+
"transition-colors",
|
|
4217
|
+
"transition-shadow",
|
|
4218
|
+
"motion-reduce:transition-none",
|
|
4219
|
+
"duration-200",
|
|
3962
4220
|
"outline-none",
|
|
3963
4221
|
"min-w-0",
|
|
3964
4222
|
"has-[input:focus-visible]:border-ring",
|
|
@@ -4003,7 +4261,7 @@
|
|
|
4003
4261
|
stepDown.appendChild(
|
|
4004
4262
|
createSvg({
|
|
4005
4263
|
icon: Minus,
|
|
4006
|
-
classes: "opacity-70
|
|
4264
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
4007
4265
|
attrs: {
|
|
4008
4266
|
"aria-hidden": true,
|
|
4009
4267
|
role: "presentation"
|
|
@@ -4021,16 +4279,23 @@
|
|
|
4021
4279
|
"[input:invalid~&]:border-negative",
|
|
4022
4280
|
"h-full",
|
|
4023
4281
|
"aspect-square",
|
|
4282
|
+
"transition-colors",
|
|
4283
|
+
"motion-reduce:transition-none",
|
|
4284
|
+
"duration-100",
|
|
4024
4285
|
"bg-transparent",
|
|
4025
4286
|
"hover:bg-secondary",
|
|
4287
|
+
"hover:text-secondary-foreground",
|
|
4026
4288
|
"active:bg-secondary-active",
|
|
4289
|
+
"active:text-secondary-foreground",
|
|
4027
4290
|
"outline-none",
|
|
4028
4291
|
"relative",
|
|
4029
4292
|
"[&:hover>svg]:text-secondary-foreground"
|
|
4030
4293
|
);
|
|
4031
4294
|
el.appendChild(stepDown);
|
|
4032
4295
|
const onStepDown = () => {
|
|
4033
|
-
input.
|
|
4296
|
+
if (input.step === "any") {
|
|
4297
|
+
input.value = (parseFloat(input.value) || 0) - 1;
|
|
4298
|
+
} else input.stepDown();
|
|
4034
4299
|
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
4035
4300
|
input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
4036
4301
|
};
|
|
@@ -4044,7 +4309,7 @@
|
|
|
4044
4309
|
stepUp.appendChild(
|
|
4045
4310
|
createSvg({
|
|
4046
4311
|
icon: Plus,
|
|
4047
|
-
classes: "opacity-70
|
|
4312
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
4048
4313
|
attrs: {
|
|
4049
4314
|
"aria-hidden": true,
|
|
4050
4315
|
role: "presentation"
|
|
@@ -4062,16 +4327,23 @@
|
|
|
4062
4327
|
"[input:invalid~&]:border-negative",
|
|
4063
4328
|
"h-full",
|
|
4064
4329
|
"aspect-square",
|
|
4330
|
+
"transition-all",
|
|
4331
|
+
"motion-reduce:transition-none",
|
|
4332
|
+
"duration-100",
|
|
4065
4333
|
"bg-transparent",
|
|
4066
4334
|
"hover:bg-secondary",
|
|
4335
|
+
"hover:text-secondary-foreground",
|
|
4067
4336
|
"active:bg-secondary-active",
|
|
4337
|
+
"active:text-secondary-foreground",
|
|
4068
4338
|
"outline-none",
|
|
4069
4339
|
"relative",
|
|
4070
4340
|
"[&:hover>svg]:text-secondary-foreground"
|
|
4071
4341
|
);
|
|
4072
4342
|
el.appendChild(stepUp);
|
|
4073
4343
|
const onStepUp = () => {
|
|
4074
|
-
input.
|
|
4344
|
+
if (input.step === "any") {
|
|
4345
|
+
input.value = (parseFloat(input.value) || 0) + 1;
|
|
4346
|
+
} else input.stepUp();
|
|
4075
4347
|
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
4076
4348
|
input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
4077
4349
|
};
|
|
@@ -4277,23 +4549,47 @@
|
|
|
4277
4549
|
el._menu_trigger = {
|
|
4278
4550
|
isDropdown: modifiers.includes("dropdown"),
|
|
4279
4551
|
setOpen(open) {
|
|
4280
|
-
el.setAttribute("
|
|
4552
|
+
el.setAttribute("aria-expanded", open);
|
|
4281
4553
|
}
|
|
4282
4554
|
};
|
|
4283
|
-
el.
|
|
4555
|
+
if (el._menu_trigger.isDropdown) {
|
|
4556
|
+
el.setAttribute("aria-haspopup", "true");
|
|
4557
|
+
el.setAttribute("aria-expanded", "false");
|
|
4558
|
+
if (!el.hasAttribute("id")) {
|
|
4559
|
+
el.setAttribute("id", `mt${uuid_default()}`);
|
|
4560
|
+
}
|
|
4561
|
+
}
|
|
4284
4562
|
});
|
|
4285
4563
|
Alpine.directive("h-menu", (el, { original: original2, modifiers }, { cleanup, Alpine: Alpine2 }) => {
|
|
4286
4564
|
if (el.tagName !== "UL") {
|
|
4287
4565
|
throw new Error(`${original2} must be an ul element`);
|
|
4288
4566
|
}
|
|
4289
|
-
el.classList.add(
|
|
4567
|
+
el.classList.add(
|
|
4568
|
+
"hidden",
|
|
4569
|
+
"fixed",
|
|
4570
|
+
"bg-popover",
|
|
4571
|
+
"text-popover-foreground",
|
|
4572
|
+
"font-normal",
|
|
4573
|
+
"z-50",
|
|
4574
|
+
"min-w-[8rem]",
|
|
4575
|
+
"overflow-x-hidden",
|
|
4576
|
+
"overflow-y-auto",
|
|
4577
|
+
"rounded-md",
|
|
4578
|
+
"p-1",
|
|
4579
|
+
"shadow-md",
|
|
4580
|
+
"border",
|
|
4581
|
+
"outline-none",
|
|
4582
|
+
"transition-[opacity,scale]",
|
|
4583
|
+
"motion-reduce:transition-none",
|
|
4584
|
+
"duration-100",
|
|
4585
|
+
"ease-out",
|
|
4586
|
+
"opacity-0",
|
|
4587
|
+
"scale-95"
|
|
4588
|
+
);
|
|
4290
4589
|
el.setAttribute("role", "menu");
|
|
4291
4590
|
el.setAttribute("aria-orientation", "vertical");
|
|
4292
4591
|
el.setAttribute("tabindex", "-1");
|
|
4293
4592
|
el.setAttribute("data-slot", "menu");
|
|
4294
|
-
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
4295
|
-
throw new Error(`${original2} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
4296
|
-
}
|
|
4297
4593
|
const isSubmenu = modifiers.includes("sub");
|
|
4298
4594
|
const menuTrigger = (() => {
|
|
4299
4595
|
if (isSubmenu) return;
|
|
@@ -4302,15 +4598,31 @@
|
|
|
4302
4598
|
sibling = sibling.previousElementSibling;
|
|
4303
4599
|
}
|
|
4304
4600
|
if (!sibling.hasOwnProperty("_menu_trigger")) {
|
|
4305
|
-
throw new Error(`${original2} must be placed after
|
|
4601
|
+
throw new Error(`${original2} menu must be placed after a menu trigger element`);
|
|
4306
4602
|
}
|
|
4307
4603
|
return sibling;
|
|
4308
4604
|
})();
|
|
4309
|
-
|
|
4310
|
-
|
|
4605
|
+
function setAriaAttrubutes(parent) {
|
|
4606
|
+
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
4607
|
+
if (parent && parent.hasAttribute("id")) {
|
|
4608
|
+
el.setAttribute("aria-labelledby", parent.id);
|
|
4609
|
+
} else {
|
|
4610
|
+
throw new Error(`${original2} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
4611
|
+
}
|
|
4612
|
+
}
|
|
4311
4613
|
}
|
|
4312
4614
|
let menuSubItem;
|
|
4313
|
-
if (isSubmenu)
|
|
4615
|
+
if (isSubmenu) {
|
|
4616
|
+
menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
|
|
4617
|
+
if (!menuSubItem) {
|
|
4618
|
+
throw new Error(`${original2} must be placed inside a ${Alpine2.prefixed("h-menu-sub")} element`);
|
|
4619
|
+
}
|
|
4620
|
+
setAriaAttrubutes(menuSubItem);
|
|
4621
|
+
} else if (menuTrigger) {
|
|
4622
|
+
setAriaAttrubutes(menuTrigger._menu_trigger.isDropdown ? menuTrigger : void 0);
|
|
4623
|
+
} else {
|
|
4624
|
+
setAriaAttrubutes();
|
|
4625
|
+
}
|
|
4314
4626
|
function listenForTrigger(listen) {
|
|
4315
4627
|
if (listen) {
|
|
4316
4628
|
if (menuTrigger._menu_trigger.isDropdown) menuTrigger.addEventListener("click", openDropdown);
|
|
@@ -4322,11 +4634,15 @@
|
|
|
4322
4634
|
}
|
|
4323
4635
|
function close(closeParent = false, focusTrigger = false) {
|
|
4324
4636
|
el.pauseKeyEvents = false;
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4637
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
4638
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
4639
|
+
Object.assign(el.style, {
|
|
4640
|
+
left: "0px",
|
|
4641
|
+
top: "0px"
|
|
4642
|
+
});
|
|
4643
|
+
} else {
|
|
4644
|
+
el.classList.add("scale-95", "opacity-0");
|
|
4645
|
+
}
|
|
4330
4646
|
top.removeEventListener("contextmenu", onClick);
|
|
4331
4647
|
top.removeEventListener("click", onClick);
|
|
4332
4648
|
el.removeEventListener("keydown", onKeyDown);
|
|
@@ -4362,7 +4678,9 @@
|
|
|
4362
4678
|
}
|
|
4363
4679
|
function onClick(event) {
|
|
4364
4680
|
if (event.type === "contextmenu") event.preventDefault();
|
|
4365
|
-
|
|
4681
|
+
if (el.getAttribute("data-innerclicks") === "true" && el.contains(event.composedPath()[0])) {
|
|
4682
|
+
return;
|
|
4683
|
+
} else close(isSubmenu);
|
|
4366
4684
|
}
|
|
4367
4685
|
el.pauseKeyEvents = false;
|
|
4368
4686
|
function onKeyDown(event) {
|
|
@@ -4486,6 +4804,7 @@
|
|
|
4486
4804
|
left: `${x}px`,
|
|
4487
4805
|
top: `${y}px`
|
|
4488
4806
|
});
|
|
4807
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
4489
4808
|
});
|
|
4490
4809
|
}
|
|
4491
4810
|
}
|
|
@@ -4519,11 +4838,22 @@
|
|
|
4519
4838
|
} else {
|
|
4520
4839
|
listenForTrigger(true);
|
|
4521
4840
|
}
|
|
4841
|
+
function onTransitionEnd(event) {
|
|
4842
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
4843
|
+
el.classList.add("hidden");
|
|
4844
|
+
Object.assign(el.style, {
|
|
4845
|
+
left: "0px",
|
|
4846
|
+
top: "0px"
|
|
4847
|
+
});
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4850
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
4522
4851
|
cleanup(() => {
|
|
4523
4852
|
if (menuTrigger) listenForTrigger(false);
|
|
4524
4853
|
top.removeEventListener("click", onClick);
|
|
4525
4854
|
top.removeEventListener("contextmenu", onClick);
|
|
4526
4855
|
el.removeEventListener("keydown", onKeyDown);
|
|
4856
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
4527
4857
|
});
|
|
4528
4858
|
});
|
|
4529
4859
|
Alpine.directive("h-menu-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
@@ -4615,6 +4945,9 @@
|
|
|
4615
4945
|
el.appendChild(chevronRight);
|
|
4616
4946
|
const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
|
|
4617
4947
|
if (!parentMenu) throw new Error(`${original2} must have a parent`);
|
|
4948
|
+
if (!el.hasAttribute("id")) {
|
|
4949
|
+
el.setAttribute("id", `ms${uuid_default()}`);
|
|
4950
|
+
}
|
|
4618
4951
|
el._menu_sub = {
|
|
4619
4952
|
open: void 0,
|
|
4620
4953
|
close: void 0,
|
|
@@ -4730,6 +5063,7 @@
|
|
|
4730
5063
|
"aria-[disabled=true]:cursor-not-allowed",
|
|
4731
5064
|
"aria-[disabled=true]:opacity-50",
|
|
4732
5065
|
"transition-all",
|
|
5066
|
+
"motion-reduce:transition-none",
|
|
4733
5067
|
"overflow-hidden",
|
|
4734
5068
|
"aria-[checked=true]:[&>svg]:visible"
|
|
4735
5069
|
);
|
|
@@ -4799,6 +5133,7 @@
|
|
|
4799
5133
|
"aria-[disabled=true]:cursor-not-allowed",
|
|
4800
5134
|
"aria-[disabled=true]:opacity-50",
|
|
4801
5135
|
"transition-all",
|
|
5136
|
+
"motion-reduce:transition-none",
|
|
4802
5137
|
"overflow-hidden",
|
|
4803
5138
|
"before:invisible",
|
|
4804
5139
|
"before:bg-foreground",
|
|
@@ -5004,7 +5339,7 @@
|
|
|
5004
5339
|
const listener = {
|
|
5005
5340
|
added(item) {
|
|
5006
5341
|
const clone = notificationTemplates[item.template].content.firstElementChild.cloneNode(true);
|
|
5007
|
-
clone.classList.add("transform", "transition-all", "duration-300", "ease-out", "opacity-0");
|
|
5342
|
+
clone.classList.add("transform", "transition-all", "motion-reduce:transition-none", "duration-300", "ease-out", "opacity-0");
|
|
5008
5343
|
clone.setAttribute("id", item.id);
|
|
5009
5344
|
Alpine2.addScopeToNode(clone, item.data);
|
|
5010
5345
|
if (!isExtraLarge && !isLarge) {
|
|
@@ -5059,15 +5394,20 @@
|
|
|
5059
5394
|
removed(id) {
|
|
5060
5395
|
const element = el.querySelector(`#${id}`);
|
|
5061
5396
|
if (element) {
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
()
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5397
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
5398
|
+
Alpine2.destroyTree(element);
|
|
5399
|
+
element.remove();
|
|
5400
|
+
} else {
|
|
5401
|
+
element.addEventListener(
|
|
5402
|
+
"transitionend",
|
|
5403
|
+
() => {
|
|
5404
|
+
Alpine2.destroyTree(element);
|
|
5405
|
+
element.remove();
|
|
5406
|
+
},
|
|
5407
|
+
{ once: true }
|
|
5408
|
+
);
|
|
5409
|
+
element.classList.add(element._h_animation_class, "opacity-0");
|
|
5410
|
+
}
|
|
5071
5411
|
}
|
|
5072
5412
|
}
|
|
5073
5413
|
};
|
|
@@ -5177,6 +5517,7 @@
|
|
|
5177
5517
|
"text-sm",
|
|
5178
5518
|
"font-medium",
|
|
5179
5519
|
"transition-all",
|
|
5520
|
+
"motion-reduce:transition-none",
|
|
5180
5521
|
"disabled:pointer-events-none",
|
|
5181
5522
|
"disabled:opacity-50",
|
|
5182
5523
|
"[&_svg]:pointer-events-none",
|
|
@@ -5251,7 +5592,7 @@
|
|
|
5251
5592
|
}
|
|
5252
5593
|
el.setAttribute("type", "button");
|
|
5253
5594
|
if (modifiers.includes("chevron")) {
|
|
5254
|
-
el.classList.add("[&_svg]:transition-transform", "[&[
|
|
5595
|
+
el.classList.add("[&_svg]:transition-transform", "motion-reduce:[&_svg]:transition-none", "[&[aria-expanded=true]>svg:not(:first-child):last-child]:rotate-180");
|
|
5255
5596
|
}
|
|
5256
5597
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "popover-trigger");
|
|
5257
5598
|
if (el.hasAttribute("id")) {
|
|
@@ -5263,7 +5604,6 @@
|
|
|
5263
5604
|
el.setAttribute("aria-controls", el._popover.controls);
|
|
5264
5605
|
el.setAttribute("aria-haspopup", "dialog");
|
|
5265
5606
|
const setAttributes = () => {
|
|
5266
|
-
el.setAttribute("data-state", el._popover.expanded ? "open" : "closed");
|
|
5267
5607
|
el.setAttribute("aria-expanded", el._popover.expanded);
|
|
5268
5608
|
};
|
|
5269
5609
|
const close = () => {
|
|
@@ -5305,13 +5645,32 @@
|
|
|
5305
5645
|
if (!popover) {
|
|
5306
5646
|
throw new Error(`${original2} must be placed after a popover element`);
|
|
5307
5647
|
}
|
|
5308
|
-
el.classList.add(
|
|
5648
|
+
el.classList.add(
|
|
5649
|
+
"absolute",
|
|
5650
|
+
"bg-popover",
|
|
5651
|
+
"text-popover-foreground",
|
|
5652
|
+
"hidden",
|
|
5653
|
+
"top-0",
|
|
5654
|
+
"left-0",
|
|
5655
|
+
"z-50",
|
|
5656
|
+
"min-w-[1rem]",
|
|
5657
|
+
"rounded-md",
|
|
5658
|
+
"border",
|
|
5659
|
+
"shadow-md",
|
|
5660
|
+
"outline-hidden",
|
|
5661
|
+
"overflow-auto",
|
|
5662
|
+
"transition-[opacity,scale]",
|
|
5663
|
+
"motion-reduce:transition-none",
|
|
5664
|
+
"duration-100",
|
|
5665
|
+
"ease-out",
|
|
5666
|
+
"opacity-0",
|
|
5667
|
+
"scale-95"
|
|
5668
|
+
);
|
|
5309
5669
|
el.setAttribute("data-slot", "popover");
|
|
5310
5670
|
el.setAttribute("role", "dialog");
|
|
5311
5671
|
el.setAttribute("tabindex", "-1");
|
|
5312
5672
|
el.setAttribute("id", popover._popover.controls);
|
|
5313
5673
|
el.setAttribute("aria-labelledby", popover._popover.id);
|
|
5314
|
-
el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
|
|
5315
5674
|
let noScroll = modifiers.includes("no-scroll");
|
|
5316
5675
|
if (noScroll) {
|
|
5317
5676
|
el.classList.remove("overflow-auto");
|
|
@@ -5345,22 +5704,39 @@
|
|
|
5345
5704
|
left: `${x}px`,
|
|
5346
5705
|
top: `${y}px`
|
|
5347
5706
|
});
|
|
5707
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
5348
5708
|
});
|
|
5349
5709
|
}
|
|
5350
5710
|
effect(() => {
|
|
5351
|
-
el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
|
|
5352
5711
|
if (popover._popover.expanded) {
|
|
5712
|
+
el.classList.remove("hidden");
|
|
5353
5713
|
autoUpdateCleanup = autoUpdate(popover, el, updatePosition);
|
|
5354
5714
|
} else {
|
|
5715
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
5716
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
5717
|
+
Object.assign(el.style, {
|
|
5718
|
+
left: "0px",
|
|
5719
|
+
top: "0px"
|
|
5720
|
+
});
|
|
5721
|
+
} else {
|
|
5722
|
+
el.classList.add("scale-95", "opacity-0");
|
|
5723
|
+
}
|
|
5355
5724
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
5725
|
+
}
|
|
5726
|
+
});
|
|
5727
|
+
function onTransitionEnd(event) {
|
|
5728
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
5729
|
+
el.classList.add("hidden");
|
|
5356
5730
|
Object.assign(el.style, {
|
|
5357
5731
|
left: "0px",
|
|
5358
5732
|
top: "0px"
|
|
5359
5733
|
});
|
|
5360
5734
|
}
|
|
5361
|
-
}
|
|
5735
|
+
}
|
|
5736
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
5362
5737
|
cleanup(() => {
|
|
5363
5738
|
el.removeEventListener("click", stopPropagation);
|
|
5739
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
5364
5740
|
});
|
|
5365
5741
|
});
|
|
5366
5742
|
}
|
|
@@ -5371,7 +5747,7 @@
|
|
|
5371
5747
|
el.classList.add("bg-secondary", "relative", "h-2", "w-full", "overflow-hidden", "rounded-full");
|
|
5372
5748
|
el.setAttribute("data-slot", "progress");
|
|
5373
5749
|
const indicator = document.createElement("div");
|
|
5374
|
-
indicator.classList.add("bg-primary", "h-full", "w-full", "flex-1", "transition-all", "rounded-full");
|
|
5750
|
+
indicator.classList.add("bg-primary", "h-full", "w-full", "flex-1", "transition-all", "motion-reduce:transition-none", "rounded-full");
|
|
5375
5751
|
indicator.setAttribute("data-slot", "progress-indicator");
|
|
5376
5752
|
Object.assign(indicator.style, {
|
|
5377
5753
|
transform: `translateX(-${100 - 0}%)`
|
|
@@ -7342,9 +7718,18 @@
|
|
|
7342
7718
|
set: void 0,
|
|
7343
7719
|
get: void 0
|
|
7344
7720
|
};
|
|
7345
|
-
el.classList.add("cursor-pointer", "outline-none", "transition-
|
|
7721
|
+
el.classList.add("cursor-pointer", "outline-none", "transition-colors", "transition-shadow", "motion-reduce:transition-none", "duration-200", "w-full", "has-[input:disabled]:pointer-events-none", "has-[input:disabled]:opacity-50");
|
|
7346
7722
|
if (modifiers.includes("table")) {
|
|
7347
|
-
el.classList.add(
|
|
7723
|
+
el.classList.add(
|
|
7724
|
+
"h-10",
|
|
7725
|
+
"flex",
|
|
7726
|
+
"focus-visible:inset-ring-ring/50",
|
|
7727
|
+
"focus-visible:inset-ring-2",
|
|
7728
|
+
'[&>[data-slot="select-input"]]:hover:bg-table-hover',
|
|
7729
|
+
'[&>[data-slot="select-input"]]:hover:text-table-hover-foreground',
|
|
7730
|
+
'[&>[data-slot="select-input"]]:active:!bg-table-active',
|
|
7731
|
+
'[&>[data-slot="select-input"]]:active:!text-table-active-foreground'
|
|
7732
|
+
);
|
|
7348
7733
|
el.setAttribute("data-slot", "cell-input-select");
|
|
7349
7734
|
} else {
|
|
7350
7735
|
el.classList.add(
|
|
@@ -7358,8 +7743,11 @@
|
|
|
7358
7743
|
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
7359
7744
|
"has-[input:invalid]:border-negative",
|
|
7360
7745
|
"has-[input:invalid]:ring-negative/20",
|
|
7361
|
-
"hover:bg-secondary-hover
|
|
7362
|
-
"
|
|
7746
|
+
'[&>[data-slot="select-input"]]:hover:bg-secondary-hover',
|
|
7747
|
+
'[&>[data-slot="select-input"]]:hover:text-secondary-foreground',
|
|
7748
|
+
'[&>[data-slot="select-input"]]:active:bg-secondary-active',
|
|
7749
|
+
'[&>[data-slot="select-input"]]:active:text-secondary-foreground',
|
|
7750
|
+
'[&>[data-slot="select-input"]]:rounded-control',
|
|
7363
7751
|
"rounded-control",
|
|
7364
7752
|
"border",
|
|
7365
7753
|
"bg-input-inner",
|
|
@@ -7425,7 +7813,7 @@
|
|
|
7425
7813
|
fakeTrigger.appendChild(displayValue);
|
|
7426
7814
|
fakeTrigger.setAttribute("data-slot", "select-value");
|
|
7427
7815
|
fakeTrigger.setAttribute("tabindex", "0");
|
|
7428
|
-
fakeTrigger.classList.add("flex", "items-center", "justify-between", "gap-2", "outline-none", "pl-3", "pr-2", "size-full", "[&[
|
|
7816
|
+
fakeTrigger.classList.add("flex", "items-center", "justify-between", "gap-2", "outline-none", "pl-3", "pr-2", "size-full", "[&[aria-expanded=true]>svg]:rotate-180");
|
|
7429
7817
|
select._h_select.trigger = fakeTrigger;
|
|
7430
7818
|
let labelObserver;
|
|
7431
7819
|
if (label) {
|
|
@@ -7472,7 +7860,6 @@
|
|
|
7472
7860
|
fakeTrigger.setAttribute("aria-autocomplete", "none");
|
|
7473
7861
|
fakeTrigger.setAttribute("role", "combobox");
|
|
7474
7862
|
effect(() => {
|
|
7475
|
-
fakeTrigger.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7476
7863
|
fakeTrigger.setAttribute("aria-expanded", select._h_select.expanded);
|
|
7477
7864
|
});
|
|
7478
7865
|
const close = (focusSelect = false) => {
|
|
@@ -7617,7 +8004,7 @@
|
|
|
7617
8004
|
fakeTrigger.addEventListener("click", onClick);
|
|
7618
8005
|
const chevronDown = createSvg({
|
|
7619
8006
|
icon: ChevronDown,
|
|
7620
|
-
classes: "opacity-70 text-
|
|
8007
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none transition-transform motion-reduce:transition-none duration-200",
|
|
7621
8008
|
attrs: {
|
|
7622
8009
|
"aria-hidden": true,
|
|
7623
8010
|
role: "presentation"
|
|
@@ -7648,17 +8035,37 @@
|
|
|
7648
8035
|
}
|
|
7649
8036
|
});
|
|
7650
8037
|
});
|
|
7651
|
-
Alpine.directive("h-select-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
|
|
8038
|
+
Alpine.directive("h-select-content", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7652
8039
|
const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
7653
8040
|
if (!select) {
|
|
7654
8041
|
throw new Error(`${original2} must be inside a select element`);
|
|
7655
8042
|
}
|
|
7656
|
-
el.classList.add(
|
|
8043
|
+
el.classList.add(
|
|
8044
|
+
"absolute",
|
|
8045
|
+
"bg-popover",
|
|
8046
|
+
"text-popover-foreground",
|
|
8047
|
+
"hidden",
|
|
8048
|
+
"p-1",
|
|
8049
|
+
"top-0",
|
|
8050
|
+
"left-0",
|
|
8051
|
+
"z-50",
|
|
8052
|
+
"min-w-[1rem]",
|
|
8053
|
+
"overflow-x-hidden",
|
|
8054
|
+
"overflow-y-auto",
|
|
8055
|
+
"rounded-md",
|
|
8056
|
+
"border",
|
|
8057
|
+
"shadow-md",
|
|
8058
|
+
"transition-[opacity,scale]",
|
|
8059
|
+
"motion-reduce:transition-none",
|
|
8060
|
+
"duration-100",
|
|
8061
|
+
"ease-out",
|
|
8062
|
+
"opacity-0",
|
|
8063
|
+
"scale-95"
|
|
8064
|
+
);
|
|
7657
8065
|
el.setAttribute("data-slot", "select-content");
|
|
7658
8066
|
el.setAttribute("role", "listbox");
|
|
7659
8067
|
el.setAttribute("id", select._h_select.controls);
|
|
7660
8068
|
el.setAttribute("tabindex", "-1");
|
|
7661
|
-
el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7662
8069
|
if (!select._h_select.trigger) {
|
|
7663
8070
|
throw new Error(`${original2}: trigger not found`);
|
|
7664
8071
|
}
|
|
@@ -7684,22 +8091,41 @@
|
|
|
7684
8091
|
left: `${x}px`,
|
|
7685
8092
|
top: `${y}px`
|
|
7686
8093
|
});
|
|
8094
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
7687
8095
|
});
|
|
7688
8096
|
}
|
|
7689
8097
|
effect(() => {
|
|
7690
8098
|
el.setAttribute("aria-labelledby", select._h_select.fieldLabelId);
|
|
7691
8099
|
});
|
|
7692
8100
|
effect(() => {
|
|
7693
|
-
el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7694
8101
|
if (select._h_select.expanded) {
|
|
8102
|
+
el.classList.remove("hidden");
|
|
7695
8103
|
autoUpdateCleanup = autoUpdate(select._h_select.trigger, el, updatePosition);
|
|
7696
8104
|
} else {
|
|
8105
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
8106
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
8107
|
+
Object.assign(el.style, {
|
|
8108
|
+
left: "0px",
|
|
8109
|
+
top: "0px"
|
|
8110
|
+
});
|
|
8111
|
+
} else {
|
|
8112
|
+
el.classList.add("scale-95", "opacity-0");
|
|
8113
|
+
}
|
|
7697
8114
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
8115
|
+
}
|
|
8116
|
+
});
|
|
8117
|
+
function onTransitionEnd(event) {
|
|
8118
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
8119
|
+
el.classList.add("hidden");
|
|
7698
8120
|
Object.assign(el.style, {
|
|
7699
8121
|
left: "0px",
|
|
7700
8122
|
top: "0px"
|
|
7701
8123
|
});
|
|
7702
8124
|
}
|
|
8125
|
+
}
|
|
8126
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
8127
|
+
cleanup(() => {
|
|
8128
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
7703
8129
|
});
|
|
7704
8130
|
});
|
|
7705
8131
|
Alpine.directive("h-select-search", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
@@ -7873,6 +8299,7 @@
|
|
|
7873
8299
|
const onActivate = (event) => {
|
|
7874
8300
|
if (event.type === "keydown" && (event.key === "Enter" || event.key === " ") || event.type === "click") {
|
|
7875
8301
|
if (select._h_select.multiple) {
|
|
8302
|
+
event.stopPropagation();
|
|
7876
8303
|
const vIndex = select._h_model.get().indexOf(getValue());
|
|
7877
8304
|
if (vIndex > -1) {
|
|
7878
8305
|
const val = select._h_model.get().splice(vIndex, 1);
|
|
@@ -7927,16 +8354,43 @@
|
|
|
7927
8354
|
// src/components/sheet.js
|
|
7928
8355
|
function sheet_default(Alpine) {
|
|
7929
8356
|
Alpine.directive("h-sheet-overlay", (el, { expression }, { effect, evaluate: evaluate2, evaluateLater, cleanup }) => {
|
|
7930
|
-
el.
|
|
8357
|
+
el._h_sheet_overlay = {
|
|
8358
|
+
showSheet: void 0,
|
|
8359
|
+
hideSheet: void 0,
|
|
8360
|
+
state: Alpine.reactive({
|
|
8361
|
+
open: evaluate2(expression || "false")
|
|
8362
|
+
})
|
|
8363
|
+
};
|
|
8364
|
+
el.classList.add("hidden", "fixed", "inset-0", "z-50", "bg-black/50", "transition-opacity", "motion-reduce:transition-none", "duration-200", "ease-out", "opacity-0");
|
|
7931
8365
|
el.setAttribute("tabindex", "-1");
|
|
7932
8366
|
el.setAttribute("data-slot", "sheet-overlay");
|
|
7933
|
-
el.setAttribute("data-open", evaluate2(expression));
|
|
7934
8367
|
const getIsOpen = evaluateLater(expression);
|
|
7935
8368
|
effect(() => {
|
|
7936
8369
|
getIsOpen((isOpen) => {
|
|
7937
|
-
el.
|
|
8370
|
+
el._h_sheet_overlay.state.open = isOpen;
|
|
7938
8371
|
});
|
|
7939
8372
|
});
|
|
8373
|
+
effect(() => {
|
|
8374
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
8375
|
+
if (el._h_sheet_overlay.state.open) {
|
|
8376
|
+
el.classList.remove("hidden", "opacity-0");
|
|
8377
|
+
} else {
|
|
8378
|
+
el.classList.add("hidden", "opacity-0");
|
|
8379
|
+
}
|
|
8380
|
+
} else if (el._h_sheet_overlay.state.open) {
|
|
8381
|
+
el.classList.remove("hidden");
|
|
8382
|
+
el.offsetHeight;
|
|
8383
|
+
el.classList.remove("opacity-0");
|
|
8384
|
+
} else {
|
|
8385
|
+
el.classList.add("opacity-0");
|
|
8386
|
+
}
|
|
8387
|
+
});
|
|
8388
|
+
function onTransitionEnd(event) {
|
|
8389
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
8390
|
+
el.classList.add("hidden");
|
|
8391
|
+
}
|
|
8392
|
+
}
|
|
8393
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
7940
8394
|
const onClick = (event) => {
|
|
7941
8395
|
if (event.target.getAttribute("data-slot") === "sheet-overlay") {
|
|
7942
8396
|
evaluate2(`${expression} = false`);
|
|
@@ -7945,12 +8399,29 @@
|
|
|
7945
8399
|
el.addEventListener("click", onClick);
|
|
7946
8400
|
cleanup(() => {
|
|
7947
8401
|
el.removeEventListener("click", onClick);
|
|
8402
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
7948
8403
|
});
|
|
7949
8404
|
});
|
|
7950
|
-
Alpine.directive("h-sheet", (el,
|
|
7951
|
-
el.
|
|
8405
|
+
Alpine.directive("h-sheet", (el, { original: original2 }, { effect, cleanup }) => {
|
|
8406
|
+
const overlay = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sheet_overlay"));
|
|
8407
|
+
if (!overlay) {
|
|
8408
|
+
throw new Error(`${original2} must be placed inside a sheet overlay`);
|
|
8409
|
+
}
|
|
8410
|
+
el.classList.add("hidden", "bg-background", "fixed", "shadow-lg", "transform", "transition-all", "motion-reduce:transition-none", "duration-200", "ease-out");
|
|
7952
8411
|
el.setAttribute("data-slot", "sheet");
|
|
7953
8412
|
let lastSide;
|
|
8413
|
+
const getTranslateClass = (side) => {
|
|
8414
|
+
switch (side) {
|
|
8415
|
+
case "top":
|
|
8416
|
+
return "-translate-y-full";
|
|
8417
|
+
case "right":
|
|
8418
|
+
return "translate-x-full";
|
|
8419
|
+
case "left":
|
|
8420
|
+
return "-translate-x-full";
|
|
8421
|
+
default:
|
|
8422
|
+
return "translate-y-full";
|
|
8423
|
+
}
|
|
8424
|
+
};
|
|
7954
8425
|
const getSideClasses = (side) => {
|
|
7955
8426
|
switch (side) {
|
|
7956
8427
|
case "top":
|
|
@@ -7972,9 +8443,32 @@
|
|
|
7972
8443
|
setSide(el.getAttribute("data-align"));
|
|
7973
8444
|
});
|
|
7974
8445
|
setSide(el.getAttribute("data-align"));
|
|
8446
|
+
el.classList.add(getTranslateClass(lastSide));
|
|
8447
|
+
function onTransitionEnd(event) {
|
|
8448
|
+
if (event.target === el && event.target.classList.contains(getTranslateClass(lastSide))) {
|
|
8449
|
+
el.classList.add("hidden");
|
|
8450
|
+
}
|
|
8451
|
+
}
|
|
8452
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
8453
|
+
effect(() => {
|
|
8454
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
8455
|
+
if (overlay._h_sheet_overlay.state.open) {
|
|
8456
|
+
el.classList.remove("hidden", getTranslateClass(lastSide));
|
|
8457
|
+
} else {
|
|
8458
|
+
el.classList.add("hidden", getTranslateClass(lastSide));
|
|
8459
|
+
}
|
|
8460
|
+
} else if (overlay._h_sheet_overlay.state.open) {
|
|
8461
|
+
el.classList.remove("hidden");
|
|
8462
|
+
el.offsetHeight;
|
|
8463
|
+
el.classList.remove(getTranslateClass(lastSide));
|
|
8464
|
+
} else {
|
|
8465
|
+
el.classList.add(getTranslateClass(lastSide));
|
|
8466
|
+
}
|
|
8467
|
+
});
|
|
7975
8468
|
observer.observe(el, { attributes: true, attributeFilter: ["data-align"] });
|
|
7976
8469
|
cleanup(() => {
|
|
7977
8470
|
observer.disconnect();
|
|
8471
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
7978
8472
|
});
|
|
7979
8473
|
});
|
|
7980
8474
|
}
|
|
@@ -8050,6 +8544,7 @@
|
|
|
8050
8544
|
"font-medium",
|
|
8051
8545
|
"outline-hidden",
|
|
8052
8546
|
"transition-[margin,opacity]",
|
|
8547
|
+
"motion-reduce:transition-none",
|
|
8053
8548
|
"duration-200",
|
|
8054
8549
|
"ease-linear",
|
|
8055
8550
|
"focus-visible:ring-2",
|
|
@@ -8059,7 +8554,7 @@
|
|
|
8059
8554
|
);
|
|
8060
8555
|
el.setAttribute("data-slot", "sidebar-group-label");
|
|
8061
8556
|
if (group._h_sidebar_group.collapsable) {
|
|
8062
|
-
el.classList.add("text-sidebar-foreground", "text-sm", "hover:bg-secondary-
|
|
8557
|
+
el.classList.add("text-sidebar-foreground", "text-sm", "hover:bg-sidebar-secondary", "hover:text-sidebar-secondary-foreground", "active:bg-sidebar-secondary", "active:text-sidebar-secondary-foreground");
|
|
8063
8558
|
if (el.hasAttribute("id")) {
|
|
8064
8559
|
group._h_sidebar_group.controlId = el.getAttribute("id");
|
|
8065
8560
|
} else {
|
|
@@ -8076,7 +8571,7 @@
|
|
|
8076
8571
|
el.appendChild(
|
|
8077
8572
|
createSvg({
|
|
8078
8573
|
icon: ChevronRight,
|
|
8079
|
-
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
8574
|
+
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
8080
8575
|
attrs: {
|
|
8081
8576
|
"aria-hidden": true,
|
|
8082
8577
|
role: "presentation"
|
|
@@ -8109,6 +8604,7 @@
|
|
|
8109
8604
|
"p-0",
|
|
8110
8605
|
"outline-hidden",
|
|
8111
8606
|
"transition-transform",
|
|
8607
|
+
"motion-reduce:transition-none",
|
|
8112
8608
|
"focus-visible:ring-2",
|
|
8113
8609
|
"[&>svg]:size-4",
|
|
8114
8610
|
"[&>svg]:shrink-0",
|
|
@@ -8241,10 +8737,11 @@
|
|
|
8241
8737
|
"text-sm",
|
|
8242
8738
|
"duration-200",
|
|
8243
8739
|
"transition-[width,height,padding]",
|
|
8740
|
+
"motion-reduce:transition-none",
|
|
8244
8741
|
"group-has-data-[sidebar=menu-action]/menu-item:pr-8",
|
|
8245
8742
|
"data-[active=true]:font-medium",
|
|
8246
|
-
"
|
|
8247
|
-
"
|
|
8743
|
+
"aria-[expanded=true]:hover:bg-sidebar-secondary",
|
|
8744
|
+
"aria-[expanded=true]:hover:text-sidebar-secondary-foreground",
|
|
8248
8745
|
"group-data-[collapsed=true]/sidebar:!size-8",
|
|
8249
8746
|
"group-data-[collapsed=true]/sidebar:!p-2",
|
|
8250
8747
|
"group-data-[collapsed=true]/sidebar:[&>*:not(svg:first-child):not([data-slot=menu])]:!hidden"
|
|
@@ -8267,7 +8764,7 @@
|
|
|
8267
8764
|
el.appendChild(
|
|
8268
8765
|
createSvg({
|
|
8269
8766
|
icon: ChevronRight,
|
|
8270
|
-
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
8767
|
+
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
8271
8768
|
attrs: {
|
|
8272
8769
|
"aria-hidden": true,
|
|
8273
8770
|
role: "presentation"
|
|
@@ -8305,6 +8802,7 @@
|
|
|
8305
8802
|
"p-0",
|
|
8306
8803
|
"outline-hidden",
|
|
8307
8804
|
"transition-transform",
|
|
8805
|
+
"motion-reduce:transition-none",
|
|
8308
8806
|
"focus-visible:ring-2",
|
|
8309
8807
|
"[&>svg]:size-4",
|
|
8310
8808
|
"[&>svg]:shrink-0",
|
|
@@ -8314,7 +8812,7 @@
|
|
|
8314
8812
|
"group-data-[collapsed=true]/sidebar:hidden"
|
|
8315
8813
|
);
|
|
8316
8814
|
if (modifiers.includes("autohide")) {
|
|
8317
|
-
el.classList.add("group-focus-within/menu-item:opacity-100", "group-hover/menu-item:opacity-100", "
|
|
8815
|
+
el.classList.add("group-focus-within/menu-item:opacity-100", "group-hover/menu-item:opacity-100", "aria-[expanded=true]:opacity-100", "md:opacity-0");
|
|
8318
8816
|
}
|
|
8319
8817
|
if (el.tagName !== "BUTTON") {
|
|
8320
8818
|
el.setAttribute("role", "button");
|
|
@@ -8953,6 +9451,7 @@
|
|
|
8953
9451
|
"before:h-full",
|
|
8954
9452
|
"before:aspect-square",
|
|
8955
9453
|
"before:transition-transform",
|
|
9454
|
+
"before:motion-reduce:transition-none",
|
|
8956
9455
|
"bg-muted",
|
|
8957
9456
|
"border",
|
|
8958
9457
|
"data-[size=sm]:h-5",
|
|
@@ -8971,7 +9470,8 @@
|
|
|
8971
9470
|
"relative",
|
|
8972
9471
|
"rounded-full",
|
|
8973
9472
|
"shrink-0",
|
|
8974
|
-
"transition-
|
|
9473
|
+
"transition-colors",
|
|
9474
|
+
"motion-reduce:transition-none"
|
|
8975
9475
|
);
|
|
8976
9476
|
el.setAttribute("tabindex", "-1");
|
|
8977
9477
|
el.setAttribute("data-slot", "switch");
|
|
@@ -9074,11 +9574,14 @@
|
|
|
9074
9574
|
"justify-between",
|
|
9075
9575
|
"outline-none",
|
|
9076
9576
|
"gap-2",
|
|
9077
|
-
"transition-
|
|
9577
|
+
"transition-colors",
|
|
9578
|
+
"transition-shadow",
|
|
9579
|
+
"motion-reduce:transition-none",
|
|
9078
9580
|
"[&_svg]:pointer-events-none",
|
|
9079
9581
|
"[&_svg]:opacity-70",
|
|
9080
9582
|
"[&_svg]:text-foreground",
|
|
9081
9583
|
"[&_svg]:transition-transform",
|
|
9584
|
+
"motion-reduce:[&_svg]:transition-none",
|
|
9082
9585
|
"[&_svg]:duration-200",
|
|
9083
9586
|
"[&_svg:not([class*='size-'])]:size-4",
|
|
9084
9587
|
"shrink-0",
|
|
@@ -9198,7 +9701,9 @@
|
|
|
9198
9701
|
"text-sm",
|
|
9199
9702
|
"font-medium",
|
|
9200
9703
|
"whitespace-nowrap",
|
|
9201
|
-
"transition-
|
|
9704
|
+
"transition-colors",
|
|
9705
|
+
"transition-shadow",
|
|
9706
|
+
"motion-reduce:transition-none",
|
|
9202
9707
|
"group-data-[floating=true]/tab-bar:rounded-md",
|
|
9203
9708
|
"group-data-[floating=true]/tab-bar:border",
|
|
9204
9709
|
"group-data-[floating=true]/tab-bar:border-transparent",
|
|
@@ -9379,7 +9884,9 @@
|
|
|
9379
9884
|
"py-2",
|
|
9380
9885
|
"text-base",
|
|
9381
9886
|
"shadow-input",
|
|
9382
|
-
"transition-
|
|
9887
|
+
"transition-colors",
|
|
9888
|
+
"transition-shadow",
|
|
9889
|
+
"motion-reduce:transition-none",
|
|
9383
9890
|
"outline-none",
|
|
9384
9891
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
9385
9892
|
"disabled:cursor-not-allowed",
|
|
@@ -9413,9 +9920,11 @@
|
|
|
9413
9920
|
"text-sm",
|
|
9414
9921
|
"rounded-lg",
|
|
9415
9922
|
"transition-colors",
|
|
9923
|
+
"motion-reduce:transition-none",
|
|
9416
9924
|
"[a]:hover:bg-secondary-hover",
|
|
9417
9925
|
"[a]:hover:text-secondary-foreground",
|
|
9418
9926
|
"[a]:transition-colors",
|
|
9927
|
+
"[a]:motion-reduce:transition-none",
|
|
9419
9928
|
"duration-100",
|
|
9420
9929
|
"flex-wrap",
|
|
9421
9930
|
"outline-none",
|
|
@@ -9558,8 +10067,6 @@
|
|
|
9558
10067
|
el.classList.add(
|
|
9559
10068
|
"cursor-pointer",
|
|
9560
10069
|
"border-input",
|
|
9561
|
-
"hover:bg-secondary-hover",
|
|
9562
|
-
"active:bg-secondary-active",
|
|
9563
10070
|
"flex",
|
|
9564
10071
|
"items-center",
|
|
9565
10072
|
"justify-between",
|
|
@@ -9569,7 +10076,9 @@
|
|
|
9569
10076
|
"data-[size=sm]:pr-1",
|
|
9570
10077
|
"text-sm",
|
|
9571
10078
|
"whitespace-nowrap",
|
|
9572
|
-
"transition-
|
|
10079
|
+
"transition-colors",
|
|
10080
|
+
"transition-shadow",
|
|
10081
|
+
"motion-reduce:transition-none",
|
|
9573
10082
|
"duration-200",
|
|
9574
10083
|
"outline-none",
|
|
9575
10084
|
"has-[input:disabled]:pointer-events-none",
|
|
@@ -9585,16 +10094,30 @@
|
|
|
9585
10094
|
"has-[input[aria-invalid=true]]:inset-ring-negative/20",
|
|
9586
10095
|
"dark:has-[input[aria-invalid=true]]:inset-ring-negative/40",
|
|
9587
10096
|
"has-[input:invalid]:!inset-ring-negative/20",
|
|
9588
|
-
"dark:has-[input:invalid]:!inset-ring-negative/40"
|
|
10097
|
+
"dark:has-[input:invalid]:!inset-ring-negative/40",
|
|
10098
|
+
"hover:bg-table-hover",
|
|
10099
|
+
"hover:text-table-hover-foreground",
|
|
10100
|
+
"active:!bg-table-active",
|
|
10101
|
+
"active:!text-table-active-foreground",
|
|
10102
|
+
"has-[[aria-expanded=true]]:bg-transparent",
|
|
10103
|
+
"has-[[aria-expanded=true]]:text-foreground"
|
|
9589
10104
|
);
|
|
9590
10105
|
el.setAttribute("data-slot", "cell-input-time");
|
|
9591
10106
|
} else {
|
|
9592
10107
|
el.classList.add(
|
|
9593
10108
|
"w-full",
|
|
10109
|
+
"hover:bg-secondary-hover",
|
|
10110
|
+
"hover:text-secondary-foreground",
|
|
10111
|
+
'[&>[data-slot="time-picker-input"]]:hover:text-secondary-foreground',
|
|
10112
|
+
"active:bg-secondary-active",
|
|
10113
|
+
"active:text-secondary-foreground",
|
|
10114
|
+
'[&>[data-slot="time-picker-input"]]:active:text-secondary-foreground',
|
|
9594
10115
|
"rounded-control",
|
|
9595
10116
|
"border",
|
|
9596
10117
|
"bg-input-inner",
|
|
9597
10118
|
"shadow-input",
|
|
10119
|
+
"has-[[aria-expanded=true]]:bg-input-inner",
|
|
10120
|
+
"has-[[aria-expanded=true]]:text-foreground",
|
|
9598
10121
|
"has-[input:focus-visible]:border-ring",
|
|
9599
10122
|
"has-[input:focus-visible]:ring-[calc(var(--spacing)*0.75)]",
|
|
9600
10123
|
"has-[input:focus-visible]:ring-ring/50",
|
|
@@ -9611,7 +10134,7 @@
|
|
|
9611
10134
|
el.appendChild(
|
|
9612
10135
|
createSvg({
|
|
9613
10136
|
icon: Clock,
|
|
9614
|
-
classes: "opacity-70 text-
|
|
10137
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
9615
10138
|
attrs: {
|
|
9616
10139
|
"aria-hidden": true,
|
|
9617
10140
|
role: "presentation"
|
|
@@ -9754,7 +10277,6 @@
|
|
|
9754
10277
|
el.addEventListener("beforeinput", preventInput);
|
|
9755
10278
|
el.addEventListener("paste", preventInput);
|
|
9756
10279
|
effect(() => {
|
|
9757
|
-
el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
|
|
9758
10280
|
el.setAttribute("aria-expanded", timepicker._h_timepicker.expanded);
|
|
9759
10281
|
});
|
|
9760
10282
|
cleanup(() => {
|
|
@@ -9772,11 +10294,17 @@
|
|
|
9772
10294
|
"absolute",
|
|
9773
10295
|
"bg-popover",
|
|
9774
10296
|
"text-popover-foreground",
|
|
9775
|
-
"
|
|
9776
|
-
"
|
|
9777
|
-
"
|
|
10297
|
+
"flex",
|
|
10298
|
+
"flex-col",
|
|
10299
|
+
"hidden",
|
|
9778
10300
|
"z-50",
|
|
9779
|
-
"shadow-md"
|
|
10301
|
+
"shadow-md",
|
|
10302
|
+
"transition-[opacity,scale]",
|
|
10303
|
+
"motion-reduce:transition-none",
|
|
10304
|
+
"duration-100",
|
|
10305
|
+
"ease-out",
|
|
10306
|
+
"opacity-0",
|
|
10307
|
+
"scale-95"
|
|
9780
10308
|
);
|
|
9781
10309
|
el.setAttribute("id", timepicker._h_timepicker.controls);
|
|
9782
10310
|
el.setAttribute("tabindex", "-1");
|
|
@@ -9784,7 +10312,6 @@
|
|
|
9784
10312
|
el.setAttribute("aria-modal", "true");
|
|
9785
10313
|
el.setAttribute("data-slot", "time-picker-popup");
|
|
9786
10314
|
el.setAttribute("aria-labelledby", timepicker._h_timepicker.id);
|
|
9787
|
-
el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
|
|
9788
10315
|
const optionClasses = [
|
|
9789
10316
|
"px-3.5",
|
|
9790
10317
|
"py-2",
|
|
@@ -10194,6 +10721,7 @@
|
|
|
10194
10721
|
left: `${x}px`,
|
|
10195
10722
|
top: `${y}px`
|
|
10196
10723
|
});
|
|
10724
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
10197
10725
|
if (focusFirstItem) {
|
|
10198
10726
|
focusFirstItem = false;
|
|
10199
10727
|
Alpine2.nextTick(() => {
|
|
@@ -10207,25 +10735,41 @@
|
|
|
10207
10735
|
});
|
|
10208
10736
|
}
|
|
10209
10737
|
effect(() => {
|
|
10210
|
-
el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
|
|
10211
10738
|
if (timepicker._h_timepicker.expanded) {
|
|
10212
10739
|
render();
|
|
10740
|
+
el.classList.remove("hidden");
|
|
10213
10741
|
autoUpdateCleanup = autoUpdate(timepicker, el, updatePosition);
|
|
10214
10742
|
if (selectedHour) scrollIntoCenter(selectedHour.parentElement, selectedHour);
|
|
10215
10743
|
if (selectedMinute) scrollIntoCenter(selectedMinute.parentElement, selectedMinute);
|
|
10216
10744
|
if (selectedSecond && timepicker._h_timepicker.seconds) scrollIntoCenter(selectedSecond.parentElement, selectedSecond);
|
|
10217
10745
|
} else {
|
|
10746
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
10747
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
10748
|
+
Object.assign(el.style, {
|
|
10749
|
+
left: "0px",
|
|
10750
|
+
top: "0px"
|
|
10751
|
+
});
|
|
10752
|
+
} else {
|
|
10753
|
+
el.classList.add("scale-95", "opacity-0");
|
|
10754
|
+
}
|
|
10218
10755
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
10219
10756
|
focusFirstItem = true;
|
|
10757
|
+
}
|
|
10758
|
+
});
|
|
10759
|
+
function onTransitionEnd(event) {
|
|
10760
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
10761
|
+
el.classList.add("hidden");
|
|
10220
10762
|
Object.assign(el.style, {
|
|
10221
10763
|
left: "0px",
|
|
10222
10764
|
top: "0px"
|
|
10223
10765
|
});
|
|
10224
10766
|
}
|
|
10225
|
-
}
|
|
10767
|
+
}
|
|
10768
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
10226
10769
|
cleanup(() => {
|
|
10227
10770
|
el.removeEventListener("keydown", onKeyDown);
|
|
10228
10771
|
el.removeEventListener("click", onClick);
|
|
10772
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
10229
10773
|
okButton.removeEventListener("click", timepicker._h_timepicker.close);
|
|
10230
10774
|
nowButton.removeEventListener("click", getCurrentTime);
|
|
10231
10775
|
timeContainer.removeEventListener("click", setTime);
|
|
@@ -10320,7 +10864,7 @@
|
|
|
10320
10864
|
el.removeEventListener("pointerleave", handler);
|
|
10321
10865
|
});
|
|
10322
10866
|
});
|
|
10323
|
-
Alpine.directive("h-tooltip", (el, { original: original2 }, { effect }) => {
|
|
10867
|
+
Alpine.directive("h-tooltip", (el, { original: original2 }, { effect, cleanup }) => {
|
|
10324
10868
|
const tooltip = (() => {
|
|
10325
10869
|
let sibling = el.previousElementSibling;
|
|
10326
10870
|
while (sibling && !sibling.hasOwnProperty("_tooltip")) {
|
|
@@ -10331,7 +10875,24 @@
|
|
|
10331
10875
|
if (!tooltip) {
|
|
10332
10876
|
throw new Error(`${original2} must be placed after a tooltip trigger element`);
|
|
10333
10877
|
}
|
|
10334
|
-
el.classList.add(
|
|
10878
|
+
el.classList.add(
|
|
10879
|
+
"absolute",
|
|
10880
|
+
"bg-foreground",
|
|
10881
|
+
"text-background",
|
|
10882
|
+
"z-50",
|
|
10883
|
+
"w-fit",
|
|
10884
|
+
"rounded-md",
|
|
10885
|
+
"px-3",
|
|
10886
|
+
"py-1.5",
|
|
10887
|
+
"text-xs",
|
|
10888
|
+
"text-balance",
|
|
10889
|
+
"transition-[opacity,scale]",
|
|
10890
|
+
"motion-reduce:transition-none",
|
|
10891
|
+
"duration-100",
|
|
10892
|
+
"ease-out",
|
|
10893
|
+
"opacity-0",
|
|
10894
|
+
"scale-95"
|
|
10895
|
+
);
|
|
10335
10896
|
el.setAttribute("data-slot", "tooltip");
|
|
10336
10897
|
el.setAttribute("id", tooltip._tooltip.controls);
|
|
10337
10898
|
const arrowEl = document.createElement("span");
|
|
@@ -10346,6 +10907,7 @@
|
|
|
10346
10907
|
left: `${x}px`,
|
|
10347
10908
|
top: `${y}px`
|
|
10348
10909
|
});
|
|
10910
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
10349
10911
|
if (middlewareData.arrow) {
|
|
10350
10912
|
Object.assign(arrowEl.style, {
|
|
10351
10913
|
left: middlewareData.arrow.x != null ? `${middlewareData.arrow.x}px` : "",
|
|
@@ -10359,6 +10921,23 @@
|
|
|
10359
10921
|
el.classList.remove("hidden");
|
|
10360
10922
|
updatePosition();
|
|
10361
10923
|
} else {
|
|
10924
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
10925
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
10926
|
+
Object.assign(el.style, {
|
|
10927
|
+
left: "0px",
|
|
10928
|
+
top: "0px"
|
|
10929
|
+
});
|
|
10930
|
+
Object.assign(arrowEl.style, {
|
|
10931
|
+
left: "0px",
|
|
10932
|
+
top: "0px"
|
|
10933
|
+
});
|
|
10934
|
+
} else {
|
|
10935
|
+
el.classList.add("scale-95", "opacity-0");
|
|
10936
|
+
}
|
|
10937
|
+
}
|
|
10938
|
+
});
|
|
10939
|
+
function onTransitionEnd(event) {
|
|
10940
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
10362
10941
|
el.classList.add("hidden");
|
|
10363
10942
|
Object.assign(el.style, {
|
|
10364
10943
|
left: "0px",
|
|
@@ -10369,6 +10948,10 @@
|
|
|
10369
10948
|
top: "0px"
|
|
10370
10949
|
});
|
|
10371
10950
|
}
|
|
10951
|
+
}
|
|
10952
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
10953
|
+
cleanup(() => {
|
|
10954
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
10372
10955
|
});
|
|
10373
10956
|
});
|
|
10374
10957
|
}
|
|
@@ -10552,6 +11135,7 @@
|
|
|
10552
11135
|
"outline-hidden",
|
|
10553
11136
|
"ring-ring",
|
|
10554
11137
|
"transition-[width,height,padding]",
|
|
11138
|
+
"motion-reduce:transition-none",
|
|
10555
11139
|
"hover:bg-secondary",
|
|
10556
11140
|
"hover:text-secondary-foreground",
|
|
10557
11141
|
"focus-visible:ring-2",
|
|
@@ -10583,7 +11167,7 @@
|
|
|
10583
11167
|
if (treeItem._h_tree_item.hasSubtree) {
|
|
10584
11168
|
const chevronDown = createSvg({
|
|
10585
11169
|
icon: ChevronRight,
|
|
10586
|
-
classes: "size-4 shrink-0 transition-transform duration-200 [[data-expanded=true]>&]:rotate-90",
|
|
11170
|
+
classes: "size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[data-expanded=true]>&]:rotate-90",
|
|
10587
11171
|
attrs: {
|
|
10588
11172
|
"aria-hidden": true,
|
|
10589
11173
|
role: "presentation"
|
|
@@ -10785,7 +11369,7 @@
|
|
|
10785
11369
|
}
|
|
10786
11370
|
|
|
10787
11371
|
// package.json
|
|
10788
|
-
var version = "1.
|
|
11372
|
+
var version = "1.9.0";
|
|
10789
11373
|
|
|
10790
11374
|
// src/index.js
|
|
10791
11375
|
window.Harmonia = { getBreakpointListener, addColorSchemeListener, getColorScheme, removeColorSchemeListener, setColorScheme, getSystemColorScheme, version };
|
|
@@ -10798,9 +11382,9 @@
|
|
|
10798
11382
|
window.Alpine.plugin(calendar_default);
|
|
10799
11383
|
window.Alpine.plugin(card_default);
|
|
10800
11384
|
window.Alpine.plugin(checkbox_default);
|
|
10801
|
-
window.Alpine.plugin(collapsible_default);
|
|
10802
11385
|
window.Alpine.plugin(datepicker_default);
|
|
10803
11386
|
window.Alpine.plugin(dialog_default);
|
|
11387
|
+
window.Alpine.plugin(expansion_panel_default);
|
|
10804
11388
|
window.Alpine.plugin(fieldset_default);
|
|
10805
11389
|
window.Alpine.plugin(icon_default);
|
|
10806
11390
|
window.Alpine.plugin(info_page_default);
|