import * as React from 'react'; import { clsx } from 'clsx'; export interface InputProps extends React.InputHTMLAttributes { label?: string; error?: string; hint?: string; controlSize?: 'sm' | 'md' | 'lg'; variant?: 'surface' | 'muted' | 'ghost'; } export const Input = React.forwardRef( ( { label, error, hint, controlSize = 'md', variant = 'surface', className, id, ...props }, ref ) => { const generatedId = React.useId(); const inputId = id ?? (label || error || hint ? `input-${generatedId}` : undefined); const sizes: Record, string> = { sm: 'h-8 px-2.5 text-xs', md: 'h-10 px-3 text-sm', lg: 'h-11 px-4 text-sm', }; const variants: Record, string> = { surface: 'bg-[var(--bl-input,var(--bl-surface-card,#1a1a2e))]', muted: 'bg-[var(--bl-surface-muted,#252540)]', ghost: 'bg-transparent', }; return (
{label && ( )} {error && ( )} {hint && !error && (

{hint}

)}
); } ); Input.displayName = 'Input';