{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-centered",
  "type": "registry:block",
  "title": "Hero, centered",
  "description": "Centered headline, description and two actions, with a wide framed image below.",
  "categories": [
    "hero"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-centered/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-centered/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  note: t(80),\n  /** An optional third action drawn as a text link with an arrow, after the two buttons. */\n  tertiary: link.partial().optional(),\n  /** How the actions sit on a narrow container: stacked under each other, or staggered (and at the right edge on a wide one, with the text link). 'column': one narrow centred column of full-width buttons, the text link under them, on every width. Empty: side by side. */\n  actionsLayout: z.enum(['stack', 'stagger', 'column']).optional(),\n  /** Empty or absent: no picture below. */\n  media: media.optional(),\n  /** A small pill-shaped picture set inside the title's line; the words after it go in titleAfter. */\n  titleMedia: media.optional(),\n  titleAfter: t(120).optional(),\n  /** The pill is wide (2.2em) instead of 1.6em. */\n  titleMediaWide: z.boolean().optional(),\n  /** Actions come after the picture instead of before it. Empty: before. */\n  actionsBelow: z.boolean().optional(),\n  /** Text at the centre (default) or at the start, sharing the picture's left edge. */\n  align: z.enum(['center', 'start']).optional(),\n  /** The title's scale. 'display': the large headline set in the light weight, whether or not a lead follows. 'section': the small light section heading, whether or not a lead follows, with the picture at full width. 'compact': a title about the size of a lead, as a caption to the picture. Empty: today's rule (a lead makes it a bold display, no lead with actions below or at the start makes it the section heading). */\n  titleSize: z.enum(['display', 'section', 'compact']).optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'hero-centered',\n  aliases: ['hero/centered'],\n  sourceRuns: ['rmwj1relx2ee937', 'rmwj03p955e9c0e', 'rmwj04cd7d33201', 'rmwizlmwhf2c671', 'rmwj1vizac4d8b4', 'rmwj1v8gedec94b', 'rmwj0zdeu1c4da2', 'rmwj04n659e3c3b', 'rmwj1d6l19ad291', 'rmwj0yvlo7c2c9a', 'rmwj0uxkk2e4efd', 'rmwj03p8y40a723', 'rmwjf5ij653050e', 'rmwj0tmwu9f9960', 'rmwizlmwb48c0a1', 'rmwj1c3h4644d2e', 'rmwj0tmwv6e0b6b', 'rmwj106u719ca24', 'rmwj0xjcz4b4915', 'rmwiybo3g84cbfe', 'rmwj0yvkz62f7cd', 'rmwj0xjcd5d0e2a', 'rmwjf55sg871ab4', 'rmwj0tmws26d1a5', 'rmwj4urt2fde275'],\n  name: 'Hero, centered',\n  category: 'hero',\n  role: 'body',\n  description: 'Centered headline, description and two actions, with a wide framed image below.',\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: '#demo' },\n    note: 'Say what makes starting easy.',\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-centered/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-centered/index.tsx",
      "content": "import { useContext, useId } from 'react';\nimport { HeadingLevelContext, Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Eyebrow, Opt, Section, useEditing } from '../_shared/kit';\nimport { ArrowUpRight } from 'lucide-react';\nimport { cn } from '../../lib/utils';\nimport { safeHref } from '../../ui/button';\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 HeroCentered({ props }: BlockProps<Props>) {\n  const id = useId();\n  const start = props.align === 'start';\n  const H = `h${useContext(HeadingLevelContext)?.level ?? '1'}` as 'h1' | 'h2';\n  const below = !!props.actionsBelow;\n  const tm = !!props.titleMedia;\n  // A section heading, not a hero: no lead, so the title is smaller and light and the picture sits closer.\n  const size = props.titleSize;\n  const lean = size ? size !== 'display' && !tm : (below || start) && !tm && !props.description;\n  const editing = useEditing();\n  const hasActions = !!(props.primary.label || props.secondary.label || props.tertiary?.label) || editing;\n  const layout = props.actionsLayout;\n  const stagger = layout === 'stagger';\n  const column = layout === 'column';\n  const rowClass = column\n    ? 'mx-auto mt-9 flex w-full max-w-sm flex-col gap-3 [&>div>*]:w-full [&>div>*]:justify-center'\n    : stagger\n    ? 'mt-9 flex flex-col items-start gap-4 @3xl:items-end'\n    : layout === 'stack'\n      ? cn('mt-9 flex flex-col gap-3 @md:flex-row @md:flex-wrap', start ? 'items-start @md:justify-start' : 'items-center @md:justify-center')\n      : start ? 'mt-9 flex flex-wrap justify-start gap-3' : 'mt-9 flex flex-wrap justify-center gap-3';\n  const step = (n: number) => (stagger ? (['', 'ml-8 @3xl:ml-0 @3xl:mr-0', 'ml-16 @3xl:ml-0 @3xl:mr-6'][n] ?? '') : '');\n  const actions = (\n    <>\n      {hasActions && (layout ? (\n        <div className={rowClass}>\n          <div className={cn(stagger && '@3xl:mr-16')}><ActionLink path={['primary']} value={props.primary} /></div>\n          <div className={step(1)}><ActionLink path={['secondary']} value={props.secondary} variant=\"secondary\" /></div>\n          {props.tertiary?.label && (\n            <a href={safeHref(props.tertiary.href ?? '')} className={cn('inline-flex items-center gap-2 text-kh-body font-medium text-kh-accent-ink underline underline-offset-4', step(2))}>\n              <Text path={['tertiary', 'label']} value={props.tertiary.label} as=\"span\" />\n              <ArrowUpRight aria-hidden className=\"size-4\" />\n            </a>\n          )}\n        </div>\n      ) : (\n        <div className={rowClass}>\n          <ActionLink path={['primary']} value={props.primary} />\n          <ActionLink path={['secondary']} value={props.secondary} variant=\"secondary\" />\n          {props.tertiary?.label && (\n            <a href={safeHref(props.tertiary.href ?? '')} className=\"inline-flex items-center gap-2 text-kh-body font-medium text-kh-accent-ink underline underline-offset-4\">\n              <Text path={['tertiary', 'label']} value={props.tertiary.label} as=\"span\" />\n              <ArrowUpRight aria-hidden className=\"size-4\" />\n            </a>\n          )}\n        </div>\n      ))}\n      <Opt path={['note']} value={props.note} className=\"mt-4 text-kh-small text-kh-muted\" placeholder=\"Reassurance line\" />\n    </>\n  );\n  return (\n    <Section labelledBy={id} flushEnd={!below && !!props.media} className=\"pt-16 @3xl:pt-24\">\n      <Container>\n        <div className={cn('mx-auto', start ? (tm && !props.media ? 'max-w-kh-narrow text-start' : 'max-w-5xl text-start') : tm ? 'max-w-kh-page text-center' : 'max-w-kh-narrow text-center')}>\n          <Eyebrow path={['eyebrow']} value={props.eyebrow} />\n          <div id={id}>\n            {props.titleMedia ? (\n              <H className={cn('font-kh-display text-[length:clamp(2.5rem,6cqi,5.5rem)] leading-[1.05] tracking-tight font-normal text-balance', start && 'max-w-kh-narrow')}>\n                <Text path={['title']} value={props.title} />{' '}\n                <span className={cn('inline-block', props.titleMediaWide ? 'h-[1.1em] w-[2.2em] align-middle' : 'h-[0.8em] w-[1.6em] align-[-0.1em]')}>\n                  <Media path={['titleMedia']} value={props.titleMedia} ratio=\"2 / 1\" className=\"size-full rounded-kh-pill\" />\n                </span>{' '}\n                <Text path={['titleAfter']} value={props.titleAfter ?? ''} />\n              </H>\n            ) : (\n              <Text path={['title']} value={props.title} as=\"h1\" className={lean ? `font-kh-display ${size === 'compact' ? 'text-kh-lead' : 'text-kh-title'} font-normal text-balance` : below || start || size ? cn('text-kh-display font-normal tracking-tight', start && 'max-w-kh-narrow') : 'text-kh-display font-semibold'} />\n            )}\n          </div>\n          <Opt path={['description']} value={props.description} as=\"p\" multiline placeholder=\"Lead paragraph\" className={start ? 'mt-6 max-w-kh-lead text-kh-lead text-kh-muted' : 'mx-auto mt-6 max-w-kh-lead text-kh-lead text-kh-muted'} />\n          {!below && actions}\n        </div>\n        {props.media && (\n          <div className={cn('relative mx-auto', lean ? 'mt-8' : 'mt-16', lean && !start && !size ? 'max-w-kh-narrow' : 'max-w-5xl')}>\n            <Media path={['media']} value={props.media} priority ratio={lean ? '16 / 10' : '16 / 9'} className={below ? 'rounded-kh-xl border border-kh-line shadow-kh-3' : 'rounded-t-kh-xl border border-b-0 border-kh-line shadow-kh-3'} />\n          </div>\n        )}\n        {below && <div className={cn('mx-auto', lean && !start && !size ? 'max-w-kh-narrow' : 'max-w-5xl', start ? 'text-start' : 'text-center')}>{actions}</div>}\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroCentered);\n"
    }
  ]
}
