UNPKG

@anoki/fse-marche-ui

Version:

FSE UI components library

74 lines (73 loc) 2.03 kB
import { j as e } from "./index.es137.js"; import { Root as h, Indicator as m } from "./index.es170.js"; import './components/ui/filters/CheckboxFilter/CheckboxFilter.css';/* empty css */ import p from "./index.es210.js"; import { clsx as d } from "./index.es139.js"; import { Row as n } from "./index.es9.js"; const C = ({ id: r, label: t, checked: i, onChange: c, classNameText: a = "fs-6 fw-bold" }) => { var s; const l = () => /* @__PURE__ */ e.jsx( "svg", { width: "14", height: "14", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx( "path", { d: "M10 3L4.5 8.5L2 6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" } ) } ), o = new DOMParser().parseFromString(`${t}`, "text/html"), x = ((s = o == null ? void 0 : o.body) == null ? void 0 : s.textContent) || ""; return /* @__PURE__ */ e.jsx(n, { alignItems: "center", gap: "x16", children: /* @__PURE__ */ e.jsxs( n, { as: "label", gap: "x16", alignItems: "center", py: "x8", htmlFor: r, className: "cursor-pointer w-full", children: [ /* @__PURE__ */ e.jsx( h, { id: r, checked: i, onCheckedChange: c, className: "ui-checkbox-filter", "aria-label": x, children: /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx("div", { className: "checkbox-container", children: /* @__PURE__ */ e.jsx(l, {}) }) }) } ), t && /* @__PURE__ */ e.jsx( p, { as: "label", htmlFor: r, className: d(a, "text-slate-20 cursor-pointer"), children: t } ) ] } ) }); }; export { C as CheckboxFilter }; //# sourceMappingURL=index.es61.js.map