@mitcsutt/kiln-forms
Version:
Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui
33 lines (32 loc) • 938 B
JavaScript
import { FieldView as e } from "../FieldView/FieldView.js";
import { accepts as t } from "../../../kit/accepts.js";
import { useFieldBinding as n } from "../../../hooks/useFieldBinding.js";
import { defineField as r } from "../../../kit/contracts.js";
import { jsx as i } from "react/jsx-runtime";
import { TextareaField as a } from "@mitcsutt/kiln-ui";
//#region src/components/fields/FormTextareaField/FormTextareaField.tsx
var o = r()(function({ warn: r, excluded: o, onBlur: s, ...c }) {
let l = n({
...c,
warn: r,
excluded: o,
accepts: t.string,
empty: ""
});
return l.mode === "view" ? /* @__PURE__ */ i(e, {
label: c.label,
children: l.value
}) : /* @__PURE__ */ i(a, {
...c,
...l.fieldProps,
ref: l.ref,
value: l.value ?? "",
onValueChange: l.setValue,
onBlur: (e) => {
s?.(e), l.onBlur();
}
});
});
//#endregion
export { o as FormTextareaField };
//# sourceMappingURL=FormTextareaField.js.map