@achs/webkit
Version:
Conjunto de componentes de UI con el estilo del Sistema de Diseño ACHS (Asociación Chilena de Seguridad), para reutilizar de forma transversal en las aplicaciones web de ACHS. Construido con **React 19**, **TypeScript** y **Vite**, con soporte para las
59 lines (58 loc) • 2.1 kB
JavaScript
import { jsxs as c, jsx as a } from "react/jsx-runtime";
import { forwardRef as f } from "react";
import e from "./CaptchaField.module.scss.mjs";
import '../../../assets/node_modules/.pnpm/bootstrap-icons@1.13.1/node_modules/bootstrap-icons/font/bootstrap-icons.css';/* empty css */
const u = f(({
status: i = "idle",
label: d = "No soy un robot",
errorMessage: o = "No pudimos verificar. Inténtalo de nuevo.",
onVerify: l,
disabled: n = !1,
className: t,
...m
}, h) => {
const r = i === "verified", s = i === "verifying", p = i === "error", b = !n && !r && !s, N = () => {
b && (l == null || l());
};
return /* @__PURE__ */ c(
"div",
{
ref: h,
className: `${e.field} ${t ?? ""}`.trim(),
"data-status": i,
...m,
children: [
/* @__PURE__ */ c("div", { className: e.row, children: [
/* @__PURE__ */ c(
"button",
{
type: "button",
className: e.box,
role: "checkbox",
"aria-checked": r,
"aria-label": d,
"aria-busy": s || void 0,
disabled: n || r || s,
onClick: N,
children: [
s && /* @__PURE__ */ a("span", { className: e.spinner, "aria-hidden": "true" }),
r && /* @__PURE__ */ a("i", { className: "bi bi-check-lg", "aria-hidden": "true" })
]
}
),
/* @__PURE__ */ a("span", { className: e.label, children: d }),
/* @__PURE__ */ c("span", { className: e.brand, "aria-hidden": "true", children: [
/* @__PURE__ */ a("i", { className: "bi bi-shield-check" }),
/* @__PURE__ */ a("span", { className: e.brandText, children: "Protegido" })
] })
] }),
p && /* @__PURE__ */ a("span", { className: e.error, role: "alert", children: o })
]
}
);
});
u.displayName = "CaptchaField";
export {
u as CaptchaField,
u as default
};