{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-channels",
  "type": "registry:block",
  "title": "Contact, channels",
  "description": "Two to four ways to reach you as cards: an icon, the channel name, who it is for, the address or number as a link, and how fast you answer. For support pages and anywhere \"contact us\" is really a choice.",
  "categories": [
    "contact"
  ],
  "dependencies": [
    "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/text-link.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/contact-channels/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-channels/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, icon, req, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: req(120),\n  description: t(300),\n  channels: z.array(z.object({\n    icon,\n    name: req(30),\n    detail: t(100),\n    value: req(60),\n    href: t(300),\n    response: t(40),\n  })).min(2).max(4),\n  // align: 'center' centres the eyebrow, headline and sentence over the cards instead of setting them left.\n  align: z.enum(['left', 'center']).optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'contact-channels',\n  aliases: ['contact/channels'],\n  sourceRuns: ['rmwj0uxknf24923'],\n  name: 'Contact, channels',\n  category: 'contact',\n  role: 'body',\n  description: 'Two to four ways to reach you as cards: an icon, the channel name, who it is for, the address or number as a link, and how fast you answer. For support pages and anywhere \"contact us\" is really a choice.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    title: 'Say that they can pick a channel',\n    description: 'Say in one sentence who answers and how fast.',\n    channels: [\n      { icon: 'mail', name: 'Channel one', detail: 'Say what this channel suits, in one line.', value: 'you@company.example', href: 'mailto:you@company.example', response: 'Say how fast you reply' },\n      { icon: 'users', name: 'Channel two', detail: 'Say what this channel suits, in one line.', value: 'Say how to start', href: '#chat', response: 'Say how fast you reply' },\n      { icon: 'clock', name: 'Channel three', detail: 'Say what this channel suits, in one line.', value: '+00 00 000 00 00', href: 'tel:+46310000000', response: 'Say when you answer' },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/contact-channels/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/contact-channels/index.tsx",
      "content": "import { Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { linkClass } from '../../ui/text-link';\nimport { Container, Icon, Opt, Section } from '../_shared/kit';\nimport { Heading, 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 COLS = { 2: '@2xl:grid-cols-2', 3: '@2xl:grid-cols-2 @4xl:grid-cols-3', 4: '@2xl:grid-cols-2 @5xl:grid-cols-4' } as const;\n\nfunction ContactChannels({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const n = Math.min(4, Math.max(2, props.channels.length)) as 2 | 3 | 4;\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <Heading id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} align={props.align} />\n        <ul className={cn('mt-12 grid gap-5', COLS[n])}>\n          {props.channels.map((c, i) => (\n            <li key={i} className=\"flex flex-col rounded-kh-xl border border-kh-line bg-kh-surface p-7\">\n              <span className=\"inline-flex size-11 items-center justify-center rounded-kh-lg bg-kh-accent-soft text-kh-accent-ink\">\n                <Icon name={c.icon} />\n              </span>\n              <Text path={['channels', i, 'name']} value={c.name} as=\"h3\" className=\"mt-5 text-kh-heading font-semibold\" />\n              <Opt path={['channels', i, 'detail']} value={c.detail} className=\"mt-1 text-kh-small text-kh-muted\" placeholder=\"Who it is for\" />\n              <p className=\"mt-6\">\n                <a href={safeHref(c.href)} className={cn(linkClass(), 'inline-flex min-h-6 items-center break-all text-kh-body font-medium')}>\n                  <Text path={['channels', i, 'value']} value={c.value} as=\"span\" />\n                </a>\n              </p>\n              <Opt path={['channels', i, 'response']} value={c.response} className=\"mt-auto pt-4 text-kh-caption text-kh-muted\" placeholder=\"Response time\" />\n            </li>\n          ))}\n        </ul>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(ContactChannels);\n"
    }
  ]
}
