@codbex/harmonia 1.2.0 → 1.2.1

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.
@@ -2210,10 +2210,10 @@ function accordion_default(Alpine) {
2210
2210
  }) : { single: false };
2211
2211
  el.setAttribute("data-slot", "accordion");
2212
2212
  });
2213
- Alpine.directive("h-accordion-item", (el, { original, expression, modifiers }, { effect, Alpine: Alpine2 }) => {
2213
+ Alpine.directive("h-accordion-item", (el, { original: original2, expression, modifiers }, { effect, Alpine: Alpine2 }) => {
2214
2214
  const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
2215
2215
  if (!accordion) {
2216
- throw new Error(`${original} must be inside an accordion`);
2216
+ throw new Error(`${original2} must be inside an accordion`);
2217
2217
  }
2218
2218
  el.classList.add("border-b", "last:border-b-0", "[[data-variant=header]_&]:data-[state=closed]:border-b-0");
2219
2219
  el.setAttribute("data-slot", "accordion-item");
@@ -2241,14 +2241,14 @@ function accordion_default(Alpine) {
2241
2241
  setAttributes();
2242
2242
  effect(setAttributes);
2243
2243
  });
2244
- Alpine.directive("h-accordion-trigger", (el, { original, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
2244
+ Alpine.directive("h-accordion-trigger", (el, { original: original2, expression }, { effect, evaluateLater, Alpine: Alpine2, cleanup }) => {
2245
2245
  if (el.tagName.length !== 2 && !el.tagName.startsWith("H")) {
2246
- throw new Error(`${original} must be a header element`);
2246
+ throw new Error(`${original2} must be a header element`);
2247
2247
  }
2248
2248
  const accordion = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordion"));
2249
2249
  const accordionItem = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_accordionItem"));
2250
2250
  if (!accordionItem || !accordion) {
2251
- throw new Error(`${original} must have an accordion and accordion item parent elements`);
2251
+ throw new Error(`${original2} must have an accordion and accordion item parent elements`);
2252
2252
  }
2253
2253
  el.classList.add(
2254
2254
  "flex",
@@ -2433,10 +2433,10 @@ function avatar_default(Alpine) {
2433
2433
  el.classList.add("cursor-pointer", "hover:bg-secondary-hover", "active:bg-secondary-active");
2434
2434
  }
2435
2435
  });
2436
- Alpine.directive("h-avatar-image", (el, { original }, { cleanup }) => {
2436
+ Alpine.directive("h-avatar-image", (el, { original: original2 }, { cleanup }) => {
2437
2437
  const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_avatar"));
2438
2438
  if (!avatar) {
2439
- throw new Error(`${original} must be inside an avatar element`);
2439
+ throw new Error(`${original2} must be inside an avatar element`);
2440
2440
  }
2441
2441
  el.classList.add("aspect-square", "size-full");
2442
2442
  el.setAttribute("data-slot", "avatar-image");
@@ -2467,10 +2467,10 @@ function avatar_default(Alpine) {
2467
2467
  observer.disconnect();
2468
2468
  });
2469
2469
  });
2470
- Alpine.directive("h-avatar-fallback", (el, { original }, { effect }) => {
2470
+ Alpine.directive("h-avatar-fallback", (el, { original: original2 }, { effect }) => {
2471
2471
  const avatar = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_avatar"));
2472
2472
  if (!avatar) {
2473
- throw new Error(`${original} must be inside an avatar element`);
2473
+ throw new Error(`${original2} must be inside an avatar element`);
2474
2474
  }
2475
2475
  el.classList.add("hidden", "bg-muted", "flex", "size-full", "items-center", "justify-center");
2476
2476
  el.setAttribute("data-slot", "avatar-fallback");
@@ -2679,7 +2679,7 @@ var getButtonSize = (size3, isAddon = false) => {
2679
2679
  }
2680
2680
  };
2681
2681
  function button_default(Alpine) {
2682
- Alpine.directive("h-button", (el, { original, modifiers }, { cleanup }) => {
2682
+ Alpine.directive("h-button", (el, { original: original2, modifiers }, { cleanup }) => {
2683
2683
  setButtonClasses(el);
2684
2684
  if (!el.hasAttribute("data-slot")) {
2685
2685
  el.setAttribute("data-slot", "button");
@@ -2696,7 +2696,7 @@ function button_default(Alpine) {
2696
2696
  el.classList.remove(...getButtonSize(lastSize, isAddon));
2697
2697
  el.classList.add(...getButtonSize(size3, isAddon));
2698
2698
  if (size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
2699
- console.error(`${original}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
2699
+ console.error(`${original2}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
2700
2700
  }
2701
2701
  lastSize = size3;
2702
2702
  }
@@ -4245,7 +4245,7 @@ var computePosition2 = (reference, floating, options) => {
4245
4245
 
4246
4246
  // src/components/calendar.js
4247
4247
  function calendar_default(Alpine) {
4248
- Alpine.directive("h-calendar", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
4248
+ Alpine.directive("h-calendar", (el, { original: original2, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
4249
4249
  const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_datepicker"));
4250
4250
  el.classList.add("border", "rounded-control", "gap-2", "p-2");
4251
4251
  el.setAttribute("tabindex", "-1");
@@ -4289,7 +4289,7 @@ function calendar_default(Alpine) {
4289
4289
  const onInputChange = () => {
4290
4290
  const newValue = new Date(datepicker._h_datepicker.input.value);
4291
4291
  if (isNaN(newValue)) {
4292
- console.error(`${original}: input value is not a valid date - ${datepicker._h_datepicker.input.value}`);
4292
+ console.error(`${original2}: input value is not a valid date - ${datepicker._h_datepicker.input.value}`);
4293
4293
  datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
4294
4294
  return;
4295
4295
  } else if (selected.getTime() !== newValue.getTime()) {
@@ -4306,7 +4306,7 @@ function calendar_default(Alpine) {
4306
4306
  if (el.hasOwnProperty("_x_model") && el._x_model.get()) {
4307
4307
  selected = new Date(el._x_model.get());
4308
4308
  if (isNaN(selected)) {
4309
- console.error(`${original}: input value is not a valid date - ${el._x_model.get()}`);
4309
+ console.error(`${original2}: input value is not a valid date - ${el._x_model.get()}`);
4310
4310
  if (datepicker) datepicker._h_datepicker.input.setCustomValidity("Input value is not a valid date.");
4311
4311
  else el.setAttribute("data-invalid", "true");
4312
4312
  } else if (datepicker) {
@@ -4815,10 +4815,10 @@ function collapsible_default(Alpine) {
4815
4815
  });
4816
4816
  }
4817
4817
  });
4818
- Alpine.directive("h-collapsible-trigger", (el, { original, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
4818
+ Alpine.directive("h-collapsible-trigger", (el, { original: original2, modifiers }, { effect, Alpine: Alpine2, cleanup }) => {
4819
4819
  const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
4820
4820
  if (!collapsible) {
4821
- throw new Error(`${original} must be inside a collapsible element`);
4821
+ throw new Error(`${original2} must be inside a collapsible element`);
4822
4822
  }
4823
4823
  if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-trigger");
4824
4824
  if (modifiers.includes("chevron")) {
@@ -4837,10 +4837,10 @@ function collapsible_default(Alpine) {
4837
4837
  el.removeEventListener("click", handler);
4838
4838
  });
4839
4839
  });
4840
- Alpine.directive("h-collapsible-content", (el, { original }, { effect, Alpine: Alpine2 }) => {
4840
+ Alpine.directive("h-collapsible-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
4841
4841
  const collapsible = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_collapsible"));
4842
4842
  if (!collapsible) {
4843
- throw new Error(`${original} must be inside an h-collapsible element`);
4843
+ throw new Error(`${original2} must be inside an h-collapsible element`);
4844
4844
  }
4845
4845
  if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "collapsible-content");
4846
4846
  el.classList.add("data-[state=closed]:!hidden");
@@ -4871,7 +4871,7 @@ function sizeObserver(el) {
4871
4871
 
4872
4872
  // src/components/datepicker.js
4873
4873
  function datepicker_default(Alpine) {
4874
- Alpine.directive("h-date-picker", (el, { original, modifiers }, { Alpine: Alpine2, cleanup }) => {
4874
+ Alpine.directive("h-date-picker", (el, { original: original2, modifiers }, { Alpine: Alpine2, cleanup }) => {
4875
4875
  const state = Alpine2.reactive({
4876
4876
  expanded: false
4877
4877
  });
@@ -4884,7 +4884,7 @@ function datepicker_default(Alpine) {
4884
4884
  };
4885
4885
  el._h_datepicker.input = el.querySelector("input");
4886
4886
  if (!el._h_datepicker.input || el._h_datepicker.input.tagName !== "INPUT") {
4887
- throw new Error(`${original} must contain an input`);
4887
+ throw new Error(`${original2} must contain an input`);
4888
4888
  } else if (el._h_datepicker.input.hasAttribute("id")) {
4889
4889
  el._h_datepicker.id = el._h_datepicker.input.getAttribute("id");
4890
4890
  } else {
@@ -4961,16 +4961,16 @@ function datepicker_default(Alpine) {
4961
4961
  observer.disconnect();
4962
4962
  });
4963
4963
  });
4964
- Alpine.directive("h-date-picker-trigger", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
4964
+ Alpine.directive("h-date-picker-trigger", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
4965
4965
  if (el.tagName !== "BUTTON") {
4966
- throw new Error(`${original} must be a button`);
4966
+ throw new Error(`${original2} must be a button`);
4967
4967
  }
4968
4968
  if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
4969
- throw new Error(`${original}: must have an "aria-label" or "aria-labelledby" attribute`);
4969
+ throw new Error(`${original2}: must have an "aria-label" or "aria-labelledby" attribute`);
4970
4970
  }
4971
4971
  const datepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_datepicker"));
4972
4972
  if (!datepicker) {
4973
- throw new Error(`${original} must be inside an date-picker element`);
4973
+ throw new Error(`${original2} must be inside an date-picker element`);
4974
4974
  }
4975
4975
  el.classList.add("cursor-pointer", "inline-flex", "items-center", "justify-center", "h-full", "aspect-square", "bg-transparent", "hover:bg-secondary", "active:bg-secondary-active", "outline-none");
4976
4976
  if (datepicker._h_datepicker.inTable) {
@@ -5250,13 +5250,13 @@ function fieldset_default(Alpine) {
5250
5250
 
5251
5251
  // src/components/icon.js
5252
5252
  function icon_default(Alpine) {
5253
- Alpine.directive("h-icon", (el, { original, modifiers }) => {
5253
+ Alpine.directive("h-icon", (el, { original: original2, modifiers }) => {
5254
5254
  if (el.tagName.toLowerCase() !== "svg") {
5255
- throw new Error(`${original} works only on svg elements`);
5255
+ throw new Error(`${original2} works only on svg elements`);
5256
5256
  } else if (!el.hasAttribute("role")) {
5257
- throw new Error(`${original} must have a role`);
5257
+ throw new Error(`${original2} must have a role`);
5258
5258
  } else if (el.getAttribute("role") === "img" && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
5259
- throw new Error(`${original}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
5259
+ throw new Error(`${original2}: svg images with the role of img must have an "aria-label" or "aria-labelledby" attribute`);
5260
5260
  }
5261
5261
  el.classList.add("fill-current");
5262
5262
  el.setAttribute("data-slot", "icon");
@@ -5473,7 +5473,7 @@ function input_default(Alpine) {
5473
5473
  el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
5474
5474
  el.setAttribute("data-slot", "label");
5475
5475
  });
5476
- Alpine.directive("h-input-number", (el, { original }, { cleanup }) => {
5476
+ Alpine.directive("h-input-number", (el, { original: original2 }, { cleanup }) => {
5477
5477
  el.classList.add(
5478
5478
  "overflow-hidden",
5479
5479
  "group/input-number",
@@ -5506,7 +5506,7 @@ function input_default(Alpine) {
5506
5506
  el.setAttribute("data-slot", "input-number");
5507
5507
  const input = el.querySelector("input");
5508
5508
  if (!input || input.getAttribute("type") !== "number") {
5509
- throw new Error(`${original} must contain an input of type 'number'`);
5509
+ throw new Error(`${original2} must contain an input of type 'number'`);
5510
5510
  }
5511
5511
  if (!input.hasAttribute("type")) input.setAttribute("type", "number");
5512
5512
  if (!input.hasAttribute("inputmode")) input.setAttribute("inputmode", "numeric");
@@ -5752,13 +5752,13 @@ function list_default(Alpine) {
5752
5752
  el.setAttribute("data-slot", "list");
5753
5753
  el.setAttribute("role", "group");
5754
5754
  });
5755
- Alpine.directive("h-list-header", (el, { original }, { Alpine: Alpine2 }) => {
5755
+ Alpine.directive("h-list-header", (el, { original: original2 }, { Alpine: Alpine2 }) => {
5756
5756
  el.classList.add("font-medium", "flex", "items-center", "p-2", "gap-2", "align-middle", "bg-table-header", "text-table-header-foreground");
5757
5757
  el.setAttribute("role", "presentation");
5758
5758
  el.setAttribute("data-slot", "list-header");
5759
5759
  const list = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "list");
5760
5760
  if (!list) {
5761
- throw new Error(`${original} must be placed inside a list element`);
5761
+ throw new Error(`${original2} must be placed inside a list element`);
5762
5762
  }
5763
5763
  if (!el.hasAttribute("id")) {
5764
5764
  const id = `lbh${v4_default()}`;
@@ -5810,9 +5810,9 @@ function menu_default(Alpine) {
5810
5810
  };
5811
5811
  el.setAttribute("data-state", "closed");
5812
5812
  });
5813
- Alpine.directive("h-menu", (el, { original, modifiers }, { cleanup, Alpine: Alpine2 }) => {
5813
+ Alpine.directive("h-menu", (el, { original: original2, modifiers }, { cleanup, Alpine: Alpine2 }) => {
5814
5814
  if (el.tagName !== "UL") {
5815
- throw new Error(`${original} must be an ul element`);
5815
+ throw new Error(`${original2} must be an ul element`);
5816
5816
  }
5817
5817
  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");
5818
5818
  el.setAttribute("role", "menu");
@@ -5820,7 +5820,7 @@ function menu_default(Alpine) {
5820
5820
  el.setAttribute("tabindex", "-1");
5821
5821
  el.setAttribute("data-slot", "menu");
5822
5822
  if (!el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
5823
- throw new Error(`${original} must have an "aria-label" or "aria-labelledby" attribute`);
5823
+ throw new Error(`${original2} must have an "aria-label" or "aria-labelledby" attribute`);
5824
5824
  }
5825
5825
  const isSubmenu = modifiers.includes("sub");
5826
5826
  const menuTrigger = (() => {
@@ -5832,7 +5832,7 @@ function menu_default(Alpine) {
5832
5832
  return sibling;
5833
5833
  })();
5834
5834
  if (!isSubmenu && !menuTrigger) {
5835
- throw new Error(`${original} menu must be placed after a menu trigger element`);
5835
+ throw new Error(`${original2} menu must be placed after a menu trigger element`);
5836
5836
  }
5837
5837
  let menuSubItem;
5838
5838
  if (isSubmenu) menuSubItem = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("data-slot") === "menu-sub");
@@ -6051,9 +6051,9 @@ function menu_default(Alpine) {
6051
6051
  el.removeEventListener("keydown", onKeyDown);
6052
6052
  });
6053
6053
  });
6054
- Alpine.directive("h-menu-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
6054
+ Alpine.directive("h-menu-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
6055
6055
  if (el.tagName !== "LI") {
6056
- throw new Error(`${original} must be a li element`);
6056
+ throw new Error(`${original2} must be a li element`);
6057
6057
  }
6058
6058
  el.classList.add(
6059
6059
  "focus:bg-secondary-hover",
@@ -6107,7 +6107,7 @@ function menu_default(Alpine) {
6107
6107
  el.removeEventListener("mouseleave", focusOut);
6108
6108
  });
6109
6109
  });
6110
- Alpine.directive("h-menu-sub", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
6110
+ Alpine.directive("h-menu-sub", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
6111
6111
  el.classList.add(
6112
6112
  "focus:bg-secondary-hover",
6113
6113
  "hover:bg-secondary-hover",
@@ -6139,7 +6139,7 @@ function menu_default(Alpine) {
6139
6139
  const chevronRight = createSvg({ icon: ChevronRight, classes: "size-4 ml-auto", attrs: { "aria-hidden": true, role: "presentation" } });
6140
6140
  el.appendChild(chevronRight);
6141
6141
  const parentMenu = Alpine2.findClosest(el.parentElement, (parent) => parent.getAttribute("role") === "menu");
6142
- if (!parentMenu) throw new Error(`${original} must have a parent`);
6142
+ if (!parentMenu) throw new Error(`${original2} must have a parent`);
6143
6143
  el._menu_sub = {
6144
6144
  open: void 0,
6145
6145
  close: void 0,
@@ -6233,9 +6233,9 @@ function menu_default(Alpine) {
6233
6233
  el.classList.add("text-foreground", "px-2", "py-1.5", "text-sm", "font-semibold", "text-left", "data-[inset=true]:pl-8");
6234
6234
  el.setAttribute("data-slot", "menu-label");
6235
6235
  });
6236
- Alpine.directive("h-menu-checkbox-item", (el, { original }, { cleanup, Alpine: Alpine2 }) => {
6236
+ Alpine.directive("h-menu-checkbox-item", (el, { original: original2 }, { cleanup, Alpine: Alpine2 }) => {
6237
6237
  if (el.tagName !== "LI" && el.tagName !== "DIV") {
6238
- throw new Error(`${original} must be a li or div element`);
6238
+ throw new Error(`${original2} must be a li or div element`);
6239
6239
  }
6240
6240
  el.classList.add(
6241
6241
  "focus:bg-secondary-hover",
@@ -6301,9 +6301,9 @@ function menu_default(Alpine) {
6301
6301
  el.removeEventListener("mouseleave", focusOut);
6302
6302
  });
6303
6303
  });
6304
- Alpine.directive("h-menu-radio-item", (el, { original, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
6304
+ Alpine.directive("h-menu-radio-item", (el, { original: original2, expression }, { effect, evaluateLater, cleanup, Alpine: Alpine2 }) => {
6305
6305
  if (el.tagName !== "LI" && el.tagName !== "DIV") {
6306
- throw new Error(`${original} must be a li or div element`);
6306
+ throw new Error(`${original2} must be a li or div element`);
6307
6307
  }
6308
6308
  el.classList.add(
6309
6309
  "focus:bg-secondary-hover",
@@ -6531,7 +6531,7 @@ function popover_default(Alpine) {
6531
6531
  });
6532
6532
  }
6533
6533
  });
6534
- Alpine.directive("h-popover", (el, { original, modifiers }, { effect }) => {
6534
+ Alpine.directive("h-popover", (el, { original: original2, modifiers }, { effect }) => {
6535
6535
  const popover = (() => {
6536
6536
  let sibling = el.previousElementSibling;
6537
6537
  while (sibling && !sibling.hasOwnProperty("_popover")) {
@@ -6540,7 +6540,7 @@ function popover_default(Alpine) {
6540
6540
  return sibling;
6541
6541
  })();
6542
6542
  if (!popover) {
6543
- throw new Error(`${original} must be placed after a popover element`);
6543
+ throw new Error(`${original2} must be placed after a popover element`);
6544
6544
  }
6545
6545
  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");
6546
6546
  el.setAttribute("data-slot", "popover");
@@ -6742,13 +6742,13 @@ function select_default(Alpine) {
6742
6742
  });
6743
6743
  }
6744
6744
  });
6745
- Alpine.directive("h-select-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
6745
+ Alpine.directive("h-select-input", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
6746
6746
  if (el.tagName !== "INPUT") {
6747
- throw new Error(`${original} must be a readonly input of type "text"`);
6747
+ throw new Error(`${original2} must be a readonly input of type "text"`);
6748
6748
  }
6749
6749
  const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
6750
6750
  if (!select) {
6751
- throw new Error(`${original} must be inside a select element`);
6751
+ throw new Error(`${original2} must be inside a select element`);
6752
6752
  } else if (el.hasOwnProperty("_x_model")) {
6753
6753
  select._h_select.multiple = Array.isArray(el._x_model.get());
6754
6754
  select._h_model.set = (value) => {
@@ -7001,10 +7001,10 @@ function select_default(Alpine) {
7001
7001
  observer.disconnect();
7002
7002
  });
7003
7003
  });
7004
- Alpine.directive("h-select-content", (el, { original }, { effect, Alpine: Alpine2 }) => {
7004
+ Alpine.directive("h-select-content", (el, { original: original2 }, { effect, Alpine: Alpine2 }) => {
7005
7005
  const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
7006
7006
  if (!select) {
7007
- throw new Error(`${original} must be inside a select element`);
7007
+ throw new Error(`${original2} must be inside a select element`);
7008
7008
  }
7009
7009
  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");
7010
7010
  el.setAttribute("data-slot", "select-content");
@@ -7015,7 +7015,7 @@ function select_default(Alpine) {
7015
7015
  el.setAttribute("data-state", select._h_select.expanded ? "open" : "closed");
7016
7016
  const control = select.querySelector(`#${select._h_select.id}`);
7017
7017
  if (!control) {
7018
- throw new Error(`${original}: trigger not found`);
7018
+ throw new Error(`${original2}: trigger not found`);
7019
7019
  }
7020
7020
  let autoUpdateCleanup;
7021
7021
  function updatePosition() {
@@ -7057,10 +7057,10 @@ function select_default(Alpine) {
7057
7057
  }
7058
7058
  });
7059
7059
  });
7060
- Alpine.directive("h-select-search", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
7060
+ Alpine.directive("h-select-search", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
7061
7061
  const select = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
7062
7062
  if (!select) {
7063
- throw new Error(`${original} must be inside an h-select element`);
7063
+ throw new Error(`${original2} must be inside an h-select element`);
7064
7064
  } else {
7065
7065
  select._h_select.filterType = FilterType[el.getAttribute("data-filter")] ?? FilterType["starts-with"];
7066
7066
  }
@@ -7132,10 +7132,10 @@ function select_default(Alpine) {
7132
7132
  selectGroup._h_selectGroup.labelledby = id;
7133
7133
  }
7134
7134
  });
7135
- Alpine.directive("h-select-option", (el, { original, expression }, { effect, evaluateLater, cleanup }) => {
7135
+ Alpine.directive("h-select-option", (el, { original: original2, expression }, { effect, evaluateLater, cleanup }) => {
7136
7136
  const select = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_select"));
7137
7137
  if (!select) {
7138
- throw new Error(`${original} must be inside an h-select element`);
7138
+ throw new Error(`${original2} must be inside an h-select element`);
7139
7139
  }
7140
7140
  el.classList.add(
7141
7141
  "focus:bg-primary",
@@ -7420,6 +7420,11 @@ function sidebar_default(Alpine) {
7420
7420
  "md:after:hidden",
7421
7421
  "group-data-[collapsed=true]/sidebar:hidden"
7422
7422
  );
7423
+ if (el.tagName !== "BUTTON") {
7424
+ el.setAttribute("role", "button");
7425
+ } else {
7426
+ el.setAttribute("type", "button");
7427
+ }
7423
7428
  el.setAttribute("data-slot", "sidebar-group-action");
7424
7429
  });
7425
7430
  Alpine.directive("h-sidebar-group-content", (el) => {
@@ -7430,11 +7435,18 @@ function sidebar_default(Alpine) {
7430
7435
  el.classList.add("vbox", "w-full", "min-w-0", "gap-1");
7431
7436
  el.setAttribute("data-slot", "sidebar-menu");
7432
7437
  });
7433
- Alpine.directive("h-sidebar-menu-item", (el) => {
7438
+ Alpine.directive("h-sidebar-menu-item", (el, { original: original2 }) => {
7439
+ if (el.tagName !== "BUTTON") {
7440
+ throw new Error(`${original2} must be a button`);
7441
+ }
7434
7442
  el.classList.add("group/menu-item", "relative");
7443
+ el.setAttribute("type", "button");
7435
7444
  el.setAttribute("data-slot", "sidebar-menu-item");
7436
7445
  });
7437
7446
  Alpine.directive("h-sidebar-menu-button", (el) => {
7447
+ if (el.tagName !== "BUTTON") {
7448
+ throw new Error(`${original} must be a button`);
7449
+ }
7438
7450
  el.classList.add(
7439
7451
  "peer/menu-button",
7440
7452
  "flex",
@@ -7474,6 +7486,7 @@ function sidebar_default(Alpine) {
7474
7486
  "[&>svg]:shrink-0",
7475
7487
  "[&>svg:not(:first-child):last-child]:ml-auto"
7476
7488
  );
7489
+ el.setAttribute("type", "button");
7477
7490
  if (!el.hasAttribute("data-slot")) el.setAttribute("data-slot", "sidebar-menu-button");
7478
7491
  const sizes = {
7479
7492
  default: ["h-8", "text-sm"],
@@ -7521,6 +7534,11 @@ function sidebar_default(Alpine) {
7521
7534
  if (modifiers.includes("autohide")) {
7522
7535
  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");
7523
7536
  }
7537
+ if (el.tagName !== "BUTTON") {
7538
+ el.setAttribute("role", "button");
7539
+ } else {
7540
+ el.setAttribute("type", "button");
7541
+ }
7524
7542
  el.setAttribute("data-slot", "sidebar-menu-action");
7525
7543
  });
7526
7544
  Alpine.directive("h-sidebar-menu-badge", (el) => {
@@ -7579,6 +7597,9 @@ function sidebar_default(Alpine) {
7579
7597
  el.setAttribute("data-slot", "sidebar-menu-sub-item");
7580
7598
  });
7581
7599
  Alpine.directive("h-sidebar-menu-sub-button", (el) => {
7600
+ if (el.tagName !== "BUTTON") {
7601
+ throw new Error(`${original} must be a button`);
7602
+ }
7582
7603
  el.classList.add(
7583
7604
  "text-sidebar-foreground",
7584
7605
  "ring-sidebar-ring",
@@ -7613,6 +7634,7 @@ function sidebar_default(Alpine) {
7613
7634
  "data-[active=true]:text-sidebar-primary-foreground",
7614
7635
  "group-data-[collapsed=true]/sidebar:hidden"
7615
7636
  );
7637
+ el.setAttribute("type", "button");
7616
7638
  el.setAttribute("data-slot", "sidebar-menu-sub-button");
7617
7639
  const sizes = {
7618
7640
  sm: ["text-xs"],
@@ -7875,10 +7897,10 @@ function split_default(Alpine) {
7875
7897
  observer.disconnect();
7876
7898
  });
7877
7899
  });
7878
- Alpine.directive("h-split-panel", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
7900
+ Alpine.directive("h-split-panel", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
7879
7901
  const split = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_split"));
7880
7902
  if (!split) {
7881
- throw new Error(`${original} must be inside an split element`);
7903
+ throw new Error(`${original2} must be inside an split element`);
7882
7904
  }
7883
7905
  el.classList.add("flex", "shrink", "grow-0", "box-border", "min-w-0", "min-h-0", "overflow-visible");
7884
7906
  el.setAttribute("tabindex", "-1");
@@ -8398,7 +8420,7 @@ function tabs_default(Alpine) {
8398
8420
  el.setAttribute("role", "tablist");
8399
8421
  el.setAttribute("data-slot", "tab-list");
8400
8422
  });
8401
- Alpine.directive("h-tab", (el, { original }) => {
8423
+ Alpine.directive("h-tab", (el, { original: original2 }) => {
8402
8424
  el.classList.add(
8403
8425
  "cursor-pointer",
8404
8426
  "focus-visible:border-ring",
@@ -8445,8 +8467,8 @@ function tabs_default(Alpine) {
8445
8467
  );
8446
8468
  el.setAttribute("role", "tab");
8447
8469
  el.setAttribute("data-slot", "tab");
8448
- if (!el.hasAttribute("id")) throw new Error(`${original}: Tabs must have an id`);
8449
- if (!el.hasAttribute("aria-controls")) throw new Error(`${original}: aria-controls must be set to the tab-content id.`);
8470
+ if (!el.hasAttribute("id")) throw new Error(`${original2}: Tabs must have an id`);
8471
+ if (!el.hasAttribute("aria-controls")) throw new Error(`${original2}: aria-controls must be set to the tab-content id.`);
8450
8472
  });
8451
8473
  Alpine.directive("h-tab-action", (el) => {
8452
8474
  el.classList.add("cursor-pointer", "ml-auto", "rounded-md", "text-foreground", "hover:bg-secondary", "hover:text-secondary-foreground", "active:bg-secondary-active");
@@ -8480,13 +8502,13 @@ function tabs_default(Alpine) {
8480
8502
  el.setAttribute("role", "button");
8481
8503
  el.setAttribute("data-slot", "tab-list-action");
8482
8504
  });
8483
- Alpine.directive("h-tabs-content", (el, { original }) => {
8505
+ Alpine.directive("h-tabs-content", (el, { original: original2 }) => {
8484
8506
  el.classList.add("flex-1", "outline-none");
8485
8507
  el.setAttribute("role", "tabpanel");
8486
8508
  el.setAttribute("tabindex", "0");
8487
8509
  el.setAttribute("data-slot", "tabs-content");
8488
- if (!el.hasAttribute("id")) throw new Error(`${original}: Tab content must have an id`);
8489
- if (!el.hasAttribute("aria-labelledby")) throw new Error(`${original}: aria-labelledby must be set to the tab id.`);
8510
+ if (!el.hasAttribute("id")) throw new Error(`${original2}: Tab content must have an id`);
8511
+ if (!el.hasAttribute("aria-labelledby")) throw new Error(`${original2}: aria-labelledby must be set to the tab id.`);
8490
8512
  });
8491
8513
  }
8492
8514
 
@@ -8879,13 +8901,13 @@ function timepicker_default(Alpine) {
8879
8901
  top.removeEventListener("click", el._h_timepicker.close);
8880
8902
  });
8881
8903
  });
8882
- Alpine.directive("h-time-picker-input", (el, { original }, { effect, cleanup, Alpine: Alpine2 }) => {
8904
+ Alpine.directive("h-time-picker-input", (el, { original: original2 }, { effect, cleanup, Alpine: Alpine2 }) => {
8883
8905
  if (el.tagName !== "INPUT") {
8884
- throw new Error(`${original} must be a readonly input of type "text"`);
8906
+ throw new Error(`${original2} must be a readonly input of type "text"`);
8885
8907
  }
8886
8908
  const timepicker = Alpine2.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_timepicker"));
8887
8909
  if (!timepicker) {
8888
- throw new Error(`${original} must be inside a time-picker element`);
8910
+ throw new Error(`${original2} must be inside a time-picker element`);
8889
8911
  }
8890
8912
  timepicker._h_timepicker.focusInput = () => {
8891
8913
  el.focus();
@@ -9534,7 +9556,7 @@ function tooltip_default(Alpine) {
9534
9556
  el.removeEventListener("pointerleave", handler);
9535
9557
  });
9536
9558
  });
9537
- Alpine.directive("h-tooltip", (el, { original }, { effect }) => {
9559
+ Alpine.directive("h-tooltip", (el, { original: original2 }, { effect }) => {
9538
9560
  const tooltip = (() => {
9539
9561
  let sibling = el.previousElementSibling;
9540
9562
  while (sibling && !sibling.hasOwnProperty("_tooltip")) {
@@ -9543,7 +9565,7 @@ function tooltip_default(Alpine) {
9543
9565
  return sibling;
9544
9566
  })();
9545
9567
  if (!tooltip) {
9546
- throw new Error(`${original} must be placed after a tooltip trigger element`);
9568
+ throw new Error(`${original2} must be placed after a tooltip trigger element`);
9547
9569
  }
9548
9570
  el.classList.add("absolute", "bg-foreground", "text-background", "z-50", "w-fit", "rounded-md", "px-3", "py-1.5", "text-xs", "text-balance");
9549
9571
  el.setAttribute("data-slot", "tooltip");
@@ -9749,9 +9771,9 @@ function tree_default(Alpine) {
9749
9771
  });
9750
9772
  }
9751
9773
  });
9752
- Alpine.directive("h-tree-button", (el, { original }, { effect }) => {
9774
+ Alpine.directive("h-tree-button", (el, { original: original2 }, { effect }) => {
9753
9775
  const treeItem = Alpine.findClosest(el.parentElement, (parent) => parent.hasOwnProperty("_h_tree_item"));
9754
- if (!treeItem) throw new Error(`${original} must be inside a tree item`);
9776
+ if (!treeItem) throw new Error(`${original2} must be inside a tree item`);
9755
9777
  el.classList.add(
9756
9778
  "flex",
9757
9779
  "w-full",
@@ -9814,7 +9836,7 @@ function tree_default(Alpine) {
9814
9836
  }
9815
9837
 
9816
9838
  // package.json
9817
- var version = "1.2.0";
9839
+ var version = "1.2.1";
9818
9840
 
9819
9841
  // src/utils/breakpoint-listener.js
9820
9842
  function getBreakpointListener(handler, breakpoint = 768) {
@@ -9921,7 +9943,7 @@ function focus_default(Alpine) {
9921
9943
 
9922
9944
  // src/utils/template.js
9923
9945
  function template_default(Alpine) {
9924
- Alpine.directive("h-template", (el, { original, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
9946
+ Alpine.directive("h-template", (el, { original: original2, expression }, { evaluate: evaluate2, Alpine: Alpine2, cleanup }) => {
9925
9947
  if (el.hasAttribute(Alpine2.prefixed("data"))) {
9926
9948
  const template = evaluate2(expression);
9927
9949
  const clone = template.content.cloneNode(true).firstElementChild;
@@ -9935,7 +9957,7 @@ function template_default(Alpine) {
9935
9957
  clone.remove();
9936
9958
  });
9937
9959
  } else {
9938
- console.error(`${original}: ${Alpine2.prefixed("data")} directive is missing`);
9960
+ console.error(`${original2}: ${Alpine2.prefixed("data")} directive is missing`);
9939
9961
  }
9940
9962
  });
9941
9963
  }