/* eslint-disable react/prop-types */ // TODO: Remove disable rule and make it work import React from 'react' /* Import components here */ import { Caption } from '../../typography/caption' import { Label } from '../../typography/label' import { InputWrapper, StyledInput } from './text-input.styles' /* Import interfaces here */ import { TextInputProps } from './text-input.interfaces' import { textInputTheme } from './text-input.theme' import { ThemedComponent } from '../../theming' type TTextInput = React.ForwardRefExoticComponent> & ThemedComponent export const TextInput: TTextInput = React.forwardRef( ( { autoComplete, caption, captionType, className, disabled, fieldSize = 'medium', fullWidth = false, id, inputRef, inputType = 'text', label, name, onBlur, onChange, onClick, onFocus, pattern, placeholder, required, shape = 'rectangle', status = 'basic', step, value, }, ref, ): JSX.Element => { const [myID] = React.useState(id || Math.random().toString()) return ( {!!label && } {caption && typeof caption === 'string' ? ( {caption} ) : ( caption )} ) }, ) TextInput.defaultTheme = textInputTheme TextInput.displayName = 'TextInput'