{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "faq-support",
  "type": "registry:block",
  "title": "FAQ, with a support card",
  "description": "An accordion of questions beside a raised \"still stuck?\" card with up to three ways to reach a person and one action. For products where the real answer is often a conversation.",
  "categories": [
    "faq"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/button.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/kit-c-proof.json",
    "https://ui.klarhimmel.com/r/kit-e-faq.json",
    "https://ui.klarhimmel.com/r/text-link.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/faq-support/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/faq-support/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, req, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: req(120),\n  description: t(300),\n  items: z.array(z.object({ question: req(160), answer: t(600) })).min(2).max(8),\n  support: z.object({\n    title: req(60),\n    text: t(200),\n    channels: z.array(z.object({ label: req(30), value: t(80), href: t(300) })).max(3),\n    cta: link,\n  }),\n});\n\nexport const spec = defineSpec({\n  type: 'faq-support',\n  aliases: ['faq/support'],\n  name: 'FAQ, with a support card',\n  category: 'faq',\n  role: 'body',\n  description: 'An accordion of questions beside a raised \"still stuck?\" card with up to three ways to reach a person and one action. For products where the real answer is often a conversation.',\n  schema,\n  defaults: {\n    eyebrow: 'Section name',\n    title: 'Say what the answers cover',\n    description: '',\n    items: [\n      { question: 'Ask a question customers have', answer: 'Answer in one or two plain sentences, with the key fact first, then what to do or where to go next.' },\n      { question: 'Ask a question customers have', answer: 'Answer in one or two plain sentences, with the key fact first, then what to do or where to go next.' },\n      { question: 'Ask a question customers have', answer: 'Answer in one or two plain sentences, with the key fact first, then what to do or where to go next.' },\n      { question: 'Ask a question customers have', answer: 'Answer in one or two plain sentences, with the key fact first, then what to do or where to go next.' },\n    ],\n    support: {\n      title: 'Say who can help',\n      text: 'Say who answers and how soon they reply.',\n      channels: [\n        { label: 'Channel', value: 'When it is open', href: '#chat' },\n        { label: 'Channel', value: 'Their email address', href: 'mailto:help@example.com' },\n        { label: 'Channel', value: 'Their phone number', href: 'tel:+46310000000' },\n      ],\n      cta: { label: 'Link to more help', href: '#help' },\n    },\n  },\n});\n"
    },
    {
      "path": "src/blocks/faq-support/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/faq-support/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { linkClass } from '../../ui/text-link';\nimport { ActionLink, Container, Opt, Section, useEditing } from '../_shared/kit';\nimport { Heading, useHeadingId } from '../_shared/c-proof-kit';\nimport { Accordion } from '../_shared/e-faq-kit';\nimport { cn } from '../../lib/utils';\nimport { spec } from './spec';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\n\nexport { spec };\ntype Props = z.infer<typeof spec.schema>;\n\nfunction FaqSupport({ props }: BlockProps<Props>) {\n  const group = useId(); // one open answer at a time\n  const id = useHeadingId(props.title);\n  const editing = useEditing();\n  const s = props.support;\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <Heading id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n        <div className=\"mt-12 grid gap-10 @4xl:grid-cols-[1.7fr_1fr] @4xl:gap-16\">\n          <div className=\"divide-y divide-kh-line border-y border-kh-line\">\n            {props.items.map((item, i) => <Accordion key={i} name={group} base={['items', i]} question={item.question} answer={item.answer} />)}\n          </div>\n          <aside className=\"self-start rounded-kh-xl border border-kh-line bg-kh-surface p-7 shadow-kh-2 @4xl:sticky @4xl:top-8\">\n            <Text path={['support', 'title']} value={s.title} as=\"h3\" className=\"text-kh-heading font-semibold\" />\n            <Opt path={['support', 'text']} value={s.text} className=\"mt-2 text-kh-small text-kh-muted\" placeholder=\"Text\" />\n            {s.channels.length > 0 && (\n              <dl className=\"mt-6 space-y-4\">\n                {s.channels.map((c, i) => (\n                  <div key={i}>\n                    <dt className=\"text-kh-caption font-medium uppercase tracking-wide text-kh-muted\">\n                      <Text path={['support', 'channels', i, 'label']} value={c.label} as=\"span\" />\n                    </dt>\n                    <dd className=\"mt-0.5 text-kh-small\">\n                      {c.href && (c.value || editing) ? (\n                        <a href={safeHref(c.href)} className={cn(linkClass(), 'inline-flex min-h-6 items-center')}>\n                          <Text path={['support', 'channels', i, 'value']} value={c.value} as=\"span\" placeholder=\"Value\" />\n                        </a>\n                      ) : (\n                        <Text path={['support', 'channels', i, 'value']} value={c.value} as=\"span\" />\n                      )}\n                    </dd>\n                  </div>\n                ))}\n              </dl>\n            )}\n            <div className=\"mt-7\">\n              <ActionLink path={['support', 'cta']} value={s.cta} variant=\"secondary\" size=\"md\" />\n            </div>\n          </aside>\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(FaqSupport);\n"
    }
  ]
}
