@codbex/harmonia 1.7.2 → 1.8.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.
@@ -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 }, { effect, Alpine: Alpine2 }) => {
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", "[[data-variant=header]_&]:data-[state=closed]: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
- "[&[data-state=open]>svg]:rotate-180"
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("pt-0", "pb-4", "overflow-hidden", "text-sm", "data-[state=closed]:hidden");
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
- el.setAttribute("data-state", parent._h_accordionItem.expanded ? "open" : "closed");
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
  });
@@ -2825,6 +2839,7 @@ function badge_default(Alpine) {
2825
2839
  "focus-visible:ring-ring/50",
2826
2840
  "focus-visible:ring-[calc(var(--spacing)*0.75)]",
2827
2841
  "transition-[color,box-shadow]",
2842
+ "motion-reduce:transition-none",
2828
2843
  "overflow-hidden"
2829
2844
  );
2830
2845
  el.setAttribute("data-slot", "badge");
@@ -3018,6 +3033,7 @@ var setButtonClasses = (el) => {
3018
3033
  "text-sm",
3019
3034
  "font-medium",
3020
3035
  "transition-all",
3036
+ "motion-reduce:transition-none",
3021
3037
  "disabled:pointer-events-none",
3022
3038
  "disabled:opacity-50",
3023
3039
  "[&_svg]:pointer-events-none",
@@ -4628,11 +4644,25 @@ function calendar_default(Alpine) {
4628
4644
  el.classList.add("border", "rounded-control", "gap-2", "p-2");
4629
4645
  el.setAttribute("tabindex", "-1");
4630
4646
  if (datepicker) {
4631
- el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=open]:flex", "data-[state=open]:flex-col", "data-[state=closed]:hidden", "z-50", "shadow-md");
4647
+ el.classList.add(
4648
+ "absolute",
4649
+ "bg-popover",
4650
+ "text-popover-foreground",
4651
+ "flex",
4652
+ "flex-col",
4653
+ "hidden",
4654
+ "z-50",
4655
+ "shadow-md",
4656
+ "transition-[opacity,scale]",
4657
+ "motion-reduce:transition-none",
4658
+ "duration-100",
4659
+ "ease-out",
4660
+ "opacity-0",
4661
+ "scale-95"
4662
+ );
4632
4663
  el.setAttribute("role", "dialog");
4633
4664
  el.setAttribute("aria-modal", "true");
4634
4665
  el.setAttribute("data-slot", "date-picker-calendar");
4635
- el.setAttribute("data-state", datepicker._h_datepicker.state.expanded ? "open" : "closed");
4636
4666
  } else {
4637
4667
  el.classList.add("shadow-input", "data-[invalid=true]:border-negative", "data-[invalid=true]:ring-negative/20", "dark:data-[invalid=true]:ring-negative/40");
4638
4668
  }
@@ -4680,16 +4710,19 @@ function calendar_default(Alpine) {
4680
4710
  if (datepicker) {
4681
4711
  datepicker._h_datepicker.input.addEventListener("change", onInputChange);
4682
4712
  }
4713
+ function setFromModel() {
4714
+ selected = new Date(el._x_model.get());
4715
+ if (isNaN(selected)) {
4716
+ console.error(`${original2}: input value is not a valid date - ${el._x_model.get()}`);
4717
+ if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
4718
+ else el.setAttribute("data-invalid", "true");
4719
+ } else if (datepicker) {
4720
+ datepicker._h_datepicker.input.value = formatter.format(selected);
4721
+ }
4722
+ }
4683
4723
  function checkForModel() {
4684
4724
  if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
4685
- selected = new Date(el._x_model.get());
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
- }
4725
+ setFromModel();
4693
4726
  }
4694
4727
  }
4695
4728
  function dayClick(event) {
@@ -4736,6 +4769,7 @@ function calendar_default(Alpine) {
4736
4769
  "text-sm",
4737
4770
  "font-medium",
4738
4771
  "transition-all",
4772
+ "motion-reduce:transition-none",
4739
4773
  "outline-none",
4740
4774
  "focus-visible:border-ring",
4741
4775
  "focus-visible:ring-ring/50",
@@ -4865,6 +4899,9 @@ function calendar_default(Alpine) {
4865
4899
  "size-8",
4866
4900
  "rounded-control",
4867
4901
  "outline-none",
4902
+ "duration-100",
4903
+ "transition-all",
4904
+ "motion-reduce:transition-none",
4868
4905
  "hover:bg-secondary-hover",
4869
4906
  "hover:text-secondary-foreground",
4870
4907
  "focus:bg-secondary-hover",
@@ -5068,25 +5105,59 @@ function calendar_default(Alpine) {
5068
5105
  left: `${x}px`,
5069
5106
  top: `${y}px`
5070
5107
  });
5108
+ el.classList.remove("scale-95", "opacity-0");
5071
5109
  });
5072
5110
  }
5073
5111
  if (datepicker) {
5074
5112
  effect(() => {
5075
- el.setAttribute("data-state", datepicker._h_datepicker.state.expanded ? "open" : "closed");
5076
5113
  if (datepicker._h_datepicker.state.expanded) {
5114
+ el.classList.remove("hidden");
5077
5115
  autoUpdateCleanup = autoUpdate(datepicker, el, updatePosition);
5078
5116
  Alpine2.nextTick(() => {
5079
5117
  focusDay();
5080
5118
  });
5081
5119
  } else {
5120
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
5121
+ el.classList.add("hidden", "scale-95", "opacity-0");
5122
+ Object.assign(el.style, {
5123
+ left: "0px",
5124
+ top: "0px"
5125
+ });
5126
+ } else {
5127
+ el.classList.add("scale-95", "opacity-0");
5128
+ }
5082
5129
  if (autoUpdateCleanup) autoUpdateCleanup();
5083
- Object.assign(el.style, {
5084
- left: "0px",
5085
- top: "0px"
5086
- });
5087
5130
  }
5088
5131
  });
5089
5132
  }
5133
+ function onTransitionEnd(event) {
5134
+ if (event.target === el && event.target.classList.contains("opacity-0")) {
5135
+ el.classList.add("hidden");
5136
+ Object.assign(el.style, {
5137
+ left: "0px",
5138
+ top: "0px"
5139
+ });
5140
+ }
5141
+ }
5142
+ if (datepicker) {
5143
+ el.addEventListener("transitionend", onTransitionEnd);
5144
+ }
5145
+ if (el.hasOwnProperty("_x_model")) {
5146
+ const modelExpression = el.getAttribute("x-model");
5147
+ const evaluateModel = evaluateLater(modelExpression);
5148
+ effect(() => {
5149
+ evaluateModel((value) => {
5150
+ if (!selected && value || value && selected.getTime() !== new Date(value).getTime()) {
5151
+ setFromModel();
5152
+ render();
5153
+ } else if (!value) {
5154
+ if (datepicker) datepicker._h_datepicker.input.value = "";
5155
+ selected = void 0;
5156
+ render();
5157
+ }
5158
+ });
5159
+ });
5160
+ }
5090
5161
  cleanup(() => {
5091
5162
  el.removeEventListener("keydown", onKeyDown);
5092
5163
  for (let d = 0; d < dayCells.length; d++) {
@@ -5094,6 +5165,7 @@ function calendar_default(Alpine) {
5094
5165
  }
5095
5166
  if (datepicker) {
5096
5167
  datepicker._h_datepicker.input.removeEventListener("change", onInputChange);
5168
+ el.removeEventListener("transitionend", onTransitionEnd);
5097
5169
  }
5098
5170
  });
5099
5171
  });
@@ -5168,7 +5240,8 @@ function checkbox_default(Alpine) {
5168
5240
  "shadow-input",
5169
5241
  "shrink-0",
5170
5242
  "size-5",
5171
- "transition-color"
5243
+ "transition-colors",
5244
+ "motion-reduce:transition-none"
5172
5245
  );
5173
5246
  el.setAttribute("tabindex", "-1");
5174
5247
  el.setAttribute("data-slot", "checkbox");
@@ -5177,57 +5250,6 @@ function checkbox_default(Alpine) {
5177
5250
  });
