diff --git a/app/components/ui/input.tsx b/app/components/ui/input.tsx index e46302a..fa054fe 100644 --- a/app/components/ui/input.tsx +++ b/app/components/ui/input.tsx @@ -1,21 +1,25 @@ -import * as React from 'react'; +import type { ComponentProps } from 'react'; +import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '~/lib/utils'; -const Input = React.forwardRef>( - ({ className, type, ...props }, ref) => { - return ( - - ); - } +const inputVariants = cva( + 'flex w-full rounded-control border border-border-control bg-background text-text-primary transition-[color,border-color,box-shadow] duration-150 focus-visible:border-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger/70', + { + variants: { + size: { + sm: 'h-8 px-2.5 text-xs', + md: 'h-10 px-3 text-base', + // Login: taller, with a soft focus ring + lg: 'h-12 rounded-field border-border-dialog bg-surface px-3.5 text-base focus-visible:ring-3 focus-visible:ring-primary/15', + }, + mono: { true: 'font-mono', false: '' }, + }, + defaultVariants: { size: 'md', mono: false }, + }, ); -Input.displayName = 'Input'; -export { Input }; +export interface InputProps extends Omit, 'size'>, VariantProps {} + +export function Input({ className, size, mono, ...props }: InputProps) { + return ; +}