{ "name": "stack", "displayName": "Stack", "type": "component", "files": [ { "name": "Stack.tsx", "content": "import {\n forwardRef,\n type CSSProperties,\n type ElementType,\n type ReactNode,\n} from 'react';\nimport { cn, vc } from '../../utils/cn';\nimport styles from './Stack.module.css';\n\nexport type StackDirection = 'horizontal' | 'vertical';\nexport type StackAlign = 'start' | 'center' | 'end' | 'stretch';\nexport type StackJustify = 'start' | 'center' | 'end' | 'between' | 'around';\n\nexport interface StackProps {\n direction?: StackDirection;\n /** Spacing token (1–12) or any CSS length. */\n gap?: string | number;\n align?: StackAlign;\n justify?: StackJustify;\n wrap?: boolean;\n as?: ElementType;\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n 'data-testid'?: string;\n}\n\nexport const Stack = forwardRef(function Stack(\n {\n direction = 'vertical',\n gap = '4',\n align,\n justify,\n wrap = false,\n as,\n className,\n style,\n children,\n 'data-testid': dataTestId = 'tatva-stack',\n },\n ref,\n) {\n const Component = (as ?? 'div') as ElementType;\n const gapVal =\n typeof gap === 'number' || /^\\d+$/.test(String(gap))\n ? `var(--tatva-space-${gap})`\n : gap;\n return (\n \n {children}\n \n );\n});\n" }, { "name": "Stack.module.css", "content": ".stack {\n display: flex;\n}\n\n.directionVertical {\n flex-direction: column;\n}\n.directionHorizontal {\n flex-direction: row;\n}\n\n.alignStart {\n align-items: flex-start;\n}\n.alignCenter {\n align-items: center;\n}\n.alignEnd {\n align-items: flex-end;\n}\n.alignStretch {\n align-items: stretch;\n}\n\n.justifyStart {\n justify-content: flex-start;\n}\n.justifyCenter {\n justify-content: center;\n}\n.justifyEnd {\n justify-content: flex-end;\n}\n.justifyBetween {\n justify-content: space-between;\n}\n.justifyAround {\n justify-content: space-around;\n}\n\n.wrap {\n flex-wrap: wrap;\n}\n" }, { "name": "index.ts", "content": "export { Stack } from './Stack';\nexport type {\n StackProps,\n StackDirection,\n StackAlign,\n StackJustify,\n} from './Stack';\n" } ], "registryDependencies": [], "dependencies": [], "devDependencies": [] }