import { cloneElement, isValidElement, useId, type ReactElement, type ReactNode, } from "react"; import type { BaseProps, HTMLProps } from "../../shared/types"; import { cn } from "../../shared/utils/cn"; import { Typography } from "../typography/Typography"; import { cloneIcon } from "../../shared/utils/clone-icon"; export type InputProps = Omit< HTMLProps<"input">, "label" | "aria-invalid" | "checked" > & { label: string; start?: ReactElement>; end?: ReactElement>; error?: string; hint?: string; } & BaseProps; export const Input = ({ className, label, id: propId, disabled, value, onChange, start, end, error, type, hint, readOnly, testId, ...props }: InputProps) => { const generatedId = useId(); const id = propId ?? generatedId; const iconCss = cn( "w-6 h-6 text-light-neutral-300", error && " text-red-400" ); return ( ); };