import classNames from 'classnames';
import React, { forwardRef } from 'react';
import { FormField } from '../form-field';
import { jsx as _jsx } from "react/jsx-runtime";
export const TEXTAREA_RESIZE_VALUES = {
  VERTICAL: 'vertical',
  HORIZONTAL: 'horizontal'
};
/**
 * TextArea component, which supports label, helper text and validation
 * [CAPITALIZATION] Use sentence case for label and placeholder, no colon
 * [CAPITALIZATION] Helper text, in most cases, should be a complete sentence with a period
export function TextArea(props: FormFieldProps) {
 * [CAPITALIZATION] Don't have mixed format in one text block, use sentence case
 */
export const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
  const {
    fieldClass,
    useFont,
    allowResizing,
    ...rest
  } = props;
  const fieldClassName = classNames('text-area', fieldClass, {
    'no-font': !useFont,
    'vertical-resize': allowResizing === TEXTAREA_RESIZE_VALUES.VERTICAL,
    'horizontal-resize': allowResizing === TEXTAREA_RESIZE_VALUES.HORIZONTAL,
    'no-resize': !allowResizing
  });
  return /*#__PURE__*/_jsx(FormField, {
    ...rest,
    fieldClass: fieldClassName,
    children: /*#__PURE__*/_jsx("textarea", {
      ref: ref
    })
  });
});
TextArea.displayName = 'TextArea';
TextArea.defaultProps = {
  value: '',
  label: '',
  helperText: '',
  fieldClass: '',
  className: '',
  isDisabled: false,
  autoFocus: false,
  labelIcon: null,
  placeholder: '',
  required: false,
  useFont: true,
  onChange() {},
  onBlur() {},
  onFocus() {},
  allowResizing: true
};