import React__default from 'react';
import classnames from 'classnames';

var styles = {"vertical":"RwhScbXCXw0-","horizontal":"xxMbKnv30VQ-","inputGroup":"l87dJm2JnlA-","spinning":"XZBCtuO467Y-"};

function InputGroup({ children, flowDirection = "vertical", }) {
    if (isInvalidGroupNesting(children))
        return React__default.createElement(React__default.Fragment, null);
    const className = classnames(styles.inputGroup, styles[flowDirection]);
    return React__default.createElement("div", { className: className }, children);
}
function isInputGroupElement(node) {
    return React__default.isValidElement(node) && node.type === InputGroup;
}
function isInvalidGroupNesting(childs) {
    return React__default.Children.toArray(childs).some(child => {
        if (isInputGroupElement(child) &&
            child.props.flowDirection !== "horizontal") {
            console.error(`ERROR: InputGroup not rendered: nesting 'flowDirection="vertical"' columns not supported.`, `https://atlantis.getjobber.com/?path=/story/components-forms-and-inputs-inputgroup-web--nested`);
            return true;
        }
        return false;
    });
}

export { InputGroup as I };
