{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cta-audiences",
  "type": "registry:block",
  "title": "Call to action, by audience",
  "description": "Two or three side-by-side cards, one per kind of visitor (for guests, for owners, for agencies), each with its own short pitch, up to three points and its own action. The first card is filled. For a site with more than one front door.",
  "categories": [
    "cta"
  ],
  "dependencies": [
    "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",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/cta-audiences/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/cta-audiences/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, icon, link, req, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: req(120),\n  description: t(300),\n  // align: 'start' sets the heading block flush left instead of centred (a kept look with a left heading over the cards).\n  align: z.enum(['center', 'start']).optional(),\n  // highlightFirst: false draws all cards alike, with no filled first card; absent or true keeps the filled first card.\n  highlightFirst: z.boolean().optional(),\n  // layout: 'joined' draws no section header (the title stays as the section's screen-reader name) and joins the two or three audiences into one bordered panel,\n  // side by side with rules between them, each with its icon, small heading, sentence and its own action (a primary, a secondary, then a plain text link).\n  // 'halves' draws the audiences as flush, screen-high columns side by side with a hairline between: no section header (the title stays as the section's screen-reader name), no card box; the first column on the surface, the others on the tinted ground, each with its small heading, sentence and its own action, centred in the column's height.\n  layout: z.enum(['cards', 'joined', 'halves']).optional(),\n  audiences: z.array(z.object({ name: req(40), description: t(160), points: z.array(t(80)).max(3), cta: link, icon: icon.optional() })).min(2).max(3),\n});\n\nexport const spec = defineSpec({\n  type: 'cta-audiences',\n  aliases: ['cta/audiences'],\n  sourceRuns: ['rmwj0tv5g13ae0b', 'rmwj04ao6acc085', 'rmwj10r4016b78d'],\n  name: 'Call to action, by audience',\n  category: 'cta',\n  role: 'body',\n  description: 'Two or three side-by-side cards, one per kind of visitor (for guests, for owners, for agencies), each with its own short pitch, up to three points and its own action. The first card is filled. For a site with more than one front door.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    title: 'Say how the choices differ, in one line',\n    description: 'Say in a sentence how to choose between them.',\n    audiences: [\n      { name: 'Name an audience', description: 'Say in one line what this audience gets and how soon.', points: ['Name a first benefit', 'Name a second benefit, in a few words'], cta: { label: 'Main action', href: '#start' } },\n      { name: 'Name an audience', description: 'Say in one line what this audience gets and how soon.', points: ['Name a first benefit', 'Name a second benefit, in a few words'], cta: { label: 'Main action', href: '#rooms' } },\n      { name: 'Name an audience', description: 'Say in one line what this audience gets and how soon.', points: ['Name a first benefit', 'Name a second benefit'], cta: { label: 'Main action', href: '#docs' } },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/cta-audiences/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/cta-audiences/index.tsx",
      "content": "import { Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Eyebrow, Icon, Opt, Section } from '../_shared/kit';\nimport { CheckItem, useHeadingId } from '../_shared/c-proof-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\nconst COLS = { 2: '@3xl:grid-cols-2', 3: '@3xl:grid-cols-3' } as const;\n\nfunction CtaAudiences({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const start = props.align === 'start';\n  const first = props.highlightFirst !== false;\n  const n = Math.min(3, Math.max(2, props.audiences.length)) as 2 | 3;\n  if (props.layout === 'halves') {\n    return (\n      <Section labelledBy={id} bare className=\"py-0\">\n        <div id={id} className=\"sr-only\">\n          <Text path={['title']} value={props.title} as=\"h2\" />\n        </div>\n        <ul className={cn('grid grid-cols-1 @3xl:divide-x @3xl:divide-kh-line', COLS[n])}>\n          {props.audiences.map((a, i) => (\n            <li key={i} className={cn('flex flex-col items-start justify-center gap-5 px-kh-gutter py-kh-section @3xl:min-h-svh', i === 0 ? 'bg-kh-surface' : 'bg-kh-accent-soft')}>\n              {a.icon && (\n                <span className=\"inline-flex size-11 items-center justify-center rounded-kh bg-kh-canvas text-kh-accent-ink\">\n                  <Icon name={a.icon} />\n                </span>\n              )}\n              <Text path={['audiences', i, 'name']} value={a.name} as=\"h3\" className=\"text-kh-heading text-kh-ink\" />\n              <Opt path={['audiences', i, 'description']} value={a.description} multiline className=\"max-w-kh-lead text-kh-body text-kh-ink-2\" placeholder=\"Description\" />\n              <ActionLink path={['audiences', i, 'cta']} value={a.cta} variant={i === 0 ? 'primary' : 'secondary'} size=\"md\" />\n            </li>\n          ))}\n        </ul>\n      </Section>\n    );\n  }\n  if (props.layout === 'joined') {\n    return (\n      <Section labelledBy={id}>\n        <Container>\n          <div id={id} className=\"sr-only\">\n            <Text path={['title']} value={props.title} as=\"h2\" />\n          </div>\n          <ul className={cn('grid grid-cols-1 gap-6 overflow-hidden rounded-kh-xl border border-kh-line bg-kh-surface shadow-kh-1 @3xl:gap-0 @3xl:divide-x @3xl:divide-kh-line', COLS[n])}>\n            {props.audiences.map((a, i) => (\n              <li key={i} className=\"flex flex-col items-start gap-5 p-8 @5xl:p-10\">\n                {a.icon && (\n                  <span className=\"inline-flex size-11 items-center justify-center rounded-kh bg-kh-accent-soft text-kh-accent-ink\">\n                    <Icon name={a.icon} />\n                  </span>\n                )}\n                <Text path={['audiences', i, 'name']} value={a.name} as=\"h3\" className=\"text-kh-heading text-kh-ink\" />\n                <Opt path={['audiences', i, 'description']} value={a.description} multiline className=\"text-kh-body text-kh-ink-2\" placeholder=\"Description\" />\n                <div className=\"mt-auto\">\n                  <ActionLink path={['audiences', i, 'cta']} value={a.cta} variant={i === 0 ? 'primary' : i === 1 ? 'secondary' : 'ghost'} size=\"md\" />\n                </div>\n              </li>\n            ))}\n          </ul>\n        </Container>\n      </Section>\n    );\n  }\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <div className={cn(start ? 'max-w-kh-narrow' : 'mx-auto max-w-kh-narrow text-center')}>\n          <Eyebrow path={['eyebrow']} value={props.eyebrow} />\n          <div id={id}>\n            <Text path={['title']} value={props.title} as=\"h2\" className=\"text-kh-title font-semibold\" />\n          </div>\n          <Opt path={['description']} value={props.description} className={start ? 'mt-4 max-w-kh-lead text-kh-lead text-kh-muted' : 'mx-auto mt-4 max-w-kh-lead text-kh-lead text-kh-muted'} placeholder=\"Description\" />\n        </div>\n        <ul className={cn('mt-14 grid gap-5', COLS[n])}>\n          {props.audiences.map((a, i) => (\n            <li key={i} className={cn('flex flex-col rounded-kh-xl border p-8', i === 0 && first ? 'border-kh-accent bg-kh-accent-soft' : 'border-kh-line bg-kh-surface')}>\n              <Text path={['audiences', i, 'name']} value={a.name} as=\"h3\" className=\"text-kh-heading font-semibold\" />\n              <Opt path={['audiences', i, 'description']} value={a.description} multiline className=\"mt-3 text-kh-body text-kh-muted\" placeholder=\"Description\" />\n              {a.points.length > 0 && (\n                <ul className=\"mt-6 space-y-2\">\n                  {a.points.map((p, j) => <CheckItem key={j} path={['audiences', i, 'points', j]} value={p} />)}\n                </ul>\n              )}\n              <div className=\"mt-auto pt-8\">\n                <ActionLink path={['audiences', i, 'cta']} value={a.cta} variant={i === 0 ? 'primary' : 'secondary'} size=\"md\" />\n              </div>\n            </li>\n          ))}\n        </ul>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(CtaAudiences);\n"
    }
  ]
}
