{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "logos-detail-picker",
  "type": "registry:block",
  "title": "Logos, detail picker",
  "description": "A header (label, heading, lead) over two columns: a list of selectable logo rows on the left and one detail panel on the right (picture, badge, heading, text, two actions) that changes with the chosen row, with no script. On a phone the list sits above the panel.",
  "categories": [
    "logos"
  ],
  "dependencies": [
    "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/logos-detail-picker/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/logos-detail-picker/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, req, t } from '../_shared/schema';\n\nconst item = z.object({\n  /** Shown beside the small logo in the list; names the choice. */\n  name: req(40),\n  logo: media,\n  /** The picture at the top of this item's detail panel. */\n  picture: media,\n  badge: t(24),\n  title: t(100),\n  description: t(240),\n  primary: link,\n  secondary: link.optional(),\n});\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: req(120),\n  description: t(240),\n  /** A list is an array field, never a slot. The first item's panel is open; each row in the list opens its own. */\n  items: z.array(item).min(2).max(6),\n});\n\nexport const spec = defineSpec({\n  type: 'logos-detail-picker',\n  aliases: ['logo-cloud/detail-picker'],\n  sourceRuns: ['rmwj0x2pnedc7be'],\n  name: 'Logos, detail picker',\n  category: 'logos',\n  role: 'body',\n  description: 'A header (label, heading, lead) over two columns: a list of selectable logo rows on the left and one detail panel on the right (picture, badge, heading, text, two actions) that changes with the chosen row, with no script. On a phone the list sits above the panel.',\n  schema,\n  defaults: {\n    eyebrow: 'Section name',\n    title: 'Say what the visitor can choose between',\n    description: 'Say what each row on the left opens.',\n    items: [\n      { name: 'First name', logo: { src: '', alt: 'First logo' }, picture: { src: '', alt: 'Show the first item at work' }, badge: 'Label', title: 'Name what this item is', description: 'Say in a line what this one offers the visitor.', primary: { label: 'Main action', href: '#first' }, secondary: { label: 'Second action', href: '#first-more' } },\n      { name: 'Second name', logo: { src: '', alt: 'Second logo' }, picture: { src: '', alt: 'Show the second item at work' }, badge: 'Label', title: 'Name what this item is', description: 'Say in a line what this one offers the visitor.', primary: { label: 'Main action', href: '#second' }, secondary: { label: 'Second action', href: '#second-more' } },\n      { name: 'Third name', logo: { src: '', alt: 'Third logo' }, picture: { src: '', alt: 'Show the third item at work' }, badge: 'Label', title: 'Name what this item is', description: 'Say in a line what this one offers the visitor.', primary: { label: 'Main action', href: '#third' }, secondary: { label: 'Second action', href: '#third-more' } },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/logos-detail-picker/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/logos-detail-picker/index.tsx",
      "content": "import { useId } from 'react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, 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\n// Native picker: one hidden radio per row sits before the grid; the checked one opens its panel and lights its row. Class names are\n// written out so the stylesheet scan finds them.\nconst PEER = ['peer/p0', 'peer/p1', 'peer/p2', 'peer/p3', 'peer/p4', 'peer/p5'];\nconst OPEN = [\n  'peer-checked/p0:[&_article:nth-of-type(1)]:flex',\n  'peer-checked/p1:[&_article:nth-of-type(2)]:flex',\n  'peer-checked/p2:[&_article:nth-of-type(3)]:flex',\n  'peer-checked/p3:[&_article:nth-of-type(4)]:flex',\n  'peer-checked/p4:[&_article:nth-of-type(5)]:flex',\n  'peer-checked/p5:[&_article:nth-of-type(6)]:flex',\n];\nconst LIT = [\n  'peer-checked/p0:[&_label:nth-of-type(1)]:border-kh-accent peer-checked/p0:[&_label:nth-of-type(1)]:bg-kh-accent-soft',\n  'peer-checked/p1:[&_label:nth-of-type(2)]:border-kh-accent peer-checked/p1:[&_label:nth-of-type(2)]:bg-kh-accent-soft',\n  'peer-checked/p2:[&_label:nth-of-type(3)]:border-kh-accent peer-checked/p2:[&_label:nth-of-type(3)]:bg-kh-accent-soft',\n  'peer-checked/p3:[&_label:nth-of-type(4)]:border-kh-accent peer-checked/p3:[&_label:nth-of-type(4)]:bg-kh-accent-soft',\n  'peer-checked/p4:[&_label:nth-of-type(5)]:border-kh-accent peer-checked/p4:[&_label:nth-of-type(5)]:bg-kh-accent-soft',\n  'peer-checked/p5:[&_label:nth-of-type(6)]:border-kh-accent peer-checked/p5:[&_label:nth-of-type(6)]:bg-kh-accent-soft',\n];\nconst FOCUS = [\n  'peer-focus-visible/p0:[&_label:nth-of-type(1)]:ring-2 peer-focus-visible/p0:[&_label:nth-of-type(1)]:ring-kh-accent',\n  'peer-focus-visible/p1:[&_label:nth-of-type(2)]:ring-2 peer-focus-visible/p1:[&_label:nth-of-type(2)]:ring-kh-accent',\n  'peer-focus-visible/p2:[&_label:nth-of-type(3)]:ring-2 peer-focus-visible/p2:[&_label:nth-of-type(3)]:ring-kh-accent',\n  'peer-focus-visible/p3:[&_label:nth-of-type(4)]:ring-2 peer-focus-visible/p3:[&_label:nth-of-type(4)]:ring-kh-accent',\n  'peer-focus-visible/p4:[&_label:nth-of-type(5)]:ring-2 peer-focus-visible/p4:[&_label:nth-of-type(5)]:ring-kh-accent',\n  'peer-focus-visible/p5:[&_label:nth-of-type(6)]:ring-2 peer-focus-visible/p5:[&_label:nth-of-type(6)]:ring-kh-accent',\n];\n\n// The header on top, then the list of rows (1) beside one detail panel (1.4); on a phone the list sits above the panel.\nfunction LogosDetailPicker({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const name = `kh-pick-${useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;\n  const items = props.items.slice(0, 6);\n  return (\n    <Section labelledBy={id}>\n      <div className=\"px-kh-gutter\">\n        <div className=\"mx-auto max-w-kh-page\">\n          <header className=\"max-w-kh-narrow\">\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-4 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-muted\" placeholder=\"Description\" />\n          </header>\n\n          <div className=\"relative mt-12\">\n            {items.map((it, i) => (\n              <input key={i} type=\"radio\" name={name} id={`${name}-${i}`} defaultChecked={i === 0} data-kh-css-control=\"\" aria-label={it.name} className={cn('sr-only', PEER[i])} />\n            ))}\n            <div className={cn('grid gap-8 @5xl:grid-cols-[1fr_1.4fr] @5xl:gap-12', LIT.join(' '), FOCUS.join(' '), OPEN.join(' '))}>\n              <div role=\"presentation\" className=\"flex flex-col gap-3\">\n                {items.map((it, i) => (\n                  <label key={i} htmlFor={`${name}-${i}`} className=\"flex cursor-pointer items-center gap-4 rounded-kh-lg border border-kh-line bg-kh-surface p-4 shadow-kh-1 transition hover:border-kh-line-strong\">\n                    <span className=\"block size-8 shrink-0 overflow-hidden\"><Media path={['items', i, 'logo']} value={it.logo} ratio=\"1 / 1\" /></span>\n                    <Text path={['items', i, 'name']} value={it.name} as=\"span\" className=\"font-kh-sans text-kh-body text-kh-ink\" />\n                  </label>\n                ))}\n              </div>\n              <div>\n                {items.map((it, i) => (\n                  <article key={i} className=\"hidden flex-col rounded-kh-xl border border-kh-line bg-kh-surface p-6 shadow-kh-2 @2xl:p-10\">\n                    <Media path={['items', i, 'picture']} value={it.picture} ratio=\"16 / 10\" className=\"w-full rounded-kh-lg\" />\n                    <div className=\"mt-6 flex items-center gap-3\">\n                      <Opt path={['items', i, 'badge']} value={it.badge} as=\"span\" className=\"rounded-kh-pill bg-kh-accent-soft px-3 py-1 font-kh-mono text-kh-caption uppercase tracking-wider text-kh-accent-ink\" placeholder=\"Badge\" />\n                    </div>\n                    <Opt path={['items', i, 'title']} value={it.title} as=\"h3\" className=\"mt-4 font-kh-display text-kh-heading text-kh-ink\" placeholder=\"Title\" />\n                    <Opt path={['items', i, 'description']} value={it.description} multiline className=\"mt-3 text-kh-body text-kh-muted\" placeholder=\"Description\" />\n                    <div className=\"mt-8 flex flex-wrap gap-3\">\n                      <ActionLink path={['items', i, 'primary']} value={it.primary} size=\"md\" className=\"rounded-kh-pill\" />\n                      {it.secondary && <ActionLink path={['items', i, 'secondary']} value={it.secondary} variant=\"secondary\" size=\"md\" className=\"rounded-kh-pill\" />}\n                    </div>\n                  </article>\n                ))}\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(LogosDetailPicker);\n"
    }
  ]
}
