{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"bento-grid","type":"registry:ui","title":"Bento Grid","description":"Responsive bento layout of feature tiles with hover lifts, playful icons and a cursor spotlight that glows across tile borders.","dependencies":["lucide-react"],"registryDependencies":[],"files":[{"path":"registry/ui/bento-grid.tsx","type":"registry:ui","content":"\"use client\";\n\nimport { useRef, type CSSProperties, type PointerEvent, type ReactNode } from \"react\";\nimport { ArrowRight } from \"lucide-react\";\n\nexport interface BentoGridProps {\n  children: ReactNode;\n  /** Columns on wide screens (collapses to one column on small screens). */\n  columns?: number;\n  /** Row height in px. */\n  rowHeight?: number;\n  /** Gap between tiles in px. */\n  gap?: number;\n  /** Cursor spotlight that glows across tile borders. */\n  spotlight?: boolean;\n  /** Spotlight color. */\n  spotlightColor?: string;\n  className?: string;\n}\n\nexport function BentoGrid({\n  children,\n  columns = 3,\n  rowHeight = 176,\n  gap = 12,\n  spotlight = true,\n  spotlightColor = \"#a3e635\",\n  className,\n}: BentoGridProps) {\n  const root = useRef<HTMLDivElement>(null);\n\n  // One listener on the grid feeds every tile, so the glow bleeds across neighbouring borders.\n  const onMove = (e: PointerEvent<HTMLDivElement>) => {\n    if (!spotlight) return;\n    for (const el of root.current!.querySelectorAll<HTMLElement>(\"[data-bento-card]\")) {\n      const r = el.getBoundingClientRect();\n      el.style.setProperty(\"--bx\", `${e.clientX - r.left}px`);\n      el.style.setProperty(\"--by\", `${e.clientY - r.top}px`);\n    }\n  };\n\n  return (\n    <div\n      ref={root}\n      onPointerMove={onMove}\n      className={`group/grid grid w-full grid-cols-1 md:[grid-template-columns:repeat(var(--bento-cols),minmax(0,1fr))] ${className ?? \"\"}`}\n      style={\n        {\n          \"--bento-cols\": columns,\n          \"--bento-spot\": spotlight ? spotlightColor : \"transparent\",\n          gridAutoRows: rowHeight,\n          gap,\n        } as CSSProperties\n      }\n    >\n      {children}\n    </div>\n  );\n}\n\nexport interface BentoCardProps {\n  title: string;\n  description: string;\n  icon: ReactNode;\n  /** Decorative visual that fills the top of the tile. Style it with `group-hover/bento:` for hover motion. */\n  visual?: ReactNode;\n  /** Link for the reveal-on-hover call to action. */\n  href?: string;\n  cta?: string;\n  /** Use for spans, e.g. \"md:col-span-2 md:row-span-2\". */\n  className?: string;\n}\n\nexport function BentoCard({ title, description, icon, visual, href, cta = \"Learn more\", className }: BentoCardProps) {\n  return (\n    <div\n      data-bento-card\n      className={`group/bento relative isolate overflow-hidden rounded-2xl border border-border bg-card transition-[transform,box-shadow] duration-500 ease-[cubic-bezier(.2,.7,.2,1)] hover:-translate-y-0.5 hover:shadow-[0_24px_50px_-24px_rgba(0,0,0,.7)] ${className ?? \"\"}`}\n    >\n      {/* Border glow: a radial gradient masked to the 1px ring. */}\n      <div\n        aria-hidden\n        className=\"pointer-events-none absolute inset-0 z-20 rounded-[inherit] opacity-0 transition-opacity duration-300 group-hover/grid:opacity-100\"\n        style={{\n          padding: 1,\n          background: \"radial-gradient(260px circle at var(--bx,-999px) var(--by,-999px), var(--bento-spot), transparent 70%)\",\n          WebkitMask: \"linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)\",\n          mask: \"linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)\",\n        }}\n      />\n      <div\n        aria-hidden\n        className=\"pointer-events-none absolute inset-0 -z-10 opacity-0 transition-opacity duration-300 group-hover/bento:opacity-100\"\n        style={{ background: \"radial-gradient(320px circle at var(--bx,50%) var(--by,50%), color-mix(in oklab, var(--bento-spot) 10%, transparent), transparent 70%)\" }}\n      />\n\n      {visual && (\n        <div\n          aria-hidden\n          className=\"absolute inset-0 -z-10 transition-transform duration-700 ease-[cubic-bezier(.2,.7,.2,1)] group-hover/bento:scale-[1.04] [mask-image:linear-gradient(to_bottom,#000_35%,transparent_85%)]\"\n        >\n          {visual}\n        </div>\n      )}\n\n      <div className=\"absolute inset-x-0 bottom-0 flex translate-y-7 flex-col gap-1 p-5 transition-transform duration-500 ease-[cubic-bezier(.2,.7,.2,1)] group-hover/bento:translate-y-0 group-focus-within/bento:translate-y-0\">\n        <span className=\"mb-2 grid size-9 origin-bottom-left place-items-center rounded-lg border border-border bg-muted text-foreground transition-transform duration-500 ease-[cubic-bezier(.2,.7,.2,1)] group-hover/bento:-rotate-6 group-hover/bento:scale-110 [&>svg]:size-[18px]\">\n          {icon}\n        </span>\n        <h3 className=\"text-base font-semibold text-foreground\">{title}</h3>\n        <p className=\"max-w-sm text-sm text-muted-foreground\">{description}</p>\n        {href ? (\n          <a\n            href={href}\n            className=\"mt-1 inline-flex w-fit items-center gap-1 rounded text-sm font-medium text-foreground opacity-0 outline-none transition-opacity duration-300 group-hover/bento:opacity-100 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring\"\n          >\n            {cta}\n            <ArrowRight className=\"size-3.5 transition-transform group-hover/bento:translate-x-0.5\" />\n          </a>\n        ) : (\n          <span className=\"h-5\" />\n        )}\n      </div>\n    </div>\n  );\n}\n"}]}