{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-card-cover",
  "type": "registry:block",
  "title": "Hero, card cover",
  "description": "A full-width picture with one centred card over it holding a small label, the heading, one line and two actions. The card keeps its width on a phone and the actions stack.",
  "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-card-cover/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-card-cover/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  /** A picture behind the card, as wide as the band. */\n  media,\n  eyebrow: t(40),\n  title: t(80),\n  description: t(200),\n  primary: link.partial().optional(),\n  secondary: link.partial().optional(),\n  /** The band fills the screen's height when set; otherwise it is as tall as the card plus its padding. */\n  fullHeight: z.boolean(),\n  /** 'center' sets the card's text in the middle; 'start' sets it at the start. */\n  align: z.enum(['start', 'center']),\n  /** 'center' (default) puts the card in the middle of the band; 'start' anchors it at the left edge of the page column, still centred vertically. */\n  cardAt: z.enum(['center', 'start']).optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'hero-card-cover',\n  aliases: ['hero/card-cover'],\n  sourceRuns: ['rmwj1rem1791e17', 'rmwj03p9rbe43f0', 'rmwjf5cqn5b0166'],\n  name: 'Hero, card cover',\n  category: 'hero',\n  role: 'body',\n  description: 'A full-width picture with one centred card over it holding a small label, the heading, one line and two actions. The card keeps its width on a phone and the actions stack.',\n  schema,\n  defaults: {\n    media: { src: '', alt: 'Show the main subject of the page' },\n    eyebrow: 'Name the topic in two or three words',\n    title: 'Say what this page offers, in plain words',\n    description: 'Give the reader a short reason to keep going: who it is for and what they get.',\n    primary: { label: 'Name the main action', href: '#primary' },\n    secondary: { label: 'Name the other action', href: '#secondary' },\n    fullHeight: true,\n    align: 'start',\n    cardAt: 'center',\n  },\n});\n"
    },
    {
      "path": "src/blocks/hero-card-cover/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-card-cover/index.tsx",
      "content": "import { useContext } from 'react';\nimport { HeadingLevelContext, Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Opt, Section, Gate } from '../_shared/kit';\nimport { 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\nfunction HeroCardCover({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const H = `h${useContext(HeadingLevelContext)?.level ?? '1'}` as 'h1' | 'h2';\n  const center = props.align === 'center';\n  const card_ = (\n        <div className={cn('relative z-10 flex w-full min-w-0 max-w-kh-narrow flex-col gap-6 rounded-kh-xl border border-kh-line bg-kh-surface/90 p-6 shadow-kh-2 @md:p-10', center && 'text-center')}>\n            <Opt path={['eyebrow']} value={props.eyebrow} as=\"p\" className=\"font-kh-mono text-kh-caption uppercase tracking-wide text-kh-accent-ink\" placeholder=\"Eyebrow\" />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as={H} className=\"font-kh-display text-kh-display text-balance text-kh-ink\" />\n            </div>\n            <Text path={['description']} value={props.description} as=\"p\" multiline className=\"text-kh-lead text-kh-muted\" />\n            <Gate label={props.primary?.label || props.secondary?.label}>\n            <div className={cn('flex flex-wrap gap-3', center && 'justify-center')}>\n              <ActionLink path={['primary']} value={props.primary} />\n              {props.secondary && <ActionLink path={['secondary']} value={props.secondary} variant=\"secondary\" />}\n            </div>\n            </Gate>\n          </div>\n  );\n  return (\n    <Section labelledBy={id} className=\"p-0\">\n      <div className={cn('relative isolate flex items-center justify-center overflow-hidden bg-kh-canvas px-kh-gutter py-kh-section', props.fullHeight && 'min-h-svh')}>\n        <Media path={['media']} value={props.media} ratio=\"16/9\" priority className=\"absolute inset-0 -z-10 h-full rounded-none\" />\n        {props.cardAt === 'start' ? <div className=\"relative z-10 mx-auto flex w-full max-w-kh-page\">{card_}</div> : card_}\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroCardCover);\n"
    }
  ]
}
