{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-facts",
  "type": "registry:block",
  "title": "Hero, facts",
  "description": "A hero with no picture: one large sentence, a thin rule, then two to four facts stacked under it, each a small label, a large value and an optional link (the next date and tickets, where, opening hours, a price from). For an event, a venue, a practice or a trade whose page opens on what a visitor needs to know. The same stack on a phone.",
  "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/kit-c-proof.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-facts/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-facts/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t } from '../_shared/schema';\n\nconst fact = z.object({\n  /** What the fact is, small, above it ('Next date', 'Where', 'Open'). */\n  label: t(30),\n  /** The fact itself, large: a date, a place, opening hours, a price from. */\n  value: t(60),\n  /** The fact's own page (the event, a map): the label and value become one link. Empty: plain text. */\n  href: t(300).default(''),\n  /** A further step under it ('Book a place', 'Directions'). Empty label: no link. */\n  link: link.optional(),\n});\n\nconst schema = z.object({\n  /** One sentence that says what they are and for whom, set large. */\n  title: t(160),\n  /** Two to four facts a visitor wants before anything else, stacked under one thin rule. */\n  facts: z.array(fact).min(1).max(4),\n});\n\nexport const spec = defineSpec({\n  type: 'hero-facts',\n  aliases: ['hero/facts'],\n  name: 'Hero, facts',\n  category: 'hero',\n  role: 'body',\n  description: 'A hero with no picture: one large sentence, a thin rule, then two to four facts stacked under it, each a small label, a large value and an optional link (the next date and tickets, where, opening hours, a price from). For an event, a venue, a practice or a trade whose page opens on what a visitor needs to know. The same stack on a phone.',\n  schema,\n  defaults: {\n    title: 'Say in one sentence what you are and who you are for, in the words a visitor would use',\n    facts: [\n      { label: 'Name the first fact', value: 'The first fact, as a date or place', href: '#first', link: { label: 'The next step', href: '#next' } },\n      { label: 'Name the second fact', value: 'The second fact, in a few words', href: '#second', link: { label: '', href: '' } },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/hero-facts/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-facts/index.tsx",
      "content": "import { ArrowUpRight } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { Container, Gate, Section } from '../_shared/kit';\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\n// A type-led hero: the statement, a thin rule, and the facts a visitor wants first, stacked. No picture, so a page with none still\n// opens on something of its own (KB-413).\nfunction HeroFacts({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <div id={id} className=\"max-w-[60rem]\">\n          <Text path={['title']} value={props.title} as=\"h1\" className=\"text-[2rem] font-normal leading-[1.2] tracking-tight @md:text-[2.75rem] @4xl:text-[3.5rem]\" />\n        </div>\n        <div aria-hidden className=\"mt-8 h-px bg-kh-line-strong @4xl:mt-10\" />\n        <ul className=\"mt-8 flex flex-col gap-8 @4xl:mt-10 @4xl:gap-10\">\n          {props.facts.map((f, i) => {\n            // A fact is large text, not a heading (no h3 under the h1). A linked fact shows an arrow after its value, so a phone number or an address reads as a link at rest, not only on hover.\n            const fact = <>\n              <Text path={['facts', i, 'label']} value={f.label} as=\"p\" className=\"text-kh-small text-kh-muted\" />\n              <p className=\"flex items-baseline gap-2 text-[1.375rem] font-normal leading-tight @md:text-[1.75rem] @4xl:text-[2rem]\">\n                <Text path={['facts', i, 'value']} value={f.value} as=\"span\" />\n                {f.href && <ArrowUpRight aria-hidden strokeWidth={1.75} className=\"size-[0.8em] shrink-0 translate-y-[0.08em] text-kh-muted\" />}\n              </p>\n            </>;\n            return (\n            <li key={i} className=\"flex flex-col gap-1.5\">\n              {f.href ? <a href={safeHref(f.href)} className=\"flex w-fit flex-col gap-1.5 rounded-kh-sm hover:[&_p:last-child]:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus)\">{fact}</a> : fact}\n              {f.link && (\n                <Gate label={f.link.label}>\n                  <a href={safeHref(f.link.href)} className=\"mt-1 w-fit rounded-kh-sm text-kh-small font-semibold underline underline-offset-4 hover:text-kh-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus)\">\n                    <Text path={['facts', i, 'link', 'label']} value={f.link.label} as=\"span\" />\n                  </a>\n                </Gate>\n              )}\n            </li>\n            );\n          })}\n        </ul>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroFacts);\n"
    }
  ]
}
