{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "logos-tile-heading",
  "type": "registry:block",
  "title": "Logos, heading tile",
  "description": "One hairline-framed grid in which the first tile holds the heading and an action and the rest hold logos (three across on a wide container, two on a phone, the heading tile full width). Names without artwork are set as wordmarks.",
  "categories": [
    "logos"
  ],
  "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/logos-tile-heading/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/logos-tile-heading/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  title: t(80),\n  action: link.partial().optional(),\n  logos: z.array(z.object({ name: t(40).optional(), media, href: t(300).optional() })).min(2).max(11),\n});\n\nconst logo = (name: string) => ({ name, media: { src: '', alt: name } });\n\nexport const spec = defineSpec({\n  type: 'logos-tile-heading',\n  aliases: ['logo-cloud/tile-heading'],\n  sourceRuns: ['rmwj0x2cic8b2bb'],\n  name: 'Logos, heading tile',\n  category: 'logos',\n  role: 'body',\n  description: 'One hairline-framed grid in which the first tile holds the heading and an action and the rest hold logos (three across on a wide container, two on a phone, the heading tile full width). Names without artwork are set as wordmarks.',\n  schema,\n  defaults: {\n    title: 'Say who relies on you in one line',\n    action: { label: 'Name the main action', href: '#primary' },\n    logos: ['First logo', 'Second logo', 'Third logo', 'Fourth logo', 'Fifth logo'].map(logo),\n  },\n});\n"
    },
    {
      "path": "src/blocks/logos-tile-heading/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/logos-tile-heading/index.tsx",
      "content": "import type { ReactNode } from 'react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { ActionLink, Section, useEditing } from '../_shared/kit';\nimport { hasImage, 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 TILE = 'flex items-center justify-center bg-kh-surface p-8 text-kh-ink-2';\n\nfunction Tile({ href, children }: { href: string | undefined; children: ReactNode }) {\n  return href ? <a href={safeHref(href)} className={cn(TILE, 'transition-colors hover:bg-kh-surface-2')}>{children}</a> : <div className={TILE}>{children}</div>;\n}\n\n// One framed grid: the first tile is the heading and its action (full width on a phone), the others are logos.\nfunction LogosTileHeading({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const editing = useEditing();\n  return (\n    <Section labelledBy={id}>\n      <div className=\"px-kh-gutter\">\n        <div className=\"mx-auto grid max-w-kh-page grid-cols-2 gap-px overflow-hidden rounded-kh-lg border border-kh-line bg-kh-line shadow-kh-1 @3xl:grid-cols-3\">\n          <div className=\"col-span-2 flex flex-col items-start justify-center gap-6 bg-kh-surface p-8 @3xl:col-span-1\">\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            {props.action && <ActionLink path={['action']} value={{ label: props.action.label ?? '', href: props.action.href ?? '' }} size=\"md\" className=\"rounded-kh-pill\" />}\n          </div>\n          {props.logos.map((l, i) => {\n            const image = hasImage(l.media);\n            return (\n              <Tile key={i} href={editing ? undefined : l.href}>\n                {(image || editing) && (\n                  <div className=\"w-32 max-w-full\">\n                    <Media path={['logos', i, 'media']} value={l.media} ratio=\"3 / 1\" />\n                  </div>\n                )}\n                <Text path={['logos', i, 'name']} value={l.name ?? ''} as=\"span\" className={cn(image && !editing ? 'sr-only' : 'text-kh-heading text-kh-ink-2')} />\n              </Tile>\n            );\n          })}\n        </div>\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(LogosTileHeading);\n"
    }
  ]
}
