/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-7eefd09
 * Released under the MIT license.
 */

import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { CONTAINER_STYLES, extractStyles, filterBaseProps, tasty, } from '../../tasty/index.js';
const SpaceElement = tasty({
    styles: {
        display: 'flex',
        gap: true,
        flow: {
            '': 'row',
            vertical: 'column',
        },
        placeItems: {
            '': 'center stretch',
            vertical: 'stretch',
        },
    },
});
export const Space = forwardRef(function Space(props, ref) {
    const { mods, direction, ...otherProps } = props;
    const styles = extractStyles(otherProps, CONTAINER_STYLES);
    return (_jsx(SpaceElement, { ...filterBaseProps(otherProps, { eventProps: true }), ref: ref, mods: {
            vertical: direction === 'vertical' ||
                otherProps.flow === 'column' ||
                styles.flow === 'column',
            ...mods,
        }, styles: styles }));
});

        