import React, { DetailedHTMLProps, InputHTMLAttributes, LabelHTMLAttributes, RefObject, TextareaHTMLAttributes, } from "react"; import { twMerge } from "tailwind-merge"; export type InputProps = DetailedHTMLProps< InputHTMLAttributes, HTMLInputElement > & DetailedHTMLProps< TextareaHTMLAttributes, HTMLTextAreaElement > & { label?: string; variant?: "normal" | "warning" | "error" | "inactive"; prefix?: string | React.ReactNode; suffix?: string | React.ReactNode; showLabel?: boolean; istextarea?: boolean; wrapperProps?: DetailedHTMLProps< InputHTMLAttributes, HTMLDivElement >; labelProps?: DetailedHTMLProps< LabelHTMLAttributes, HTMLLabelElement >; componentRef?: RefObject; }; /** * # Input Element * @className twui-input */ export default function Input({ label, variant, prefix, suffix, componentRef, labelProps, wrapperProps, showLabel, istextarea, ...props }: InputProps) { const [focus, setFocus] = React.useState(false); const targetComponent = istextarea ? (