import {
  __objRest,
  __spreadProps,
  __spreadValues
} from "./chunk-2NMEKWO5.js";

// src/atoms/card.tsx
import { forwardRef, useMemo } from "react";
import {
  Card as RadixCard
} from "@radix-ui/themes";
import { jsx } from "react/jsx-runtime";
var Card = forwardRef(
  (props, forwardedRef) => {
    const _a = props, { borderDisable, borderRadius, error } = _a, rest = __objRest(_a, ["borderDisable", "borderRadius", "error"]);
    const borderInsetClassName = useMemo(() => {
      if (!borderDisable) return "";
      const { left, right, top, bottom } = borderDisable;
      return [
        left && "disable-inset-left",
        right && "disable-inset-right",
        top && "disable-inset-top",
        bottom && "disable-inset-bottom"
      ].filter(Boolean).join(" ");
    }, [borderDisable]);
    const errorClsName = useMemo(() => {
      return error ? " error" : "";
    }, [error]);
    return /* @__PURE__ */ jsx(
      RadixCard,
      __spreadProps(__spreadValues({
        variant: "surface"
      }, rest), {
        className: `${borderInsetClassName}${errorClsName} ${rest.className || ""}`,
        "data-radius": borderRadius,
        ref: forwardedRef
      })
    );
  }
);
Card.displayName = "Card";

export {
  Card
};
//# sourceMappingURL=chunk-HEDMSFPW.js.map