import { forwardRef } from "react"; import { InputRoot, InputRootProps, InputSlot } from "./input"; export interface TextInputProps extends Omit { value?: string; onChange?: (value: string) => void; placeholder?: string; prefix?: string; suffix?: string; maxLength?: number; } /** * Text input component for string values. * Provides a simple text input with optional prefix/suffix. * * @param value - The current text value * @param onChange - Callback when text changes * @param placeholder - Placeholder text * @param prefix - Optional prefix text/icon * @param suffix - Optional suffix text/icon * @param maxLength - Maximum character length */ export const TextInput = forwardRef(function TextInput( { value = "", onChange, prefix, suffix, placeholder, maxLength, ...props }, ref, ) { return ( onChange?.(e.target.value)} placeholder={placeholder} maxLength={maxLength} {...props} > {prefix && {prefix}} {suffix && {suffix}} ); });