import * as React from 'react'; import classNames from 'classnames'; import { classNameModifier } from '../shared/utils'; import { ComponentClassNames } from '../shared/constants'; import { FieldDescription, FieldErrorMessage } from '../Field'; import { Flex } from '../Flex'; import { Label } from '../Label'; import { ForwardRefPrimitive, Primitive } from '../types'; import { splitPrimitiveProps } from '../utils/splitPrimitiveProps'; import { TextArea } from '../TextArea'; import { BaseTextAreaFieldProps, TextAreaFieldProps, } from '../types/textAreaField'; import { useStableId } from '../utils/useStableId'; export const DEFAULT_ROW_COUNT = 3; const TextAreaFieldPrimitive: Primitive = ( props, ref ) => { const { className, descriptiveText, errorMessage, hasError = false, id, label, labelHidden = false, rows, size, testId, inputStyles, // Destructuring the 'resize' style prop because while it is a style prop // it should go on the textarea element and not the wrapper div. resize, ..._rest } = props; const fieldId = useStableId(id); const descriptionId = useStableId(); const ariaDescribedBy = descriptiveText ? descriptionId : undefined; const { styleProps, rest } = splitPrimitiveProps(_rest); return (