UNPKG

@anoki/fse-ui

Version:

FSE UI components library

59 lines (58 loc) 1.88 kB
import { j as r } from "./index.es244.js"; import { Root as x, Indicator as p } from "./index.es306.js"; import './components/ui/filters/CheckboxFilter/CheckboxFilter.css';/* empty css */ import f from "./index.es256.js"; import { clsx as i } from "./index.es246.js"; import { CheckIconCircle as d } from "./index.es214.js"; import { Row as n } from "./index.es9.js"; import { CheckIcon as j } from "./index.es213.js"; const R = ({ id: e, label: o, checked: a, onChange: l, classNameText: m = "fs-6 fw-bold", canMultiple: s = !0 }) => { var c; const t = new DOMParser().parseFromString(`${o}`, "text/html"), h = ((c = t == null ? void 0 : t.body) == null ? void 0 : c.textContent) || ""; return /* @__PURE__ */ r.jsx(n, { alignItems: "center", gap: "x16", children: /* @__PURE__ */ r.jsxs( n, { as: "label", gap: "x16", alignItems: "center", py: "x8", htmlFor: e, className: "cursor-pointer w-full", children: [ /* @__PURE__ */ r.jsx( x, { id: e, checked: a, onCheckedChange: l, className: i( s ? "ui-checkbox-filter-container" : "ui-checkbox-filter" ), "aria-label": h, children: /* @__PURE__ */ r.jsx(p, { children: /* @__PURE__ */ r.jsx("div", { className: "checkbox-container", children: s ? /* @__PURE__ */ r.jsx(j, { width: 14, height: 14, color: "white" }) : /* @__PURE__ */ r.jsx(d, { width: 14, height: 14, color: "white" }) }) }) } ), o && /* @__PURE__ */ r.jsx( f, { as: "label", htmlFor: e, className: i(m, "text-slate-20 cursor-pointer"), children: o } ) ] } ) }); }; export { R as CheckboxFilter }; //# sourceMappingURL=index.es69.js.map