import React from 'react'; import { cn } from '@/lib/cn'; import { Input as BaseInput } from '@base-ui/react/input'; import { NumberField } from '@base-ui/react/number-field'; interface ThemeProps { $isLight?: boolean; $hasError?: boolean; } const controlBaseClass = [ 'resize-none appearance-none outline-hidden w-full min-w-0', 'p-3 border-2 rounded-sm text-sm transition-[background-color,border-color,color,box-shadow] duration-150', 'bg-input border-input hover:border-input text-foreground shadow-none focus:ring-0', 'focus:shadow-md focus:border-primary focus:ring-2 focus:ring-ring/50', 'disabled:opacity-75 read-only:cursor-text read-only:bg-muted/40', 'required:shadow-none invalid:shadow-none', ].join(' '); const lightClass = 'bg-background border-border text-foreground focus:border-primary disabled:bg-muted disabled:border-border'; const errorClass = [ 'text-destructive border-destructive hover:border-destructive', 'focus:border-destructive focus:ring-destructive', ].join(' '); const controlClass = ({ $isLight, $hasError }: ThemeProps, className?: string): string => cn(controlBaseClass, $isLight && lightClass, $hasError && errorClass, className); type WithStringClassName = Omit & { className?: string }; type TextInputProps = ThemeProps & WithStringClassName>; type NumberInputProps = ThemeProps & Pick< React.ComponentProps, 'value' | 'onValueChange' | 'min' | 'max' | 'step' | 'format' | 'disabled' > & WithStringClassName, 'value' | 'onChange' | 'disabled'>>; export const TextInput = ({ $isLight, $hasError, className, ...props }: TextInputProps) => ( ); export const FileInput = ({ className, ...props }: Omit, 'type'>) => ( ); export const TextArea = ({ $isLight, $hasError, className, ...props }: ThemeProps & React.ComponentProps<'textarea'>) => (