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

// src/atoms/button.tsx
import { forwardRef, useMemo } from "react";
import { Button as RadixButton } from "@radix-ui/themes";
import { clsx } from "clsx";
import { jsx } from "react/jsx-runtime";
var Button = 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(
      RadixButton,
      __spreadProps(__spreadValues({
        style,
        type: "button",
        variant: radixVariant
      }, restProps), {
        className,
        ref,
        size: radixSize
      })
    );
  }
);
Button.displayName = "Button";

export {
  Button
};
//# sourceMappingURL=chunk-ZVDAEY5Q.js.map