{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-accordion-rows",
  "type": "registry:block",
  "title": "Contact, accordion rows",
  "description": "A label, heading and lead beside a picture, then ways to get in touch stacked beneath as rows that open on a tap, each showing a line, a detail and one action. The first row starts open. On a phone the heading sits above the picture and each row stacks its action under its text.",
  "categories": [
    "contact"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/kit-c-proof.json"
  ],
  "files": [
    {
      "path": "src/blocks/contact-accordion-rows/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-accordion-rows/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, req, t } from '../_shared/schema';\n\nconst row = z.object({\n  title: req(60),\n  description: t(160),\n  /** The address, number or place the row gives, set in the second line. */\n  detail: t(80),\n  action: link,\n  /** How the action is drawn: a filled button, an outlined button or a plain underlined link. */\n  actionStyle: z.enum(['primary', 'secondary', 'link']).optional(),\n  /** Whether the row starts open. */\n  open: z.boolean(),\n});\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: req(120),\n  description: t(240),\n  media,\n  /** A list is an array field, never a slot. */\n  rows: z.array(row).min(1).max(6),\n});\n\nexport const spec = defineSpec({\n  type: 'contact-accordion-rows',\n  aliases: ['contact/accordion-rows'],\n  sourceRuns: ['rmwj0vg7l0f8f0a'],\n  name: 'Contact, accordion rows',\n  category: 'contact',\n  role: 'body',\n  description: 'A label, heading and lead beside a picture, then ways to get in touch stacked beneath as rows that open on a tap, each showing a line, a detail and one action. The first row starts open. On a phone the heading sits above the picture and each row stacks its action under its text.',\n  schema,\n  defaults: {\n    eyebrow: 'Section name',\n    title: 'Say how a visitor can reach you',\n    description: 'Say in one or two sentences what the visitor gets by getting in touch.',\n    media: { src: '', alt: 'Show the place or the team' },\n    rows: [\n      { title: 'Name the first way to reach you', description: 'Say in one line when to use it.', detail: 'Give the address or number', action: { label: 'Main action', href: '#first' }, actionStyle: 'primary', open: true },\n      { title: 'Name the second way to reach you', description: 'Say in one line when to use it.', detail: 'Give the address or number', action: { label: 'Second action', href: '#second' }, actionStyle: 'secondary', open: false },\n      { title: 'Name the third way to reach you', description: 'Say in one line when to use it.', detail: 'Give the address or place', action: { label: 'Third action', href: '#third' }, actionStyle: 'link', open: false },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/contact-accordion-rows/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-accordion-rows/index.tsx",
      "content": "import { ChevronDown } from 'lucide-react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Opt, Section } from '../_shared/kit';\nimport { useHeadingId } from '../_shared/c-proof-kit';\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\n// The heading and picture in two columns, then rows that open natively (details), each with a line, a detail and one action; on a phone everything stacks.\nfunction ContactAccordionRows({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  return (\n    <Section labelledBy={id}>\n      <div className=\"px-kh-gutter\">\n        <div className=\"mx-auto max-w-kh-page\">\n          <div className=\"grid items-center gap-10 @3xl:grid-cols-[1.1fr_1fr] @3xl:gap-16\">\n            <div>\n              <Opt path={['eyebrow']} value={props.eyebrow} className=\"font-kh-mono text-kh-caption uppercase tracking-wider text-kh-accent-ink\" placeholder=\"Eyebrow\" />\n              <div id={id}>\n                <Text path={['title']} value={props.title} as=\"h2\" className=\"mt-4 font-kh-display text-kh-title text-kh-ink\" />\n              </div>\n              <Opt path={['description']} value={props.description} multiline className=\"mt-6 max-w-kh-narrow text-kh-lead text-kh-ink-2\" placeholder=\"Description\" />\n            </div>\n            <Media path={['media']} value={props.media} ratio=\"4 / 3\" className=\"w-full rounded-kh-lg shadow-kh-2\" />\n          </div>\n          <div className=\"mt-14 divide-y divide-kh-line border-y border-kh-line\">\n            {props.rows.map((r, i) => (\n              <details key={i} className=\"group py-6\" open={r.open}>\n                <summary className=\"flex cursor-pointer list-none items-center justify-between gap-6 rounded-kh-sm focus-visible:ring-2 focus-visible:ring-kh-accent [&::-webkit-details-marker]:hidden\">\n                  <Text path={['rows', i, 'title']} value={r.title} as=\"h3\" className=\"font-kh-display text-kh-heading text-kh-ink\" />\n                  <ChevronDown className=\"size-5 shrink-0 text-kh-muted transition-transform duration-200 group-open:rotate-180\" aria-hidden=\"true\" />\n                </summary>\n                <div className=\"mt-5 grid gap-6 @2xl:grid-cols-[1fr_auto] @2xl:items-end\">\n                  <div>\n                    <Opt path={['rows', i, 'description']} value={r.description} className=\"text-kh-body text-kh-muted\" placeholder=\"Description\" />\n                    <Opt path={['rows', i, 'detail']} value={r.detail} className=\"mt-3 font-kh-mono text-kh-small text-kh-ink-2\" placeholder=\"Detail\" />\n                  </div>\n                  <ActionLink\n                    path={['rows', i, 'action']}\n                    value={r.action}\n                    variant={r.actionStyle === 'link' ? 'ghost' : r.actionStyle}\n                    size=\"md\"\n                    className={r.actionStyle === 'link' ? 'text-kh-small font-medium text-kh-accent-ink underline underline-offset-4' : 'rounded-kh-pill'}\n                  />\n                </div>\n              </details>\n            ))}\n          </div>\n        </div>\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(ContactAccordionRows);\n"
    }
  ]
}
