@mitcsutt/kiln-forms
Version:
Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui
43 lines (42 loc) • 1.35 kB
JavaScript
import { FieldViewListBoundary as e } from "../../fields/FieldView/FieldView.js";
import { useId as t } from "react";
import { jsx as n, jsxs as r } from "react/jsx-runtime";
import { Card as i, Grid as a, Inline as o, Stack as s } from "@mitcsutt/kiln-ui";
//#region src/components/layouts/FormPanels/FormPanels.tsx
function c({ columns: e = 1, gap: t = 5, children: r }) {
return /* @__PURE__ */ n(a, {
columns: e,
gap: t,
children: r
});
}
function l({ title: e, description: a, headingLevel: c = 3, actions: l, children: u }) {
let d = t();
return /* @__PURE__ */ n(i, {
variant: "outline",
asChild: !0,
children: /* @__PURE__ */ r("section", {
"aria-labelledby": d,
children: [/* @__PURE__ */ r(i.Header, { children: [/* @__PURE__ */ r(o, {
justify: "between",
align: "center",
gap: 3,
children: [/* @__PURE__ */ n(i.Title, {
level: c,
id: d,
children: e
}), l]
}), a == null ? null : /* @__PURE__ */ n(i.Description, { children: a })] }), /* @__PURE__ */ n(i.Body, { children: /* @__PURE__ */ n(s, {
gap: 5,
children: u
}) })]
})
});
}
function u(t) {
return /* @__PURE__ */ n(e, { children: /* @__PURE__ */ n(c, { ...t }) });
}
var d = Object.assign(u, { Panel: l });
//#endregion
export { l as FormPanel, d as FormPanels };
//# sourceMappingURL=FormPanels.js.map