import { jsxs as g, jsx as t } from "react/jsx-runtime";
import { Loading as i } from "../loading/index.js";
import '../../assets/index2.css';const m = "_toggle_7uv10_1", d = "_thumb_7uv10_15", p = "_track_7uv10_26", o = {
  toggle: m,
  thumb: d,
  track: p
}, h = ({
  checked: s,
  disabled: l,
  isLoading: a,
  label: e,
  onChange: c
}) => {
  const n = s !== void 0 && c === void 0;
  return /* @__PURE__ */ g("label", { className: o.toggle, onClick: (r) => r.stopPropagation(), "data-component": "toggle", children: [
    /* @__PURE__ */ t("input", { checked: s, disabled: l || a, onChange: c, readOnly: n, type: "checkbox" }),
    /* @__PURE__ */ t("span", { "aria-hidden": "true", className: o.track, children: a ? /* @__PURE__ */ t(i, { size: 24 }) : /* @__PURE__ */ t("span", { className: o.thumb }) }),
    e && /* @__PURE__ */ t("span", { className: "toggle", children: e })
  ] });
};
export {
  h as Toggle
};
//# sourceMappingURL=index.js.map
