import * as React from 'react'; import classNames from 'classnames'; import { classNameModifier, classNameModifierByFlag } from '../shared/utils'; import { ComponentClassNames } from '../shared'; import { BaseInputProps, InputProps, ForwardRefPrimitive, Primitive, } from '../types'; import { View } from '../View'; const InputPrimitive: Primitive = ( { autoComplete, checked, className, defaultChecked, defaultValue, id, isDisabled, isReadOnly, isRequired, size, type = 'text', hasError = false, value, variation, onBlur, onChange, onCopy, onCut, onFocus, onInput, onPaste, onSelect, onWheel, ...rest }, ref ) => { const componentClasses = classNames( ComponentClassNames.Input, ComponentClassNames.FieldGroupControl, classNameModifier(ComponentClassNames.Input, variation), classNameModifierByFlag(ComponentClassNames.Input, 'error', hasError), classNameModifier(ComponentClassNames.Input, size), className ); return ( ); }; export const Input: ForwardRefPrimitive = React.forwardRef(InputPrimitive); Input.displayName = 'Input';