import * as React from 'react'; import { cn } from '@/lib/utils'; /** * Layout helpers. * * These exist so vertical rhythm and grid behaviour are declared once. The * reference pages each invented their own spacing (`space-y-5`, `space-y-6`, * `space-y-8` on sibling pages), which is exactly the drift a design system is * supposed to prevent. */ const GAPS = { sm: 'gap-3', default: 'gap-4', lg: 'gap-6' }; /** * Grid — responsive column layouts with the app's standard breakpoints. * * `cols` is the count at the largest breakpoint; the intermediate steps are * chosen to avoid orphan cards (6 → 2/3/6 rather than 1/3/6). */ /** @param {any} props */ export function Grid({ cols = 3, gap = 'default', className, children, ...props }) { const columns = { 1: 'grid-cols-1', 2: 'grid-cols-1 sm:grid-cols-2', 3: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3', 4: 'grid-cols-2 md:grid-cols-3 lg:grid-cols-4', 5: 'grid-cols-2 md:grid-cols-3 lg:grid-cols-5', 6: 'grid-cols-2 md:grid-cols-3 lg:grid-cols-6', }[cols]; return (
{children}
); } /** Stack — vertical rhythm. `space` maps to the two spacings pages should use. */ /** @param {any} props */ export function Stack({ space = 'default', className, children, ...props }) { const spacing = { xs: 'space-y-2', sm: 'space-y-3', default: 'space-y-5', lg: 'space-y-6', xl: 'space-y-8', }[space]; return (
{children}
); } /** * PageSection — a titled region of a page. Pairs a SectionHeader-style label * with its content at consistent spacing. */ /** @param {any} props */ export function PageSection({ title, subtitle, actions, level = 'overline', className, children }) { return (
{title && (
{level === 'overline' ? (

{title}

) : (

{title}

{subtitle &&

{subtitle}

}
)} {actions &&
{actions}
}
)} {children}
); }