@anoki/fse-ui
Version:
FSE UI components library
59 lines (58 loc) • 1.9 kB
JavaScript
import { j as e } from "./index.es237.js";
import { Checkbox as x, CheckboxIndicator as p } from "./index.es338.js";
import './components/ui/filters/CheckboxFilter/CheckboxFilter.css';/* empty css */
import f from "./index.es249.js";
import { clsx as i } from "./index.es239.js";
import { CheckIconCircle as d } from "./index.es175.js";
import { Row as n } from "./index.es116.js";
import { CheckIcon as b } from "./index.es174.js";
const y = ({
id: r,
label: o,
checked: a,
onChange: l,
classNameText: h = "fs-6 fw-bold",
canMultiple: c = !0
}) => {
var s;
const t = new DOMParser().parseFromString(`${o}`, "text/html"), m = ((s = t == null ? void 0 : t.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(
x,
{
id: r,
checked: a,
onCheckedChange: l,
className: i(
c ? "ui-checkbox-filter-container" : "ui-checkbox-filter"
),
"aria-label": m,
children: /* @__PURE__ */ e.jsx(p, { children: /* @__PURE__ */ e.jsx("div", { className: "checkbox-container", children: c ? /* @__PURE__ */ e.jsx(b, { width: 14, height: 14, color: "white" }) : /* @__PURE__ */ e.jsx(d, { width: 14, height: 14, color: "white" }) }) })
}
),
o && /* @__PURE__ */ e.jsx(
f,
{
as: "label",
htmlFor: r,
className: i(h, "text-slate-20 cursor-pointer"),
children: o
}
)
]
}
) });
};
export {
y as CheckboxFilter
};
//# sourceMappingURL=index.es90.js.map