{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "gallery-mosaic",
  "type": "registry:block",
  "title": "Gallery, mosaic",
  "description": "Photos edge to edge with no gaps on a three-column grid, one and two columns wide in turn, so each pair of rows reads as a mosaic. Stacked full width on a phone.",
  "categories": [
    "gallery"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/editing.json"
  ],
  "files": [
    {
      "path": "src/blocks/gallery-mosaic/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/gallery-mosaic/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  /** Read aloud by assistive tech only; names what the photos show. */\n  label: t(48),\n  /** Photos edge to edge on three columns; on a wide screen the 2nd and 3rd of every four are two columns wide, so each pair of rows reads as a mosaic. On a phone they stack. */\n  photos: z.array(media).min(4).max(8),\n});\n\nexport const spec = defineSpec({\n  type: 'gallery-mosaic',\n  aliases: ['gallery/mosaic'],\n  name: 'Gallery, mosaic',\n  category: 'gallery',\n  role: 'body',\n  description: 'Photos edge to edge with no gaps on a three-column grid, one and two columns wide in turn, so each pair of rows reads as a mosaic. Stacked full width on a phone.',\n  schema,\n  defaults: {\n    label: 'Name what the photos show',\n    photos: [\n      { src: '', alt: 'A room, close, one column wide' },\n      { src: '', alt: 'The main room, wide, across two columns' },\n      { src: '', alt: 'The kitchen or the work space, two columns' },\n      { src: '', alt: 'A detail, the bathroom or the view' },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/gallery-mosaic/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/gallery-mosaic/index.tsx",
      "content": "import { useId } from 'react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\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// The region's name is copy like any other (a Text slot), shown to screen readers only.\nfunction GalleryMosaic({ props }: BlockProps<Props>) {\n  const id = useId();\n  return (\n    <section role=\"group\" aria-labelledby={props.label.trim() ? id : undefined} className=\"@container\">\n      <span id={id} className=\"sr-only\"><Text path={['label']} value={props.label} /></span>\n      <div className=\"grid grid-cols-1 gap-0 bg-kh-canvas @4xl:grid-cols-3\">\n        {props.photos.map((m, i) => (\n          <div key={i} className={`min-w-0 ${i % 4 === 1 || i % 4 === 2 ? '@4xl:col-span-2' : ''}`}>\n            <Media path={['photos', i]} value={m} ratio=\"auto\" className=\"h-[19rem] w-full rounded-none @4xl:h-[29.5rem] [&>img]:size-full [&>img]:object-cover\" />\n          </div>\n        ))}\n      </div>\n    </section>\n  );\n}\n\nexport default withHeadingLevel(GalleryMosaic);\n"
    }
  ]
}
