UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

18 lines (17 loc) • 714 B
import { useFormRuntime as e } from "../../../runtime/formRuntime.js"; import { useScopeErrors as t } from "../../../hooks/useScopeErrors.js"; import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime"; import { Badge as a, VisuallyHidden as o } from "@mitcsutt/kiln-ui"; //#region src/components/layouts/internal/ErrorBadge.tsx function s({ scope: s }) { let c = t(s), l = e().options.messages; return c === 0 ? null : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(a, { tone: "critical", size: "sm", "aria-hidden": "true", children: c }), /* @__PURE__ */ r(o, { children: ` ${l.errorCount(c)}` })] }); } //#endregion export { s as ErrorBadge }; //# sourceMappingURL=ErrorBadge.js.map