import {
  convertSize
} from "./chunk-HF6GNDPV.js";
import {
  __objRest,
  __spreadProps,
  __spreadValues
} from "./chunk-CRTRMMJ7.js";

// src/atoms/icon-button.tsx
import { forwardRef, useMemo } from "react";
import { clsx } from "clsx";
import { IconButton as RadixIconButton } from "@radix-ui/themes";
import { jsx } from "react/jsx-runtime";
var IconButton = forwardRef(
  (props, ref) => {
    const _a = props, { size, style, variant } = _a, restProps = __objRest(_a, ["size", "style", "variant"]);
    const radixSize = useMemo(() => {
      return convertSize(size);
    }, [size]);
    const radixVariant = useMemo(() => {
      if (variant === "transparent") return "ghost";
      return variant;
    }, [variant]);
    const className = useMemo(() => {
      return clsx(props.className, { transparent: variant === "transparent" });
    }, [props.className, variant]);
    return /* @__PURE__ */ jsx(
      RadixIconButton,
      __spreadProps(__spreadValues({
        style,
        type: "button",
        variant: radixVariant
      }, restProps), {
        className,
        ref,
        size: radixSize
      })
    );
  }
);
IconButton.displayName = "IconButton";

export {
  IconButton
};
//# sourceMappingURL=chunk-XK6VEVOK.js.map