UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

33 lines (32 loc) 825 B
import { jsxs as a, jsx as e } from "react/jsx-runtime"; import l from "clsx"; import { useValidationErrors as h, ErrorList as d } from "../../utils/errors.js"; import u from "./component-label.js"; /* empty css */ const I = ({ type: o, field: r = "", required: m = !1, label: t, tooltip: c = "", children: f, className: n = "", ...p }) => { const { errors: s } = h(r), i = l("form-group", "has-feedback", "formio-component", "offb-component", { [`formio-component-${o}`]: o, "has-error": r && s.length > 0, required: m, [n]: !!n }); return /* @__PURE__ */ a("div", { className: i, children: [ t && /* @__PURE__ */ e(u, { label: t, required: m, htmlId: p.htmlId, tooltip: c }), f, /* @__PURE__ */ e(d, { errors: s }) ] }); }; export { I as default };