import classNames from 'classnames'; import type { ComponentType, ForwardedRef, HTMLAttributes, ReactNode } from 'react'; import { forwardRef } from 'react'; const gapClasses = { 0: 'gap-0', 0.5: 'gap-0.5', 1: 'gap-1', 1.5: 'gap-1.5', 2: 'gap-2', 3: 'gap-3', 4: 'gap-4', 5: 'gap-5', 6: 'gap-6', }; interface HStackProps extends BaseStackProps { children?: ReactNode; } export const HStack = forwardRef(function HStack( { className, space, children, alignItems = 'center', ...props }: HStackProps, // eslint-disable-next-line @typescript-eslint/no-explicit-any ref: ForwardedRef, ) { return ( {children} ); }); export type VStackProps = BaseStackProps & { children: ReactNode; }; export const VStack = forwardRef(function VStack( { className, space, children, ...props }: VStackProps, // eslint-disable-next-line @typescript-eslint/no-explicit-any ref: ForwardedRef, ) { return ( {children} ); }); type BaseStackProps = HTMLAttributes & { as?: ComponentType | 'ul' | 'label' | 'form'; space?: keyof typeof gapClasses; alignItems?: 'start' | 'center' | 'stretch' | 'end'; justifyContent?: 'start' | 'center' | 'end' | 'between'; wrap?: boolean; }; const BaseStack = forwardRef(function BaseStack( { className, alignItems, justifyContent, wrap, children, as, ...props }: BaseStackProps, // eslint-disable-next-line @typescript-eslint/no-explicit-any ref: ForwardedRef, ) { const Component = as ?? 'div'; return ( {children} ); });