import * as React from "react"; import { useField } from "formik"; import { Box } from "./Box"; import { StatelessTextInput } from "./StatelessTextInput"; import { ErrorLabel } from "./ErrorLabel"; import { Label } from "./Label"; import { CommonStyleProps } from "./system/unions"; export type ManagedTextInputFieldProps = { hasError?: boolean; disabled?: boolean; placeholder?: string; id: string; label?: string; caption?: string; type?: string; autoFocus?: boolean; } & React.HTMLAttributes & React.HTMLAttributes & CommonStyleProps; export const ManagedTextInputField = ({ disabled, hasError, placeholder, label, caption, id, children, type, fontFamily, borderColor, color, fontWeight, autoFocus, ...props }: ManagedTextInputFieldProps) => { const [field, meta] = useField(id); return ( {caption ? ( ) : null} {meta.error} ); }; ManagedTextInputField.displayName = "ManagedTextInputField";