{
  "component": {
    "id": "json-viewer",
    "name": "JSON viewer",
    "tier": "pro",
    "exampleId": "json-viewer",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/json-viewer-demo.tsx",
    "exportName": "JsonViewerDemo",
    "sha256": "6032eb71e18b2f72ea897dcfd22680a66f77d635fcc447f330bc38934b5e3c37",
    "helperImports": [],
    "directComponentImports": [
      "json-viewer"
    ],
    "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/json-viewer",
    "registryUrl": "https://tidalui.com/r/pro/json-viewer.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/json-viewer",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/json-viewer",
      "registryUrl": "https://tidalui.com/r/pro/json-viewer.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/json-viewer.tsx",
    "exports": [
      "TidalJsonCopyRequest",
      "TidalJsonView",
      "TidalJsonViewer"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/json-viewer.css",
      "components/ui/tree-view.css",
      "components/ui/code-block.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "@tidal-pro/tree-view",
      "@tidal-pro/code-block"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "code-block",
      "json-viewer",
      "tree-view"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/json-viewer.css",
      "components/ui/tree-view.css",
      "components/ui/code-block.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/json-viewer.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/json-viewer-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useState } from \"react\";\n\nimport { TidalJsonViewer, type TidalJsonCopyRequest, type TidalJsonView } from \"./components/ui/json-viewer\";\n\nimport \"./components/ui/json-viewer.css\";\n\nimport \"./components/ui/tree-view.css\";\n\nimport \"./components/ui/code-block.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .json-viewer-demo {\\n  display: grid;\\n  width: 100%;\\n  max-width: 760px;\\n  min-width: 0;\\n  gap: 14px;\\n}\\n\\n.json-viewer-demo-footer {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 12px;\\n  padding-inline: 4px;\\n}\\n\\n.json-viewer-demo-footer p {\\n  min-width: 0;\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.45;\\n  overflow-wrap: anywhere;\\n}\\n\\n.json-viewer-demo-footer button {\\n  flex: 0 0 auto;\\n  min-width: 44px;\\n  min-height: 44px;\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-control);\\n  padding-inline: 14px;\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  cursor: pointer;\\n  font: inherit;\\n  font-size: 12px;\\n  font-weight: 680;\\n}\\n\\n.json-viewer-demo-footer button:hover {\\n  background: var(--t-wash);\\n}\\n\\n.json-viewer-demo-footer button:focus-visible {\\n  outline: 2px solid var(--t-ink);\\n  outline-offset: 2px;\\n}\\n\\n@media (max-width: 420px) {\\n  .json-viewer-demo-footer {\\n    display: grid;\\n  }\\n\\n  .json-viewer-demo-footer button {\\n    width: 100%;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .json-viewer-demo-footer button {\\n    transition: none;\\n  }\\n}\";\n\nconst samplePayload = {\n  id: \"evt_01JAF7M8\",\n  type: \"workspace.member.updated\",\n  createdAt: \"2026-10-14T21:45:00-05:00\",\n  data: {\n    workspaceId: \"ws_sample\",\n    customer: {\n      id: \"cus_sample_42\",\n      name: \"Ava Reed\",\n      email: \"ava@example.test\",\n      active: true,\n    },\n    permissions: [\"projects:read\", \"comments:write\"],\n    attempts: 2,\n    note: null,\n  },\n} as const;\n\nconst initialExpanded = [\"\", \"/data\", \"/data/customer\"];\n\nexport function JsonViewerDemo({ dir = \"ltr\" }: { dir?: \"ltr\" | \"rtl\" }) {\n  const [view, setView] = useState<TidalJsonView>(\"tree\");\n  const [expandedPaths, setExpandedPaths] =\n    useState<readonly string[]>(initialExpanded);\n  const [selectedPath, setSelectedPath] = useState<string | null>(\n    \"/data/customer/name\",\n  );\n  const [query, setQuery] = useState(\"\");\n  const [status, setStatus] = useState(\n    \"Select a value, search the payload or copy exact JSON.\",\n  );\n\n  async function copyJson(request: TidalJsonCopyRequest) {\n    if (!navigator.clipboard?.writeText) {\n      setStatus(\"Clipboard access is unavailable in this preview.\");\n      return;\n    }\n    try {\n      await navigator.clipboard.writeText(request.text);\n      setStatus(\n        `${request.displayPath} copied (${request.text.length} characters).`,\n      );\n    } catch {\n      setStatus(\"The browser did not allow this copy. Try again.\");\n    }\n  }\n\n  return (\n    <section className=\"json-viewer-demo\" aria-label=\"JSON viewer sample\">\n      <TidalJsonViewer\n        label=\"Webhook delivery\"\n        description=\"Inspect the exact fictional payload before using it elsewhere.\"\n        dir={dir}\n        value={samplePayload}\n        view={view}\n        onViewChange={(nextView) => {\n          setView(nextView);\n          setStatus(\n            `${nextView === \"tree\" ? \"Tree\" : \"Source\"} view selected.`,\n          );\n        }}\n        expandedPaths={expandedPaths}\n        onExpandedPathsChange={(nextPaths) => setExpandedPaths(nextPaths)}\n        selectedPath={selectedPath}\n        onSelectedPathChange={(nextPath, _value) => {\n          setSelectedPath(nextPath);\n          setStatus(`${nextPath || \"$\"} selected.`);\n        }}\n        query={query}\n        onQueryChange={setQuery}\n        onCopyRequest={copyJson}\n      />\n\n      <footer className=\"json-viewer-demo-footer\">\n        <p role=\"status\">{status}</p>\n        <button\n          type=\"button\"\n          onClick={() => {\n            setView(\"tree\");\n            setExpandedPaths(initialExpanded);\n            setSelectedPath(\"/data/customer/name\");\n            setQuery(\"\");\n            setStatus(\"The local sample was reset.\");\n          }}\n        >\n          Reset sample\n        </button>\n      </footer>\n    </section>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <JsonViewerDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/json-viewer.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "view",
      "type": "inferred-from-existing-demo",
      "initial": "\"tree\"",
      "setter": "setView",
      "proposalCanBeRejected": false
    },
    {
      "prop": "expandedPaths",
      "type": "inferred-from-existing-demo",
      "initial": "initialExpanded",
      "setter": "setExpandedPaths",
      "proposalCanBeRejected": false
    },
    {
      "prop": "selectedPath",
      "type": "inferred-from-existing-demo",
      "initial": "\"/data/customer/name\",",
      "setter": "setSelectedPath",
      "proposalCanBeRejected": false
    },
    {
      "prop": "query",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setQuery",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "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": "onCopyRequest",
      "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": "onExpandedPathsChange",
      "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": "onQueryChange",
      "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": "onSelectedPathChange",
      "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": "onViewChange",
      "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": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "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": "Existing demo label or ARIA prop",
    "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": "Preserve browser focus order and visible focus.",
    "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": []
}
