Complete 1 fase docs components

This commit is contained in:
2026-04-01 09:26:52 +02:00
parent cacdbc26ad
commit c9411be600
21 changed files with 6748 additions and 173 deletions

86
dist/sigpro-ui.cjs vendored
View File

@@ -750,39 +750,55 @@ var DrawerModule = /*#__PURE__*/Object.freeze({
Drawer: Drawer
});
/** DROPDOWN */
const Dropdown = (props, children) => {
const { label, icon, ...rest } = props;
const { label, icon, items, ...rest } = props;
return sigpro.$html(
"div",
{
...rest,
class: () => `dropdown ${val(props.class) || props.class || ""}`,
},
[
sigpro.$html(
"div",
{
tabindex: 0,
role: "button",
class: "btn m-1 flex items-center gap-2",
},
[
icon ? (typeof icon === "function" ? icon() : icon) : null,
label ? (typeof label === "function" ? label() : label) : null
],
),
sigpro.$html(
"ul",
{
tabindex: 0,
class: "dropdown-content z-[50] menu p-2 shadow bg-base-100 rounded-box min-w-max border border-base-300",
},
[typeof children === "function" ? children() : children],
),
],
);
const renderContent = () => {
if (items) {
const source = typeof items === "function" ? items : () => items;
return sigpro.$html("ul", {
tabindex: 0,
class: "dropdown-content z-[50] menu p-2 shadow bg-base-100 rounded-box w-52 border border-base-300"
}, [
sigpro.$for(source, (item) =>
sigpro.$html("li", {}, [
sigpro.$html("a", {
class: item.class || "",
onclick: (e) => {
if (item.onclick) item.onclick(e);
if (document.activeElement) document.activeElement.blur();
}
}, [
item.icon ? sigpro.$html("span", {}, item.icon) : null,
sigpro.$html("span", {}, item.label)
])
])
)
]);
}
return sigpro.$html("div", {
tabindex: 0,
class: "dropdown-content z-[50] p-2 shadow bg-base-100 rounded-box min-w-max border border-base-300"
}, [
typeof children === "function" ? children() : children
]);
};
return sigpro.$html("div", {
...rest,
class: () => `dropdown ${val(props.class) || ""}`,
}, [
sigpro.$html("div", {
tabindex: 0,
role: "button",
class: "btn m-1 flex items-center gap-2",
}, [
icon ? (typeof icon === "function" ? icon() : icon) : null,
label ? (typeof label === "function" ? label() : label) : null
]),
renderContent()
]);
};
var DropdownModule = /*#__PURE__*/Object.freeze({
@@ -792,18 +808,15 @@ var DropdownModule = /*#__PURE__*/Object.freeze({
/** FAB (Floating Action Button) */
const Fab = (props) => {
const { icon, label, actions = [], position = "bottom-6 right-6", ...rest } = props;
const { icon, label, actions = [], position = "bottom-6 right-6", class: className = "", ...rest } = props;
return sigpro.$html(
"div",
{
...rest,
class: () => `fab fixed ${val(position)} flex flex-col-reverse items-end gap-3 z-[100] ${
props.class || ""
}`,
class: `fab absolute ${position} flex flex-col-reverse items-end gap-3 z-[100] ${className}`,
},
[
// Botón principal
sigpro.$html(
"div",
{
@@ -817,7 +830,6 @@ const Fab = (props) => {
],
),
// Acciones secundarias (se despliegan hacia arriba)
...val(actions).map((act) =>
sigpro.$html("div", { class: "flex items-center gap-3 transition-all duration-300" }, [
act.label ? sigpro.$html("span", { class: "badge badge-ghost shadow-sm whitespace-nowrap" }, act.label) : null,