{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-banner-details",
  "type": "registry:block",
  "title": "Contact, banner and details",
  "description": "A wide picture first, then a headline with actions and two detail blocks, an address with phone and email and a list of opening hours. Centered stacks the intro over two cards; split puts the intro and details left and the actions right. On a phone everything stacks in one column.",
  "categories": [
    "contact"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "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/kit-c-proof.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/contact-banner-details/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-banner-details/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, req, t } from '../_shared/schema';\n\nconst schema = z.object({\n  /** 'centered' is a full-width banner with a centred intro and two cards; 'split' is a contained banner with a caption, the intro and details left, the actions right. */\n  layout: z.enum(['centered', 'split']).optional(),\n  eyebrow: t(60),\n  title: req(120),\n  description: t(240),\n  banner: media,\n  /** Under the banner, in the split layout only. */\n  caption: t(120).optional(),\n  primary: link,\n  secondary: link.optional(),\n  /** A quiet link: in the contact card (centered) or under the actions (split). */\n  more: link.optional(),\n  contactTitle: t(60),\n  address: t(120),\n  phone: t(40),\n  email: t(80),\n  hoursTitle: t(60),\n  /** A line above the hours, in the centered layout only. */\n  hoursNote: t(160).optional(),\n  hours: z.array(z.object({ day: req(30), time: t(40) })).min(1).max(8),\n});\n\nexport const spec = defineSpec({\n  type: 'contact-banner-details',\n  aliases: ['contact/banner-details'],\n  sourceRuns: ['rmwj130i3dd858b', 'rmwj13d6ub4fefa'],\n  name: 'Contact, banner and details',\n  category: 'contact',\n  role: 'body',\n  description: 'A wide picture first, then a headline with actions and two detail blocks, an address with phone and email and a list of opening hours. Centered stacks the intro over two cards; split puts the intro and details left and the actions right. On a phone everything stacks in one column.',\n  schema,\n  defaults: {\n    layout: 'centered',\n    eyebrow: 'Name a topic',\n    title: 'Say how to reach or visit you',\n    description: 'Say in one line what the visitor can do here.',\n    banner: { src: '', alt: 'Show the place or the people the visitor will meet' },\n    caption: '',\n    primary: { label: 'Main action', href: '#book' },\n    secondary: { label: 'Second action', href: '#contact' },\n    more: { label: 'Another way in', href: '#directions' },\n    contactTitle: 'Name the contact block',\n    address: 'Give the street address and town',\n    phone: '+00 00 00 00 00',\n    email: 'you@company.example',\n    hoursTitle: 'Name the hours block',\n    hoursNote: 'Say in one line when the visitor can come.',\n    hours: [\n      { day: 'Name the days', time: 'Name the times' },\n      { day: 'Name the days', time: 'Name the times' },\n      { day: 'Name the days', time: 'Name the times' },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/contact-banner-details/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-banner-details/index.tsx",
      "content": "import { MapPin } from 'lucide-react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Gate, Opt, Section } from '../_shared/kit';\nimport { useHeadingId } from '../_shared/c-proof-kit';\nimport { cn } from '../../lib/utils';\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\nconst tel = (s: string) => (s ? `tel:${s.replace(/[^+\\d]/g, '')}` : '#');\n\n// A wide picture, then the headline and actions, then an address block and an hours list. Centered: full-bleed banner, centred intro, two cards. Split: rounded banner with a caption, intro and details left, actions right.\nfunction ContactBannerDetails({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const split = props.layout === 'split';\n  const link = props.more;\n  const moreLink = link && (\n    <ActionLink path={['more']} value={link} variant=\"ghost\" size=\"md\" className={split ? 'font-medium text-kh-accent-ink underline underline-offset-4' : 'mt-auto w-fit px-0 font-medium text-kh-accent-ink underline-offset-4 hover:underline'} />\n  );\n  const address = (\n    <>\n      <MapPin aria-hidden className={cn('mt-1 shrink-0 text-kh-accent-ink', split ? 'size-4' : 'size-5')} />\n      <Text path={['address']} value={props.address} as=\"span\" />\n    </>\n  );\n  const hoursRows = (\n    <dl className={cn('flex flex-col divide-y divide-kh-line', split && 'mt-3')}>\n      {props.hours.map((h, i) => (\n        <div key={i} className={cn('flex items-center justify-between gap-4', split ? 'py-3' : 'py-4')}>\n          <dt className={cn(split ? 'text-kh-body text-kh-ink-2' : 'text-kh-body font-medium text-kh-ink')}>\n            <Text path={['hours', i, 'day']} value={h.day} as=\"span\" />\n          </dt>\n          <dd className={cn('font-kh-mono text-kh-small', split ? 'text-kh-ink' : 'text-kh-ink-2')}>\n            <Text path={['hours', i, 'time']} value={h.time} as=\"span\" />\n          </dd>\n        </div>\n      ))}\n    </dl>\n  );\n\n  if (!split) {\n    const card = 'flex flex-col gap-5 rounded-kh-lg border border-kh-line bg-kh-surface p-6 shadow-kh-1 @2xl:p-8';\n    return (\n      <Section labelledBy={id} className=\"py-0\">\n        <Media path={['banner']} value={props.banner} ratio=\"21 / 9\" className=\"block w-full\" />\n        <div className=\"mx-auto max-w-kh-page px-kh-gutter py-kh-section\">\n          <div className=\"mx-auto flex max-w-kh-narrow flex-col items-center gap-4 text-center\">\n            <Opt path={['eyebrow']} value={props.eyebrow} className=\"font-kh-mono text-kh-caption uppercase tracking-widest text-kh-accent-ink\" placeholder=\"Eyebrow\" />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h2\" className=\"font-kh-display text-kh-heading text-kh-ink\" />\n            </div>\n            <Opt path={['description']} value={props.description} multiline className=\"text-kh-lead text-kh-ink-2\" placeholder=\"Description\" />\n            <div className=\"mt-2 flex flex-wrap justify-center gap-3\">\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          </div>\n          <div className=\"mt-12 grid gap-6 @3xl:grid-cols-2\">\n            <div className={card}>\n              <Opt path={['contactTitle']} value={props.contactTitle} as=\"h3\" className=\"font-kh-display text-kh-title text-kh-ink\" placeholder=\"Heading\" />\n              <div className=\"flex items-start gap-3 text-kh-body text-kh-ink-2\">{address}</div>\n              <div className=\"flex flex-col gap-2 border-t border-kh-line pt-5 text-kh-body text-kh-ink-2\">\n                <Gate label={props.phone}><a href={tel(props.phone)}><Text path={['phone']} value={props.phone} as=\"span\" /></a></Gate>\n                <Gate label={props.email}><a href={`mailto:${props.email}`} className=\"break-all\"><Text path={['email']} value={props.email} as=\"span\" /></a></Gate>\n              </div>\n              {moreLink}\n            </div>\n            <div className={card}>\n              <Opt path={['hoursTitle']} value={props.hoursTitle} as=\"h3\" className=\"font-kh-display text-kh-title text-kh-ink\" placeholder=\"Heading\" />\n              <Opt path={['hoursNote']} value={props.hoursNote} className=\"text-kh-body text-kh-muted\" placeholder=\"Note\" />\n              {hoursRows}\n            </div>\n          </div>\n        </div>\n      </Section>\n    );\n  }\n\n  return (\n    <Section labelledBy={id} className=\"px-kh-gutter\">\n      <div className=\"mx-auto max-w-kh-page\">\n        <figure className=\"m-0\">\n          <Media path={['banner']} value={props.banner} ratio=\"16 / 7\" className=\"block w-full rounded-kh-xl shadow-kh-2\" />\n          <Opt path={['caption']} value={props.caption} as=\"figcaption\" className=\"mt-3 text-kh-caption text-kh-muted\" placeholder=\"Caption\" />\n        </figure>\n        <div className=\"mt-12 grid gap-10 @5xl:grid-cols-2 @5xl:gap-16\">\n          <div className=\"min-w-0\">\n            <Opt path={['eyebrow']} value={props.eyebrow} className=\"font-kh-mono text-kh-caption uppercase tracking-wider text-kh-accent-ink\" placeholder=\"Eyebrow\" />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h2\" className=\"mt-3 font-kh-display text-kh-title text-kh-ink\" />\n            </div>\n            <Opt path={['description']} value={props.description} multiline className=\"mt-4 text-kh-lead text-kh-ink-2\" placeholder=\"Description\" />\n            <div className=\"mt-8 grid gap-8 border-t border-kh-line pt-8 @2xl:grid-cols-2\">\n              <div>\n                <Opt path={['contactTitle']} value={props.contactTitle} as=\"h3\" className=\"font-kh-display text-kh-heading text-kh-ink\" placeholder=\"Heading\" />\n                <address className=\"mt-3 flex items-start gap-2 not-italic text-kh-body text-kh-ink-2\">{address}</address>\n                <ul className=\"mt-4 flex flex-col gap-2 text-kh-small\">\n                  <Gate label={props.phone}><li><a href={tel(props.phone)} className=\"text-kh-ink-2 hover:text-kh-accent-ink\"><Text path={['phone']} value={props.phone} as=\"span\" /></a></li></Gate>\n                  <Gate label={props.email}><li><a href={`mailto:${props.email}`} className=\"break-all text-kh-ink-2 hover:text-kh-accent-ink\"><Text path={['email']} value={props.email} as=\"span\" /></a></li></Gate>\n                </ul>\n              </div>\n              <div>\n                <Opt path={['hoursTitle']} value={props.hoursTitle} as=\"h3\" className=\"font-kh-display text-kh-heading text-kh-ink\" placeholder=\"Heading\" />\n                {hoursRows}\n              </div>\n            </div>\n          </div>\n          <div className=\"flex flex-col gap-6 @5xl:items-end @5xl:pt-2\">\n            <div className=\"flex flex-wrap gap-3\">\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            {moreLink}\n          </div>\n        </div>\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(ContactBannerDetails);\n"
    }
  ]
}
