{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "astro-faq",
  "title": "FAQ Block (Astro)",
  "description": "Accordion of question/answer pairs.",
  "dependencies": [
    "@contentbit/core",
    "@contentbit/blocks",
    "@contentbit/astro"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/astro/faq.astro",
      "content": "---\nimport type { FaqData, FaqItemData } from '@contentbit/blocks'\nimport type { ValidatedBlockNode } from '@contentbit/core'\nimport type { AstroBlockContext } from '@contentbit/astro'\n\nimport { isValidatedBlock } from '@contentbit/core'\n\ninterface Props {\n  node: ValidatedBlockNode<unknown>\n  ctx: AstroBlockContext\n}\n\nconst { node, ctx } = Astro.props\nconst data = node.data as FaqData\nconst items = await Promise.all(\n  data.blocks.map(async (item) => ({\n    question: String(item.props.question),\n    html: await ctx.renderMarkdown(isValidatedBlock(item) ? (item.data as FaqItemData).markdown : item.body),\n  })),\n)\n\n// Inline lucide path: chevron-down.\nconst CHEVRON = '<path d=\"m6 9 6 6 6-6\"/>'\n\n// Native <details> means items open independently (the React pack's accordion\n// is single-open). Add name=\"faq\" to the <details> elements for exclusivity.\n---\n\n<div data-cb-styled class=\"bg-card my-6 rounded-lg border px-4\">\n  {\n    items.map((item, i) => (\n      <details class:list={['group', i < items.length - 1 && 'border-b']}>\n        <summary class=\"flex cursor-pointer list-none items-center justify-between gap-4 py-4 text-left text-sm font-medium [&::-webkit-details-marker]:hidden\">\n          {item.question}\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-width=\"2\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            class=\"text-muted-foreground size-4 shrink-0 transition-transform group-open:rotate-180\"\n            aria-hidden=\"true\"\n            set:html={CHEVRON}\n          />\n        </summary>\n        <div class=\"text-muted-foreground pb-4 text-sm leading-relaxed\" set:html={item.html} />\n      </details>\n    ))\n  }\n</div>\n",
      "type": "registry:component",
      "target": "components/content-blocks/faq.astro"
    }
  ],
  "type": "registry:component"
}