{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-area",
  "type": "registry:block",
  "title": "Contact, area served",
  "description": "Where a business that travels to its customers works: a heading, how far and how fast they come, the town they work from and one call button on one side, the places they cover as a ruled list (with a note per place) on the other. No map picture needed. For trades, cleaners, mobile services and delivery.",
  "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/contact-area/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-area/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, req, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: req(120),\n  /** How far they travel and how fast, in their words ('Call-outs within 20 miles, same day where we can'). t(1500) and a blank line is a paragraph break: Tetris Flytt's area text is about 1,500 characters (the longest real); from 300 characters it is set at body size. */\n  description: t(1500),\n  /** Where they work from: a town or district, never a house number. Empty: the line is not drawn. */\n  base: t(80),\n  /** The places they cover, as their page names them. A note holds what differs for one place (a call-out fee, a day). */\n  /** Up to 80 places (Tetris Flytt names about 60 towns); an href makes the name a link to that place's page. */\n  areas: z.array(z.object({ name: req(40), note: t(60), href: t(300).optional() })).min(1).max(80),\n  /** What to do when a place is missing ('Not on the list? Ring and ask.'). */\n  note: t(200),\n  action: link,\n});\n\nexport const spec = defineSpec({\n  type: 'contact-area',\n  aliases: ['contact/area'],\n  name: 'Contact, area served',\n  category: 'contact',\n  role: 'body',\n  description: 'Where a business that travels to its customers works: a heading, how far and how fast they come, the town they work from and one call button on one side, the places they cover as a ruled list (with a note per place) on the other. No map picture needed. For trades, cleaners, mobile services and delivery.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    title: 'Say where you work and how far',\n    description: 'Say in one sentence how far you travel and how fast you can arrive.',\n    base: 'Name the town you work from',\n    areas: [\n      { name: 'First place', note: '' },\n      { name: 'Second place', note: '' },\n      { name: 'Third place', note: '' },\n      { name: 'Fourth place', note: '' },\n      { name: 'Fifth place', note: '' },\n      { name: 'Sixth place', note: '' },\n      { name: 'Seventh place', note: 'Say what differs here' },\n      { name: 'Eighth place', note: 'Say what differs here' },\n    ],\n    note: 'Say what to do when a place is missing.',\n    action: { label: 'Main action', href: 'tel:+441134960123' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/contact-area/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-area/index.tsx",
      "content": "import { useId } from 'react';\nimport { MapPin } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Eyebrow, Opt, Section, useEditing } from '../_shared/kit';\nimport { safeHref } from '../../ui/button';\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\nfunction ContactArea({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  // Up to six places read as one column; more flow into two, and three in a wide container when no place has a note (a note\n  // in a third of the width wraps and the rows go uneven).\n  const many = props.areas.length > 6;\n  const notes = props.areas.some((a) => a.note);\n  return (\n    <Section labelledBy={id}>\n      <Container className=\"grid gap-10 @4xl:grid-cols-[1fr_1.3fr] @4xl:gap-16\">\n        <div>\n          <Eyebrow path={['eyebrow']} value={props.eyebrow} />\n          <div id={id}>\n            <Text path={['title']} value={props.title} as=\"h2\" className=\"text-kh-title font-semibold\" />\n          </div>\n          <Opt path={['description']} value={props.description} multiline className={cn('mt-4 max-w-kh-lead whitespace-pre-line text-kh-muted', props.description.length > 300 ? 'text-kh-body' : 'text-kh-lead')} placeholder=\"How far and how fast\" />\n          {(props.base || editing) && (\n            <p className=\"mt-6 flex items-start gap-3 text-kh-body\">\n              <MapPin aria-hidden className=\"mt-1 size-4 shrink-0 text-kh-muted\" />\n              <Text path={['base']} value={props.base} as=\"span\" placeholder=\"Where you work from\" />\n            </p>\n          )}\n          <ActionLink path={['action']} value={props.action} className=\"mt-8\" />\n        </div>\n        <div>\n          <ul className={cn('border-t border-kh-line', many && '@md:columns-2 @md:gap-x-8', many && !notes && '@5xl:columns-3')}>\n            {props.areas.map((a, i) => (\n              <li key={i} className=\"flex break-inside-avoid items-baseline justify-between gap-4 border-b border-kh-line py-3\">\n                {a.href ? (\n                  <a href={safeHref(a.href)} className=\"text-kh-body font-medium underline-offset-2 hover:underline\">\n                    <Text path={['areas', i, 'name']} value={a.name} as=\"span\" />\n                  </a>\n                ) : (\n                  <Text path={['areas', i, 'name']} value={a.name} as=\"span\" className=\"text-kh-body font-medium\" />\n                )}\n                <Opt path={['areas', i, 'note']} value={a.note} as=\"span\" className=\"text-right text-kh-small text-kh-muted\" placeholder=\"Note\" />\n              </li>\n            ))}\n          </ul>\n          <Opt path={['note']} value={props.note} className=\"mt-4 text-kh-small text-kh-muted\" placeholder=\"Note\" />\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(ContactArea);\n"
    }
  ]
}
