'use client'; import React, { forwardRef } from 'react'; import { cn, Surface, useEffectiveSurface, surfaceClasses } from '../common'; import { stackGap, StackGapKey } from '../tokens'; const alignMap = { start: 'items-start', center: 'items-center', end: 'items-end', stretch: 'items-stretch', baseline: 'items-baseline', } as const; const justifyMap = { start: 'justify-start', center: 'justify-center', end: 'justify-end', between: 'justify-between', around: 'justify-around', evenly: 'justify-evenly', } as const; export interface PixelClusterProps extends React.HTMLAttributes { gap?: StackGapKey; align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline'; justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'; as?: keyof React.JSX.IntrinsicElements; surface?: Surface; } export const PixelCluster = forwardRef(function PixelCluster( { gap = 4, align = 'center', justify, as, surface: surfaceProp, className, children, ...rest }, ref, ) { const surface = useEffectiveSurface(surfaceProp); const s = surfaceClasses(surface); const Comp = (as ?? 'div') as 'div'; return ( {children} ); }); PixelCluster.displayName = 'PixelCluster';