{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"features-bento","type":"registry:block","title":"Features bento","description":"Tiles of two sizes, each showing the feature in miniature: a live chart, the team, sources and an alert switch.","dependencies":["lucide-react"],"registryDependencies":["https://dashral.com/r/utils.json","https://dashral.com/r/avatar.json","https://dashral.com/r/sparkline.json","https://dashral.com/r/switch.json"],"files":[{"path":"registry/dashral/blocks/features-bento.tsx","type":"registry:file","target":"components/dashral/blocks/features-bento.tsx","content":"\"use client\"\n\nimport { useState } from \"react\"\nimport { BellRing } from \"lucide-react\"\nimport { AvatarGroup } from \"../avatar\"\nimport { Sparkline } from \"../sparkline\"\nimport { Switch } from \"../switch\"\nimport { cn } from \"../lib/utils\"\n\n// The products named here are real ones, as examples: their names are their owners' trademarks, no affiliation implied. Put in the tools your product really works with.\nconst brands = { payments: \"Stripe\", store: \"Shopify\", crm: \"HubSpot\", analytics: \"Google Analytics\", chat: \"Slack\" }\n\nconst team = [\n  { name: \"Olivia Martin\", src: \"https://randomuser.me/api/portraits/women/44.jpg\" },\n  { name: \"Liam Johnson\", src: \"https://randomuser.me/api/portraits/men/32.jpg\" },\n  { name: \"Sofia Davis\", src: \"https://randomuser.me/api/portraits/women/68.jpg\" },\n  { name: \"Budi Santoso\" },\n  { name: \"Ava Chen\" },\n]\nconst sources = [brands.payments, brands.store, \"Postgres\", brands.crm, brands.analytics, brands.chat]\n\n/** A tile: the thing itself in miniature (`visual`), its title and a line; `wide` takes two columns. */\nexport type BentoTile = { title: string; text: React.ReactNode; visual: React.ReactNode; wide?: boolean }\n\nfunction Tile({ title, text, className, children }: { title: string; text: React.ReactNode; className?: string; children: React.ReactNode }) {\n  return (\n    <li className={cn(\"flex flex-col overflow-hidden rounded-2xl border bg-card\", className)}>\n      <div className=\"flex flex-1 items-center justify-center bg-muted/40 p-6\">{children}</div>\n      <div className=\"border-t p-5\">\n        <h3 className=\"font-semibold\">{title}</h3>\n        <p className=\"mt-1 text-sm text-muted-foreground\">{text}</p>\n      </div>\n    </li>\n  )\n}\n\n/**\n * Features as a bento grid, each tile showing the thing itself in miniature: a live chart, the team sharing a\n * board, the sources it connects and an alert you can switch on. Tiles of two sizes; one column on phones. Every\n * part comes from props: your tiles, each with a visual of its own.\n */\nexport function FeaturesBento({\n  eyebrow = \"Why teams switch\",\n  title = \"See it, share it, act on it\",\n  tiles = sampleTiles,\n}: {\n  eyebrow?: React.ReactNode\n  title?: React.ReactNode\n  tiles?: BentoTile[]\n}) {\n  return (\n    <section className=\"bg-background px-4 py-16 sm:px-6 sm:py-24\">\n      <div className=\"mx-auto max-w-6xl\">\n        <div className=\"mx-auto max-w-2xl text-center\">\n          {eyebrow && <p className=\"text-sm font-medium text-primary-text\">{eyebrow}</p>}\n          <h2 className=\"mt-3 text-3xl font-semibold tracking-[-0.03em] text-balance sm:text-4xl\">{title}</h2>\n        </div>\n        <ul className=\"mt-12 grid gap-4 md:grid-cols-3\">\n          {tiles.map((tile) => (\n            <Tile key={tile.title} title={tile.title} text={tile.text} className={cn(tile.wide && \"md:col-span-2\")}>\n              {tile.visual}\n            </Tile>\n          ))}\n        </ul>\n      </div>\n    </section>\n  )\n}\n\n/** The sample alert: a spike, and a switch to hear about it. */\nfunction AlertVisual() {\n  const [alerts, setAlerts] = useState(true)\n  return (\n    <div className=\"grid w-full max-w-md gap-3\">\n      <div className=\"flex items-center gap-3 rounded-xl border bg-card p-3 shadow-sm\">\n        <span className=\"grid size-9 place-items-center rounded-lg bg-warning/15 text-warning-text\">\n          <BellRing className=\"size-4\" aria-hidden />\n        </span>\n        <span className=\"flex-1 text-sm\">\n          Signups up <span className=\"font-semibold\">38%</span> since 9 AM\n        </span>\n      </div>\n      <Switch label=\"Tell me when signups spike\" checked={alerts} onCheckedChange={setAlerts} labelPosition=\"start\" classNames={{ root: \"rounded-xl border bg-card p-3 shadow-sm\" }} />\n    </div>\n  )\n}\n\nconst sampleTiles: BentoTile[] = [\n  {\n    title: \"Live, not yesterday's\",\n    text: \"Every chart moves the moment your data does.\",\n    wide: true,\n    visual: (\n      <div className=\"w-full max-w-md rounded-xl border bg-card p-4 shadow-sm\">\n        <div className=\"flex items-baseline justify-between\">\n          <span className=\"text-xs text-muted-foreground\">Revenue</span>\n          <span className=\"text-xs font-medium text-success-text\">+12.5%</span>\n        </div>\n        <p className=\"mt-1 text-2xl font-semibold tabular-nums\">$48,290</p>\n        <Sparkline data={[31, 34, 33, 38, 36, 41, 40, 44, 43, 47, 46, 52]} variant=\"area\" showLast className=\"mt-3 h-20\" aria-label=\"Revenue rising over 12 weeks\" />\n      </div>\n    ),\n  },\n  {\n    title: \"Made for the team\",\n    text: \"Share a board; comments and mentions keep everyone in it.\",\n    visual: (\n      <div className=\"grid justify-items-center gap-3\">\n        <AvatarGroup items={team} max={4} size=\"lg\" showNames aria-label=\"5 people on this board\" />\n        <span className=\"rounded-full border bg-card px-3 py-1 text-xs text-muted-foreground shadow-sm\">Olivia is viewing</span>\n      </div>\n    ),\n  },\n  {\n    title: \"Connects to what you use\",\n    text: \"Forty sources, set up in a couple of clicks.\",\n    visual: (\n      <div className=\"flex max-w-56 flex-wrap justify-center gap-2\">\n        {sources.map((source) => (\n          <span key={source} className=\"rounded-md border bg-card px-2.5 py-1 text-xs font-medium shadow-sm\">\n            {source}\n          </span>\n        ))}\n      </div>\n    ),\n  },\n  { title: \"Alerts, not noise\", text: \"One message when something actually changes.\", wide: true, visual: <AlertVisual /> },\n]\n"}],"cssVars":{"theme":{"color-primary-text":"var(--primary-text, var(--primary))","color-success":"var(--success)","color-success-foreground":"var(--success-foreground)","color-success-text":"var(--success-text)","color-warning":"var(--warning)","color-warning-foreground":"var(--warning-foreground)","color-warning-text":"var(--warning-text)"},"light":{"success":"oklch(0.508 0.118 165.612)","success-foreground":"oklch(0.985 0 0)","success-text":"oklch(0.432 0.095 166.913)","warning":"#f59200","warning-foreground":"oklch(0.3 0.07 60)","warning-text":"#964e00"},"dark":{"success":"oklch(0.696 0.17 162.48)","success-foreground":"oklch(0.2 0.04 160)","success-text":"oklch(0.765 0.177 163.223)","warning":"#f59200","warning-foreground":"oklch(0.25 0.06 60)","warning-text":"#ffba42"}}}