"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Box = exports.BoxBase = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const core_1 = require("../core");
const utils_1 = require("../utils");
exports.BoxBase = core_1.styled.divBox `
  display: flex;
  min-width: 0;
  transition-duration: normal;
`;
/** Organizes content layout into columns or rows with easy centering. */
exports.Box = (0, core_1.vui)((props, ref) => {
    const _a = (0, core_1.omitThemingProps)(props), { align, center, centerH, centerV, className, column, direction, elevation, hoverShadow: hoverBoxShadow, justify, radius: borderRadius, shadow, wrap } = _a, rest = __rest(_a, ["align", "center", "centerH", "centerV", "className", "column", "direction", "elevation", "hoverShadow", "justify", "radius", "shadow", "wrap"]);
    const styles = (0, core_1.useStyleConfig)('Box', props);
    const alignItems = center || (column ? centerH : centerV) ? 'center' : undefined;
    const flexDirection = column ? 'column' : undefined;
    const justifyContent = center || (column ? centerV : centerH) ? 'center' : undefined;
    const aliasedProps = (0, utils_1.filterUndefined)({
        alignItems: align !== null && align !== void 0 ? align : alignItems,
        borderRadius,
        boxShadow: elevation !== null && elevation !== void 0 ? elevation : shadow,
        flexDirection: direction !== null && direction !== void 0 ? direction : flexDirection,
        flexWrap: wrap ? 'wrap' : undefined,
        justifyContent: justify !== null && justify !== void 0 ? justify : justifyContent,
    });
    return (0, jsx_runtime_1.jsx)(exports.BoxBase, Object.assign({ className: (0, utils_1.cs)('vui-box', className), ref: ref }, styles, aliasedProps, rest));
});
exports.Box.displayName = 'Box';
exports.default = exports.Box;
//# sourceMappingURL=box.js.map