{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-packages",
  "type": "registry:block",
  "title": "Pricing, packages",
  "description": "A grid of three to six packages: name, one line on what you get, how long it takes, a price or the word \"Ask\" (never a made-up number), an optional flag, a button each, a visible \"Examples\" tag and an optional monthly line underneath.",
  "categories": [
    "pricing"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/badge.json",
    "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-packages/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/pricing-packages/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, req, t } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60).optional(),\n  title: req(120),\n  description: t(300).optional(),\n  /** A visible tag on the section (\"Examples\"): says the grid is a sample of what is built, not the full menu. */\n  label: t(24).optional(),\n  packages: z\n    .array(\n      z.object({\n        name: req(40),\n        summary: t(120),\n        /** How long it takes, in words: \"Days, not months\". */\n        duration: t(40),\n        /** shown: the price is printed. ask: the block prints `askLabel` instead and `price` is ignored, so an unruled price never appears as a number. */\n        priceState: z.enum(['shown', 'ask']),\n        /** The text before the price (\"from\"). Optional. */\n        pricePrefix: t(12).optional(),\n        price: t(24),\n        /** A short flag on the card (\"Start here\"). Optional. */\n        badge: t(24).optional(),\n        cta: link,\n      }),\n    )\n    .min(3)\n    .max(6),\n  /** What is printed where the price is not given: \"Ask\". */\n  askLabel: req(24),\n  /** The word before the duration (\"Takes\"). */\n  durationLabel: t(20),\n  /** An optional line under the grid for the monthly \"keep it running\" offer. */\n  keep: z.object({ label: t(40), text: t(200) }).optional(),\n});\n\nexport const spec = defineSpec({\n  type: 'pricing-packages',\n  aliases: ['pricing/packages'],\n  name: 'Pricing, packages',\n  category: 'pricing',\n  role: 'body',\n  description: 'A grid of three to six packages: name, one line on what you get, how long it takes, a price or the word \"Ask\" (never a made-up number), an optional flag, a button each, a visible \"Examples\" tag and an optional monthly line underneath.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the section',\n    title: 'Say what the packages have in common',\n    description: 'Say in a sentence or two what the packages are and how to ask for something else.',\n    label: 'A short tag',\n    packages: [\n      { name: 'Name a package', summary: 'Say in one line what you get from this package, and who it is for.', duration: '00 days', priceState: 'shown', pricePrefix: 'from', price: '00 000 kr', badge: 'A short flag', cta: { label: 'Main action', href: '#review' } },\n      { name: 'Name a package', summary: 'Say in one line what you get from this package, and who it is for.', duration: '0 weeks', priceState: 'ask', price: '', cta: { label: 'Main action', href: '#review' } },\n      { name: 'Name a package', summary: 'Say in one line what you get from this package, and who it is for.', duration: '00 days', priceState: 'ask', price: '', cta: { label: 'Main action', href: '#review' } },\n      { name: 'Name a package', summary: 'Say in one line what you get from this package, and who it is for.', duration: '00 days', priceState: 'shown', pricePrefix: 'from', price: '00 000 kr', cta: { label: 'Main action', href: '#review' } },\n    ],\n    askLabel: 'Ask',\n    durationLabel: 'Takes',\n    keep: { label: 'Name the ongoing offer', text: 'Say in a sentence what the monthly offer covers and what it costs.' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/pricing-packages/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/pricing-packages/index.tsx",
      "content": "import { useId } from 'react';\nimport { Clock } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Badge } from '../../ui/badge';\nimport { ActionLink, Container, Opt, Section, useEditing, 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\nconst COLS = { 3: '@2xl:grid-cols-3', 4: '@2xl:grid-cols-2 @5xl:grid-cols-4', 5: '@2xl:grid-cols-2 @5xl:grid-cols-3', 6: '@2xl:grid-cols-2 @5xl:grid-cols-3' } as const;\n\nfunction PricingPackages({ props }: BlockProps<Props>) {\n  const id = useId();\n  const editing = useEditing();\n  const n = Math.min(6, Math.max(3, props.packages.length)) as 3 | 4 | 5 | 6;\n  return (\n    <Section labelledBy={id}>\n      <Container>\n        <div className=\"max-w-kh-narrow\">\n          {(props.eyebrow || props.label || editing) && (\n            <div className=\"mb-4 flex flex-wrap items-center gap-x-3 gap-y-2\">\n              <Opt path={['eyebrow']} value={props.eyebrow} as=\"p\" className=\"text-kh-small font-medium text-kh-accent-ink\" placeholder=\"Eyebrow\" />\n              {(props.label || editing) && (\n                <Badge tone=\"outline\">\n                  <Text path={['label']} value={props.label ?? ''} as=\"span\" placeholder=\"Tag\" />\n                </Badge>\n              )}\n            </div>\n          )}\n          <div id={id}>\n            <Text path={['title']} value={props.title} as=\"h2\" className=\"text-kh-title font-semibold\" />\n          </div>\n          <Opt path={['description']} value={props.description} className=\"mt-4 max-w-kh-lead text-kh-lead text-kh-muted\" placeholder=\"Description\" />\n        </div>\n        <ul className={cn('mt-12 grid gap-x-5 gap-y-0', COLS[n])}>\n          {props.packages.map((p, i) => {\n            const ask = p.priceState === 'ask';\n            return (\n              <li key={i} className=\"mb-5 grid grid-rows-subgrid gap-y-0 rounded-kh-xl border border-kh-line bg-kh-surface p-6 shadow-kh-1 row-span-5 @xl:p-7\">\n                <div className=\"flex min-h-7 items-start justify-between gap-3\">\n                  <Text path={['packages', i, 'name']} value={p.name} as=\"h3\" className=\"min-w-0 text-kh-heading font-semibold\" />\n                  <Opt path={['packages', i, 'badge']} value={p.badge} as=\"span\" className=\"max-w-[60%] shrink-0 [overflow-wrap:anywhere] rounded-kh-pill bg-kh-accent-soft px-2.5 py-0.5 text-kh-caption font-medium text-kh-accent-ink\" placeholder=\"Flag\" />\n                </div>\n                <Text path={['packages', i, 'summary']} value={p.summary} as=\"p\" className=\"mt-2 text-kh-small text-kh-muted\" />\n                <p className=\"mt-5 flex items-center gap-2 text-kh-small text-kh-muted\">\n                  <Clock aria-hidden className=\"size-4 shrink-0\" />\n                  <Text path={['durationLabel']} value={props.durationLabel} as=\"span\" />\n                  <Text path={['packages', i, 'duration']} value={p.duration} as=\"span\" className=\"font-medium text-kh-ink\" />\n                </p>\n                <p className={cn('mb-0 mt-4 flex items-baseline gap-x-2', nowrapIfShort(p.price) === 'whitespace-nowrap' ? 'whitespace-nowrap' : 'flex-wrap')}>\n                  {!ask && <Opt path={['packages', i, 'pricePrefix']} value={p.pricePrefix} as=\"span\" className=\"text-kh-small text-kh-muted\" placeholder=\"from\" />}\n                  {ask ? (\n                    <Text path={['askLabel']} value={props.askLabel} as=\"span\" className=\"text-kh-heading font-semibold text-kh-muted\" />\n                  ) : (\n                    <Text path={['packages', i, 'price']} value={p.price} as=\"span\" className={cn(nowrapIfShort(p.price), 'font-semibold tabular-nums', n >= 4 ? 'text-kh-heading' : 'text-kh-title')} />\n                  )}\n                  {editing && ask && <Text path={['packages', i, 'price']} value={p.price} as=\"span\" className=\"sr-only\" />}\n                </p>\n                <div className=\"flex flex-col pt-6\">\n                  <ActionLink path={['packages', i, 'cta']} value={p.cta} variant=\"secondary\" size=\"md\" className=\"w-full\" />\n                </div>\n              </li>\n            );\n          })}\n        </ul>\n        {props.keep && (props.keep.label || props.keep.text || editing) && (\n          <div className=\"mt-8 flex flex-col gap-1 rounded-kh-xl border border-dashed border-kh-line-strong px-6 py-5 @xl:flex-row @xl:items-baseline @xl:gap-4\">\n            <Text path={['keep', 'label']} value={props.keep.label} as=\"p\" className=\"text-kh-small font-semibold\" />\n            <Text path={['keep', 'text']} value={props.keep.text} as=\"p\" className=\"text-kh-small text-kh-muted\" />\n          </div>\n        )}\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(PricingPackages);\n"
    }
  ]
}
