import clsx from 'clsx'; import type { CSSProperties, ForwardedRef, InputHTMLAttributes, KeyboardEventHandler, ReactNode, } from 'react'; import { forwardRef } from 'react'; import { RowInput } from './row-input'; import { input, inputWrapper, mobileInputWrapper } from './style.css'; export type InputProps = { disabled?: boolean; onChange?: (value: string) => void; onBlur?: (ev: FocusEvent & { currentTarget: HTMLInputElement }) => void; onKeyDown?: KeyboardEventHandler; autoSelect?: boolean; noBorder?: boolean; status?: 'error' | 'success' | 'warning' | 'default'; size?: 'default' | 'large' | 'extraLarge'; preFix?: ReactNode; endFix?: ReactNode; type?: HTMLInputElement['type']; inputStyle?: CSSProperties; onEnter?: () => void; } & Omit, 'onChange' | 'size' | 'onBlur'>; export const Input = forwardRef(function Input( { disabled, onChange: propsOnChange, noBorder = false, className, status = 'default', style = {}, inputStyle = {}, size = 'default', preFix, endFix, onEnter, onKeyDown, onBlur, autoFocus, autoSelect, ...otherProps }: InputProps, upstreamRef: ForwardedRef ) { return (
{preFix} {endFix}
); });