import { jsxs as f, jsx as r } from "react/jsx-runtime";
import p, { useContext as g } from "react";
import * as o from "@radix-ui/react-toggle-group";
import v from "../icon/components/icon-extend/IconExtend.js";
import { c as m } from "../../index-BtlgVD4m.js";
import { toggleGroupItemSizes as x } from "./types/ToggleGroupItemSize.js";
import { toggleVariants as b } from "../toggle/types/ToggleVariant.js";
const d = p.createContext({
  size: "default",
  variant: "default",
  shape: "default"
}), h = (c) => {
  const { className: s, type: t = "single", variant: a = "default", size: i = "default", shape: n = "default", children: l, ref: e, ...u } = c;
  return t === "single" ? /* @__PURE__ */ r(
    o.Root,
    {
      ref: e,
      className: m("flex items-center justify-center gap-1 max-w-max", s),
      ...u,
      type: t,
      children: /* @__PURE__ */ r(d.Provider, { value: { variant: a, size: i, shape: n }, children: l })
    }
  ) : /* @__PURE__ */ r(
    o.Root,
    {
      ref: e,
      className: m("flex items-center justify-center gap-1 max-w-max", s),
      ...u,
      type: t,
      children: /* @__PURE__ */ r(d.Provider, { value: { variant: a, size: i, shape: n }, children: l })
    }
  );
};
h.displayName = o.Root.displayName;
const y = 16, N = ({ className: c, variant: s = "default", size: t = "default", icon: a, label: i, ref: n, ...l }) => {
  const e = g(d);
  return /* @__PURE__ */ f(
    o.Item,
    {
      ref: n,
      className: m(
        "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:text-[var(--base-muted-foreground)] hover:bg-[var(--base-muted)] hover:cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-[var(--opacity-opacity-50)] data-[state=on]:bg-[var(--base-accent)] data-[state=on]:text-[var(--base-foreground)] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 aria-checked:bg-[var(--base-accent)] aria-checked:text-[var(--base-foreground)]",
        b[e.variant || s],
        x[e.size || t],
        e.shape === "pill" && "rounded-full ",
        c
      ),
      ...l,
      children: [
        a && /* @__PURE__ */ r(v, { icon: a, size: y }),
        i
      ]
    }
  );
};
N.displayName = o.Item.displayName;
export {
  h as ToggleGroup,
  N as ToggleGroupItem
};
//# sourceMappingURL=TogglePrimitive.js.map
