import { jsx as s, jsxs as d } from "react/jsx-runtime";
import { useMemo as v } from "react";
import h from "./components/ToggleMultipleGroup.js";
import M from "./components/ToggleSingleGroup.js";
import C from "../error-message/ErrorMessage.js";
import "./TogglePrimitive.js";
import "./types/ToggleGroupItemSize.js";
import "./types/ToggleGroupVariant.js";
const T = (a) => {
  const { type: l = "single", size: e = "default", variant: r = "default", shape: o = "default", errorMessage: n, ...t } = a, i = v(() => {
    if (l === "multiple") {
      const { value: u, onChange: f, ...c } = t;
      return /* @__PURE__ */ s(h, { value: u, onChange: f, ...c, shape: o, size: e, variant: r });
    }
    const { value: g, onChange: m, ...p } = t;
    return /* @__PURE__ */ s(M, { value: g, onChange: m, ...p, shape: o, size: e, variant: r });
  }, [t, o, e, l, r]);
  return /* @__PURE__ */ d("div", { className: "relative", children: [
    i,
    /* @__PURE__ */ s(C, { message: n })
  ] });
};
T.displayName = "ToggleGroup";
export {
  T as default
};
//# sourceMappingURL=ToggleGroup.js.map
