{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "features-tabs-cards",
  "type": "registry:block",
  "title": "Features, tab cards",
  "description": "A left-aligned heading and lead above a numbered list of cards at the left, the first open with its line, and one picture with a caption at the right that follows the open card. Works without script; on a phone the picture sits under the list.",
  "categories": [
    "features"
  ],
  "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/features-tabs-cards/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/features-tabs-cards/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, media, t } from '../_shared/schema';\n\n// Each item is a card in a list at the left; the open card shows its line and its picture with a caption at the right, with no script.\nconst item = z.object({\n  label: t(40),\n  description: t(160),\n  caption: t(80),\n  media,\n});\n\nconst schema = z.object({\n  eyebrow: t(40),\n  title: t(100),\n  description: t(240),\n  /** A list is an array field, never a slot. The first card is open. */\n  items: z.array(item).min(2).max(6),\n  /** The heading's size: 'title' is the large one, 'heading' one step smaller. */\n  titleSize: z.enum(['title', 'heading']).default('title'),\n});\n\nexport const spec = defineSpec({\n  type: 'features-tabs-cards',\n  aliases: ['features/tabs-cards'],\n  sourceRuns: ['rmwj00n3racb9a9', 'rmwj0ra6gf3f978'],\n  name: 'Features, tab cards',\n  category: 'features',\n  role: 'body',\n  description: 'A left-aligned heading and lead above a numbered list of cards at the left, the first open with its line, and one picture with a caption at the right that follows the open card. Works without script; on a phone the picture sits under the list.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the group in two or three words',\n    title: 'Say what the list of choices takes the reader through',\n    description: 'Open with one or two short lines that tell the reader what to pick between.',\n    items: [\n      { label: 'Name the first choice', description: 'Say in one line what the reader gets from the first choice.', caption: 'Say what the picture shows', media: { src: '', alt: 'Show the first choice at work' } },\n      { label: 'Name the second choice', description: 'Say in one line what the reader gets from the second choice.', caption: 'Say what the picture shows', media: { src: '', alt: 'Show the second choice at work' } },\n      { label: 'Name the third choice', description: 'Say in one line what the reader gets from the third choice.', caption: 'Say what the picture shows', media: { src: '', alt: 'Show the third choice at work' } },\n      { label: 'Name the fourth choice', description: 'Say in one line what the reader gets from the fourth choice.', caption: 'Say what the picture shows', media: { src: '', alt: 'Show the fourth choice at work' } },\n    ],\n    titleSize: 'title',\n  },\n});\n"
    },
    {
      "path": "src/blocks/features-tabs-cards/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/features-tabs-cards/index.tsx",
      "content": "import { useId } from 'react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { Container, Opt, Section, useEditing } from '../_shared/kit';\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 num = (i: number) => String(i + 1).padStart(2, '0');\n\n// Without script: native details cards (one open at a time through `name`), and the open card's picture is drawn inside it, placed over\n// a spacer in the second column (beside the list on wide, under it on a phone), so the picture follows the open card with no JavaScript.\nfunction FeaturesTabsCards({ props }: BlockProps<Props>) {\n  const id = useId();\n  const group = useId();\n  const editing = useEditing();\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <div className=\"max-w-kh-narrow\">\n          <Opt path={['eyebrow']} value={props.eyebrow} as=\"p\" className=\"font-kh-mono text-kh-caption uppercase tracking-widest text-kh-accent-ink\" placeholder=\"Eyebrow\" />\n          <div id={id}>\n            <Text path={['title']} value={props.title} as=\"h2\" className={props.titleSize === 'heading' ? 'mt-4 font-kh-display text-kh-heading text-kh-ink' : 'mt-4 font-kh-display text-kh-title text-kh-ink'} />\n          </div>\n          <Text path={['description']} value={props.description} as=\"p\" multiline className=\"mt-4 text-kh-lead text-kh-ink-2\" />\n        </div>\n        {editing ? (\n          <div className=\"mt-12 grid gap-10\">\n            {props.items.map((it, i) => (\n              <div key={i} className=\"grid gap-6 @4xl:grid-cols-[1fr_1.5fr] @4xl:gap-16\">\n                <div className=\"rounded-kh-lg border border-kh-line bg-kh-surface p-5\">\n                  <Text path={['items', i, 'label']} value={it.label} as=\"p\" className=\"text-kh-heading\" />\n                  <Text path={['items', i, 'description']} value={it.description} as=\"p\" multiline className=\"mt-2 text-kh-body text-kh-muted\" />\n                </div>\n                <figure className=\"flex flex-col gap-3\">\n                  <Media path={['items', i, 'media']} value={it.media} ratio=\"4 / 3\" className=\"w-full rounded-kh-xl shadow-kh-2\" />\n                  <Text path={['items', i, 'caption']} value={it.caption} as=\"figcaption\" className=\"text-kh-caption text-kh-muted\" />\n                </figure>\n              </div>\n            ))}\n          </div>\n        ) : (\n          <div className=\"relative mt-12 grid gap-10 @4xl:grid-cols-[1fr_1.5fr] @4xl:gap-16\">\n            <div className=\"flex flex-col gap-3\">\n              {props.items.map((it, i) => (\n                <details\n                  key={i}\n                  name={group}\n                  open={i === 0}\n                  className=\"group rounded-kh-lg border border-kh-line bg-kh-surface hover:border-kh-line-strong hover:bg-kh-surface-2 open:border-kh-accent open:bg-kh-accent-soft open:shadow-kh-1\"\n                >\n                  <summary className=\"flex min-h-11 cursor-pointer list-none items-start gap-4 p-5 text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--kh-focus) [&::-webkit-details-marker]:hidden\">\n                    <span aria-hidden className=\"font-kh-mono text-kh-small text-kh-muted group-open:text-kh-accent-ink\">{num(i)}</span>\n                    <Text path={['items', i, 'label']} value={it.label} as=\"span\" className=\"font-kh-display text-kh-heading text-kh-ink\" />\n                  </summary>\n                  <Text path={['items', i, 'description']} value={it.description} as=\"p\" multiline className=\"-mt-3 px-5 pb-5 pl-[3.25rem] text-kh-body text-kh-ink-2\" />\n                  <figure className=\"absolute bottom-0 left-0 right-0 flex flex-col gap-3 @4xl:bottom-auto @4xl:left-[calc(40%+2.4rem)] @4xl:top-0\">\n                    <Media path={['items', i, 'media']} value={it.media} ratio=\"4 / 3\" className=\"w-full rounded-kh-xl shadow-kh-2\" />\n                    <Text path={['items', i, 'caption']} value={it.caption} as=\"figcaption\" className=\"text-kh-caption text-kh-muted\" />\n                  </figure>\n                </details>\n              ))}\n            </div>\n            {/* Holds the room the open picture takes (4:3 and a caption line), so the list and the section grow to it. */}\n            <div aria-hidden className=\"flex flex-col gap-3\">\n              <div className=\"aspect-[4/3] w-full\" />\n              <div className=\"text-kh-caption\">&nbsp;</div>\n            </div>\n          </div>\n        )}\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(FeaturesTabsCards);\n"
    }
  ]
}