5178
5251
  }
5179
5252
 
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
5253
  // src/common/input-size.js
5232
5254
  function setSize(el, size3) {
5233
5255
  if (size3 === "sm") {
@@ -5276,6 +5298,7 @@ function datepicker_default(Alpine) {
5276
5298
  "flex",
5277
5299
  "items-center",
5278
5300
  "transition-[color,box-shadow]",
5301
+ "motion-reduce:transition-none",
5279
5302
  "duration-200",
5280
5303
  "outline-none",
5281
5304
  "pl-3",
@@ -5416,11 +5439,20 @@ function datepicker_default(Alpine) {
5416
5439
  // src/components/dialog.js
5417
5440
  function dialog_default(Alpine) {
5418
5441
  Alpine.directive("h-dialog-overlay", (el, _, { cleanup }) => {
5419
- el.classList.add("hidden", "data-[open=true]:block", "fixed", "inset-0", "z-50", "bg-black/60");
5442
+ 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
5443
  el.setAttribute("tabindex", "-1");
5421
5444
  el.setAttribute("data-slot", "dialog-overlay");
5422
5445
  const observer = new MutationObserver(() => {
5423
5446
  if (el.getAttribute("data-open") === "true") {
5447
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
5448
+ el.classList.remove("hidden", "*:scale-95", "opacity-0");
5449
+ } else {
5450
+ el.classList.remove("hidden");
5451
+ Alpine.nextTick(() => {
5452
+ el.offsetHeight;
5453
+ el.classList.remove("*:scale-95", "opacity-0");
5454
+ });
5455
+ }
5424
5456
  const inputs = el.getElementsByTagName("INPUT");
5425
5457
  if (inputs.length) {
5426
5458
  for (let i = 0; i < inputs.length; i++) {
@@ -5448,11 +5480,24 @@ function dialog_default(Alpine) {
5448
5480
  if (buttons.length) {
5449
5481
  buttons[0].focus();
5450
5482
  }
5483
+ } else {
5484
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
5485
+ el.classList.add("hidden", "*:scale-95", "opacity-0");
5486
+ } else {
5487
+ el.classList.add("*:scale-95", "opacity-0");
5488
+ }
5451
5489
  }
5452
5490
  });
5491
+ function onTransitionEnd(event) {
5492
+ if (event.target === el && event.target.classList.contains("opacity-0")) {
5493
+ el.classList.add("hidden");
5494
+ }
5495
+ }
5496
+ el.addEventListener("transitionend", onTransitionEnd);
5453
5497
  observer.observe(el, { attributes: true, attributeFilter: ["data-open"] });
5454
5498
  cleanup(() => {
5455
5499
  observer.disconnect();
5500
+ el.removeEventListener("transitionend", onTransitionEnd);
5456
5501
  });
5457
5502
  });
5458
5503
  Alpine.directive("h-dialog", (el) => {
@@ -5475,7 +5520,11 @@ function dialog_default(Alpine) {
5475
5520
  "p-4",
5476
5521
  "shadow-xl",
5477
5522
  "sm:max-w-lg",
5478
- "outline-none"
5523
+ "outline-none",
5524
+ "transition-[opacity,scale]",
5525
+ "motion-reduce:transition-none",
5526
+ "duration-200",
5527
+ "ease-out"
5479
5528
  );
5480
5529
  el.setAttribute("role", "dialog");
5481
5530
  el.setAttribute("data-slot", "dialog");
@@ -5504,6 +5553,7 @@ function dialog_default(Alpine) {
5504
5553
  "rounded-xs",
5505
5554
  "opacity-70",
5506
5555
  "transition-opacity",
5556
+ "motion-reduce:transition-none",
5507
5557
  "hover:opacity-100",
5508
5558
  "focus:ring-2",
5509
5559
  "focus:ring-offset-2",
@@ -5534,6 +5584,161 @@ function dialog_default(Alpine) {
5534
5584
  });
5535
5585
  }
5536
5586
 
5587
+ // src/components/expansion-panel.js
5588
+ function expansion_panel_default(Alpine) {
5589
+ Alpine.directive("h-exp-panel", (el) => {
5590
+ el.classList.add("vbox", "h-full", "group/exp", "data-[floating=true]:gap-2", "data-[floating=true]:overflow-visible");
5591
+ el.setAttribute("data-slot", "exp-panel");
5592
+ });
5593
+ Alpine.directive("h-exp-panel-item", (el, { expression }, { evaluate: evaluate2, evaluateLater, effect, Alpine: Alpine2 }) => {
5594
+ el.classList.add(
5595
+ "flex",
5596
+ "flex-col",
5597
+ "overflow-hidden",
5598
+ "transition-all",
5599
+ "motion-reduce:transition-none",
5600
+ "duration-300",
5601
+ "ease-out",
5602
+ "h-full",
5603
+ "border-b",
5604
+ "last:border-b-0",
5605
+ "min-h-12",
5606
+ "[[data-size=md]_&]:min-h-10",
5607
+ "[[data-size=sm]_&]:min-h-8",
5608
+ "[[data-floating=true]_&]:border-b-0",
5609
+ "[[data-floating=true]_&]:overflow-visible"
5610
+ );
5611
+ el.setAttribute("data-slot", "exp-panel-item");
5612
+ let itemId;
5613
+ if (el.hasAttribute("id")) {
5614
+ itemId = el.getAttribute("id");
5615
+ } else {
5616
+ itemId = `epi${uuid_default()}`;
5617
+ }
5618
+ function setExpanded(expanded) {
5619
+ if (expanded) {
5620
+ el.classList.add("flex-[1_1_0]");
5621
+ el.classList.remove("flex-[0_1_0]");
5622
+ } else {
5623
+ el.classList.add("flex-[0_1_0]");
5624
+ el.classList.remove("flex-[1_1_0]");
5625
+ }
5626
+ }
5627
+ el._h_expPanelItem = Alpine2.reactive({
5628
+ controls: itemId,
5629
+ expanded: evaluate2(expression || "false")
5630
+ });
5631
+ if (expression !== "" && expression !== void 0 && expression !== null && expression !== "true" && expression !== "false") {
5632
+ const getIsExpanded = evaluateLater(expression);
5633
+ effect(() => {
5634
+ getIsExpanded((expanded) => {
5635
+ setExpanded(expanded);
5636
+ });
5637
+ });
5638
+ effect(() => {
5639
+ if (evaluate2(expression) !== el._h_expPanelItem.expanded) {
5640
+ evaluate2(`${expression} = ${el._h_expPanelItem.expanded}`);
5641
+ }
5642
+ });
5643
+ } else {
5644
+ effect(() => {
5645
+ setExpanded(el._h_expPanelItem.expanded);
5646
+ });
5647
+ }
5648
+ });
5649
+ Alpine.directive("h-exp-panel-trigger", (el, { original: original2, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
5650
+ if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
5651
+ throw new Error(`${original2} must be a header element`);
5652
+ }
5653
+ const expPanelItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_expPanelItem"));
5654
+ if (!expPanelItem) {
5655
+ throw new Error(`${original2} must have an exp-panel-item parent element`);
5656
+ }
5657
+ el.classList.add(
5658
+ "bg-object-header",
5659
+ "border-b",
5660
+ "[[data-slot=exp-panel-item]:last-child>&]:not-has-[button[aria-expanded=true]]:group-has-[button[aria-expanded=true]]/exp:border-b-0",
5661
+ "flex",
5662
+ "h-12",
5663
+ "min-h-12",
5664
+ "px-4",
5665
+ "text-object-header-foreground",
5666
+ "[[data-floating=true]_&]:border",
5667
+ "[[data-floating=true]_&]:!border-b",
5668
+ "[[data-floating=true]_&]:rounded-lg",
5669
+ "[[data-floating=true]_&]:shadow-xs",
5670
+ "[[data-size=md]_&]:h-10",
5671
+ "[[data-size=md]_&]:min-h-10",
5672
+ "[[data-size=md]_&]:px-3",
5673
+ "[[data-size=sm]_&]:h-8",
5674
+ "[[data-size=sm]_&]:min-h-8",
5675
+ "[[data-size=sm]_&]:px-2.5",
5676
+ "[[data-variant=transparent]_&]:bg-transparent",
5677
+ "[[data-variant=transparent]_&]:text-foreground"
5678
+ );
5679
+ el.setAttribute("tabIndex", "-1");
5680
+ const getLabel = evaluateLater(expression);
5681
+ const chevronDown = createSvg({
5682
+ icon: ChevronDown,
5683
+ classes: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform motion-reduce:transition-none duration-200",
5684
+ attrs: {
5685
+ "aria-hidden": true,
5686
+ role: "presentation"
5687
+ }
5688
+ });
5689
+ const button = document.createElement("button");
5690
+ button.setAttribute("type", "button");
5691
+ button.setAttribute("tabIndex", "0");
5692
+ button.setAttribute("data-slot", "exp-panel-trigger");
5693
+ button.classList.add(
5694
+ "cursor-pointer",
5695
+ "focus-visible:border-ring",
5696
+ "focus-visible:ring-ring/50",
5697
+ "flex",
5698
+ "flex-1",
5699
+ "items-center",
5700
+ "justify-between",
5701
+ "gap-4",
5702
+ "text-left",
5703
+ "text-sm",
5704
+ "font-medium",
5705
+ "transition-all",
5706
+ "motion-reduce:transition-none",
5707
+ "outline-none",
5708
+ "hover:underline",
5709
+ "focus-visible:ring-[calc(var(--spacing)*0.75)]",
5710
+ "disabled:pointer-events-none",
5711
+ "disabled:opacity-50",
5712
+ "[&[aria-expanded=true]>svg]:rotate-180"
5713
+ );
5714
+ el.appendChild(button);
5715
+ effect(() => {
5716
+ getLabel((label) => {
5717
+ button.innerText = label;
5718
+ button.appendChild(chevronDown);
5719
+ });
5720
+ });
5721
+ button.setAttribute("id", expPanelItem._h_expPanelItem.id);
5722
+ button.setAttribute("aria-controls", expPanelItem._h_expPanelItem.controls);
5723
+ const setAttributes = () => {
5724
+ button.setAttribute("aria-expanded", expPanelItem._h_expPanelItem.expanded);
5725
+ };
5726
+ const handler = () => {
5727
+ expPanelItem._h_expPanelItem.expanded = !expPanelItem._h_expPanelItem.expanded;
5728
+ setAttributes();
5729
+ };
5730
+ setAttributes();
5731
+ el.addEventListener("click", handler);
5732
+ cleanup(() => {
5733
+ el.removeEventListener("click", handler);
5734
+ });
5735
+ });
5736
+ Alpine.directive("h-exp-panel-content", (el) => {
5737
+ el.classList.add("flex-1", "overflow-scroll");
5738
+ el.setAttribute("data-slot", "exp-panel-content");
5739
+ });
5740
+ }
5741
+
5537
5742
  // src/components/fieldset.js
5538
5743
  function fieldset_default(Alpine) {
5539
5744
  Alpine.directive("h-fieldset", (el) => {
@@ -5707,6 +5912,7 @@ function input_default(Alpine) {
5707
5912
  "[&::-webkit-color-swatch-wrapper]:p-0",
5708
5913
  "text-base",
5709
5914
  "transition-[color,box-shadow]",
5915
+ "motion-reduce:transition-none",
5710
5916
  "outline-none",
5711
5917
  "file:inline-flex",
5712
5918
  "file:h-7",
@@ -5764,6 +5970,7 @@ function input_default(Alpine) {
5764
5970
  "border",
5765
5971
  "shadow-input",
5766
5972
  "transition-[color,box-shadow]",
5973
+ "motion-reduce:transition-none",
5767
5974
  "outline-none",
5768
5975
  "min-w-0",
5769
5976
  "has-[>textarea]:h-auto",
@@ -5865,6 +6072,7 @@ function input_default(Alpine) {
5865
6072
  "border",
5866
6073
  "shadow-input",
5867
6074
  "transition-[color,box-shadow]",
6075
+ "motion-reduce:transition-none",
5868
6076
  "outline-none",
5869
6077
  "min-w-0",
5870
6078
  "has-[input:focus-visible]:border-ring",
@@ -6183,23 +6391,47 @@ function menu_default(Alpine) {
6183
6391
  el._menu_trigger = {
6184
6392
  isDropdown: modifiers.includes("dropdown"),
6185
6393
  setOpen(open) {
6186
- el.setAttribute("data-state", open ? "open" : "closed");
6394
+ el.setAttribute("aria-expanded", open);
6187
6395
  }
6188
6396
  };
6189
- el.setAttribute("data-state", "closed");
6397
+ if (el._menu_trigger.isDropdown) {
6398
+ el.setAttribute("aria-haspopup", "true");
6399
+ el.setAttribute("aria-expanded", "false");
6400
+ if (!el.hasAttribute("id")) {
6401
+ el.setAttribute("id", `mt${uuid_default()}`);
6402
+ }
6403
+ }
6190
6404
  });
6191
6405
  Alpine.directive("h-menu", (el, { original: original2, modifiers }, { cleanup, Alpine: Alpine2 }) => {
6192
6406
  if (el.tagName !== "UL") {
6193
6407
  throw new Error(`${original2} must be an ul element`);
6194
6408
  }
6195
- el.classList.add("hidden", "fixed", "bg-popover", "text-popover-foreground", "font-normal", "z-50", "min-w-[8rem]", "overflow-x-hidden", "overflow-y-auto", "rounded-md", "p-1", "shadow-md", "border", "outline-none");
6409
+ el.classList.add(
6410
+ "hidden",
6411
+ "fixed",
6412
+ "bg-popover",
6413
+ "text-popover-foreground",
6414
+ "font-normal",
6415
+ "z-50",
6416
+ "min-w-[8rem]",
6417
+ "overflow-x-hidden",
6418
+ "overflow-y-auto",
6419
+ "rounded-md",
6420
+ "p-1",
6421
+ "shadow-md",
6422
+ "border",
6423
+ "outline-none",
6424
+ "transition-[opacity,scale]",
6425
+ "motion-reduce:transition-none",
6426
+ "duration-100",
6427
+ "ease-out",
6428
+ "opacity-0",
6429
+ "scale-95"
6430
+ );
6196
6431
  el.setAttribute("role", "menu");
6197
6432
  el.setAttribute("aria-orientation", "vertical");
6198
6433
  el.setAttribute("tabindex", "-1");
6199
6434
  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
6435
  const isSubmenu = modifiers.includes("sub");
6204
6436
  const menuTrigger = (() => {
6205
6437
  if (isSubmenu) return;
@@ -6208,15 +6440,31 @@ function menu_default(Alpine) {
6208
6440
  sibling = sibling.previousElementSibling;
6209
6441
  }
6210
6442
  if (!sibling.hasOwnProperty("_menu_trigger")) {
6211
- throw new Error(`${original2} must be placed after the menu trigger`);
6443
+ throw new Error(`${original2} menu must be placed after a menu trigger element`);
6212
6444
  }
6213
6445
  return sibling;
6214
6446
  })();
6215
- if (!isSubmenu && !menuTrigger) {
6216
- throw new Error(`${original2} menu must be placed after a menu trigger element`);
6447
+ function setAriaAttrubutes(parent) {
6448
+ if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
6449
+ if (parent && parent.hasAttribute("id")) {
6450
+ el.setAttribute("aria-labelledby", parent.id);
6451
+ } else {
6452
+ throw new Error(`${original2} must have an "aria-label" or "aria-labelledby" attribute`);
6453
+ }
6454
+ }
6217
6455
  }
6218
6456
  let menuSubItem;
6219
- if (isSubmenu) menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
6457
+ if (isSubmenu) {
6458
+ menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
6459
+ if (!menuSubItem) {
6460
+ throw new Error(`${original2} must be placed inside a ${Alpine2.prefixed("h-menu-sub")} element`);
6461
+ }
6462
+ setAriaAttrubutes(menuSubItem);
6463
+ } else if (menuTrigger) {
6464
+ setAriaAttrubutes(menuTrigger._menu_trigger.isDropdown ? menuTrigger : void 0);
6465
+ } else {
6466
+ setAriaAttrubutes();
6467
+ }
6220
6468
  function listenForTrigger(listen) {
6221
6469
  if (listen) {
6222
6470
  if (menuTrigger._menu_trigger.isDropdown) menuTrigger.addEventListener("click", openDropdown);
@@ -6228,11 +6476,15 @@ function menu_default(Alpine) {
6228
6476
  }
6229
6477
  function close(closeParent = false, focusTrigger = false) {
6230
6478
  el.pauseKeyEvents = false;
6231
- el.classList.add("hidden");
6232
- Object.assign(el.style, {
6233
- left: "0px",
6234
- top: "0px"
6235
- });
6479
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
6480
+ el.classList.add("hidden", "scale-95", "opacity-0");
6481
+ Object.assign(el.style, {
6482
+ left: "0px",
6483
+ top: "0px"
6484
+ });
6485
+ } else {
6486
+ el.classList.add("scale-95", "opacity-0");
6487
+ }
6236
6488
  top.removeEventListener("contextmenu", onClick);
6237
6489
  top.removeEventListener("click", onClick);
6238
6490
  el.removeEventListener("keydown", onKeyDown);
@@ -6392,6 +6644,7 @@ function menu_default(Alpine) {
6392
6644
  left: `${x}px`,
6393
6645
  top: `${y}px`
6394
6646
  });
6647
+ el.classList.remove("scale-95", "opacity-0");
6395
6648
  });
6396
6649
  }
6397
6650
  }
@@ -6425,11 +6678,22 @@ function menu_default(Alpine) {
6425
6678
  } else {
6426
6679
  listenForTrigger(true);
6427
6680
  }
6681
+ function onTransitionEnd(event) {
6682
+ if (event.target === el && event.target.classList.contains("opacity-0")) {
6683
+ el.classList.add("hidden");
6684
+ Object.assign(el.style, {
6685
+ left: "0px",
6686
+ top: "0px"
6687
+ });
6688
+ }
6689
+ }
6690
+ el.addEventListener("transitionend", onTransitionEnd);
6428
6691
  cleanup(() => {
6429
6692
  if (menuTrigger) listenForTrigger(false);
6430
6693
  top.removeEventListener("click", onClick);
6431
6694
  top.removeEventListener("contextmenu", onClick);
6432
6695
  el.removeEventListener("keydown", onKeyDown);
6696
+ el.removeEventListener("transitionend", onTransitionEnd);
6433
6697
  });
6434
6698
  });
6435
6699
  Alpine.directive("h-menu-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
@@ -6521,6 +6785,9 @@ function menu_default(Alpine) {
6521
6785
  el.appendChild(chevronRight);
6522
6786
  const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
6523
6787
  if (!parentMenu) throw new Error(`${original2} must have a parent`);
6788
+ if (!el.hasAttribute("id")) {
6789
+ el.setAttribute("id", `ms${uuid_default()}`);
6790
+ }
6524
6791
  el._menu_sub = {
6525
6792
  open: void 0,
6526
6793
  close: void 0,
@@ -6636,6 +6903,7 @@ function menu_default(Alpine) {
6636
6903
  "aria-[disabled=true]:cursor-not-allowed",
6637
6904
  "aria-[disabled=true]:opacity-50",
6638
6905
  "transition-all",
6906
+ "motion-reduce:transition-none",
6639
6907
  "overflow-hidden",
6640
6908
  "aria-[checked=true]:[&>svg]:visible"
6641
6909
  );
@@ -6705,6 +6973,7 @@ function menu_default(Alpine) {
6705
6973
  "aria-[disabled=true]:cursor-not-allowed",
6706
6974
  "aria-[disabled=true]:opacity-50",
6707
6975
  "transition-all",
6976
+ "motion-reduce:transition-none",
6708
6977
  "overflow-hidden",
6709
6978
  "before:invisible",
6710
6979
  "before:bg-foreground",
@@ -6910,7 +7179,7 @@ function notifications_default(Alpine) {
6910
7179
  const listener = {
6911
7180
  added(item) {
6912
7181
  const clone = notificationTemplates[item.template].content.firstElementChild.cloneNode(true);
6913
- clone.classList.add("transform", "transition-all", "duration-300", "ease-out", "opacity-0");
7182
+ clone.classList.add("transform", "transition-all", "motion-reduce:transition-none", "duration-300", "ease-out", "opacity-0");
6914
7183
  clone.setAttribute("id", item.id);
6915
7184
  Alpine2.addScopeToNode(clone, item.data);
6916
7185
  if (!isExtraLarge && !isLarge) {
@@ -6965,15 +7234,20 @@ function notifications_default(Alpine) {
6965
7234
  removed(id) {
6966
7235
  const element = el.querySelector(`#${id}`);
6967
7236
  if (element) {
6968
- element.addEventListener(
6969
- "transitionend",
6970
- () => {
6971
- Alpine2.destroyTree(element);
6972
- element.remove();
6973
- },
6974
- { once: true }
6975
- );
6976
- element.classList.add(element._h_animation_class, "opacity-0");
7237
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
7238
+ Alpine2.destroyTree(element);
7239
+ element.remove();
7240
+ } else {
7241
+ element.addEventListener(
7242
+ "transitionend",
7243
+ () => {
7244
+ Alpine2.destroyTree(element);
7245
+ element.remove();
7246
+ },
7247
+ { once: true }
7248
+ );
7249
+ element.classList.add(element._h_animation_class, "opacity-0");
7250
+ }
6977
7251
  }
6978
7252
  }
6979
7253
  };
@@ -7083,6 +7357,7 @@ function pagination_default(Alpine) {
7083
7357
  "text-sm",
7084
7358
  "font-medium",
7085
7359
  "transition-all",
7360
+ "motion-reduce:transition-none",
7086
7361
  "disabled:pointer-events-none",
7087
7362
  "disabled:opacity-50",
7088
7363
  "[&_svg]:pointer-events-none",
@@ -7157,7 +7432,7 @@ function popover_default(Alpine) {
7157
7432
  }
7158
7433
  el.setAttribute("type", "button");
7159
7434
  if (modifiers.includes("chevron")) {
7160
- el.classList.add("[&_svg]:transition-transform", "[&[data-state=open]>svg:not(:first-child):last-child]:rotate-180");
7435
+ el.classList.add("[&_svg]:transition-transform", "motion-reduce:[&_svg]:transition-none", "[&[aria-expanded=true]>svg:not(:first-child):last-child]:rotate-180");
7161
7436
  }
7162
7437
  if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "popover-trigger");
7163
7438
  if (el.hasAttribute("id")) {
@@ -7169,7 +7444,6 @@ function popover_default(Alpine) {
7169
7444
  el.setAttribute("aria-controls", el._popover.controls);
7170
7445
  el.setAttribute("aria-haspopup", "dialog");
7171
7446
  const setAttributes = () => {
7172
- el.setAttribute("data-state", el._popover.expanded ? "open" : "closed");
7173
7447
  el.setAttribute("aria-expanded", el._popover.expanded);
7174
7448
  };
7175
7449
  const close = () => {
@@ -7211,13 +7485,32 @@ function popover_default(Alpine) {
7211
7485
  if (!popover) {
7212
7486
  throw new Error(`${original2} must be placed after a popover element`);
7213
7487
  }
7214
- el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "top-0", "left-0", "z-50", "min-w-[1rem]", "rounded-md", "border", "shadow-md", "outline-hidden", "overflow-auto");
7488
+ el.classList.add(
7489
+ "absolute",
7490
+ "bg-popover",
7491
+ "text-popover-foreground",
7492
+ "hidden",
7493
+ "top-0",
7494
+ "left-0",
7495
+ "z-50",
7496
+ "min-w-[1rem]",
7497
+ "rounded-md",
7498
+ "border",
7499
+ "shadow-md",
7500
+ "outline-hidden",
7501
+ "overflow-auto",
7502
+ "transition-[opacity,scale]",
7503
+ "motion-reduce:transition-none",
7504
+ "duration-100",
7505
+ "ease-out",
7506
+ "opacity-0",
7507
+ "scale-95"
7508
+ );
7215
7509
  el.setAttribute("data-slot", "popover");
7216
7510
  el.setAttribute("role", "dialog");
7217
7511
  el.setAttribute("tabindex", "-1");
7218
7512
  el.setAttribute("id", popover._popover.controls);
7219
7513
  el.setAttribute("aria-labelledby", popover._popover.id);
7220
- el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
7221
7514
  let noScroll = modifiers.includes("no-scroll");
7222
7515
  if (noScroll) {
7223
7516
  el.classList.remove("overflow-auto");
@@ -7251,22 +7544,39 @@ function popover_default(Alpine) {
7251
7544
  left: `${x}px`,
7252
7545
  top: `${y}px`
7253
7546
  });
7547
+ el.classList.remove("scale-95", "opacity-0");
7254
7548
  });
7255
7549
  }
7256
7550
  effect(() => {
7257
- el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
7258
7551
  if (popover._popover.expanded) {
7552
+ el.classList.remove("hidden");
7259
7553
  autoUpdateCleanup = autoUpdate(popover, el, updatePosition);
7260
7554
  } else {
7555
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
7556
+ el.classList.add("hidden", "scale-95", "opacity-0");
7557
+ Object.assign(el.style, {
7558
+ left: "0px",
7559
+ top: "0px"
7560
+ });
7561
+ } else {
7562
+ el.classList.add("scale-95", "opacity-0");
7563
+ }
7261
7564
  if (autoUpdateCleanup) autoUpdateCleanup();
7565
+ }
7566
+ });
7567
+ function onTransitionEnd(event) {
7568
+ if (event.target === el && event.target.classList.contains("opacity-0")) {
7569
+ el.classList.add("hidden");
7262
7570
  Object.assign(el.style, {
7263
7571
  left: "0px",
7264
7572
  top: "0px"
7265
7573
  });
7266
7574
  }
7267
- });
7575
+ }
7576
+ el.addEventListener("transitionend", onTransitionEnd);
7268
7577
  cleanup(() => {
7269
7578
  el.removeEventListener("click", stopPropagation);
7579
+ el.removeEventListener("transitionend", onTransitionEnd);
7270
7580
  });
7271
7581
  });
7272
7582
  }
@@ -7277,7 +7587,7 @@ function progress_default(Alpine) {
7277
7587
  el.classList.add("bg-secondary", "relative", "h-2", "w-full", "overflow-hidden", "rounded-full");
7278
7588
  el.setAttribute("data-slot", "progress");
7279
7589
  const indicator = document.createElement("div");
7280
- indicator.classList.add("bg-primary", "h-full", "w-full", "flex-1", "transition-all", "rounded-full");
7590
+ indicator.classList.add("bg-primary", "h-full", "w-full", "flex-1", "transition-all", "motion-reduce:transition-none", "rounded-full");
7281
7591
  indicator.setAttribute("data-slot", "progress-indicator");
7282
7592
  Object.assign(indicator.style, {
7283
7593
  transform: `translateX(-${100 - 0}%)`
@@ -7389,7 +7699,7 @@ function select_default(Alpine) {
7389
7699
  set: void 0,
7390
7700
  get: void 0
7391
7701
  };
7392
- el.classList.add("cursor-pointer", "outline-none", "transition-[color,box-shadow]", "duration-200", "w-full", "has-[input:disabled]:pointer-events-none", "has-[input:disabled]:opacity-50");
7702
+ el.classList.add("cursor-pointer", "outline-none", "transition-[color,box-shadow]", "motion-reduce:transition-none", "duration-200", "w-full", "has-[input:disabled]:pointer-events-none", "has-[input:disabled]:opacity-50");
7393
7703
  if (modifiers.includes("table")) {
7394
7704
  el.classList.add("h-10", "flex", "focus-visible:inset-ring-ring/50", "focus-visible:inset-ring-2", "hover:bg-table-hover", "hover:text-table-hover-foreground", "active:!bg-table-active", "active:!text-table-active-foreground");
7395
7705
  el.setAttribute("data-slot", "cell-input-select");
@@ -7472,7 +7782,7 @@ function select_default(Alpine) {
7472
7782
  fakeTrigger.appendChild(displayValue);
7473
7783
  fakeTrigger.setAttribute("data-slot", "select-value");
7474
7784
  fakeTrigger.setAttribute("tabindex", "0");
7475
- fakeTrigger.classList.add("flex", "items-center", "justify-between", "gap-2", "outline-none", "pl-3", "pr-2", "size-full", "[&[data-state=open]>svg]:rotate-180");
7785
+ 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
7786
  select._h_select.trigger = fakeTrigger;
7477
7787
  let labelObserver;
7478
7788
  if (label) {
@@ -7519,7 +7829,6 @@ function select_default(Alpine) {
7519
7829
  fakeTrigger.setAttribute("aria-autocomplete", "none");
7520
7830
  fakeTrigger.setAttribute("role", "combobox");
7521
7831
  effect(() => {
7522
- fakeTrigger.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
7523
7832
  fakeTrigger.setAttribute("aria-expanded", select._h_select.expanded);
7524
7833
  });
7525
7834
  const close = (focusSelect = false) => {
@@ -7664,7 +7973,7 @@ function select_default(Alpine) {
7664
7973
  fakeTrigger.addEventListener("click", onClick);
7665
7974
  const chevronDown = createSvg({
7666
7975
  icon: ChevronDown,
7667
- classes: "opacity-70 text-foreground size-4 shrink-0 pointer-events-none transition-transform duration-200",
7976
+ classes: "opacity-70 text-foreground size-4 shrink-0 pointer-events-none transition-transform motion-reduce:transition-none duration-200",
7668
7977
  attrs: {
7669
7978
  "aria-hidden": true,
7670
7979
  role: "presentation"
@@ -7695,17 +8004,37 @@ function select_default(Alpine) {
7695
8004
  }
7696
8005
  });
7697
8006
  });
7698
- Alpine.directive("h-select-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
8007
+ Alpine.directive("h-select-content", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
7699
8008
  const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
7700
8009
  if (!select) {
7701
8010
  throw new Error(`${original2} must be inside a select element`);
7702
8011
  }
7703
- el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "p-1", "top-0", "left-0", "z-50", "min-w-[1rem]", "overflow-x-hidden", "overflow-y-auto", "rounded-md", "border", "shadow-md");
8012
+ el.classList.add(
8013
+ "absolute",
8014
+ "bg-popover",
8015
+ "text-popover-foreground",
8016
+ "hidden",
8017
+ "p-1",
8018
+ "top-0",
8019
+ "left-0",
8020
+ "z-50",
8021
+ "min-w-[1rem]",
8022
+ "overflow-x-hidden",
8023
+ "overflow-y-auto",
8024
+ "rounded-md",
8025
+ "border",
8026
+ "shadow-md",
8027
+ "transition-[opacity,scale]",
8028
+ "motion-reduce:transition-none",
8029
+ "duration-100",
8030
+ "ease-out",
8031
+ "opacity-0",
8032
+ "scale-95"
8033
+ );
7704
8034
  el.setAttribute("data-slot", "select-content");
7705
8035
  el.setAttribute("role", "listbox");
7706
8036
  el.setAttribute("id", select._h_select.controls);
7707
8037
  el.setAttribute("tabindex", "-1");
7708
- el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
7709
8038
  if (!select._h_select.trigger) {
7710
8039
  throw new Error(`${original2}: trigger not found`);
7711
8040
  }
@@ -7731,22 +8060,41 @@ function select_default(Alpine) {
7731
8060
  left: `${x}px`,
7732
8061
  top: `${y}px`
7733
8062
  });
8063
+ el.classList.remove("scale-95", "opacity-0");
7734
8064
  });
7735
8065
  }
7736
8066
  effect(() => {
7737
8067
  el.setAttribute("aria-labelledby", select._h_select.fieldLabelId);
7738
8068
  });
7739
8069
  effect(() => {
7740
- el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
7741
8070
  if (select._h_select.expanded) {
8071
+ el.classList.remove("hidden");
7742
8072
  autoUpdateCleanup = autoUpdate(select._h_select.trigger, el, updatePosition);
7743
8073
  } else {
8074
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
8075
+ el.classList.add("hidden", "scale-95", "opacity-0");
8076
+ Object.assign(el.style, {
8077
+ left: "0px",
8078
+ top: "0px"
8079
+ });
8080
+ } else {
8081
+ el.classList.add("scale-95", "opacity-0");
8082
+ }
7744
8083
  if (autoUpdateCleanup) autoUpdateCleanup();
8084
+ }
8085
+ });
8086
+ function onTransitionEnd(event) {
8087
+ if (event.target === el && event.target.classList.contains("opacity-0")) {
8088
+ el.classList.add("hidden");
7745
8089
  Object.assign(el.style, {
7746
8090
  left: "0px",
7747
8091
  top: "0px"
7748
8092
  });
7749
8093
  }
8094
+ }
8095
+ el.addEventListener("transitionend", onTransitionEnd);
8096
+ cleanup(() => {
8097
+ el.removeEventListener("transitionend", onTransitionEnd);
7750
8098
  });
7751
8099
  });
7752
8100
  Alpine.directive("h-select-search", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
@@ -7974,16 +8322,43 @@ function separator_default(Alpine) {
7974
8322
  // src/components/sheet.js
7975
8323
  function sheet_default(Alpine) {
7976
8324
  Alpine.directive("h-sheet-overlay", (el, { expression }, { effect, evaluate: evaluate2, evaluateLater, cleanup }) => {
7977
- el.classList.add("data-[open=false]:hidden", "fixed", "inset-0", "z-50", "bg-black/50");
8325
+ el._h_sheet_overlay = {
8326
+ showSheet: void 0,
8327
+ hideSheet: void 0,
8328
+ state: Alpine.reactive({
8329
+ open: evaluate2(expression || "false")
8330
+ })
8331
+ };
8332
+ 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
8333
  el.setAttribute("tabindex", "-1");
7979
8334
  el.setAttribute("data-slot", "sheet-overlay");
7980
- el.setAttribute("data-open", evaluate2(expression));
7981
8335
  const getIsOpen = evaluateLater(expression);
7982
8336
  effect(() => {
7983
8337
  getIsOpen((isOpen) => {
7984
- el.setAttribute("data-open", isOpen);
8338
+ el._h_sheet_overlay.state.open = isOpen;
7985
8339
  });
7986
8340
  });
8341
+ effect(() => {
8342
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
8343
+ if (el._h_sheet_overlay.state.open) {
8344
+ el.classList.remove("hidden", "opacity-0");
8345
+ } else {
8346
+ el.classList.add("hidden", "opacity-0");
8347
+ }
8348
+ } else if (el._h_sheet_overlay.state.open) {
8349
+ el.classList.remove("hidden");
8350
+ el.offsetHeight;
8351
+ el.classList.remove("opacity-0");
8352
+ } else {
8353
+ el.classList.add("opacity-0");
8354
+ }
8355
+ });
8356
+ function onTransitionEnd(event) {
8357
+ if (event.target === el && event.target.classList.contains("opacity-0")) {
8358
+ el.classList.add("hidden");
8359
+ }
8360
+ }
8361
+ el.addEventListener("transitionend", onTransitionEnd);
7987
8362
  const onClick = (event) => {
7988
8363
  if (event.target.getAttribute("data-slot") === "sheet-overlay") {
7989
8364
  evaluate2(`${expression} = false`);
@@ -7992,12 +8367,29 @@ function sheet_default(Alpine) {
7992
8367
  el.addEventListener("click", onClick);
7993
8368
  cleanup(() => {
7994
8369
  el.removeEventListener("click", onClick);
8370
+ el.removeEventListener("transitionend", onTransitionEnd);
7995
8371
  });
7996
8372
  });
7997
- Alpine.directive("h-sheet", (el, _, { cleanup }) => {
7998
- el.classList.add("bg-background", "fixed", "shadow-lg");
8373
+ Alpine.directive("h-sheet", (el, { original: original2 }, { effect, cleanup }) => {
8374
+ const overlay = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_sheet_overlay"));
8375
+ if (!overlay) {
8376
+ throw new Error(`${original2} must be placed inside a sheet overlay`);
8377
+ }
8378
+ el.classList.add("hidden", "bg-background", "fixed", "shadow-lg", "transform", "transition-all", "motion-reduce:transition-none", "duration-200", "ease-out");
7999
8379
  el.setAttribute("data-slot", "sheet");
8000
8380
  let lastSide;
8381
+ const getTranslateClass = (side) => {
8382
+ switch (side) {
8383
+ case "top":
8384
+ return "-translate-y-full";
8385
+ case "right":
8386
+ return "translate-x-full";
8387
+ case "left":
8388
+ return "-translate-x-full";
8389
+ default:
8390
+ return "translate-y-full";
8391
+ }
8392
+ };
8001
8393
  const getSideClasses = (side) => {
8002
8394
  switch (side) {
8003
8395
  case "top":
@@ -8019,9 +8411,32 @@ function sheet_default(Alpine) {
8019
8411
  setSide(el.getAttribute("data-align"));
8020
8412
  });
8021
8413
  setSide(el.getAttribute("data-align"));
8414
+ el.classList.add(getTranslateClass(lastSide));
8415
+ function onTransitionEnd(event) {
8416
+ if (event.target === el && event.target.classList.contains(getTranslateClass(lastSide))) {
8417
+ el.classList.add("hidden");
8418
+ }
8419
+ }
8420
+ el.addEventListener("transitionend", onTransitionEnd);
8421
+ effect(() => {
8422
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
8423
+ if (overlay._h_sheet_overlay.state.open) {
8424
+ el.classList.remove("hidden", getTranslateClass(lastSide));
8425
+ } else {
8426
+ el.classList.add("hidden", getTranslateClass(lastSide));
8427
+ }
8428
+ } else if (overlay._h_sheet_overlay.state.open) {
8429
+ el.classList.remove("hidden");
8430
+ el.offsetHeight;
8431
+ el.classList.remove(getTranslateClass(lastSide));
8432
+ } else {
8433
+ el.classList.add(getTranslateClass(lastSide));
8434
+ }
8435
+ });
8022
8436
  observer.observe(el, { attributes: true, attributeFilter: ["data-align"] });
8023
8437
  cleanup(() => {
8024
8438
  observer.disconnect();
8439
+ el.removeEventListener("transitionend", onTransitionEnd);
8025
8440
  });
8026
8441
  });
8027
8442
  }
@@ -8097,6 +8512,7 @@ function sidebar_default(Alpine) {
8097
8512
  "font-medium",
8098
8513
  "outline-hidden",
8099
8514
  "transition-[margin,opacity]",
8515
+ "motion-reduce:transition-none",
8100
8516
  "duration-200",
8101
8517
  "ease-linear",
8102
8518
  "focus-visible:ring-2",
@@ -8123,7 +8539,7 @@ function sidebar_default(Alpine) {
8123
8539
  el.appendChild(
8124
8540
  createSvg({
8125
8541
  icon: ChevronRight,
8126
- classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform duration-200 [[aria-expanded=true]>&]:rotate-90",
8542
+ classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[aria-expanded=true]>&]:rotate-90",
8127
8543
  attrs: {
8128
8544
  "aria-hidden": true,
8129
8545
  role: "presentation"
@@ -8156,6 +8572,7 @@ function sidebar_default(Alpine) {
8156
8572
  "p-0",
8157
8573
  "outline-hidden",
8158
8574
  "transition-transform",
8575
+ "motion-reduce:transition-none",
8159
8576
  "focus-visible:ring-2",
8160
8577
  "[&>svg]:size-4",
8161
8578
  "[&>svg]:shrink-0",
@@ -8288,10 +8705,11 @@ function sidebar_default(Alpine) {
8288
8705
  "text-sm",
8289
8706
  "duration-200",
8290
8707
  "transition-[width,height,padding]",
8708
+ "motion-reduce:transition-none",
8291
8709
  "group-has-data-[sidebar=menu-action]/menu-item:pr-8",
8292
8710
  "data-[active=true]:font-medium",
8293
- "data-[state=open]:hover:bg-sidebar-secondary",
8294
- "data-[state=open]:hover:text-sidebar-secondary-foreground",
8711
+ "aria-[expanded=true]:hover:bg-sidebar-secondary",
8712
+ "aria-[expanded=true]:hover:text-sidebar-secondary-foreground",
8295
8713
  "group-data-[collapsed=true]/sidebar:!size-8",
8296
8714
  "group-data-[collapsed=true]/sidebar:!p-2",
8297
8715
  "group-data-[collapsed=true]/sidebar:[&>*:not(svg:first-child):not([data-slot=menu])]:!hidden"
@@ -8314,7 +8732,7 @@ function sidebar_default(Alpine) {
8314
8732
  el.appendChild(
8315
8733
  createSvg({
8316
8734
  icon: ChevronRight,
8317
- classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform duration-200 [[aria-expanded=true]>&]:rotate-90",
8735
+ classes: "ml-auto pointer-events-none size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[aria-expanded=true]>&]:rotate-90",
8318
8736
  attrs: {
8319
8737
  "aria-hidden": true,
8320
8738
  role: "presentation"
@@ -8352,6 +8770,7 @@ function sidebar_default(Alpine) {
8352
8770
  "p-0",
8353
8771
  "outline-hidden",
8354
8772
  "transition-transform",
8773
+ "motion-reduce:transition-none",
8355
8774
  "focus-visible:ring-2",
8356
8775
  "[&>svg]:size-4",
8357
8776
  "[&>svg]:shrink-0",
@@ -8361,7 +8780,7 @@ function sidebar_default(Alpine) {
8361
8780
  "group-data-[collapsed=true]/sidebar:hidden"
8362
8781
  );
8363
8782
  if (modifiers.includes("autohide")) {
8364
- el.classList.add("group-focus-within/menu-item:opacity-100", "group-hover/menu-item:opacity-100", "data-[state=open]:opacity-100", "md:opacity-0");
8783
+ 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
8784
  }
8366
8785
  if (el.tagName !== "BUTTON") {
8367
8786
  el.setAttribute("role", "button");
@@ -9000,6 +9419,7 @@ function switch_default(Alpine) {
9000
9419
  "before:h-full",
9001
9420
  "before:aspect-square",
9002
9421
  "before:transition-transform",
9422
+ "before:motion-reduce:transition-none",
9003
9423
  "bg-muted",
9004
9424
  "border",
9005
9425
  "data-[size=sm]:h-5",
@@ -9018,7 +9438,8 @@ function switch_default(Alpine) {
9018
9438
  "relative",
9019
9439
  "rounded-full",
9020
9440
  "shrink-0",
9021
- "transition-color"
9441
+ "transition-colors",
9442
+ "motion-reduce:transition-none"
9022
9443
  );
9023
9444
  el.setAttribute("tabindex", "-1");
9024
9445
  el.setAttribute("data-slot", "switch");
@@ -9122,10 +9543,12 @@ function table_default(Alpine) {
9122
9543
  "outline-none",
9123
9544
  "gap-2",
9124
9545
  "transition-[color,box-shadow]",
9546
+ "motion-reduce:transition-none",
9125
9547
  "[&_svg]:pointer-events-none",
9126
9548
  "[&_svg]:opacity-70",
9127
9549
  "[&_svg]:text-foreground",
9128
9550
  "[&_svg]:transition-transform",
9551
+ "motion-reduce:[&_svg]:transition-none",
9129
9552
  "[&_svg]:duration-200",
9130
9553
  "[&_svg:not([class*='size-'])]:size-4",
9131
9554
  "shrink-0",
@@ -9246,6 +9669,7 @@ function tabs_default(Alpine) {
9246
9669
  "font-medium",
9247
9670
  "whitespace-nowrap",
9248
9671
  "transition-[color,box-shadow]",
9672
+ "motion-reduce:transition-none",
9249
9673
  "group-data-[floating=true]/tab-bar:rounded-md",
9250
9674
  "group-data-[floating=true]/tab-bar:border",
9251
9675
  "group-data-[floating=true]/tab-bar:border-transparent",
@@ -9427,6 +9851,7 @@ function textarea_default(Alpine) {
9427
9851
  "text-base",
9428
9852
  "shadow-input",
9429
9853
  "transition-[color,box-shadow]",
9854
+ "motion-reduce:transition-none",
9430
9855
  "outline-none",
9431
9856
  "focus-visible:ring-[calc(var(--spacing)*0.75)]",
9432
9857
  "disabled:cursor-not-allowed",
@@ -9460,9 +9885,11 @@ function tile_default(Alpine) {
9460
9885
  "text-sm",
9461
9886
  "rounded-lg",
9462
9887
  "transition-colors",
9888
+ "motion-reduce:transition-none",
9463
9889
  "[a]:hover:bg-secondary-hover",
9464
9890
  "[a]:hover:text-secondary-foreground",
9465
9891
  "[a]:transition-colors",
9892
+ "[a]:motion-reduce:transition-none",
9466
9893
  "duration-100",
9467
9894
  "flex-wrap",
9468
9895
  "outline-none",
@@ -9617,6 +10044,7 @@ function timepicker_default(Alpine) {
9617
10044
  "text-sm",
9618
10045
  "whitespace-nowrap",
9619
10046
  "transition-[color,box-shadow]",
10047
+ "motion-reduce:transition-none",
9620
10048
  "duration-200",
9621
10049
  "outline-none",
9622
10050
  "has-[input:disabled]:pointer-events-none",
@@ -9801,7 +10229,6 @@ function timepicker_default(Alpine) {
9801
10229
  el.addEventListener("beforeinput", preventInput);
9802
10230
  el.addEventListener("paste", preventInput);
9803
10231
  effect(() => {
9804
- el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
9805
10232
  el.setAttribute("aria-expanded", timepicker._h_timepicker.expanded);
9806
10233
  });
9807
10234
  cleanup(() => {
@@ -9819,11 +10246,17 @@ function timepicker_default(Alpine) {
9819
10246
  "absolute",
9820
10247
  "bg-popover",
9821
10248
  "text-popover-foreground",
9822
- "data-[state=open]:flex",
9823
- "data-[state=open]:flex-col",
9824
- "data-[state=closed]:hidden",
10249
+ "flex",
10250
+ "flex-col",
10251
+ "hidden",
9825
10252
  "z-50",
9826
- "shadow-md"
10253
+ "shadow-md",
10254
+ "transition-[opacity,scale]",
10255
+ "motion-reduce:transition-none",
10256
+ "duration-100",
10257
+ "ease-out",
10258
+ "opacity-0",
10259
+ "scale-95"
9827
10260
  );
9828
10261
  el.setAttribute("id", timepicker._h_timepicker.controls);
9829
10262
  el.setAttribute("tabindex", "-1");
@@ -9831,7 +10264,6 @@ function timepicker_default(Alpine) {
9831
10264
  el.setAttribute("aria-modal", "true");
9832
10265
  el.setAttribute("data-slot", "time-picker-popup");
9833
10266
  el.setAttribute("aria-labelledby", timepicker._h_timepicker.id);
9834
- el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
9835
10267
  const optionClasses = [
9836
10268
  "px-3.5",
9837
10269
  "py-2",
@@ -10241,6 +10673,7 @@ function timepicker_default(Alpine) {
10241
10673
  left: `${x}px`,
10242
10674
  top: `${y}px`
10243
10675
  });
10676
+ el.classList.remove("scale-95", "opacity-0");
10244
10677
  if (focusFirstItem) {
10245
10678
  focusFirstItem = false;
10246
10679
  Alpine2.nextTick(() => {
@@ -10254,25 +10687,41 @@ function timepicker_default(Alpine) {
10254
10687
  });
10255
10688
  }
10256
10689
  effect(() => {
10257
- el.setAttribute("data-state", timepicker._h_timepicker.expanded ? "open" : "closed");
10258
10690
  if (timepicker._h_timepicker.expanded) {
10259
10691
  render();
10692
+ el.classList.remove("hidden");
10260
10693
  autoUpdateCleanup = autoUpdate(timepicker, el, updatePosition);
10261
10694
  if (selectedHour) scrollIntoCenter(selectedHour.parentElement, selectedHour);
10262
10695
  if (selectedMinute) scrollIntoCenter(selectedMinute.parentElement, selectedMinute);
10263
10696
  if (selectedSecond && timepicker._h_timepicker.seconds) scrollIntoCenter(selectedSecond.parentElement, selectedSecond);
10264
10697
  } else {
10698
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
10699
+ el.classList.add("hidden", "scale-95", "opacity-0");
10700
+ Object.assign(el.style, {
10701
+ left: "0px",
10702
+ top: "0px"
10703
+ });
10704
+ } else {
10705
+ el.classList.add("scale-95", "opacity-0");
10706
+ }
10265
10707
  if (autoUpdateCleanup) autoUpdateCleanup();
10266
10708
  focusFirstItem = true;
10709
+ }
10710
+ });
10711
+ function onTransitionEnd(event) {
10712
+ if (event.target === el && event.target.classList.contains("opacity-0")) {
10713
+ el.classList.add("hidden");
10267
10714
  Object.assign(el.style, {
10268
10715
  left: "0px",
10269
10716
  top: "0px"
10270
10717
  });
10271
10718
  }
10272
- });
10719
+ }
10720
+ el.addEventListener("transitionend", onTransitionEnd);
10273
10721
  cleanup(() => {
10274
10722
  el.removeEventListener("keydown", onKeyDown);
10275
10723
  el.removeEventListener("click", onClick);
10724
+ el.removeEventListener("transitionend", onTransitionEnd);
10276
10725
  okButton.removeEventListener("click", timepicker._h_timepicker.close);
10277
10726
  nowButton.removeEventListener("click", getCurrentTime);
10278
10727
  timeContainer.removeEventListener("click", setTime);
@@ -10367,7 +10816,7 @@ function tooltip_default(Alpine) {
10367
10816
  el.removeEventListener("pointerleave", handler);
10368
10817
  });
10369
10818
  });
10370
- Alpine.directive("h-tooltip", (el, { original: original2 }, { effect }) => {
10819
+ Alpine.directive("h-tooltip", (el, { original: original2 }, { effect, cleanup }) => {
10371
10820
  const tooltip = (() => {
10372
10821
  let sibling = el.previousElementSibling;
10373
10822
  while (sibling && !sibling.hasOwnProperty("_tooltip")) {
@@ -10378,7 +10827,24 @@ function tooltip_default(Alpine) {
10378
10827
  if (!tooltip) {
10379
10828
  throw new Error(`${original2} must be placed after a tooltip trigger element`);
10380
10829
  }
10381
- el.classList.add("absolute", "bg-foreground", "text-background", "z-50", "w-fit", "rounded-md", "px-3", "py-1.5", "text-xs", "text-balance");
10830
+ el.classList.add(
10831
+ "absolute",
10832
+ "bg-foreground",
10833
+ "text-background",
10834
+ "z-50",
10835
+ "w-fit",
10836
+ "rounded-md",
10837
+ "px-3",
10838
+ "py-1.5",
10839
+ "text-xs",
10840
+ "text-balance",
10841
+ "transition-[opacity,scale]",
10842
+ "motion-reduce:transition-none",
10843
+ "duration-100",
10844
+ "ease-out",
10845
+ "opacity-0",
10846
+ "scale-95"
10847
+ );
10382
10848
  el.setAttribute("data-slot", "tooltip");
10383
10849
  el.setAttribute("id", tooltip._tooltip.controls);
10384
10850
  const arrowEl = document.createElement("span");
@@ -10393,6 +10859,7 @@ function tooltip_default(Alpine) {
10393
10859
  left: `${x}px`,
10394
10860
  top: `${y}px`
10395
10861
  });
10862
+ el.classList.remove("scale-95", "opacity-0");
10396
10863
  if (middlewareData.arrow) {
10397
10864
  Object.assign(arrowEl.style, {
10398
10865
  left: middlewareData.arrow.x != null ? `${middlewareData.arrow.x}px` : "",
@@ -10406,6 +10873,23 @@ function tooltip_default(Alpine) {
10406
10873
  el.classList.remove("hidden");
10407
10874
  updatePosition();
10408
10875
  } else {
10876
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
10877
+ el.classList.add("hidden", "scale-95", "opacity-0");
10878
+ Object.assign(el.style, {
10879
+ left: "0px",
10880
+ top: "0px"
10881
+ });
10882
+ Object.assign(arrowEl.style, {
10883
+ left: "0px",
10884
+ top: "0px"
10885
+ });
10886
+ } else {
10887
+ el.classList.add("scale-95", "opacity-0");
10888
+ }
10889
+ }
10890
+ });
10891
+ function onTransitionEnd(event) {
10892
+ if (event.target === el && event.target.classList.contains("opacity-0")) {
10409
10893
  el.classList.add("hidden");
10410
10894
  Object.assign(el.style, {
10411
10895
  left: "0px",
@@ -10416,6 +10900,10 @@ function tooltip_default(Alpine) {
10416
10900
  top: "0px"
10417
10901
  });
10418
10902
  }
10903
+ }
10904
+ el.addEventListener("transitionend", onTransitionEnd);
10905
+ cleanup(() => {
10906
+ el.removeEventListener("transitionend", onTransitionEnd);
10419
10907
  });
10420
10908
  });
10421
10909
  }
@@ -10599,6 +11087,7 @@ function tree_default(Alpine) {
10599
11087
  "outline-hidden",
10600
11088
  "ring-ring",
10601
11089
  "transition-[width,height,padding]",
11090
+ "motion-reduce:transition-none",
10602
11091
  "hover:bg-secondary",
10603
11092
  "hover:text-secondary-foreground",
10604
11093
  "focus-visible:ring-2",
@@ -10630,7 +11119,7 @@ function tree_default(Alpine) {
10630
11119
  if (treeItem._h_tree_item.hasSubtree) {
10631
11120
  const chevronDown = createSvg({
10632
11121
  icon: ChevronRight,
10633
- classes: "size-4 shrink-0 transition-transform duration-200 [[data-expanded=true]>&]:rotate-90",
11122
+ classes: "size-4 shrink-0 transition-transform motion-reduce:transition-none duration-200 [[data-expanded=true]>&]:rotate-90",
10634
11123
  attrs: {
10635
11124
  "aria-hidden": true,
10636
11125
  role: "presentation"
@@ -10647,7 +11136,7 @@ function tree_default(Alpine) {
10647
11136
  }
10648
11137
 
10649
11138
  // package.json
10650
- var version = "1.7.2";
11139
+ var version = "1.8.0";
10651
11140
 
10652
11141
  // src/utils/theme.js
10653
11142
  var colorSchemeKey = "codbex.harmonia.colorMode";
@@ -10844,9 +11333,9 @@ var registerComponents = (registerPlugin) => {
10844
11333
  registerPlugin(calendar_default);
10845
11334
  registerPlugin(card_default);
10846
11335
  registerPlugin(checkbox_default);
10847
- registerPlugin(collapsible_default);
10848
11336
  registerPlugin(datepicker_default);
10849
11337
  registerPlugin(dialog_default);
11338
+ registerPlugin(expansion_panel_default);
10850
11339
  registerPlugin(fieldset_default);
10851
11340
  registerPlugin(focus_default);
10852
11341
  registerPlugin(icon_default);
@@ -10892,9 +11381,9 @@ export {
10892
11381
  calendar_default as Calendar,
10893
11382
  card_default as Card,
10894
11383
  checkbox_default as Checkbox,
10895
- collapsible_default as Collapsible,
10896
11384
  datepicker_default as DatePicker,
10897
11385
  dialog_default as Dialog,
11386
+ expansion_panel_default as ExpansionPanel,
10898
11387
  fieldset_default as Fieldset,
10899
11388
  focus_default as Focus,
10900
11389
  icon_default as Icon,