{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"integration-cards-detail","type":"registry:component","title":"Integration cards · Integration consent","description":"Two linked marks, a permissions list with spring switches and locked required scopes, and an authorize flow that ends in a drawn check.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":[],"files":[{"path":"registry/geturui/examples/integration-cards/detail.tsx","type":"registry:component","target":"components/examples/integration-cards/detail.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { Eye, FileText, Lock, Pencil, ShieldCheck, Users } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface IntegrationPermission {\n  id: string;\n  title: string;\n  description: string;\n  icon?: \"read\" | \"write\" | \"people\" | \"files\";\n  /** Cannot be turned off. */\n  required?: boolean;\n  defaultGranted?: boolean;\n}\n\nexport interface IntegrationDetailProps {\n  app?: string;\n  appMonogram?: string;\n  workspace?: string;\n  workspaceMonogram?: string;\n  publisher?: string;\n  permissions?: IntegrationPermission[];\n  /** Receives the ids of granted permissions. */\n  onAuthorize?: (granted: string[]) => void;\n  onCancel?: () => void;\n  className?: string;\n}\n\nconst icons = { read: Eye, write: Pencil, people: Users, files: FileText };\nconst spring = { type: \"spring\", stiffness: 420, damping: 30 } as const;\n\n/** Consent card for a single integration: linked marks, a permissions list with spring switches and an authorize flow that resolves into a drawn check. */\nexport function IntegrationDetail({\n  app = \"Ledgerly\",\n  appMonogram = \"L\",\n  workspace = \"Fieldnote\",\n  workspaceMonogram = \"F\",\n  publisher = \"Ledgerly Inc. · Verified publisher\",\n  permissions = [\n    { id: \"read\", title: \"Read invoices and payouts\", description: \"Needed to match payments to your books.\", icon: \"read\", required: true },\n    { id: \"write\", title: \"Create draft invoices\", description: \"Drafts stay unsent until you approve them.\", icon: \"write\", defaultGranted: true },\n    { id: \"people\", title: \"View customer contacts\", description: \"Name, company and billing email only.\", icon: \"people\", defaultGranted: true },\n    { id: \"files\", title: \"Attach receipts\", description: \"Upload PDFs to matching transactions.\", icon: \"files\" },\n  ],\n  onAuthorize,\n  onCancel,\n  className,\n}: IntegrationDetailProps) {\n  const reduce = useReducedMotion();\n  const [granted, setGranted] = React.useState<Record<string, boolean>>(() => Object.fromEntries(permissions.map((p) => [p.id, !!(p.required || p.defaultGranted)])));\n  const [phase, setPhase] = React.useState<\"review\" | \"working\" | \"done\">(\"review\");\n  const uid = React.useId();\n  const count = Object.values(granted).filter(Boolean).length;\n\n  React.useEffect(() => {\n    if (phase !== \"working\") return;\n    const id = window.setTimeout(() => setPhase(\"done\"), 1100);\n    return () => window.clearTimeout(id);\n  }, [phase]);\n\n  const mark = (m: string, strong?: boolean) => (\n    <span className={cn(\"grid size-12 place-items-center rounded-md font-display text-[18px] font-bold shadow-sm\", strong ? \"bg-ink text-bg\" : \"border border-border bg-surface text-ink\")}>\n      {m}\n    </span>\n  );\n\n  return (\n    <div className={cn(\"w-full max-w-[400px] overflow-hidden rounded-lg border border-border bg-surface-raised shadow-sm\", className)}>\n      <div className=\"flex flex-col items-center px-5 pt-6 text-center\">\n        <div aria-hidden className=\"relative flex items-center\">\n          {mark(workspaceMonogram, true)}\n          <svg viewBox=\"0 0 72 12\" className=\"h-3 w-[72px] text-border-strong\">\n            <motion.line\n              x1=\"4\"\n              y1=\"6\"\n              x2=\"68\"\n              y2=\"6\"\n              stroke=\"currentColor\"\n              strokeWidth=\"1.5\"\n              strokeDasharray=\"3 4\"\n              animate={reduce || phase === \"done\" ? { strokeDashoffset: 0 } : { strokeDashoffset: [0, -14] }}\n              transition={{ duration: phase === \"working\" ? 0.3 : 1.2, repeat: reduce || phase === \"done\" ? 0 : Infinity, ease: \"linear\" }}\n            />\n          </svg>\n          {mark(appMonogram)}\n          <span className=\"absolute left-1/2 top-1/2 grid size-6 -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full border border-border bg-surface-raised text-ink-muted\">\n            <Lock className=\"size-3\" />\n          </span>\n        </div>\n        <h3 className=\"mt-4 font-display text-[17px] font-semibold tracking-tight text-ink\">\n          Connect {app} to {workspace}\n        </h3>\n        <p className=\"mt-1 inline-flex items-center gap-1 text-[12px] text-ink-subtle\">\n          <ShieldCheck aria-hidden className=\"size-3.5\" />\n          {publisher}\n        </p>\n      </div>\n\n      <AnimatePresence mode=\"wait\" initial={false}>\n        {phase !== \"done\" ? (\n          <motion.div key=\"review\" exit={{ opacity: 0, filter: \"blur(8px)\" }} transition={{ duration: 0.18 }}>\n            <p className=\"px-5 pt-5 text-[12px] font-medium text-ink-muted\">{app} will be able to</p>\n            <ul className=\"mt-1.5 px-3\">\n              {permissions.map((p) => {\n                const Icon = icons[p.icon ?? \"read\"];\n                const on = granted[p.id];\n                return (\n                  <li key={p.id} className=\"flex items-center gap-3 rounded-md px-2 py-2.5\">\n                    <span aria-hidden className=\"grid size-8 shrink-0 place-items-center rounded-sm bg-surface-sunken text-ink-muted\">\n                      <Icon className=\"size-4\" />\n                    </span>\n                    <div className=\"min-w-0 flex-1\">\n                      <p id={`${uid}-${p.id}`} className=\"text-[13px] font-medium text-ink\">\n                        {p.title}\n                      </p>\n                      <p className=\"text-[11.5px] text-ink-subtle\">{p.required ? \"Required · \" : \"\"}{p.description}</p>\n                    </div>\n                    <button\n                      type=\"button\"\n                      role=\"switch\"\n                      aria-checked={on}\n                      aria-labelledby={`${uid}-${p.id}`}\n                      disabled={p.required || phase === \"working\"}\n                      onClick={() => setGranted((g) => ({ ...g, [p.id]: !g[p.id] }))}\n                      className={cn(\n                        \"relative h-6 w-10 shrink-0 rounded-full p-0.5 outline-none transition-colors focus-visible:shadow-[var(--focus-ring)] disabled:cursor-not-allowed\",\n                        on ? \"bg-ink\" : \"bg-ink/15\",\n                        p.required && \"opacity-50\",\n                      )}\n                    >\n                      <motion.span layout transition={spring} className={cn(\"block size-5 rounded-full bg-surface-raised shadow-sm\", on && \"ml-auto\")} />\n                    </button>\n                  </li>\n                );\n              })}\n            </ul>\n            <div className=\"flex gap-2 border-t border-border p-4\">\n              <motion.button\n                type=\"button\"\n                whileTap={{ scale: 0.96 }}\n                onClick={onCancel}\n                className=\"inline-flex h-10 flex-1 items-center justify-center rounded-full border border-border-strong text-[13px] font-medium text-ink outline-none transition-colors hover:bg-surface-hover focus-visible:shadow-[var(--focus-ring)]\"\n              >\n                Cancel\n              </motion.button>\n              <motion.button\n                type=\"button\"\n                whileTap={{ scale: 0.96 }}\n                disabled={phase === \"working\"}\n                aria-busy={phase === \"working\"}\n                onClick={() => {\n                  setPhase(\"working\");\n                  onAuthorize?.(Object.keys(granted).filter((k) => granted[k]));\n                }}\n                className=\"relative inline-flex h-10 flex-[1.4] items-center justify-center overflow-hidden rounded-full bg-volt text-[13px] font-medium text-on-volt outline-none focus-visible:shadow-[var(--focus-ring)]\"\n              >\n                {phase === \"working\" && (\n                  <motion.span aria-hidden className=\"absolute inset-y-0 left-0 bg-on-volt/15\" initial={{ width: \"0%\" }} animate={{ width: \"100%\" }} transition={{ duration: 1.1, ease: \"easeInOut\" }} />\n                )}\n                <span className=\"relative\">\n                  {phase === \"working\" ? \"Authorizing…\" : `Authorize ${count} permission${count === 1 ? \"\" : \"s\"}`}\n                </span>\n              </motion.button>\n            </div>\n          </motion.div>\n        ) : (\n          <motion.div\n            key=\"done\"\n            role=\"status\"\n            initial={{ opacity: 0, y: reduce ? 0 : 10, filter: \"blur(8px)\" }}\n            animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n            transition={spring}\n            className=\"flex flex-col items-center px-5 pb-6 pt-5 text-center\"\n          >\n            <svg viewBox=\"0 0 48 48\" aria-hidden className=\"size-12 text-success\">\n              <motion.circle cx=\"24\" cy=\"24\" r=\"21\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" initial={{ pathLength: reduce ? 1 : 0 }} animate={{ pathLength: 1 }} transition={{ duration: 0.5 }} />\n              <motion.path d=\"M15 24.5 21.5 31 33 18\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"3\" strokeLinecap=\"round\" strokeLinejoin=\"round\" initial={{ pathLength: reduce ? 1 : 0 }} animate={{ pathLength: 1 }} transition={{ duration: 0.35, delay: 0.4 }} />\n            </svg>\n            <p className=\"mt-3 text-[14px] font-medium text-ink\">{app} is connected</p>\n            <p className=\"mt-1 text-[12.5px] text-ink-muted\">\n              <span className=\"font-mono tabular-nums\">{count}</span> of <span className=\"font-mono tabular-nums\">{permissions.length}</span> permissions granted. You can change them in Settings at any time.\n            </p>\n            <button\n              type=\"button\"\n              onClick={() => setPhase(\"review\")}\n              className=\"mt-4 rounded-full px-3 py-1.5 text-[12.5px] font-medium text-ink-muted outline-none transition-colors hover:bg-surface-hover hover:text-ink focus-visible:shadow-[var(--focus-ring)]\"\n            >\n              Review permissions\n            </button>\n          </motion.div>\n        )}\n      </AnimatePresence>\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#detail"}}