{
  "component": {
    "id": "global-search",
    "name": "Global search",
    "tier": "pro",
    "exampleId": "global-search",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/global-search-demo.tsx",
    "exportName": "GlobalSearchDemo",
    "sha256": "8b6df3311bfb4033d942bea85c6d1255ef85a77cd40e95d5ef51a0a8c9f764ab",
    "helperImports": [],
    "directComponentImports": [
      "global-search"
    ],
    "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/global-search",
    "registryUrl": "https://tidalui.com/r/pro/global-search.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/global-search",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/global-search",
      "registryUrl": "https://tidalui.com/r/pro/global-search.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/global-search.tsx",
    "exports": [
      "TidalGlobalSearch",
      "TidalGlobalSearchGroup",
      "TidalGlobalSearchResult"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/global-search.css",
      "components/ui/keyboard-key.css",
      "components/ui/spinner.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "@radix-ui/react-dialog",
      "lucide-react"
    ],
    "registry": [
      "https://tidalui.com/r/keyboard-key.json",
      "https://tidalui.com/r/spinner.json"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "global-search",
      "keyboard-key",
      "spinner"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/global-search.css",
      "components/ui/keyboard-key.css",
      "components/ui/spinner.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/global-search.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/global-search-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useMemo, useState, type MouseEvent } from \"react\";\n\nimport { FileText, FolderKanban, Settings2, UserRound } from \"lucide-react\";\n\nimport { TidalGlobalSearch, type TidalGlobalSearchGroup, type TidalGlobalSearchResult } from \"./components/ui/global-search\";\n\nimport \"./components/ui/global-search.css\";\n\nimport \"./components/ui/keyboard-key.css\";\n\nimport \"./components/ui/spinner.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .global-search-demo {\\n  display: grid;\\n  width: min(100%, 440px);\\n  min-width: 0;\\n  justify-items: start;\\n  gap: 14px;\\n  margin-inline: auto;\\n}\\n\\n.tidal-scope .global-search-demo > 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.tidal-scope .global-search-demo > p:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\";\n\nexport interface GlobalSearchDemoProps {\n  theme?: \"light\" | \"dark\";\n}\n\nfunction isPlainPrimaryClick(\n  event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>,\n) {\n  return !(\n    event.metaKey ||\n    event.ctrlKey ||\n    event.shiftKey ||\n    event.altKey ||\n    event.button !== 0\n  );\n}\n\nexport function GlobalSearchDemo({ theme = \"light\" }: GlobalSearchDemoProps) {\n  const destinationId = `global-search-${useId().replace(/:/g, \"\")}`;\n  const [open, setOpen] = useState(false);\n  const [query, setQuery] = useState(\"\");\n  const [compact, setCompact] = useState(false);\n  const [status, setStatus] = useState(\"No result selected.\");\n\n  const corpus = useMemo<TidalGlobalSearchGroup[]>(\n    () => [\n      {\n        id: \"workspace\",\n        label: \"Workspace\",\n        results: [\n          {\n            id: \"project-atlas\",\n            label: \"Atlas planning\",\n            description: \"Sample project\",\n            meta: \"Project\",\n            icon: <FolderKanban />,\n            href: `#${destinationId}`,\n          },\n          {\n            id: \"release-brief\",\n            label: \"Release brief\",\n            description: \"Sample document\",\n            meta: \"Document\",\n            icon: <FileText />,\n            href: `#${destinationId}`,\n          },\n          {\n            id: \"ava-reed\",\n            label: \"Ava Reed\",\n            description: \"Sample teammate\",\n            meta: \"Person\",\n            icon: <UserRound />,\n            href: `#${destinationId}`,\n          },\n        ],\n      },\n      {\n        id: \"actions\",\n        label: \"Actions\",\n        results: [\n          {\n            id: \"compact-view\",\n            label: compact ? \"Use comfortable view\" : \"Use compact view\",\n            description: \"Change this local sample\",\n            meta: \"Action\",\n            icon: <Settings2 />,\n          },\n        ],\n      },\n    ],\n    [compact, destinationId],\n  );\n\n  const groups = useMemo(() => {\n    const normalizedQuery = query.trim().toLocaleLowerCase();\n    if (!normalizedQuery) return corpus;\n    return corpus.map((group) => ({\n      ...group,\n      results: group.results.filter((result) =>\n        `${result.label} ${String(result.description ?? \"\")} ${String(result.meta ?? \"\")}`\n          .toLocaleLowerCase()\n          .includes(normalizedQuery),\n      ),\n    }));\n  }, [corpus, query]);\n\n  const recentItems = useMemo<readonly TidalGlobalSearchResult[]>(\n    () => [corpus[0].results[0], corpus[0].results[1]],\n    [corpus],\n  );\n\n  return (\n    <section className=\"global-search-demo\" aria-label=\"Global search preview\">\n      <TidalGlobalSearch\n        open={open}\n        onOpenChange={setOpen}\n        query={query}\n        onQueryChange={setQuery}\n        groups={groups}\n        recentItems={recentItems}\n        title=\"Search workspace\"\n        description=\"Find a sample record or run a local view action.\"\n        defaultTriggerLabel=\"Search workspace\"\n        shortcutKeys={[\n          { id: \"command\", label: \"⌘\", accessibleLabel: \"Command\" },\n          { id: \"k\", label: \"K\", accessibleLabel: \"K\" },\n        ]}\n        inputLabel=\"Search sample workspace\"\n        inputPlaceholder=\"Projects, documents, people, actions\"\n        theme={theme}\n        onResultSelect={(resultId, result, event) => {\n          if (!isPlainPrimaryClick(event)) return;\n          if (result.href !== undefined) event.preventDefault();\n          if (resultId === \"compact-view\") {\n            const nextCompact = !compact;\n            setCompact(nextCompact);\n            setStatus(`Compact view ${nextCompact ? \"on\" : \"off\"}.`);\n          } else {\n            setStatus(`${result.label} selected.`);\n          }\n          setOpen(false);\n        }}\n      />\n      <p id={destinationId} tabIndex={-1}>\n        {status}\n      </p>\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      <GlobalSearchDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/global-search.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "open",
      "type": "inferred-from-existing-demo",
      "initial": "false",
      "setter": "setOpen",
      "proposalCanBeRejected": false
    },
    {
      "prop": "query",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setQuery",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "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": "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": "onResultSelect",
      "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": "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": "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": []
}
