import * as n from "react";
import { composeEventHandlers as l } from "../../../../../@radix-ui_primitive@1.1.0/node_modules/@radix-ui/primitive/dist/index.js";
import { useControllableState as f } from "../../../../../@radix-ui_react-use-controllable-state@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
import { Primitive as m } from "../../../../../@radix-ui_react-primitive@2.0.0_@types_react-dom@18.3.6_@types_react@18.3.3__@types_rea_bdcf182289a3a76356f07e550726e479/node_modules/@radix-ui/react-primitive/dist/index.js";
import { j as p } from "../../../../../../../_virtual/jsx-runtime.js";
var u = "Toggle", b = n.forwardRef((e, r) => {
  const { pressed: t, defaultPressed: s = !1, onPressedChange: a, ...d } = e, [o = !1, i] = f({
    prop: t,
    onChange: a,
    defaultProp: s
  });
  return /* @__PURE__ */ p.jsx(
    m.button,
    {
      type: "button",
      "aria-pressed": o,
      "data-state": o ? "on" : "off",
      "data-disabled": e.disabled ? "" : void 0,
      ...d,
      ref: r,
      onClick: l(e.onClick, () => {
        e.disabled || i(!o);
      })
    }
  );
});
b.displayName = u;
export {
  b as Toggle
};
//# sourceMappingURL=index.js.map
