{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-media-foot",
  "type": "registry:block",
  "title": "Hero, picture over a foot row",
  "description": "A large picture across the top, then a foot row with a label, a heading and a short line on one side and the actions on the other. On a phone the foot stacks under the picture, text first and actions last.",
  "categories": [
    "hero"
  ],
  "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-media-foot/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-media-foot/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  /** How the picture sits above the text: wide is a 21 to 9 band, tall a 16 to 10 picture, screen a tall picture that fills most of the screen, half a section about two screens high with the picture on the top half and the foot centred on the bottom half. */\n  look: z.enum(['wide', 'tall', 'screen', 'half']),\n  /** Where the actions go in the foot: beside the text on a wide screen (split), or under it (stacked). */\n  foot: z.enum(['split', 'stacked']),\n  media,\n  /** Where the foot's text and actions sit when stacked: start (left under the picture) or center (a centred heading with the actions under it). Unset keeps start. */\n  align: z.enum(['start', 'center']).optional(),\n  /** The whole block in the narrow reading width, with the heading at the title size, for a picture over one short column of text. Unset keeps the page width. */\n  narrow: z.boolean().optional(),\n  /** A longer paragraph under the lead; leave empty for none. */\n  body: t(300).optional(),\n  /** A short label above the heading; leave empty for none. */\n  eyebrow: t(40).optional(),\n  /** The block fills the screen's height. With look screen the picture takes all the room above the foot; with another look the picture and foot sit together in the middle of the screen. Unset keeps the content's own height. */\n  fullHeight: z.boolean().optional(),\n  /** The heading's scale: 'title' (the section heading size) or 'display' (the large headline). Unset keeps the small heading (the title size when narrow). */\n  titleSize: z.enum(['title', 'display']).optional(),\n  /** Up to six plain links (a menu of where to go) drawn as a ruled list in the foot, above the actions; the foot becomes two columns, the text and then the list with the actions. None by default. */\n  links: z.array(link.partial()).max(6).optional(),\n  title: t(80),\n  description: t(200).optional(),\n  primary: link.partial().optional(),\n  secondary: link.partial().optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'hero-media-foot',\n  aliases: ['hero/media-foot'],\n  sourceRuns: ['rmwj1rem3ebe57b', 'rmwj04cau86de30', 'rmwj1v8gn0436cb', 'rmwj1v8gqfce7c8', 'rmwj0z52cf4c0ef', 'rmwj0xsm6075e21', 'rmwj0yvl2be9d3f', 'rmwj0xjcp6ededf', 'rmwj0w0hr1d63f3', 'rmwjf5i5jb8f3c2', 'rmwjf55scbb5af8', 'rmwj1cfr2e89f73', 'rmwj11wwz56c583', 'rmwj11wxg3e9b05'],\n  name: 'Hero, picture over a foot row',\n  category: 'hero',\n  role: 'body',\n  description: 'A large picture across the top, then a foot row with a label, a heading and a short line on one side and the actions on the other. On a phone the foot stacks under the picture, text first and actions last.',\n  schema,\n  defaults: {\n    look: 'wide',\n    foot: 'split',\n    media: { src: '', alt: 'Show the main subject of the page' },\n    eyebrow: 'Name the topic in a few words',\n    title: 'Say in one line what the visitor gets',\n    description: 'Say what the page offers and who it suits, in two short lines.',\n    primary: { label: 'Main action', href: '#start' },\n    secondary: { label: 'Second action', href: '#more' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/hero-media-foot/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-media-foot/index.tsx",
      "content": "import { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Eyebrow, Opt, Section, Gate } from '../_shared/kit';\nimport { safeHref } from '../../ui/button';\nimport { useHeadingId } from '../_shared/c-proof-kit';\nimport { spec } from './spec';\nimport { cn } from '../../lib/utils';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\n\nexport { spec };\ntype Props = z.infer<typeof spec.schema>;\n\nconst PICTURE = {\n  wide: { ratio: '21 / 9', box: 'rounded-kh-xl shadow-kh-2' },\n  tall: { ratio: '16 / 10', box: 'rounded-kh-lg shadow-kh-2' },\n  screen: { ratio: '4 / 3', box: 'min-h-[34rem] @4xl:min-h-[44rem]' },\n  half: { ratio: '16 / 9', box: 'absolute inset-0 h-full rounded-none' },\n} as const;\n\nfunction HeroMediaFoot({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const pic = PICTURE[props.look] ?? PICTURE.wide;\n  const split = props.foot === 'split';\n  const full = props.look === 'screen' || props.look === 'half';\n  const half = props.look === 'half';\n  const narrow = props.narrow === true;\n  const mid = props.align === 'center' && !split;\n  const tall = props.fullHeight === true;\n  const fill = tall && props.look === 'screen';\n  const centre = tall && !full;\n  const lift = half || fill;\n  const links = (props.links ?? []).filter((l) => l.label);\n  const withLinks = links.length > 0;\n  const actions = (\n    <Gate label={props.primary?.label || props.secondary?.label}>\n    <div className={cn('flex flex-wrap items-center gap-3', mid && 'justify-center')}>\n      <ActionLink path={['primary']} value={props.primary} size=\"md\" className=\"rounded-kh-pill\" />\n      {props.secondary && <ActionLink path={['secondary']} value={props.secondary} variant=\"secondary\" size=\"md\" className=\"rounded-kh-pill\" />}\n    </div>\n    </Gate>\n  );\n  return (\n    <Section labelledBy={id} bare={full} className={centre ? 'flex min-h-svh flex-col justify-center' : fill ? 'py-0' : undefined}>\n      <div className={cn(half ? 'flex min-h-[40rem] flex-col @4xl:min-h-[48rem]' : '', fill && 'flex min-h-svh flex-col', centre && 'w-full', !full && (narrow ? 'mx-auto max-w-kh-narrow px-kh-gutter' : 'mx-auto max-w-kh-page px-kh-gutter @4xl:px-0'))}>\n        {lift ? (\n          <div className=\"relative min-h-[16rem] flex-1 @4xl:min-h-[18rem]\">\n            <Media path={['media']} value={props.media} ratio={pic.ratio} className={PICTURE.half.box} />\n          </div>\n        ) : (\n          <Media path={['media']} value={props.media} ratio={pic.ratio} className={pic.box} />\n        )}\n        <div className={cn('mx-auto flex max-w-kh-page flex-col gap-8', half ? 'w-full flex-1 justify-center border-t border-kh-line px-kh-gutter py-kh-section' : fill ? 'w-full px-kh-gutter py-kh-section' : full ? 'px-kh-gutter pt-12' : withLinks ? 'mt-16 @4xl:mt-24' : 'mt-8', split && !withLinks && '@3xl:flex-row @3xl:flex-wrap @3xl:items-end @3xl:justify-between', withLinks && '@3xl:grid @3xl:grid-cols-2 @3xl:items-center @3xl:gap-16', mid && 'items-center text-center')}>\n          <div className={cn('flex min-w-0 max-w-kh-narrow flex-col', split ? 'gap-3' : 'gap-4', mid && 'items-center')}>\n            <Eyebrow path={['eyebrow']} value={props.eyebrow} className=\"mb-0 font-kh-mono text-kh-caption tracking-wider text-kh-accent-ink uppercase\" />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h2\" className={cn('font-kh-display text-kh-ink', props.titleSize === 'display' ? 'text-kh-display text-balance' : props.titleSize === 'title' || narrow ? 'text-kh-title' : 'text-kh-heading')} />\n            </div>\n            <Opt path={['description']} value={props.description} as=\"p\" multiline className=\"text-kh-lead text-kh-muted\" placeholder=\"Description\" />\n            <Opt path={['body']} value={props.body} as=\"p\" multiline className=\"text-kh-body text-kh-muted\" placeholder=\"Paragraph\" />\n          </div>\n          {withLinks ? (\n            <div className=\"flex flex-col gap-8\">\n              <ul className=\"divide-y divide-kh-line border-y border-kh-line\">\n                {(props.links ?? []).map((l, i) => l.label && (\n                  <li key={i}>\n                    <a href={safeHref(l.href ?? '')} className=\"block py-4 text-kh-lead text-kh-ink hover:text-kh-accent-ink\">\n                      <Text path={['links', i, 'label']} value={l.label} as=\"span\" />\n                    </a>\n                  </li>\n                ))}\n              </ul>\n              {actions}\n            </div>\n          ) : actions}\n        </div>\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroMediaFoot);\n"
    }
  ]
}
