import classNames from 'classnames'
import { HTMLInputTypeAttribute, HTMLProps, ReactNode, useId } from 'react'
import Field from '../field'
import './style.scss'
interface TextInputBaseProps {
type?: HTMLInputTypeAttribute
isInvalid?: boolean
isLoading?: boolean
required?: boolean
className?: string
id: string
field: HTMLProps
}
function TextInputBase({
type,
isInvalid,
isLoading,
className,
id,
field,
...rest
}: TextInputBaseProps) {
return (
)
}
interface TextInputFieldProps {
type?: HTMLInputTypeAttribute
isInvalid?: boolean
isLoading?: boolean
isRequired?: boolean
isOptional?: boolean
id?: string
label?: ReactNode
helperText?: ReactNode
error?: ReactNode
field: HTMLProps
className?: string
}
export default function TextInputField({
type = 'text',
isInvalid,
isLoading,
isRequired,
isOptional,
id,
label,
helperText,
error,
field,
className,
...rest
}: TextInputFieldProps) {
const generatedId = useId()
const inputId = id ?? generatedId
return (
)
}