"use strict";
exports.__esModule = true;
exports.Grid = exports.cnGrid = exports.breakpointSizes = exports.gridPropGap = exports.gridPropYAlign = exports.gridPropXAlign = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./Grid.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var classnames_1 = require("@bem-react/classnames");
var bem_1 = require("../../utils/bem");
var PropsWithAsAttributes_1 = require("../../utils/types/PropsWithAsAttributes");
var useBreakpoints_1 = require("./useBreakpoints");
(0, tslib_1.__exportStar)(require("./GridItem/GridItem"), exports);
exports.gridPropXAlign = ['left', 'center', 'right'];
exports.gridPropYAlign = ['top', 'center', 'bottom'];
exports.gridPropGap = [
    0,
    '2xs',
    'xs',
    's',
    'm',
    'l',
    'xl',
    '2xl',
    '3xl',
    '4xl',
    '5xl',
    '6xl',
];
exports.breakpointSizes = ['mobile', 'tablet', 'desktop'];
exports.cnGrid = (0, bem_1.cn)('Grid');
exports.Grid = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = props.as, as = _a === void 0 ? 'div' : _a, cols = props.cols, xAlign = props.xAlign, yAlign = props.yAlign, gap = props.gap, colGap = props.colGap, rowGap = props.rowGap, className = props.className, children = props.children, breakpoints = props.breakpoints, otherProps = (0, tslib_1.__rest)(props, ["as", "cols", "xAlign", "yAlign", "gap", "colGap", "rowGap", "className", "children", "breakpoints"]);
    var Tag = as;
    var breakpointsCn = (0, useBreakpoints_1.useBreakpoints)(exports.cnGrid, breakpoints);
    return (react_1["default"].createElement(Tag, (0, tslib_1.__assign)({}, otherProps, { className: (0, classnames_1.classnames)((0, exports.cnGrid)({
            cols: cols,
            gap: gap,
            colGap: colGap,
            rowGap: rowGap,
            xAlign: xAlign,
            yAlign: yAlign
        }), breakpointsCn, className), ref: ref }), children));
});
