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

// src/atoms/text-area.tsx
import {
  TextArea as RTextArea
} from "@radix-ui/themes";
import { forwardRef, useMemo } from "react";
import { jsx } from "react/jsx-runtime";
var TextArea = forwardRef(
  (props, ref) => {
    const _a = props, { error, style, className } = _a, rest = __objRest(_a, ["error", "style", "className"]);
    const fieldStyle = useMemo(() => {
      if (!error)
        return style;
      const errorStyle = {
        boxShadow: "inset 0 0 0 var(--text-area-border-width) var(--error-11)"
      };
      return __spreadValues(__spreadValues({}, style || {}), errorStyle);
    }, [error, style]);
    const classNameStr = error ? `error ${className}` : className;
    return /* @__PURE__ */ jsx(
      RTextArea,
      __spreadProps(__spreadValues({}, rest), {
        className: classNameStr,
        ref,
        style: fieldStyle
      })
    );
  }
);
TextArea.displayName = "TextArea";

export {
  TextArea
};
//# sourceMappingURL=chunk-EW6OPYEW.js.map