UNPKG

@clubmed/trident-ui

Version:

Shared ClubMed React UI components

58 lines (57 loc) 1.53 kB
import { jsxs as i, jsx as e } from "react/jsx-runtime"; import { c as r } from "../../chunks/index.js"; import { useId as D } from "react"; /* empty css */ import { Icon as c } from "../../atoms/Icons/Icon.js"; import "@clubmed/trident-icons"; import { useValue as N } from "../../hooks/useValue.js"; function T(m) { const d = D(), { id: p = d, name: l = p, className: u, dataTestId: h, disabled: o, checked: f = !1, value: a, tabIndex: b = 0, onChange: t, hasDropdown: x, children: k, ...w } = m, { value: n, setValue: I } = N({ name: l, initialValue: f, onChange(v, s) { t == null || t(v, s ? a !== void 0 ? a : s : null); } }); return /* @__PURE__ */ i("label", { className: r(u, "relative"), children: [ /* @__PURE__ */ e( "input", { ...w, name: l, "data-testid": h, type: "checkbox", tabIndex: b, onChange: () => { !o && I(!n); }, checked: n, "data-name": "Filter", disabled: o, value: a } ), /* @__PURE__ */ i("span", { children: [ /* @__PURE__ */ e("span", { className: r("text-b3 font-semibold"), children: k }), /* @__PURE__ */ e(c, { width: null, name: "CheckDefault", color: "black" }), x && /* @__PURE__ */ e(c, { name: "ArrowDefaultDown", className: "ml-8", width: "24px", color: "black" }) ] }) ] }); } export { T as Filter }; //# sourceMappingURL=Filter.js.map