{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-kit",
  "type": "registry:lib",
  "title": "Block kit",
  "description": "The block contract (types), schema helpers, the shared layout kit , BlockSurface and the block mode.",
  "dependencies": [
    "lucide-react@^1.49.0",
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/avatar.json",
    "https://ui.klarhimmel.com/r/button.json",
    "https://ui.klarhimmel.com/r/copy-button.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/text-link.json",
    "https://ui.klarhimmel.com/r/theme.json",
    "https://ui.klarhimmel.com/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/types.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/types.ts",
      "content": "// The block contract. A block is a page section: a React component whose content is `props`,\n// validated by `schema`. Blocks are pure presentation: no data fetching, no app state.\nimport type { ComponentType } from 'react';\nimport type { z } from 'zod';\n\nexport type BlockCategory =\n  | 'navbar' | 'hero' | 'logos' | 'features' | 'content' | 'stats' | 'testimonials' | 'pricing'\n  | 'faq' | 'cta' | 'contact' | 'team' | 'blog' | 'gallery' | 'docs' | 'app' | 'footer'\n  | 'directory' | 'steps' | 'case-study' | 'newsletter' | 'banner' | 'error' | 'review' | 'report' | 'snapshot'\n  | 'integrations' | 'changelog' | 'careers' | 'comparison' | 'download' | 'cards' | 'products' | 'schedule' | 'booking';\n\n/** Everything about a block except its component. Safe to import without React (worker, MCP, exports). */\nexport interface BlockSpec<S extends z.ZodType = z.ZodType> {\n  /** kebab-case id, unique, stable forever (stored in documents): 'hero-split'. */\n  type: string;\n  /** Other names the block answers to, in `category/variant` URL form: ['header/simple']. Unique across all types and aliases. */\n  aliases?: string[];\n  /** Human name: 'Hero, split'. */\n  name: string;\n  category: BlockCategory;\n  /** Where it sits on a page. */\n  role: 'nav' | 'body' | 'foot';\n  /** One line for pickers and agents. */\n  description: string;\n  /** Content schema. Text fields are strings with a max length; lists are arrays with a max. */\n  schema: S;\n  /** Realistic default content, valid against `schema`. */\n  defaults: z.infer<S>;\n  /**\n   * Opt out of repair: invalid props show the block's own invalid notice in both modes (see docs/publish-mode.md). Set it on a block whose text is something a person consents to or that cannot be\n   * undone (an approval, a danger zone): substituting the default for an invalid field would show text nobody wrote.\n   * `<Block>` then passes invalid input through untouched, and the block's component must validate its own props\n   * (`spec.schema.safeParse`) and render an explicit invalid state with its actions disabled. See `_shared/invalid-kit.tsx`.\n   */\n  strict?: boolean;\n  /**\n   * The top-level text field that `headingLevel` moves between h1 and h2 (default 'title'). `false`: the block has no section heading\n   * (its `title` is a label), so it gets no `headingLevel` prop. The component passes the same slot to `withHeadingLevel`.\n   */\n  headingSlot?: string | false;\n  /**\n   * Optional top-level props a library row leaves out, because without script they draw a control that does nothing or change the\n   * layout for something that is not drawn (navbar-simple's themeToggle and search). The compile renders the defaults without them\n   * and the row's fields do not offer them (db/compile.tsx, `deadControls` in ./no-script).\n   */\n  rowOmit?: readonly string[];\n  /** The Klar Workshop runs this block was made from, when Felix kept generated sections (KB-443): the row's source_run, space-separated\n   *  (KB-514). */\n  sourceRuns?: readonly string[];\n}\n\nexport interface BlockProps<P> {\n  props: P;\n}\n\nexport interface BlockDef<S extends z.ZodType = z.ZodType> extends BlockSpec<S> {\n  Component: ComponentType<BlockProps<z.infer<S>>>;\n}\n"
    },
    {
      "path": "src/blocks/_shared/schema.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/_shared/schema.ts",
      "content": "// Schema helpers shared by every block spec. No React in this file: specs are imported by the worker and MCP.\nimport { z } from 'zod';\nimport { ICON_NAMES } from './icon-names';\n\nimport type { BlockSpec } from '../types';\n\n// No eval: zod's JIT probes `new Function`, which a CSP without 'unsafe-eval' blocks (kh-website's snapshot page). Jitless parsing is\n// fast enough for block props, so every page that loads a block schema works under a strict CSP.\nz.config({ jitless: true });\n\n/** A text field with a max length (the canvas props panel and the worker read these limits). */\nexport const t = (max: number) => z.string().max(max);\n/**\n * A text field that names a control, a landmark or a list item (button label, field label, heading inside a link): it may not be empty. In a\n * published page an emptied one never brings sample text back: its list item, or its control, is not drawn (docs/publish-mode.md).\n */\nexport const req = (max: number) => z.string().min(1).max(max);\nexport const link = z.object({ label: t(40), href: t(300) });\n/** An image: `src` (https or a site path), the same picture for dark mode in `srcDark` (optional), and its alt text. */\nexport const media = z.object({ src: t(500), srcDark: t(500).optional(), alt: t(200) });\n/** A small brand mark drawn before the wordmark (about 24px). Decorative next to the brand name, so alt defaults to empty. */\nexport const logo = z.object({ src: t(300), alt: t(60).optional() }).optional();\n/** Their logo in place of the brand name (navbars): any width, about 32-40px tall. The brand name stays for screen readers. */\nexport const wordmark = z.object({ src: t(300), alt: t(60).optional() }).optional();\n/**\n * The brand mark before the wordmark, as vector paths so it inherits currentColor (dark mode) and stays crisp: `paths` are SVG path\n * `d` strings in `viewBox` space (rendered as an attribute value, so markup in them is inert text), filled with currentColor; `src` is an image\n * fallback. Drawn at the brand text's cap height, aria-hidden (the link is named by the brand text).\n */\nexport const mark = z.object({\n  paths: z.array(t(4000)).max(8).optional(),\n  viewBox: t(40).optional(),\n  src: t(300).optional(),\n}).optional();\n\nexport { ICON_NAMES };\n// An icon name outside the set draws as 'box' instead of failing the whole section: a model filling a kayak page wrote 'kayak', and\n// Builder rejected features-list 5 times for it (runs tool, 15 Nov). The fields still list the set as the enum.\nexport const icon = z.enum(ICON_NAMES).catch('box');\nexport type IconName = (typeof ICON_NAMES)[number];\n\n/**\n * Type-checks that `defaults` is valid for `schema`, and gives every block that has a `title` (or its `headingSlot`) the optional `headingLevel`\n * ('1' or '2', default unchanged): the level of that title, so a page whose only heading block is a contact form or an FAQ can\n * give it the page's h1. Added here so no block repeats it; a schema that cannot be extended is left as it is.\n */\nexport const defineSpec = <S extends z.ZodType>(spec: BlockSpec<S>): BlockSpec<S> => {\n  const s = spec.schema as unknown as { shape?: Record<string, unknown>; extend?: (x: object) => z.ZodType };\n  const slot = spec.headingSlot ?? 'title';\n  if (slot === false || !s.shape || !(slot in s.shape) || 'headingLevel' in s.shape || typeof s.extend !== 'function') return spec;\n  try {\n    return { ...spec, schema: s.extend({ headingLevel: z.enum(['1', '2']).optional() }) as unknown as S };\n  } catch {\n    return spec; // refinements on the object: leave it alone\n  }\n};\n\n/**\n * Optional fields every form block shares (spread into its schema). Without `method` a form only names where it goes after the\n * host's submit handler (`action`, a flow edge in Canvas) and the block cancels the submit. With `method` (and `action`) the\n * form is a plain HTML form that submits natively, no JavaScript needed. `hidden` is name -> value, rendered as hidden inputs.\n * `captcha` renders an empty container for a bot-check widget (Turnstile); the host loads the widget, the block loads nothing.\n */\n/**\n * What a host that redirects back after a native submit (`?sent=1`) can ask the form to draw: `status` idle (default), sent or\n * error, and the words for the last two (English defaults when omitted). The block only draws it; it never knows whether a\n * request worked.\n */\n/** What a field says under itself when the browser's own validation fails: missing, not an email with a dot after the @, not an https address, not a domain. Optional on a block: English defaults. */\nexport const formErrors = z.object({ required: t(100), email: t(100), url: t(100), domain: t(100) }).partial().optional(); // each text is optional: a missing one uses the English default\n\nexport const formStatus = {\n  status: z.enum(['idle', 'sent', 'error']).optional(),\n  messages: z.object({ sent: t(160), error: t(160) }).optional(),\n};\n\nexport const formFields = {\n  action: t(300).optional(),\n  method: z.enum(['post', 'get']).optional(),\n  hidden: z.record(t(60), t(300)).optional(),\n  captcha: z.boolean().optional(),\n  captchaSitekey: t(100).optional(),\n};\n"
    },
    {
      "path": "src/blocks/_shared/icon-names.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/_shared/icon-names.ts",
      "content": "// The fixed icon set, chosen by name from props. No zod here: a page that only lists the icons imports this, not schema.ts.\nexport const ICON_NAMES = [\n  'zap', 'shield', 'layers', 'globe', 'sparkles', 'clock', 'code', 'palette', 'lock', 'chart', 'users', 'mail',\n  'heart', 'rocket', 'search', 'settings', 'check', 'star', 'book', 'box', 'cloud', 'compass', 'leaf', 'gauge',\n] as const;\n"
    },
    {
      "path": "src/blocks/_shared/kit.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/_shared/kit.tsx",
      "content": "// Layout and content pieces shared by blocks. React lives here, never in spec files.\nimport { initials as initialsOf } from '../../ui/avatar';\nimport { useContext, type ReactNode } from 'react';\nimport {\n  BookOpen, Box, ChartColumn, Check, Cloud, Code, Compass, Gauge, Globe, Heart, Layers, Leaf, Lock, Mail, Palette, Rocket,\n  Search, Settings, ShieldCheck, Sparkles, Star, Users, Zap, Clock, type LucideIcon,\n} from 'lucide-react';\nimport { EditingContext, EmptySlotMark, Media, SlotsContext, Text, slotMarks, type MediaValue, type PropPath } from '../../editing';\nimport { BUTTON_VARIANTS, ButtonLink, nameEmptied, safeHref, type ButtonSize, type ButtonVariant } from '../../ui/button';\nimport { linkClass } from '../../ui/text-link';\nimport { cn } from '../../lib/utils';\nimport { CopyButton } from '../../ui/copy-button';\nimport type { IconName } from './schema';\nimport { BlockModeContext } from '../mode';\nimport { useInPanel } from '../../lib/placement';\n\n/** True when a media value will render a real image (not the placeholder). Lives here so free blocks need no paid kit. */\nexport const hasImage = (m: MediaValue) => !!m.src && /^(https:\\/\\/|\\/(?!\\/))/.test(m.src);\n\nconst ICONS: Record<IconName, LucideIcon> = {\n  zap: Zap, shield: ShieldCheck, layers: Layers, globe: Globe, sparkles: Sparkles, clock: Clock, code: Code, palette: Palette,\n  lock: Lock, chart: ChartColumn, users: Users, mail: Mail, heart: Heart, rocket: Rocket, search: Search, settings: Settings,\n  check: Check, star: Star, book: BookOpen, box: Box, cloud: Cloud, compass: Compass, leaf: Leaf, gauge: Gauge,\n};\n\nexport function Icon({ name, className }: { name: IconName; className?: string }) {\n  const C = ICONS[name] ?? Box;\n  return <C aria-hidden strokeWidth={1.75} className={cn('size-5', className)} />;\n}\n\n/** True inside the canvas editor. Blocks use it to show everything (menus, accordions) so all copy is reachable. */\nexport const useEditing = () => !!useContext(EditingContext);\n/** Whether an empty picture slot is drawn: in the editor and the directory (preview), so the slot shows; never on a real page. */\nexport const usePictureSlots = () => useEditing() || useContext(BlockModeContext) === 'preview';\n\n/** Page-width column with the responsive gutter. */\nexport function Container({ className, children, width = 'page' }: { className?: string; children: ReactNode; width?: 'page' | 'narrow' | 'prose' }) {\n  const max = width === 'page' ? 'max-w-kh-page' : width === 'narrow' ? 'max-w-kh-narrow' : 'max-w-kh-prose';\n  // In an app panel the screen sets the width: the block fills its column.\n  if (useInPanel()) return <div className={cn('w-full min-w-0', className)}>{children}</div>;\n  return <div className={cn('mx-auto w-full px-kh-gutter', max, className)}>{children}</div>;\n}\n\n/** A body section: landmark labelled by its heading id, with the vertical rhythm. */\nexport function Section({ labelledBy, className, children, bare, flushEnd }: { labelledBy?: string; className?: string; children: ReactNode; /** No band of its own: transparent, nothing clipped (theme-core.css). */ bare?: boolean; /** No bottom padding (a picture sits on the band's edge): the next band of the same tone keeps its top padding (theme-core.css). */ flushEnd?: boolean }) {\n  if (useInPanel()) return <section aria-labelledby={labelledBy} data-kh-bare=\"\" className={cn('min-w-0', className)}>{children}</section>;\n  return (\n    <section aria-labelledby={labelledBy} data-kh-bare={bare ? '' : undefined} data-kh-flush-end={flushEnd ? '' : undefined} className={cn('py-kh-section', flushEnd && 'pb-0', className)}>\n      {children}\n    </section>\n  );\n}\n\n/** Text that is optional in the schema: rendered when set, or always while editing so it can be filled in. */\nexport function Opt({ path, value, as = 'p', className, placeholder, multiline, rich }: { path: PropPath; value: string | undefined; as?: React.ElementType; className?: string; placeholder?: string; multiline?: boolean; rich?: boolean }) {\n  const editing = useEditing();\n  if (!value && !editing) return null;\n  return <Text path={path} value={value ?? ''} as={as} className={className} placeholder={placeholder} multiline={multiline} rich={rich} />;\n}\n\nexport function Eyebrow({ path, value, className }: { path: PropPath; value: string | undefined; className?: string }) {\n  return <Opt path={path} value={value} as=\"p\" className={cn('mb-4 text-kh-small font-medium text-kh-accent-ink', className)} placeholder=\"Eyebrow\" />;\n}\n\n/** Section header: eyebrow, h2, description. `id` names the heading for aria-labelledby. */\nexport function SectionHeader({\n  base = [], id, eyebrow, title, description, align = 'left', className,\n}: { base?: PropPath; id: string; eyebrow?: string; title: string; description?: string; align?: 'left' | 'center'; className?: string }) {\n  if (useInPanel()) {\n    // Under the screen's h1: heading size, one line under it, and 1 rem to the content (-mb-6 against the blocks' mt-10).\n    return (\n      <div className={cn('-mb-6', className)}>\n        <Eyebrow path={[...base, 'eyebrow']} value={eyebrow} className=\"mb-1 text-kh-caption\" />\n        <div id={id}>\n          <Text path={[...base, 'title']} value={title} as=\"h2\" className=\"font-kh-display text-kh-heading font-semibold\" />\n        </div>\n        <Opt path={[...base, 'description']} value={description} className=\"mt-1 text-kh-small text-kh-muted\" placeholder=\"Description\" />\n      </div>\n    );\n  }\n  return (\n    <div className={cn('max-w-kh-narrow', align === 'center' && 'mx-auto text-center', className)}>\n      <Eyebrow path={[...base, 'eyebrow']} value={eyebrow} />\n      <div id={id}>\n        <Text path={[...base, 'title']} value={title} as=\"h2\" className=\"text-kh-title font-semibold\" />\n      </div>\n      <Opt path={[...base, 'description']} value={description} multiline className={cn('mt-4 max-w-kh-lead whitespace-pre-line text-kh-lead text-kh-muted', align === 'center' && 'mx-auto')} placeholder=\"Description\" />\n    </div>\n  );\n}\n\n/** Children only when `label` is non-empty, or inside an editor: the block contract for links (an empty label means no link, never a nameless <a>). */\nexport function Gate({ label, children }: { label: string | undefined; children: ReactNode }) {\n  const editing = useEditing();\n  return label || editing ? <>{children}</> : null;\n}\n\n/** An element that is not drawn when it says nothing: `<Named as=\"h2\">` around an emptied text slot. Drawn always while editing. */\nexport function Named({ as: As = 'span', children, ...rest }: { as?: React.ElementType; children?: ReactNode } & Record<string, unknown>) {\n  const editing = useEditing();\n  if (!editing && nameEmptied(children)) return null;\n  return <As {...rest}>{children}</As>;\n}\n\n/** A button-looking link whose label is an editable slot. Renders nothing for an empty label outside the editor. */\nexport function ActionLink({\n  path, value, variant = 'primary', size = 'lg', className,\n}: { path: PropPath; value: { label: string; href: string }; variant?: ButtonVariant; size?: ButtonSize; className?: string }) {\n  const editing = useEditing();\n  // In a section worked on as a composition, the button's version comes from the section's data (button/ghost), or it is emptied.\n  const slots = useContext(SlotsContext);\n  const part = slots?.partAt(path);\n  if (part === null) return <EmptySlotMark path={path} tag=\"button\" />;\n  if (!value.label && !editing) return null;\n  const v = part?.split('/')[1];\n  const look = v && (BUTTON_VARIANTS as string[]).includes(v) ? (v as ButtonVariant) : variant;\n  return (\n    <ButtonLink href={value.href} variant={look} size={size} className={className} {...slotMarks(slots, path, 'button', part ?? `button/${variant}`, !!part)}>\n      <Text path={[...path, 'label']} value={value.label} as=\"span\" placeholder=\"Label\" />\n    </ButtonLink>\n  );\n}\n\n/** A shell command with a copy button. The command is an editable slot. */\nexport function CommandBlock({ path, value, className }: { path: PropPath; value: string; className?: string }) {\n  return (\n    <div className={cn('flex min-h-12 items-center gap-3 rounded-kh-lg border border-kh-line-strong bg-kh-surface py-1.5 pl-4 pr-2 shadow-kh-1', className)}>\n      <span aria-hidden className=\"select-none font-kh-mono text-kh-small text-kh-muted\">$</span>\n      {/* The command can be longer than the box: it scrolls, so the scroller takes focus (keyboard users can read the rest). */}\n      <div role=\"group\" aria-label=\"Command\" className=\"min-w-0 flex-1 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n        <Text path={path} value={value} as=\"code\" className=\"font-kh-mono text-kh-small text-kh-ink\" />\n      </div>\n      <CopyButton value={value} label=\"Copy command\" />\n    </div>\n  );\n}\n\n/** Round avatar: the image slot, or initials when there is no image. */\nexport function Avatar({ name, className }: { name: string; className?: string }) {\n  const initials = initialsOf(name);\n  return (\n    <span aria-hidden className={cn('inline-flex size-11 shrink-0 items-center justify-center rounded-kh-pill bg-kh-accent-soft text-kh-small font-semibold text-kh-accent-ink', className)}>\n      {initials}\n    </span>\n  );\n}\n\n/**\n * Hairline grid that stays clean when the last row is short: no filler background, cells draw their own right and\n * bottom borders and the frame clips the overflow. `<HairFrame><ul className={HAIR_GRID + ' @xl:grid-cols-2'}><li className={HAIR_CELL}>`.\n */\nexport const HAIR_GRID = '-mb-px -mr-px grid';\nexport const HAIR_CELL = 'border-b border-r border-kh-line';\nexport function HairFrame({ className, children }: { className?: string; children: ReactNode }) {\n  return <div className={cn('overflow-hidden rounded-kh-xl border border-kh-line', className)}>{children}</div>;\n}\n\n/** Whether a text that names a control or a field is there: false for an emptied one outside the editor, so the control is not drawn. */\nexport function useNamed(...texts: (string | undefined)[]): boolean {\n  const editing = useEditing();\n  return editing || texts.every((t) => !!t?.trim());\n}\n\n/** A price stays on one line while it is a price; an over-long text (twice the limit, a sentence) wraps instead of widening the page. */\n/** A detail's value (a phone, an e-mail, an address): a link when it has an href (tel:, mailto:, https:), plain text when not. */\nexport function LinkedValue({ path, value, href }: { path: PropPath; value: string; href?: string }) {\n  const editing = useEditing();\n  const text = <Text path={path} value={value} as=\"span\" />;\n  if (!href || !(value || editing)) return text;\n  return <a href={safeHref(href)} className={cn(linkClass(), 'inline-flex min-h-6 items-center [overflow-wrap:anywhere]')}>{text}</a>;\n}\n\nexport const nowrapIfShort = (s: string | undefined) => ((s ?? '').length <= 24 ? 'whitespace-nowrap' : '[overflow-wrap:anywhere]');\n\n/** The brand name in a navbar, or their logo (`wordmark`) in its place: the name then stays for screen readers only. Called as a\n *  function, not rendered as <BrandName>, so Named/nameEmptied still see the Text slot and drop a link whose name was emptied. With no name the logo's\n *  own alt names the link, and the link stays. */\n/** Klar Builder App 11-06 (UI-48): beside a phone's menu button a long brand and a long call to action do not both fit, and the\n *  brand broke onto two lines ('Malmö Surdeg' + 'Order for Saturday' at 360 and 390). Measured on three presets at 320 to 430: a\n *  pair over about 22 characters wraps, a shorter one never does. A navbar with a menu moves such a call to action into the menu\n *  below @md (448 px) and the brand keeps the row. A wordmark counts as 14 characters, a mark or logo adds 2.\n *  The block's ctaInMenu prop overrides the count: false keeps the button in the bar, true always moves it. */\nexport function ctaInMenu({ brand, wordmark, mark, logo, cta, ctaInMenu: set, editing }: { brand?: string; wordmark?: { src?: string }; mark?: unknown; logo?: { src?: string }; cta?: { label?: string }; ctaInMenu?: boolean; editing: boolean }) {\n  if (editing || !cta?.label?.trim()) return false;\n  // website 11-06: 'Klarhimmel' + mark + 'Talk to Felix' counts 25 yet fits at 320, so a site that measured its own header says so.\n  if (set !== undefined) return set;\n  const brandChars = (wordmark?.src?.trim() ? 14 : (brand ?? '').trim().length) + (mark || logo?.src ? 2 : 0);\n  return brandChars + cta.label.trim().length > 22;\n}\n\nexport function brandName({ brand, wordmark, className, placeholder }: { brand: string | undefined; wordmark?: { src: string; alt?: string }; className?: string; placeholder?: string }) {\n  if (!wordmark?.src?.trim()) return <Text path={['brand']} value={brand ?? ''} as=\"span\" placeholder={placeholder} className={className} />;\n  return (\n    <>\n      <Media path={['wordmark']} value={{ src: wordmark.src, alt: brand?.trim() ? '' : (wordmark.alt ?? '') }} ratio=\"auto\" className=\"h-8 w-auto max-w-[min(100%,12rem)] shrink-0 rounded-none bg-transparent @3xl:h-10 [&>img]:h-full [&>img]:w-auto [&>img]:object-contain\" />\n      <Text path={['brand']} value={brand ?? ''} as=\"span\" className=\"sr-only\" />\n    </>\n  );\n}\n\n/** The brand mark before a wordmark (navbar, footer): a square image about 24px, only when it has a src. */\nexport function BrandMark({ path, logo }: { path: PropPath; logo?: { src: string; alt?: string } }) {\n  if (!logo?.src?.trim()) return null;\n  return <Media path={path} value={{ src: logo.src, alt: logo.alt ?? '' }} ratio=\"1 / 1\" className=\"size-[max(var(--kh-mark-size),var(--kh-mark-min))] shrink-0\" />;\n}\n\n/** The brand mark (schema `mark`): vector paths in currentColor, else an image; --kh-mark-size tall (1.15em of the brand text), hidden from assistive tech. */\nexport function Mark({ mark }: { mark?: { paths?: string[]; viewBox?: string; src?: string } }) {\n  // --kh-mark-size (1.15em of the brand text), never under --kh-mark-min; square marks come out square\n  const size = 'h-[max(var(--kh-mark-size),var(--kh-mark-min))] w-auto shrink-0 self-center';\n  const paths = (mark?.paths ?? []).filter((d) => d.trim());\n  if (paths.length) {\n    const box = /^-?[\\d.]+(\\s+-?[\\d.]+){3}$/.test(mark?.viewBox?.trim() ?? '') ? mark!.viewBox!.trim() : '0 0 24 24';\n    return (\n      <svg aria-hidden focusable=\"false\" viewBox={box} className={cn(size, 'overflow-visible')} fill=\"currentColor\">\n        {paths.map((d, i) => <path key={i} d={d} />)}\n      </svg>\n    );\n  }\n  const src = mark?.src?.trim();\n  if (src && /^(https:\\/\\/|\\/(?!\\/))/.test(src)) return <img aria-hidden alt=\"\" src={src} className={size} />;\n  return null;\n}\n"
    },
    {
      "path": "src/blocks/_shared/brand-wordmark.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/_shared/brand-wordmark.tsx",
      "content": "import { Text } from '../../editing';\n\n/** A selectable SVG wordmark, fitted once to its container and named once. */\nexport function BrandWordmark({ brand, mark }: {\n  brand: string;\n  mark?: { paths?: string[]; viewBox?: string; src?: string };\n}) {\n  const paths = (mark?.paths ?? []).filter(path => path.trim());\n  const image = !paths.length && /^(https:\\/\\/|\\/(?!\\/))/.test(mark?.src ?? '') ? mark?.src : undefined;\n  const hasMark = paths.length > 0 || Boolean(image);\n  const offset = hasMark ? 140 : 0;\n  const textWidth = Math.max([...brand].length, 1) * 60;\n  const box = /^-?[\\d.]+(\\s+-?[\\d.]+){3}$/.test(mark?.viewBox?.trim() ?? '') ? mark!.viewBox!.trim() : '0 0 24 24';\n  return <svg viewBox={`0 0 ${offset + textWidth} 120`} width=\"100%\" role=\"img\" aria-label={brand || 'Brand'} className=\"block h-auto w-full font-semibold text-kh-ink\" fill=\"currentColor\">\n    {hasMark && <svg x=\"0\" y=\"14\" width=\"88\" height=\"88\" viewBox={box} aria-hidden=\"true\" focusable=\"false\">\n      {paths.map((path, i) => <path key={i} d={path} />)}\n      {image && <image href={image} width=\"100%\" height=\"100%\" />}\n    </svg>}\n    <text x={offset} y=\"90\" fontSize=\"100\" textLength={textWidth} lengthAdjust=\"spacingAndGlyphs\" aria-hidden=\"true\">\n      <Text path={['brand']} value={brand} as=\"tspan\" />\n    </text>\n  </svg>;\n}\n"
    },
    {
      "path": "src/blocks/surface.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/surface.tsx",
      "content": "// The tone surface and size container every block sits on. Its own file so a single installed block (shadcn registry,\n// apps/ui/site/registry.ts) does not pull the whole block index in through block.tsx.\nimport type { ReactNode } from 'react';\nimport { BlockPlacementContext } from '../lib/placement';\n\nexport type Tone = 'default' | 'muted' | 'inverse' | 'accent';\n\n/** Tone surface and size container. Production pages that import one block directly wrap it in this. */\nexport function BlockSurface({ tone = 'default', type, id, children }: { tone?: Tone; type?: string; id?: string; children: ReactNode }) {\n  return (\n    <div id={id} className=\"kh-block\" data-kh-tone={tone} data-kh-block={type}>\n      {/* A page band is a page, even inside an app shell (a site preview in SidebarLayout keeps its rhythm). */}\n      <BlockPlacementContext.Provider value=\"page\">{children}</BlockPlacementContext.Provider>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/mode.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/mode.ts",
      "content": "// The block mode as context, in a module of its own so a block can read it without loading the props resolver (render.tsx).\nimport { createContext } from 'react';\n\nexport type BlockMode = 'publish' | 'preview';\nexport const BlockModeContext = createContext<BlockMode | undefined>(undefined);\n"
    },
    {
      "path": "src/blocks/in-panel.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/in-panel.tsx",
      "content": "// Where a block sits: a page band (the default) or inside an app's panel. In a panel the block keeps its content and states but\n// drops the page's rhythm: no band padding, no page column or gutter, and its header at the in-app heading size, so a settings\n// screen can stack app blocks under its own h1 without overriding their classes (/ws settings had a local `Bare` doing that).\n// SidebarLayout's content is a panel already; InPanel is for app screens drawn without it.\nimport type { ReactNode } from 'react';\nimport { BlockPlacementContext } from '../lib/placement';\n\nexport { BlockPlacementContext, useInPanel, type BlockPlacement } from '../lib/placement';\n\n/** Render the blocks inside it as parts of an app screen: `<InPanel><AppBillingPlan props={…} /></InPanel>`. */\nexport function InPanel({ children }: { children: ReactNode }) {\n  return <BlockPlacementContext.Provider value=\"panel\">{children}</BlockPlacementContext.Provider>;\n}\n"
    }
  ]
}
