{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-overlay-aside",
  "type": "registry:block",
  "title": "Contact, overlay aside",
  "description": "A wide picture with the heading laid over its foot beside a narrow ruled card holding the lead, address, phone and email, a one-field form, three actions and a profile link with the legal line. On a phone the picture sits above the card.",
  "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/button.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/kit-c-proof.json",
    "https://ui.klarhimmel.com/r/kit-form.json"
  ],
  "files": [
    {
      "path": "src/blocks/contact-overlay-aside/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-overlay-aside/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, formFields, link, media, req, t } from '../_shared/schema';\n\nconst schema = z.object({\n  media,\n  eyebrow: t(60),\n  /** Drawn over the picture, bottom left. */\n  title: req(80),\n  description: t(240),\n  /** The small heading above the address and the phone and email lines. */\n  detailsTitle: t(60),\n  address: t(120),\n  phone: link.partial().optional(),\n  email: link.partial().optional(),\n  /** The one field above the send button: its label, form name, text inside it and the line under it. */\n  fieldLabel: req(60),\n  /** The field's form name; without one it is \"field\". */\n  fieldName: t(40).optional(),\n  fieldPlaceholder: t(80).optional(),\n  fieldHelp: t(120),\n  submit: req(40),\n  primary: link,\n  secondary: link.optional(),\n  textLink: link.optional(),\n  /** A list is an array field, never a slot. Each draws as a round icon link; the label is read aloud. */\n  profiles: z.array(z.object({ label: req(40), href: t(300) })).max(3),\n  legal: t(120),\n  /** Form wiring: `action` is where the form goes; with `method` it submits natively. */\n  ...formFields,\n});\n\nexport const spec = defineSpec({\n  type: 'contact-overlay-aside',\n  aliases: ['contact/overlay-aside'],\n  sourceRuns: ['rmwj0vhs835e61a'],\n  name: 'Contact, overlay aside',\n  category: 'contact',\n  role: 'body',\n  description: 'A wide picture with the heading laid over its foot beside a narrow ruled card holding the lead, address, phone and email, a one-field form, three actions and a profile link with the legal line. On a phone the picture sits above the card.',\n  schema,\n  defaults: {\n    media: { src: '', alt: 'Show the place or the people a visitor will meet' },\n    eyebrow: 'Name the section',\n    title: 'Say how a visitor reaches you',\n    description: 'Say in one or two sentences when you answer and what to bring up first.',\n    detailsTitle: 'Name the place or the team',\n    address: 'Give the street and town',\n    phone: { label: 'Give the phone number', href: '#phone' },\n    email: { label: 'Give the email address', href: '#email' },\n    fieldLabel: 'Name the one thing you ask for',\n    fieldHelp: 'Say in a few words how the answer is used.',\n    submit: 'Send',\n    primary: { label: 'Main action', href: '#start' },\n    secondary: { label: 'Second action', href: '#contact' },\n    textLink: { label: 'Name the extra page', href: '#more' },\n    profiles: [{ label: 'Name the profile', href: '#profile' }],\n    legal: 'Say in a few words what applies.',\n  },\n});\n"
    },
    {
      "path": "src/blocks/contact-overlay-aside/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-overlay-aside/index.tsx",
      "content": "import { useId } from 'react';\nimport { Camera } from 'lucide-react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { ActionLink, Gate, Opt, Section } from '../_shared/kit';\nimport { useHeadingId } from '../_shared/c-proof-kit';\nimport { FormExtras, useFormProps } from '../_shared/form-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\nconst focus = 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-kh-accent';\n\n// A wide picture with the heading over its foot beside a narrow card of address, form and actions (1.6 to 1 columns); on a phone the card follows the picture.\nfunction ContactOverlayAside({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const fid = useId();\n  const formProps = useFormProps(props);\n  const detail = `font-kh-mono text-kh-small text-kh-accent-ink hover:underline ${focus}`;\n  return (\n    <Section labelledBy={id}>\n      <div className=\"px-kh-gutter font-kh-sans text-kh-ink\">\n        <div className=\"mx-auto grid max-w-kh-page gap-8 @5xl:grid-cols-[1.6fr_1fr] @5xl:items-stretch\">\n          <div className=\"relative isolate min-h-[18rem] overflow-hidden rounded-kh-xl @5xl:min-h-0\">\n            <Media path={['media']} value={props.media} ratio=\"4 / 3\" className=\"absolute inset-0 size-full\" />\n            <div className=\"absolute inset-0 bg-kh-ink/50\" aria-hidden=\"true\" />\n            <div className=\"relative flex h-full flex-col justify-end gap-4 p-kh-gutter @2xl:p-10\">\n              <Opt path={['eyebrow']} value={props.eyebrow} className=\"font-kh-mono text-kh-caption uppercase tracking-wider text-kh-on-ink\" placeholder=\"Eyebrow\" />\n              <div id={id}>\n                <Text path={['title']} value={props.title} as=\"h2\" className=\"max-w-[18ch] font-kh-display text-kh-title text-kh-on-ink\" />\n              </div>\n            </div>\n          </div>\n\n          <div className=\"flex flex-col gap-8 rounded-kh-xl border border-kh-line bg-kh-surface p-kh-gutter shadow-kh-1\">\n            <Opt path={['description']} value={props.description} multiline className=\"text-kh-lead text-kh-ink-2\" placeholder=\"Description\" />\n\n            <div className=\"flex flex-col gap-4 border-t border-kh-line pt-6\">\n              <Opt path={['detailsTitle']} value={props.detailsTitle} as=\"h3\" className=\"font-kh-display text-kh-heading text-kh-ink\" placeholder=\"Heading\" />\n              <Opt path={['address']} value={props.address} className=\"text-kh-small text-kh-muted\" placeholder=\"Address\" />\n              {props.phone?.label && <a href={safeHref(props.phone.href ?? '')} className={detail}><Text path={['phone', 'label']} value={props.phone.label} as=\"span\" /></a>}\n              {props.email?.label && <a href={safeHref(props.email.href ?? '')} className={detail}><Text path={['email', 'label']} value={props.email.label} as=\"span\" /></a>}\n            </div>\n\n            {/* With no field label or no send label the form would draw an unnamed control: it is left out. */}\n            <Gate label={props.fieldLabel && props.submit}>\n            <form {...formProps} className=\"flex flex-col gap-4 border-t border-kh-line pt-6\">\n              <div className=\"flex flex-col gap-2\">\n                <label htmlFor={`${fid}-field`} className=\"text-kh-small font-medium text-kh-ink\"><Text path={['fieldLabel']} value={props.fieldLabel} as=\"span\" /></label>\n                <input id={`${fid}-field`} name={props.fieldName || 'field'} type=\"text\" placeholder={props.fieldPlaceholder || undefined} aria-describedby={`${fid}-help`} className={`rounded-kh border border-kh-line-strong bg-kh-canvas px-4 py-3 text-kh-body text-kh-ink placeholder:text-kh-muted ${focus}`} />\n                <Opt path={['fieldHelp']} value={props.fieldHelp} className=\"text-kh-caption text-kh-muted\" placeholder=\"Help text\" />\n              </div>\n              <FormExtras {...props} />\n              <button type=\"submit\" className={`inline-flex items-center justify-center rounded-kh-pill bg-kh-accent-fill px-6 py-3 text-kh-small font-medium text-kh-accent-fg shadow-kh-1 hover:opacity-90 ${focus}`}>\n                <Text path={['submit']} value={props.submit} as=\"span\" />\n              </button>\n            </form>\n            </Gate>\n\n            <div className=\"flex flex-col gap-3 border-t border-kh-line pt-6\">\n              <ActionLink path={['primary']} value={props.primary} size=\"md\" className=\"w-full justify-center rounded-kh-pill\" />\n              {props.secondary && <ActionLink path={['secondary']} value={props.secondary} variant=\"secondary\" size=\"md\" className=\"w-full justify-center rounded-kh-pill\" />}\n              {props.textLink && props.textLink.label && (\n                <a href={safeHref(props.textLink.href)} className={`self-center text-kh-small text-kh-accent-ink underline underline-offset-4 hover:text-kh-accent ${focus}`}>\n                  <Text path={['textLink', 'label']} value={props.textLink.label} as=\"span\" />\n                </a>\n              )}\n            </div>\n\n            <div className=\"flex items-center justify-between gap-4 border-t border-kh-line pt-6\">\n              <div className=\"flex gap-2\">\n                {props.profiles.map((p, i) => (\n                  <Gate key={i} label={p.label}><a href={safeHref(p.href)} className={`inline-flex size-10 items-center justify-center rounded-kh-pill border border-kh-line text-kh-ink-2 hover:bg-kh-surface-2 ${focus}`}>\n                    <Camera className=\"size-5\" strokeWidth={1.75} aria-hidden=\"true\" />\n                    <span className=\"sr-only\"><Text path={['profiles', i, 'label']} value={p.label} as=\"span\" /></span>\n                  </a></Gate>\n                ))}\n              </div>\n              <Opt path={['legal']} value={props.legal} className=\"text-kh-caption text-kh-muted\" placeholder=\"Legal text\" />\n            </div>\n          </div>\n        </div>\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(ContactOverlayAside);\n"
    }
  ]
}
