{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "download-desktop",
  "type": "registry:block",
  "title": "Download, desktop builds",
  "description": "Desktop builds side by side: one card per platform with version, what it runs on, size and a download link that names its platform, then the system requirements for each platform as definition lists. Nothing is detected, so every build is always offered.",
  "categories": [
    "download"
  ],
  "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/kit-c-proof.json"
  ],
  "files": [
    {
      "path": "src/blocks/download-desktop/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/download-desktop/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(300),\n  /** Every platform is offered; nothing is detected, so a person on any machine can pick any build. */\n  builds: z.array(z.object({ platform: t(24), version: t(16), detail: t(60), size: t(16), href: t(300) })).min(2).max(4),\n  /** The download link's text on every build; the platform follows it for screen readers. */\n  downloadLabel: t(30),\n  requirementsTitle: t(60),\n  /** One list of requirements per platform, in the same order as `builds`. */\n  requirements: z.array(z.object({ platform: t(24), rows: z.array(z.object({ label: t(24), value: t(70) })).min(2).max(4) })).min(2).max(4),\n  /** An optional line about checking the download. */\n  checksum: t(160).optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'download-desktop',\n  aliases: ['download/desktop'],\n  name: 'Download, desktop builds',\n  category: 'download',\n  role: 'body',\n  description: 'Desktop builds side by side: one card per platform with version, what it runs on, size and a download link that names its platform, then the system requirements for each platform as definition lists. Nothing is detected, so every build is always offered.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the topic',\n    title: 'Say what they can download for a computer',\n    description: 'Say in one sentence which systems it runs on and how to pick one.',\n    builds: [\n      { platform: 'First system', version: '2.4.1', detail: 'Say which editions it covers', size: '00 MB', href: '#mac' },\n      { platform: 'Second system', version: '2.4.1', detail: 'Say which versions it supports', size: '00 MB', href: '#windows' },\n      { platform: 'Third system', version: '2.4.1', detail: 'Say which package or edition it is', size: '00 MB', href: '#linux' },\n    ],\n    downloadLabel: 'Main action',\n    requirementsTitle: 'Name what the system needs',\n    requirements: [\n      { platform: 'First system', rows: [{ label: 'First need', value: 'Name the oldest version' }, { label: 'Second need', value: '0 GB' }, { label: 'Third need', value: '000 MB free' }] },\n      { platform: 'Second system', rows: [{ label: 'First need', value: 'Name the oldest version' }, { label: 'Second need', value: '0 GB' }, { label: 'Third need', value: '000 MB free' }] },\n      { platform: 'Third system', rows: [{ label: 'First need', value: 'Name the oldest version and any library' }, { label: 'Second need', value: '0 GB' }, { label: 'Third need', value: '000 MB free' }] },\n    ],\n    checksum: 'Say that each file is signed and where the checksums are listed for checking.',\n  },\n});\n"
    },
    {
      "path": "src/blocks/download-desktop/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/download-desktop/index.tsx",
      "content": "import { useId } from 'react';\nimport { Download } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { ButtonLink } from '../../ui/button';\nimport { Container, Opt, Section, useEditing } from '../_shared/kit';\nimport { Heading, useHeadingId } from '../_shared/c-proof-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\nfunction DownloadDesktop({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const uid = useId();\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-12 grid gap-4 @3xl:grid-cols-2 @5xl:grid-cols-3\">\n          {props.builds.map((b, i) => (\n            <li key={i} className=\"flex flex-col gap-4 rounded-kh-xl border border-kh-line bg-kh-surface p-6\">\n              <div>\n                <Text path={['builds', i, 'platform']} value={b.platform} as=\"h3\" className=\"text-kh-heading font-semibold\" />\n                <p className=\"mt-1 text-kh-small text-kh-muted\">\n                  <Text path={['builds', i, 'detail']} value={b.detail} as=\"span\" />\n                </p>\n              </div>\n              <p className=\"flex items-baseline gap-3 text-kh-small tabular-nums text-kh-muted\">\n                <Text path={['builds', i, 'version']} value={b.version} as=\"span\" className=\"font-medium text-kh-ink\" />\n                <Text path={['builds', i, 'size']} value={b.size} as=\"span\" />\n              </p>\n              {(props.downloadLabel || editing) && (\n                <ButtonLink href={b.href} variant={i === 0 ? 'primary' : 'secondary'} size=\"md\" icon={<Download aria-hidden className=\"size-4\" />} className=\"mt-auto self-start\">\n                  <Text path={['downloadLabel']} value={props.downloadLabel} as=\"span\" placeholder=\"Label\" />\n                  {' '}\n                  <span className=\"sr-only\">{b.platform}</span>\n                </ButtonLink>\n              )}\n            </li>\n          ))}\n        </ul>\n        <section aria-labelledby={props.requirementsTitle || editing ? `${uid}-r` : undefined} className=\"mt-16\">\n          {(props.requirementsTitle || editing) && (\n            <h3 id={`${uid}-r`} className=\"text-kh-heading font-semibold\">\n              <Text path={['requirementsTitle']} value={props.requirementsTitle} as=\"span\" />\n            </h3>\n          )}\n          <div className=\"mt-6 grid gap-8 @3xl:grid-cols-2 @5xl:grid-cols-3\">\n            {props.requirements.map((r, i) => (\n              <div key={i}>\n                {(r.platform || editing) && <Text path={['requirements', i, 'platform']} value={r.platform} as=\"h4\" className=\"border-b border-kh-line pb-2 text-kh-small font-semibold\" />}\n                <dl className=\"mt-3 flex flex-col gap-3\">\n                  {r.rows.map((row, k) => (\n                    <div key={k}>\n                      <dt className=\"text-kh-caption text-kh-muted\">\n                        <Text path={['requirements', i, 'rows', k, 'label']} value={row.label} as=\"span\" />\n                      </dt>\n                      <dd className=\"m-0 text-kh-small\">\n                        <Text path={['requirements', i, 'rows', k, 'value']} value={row.value} as=\"span\" />\n                      </dd>\n                    </div>\n                  ))}\n                </dl>\n              </div>\n            ))}\n          </div>\n        </section>\n        <Opt path={['checksum']} value={props.checksum} className=\"mt-12 max-w-kh-lead text-kh-small text-kh-muted\" placeholder=\"About checking the download\" />\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(DownloadDesktop);\n"
    }
  ]
}
