import React from 'react'; import { cn } from '@/lib/utils'; import { Icon } from './Icon'; export interface InputProps extends React.InputHTMLAttributes { label?: string; error?: string; icon?: string; compact?: boolean; } export const Input = React.forwardRef( ({ label, error, icon, compact = false, className, id, ...props }, ref) => { const inputId = id || (label ? label.toLowerCase().replace(/\s+/g, '-') : undefined); return (
{label && ( )}
{icon && (
)}
{error && {error}}
); } ); Input.displayName = 'Input'; export interface TextareaProps extends React.TextareaHTMLAttributes { label?: string; error?: string; } export const Textarea = React.forwardRef( ({ label, error, className, id, ...props }, ref) => { const textareaId = id || (label ? label.toLowerCase().replace(/\s+/g, '-') : undefined); return (
{label && ( )}