{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-header-row",
  "type": "registry:block",
  "title": "Hero, header row",
  "description": "A heading and a short lead on the left with the actions on the same row at the right, and a wide picture below, with an optional caption. On a phone the actions stack under the lead, full width, and the picture follows.",
  "categories": [
    "hero"
  ],
  "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/text-link.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-header-row/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-header-row/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  /** A small uppercase label above the heading; leave empty for none. */\n  eyebrow: t(40),\n  title: t(100),\n  /** The heading's size: heading for a small ordinary one, title for a modest heading, display for a large page-opening one. */\n  headingSize: z.enum(['heading', 'title', 'display']).default('title'),\n  description: t(200),\n  primary: link.partial().optional(),\n  secondary: link.partial().optional(),\n  media,\n  /** A line under the picture; leave empty for none. */\n  caption: t(120),\n  /** The picture's shape on a wide screen: wide is 21 by 9 (4 by 3 on a phone), cinema is 16 by 7 at every width. */\n  pictureShape: z.enum(['wide', 'cinema']).default('wide'),\n  /** Up to three plain lines under the lead (an email, a phone number, an address); an email or phone number is linked. Leave out for none. */\n  details: z.array(t(80)).max(3).optional(),\n  /** Draw the picture above the heading row instead of below it (mirrored), with the heading and actions centred on their row. */\n  pictureFirst: z.boolean().optional(),\n  /** Up to three figures in a card laid over the foot of the picture ('120+' 'rooms'). Leave out for none. */\n  stats: z.array(z.object({ value: t(20), label: t(60) })).max(3).optional(),\n  /** Stack the heading and the actions in one left column (actions under the heading) instead of a row with the actions at the right; the picture is 16 by 9 and any figures run as a bar across its foot rather than a card. */\n  stacked: z.boolean().optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'hero-header-row',\n  aliases: ['hero/header-row'],\n  sourceRuns: ['rmwj00rsudc3ef3', 'rmwj0ofbc52ab2c', 'rmwj0rdgceacb10', 'rmwj0xjdlf49440', 'rmwj0tua38b825b', 'rmwj0tuqf30d4c2', 'rmwj0v4ive9fd33', 'rmwj0w0id4ea755', 'rmwj0w0hnc20c2b'],\n  name: 'Hero, header row',\n  category: 'hero',\n  role: 'body',\n  description: 'A heading and a short lead on the left with the actions on the same row at the right, and a wide picture below, with an optional caption. On a phone the actions stack under the lead, full width, and the picture follows.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the topic in two words',\n    title: 'Say in one line what this page is about',\n    headingSize: 'title',\n    description: 'Write one or two short lines on what the reader gets here and who it is for.',\n    primary: { label: 'Main action', href: '#start' },\n    secondary: { label: 'Second action', href: '#more' },\n    media: { src: '', alt: 'Show the main subject at work' },\n    caption: '',\n    pictureShape: 'wide',\n  },\n});\n"
    },
    {
      "path": "src/blocks/hero-header-row/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-header-row/index.tsx",
      "content": "import { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Gate, Opt, Section } from '../_shared/kit';\nimport { linkClass } from '../../ui/text-link';\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\nconst hrefOf = (line: string) => {\n  if (/^[\\w.+-]+@[\\w-]+(?:\\.[\\w-]+)+$/.test(line.trim())) return `mailto:${line.trim()}`;\n  if (/^\\+?\\d[\\d ()-]{6,}\\d$/.test(line.trim())) return `tel:${line.trim().replace(/[^+\\d]/g, '')}`;\n  return undefined;\n};\n\nfunction HeroHeaderRow({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const display = props.headingSize === 'display';\n  const ratio = props.pictureShape === 'cinema' ? 'aspect-[16/7]' : props.stacked ? 'aspect-[4/3] @md:aspect-[16/9]' : 'aspect-[4/3] @md:aspect-[16/9] @4xl:aspect-[21/9]';\n  const [first, ...later] = ratio.split(' ');\n  const size = props.headingSize === 'heading' ? 'text-kh-heading' : display ? 'text-kh-display' : 'text-kh-title';\n  return (\n    <Section labelledBy={id}>\n      <Container className=\"flex flex-col gap-10 @4xl:gap-14\">\n        <div className={props.stacked ? 'flex flex-col gap-8' : `flex flex-col gap-8 @4xl:flex-row ${props.pictureFirst ? 'order-2 @4xl:items-center' : '@4xl:items-end'} @4xl:justify-between @4xl:gap-16`}>\n          <div className=\"flex max-w-kh-narrow flex-col gap-4\">\n            <Opt path={['eyebrow']} value={props.eyebrow} as=\"p\" className=\"font-kh-mono text-kh-caption uppercase tracking-widest text-kh-accent-ink\" />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h2\" className={`font-kh-display ${size} text-kh-ink`} />\n            </div>\n            <Text path={['description']} value={props.description} as=\"p\" multiline className=\"text-kh-lead text-kh-muted\" />\n            {props.details && props.details.length > 0 && (\n              <div className=\"flex flex-col gap-1 text-kh-small text-kh-ink-2\">\n                {props.details.map((line, i) => {\n                  const href = hrefOf(line);\n                  return (\n                    <Gate key={i} label={line}>\n                      {href ? <a href={href} className={`${linkClass()} w-fit`}><Text path={['details', i]} value={line} as=\"span\" /></a> : <Text path={['details', i]} value={line} as=\"span\" />}\n                    </Gate>\n                  );\n                })}\n              </div>\n            )}\n          </div>\n          <Gate label={props.primary?.label || props.secondary?.label}>\n          <div className={props.stacked ? 'flex flex-col gap-3 @md:flex-row @md:flex-wrap' : 'flex flex-col gap-3 @md:flex-row @md:flex-wrap @4xl:shrink-0 @4xl:justify-end'}>\n            <ActionLink path={['primary']} value={props.primary} size=\"md\" />\n            {props.secondary && <ActionLink path={['secondary']} value={props.secondary} variant=\"secondary\" size=\"md\" />}\n          </div>\n          </Gate>\n        </div>\n        <figure className=\"flex flex-col gap-3\">\n          <div className=\"relative\">\n            <div className={`${first} w-full overflow-hidden rounded-kh-xl shadow-kh-2 ${later.join(' ')}`.trim()}>\n              <Media path={['media']} value={props.media} className=\"h-full w-full\" />\n            </div>\n            {props.stats && props.stats.length > 0 && (\n              <dl className={`absolute grid gap-3 bg-kh-surface/90 @md:gap-6 ${props.stacked ? 'inset-x-0 bottom-0 rounded-b-kh-lg p-3 @md:p-6' : 'inset-x-3 bottom-3 rounded-kh-lg border border-kh-line p-3 @md:p-6 @4xl:inset-x-6 @4xl:bottom-6 @4xl:p-8'} ${props.stacked ? '@md:grid-cols-3 grid-cols-1' : props.stats.length < 3 ? 'grid-cols-2' : 'grid-cols-3'}`}>\n                {props.stats.map((st, i) => (\n                  <div key={i} className=\"flex flex-col gap-1\">\n                    <Text path={['stats', i, 'value']} value={st.value} as=\"dd\" className={props.stacked ? 'text-kh-heading' : 'text-kh-title font-semibold'} />\n                    <Text path={['stats', i, 'label']} value={st.label} as=\"dt\" className={props.stacked ? 'order-last text-kh-small text-kh-muted' : 'order-first text-kh-small text-kh-muted'} />\n                  </div>\n                ))}\n              </dl>\n            )}\n          </div>\n          <Opt path={['caption']} value={props.caption} as=\"figcaption\" className=\"text-kh-caption text-kh-muted\" />\n        </figure>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroHeaderRow);\n"
    }
  ]
}
