{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-floating-media",
  "type": "registry:block",
  "title": "Hero, floating pictures",
  "description": "A large two-line heading, its second line in the accent, a short line and a row of chips, with pictures floating around it at different sizes.",
  "categories": [
    "hero"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/editing.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-floating-media/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-floating-media/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  title: t(16),\n  /** The heading's second line, drawn in the accent. */\n  titleAccent: t(16),\n  description: t(160),\n  /** Short uses, one per chip; leave empty for none. */\n  chips: z.array(t(28)).max(8),\n  primary: link.partial().optional(),\n  secondary: link.partial().optional(),\n  /** Up to eight pictures float around the text on a wide screen, in this order: left top, left top wide, left low, left bottom, centre bottom small, right top, right edge, right bottom. On a phone they keep to a band above and below the text. */\n  media: z.array(media).max(8),\n});\n\nexport const spec = defineSpec({\n  type: 'hero-floating-media',\n  aliases: ['hero/floating-media'],\n  name: 'Hero, floating pictures',\n  category: 'hero',\n  role: 'body',\n  description: 'A large two-line heading, its second line in the accent, a short line and a row of chips, with pictures floating around it at different sizes.',\n  schema,\n  defaults: {\n    title: 'Name the act',\n    titleAccent: 'and its range',\n    description: 'Say who it is for and what they no longer have to do themselves. Then say how simply it starts.',\n    chips: ['Name a first use', 'Name a second use', 'Name a third use', 'Name a fourth use'],\n    primary: { label: 'Main action', href: '#start' },\n    secondary: { label: 'Second action', href: '#more' },\n    media: [\n      { src: '', alt: 'The thing at work, close' },\n      { src: '', alt: 'A second result, small' },\n      { src: '', alt: 'A wide shot of a result' },\n      { src: '', alt: 'A detail, small' },\n      { src: '', alt: 'The best result, large' },\n      { src: '', alt: 'A face or a hand, small' },\n      { src: '', alt: 'One more result, upright' },\n      { src: '', alt: 'The people who made it' },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/hero-floating-media/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-floating-media/index.tsx",
      "content": "import { useContext, useId } from 'react';\nimport { HeadingLevelContext, Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Section, Gate } from '../_shared/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// Where each picture floats: its corner, width and ratio, read from the captured layout at 390 (base) and 1280 (@4xl, a container of\n// 56rem and up). On a phone they keep to a band above and a band below the text, so nothing covers a word.\nconst PLACES = [\n  { ratio: '9 / 16', at: 'start-[-6%] top-[12%] w-[16%] @4xl:start-[-4%] @4xl:top-[13%] @4xl:w-[13%]' },\n  { ratio: '16 / 9', at: 'start-[8%] top-[3%] w-[30%] @4xl:start-[9%] @4xl:top-[18%] @4xl:w-[21%]' },\n  { ratio: '9 / 16', at: 'start-[-5%] top-[72%] w-[18%] @4xl:start-[-3%] @4xl:top-[33%] @4xl:w-[13%] @4xl:-z-[1]' },\n  { ratio: '3 / 4', at: 'start-[18%] top-[80%] w-[26%] @4xl:start-[16%] @4xl:top-[71%] @4xl:w-[15%]' },\n  { ratio: '21 / 9', at: 'start-[50%] top-[74%] w-[20%] opacity-60 @4xl:start-[44%] @4xl:top-[69%] @4xl:w-[14%]' },\n  { ratio: '9 / 16', at: 'end-[4%] top-[6%] w-[22%] @4xl:end-[8%] @4xl:top-[28%] @4xl:w-[14%]' },\n  { ratio: '9 / 16', at: 'end-[-6%] top-[71%] w-[16%] @4xl:end-[-8%] @4xl:top-[40%] @4xl:w-[13%]' },\n  { ratio: '16 / 9', at: 'end-[2%] top-[86%] w-[32%] @4xl:end-0 @4xl:top-[86%] @4xl:w-[22%]' },\n];\n\nfunction HeroFloatingMedia({ props }: BlockProps<Props>) {\n  const id = useId();\n  const H = `h${useContext(HeadingLevelContext)?.level ?? '1'}` as 'h1' | 'h2';\n  const media = props.media.slice(0, PLACES.length);\n  return (\n    <Section labelledBy={id} className=\"overflow-hidden bg-[radial-gradient(ellipse_70%_60%_at_50%_42%,var(--kh-accent-soft),var(--kh-canvas)_70%)]\">\n      <div className=\"relative isolate grid min-h-[66rem] place-items-center @4xl:min-h-[54rem]\">\n        <div className=\"relative z-[2] max-w-kh-narrow px-kh-gutter text-center\">\n          <H id={id} className=\"text-kh-display @4xl:text-[clamp(var(--kh-text-display),7.5cqi,calc(var(--kh-text-display)*2.2))] leading-[0.95] font-semibold tracking-tight\">\n            <Text path={['title']} value={props.title} className=\"block\" />\n            <Text path={['titleAccent']} value={props.titleAccent} className=\"block bg-linear-[100deg,var(--kh-accent),var(--kh-accent-ink)] bg-clip-text pb-[0.08em] text-transparent\" />\n          </H>\n          <Text path={['description']} value={props.description} as=\"p\" multiline className=\"mx-auto mt-6 max-w-[34rem] text-kh-lead text-kh-muted\" />\n          {props.chips.length > 0 && (\n            <ul className=\"mt-8 flex flex-wrap justify-center gap-2\">\n              {props.chips.map((c, i) => (\n                <li key={i} className=\"rounded-full border border-kh-line bg-kh-surface px-4 py-2 text-kh-small\">\n                  <Text path={['chips', i]} value={c} />\n                </li>\n              ))}\n            </ul>\n          )}\n          <Gate label={props.primary?.label || props.secondary?.label}>\n          <div className=\"mt-6 flex flex-wrap justify-center gap-3\">\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        {media.length > 0 && (\n          <div className=\"pointer-events-none absolute inset-0 z-[1]\">\n            {media.map((m, i) => (\n              <div key={i} className={`absolute ${PLACES[i]!.at}`}>\n                <Media path={['media', i]} value={m} ratio={PLACES[i]!.ratio} className=\"rounded-kh-lg shadow-kh-3\" />\n              </div>\n            ))}\n          </div>\n        )}\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroFloatingMedia);\n"
    }
  ]
}
