@codbex/harmonia 0.9.0 → 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.
- package/README.md +3 -3
- package/dist/harmonia.css +1 -1
- package/dist/harmonia.esm.js +292 -93
- package/dist/harmonia.esm.min.js +3 -3
- package/dist/harmonia.esm.min.js.map +4 -4
- package/dist/harmonia.js +292 -93
- package/dist/harmonia.min.js +2 -2
- package/dist/harmonia.min.js.map +4 -4
- package/package.json +2 -2
package/dist/harmonia.esm.js
CHANGED
|
@@ -19586,24 +19586,20 @@ var setButtonClasses = (el) => {
|
|
|
19586
19586
|
"invalid:!border-negative"
|
|
19587
19587
|
);
|
|
19588
19588
|
};
|
|
19589
|
-
var getButtonSize = (size3,
|
|
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
|
|
19595
|
-
case "
|
|
19596
|
-
return ["h-
|
|
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
|
|
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
|
|
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
|
|
19624
|
-
el.classList.remove(...getButtonSize(lastSize,
|
|
19625
|
-
el.classList.add(...getButtonSize(size3,
|
|
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 (
|
|
19628
|
+
if (isAddon) {
|
|
19633
19629
|
el.classList.remove("shadow-button", "inline-flex");
|
|
19634
19630
|
el.classList.add("shadow-none", "flex");
|
|
19635
|
-
|
|
19631
|
+
setSize2(el.getAttribute("data-size") ?? "sm");
|
|
19636
19632
|
} else {
|
|
19637
19633
|
if (el.hasAttribute("data-size")) {
|
|
19638
|
-
|
|
19634
|
+
setSize2(el.getAttribute("data-size"));
|
|
19639
19635
|
} else {
|
|
19640
19636
|
if (["date-picker-trigger", "time-picker-trigger"].includes(el.getAttribute("data-slot"))) {
|
|
19641
|
-
|
|
19637
|
+
setSize2("icon-sm");
|
|
19642
19638
|
} else {
|
|
19643
|
-
|
|
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
|
|
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"] });
|
|
@@ -21174,7 +21170,7 @@ function calendar_default(Alpine) {
|
|
|
21174
21170
|
el.classList.add("border", "rounded-control", "gap-2", "p-2");
|
|
21175
21171
|
el.setAttribute("tabindex", "-1");
|
|
21176
21172
|
if (datepicker) {
|
|
21177
|
-
el.classList.add("
|
|
21173
|
+
el.classList.add("absolute", "bg-popover", "text-popover-foreground", "data-[state=open]:flex", "data-[state=open]:flex-col", "data-[state=closed]:hidden", "z-50", "shadow-md");
|
|
21178
21174
|
el.setAttribute("role", "dialog");
|
|
21179
21175
|
el.setAttribute("aria-modal", "true");
|
|
21180
21176
|
el.setAttribute("data-slot", "date-picker-calendar");
|
|
@@ -21604,7 +21600,6 @@ function calendar_default(Alpine) {
|
|
|
21604
21600
|
function updatePosition() {
|
|
21605
21601
|
computePosition2(datepicker, el, {
|
|
21606
21602
|
placement: el.getAttribute("data-align") || "bottom-start",
|
|
21607
|
-
strategy: "fixed",
|
|
21608
21603
|
middleware: [offset2(4), flip2(), shift2({ padding: 4 })]
|
|
21609
21604
|
}).then(({ x, y }) => {
|
|
21610
21605
|
Object.assign(el.style, {
|
|
@@ -21830,7 +21825,19 @@ function datepicker_default(Alpine) {
|
|
|
21830
21825
|
"dark:has-[input:invalid]:ring-negative/40"
|
|
21831
21826
|
);
|
|
21832
21827
|
el.setAttribute("data-slot", "date-picker");
|
|
21833
|
-
el._h_datepicker.input.classList.add(
|
|
21828
|
+
el._h_datepicker.input.classList.add(
|
|
21829
|
+
"bg-transparent",
|
|
21830
|
+
"outline-none",
|
|
21831
|
+
"flex-1",
|
|
21832
|
+
"h-full",
|
|
21833
|
+
"border-0",
|
|
21834
|
+
"focus-visible:ring-0",
|
|
21835
|
+
"disabled:pointer-events-none",
|
|
21836
|
+
"disabled:cursor-not-allowed",
|
|
21837
|
+
"disabled:opacity-50",
|
|
21838
|
+
"md:text-sm",
|
|
21839
|
+
"text-base"
|
|
21840
|
+
);
|
|
21834
21841
|
el._h_datepicker.input.setAttribute("aria-autocomplete", "none");
|
|
21835
21842
|
el._h_datepicker.input.setAttribute("type", "text");
|
|
21836
21843
|
});
|
|
@@ -21939,8 +21946,8 @@ function dialog_default(Alpine) {
|
|
|
21939
21946
|
"flex-col",
|
|
21940
21947
|
"w-full",
|
|
21941
21948
|
"max-w-[calc(100%-2rem)]",
|
|
21942
|
-
"translate-x-
|
|
21943
|
-
"translate-y-
|
|
21949
|
+
"-translate-x-1/2",
|
|
21950
|
+
"-translate-y-1/2",
|
|
21944
21951
|
"gap-4",
|
|
21945
21952
|
"rounded-lg",
|
|
21946
21953
|
"border",
|
|
@@ -22019,7 +22026,7 @@ function fieldset_default(Alpine) {
|
|
|
22019
22026
|
el.setAttribute("data-slot", "field-group");
|
|
22020
22027
|
});
|
|
22021
22028
|
Alpine.directive("h-field", (el) => {
|
|
22022
|
-
el.classList.add("group/field", "w-full", "gap-3", "
|
|
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");
|
|
22023
22030
|
switch (el.getAttribute("data-orientation")) {
|
|
22024
22031
|
case "horizontal":
|
|
22025
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");
|
|
@@ -22066,9 +22073,32 @@ function fieldset_default(Alpine) {
|
|
|
22066
22073
|
"[&>a]:underline-offset-4"
|
|
22067
22074
|
);
|
|
22068
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
|
+
}
|
|
22069
22086
|
});
|
|
22070
22087
|
Alpine.directive("h-field-error", (el) => {
|
|
22071
|
-
el.classList.add(
|
|
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
|
+
);
|
|
22072
22102
|
el.setAttribute("data-slot", "field-error");
|
|
22073
22103
|
});
|
|
22074
22104
|
}
|
|
@@ -22133,20 +22163,35 @@ function info_page_default(Alpine) {
|
|
|
22133
22163
|
});
|
|
22134
22164
|
}
|
|
22135
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
|
+
|
|
22136
22185
|
// src/components/input.js
|
|
22137
22186
|
function input_default(Alpine) {
|
|
22138
|
-
Alpine.directive("h-input", (el, { modifiers }) => {
|
|
22187
|
+
Alpine.directive("h-input", (el, { modifiers }, { cleanup }) => {
|
|
22139
22188
|
el.classList.add(
|
|
22140
22189
|
"file:text-foreground",
|
|
22141
22190
|
"placeholder:text-muted-foreground",
|
|
22142
22191
|
"selection:bg-primary",
|
|
22143
22192
|
"selection:text-primary-foreground",
|
|
22144
|
-
"bg-input-inner",
|
|
22145
22193
|
"border-input",
|
|
22146
|
-
"w-full",
|
|
22147
22194
|
"min-w-0",
|
|
22148
|
-
"rounded-control",
|
|
22149
|
-
"border",
|
|
22150
22195
|
"[&:not([type='color'])]:px-3",
|
|
22151
22196
|
"[&:not([type='color'])]:py-1",
|
|
22152
22197
|
"[&[type='color']]:overflow-hidden",
|
|
@@ -22155,7 +22200,6 @@ function input_default(Alpine) {
|
|
|
22155
22200
|
"[&::-webkit-color-swatch-wrapper]:rounded-0",
|
|
22156
22201
|
"[&::-webkit-color-swatch-wrapper]:p-0",
|
|
22157
22202
|
"text-base",
|
|
22158
|
-
"shadow-input",
|
|
22159
22203
|
"transition-[color,box-shadow]",
|
|
22160
22204
|
"outline-none",
|
|
22161
22205
|
"file:inline-flex",
|
|
@@ -22170,7 +22214,6 @@ function input_default(Alpine) {
|
|
|
22170
22214
|
"md:text-sm",
|
|
22171
22215
|
"focus-visible:border-ring",
|
|
22172
22216
|
"focus-visible:ring-ring/50",
|
|
22173
|
-
"focus-visible:ring-[calc(var(--spacing)*0.75)]",
|
|
22174
22217
|
"aria-invalid:ring-negative/20",
|
|
22175
22218
|
"dark:aria-invalid:ring-negative/40",
|
|
22176
22219
|
"aria-invalid:border-negative",
|
|
@@ -22179,15 +22222,18 @@ function input_default(Alpine) {
|
|
|
22179
22222
|
"invalid:!border-negative"
|
|
22180
22223
|
);
|
|
22181
22224
|
if (modifiers.includes("group")) {
|
|
22182
|
-
el.classList.
|
|
22183
|
-
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");
|
|
22184
22226
|
el.setAttribute("data-slot", "input-group-control");
|
|
22185
|
-
} else
|
|
22186
|
-
|
|
22187
|
-
|
|
22188
|
-
|
|
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
|
+
}
|
|
22189
22235
|
});
|
|
22190
|
-
Alpine.directive("h-input-group", (el) => {
|
|
22236
|
+
Alpine.directive("h-input-group", (el, _, { cleanup }) => {
|
|
22191
22237
|
el.classList.add(
|
|
22192
22238
|
"group/input-group",
|
|
22193
22239
|
"border-input",
|
|
@@ -22201,7 +22247,6 @@ function input_default(Alpine) {
|
|
|
22201
22247
|
"shadow-input",
|
|
22202
22248
|
"transition-[color,box-shadow]",
|
|
22203
22249
|
"outline-none",
|
|
22204
|
-
"h-9",
|
|
22205
22250
|
"min-w-0",
|
|
22206
22251
|
"has-[>textarea]:h-auto",
|
|
22207
22252
|
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
@@ -22221,6 +22266,10 @@ function input_default(Alpine) {
|
|
|
22221
22266
|
);
|
|
22222
22267
|
el.setAttribute("role", "group");
|
|
22223
22268
|
el.setAttribute("data-slot", "input-group");
|
|
22269
|
+
const observer = sizeObserver(el);
|
|
22270
|
+
cleanup(() => {
|
|
22271
|
+
observer.disconnect();
|
|
22272
|
+
});
|
|
22224
22273
|
});
|
|
22225
22274
|
Alpine.directive("h-input-group-addon", (el, _, { cleanup }) => {
|
|
22226
22275
|
el.classList.add(
|
|
@@ -22231,7 +22280,6 @@ function input_default(Alpine) {
|
|
|
22231
22280
|
"items-center",
|
|
22232
22281
|
"justify-center",
|
|
22233
22282
|
"gap-2",
|
|
22234
|
-
"py-1.5",
|
|
22235
22283
|
"text-sm",
|
|
22236
22284
|
"font-medium",
|
|
22237
22285
|
"select-none",
|
|
@@ -22243,8 +22291,24 @@ function input_default(Alpine) {
|
|
|
22243
22291
|
el.setAttribute("role", "group");
|
|
22244
22292
|
el.setAttribute("data-slot", "input-group-addon");
|
|
22245
22293
|
const variants = {
|
|
22246
|
-
"inline-start": [
|
|
22247
|
-
|
|
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
|
+
],
|
|
22248
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"],
|
|
22249
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"]
|
|
22250
22314
|
};
|
|
@@ -22269,6 +22333,136 @@ function input_default(Alpine) {
|
|
|
22269
22333
|
el.classList.add("text-muted-foreground", "flex", "items-center", "gap-2", "text-sm", "[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4");
|
|
22270
22334
|
el.setAttribute("data-slot", "label");
|
|
22271
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
|
+
});
|
|
22272
22466
|
}
|
|
22273
22467
|
|
|
22274
22468
|
// src/components/label.js
|
|
@@ -23411,23 +23605,7 @@ function select_default(Alpine) {
|
|
|
23411
23605
|
"[&_svg]:opacity-50"
|
|
23412
23606
|
);
|
|
23413
23607
|
el.setAttribute("data-slot", "select");
|
|
23414
|
-
const
|
|
23415
|
-
if (size3 === "sm") {
|
|
23416
|
-
el.classList.add("h-8");
|
|
23417
|
-
el.classList.remove("h-9", "h-6.5");
|
|
23418
|
-
} else if (size3 === "xs") {
|
|
23419
|
-
el.classList.add("h-6.5");
|
|
23420
|
-
el.classList.remove("h-9", "h-8");
|
|
23421
|
-
} else {
|
|
23422
|
-
el.classList.add("h-9");
|
|
23423
|
-
el.classList.remove("h-8", "h-6.5");
|
|
23424
|
-
}
|
|
23425
|
-
};
|
|
23426
|
-
setSize(el.getAttribute("data-size"));
|
|
23427
|
-
const observer = new MutationObserver(() => {
|
|
23428
|
-
setSize(el.getAttribute("data-size"));
|
|
23429
|
-
});
|
|
23430
|
-
observer.observe(el, { attributes: true, attributeFilter: ["data-size"] });
|
|
23608
|
+
const observer = sizeObserver(el);
|
|
23431
23609
|
cleanup(() => {
|
|
23432
23610
|
observer.disconnect();
|
|
23433
23611
|
});
|
|
@@ -24169,13 +24347,13 @@ function sidebar_default(Alpine) {
|
|
|
24169
24347
|
sm: ["h-7", "text-xs"],
|
|
24170
24348
|
lg: ["h-12", "text-sm", "group-data-[collapsed=true]/sidebar:p-0!"]
|
|
24171
24349
|
};
|
|
24172
|
-
function
|
|
24350
|
+
function setSize2(size3) {
|
|
24173
24351
|
if (sizes.hasOwnProperty(size3)) {
|
|
24174
24352
|
el.classList.add(...sizes[size3]);
|
|
24175
24353
|
}
|
|
24176
24354
|
}
|
|
24177
24355
|
if (!el.hasAttribute("data-size")) el.setAttribute("data-size", "default");
|
|
24178
|
-
|
|
24356
|
+
setSize2(el.getAttribute("data-size"));
|
|
24179
24357
|
});
|
|
24180
24358
|
Alpine.directive("h-sidebar-menu-action", (el, { modifiers }) => {
|
|
24181
24359
|
el.classList.add(
|
|
@@ -24307,13 +24485,13 @@ function sidebar_default(Alpine) {
|
|
|
24307
24485
|
sm: ["text-xs"],
|
|
24308
24486
|
md: ["text-sm"]
|
|
24309
24487
|
};
|
|
24310
|
-
function
|
|
24488
|
+
function setSize2(size3) {
|
|
24311
24489
|
if (sizes.hasOwnProperty(size3)) {
|
|
24312
24490
|
el.classList.add(...sizes[size3]);
|
|
24313
24491
|
}
|
|
24314
24492
|
}
|
|
24315
24493
|
if (!el.hasAttribute("data-size")) el.setAttribute("data-size", "md");
|
|
24316
|
-
|
|
24494
|
+
setSize2(el.getAttribute("data-size"));
|
|
24317
24495
|
});
|
|
24318
24496
|
Alpine.directive("h-sidebar-footer", (el) => {
|
|
24319
24497
|
el.classList.add("vbox", "gap-2", "px-2", "h-12", "justify-center", "border-t");
|
|
@@ -24329,10 +24507,10 @@ function skeleton_default(Alpine) {
|
|
|
24329
24507
|
if (modifiers.includes("control")) {
|
|
24330
24508
|
el.classList.add("rounded-control");
|
|
24331
24509
|
switch (el.getAttribute("data-size")) {
|
|
24332
|
-
case "
|
|
24510
|
+
case "sm":
|
|
24333
24511
|
el.classList.add("h-6.5");
|
|
24334
24512
|
break;
|
|
24335
|
-
case "
|
|
24513
|
+
case "md":
|
|
24336
24514
|
el.classList.add("h-8");
|
|
24337
24515
|
break;
|
|
24338
24516
|
default:
|
|
@@ -24351,7 +24529,20 @@ function skeleton_default(Alpine) {
|
|
|
24351
24529
|
// src/components/spinner.js
|
|
24352
24530
|
function spinner_default(Alpine) {
|
|
24353
24531
|
Alpine.directive("h-spinner", (el) => {
|
|
24354
|
-
el.classList.add(
|
|
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
|
+
);
|
|
24355
24546
|
el.setAttribute("role", "status");
|
|
24356
24547
|
el.setAttribute("data-slot", "spinner");
|
|
24357
24548
|
if (!el.hasAttribute("aria-label")) el.setAttribute("aria-label", "Loading");
|
|
@@ -24910,6 +25101,10 @@ function tile_default(Alpine) {
|
|
|
24910
25101
|
"group/tile",
|
|
24911
25102
|
"flex",
|
|
24912
25103
|
"items-center",
|
|
25104
|
+
"py-3",
|
|
25105
|
+
"px-4",
|
|
25106
|
+
"has-data-[slot=tile-header]:py-4",
|
|
25107
|
+
"gap-2.5",
|
|
24913
25108
|
"text-sm",
|
|
24914
25109
|
"rounded-lg",
|
|
24915
25110
|
"transition-colors",
|
|
@@ -24924,14 +25119,6 @@ function tile_default(Alpine) {
|
|
|
24924
25119
|
"focus-visible:ring-[calc(var(--spacing)*0.75)]"
|
|
24925
25120
|
);
|
|
24926
25121
|
el.setAttribute("data-slot", "tile");
|
|
24927
|
-
const sizes = {
|
|
24928
|
-
default: ["p-4", "gap-4"],
|
|
24929
|
-
sm: ["py-3", "px-4", "gap-2.5"]
|
|
24930
|
-
};
|
|
24931
|
-
function setSize(size3) {
|
|
24932
|
-
el.classList.add(...sizes[size3]);
|
|
24933
|
-
el.setAttribute("data-size", size3);
|
|
24934
|
-
}
|
|
24935
25122
|
switch (el.getAttribute("data-variant")) {
|
|
24936
25123
|
case "outline":
|
|
24937
25124
|
el.classList.add("border", "border-border");
|
|
@@ -24945,9 +25132,6 @@ function tile_default(Alpine) {
|
|
|
24945
25132
|
default:
|
|
24946
25133
|
el.classList.add("border", "bg-transparent", "border-transparent");
|
|
24947
25134
|
}
|
|
24948
|
-
if (el.getAttribute("data-size") === "sm") {
|
|
24949
|
-
setSize("sm");
|
|
24950
|
-
} else setSize("sm");
|
|
24951
25135
|
});
|
|
24952
25136
|
Alpine.directive("h-tile-header", (el) => {
|
|
24953
25137
|
el.classList.add("flex", "basis-full", "items-center", "justify-between", "gap-2");
|
|
@@ -25030,6 +25214,15 @@ var getSelectedTime = (rawTime, convertTo12) => {
|
|
|
25030
25214
|
}
|
|
25031
25215
|
return { hour, minute, second, period };
|
|
25032
25216
|
};
|
|
25217
|
+
function scrollIntoCenter(container, element, behavior = "instant") {
|
|
25218
|
+
const containerRect = container.getBoundingClientRect();
|
|
25219
|
+
const elementRect = element.getBoundingClientRect();
|
|
25220
|
+
const offset3 = elementRect.top - containerRect.top - container.clientHeight / 2 + element.clientHeight / 2;
|
|
25221
|
+
container.scrollBy({
|
|
25222
|
+
top: offset3,
|
|
25223
|
+
behavior
|
|
25224
|
+
});
|
|
25225
|
+
}
|
|
25033
25226
|
function timepicker_default(Alpine) {
|
|
25034
25227
|
Alpine.directive("h-time-picker", (el, { expression }, { evaluateLater, cleanup, effect, Alpine: Alpine2 }) => {
|
|
25035
25228
|
el._h_timepicker = Alpine2.reactive({
|
|
@@ -25236,7 +25429,7 @@ function timepicker_default(Alpine) {
|
|
|
25236
25429
|
"outline-none",
|
|
25237
25430
|
"border",
|
|
25238
25431
|
"rounded-control",
|
|
25239
|
-
"
|
|
25432
|
+
"absolute",
|
|
25240
25433
|
"bg-popover",
|
|
25241
25434
|
"text-popover-foreground",
|
|
25242
25435
|
"data-[state=open]:flex",
|
|
@@ -25648,21 +25841,26 @@ function timepicker_default(Alpine) {
|
|
|
25648
25841
|
};
|
|
25649
25842
|
el.addEventListener("click", onClick2);
|
|
25650
25843
|
let autoUpdateCleanup;
|
|
25844
|
+
let focusFirstItem = true;
|
|
25651
25845
|
function updatePosition() {
|
|
25652
25846
|
computePosition2(timepicker, el, {
|
|
25653
25847
|
placement: el.getAttribute("data-align") || "bottom-start",
|
|
25654
|
-
strategy: "fixed",
|
|
25655
25848
|
middleware: [offset2(4), flip2(), shift2({ padding: 4 })]
|
|
25656
25849
|
}).then(({ x, y }) => {
|
|
25657
|
-
if (selectedHour) {
|
|
25658
|
-
selectedHour.focus();
|
|
25659
|
-
} else {
|
|
25660
|
-
hoursList.children[timepicker._h_timepicker.is12Hour ? 1 : 0].focus();
|
|
25661
|
-
}
|
|
25662
25850
|
Object.assign(el.style, {
|
|
25663
25851
|
left: `${x}px`,
|
|
25664
25852
|
top: `${y}px`
|
|
25665
25853
|
});
|
|
25854
|
+
if (focusFirstItem) {
|
|
25855
|
+
focusFirstItem = false;
|
|
25856
|
+
Alpine2.nextTick(() => {
|
|
25857
|
+
if (selectedHour) {
|
|
25858
|
+
selectedHour.focus();
|
|
25859
|
+
} else {
|
|
25860
|
+
hoursList.children[timepicker._h_timepicker.is12Hour ? 1 : 0].focus();
|
|
25861
|
+
}
|
|
25862
|
+
});
|
|
25863
|
+
}
|
|
25666
25864
|
});
|
|
25667
25865
|
}
|
|
25668
25866
|
effect(() => {
|
|
@@ -25670,11 +25868,12 @@ function timepicker_default(Alpine) {
|
|
|
25670
25868
|
if (timepicker._h_timepicker.expanded) {
|
|
25671
25869
|
render();
|
|
25672
25870
|
autoUpdateCleanup = autoUpdate(timepicker, el, updatePosition);
|
|
25673
|
-
if (selectedHour) selectedHour.
|
|
25674
|
-
if (selectedMinute) selectedMinute.
|
|
25675
|
-
if (selectedSecond && timepicker._h_timepicker.seconds) selectedSecond.
|
|
25871
|
+
if (selectedHour) scrollIntoCenter(selectedHour.parentElement, selectedHour);
|
|
25872
|
+
if (selectedMinute) scrollIntoCenter(selectedMinute.parentElement, selectedMinute);
|
|
25873
|
+
if (selectedSecond && timepicker._h_timepicker.seconds) scrollIntoCenter(selectedSecond.parentElement, selectedSecond);
|
|
25676
25874
|
} else {
|
|
25677
25875
|
if (autoUpdateCleanup) autoUpdateCleanup();
|
|
25876
|
+
focusFirstItem = true;
|
|
25678
25877
|
Object.assign(el.style, {
|
|
25679
25878
|
left: "0px",
|
|
25680
25879
|
top: "0px"
|
|
@@ -26065,7 +26264,7 @@ function tree_default(Alpine) {
|
|
|
26065
26264
|
}
|
|
26066
26265
|
|
|
26067
26266
|
// package.json
|
|
26068
|
-
var version = "0.
|
|
26267
|
+
var version = "1.0.0";
|
|
26069
26268
|
|
|
26070
26269
|
// src/utils/breakpoint-listener.js
|
|
26071
26270
|
function getBreakpointListener(handler, breakpoint = 768) {
|