import { typeof as _typeof } from '../../../_virtual/_rollupPluginBabelHelpers.js';
import React__default, { Children, isValidElement, cloneElement } from 'react';

var getCorrectHeight = function getCorrectHeight(listMaxHeight) {
  if (Number.isNaN(Number(listMaxHeight))) {
    return listMaxHeight.toString();
  }
  return "".concat(listMaxHeight, "rem");
};
var childrenWithProps = function childrenWithProps(children, additionalProps) {
  return Children.map(children, function (child) {
    if (/*#__PURE__*/React__default.isValidElement(child)) {
      return /*#__PURE__*/React__default.cloneElement(child, additionalProps);
    }
    return child;
  });
};
var isReactObject = function isReactObject(element) {
  return _typeof(element) === 'object' || typeof element === 'function';
};
var getValidComponent = function getValidComponent(element, props) {
  if (/*#__PURE__*/isValidElement(element)) {
    return /*#__PURE__*/cloneElement(element, props);
  }
  if (isReactObject(element)) {
    var Component = element;
    return /*#__PURE__*/React__default.createElement(Component, props);
  }
  return element;
};

export { childrenWithProps, getCorrectHeight, getValidComponent };
//# sourceMappingURL=index.js.map
