// FeatureBento — Linear/Vercel-style mixed-size feature grid. Cells // support three sizes (`wide`, `tall`, `square`) and arrange into a // 4-column grid on desktop, single column on mobile. // // Each cell has its own hover treatment: a soft glow plus a subtle // border lift. Pass an `accent` ReactNode to render a custom // illustration / mini-demo as the cell's hero area. import type { ReactNode } from 'react' import { cn } from '../cn' export interface BentoCellProps { readonly title: ReactNode readonly description: ReactNode /** Icon shown in the top-left chip. */ readonly icon?: ReactNode /** Custom hero/illustration on the cell. */ readonly accent?: ReactNode /** Cell size: 'wide' (cols 1-2 on desktop), 'tall' (rows 1-2), * 'square' (1×1). Default 'square'. */ readonly size?: 'wide' | 'tall' | 'square' /** Optional extra content rendered below the description in the text * column — e.g. a "Learn more" link. */ readonly children?: ReactNode readonly className?: string } interface BentoProps { readonly children: ReactNode readonly className?: string } const sizeClass: Record, string> = { wide: 'md:col-span-2', tall: 'md:row-span-2', square: '', } export const Bento = ({ children, className }: BentoProps): ReactNode => (
{children}
) export const BentoCell = ({ title, description, icon, accent, size = 'square', className, children, }: BentoCellProps): ReactNode => (
{/* Hero illustration slot — pinned to the cell's right edge, full * height, ~50% wide. Accents inside can use `top-1/2 * -translate-y-1/2` to vertically centre on the cell. Text on the * left stays clear because it has its own constrained max-width * below. */} {accent ? ( ) : null} {/* Content column — explicit max-width so text always stays clear * of the right-half accent slot. ~32ch reads as roughly 280px at * text-sm, which leaves comfortable breathing room next to any * w-28 / w-32 accent in the right half of the cell. */}
{icon ? (
{icon}
) : null}

{title}

{description}

{children}
)