{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "features-split",
  "type": "registry:block",
  "title": "Features, alternating",
  "description": "Feature rows with copy beside an image, alternating sides. Each row has a title, description and up to four points.",
  "categories": [
    "features"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "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/text-link.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/features-split/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/features-split/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, media, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(900), // KB-178: longest real text 780 chars (tetris-flytt); blank lines draw as paragraph gaps\n  // Optional: the picture opens every row (on a phone it sits above its text, on a wide screen the first row has it on the left). Unset keeps the text first.\n  mediaFirst: z.boolean().optional(),\n  // Optional header look: 'display' draws the heading at display size, 'centered' centres the whole header block. Unset keeps the default.\n  headerStyle: z.enum(['display', 'centered']).optional(),\n  // Optional: each row's link (and link2) draws as a primary (and secondary) button instead of a text link.\n  buttons: z.boolean().optional(),\n  // Optional closing pair of buttons under the last row; an empty label draws nothing.\n  actions: z.object({ primary: link.partial().optional(), secondary: link.partial().optional() }).optional(),\n  items: z\n    // description t(300) -> t(900) (C01); points text t(80) -> t(200) (C17, caroli-trafikskola and encore carry full sentences); per-row optional link.\n    // No video slot: Media draws images only.\n    .array(z.object({ title: t(80), description: t(900), points: z.array(t(200)).max(4), link: link.partial().optional(), media,\n      // Optional small pill above the row title (a tag such as \"New\" or \"Popular\"); empty draws nothing.\n      badge: t(24).optional(),\n      // Optional second link of the row; with `buttons` it draws as the secondary button next to the primary one.\n      link2: link.partial().optional(),\n    }))\n    .min(1)\n    .max(4),\n});\n\nexport const spec = defineSpec({\n  type: 'features-split',\n  aliases: ['features/alternating'],\n  sourceRuns: ['rmwj0xumhf518db', 'rmwj0yvm9212b23', 'rmwj10no287b97d', 'rmwj1vjet0adb1d', 'rmwj0y1wmca9360'],\n  name: 'Features, alternating',\n  category: 'features',\n  role: 'body',\n  description: 'Feature rows with copy beside an image, alternating sides. Each row has a title, description and up to four points.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    title: 'Say what the steps lead to',\n    description: 'Say in one sentence how many steps there are and what they replace.',\n    items: [\n      {\n        title: 'Name the first step in a few words',\n        description: 'Say what happens in the first step and what the reader gets from it, in a sentence or two.',\n        points: ['Name a first thing it does', 'Name a second thing it does', 'Name a third thing it does'],\n        media: { src: '', alt: 'Show a list of items with the details that matter for each' },\n      },\n      {\n        title: 'Name the second step',\n        description: 'Say what happens in the second step and what the reader gets from it, in a sentence or two.',\n        points: ['Name a first thing it does', 'Name a second thing', 'Name a third thing'],\n        media: { src: '', alt: 'Show a calendar view with one day chosen' },\n      },\n      {\n        title: 'Name the third step in a few words',\n        description: 'Say what happens in the third step and what the reader gets from it, in a sentence or two.',\n        points: ['Name a first one', 'Name a second one', 'Name a third one'],\n        media: { src: '', alt: 'Show a report with one overall score and what it found' },\n      },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/features-split/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/features-split/index.tsx",
      "content": "import { useId } from 'react';\nimport { ArrowUpRight, Check } from 'lucide-react';\nimport { safeHref } from '../../ui/button';\nimport { linkClass } from '../../ui/text-link';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Eyebrow, Opt, Section, SectionHeader, useEditing } 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 FeaturesSplit({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  const hasHeader = editing || !!(props.eyebrow || props.title || props.description); // a kept section can open straight on its rows\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        {hasHeader && !props.headerStyle && <SectionHeader id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} />}\n        {hasHeader && props.headerStyle && (\n          <div className={cn('max-w-kh-narrow', props.headerStyle === 'centered' && 'mx-auto text-center')}>\n            <Eyebrow path={['eyebrow']} value={props.eyebrow} />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h2\" className={cn('font-semibold', props.headerStyle === 'display' ? 'text-kh-display leading-[0.95] tracking-tight' : 'text-kh-title')} />\n            </div>\n            <Opt path={['description']} value={props.description} multiline className={cn('mt-4 max-w-kh-lead whitespace-pre-line text-kh-lead text-kh-muted', props.headerStyle === 'centered' && 'mx-auto')} placeholder=\"Description\" />\n          </div>\n        )}\n        <div className={cn(hasHeader && 'mt-16', 'space-y-20 @4xl:space-y-28')}>\n          {props.items.map((item, i) => (\n            <div key={i} className=\"grid items-center gap-10 @4xl:grid-cols-2 @4xl:gap-20\">\n              <div className={props.mediaFirst ? cn('order-2', i % 2 === 1 && '@4xl:order-first') : cn(i % 2 === 1 && '@4xl:order-2')}>\n                <Opt path={['items', i, 'badge']} value={item.badge} as=\"span\" placeholder=\"Badge\" className=\"mb-4 inline-block rounded-kh-pill bg-kh-accent-soft px-3 py-1 text-kh-caption font-medium text-kh-accent-ink\" />\n                <Opt path={['items', i, 'title']} value={item.title} as=\"h3\" className=\"text-kh-title font-semibold [font-size:calc(var(--kh-size)*1.75)]\" placeholder=\"Title\" />\n                <Text path={['items', i, 'description']} value={item.description} as=\"p\" multiline className=\"mt-4 whitespace-pre-line text-kh-lead text-kh-muted\" />\n                <ul className=\"mt-6 space-y-3\">\n                  {item.points.map((p, j) => (\n                    <li key={j} className=\"flex items-start gap-3 text-kh-body\">\n                      <span className=\"mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-kh-pill bg-kh-accent-soft text-kh-accent-ink\">\n                        <Check aria-hidden className=\"size-3\" strokeWidth={2.5} />\n                      </span>\n                      <Text path={['items', i, 'points', j]} value={p} as=\"span\" />\n                    </li>\n                  ))}\n                </ul>\n                {props.buttons ? (\n                  <div className=\"mt-6 flex flex-wrap items-center gap-3\">\n                    <ActionLink path={['items', i, 'link']} value={{ label: item.link?.label ?? '', href: item.link?.href ?? '' }} size=\"md\" />\n                    <ActionLink path={['items', i, 'link2']} value={{ label: item.link2?.label ?? '', href: item.link2?.href ?? '' }} variant=\"secondary\" size=\"md\" />\n                  </div>\n                ) : (\n                  item.link && item.link.label && (\n                    <p className=\"mt-6\">\n                      <a href={safeHref(item.link.href)} className={cn(linkClass(), 'inline-flex min-h-11 items-center gap-1 text-kh-small font-medium no-underline')}>\n                        <Text path={['items', i, 'link', 'label']} value={item.link.label} as=\"span\" />\n                        <ArrowUpRight aria-hidden className=\"size-4\" />\n                      </a>\n                    </p>\n                  )\n                )}\n              </div>\n              <Media path={['items', i, 'media']} value={item.media} ratio=\"5 / 4\" className=\"rounded-kh-xl border border-kh-line shadow-kh-2\" />\n            </div>\n          ))}\n        </div>\n        {props.actions && (\n          <div className=\"mt-16 flex flex-wrap items-center gap-3\">\n            <ActionLink path={['actions', 'primary']} value={{ label: props.actions.primary?.label ?? '', href: props.actions.primary?.href ?? '' }} />\n            <ActionLink path={['actions', 'secondary']} value={{ label: props.actions.secondary?.label ?? '', href: props.actions.secondary?.href ?? '' }} variant=\"secondary\" />\n          </div>\n        )}\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(FeaturesSplit);\n"
    }
  ]
}
