@codbex/harmonia 0.3.0 → 0.4.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.
@@ -18493,7 +18493,6 @@ function accordion_default(Alpine) {
18493
18493
  "items-start",
18494
18494
  "justify-between",
18495
18495
  "gap-4",
18496
- "rounded-md",
18497
18496
  "py-4",
18498
18497
  "text-left",
18499
18498
  "text-sm",
@@ -18575,7 +18574,7 @@ function alert_default(Alpine) {
18575
18574
  "items-center",
18576
18575
  "[&>svg]:size-4",
18577
18576
  "[&>svg]:text-current",
18578
- modifiers.includes("floating") ? "shadow-alert" : void 0
18577
+ modifiers.includes("floating") ? "shadow-lg" : void 0
18579
18578
  );
18580
18579
  el.setAttribute("data-slot", "alert");
18581
18580
  el.setAttribute("role", "alert");
@@ -18627,8 +18626,6 @@ function avatar_default(Alpine) {
18627
18626
  "bg-secondary",
18628
18627
  "text-secondary-foreground",
18629
18628
  "fill-secondary-foreground",
18630
- "hover:bg-secondary-hover",
18631
- "active:bg-secondary-active",
18632
18629
  "[[data-slot=toolbar]:not([data-variant=transparent])_&]:border",
18633
18630
  "has-[img]:border-0",
18634
18631
  "flex",
@@ -18645,6 +18642,9 @@ function avatar_default(Alpine) {
18645
18642
  el._avatar = Alpine2.reactive({
18646
18643
  fallback: false
18647
18644
  });
18645
+ if (el.tagName === "BUTTON") {
18646
+ el.classList.add("cursor-pointer", "hover:bg-secondary-hover", "active:bg-secondary-active");
18647
+ }
18648
18648
  });
18649
18649
  Alpine.directive("h-avatar-image", (el, {}, { cleanup }) => {
18650
18650
  const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_avatar"));
@@ -18762,50 +18762,126 @@ function badge_default(Alpine) {
18762
18762
  }
18763
18763
 
18764
18764
  // src/components/button.js
18765
+ var buttonVariants = {
18766
+ default: [
18767
+ "bg-secondary",
18768
+ "text-secondary-foreground",
18769
+ "shadow-control",
18770
+ "hover:bg-secondary-hover",
18771
+ "active:bg-secondary-active",
18772
+ "aria-pressed:bg-secondary-active",
18773
+ "active:data-[toggled=true]:bg-secondary-active",
18774
+ "hover:data-[toggled=true]:bg-secondary-hover",
18775
+ "data-[toggled=true]:bg-secondary-active"
18776
+ ],
18777
+ primary: [
18778
+ "bg-primary",
18779
+ "text-primary-foreground",
18780
+ "shadow-control",
18781
+ "hover:bg-primary-hover",
18782
+ "active:bg-primary-active",
18783
+ "aria-pressed:bg-primary-active",
18784
+ "active:data-[toggled=true]:bg-primary-active",
18785
+ "hover:data-[toggled=true]:bg-primary-hover",
18786
+ "data-[toggled=true]:bg-primary-active"
18787
+ ],
18788
+ positive: [
18789
+ "bg-positive",
18790
+ "text-positive-foreground",
18791
+ "shadow-control",
18792
+ "hover:bg-positive-hover",
18793
+ "active:bg-positive-active",
18794
+ "aria-pressed:bg-positive-active",
18795
+ "active:data-[toggled=true]:bg-positive-active",
18796
+ "hover:data-[toggled=true]:bg-positive-hover",
18797
+ "data-[toggled=true]:bg-positive-active"
18798
+ ],
18799
+ negative: [
18800
+ "bg-negative",
18801
+ "text-negative-foreground",
18802
+ "shadow-control",
18803
+ "hover:bg-negative-hover",
18804
+ "active:bg-negative-active",
18805
+ "aria-pressed:bg-negative-active",
18806
+ "active:data-[toggled=true]:bg-negative-active",
18807
+ "hover:data-[toggled=true]:bg-negative-hover",
18808
+ "data-[toggled=true]:bg-negative-active"
18809
+ ],
18810
+ warning: [
18811
+ "bg-warning",
18812
+ "text-warning-foreground",
18813
+ "shadow-control",
18814
+ "hover:bg-warning-hover",
18815
+ "active:bg-warning-active",
18816
+ "aria-pressed:bg-warning-active",
18817
+ "active:data-[toggled=true]:bg-warning-active",
18818
+ "hover:data-[toggled=true]:bg-warning-hover",
18819
+ "data-[toggled=true]:bg-warning-active"
18820
+ ],
18821
+ outline: [
18822
+ "border",
18823
+ "bg-background",
18824
+ "text-foreground",
18825
+ "shadow-none",
18826
+ "hover:bg-secondary",
18827
+ "hover:text-secondary-foreground",
18828
+ "active:bg-secondary-active",
18829
+ "aria-pressed:bg-secondary-active",
18830
+ "active:data-[toggled=true]:bg-secondary-active",
18831
+ "hover:data-[toggled=true]:bg-secondary-hover",
18832
+ "data-[toggled=true]:bg-secondary-active"
18833
+ ],
18834
+ transparent: [
18835
+ "bg-transparent",
18836
+ "text-foreground",
18837
+ "shadow-none",
18838
+ "hover:bg-secondary",
18839
+ "hover:text-secondary-foreground",
18840
+ "active:bg-secondary-active",
18841
+ "aria-pressed:bg-secondary-active",
18842
+ "active:data-[toggled=true]:bg-secondary-active",
18843
+ "hover:data-[toggled=true]:bg-secondary-hover",
18844
+ "data-[toggled=true]:bg-secondary-active"
18845
+ ],
18846
+ link: ["text-primary", "underline-offset-4", "hover:underline"]
18847
+ };
18848
+ var setButtonClasses = (el) => {
18849
+ el.classList.add(
18850
+ "cursor-pointer",
18851
+ "inline-flex",
18852
+ "items-center",
18853
+ "justify-center",
18854
+ "gap-2",
18855
+ "whitespace-nowrap",
18856
+ "rounded-control",
18857
+ "text-sm",
18858
+ "font-medium",
18859
+ "transition-all",
18860
+ "disabled:pointer-events-none",
18861
+ "disabled:opacity-50",
18862
+ "[&_svg]:pointer-events-none",
18863
+ "[&_svg:not([class*='size-'])]:size-4",
18864
+ "shrink-0",
18865
+ "[&_svg]:shrink-0",
18866
+ "outline-none",
18867
+ "focus-visible:border-ring",
18868
+ "focus-visible:ring-ring/50",
18869
+ "focus-visible:ring-[3px]",
18870
+ "aria-invalid:ring-negative/20",
18871
+ "dark:aria-invalid:ring-negative/40",
18872
+ "aria-invalid:border-negative",
18873
+ "invalid:ring-negative/20",
18874
+ "dark:invalid:ring-negative/40",
18875
+ "invalid:border-negative"
18876
+ );
18877
+ };
18765
18878
  function button_default(Alpine) {
18766
18879
  Alpine.directive("h-button", (el, { modifiers }, { cleanup }) => {
18767
- el.classList.add(
18768
- "cursor-pointer",
18769
- "inline-flex",
18770
- "items-center",
18771
- "justify-center",
18772
- "gap-2",
18773
- "whitespace-nowrap",
18774
- "rounded-control",
18775
- "text-sm",
18776
- "font-medium",
18777
- "transition-all",
18778
- "disabled:pointer-events-none",
18779
- "disabled:opacity-50",
18780
- "[&_svg]:pointer-events-none",
18781
- "[&_svg:not([class*='size-'])]:size-4",
18782
- "shrink-0",
18783
- "[&_svg]:shrink-0",
18784
- "outline-none",
18785
- "focus-visible:border-ring",
18786
- "focus-visible:ring-ring/50",
18787
- "focus-visible:ring-[3px]",
18788
- "aria-invalid:ring-negative/20",
18789
- "dark:aria-invalid:ring-negative/40",
18790
- "aria-invalid:border-negative",
18791
- "invalid:ring-negative/20",
18792
- "dark:invalid:ring-negative/40",
18793
- "invalid:border-negative"
18794
- );
18880
+ setButtonClasses(el);
18795
18881
  if (!el.hasAttribute("data-slot")) {
18796
18882
  el.setAttribute("data-slot", "button");
18797
18883
  }
18798
18884
  const inGroup = modifiers.includes("group");
18799
- const variants = {
18800
- default: ["bg-secondary", "text-secondary-foreground", "shadow-control", "hover:bg-secondary-hover", "active:bg-secondary-active", "aria-pressed:bg-secondary-active"],
18801
- primary: ["bg-primary", "text-primary-foreground", "shadow-control", "hover:bg-primary-hover", "active:bg-primary-active", "aria-pressed:bg-primary-active"],
18802
- positive: ["bg-positive", "text-positive-foreground", "shadow-control", "hover:bg-positive-hover", "active:bg-positive-active", "aria-pressed:bg-positive-active"],
18803
- negative: ["bg-negative", "text-negative-foreground", "shadow-control", "hover:bg-negative-hover", "active:bg-negative-active", "aria-pressed:bg-negative-active"],
18804
- warning: ["bg-warning", "text-warning-foreground", "shadow-control", "hover:bg-warning-hover", "active:bg-warning-active", "aria-pressed:bg-warning-active"],
18805
- outline: ["border", "bg-background", "text-foreground", "shadow-none", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active", "aria-pressed:bg-secondary-active"],
18806
- transparent: ["bg-transparent", "text-foreground", "shadow-none", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active", "aria-pressed:bg-secondary-active"],
18807
- link: ["text-primary", "underline-offset-4", "hover:underline"]
18808
- };
18809
18885
  const sizes = {
18810
18886
  default: ["h-9", "px-4", "py-2", "has-[>svg]:px-3"],
18811
18887
  xs: inGroup ? ["h-6", "gap-1", "px-2", "[&>svg:not([class*='size-'])]:size-3.5", "has-[>svg]:px-2"] : ["h-6.5", "gap-1.5", "px-2.5", "has-[>svg]:px-2.5"],
@@ -18814,22 +18890,13 @@ function button_default(Alpine) {
18814
18890
  "icon-xs": inGroup ? ["size-6", "p-0", "has-[>svg]:p-0"] : ["size-6.5"],
18815
18891
  "icon-sm": inGroup ? ["size-8", "p-0", "has-[>svg]:p-0"] : ["size-8"],
18816
18892
  icon: ["size-9"],
18817
- "icon-lg": ["size-10"],
18818
- "icon-tab": [
18819
- "group-data-[orientation=horizontal]/tabs:aspect-square",
18820
- "group-data-[orientation=horizontal]/tabs:w-auto",
18821
- "group-data-[style=float]/tab-bar:group-data-[orientation=horizontal]/tabs:h-full",
18822
- "group-data-[style=inline]/tab-bar:group-data-[orientation=horizontal]/tabs:h-[80%]",
18823
- "group-data-[orientation=vertical]/tabs:h-9",
18824
- "group-data-[style=float]/tab-bar:group-data-[orientation=vertical]/tabs:w-full",
18825
- "group-data-[style=inline]/tab-bar:group-data-[orientation=vertical]/tabs:w-[80%]"
18826
- ]
18893
+ "icon-lg": ["size-10"]
18827
18894
  };
18828
18895
  function setVariant(variant) {
18829
- for (const [_, value] of Object.entries(variants)) {
18896
+ for (const [_, value] of Object.entries(buttonVariants)) {
18830
18897
  el.classList.remove(...value);
18831
18898
  }
18832
- if (variants.hasOwnProperty(variant)) el.classList.add(...variants[variant]);
18899
+ if (buttonVariants.hasOwnProperty(variant)) el.classList.add(...buttonVariants[variant]);
18833
18900
  }
18834
18901
  function setSize(size3) {
18835
18902
  if (sizes.hasOwnProperty(size3)) {
@@ -18895,10 +18962,6 @@ function button_default(Alpine) {
18895
18962
  }
18896
18963
  setVariant(el.getAttribute("data-orientation") ?? "horizontal");
18897
18964
  });
18898
- Alpine.directive("h-button-group-text", (el) => {
18899
- el.classList.add("bg-muted", "flex", "items-center", "gap-2", "rounded-control", "border", "px-4", "text-sm", "font-medium", "shadow-xs", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
18900
- el.setAttribute("data-slot", "button-group-text");
18901
- });
18902
18965
  Alpine.directive("h-button-group-separator", (el) => {
18903
18966
  el.classList.add("bg-foreground/20", "shrink-0", "[[data-orientation=vertical]_&]:h-px", "[[data-orientation=vertical]_&]:w-full", "h-auto", "w-px", "relative", "!m-0", "self-stretch");
18904
18967
  el.setAttribute("role", "none");
@@ -18906,9 +18969,6 @@ function button_default(Alpine) {
18906
18969
  });
18907
18970
  }
18908
18971
 
18909
- // src/components/calendar.js
18910
- var import_lucide2 = __toESM(require_lucide(), 1);
18911
-
18912
18972
  // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
18913
18973
  var min = Math.min;
18914
18974
  var max = Math.max;
@@ -20388,6 +20448,7 @@ var computePosition2 = (reference, floating, options) => {
20388
20448
  };
20389
20449
 
20390
20450
  // src/components/calendar.js
20451
+ var import_lucide2 = __toESM(require_lucide(), 1);
20391
20452
  function calendar_default(Alpine) {
20392
20453
  Alpine.directive("h-calendar", (el, { expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
20393
20454
  const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_datepicker"));
@@ -20411,7 +20472,7 @@ function calendar_default(Alpine) {
20411
20472
  let firstDay = 0;
20412
20473
  let minDate = void 0;
20413
20474
  let maxDate = void 0;
20414
- function modelChange() {
20475
+ function modelChange(triggerInput = false) {
20415
20476
  Alpine2.nextTick(() => {
20416
20477
  el.dispatchEvent(new CustomEvent("change", { detail: { date: selected } }));
20417
20478
  });
@@ -20424,23 +20485,27 @@ function calendar_default(Alpine) {
20424
20485
  }
20425
20486
  if (datepicker) {
20426
20487
  datepicker._datepicker.input.value = formatter.format(selected);
20488
+ datepicker._datepicker.input.setCustomValidity("");
20489
+ if (triggerInput) datepicker._datepicker.input.dispatchEvent(new Event("change", { bubbles: true }));
20427
20490
  } else {
20428
20491
  el.setAttribute("data-invalid", "false");
20429
20492
  }
20430
20493
  }
20431
- if (datepicker) {
20432
- datepicker._datepicker.input.addEventListener("change", () => {
20433
- selected = new Date(datepicker._datepicker.input.value);
20434
- if (isNaN(selected)) {
20435
- console.error(`h-calendar: input value is not a valid date - ${datepicker._datepicker.input.value}`);
20436
- datepicker._datepicker.input.setCustomValidity("Input value is not a valid date.");
20437
- return;
20438
- } else {
20439
- datepicker._datepicker.input.setCustomValidity("");
20440
- }
20494
+ const onInputChange = () => {
20495
+ const newValue = new Date(datepicker._datepicker.input.value);
20496
+ if (isNaN(newValue)) {
20497
+ console.error(`h-calendar: input value is not a valid date - ${datepicker._datepicker.input.value}`);
20498
+ datepicker._datepicker.input.setCustomValidity("Input value is not a valid date.");
20499
+ return;
20500
+ } else if (selected.getTime() !== newValue.getTime()) {
20501
+ selected = newValue;
20441
20502
  modelChange();
20442
20503
  render();
20443
- });
20504
+ }
20505
+ datepicker._datepicker.input.setCustomValidity("");
20506
+ };
20507
+ if (datepicker) {
20508
+ datepicker._datepicker.input.addEventListener("change", onInputChange);
20444
20509
  }
20445
20510
  function checkForModel() {
20446
20511
  if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
@@ -20458,7 +20523,7 @@ function calendar_default(Alpine) {
20458
20523
  if (event.target.getAttribute("aria-disabled") === "true") return;
20459
20524
  focusedDay = new Date(event.target.dataset.year, event.target.dataset.month, event.target.dataset.day);
20460
20525
  selected = new Date(focusedDay);
20461
- modelChange();
20526
+ modelChange(true);
20462
20527
  render();
20463
20528
  if (datepicker) datepicker._datepicker.expanded = false;
20464
20529
  }
@@ -20621,7 +20686,7 @@ function calendar_default(Alpine) {
20621
20686
  "align-middle",
20622
20687
  "text-center",
20623
20688
  "size-8",
20624
- "rounded-sm",
20689
+ "rounded-control",
20625
20690
  "outline-none",
20626
20691
  "hover:bg-secondary-hover",
20627
20692
  "hover:text-secondary-foreground",
@@ -20837,6 +20902,9 @@ function calendar_default(Alpine) {
20837
20902
  for (let d = 0; d < dayCells.length; d++) {
20838
20903
  dayCells[d].removeEventListener("click", dayClick);
20839
20904
  }
20905
+ if (datepicker) {
20906
+ datepicker._datepicker.input.removeEventListener("change", onInputChange);
20907
+ }
20840
20908
  });
20841
20909
  });
20842
20910
  }
@@ -20844,7 +20912,7 @@ function calendar_default(Alpine) {
20844
20912
  // src/components/card.js
20845
20913
  function card_default(Alpine) {
20846
20914
  Alpine.directive("h-card", (el) => {
20847
- el.classList.add("bg-card", "text-card-foreground", "vbox", "gap-6", "rounded-xl", "border", "py-6", "shadow-sm");
20915
+ el.classList.add("bg-card", "text-card-foreground", "vbox", "gap-4", "rounded-xl", "border", "py-6", "shadow-sm");
20848
20916
  el.setAttribute("data-slot", "card");
20849
20917
  });
20850
20918
  Alpine.directive("h-card-header", (el) => {
@@ -20875,56 +20943,58 @@ function card_default(Alpine) {
20875
20943
 
20876
20944
  // src/components/checkbox.js
20877
20945
  function checkbox_default(Alpine) {
20878
- Alpine.directive("h-checkbox", (el, {}, { cleanup }) => {
20946
+ Alpine.directive("h-checkbox", (el) => {
20879
20947
  el.classList.add(
20880
- "appearance-none",
20881
- "border-input",
20882
- "bg-input-inner",
20883
- "data-[state=checked]:bg-primary",
20884
- "data-[state=checked]:text-primary-foreground",
20885
- "data-[state=checked]:border-primary",
20886
- "focus-visible:border-ring",
20887
- "focus-visible:ring-ring/50",
20888
- "aria-invalid:ring-negative/20",
20889
- "dark:aria-invalid:ring-negative/40",
20890
- "aria-invalid:border-negative",
20891
- "invalid:ring-negative/20",
20892
- "dark:invalid:ring-negative/40",
20893
- "invalid:border-negative",
20894
- "size-4",
20895
- "shrink-0",
20896
- "rounded-[4px]",
20897
- "border",
20898
- "shadow-control",
20899
- "transition-all",
20900
- "outline-none",
20901
- "focus-visible:ring-[3px]",
20902
- "disabled:cursor-not-allowed",
20903
- "disabled:opacity-50",
20904
- "overflow-hidden",
20905
- "before:block",
20948
+ "[&>input]:absolute",
20949
+ "[&>input]:appearance-none",
20950
+ "[&>input]:bg-transparent",
20951
+ "[&>input]:border-0",
20952
+ "[&>input]:cursor-pointer",
20953
+ "[&>input]:focus-visible:border-ring",
20954
+ "[&>input]:focus-visible:ring-[3px]",
20955
+ "[&>input]:focus-visible:ring-ring/50",
20956
+ "[&>input]:left-0",
20957
+ "[&>input]:outline-none",
20958
+ "[&>input]:rounded-[0.25rem]",
20959
+ "[&>input]:size-full",
20960
+ "[&>input]:top-0",
20961
+ "aspect-square",
20906
20962
  "before:bg-transparent",
20907
- "before:border-l-2",
20963
+ "before:block",
20908
20964
  "before:border-b-2",
20965
+ "before:border-l-2",
20909
20966
  "before:border-primary-foreground",
20967
+ "before:h-2",
20968
+ "before:invisible",
20910
20969
  "before:pointer-events-none",
20911
- "before:w-2.5",
20912
- "before:h-1.5",
20913
- "before:rounded-[0.125rem]",
20914
20970
  "before:-rotate-45",
20915
20971
  "before:translate-x-0.5",
20916
20972
  "before:translate-y-0.75",
20917
- "data-[state=unchecked]:before:hidden"
20973
+ "before:w-3.5",
20974
+ "bg-input-inner",
20975
+ "border",
20976
+ "border-input",
20977
+ "dark:has-[aria-invalid=true]:ring-negative/40",
20978
+ "dark:has-[input:invalid]:ring-negative/40",
20979
+ "duration-200",
20980
+ "has-[aria-invalid=true]:border-negative",
20981
+ "has-[aria-invalid=true]:ring-negative/20",
20982
+ "has-[input:checked]:before:visible",
20983
+ "has-[input:checked]:bg-primary",
20984
+ "has-[input:checked]:border-primary",
20985
+ "has-[input:disabled]:cursor-not-allowed",
20986
+ "has-[input:disabled]:opacity-50",
20987
+ "has-[input:invalid]:border-negative",
20988
+ "has-[input:invalid]:ring-negative/20",
20989
+ "relative",
20990
+ "rounded-[0.25rem]",
20991
+ "shadow-control",
20992
+ "shrink-0",
20993
+ "size-5",
20994
+ "transition-color"
20918
20995
  );
20996
+ el.setAttribute("tabindex", "-1");
20919
20997
  el.setAttribute("data-slot", "checkbox");
20920
- function setState() {
20921
- el.setAttribute("data-state", el.checked ? "checked" : "unchecked");
20922
- }
20923
- setState();
20924
- el.addEventListener("change", setState);
20925
- cleanup(() => {
20926
- el.removeEventListener("change", setState);
20927
- });
20928
20998
  });
20929
20999
  }
20930
21000
 
@@ -21009,6 +21079,7 @@ function datepicker_default(Alpine) {
21009
21079
  "border",
21010
21080
  "shadow-control",
21011
21081
  "transition-[color,box-shadow]",
21082
+ "duration-200",
21012
21083
  "outline-none",
21013
21084
  "h-9",
21014
21085
  "pl-3",
@@ -21130,7 +21201,7 @@ function dialog_default(Alpine) {
21130
21201
  "rounded-lg",
21131
21202
  "border",
21132
21203
  "p-4",
21133
- "shadow-lg",
21204
+ "shadow-xl",
21134
21205
  "sm:max-w-lg"
21135
21206
  );
21136
21207
  el.setAttribute("role", "dialog");
@@ -21288,7 +21359,7 @@ function info_page_default(Alpine) {
21288
21359
  el.setAttribute("data-slot", "info-page-header");
21289
21360
  });
21290
21361
  Alpine.directive("h-info-page-media", (el, { modifiers }) => {
21291
- el.classList.add("hbox", "shrink-0", "items-center", "justify-center", "mb-2", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0");
21362
+ el.classList.add("hbox", "shrink-0", "items-center", "justify-center", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0");
21292
21363
  if (modifiers.includes("icon")) el.classList.add("bg-muted", "text-foreground", "size-10", "shrink-0", "items-center", "justify-center", "rounded-lg", "[&_svg:not([class*='size-'])]:size-6");
21293
21364
  else el.classList.add("bg-transparent");
21294
21365
  el.setAttribute("data-slot", "info-page-media");
@@ -21481,6 +21552,156 @@ function label_default(Alpine) {
21481
21552
  });
21482
21553
  }
21483
21554
 
21555
+ // src/components/list.js
21556
+ function list_default(Alpine) {
21557
+ Alpine.directive("h-listbox", (el, {}, { cleanup }) => {
21558
+ el.classList.add(
21559
+ "divide-solid",
21560
+ "divide-y",
21561
+ "bg-input-inner",
21562
+ "border-input",
21563
+ "border",
21564
+ "rounded-control",
21565
+ "shadow-control",
21566
+ "outline-none",
21567
+ "disabled:pointer-events-none",
21568
+ "disabled:cursor-not-allowed",
21569
+ "disabled:opacity-50",
21570
+ "focus-visible:border-ring",
21571
+ "focus-visible:ring-ring/50",
21572
+ "focus-visible:ring-[3px]",
21573
+ "aria-invalid:ring-negative/20",
21574
+ "dark:aria-invalid:ring-negative/40",
21575
+ "aria-invalid:border-negative",
21576
+ "invalid:ring-negative/20",
21577
+ "dark:invalid:ring-negative/40",
21578
+ "invalid:border-negative",
21579
+ "[&>ul:first-child>*:first-child]:rounded-t-control",
21580
+ "[&>ul:last-child>*:last-child]:rounded-b-control"
21581
+ );
21582
+ el.setAttribute("data-slot", "listbox");
21583
+ el.setAttribute("role", "listbox");
21584
+ function focusFirstOption(elem) {
21585
+ const firstOption = elem.querySelector('[role="option"]');
21586
+ if (firstOption) firstOption.focus();
21587
+ }
21588
+ function focusLastOption(elem) {
21589
+ const itemList = elem.querySelectorAll('[role="option"]');
21590
+ if (itemList.length) {
21591
+ itemList[itemList.length - 1].focus();
21592
+ }
21593
+ }
21594
+ function selectOption(option) {
21595
+ const selected = el.querySelector('[aria-selected="true"]');
21596
+ if (selected) selected.removeAttribute("aria-selected");
21597
+ if (selected !== option) option.setAttribute("aria-selected", "true");
21598
+ }
21599
+ function onKeyDown(event) {
21600
+ switch (event.key) {
21601
+ case "PageUp":
21602
+ case "PageDown":
21603
+ event.preventDefault();
21604
+ break;
21605
+ case "Home":
21606
+ focusFirstOption(el);
21607
+ break;
21608
+ case "End":
21609
+ focusLastOption(el);
21610
+ break;
21611
+ case "ArrowUp":
21612
+ let prevElem = event.target.previousElementSibling;
21613
+ if (prevElem && prevElem.getAttribute("data-slot") !== "list-header") {
21614
+ prevElem.focus();
21615
+ } else {
21616
+ prevElem = event.target.parentElement.previousElementSibling;
21617
+ if (prevElem && prevElem.tagName === "UL") {
21618
+ focusLastOption(prevElem);
21619
+ }
21620
+ }
21621
+ break;
21622
+ case "ArrowDown":
21623
+ let nextElem = event.target.nextElementSibling;
21624
+ if (nextElem) {
21625
+ nextElem.focus();
21626
+ } else {
21627
+ nextElem = event.target.parentElement.nextElementSibling;
21628
+ if (nextElem && nextElem.tagName === "UL") {
21629
+ focusFirstOption(nextElem);
21630
+ }
21631
+ }
21632
+ break;
21633
+ case " ":
21634
+ case "Enter":
21635
+ selectOption(event.target);
21636
+ break;
21637
+ default:
21638
+ break;
21639
+ }
21640
+ }
21641
+ function onClick(event) {
21642
+ if (event.target.getAttribute("data-slot") === "list-item") selectOption(event.target);
21643
+ }
21644
+ el.addEventListener("click", onClick);
21645
+ el.addEventListener("keydown", onKeyDown);
21646
+ cleanup(() => {
21647
+ el.removeEventListener("keydown", onKeyDown);
21648
+ el.removeEventListener("click", onClick);
21649
+ });
21650
+ });
21651
+ Alpine.directive("h-list", (el) => {
21652
+ el.classList.add("divide-solid", "divide-y");
21653
+ el.setAttribute("data-slot", "list");
21654
+ el.setAttribute("role", "group");
21655
+ });
21656
+ Alpine.directive("h-list-header", (el, {}, { Alpine: Alpine2 }) => {
21657
+ el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
21658
+ el.setAttribute("role", "presentation");
21659
+ el.setAttribute("data-slot", "list-header");
21660
+ const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
21661
+ if (!list) {
21662
+ throw new Error("h-list-header: must be placed inside an h-list element");
21663
+ }
21664
+ if (el.hasAttribute("id")) {
21665
+ list.setAttribute("aria-labelledby", el.getAttribute("id"));
21666
+ } else {
21667
+ const id = `lbh${v4_default()}`;
21668
+ el.setAttribute("id", id);
21669
+ list.setAttribute("aria-labelledby", id);
21670
+ }
21671
+ });
21672
+ Alpine.directive("h-list-item", (el, { modifiers }) => {
21673
+ el.classList.add("min-h-11", "flex", "items-center", "p-2", "gap-2", "align-middle", "outline-none");
21674
+ el.setAttribute("data-slot", "list-item");
21675
+ const listbox = Alpine.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "listbox");
21676
+ function setInteractive() {
21677
+ el.classList.add(
21678
+ "focus:bg-table-hover",
21679
+ "focus:text-table-hover-foreground",
21680
+ "hover:bg-table-hover",
21681
+ "hover:text-table-hover-foreground",
21682
+ "active:bg-table-active",
21683
+ "active:text-table-active-foreground",
21684
+ "aria-selected:bg-primary",
21685
+ "aria-selected:text-primary-foreground",
21686
+ "[&[aria-selected=true]:hover]:bg-primary-hover",
21687
+ "[&[aria-selected=true]:hover]:text-primary-hover-foreground",
21688
+ "[&[aria-selected=true]:focus]:bg-primary-hover",
21689
+ "[&[aria-selected=true]:focus]:text-primary-hover-foreground"
21690
+ );
21691
+ el.setAttribute("tabindex", "0");
21692
+ }
21693
+ if (listbox) {
21694
+ setInteractive();
21695
+ el.setAttribute("role", "option");
21696
+ el.setAttribute("tabindex", "0");
21697
+ } else if (modifiers.includes("interactive")) {
21698
+ setInteractive();
21699
+ } else {
21700
+ el.setAttribute("tabindex", "-1");
21701
+ }
21702
+ });
21703
+ }
21704
+
21484
21705
  // src/components/menu.js
21485
21706
  function menu_default(Alpine) {
21486
21707
  Alpine.directive("h-menu-trigger", (el, { modifiers }) => {
@@ -21497,11 +21718,18 @@ function menu_default(Alpine) {
21497
21718
  if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
21498
21719
  throw new Error('h-menu: must have an "aria-label" or "aria-labelledby" attribute');
21499
21720
  }
21500
- const menuTrigger = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_menu_trigger"));
21501
- if (!menuTrigger) {
21502
- throw new Error("h-menu: menu must be inside an h-menu-trigger");
21721
+ const isSubmenu = modifiers.includes("sub");
21722
+ const menuTrigger = (() => {
21723
+ if (isSubmenu) return;
21724
+ let sibling = el.previousElementSibling;
21725
+ while (sibling && !sibling.hasOwnProperty("_menu_trigger")) {
21726
+ sibling = sibling.previousElementSibling;
21727
+ }
21728
+ return sibling;
21729
+ })();
21730
+ if (!isSubmenu && !menuTrigger) {
21731
+ throw new Error("h-menu: menu must be placed after an h-menu-trigger element");
21503
21732
  }
21504
- let isSubmenu = modifiers.includes("sub");
21505
21733
  let menuSubItem;
21506
21734
  if (isSubmenu) menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
21507
21735
  function listenForTrigger(listen) {
@@ -21560,12 +21788,17 @@ function menu_default(Alpine) {
21560
21788
  switch (event.key) {
21561
21789
  case "Left":
21562
21790
  case "ArrowLeft":
21791
+ if (isSubmenu) {
21792
+ Alpine2.nextTick(() => menuSubItem.focus());
21793
+ close();
21794
+ }
21795
+ break;
21563
21796
  case "Esc":
21564
21797
  case "Escape":
21565
- close();
21566
21798
  if (isSubmenu) {
21567
- setTimeout(() => menuSubItem.focus(), 0);
21799
+ Alpine2.nextTick(() => menuSubItem.focus());
21568
21800
  }
21801
+ close();
21569
21802
  break;
21570
21803
  case "Tab":
21571
21804
  case " ":
@@ -21657,16 +21890,19 @@ function menu_default(Alpine) {
21657
21890
  })
21658
21891
  ]
21659
21892
  }).then(({ x, y }) => {
21893
+ if (!isSubmenu) {
21894
+ Alpine2.nextTick(() => el.focus());
21895
+ listenForTrigger(false);
21896
+ }
21897
+ Alpine2.nextTick(() => {
21898
+ top.addEventListener("contextmenu", onClick);
21899
+ top.addEventListener("click", onClick);
21900
+ el.addEventListener("keydown", onKeydown);
21901
+ });
21660
21902
  Object.assign(el.style, {
21661
21903
  left: `${x}px`,
21662
21904
  top: `${y}px`
21663
21905
  });
21664
- if (!isSubmenu) Alpine2.nextTick(() => el.focus());
21665
- setTimeout(() => {
21666
- top.addEventListener("contextmenu", onClick);
21667
- top.addEventListener("click", onClick);
21668
- el.addEventListener("keydown", onKeydown);
21669
- }, 0);
21670
21906
  });
21671
21907
  }
21672
21908
  }
@@ -21920,27 +22156,19 @@ function menu_default(Alpine) {
21920
22156
  el.setAttribute("role", "menuitemcheckbox");
21921
22157
  el.setAttribute("data-slot", "menu-checkbox-item");
21922
22158
  function setState(checked, dispatch = true) {
21923
- el.setAttribute("aria-checked", checked);
21924
22159
  if (dispatch)
21925
- setTimeout(() => {
22160
+ Alpine2.nextTick(() => {
21926
22161
  el.dispatchEvent(new Event("change", { bubbles: true }));
21927
- }, 0);
22162
+ });
22163
+ el.setAttribute("aria-checked", checked);
21928
22164
  }
21929
22165
  if (el.hasOwnProperty("_x_model")) {
21930
- let handler2 = function(event) {
21931
- if (event.type === "keydown") {
21932
- if (event.key !== " " && event.key !== "Enter") {
21933
- return;
21934
- } else if (event.key === " ") {
21935
- event.preventDefault();
21936
- }
21937
- }
22166
+ let handler2 = function() {
21938
22167
  el._x_model.set(!el._x_model.get());
21939
22168
  setState(el._x_model.get());
21940
22169
  };
21941
22170
  setState(el._x_model.get(), false);
21942
22171
  el.addEventListener("click", handler2);
21943
- el.addEventListener("keydown", handler2);
21944
22172
  }
21945
22173
  const menu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
21946
22174
  function focusOut(event) {
@@ -22146,14 +22374,13 @@ function pagination_default(Alpine) {
22146
22374
 
22147
22375
  // src/components/popover.js
22148
22376
  function popover_default(Alpine) {
22149
- Alpine.directive("h-popover", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2 }) => {
22377
+ Alpine.directive("h-popover-trigger", (el, { expression, modifiers }, { effect, evaluate: evaluate2, evaluateLater, Alpine: Alpine2, cleanup }) => {
22150
22378
  el._popover = Alpine2.reactive({
22151
22379
  id: void 0,
22152
22380
  controls: `hpc${v4_default()}`,
22153
- auto: modifiers.includes("auto"),
22381
+ auto: expression ? false : true,
22154
22382
  expanded: expression ? evaluate2(expression) : false
22155
22383
  });
22156
- el.setAttribute("data-slot", "popover");
22157
22384
  if (expression) {
22158
22385
  const getExpanded = evaluateLater(expression);
22159
22386
  effect(() => {
@@ -22162,43 +22389,39 @@ function popover_default(Alpine) {
22162
22389
  });
22163
22390
  });
22164
22391
  }
22165
- });
22166
- Alpine.directive("h-popover-trigger", (el, { modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
22167
- const popover = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_popover"));
22168
- if (!popover) {
22169
- throw new Error("h-popover-trigger must be inside an h-popover element");
22170
- }
22171
22392
  el.setAttribute("type", "button");
22172
22393
  if (modifiers.includes("chevron")) {
22173
22394
  el.classList.add("[&_svg]:transition-transform", "[&[data-state=open]>svg:not(:first-child):last-child]:rotate-180");
22174
22395
  }
22175
22396
  if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "popover-trigger");
22176
22397
  if (el.hasAttribute("id")) {
22177
- popover._popover.id = el.getAttribute("id");
22398
+ el._popover.id = el.getAttribute("id");
22178
22399
  } else {
22179
- popover._popover.id = `hp${v4_default()}`;
22180
- el.setAttribute("id", popover._popover.id);
22400
+ el._popover.id = `hp${v4_default()}`;
22401
+ el.setAttribute("id", el._popover.id);
22181
22402
  }
22182
- el.setAttribute("aria-controls", popover._popover.controls);
22403
+ el.setAttribute("aria-controls", el._popover.controls);
22183
22404
  el.setAttribute("aria-haspopup", "dialog");
22184
22405
  const setAttributes = () => {
22185
- el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
22186
- el.setAttribute("aria-expanded", popover._popover.expanded);
22406
+ el.setAttribute("data-state", el._popover.expanded ? "open" : "closed");
22407
+ el.setAttribute("aria-expanded", el._popover.expanded);
22187
22408
  };
22188
22409
  const close = () => {
22189
- popover._popover.expanded = false;
22410
+ el._popover.expanded = false;
22411
+ el.addEventListener("click", handler2);
22190
22412
  };
22191
22413
  const handler2 = () => {
22192
- popover._popover.expanded = !popover._popover.expanded;
22414
+ el._popover.expanded = !el._popover.expanded;
22193
22415
  setAttributes();
22194
22416
  Alpine2.nextTick(() => {
22195
- if (popover._popover.auto && popover._popover.expanded) {
22417
+ if (el._popover.auto && el._popover.expanded) {
22196
22418
  top.addEventListener("click", close, { once: true });
22419
+ el.removeEventListener("click", handler2);
22197
22420
  }
22198
22421
  });
22199
22422
  };
22200
22423
  setAttributes();
22201
- if (popover._popover.auto) {
22424
+ if (el._popover.auto) {
22202
22425
  el.addEventListener("click", handler2);
22203
22426
  cleanup(() => {
22204
22427
  el.removeEventListener("click", handler2);
@@ -22210,13 +22433,19 @@ function popover_default(Alpine) {
22210
22433
  });
22211
22434
  }
22212
22435
  });
22213
- Alpine.directive("h-popover-content", (el, { modifiers }, { effect, Alpine: Alpine2 }) => {
22214
- const popover = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_popover"));
22436
+ Alpine.directive("h-popover", (el, { modifiers }, { effect }) => {
22437
+ const popover = (() => {
22438
+ let sibling = el.previousElementSibling;
22439
+ while (sibling && !sibling.hasOwnProperty("_popover")) {
22440
+ sibling = sibling.previousElementSibling;
22441
+ }
22442
+ return sibling;
22443
+ })();
22215
22444
  if (!popover) {
22216
- throw new Error("h-popover-content must be inside an h-popover element");
22445
+ throw new Error("h-popover-content must be placed after an h-popover element");
22217
22446
  }
22218
- el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "top-0", "left-0", "z-50", "min-w-[1rem]", "rounded-control", "border", "shadow-md", "outline-hidden", "overflow-scroll");
22219
- el.setAttribute("data-slot", "popover-content");
22447
+ el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=closed]:hidden", "top-0", "left-0", "z-50", "min-w-[1rem]", "rounded-md", "border", "shadow-md", "outline-hidden", "overflow-scroll");
22448
+ el.setAttribute("data-slot", "popover");
22220
22449
  el.setAttribute("role", "dialog");
22221
22450
  el.setAttribute("tabindex", "-1");
22222
22451
  el.setAttribute("id", popover._popover.controls);
@@ -22227,13 +22456,9 @@ function popover_default(Alpine) {
22227
22456
  el.classList.remove("overflow-scroll");
22228
22457
  el.classList.add("overflow-none");
22229
22458
  }
22230
- const control = popover.querySelector(`#${popover._popover.id}`);
22231
- if (!control) {
22232
- throw new Error("h-popover-content: trigger not found");
22233
- }
22234
22459
  let autoUpdateCleanup;
22235
22460
  function updatePosition() {
22236
- computePosition2(control, el, {
22461
+ computePosition2(popover, el, {
22237
22462
  placement: el.getAttribute("data-align") || "bottom-start",
22238
22463
  middleware: [
22239
22464
  offset2(4),
@@ -22258,7 +22483,7 @@ function popover_default(Alpine) {
22258
22483
  effect(() => {
22259
22484
  el.setAttribute("data-state", popover._popover.expanded ? "open" : "closed");
22260
22485
  if (popover._popover.expanded) {
22261
- autoUpdateCleanup = autoUpdate(control, el, updatePosition);
22486
+ autoUpdateCleanup = autoUpdate(popover, el, updatePosition);
22262
22487
  } else {
22263
22488
  if (autoUpdateCleanup) autoUpdateCleanup();
22264
22489
  Object.assign(el.style, {
@@ -22297,40 +22522,48 @@ function progress_default(Alpine) {
22297
22522
  function radio_default(Alpine) {
22298
22523
  Alpine.directive("h-radio", (el) => {
22299
22524
  el.classList.add(
22300
- "appearance-none",
22301
- "border-input",
22302
- "bg-input-inner",
22303
- "text-primary",
22304
- "focus-visible:border-ring",
22305
- "focus-visible:ring-ring/50",
22306
- "aria-invalid:ring-negative/20",
22307
- "dark:aria-invalid:ring-negative/40",
22308
- "aria-invalid:border-negative",
22309
- "invalid:ring-negative/20",
22310
- "dark:invalid:ring-negative/40",
22311
- "invalid:border-negative",
22525
+ "[&>input]:absolute",
22526
+ "[&>input]:appearance-none",
22527
+ "[&>input]:bg-transparent",
22528
+ "[&>input]:border-0",
22529
+ "[&>input]:cursor-pointer",
22530
+ "[&>input]:focus-visible:border-ring",
22531
+ "[&>input]:focus-visible:ring-[3px]",
22532
+ "[&>input]:focus-visible:ring-ring/50",
22533
+ "[&>input]:left-0",
22534
+ "[&>input]:outline-none",
22535
+ "[&>input]:rounded-full",
22536
+ "[&>input]:size-full",
22537
+ "[&>input]:top-0",
22312
22538
  "aspect-square",
22313
- "size-4",
22314
- "shrink-0",
22315
- "rounded-full",
22316
- "border",
22317
- "shadow-control",
22318
- "transition-color",
22319
- "duration-200",
22320
- "outline-none",
22321
- "focus-visible:ring-[3px]",
22322
- "disabled:cursor-not-allowed",
22323
- "disabled:opacity-50",
22324
- "before:block",
22325
22539
  "before:bg-clip-padding",
22326
- "before:rounded-full",
22327
- "before:h-full",
22328
- "before:w-full",
22329
22540
  "before:bg-primary",
22330
- "before:border-input-inner",
22541
+ "before:block",
22331
22542
  "before:border-3",
22332
- "not-checked:before:hidden"
22543
+ "before:border-transparent",
22544
+ "before:invisible",
22545
+ "before:pointer-events-none",
22546
+ "before:rounded-full",
22547
+ "before:size-full",
22548
+ "bg-input-inner",
22549
+ "border",
22550
+ "border-input",
22551
+ "dark:has-[aria-invalid=true]:ring-negative/40",
22552
+ "dark:has-[input:invalid]:ring-negative/40",
22553
+ "has-[aria-invalid=true]:border-negative",
22554
+ "has-[aria-invalid=true]:ring-negative/20",
22555
+ "has-[input:checked]:before:visible",
22556
+ "has-[input:disabled]:cursor-not-allowed",
22557
+ "has-[input:disabled]:opacity-50",
22558
+ "has-[input:invalid]:border-negative",
22559
+ "has-[input:invalid]:ring-negative/20",
22560
+ "relative",
22561
+ "rounded-full",
22562
+ "shadow-control",
22563
+ "shrink-0",
22564
+ "size-5"
22333
22565
  );
22566
+ el.setAttribute("tabindex", "-1");
22334
22567
  el.setAttribute("data-slot", "radio");
22335
22568
  });
22336
22569
  }
@@ -22852,21 +23085,40 @@ function separator_default(Alpine) {
22852
23085
 
22853
23086
  // src/components/sidebar.js
22854
23087
  function sidebar_default(Alpine) {
22855
- Alpine.directive("h-sidebar", (el, { modifiers }) => {
22856
- el.classList.add("group/sidebar", "bg-sidebar", "text-sidebar-foreground", "border-sidebar-border", "vbox", "h-full", "w-(--sidebar-width,16rem)");
22857
- if (modifiers.includes("floating")) {
22858
- el.classList.add("border", "rounded-lg", "shadow-sm", "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]");
22859
- } else el.classList.add("group-data-[collapsible=icon]:w-(--sidebar-width-icon)");
23088
+ Alpine.directive("h-sidebar", (el, { modifiers }, { cleanup }) => {
23089
+ el.classList.add("group/sidebar", "bg-sidebar", "text-sidebar-foreground", "border-sidebar-border", "vbox", "h-full", "w-(--sidebar-width,16rem)", "data-[collapsed=true]:w-min");
22860
23090
  if (modifiers.includes("right")) el.classList.add("border-l");
22861
23091
  else el.classList.add("border-r");
22862
23092
  el.setAttribute("data-slot", "sidebar");
23093
+ const setFloating = () => {
23094
+ if (el.getAttribute("data-floating") === "true") {
23095
+ el.classList.add("border", "rounded-lg", "shadow-sm");
23096
+ } else {
23097
+ el.classList.remove("border", "rounded-lg", "shadow-sm");
23098
+ }
23099
+ };
23100
+ setFloating();
23101
+ const observer = new MutationObserver((mutations) => {
23102
+ mutations.forEach((mutation) => {
23103
+ if (mutation.type === "attributes") {
23104
+ if (mutation.attributeName === "data-floating") {
23105
+ setFloating();
23106
+ }
23107
+ }
23108
+ });
23109
+ });
23110
+ observer.observe(el, { attributes: true });
23111
+ cleanup(() => {
23112
+ observer.disconnect();
23113
+ });
22863
23114
  });
22864
23115
  Alpine.directive("h-sidebar-header", (el) => {
22865
- el.classList.add("vbox", "gap-2", "p-2");
23116
+ el.classList.add("vbox", "gap-2", "px-2", "h-12", "justify-center", "border-b");
23117
+ if (el.dataset.borderless && el.dataset.borderless === "true") el.classList.remove("border-b");
22866
23118
  el.setAttribute("data-slot", "sidebar-header");
22867
23119
  });
22868
23120
  Alpine.directive("h-sidebar-content", (el) => {
22869
- el.classList.add("vbox", "min-h-0", "flex-1", "gap-2", "overflow-auto", "group-data-[collapsible=icon]:overflow-hidden");
23121
+ el.classList.add("vbox", "min-h-0", "flex-1", "gap-2", "overflow-auto", "group-data-[collapsed=true]/sidebar:overflow-hidden");
22870
23122
  el.setAttribute("data-slot", "sidebar-content");
22871
23123
  });
22872
23124
  Alpine.directive("h-sidebar-group", (el) => {
@@ -22892,8 +23144,7 @@ function sidebar_default(Alpine) {
22892
23144
  "focus-visible:ring-2",
22893
23145
  "[&>svg]:size-4",
22894
23146
  "[&>svg]:shrink-0",
22895
- "group-data-[collapsible=icon]:-mt-8",
22896
- "group-data-[collapsible=icon]:opacity-0"
23147
+ "group-data-[collapsed=true]/sidebar:!hidden"
22897
23148
  );
22898
23149
  if (modifiers.includes("action")) el.classList.add("hover:bg-secondary-hover", "active:bg-secondary-active");
22899
23150
  el.setAttribute("data-slot", "sidebar-group-label");
@@ -22922,7 +23173,7 @@ function sidebar_default(Alpine) {
22922
23173
  "after:absolute",
22923
23174
  "after:-inset-2",
22924
23175
  "md:after:hidden",
22925
- "group-data-[collapsible=icon]:hidden"
23176
+ "group-data-[collapsed=true]/sidebar:hidden"
22926
23177
  );
22927
23178
  el.setAttribute("data-slot", "sidebar-group-action");
22928
23179
  });
@@ -22969,8 +23220,9 @@ function sidebar_default(Alpine) {
22969
23220
  "data-[active=true]:text-sidebar-primary-foreground",
22970
23221
  "data-[state=open]:hover:bg-sidebar-secondary",
22971
23222
  "data-[state=open]:hover:text-sidebar-secondary-foreground",
22972
- "group-data-[collapsible=icon]:size-8!",
22973
- "group-data-[collapsible=icon]:p-2!",
23223
+ "group-data-[collapsed=true]/sidebar:!size-8",
23224
+ "group-data-[collapsed=true]/sidebar:!p-2",
23225
+ "group-data-[collapsed=true]/sidebar:[&>*:not(svg:first-child):not([data-slot=menu])]:!hidden",
22974
23226
  "[&>span]:truncate",
22975
23227
  "[&>span]:align-middle",
22976
23228
  "[&>svg]:size-4",
@@ -22981,7 +23233,7 @@ function sidebar_default(Alpine) {
22981
23233
  const sizes = {
22982
23234
  default: ["h-8", "text-sm"],
22983
23235
  sm: ["h-7", "text-xs"],
22984
- lg: ["h-12", "text-sm", "group-data-[collapsible=icon]:p-0!"]
23236
+ lg: ["h-12", "text-sm", "group-data-[collapsed=true]/sidebar:p-0!"]
22985
23237
  };
22986
23238
  function setSize(size3) {
22987
23239
  if (sizes.hasOwnProperty(size3)) {
@@ -23019,7 +23271,7 @@ function sidebar_default(Alpine) {
23019
23271
  "peer-data-[size=sm]/menu-button:top-1",
23020
23272
  "peer-data-[size=default]/menu-button:top-1.5",
23021
23273
  "peer-data-[size=lg]/menu-button:top-2.5",
23022
- "group-data-[collapsible=icon]:hidden"
23274
+ "group-data-[collapsed=true]/sidebar:hidden"
23023
23275
  );
23024
23276
  if (modifiers.includes("autohide")) {
23025
23277
  el.classList.add("peer-data-[active=true]/menu-button:text-sidebar-secondary-foreground", "group-focus-within/menu-item:opacity-100", "group-hover/menu-item:opacity-100", "data-[state=open]:opacity-100", "md:opacity-0");
@@ -23048,7 +23300,7 @@ function sidebar_default(Alpine) {
23048
23300
  "peer-data-[size=sm]/menu-button:top-1",
23049
23301
  "peer-data-[size=default]/menu-button:top-1.5",
23050
23302
  "peer-data-[size=lg]/menu-button:top-2.5",
23051
- "group-data-[collapsible=icon]:hidden"
23303
+ "group-data-[collapsed=true]/sidebar:hidden"
23052
23304
  );
23053
23305
  el.setAttribute("data-slot", "sidebar-menu-badge");
23054
23306
  });
@@ -23071,7 +23323,7 @@ function sidebar_default(Alpine) {
23071
23323
  el.setAttribute("role", "none");
23072
23324
  });
23073
23325
  Alpine.directive("h-sidebar-menu-sub", (el, { modifiers }) => {
23074
- el.classList.add("vbox", "min-w-0", "translate-x-px", "gap-1", "py-0.5", "group-data-[collapsible=icon]:hidden");
23326
+ el.classList.add("vbox", "min-w-0", "translate-x-px", "gap-1", "py-0.5", "group-data-[collapsed=true]/sidebar:hidden");
23075
23327
  if (!modifiers.includes("flat")) {
23076
23328
  el.classList.add("border-sidebar-border", "mx-3.5", "border-l", "px-2.5");
23077
23329
  }
@@ -23114,7 +23366,7 @@ function sidebar_default(Alpine) {
23114
23366
  "[&>svg:not(:first-child):last-child]:ml-auto",
23115
23367
  "data-[active=true]:bg-sidebar-primary",
23116
23368
  "data-[active=true]:text-sidebar-primary-foreground",
23117
- "group-data-[collapsible=icon]:hidden"
23369
+ "group-data-[collapsed=true]/sidebar:hidden"
23118
23370
  );
23119
23371
  el.setAttribute("data-slot", "sidebar-menu-sub-button");
23120
23372
  const sizes = {
@@ -23130,7 +23382,8 @@ function sidebar_default(Alpine) {
23130
23382
  setSize(el.getAttribute("data-size"));
23131
23383
  });
23132
23384
  Alpine.directive("h-sidebar-footer", (el) => {
23133
- el.classList.add("vbox", "gap-2", "p-2");
23385
+ el.classList.add("vbox", "gap-2", "px-2", "h-12", "justify-center", "border-t");
23386
+ if (el.dataset.borderless && el.dataset.borderless === "true") el.classList.remove("border-t");
23134
23387
  el.setAttribute("data-slot", "sidebar-footer");
23135
23388
  });
23136
23389
  }
@@ -23142,7 +23395,7 @@ function skeleton_default(Alpine) {
23142
23395
  if (modifiers.includes("control")) {
23143
23396
  el.classList.add("rounded-control");
23144
23397
  } else if (modifiers.includes("card")) {
23145
- el.classList.add("rounded-xl");
23398
+ el.classList.add("rounded-lg");
23146
23399
  } else if (modifiers.includes("avatar")) {
23147
23400
  el.classList.add("rounded-full", "size-8");
23148
23401
  } else el.classList.add("rounded-md");
@@ -23162,52 +23415,53 @@ function spinner_default(Alpine) {
23162
23415
 
23163
23416
  // src/components/switch.js
23164
23417
  function switch_default(Alpine) {
23165
- Alpine.directive("h-switch", (el, {}, { cleanup }) => {
23418
+ Alpine.directive("h-switch", (el) => {
23166
23419
  el.classList.add(
23167
- "appearance-none",
23168
- "peer",
23169
- "data-[state=checked]:bg-primary",
23170
- "data-[state=unchecked]:bg-input",
23171
- "focus-visible:border-ring",
23172
- "focus-visible:ring-ring/50",
23173
- "inline-flex",
23174
- "data-[size=sm]:h-5",
23175
- "data-[size=sm]:w-8",
23176
- "h-6",
23177
- "w-10",
23178
- "shrink-0",
23179
- "items-center",
23180
- "rounded-full",
23181
- "border",
23182
- "border-transparent",
23183
- "shadow-control",
23184
- "transition-all",
23185
- "duration-200",
23186
- "outline-none",
23187
- "focus-visible:ring-[3px]",
23188
- "disabled:cursor-not-allowed",
23189
- "disabled:opacity-50",
23190
- "before:block",
23420
+ "[&>input]:absolute",
23421
+ "[&>input]:appearance-none",
23422
+ "[&>input]:bg-transparent",
23423
+ "[&>input]:border-0",
23424
+ "[&>input]:cursor-pointer",
23425
+ "[&>input]:focus-visible:border-ring",
23426
+ "[&>input]:focus-visible:ring-[3px]",
23427
+ "[&>input]:focus-visible:ring-ring/50",
23428
+ "[&>input]:left-0",
23429
+ "[&>input]:outline-none",
23430
+ "[&>input]:rounded-full",
23431
+ "[&>input]:size-full",
23432
+ "[&>input]:top-0",
23191
23433
  "before:bg-background",
23434
+ "before:duration-200",
23435
+ "before:inline-block",
23436
+ "before:m-[1px]",
23192
23437
  "before:pointer-events-none",
23193
- "data-[size=sm]:before:size-4",
23194
- "before:size-5",
23195
- "before:rounded-full",
23196
23438
  "before:ring-0",
23439
+ "before:rounded-full",
23440
+ "before:shadow-control",
23441
+ "before:size-5",
23197
23442
  "before:transition-transform",
23198
- "before:duration-200",
23199
- "data-[state=checked]:before:translate-x-[calc(100%-3px)]",
23200
- "data-[state=unchecked]:before:translate-x-[1px]"
23443
+ "bg-muted",
23444
+ "border",
23445
+ "data-[size=sm]:before:size-4",
23446
+ "data-[size=sm]:h-5",
23447
+ "data-[size=sm]:max-w-8",
23448
+ "data-[size=sm]:min-w-8",
23449
+ "duration-200",
23450
+ "h-6",
23451
+ "has-[input:checked]:before:translate-x-[calc(100%-var(--spacing)*1)]",
23452
+ "has-[input:checked]:bg-primary",
23453
+ "has-[input:checked]:border-primary-active",
23454
+ "has-[input:disabled]:cursor-not-allowed",
23455
+ "has-[input:disabled]:opacity-50",
23456
+ "max-w-10",
23457
+ "min-w-10",
23458
+ "relative",
23459
+ "rounded-full",
23460
+ "shrink-0",
23461
+ "transition-color"
23201
23462
  );
23463
+ el.setAttribute("tabindex", "-1");
23202
23464
  el.setAttribute("data-slot", "switch");
23203
- function setState() {
23204
- el.setAttribute("data-state", el.checked ? "checked" : "unchecked");
23205
- }
23206
- setState();
23207
- el.addEventListener("change", setState);
23208
- cleanup(() => {
23209
- el.removeEventListener("change", setState);
23210
- });
23211
23465
  });
23212
23466
  }
23213
23467
 
@@ -23245,19 +23499,60 @@ function table_default(Alpine) {
23245
23499
  el.setAttribute("data-slot", "table-header");
23246
23500
  });
23247
23501
  Alpine.directive("h-table-head", (el) => {
23248
- el.classList.add("text-foreground", "h-10", "px-2", "text-left", "align-middle", "font-medium", "whitespace-nowrap", "[&:has([role=checkbox])]:pr-0", "[&>[role=checkbox]]:flex", "[&>[role=checkbox]]:items-center");
23502
+ el.classList.add(
23503
+ "text-foreground",
23504
+ "[&[data-hoverable=true]:hover]:bg-table-hover",
23505
+ "[&[data-hoverable=true]:hover]:text-table-hover-foreground",
23506
+ "[&[data-activable=true]:active]:!bg-table-active",
23507
+ "[&[data-activable=true]:active]:!text-table-active-foreground",
23508
+ "h-10",
23509
+ "px-2",
23510
+ "text-left",
23511
+ "align-middle",
23512
+ "font-medium",
23513
+ "whitespace-nowrap",
23514
+ "[&:has([role=checkbox])]:pr-0",
23515
+ "[&>[role=checkbox]]:flex",
23516
+ "[&>[role=checkbox]]:items-center"
23517
+ );
23249
23518
  el.setAttribute("data-slot", "table-head");
23250
23519
  });
23251
23520
  Alpine.directive("h-table-cell", (el) => {
23252
- el.classList.add("p-2", "align-middle", "whitespace-nowrap", "[&:has([role=checkbox])]:pr-0", "[&>[role=checkbox]]:flex", "[&>[role=checkbox]]:items-center");
23521
+ el.classList.add(
23522
+ "p-2",
23523
+ "align-middle",
23524
+ "whitespace-nowrap",
23525
+ "[&:has([role=checkbox])]:pr-0",
23526
+ "[&>[role=checkbox]]:flex",
23527
+ "[&>[role=checkbox]]:items-center",
23528
+ "[&[data-hoverable=true]:hover]:bg-table-hover",
23529
+ "[&[data-hoverable=true]:hover]:text-table-hover-foreground",
23530
+ "[&[data-activable=true]:active]:!bg-table-active",
23531
+ "[&[data-activable=true]:active]:!text-table-active-foreground"
23532
+ );
23253
23533
  el.setAttribute("data-slot", "table-cell");
23254
23534
  });
23255
23535
  Alpine.directive("h-table-body", (el) => {
23256
- el.classList.add("[&_tr:last-child_td]:border-b-0", "[&_tr:last-child_th]:border-b-0", "[&_tr_th]:bg-table-header", "[&_tr:hover_th]:bg-table-hover", "[&_tr:hover_th]:text-table-hover-foreground");
23536
+ el.classList.add(
23537
+ "[&_tr:last-child_td]:border-b-0",
23538
+ "[&_tr:last-child_th]:border-b-0",
23539
+ "[&_tr_th]:bg-table-header",
23540
+ "[&_tr[data-hoverable=true]:hover_th]:bg-table-hover",
23541
+ "[&_tr[data-hoverable=true]:hover_th]:text-table-hover-foreground",
23542
+ "[&_tr[data-activable=true]:active_th]:!bg-table-active",
23543
+ "[&_tr[data-activable=true]:active_th]:!text-table-active-foreground"
23544
+ );
23257
23545
  el.setAttribute("data-slot", "table-body");
23258
23546
  });
23259
23547
  Alpine.directive("h-table-row", (el) => {
23260
- el.classList.add("hover:bg-table-hover", "hover:text-table-hover-foreground", "data-[state=selected]:bg-muted");
23548
+ el.classList.add(
23549
+ "[&[data-hoverable=true]:hover]:bg-table-hover",
23550
+ "[&[data-hoverable=true]:hover]:text-table-hover-foreground",
23551
+ "[&[data-activable=true]:active]:!bg-table-active",
23552
+ "[&[data-activable=true]:active]:!text-table-active-foreground",
23553
+ "data-[state=selected]:bg-table-active",
23554
+ "data-[state=selected]:text-table-active-foreground"
23555
+ );
23261
23556
  el.setAttribute("data-slot", "table-row");
23262
23557
  });
23263
23558
  Alpine.directive("h-table-caption", (el) => {
@@ -23280,18 +23575,23 @@ function tabs_default(Alpine) {
23280
23575
  el.classList.add(
23281
23576
  "group/tab-bar",
23282
23577
  "flex",
23283
- "gap-1.5",
23578
+ "gap-1",
23284
23579
  "bg-object-header",
23285
23580
  "text-object-header-foreground",
23286
23581
  "group-data-[orientation=horizontal]/tabs:flex-row",
23287
23582
  "group-data-[orientation=vertical]/tabs:flex-col",
23288
- "data-[style=inline]:group-data-[orientation=horizontal]/tabs:inset-shadow-[0_-.063rem_var(--border)]",
23289
- "data-[style=inline]:group-data-[orientation=vertical]/tabs:inset-shadow-[-.063rem_0_var(--border)]",
23290
- "data-[style=inline]:group-data-[orientation=horizontal]/tabs:h-11",
23291
- "data-[style=inline]:data-[size=sm]:group-data-[orientation=horizontal]/tabs:h-8",
23292
- "data-[style=float]:border",
23293
- "data-[style=float]:rounded-lg",
23294
- "data-[style=float]:p-[3px]"
23583
+ "[&:not([data-floating=true])]:group-data-[orientation=horizontal]/tabs:inset-shadow-[0_-.063rem_var(--border)]",
23584
+ "[&:not([data-floating=true])]:group-data-[orientation=vertical]/tabs:inset-shadow-[-.063rem_0_var(--border)]",
23585
+ "[&:not([data-floating=true])]:group-data-[orientation=horizontal]/tabs:h-10",
23586
+ "[&:not([data-floating=true])]:group-data-[orientation=horizontal]/tabs:min-h-10",
23587
+ "[&:not([data-floating=true])]:data-[size=sm]:group-data-[orientation=horizontal]/tabs:h-8",
23588
+ "[&:not([data-floating=true])]:data-[size=sm]:group-data-[orientation=horizontal]/tabs:min-h-8",
23589
+ "[&:not([data-floating=true])]:data-[size=lg]:group-data-[orientation=horizontal]/tabs:h-12",
23590
+ "[&:not([data-floating=true])]:data-[size=lg]:group-data-[orientation=horizontal]/tabs:min-h-12",
23591
+ "data-[floating=true]:border",
23592
+ "data-[floating=true]:shadow-xs",
23593
+ "data-[floating=true]:rounded-lg",
23594
+ "data-[floating=true]:p-[0.188rem]"
23295
23595
  );
23296
23596
  el.setAttribute("data-slot", "tab-bar");
23297
23597
  });
@@ -23304,8 +23604,8 @@ function tabs_default(Alpine) {
23304
23604
  "group-data-[orientation=horizontal]/tabs:flex-row",
23305
23605
  "group-data-[orientation=vertical]/tabs:flex-col",
23306
23606
  "group-data-[orientation=vertical]/tabs:h-fit",
23307
- "group-data-[style=inline]/tab-bar:gap-2",
23308
- "group-data-[style=float]/tab-bar:gap-1"
23607
+ "gap-2",
23608
+ "group-data-[floating=true]/tab-bar:gap-1"
23309
23609
  );
23310
23610
  el.setAttribute("role", "tablist");
23311
23611
  el.setAttribute("data-slot", "tab-list");
@@ -23321,8 +23621,7 @@ function tabs_default(Alpine) {
23321
23621
  "aria-selected:text-foreground",
23322
23622
  "inline-flex",
23323
23623
  "group-data-[orientation=vertical]/tabs:w-full",
23324
- "group-data-[orientation=vertical]/tabs:h-9",
23325
- "group-data-[orientation=vertical]/tabs:group-data-[size=sm]/tab-bar:h-8",
23624
+ "group-data-[orientation=vertical]/tabs:h-8",
23326
23625
  "group-data-[orientation=horizontal]/tabs:h-full",
23327
23626
  "items-center",
23328
23627
  "justify-start",
@@ -23333,21 +23632,21 @@ function tabs_default(Alpine) {
23333
23632
  "font-medium",
23334
23633
  "whitespace-nowrap",
23335
23634
  "transition-[color,box-shadow]",
23336
- "group-data-[style=float]/tab-bar:rounded-md",
23337
- "group-data-[style=float]/tab-bar:border",
23338
- "group-data-[style=float]/tab-bar:border-transparent",
23339
- "group-data-[style=float]/tab-bar:aria-selected:bg-background",
23340
- "group-data-[style=float]/tab-bar:aria-selected:border-border",
23341
- "group-data-[style=float]/tab-bar:hover:bg-background",
23342
- "group-data-[style=float]/tab-bar:hover:border-border",
23343
- "group-data-[style=inline]/tab-bar:border-0",
23344
- "group-data-[style=inline]/tab-bar:group-data-[orientation=horizontal]/tabs:hover:inset-shadow-[0_-.188rem_var(--border)]",
23345
- "group-data-[style=inline]/tab-bar:group-data-[orientation=horizontal]/tabs:aria-selected:inset-shadow-[0_-.125rem_var(--primary)]",
23346
- "group-data-[style=inline]/tab-bar:group-data-[orientation=horizontal]/tabs:hover:aria-selected:inset-shadow-[0_-.188rem_var(--primary)]",
23347
- "group-data-[style=inline]/tab-bar:group-data-[orientation=vertical]/tabs:px-3.5",
23348
- "group-data-[style=inline]/tab-bar:group-data-[orientation=vertical]/tabs:hover:inset-shadow-[-.188rem_0_var(--border)]",
23349
- "group-data-[style=inline]/tab-bar:group-data-[orientation=vertical]/tabs:aria-selected:inset-shadow-[-.125rem_0_var(--primary)]",
23350
- "group-data-[style=inline]/tab-bar:group-data-[orientation=vertical]/tabs:hover:aria-selected:inset-shadow-[-.188rem_0_var(--primary)]",
23635
+ "group-data-[floating=true]/tab-bar:rounded-md",
23636
+ "group-data-[floating=true]/tab-bar:border",
23637
+ "group-data-[floating=true]/tab-bar:border-transparent",
23638
+ "group-data-[floating=true]/tab-bar:aria-selected:bg-background",
23639
+ "group-data-[floating=true]/tab-bar:aria-selected:border-border",
23640
+ "group-data-[floating=true]/tab-bar:hover:bg-background",
23641
+ "group-data-[floating=true]/tab-bar:hover:border-border",
23642
+ "group-[&:not([data-floating=true])]/tab-bar:border-0",
23643
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:hover:inset-shadow-[0_-.188rem_var(--border)]",
23644
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:aria-selected:inset-shadow-[0_-.125rem_var(--primary)]",
23645
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:hover:aria-selected:inset-shadow-[0_-.188rem_var(--primary)]",
23646
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:px-3",
23647
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:hover:inset-shadow-[-.188rem_0_var(--border)]",
23648
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:aria-selected:inset-shadow-[-.125rem_0_var(--primary)]",
23649
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:hover:aria-selected:inset-shadow-[-.188rem_0_var(--primary)]",
23351
23650
  "focus-visible:ring-[3px]",
23352
23651
  "focus-visible:outline-1",
23353
23652
  "disabled:pointer-events-none",
@@ -23371,12 +23670,28 @@ function tabs_default(Alpine) {
23371
23670
  if (modifiers.includes("end"))
23372
23671
  el.classList.add(
23373
23672
  "group-data-[orientation=horizontal]/tabs:ml-auto",
23374
- "group-data-[style=inline]/tab-bar:group-data-[orientation=horizontal]/tabs:mr-1.5",
23673
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:mr-1.5",
23375
23674
  "group-data-[orientation=vertical]/tabs:mt-auto",
23376
- "group-data-[style=inline]/tab-bar:group-data-[orientation=vertical]/tabs:mb-1.5"
23675
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:mb-1.5"
23377
23676
  );
23378
23677
  el.setAttribute("data-slot", "tab-list-actions");
23379
23678
  });
23679
+ Alpine.directive("h-tab-list-action", (el) => {
23680
+ setButtonClasses(el);
23681
+ el.classList.add(
23682
+ "group-data-[floating=true]/tab-bar:rounded-md",
23683
+ "group-data-[orientation=horizontal]/tabs:aspect-square",
23684
+ "group-data-[orientation=horizontal]/tabs:w-auto",
23685
+ "group-data-[floating=true]/tab-bar:group-data-[orientation=horizontal]/tabs:h-full",
23686
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=horizontal]/tabs:h-[75%]",
23687
+ "group-data-[orientation=vertical]/tabs:h-9",
23688
+ "group-data-[floating=true]/tab-bar:group-data-[orientation=vertical]/tabs:w-full",
23689
+ "group-[&:not([data-floating=true])]/tab-bar:group-data-[orientation=vertical]/tabs:w-[80%]"
23690
+ );
23691
+ el.classList.add(...buttonVariants[el.getAttribute("data-variant") ?? "outline"]);
23692
+ el.setAttribute("role", "button");
23693
+ el.setAttribute("data-slot", "tab-list-action");
23694
+ });
23380
23695
  Alpine.directive("h-tabs-content", (el) => {
23381
23696
  el.classList.add("flex-1", "outline-none");
23382
23697
  el.setAttribute("role", "tabpanel");
@@ -23522,7 +23837,7 @@ function tile_default(Alpine) {
23522
23837
  "flex",
23523
23838
  "items-center",
23524
23839
  "text-sm",
23525
- "rounded-xl",
23840
+ "rounded-lg",
23526
23841
  "transition-colors",
23527
23842
  "[a]:hover:bg-secondary-hover",
23528
23843
  "[a]:hover:text-secondary-foreground",
@@ -23570,10 +23885,10 @@ function tile_default(Alpine) {
23570
23885
  el.setAttribute("data-slot", "tile-media");
23571
23886
  switch (el.getAttribute("data-variant")) {
23572
23887
  case "icon":
23573
- el.classList.add("size-8", "border", "rounded-xl", "bg-muted", "[&_svg:not([class*='size-'])]:size-4");
23888
+ el.classList.add("size-8", "border", "rounded-lg", "bg-muted", "[&_svg:not([class*='size-'])]:size-4");
23574
23889
  break;
23575
23890
  case "image":
23576
- el.classList.add("size-10", "rounded-xl", "overflow-hidden", "[&_img]:size-full", "[&_img]:object-cover");
23891
+ el.classList.add("size-10", "rounded-lg", "overflow-hidden", "[&_img]:size-full", "[&_img]:object-cover");
23577
23892
  break;
23578
23893
  default:
23579
23894
  el.classList.add("bg-transparent");
@@ -23668,14 +23983,16 @@ function timepicker_default(Alpine) {
23668
23983
  el.classList.add(
23669
23984
  "cursor-pointer",
23670
23985
  "border-input",
23671
- "focus-visible:border-ring",
23672
- "focus-visible:ring-ring/50",
23673
- "aria-invalid:ring-negative/20",
23674
- "dark:aria-invalid:ring-negative/40",
23675
- "aria-invalid:border-negative",
23676
- "invalid:ring-negative/20",
23677
- "dark:invalid:ring-negative/40",
23678
- "invalid:border-negative",
23986
+ "[&>input]:appearance-none",
23987
+ "has-[input:focus-visible]:border-ring",
23988
+ "has-[input:focus-visible]:ring-[3px]",
23989
+ "has-[input:focus-visible]:ring-ring/50",
23990
+ "dark:has-[aria-invalid=true]:ring-negative/40",
23991
+ "dark:has-[input:invalid]:ring-negative/40",
23992
+ "has-[aria-invalid=true]:border-negative",
23993
+ "has-[aria-invalid=true]:ring-negative/20",
23994
+ "has-[input:invalid]:border-negative",
23995
+ "has-[input:invalid]:ring-negative/20",
23679
23996
  "hover:bg-secondary-hover",
23680
23997
  "active:bg-secondary-active",
23681
23998
  "flex",
@@ -23693,8 +24010,8 @@ function timepicker_default(Alpine) {
23693
24010
  "whitespace-nowrap",
23694
24011
  "shadow-control",
23695
24012
  "transition-[color,box-shadow]",
24013
+ "duration-200",
23696
24014
  "outline-none",
23697
- "focus-visible:ring-[3px]",
23698
24015
  "has-[input:disabled]:pointer-events-none",
23699
24016
  "has-[input:disabled]:opacity-50",
23700
24017
  "[&_svg]:pointer-events-none",
@@ -23703,6 +24020,7 @@ function timepicker_default(Alpine) {
23703
24020
  "[&_svg]:opacity-50"
23704
24021
  );
23705
24022
  el.setAttribute("data-slot", "time-picker");
24023
+ el.setAttribute("tabindex", "-1");
23706
24024
  el.appendChild(
23707
24025
  (0, import_lucide5.createElement)(import_lucide5.Clock, {
23708
24026
  class: ["opacity-50 size-4 transition-transform duration-200"],
@@ -23730,7 +24048,8 @@ function timepicker_default(Alpine) {
23730
24048
  } else {
23731
24049
  el._timepicker.is12Hour = new Intl.DateTimeFormat(el._timepicker.locale, { hour: "numeric" }).resolvedOptions().hour12;
23732
24050
  }
23733
- const handler2 = () => {
24051
+ const handler2 = (event) => {
24052
+ if (event.type === "keydown" && event.key !== "Enter") return;
23734
24053
  el._timepicker.expanded = !el._timepicker.expanded;
23735
24054
  el.setAttribute("aria-expanded", el._timepicker.expanded);
23736
24055
  Alpine2.nextTick(() => {
@@ -23742,8 +24061,10 @@ function timepicker_default(Alpine) {
23742
24061
  });
23743
24062
  };
23744
24063
  el.addEventListener("click", handler2);
24064
+ el.addEventListener("keydown", handler2);
23745
24065
  cleanup(() => {
23746
24066
  el.removeEventListener("click", handler2);
24067
+ el.removeEventListener("keydown", handler2);
23747
24068
  top.removeEventListener("click", el._timepicker.close);
23748
24069
  });
23749
24070
  });
@@ -24088,6 +24409,7 @@ function timepicker_default(Alpine) {
24088
24409
  okButton.addEventListener("click", timepicker._timepicker.close);
24089
24410
  footer.appendChild(okButton);
24090
24411
  el.appendChild(footer);
24412
+ Alpine2.initTree(footer);
24091
24413
  let selectedHour;
24092
24414
  let selectedMinute;
24093
24415
  let selectedSecond;
@@ -24241,7 +24563,7 @@ function timepicker_default(Alpine) {
24241
24563
  periodList.children[p].removeEventListener("click", setPeriod);
24242
24564
  }
24243
24565
  });
24244
- }).before("h-button");
24566
+ });
24245
24567
  }
24246
24568
 
24247
24569
  // src/components/toolbar.js
@@ -24253,14 +24575,19 @@ function toolbar_default(Alpine) {
24253
24575
  "hbox",
24254
24576
  "shrink-0",
24255
24577
  "items-center",
24256
- "px-2",
24578
+ "px-1",
24579
+ 'has-[>[data-slot="avatar"]:last-child]:pr-2',
24580
+ 'has-[>[data-slot="toolbar-image"]:first-child]:pl-2',
24257
24581
  "gap-1",
24258
24582
  modifiers.includes("footer") ? "border-t" : "border-b",
24259
24583
  "w-full",
24260
- "h-11",
24584
+ "h-12",
24261
24585
  "data-[size=sm]:h-8",
24262
24586
  "data-[variant=transparent]:bg-transparent",
24263
- "data-[variant=transparent]:text-foreground"
24587
+ "data-[variant=transparent]:text-foreground",
24588
+ "data-[floating=true]:shadow-xs",
24589
+ "data-[floating=true]:rounded-lg",
24590
+ "data-[floating=true]:border"
24264
24591
  );
24265
24592
  el.setAttribute("data-slot", "toolbar");
24266
24593
  });
@@ -24269,11 +24596,12 @@ function toolbar_default(Alpine) {
24269
24596
  el.setAttribute("data-slot", "toolbar-image");
24270
24597
  });
24271
24598
  Alpine.directive("h-toolbar-title", (el) => {
24272
- el.classList.add("text", "[[data-size=sm]_&]:text-sm", "font-medium", "whitespace-nowrap", "text-ellipsis", "overflow-hidden");
24599
+ el.classList.add("text", "[[data-size=sm]_&]:text-sm", "first:pl-2", "font-medium", "whitespace-nowrap", "text-ellipsis", "overflow-hidden");
24273
24600
  el.setAttribute("data-slot", "toolbar-title");
24274
24601
  });
24275
24602
  Alpine.directive("h-toolbar-spacer", (el) => {
24276
24603
  el.classList.add("flex-[1_auto]", "h-full");
24604
+ el.setAttribute("tabindex", "-1");
24277
24605
  el.setAttribute("data-slot", "toolbar-spacer");
24278
24606
  });
24279
24607
  Alpine.directive("h-toolbar-separator", (el) => {
@@ -24284,28 +24612,21 @@ function toolbar_default(Alpine) {
24284
24612
 
24285
24613
  // src/components/tooltip.js
24286
24614
  function tooltip_default(Alpine) {
24287
- Alpine.directive("h-tooltip", (el, {}, { Alpine: Alpine2 }) => {
24615
+ Alpine.directive("h-tooltip-trigger", (el, {}, { Alpine: Alpine2, cleanup }) => {
24288
24616
  el._tooltip = Alpine2.reactive({
24289
24617
  id: void 0,
24290
24618
  controls: `hpc${v4_default()}`,
24291
24619
  shown: false
24292
24620
  });
24293
- el.setAttribute("data-slot", "tooltip");
24294
- });
24295
- Alpine.directive("h-tooltip-trigger", (el, {}, { Alpine: Alpine2, cleanup }) => {
24296
- const tooltip = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_tooltip"));
24297
- if (!tooltip) {
24298
- throw new Error("h-tooltip-trigger must be inside an h-tooltip element");
24299
- }
24300
24621
  if (el.hasAttribute("id")) {
24301
- tooltip._tooltip.id = el.getAttribute("id");
24622
+ el._tooltip.id = el.getAttribute("id");
24302
24623
  } else {
24303
- tooltip._tooltip.id = `hp${v4_default()}`;
24304
- el.setAttribute("id", tooltip._tooltip.id);
24624
+ el._tooltip.id = `hp${v4_default()}`;
24625
+ el.setAttribute("id", el._tooltip.id);
24305
24626
  }
24306
- el.setAttribute("aria-describedby", tooltip._tooltip.controls);
24627
+ el.setAttribute("aria-describedby", el._tooltip.controls);
24307
24628
  const handler2 = (event) => {
24308
- tooltip._tooltip.shown = event.type === "pointerenter";
24629
+ el._tooltip.shown = event.type === "pointerenter";
24309
24630
  };
24310
24631
  el.addEventListener("pointerenter", handler2);
24311
24632
  el.addEventListener("pointerleave", handler2);
@@ -24314,20 +24635,25 @@ function tooltip_default(Alpine) {
24314
24635
  el.removeEventListener("pointerleave", handler2);
24315
24636
  });
24316
24637
  });
24317
- Alpine.directive("h-tooltip-content", (el, {}, { effect, Alpine: Alpine2 }) => {
24318
- const tooltip = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_tooltip"));
24638
+ Alpine.directive("h-tooltip", (el, {}, { effect }) => {
24639
+ const tooltip = (() => {
24640
+ let sibling = el.previousElementSibling;
24641
+ while (sibling && !sibling.hasOwnProperty("_tooltip")) {
24642
+ sibling = sibling.previousElementSibling;
24643
+ }
24644
+ return sibling;
24645
+ })();
24319
24646
  if (!tooltip) {
24320
- throw new Error("h-tooltip-content must be inside an h-tooltip element");
24647
+ throw new Error("h-tooltip must be placed after an h-tooltip-trigger element");
24321
24648
  }
24322
24649
  el.classList.add("absolute", "bg-foreground", "text-background", "z-50", "w-fit", "rounded-md", "px-3", "py-1.5", "text-xs", "text-balance");
24323
- el.setAttribute("data-slot", "tooltip-content");
24650
+ el.setAttribute("data-slot", "tooltip");
24324
24651
  el.setAttribute("id", tooltip._tooltip.controls);
24325
- const control = tooltip.querySelector(`#${tooltip._tooltip.id}`);
24326
24652
  const arrowEl = document.createElement("span");
24327
24653
  arrowEl.classList.add("absolute", "bg-foreground", "fill-foreground", "z-50", "size-2.5", "rotate-45", "rounded-[2px]");
24328
24654
  el.appendChild(arrowEl);
24329
24655
  function updatePosition() {
24330
- computePosition2(control, el, {
24656
+ computePosition2(tooltip, el, {
24331
24657
  placement: "top",
24332
24658
  middleware: [offset2(10), flip2(), shift2({ padding: 4 }), arrow2({ element: arrowEl })]
24333
24659
  }).then(({ x, y, middlewareData, placement }) => {
@@ -24361,6 +24687,9 @@ function tooltip_default(Alpine) {
24361
24687
  });
24362
24688
  }
24363
24689
 
24690
+ // package.json
24691
+ var version = "0.4.0";
24692
+
24364
24693
  // src/utils/theme.js
24365
24694
  var colorSchemeKey = "codbex.harmonia.colorMode";
24366
24695
  var savedScheme = localStorage.getItem(colorSchemeKey);
@@ -24385,16 +24714,31 @@ var initColorScheme = () => {
24385
24714
  };
24386
24715
  var setColorScheme = (mode) => {
24387
24716
  if (mode === "dark") {
24717
+ document.documentElement.classList.add("dark");
24388
24718
  localStorage.setItem(colorSchemeKey, "dark");
24389
24719
  window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change", colorSchemeChange);
24390
24720
  } else if (mode === "light") {
24721
+ document.documentElement.classList.remove("dark");
24391
24722
  localStorage.setItem(colorSchemeKey, "light");
24392
24723
  window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change", colorSchemeChange);
24393
24724
  } else {
24725
+ if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
24726
+ document.documentElement.classList.add("dark");
24727
+ } else {
24728
+ document.documentElement.classList.remove("dark");
24729
+ }
24394
24730
  localStorage.setItem(colorSchemeKey, "auto");
24395
24731
  window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", colorSchemeChange);
24396
24732
  }
24397
24733
  };
24734
+ var getColorScheme = () => {
24735
+ const theme = localStorage.getItem(colorSchemeKey);
24736
+ if (theme) return theme;
24737
+ else if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
24738
+ return "dark";
24739
+ }
24740
+ return "light";
24741
+ };
24398
24742
  initColorScheme();
24399
24743
 
24400
24744
  // src/module.js
@@ -24416,6 +24760,7 @@ var Harmonia = {
24416
24760
  registerPlugin(info_page_default);
24417
24761
  registerPlugin(input_default);
24418
24762
  registerPlugin(label_default);
24763
+ registerPlugin(list_default);
24419
24764
  registerPlugin(menu_default);
24420
24765
  registerPlugin(pagination_default);
24421
24766
  registerPlugin(popover_default);
@@ -24438,7 +24783,9 @@ var Harmonia = {
24438
24783
  registerPlugin(toolbar_default);
24439
24784
  registerPlugin(tooltip_default);
24440
24785
  },
24441
- setColorScheme
24786
+ setColorScheme,
24787
+ getColorScheme,
24788
+ version
24442
24789
  };
24443
24790
  var module_default = Harmonia;
24444
24791
  export {
@@ -24458,6 +24805,7 @@ export {
24458
24805
  info_page_default as InfoPage,
24459
24806
  input_default as Input,
24460
24807
  label_default as Label,
24808
+ list_default as List,
24461
24809
  menu_default as Menu,
24462
24810
  pagination_default as Pagination,
24463
24811
  popover_default as Popover,