@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.esm.js
CHANGED
|
@@ -2503,12 +2503,12 @@ function accordion_default(Alpine) {
|
|
|
2503
2503
|
}) : { single: false };
|
|
2504
2504
|
el.setAttribute("data-slot", "accordion");
|
|
2505
2505
|
});
|
|
2506
|
-
Alpine.directive("h-accordion-item", (el, { original: original2, expression, modifiers }, {
|
|
2506
|
+
Alpine.directive("h-accordion-item", (el, { original: original2, expression, modifiers }, { Alpine: Alpine2 }) => {
|
|
2507
2507
|
const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
|
|
2508
2508
|
if (!accordion) {
|
|
2509
2509
|
throw new Error(`${original2} must be inside an accordion`);
|
|
2510
2510
|
}
|
|
2511
|
-
el.classList.add("border-b", "last:border-b-0"
|
|
2511
|
+
el.classList.add("border-b", "last:border-b-0");
|
|
2512
2512
|
el.setAttribute("data-slot", "accordion-item");
|
|
2513
2513
|
const itemId = expression ?? `ha${uuid_default()}`;
|
|
2514
2514
|
function getIsExpanded() {
|
|
@@ -2528,11 +2528,6 @@ function accordion_default(Alpine) {
|
|
|
2528
2528
|
controls: `ha${uuid_default()}`,
|
|
2529
2529
|
expanded: getIsExpanded()
|
|
2530
2530
|
});
|
|
2531
|
-
const setAttributes = () => {
|
|
2532
|
-
el.setAttribute("data-state", el._h_accordionItem.expanded ? "open" : "closed");
|
|
2533
|
-
};
|
|
2534
|
-
setAttributes();
|
|
2535
|
-
effect(setAttributes);
|
|
2536
2531
|
});
|
|
2537
2532
|
Alpine.directive("h-accordion-trigger", (el, { original: original2, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
2538
2533
|
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
@@ -2543,23 +2538,12 @@ function accordion_default(Alpine) {
|
|
|
2543
2538
|
if (!accordionItem || !accordion) {
|
|
2544
2539
|
throw new Error(`${original2} must have an accordion and accordion item parent elements`);
|
|
2545
2540
|
}
|
|
2546
|
-
el.classList.add(
|
|
2547
|
-
"flex",
|
|
2548
|
-
"h-12",
|
|
2549
|
-
"[[data-size=md]_&]:h-10",
|
|
2550
|
-
"[[data-size=sm]_&]:h-8",
|
|
2551
|
-
"[[data-variant=header]_&]:bg-object-header",
|
|
2552
|
-
"[[data-variant=header]_&]:text-object-header-foreground",
|
|
2553
|
-
"[[data-variant=header]_&]:px-4",
|
|
2554
|
-
"[[data-variant=header]_&]:border-b",
|
|
2555
|
-
"[[data-size=md][data-variant=header]_&]:px-3",
|
|
2556
|
-
"[[data-size=sm][data-variant=header]_&]:px-2.5"
|
|
2557
|
-
);
|
|
2541
|
+
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");
|
|
2558
2542
|
el.setAttribute("tabIndex", "-1");
|
|
2559
2543
|
const getLabel = evaluateLater(expression);
|
|
2560
2544
|
const chevronDown = createSvg({
|
|
2561
2545
|
icon: ChevronDown,
|
|
2562
|
-
classes: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200",
|
|
2546
|
+
classes: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform motion-reduce:transition-none duration-200",
|
|
2563
2547
|
attrs: {
|
|
2564
2548
|
"aria-hidden": true,
|
|
2565
2549
|
role: "presentation"
|
|
@@ -2581,12 +2565,13 @@ function accordion_default(Alpine) {
|
|
|
2581
2565
|
"text-sm",
|
|
2582
2566
|
"font-medium",
|
|
2583
2567
|
"transition-all",
|
|
2568
|
+
"motion-reduce:transition-none",
|
|
2584
2569
|
"outline-none",
|
|
2585
2570
|
"hover:underline",
|
|
2586
2571
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
2587
2572
|
"disabled:pointer-events-none",
|
|
2588
2573
|
"disabled:opacity-50",
|
|
2589
|
-
"[&[
|
|
2574
|
+
"[&[aria-expanded=true]>svg]:rotate-180"
|
|
2590
2575
|
);
|
|
2591
2576
|
el.appendChild(button);
|
|
2592
2577
|
effect(() => {
|
|
@@ -2598,7 +2583,6 @@ function accordion_default(Alpine) {
|
|
|
2598
2583
|
button.setAttribute("id", accordionItem._h_accordionItem.id);
|
|
2599
2584
|
button.setAttribute("aria-controls", accordionItem._h_accordionItem.controls);
|
|
2600
2585
|
const setAttributes = () => {
|
|
2601
|
-
button.setAttribute("data-state", accordionItem._h_accordionItem.expanded ? "open" : "closed");
|
|
2602
2586
|
button.setAttribute("aria-expanded", accordionItem._h_accordionItem.expanded);
|
|
2603
2587
|
};
|
|
2604
2588
|
const handler = () => {
|
|
@@ -2622,16 +2606,46 @@ function accordion_default(Alpine) {
|
|
|
2622
2606
|
});
|
|
2623
2607
|
}
|
|
2624
2608
|
});
|
|
2625
|
-
Alpine.directive("h-accordion-content", (el, _, { effect, Alpine: Alpine2 }) => {
|
|
2626
|
-
el.classList.add("
|
|
2609
|
+
Alpine.directive("h-accordion-content", (el, _, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
2610
|
+
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");
|
|
2627
2611
|
el.setAttribute("data-slot", "accordion-content");
|
|
2628
2612
|
const parent = Alpine2.findClosest(el.parentElement, (parent2) => parent2.hasOwnProperty("_h_accordionItem"));
|
|
2629
2613
|
if (parent) {
|
|
2614
|
+
let onTransitionEnd = function(event) {
|
|
2615
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
2616
|
+
el.classList.add("hidden");
|
|
2617
|
+
}
|
|
2618
|
+
};
|
|
2630
2619
|
el.setAttribute("id", parent._h_accordionItem.controls);
|
|
2631
2620
|
el.setAttribute("aria-labelledby", parent._h_accordionItem.id);
|
|
2632
|
-
el.setAttribute("data-state", parent._h_accordionItem.expanded ? "open" : "closed");
|
|
2633
2621
|
effect(() => {
|
|
2634
|
-
|
|
2622
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
2623
|
+
el.style.removeProperty("max-height");
|
|
2624
|
+
if (parent._h_accordionItem.expanded) {
|
|
2625
|
+
el.classList.add("pb-4", "[[data-size=md]_&]:pb-3", "[[data-size=sm]_&]:pb-2");
|
|
2626
|
+
el.classList.remove("hidden", "pb-0", "opacity-0");
|
|
2627
|
+
} else {
|
|
2628
|
+
el.classList.add("hidden", "pb-0", "opacity-0");
|
|
2629
|
+
el.classList.remove("pb-4", "[[data-size=md]_&]:pb-3", "[[data-size=sm]_&]:pb-2");
|
|
2630
|
+
}
|
|
2631
|
+
} else if (parent._h_accordionItem.expanded) {
|
|
2632
|
+
if (el.classList.contains("hidden")) {
|
|
2633
|
+
el.classList.add("pb-4", "[[data-size=md]_&]:pb-3", "[[data-size=sm]_&]:pb-2");
|
|
2634
|
+
el.classList.remove("hidden", "pb-0");
|
|
2635
|
+
Alpine2.nextTick(() => {
|
|
2636
|
+
el.style.maxHeight = `${el.scrollHeight}px`;
|
|
2637
|
+
el.classList.remove("opacity-0");
|
|
2638
|
+
});
|
|
2639
|
+
}
|
|
2640
|
+
} else {
|
|
2641
|
+
el.style.maxHeight = "0px";
|
|
2642
|
+
el.classList.add("opacity-0", "pb-0");
|
|
2643
|
+
el.classList.remove("pb-4", "[[data-size=md]_&]:pb-3", "[[data-size=sm]_&]:pb-2");
|
|
2644
|
+
}
|
|
2645
|
+
});
|
|
2646
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
2647
|
+
cleanup(() => {
|
|
2648
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
2635
2649
|
});
|
|
2636
2650
|
}
|
|
2637
2651
|
});
|
|
@@ -2824,7 +2838,9 @@ function badge_default(Alpine) {
|
|
|
2824
2838
|
"focus-visible:border-ring",
|
|
2825
2839
|
"focus-visible:ring-ring/50",
|
|
2826
2840
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
2827
|
-
"transition-
|
|
2841
|
+
"transition-colors",
|
|
2842
|
+
"transition-shadow",
|
|
2843
|
+
"motion-reduce:transition-none",
|
|
2828
2844
|
"overflow-hidden"
|
|
2829
2845
|
);
|
|
2830
2846
|
el.setAttribute("data-slot", "badge");
|
|
@@ -2912,6 +2928,7 @@ var buttonVariants = {
|
|
|
2912
2928
|
default: [
|
|
2913
2929
|
"bg-secondary",
|
|
2914
2930
|
"text-secondary-foreground",
|
|
2931
|
+
"fill-secondary-foreground",
|
|
2915
2932
|
"shadow-button",
|
|
2916
2933
|
"hover:bg-secondary-hover",
|
|
2917
2934
|
"active:bg-secondary-active",
|
|
@@ -2923,6 +2940,7 @@ var buttonVariants = {
|
|
|
2923
2940
|
primary: [
|
|
2924
2941
|
"bg-primary",
|
|
2925
2942
|
"text-primary-foreground",
|
|
2943
|
+
"fill-primary-foreground",
|
|
2926
2944
|
"shadow-button",
|
|
2927
2945
|
"focus-visible:outline-primary/50",
|
|
2928
2946
|
"hover:bg-primary-hover",
|
|
@@ -2935,6 +2953,7 @@ var buttonVariants = {
|
|
|
2935
2953
|
positive: [
|
|
2936
2954
|
"bg-positive",
|
|
2937
2955
|
"text-positive-foreground",
|
|
2956
|
+
"fill-positive-foreground",
|
|
2938
2957
|
"shadow-button",
|
|
2939
2958
|
"focus-visible:outline-positive/50",
|
|
2940
2959
|
"hover:bg-positive-hover",
|
|
@@ -2947,6 +2966,7 @@ var buttonVariants = {
|
|
|
2947
2966
|
negative: [
|
|
2948
2967
|
"bg-negative",
|
|
2949
2968
|
"text-negative-foreground",
|
|
2969
|
+
"fill-negative-foreground",
|
|
2950
2970
|
"shadow-button",
|
|
2951
2971
|
"focus-visible:outline-negative/50",
|
|
2952
2972
|
"hover:bg-negative-hover",
|
|
@@ -2959,6 +2979,7 @@ var buttonVariants = {
|
|
|
2959
2979
|
warning: [
|
|
2960
2980
|
"bg-warning",
|
|
2961
2981
|
"text-warning-foreground",
|
|
2982
|
+
"fill-warning-foreground",
|
|
2962
2983
|
"shadow-button",
|
|
2963
2984
|
"focus-visible:outline-warning/50",
|
|
2964
2985
|
"hover:bg-warning-hover",
|
|
@@ -2971,6 +2992,7 @@ var buttonVariants = {
|
|
|
2971
2992
|
information: [
|
|
2972
2993
|
"bg-information",
|
|
2973
2994
|
"text-information-foreground",
|
|
2995
|
+
"fill-information-foreground",
|
|
2974
2996
|
"shadow-button",
|
|
2975
2997
|
"focus-visible:outline-information/50",
|
|
2976
2998
|
"hover:bg-information-hover",
|
|
@@ -2984,25 +3006,49 @@ var buttonVariants = {
|
|
|
2984
3006
|
"border",
|
|
2985
3007
|
"bg-background",
|
|
2986
3008
|
"text-foreground",
|
|
3009
|
+
"fill-foreground",
|
|
2987
3010
|
"hover:bg-secondary",
|
|
2988
3011
|
"hover:text-secondary-foreground",
|
|
3012
|
+
"hover:fill-secondary-foreground",
|
|
2989
3013
|
"active:bg-secondary-active",
|
|
3014
|
+
"active:text-secondary-foreground",
|
|
3015
|
+
"active:fill-secondary-foreground",
|
|
2990
3016
|
"aria-pressed:bg-secondary-active",
|
|
3017
|
+
"aria-pressed:text-secondary-foreground",
|
|
3018
|
+
"aria-pressed:fill-secondary-foreground",
|
|
2991
3019
|
"active:data-[toggled=true]:bg-secondary-active",
|
|
3020
|
+
"active:data-[toggled=true]:text-secondary-foreground",
|
|
3021
|
+
"active:data-[toggled=true]:fill-secondary-foreground",
|
|
2992
3022
|
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
2993
|
-
"data-[toggled=true]:
|
|
3023
|
+
"hover:data-[toggled=true]:text-secondary-foreground",
|
|
3024
|
+
"hover:data-[toggled=true]:fill-secondary-foreground",
|
|
3025
|
+
"data-[toggled=true]:bg-secondary-active",
|
|
3026
|
+
"data-[toggled=true]:text-secondary-foreground",
|
|
3027
|
+
"data-[toggled=true]:fill-secondary-foreground"
|
|
2994
3028
|
],
|
|
2995
3029
|
transparent: [
|
|
2996
3030
|
"bg-transparent",
|
|
2997
3031
|
"text-foreground",
|
|
3032
|
+
"fill-foreground",
|
|
2998
3033
|
"shadow-none",
|
|
2999
3034
|
"hover:bg-secondary",
|
|
3000
3035
|
"hover:text-secondary-foreground",
|
|
3036
|
+
"hover:fill-secondary-foreground",
|
|
3001
3037
|
"active:bg-secondary-active",
|
|
3038
|
+
"active:text-secondary-foreground",
|
|
3039
|
+
"active:fill-secondary-foreground",
|
|
3002
3040
|
"aria-pressed:bg-secondary-active",
|
|
3041
|
+
"aria-pressed:text-secondary-foreground",
|
|
3042
|
+
"aria-pressed:fill-secondary-foreground",
|
|
3003
3043
|
"active:data-[toggled=true]:bg-secondary-active",
|
|
3044
|
+
"active:data-[toggled=true]:text-secondary-foreground",
|
|
3045
|
+
"active:data-[toggled=true]:fill-secondary-foreground",
|
|
3004
3046
|
"hover:data-[toggled=true]:bg-secondary-hover",
|
|
3005
|
-
"data-[toggled=true]:
|
|
3047
|
+
"hover:data-[toggled=true]:text-secondary-foreground",
|
|
3048
|
+
"hover:data-[toggled=true]:fill-secondary-foreground",
|
|
3049
|
+
"data-[toggled=true]:bg-secondary-active",
|
|
3050
|
+
"data-[toggled=true]:text-secondary-foreground",
|
|
3051
|
+
"data-[toggled=true]:fill-secondary-foreground"
|
|
3006
3052
|
],
|
|
3007
3053
|
link: ["text-primary", "underline-offset-4", "hover:underline"]
|
|
3008
3054
|
};
|
|
@@ -3018,6 +3064,8 @@ var setButtonClasses = (el) => {
|
|
|
3018
3064
|
"text-sm",
|
|
3019
3065
|
"font-medium",
|
|
3020
3066
|
"transition-all",
|
|
3067
|
+
"duration-100",
|
|
3068
|
+
"motion-reduce:transition-none",
|
|
3021
3069
|
"disabled:pointer-events-none",
|
|
3022
3070
|
"disabled:opacity-50",
|
|
3023
3071
|
"[&_svg]:pointer-events-none",
|
|
@@ -4628,11 +4676,25 @@ function calendar_default(Alpine) {
|
|
|
4628
4676
|
el.classList.add("border", "rounded-control", "gap-2", "p-2");
|
|
4629
4677
|
el.setAttribute("tabindex", "-1");
|
|
4630
4678
|
if (datepicker) {
|
|
4631
|
-
el.classList.add(
|
|
4679
|
+
el.classList.add(
|
|
4680
|
+
"absolute",
|
|
4681
|
+
"bg-popover",
|
|
4682
|
+
"text-popover-foreground",
|
|
4683
|
+
"flex",
|
|
4684
|
+
"flex-col",
|
|
4685
|
+
"hidden",
|
|
4686
|
+
"z-50",
|
|
4687
|
+
"shadow-md",
|
|
4688
|
+
"transition-[opacity,scale]",
|
|
4689
|
+
"motion-reduce:transition-none",
|
|
4690
|
+
"duration-100",
|
|
4691
|
+
"ease-out",
|
|
4692
|
+
"opacity-0",
|
|
4693
|
+
"scale-95"
|
|
4694
|
+
);
|
|
4632
4695
|
el.setAttribute("role", "dialog");
|
|
4633
4696
|
el.setAttribute("aria-modal", "true");
|
|
4634
4697
|
el.setAttribute("data-slot", "date-picker-calendar");
|
|
4635
|
-
el.setAttribute("data-state", datepicker._h_datepicker.state.expanded ? "open" : "closed");
|
|
4636
4698
|
} else {
|
|
4637
4699
|
el.classList.add("shadow-input", "data-[invalid=true]:border-negative", "data-[invalid=true]:ring-negative/20", "dark:data-[invalid=true]:ring-negative/40");
|
|
4638
4700
|
}
|
|
@@ -4680,16 +4742,19 @@ function calendar_default(Alpine) {
|
|
|
4680
4742
|
if (datepicker) {
|
|
4681
4743
|
datepicker._h_datepicker.input.addEventListener("change", onInputChange);
|
|
4682
4744
|
}
|
|
4745
|
+
function setFromModel() {
|
|
4746
|
+
selected = new Date(el._x_model.get());
|
|
4747
|
+
if (isNaN(selected)) {
|
|
4748
|
+
console.error(`${original2}: input value is not a valid date - ${el._x_model.get()}`);
|
|
4749
|
+
if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4750
|
+
else el.setAttribute("data-invalid", "true");
|
|
4751
|
+
} else if (datepicker) {
|
|
4752
|
+
datepicker._h_datepicker.input.value = formatter.format(selected);
|
|
4753
|
+
}
|
|
4754
|
+
}
|
|
4683
4755
|
function checkForModel() {
|
|
4684
4756
|
if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
|
|
4685
|
-
|
|
4686
|
-
if (isNaN(selected)) {
|
|
4687
|
-
console.error(`${original2}: input value is not a valid date - ${el._x_model.get()}`);
|
|
4688
|
-
if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
|
|
4689
|
-
else el.setAttribute("data-invalid", "true");
|
|
4690
|
-
} else if (datepicker) {
|
|
4691
|
-
datepicker._h_datepicker.input.value = formatter.format(selected);
|
|
4692
|
-
}
|
|
4757
|
+
setFromModel();
|
|
4693
4758
|
}
|
|
4694
4759
|
}
|
|
4695
4760
|
function dayClick(event) {
|
|
@@ -4736,6 +4801,7 @@ function calendar_default(Alpine) {
|
|
|
4736
4801
|
"text-sm",
|
|
4737
4802
|
"font-medium",
|
|
4738
4803
|
"transition-all",
|
|
4804
|
+
"motion-reduce:transition-none",
|
|
4739
4805
|
"outline-none",
|
|
4740
4806
|
"focus-visible:border-ring",
|
|
4741
4807
|
"focus-visible:ring-ring/50",
|
|
@@ -4865,6 +4931,9 @@ function calendar_default(Alpine) {
|
|
|
4865
4931
|
"size-8",
|
|
4866
4932
|
"rounded-control",
|
|
4867
4933
|
"outline-none",
|
|
4934
|
+
"duration-100",
|
|
4935
|
+
"transition-all",
|
|
4936
|
+
"motion-reduce:transition-none",
|
|
4868
4937
|
"hover:bg-secondary-hover",
|
|
4869
4938
|
"hover:text-secondary-foreground",
|
|
4870
4939
|
"focus:bg-secondary-hover",
|
|
@@ -5068,25 +5137,59 @@ function calendar_default(Alpine) {
|
|
|
5068
5137
|
left: `${x}px`,
|
|
5069
5138
|
top: `${y}px`
|
|
5070
5139
|
});
|
|
5140
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
5071
5141
|
});
|
|
5072
5142
|
}
|
|
5073
5143
|
if (datepicker) {
|
|
5074
5144
|
effect(() => {
|
|
5075
|
-
el.setAttribute("data-state", datepicker._h_datepicker.state.expanded ? "open" : "closed");
|
|
5076
5145
|
if (datepicker._h_datepicker.state.expanded) {
|
|
5146
|
+
el.classList.remove("hidden");
|
|
5077
5147
|
autoUpdateCleanup = autoUpdate(datepicker, el, updatePosition);
|
|
5078
5148
|
Alpine2.nextTick(() => {
|
|
5079
5149
|
focusDay();
|
|
5080
5150
|
});
|
|
5081
5151
|
} else {
|
|
5152
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
5153
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
5154
|
+
Object.assign(el.style, {
|
|
5155
|
+
left: "0px",
|
|
5156
|
+
top: "0px"
|
|
5157
|
+
});
|
|
5158
|
+
} else {
|
|
5159
|
+
el.classList.add("scale-95", "opacity-0");
|
|
5160
|
+
}
|
|
5082
5161
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
5083
|
-
Object.assign(el.style, {
|
|
5084
|
-
left: "0px",
|
|
5085
|
-
top: "0px"
|
|
5086
|
-
});
|
|
5087
5162
|
}
|
|
5088
5163
|
});
|
|
5089
5164
|
}
|
|
5165
|
+
function onTransitionEnd(event) {
|
|
5166
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
5167
|
+
el.classList.add("hidden");
|
|
5168
|
+
Object.assign(el.style, {
|
|
5169
|
+
left: "0px",
|
|
5170
|
+
top: "0px"
|
|
5171
|
+
});
|
|
5172
|
+
}
|
|
5173
|
+
}
|
|
5174
|
+
if (datepicker) {
|
|
5175
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
5176
|
+
}
|
|
5177
|
+
if (el.hasOwnProperty("_x_model")) {
|
|
5178
|
+
const modelExpression = el.getAttribute("x-model");
|
|
5179
|
+
const evaluateModel = evaluateLater(modelExpression);
|
|
5180
|
+
effect(() => {
|
|
5181
|
+
evaluateModel((value) => {
|
|
5182
|
+
if (!selected && value || value && selected.getTime() !== new Date(value).getTime()) {
|
|
5183
|
+
setFromModel();
|
|
5184
|
+
render();
|
|
5185
|
+
} else if (!value) {
|
|
5186
|
+
if (datepicker) datepicker._h_datepicker.input.value = "";
|
|
5187
|
+
selected = void 0;
|
|
5188
|
+
render();
|
|
5189
|
+
}
|
|
5190
|
+
});
|
|
5191
|
+
});
|
|
5192
|
+
}
|
|
5090
5193
|
cleanup(() => {
|
|
5091
5194
|
el.removeEventListener("keydown", onKeyDown);
|
|
5092
5195
|
for (let d = 0; d < dayCells.length; d++) {
|
|
@@ -5094,6 +5197,7 @@ function calendar_default(Alpine) {
|
|
|
5094
5197
|
}
|
|
5095
5198
|
if (datepicker) {
|
|
5096
5199
|
datepicker._h_datepicker.input.removeEventListener("change", onInputChange);
|
|
5200
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
5097
5201
|
}
|
|
5098
5202
|
});
|
|
5099
5203
|
});
|
|
@@ -5168,7 +5272,8 @@ function checkbox_default(Alpine) {
|
|
|
5168
5272
|
"shadow-input",
|
|
5169
5273
|
"shrink-0",
|
|
5170
5274
|
"size-5",
|
|
5171
|
-
"transition-
|
|
5275
|
+
"transition-colors",
|
|
5276
|
+
"motion-reduce:transition-none"
|
|
5172
5277
|
);
|
|
5173
5278
|
el.setAttribute("tabindex", "-1");
|
|
5174
5279
|
el.setAttribute("data-slot", "checkbox");
|
|
@@ -5177,57 +5282,6 @@ function checkbox_default(Alpine) {
|
|
|
5177
5282
|
});
|
|
5178
5283
|
}
|
|
5179
5284
|
|
|
5180
|
-
// src/components/collapsible.js
|
|
5181
|
-
function collapsible_default(Alpine) {
|
|
5182
|
-
Alpine.directive("h-collapsible", (el, { expression }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
|
|
5183
|
-
el._h_collapsible = Alpine2.reactive({
|
|
5184
|
-
expanded: expression ? evaluate2(expression) : false
|
|
5185
|
-
});
|
|
5186
|
-
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible");
|
|
5187
|
-
if (expression) {
|
|
5188
|
-
const getExpanded = evaluateLater(expression);
|
|
5189
|
-
effect(() => {
|
|
5190
|
-
getExpanded((expanded) => {
|
|
5191
|
-
el._h_collapsible.expanded = expanded;
|
|
5192
|
-
});
|
|
5193
|
-
});
|
|
5194
|
-
}
|
|
5195
|
-
});
|
|
5196
|
-
Alpine.directive("h-collapsible-trigger", (el, { original: original2, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
|
|
5197
|
-
const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
|
|
5198
|
-
if (!collapsible) {
|
|
5199
|
-
throw new Error(`${original2} must be inside a collapsible element`);
|
|
5200
|
-
}
|
|
5201
|
-
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-trigger");
|
|
5202
|
-
if (modifiers.includes("chevron")) {
|
|
5203
|
-
el.classList.add("[&_svg]:transition-transform");
|
|
5204
|
-
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");
|
|
5205
|
-
else el.classList.add("[&[data-state=open]>svg:not(:first-child):last-child]:rotate-180", "[&[data-state=open]>svg:only-child]:rotate-180");
|
|
5206
|
-
}
|
|
5207
|
-
const handler = () => {
|
|
5208
|
-
collapsible._h_collapsible.expanded = !collapsible._h_collapsible.expanded;
|
|
5209
|
-
};
|
|
5210
|
-
effect(() => {
|
|
5211
|
-
el.setAttribute("data-state", collapsible._h_collapsible.expanded ? "open" : "closed");
|
|
5212
|
-
});
|
|
5213
|
-
el.addEventListener("click", handler);
|
|
5214
|
-
cleanup(() => {
|
|
5215
|
-
el.removeEventListener("click", handler);
|
|
5216
|
-
});
|
|
5217
|
-
});
|
|
5218
|
-
Alpine.directive("h-collapsible-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
|
|
5219
|
-
const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
|
|
5220
|
-
if (!collapsible) {
|
|
5221
|
-
throw new Error(`${original2} must be inside an h-collapsible element`);
|
|
5222
|
-
}
|
|
5223
|
-
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-content");
|
|
5224
|
-
el.classList.add("data-[state=closed]:!hidden");
|
|
5225
|
-
effect(() => {
|
|
5226
|
-
el.setAttribute("data-state", collapsible._h_collapsible.expanded ? "open" : "closed");
|
|
5227
|
-
});
|
|
5228
|
-
});
|
|
5229
|
-
}
|
|
5230
|
-
|
|
5231
5285
|
// src/common/input-size.js
|
|
5232
5286
|
function setSize(el, size3) {
|
|
5233
5287
|
if (size3 === "sm") {
|
|
@@ -5275,7 +5329,9 @@ function datepicker_default(Alpine) {
|
|
|
5275
5329
|
"border-input",
|
|
5276
5330
|
"flex",
|
|
5277
5331
|
"items-center",
|
|
5278
|
-
"transition-
|
|
5332
|
+
"transition-colors",
|
|
5333
|
+
"transition-shadow",
|
|
5334
|
+
"motion-reduce:transition-none",
|
|
5279
5335
|
"duration-200",
|
|
5280
5336
|
"outline-none",
|
|
5281
5337
|
"pl-3",
|
|
@@ -5350,7 +5406,20 @@ function datepicker_default(Alpine) {
|
|
|
5350
5406
|
if (!datepicker) {
|
|
5351
5407
|
throw new Error(`${original2} must be inside an date-picker element`);
|
|
5352
5408
|
}
|
|
5353
|
-
el.classList.add(
|
|
5409
|
+
el.classList.add(
|
|
5410
|
+
"cursor-pointer",
|
|
5411
|
+
"inline-flex",
|
|
5412
|
+
"items-center",
|
|
5413
|
+
"justify-center",
|
|
5414
|
+
"h-full",
|
|
5415
|
+
"aspect-square",
|
|
5416
|
+
"bg-transparent",
|
|
5417
|
+
"hover:bg-secondary",
|
|
5418
|
+
"hover:text-secondary-foreground",
|
|
5419
|
+
"active:bg-secondary-active",
|
|
5420
|
+
"active:text-secondary-foreground",
|
|
5421
|
+
"outline-none"
|
|
5422
|
+
);
|
|
5354
5423
|
if (datepicker._h_datepicker.inTable) {
|
|
5355
5424
|
el.classList.add(
|
|
5356
5425
|
"focus-visible:inset-ring-ring/50",
|
|
@@ -5381,7 +5450,7 @@ function datepicker_default(Alpine) {
|
|
|
5381
5450
|
el.appendChild(
|
|
5382
5451
|
createSvg({
|
|
5383
5452
|
icon: Calendar,
|
|
5384
|
-
classes: "opacity-70 text-
|
|
5453
|
+
classes: "opacity-70 text-inherit size-4",
|
|
5385
5454
|
attrs: {
|
|
5386
5455
|
"aria-hidden": true,
|
|
5387
5456
|
role: "presentation"
|
|
@@ -5416,11 +5485,20 @@ function datepicker_default(Alpine) {
|
|
|
5416
5485
|
// src/components/dialog.js
|
|
5417
5486
|
function dialog_default(Alpine) {
|
|
5418
5487
|
Alpine.directive("h-dialog-overlay", (el, _, { cleanup }) => {
|
|
5419
|
-
el.classList.add("hidden", "
|
|
5488
|
+
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");
|
|
5420
5489
|
el.setAttribute("tabindex", "-1");
|
|
5421
5490
|
el.setAttribute("data-slot", "dialog-overlay");
|
|
5422
5491
|
const observer = new MutationObserver(() => {
|
|
5423
5492
|
if (el.getAttribute("data-open") === "true") {
|
|
5493
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
5494
|
+
el.classList.remove("hidden", "*:scale-95", "opacity-0");
|
|
5495
|
+
} else {
|
|
5496
|
+
el.classList.remove("hidden");
|
|
5497
|
+
Alpine.nextTick(() => {
|
|
5498
|
+
el.offsetHeight;
|
|
5499
|
+
el.classList.remove("*:scale-95", "opacity-0");
|
|
5500
|
+
});
|
|
5501
|
+
}
|
|
5424
5502
|
const inputs = el.getElementsByTagName("INPUT");
|
|
5425
5503
|
if (inputs.length) {
|
|
5426
5504
|
for (let i = 0; i < inputs.length; i++) {
|
|
@@ -5448,11 +5526,24 @@ function dialog_default(Alpine) {
|
|
|
5448
5526
|
if (buttons.length) {
|
|
5449
5527
|
buttons[0].focus();
|
|
5450
5528
|
}
|
|
5529
|
+
} else {
|
|
5530
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
5531
|
+
el.classList.add("hidden", "*:scale-95", "opacity-0");
|
|
5532
|
+
} else {
|
|
5533
|
+
el.classList.add("*:scale-95", "opacity-0");
|
|
5534
|
+
}
|
|
5451
5535
|
}
|
|
5452
5536
|
});
|
|
5537
|
+
function onTransitionEnd(event) {
|
|
5538
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
5539
|
+
el.classList.add("hidden");
|
|
5540
|
+
}
|
|
5541
|
+
}
|
|
5542
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
5453
5543
|
observer.observe(el, { attributes: true, attributeFilter: ["data-open"] });
|
|
5454
5544
|
cleanup(() => {
|
|
5455
5545
|
observer.disconnect();
|
|
5546
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
5456
5547
|
});
|
|
5457
5548
|
});
|
|
5458
5549
|
Alpine.directive("h-dialog", (el) => {
|
|
@@ -5475,7 +5566,11 @@ function dialog_default(Alpine) {
|
|
|
5475
5566
|
"p-4",
|
|
5476
5567
|
"shadow-xl",
|
|
5477
5568
|
"sm:max-w-lg",
|
|
5478
|
-
"outline-none"
|
|
5569
|
+
"outline-none",
|
|
5570
|
+
"transition-[opacity,scale]",
|
|
5571
|
+
"motion-reduce:transition-none",
|
|
5572
|
+
"duration-200",
|
|
5573
|
+
"ease-out"
|
|
5479
5574
|
);
|
|
5480
5575
|
el.setAttribute("role", "dialog");
|
|
5481
5576
|
el.setAttribute("data-slot", "dialog");
|
|
@@ -5504,6 +5599,7 @@ function dialog_default(Alpine) {
|
|
|
5504
5599
|
"rounded-xs",
|
|
5505
5600
|
"opacity-70",
|
|
5506
5601
|
"transition-opacity",
|
|
5602
|
+
"motion-reduce:transition-none",
|
|
5507
5603
|
"hover:opacity-100",
|
|
5508
5604
|
"focus:ring-2",
|
|
5509
5605
|
"focus:ring-offset-2",
|
|
@@ -5534,6 +5630,161 @@ function dialog_default(Alpine) {
|
|
|
5534
5630
|
});
|
|
5535
5631
|
}
|
|
5536
5632
|
|
|
5633
|
+
// src/components/expansion-panel.js
|
|
5634
|
+
function expansion_panel_default(Alpine) {
|
|
5635
|
+
Alpine.directive("h-exp-panel", (el) => {
|
|
5636
|
+
el.classList.add("vbox", "h-full", "group/exp", "data-[floating=true]:gap-2", "data-[floating=true]:overflow-visible");
|
|
5637
|
+
el.setAttribute("data-slot", "exp-panel");
|
|
5638
|
+
});
|
|
5639
|
+
Alpine.directive("h-exp-panel-item", (el, { expression }, { evaluate: evaluate2, evaluateLater, effect, Alpine: Alpine2 }) => {
|
|
5640
|
+
el.classList.add(
|
|
5641
|
+
"flex",
|
|
5642
|
+
"flex-col",
|
|
5643
|
+
"overflow-hidden",
|
|
5644
|
+
"transition-all",
|
|
5645
|
+
"motion-reduce:transition-none",
|
|
5646
|
+
"duration-300",
|
|
5647
|
+
"ease-out",
|
|
5648
|
+
"h-full",
|
|
5649
|
+
"border-b",
|
|
5650
|
+
"last:border-b-0",
|
|
5651
|
+
"min-h-12",
|
|
5652
|
+
"[[data-size=md]_&]:min-h-10",
|
|
5653
|
+
"[[data-size=sm]_&]:min-h-8",
|
|
5654
|
+
"[[data-floating=true]_&]:border-b-0",
|
|
5655
|
+
"[[data-floating=true]_&]:overflow-visible"
|
|
5656
|
+
);
|
|
5657
|
+
el.setAttribute("data-slot", "exp-panel-item");
|
|
5658
|
+
let itemId;
|
|
5659
|
+
if (el.hasAttribute("id")) {
|
|
5660
|
+
itemId = el.getAttribute("id");
|
|
5661
|
+
} else {
|
|
5662
|
+
itemId = `epi${uuid_default()}`;
|
|
5663
|
+
}
|
|
5664
|
+
function setExpanded(expanded) {
|
|
5665
|
+
if (expanded) {
|
|
5666
|
+
el.classList.add("flex-[1_1_0]");
|
|
5667
|
+
el.classList.remove("flex-[0_1_0]");
|
|
5668
|
+
} else {
|
|
5669
|
+
el.classList.add("flex-[0_1_0]");
|
|
5670
|
+
el.classList.remove("flex-[1_1_0]");
|
|
5671
|
+
}
|
|
5672
|
+
}
|
|
5673
|
+
el._h_expPanelItem = Alpine2.reactive({
|
|
5674
|
+
controls: itemId,
|
|
5675
|
+
expanded: evaluate2(expression || "false")
|
|
5676
|
+
});
|
|
5677
|
+
if (expression !== "" && expression !== void 0 && expression !== null && expression !== "true" && expression !== "false") {
|
|
5678
|
+
const getIsExpanded = evaluateLater(expression);
|
|
5679
|
+
effect(() => {
|
|
5680
|
+
getIsExpanded((expanded) => {
|
|
5681
|
+
setExpanded(expanded);
|
|
5682
|
+
});
|
|
5683
|
+
});
|
|
5684
|
+
effect(() => {
|
|
5685
|
+
if (evaluate2(expression) !== el._h_expPanelItem.expanded) {
|
|
5686
|
+
evaluate2(`${expression} = ${el._h_expPanelItem.expanded}`);
|
|
5687
|
+
}
|
|
5688
|
+
});
|
|
5689
|
+
} else {
|
|
5690
|
+
effect(() => {
|
|
5691
|
+
setExpanded(el._h_expPanelItem.expanded);
|
|
5692
|
+
});
|
|
5693
|
+
}
|
|
5694
|
+
});
|
|
5695
|
+
Alpine.directive("h-exp-panel-trigger", (el, { original: original2, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
|
|
5696
|
+
if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
|
|
5697
|
+
throw new Error(`${original2} must be a header element`);
|
|
5698
|
+
}
|
|
5699
|
+
const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_expPanelItem"));
|
|
5700
|
+
if (!expPanelItem) {
|
|
5701
|
+
throw new Error(`${original2} must have an exp-panel-item parent element`);
|
|
5702
|
+
}
|
|
5703
|
+
el.classList.add(
|
|
5704
|
+
"bg-object-header",
|
|
5705
|
+
"border-b",
|
|
5706
|
+
"[[data-slot=exp-panel-item]:last-child>&]:not-has-[button[aria-expanded=true]]:group-has-[button[aria-expanded=true]]/exp:border-b-0",
|
|
5707
|
+
"flex",
|
|
5708
|
+
"h-12",
|
|
5709
|
+
"min-h-12",
|
|
5710
|
+
"px-4",
|
|
5711
|
+
"text-object-header-foreground",
|
|
5712
|
+
"[[data-floating=true]_&]:border",
|
|
5713
|
+
"[[data-floating=true]_&]:!border-b",
|
|
5714
|
+
"[[data-floating=true]_&]:rounded-lg",
|
|
5715
|
+
"[[data-floating=true]_&]:shadow-xs",
|
|
5716
|
+
"[[data-size=md]_&]:h-10",
|
|
5717
|
+
"[[data-size=md]_&]:min-h-10",
|
|
5718
|
+
"[[data-size=md]_&]:px-3",
|
|
5719
|
+
"[[data-size=sm]_&]:h-8",
|
|
5720
|
+
"[[data-size=sm]_&]:min-h-8",
|
|
5721
|
+
"[[data-size=sm]_&]:px-2.5",
|
|
5722
|
+
"[[data-variant=transparent]_&]:bg-transparent",
|
|
5723
|
+
"[[data-variant=transparent]_&]:text-foreground"
|
|
5724
|
+
);
|
|
5725
|
+
el.setAttribute("tabIndex", "-1");
|
|
5726
|
+
const getLabel = evaluateLater(expression);
|
|
5727
|
+
const chevronDown = createSvg({
|
|
5728
|
+
icon: ChevronDown,
|
|
5729
|
+
classes: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform motion-reduce:transition-none duration-200",
|
|
5730
|
+
attrs: {
|
|
5731
|
+
"aria-hidden": true,
|
|
5732
|
+
role: "presentation"
|
|
5733
|
+
}
|
|
5734
|
+
});
|
|
5735
|
+
const button = document.createElement("button");
|
|
5736
|
+
button.setAttribute("type", "button");
|
|
5737
|
+
button.setAttribute("tabIndex", "0");
|
|
5738
|
+
button.setAttribute("data-slot", "exp-panel-trigger");
|
|
5739
|
+
button.classList.add(
|
|
5740
|
+
"cursor-pointer",
|
|
5741
|
+
"focus-visible:border-ring",
|
|
5742
|
+
"focus-visible:ring-ring/50",
|
|
5743
|
+
"flex",
|
|
5744
|
+
"flex-1",
|
|
5745
|
+
"items-center",
|
|
5746
|
+
"justify-between",
|
|
5747
|
+
"gap-4",
|
|
5748
|
+
"text-left",
|
|
5749
|
+
"text-sm",
|
|
5750
|
+
"font-medium",
|
|
5751
|
+
"transition-all",
|
|
5752
|
+
"motion-reduce:transition-none",
|
|
5753
|
+
"outline-none",
|
|
5754
|
+
"hover:underline",
|
|
5755
|
+
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
5756
|
+
"disabled:pointer-events-none",
|
|
5757
|
+
"disabled:opacity-50",
|
|
5758
|
+
"[&[aria-expanded=true]>svg]:rotate-180"
|
|
5759
|
+
);
|
|
5760
|
+
el.appendChild(button);
|
|
5761
|
+
effect(() => {
|
|
5762
|
+
getLabel((label) => {
|
|
5763
|
+
button.innerText = label;
|
|
5764
|
+
button.appendChild(chevronDown);
|
|
5765
|
+
});
|
|
5766
|
+
});
|
|
5767
|
+
button.setAttribute("id", expPanelItem._h_expPanelItem.id);
|
|
5768
|
+
button.setAttribute("aria-controls", expPanelItem._h_expPanelItem.controls);
|
|
5769
|
+
const setAttributes = () => {
|
|
5770
|
+
button.setAttribute("aria-expanded", expPanelItem._h_expPanelItem.expanded);
|
|
5771
|
+
};
|
|
5772
|
+
const handler = () => {
|
|
5773
|
+
expPanelItem._h_expPanelItem.expanded = !expPanelItem._h_expPanelItem.expanded;
|
|
5774
|
+
setAttributes();
|
|
5775
|
+
};
|
|
5776
|
+
setAttributes();
|
|
5777
|
+
el.addEventListener("click", handler);
|
|
5778
|
+
cleanup(() => {
|
|
5779
|
+
el.removeEventListener("click", handler);
|
|
5780
|
+
});
|
|
5781
|
+
});
|
|
5782
|
+
Alpine.directive("h-exp-panel-content", (el) => {
|
|
5783
|
+
el.classList.add("flex-1", "overflow-scroll");
|
|
5784
|
+
el.setAttribute("data-slot", "exp-panel-content");
|
|
5785
|
+
});
|
|
5786
|
+
}
|
|
5787
|
+
|
|
5537
5788
|
// src/components/fieldset.js
|
|
5538
5789
|
function fieldset_default(Alpine) {
|
|
5539
5790
|
Alpine.directive("h-fieldset", (el) => {
|
|
@@ -5706,7 +5957,9 @@ function input_default(Alpine) {
|
|
|
5706
5957
|
"[&::-webkit-color-swatch-wrapper]:rounded-0",
|
|
5707
5958
|
"[&::-webkit-color-swatch-wrapper]:p-0",
|
|
5708
5959
|
"text-base",
|
|
5709
|
-
"transition-
|
|
5960
|
+
"transition-colors",
|
|
5961
|
+
"transition-shadow",
|
|
5962
|
+
"motion-reduce:transition-none",
|
|
5710
5963
|
"outline-none",
|
|
5711
5964
|
"file:inline-flex",
|
|
5712
5965
|
"file:h-7",
|
|
@@ -5763,7 +6016,9 @@ function input_default(Alpine) {
|
|
|
5763
6016
|
"rounded-control",
|
|
5764
6017
|
"border",
|
|
5765
6018
|
"shadow-input",
|
|
5766
|
-
"transition-
|
|
6019
|
+
"transition-colors",
|
|
6020
|
+
"transition-shadow",
|
|
6021
|
+
"motion-reduce:transition-none",
|
|
5767
6022
|
"outline-none",
|
|
5768
6023
|
"min-w-0",
|
|
5769
6024
|
"has-[>textarea]:h-auto",
|
|
@@ -5864,7 +6119,10 @@ function input_default(Alpine) {
|
|
|
5864
6119
|
"rounded-control",
|
|
5865
6120
|
"border",
|
|
5866
6121
|
"shadow-input",
|
|
5867
|
-
"transition-
|
|
6122
|
+
"transition-colors",
|
|
6123
|
+
"transition-shadow",
|
|
6124
|
+
"motion-reduce:transition-none",
|
|
6125
|
+
"duration-200",
|
|
5868
6126
|
"outline-none",
|
|
5869
6127
|
"min-w-0",
|
|
5870
6128
|
"has-[input:focus-visible]:border-ring",
|
|
@@ -5909,7 +6167,7 @@ function input_default(Alpine) {
|
|
|
5909
6167
|
stepDown.appendChild(
|
|
5910
6168
|
createSvg({
|
|
5911
6169
|
icon: Minus,
|
|
5912
|
-
classes: "opacity-70
|
|
6170
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
5913
6171
|
attrs: {
|
|
5914
6172
|
"aria-hidden": true,
|
|
5915
6173
|
role: "presentation"
|
|
@@ -5927,16 +6185,23 @@ function input_default(Alpine) {
|
|
|
5927
6185
|
"[input:invalid~&]:border-negative",
|
|
5928
6186
|
"h-full",
|
|
5929
6187
|
"aspect-square",
|
|
6188
|
+
"transition-colors",
|
|
6189
|
+
"motion-reduce:transition-none",
|
|
6190
|
+
"duration-100",
|
|
5930
6191
|
"bg-transparent",
|
|
5931
6192
|
"hover:bg-secondary",
|
|
6193
|
+
"hover:text-secondary-foreground",
|
|
5932
6194
|
"active:bg-secondary-active",
|
|
6195
|
+
"active:text-secondary-foreground",
|
|
5933
6196
|
"outline-none",
|
|
5934
6197
|
"relative",
|
|
5935
6198
|
"[&:hover>svg]:text-secondary-foreground"
|
|
5936
6199
|
);
|
|
5937
6200
|
el.appendChild(stepDown);
|
|
5938
6201
|
const onStepDown = () => {
|
|
5939
|
-
input.
|
|
6202
|
+
if (input.step === "any") {
|
|
6203
|
+
input.value = (parseFloat(input.value) || 0) - 1;
|
|
6204
|
+
} else input.stepDown();
|
|
5940
6205
|
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
5941
6206
|
input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
5942
6207
|
};
|
|
@@ -5950,7 +6215,7 @@ function input_default(Alpine) {
|
|
|
5950
6215
|
stepUp.appendChild(
|
|
5951
6216
|
createSvg({
|
|
5952
6217
|
icon: Plus,
|
|
5953
|
-
classes: "opacity-70
|
|
6218
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
5954
6219
|
attrs: {
|
|
5955
6220
|
"aria-hidden": true,
|
|
5956
6221
|
role: "presentation"
|
|
@@ -5968,16 +6233,23 @@ function input_default(Alpine) {
|
|
|
5968
6233
|
"[input:invalid~&]:border-negative",
|
|
5969
6234
|
"h-full",
|
|
5970
6235
|
"aspect-square",
|
|
6236
|
+
"transition-all",
|
|
6237
|
+
"motion-reduce:transition-none",
|
|
6238
|
+
"duration-100",
|
|
5971
6239
|
"bg-transparent",
|
|
5972
6240
|
"hover:bg-secondary",
|
|
6241
|
+
"hover:text-secondary-foreground",
|
|
5973
6242
|
"active:bg-secondary-active",
|
|
6243
|
+
"active:text-secondary-foreground",
|
|
5974
6244
|
"outline-none",
|
|
5975
6245
|
"relative",
|
|
5976
6246
|
"[&:hover>svg]:text-secondary-foreground"
|
|
5977
6247
|
);
|
|
5978
6248
|
el.appendChild(stepUp);
|
|
5979
6249
|
const onStepUp = () => {
|
|
5980
|
-
input.
|
|
6250
|
+
if (input.step === "any") {
|
|
6251
|
+
input.value = (parseFloat(input.value) || 0) + 1;
|
|
6252
|
+
} else input.stepUp();
|
|
5981
6253
|
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
5982
6254
|
input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
5983
6255
|
};
|
|
@@ -6183,23 +6455,47 @@ function menu_default(Alpine) {
|
|
|
6183
6455
|
el._menu_trigger = {
|
|
6184
6456
|
isDropdown: modifiers.includes("dropdown"),
|
|
6185
6457
|
setOpen(open) {
|
|
6186
|
-
el.setAttribute("
|
|
6458
|
+
el.setAttribute("aria-expanded", open);
|
|
6187
6459
|
}
|
|
6188
6460
|
};
|
|
6189
|
-
el.
|
|
6461
|
+
if (el._menu_trigger.isDropdown) {
|
|
6462
|
+
el.setAttribute("aria-haspopup", "true");
|
|
6463
|
+
el.setAttribute("aria-expanded", "false");
|
|
6464
|
+
if (!el.hasAttribute("id")) {
|
|
6465
|
+
el.setAttribute("id", `mt${uuid_default()}`);
|
|
6466
|
+
}
|
|
6467
|
+
}
|
|
6190
6468
|
});
|
|
6191
6469
|
Alpine.directive("h-menu", (el, { original: original2, modifiers }, { cleanup, Alpine: Alpine2 }) => {
|
|
6192
6470
|
if (el.tagName !== "UL") {
|
|
6193
6471
|
throw new Error(`${original2} must be an ul element`);
|
|
6194
6472
|
}
|
|
6195
|
-
el.classList.add(
|
|
6473
|
+
el.classList.add(
|
|
6474
|
+
"hidden",
|
|
6475
|
+
"fixed",
|
|
6476
|
+
"bg-popover",
|
|
6477
|
+
"text-popover-foreground",
|
|
6478
|
+
"font-normal",
|
|
6479
|
+
"z-50",
|
|
6480
|
+
"min-w-[8rem]",
|
|
6481
|
+
"overflow-x-hidden",
|
|
6482
|
+
"overflow-y-auto",
|
|
6483
|
+
"rounded-md",
|
|
6484
|
+
"p-1",
|
|
6485
|
+
"shadow-md",
|
|
6486
|
+
"border",
|
|
6487
|
+
"outline-none",
|
|
6488
|
+
"transition-[opacity,scale]",
|
|
6489
|
+
"motion-reduce:transition-none",
|
|
6490
|
+
"duration-100",
|
|
6491
|
+
"ease-out",
|
|
6492
|
+
"opacity-0",
|
|
6493
|
+
"scale-95"
|
|
6494
|
+
);
|
|
6196
6495
|
el.setAttribute("role", "menu");
|
|
6197
6496
|
el.setAttribute("aria-orientation", "vertical");
|
|
6198
6497
|
el.setAttribute("tabindex", "-1");
|
|
6199
6498
|
el.setAttribute("data-slot", "menu");
|
|
6200
|
-
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
6201
|
-
throw new Error(`${original2} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
6202
|
-
}
|
|
6203
6499
|
const isSubmenu = modifiers.includes("sub");
|
|
6204
6500
|
const menuTrigger = (() => {
|
|
6205
6501
|
if (isSubmenu) return;
|
|
@@ -6208,15 +6504,31 @@ function menu_default(Alpine) {
|
|
|
6208
6504
|
sibling = sibling.previousElementSibling;
|
|
6209
6505
|
}
|
|
6210
6506
|
if (!sibling.hasOwnProperty("_menu_trigger")) {
|
|
6211
|
-
throw new Error(`${original2} must be placed after
|
|
6507
|
+
throw new Error(`${original2} menu must be placed after a menu trigger element`);
|
|
6212
6508
|
}
|
|
6213
6509
|
return sibling;
|
|
6214
6510
|
})();
|
|
6215
|
-
|
|
6216
|
-
|
|
6511
|
+
function setAriaAttrubutes(parent) {
|
|
6512
|
+
if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
|
|
6513
|
+
if (parent && parent.hasAttribute("id")) {
|
|
6514
|
+
el.setAttribute("aria-labelledby", parent.id);
|
|
6515
|
+
} else {
|
|
6516
|
+
throw new Error(`${original2} must have an "aria-label" or "aria-labelledby" attribute`);
|
|
6517
|
+
}
|
|
6518
|
+
}
|
|
6217
6519
|
}
|
|
6218
6520
|
let menuSubItem;
|
|
6219
|
-
if (isSubmenu)
|
|
6521
|
+
if (isSubmenu) {
|
|
6522
|
+
menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
|
|
6523
|
+
if (!menuSubItem) {
|
|
6524
|
+
throw new Error(`${original2} must be placed inside a ${Alpine2.prefixed("h-menu-sub")} element`);
|
|
6525
|
+
}
|
|
6526
|
+
setAriaAttrubutes(menuSubItem);
|
|
6527
|
+
} else if (menuTrigger) {
|
|
6528
|
+
setAriaAttrubutes(menuTrigger._menu_trigger.isDropdown ? menuTrigger : void 0);
|
|
6529
|
+
} else {
|
|
6530
|
+
setAriaAttrubutes();
|
|
6531
|
+
}
|
|
6220
6532
|
function listenForTrigger(listen) {
|
|
6221
6533
|
if (listen) {
|
|
6222
6534
|
if (menuTrigger._menu_trigger.isDropdown) menuTrigger.addEventListener("click", openDropdown);
|
|
@@ -6228,11 +6540,15 @@ function menu_default(Alpine) {
|
|
|
6228
6540
|
}
|
|
6229
6541
|
function close(closeParent = false, focusTrigger = false) {
|
|
6230
6542
|
el.pauseKeyEvents = false;
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6543
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
6544
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
6545
|
+
Object.assign(el.style, {
|
|
6546
|
+
left: "0px",
|
|
6547
|
+
top: "0px"
|
|
6548
|
+
});
|
|
6549
|
+
} else {
|
|
6550
|
+
el.classList.add("scale-95", "opacity-0");
|
|
6551
|
+
}
|
|
6236
6552
|
top.removeEventListener("contextmenu", onClick);
|
|
6237
6553
|
top.removeEventListener("click", onClick);
|
|
6238
6554
|
el.removeEventListener("keydown", onKeyDown);
|
|
@@ -6268,7 +6584,9 @@ function menu_default(Alpine) {
|
|
|
6268
6584
|
}
|
|
6269
6585
|
function onClick(event) {
|
|
6270
6586
|
if (event.type === "contextmenu") event.preventDefault();
|
|
6271
|
-
|
|
6587
|
+
if (el.getAttribute("data-innerclicks") === "true" && el.contains(event.composedPath()[0])) {
|
|
6588
|
+
return;
|
|
6589
|
+
} else close(isSubmenu);
|
|
6272
6590
|
}
|
|
6273
6591
|
el.pauseKeyEvents = false;
|
|
6274
6592
|
function onKeyDown(event) {
|
|
@@ -6392,6 +6710,7 @@ function menu_default(Alpine) {
|
|
|
6392
6710
|
left: `${x}px`,
|
|
6393
6711
|
top: `${y}px`
|
|
6394
6712
|
});
|
|
6713
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
6395
6714
|
});
|
|
6396
6715
|
}
|
|
6397
6716
|
}
|
|
@@ -6425,11 +6744,22 @@ function menu_default(Alpine) {
|
|
|
6425
6744
|
} else {
|
|
6426
6745
|
listenForTrigger(true);
|
|
6427
6746
|
}
|
|
6747
|
+
function onTransitionEnd(event) {
|
|
6748
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
6749
|
+
el.classList.add("hidden");
|
|
6750
|
+
Object.assign(el.style, {
|
|
6751
|
+
left: "0px",
|
|
6752
|
+
top: "0px"
|
|
6753
|
+
});
|
|
6754
|
+
}
|
|
6755
|
+
}
|
|
6756
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
6428
6757
|
cleanup(() => {
|
|
6429
6758
|
if (menuTrigger) listenForTrigger(false);
|
|
6430
6759
|
top.removeEventListener("click", onClick);
|
|
6431
6760
|
top.removeEventListener("contextmenu", onClick);
|
|
6432
6761
|
el.removeEventListener("keydown", onKeyDown);
|
|
6762
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
6433
6763
|
});
|
|
6434
6764
|
});
|
|
6435
6765
|
Alpine.directive("h-menu-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
|
|
@@ -6521,6 +6851,9 @@ function menu_default(Alpine) {
|
|
|
6521
6851
|
el.appendChild(chevronRight);
|
|
6522
6852
|
const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
|
|
6523
6853
|
if (!parentMenu) throw new Error(`${original2} must have a parent`);
|
|
6854
|
+
if (!el.hasAttribute("id")) {
|
|
6855
|
+
el.setAttribute("id", `ms${uuid_default()}`);
|
|
6856
|
+
}
|
|
6524
6857
|
el._menu_sub = {
|
|
6525
6858
|
open: void 0,
|
|
6526
6859
|
close: void 0,
|
|
@@ -6636,6 +6969,7 @@ function menu_default(Alpine) {
|
|
|
6636
6969
|
"aria-[disabled=true]:cursor-not-allowed",
|
|
6637
6970
|
"aria-[disabled=true]:opacity-50",
|
|
6638
6971
|
"transition-all",
|
|
6972
|
+
"motion-reduce:transition-none",
|
|
6639
6973
|
"overflow-hidden",
|
|
6640
6974
|
"aria-[checked=true]:[&>svg]:visible"
|
|
6641
6975
|
);
|
|
@@ -6705,6 +7039,7 @@ function menu_default(Alpine) {
|
|
|
6705
7039
|
"aria-[disabled=true]:cursor-not-allowed",
|
|
6706
7040
|
"aria-[disabled=true]:opacity-50",
|
|
6707
7041
|
"transition-all",
|
|
7042
|
+
"motion-reduce:transition-none",
|
|
6708
7043
|
"overflow-hidden",
|
|
6709
7044
|
"before:invisible",
|
|
6710
7045
|
"before:bg-foreground",
|
|
@@ -6910,7 +7245,7 @@ function notifications_default(Alpine) {
|
|
|
6910
7245
|
const listener = {
|
|
6911
7246
|
added(item) {
|
|
6912
7247
|
const clone = notificationTemplates[item.template].content.firstElementChild.cloneNode(true);
|
|
6913
|
-
clone.classList.add("transform", "transition-all", "duration-300", "ease-out", "opacity-0");
|
|
7248
|
+
clone.classList.add("transform", "transition-all", "motion-reduce:transition-none", "duration-300", "ease-out", "opacity-0");
|
|
6914
7249
|
clone.setAttribute("id", item.id);
|
|
6915
7250
|
Alpine2.addScopeToNode(clone, item.data);
|
|
6916
7251
|
if (!isExtraLarge && !isLarge) {
|
|
@@ -6965,15 +7300,20 @@ function notifications_default(Alpine) {
|
|
|
6965
7300
|
removed(id) {
|
|
6966
7301
|
const element = el.querySelector(`#${id}`);
|
|
6967
7302
|
if (element) {
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
()
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
7303
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
7304
|
+
Alpine2.destroyTree(element);
|
|
7305
|
+
element.remove();
|
|
7306
|
+
} else {
|
|
7307
|
+
element.addEventListener(
|
|
7308
|
+
"transitionend",
|
|
7309
|
+
() => {
|
|
7310
|
+
Alpine2.destroyTree(element);
|
|
7311
|
+
element.remove();
|
|
7312
|
+
},
|
|
7313
|
+
{ once: true }
|
|
7314
|
+
);
|
|
7315
|
+
element.classList.add(element._h_animation_class, "opacity-0");
|
|
7316
|
+
}
|
|
6977
7317
|
}
|
|
6978
7318
|
}
|
|
6979
7319
|
};
|
|
@@ -7083,6 +7423,7 @@ function pagination_default(Alpine) {
|
|
|
7083
7423
|
"text-sm",
|
|
7084
7424
|
"font-medium",
|
|
7085
7425
|
"transition-all",
|
|
7426
|
+
"motion-reduce:transition-none",
|
|
7086
7427
|
"disabled:pointer-events-none",
|
|
7087
7428
|
"disabled:opacity-50",
|
|
7088
7429
|
"[&_svg]:pointer-events-none",
|
|
@@ -7157,7 +7498,7 @@ function popover_default(Alpine) {
|
|
|
7157
7498
|
}
|
|
7158
7499
|
el.setAttribute("type", "button");
|
|
7159
7500
|
if (modifiers.includes("chevron")) {
|
|
7160
|
-
el.classList.add("[&_svg]:transition-transform", "[&[
|
|
7501
|
+
el.classList.add("[&_svg]:transition-transform", "motion-reduce:[&_svg]:transition-none", "[&[aria-expanded=true]>svg:not(:first-child):last-child]:rotate-180");
|
|
7161
7502
|
}
|
|
7162
7503
|
if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "popover-trigger");
|
|
7163
7504
|
if (el.hasAttribute("id")) {
|
|
@@ -7169,7 +7510,6 @@ function popover_default(Alpine) {
|
|
|
7169
7510
|
el.setAttribute("aria-controls", el._popover.controls);
|
|
7170
7511
|
el.setAttribute("aria-haspopup", "dialog");
|
|
7171
7512
|
const setAttributes = () => {
|
|
7172
|
-
el.setAttribute("data-state", el._popover.expanded ? "open" : "closed");
|
|
7173
7513
|
el.setAttribute("aria-expanded", el._popover.expanded);
|
|
7174
7514
|
};
|
|
7175
7515
|
const close = () => {
|
|
@@ -7211,13 +7551,32 @@ function popover_default(Alpine) {
|
|
|
7211
7551
|
if (!popover) {
|
|
7212
7552
|
throw new Error(`${original2} must be placed after a popover element`);
|
|
7213
7553
|
}
|
|
7214
|
-
el.classList.add(
|
|
7554
|
+
el.classList.add(
|
|
7555
|
+
"absolute",
|
|
7556
|
+
"bg-popover",
|
|
7557
|
+
"text-popover-foreground",
|
|
7558
|
+
"hidden",
|
|
7559
|
+
"top-0",
|
|
7560
|
+
"left-0",
|
|
7561
|
+
"z-50",
|
|
7562
|
+
"min-w-[1rem]",
|
|
7563
|
+
"rounded-md",
|
|
7564
|
+
"border",
|
|
7565
|
+
"shadow-md",
|
|
7566
|
+
"outline-hidden",
|
|
7567
|
+
"overflow-auto",
|
|
7568
|
+
"transition-[opacity,scale]",
|
|
7569
|
+
"motion-reduce:transition-none",
|
|
7570
|
+
"duration-100",
|
|
7571
|
+
"ease-out",
|
|
7572
|
+
"opacity-0",
|
|
7573
|
+
"scale-95"
|
|
7574
|
+
);
|
|
7215
7575
|
el.setAttribute("data-slot", "popover");
|
|
7216
7576
|
el.setAttribute("role", "dialog");
|
|
7217
7577
|
el.setAttribute("tabindex", "-1");
|
|
7218
7578
|
el.setAttribute("id", popover._popover.controls);
|
|
7219
7579
|
el.setAttribute("aria-labelledby", popover._popover.id);
|
|
7220
|
-
el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
|
|
7221
7580
|
let noScroll = modifiers.includes("no-scroll");
|
|
7222
7581
|
if (noScroll) {
|
|
7223
7582
|
el.classList.remove("overflow-auto");
|
|
@@ -7251,22 +7610,39 @@ function popover_default(Alpine) {
|
|
|
7251
7610
|
left: `${x}px`,
|
|
7252
7611
|
top: `${y}px`
|
|
7253
7612
|
});
|
|
7613
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
7254
7614
|
});
|
|
7255
7615
|
}
|
|
7256
7616
|
effect(() => {
|
|
7257
|
-
el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
|
|
7258
7617
|
if (popover._popover.expanded) {
|
|
7618
|
+
el.classList.remove("hidden");
|
|
7259
7619
|
autoUpdateCleanup = autoUpdate(popover, el, updatePosition);
|
|
7260
7620
|
} else {
|
|
7621
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
7622
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
7623
|
+
Object.assign(el.style, {
|
|
7624
|
+
left: "0px",
|
|
7625
|
+
top: "0px"
|
|
7626
|
+
});
|
|
7627
|
+
} else {
|
|
7628
|
+
el.classList.add("scale-95", "opacity-0");
|
|
7629
|
+
}
|
|
7261
7630
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
7631
|
+
}
|
|
7632
|
+
});
|
|
7633
|
+
function onTransitionEnd(event) {
|
|
7634
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
7635
|
+
el.classList.add("hidden");
|
|
7262
7636
|
Object.assign(el.style, {
|
|
7263
7637
|
left: "0px",
|
|
7264
7638
|
top: "0px"
|
|
7265
7639
|
});
|
|
7266
7640
|
}
|
|
7267
|
-
}
|
|
7641
|
+
}
|
|
7642
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
7268
7643
|
cleanup(() => {
|
|
7269
7644
|
el.removeEventListener("click", stopPropagation);
|
|
7645
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
7270
7646
|
});
|
|
7271
7647
|
});
|
|
7272
7648
|
}
|
|
@@ -7277,7 +7653,7 @@ function progress_default(Alpine) {
|
|
|
7277
7653
|
el.classList.add("bg-secondary", "relative", "h-2", "w-full", "overflow-hidden", "rounded-full");
|
|
7278
7654
|
el.setAttribute("data-slot", "progress");
|
|
7279
7655
|
const indicator = document.createElement("div");
|
|
7280
|
-
indicator.classList.add("bg-primary", "h-full", "w-full", "flex-1", "transition-all", "rounded-full");
|
|
7656
|
+
indicator.classList.add("bg-primary", "h-full", "w-full", "flex-1", "transition-all", "motion-reduce:transition-none", "rounded-full");
|
|
7281
7657
|
indicator.setAttribute("data-slot", "progress-indicator");
|
|
7282
7658
|
Object.assign(indicator.style, {
|
|
7283
7659
|
transform: `translateX(-${100 - 0}%)`
|
|
@@ -7389,9 +7765,18 @@ function select_default(Alpine) {
|
|
|
7389
7765
|
set: void 0,
|
|
7390
7766
|
get: void 0
|
|
7391
7767
|
};
|
|
7392
|
-
el.classList.add("cursor-pointer", "outline-none", "transition-
|
|
7768
|
+
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");
|
|
7393
7769
|
if (modifiers.includes("table")) {
|
|
7394
|
-
el.classList.add(
|
|
7770
|
+
el.classList.add(
|
|
7771
|
+
"h-10",
|
|
7772
|
+
"flex",
|
|
7773
|
+
"focus-visible:inset-ring-ring/50",
|
|
7774
|
+
"focus-visible:inset-ring-2",
|
|
7775
|
+
'[&>[data-slot="select-input"]]:hover:bg-table-hover',
|
|
7776
|
+
'[&>[data-slot="select-input"]]:hover:text-table-hover-foreground',
|
|
7777
|
+
'[&>[data-slot="select-input"]]:active:!bg-table-active',
|
|
7778
|
+
'[&>[data-slot="select-input"]]:active:!text-table-active-foreground'
|
|
7779
|
+
);
|
|
7395
7780
|
el.setAttribute("data-slot", "cell-input-select");
|
|
7396
7781
|
} else {
|
|
7397
7782
|
el.classList.add(
|
|
@@ -7405,8 +7790,11 @@ function select_default(Alpine) {
|
|
|
7405
7790
|
"has-[input[aria-invalid=true]]:ring-negative/20",
|
|
7406
7791
|
"has-[input:invalid]:border-negative",
|
|
7407
7792
|
"has-[input:invalid]:ring-negative/20",
|
|
7408
|
-
"hover:bg-secondary-hover
|
|
7409
|
-
"
|
|
7793
|
+
'[&>[data-slot="select-input"]]:hover:bg-secondary-hover',
|
|
7794
|
+
'[&>[data-slot="select-input"]]:hover:text-secondary-foreground',
|
|
7795
|
+
'[&>[data-slot="select-input"]]:active:bg-secondary-active',
|
|
7796
|
+
'[&>[data-slot="select-input"]]:active:text-secondary-foreground',
|
|
7797
|
+
'[&>[data-slot="select-input"]]:rounded-control',
|
|
7410
7798
|
"rounded-control",
|
|
7411
7799
|
"border",
|
|
7412
7800
|
"bg-input-inner",
|
|
@@ -7472,7 +7860,7 @@ function select_default(Alpine) {
|
|
|
7472
7860
|
fakeTrigger.appendChild(displayValue);
|
|
7473
7861
|
fakeTrigger.setAttribute("data-slot", "select-value");
|
|
7474
7862
|
fakeTrigger.setAttribute("tabindex", "0");
|
|
7475
|
-
fakeTrigger.classList.add("flex", "items-center", "justify-between", "gap-2", "outline-none", "pl-3", "pr-2", "size-full", "[&[
|
|
7863
|
+
fakeTrigger.classList.add("flex", "items-center", "justify-between", "gap-2", "outline-none", "pl-3", "pr-2", "size-full", "[&[aria-expanded=true]>svg]:rotate-180");
|
|
7476
7864
|
select._h_select.trigger = fakeTrigger;
|
|
7477
7865
|
let labelObserver;
|
|
7478
7866
|
if (label) {
|
|
@@ -7519,7 +7907,6 @@ function select_default(Alpine) {
|
|
|
7519
7907
|
fakeTrigger.setAttribute("aria-autocomplete", "none");
|
|
7520
7908
|
fakeTrigger.setAttribute("role", "combobox");
|
|
7521
7909
|
effect(() => {
|
|
7522
|
-
fakeTrigger.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7523
7910
|
fakeTrigger.setAttribute("aria-expanded", select._h_select.expanded);
|
|
7524
7911
|
});
|
|
7525
7912
|
const close = (focusSelect = false) => {
|
|
@@ -7664,7 +8051,7 @@ function select_default(Alpine) {
|
|
|
7664
8051
|
fakeTrigger.addEventListener("click", onClick);
|
|
7665
8052
|
const chevronDown = createSvg({
|
|
7666
8053
|
icon: ChevronDown,
|
|
7667
|
-
classes: "opacity-70 text-
|
|
8054
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none transition-transform motion-reduce:transition-none duration-200",
|
|
7668
8055
|
attrs: {
|
|
7669
8056
|
"aria-hidden": true,
|
|
7670
8057
|
role: "presentation"
|
|
@@ -7695,17 +8082,37 @@ function select_default(Alpine) {
|
|
|
7695
8082
|
}
|
|
7696
8083
|
});
|
|
7697
8084
|
});
|
|
7698
|
-
Alpine.directive("h-select-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
|
|
8085
|
+
Alpine.directive("h-select-content", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
7699
8086
|
const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
|
|
7700
8087
|
if (!select) {
|
|
7701
8088
|
throw new Error(`${original2} must be inside a select element`);
|
|
7702
8089
|
}
|
|
7703
|
-
el.classList.add(
|
|
8090
|
+
el.classList.add(
|
|
8091
|
+
"absolute",
|
|
8092
|
+
"bg-popover",
|
|
8093
|
+
"text-popover-foreground",
|
|
8094
|
+
"hidden",
|
|
8095
|
+
"p-1",
|
|
8096
|
+
"top-0",
|
|
8097
|
+
"left-0",
|
|
8098
|
+
"z-50",
|
|
8099
|
+
"min-w-[1rem]",
|
|
8100
|
+
"overflow-x-hidden",
|
|
8101
|
+
"overflow-y-auto",
|
|
8102
|
+
"rounded-md",
|
|
8103
|
+
"border",
|
|
8104
|
+
"shadow-md",
|
|
8105
|
+
"transition-[opacity,scale]",
|
|
8106
|
+
"motion-reduce:transition-none",
|
|
8107
|
+
"duration-100",
|
|
8108
|
+
"ease-out",
|
|
8109
|
+
"opacity-0",
|
|
8110
|
+
"scale-95"
|
|
8111
|
+
);
|
|
7704
8112
|
el.setAttribute("data-slot", "select-content");
|
|
7705
8113
|
el.setAttribute("role", "listbox");
|
|
7706
8114
|
el.setAttribute("id", select._h_select.controls);
|
|
7707
8115
|
el.setAttribute("tabindex", "-1");
|
|
7708
|
-
el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7709
8116
|
if (!select._h_select.trigger) {
|
|
7710
8117
|
throw new Error(`${original2}: trigger not found`);
|
|
7711
8118
|
}
|
|
@@ -7731,22 +8138,41 @@ function select_default(Alpine) {
|
|
|
7731
8138
|
left: `${x}px`,
|
|
7732
8139
|
top: `${y}px`
|
|
7733
8140
|
});
|
|
8141
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
7734
8142
|
});
|
|
7735
8143
|
}
|
|
7736
8144
|
effect(() => {
|
|
7737
8145
|
el.setAttribute("aria-labelledby", select._h_select.fieldLabelId);
|
|
7738
8146
|
});
|
|
7739
8147
|
effect(() => {
|
|
7740
|
-
el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
|
|
7741
8148
|
if (select._h_select.expanded) {
|
|
8149
|
+
el.classList.remove("hidden");
|
|
7742
8150
|
autoUpdateCleanup = autoUpdate(select._h_select.trigger, el, updatePosition);
|
|
7743
8151
|
} else {
|
|
8152
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
8153
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
8154
|
+
Object.assign(el.style, {
|
|
8155
|
+
left: "0px",
|
|
8156
|
+
top: "0px"
|
|
8157
|
+
});
|
|
8158
|
+
} else {
|
|
8159
|
+
el.classList.add("scale-95", "opacity-0");
|
|
8160
|
+
}
|
|
7744
8161
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
8162
|
+
}
|
|
8163
|
+
});
|
|
8164
|
+
function onTransitionEnd(event) {
|
|
8165
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
8166
|
+
el.classList.add("hidden");
|
|
7745
8167
|
Object.assign(el.style, {
|
|
7746
8168
|
left: "0px",
|
|
7747
8169
|
top: "0px"
|
|
7748
8170
|
});
|
|
7749
8171
|
}
|
|
8172
|
+
}
|
|
8173
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
8174
|
+
cleanup(() => {
|
|
8175
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
7750
8176
|
});
|
|
7751
8177
|
});
|
|
7752
8178
|
Alpine.directive("h-select-search", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
|
|
@@ -7920,6 +8346,7 @@ function select_default(Alpine) {
|
|
|
7920
8346
|
const onActivate = (event) => {
|
|
7921
8347
|
if (event.type === "keydown" && (event.key === "Enter" || event.key === " ") || event.type === "click") {
|
|
7922
8348
|
if (select._h_select.multiple) {
|
|
8349
|
+
event.stopPropagation();
|
|
7923
8350
|
const vIndex = select._h_model.get().indexOf(getValue());
|
|
7924
8351
|
if (vIndex > -1) {
|
|
7925
8352
|
const val = select._h_model.get().splice(vIndex, 1);
|
|
@@ -7974,16 +8401,43 @@ function separator_default(Alpine) {
|
|
|
7974
8401
|
// src/components/sheet.js
|
|
7975
8402
|
function sheet_default(Alpine) {
|
|
7976
8403
|
Alpine.directive("h-sheet-overlay", (el, { expression }, { effect, evaluate: evaluate2, evaluateLater, cleanup }) => {
|
|
7977
|
-
el.
|
|
8404
|
+
el._h_sheet_overlay = {
|
|
8405
|
+
showSheet: void 0,
|
|
8406
|
+
hideSheet: void 0,
|
|
8407
|
+
state: Alpine.reactive({
|
|
8408
|
+
open: evaluate2(expression || "false")
|
|
8409
|
+
})
|
|
8410
|
+
};
|
|
8411
|
+
el.classList.add("hidden", "fixed", "inset-0", "z-50", "bg-black/50", "transition-opacity", "motion-reduce:transition-none", "duration-200", "ease-out", "opacity-0");
|
|
7978
8412
|
el.setAttribute("tabindex", "-1");
|
|
7979
8413
|
el.setAttribute("data-slot", "sheet-overlay");
|
|
7980
|
-
el.setAttribute("data-open", evaluate2(expression));
|
|
7981
8414
|
const getIsOpen = evaluateLater(expression);
|
|
7982
8415
|
effect(() => {
|
|
7983
8416
|
getIsOpen((isOpen) => {
|
|
7984
|
-
el.
|
|
8417
|
+
el._h_sheet_overlay.state.open = isOpen;
|
|
7985
8418
|
});
|
|
7986
8419
|
});
|
|
8420
|
+
effect(() => {
|
|
8421
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
8422
|
+
if (el._h_sheet_overlay.state.open) {
|
|
8423
|
+
el.classList.remove("hidden", "opacity-0");
|
|
8424
|
+
} else {
|
|
8425
|
+
el.classList.add("hidden", "opacity-0");
|
|
8426
|
+
}
|
|
8427
|
+
} else if (el._h_sheet_overlay.state.open) {
|
|
8428
|
+
el.classList.remove("hidden");
|
|
8429
|
+
el.offsetHeight;
|
|
8430
|
+
el.classList.remove("opacity-0");
|
|
8431
|
+
} else {
|
|
8432
|
+
el.classList.add("opacity-0");
|
|
8433
|
+
}
|
|
8434
|
+
});
|
|
8435
|
+
function onTransitionEnd(event) {
|
|
8436
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
8437
|
+
el.classList.add("hidden");
|
|
8438
|
+
}
|
|
8439
|
+
}
|
|
8440
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
7987
8441
|
const onClick = (event) => {
|
|
7988
8442
|
if (event.target.getAttribute("data-slot") === "sheet-overlay") {
|
|
7989
8443
|
evaluate2(`${expression} = false`);
|
|
@@ -7992,12 +8446,29 @@ function sheet_default(Alpine) {
|
|
|
7992
8446
|
el.addEventListener("click", onClick);
|
|
7993
8447
|
cleanup(() => {
|
|
7994
8448
|
el.removeEventListener("click", onClick);
|
|
8449
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
7995
8450
|
});
|
|
7996
8451
|
});
|
|
7997
|
-
Alpine.directive("h-sheet", (el,
|
|
7998
|
-
el.
|
|
8452
|
+
Alpine.directive("h-sheet", (el, { original: original2 }, { effect, cleanup }) => {
|
|
8453
|
+
const overlay = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sheet_overlay"));
|
|
8454
|
+
if (!overlay) {
|
|
8455
|
+
throw new Error(`${original2} must be placed inside a sheet overlay`);
|
|
8456
|
+
}
|
|
8457
|
+
el.classList.add("hidden", "bg-background", "fixed", "shadow-lg", "transform", "transition-all", "motion-reduce:transition-none", "duration-200", "ease-out");
|
|
7999
8458
|
el.setAttribute("data-slot", "sheet");
|
|
8000
8459
|
let lastSide;
|
|
8460
|
+
const getTranslateClass = (side) => {
|
|
8461
|
+
switch (side) {
|
|
8462
|
+
case "top":
|
|
8463
|
+
return "-translate-y-full";
|
|
8464
|
+
case "right":
|
|
8465
|
+
return "translate-x-full";
|
|
8466
|
+
case "left":
|
|
8467
|
+
return "-translate-x-full";
|
|
8468
|
+
default:
|
|
8469
|
+
return "translate-y-full";
|
|
8470
|
+
}
|
|
8471
|
+
};
|
|
8001
8472
|
const getSideClasses = (side) => {
|
|
8002
8473
|
switch (side) {
|
|
8003
8474
|
case "top":
|
|
@@ -8019,9 +8490,32 @@ function sheet_default(Alpine) {
|
|
|
8019
8490
|
setSide(el.getAttribute("data-align"));
|
|
8020
8491
|
});
|
|
8021
8492
|
setSide(el.getAttribute("data-align"));
|
|
8493
|
+
el.classList.add(getTranslateClass(lastSide));
|
|
8494
|
+
function onTransitionEnd(event) {
|
|
8495
|
+
if (event.target === el && event.target.classList.contains(getTranslateClass(lastSide))) {
|
|
8496
|
+
el.classList.add("hidden");
|
|
8497
|
+
}
|
|
8498
|
+
}
|
|
8499
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
8500
|
+
effect(() => {
|
|
8501
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
8502
|
+
if (overlay._h_sheet_overlay.state.open) {
|
|
8503
|
+
el.classList.remove("hidden", getTranslateClass(lastSide));
|
|
8504
|
+
} else {
|
|
8505
|
+
el.classList.add("hidden", getTranslateClass(lastSide));
|
|
8506
|
+
}
|
|
8507
|
+
} else if (overlay._h_sheet_overlay.state.open) {
|
|
8508
|
+
el.classList.remove("hidden");
|
|
8509
|
+
el.offsetHeight;
|
|
8510
|
+
el.classList.remove(getTranslateClass(lastSide));
|
|
8511
|
+
} else {
|
|
8512
|
+
el.classList.add(getTranslateClass(lastSide));
|
|
8513
|
+
}
|
|
8514
|
+
});
|
|
8022
8515
|
observer.observe(el, { attributes: true, attributeFilter: ["data-align"] });
|
|
8023
8516
|
cleanup(() => {
|
|
8024
8517
|
observer.disconnect();
|
|
8518
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
8025
8519
|
});
|
|
8026
8520
|
});
|
|
8027
8521
|
}
|
|
@@ -8097,6 +8591,7 @@ function sidebar_default(Alpine) {
|
|
|
8097
8591
|
"font-medium",
|
|
8098
8592
|
"outline-hidden",
|
|
8099
8593
|
"transition-[margin,opacity]",
|
|
8594
|
+
"motion-reduce:transition-none",
|
|
8100
8595
|
"duration-200",
|
|
8101
8596
|
"ease-linear",
|
|
8102
8597
|
"focus-visible:ring-2",
|
|
@@ -8106,7 +8601,7 @@ function sidebar_default(Alpine) {
|
|
|
8106
8601
|
);
|
|
8107
8602
|
el.setAttribute("data-slot", "sidebar-group-label");
|
|
8108
8603
|
if (group._h_sidebar_group.collapsable) {
|
|
8109
|
-
el.classList.add("text-sidebar-foreground", "text-sm", "hover:bg-secondary-
|
|
8604
|
+
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");
|
|
8110
8605
|
if (el.hasAttribute("id")) {
|
|
8111
8606
|
group._h_sidebar_group.controlId = el.getAttribute("id");
|
|
8112
8607
|
} else {
|
|
@@ -8123,7 +8618,7 @@ function sidebar_default(Alpine) {
|
|
|
8123
8618
|
el.appendChild(
|
|
8124
8619
|
createSvg({
|
|
8125
8620
|
icon: ChevronRight,
|
|
8126
|
-
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
8621
|
+
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
8127
8622
|
attrs: {
|
|
8128
8623
|
"aria-hidden": true,
|
|
8129
8624
|
role: "presentation"
|
|
@@ -8156,6 +8651,7 @@ function sidebar_default(Alpine) {
|
|
|
8156
8651
|
"p-0",
|
|
8157
8652
|
"outline-hidden",
|
|
8158
8653
|
"transition-transform",
|
|
8654
|
+
"motion-reduce:transition-none",
|
|
8159
8655
|
"focus-visible:ring-2",
|
|
8160
8656
|
"[&>svg]:size-4",
|
|
8161
8657
|
"[&>svg]:shrink-0",
|
|
@@ -8288,10 +8784,11 @@ function sidebar_default(Alpine) {
|
|
|
8288
8784
|
"text-sm",
|
|
8289
8785
|
"duration-200",
|
|
8290
8786
|
"transition-[width,height,padding]",
|
|
8787
|
+
"motion-reduce:transition-none",
|
|
8291
8788
|
"group-has-data-[sidebar=menu-action]/menu-item:pr-8",
|
|
8292
8789
|
"data-[active=true]:font-medium",
|
|
8293
|
-
"
|
|
8294
|
-
"
|
|
8790
|
+
"aria-[expanded=true]:hover:bg-sidebar-secondary",
|
|
8791
|
+
"aria-[expanded=true]:hover:text-sidebar-secondary-foreground",
|
|
8295
8792
|
"group-data-[collapsed=true]/sidebar:!size-8",
|
|
8296
8793
|
"group-data-[collapsed=true]/sidebar:!p-2",
|
|
8297
8794
|
"group-data-[collapsed=true]/sidebar:[&>*:not(svg:first-child):not([data-slot=menu])]:!hidden"
|
|
@@ -8314,7 +8811,7 @@ function sidebar_default(Alpine) {
|
|
|
8314
8811
|
el.appendChild(
|
|
8315
8812
|
createSvg({
|
|
8316
8813
|
icon: ChevronRight,
|
|
8317
|
-
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
8814
|
+
classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[aria-expanded=true]>&]:rotate-90",
|
|
8318
8815
|
attrs: {
|
|
8319
8816
|
"aria-hidden": true,
|
|
8320
8817
|
role: "presentation"
|
|
@@ -8352,6 +8849,7 @@ function sidebar_default(Alpine) {
|
|
|
8352
8849
|
"p-0",
|
|
8353
8850
|
"outline-hidden",
|
|
8354
8851
|
"transition-transform",
|
|
8852
|
+
"motion-reduce:transition-none",
|
|
8355
8853
|
"focus-visible:ring-2",
|
|
8356
8854
|
"[&>svg]:size-4",
|
|
8357
8855
|
"[&>svg]:shrink-0",
|
|
@@ -8361,7 +8859,7 @@ function sidebar_default(Alpine) {
|
|
|
8361
8859
|
"group-data-[collapsed=true]/sidebar:hidden"
|
|
8362
8860
|
);
|
|
8363
8861
|
if (modifiers.includes("autohide")) {
|
|
8364
|
-
el.classList.add("group-focus-within/menu-item:opacity-100", "group-hover/menu-item:opacity-100", "
|
|
8862
|
+
el.classList.add("group-focus-within/menu-item:opacity-100", "group-hover/menu-item:opacity-100", "aria-[expanded=true]:opacity-100", "md:opacity-0");
|
|
8365
8863
|
}
|
|
8366
8864
|
if (el.tagName !== "BUTTON") {
|
|
8367
8865
|
el.setAttribute("role", "button");
|
|
@@ -9000,6 +9498,7 @@ function switch_default(Alpine) {
|
|
|
9000
9498
|
"before:h-full",
|
|
9001
9499
|
"before:aspect-square",
|
|
9002
9500
|
"before:transition-transform",
|
|
9501
|
+
"before:motion-reduce:transition-none",
|
|
9003
9502
|
"bg-muted",
|
|
9004
9503
|
"border",
|
|
9005
9504
|
"data-[size=sm]:h-5",
|
|
@@ -9018,7 +9517,8 @@ function switch_default(Alpine) {
|
|
|
9018
9517
|
"relative",
|
|
9019
9518
|
"rounded-full",
|
|
9020
9519
|
"shrink-0",
|
|
9021
|
-
"transition-
|
|
9520
|
+
"transition-colors",
|
|
9521
|
+
"motion-reduce:transition-none"
|
|
9022
9522
|
);
|
|
9023
9523
|
el.setAttribute("tabindex", "-1");
|
|
9024
9524
|
el.setAttribute("data-slot", "switch");
|
|
@@ -9121,11 +9621,14 @@ function table_default(Alpine) {
|
|
|
9121
9621
|
"justify-between",
|
|
9122
9622
|
"outline-none",
|
|
9123
9623
|
"gap-2",
|
|
9124
|
-
"transition-
|
|
9624
|
+
"transition-colors",
|
|
9625
|
+
"transition-shadow",
|
|
9626
|
+
"motion-reduce:transition-none",
|
|
9125
9627
|
"[&_svg]:pointer-events-none",
|
|
9126
9628
|
"[&_svg]:opacity-70",
|
|
9127
9629
|
"[&_svg]:text-foreground",
|
|
9128
9630
|
"[&_svg]:transition-transform",
|
|
9631
|
+
"motion-reduce:[&_svg]:transition-none",
|
|
9129
9632
|
"[&_svg]:duration-200",
|
|
9130
9633
|
"[&_svg:not([class*='size-'])]:size-4",
|
|
9131
9634
|
"shrink-0",
|
|
@@ -9245,7 +9748,9 @@ function tabs_default(Alpine) {
|
|
|
9245
9748
|
"text-sm",
|
|
9246
9749
|
"font-medium",
|
|
9247
9750
|
"whitespace-nowrap",
|
|
9248
|
-
"transition-
|
|
9751
|
+
"transition-colors",
|
|
9752
|
+
"transition-shadow",
|
|
9753
|
+
"motion-reduce:transition-none",
|
|
9249
9754
|
"group-data-[floating=true]/tab-bar:rounded-md",
|
|
9250
9755
|
"group-data-[floating=true]/tab-bar:border",
|
|
9251
9756
|
"group-data-[floating=true]/tab-bar:border-transparent",
|
|
@@ -9426,7 +9931,9 @@ function textarea_default(Alpine) {
|
|
|
9426
9931
|
"py-2",
|
|
9427
9932
|
"text-base",
|
|
9428
9933
|
"shadow-input",
|
|
9429
|
-
"transition-
|
|
9934
|
+
"transition-colors",
|
|
9935
|
+
"transition-shadow",
|
|
9936
|
+
"motion-reduce:transition-none",
|
|
9430
9937
|
"outline-none",
|
|
9431
9938
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
9432
9939
|
"disabled:cursor-not-allowed",
|
|
@@ -9460,9 +9967,11 @@ function tile_default(Alpine) {
|
|
|
9460
9967
|
"text-sm",
|
|
9461
9968
|
"rounded-lg",
|
|
9462
9969
|
"transition-colors",
|
|
9970
|
+
"motion-reduce:transition-none",
|
|
9463
9971
|
"[a]:hover:bg-secondary-hover",
|
|
9464
9972
|
"[a]:hover:text-secondary-foreground",
|
|
9465
9973
|
"[a]:transition-colors",
|
|
9974
|
+
"[a]:motion-reduce:transition-none",
|
|
9466
9975
|
"duration-100",
|
|
9467
9976
|
"flex-wrap",
|
|
9468
9977
|
"outline-none",
|
|
@@ -9605,8 +10114,6 @@ function timepicker_default(Alpine) {
|
|
|
9605
10114
|
el.classList.add(
|
|
9606
10115
|
"cursor-pointer",
|
|
9607
10116
|
"border-input",
|
|
9608
|
-
"hover:bg-secondary-hover",
|
|
9609
|
-
"active:bg-secondary-active",
|
|
9610
10117
|
"flex",
|
|
9611
10118
|
"items-center",
|
|
9612
10119
|
"justify-between",
|
|
@@ -9616,7 +10123,9 @@ function timepicker_default(Alpine) {
|
|
|
9616
10123
|
"data-[size=sm]:pr-1",
|
|
9617
10124
|
"text-sm",
|
|
9618
10125
|
"whitespace-nowrap",
|
|
9619
|
-
"transition-
|
|
10126
|
+
"transition-colors",
|
|
10127
|
+
"transition-shadow",
|
|
10128
|
+
"motion-reduce:transition-none",
|
|
9620
10129
|
"duration-200",
|
|
9621
10130
|
"outline-none",
|
|
9622
10131
|
"has-[input:disabled]:pointer-events-none",
|
|
@@ -9632,16 +10141,30 @@ function timepicker_default(Alpine) {
|
|
|
9632
10141
|
"has-[input[aria-invalid=true]]:inset-ring-negative/20",
|
|
9633
10142
|
"dark:has-[input[aria-invalid=true]]:inset-ring-negative/40",
|
|
9634
10143
|
"has-[input:invalid]:!inset-ring-negative/20",
|
|
9635
|
-
"dark:has-[input:invalid]:!inset-ring-negative/40"
|
|
10144
|
+
"dark:has-[input:invalid]:!inset-ring-negative/40",
|
|
10145
|
+
"hover:bg-table-hover",
|
|
10146
|
+
"hover:text-table-hover-foreground",
|
|
10147
|
+
"active:!bg-table-active",
|
|
10148
|
+
"active:!text-table-active-foreground",
|
|
10149
|
+
"has-[[aria-expanded=true]]:bg-transparent",
|
|
10150
|
+
"has-[[aria-expanded=true]]:text-foreground"
|
|
9636
10151
|
);
|
|
9637
10152
|
el.setAttribute("data-slot", "cell-input-time");
|
|
9638
10153
|
} else {
|
|
9639
10154
|
el.classList.add(
|
|
9640
10155
|
"w-full",
|
|
10156
|
+
"hover:bg-secondary-hover",
|
|
10157
|
+
"hover:text-secondary-foreground",
|
|
10158
|
+
'[&>[data-slot="time-picker-input"]]:hover:text-secondary-foreground',
|
|
10159
|
+
"active:bg-secondary-active",
|
|
10160
|
+
"active:text-secondary-foreground",
|
|
10161
|
+
'[&>[data-slot="time-picker-input"]]:active:text-secondary-foreground',
|
|
9641
10162
|
"rounded-control",
|
|
9642
10163
|
"border",
|
|
9643
10164
|
"bg-input-inner",
|
|
9644
10165
|
"shadow-input",
|
|
10166
|
+
"has-[[aria-expanded=true]]:bg-input-inner",
|
|
10167
|
+
"has-[[aria-expanded=true]]:text-foreground",
|
|
9645
10168
|
"has-[input:focus-visible]:border-ring",
|
|
9646
10169
|
"has-[input:focus-visible]:ring-[calc(var(--spacing)*0.75)]",
|
|
9647
10170
|
"has-[input:focus-visible]:ring-ring/50",
|
|
@@ -9658,7 +10181,7 @@ function timepicker_default(Alpine) {
|
|
|
9658
10181
|
el.appendChild(
|
|
9659
10182
|
createSvg({
|
|
9660
10183
|
icon: Clock,
|
|
9661
|
-
classes: "opacity-70 text-
|
|
10184
|
+
classes: "opacity-70 text-inherit size-4 shrink-0 pointer-events-none",
|
|
9662
10185
|
attrs: {
|
|
9663
10186
|
"aria-hidden": true,
|
|
9664
10187
|
role: "presentation"
|
|
@@ -9801,7 +10324,6 @@ function timepicker_default(Alpine) {
|
|
|
9801
10324
|
el.addEventListener("beforeinput", preventInput);
|
|
9802
10325
|
el.addEventListener("paste", preventInput);
|
|
9803
10326
|
effect(() => {
|
|
9804
|
-
el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
|
|
9805
10327
|
el.setAttribute("aria-expanded", timepicker._h_timepicker.expanded);
|
|
9806
10328
|
});
|
|
9807
10329
|
cleanup(() => {
|
|
@@ -9819,11 +10341,17 @@ function timepicker_default(Alpine) {
|
|
|
9819
10341
|
"absolute",
|
|
9820
10342
|
"bg-popover",
|
|
9821
10343
|
"text-popover-foreground",
|
|
9822
|
-
"
|
|
9823
|
-
"
|
|
9824
|
-
"
|
|
10344
|
+
"flex",
|
|
10345
|
+
"flex-col",
|
|
10346
|
+
"hidden",
|
|
9825
10347
|
"z-50",
|
|
9826
|
-
"shadow-md"
|
|
10348
|
+
"shadow-md",
|
|
10349
|
+
"transition-[opacity,scale]",
|
|
10350
|
+
"motion-reduce:transition-none",
|
|
10351
|
+
"duration-100",
|
|
10352
|
+
"ease-out",
|
|
10353
|
+
"opacity-0",
|
|
10354
|
+
"scale-95"
|
|
9827
10355
|
);
|
|
9828
10356
|
el.setAttribute("id", timepicker._h_timepicker.controls);
|
|
9829
10357
|
el.setAttribute("tabindex", "-1");
|
|
@@ -9831,7 +10359,6 @@ function timepicker_default(Alpine) {
|
|
|
9831
10359
|
el.setAttribute("aria-modal", "true");
|
|
9832
10360
|
el.setAttribute("data-slot", "time-picker-popup");
|
|
9833
10361
|
el.setAttribute("aria-labelledby", timepicker._h_timepicker.id);
|
|
9834
|
-
el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
|
|
9835
10362
|
const optionClasses = [
|
|
9836
10363
|
"px-3.5",
|
|
9837
10364
|
"py-2",
|
|
@@ -10241,6 +10768,7 @@ function timepicker_default(Alpine) {
|
|
|
10241
10768
|
left: `${x}px`,
|
|
10242
10769
|
top: `${y}px`
|
|
10243
10770
|
});
|
|
10771
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
10244
10772
|
if (focusFirstItem) {
|
|
10245
10773
|
focusFirstItem = false;
|
|
10246
10774
|
Alpine2.nextTick(() => {
|
|
@@ -10254,25 +10782,41 @@ function timepicker_default(Alpine) {
|
|
|
10254
10782
|
});
|
|
10255
10783
|
}
|
|
10256
10784
|
effect(() => {
|
|
10257
|
-
el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
|
|
10258
10785
|
if (timepicker._h_timepicker.expanded) {
|
|
10259
10786
|
render();
|
|
10787
|
+
el.classList.remove("hidden");
|
|
10260
10788
|
autoUpdateCleanup = autoUpdate(timepicker, el, updatePosition);
|
|
10261
10789
|
if (selectedHour) scrollIntoCenter(selectedHour.parentElement, selectedHour);
|
|
10262
10790
|
if (selectedMinute) scrollIntoCenter(selectedMinute.parentElement, selectedMinute);
|
|
10263
10791
|
if (selectedSecond && timepicker._h_timepicker.seconds) scrollIntoCenter(selectedSecond.parentElement, selectedSecond);
|
|
10264
10792
|
} else {
|
|
10793
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
10794
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
10795
|
+
Object.assign(el.style, {
|
|
10796
|
+
left: "0px",
|
|
10797
|
+
top: "0px"
|
|
10798
|
+
});
|
|
10799
|
+
} else {
|
|
10800
|
+
el.classList.add("scale-95", "opacity-0");
|
|
10801
|
+
}
|
|
10265
10802
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
10266
10803
|
focusFirstItem = true;
|
|
10804
|
+
}
|
|
10805
|
+
});
|
|
10806
|
+
function onTransitionEnd(event) {
|
|
10807
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
10808
|
+
el.classList.add("hidden");
|
|
10267
10809
|
Object.assign(el.style, {
|
|
10268
10810
|
left: "0px",
|
|
10269
10811
|
top: "0px"
|
|
10270
10812
|
});
|
|
10271
10813
|
}
|
|
10272
|
-
}
|
|
10814
|
+
}
|
|
10815
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
10273
10816
|
cleanup(() => {
|
|
10274
10817
|
el.removeEventListener("keydown", onKeyDown);
|
|
10275
10818
|
el.removeEventListener("click", onClick);
|
|
10819
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
10276
10820
|
okButton.removeEventListener("click", timepicker._h_timepicker.close);
|
|
10277
10821
|
nowButton.removeEventListener("click", getCurrentTime);
|
|
10278
10822
|
timeContainer.removeEventListener("click", setTime);
|
|
@@ -10367,7 +10911,7 @@ function tooltip_default(Alpine) {
|
|
|
10367
10911
|
el.removeEventListener("pointerleave", handler);
|
|
10368
10912
|
});
|
|
10369
10913
|
});
|
|
10370
|
-
Alpine.directive("h-tooltip", (el, { original: original2 }, { effect }) => {
|
|
10914
|
+
Alpine.directive("h-tooltip", (el, { original: original2 }, { effect, cleanup }) => {
|
|
10371
10915
|
const tooltip = (() => {
|
|
10372
10916
|
let sibling = el.previousElementSibling;
|
|
10373
10917
|
while (sibling && !sibling.hasOwnProperty("_tooltip")) {
|
|
@@ -10378,7 +10922,24 @@ function tooltip_default(Alpine) {
|
|
|
10378
10922
|
if (!tooltip) {
|
|
10379
10923
|
throw new Error(`${original2} must be placed after a tooltip trigger element`);
|
|
10380
10924
|
}
|
|
10381
|
-
el.classList.add(
|
|
10925
|
+
el.classList.add(
|
|
10926
|
+
"absolute",
|
|
10927
|
+
"bg-foreground",
|
|
10928
|
+
"text-background",
|
|
10929
|
+
"z-50",
|
|
10930
|
+
"w-fit",
|
|
10931
|
+
"rounded-md",
|
|
10932
|
+
"px-3",
|
|
10933
|
+
"py-1.5",
|
|
10934
|
+
"text-xs",
|
|
10935
|
+
"text-balance",
|
|
10936
|
+
"transition-[opacity,scale]",
|
|
10937
|
+
"motion-reduce:transition-none",
|
|
10938
|
+
"duration-100",
|
|
10939
|
+
"ease-out",
|
|
10940
|
+
"opacity-0",
|
|
10941
|
+
"scale-95"
|
|
10942
|
+
);
|
|
10382
10943
|
el.setAttribute("data-slot", "tooltip");
|
|
10383
10944
|
el.setAttribute("id", tooltip._tooltip.controls);
|
|
10384
10945
|
const arrowEl = document.createElement("span");
|
|
@@ -10393,6 +10954,7 @@ function tooltip_default(Alpine) {
|
|
|
10393
10954
|
left: `${x}px`,
|
|
10394
10955
|
top: `${y}px`
|
|
10395
10956
|
});
|
|
10957
|
+
el.classList.remove("scale-95", "opacity-0");
|
|
10396
10958
|
if (middlewareData.arrow) {
|
|
10397
10959
|
Object.assign(arrowEl.style, {
|
|
10398
10960
|
left: middlewareData.arrow.x != null ? `${middlewareData.arrow.x}px` : "",
|
|
@@ -10406,6 +10968,23 @@ function tooltip_default(Alpine) {
|
|
|
10406
10968
|
el.classList.remove("hidden");
|
|
10407
10969
|
updatePosition();
|
|
10408
10970
|
} else {
|
|
10971
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
10972
|
+
el.classList.add("hidden", "scale-95", "opacity-0");
|
|
10973
|
+
Object.assign(el.style, {
|
|
10974
|
+
left: "0px",
|
|
10975
|
+
top: "0px"
|
|
10976
|
+
});
|
|
10977
|
+
Object.assign(arrowEl.style, {
|
|
10978
|
+
left: "0px",
|
|
10979
|
+
top: "0px"
|
|
10980
|
+
});
|
|
10981
|
+
} else {
|
|
10982
|
+
el.classList.add("scale-95", "opacity-0");
|
|
10983
|
+
}
|
|
10984
|
+
}
|
|
10985
|
+
});
|
|
10986
|
+
function onTransitionEnd(event) {
|
|
10987
|
+
if (event.target === el && event.target.classList.contains("opacity-0")) {
|
|
10409
10988
|
el.classList.add("hidden");
|
|
10410
10989
|
Object.assign(el.style, {
|
|
10411
10990
|
left: "0px",
|
|
@@ -10416,6 +10995,10 @@ function tooltip_default(Alpine) {
|
|
|
10416
10995
|
top: "0px"
|
|
10417
10996
|
});
|
|
10418
10997
|
}
|
|
10998
|
+
}
|
|
10999
|
+
el.addEventListener("transitionend", onTransitionEnd);
|
|
11000
|
+
cleanup(() => {
|
|
11001
|
+
el.removeEventListener("transitionend", onTransitionEnd);
|
|
10419
11002
|
});
|
|
10420
11003
|
});
|
|
10421
11004
|
}
|
|
@@ -10599,6 +11182,7 @@ function tree_default(Alpine) {
|
|
|
10599
11182
|
"outline-hidden",
|
|
10600
11183
|
"ring-ring",
|
|
10601
11184
|
"transition-[width,height,padding]",
|
|
11185
|
+
"motion-reduce:transition-none",
|
|
10602
11186
|
"hover:bg-secondary",
|
|
10603
11187
|
"hover:text-secondary-foreground",
|
|
10604
11188
|
"focus-visible:ring-2",
|
|
@@ -10630,7 +11214,7 @@ function tree_default(Alpine) {
|
|
|
10630
11214
|
if (treeItem._h_tree_item.hasSubtree) {
|
|
10631
11215
|
const chevronDown = createSvg({
|
|
10632
11216
|
icon: ChevronRight,
|
|
10633
|
-
classes: "size-4 shrink-0 transition-transform duration-200 [[data-expanded=true]>&]:rotate-90",
|
|
11217
|
+
classes: "size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[data-expanded=true]>&]:rotate-90",
|
|
10634
11218
|
attrs: {
|
|
10635
11219
|
"aria-hidden": true,
|
|
10636
11220
|
role: "presentation"
|
|
@@ -10647,7 +11231,7 @@ function tree_default(Alpine) {
|
|
|
10647
11231
|
}
|
|
10648
11232
|
|
|
10649
11233
|
// package.json
|
|
10650
|
-
var version = "1.
|
|
11234
|
+
var version = "1.9.0";
|
|
10651
11235
|
|
|
10652
11236
|
// src/utils/theme.js
|
|
10653
11237
|
var colorSchemeKey = "codbex.harmonia.colorMode";
|
|
@@ -10844,9 +11428,9 @@ var registerComponents = (registerPlugin) => {
|
|
|
10844
11428
|
registerPlugin(calendar_default);
|
|
10845
11429
|
registerPlugin(card_default);
|
|
10846
11430
|
registerPlugin(checkbox_default);
|
|
10847
|
-
registerPlugin(collapsible_default);
|
|
10848
11431
|
registerPlugin(datepicker_default);
|
|
10849
11432
|
registerPlugin(dialog_default);
|
|
11433
|
+
registerPlugin(expansion_panel_default);
|
|
10850
11434
|
registerPlugin(fieldset_default);
|
|
10851
11435
|
registerPlugin(focus_default);
|
|
10852
11436
|
registerPlugin(icon_default);
|
|
@@ -10892,9 +11476,9 @@ export {
|
|
|
10892
11476
|
calendar_default as Calendar,
|
|
10893
11477
|
card_default as Card,
|
|
10894
11478
|
checkbox_default as Checkbox,
|
|
10895
|
-
collapsible_default as Collapsible,
|
|
10896
11479
|
datepicker_default as DatePicker,
|
|
10897
11480
|
dialog_default as Dialog,
|
|
11481
|
+
expansion_panel_default as ExpansionPanel,
|
|
10898
11482
|
fieldset_default as Fieldset,
|
|
10899
11483
|
focus_default as Focus,
|
|
10900
11484
|
icon_default as Icon,
|