{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "features-bento",
  "type": "registry:block",
  "title": "Features, bento",
  "description": "A mixed-size tile grid of up to seven features. Medium and large tiles carry an image, small tiles stay text-only. Pair a large tile with a small one.",
  "categories": [
    "features"
  ],
  "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/features-bento/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/features-bento/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, icon, media, t } from '../_shared/schema';\n\nconst tile = z.object({\n  /** Tile size: 'sm' is a third of the row, 'md' a half, 'lg' two thirds. */\n  layout: z.enum(['sm', 'md', 'lg']),\n  icon,\n  title: t(60),\n  description: t(200),\n  media,\n});\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(300),\n  tiles: z.array(tile).min(2).max(7),\n});\n\n// Each tile with a picture shows one of our own app screens, light and dark.\nconst SHOTS = [['shell', 'Show the product as a whole, with its main menu'], ['dashboard', 'Show the key numbers at a glance, with a chart'], ['table', 'Show a list of items, close'], ['calendar', 'Show a calendar view with one day chosen'], ['settings', 'Show a settings view with a plan and its use']] as const;\nlet shotNo = 0;\nconst tileOf = (layout: 'sm' | 'md' | 'lg', i: z.infer<typeof icon>, title: string, description: string) => {\n  const [, alt] = SHOTS[shotNo++ % SHOTS.length]!;\n  return { layout, icon: i, title, description, media: { src: '', alt } };\n};\n\nexport const spec = defineSpec({\n  type: 'features-bento',\n  aliases: ['features/bento'],\n  name: 'Features, bento',\n  category: 'features',\n  role: 'body',\n  description: 'A mixed-size tile grid of up to seven features. Medium and large tiles carry an image, small tiles stay text-only. Pair a large tile with a small one.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the topic',\n    title: 'Say what the whole product gives the reader',\n    description: 'Say in one sentence what the features below have in common and who they help.',\n    tiles: [\n      tileOf('md', 'layers', 'Name the first feature', 'Say what the first feature does and why it helps, in a sentence or two of plain words.'),\n      tileOf('md', 'zap', 'Name feature two', 'Say what the second feature does and why it helps, in a sentence or two of plain words.'),\n      tileOf('sm', 'shield', 'Name the third feature', 'Say what the third feature does for the reader.'),\n      tileOf('sm', 'clock', 'Name the fourth feature', 'Say what the fourth feature does for the reader.'),\n      tileOf('sm', 'users', 'Name the fifth feature', 'Say what the fifth feature does for the reader.'),\n      tileOf('md', 'chart', 'Name the sixth feature, longer', 'Say what the sixth feature does and when the reader gets its result.'),\n      tileOf('md', 'settings', 'Name the seventh feature', 'Say what the seventh feature does and how the reader can switch it off or change it.'),\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/features-bento/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/features-bento/index.tsx",
      "content": "import { Media, Text, withHeadingLevel } from '../../editing';\nimport { Container, Icon, Section, useEditing } from '../_shared/kit';\nimport { Heading, 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 SPAN = {\n  'sm': '@2xl:col-span-2',\n  'md': '@2xl:col-span-3',\n  'lg': '@2xl:col-span-4',\n} as const;\n\nfunction FeaturesBento({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const editing = useEditing();\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <Heading id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />\n        <ul className=\"mt-14 grid gap-4 @2xl:grid-cols-6\">\n          {props.tiles.map((tile, i) => {\n            const big = tile.layout !== 'sm';\n            return (\n              <li key={i} className={cn('flex flex-col overflow-hidden rounded-kh-xl border border-kh-line bg-kh-surface', SPAN[tile.layout])}>\n                <div className=\"p-7\">\n                  <span className=\"inline-flex size-10 items-center justify-center rounded-kh border border-kh-line bg-kh-canvas text-kh-accent-ink\">\n                    <Icon name={tile.icon} />\n                  </span>\n                  <Text path={['tiles', i, 'title']} value={tile.title} as=\"h3\" className=\"mt-5 text-kh-heading font-semibold\" />\n                  <Text path={['tiles', i, 'description']} value={tile.description} as=\"p\" className={cn('mt-2 text-kh-body text-kh-muted', big && 'max-w-kh-lead')} />\n                </div>\n                {(big || hasImage(tile.media) || editing) && (\n                  <div className=\"mt-auto px-7 pb-7\">\n                    <div className=\"overflow-hidden rounded-kh-lg border border-kh-line\">\n                      <Media path={['tiles', i, 'media']} value={tile.media} ratio={tile.layout === 'lg' ? '16 / 8' : '16 / 7'} />\n                    </div>\n                  </div>\n                )}\n              </li>\n            );\n          })}\n        </ul>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(FeaturesBento);\n"
    }
  ]
}
