{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-tiers",
  "type": "registry:block",
  "title": "Pricing, three tiers",
  "description": "Up to three plans side by side with price, feature list and a button. One can be featured.",
  "categories": [
    "pricing"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "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/pricing-tiers/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/pricing-tiers/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t } from '../_shared/schema';\n\nconst tier = z.object({\n  name: t(40),\n  price: t(16),\n  period: t(24),\n  description: t(120),\n  features: z.array(t(80)).max(8),\n  cta: link,\n  featured: z.boolean(),\n});\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(120),\n  description: t(300),\n  /** Header alignment: centred (the default) or at the start, to share the left edge of a left-aligned page. */\n  align: z.enum(['start', 'center']).optional(),\n  /** Draw the heading on a dark band behind the top half, with the cards overlapping its lower edge. Off (the default) is the plain section. */\n  band: z.boolean().optional(),\n  /** A button on the header row, right of the heading (under it on a phone); the header then sits at the start. Absent (the default) draws no button. Ignored with band. */\n  headerAction: link.partial().optional(),\n  /** Where each card's button sits: under the price (the default) or at the foot, under the feature list, with the buttons lined up across cards of equal height. */\n  ctaPosition: z.enum(['price', 'foot']).optional(),\n  /** The price in display size instead of title size, for plans that lead with the number. Off (the default) keeps the title-size price. */\n  largePrice: z.boolean().optional(),\n  tiers: z.array(tier).min(1).max(4) // KB-178: raised from 3; four plans sit in two columns, then four from a wide container\n,\n});\n\nexport const spec = defineSpec({\n  type: 'pricing-tiers',\n  aliases: ['pricing/tiers'],\n  sourceRuns: ['rmwj1xvt71d197c', 'rmwj1qf9v4d1c5f', 'rmwj0rwh5e6b1bb', 'rmwj1q2v51e44ef', 'rmwj0s80f11bde6'],\n  name: 'Pricing, three tiers',\n  category: 'pricing',\n  role: 'body',\n  description: 'Up to three plans side by side with price, feature list and a button. One can be featured.',\n  schema,\n  defaults: {\n    eyebrow: 'Section name',\n    title: 'Say how the plans are chosen',\n    description: 'Say in one sentence what every plan includes and what the choice is about.',\n    tiers: [\n      {\n        name: 'First plan',\n        price: '$00',\n        period: 'billing period',\n        description: 'Say who this plan suits in one line',\n        features: ['Name a first feature', 'Name a feature', 'Name a third feature', 'Name a feature'],\n        cta: { label: 'Main action', href: '#start' },\n        featured: false,\n      },\n      {\n        name: 'Second plan',\n        price: '$00',\n        period: 'per unit, per period',\n        description: 'Say who this plan suits in one line',\n        features: ['Name a first feature', 'Name a second feature', 'Name a third feature', 'Name a feature', 'Name a fifth feature'],\n        cta: { label: 'Main action', href: '#trial' },\n        featured: true,\n      },\n      {\n        name: 'Third plan',\n        price: '$00',\n        period: 'per unit, per period',\n        description: 'Say who this plan suits in one line',\n        features: ['Name a first feature', 'Name a feature', 'Name a feature', 'Name a feature', 'Name a feature this plan adds'],\n        cta: { label: 'Second action', href: '#sales' },\n        featured: false,\n      },\n    ],\n  },\n});\n"
    },
    {
      "path": "src/blocks/pricing-tiers/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/pricing-tiers/index.tsx",
      "content": "import { useId } from 'react';\nimport { Check } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Container, Section, SectionHeader, nowrapIfShort } 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 PricingTiers({ props }: BlockProps<Props>) {\n  const id = useId();\n  const band = props.band === true;\n  const foot = props.ctaPosition === 'foot';\n  const action = !band && props.headerAction ? { label: props.headerAction.label ?? '', href: props.headerAction.href ?? '' } : null;\n  const header = <SectionHeader id={id} eyebrow={props.eyebrow} title={props.title} description={props.description} align={props.align === 'start' || action ? 'left' : 'center'} />;\n  return (\n    <Section labelledBy={id} className={band ? 'pt-0' : undefined}>\n      {band ? (\n        // The dark band: its own colours for the heading (muted and accent text step to the on-primary tone), and the cards below pull up over it.\n        <div className=\"bg-kh-primary pt-kh-section pb-40 text-kh-on-primary [--kh-accent-ink:var(--kh-on-primary)] [--kh-muted:color-mix(in_oklab,var(--kh-on-primary)_80%,transparent)] @3xl:pb-48\">\n          <Container>{header}</Container>\n        </div>\n      ) : null}\n      <Container className={band ? 'relative -mt-24 @3xl:-mt-32' : undefined}>\n        {band ? null : action ? (\n          <div className=\"mx-auto flex max-w-kh-page flex-col gap-6 @3xl:flex-row @3xl:items-end @3xl:justify-between\">\n            {header}\n            <ActionLink path={['headerAction']} value={action} size=\"md\" className=\"shrink-0 self-start @3xl:self-auto\" />\n          </div>\n        ) : header}\n        <ul className={cn(cn('mx-auto grid max-w-kh-page items-stretch gap-5 @4xl:grid-cols-3', !band && (action ? 'mt-12' : 'mt-14')), props.tiers.length === 4 && '@4xl:grid-cols-2 @6xl:grid-cols-4')}>\n          {props.tiers.map((tier, i) => (\n            // Side by side, each card spans five rows of the list's grid (subgrid): name, description, price, button and features line up\n            // across the cards whatever their copy length, and the leftover height goes under the shortest list (klarbuilder 13:07).\n            <li key={i} className={cn('flex flex-col rounded-kh-xl border p-8', !foot && '@4xl:row-span-5 @4xl:grid @4xl:grid-rows-subgrid @4xl:gap-y-0', tier.featured ? 'border-kh-ink bg-kh-surface shadow-kh-3' : 'border-kh-line bg-kh-surface')}>\n              <Text path={['tiers', i, 'name']} value={tier.name} as=\"h3\" className=\"text-kh-heading font-semibold\" />\n              <Text path={['tiers', i, 'description']} value={tier.description} as=\"p\" className=\"mt-2 text-kh-small text-kh-muted\" />\n              <p className=\"mt-6 flex items-baseline gap-2\">\n                <Text path={['tiers', i, 'price']} value={tier.price} as=\"span\" className={cn(nowrapIfShort(tier.price), props.largePrice ? 'text-kh-display font-semibold tabular-nums' : 'text-kh-title font-semibold tabular-nums')} />\n                <Text path={['tiers', i, 'period']} value={tier.period} as=\"span\" className=\"text-kh-small text-kh-muted\" />\n              </p>\n              {foot ? null : <ActionLink path={['tiers', i, 'cta']} value={tier.cta} variant={tier.featured ? 'primary' : 'secondary'} size=\"md\" className=\"mt-6 w-full\" />}\n              <ul className={foot ? 'mt-6 flex-1 space-y-3' : 'mt-8 space-y-3 border-t border-kh-line pt-6'}>\n                {tier.features.map((f, j) => (\n                  <li key={j} className=\"flex items-start gap-3 text-kh-small\">\n                    <Check aria-hidden className=\"mt-0.5 size-4 shrink-0 text-kh-accent-ink\" strokeWidth={2.25} />\n                    <Text path={['tiers', i, 'features', j]} value={f} as=\"span\" />\n                  </li>\n                ))}\n              </ul>\n              {foot ? <ActionLink path={['tiers', i, 'cta']} value={tier.cta} variant={tier.featured ? 'primary' : 'secondary'} size=\"md\" className=\"mt-8 w-full\" /> : null}\n            </li>\n          ))}\n        </ul>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(PricingTiers);\n"
    }
  ]
}
