import { _ as _extends } from '../extends-C4cduGrv.js';
import { _ as _objectWithoutProperties } from '../objectWithoutProperties-TXwlfNxG.js';
import React__default from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';

var _excluded = ["maxLength", "value"];
var DEFAULT = "text-gray-600";

function WithCharacterCount(_ref) {
  var maxLength = _ref.maxLength,
      value = _ref.value,
      props = _objectWithoutProperties(_ref, _excluded);

  var currentLength = value.length;
  var children = props.children;
  var className = cx(props.className, DEFAULT);
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children, /*#__PURE__*/React__default.createElement("p", _extends({
    className: className
  }, props), currentLength, " / ", maxLength));
}

WithCharacterCount.propTypes = {
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
  className: PropTypes.string,
  maxLength: PropTypes.number,
  value: PropTypes.string
};

export { WithCharacterCount as default };
