{
  "component": {
    "id": "session-manager",
    "name": "Session manager",
    "tier": "pro",
    "exampleId": "session-manager",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/session-manager-demo.tsx",
    "exportName": "SessionManagerDemo",
    "sha256": "5f0bb75bbdec2e5d21d1636467901dc0dddf46b6b71b91abeab5437dc9bfe5b6",
    "helperImports": [],
    "directComponentImports": [
      "alert-dialog",
      "session-manager"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/session-manager",
    "registryUrl": "https://tidalui.com/r/pro/session-manager.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/session-manager",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/session-manager",
      "registryUrl": "https://tidalui.com/r/pro/session-manager.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    },
    {
      "order": 2,
      "kind": "demo-only-additional",
      "dependency": "@tidal-pro/alert-dialog",
      "purpose": "complete-example-demo-dependency",
      "command": "npx shadcn@latest add @tidal-pro/alert-dialog",
      "registryUrl": "https://tidalui.com/r/pro/alert-dialog.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/session-manager.tsx",
    "exports": [
      "TidalAlertDialog",
      "TidalSessionManager",
      "TidalSessionRecord"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/session-manager.css",
      "components/ui/alert-dialog.css",
      "components/ui/status-badge.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [
      "https://tidalui.com/r/tidal-button.json",
      "https://tidalui.com/r/status-badge.json"
    ],
    "additionalRegistry": [
      "@tidal-pro/alert-dialog"
    ],
    "installClosure": [
      "alert-dialog",
      "session-manager",
      "status-badge",
      "tidal-button"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/session-manager.css",
      "components/ui/alert-dialog.css",
      "components/ui/status-badge.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/session-manager.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/session-manager-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useRef, useState } from \"react\";\n\nimport { Laptop, Monitor, Smartphone } from \"lucide-react\";\n\nimport { TidalSessionManager, type TidalSessionRecord } from \"./components/ui/session-manager\";\n\nimport { TidalAlertDialog } from \"./components/ui/alert-dialog\";\n\nimport \"./components/ui/alert-dialog.css\";\n\nimport \"./components/ui/session-manager.css\";\n\nimport \"./components/ui/status-badge.css\";\n\n\n\nconst tidalExampleStyles = \".session-manager-demo {\\n  display: grid;\\n  width: min(100%, 820px);\\n  min-width: 0;\\n  gap: 13px;\\n}\\n\\n.session-manager-demo-footer {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 14px;\\n}\\n\\n.session-manager-demo-footer output {\\n  min-width: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n  overflow-wrap: anywhere;\\n}\\n\\n.session-manager-demo-footer button {\\n  min-width: 44px;\\n  min-height: 44px;\\n  flex: none;\\n  padding: 9px 13px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n  font: inherit;\\n  font-size: 11px;\\n  font-weight: 650;\\n  cursor: pointer;\\n}\\n\\n.session-manager-demo-footer button:focus-visible {\\n  outline: 2px solid var(--t-ink);\\n  outline-offset: 3px;\\n}\\n\\n@media (max-width: 420px) {\\n  .session-manager-demo-footer {\\n    display: grid;\\n  }\\n\\n  .session-manager-demo-footer button {\\n    width: 100%;\\n  }\\n}\";\n\nconst INITIAL_SESSIONS: readonly TidalSessionRecord[] = [\n  {\n    id: \"current\",\n    device: \"MacBook Pro · Chrome\",\n    detail: \"This browser\",\n    location: \"Austin, TX\",\n    lastActive: \"Active now\",\n    dateTime: \"2026-10-15T14:32:00-05:00\",\n    current: true,\n    icon: <Laptop aria-hidden=\"true\" />,\n  },\n  {\n    id: \"phone\",\n    device: \"iPhone · Safari\",\n    detail: \"iOS 19\",\n    location: \"Austin, TX\",\n    lastActive: \"Today, 8:14 AM\",\n    dateTime: \"2026-10-15T08:14:00-05:00\",\n    icon: <Smartphone aria-hidden=\"true\" />,\n  },\n  {\n    id: \"studio\",\n    device: \"Studio PC · Edge\",\n    detail: \"Windows 12\",\n    location: \"Chicago, IL\",\n    lastActive: \"October 12\",\n    dateTime: \"2026-10-12\",\n    icon: <Monitor aria-hidden=\"true\" />,\n  },\n];\n\ntype RevokeRequest =\n  | { kind: \"session\"; session: TidalSessionRecord }\n  | { kind: \"others\" };\n\nexport function SessionManagerDemo({\n  theme = \"light\",\n  dir = \"ltr\",\n}: {\n  theme?: \"light\" | \"dark\";\n  dir?: \"ltr\" | \"rtl\";\n}) {\n  const statusId = `${useId().replace(/:/g, \"\")}-session-status`;\n  const [sessions, setSessions] =\n    useState<readonly TidalSessionRecord[]>(INITIAL_SESSIONS);\n  const [request, setRequest] = useState<RevokeRequest | null>(null);\n  const [status, setStatus] = useState(\n    \"Fictional local sessions. No account connection is active.\",\n  );\n  const rootRef = useRef<HTMLElement>(null);\n  const openerRef = useRef<HTMLButtonElement | null>(null);\n\n  const requestName =\n    request?.kind === \"session\" ? String(request.session.device) : \"all others\";\n\n  return (\n    <div className=\"session-manager-demo\" dir={dir}>\n      <TidalSessionManager\n        ref={rootRef}\n        aria-describedby={statusId}\n        title=\"Active sessions\"\n        description=\"Review the devices currently shown for this sample account.\"\n        sessions={sessions}\n        onRevokeRequest={(session, event) => {\n          openerRef.current = event.currentTarget;\n          setRequest({ kind: \"session\", session });\n        }}\n        onRevokeOthersRequest={(event) => {\n          openerRef.current = event.currentTarget;\n          setRequest({ kind: \"others\" });\n        }}\n      />\n      <TidalAlertDialog\n        open={request !== null}\n        onOpenChange={(open) => {\n          if (!open) setRequest(null);\n        }}\n        trigger={\n          <button type=\"button\" hidden tabIndex={-1}>\n            Confirm session request\n          </button>\n        }\n        title={\n          request?.kind === \"others\"\n            ? \"Revoke other sample sessions?\"\n            : `Revoke ${requestName}?`\n        }\n        description=\"This removes only local sample rows. It does not sign out a device or contact an account service.\"\n        cancelLabel=\"Cancel\"\n        confirmLabel=\"Remove sample session\"\n        tone=\"danger\"\n        theme={theme}\n        dir={dir}\n        onCancel={() => setRequest(null)}\n        onConfirm={() => {\n          if (request?.kind === \"session\") {\n            setSessions((current) =>\n              current.filter((session) => session.id !== request.session.id),\n            );\n            setStatus(`${requestName} was removed from this local sample.`);\n          } else if (request?.kind === \"others\") {\n            setSessions((current) =>\n              current.filter((session) => session.current),\n            );\n            setStatus(\"Other sessions were removed from this local sample.\");\n          }\n          setRequest(null);\n        }}\n        contentProps={{\n          onCloseAutoFocus: (event) => {\n            event.preventDefault();\n            const opener = openerRef.current;\n            const nextAction =\n              rootRef.current?.querySelector<HTMLButtonElement>(\n                \"[data-session-action]:not([aria-disabled='true'])\",\n              );\n            const target =\n              opener?.isConnected === true &&\n              !opener.disabled &&\n              opener.getAttribute(\"aria-disabled\") !== \"true\"\n                ? opener\n                : (nextAction ?? rootRef.current);\n            openerRef.current = null;\n            target?.focus({ preventScroll: true });\n          },\n        }}\n      />\n      <div className=\"session-manager-demo-footer\">\n        <output id={statusId} aria-live=\"polite\">\n          {status}\n        </output>\n        <button\n          type=\"button\"\n          onClick={() => {\n            setSessions(INITIAL_SESSIONS);\n            setRequest(null);\n            openerRef.current = null;\n            setStatus(\"The fictional session list was reset.\");\n            rootRef.current?.focus({ preventScroll: true });\n          }}\n        >\n          Reset sample\n        </button>\n      </div>\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <SessionManagerDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/session-manager.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "sessions",
      "type": "inferred-from-existing-demo",
      "initial": "INITIAL_SESSIONS",
      "setter": "setSessions",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onCancel",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onConfirm",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onOpenChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onRevokeOthersRequest",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onRevokeRequest",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": false,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "No form submit is present in the existing demo.",
    "resetBehavior": "No reset control is present in the existing demo.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Consumer-provided label remains required where the component API requires one.",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Verify focus returns to the invoking control after dismissal.",
    "errorAnnouncement": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
