{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-frame",
  "type": "registry:block",
  "title": "Hero, framed screenshot",
  "description": "Centred headline and actions above a product screenshot in a window frame with a title bar.",
  "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-frame/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-frame/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(300),\n  primary: link,\n  secondary: link,\n  frameTitle: t(60),\n  media,\n  /** 'straddle': the first screen below a sticky navbar of height --kh-nav-height (0 if unset) ends at the frame's middle, so half the frame\n   *  shows above the fold and half below, with the headline centred in the space above it. Default 'auto'. */\n  fold: z.enum(['auto', 'straddle']).optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'hero-frame',\n  aliases: ['hero/frame'],\n  name: 'Hero, framed screenshot',\n  category: 'hero',\n  role: 'body',\n  description: 'Centred headline and actions above a product screenshot in a window frame with a title bar.',\n  schema,\n  defaults: {\n    eyebrow: 'Name what this is',\n    title: 'Say what the visitor gets in one line',\n    description: 'Say in one or two sentences what it does, who it is for and what the visitor can do next, in plain words.',\n    primary: { label: 'Main action', href: '#start' },\n    secondary: { label: 'Second action', href: '#tour' },\n    frameTitle: 'your-app.example/home',\n    media: { src: '', alt: 'Show the main screen of the product at work, with real content in it' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/hero-frame/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-frame/index.tsx",
      "content": "import { useId } from 'react';\nimport { cn } from '../../lib/utils';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Eyebrow, Opt, Section } from '../_shared/kit';\nimport { spec } from './spec';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\n\nexport { spec };\n/** Half the frame's height as top padding: half a 16:9 picture (padding in % is of the width, so 28.125 %) plus half the 2.75rem title bar.\n *  A class, not a style attribute: pages that render blocks may run under a CSP with style-src 'self'. */\nconst HALF = 'pt-[calc(28.125%+1.375rem)]';\ntype Props = z.infer<typeof spec.schema>;\n\nfunction HeroFrame({ props }: BlockProps<Props>) {\n  const id = useId();\n  const straddle = props.fold === 'straddle';\n  const frame = (\n    <div className=\"overflow-hidden rounded-t-kh-xl border border-b-0 border-kh-line bg-kh-surface shadow-kh-3\">\n      <div className=\"grid h-11 grid-cols-[4.5rem_1fr_4.5rem] items-center border-b border-kh-line bg-kh-surface-2 px-4\">\n        <span aria-hidden className=\"flex gap-1.5\">\n          <span className=\"size-2.5 rounded-kh-pill bg-kh-line-strong\" />\n          <span className=\"size-2.5 rounded-kh-pill bg-kh-line-strong\" />\n          <span className=\"size-2.5 rounded-kh-pill bg-kh-line-strong\" />\n        </span>\n        <Opt path={['frameTitle']} value={props.frameTitle} as=\"p\" className=\"truncate text-center font-kh-mono text-kh-caption text-kh-muted\" placeholder=\"Window title\" />\n      </div>\n      <Media path={['media']} value={props.media} priority ratio=\"16 / 9\" className=\"rounded-none\" />\n    </div>\n  );\n  return (\n    <Section labelledBy={id} flushEnd className={straddle ? 'pt-0' : 'pt-16 @3xl:pt-24'}>\n      <Container>\n        <div className={cn(straddle && 'flex min-h-[calc(100svh-var(--kh-nav-height,0px))] flex-col')}>\n          <div className={cn('mx-auto max-w-5xl text-center', straddle && 'flex flex-1 flex-col justify-center py-8 @3xl:py-10')}>\n            <Eyebrow path={['eyebrow']} value={props.eyebrow} />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h1\" className=\"text-kh-display font-semibold\" />\n            </div>\n            <Text path={['description']} value={props.description} as=\"p\" multiline className=\"mx-auto mt-6 max-w-3xl text-kh-lead text-kh-muted\" />\n            <div className=\"mt-9 flex flex-wrap justify-center gap-3\">\n              <ActionLink path={['primary']} value={props.primary} />\n              <ActionLink path={['secondary']} value={props.secondary} variant=\"secondary\" />\n            </div>\n          </div>\n          {straddle ? (\n            // The top half of the frame closes the first screen; the spacer after the block holds the lower half.\n            <div className=\"relative mx-auto w-full max-w-5xl\">\n              <div aria-hidden className={HALF} />\n              <div className=\"absolute inset-x-0 top-0\">{frame}</div>\n            </div>\n          ) : (\n            <div className=\"mx-auto mt-16 max-w-5xl\">{frame}</div>\n          )}\n        </div>\n        {straddle && <div aria-hidden className={cn('mx-auto w-full max-w-5xl', HALF)} />}\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroFrame);\n"
    }
  ]
}
