import * as React from 'react'; import { clsx } from 'clsx'; export interface TextareaProps extends React.TextareaHTMLAttributes { label?: string; error?: string; hint?: string; controlSize?: 'sm' | 'md' | 'lg'; variant?: 'surface' | 'muted' | 'ghost'; } export const Textarea = React.forwardRef( ( { label, error, hint, controlSize = 'md', variant = 'surface', className, id, ...props }, ref ) => { const generatedId = React.useId(); const textareaId = id ?? (label || error || hint ? `textarea-${generatedId}` : undefined); const sizes: Record, string> = { sm: 'min-h-20 px-2.5 py-2 text-xs', md: 'min-h-24 px-3 py-2 text-sm', lg: 'min-h-32 px-4 py-3 text-base', }; const variants: Record, string> = { surface: 'bg-[var(--bl-surface-card,#1a1a2e)]', muted: 'bg-[var(--bl-surface-muted,#252540)]', ghost: 'bg-transparent', }; return (
{label && ( )}