{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rows-alternating",
  "type": "registry:block",
  "title": "Rows, picture and text",
  "description": "A centred heading and line, then one row per place or offer: a wide picture on one side, its name, a small line, a short text and a button on the other. The picture swaps sides row by row; on a phone each row stacks picture first.",
  "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/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/rows-alternating/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/rows-alternating/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  /** The heading's light first word, then its bold second part after a thin rule. */\n  title: t(24),\n  titleAccent: t(24),\n  description: t(300),\n  items: z\n    .array(z.object({ title: t(40), detail: t(60), description: t(240), media, link }))\n    .min(1)\n    .max(6),\n});\n\nexport const spec = defineSpec({\n  type: 'rows-alternating',\n  aliases: [],\n  name: 'Rows, picture and text',\n  category: 'features',\n  role: 'body',\n  description: 'A centred heading and line, then one row per place or offer: a wide picture on one side, its name, a small line, a short text and a button on the other. The picture swaps sides row by row; on a phone each row stacks picture first.',\n  schema,\n  defaults: {\n    title: 'Our',\n    titleAccent: 'Name them',\n    description: 'Say in a line or two where they are or what they share, and what the reader can choose between below.',\n    items: [\n      {\n        title: 'Name the place',\n        detail: 'Its address or its kind',\n        description: 'Say what it is like and who it suits best, in a sentence or two.',\n        media: { src: '', alt: 'Show the place from the inside, bright and lived in' },\n        link: { label: 'Show this place', href: '#place-one' },\n      },\n      {\n        title: 'Name the second place',\n        detail: 'Its address or its kind',\n        description: 'Say what it is like and who it suits best, in a sentence or two.',\n        media: { src: '', alt: 'Show the second place from the inside' },\n        link: { label: 'Show this place', href: '#place-two' },\n      },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/rows-alternating/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/rows-alternating/index.tsx",
      "content": "import { useContext, useId } from 'react';\nimport { HeadingLevelContext, Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Section } from '../_shared/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\nfunction RowsAlternating({ props }: BlockProps<Props>) {\n  const id = useId();\n  const H = `h${useContext(HeadingLevelContext)?.level ?? '2'}` as 'h1' | 'h2';\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <div className=\"mx-auto max-w-kh-narrow text-center\">\n          <H id={id} className=\"flex flex-wrap items-center justify-center gap-x-3 text-[length:var(--kh-text-display)] leading-none [text-transform:uppercase] tracking-widest\">\n            <Text path={['title']} value={props.title} className=\"font-light\" />\n            <span aria-hidden className=\"h-[1em] w-[2px] bg-kh-ink\" />\n            <Text path={['titleAccent']} value={props.titleAccent} className=\"font-bold\" />\n          </H>\n          <Text path={['description']} value={props.description} as=\"p\" multiline className=\"mx-auto mt-8 max-w-[36rem] text-kh-lead tracking-wide text-kh-muted\" />\n        </div>\n        <div className=\"mt-16 space-y-16 @4xl:mt-24 @4xl:space-y-24\">\n          {props.items.map((item, i) => (\n            <div key={i} className=\"grid items-center gap-8 @4xl:grid-cols-2 @4xl:gap-20\">\n              <Media path={['items', i, 'media']} value={item.media} ratio=\"16 / 9\" className={cn('w-full', i % 2 === 1 && '@4xl:order-2')} />\n              <div>\n                <Text path={['items', i, 'title']} value={item.title} as=\"h3\" className=\"text-kh-heading font-bold tracking-widest\" />\n                <Text path={['items', i, 'detail']} value={item.detail} as=\"p\" className=\"mt-3 text-kh-small tracking-widest text-kh-muted\" />\n                <Text path={['items', i, 'description']} value={item.description} as=\"p\" multiline className=\"mt-5 text-kh-lead tracking-wide text-kh-muted\" />\n                <div className=\"mt-8\">\n                  <ActionLink path={['items', i, 'link']} value={item.link} size=\"md\" />\n                </div>\n              </div>\n            </div>\n          ))}\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(RowsAlternating);\n"
    }
  ]
}
