{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "token-status-demo", "title": "Token Status Example", "author": "MR ", "description": "A full page rendering Token Status, with its own sample data — what \"Open in v0\" hands over, and what to copy when wiring the component into a real screen.", "registryDependencies": [ "@cantera/aps-oauth-preset", "@cantera/oauth-types", "@cantera/token-status" ], "files": [ { "path": "registry/examples/token-status-demo.tsx", "content": "import { TokenStatus } from '@/components/ui/token-status'\nimport { apsProvider } from '@/lib/aps-oauth-preset'\nimport type { OAuthConnection } from '@/lib/oauth-types'\n\nconst scopes = ['data:read', 'viewables:read']\n\n/**\n * The whole status vocabulary at once. \"Expiring soon\" is not a separate status\n * — it is a connected grant near its expiry, and the component derives the\n * warning tone itself. Expired is warning too: a refresh away, not a failure.\n */\nfunction demoConnections(): { label: string; connection: OAuthConnection }[] {\n const now = Date.now()\n return [\n {\n label: 'healthy',\n connection: {\n provider: apsProvider,\n status: 'connected',\n scopes,\n expiresAt: now + 42 * 60_000,\n },\n },\n {\n label: 'expiring soon',\n connection: {\n provider: apsProvider,\n status: 'connected',\n scopes,\n expiresAt: now + 3 * 60_000,\n },\n },\n { label: 'expired', connection: { provider: apsProvider, status: 'expired', scopes } },\n {\n label: 'failed',\n connection: {\n provider: apsProvider,\n status: 'error',\n error: 'Refresh token was revoked.',\n },\n },\n { label: 'never connected', connection: { provider: apsProvider, status: 'disconnected' } },\n ]\n}\n\n/** Server-safe: no state, no effects, nothing to hydrate. */\nexport function TokenStatusDemo() {\n return (\n
\n {demoConnections().map(({ label, connection }) => (\n
\n \n
\n ))}\n
\n )\n}\n", "type": "registry:component", "target": "components/examples/token-status-demo.tsx" }, { "path": "registry/examples/pages/token-status-demo-page.tsx", "content": "// Generated by scripts/build-examples.mts. Edit the demo, not this file.\nimport { TokenStatusDemo } from '@/components/examples/token-status-demo'\n\nexport default function Page() {\n return (\n
\n
\n \n
\n
\n )\n}\n", "type": "registry:page", "target": "app/examples/token-status/page.tsx" } ], "categories": [ "authentication", "status" ], "type": "registry:example" }