{
  "component": {
    "id": "code-editor",
    "name": "Code editor",
    "tier": "pro",
    "exampleId": "code-editor",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/code-editor-demo.tsx",
    "exportName": "CodeEditorDemo",
    "sha256": "f455075c42aa835f6054508282c86d9c6bb5f9dc72430aa7cb321c18aec1de60",
    "helperImports": [],
    "directComponentImports": [
      "code-editor"
    ],
    "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-editor",
    "registryUrl": "https://tidalui.com/r/pro/code-editor.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-editor",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/code-editor",
      "registryUrl": "https://tidalui.com/r/pro/code-editor.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/code-editor.tsx",
    "exports": [
      "TidalCodeEditor",
      "TidalCodeEditorDiagnostic"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/code-editor.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "code-editor"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/code-editor.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/code-editor.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/code-editor-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useId, useMemo, useRef, useState } from \"react\";\n\nimport \"./components/ui/code-editor.css\";\n\nimport { TidalCodeEditor, type TidalCodeEditorDiagnostic } from \"./components/ui/code-editor\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .tidal-code-editor-demo {\\n  display: grid;\\n  width: min(100%, 720px);\\n  min-width: 0;\\n  margin: 0 auto;\\n  gap: 14px;\\n}\\n\\n.tidal-scope .tidal-code-editor-demo button {\\n  min-height: 44px;\\n  max-width: 100%;\\n  padding: 0 14px;\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-control);\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  font: inherit;\\n  font-size: 12px;\\n  font-weight: 650;\\n  overflow-wrap: anywhere;\\n  cursor: pointer;\\n  transition:\\n    color 140ms,\\n    background 140ms,\\n    border-color 140ms,\\n    transform 140ms;\\n}\\n\\n.tidal-scope .tidal-code-editor-demo-footer {\\n  display: grid;\\n  grid-template-columns: max-content minmax(0, 1fr);\\n  align-items: center;\\n  gap: 10px 14px;\\n  min-width: 0;\\n}\\n\\n.tidal-scope .tidal-code-editor-demo-footer > button {\\n  color: var(--t-surface);\\n  background: var(--t-ink);\\n  border-color: var(--t-ink);\\n}\\n\\n.tidal-scope .tidal-code-editor-demo output,\\n.tidal-scope .tidal-code-editor-demo-note {\\n  min-width: 0;\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.6;\\n  overflow-wrap: anywhere;\\n}\\n\\n@media (hover: hover) and (pointer: fine) {\\n  .tidal-scope .tidal-code-editor-demo button:hover {\\n    border-color: var(--t-ink);\\n    transform: translateY(-1px);\\n  }\\n\\n  .tidal-scope .tidal-code-editor-demo-footer > button:hover {\\n    color: var(--t-ink);\\n    background: var(--t-surface);\\n  }\\n}\\n\\n.tidal-scope .tidal-code-editor-demo button:active {\\n  transform: translateY(1px);\\n}\\n\\n.tidal-scope .tidal-code-editor-demo button:focus-visible {\\n  outline: 2px solid var(--t-ring);\\n  outline-offset: 3px;\\n}\\n\\n@media (max-width: 420px) {\\n  .tidal-scope .tidal-code-editor-demo-footer {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n\\n  .tidal-scope .tidal-code-editor-demo-footer > button {\\n    width: 100%;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .tidal-code-editor-demo button {\\n    transition: none;\\n  }\\n\\n  .tidal-scope .tidal-code-editor-demo button:hover,\\n  .tidal-scope .tidal-code-editor-demo button:active {\\n    transform: none;\\n  }\\n}\";\n\nconst SAMPLE = `{\n  // Keep refresh intervals explicit.\n  \"refreshMinutes\": 15,\n  \"compactNavigation\": true\n}`;\n\nexport function CodeEditorDemo() {\n  const formId = useId().replace(/[^a-zA-Z0-9_-]/g, \"-\");\n  const [value, setValue] = useState(SAMPLE);\n  const [status, setStatus] = useState(\"One local diagnostic is supplied.\");\n  const source = useRef<HTMLTextAreaElement>(null);\n  const diagnostics = useMemo<readonly TidalCodeEditorDiagnostic[]>(\n    () =>\n      value.includes(\"//\")\n        ? [\n            {\n              id: \"json-comment\",\n              line: 2,\n              column: 3,\n              message: \"JSON does not allow comments.\",\n            },\n          ]\n        : [],\n    [value],\n  );\n\n  return (\n    <form\n      id={formId}\n      className=\"tidal-code-editor-demo\"\n      onSubmit={(event) => {\n        event.preventDefault();\n        const submitted = String(\n          new FormData(event.currentTarget).get(\"config\") ?? \"\",\n        );\n        setStatus(\n          diagnostics.length\n            ? \"Fix the supplied diagnostic before local review.\"\n            : `Reviewed ${submitted.length} local characters.`,\n        );\n      }}\n    >\n      <TidalCodeEditor\n        label=\"Environment config\"\n        filename=\"workspace.config.json\"\n        language=\"JSON\"\n        value={value}\n        onValueChange={(next) => {\n          setValue(next);\n          setStatus(\"Local draft updated.\");\n        }}\n        diagnostics={diagnostics}\n        textareaRef={source}\n        textareaProps={{\n          name: \"config\",\n          required: true,\n          rows: 8,\n          \"aria-label\": \"Environment config source\",\n        }}\n        tabBehavior=\"indent\"\n        actions={\n          <button\n            type=\"button\"\n            onClick={() => {\n              source.current?.focus({ preventScroll: true });\n              source.current?.select();\n              setStatus(\"Local source selected.\");\n            }}\n          >\n            Select all\n          </button>\n        }\n        description=\"Tab inserts two spaces. Shift+Tab removes one indentation level.\"\n      />\n      <div className=\"tidal-code-editor-demo-footer\">\n        <button type=\"submit\">Review locally</button>\n        <output aria-live=\"polite\">{status}</output>\n      </div>\n      <p className=\"tidal-code-editor-demo-note\">\n        Fictional sample. Editing and review stay in this page; no code runs or\n        saves.\n      </p>\n    </form>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <CodeEditorDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/code-editor.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "value",
      "type": "inferred-from-existing-demo",
      "initial": "SAMPLE",
      "setter": "setValue",
      "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": "onSubmit",
      "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": "onValueChange",
      "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": []
}
