import classnames from 'classnames';
import type { ComponentType, HTMLAttributes, ReactNode } from 'react';
const gapClasses = {
0: 'gap-0',
1: 'gap-1',
2: 'gap-2',
3: 'gap-3',
4: 'gap-4',
5: 'gap-5',
6: 'gap-6',
};
interface HStackProps extends BaseStackProps {
children?: ReactNode;
}
export function HStack({ className, space, children, ...props }: HStackProps) {
return (
{children}
);
}
export type VStackProps = BaseStackProps & {
children: ReactNode;
};
export function VStack({ className, space, children, ...props }: VStackProps) {
return (
{children}
);
}
type BaseStackProps = HTMLAttributes & {
as?: ComponentType | 'ul';
space?: keyof typeof gapClasses;
alignItems?: 'start' | 'center';
justifyContent?: 'start' | 'center' | 'end';
direction?: 'row' | 'col';
};
function BaseStack({
className,
direction,
alignItems,
justifyContent,
children,
as,
}: BaseStackProps) {
const Component = as ?? 'div';
return (
{children}
);
}