@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
41 lines (40 loc) • 906 B
JavaScript
import { jsx as s } from "react/jsx-runtime";
import a from "./Switch.module.scss.mjs";
const c = ({
checked: t,
onChange: i,
disabled: n,
"aria-label": o
}) => {
const l = () => {
n || i(!t);
};
return /* @__PURE__ */ s("div", { className: a.switchContainer, children: /* @__PURE__ */ s(
"button",
{
type: "button",
role: "switch",
"aria-checked": t,
"aria-label": o,
disabled: n,
onClick: l,
className: a.switchLabel,
children: /* @__PURE__ */ s(
"span",
{
className: `${a.switch} ${t ? a.on : a.off} ${n ? a.disabled : ""}`.trim(),
children: /* @__PURE__ */ s(
"span",
{
className: `${a.knob} ${t ? a.knobOn : a.knobOff} ${n ? a.disabled : ""}`.trim()
}
)
}
)
}
) });
};
export {
c as Switch,
c as default
};