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

export const inputVariants = 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',
  ],
  {
    variants: {
      size: {
        sm: 'h-8 px-3 text-xs',
        md: 'h-10 px-3 text-sm',
        lg: 'h-12 px-4 text-base',
      },
      error: {
        true: 'border-error focus:ring-error',
      },
    },
    defaultVariants: {
      size: 'md',
    },
  }
);

export type InputVariants = VariantProps<typeof inputVariants>;
