import React from 'react'; import { clsx } from 'clsx'; interface InputProps extends React.InputHTMLAttributes { label?: string; error?: string; helperText?: string; leftIcon?: React.ReactNode; rightIcon?: React.ReactNode; } export const Input = React.forwardRef( ( { className, label, error, helperText, leftIcon, rightIcon, id, ...props }, ref ) => { const inputId = id || `input-${Math.random().toString(36).substr(2, 9)}`; return (
{label && ( )}
{leftIcon && (
{leftIcon}
)} {rightIcon && (
{rightIcon}
)}
{error && (

{error}

)} {helperText && !error && (

{helperText}

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