UNPKG

@anoki/fse-ui

Version:

FSE UI components library

36 lines (35 loc) 1.13 kB
import { j as t } from "./index.es237.js"; import { Root as l, Thumb as c } from "./index.es440.js"; import { Row as n } from "./index.es116.js"; import './components/ui/Switch/Switch.css';/* empty css */ import { CheckIcon as x } from "./index.es174.js"; import { Close as f } from "./index.es179.js"; const b = ({ id: s = void 0, label: i = "Visibile", checked: e = !1, setValue: o, name: r, disabled: m = !1, className: h }) => /* @__PURE__ */ t.jsxs(n, { alignItems: "center", gap: "x16", className: h, children: [ i && /* @__PURE__ */ t.jsx("label", { className: "text-muted fs-6 fw-bold", htmlFor: s, children: i }), /* @__PURE__ */ t.jsx( l, { id: s, disabled: m, checked: e, onCheckedChange: (a) => { o(r ?? "", a); }, className: "ui-switch", "aria-label": i, children: /* @__PURE__ */ t.jsx(c, { className: "ui-switch-thumb", children: e ? /* @__PURE__ */ t.jsx(x, { width: 12, height: 12 }) : /* @__PURE__ */ t.jsx(f, { width: 12, height: 12 }) }) } ) ] }); export { b as Switch }; //# sourceMappingURL=index.es128.js.map