import { cva, type VariantProps } from 'class-variance-authority';

export const textareaVariants = cva(
  [
    'flex w-full rounded-md border bg-input-bg text-foreground',
    'placeholder:text-foreground-subtle',
    'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
    'disabled:cursor-not-allowed disabled:opacity-50',
    'transition-colors duration-150',
    'resize-y min-h-[80px]',
  ],
  {
    variants: {
      size: {
        sm: 'px-3 py-2 text-xs',
        md: 'px-3 py-2 text-sm',
        lg: 'px-4 py-3 text-base',
      },
      error: {
        true: 'border-error focus:ring-error',
      },
    },
    defaultVariants: {
      size: 'md',
    },
  }
);

export type TextareaVariants = VariantProps<typeof textareaVariants>;
