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