{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "heading",
  "title": "Heading",
  "description": "Semantic level independent from fluid visual size; balanced by default.",
  "dependencies": [],
  "registryDependencies": [
    "@hjconsult/lib"
  ],
  "files": [
    {
      "path": "src/components/heading/index.tsx",
      "content": "import type { ComponentPropsWithoutRef, Ref } from 'react'\nimport { cn } from '../../lib'\n\nexport type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div'\nexport type HeadingSize = 'display-1' | 'display-2' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\n/** Fluid size plus the letter-spacing that suits it; larger sizes tighten. */\nconst headingSizes: Record<HeadingSize, string> = {\n  'display-1': 'text-display-1 tracking-tighter',\n  'display-2': 'text-display-2 tracking-tighter',\n  h1: 'text-h1 tracking-tight',\n  h2: 'text-h2 tracking-tight',\n  h3: 'text-h3 tracking-tight',\n  h4: 'text-h4 tracking-normal',\n  h5: 'text-h5 tracking-normal',\n  h6: 'text-h6 tracking-wide',\n}\n\nconst defaultSizeFor = (tag: HeadingTag): HeadingSize =>\n  tag === 'p' || tag === 'span' || tag === 'div' ? 'h3' : tag\n\nexport interface HeadingProps extends ComponentPropsWithoutRef<'h2'> {\n  /** Semantic element. Independent from the visual `size`. */\n  as?: HeadingTag\n  /** Visual size from the fluid type scale. Defaults to the size matching `as`. */\n  size?: HeadingSize\n  /** Balance line lengths (`text-wrap: balance`). On by default; headings read better balanced. */\n  balance?: boolean\n  ref?: Ref<HTMLHeadingElement>\n}\n\nexport function Heading({ as = 'h2', size, balance = true, className, ...props }: HeadingProps) {\n  const Tag = as as 'h2'\n  return (\n    <Tag\n      className={cn(\n        'font-display font-medium text-fg',\n        headingSizes[size ?? defaultSizeFor(as)],\n        balance && 'text-balance',\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n",
      "type": "registry:ui",
      "target": "hj/components/heading/index.tsx"
    }
  ],
  "cssVars": {},
  "type": "registry:ui"
}