BUILD BEFORE CHANGE NEW COMPONENTS WITH UI FUNCTION

This commit is contained in:
2026-04-01 20:53:41 +02:00
parent c9411be600
commit 5a77deb442
55 changed files with 4137 additions and 5469 deletions

28
src/ui/Drawer.js Normal file
View File

@@ -0,0 +1,28 @@
// components/Drawer.js
import { $html } from "sigpro";
import { ui, val, joinClass } from "../core/utils.js";
export const Drawer = (props) => {
const { ui: uiProps, class: className, id, open, content, side, ...rest } = props;
const dynamicClasses = [
ui('drawer', uiProps),
className
].filter(Boolean).join(' ');
const classes = joinClass("drawer", dynamicClasses);
return $html("div", { ...rest, class: classes }, [
$html("input", {
id,
type: "checkbox",
class: "drawer-toggle",
checked: val(open),
}),
$html("div", { class: "drawer-content" }, content),
$html("div", { class: "drawer-side" }, [
$html("label", { for: id, class: "drawer-overlay", onclick: () => open?.(false) }),
$html("div", { class: "min-h-full bg-base-200 w-80" }, side),
]),
]);
};