import { jsx as _jsx } from "react/jsx-runtime";
const ALIGN_CLASS = {
    start: 'items-start',
    center: 'items-center',
    end: 'items-end',
    baseline: 'items-baseline',
    stretch: 'items-stretch',
};
const JUSTIFY_CLASS = {
    start: 'justify-start',
    center: 'justify-center',
    end: 'justify-end',
    between: 'justify-between',
    around: 'justify-around',
    evenly: 'justify-evenly',
};
/**
 * Horizontal cluster of items with a consistent gap, wrapping by default.
 * The canonical use case is action toolbars (`<Cluster justify="end">`),
 * badge groups, breadcrumbs, etc. Never reach for `flex flex-wrap gap-2`
 * directly — use Cluster.
 */
export function Cluster({ space = '2', as: Component = 'div', align = 'center', justify = 'start', reverse, noWrap, className = '', children, ...rest }) {
    const classes = [
        'flex',
        reverse ? 'flex-row-reverse' : 'flex-row',
        noWrap ? 'flex-nowrap' : 'flex-wrap',
        `gap-${space}`,
        ALIGN_CLASS[align],
        JUSTIFY_CLASS[justify],
        className,
    ]
        .filter(Boolean)
        .join(' ');
    return (_jsx(Component, { className: classes, ...rest, children: children }));
}
//# sourceMappingURL=Cluster.js.map