{
  "component": {
    "id": "version-history",
    "name": "Version history",
    "tier": "pro",
    "exampleId": "version-history",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/version-history-demo.tsx",
    "exportName": "VersionHistoryDemo",
    "sha256": "fa1f948cc75a2a8cdc7488b9361285832b20c85f137e2704695764999b824e70",
    "helperImports": [],
    "directComponentImports": [
      "alert-dialog",
      "version-history"
    ],
    "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/version-history",
    "registryUrl": "https://tidalui.com/r/pro/version-history.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/version-history",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/version-history",
      "registryUrl": "https://tidalui.com/r/pro/version-history.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/version-history.tsx",
    "exports": [
      "TidalAlertDialog",
      "TidalVersionEntry",
      "TidalVersionHistory"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/version-history.css",
      "components/ui/alert-dialog.css",
      "components/ui/status-badge.css",
      "components/ui/collapsible-panel.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [
      "https://tidalui.com/r/tidal-button.json",
      "https://tidalui.com/r/status-badge.json",
      "@tidal-pro/collapsible-panel"
    ],
    "additionalRegistry": [
      "@tidal-pro/alert-dialog"
    ],
    "installClosure": [
      "alert-dialog",
      "collapsible-panel",
      "status-badge",
      "tidal-button",
      "version-history"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/version-history.css",
      "components/ui/alert-dialog.css",
      "components/ui/status-badge.css",
      "components/ui/collapsible-panel.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/version-history.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/version-history-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useRef, useState } from \"react\";\n\nimport { TidalVersionHistory, type TidalVersionEntry } from \"./components/ui/version-history\";\n\nimport { TidalAlertDialog } from \"./components/ui/alert-dialog\";\n\nimport \"./components/ui/version-history.css\";\n\nimport \"./components/ui/alert-dialog.css\";\n\nimport \"./components/ui/status-badge.css\";\n\nimport \"./components/ui/collapsible-panel.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .version-history-demo {\\n  width: 100%;\\n  max-width: 680px;\\n  min-width: 0;\\n}\\n.tidal-scope .version-history-demo > p {\\n  font-size: 11px;\\n  color: var(--t-muted);\\n  line-height: 1.5;\\n  margin: 12px 0 0;\\n}\";\n\nconst revisions = [\n  {\n    id: \"v3\",\n    label: \"Version 3\",\n    author: \"Alex Morgan\",\n    time: { label: \"Today, 10:30 AM\", dateTime: \"2026-10-14T10:30:00Z\" },\n    summary: \"Shortened the introduction and added release dates.\",\n    changes: \"Updated the opening paragraph and release schedule.\",\n    content: \"A simpler release notes page. Find every update in one place.\",\n  },\n  {\n    id: \"v2\",\n    label: \"Version 2\",\n    author: \"Sam Lee\",\n    time: { label: \"Yesterday, 3:45 PM\", dateTime: \"2026-10-13T15:45:00Z\" },\n    summary: \"Added the product overview.\",\n    changes: \"Added a summary of the product and its current features.\",\n    content: \"Release notes for the product team. Read the latest changes.\",\n  },\n  {\n    id: \"v1\",\n    label: \"Version 1\",\n    author: \"Alex Morgan\",\n    time: { label: \"October 12, 9:00 AM\", dateTime: \"2026-10-12T09:00:00Z\" },\n    summary: \"Created the first draft.\",\n    content: \"Product release notes.\",\n  },\n];\n\nexport function VersionHistoryDemo({\n  theme = \"light\",\n}: {\n  theme?: \"light\" | \"dark\";\n}) {\n  const [current, setCurrent] = useState(\"v3\"),\n    [selected, setSelected] = useState(\"v3\"),\n    [request, setRequest] = useState<TidalVersionEntry | null>(null),\n    [message, setMessage] = useState(\"Sample document history.\");\n  const opener = useRef<HTMLButtonElement | null>(null);\n  const previewRefs = useRef<Record<string, HTMLButtonElement | null>>({});\n  return (\n    <div className=\"version-history-demo\">\n      <TidalVersionHistory\n        title=\"Version history\"\n        description=\"Release notes page\"\n        versions={revisions.map((v) => ({\n          ...v,\n          previewButtonRef: (node: HTMLButtonElement | null) => {\n            previewRefs.current[v.id] = node;\n          },\n        }))}\n        currentVersionId={current}\n        selectedVersionId={selected}\n        onPreviewRequest={(v) => setSelected(v.id)}\n        onRestoreRequest={(v, e) => {\n          opener.current = e.currentTarget;\n          setRequest(v);\n        }}\n        preview={\n          <>\n            <strong>\n              Document preview ·{\" \"}\n              {revisions.find((v) => v.id === selected)?.label}\n            </strong>\n            <p>{revisions.find((v) => v.id === selected)?.content}</p>\n          </>\n        }\n        confirmation={\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                Restore version\n              </button>\n            }\n            title={`Restore ${request?.label ?? \"version\"}?`}\n            description=\"This changes the current version in this local preview.\"\n            cancelLabel=\"Cancel\"\n            confirmLabel=\"Restore version\"\n            onCancel={() => setRequest(null)}\n            onConfirm={() => {\n              if (request) {\n                setCurrent(request.id);\n                setSelected(request.id);\n                setMessage(`${request.label} is current in this preview.`);\n              }\n              setRequest(null);\n            }}\n            theme={theme}\n            contentProps={{\n              onCloseAutoFocus: (event) => {\n                event.preventDefault();\n                const target = opener.current?.isConnected\n                  ? opener.current\n                  : previewRefs.current[selected];\n                target?.focus({ preventScroll: true });\n              },\n            }}\n          />\n        }\n      />\n      <p role=\"status\">{message}</p>\n      <p>Sample data. No document is saved.</p>\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      <VersionHistoryDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/version-history.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "currentVersionId",
      "type": "inferred-from-existing-demo",
      "initial": "\"v3\"",
      "setter": "setCurrent",
      "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": "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": "onPreviewRequest",
      "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": "onRestoreRequest",
      "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": []
}
