{
  "component": {
    "id": "code-block",
    "name": "Code block",
    "tier": "pro",
    "exampleId": "code-block",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/code-block-demo.tsx",
    "exportName": "CodeBlockDemo",
    "sha256": "db120086117c2757bb937f316aa2d4fbf863d078661eb0d09972b5ce6bc80a13",
    "helperImports": [],
    "directComponentImports": [
      "code-block",
      "copy-button"
    ],
    "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/code-block",
    "registryUrl": "https://tidalui.com/r/pro/code-block.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/code-block",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/code-block",
      "registryUrl": "https://tidalui.com/r/pro/code-block.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    },
    {
      "order": 2,
      "kind": "demo-only-additional",
      "dependency": "https://tidalui.com/r/copy-button.json",
      "purpose": "complete-example-demo-dependency",
      "command": "npx shadcn@latest add https://tidalui.com/r/copy-button.json",
      "registryUrl": "https://tidalui.com/r/copy-button.json",
      "access": "free",
      "sourceDelivery": "public-registry",
      "requiresAuthorization": false
    }
  ],
  "imports": {
    "componentPath": "components/ui/code-block.tsx",
    "exports": [
      "TidalCodeBlock",
      "TidalCopyButton"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/code-block.css",
      "components/ui/copy-button.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [
      "https://tidalui.com/r/copy-button.json"
    ],
    "installClosure": [
      "code-block",
      "copy-button"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/code-block.css",
      "components/ui/copy-button.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/code-block.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/code-block-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useState } from \"react\";\n\nimport { TidalCodeBlock } from \"./components/ui/code-block\";\n\nimport { TidalCopyButton } from \"./components/ui/copy-button\";\n\nimport \"./components/ui/code-block.css\";\n\nimport \"./components/ui/copy-button.css\";\n\n\n\nconst tidalExampleStyles = \".code-block-demo {\\n  width: min(100%, 680px);\\n  min-width: 0;\\n}\\n.code-block-demo .code-block-demo-copy {\\n  min-width: 88px;\\n  padding-inline: 12px;\\n}\\n.code-block-demo-controls {\\n  display: flex;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 16px;\\n  margin-bottom: 16px;\\n  color: var(--t-ink);\\n  font: 500 12px/1.5 var(--t-font, sans-serif);\\n}\\n.code-block-demo-controls fieldset {\\n  display: flex;\\n  gap: 4px;\\n  min-width: 0;\\n  border: 0;\\n  padding: 0;\\n  margin: 0;\\n}\\n.code-block-demo-controls label {\\n  display: inline-flex;\\n  align-items: center;\\n  gap: 6px;\\n  min-height: 44px;\\n  cursor: pointer;\\n}\\n.code-block-demo-controls fieldset label {\\n  position: relative;\\n}\\n.code-block-demo-controls input[type=\\\"radio\\\"] {\\n  position: absolute;\\n  opacity: 0;\\n  width: 1px;\\n  height: 1px;\\n}\\n.code-block-demo-controls fieldset span {\\n  display: grid;\\n  align-items: center;\\n  min-height: 44px;\\n  padding: 0 14px;\\n  border-radius: 9px;\\n  color: var(--t-muted);\\n  transition:\\n    color 160ms,\\n    background 160ms;\\n}\\n.code-block-demo-controls input:checked + span {\\n  color: var(--t-ink);\\n  background: var(--t-wash);\\n}\\n.code-block-demo-controls input:focus-visible + span {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 2px;\\n}\\n.code-block-demo-wrap {\\n  flex: 0 0 auto;\\n  padding-inline: 4px;\\n}\\n.code-block-demo-wrap input {\\n  accent-color: var(--t-accent);\\n  width: 16px;\\n  height: 16px;\\n}\\n.code-block-demo-sr {\\n  position: absolute;\\n  width: 1px;\\n  height: 1px;\\n  padding: 0;\\n  overflow: hidden;\\n  clip-path: inset(50%);\\n  white-space: nowrap;\\n}\\n@media (prefers-reduced-motion: reduce) {\\n  .code-block-demo-controls fieldset span {\\n    transition: none;\\n  }\\n}\";\n\nconst sources = {\n  React: `import { useState } from \"react\";\n\nexport function SaveButton() {\n  const [saved, setSaved] = useState(false);\n\n  return (\n    <button type=\"button\" onClick={() => setSaved(true)}>\n      {saved ? \"Saved\" : \"Save changes\"}\n    </button>\n  );\n}`,\n  CSS: `.button {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  min-height: 44px;\n  padding: 0 18px;\n  border: 1px solid var(--border);\n  border-radius: 10px;\n  background: var(--surface);\n  color: var(--foreground);\n}\n\n.button:focus-visible {\n  outline: 2px solid currentColor;\n  outline-offset: 3px;\n}`,\n};\n\nexport function CodeBlockDemo() {\n  const id = useId();\n  const [source, setSource] = useState<keyof typeof sources>(\"React\");\n  const [wrap, setWrap] = useState(false);\n  return (\n    <div className=\"code-block-demo\">\n      <div className=\"code-block-demo-controls\">\n        <fieldset>\n          <legend className=\"code-block-demo-sr\">Example language</legend>\n          {([\"React\", \"CSS\"] as const).map((value) => (\n            <label key={value}>\n              <input\n                type=\"radio\"\n                name={`${id}-code-language`}\n                checked={source === value}\n                onChange={() => setSource(value)}\n              />\n              <span>{value}</span>\n            </label>\n          ))}\n        </fieldset>\n        <label className=\"code-block-demo-wrap\">\n          <input\n            type=\"checkbox\"\n            checked={wrap}\n            onChange={(event) => setWrap(event.target.checked)}\n          />\n          <span>Wrap lines</span>\n        </label>\n      </div>\n      <TidalCodeBlock\n        code={sources[source]}\n        filename={source === \"React\" ? \"save-button.tsx\" : \"button.css\"}\n        language={source === \"React\" ? \"TSX\" : \"CSS\"}\n        wrap={wrap}\n        actions={\n          <TidalCopyButton\n            text={sources[source]}\n            aria-label=\"Copy code\"\n            className=\"code-block-demo-copy\"\n          />\n        }\n        caption=\"Select the code or scroll to read more.\"\n      />\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      <CodeBlockDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/code-block.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "checked",
      "type": "inferred-from-existing-demo",
      "initial": "false",
      "setter": "setWrap",
      "proposalCanBeRejected": false
    },
    {
      "prop": "wrap",
      "type": "inferred-from-existing-demo",
      "initial": "false",
      "setter": "setWrap",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onChange",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "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": false,
      "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": "No error announcement path is present in this demo; the consumer owns validation messaging.",
    "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": []
}
