import { assignInlineVars } from '@vanilla-extract/dynamic'; import clsx from 'clsx'; import type { ChangeEventHandler, CSSProperties, FocusEventHandler, ForwardedRef, HTMLAttributes, KeyboardEventHandler, } from 'react'; import { forwardRef, useCallback } from 'react'; import { heightVar, inputStyle, widthVar } from './index.css'; type inputProps = { value?: string; placeholder?: string; disabled?: boolean; width?: CSSProperties['width']; height?: CSSProperties['height']; maxLength?: number; minLength?: number; onChange?: (value: string) => void; onBlur?: FocusEventHandler; onKeyDown?: KeyboardEventHandler; noBorder?: boolean; } & Omit, 'onChange'>; export const Input = forwardRef(function Input( { disabled, value, placeholder, maxLength, minLength, height, width, onChange, noBorder = false, className, ...otherProps }: inputProps, ref: ForwardedRef ) { const handleChange = useCallback>( e => { const { value } = e.target; onChange && onChange(value); }, [onChange] ); return ( ); });