"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _propTypes = _interopRequireDefault(require("prop-types"));

var _react = _interopRequireDefault(require("react"));

var _useLabelMask2 = require("./useLabelMask");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

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

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

  var input = /*#__PURE__*/_react.default.cloneElement(field, inputProps);

  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, labelMask, input);
};

LabelMask.propTypes = {
  /**
     * Must contain a `TextField` component
     */
  children: _propTypes.default.node.isRequired
};
var _default = LabelMask;
exports.default = _default;