'use strict';

var clsx = require('clsx');
var React = require('react');
var _common = require('./_common.js');
var contexts = require('./contexts.js');
var jsxRuntime = require('react/jsx-runtime');

const TextArea = /*#__PURE__*/React.forwardRef(function TextArea({
  className,
  maxLength,
  ...restProps
}, reference) {
  const inputAttributes = contexts.useInputAttributes();
  const value = restProps.value ?? restProps.defaultValue ?? '';
  const currentLength = typeof value === 'string' ? value.length : String(value).length;
  contexts.useTextareaCharacterCount(currentLength, maxLength);
  return /*#__PURE__*/jsxRuntime.jsx("textarea", {
    ref: reference,
    className: clsx.clsx(className, _common.inputClassNameBase(), 'np-text-area'),
    maxLength: maxLength,
    ...inputAttributes,
    ...restProps
  });
});

exports.TextArea = TextArea;
//# sourceMappingURL=TextArea.js.map
