@codbex/harmonia 0.9.1 → 1.0.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.
@@ -19586,24 +19586,20 @@ var setButtonClasses = (el) => {
19586
19586
  "invalid:!border-negative"
19587
19587
  );
19588
19588
  };
19589
- var getButtonSize = (size3, inGroup = false) => {
19589
+ var getButtonSize = (size3, isAddon = false) => {
19590
19590
  switch (size3) {
19591
- case "xs":
19592
- return 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"];
19593
19591
  case "sm":
19594
- return inGroup ? ["h-8", "px-2.5", "gap-1.5", "has-[>svg]:px-2.5"] : ["h-8", "gap-1.5", "px-3", "has-[>svg]:px-2.5"];
19595
- case "lg":
19596
- return ["h-10", "px-6", "has-[>svg]:px-4"];
19597
- case "icon-xs":
19598
- return inGroup ? ["size-6", "p-0", "has-[>svg]:p-0"] : ["size-6.5"];
19592
+ return isAddon ? ["h-6", "[[data-slot=input-group][data-size=sm]_&]:h-5", "gap-1", "px-2", "[&>svg:not([class*='size-'])]:size-3.5", "has-[>svg]:px-2", "has-[>[data-slot=spinner]]:px-2"] : ["h-6.5", "gap-1.5", "px-2.5", "has-[>svg]:px-2", "has-[>[data-slot=spinner]]:px-2"];
19593
+ case "md":
19594
+ return isAddon ? ["h-8", "px-2.5", "gap-1.5", "has-[>svg]:px-2.5", "has-[>[data-slot=spinner]]:px-2.5"] : ["h-8", "gap-1.5", "px-3", "has-[>svg]:px-2.5", "has-[>[data-slot=spinner]]:px-2.5"];
19599
19595
  case "icon-sm":
19600
- return inGroup ? ["size-8", "p-0", "has-[>svg]:p-0"] : ["size-8"];
19596
+ return isAddon ? ["size-6", "[[data-slot=input-group][data-size=sm]_&]:size-5", "p-0", "has-[>svg]:p-0", "has-[>[data-slot=spinner]]:p-0"] : ["size-6.5"];
19597
+ case "icon-md":
19598
+ return isAddon ? ["size-8", "p-0", "has-[>svg]:p-0"] : ["size-8"];
19601
19599
  case "icon":
19602
19600
  return ["size-9"];
19603
- case "icon-lg":
19604
- return ["size-10"];
19605
19601
  default:
19606
- return ["h-9", "px-4", "py-2", "has-[>svg]:px-3"];
19602
+ return ["h-9", "px-4", "py-2", "has-[>svg]:px-3", "has-[>[data-slot=spinner]]:px-3"];
19607
19603
  }
19608
19604
  };
19609
19605
  function button_default(Alpine) {
@@ -19612,7 +19608,7 @@ function button_default(Alpine) {
19612
19608
  if (!el.hasAttribute("data-slot")) {
19613
19609
  el.setAttribute("data-slot", "button");
19614
19610
  }
19615
- const inGroup = modifiers.includes("group");
19611
+ const isAddon = modifiers.includes("addon");
19616
19612
  let lastSize;
19617
19613
  function setVariant(variant) {
19618
19614
  for (const [_, value] of Object.entries(buttonVariants)) {
@@ -19620,34 +19616,34 @@ function button_default(Alpine) {
19620
19616
  }
19621
19617
  if (buttonVariants.hasOwnProperty(variant)) el.classList.add(...buttonVariants[variant]);
19622
19618
  }
19623
- function setSize(size3 = "default") {
19624
- el.classList.remove(...getButtonSize(lastSize, inGroup));
19625
- el.classList.add(...getButtonSize(size3, inGroup));
19619
+ function setSize2(size3 = "default") {
19620
+ el.classList.remove(...getButtonSize(lastSize, isAddon));
19621
+ el.classList.add(...getButtonSize(size3, isAddon));
19626
19622
  if (size3.startsWith("icon") && !el.hasAttribute("aria-labelledby") && !el.hasAttribute("aria-label")) {
19627
19623
  console.error(`${original}: Icon-only buttons must have an "aria-label" or "aria-labelledby" attribute`, el);
19628
19624
  }
19629
19625
  lastSize = size3;
19630
19626
  }
19631
19627
  setVariant(el.getAttribute("data-variant") ?? "default");
19632
- if (inGroup) {
19628
+ if (isAddon) {
19633
19629
  el.classList.remove("shadow-button", "inline-flex");
19634
19630
  el.classList.add("shadow-none", "flex");
19635
- setSize(el.getAttribute("data-size") ?? "xs");
19631
+ setSize2(el.getAttribute("data-size") ?? "sm");
19636
19632
  } else {
19637
19633
  if (el.hasAttribute("data-size")) {
19638
- setSize(el.getAttribute("data-size"));
19634
+ setSize2(el.getAttribute("data-size"));
19639
19635
  } else {
19640
19636
  if (["date-picker-trigger", "time-picker-trigger"].includes(el.getAttribute("data-slot"))) {
19641
- setSize("icon-xs");
19637
+ setSize2("icon-sm");
19642
19638
  } else {
19643
- setSize();
19639
+ setSize2();
19644
19640
  }
19645
19641
  }
19646
19642
  }
19647
19643
  const observer = new MutationObserver((mutations) => {
19648
19644
  mutations.forEach((mutation) => {
19649
19645
  if (mutation.attributeName === "data-variant") setVariant(el.getAttribute("data-variant") ?? "default");
19650
- else setSize(el.getAttribute("data-size") ?? (inGroup ? "xs" : "default"));
19646
+ else setSize2(el.getAttribute("data-size") ?? (isAddon ? "sm" : "default"));
19651
19647
  });
19652
19648
  });
19653
19649
  observer.observe(el, { attributes: true, attributeFilter: ["data-variant", "data-size"] });
@@ -21950,8 +21946,8 @@ function dialog_default(Alpine) {
21950
21946
  "flex-col",
21951
21947
  "w-full",
21952
21948
  "max-w-[calc(100%-2rem)]",
21953
- "translate-x-[-50%]",
21954
- "translate-y-[-50%]",
21949
+ "-translate-x-1/2",
21950
+ "-translate-y-1/2",
21955
21951
  "gap-4",
21956
21952
  "rounded-lg",
21957
21953
  "border",
@@ -22030,7 +22026,7 @@ function fieldset_default(Alpine) {
22030
22026
  el.setAttribute("data-slot", "field-group");
22031
22027
  });
22032
22028
  Alpine.directive("h-field", (el) => {
22033
- el.classList.add("group/field", "w-full", "gap-3", "data-[invalid=true]:text-negative");
22029
+ el.classList.add("group/field", "w-full", "gap-3", "has-[input:invalid]:text-negative", "has-[textarea:invalid]:text-negative", "has-[[aria-invalid=true]]:text-negative");
22034
22030
  switch (el.getAttribute("data-orientation")) {
22035
22031
  case "horizontal":
22036
22032
  el.classList.add("hbox", "items-center", "[&>[data-slot=field-label]]:flex-auto", "has-[>[data-slot=field-content]]:items-start", "has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px");
@@ -22077,9 +22073,32 @@ function fieldset_default(Alpine) {
22077
22073
  "[&>a]:underline-offset-4"
22078
22074
  );
22079
22075
  el.setAttribute("data-slot", "field-description");
22076
+ if (el.getAttribute("data-hide-on-error") === "true") {
22077
+ el.classList.add(
22078
+ "[[data-slot=field]_input:invalid~&]:hidden",
22079
+ "[[data-slot=field]_textarea:invalid~&]:hidden",
22080
+ "[[data-slot=field]_[aria-invalid=true]~&]:hidden",
22081
+ "group-has-[input:invalid]/field:hidden",
22082
+ "group-has-[textarea:invalid)]/field:hidden",
22083
+ "group-has-[[aria-invalid=true]]/field:hidden"
22084
+ );
22085
+ }
22080
22086
  });
22081
22087
  Alpine.directive("h-field-error", (el) => {
22082
- el.classList.add("text-negative", "text-sm", "font-normal");
22088
+ el.classList.add(
22089
+ "hidden",
22090
+ "[[data-slot=field]_input:invalid~&]:block",
22091
+ "[[data-slot=field]_textarea:invalid~&]:block",
22092
+ "[[data-slot=field]_[aria-invalid=true]~&]:block",
22093
+ "group-has-[input:invalid]/field:block",
22094
+ "group-has-[textarea:invalid)]/field:block",
22095
+ "group-has-[[aria-invalid=true]]/field:block",
22096
+ "text-negative",
22097
+ "text-sm",
22098
+ "leading-normal",
22099
+ "font-normal",
22100
+ "group-has-[[data-orientation=horizontal]]/field:text-balance"
22101
+ );
22083
22102
  el.setAttribute("data-slot", "field-error");
22084
22103
  });
22085
22104
  }
@@ -22144,20 +22163,35 @@ function info_page_default(Alpine) {
22144
22163
  });
22145
22164
  }
22146
22165
 
22166
+ // src/common/input-size.js
22167
+ function setSize(el, size3) {
22168
+ if (size3 === "sm") {
22169
+ el.classList.add("h-6.5");
22170
+ el.classList.remove("h-9");
22171
+ } else {
22172
+ el.classList.add("h-9");
22173
+ el.classList.remove("h-6.5");
22174
+ }
22175
+ }
22176
+ function sizeObserver(el) {
22177
+ const observer = new MutationObserver(() => {
22178
+ setSize(el, el.getAttribute("data-size"));
22179
+ });
22180
+ setSize(el, el.getAttribute("data-size"));
22181
+ observer.observe(el, { attributes: true, attributeFilter: ["data-size"] });
22182
+ return observer;
22183
+ }
22184
+
22147
22185
  // src/components/input.js
22148
22186
  function input_default(Alpine) {
22149
- Alpine.directive("h-input", (el, { modifiers }) => {
22187
+ Alpine.directive("h-input", (el, { modifiers }, { cleanup }) => {
22150
22188
  el.classList.add(
22151
22189
  "file:text-foreground",
22152
22190
  "placeholder:text-muted-foreground",
22153
22191
  "selection:bg-primary",
22154
22192
  "selection:text-primary-foreground",
22155
- "bg-input-inner",
22156
22193
  "border-input",
22157
- "w-full",
22158
22194
  "min-w-0",
22159
- "rounded-control",
22160
- "border",
22161
22195
  "[&:not([type='color'])]:px-3",
22162
22196
  "[&:not([type='color'])]:py-1",
22163
22197
  "[&[type='color']]:overflow-hidden",
@@ -22166,7 +22200,6 @@ function input_default(Alpine) {
22166
22200
  "[&::-webkit-color-swatch-wrapper]:rounded-0",
22167
22201
  "[&::-webkit-color-swatch-wrapper]:p-0",
22168
22202
  "text-base",
22169
- "shadow-input",
22170
22203
  "transition-[color,box-shadow]",
22171
22204
  "outline-none",
22172
22205
  "file:inline-flex",
@@ -22181,7 +22214,6 @@ function input_default(Alpine) {
22181
22214
  "md:text-sm",
22182
22215
  "focus-visible:border-ring",
22183
22216
  "focus-visible:ring-ring/50",
22184
- "focus-visible:ring-[calc(var(--spacing)*0.75)]",
22185
22217
  "aria-invalid:ring-negative/20",
22186
22218
  "dark:aria-invalid:ring-negative/40",
22187
22219
  "aria-invalid:border-negative",
@@ -22190,15 +22222,18 @@ function input_default(Alpine) {
22190
22222
  "invalid:!border-negative"
22191
22223
  );
22192
22224
  if (modifiers.includes("group")) {
22193
- el.classList.remove("rounded-control", "border", "bg-input-inner", "shadow-input", "focus-visible:ring-[calc(var(--spacing)*0.75)]");
22194
- el.classList.add("flex-1", "rounded-none", "border-0", "bg-transparent", "shadow-none", "focus-visible:ring-0");
22225
+ el.classList.add("h-full", "flex-1", "rounded-none", "border-0", "bg-transparent", "shadow-none", "focus-visible:ring-0");
22195
22226
  el.setAttribute("data-slot", "input-group-control");
22196
- } else el.setAttribute("data-slot", "input");
22197
- if (el.getAttribute("data-size") === "sm") el.classList.add("h-8");
22198
- else if (el.getAttribute("data-size") === "xs") el.classList.add("h-6.5");
22199
- else el.classList.add("h-9");
22227
+ } else {
22228
+ el.classList.add("w-full", "rounded-control", "border", "bg-input-inner", "shadow-input", "focus-visible:ring-[calc(var(--spacing)*0.75)]");
22229
+ el.setAttribute("data-slot", "input");
22230
+ const observer = sizeObserver(el);
22231
+ cleanup(() => {
22232
+ observer.disconnect();
22233
+ });
22234
+ }
22200
22235
  });
22201
- Alpine.directive("h-input-group", (el) => {
22236
+ Alpine.directive("h-input-group", (el, _, { cleanup }) => {
22202
22237
  el.classList.add(
22203
22238
  "group/input-group",
22204
22239
  "border-input",
@@ -22212,7 +22247,6 @@ function input_default(Alpine) {
22212
22247
  "shadow-input",
22213
22248
  "transition-[color,box-shadow]",
22214
22249
  "outline-none",
22215
- "h-9",
22216
22250
  "min-w-0",
22217
22251
  "has-[>textarea]:h-auto",
22218
22252
  "has-[>[data-align=inline-start]]:[&>input]:pl-2",
@@ -22232,6 +22266,10 @@ function input_default(Alpine) {
22232
22266
  );
22233
22267
  el.setAttribute("role", "group");
22234
22268
  el.setAttribute("data-slot", "input-group");
22269
+ const observer = sizeObserver(el);
22270
+ cleanup(() => {
22271
+ observer.disconnect();
22272
+ });
22235
22273
  });
22236
22274
  Alpine.directive("h-input-group-addon", (el, _, { cleanup }) => {
22237
22275
  el.classList.add(
@@ -22242,7 +22280,6 @@ function input_default(Alpine) {
22242
22280
  "items-center",
22243
22281
  "justify-center",
22244
22282
  "gap-2",
22245
- "py-1.5",
22246
22283
  "text-sm",
22247
22284
  "font-medium",
22248
22285
  "select-none",
@@ -22254,8 +22291,24 @@ function input_default(Alpine) {
22254
22291
  el.setAttribute("role", "group");
22255
22292
  el.setAttribute("data-slot", "input-group-addon");
22256
22293
  const variants = {
22257
- "inline-start": ["order-first", "pl-3", "has-[>button]:ml-[-0.45rem]", "has-[>[data-slot=tag]]:ml-[-0.35rem]"],
22258
- "inline-end": ["order-last", "pr-3", "has-[>button]:mr-[-0.45rem]", "has-[>[data-slot=tag]]:mr-[-0.35rem]"],
22294
+ "inline-start": [
22295
+ "order-first",
22296
+ "pl-3",
22297
+ "[[data-slot=input-group][data-size=sm]_&]:pl-1.25",
22298
+ "has-[>button]:pl-1.25",
22299
+ "[[data-slot=input-group][data-size=sm]_&]:has-[>button]:pl-0.5",
22300
+ "has-[>[data-slot|=tag]]:pl-1.5",
22301
+ "[[data-slot=input-group][data-size=sm]_&]:has-[>[data-slot|=tag]]:pl-0.5"
22302
+ ],
22303
+ "inline-end": [
22304
+ "order-last",
22305
+ "pr-3",
22306
+ "[[data-slot=input-group][data-size=sm]_&]:pr-1.25",
22307
+ "has-[>button]:pr-1.25",
22308
+ "[[data-slot=input-group][data-size=sm]_&]:has-[>button]:pr-0.5",
22309
+ "has-[>[data-slot|=tag]]:pr-1.5",
22310
+ "[[data-slot=input-group][data-size=sm]_&]:has-[>[data-slot|=tag]]:pr-0.5"
22311
+ ],
22259
22312
  "block-start": ["order-first", "w-full", "justify-start", "px-3", "pt-3", "[.border-b]:pb-3", "group-has-[>input]/input-group:pt-2.5"],
22260
22313
  "block-end": ["order-last", "w-full", "justify-start", "px-3", "pb-3", "[.border-t]:pt-3", "group-has-[>input]/input-group:pb-2.5"]
22261
22314
  };
@@ -22280,6 +22333,136 @@ function input_default(Alpine) {
22280
22333
  el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
22281
22334
  el.setAttribute("data-slot", "label");
22282
22335
  });
22336
+ Alpine.directive("h-input-number", (el, { original }, { cleanup }) => {
22337
+ el.classList.add(
22338
+ "group/input-number",
22339
+ "border-input",
22340
+ "bg-input-inner",
22341
+ "relative",
22342
+ "flex",
22343
+ "w-full",
22344
+ "items-center",
22345
+ "rounded-control",
22346
+ "border",
22347
+ "shadow-input",
22348
+ "transition-[color,box-shadow]",
22349
+ "outline-none",
22350
+ "min-w-0",
22351
+ "has-[[data-slot=input-number-control]:focus-visible]:border-ring",
22352
+ "has-[[data-slot=input-number-control]:focus-visible]:ring-ring/50",
22353
+ "has-[[data-slot=input-number-control]:focus-visible]:ring-[calc(var(--spacing)*0.75)]",
22354
+ "has-[[data-slot][aria-invalid=true]]:ring-negative/20",
22355
+ "has-[[data-slot][aria-invalid=true]]:border-negative",
22356
+ "dark:has-[[data-slot][aria-invalid=true]]:ring-negative/40"
22357
+ );
22358
+ el.setAttribute("role", "group");
22359
+ el.setAttribute("data-slot", "input-number");
22360
+ const input = el.querySelector("input");
22361
+ if (!input || input.getAttribute("type") !== "number") {
22362
+ throw new Error(`${original} must contain an input of type 'number'`);
22363
+ }
22364
+ if (!input.hasAttribute("type")) input.setAttribute("type", "number");
22365
+ if (!input.hasAttribute("inputmode")) input.setAttribute("inputmode", "numeric");
22366
+ if (!input.hasAttribute("aria-roledescription")) {
22367
+ input.setAttribute("aria-roledescription", "Number field");
22368
+ }
22369
+ if (!input.hasAttribute("id")) {
22370
+ input.setAttribute("id", `in${v4_default()}`);
22371
+ }
22372
+ input.setAttribute("tabindex", "0");
22373
+ input.setAttribute("autocomplete", "off");
22374
+ input.setAttribute("autocorrect", "off");
22375
+ input.setAttribute("spellcheck", "off");
22376
+ input.setAttribute("data-slot", "input-number-control");
22377
+ input.classList.add("rounded-l-control", "size-full", "px-3", "py-1", "outline-none");
22378
+ const stepDown = document.createElement("button");
22379
+ stepDown.setAttribute("type", "button");
22380
+ stepDown.setAttribute("tabIndex", "-1");
22381
+ stepDown.setAttribute("aria-label", "Decrease");
22382
+ stepDown.setAttribute("aria-controls", input.getAttribute("id"));
22383
+ stepDown.setAttribute("data-slot", "step-up-trigger");
22384
+ stepDown.classList.add(
22385
+ "border-l",
22386
+ "border-input",
22387
+ "h-full",
22388
+ "aspect-square",
22389
+ "bg-transparent",
22390
+ "hover:bg-secondary",
22391
+ "active:bg-secondary-active",
22392
+ "outline-none",
22393
+ "relative",
22394
+ "before:block",
22395
+ "before:rounded-full",
22396
+ "before:h-0.5",
22397
+ "before:min-h-px",
22398
+ "before:w-3",
22399
+ "before:mx-auto",
22400
+ "before:bg-foreground",
22401
+ "before:hover:bg-secondary-foreground"
22402
+ );
22403
+ el.appendChild(stepDown);
22404
+ const onStepDown = () => {
22405
+ input.stepDown();
22406
+ input.dispatchEvent(new Event("input", { bubbles: true }));
22407
+ input.dispatchEvent(new Event("change", { bubbles: true }));
22408
+ };
22409
+ stepDown.addEventListener("click", onStepDown);
22410
+ const stepUp = document.createElement("button");
22411
+ stepUp.setAttribute("type", "button");
22412
+ stepUp.setAttribute("tabIndex", "-1");
22413
+ stepUp.setAttribute("aria-label", "Increase");
22414
+ stepUp.setAttribute("aria-controls", input.getAttribute("id"));
22415
+ stepUp.setAttribute("data-slot", "step-up-trigger");
22416
+ stepUp.classList.add(
22417
+ "border-l",
22418
+ "border-input",
22419
+ "rounded-r-control",
22420
+ "h-full",
22421
+ "aspect-square",
22422
+ "bg-transparent",
22423
+ "hover:bg-secondary",
22424
+ "active:bg-secondary-active",
22425
+ "outline-none",
22426
+ "relative",
22427
+ "before:block",
22428
+ "before:absolute",
22429
+ "before:rounded-full",
22430
+ "before:h-0.5",
22431
+ "before:min-h-px",
22432
+ "before:w-3",
22433
+ "before:top-1/2",
22434
+ "before:left-1/2",
22435
+ "before:-translate-x-1/2",
22436
+ "before:-translate-y-1/2",
22437
+ "before:bg-foreground",
22438
+ "before:hover:bg-secondary-foreground",
22439
+ "after:block",
22440
+ "after:absolute",
22441
+ "after:rounded-full",
22442
+ "after:h-3",
22443
+ "after:min-w-px",
22444
+ "after:w-0.5",
22445
+ "after:top-1/2",
22446
+ "after:left-1/2",
22447
+ "after:-translate-x-1/2",
22448
+ "after:-translate-y-1/2",
22449
+ "after:bg-foreground",
22450
+ "after:hover:bg-secondary-foreground"
22451
+ );
22452
+ el.appendChild(stepUp);
22453
+ const onStepUp = () => {
22454
+ input.stepUp();
22455
+ input.dispatchEvent(new Event("input", { bubbles: true }));
22456
+ input.dispatchEvent(new Event("change", { bubbles: true }));
22457
+ };
22458
+ stepUp.addEventListener("click", onStepUp);
22459
+ const observer = sizeObserver(el);
22460
+ cleanup(() => {
22461
+ observer.disconnect();
22462
+ stepDown.removeEventListener("click", onStepDown);
22463
+ stepUp.removeEventListener("click", onStepUp);
22464
+ });
22465
+ });
22283
22466
  }
22284
22467
 
22285
22468
  // src/components/label.js
@@ -23422,23 +23605,7 @@ function select_default(Alpine) {
23422
23605
  "[&_svg]:opacity-50"
23423
23606
  );
23424
23607
  el.setAttribute("data-slot", "select");
23425
- const setSize = (size3) => {
23426
- if (size3 === "sm") {
23427
- el.classList.add("h-8");
23428
- el.classList.remove("h-9", "h-6.5");
23429
- } else if (size3 === "xs") {
23430
- el.classList.add("h-6.5");
23431
- el.classList.remove("h-9", "h-8");
23432
- } else {
23433
- el.classList.add("h-9");
23434
- el.classList.remove("h-8", "h-6.5");
23435
- }
23436
- };
23437
- setSize(el.getAttribute("data-size"));
23438
- const observer = new MutationObserver(() => {
23439
- setSize(el.getAttribute("data-size"));
23440
- });
23441
- observer.observe(el, { attributes: true, attributeFilter: ["data-size"] });
23608
+ const observer = sizeObserver(el);
23442
23609
  cleanup(() => {
23443
23610
  observer.disconnect();
23444
23611
  });
@@ -24180,13 +24347,13 @@ function sidebar_default(Alpine) {
24180
24347
  sm: ["h-7", "text-xs"],
24181
24348
  lg: ["h-12", "text-sm", "group-data-[collapsed=true]/sidebar:p-0!"]
24182
24349
  };
24183
- function setSize(size3) {
24350
+ function setSize2(size3) {
24184
24351
  if (sizes.hasOwnProperty(size3)) {
24185
24352
  el.classList.add(...sizes[size3]);
24186
24353
  }
24187
24354
  }
24188
24355
  if (!el.hasAttribute("data-size")) el.setAttribute("data-size", "default");
24189
- setSize(el.getAttribute("data-size"));
24356
+ setSize2(el.getAttribute("data-size"));
24190
24357
  });
24191
24358
  Alpine.directive("h-sidebar-menu-action", (el, { modifiers }) => {
24192
24359
  el.classList.add(
@@ -24318,13 +24485,13 @@ function sidebar_default(Alpine) {
24318
24485
  sm: ["text-xs"],
24319
24486
  md: ["text-sm"]
24320
24487
  };
24321
- function setSize(size3) {
24488
+ function setSize2(size3) {
24322
24489
  if (sizes.hasOwnProperty(size3)) {
24323
24490
  el.classList.add(...sizes[size3]);
24324
24491
  }
24325
24492
  }
24326
24493
  if (!el.hasAttribute("data-size")) el.setAttribute("data-size", "md");
24327
- setSize(el.getAttribute("data-size"));
24494
+ setSize2(el.getAttribute("data-size"));
24328
24495
  });
24329
24496
  Alpine.directive("h-sidebar-footer", (el) => {
24330
24497
  el.classList.add("vbox", "gap-2", "px-2", "h-12", "justify-center", "border-t");
@@ -24340,10 +24507,10 @@ function skeleton_default(Alpine) {
24340
24507
  if (modifiers.includes("control")) {
24341
24508
  el.classList.add("rounded-control");
24342
24509
  switch (el.getAttribute("data-size")) {
24343
- case "xs":
24510
+ case "sm":
24344
24511
  el.classList.add("h-6.5");
24345
24512
  break;
24346
- case "sm":
24513
+ case "md":
24347
24514
  el.classList.add("h-8");
24348
24515
  break;
24349
24516
  default:
@@ -24362,7 +24529,20 @@ function skeleton_default(Alpine) {
24362
24529
  // src/components/spinner.js
24363
24530
  function spinner_default(Alpine) {
24364
24531
  Alpine.directive("h-spinner", (el) => {
24365
- el.classList.add("size-4", "border-2", "border-x-primary", "border-b-primary", "border-t-transparent", "rounded-full", "animate-spin");
24532
+ el.classList.add(
24533
+ "size-4",
24534
+ "border-2",
24535
+ "border-primary",
24536
+ "[[data-slot=button]_&]:border-secondary-foreground",
24537
+ "[[data-slot=button][data-variant=primary]_&]:border-primary-foreground",
24538
+ "[[data-slot=button][data-variant=positive]_&]:border-positive-foreground",
24539
+ "[[data-slot=button][data-variant=negative]_&]:border-negative-foreground",
24540
+ "[[data-slot=button][data-variant=warning]_&]:border-warning-foreground",
24541
+ "[[data-slot=button][data-variant=information]_&]:border-information-foreground",
24542
+ "!border-t-transparent",
24543
+ "rounded-full",
24544
+ "animate-spin"
24545
+ );
24366
24546
  el.setAttribute("role", "status");
24367
24547
  el.setAttribute("data-slot", "spinner");
24368
24548
  if (!el.hasAttribute("aria-label")) el.setAttribute("aria-label", "Loading");
@@ -24921,6 +25101,10 @@ function tile_default(Alpine) {
24921
25101
  "group/tile",
24922
25102
  "flex",
24923
25103
  "items-center",
25104
+ "py-3",
25105
+ "px-4",
25106
+ "has-data-[slot=tile-header]:py-4",
25107
+ "gap-2.5",
24924
25108
  "text-sm",
24925
25109
  "rounded-lg",
24926
25110
  "transition-colors",
@@ -24935,14 +25119,6 @@ function tile_default(Alpine) {
24935
25119
  "focus-visible:ring-[calc(var(--spacing)*0.75)]"
24936
25120
  );
24937
25121
  el.setAttribute("data-slot", "tile");
24938
- const sizes = {
24939
- default: ["p-4", "gap-4"],
24940
- sm: ["py-3", "px-4", "gap-2.5"]
24941
- };
24942
- function setSize(size3) {
24943
- el.classList.add(...sizes[size3]);
24944
- el.setAttribute("data-size", size3);
24945
- }
24946
25122
  switch (el.getAttribute("data-variant")) {
24947
25123
  case "outline":
24948
25124
  el.classList.add("border", "border-border");
@@ -24956,9 +25132,6 @@ function tile_default(Alpine) {
24956
25132
  default:
24957
25133
  el.classList.add("border", "bg-transparent", "border-transparent");
24958
25134
  }
24959
- if (el.getAttribute("data-size") === "sm") {
24960
- setSize("sm");
24961
- } else setSize("sm");
24962
25135
  });
24963
25136
  Alpine.directive("h-tile-header", (el) => {
24964
25137
  el.classList.add("flex", "basis-full", "items-center", "justify-between", "gap-2");
@@ -26091,7 +26264,7 @@ function tree_default(Alpine) {
26091
26264
  }
26092
26265
 
26093
26266
  // package.json
26094
- var version = "0.9.1";
26267
+ var version = "1.0.0";
26095
26268
 
26096
26269
  // src/utils/breakpoint-listener.js
26097
26270
  function getBreakpointListener(handler, breakpoint = 768) {