{
  "component": {
    "id": "blog-grid",
    "name": "Blog grid",
    "tier": "pro",
    "exampleId": "blog-grid",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/blog-grid-demo.tsx",
    "exportName": "BlogGridDemo",
    "sha256": "9658dbec3a96ff79f7a131b2f0d691ce976f4c2c22ab65b6c6d09d88f45cf6e9",
    "helperImports": [],
    "directComponentImports": [
      "blog-grid"
    ],
    "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/blog-grid",
    "registryUrl": "https://tidalui.com/r/pro/blog-grid.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/blog-grid",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/blog-grid",
      "registryUrl": "https://tidalui.com/r/pro/blog-grid.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/blog-grid.tsx",
    "exports": [
      "TidalBlogArticle",
      "TidalBlogGrid"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/blog-grid.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "blog-grid"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/blog-grid.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/blog-grid.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/blog-grid-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 { RotateCcw } from \"lucide-react\";\n\nimport { TidalBlogGrid, type TidalBlogArticle } from \"./components/ui/blog-grid\";\n\nimport \"./components/ui/blog-grid.css\";\n\nfunction tidalExampleAvatarDataUri(seed: unknown) {\n  const text = String(seed).replace(/[^a-z0-9]/gi, \"\").slice(-2) || \"UI\";\n  const palette = [\"#333333\", \"#555555\", \"#777777\", \"#999999\", \"#bbbbbb\"];\n  const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\"><rect width=\"96\" height=\"96\" rx=\"48\" fill=\"${color}\"/><circle cx=\"48\" cy=\"38\" r=\"17\" fill=\"white\" fill-opacity=\".92\"/><path d=\"M18 92c3-22 15-34 30-34s27 12 30 34\" fill=\"white\" fill-opacity=\".92\"/></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\nfunction tidalExampleImageDataUri(label: string) {\n  const safeLabel = label.replace(/[<>&]/g, \"\").slice(0, 28) || \"Sample image\";\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1200 675\"><defs><linearGradient id=\"g\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\"><stop stop-color=\"#171717\"/><stop offset=\"1\" stop-color=\"#555555\"/></linearGradient></defs><rect width=\"1200\" height=\"675\" fill=\"url(#g)\"/><circle cx=\"950\" cy=\"100\" r=\"260\" fill=\"white\" fill-opacity=\".08\"/><text x=\"80\" y=\"570\" fill=\"white\" font-family=\"system-ui,sans-serif\" font-size=\"64\" font-weight=\"700\">${safeLabel}</text></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\nconst tidalExampleStyles = \".tidal-scope .blog-grid-demo {\\n  display: grid;\\n  width: min(100%, 1040px);\\n  min-width: 0;\\n  gap: 18px;\\n  margin-inline: auto;\\n}\\n\\n.tidal-scope .blog-grid-demo-empty {\\n  display: grid;\\n  gap: 12px;\\n  justify-items: center;\\n}\\n\\n.tidal-scope .blog-grid-demo-empty strong {\\n  color: var(--t-ink);\\n}\\n\\n.tidal-scope .blog-grid-demo-empty button {\\n  display: inline-flex;\\n  min-width: 44px;\\n  min-height: 44px;\\n  align-items: center;\\n  justify-content: center;\\n  gap: 7px;\\n  padding: 8px 12px;\\n  color: var(--t-surface);\\n  background: var(--t-ink);\\n  border: 1px solid var(--t-ink);\\n  border-radius: var(--t-radius-control);\\n  font: inherit;\\n  font-size: 11px;\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .blog-grid-demo-detail {\\n  min-width: 0;\\n  padding: 22px;\\n  color: var(--t-surface);\\n  background: var(--t-ink);\\n  border-radius: var(--t-radius-card);\\n  scroll-margin-block: 18px;\\n}\\n\\n.tidal-scope .blog-grid-demo-detail:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .blog-grid-demo-detail > span {\\n  color: color-mix(in srgb, var(--t-surface) 68%, transparent);\\n  font-size: 11px;\\n  font-weight: 760;\\n  letter-spacing: 0.13em;\\n  text-transform: uppercase;\\n}\\n\\n.tidal-scope .blog-grid-demo-detail h3 {\\n  margin: 8px 0 0;\\n  overflow-wrap: anywhere;\\n  font-size: 24px;\\n  line-height: 1;\\n  letter-spacing: -0.04em;\\n}\\n\\n.tidal-scope .blog-grid-demo-detail p {\\n  max-width: 72ch;\\n  margin: 11px 0 0;\\n  color: color-mix(in srgb, var(--t-surface) 74%, transparent);\\n  font-size: 11px;\\n  line-height: 1.6;\\n  overflow-wrap: anywhere;\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .blog-grid-demo-empty button:active {\\n    transform: none;\\n  }\\n}\";\n\ntype CategoryId = \"all\" | \"design\" | \"engineering\" | \"workflow\";\n\ninterface SampleArticle extends Omit<TidalBlogArticle, \"href\"> {\n  categoryId: Exclude<CategoryId, \"all\">;\n  body: string;\n}\n\nconst ARTICLES: readonly SampleArticle[] = [\n  {\n    id: \"reviewing-motion\",\n    title: \"Reviewing motion without losing the interface\",\n    categoryId: \"design\",\n    category: \"Design\",\n    date: { label: \"Oct 14, 2026\", dateTime: \"2026-10-14\" },\n    excerpt:\n      \"A product note about checking continuity, focus, and reduced motion together.\",\n    featured: true,\n    cover: <CoverArt variant={0} />,\n    author: {\n      name: \"Ava Stone\",\n      role: \"Fictional editor\",\n      avatar: { src: tidalExampleAvatarDataUri(\"01\") },\n    },\n    meta: \"5 min read\",\n    body: \"Review motion alongside focus order and reduced-motion behavior so transitions support the interface instead of obscuring it.\",\n  },\n  {\n    id: \"native-controls\",\n    title: \"Why native controls still carry the hard parts\",\n    categoryId: \"engineering\",\n    category: \"Engineering\",\n    date: { label: \"Oct 11, 2026\", dateTime: \"2026-10-11\" },\n    excerpt:\n      \"A short note on forms, keyboard behavior, and application-owned state.\",\n    cover: <CoverArt variant={1} />,\n    author: {\n      name: \"Noah Park\",\n      role: \"Fictional engineer\",\n      avatar: { src: tidalExampleAvatarDataUri(\"02\") },\n    },\n    meta: \"4 min read\",\n    body: \"Native controls preserve familiar keyboard, form, and browser behavior while leaving application outcomes to the product.\",\n  },\n  {\n    id: \"small-screen\",\n    title: \"A small-screen review is a product review\",\n    categoryId: \"workflow\",\n    category: \"Workflow\",\n    date: { label: \"Oct 8, 2026\", dateTime: \"2026-10-08\" },\n    excerpt:\n      \"Field notes for evaluating real controls before decorative polish.\",\n    cover: <CoverArt variant={2} />,\n    author: {\n      name: \"Mila Santos\",\n      role: \"Fictional reviewer\",\n      avatar: { src: tidalExampleAvatarDataUri(\"03\") },\n    },\n    meta: \"3 min read\",\n    body: \"Small-screen review reveals crowded controls, unstable focus, and hidden overflow before decorative polish makes them harder to isolate.\",\n  },\n  {\n    id: \"honest-demos\",\n    title: \"Building demos that explain their boundary\",\n    categoryId: \"workflow\",\n    category: \"Workflow\",\n    date: { label: \"Oct 4, 2026\", dateTime: \"2026-10-04\" },\n    excerpt:\n      \"An editorial note about local state, clear labels, and explicit outcomes.\",\n    cover: <CoverArt variant={3} />,\n    author: {\n      name: \"Eli Brooks\",\n      role: \"Fictional writer\",\n      avatar: { src: tidalExampleAvatarDataUri(\"04\") },\n    },\n    meta: \"6 min read\",\n    body: \"A useful demo labels its boundary once, then lets real controls and visible local outcomes explain the interaction.\",\n  },\n  {\n    id: \"tokens\",\n    title: \"Keeping a neutral token system expressive\",\n    categoryId: \"design\",\n    category: \"Design\",\n    date: { label: \"Sep 29, 2026\", dateTime: \"2026-09-29\" },\n    excerpt:\n      \"A design note on rhythm, contrast, surfaces, and controlled variation.\",\n    cover: <CoverArt variant={4} />,\n    meta: \"4 min read\",\n    body: \"A neutral token system can stay expressive through spacing, hierarchy, contrast, and a small set of deliberate surface changes.\",\n  },\n];\n\nexport function BlogGridDemo() {\n  const generatedId = useId().replace(/:/g, \"\");\n  const [query, setQuery] = useState(\"\");\n  const [category, setCategory] = useState<CategoryId>(\"all\");\n  const [activeId, setActiveId] = useState<string | null>(null);\n  const searchRef = useRef<HTMLInputElement>(null);\n  const resetFocusPending = useRef(false);\n  const normalized = query.trim().toLocaleLowerCase();\n  const visible = useMemo(\n    () =>\n      ARTICLES.filter(\n        (article) =>\n          (category === \"all\" || article.categoryId === category) &&\n          (!normalized ||\n            `${article.title} ${article.categoryId} ${String(article.excerpt)}`\n              .toLocaleLowerCase()\n              .includes(normalized)),\n      ),\n    [category, normalized],\n  );\n  const counts = useMemo(\n    () =>\n      new Map(\n        ([\"all\", \"design\", \"engineering\", \"workflow\"] as CategoryId[]).map(\n          (id) => [\n            id,\n            ARTICLES.filter(\n              (article) =>\n                (id === \"all\" || article.categoryId === id) &&\n                (!normalized ||\n                  `${article.title} ${article.categoryId} ${String(article.excerpt)}`\n                    .toLocaleLowerCase()\n                    .includes(normalized)),\n            ).length,\n          ],\n        ),\n      ),\n    [normalized],\n  );\n  const active = ARTICLES.find((article) => article.id === activeId);\n  const detailId = `blog-demo-${generatedId}-detail`;\n\n  useLayoutEffect(() => {\n    if (!resetFocusPending.current) return;\n    resetFocusPending.current = false;\n    searchRef.current?.focus({ preventScroll: true });\n  }, [category, query]);\n\n  const renderedArticles: readonly TidalBlogArticle[] = visible.map(\n    (article) => ({\n      ...article,\n      href: `#${detailId}`,\n      linkProps: { onClick: () => setActiveId(article.id) },\n    }),\n  );\n\n  function reset() {\n    resetFocusPending.current = true;\n    setQuery(\"\");\n    setCategory(\"all\");\n    setActiveId(null);\n  }\n\n  return (\n    <section className=\"blog-grid-demo\" aria-label=\"Blog grid preview\">\n      <TidalBlogGrid\n        title=\"Product notes\"\n        eyebrow={null}\n        description=\"Search articles by title or topic.\"\n        articles={renderedArticles}\n        search={{\n          value: query,\n          label: \"Search sample articles\",\n          placeholder: \"Search title or topic\",\n          inputProps: { name: \"article-query\", autoComplete: \"off\" },\n          inputRef: searchRef,\n          onValueChange: setQuery,\n        }}\n        category={{\n          value: category,\n          label: \"Filter sample articles\",\n          options: [\n            { id: \"all\", label: \"All\", count: counts.get(\"all\") },\n            { id: \"design\", label: \"Design\", count: counts.get(\"design\") },\n            {\n              id: \"engineering\",\n              label: \"Engineering\",\n              count: counts.get(\"engineering\"),\n            },\n            {\n              id: \"workflow\",\n              label: \"Workflow\",\n              count: counts.get(\"workflow\"),\n            },\n          ],\n          onValueChange: (id) => setCategory(id as CategoryId),\n        }}\n        emptyMessage={\n          <div className=\"blog-grid-demo-empty\">\n            <strong>No local article matches</strong>\n            <button type=\"button\" onClick={reset}>\n              <RotateCcw size={14} aria-hidden=\"true\" /> Reset view\n            </button>\n          </div>\n        }\n        footer=\"Sample articles. Search and filters stay in this preview.\"\n      />\n\n      <div id={detailId}>\n        {active ? (\n          <article className=\"blog-grid-demo-detail\" tabIndex={-1}>\n            <span>Article detail</span>\n            <h3>{active.title}</h3>\n            <p>{active.body}</p>\n          </article>\n        ) : null}\n      </div>\n    </section>\n  );\n}\n\nfunction CoverArt({ variant }: { variant: number }) {\n  const offset = 22 + variant * 7;\n  return (\n    <svg viewBox=\"0 0 240 160\" role=\"presentation\">\n      <rect\n        x=\"28\"\n        y=\"25\"\n        width=\"184\"\n        height=\"110\"\n        rx=\"16\"\n        fill=\"var(--t-surface)\"\n        stroke=\"currentColor\"\n      />\n      <path\n        d={`M48 ${108 - variant * 3} C82 ${offset}, 126 ${132 - offset}, 191 ${47 + variant * 4}`}\n        fill=\"none\"\n        stroke=\"currentColor\"\n        strokeWidth=\"5\"\n      />\n      <circle\n        cx={58 + variant * 15}\n        cy={49 + variant * 5}\n        r=\"10\"\n        fill=\"currentColor\"\n      />\n      <path\n        d=\"M48 118H192\"\n        stroke=\"currentColor\"\n        strokeWidth=\"2\"\n        strokeDasharray=\"4 7\"\n      />\n    </svg>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <BlogGridDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/blog-grid.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."
    }
  ],
  "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": []
}
