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

// src/atoms/button.tsx
import { forwardRef, useMemo } from "react";
import { Button as RadixButton } from "@radix-ui/themes";
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 mergedStyle = useMemo(() => {
      const baseStyle = {
        background: variant === "transparent" ? "transparent" : void 0,
        fontWeight: 400
      };
      return __spreadValues(__spreadValues({}, baseStyle), style);
    }, [style, variant]);
    const radixVariant = useMemo(() => {
      if (variant === "transparent")
        return "ghost";
      return variant;
    }, [variant]);
    return /* @__PURE__ */ jsx(
      RadixButton,
      __spreadProps(__spreadValues({
        style: mergedStyle,
        variant: radixVariant
      }, restProps), {
        ref,
        size: radixSize
      })
    );
  }
);
Button.displayName = "Button";

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