import * as tslib_1 from "tslib";
import React from 'react';
import classNames from 'classnames';
var defaultProps = {
    prefixCls: 'ty-row',
    gutter: 0,
    gutterSide: false,
};
var Row = function (props) {
    var _a;
    var gutter = props.gutter, align = props.align, justify = props.justify, gutterSide = props.gutterSide, prefixCls = props.prefixCls, className = props.className, style = props.style, children = props.children;
    var cls = classNames(prefixCls, className, (_a = {},
        _a[prefixCls + "_align-" + align] = align,
        _a[prefixCls + "_justify-" + justify] = justify,
        _a));
    return (React.createElement("div", { className: cls, style: style }, React.Children.map(children, function (child, index) {
        var gutterStyle = gutter ? {
            paddingLeft: !gutterSide && (index === 0) ? 0 : gutter / 2,
            paddingRight: !gutterSide && (index === React.Children.count(children) - 1) ? 0 : gutter / 2,
        } : {};
        return (React.cloneElement(child, tslib_1.__assign({}, child.props, { style: tslib_1.__assign({}, child.props.style, gutterStyle) })));
    })));
};
Row.defaultProps = defaultProps;
export default Row;
//# sourceMappingURL=index.js.map