{
  "component": {
    "id": "search-results",
    "name": "Search results",
    "tier": "pro",
    "exampleId": "search-results",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/search-results-demo.tsx",
    "exportName": "SearchResultsDemo",
    "sha256": "6093809ee5e4bee2247a90a43c0e59f368547201e36f2ed4fea0a18156bd5785",
    "helperImports": [],
    "directComponentImports": [
      "search-results"
    ],
    "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/search-results",
    "registryUrl": "https://tidalui.com/r/pro/search-results.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/search-results",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/search-results",
      "registryUrl": "https://tidalui.com/r/pro/search-results.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/search-results.tsx",
    "exports": [
      "TidalSearchResult",
      "TidalSearchResultGroup",
      "TidalSearchResults"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/search-results.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "search-results"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/search-results.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/search-results.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/search-results-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useLayoutEffect, useMemo, useRef, useState } from \"react\";\n\nimport { TidalSearchResults, type TidalSearchResult, type TidalSearchResultGroup } from \"./components/ui/search-results\";\n\nimport \"./components/ui/search-results.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .search-results-demo,\\n.tidal-scope .search-results-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .search-results-demo {\\n  width: 100%;\\n  min-width: 0;\\n  container: search-results-demo / inline-size;\\n}\\n\\n.tidal-scope .search-results-demo-frame {\\n  display: grid;\\n  min-width: 0;\\n  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.38fr);\\n  gap: 14px;\\n  padding: 20px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 22px;\\n  background: var(--t-subtle);\\n  color: var(--t-ink);\\n}\\n\\n.tidal-scope .search-results-demo-detail {\\n  position: sticky;\\n  top: 14px;\\n  min-width: 0;\\n  min-height: 360px;\\n  align-self: start;\\n  padding: 24px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 18px;\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n  scroll-margin-block: 18px;\\n}\\n\\n.tidal-scope .search-results-demo-detail:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .search-results-demo-detail > span {\\n  display: block;\\n  color: color-mix(in srgb, var(--t-surface) 62%, var(--t-ink));\\n  font-size: 11px;\\n  font-weight: 700;\\n  letter-spacing: 0.1em;\\n  line-height: 1.35;\\n  text-transform: uppercase;\\n}\\n\\n.tidal-scope .search-results-demo-detail > strong {\\n  display: inline-block;\\n  margin-top: 24px;\\n  padding: 6px 8px;\\n  border: 1px solid color-mix(in srgb, var(--t-surface) 30%, var(--t-ink));\\n  border-radius: 7px;\\n  color: color-mix(in srgb, var(--t-surface) 74%, var(--t-ink));\\n  font-size: 11px;\\n  font-weight: 680;\\n  line-height: 1.25;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .search-results-demo-detail h3 {\\n  margin: 14px 0 0;\\n  font-size: clamp(25px, 4.5cqi, 38px);\\n  font-weight: 540;\\n  letter-spacing: -0.052em;\\n  line-height: 1.03;\\n  text-wrap: balance;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .search-results-demo-detail p {\\n  margin: 14px 0 0;\\n  color: color-mix(in srgb, var(--t-surface) 72%, var(--t-ink));\\n  font-size: 11px;\\n  line-height: 1.65;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .search-results-demo-detail dl {\\n  display: grid;\\n  gap: 1px;\\n  margin: 23px 0 0;\\n  overflow: hidden;\\n  border: 1px solid color-mix(in srgb, var(--t-surface) 22%, var(--t-ink));\\n  border-radius: 10px;\\n  background: color-mix(in srgb, var(--t-surface) 22%, var(--t-ink));\\n}\\n\\n.tidal-scope .search-results-demo-detail dl > div {\\n  min-width: 0;\\n  padding: 10px 11px;\\n  background: var(--t-ink);\\n}\\n\\n.tidal-scope .search-results-demo-detail dt {\\n  color: color-mix(in srgb, var(--t-surface) 58%, var(--t-ink));\\n  font-size: 11px;\\n  line-height: 1.35;\\n}\\n\\n.tidal-scope .search-results-demo-detail dd {\\n  margin: 4px 0 0;\\n  font-size: 11px;\\n  line-height: 1.4;\\n  overflow-wrap: anywhere;\\n}\\n\\n@container search-results-demo (max-width: 780px) {\\n  .tidal-scope .search-results-demo-frame {\\n    grid-template-columns: minmax(0, 1fr);\\n    padding: 10px;\\n  }\\n\\n  .tidal-scope .search-results-demo-detail {\\n    position: static;\\n    min-height: 0;\\n  }\\n}\\n\\n@container search-results-demo (max-width: 390px) {\\n  .tidal-scope .search-results-demo-frame {\\n    gap: 9px;\\n    padding: 7px;\\n  }\\n\\n  .tidal-scope .search-results-demo-detail {\\n    padding: 20px 16px;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .search-results-demo * {\\n    scroll-behavior: auto !important;\\n  }\\n}\";\n\ntype FilterId = \"all\" | \"guides\" | \"components\" | \"references\";\n\ninterface SampleResult {\n  id: string;\n  groupId: Exclude<FilterId, \"all\">;\n  groupLabel: string;\n  title: string;\n  description: string;\n  typeLabel: string;\n  meta: string;\n  keywords: string;\n  detail: string;\n  actionKind: \"link\" | \"button\";\n}\n\nconst SAMPLE_RESULTS: readonly SampleResult[] = [\n  {\n    id: \"search-patterns\",\n    groupId: \"guides\",\n    groupLabel: \"Guides\",\n    title: \"Search patterns for product teams\",\n    description: \"Query language, empty states, and useful result summaries.\",\n    typeLabel: \"Guide\",\n    meta: \"8 min read\",\n    keywords: \"query filters empty states product\",\n    detail:\n      \"Keep search scope, result counts, and recovery actions easy to find.\",\n    actionKind: \"link\",\n  },\n  {\n    id: \"keyboard-guide\",\n    groupId: \"guides\",\n    groupLabel: \"Guides\",\n    title: \"Keyboard review checklist\",\n    description: \"Tab order, visible focus, and recovery after filtering.\",\n    typeLabel: \"Guide\",\n    meta: \"5 min read\",\n    keywords: \"keyboard focus accessibility review\",\n    detail: \"Check native controls and stable focus as search results change.\",\n    actionKind: \"button\",\n  },\n  {\n    id: \"command-menu\",\n    groupId: \"components\",\n    groupLabel: \"Components\",\n    title: \"Command menu\",\n    description: \"A keyboard-friendly shortcut to actions and navigation.\",\n    typeLabel: \"Component\",\n    meta: \"Interactive\",\n    keywords: \"command menu keyboard navigation\",\n    detail: \"Find actions, recent pages, and shortcuts in one place.\",\n    actionKind: \"link\",\n  },\n  {\n    id: \"filter-bar\",\n    groupId: \"components\",\n    groupLabel: \"Components\",\n    title: \"Filter bar\",\n    description: \"Selected filters and result counts in a compact toolbar.\",\n    typeLabel: \"Component\",\n    meta: \"Interactive\",\n    keywords: \"filter chips counts selected state\",\n    detail:\n      \"Combine filters and remove them individually without losing context.\",\n    actionKind: \"button\",\n  },\n  {\n    id: \"empty-state\",\n    groupId: \"components\",\n    groupLabel: \"Components\",\n    title: \"Empty state section\",\n    description: \"Helpful guidance when a search has no results.\",\n    typeLabel: \"Component\",\n    meta: \"Layout\",\n    keywords: \"empty zero results recovery\",\n    detail: \"Explain what happened and give people a clear next step.\",\n    actionKind: \"link\",\n  },\n  {\n    id: \"query-syntax\",\n    groupId: \"references\",\n    groupLabel: \"References\",\n    title: \"Query syntax\",\n    description: \"Search by title, type, or status.\",\n    typeLabel: \"Reference\",\n    meta: \"12 terms\",\n    keywords: \"syntax title type status reference\",\n    detail: \"Use specific fields to narrow a search and find the right result.\",\n    actionKind: \"button\",\n  },\n  {\n    id: \"result-schema\",\n    groupId: \"references\",\n    groupLabel: \"References\",\n    title: \"Result record schema\",\n    description: \"Titles, summaries, metadata, and destinations.\",\n    typeLabel: \"Reference\",\n    meta: \"Reference\",\n    keywords: \"schema metadata destination typed data\",\n    detail: \"A reference for the fields shown in each search result.\",\n    actionKind: \"link\",\n  },\n];\n\nconst FILTERS: readonly { id: FilterId; label: string }[] = [\n  { id: \"all\", label: \"All\" },\n  { id: \"guides\", label: \"Guides\" },\n  { id: \"components\", label: \"Components\" },\n  { id: \"references\", label: \"References\" },\n];\n\nexport function SearchResultsDemo() {\n  const generatedId = useId().replace(/:/g, \"\");\n  const detailId = `search-results-${generatedId}-detail`;\n  const [query, setQuery] = useState(\"\");\n  const [filterId, setFilterId] = useState<FilterId>(\"all\");\n  const [selectedId, setSelectedId] = useState(SAMPLE_RESULTS[0].id);\n  const [message, setMessage] = useState(\"Showing all results.\");\n  const inputRef = useRef<HTMLInputElement>(null);\n  const resetFocusIntent = useRef(false);\n\n  const normalizedQuery = query.trim().toLocaleLowerCase();\n  const queryMatches = useMemo(\n    () =>\n      SAMPLE_RESULTS.filter((item) =>\n        `${item.title} ${item.description} ${item.keywords}`\n          .toLocaleLowerCase()\n          .includes(normalizedQuery),\n      ),\n    [normalizedQuery],\n  );\n  const visible = useMemo(\n    () =>\n      queryMatches.filter(\n        (item) => filterId === \"all\" || item.groupId === filterId,\n      ),\n    [filterId, queryMatches],\n  );\n\n  useLayoutEffect(() => {\n    if (!resetFocusIntent.current) return;\n    resetFocusIntent.current = false;\n    inputRef.current?.focus({ preventScroll: true });\n  }, [filterId, query]);\n\n  function selectResult(item: SampleResult) {\n    setSelectedId(item.id);\n    setMessage(`${item.title} opened.`);\n  }\n\n  const groups = useMemo<readonly TidalSearchResultGroup[]>(() => {\n    return ([\"guides\", \"components\", \"references\"] as const).flatMap(\n      (groupId) => {\n        const groupItems = visible.filter((item) => item.groupId === groupId);\n        if (!groupItems.length) return [];\n        const results: readonly TidalSearchResult[] = groupItems.map((item) => {\n          const shared = {\n            id: item.id,\n            title: item.title,\n            description: item.description,\n            typeLabel: item.typeLabel,\n            meta: item.meta,\n          };\n          if (item.actionKind === \"link\") {\n            return {\n              ...shared,\n              action: {\n                kind: \"link\",\n                accessibleLabel: `Open ${item.title}`,\n                href: `#${detailId}`,\n                onAction: () => selectResult(item),\n              },\n            };\n          }\n          return {\n            ...shared,\n            action: {\n              kind: \"button\",\n              accessibleLabel: `Preview ${item.title}`,\n              onAction: () => selectResult(item),\n            },\n          };\n        });\n        return [\n          {\n            id: groupId,\n            title: groupItems[0].groupLabel,\n            accessibleLabel: `${groupItems.length} ${groupItems[0].groupLabel.toLocaleLowerCase()} results`,\n            count: groupItems.length,\n            results,\n          },\n        ];\n      },\n    );\n  }, [detailId, visible]);\n\n  const selected =\n    SAMPLE_RESULTS.find((item) => item.id === selectedId) ?? SAMPLE_RESULTS[0];\n  const countFor = (id: FilterId) =>\n    queryMatches.filter((item) => id === \"all\" || item.groupId === id).length;\n\n  return (\n    <section\n      className=\"search-results-demo\"\n      aria-label=\"Search results preview\"\n    >\n      <div className=\"search-results-demo-frame\">\n        <TidalSearchResults\n          title=\"Search results\"\n          eyebrow={null}\n          description=\"Search guides, components, and references.\"\n          queryControl={{\n            value: query,\n            label: \"Search the library\",\n            placeholder: \"Try keyboard, filter, or schema\",\n            inputRef,\n            onValueChange: (value) => {\n              setQuery(value);\n              setMessage(\n                value ? `Searching for “${value}”.` : \"Showing all results.\",\n              );\n            },\n          }}\n          filters={FILTERS.map((filter) => ({\n            id: filter.id,\n            label: filter.label,\n            accessibleLabel: `Show ${filter.label.toLocaleLowerCase()} results, ${countFor(filter.id)}`,\n            count: countFor(filter.id),\n          }))}\n          selectedFilterId={filterId}\n          onFilterChange={(filter) => {\n            setFilterId(filter.id as FilterId);\n            setMessage(\n              `Showing ${String(filter.label).toLocaleLowerCase()} results.`,\n            );\n          }}\n          groups={groups}\n          resultCount={visible.length}\n          resultCountLabel={(count, value) =>\n            value ? `${count} results for ${value}` : `${count} results`\n          }\n          emptyDescription=\"Try another search or reset the filters.\"\n          emptyAction={{\n            label: \"Reset search\",\n            accessibleLabel: \"Reset search and focus the query field\",\n            onAction: () => {\n              resetFocusIntent.current = true;\n              setQuery(\"\");\n              setFilterId(\"all\");\n              setMessage(\"Search reset. Showing all results.\");\n            },\n          }}\n          footer={\n            <span role=\"status\" aria-live=\"polite\">\n              {message} Sample data. Changes stay in this preview.\n            </span>\n          }\n        />\n\n        <article\n          id={detailId}\n          className=\"search-results-demo-detail\"\n          tabIndex={-1}\n        >\n          <span>Result detail</span>\n          <strong>{selected.typeLabel}</strong>\n          <h3>{selected.title}</h3>\n          <p>{selected.detail}</p>\n          <dl>\n            <div>\n              <dt>Group</dt>\n              <dd>{selected.groupLabel}</dd>\n            </div>\n            <div>\n              <dt>Source</dt>\n              <dd>Library</dd>\n            </div>\n          </dl>\n        </article>\n      </div>\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      <SearchResultsDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/search-results.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "selectedFilterId",
      "type": "inferred-from-existing-demo",
      "initial": "\"all\"",
      "setter": "setFilterId",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onFilterChange",
      "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": "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": []
}
