{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "banner-promo",
  "type": "registry:block",
  "title": "Banner, promo code",
  "description": "A slim bar above the navbar for a campaign: a short badge, one line of text, the discount code in a dashed chip, and a link. Empty badge or code drops that part.",
  "categories": [
    "banner"
  ],
  "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-d-chrome.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/banner-promo/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/banner-promo/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, link, t } from '../_shared/schema';\n\nconst schema = z.object({\n  badge: t(24),\n  text: t(120),\n  code: t(24),\n  link,\n});\n\nexport const spec = defineSpec({\n  type: 'banner-promo',\n  aliases: ['banner/promo'],\n  name: 'Banner, promo code',\n  category: 'banner',\n  role: 'nav',\n  description: 'A slim bar above the navbar for a campaign: a short badge, one line of text, the discount code in a dashed chip, and a link. Empty badge or code drops that part.',\n  schema,\n  defaults: {\n    badge: 'Name the offer',\n    text: 'Say what the offer is and when it applies.',\n    code: 'CODE00',\n    link: { label: 'Read more', href: '/rooms' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/banner-promo/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/banner-promo/index.tsx",
      "content": "import { ArrowRight } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { safeHref } from '../../ui/button';\nimport { Container, Opt, useEditing } from '../_shared/kit';\nimport { FOCUS } from '../_shared/d-chrome-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 BannerPromo({ props }: BlockProps<Props>) {\n  const editing = useEditing();\n  return (\n    <aside aria-label=\"Promotion\" className=\"border-b border-kh-line bg-kh-accent-fill text-kh-accent-fg\">\n      <Container className=\"flex flex-wrap items-center justify-center gap-x-4 gap-y-2 py-2.5\">\n        <Opt path={['badge']} value={props.badge} as=\"span\" className=\"rounded-kh-pill bg-kh-accent-fg px-2.5 py-0.5 text-kh-caption font-semibold uppercase tracking-wider text-kh-accent\" placeholder=\"Badge\" />\n        <Text path={['text']} value={props.text} as=\"p\" className=\"text-kh-small\" />\n        {(props.code || editing) && (\n          <p className=\"rounded-kh border border-dashed border-kh-accent-fg/60 px-2.5 py-0.5 text-kh-small\">\n            <Text path={['code']} value={props.code} as=\"code\" className=\"font-kh-mono font-semibold tracking-wide\" placeholder=\"CODE\" />\n          </p>\n        )}\n        {(props.link.label || editing) && (\n          <a href={safeHref(props.link.href)} className={cn('inline-flex min-h-8 items-center gap-1 rounded-kh-sm text-kh-small font-medium underline decoration-current/40 underline-offset-4 hover:decoration-current', FOCUS)}>\n            <Text path={['link', 'label']} value={props.link.label} as=\"span\" placeholder=\"Label\" />\n            <ArrowRight aria-hidden strokeWidth={1.75} className=\"size-4\" />\n          </a>\n        )}\n      </Container>\n    </aside>\n  );\n}\n\nexport default withHeadingLevel(BannerPromo);\n"
    }
  ]
}
