Add Fieldset component for structured grouping

This commit is contained in:
Natxo
2026-03-31 12:16:28 +02:00
committed by GitHub
parent 5797e3cea5
commit ccbe8e5c4a

View File

@@ -0,0 +1,19 @@
import { $html } from "sigpro";
import { val, joinClass } from "../core/utils.js";
/** FIELDSET */
export const Fieldset = (props, children) =>
$html(
"fieldset",
{
...props,
class: joinClass("fieldset bg-base-200 border border-base-300 p-4 rounded-lg", props.class),
},
[
() => {
const legendText = val(props.legend);
return legendText ? $html("legend", { class: "fieldset-legend font-bold" }, [legendText]) : null;
},
children,
],
);