import _pt from "prop-types";
import React from 'react';
import { useLabelMask } from './useLabelMask';

var LabelMask = function LabelMask(props) {
  var field = React.Children.only(props.children);

  var _useLabelMask = useLabelMask(props.labelMask, field.props),
      labelMask = _useLabelMask.labelMask,
      inputProps = _useLabelMask.inputProps;

  var input = /*#__PURE__*/React.cloneElement(field, inputProps);
  return /*#__PURE__*/React.createElement(React.Fragment, null, labelMask, input);
};

LabelMask.propTypes = {
  /**
     * Must contain a `TextField` component
     */
  children: _pt.node.isRequired
};
export default LabelMask;