{
  "component": {
    "id": "context-menu",
    "name": "Context menu",
    "tier": "pro",
    "exampleId": "context-menu",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/context-menu-demo.tsx",
    "exportName": "ContextMenuDemo",
    "sha256": "c4d8dd7265b4dabc7bf980a5f34213fb9f26bc30612c3af9ef926d6bb0aacd93",
    "helperImports": [],
    "directComponentImports": [
      "context-menu"
    ],
    "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/context-menu",
    "registryUrl": "https://tidalui.com/r/pro/context-menu.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/context-menu",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/context-menu",
      "registryUrl": "https://tidalui.com/r/pro/context-menu.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/context-menu.tsx",
    "exports": [
      "TidalContextMenu",
      "TidalContextMenuContent",
      "TidalContextMenuItem",
      "TidalContextMenuLabel",
      "TidalContextMenuLinkItem",
      "TidalContextMenuSeparator",
      "TidalContextMenuTrigger"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/context-menu.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "@radix-ui/react-context-menu",
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "context-menu"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/context-menu.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/context-menu.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/context-menu-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useState } from \"react\";\n\nimport { Archive, Copy, ExternalLink, FileText, FolderOpen, RotateCcw } from \"lucide-react\";\n\nimport { TidalContextMenu, TidalContextMenuContent, TidalContextMenuItem, TidalContextMenuLabel, TidalContextMenuLinkItem, TidalContextMenuSeparator, TidalContextMenuTrigger } from \"./components/ui/context-menu\";\n\nimport \"./components/ui/context-menu.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .context-menu-demo,\\n.tidal-scope .context-menu-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .context-menu-demo {\\n  container: tidal-context-demo / inline-size;\\n  display: grid;\\n  width: min(100%, 1040px);\\n  min-width: 0;\\n  gap: 24px;\\n  margin-inline: auto;\\n  padding: clamp(16px, 4vw, 44px);\\n  color: var(--t-ink);\\n}\\n\\n.tidal-scope .context-menu-demo-heading {\\n  display: grid;\\n  max-width: 660px;\\n  min-width: 0;\\n  gap: 8px;\\n}\\n\\n.tidal-scope .context-menu-demo-heading :is(h2, p) {\\n  margin: 0;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .context-menu-demo-heading h2 {\\n  font-size: clamp(27px, 5vw, 44px);\\n  font-weight: 570;\\n  letter-spacing: -0.052em;\\n  line-height: 1;\\n}\\n\\n.tidal-scope .context-menu-demo-heading p {\\n  color: var(--t-muted);\\n  font-size: 12px;\\n  line-height: 1.55;\\n}\\n\\n.tidal-scope .context-menu-demo-shell {\\n  display: grid;\\n  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.75fr);\\n  min-width: 0;\\n  border: 1px solid var(--t-border);\\n  border-radius: 18px;\\n  overflow: hidden;\\n  background: var(--t-surface);\\n  box-shadow:\\n    inset 0 1px #ffffff0a,\\n    0 18px 54px -42px #00000080;\\n}\\n\\n.tidal-scope .context-menu-demo-list {\\n  display: grid;\\n  align-content: start;\\n  min-width: 0;\\n  max-height: 520px;\\n  padding: 8px;\\n  overflow: auto;\\n  overscroll-behavior: contain;\\n  scrollbar-width: thin;\\n}\\n\\n.tidal-scope .context-menu-demo-file {\\n  display: grid;\\n  grid-template-columns: 42px minmax(0, 1fr) auto;\\n  align-items: center;\\n  width: 100%;\\n  min-width: 0;\\n  min-height: 68px;\\n  gap: 12px;\\n  padding: 10px 12px;\\n  border: 1px solid transparent;\\n  border-radius: 11px;\\n  background: transparent;\\n  color: var(--t-ink);\\n  font: inherit;\\n  text-align: start;\\n  cursor: default;\\n  transition:\\n    background 180ms,\\n    border-color 180ms,\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.tidal-scope .context-menu-demo-file:hover {\\n  background: var(--t-subtle);\\n}\\n\\n.tidal-scope .context-menu-demo-file[data-selected] {\\n  border-color: var(--t-ink);\\n  background: var(--t-wash);\\n}\\n\\n.tidal-scope .context-menu-demo-file:active {\\n  transform: scale(0.995);\\n}\\n\\n.tidal-scope .context-menu-demo-file:focus-visible {\\n  outline: 2px solid var(--t-ink);\\n  outline-offset: -2px;\\n}\\n\\n.tidal-scope .context-menu-demo-file-icon {\\n  display: grid;\\n  width: 42px;\\n  height: 42px;\\n  place-items: center;\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  background: var(--t-surface);\\n}\\n\\n.tidal-scope .context-menu-demo-file-copy {\\n  display: grid;\\n  min-width: 0;\\n  gap: 4px;\\n}\\n\\n.tidal-scope .context-menu-demo-file-copy strong,\\n.tidal-scope .context-menu-demo-file-copy span,\\n.tidal-scope .context-menu-demo-file-state {\\n  min-width: 0;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .context-menu-demo-file-copy strong {\\n  font-size: 13px;\\n  font-weight: 620;\\n}\\n\\n.tidal-scope .context-menu-demo-file-copy span,\\n.tidal-scope .context-menu-demo-file-state {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n}\\n\\n.tidal-scope .context-menu-demo-file-state {\\n  justify-self: end;\\n  padding: 5px 7px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 999px;\\n  background: var(--t-surface);\\n}\\n\\n.tidal-scope .context-menu-demo-details {\\n  display: grid;\\n  align-content: space-between;\\n  min-width: 0;\\n  gap: 28px;\\n  padding: clamp(20px, 4vw, 34px);\\n  border-inline-start: 1px solid var(--t-border);\\n  background: var(--t-subtle);\\n}\\n\\n.tidal-scope .context-menu-demo-details > div {\\n  display: grid;\\n  min-width: 0;\\n  gap: 8px;\\n}\\n\\n.tidal-scope .context-menu-demo-details :is(span, h3, p, dl, dt, dd) {\\n  margin: 0;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .context-menu-demo-details span {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  font-weight: 700;\\n  letter-spacing: 0.1em;\\n  text-transform: uppercase;\\n}\\n\\n.tidal-scope .context-menu-demo-details h3 {\\n  font-size: clamp(19px, 3vw, 28px);\\n  font-weight: 570;\\n  letter-spacing: -0.035em;\\n  line-height: 1.05;\\n}\\n\\n.tidal-scope .context-menu-demo-details p,\\n.tidal-scope .context-menu-demo-details dd {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n}\\n\\n.tidal-scope .context-menu-demo-details dl {\\n  display: grid;\\n  min-width: 0;\\n  gap: 10px;\\n}\\n\\n.tidal-scope .context-menu-demo-details dl > div {\\n  display: grid;\\n  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);\\n  min-width: 0;\\n  gap: 10px;\\n  padding-top: 10px;\\n  border-top: 1px solid var(--t-border);\\n}\\n\\n.tidal-scope .context-menu-demo-details dt {\\n  font-size: 11px;\\n  font-weight: 650;\\n}\\n\\n.tidal-scope .context-menu-demo-footer {\\n  display: grid;\\n  grid-template-columns: minmax(0, 1fr) auto;\\n  align-items: center;\\n  min-width: 0;\\n  gap: 8px 16px;\\n}\\n\\n.tidal-scope .context-menu-demo-footer :is(p, span) {\\n  margin: 0;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .context-menu-demo-footer p {\\n  font-size: 11px;\\n}\\n\\n.tidal-scope .context-menu-demo-footer > span {\\n  grid-column: 1 / -1;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n}\\n\\n.tidal-scope .context-menu-demo-footer button {\\n  min-width: 44px;\\n  min-height: 44px;\\n  padding: 0 14px;\\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: 620;\\n  transition:\\n    border-color 160ms,\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.tidal-scope .context-menu-demo-footer button:hover {\\n  border-color: var(--t-ink);\\n}\\n\\n.tidal-scope .context-menu-demo-footer button:active {\\n  transform: translateY(1px);\\n}\\n\\n.tidal-scope .context-menu-demo-footer button:focus-visible {\\n  outline: 2px solid var(--t-ink);\\n  outline-offset: 3px;\\n}\\n\\n@container tidal-context-demo (max-width: 680px) {\\n  .tidal-scope .context-menu-demo-shell {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n\\n  .tidal-scope .context-menu-demo-details {\\n    border-block-start: 1px solid var(--t-border);\\n    border-inline-start: 0;\\n  }\\n}\\n\\n@container tidal-context-demo (max-width: 390px) {\\n  .tidal-scope .context-menu-demo-file {\\n    grid-template-columns: 42px minmax(0, 1fr);\\n  }\\n\\n  .tidal-scope .context-menu-demo-file-state {\\n    grid-column: 2;\\n    justify-self: start;\\n  }\\n\\n  .tidal-scope .context-menu-demo-footer {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n\\n  .tidal-scope .context-menu-demo-footer button {\\n    width: 100%;\\n  }\\n}\\n\\n@media (pointer: coarse) {\\n  .tidal-scope .context-menu-demo-file,\\n  .tidal-scope .context-menu-demo-footer button {\\n    font-size: 16px;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .context-menu-demo-file,\\n  .tidal-scope .context-menu-demo-footer button {\\n    transition: none;\\n  }\\n\\n  .tidal-scope .context-menu-demo-file:active,\\n  .tidal-scope .context-menu-demo-footer button:active {\\n    transform: none;\\n  }\\n}\";\n\ntype DemoFile = {\n  id: string;\n  name: string;\n  detail: string;\n  archived: boolean;\n};\n\nconst INITIAL_FILES: DemoFile[] = [\n  {\n    id: \"launch-brief\",\n    name: \"Launch brief.pdf\",\n    detail: \"PDF · 2.4 MB · Edited today\",\n    archived: false,\n  },\n  {\n    id: \"release-notes\",\n    name: \"Release notes.txt\",\n    detail: \"Text · 18 KB · Edited yesterday\",\n    archived: false,\n  },\n  {\n    id: \"cover-study\",\n    name: \"Cover study.png\",\n    detail: \"Image · 4.8 MB · Edited Monday\",\n    archived: false,\n  },\n];\n\nexport function ContextMenuDemo({\n  theme = \"light\",\n}: {\n  theme?: \"light\" | \"dark\";\n}) {\n  const demoId = useId().replace(/:/g, \"\");\n  const headingId = `${demoId}-project-files`;\n  const detailsId = `${demoId}-file-details`;\n  const [files, setFiles] = useState(INITIAL_FILES);\n  const [selectedId, setSelectedId] = useState(INITIAL_FILES[0].id);\n  const [status, setStatus] = useState(\"Select a file to inspect its details.\");\n  const selectedFile = files.find((file) => file.id === selectedId) ?? files[0];\n\n  function openDetails(file: DemoFile) {\n    setSelectedId(file.id);\n    setStatus(`${file.name} is selected in this preview.`);\n  }\n\n  function duplicate(file: DemoFile) {\n    const copyNumber = files.filter((item) =>\n      item.id.startsWith(`${file.id}-copy`),\n    ).length;\n    const extensionIndex = file.name.lastIndexOf(\".\");\n    const base =\n      extensionIndex > 0 ? file.name.slice(0, extensionIndex) : file.name;\n    const extension = extensionIndex > 0 ? file.name.slice(extensionIndex) : \"\";\n    const copy: DemoFile = {\n      ...file,\n      id: `${file.id}-copy-${copyNumber + 1}`,\n      name: `${base} copy ${copyNumber + 1}${extension}`,\n      archived: false,\n    };\n    setFiles((current) => [...current, copy]);\n    setSelectedId(copy.id);\n    setStatus(`${copy.name} was duplicated.`);\n  }\n\n  function toggleArchived(file: DemoFile) {\n    const nextArchived = !file.archived;\n    setFiles((current) =>\n      current.map((item) =>\n        item.id === file.id ? { ...item, archived: nextArchived } : item,\n      ),\n    );\n    setStatus(\n      `${file.name} is ${nextArchived ? \"archived\" : \"active\"} in this preview.`,\n    );\n  }\n\n  return (\n    <section className=\"context-menu-demo\" aria-labelledby={headingId}>\n      <header className=\"context-menu-demo-heading\">\n        <h2 id={headingId}>Project files</h2>\n        <p>\n          Right-click a row, long-press it, or use the keyboard context-menu\n          command to open its actions.\n        </p>\n      </header>\n\n      <div className=\"context-menu-demo-shell\">\n        <div\n          className=\"context-menu-demo-list\"\n          aria-label=\"Sample project files\"\n        >\n          {files.map((file, index) => (\n            <TidalContextMenu key={file.id} theme={theme}>\n              <TidalContextMenuTrigger\n                className=\"context-menu-demo-file\"\n                data-selected={file.id === selectedId || undefined}\n                onClick={() => openDetails(file)}\n                aria-describedby={`${demoId}-${file.id}-meta`}\n              >\n                <span\n                  className=\"context-menu-demo-file-icon\"\n                  aria-hidden=\"true\"\n                >\n                  <FileText size={18} />\n                </span>\n                <span className=\"context-menu-demo-file-copy\">\n                  <strong>{file.name}</strong>\n                  <span id={`${demoId}-${file.id}-meta`}>{file.detail}</span>\n                </span>\n                <span className=\"context-menu-demo-file-state\">\n                  {file.archived\n                    ? \"Archived\"\n                    : index === 0\n                      ? \"Recent\"\n                      : \"Active\"}\n                </span>\n              </TidalContextMenuTrigger>\n\n              <TidalContextMenuContent aria-label={`Actions for ${file.name}`}>\n                <TidalContextMenuLabel>{file.name}</TidalContextMenuLabel>\n                <TidalContextMenuItem\n                  textValue=\"Open details\"\n                  onSelect={() => openDetails(file)}\n                >\n                  <FolderOpen size={16} aria-hidden=\"true\" />\n                  <span className=\"tidal-context-item-copy\">Open details</span>\n                  <kbd aria-hidden=\"true\">↵</kbd>\n                </TidalContextMenuItem>\n                <TidalContextMenuLinkItem\n                  textValue=\"Jump to details\"\n                  anchorProps={{\n                    href: `#${detailsId}`,\n                    onClick: () => openDetails(file),\n                  }}\n                >\n                  <ExternalLink size={16} aria-hidden=\"true\" />\n                  <span className=\"tidal-context-item-copy\">\n                    Jump to details\n                  </span>\n                </TidalContextMenuLinkItem>\n                <TidalContextMenuItem\n                  textValue=\"Duplicate\"\n                  onSelect={() => duplicate(file)}\n                >\n                  <Copy size={16} aria-hidden=\"true\" />\n                  <span className=\"tidal-context-item-copy\">Duplicate</span>\n                </TidalContextMenuItem>\n                <TidalContextMenuSeparator />\n                <TidalContextMenuItem\n                  textValue={\n                    file.archived ? \"Restore to active\" : \"Archive in view\"\n                  }\n                  destructive={!file.archived}\n                  onSelect={() => toggleArchived(file)}\n                >\n                  {file.archived ? (\n                    <RotateCcw size={16} aria-hidden=\"true\" />\n                  ) : (\n                    <Archive size={16} aria-hidden=\"true\" />\n                  )}\n                  <span className=\"tidal-context-item-copy\">\n                    {file.archived ? \"Restore to active\" : \"Archive in view\"}\n                  </span>\n                </TidalContextMenuItem>\n                <TidalContextMenuItem\n                  disabled\n                  textValue=\"Move to client folder\"\n                >\n                  <FolderOpen size={16} aria-hidden=\"true\" />\n                  <span className=\"tidal-context-item-copy\">\n                    Move to client folder\n                  </span>\n                </TidalContextMenuItem>\n              </TidalContextMenuContent>\n            </TidalContextMenu>\n          ))}\n        </div>\n\n        <aside\n          className=\"context-menu-demo-details\"\n          id={detailsId}\n          aria-labelledby={`${detailsId}-title`}\n        >\n          <div>\n            <span>Selected file</span>\n            <h3 id={`${detailsId}-title`}>{selectedFile.name}</h3>\n            <p>{selectedFile.detail}</p>\n          </div>\n          <dl>\n            <div>\n              <dt>View</dt>\n              <dd>{selectedFile.archived ? \"Archived\" : \"Active\"}</dd>\n            </div>\n            <div>\n              <dt>Location</dt>\n              <dd>Project files</dd>\n            </div>\n          </dl>\n        </aside>\n      </div>\n\n      <footer className=\"context-menu-demo-footer\">\n        <p role=\"status\" aria-live=\"polite\">\n          {status}\n        </p>\n        <button\n          type=\"button\"\n          onClick={() => {\n            setFiles(INITIAL_FILES);\n            setSelectedId(INITIAL_FILES[0].id);\n            setStatus(\"Files reset.\");\n          }}\n        >\n          Reset sample\n        </button>\n        <span>Sample changes stay on this page.</span>\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      <ContextMenuDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/context-menu.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "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": "onSelect",
      "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": "Verify focus returns to the invoking control after dismissal.",
    "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": "No error fixture is exposed by the existing demo; inject a consumer-owned failure state before production use.",
      "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": []
}
