{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"integration-cards-connect-grid","type":"registry:component","title":"Integration cards · Connect grid","description":"Grid of apps with All and Connected filters, a connect flow that spins then springs to Connected, and layout-animated filtering.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":[],"files":[{"path":"registry/geturui/examples/integration-cards/connect-grid.tsx","type":"registry:component","target":"components/examples/integration-cards/connect-grid.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { CheckCircle2, LoaderCircle, Plus } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport type IntegrationGlyph = \"ring\" | \"diamond\" | \"stack\" | \"wave\" | \"split\" | \"bolt\";\n\nexport interface IntegrationApp {\n  id: string;\n  name: string;\n  category: string;\n  description: string;\n  glyph?: IntegrationGlyph;\n  connected?: boolean;\n}\n\nexport interface IntegrationGridProps {\n  apps?: IntegrationApp[];\n  /** Resolve to finish connecting; defaults to a short simulated delay. */\n  onConnect?: (id: string) => Promise<void> | void;\n  onDisconnect?: (id: string) => void;\n  className?: string;\n}\n\ntype Status = \"idle\" | \"connecting\" | \"connected\";\nconst spring = { type: \"spring\", stiffness: 380, damping: 30 } as const;\n\n/** Monochrome mark drawn from simple shapes, so third-party apps never bring their own colours. */\nexport function Glyph({ kind = \"ring\", className }: { kind?: IntegrationGlyph; className?: string }) {\n  const shapes: Record<IntegrationGlyph, React.ReactNode> = {\n    ring: (\n      <>\n        <circle cx=\"12\" cy=\"12\" r=\"7\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" />\n        <circle cx=\"12\" cy=\"12\" r=\"2.5\" fill=\"currentColor\" />\n      </>\n    ),\n    diamond: <path d=\"M12 3 21 12 12 21 3 12Z M12 8 16 12 12 16 8 12Z\" fill=\"currentColor\" fillRule=\"evenodd\" />,\n    stack: (\n      <>\n        <rect x=\"4\" y=\"4\" width=\"16\" height=\"4\" rx=\"2\" fill=\"currentColor\" />\n        <rect x=\"4\" y=\"10\" width=\"11\" height=\"4\" rx=\"2\" fill=\"currentColor\" opacity=\".7\" />\n        <rect x=\"4\" y=\"16\" width=\"7\" height=\"4\" rx=\"2\" fill=\"currentColor\" opacity=\".45\" />\n      </>\n    ),\n    wave: <path d=\"M3 15c3-6 6-6 9 0s6 6 9 0\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" />,\n    split: (\n      <>\n        <path d=\"M12 3a9 9 0 0 1 0 18Z\" fill=\"currentColor\" />\n        <circle cx=\"12\" cy=\"12\" r=\"8\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" />\n      </>\n    ),\n    bolt: <path d=\"M13 2 5 14h6l-1 8 8-12h-6Z\" fill=\"currentColor\" />,\n  };\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden className={className}>\n      {shapes[kind]}\n    </svg>\n  );\n}\n\n/** Grid of integrations with All/Connected filters and an optimistic connect flow: spinner, then a springy connected state. */\nexport function IntegrationGrid({\n  apps = [\n    { id: \"lumen\", name: \"Lumen CRM\", category: \"CRM\", description: \"Sync contacts and deal stages.\", glyph: \"ring\", connected: true },\n    { id: \"ledgerly\", name: \"Ledgerly\", category: \"Accounting\", description: \"Push paid invoices to your books.\", glyph: \"stack\" },\n    { id: \"parcel\", name: \"Parcel\", category: \"Shipping\", description: \"Create labels when orders ship.\", glyph: \"diamond\" },\n    { id: \"helio\", name: \"Helio Docs\", category: \"Docs\", description: \"Attach specs to any project.\", glyph: \"split\", connected: true },\n    { id: \"quartz\", name: \"Quartz\", category: \"Analytics\", description: \"Stream events to your dashboards.\", glyph: \"wave\" },\n    { id: \"relay\", name: \"Relay\", category: \"Automation\", description: \"Trigger workflows on new records.\", glyph: \"bolt\" },\n  ],\n  onConnect,\n  onDisconnect,\n  className,\n}: IntegrationGridProps) {\n  const reduce = useReducedMotion();\n  const [status, setStatus] = React.useState<Record<string, Status>>(() => Object.fromEntries(apps.map((a) => [a.id, a.connected ? \"connected\" : \"idle\"])));\n  const [filter, setFilter] = React.useState<\"all\" | \"connected\">(\"all\");\n  const timers = React.useRef<number[]>([]);\n  const tabsId = React.useId();\n  React.useEffect(() => () => timers.current.forEach((t) => window.clearTimeout(t)), []);\n\n  const connectedCount = apps.filter((a) => status[a.id] === \"connected\").length;\n  const visible = apps.filter((a) => filter === \"all\" || status[a.id] === \"connected\");\n\n  async function connect(id: string) {\n    setStatus((s) => ({ ...s, [id]: \"connecting\" }));\n    if (onConnect) await onConnect(id);\n    else await new Promise<void>((r) => timers.current.push(window.setTimeout(r, 1100)));\n    setStatus((s) => ({ ...s, [id]: \"connected\" }));\n  }\n\n  return (\n    <div className={cn(\"w-full max-w-[560px] rounded-lg border border-border bg-surface-raised p-4 shadow-sm\", className)}>\n      <div className=\"mb-3.5 flex flex-wrap items-center justify-between gap-2\">\n        <div>\n          <h3 className=\"font-display text-[17px] font-semibold tracking-tight text-ink\">Integrations</h3>\n          <p className=\"text-xs text-ink-subtle\">Connect the tools your team already uses.</p>\n        </div>\n        <div role=\"tablist\" aria-label=\"Filter integrations\" className=\"flex rounded-full bg-surface-sunken p-0.5\">\n          {([\"all\", \"connected\"] as const).map((f) => (\n            <button\n              key={f}\n              type=\"button\"\n              role=\"tab\"\n              aria-selected={filter === f}\n              aria-controls={tabsId}\n              onClick={() => setFilter(f)}\n              className={cn(\n                \"relative h-7 rounded-full px-3 text-[12px] font-medium outline-none transition-colors focus-visible:shadow-[var(--focus-ring)]\",\n                filter === f ? \"text-ink\" : \"text-ink-subtle hover:text-ink\",\n              )}\n            >\n              {filter === f && <motion.span layoutId={`${tabsId}-pill`} transition={spring} className=\"absolute inset-0 rounded-full border border-border bg-surface-raised shadow-sm\" />}\n              <span className=\"relative\">\n                {f === \"all\" ? \"All\" : \"Connected\"}{\" \"}\n                <span className=\"font-mono text-ink-subtle tabular-nums\">{f === \"all\" ? apps.length : connectedCount}</span>\n              </span>\n            </button>\n          ))}\n        </div>\n      </div>\n\n      <motion.ul id={tabsId} role=\"tabpanel\" layout className=\"grid grid-cols-1 gap-2 min-[400px]:grid-cols-2\">\n        <AnimatePresence mode=\"popLayout\" initial={false}>\n          {visible.map((a) => {\n            const st = status[a.id];\n            return (\n              <motion.li\n                key={a.id}\n                layout\n                initial={{ opacity: 0, scale: reduce ? 1 : 0.94 }}\n                animate={{ opacity: 1, scale: 1 }}\n                exit={{ opacity: 0, scale: reduce ? 1 : 0.94 }}\n                transition={spring}\n                className=\"flex flex-col gap-3 rounded-md border border-border bg-surface p-3\"\n              >\n                <div className=\"flex items-center justify-between gap-2\">\n                  <span className=\"grid size-10 shrink-0 place-items-center rounded-sm border border-border bg-surface-raised text-ink shadow-sm\">\n                    <Glyph kind={a.glyph} className=\"size-5\" />\n                  </span>\n                  <motion.button\n                    type=\"button\"\n                    whileTap={{ scale: 0.94 }}\n                    disabled={st === \"connecting\"}\n                    aria-label={`${st === \"connected\" ? \"Disconnect\" : \"Connect\"} ${a.name}`}\n                    onClick={() => {\n                      if (st === \"connected\") {\n                        setStatus((s) => ({ ...s, [a.id]: \"idle\" }));\n                        onDisconnect?.(a.id);\n                      } else connect(a.id);\n                    }}\n                    className={cn(\n                      \"inline-flex h-8 shrink-0 items-center gap-1 rounded-full px-3 text-[12px] font-medium outline-none transition-colors focus-visible:shadow-[var(--focus-ring)]\",\n                      st === \"connected\" ? \"text-ink-muted hover:bg-surface-hover hover:text-ink\" : \"border border-border-strong text-ink hover:bg-surface-hover\",\n                    )}\n                  >\n                    {st === \"connecting\" ? (\n                      <LoaderCircle aria-hidden className=\"size-3.5 animate-spin\" />\n                    ) : st === \"connected\" ? (\n                      \"Disconnect\"\n                    ) : (\n                      <>\n                        <Plus aria-hidden className=\"size-3.5\" />\n                        Connect\n                      </>\n                    )}\n                  </motion.button>\n                </div>\n                <div className=\"min-w-0\">\n                  <p className=\"truncate text-[13.5px] font-medium text-ink\">\n                    {a.name} <span className=\"text-[11.5px] font-normal text-ink-subtle\">· {a.category}</span>\n                  </p>\n                  <AnimatePresence mode=\"popLayout\" initial={false}>\n                    {st === \"connected\" ? (\n                      <motion.p\n                        key=\"on\"\n                        initial={{ opacity: 0, y: reduce ? 0 : 4 }}\n                        animate={{ opacity: 1, y: 0 }}\n                        exit={{ opacity: 0 }}\n                        className=\"mt-0.5 flex min-h-[34px] items-start gap-1 text-[12px] font-medium text-success\"\n                      >\n                        <CheckCircle2 aria-hidden className=\"mt-0.5 size-3.5\" /> Connected and syncing\n                      </motion.p>\n                    ) : (\n                      <motion.p key=\"off\" initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} className=\"mt-0.5 line-clamp-2 min-h-[34px] text-[12px] leading-[17px] text-ink-muted\">\n                        {a.description}\n                      </motion.p>\n                    )}\n                  </AnimatePresence>\n                </div>\n              </motion.li>\n            );\n          })}\n        </AnimatePresence>\n        {visible.length === 0 && <li className=\"col-span-full py-8 text-center text-[13px] text-ink-muted\">Nothing connected yet. Pick a tool from All to get started.</li>}\n      </motion.ul>\n    </div>\n  );\n}\n"},{"path":"LICENSE-geturui.md","type":"registry:file","target":"LICENSE-geturui.md","content":"MIT License\n\nCopyright (c) 2026 geturui.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"}],"categories":["examples","integrations","apps","connect","oauth","permissions","sync","status","settings"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/integration-cards#connect-grid"}}