import * as React from "react";

import { cn } from "@/lib/utils";

/**
 * Base multi-line input — the shadcn `Textarea` primitive, matched to this
 * project's `Input` styling so the two controls sit together in a form.
 *
 * This could not exist until now: the app's own `TextArea.tsx` occupied the
 * same path on a case-insensitive filesystem (macOS default), so adding it
 * would have silently overwritten that component. The wrapper has been renamed
 * to `TextAreaField.tsx`, which frees this name.
 */
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
  return (
    <textarea
      data-slot="textarea"
      className={cn(
        "placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground",
        "field-sizing-content min-h-16 w-full rounded-md border border-input bg-card px-3 py-2",
        "text-base leading-relaxed shadow-xs transition-[color,box-shadow,border-color] outline-none",
        "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/20",
        "aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/20",
        "disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-70 md:text-sm",
        className
      )}
      {...props}
    />
  );
}

export { Textarea };
