{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "heading",
  "title": "Heading",
  "description": "A heading whose rank and size are set apart, on the heading scale.",
  "dependencies": [
    "@base-ui/react",
    "@stylexjs/stylex"
  ],
  "registryDependencies": [
    "https://constella.aayush.cv/r/base.json"
  ],
  "files": [
    {
      "path": "src/components/typography/heading.tsx",
      "content": "import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport * as stylex from \"@stylexjs/stylex\";\n\nimport type { Sx, TextColor, TextWeight } from \"@/lib/constella/styles\";\nimport {\n  textColorStyles,\n  textWeightStyles,\n  typeStyles,\n} from \"@/lib/constella/styles\";\n\nconst headingSizes = [1, 2, 3, 4, 5, 6] as const;\n\ntype HeadingSize = (typeof headingSizes)[number];\n\ntype HeadingProps = Omit<\n  useRender.ComponentProps<\"h2\">,\n  \"className\" | \"style\"\n> & {\n  color?: TextColor;\n  /** The heading's rank in the outline: its tag, and its size unless `size` says otherwise. */\n  level?: HeadingSize;\n  size?: HeadingSize;\n  sx?: Sx;\n  weight?: TextWeight;\n};\n\nconst styles = stylex.create({\n  base: {\n    marginBlock: 0,\n    textWrap: \"balance\",\n  },\n});\n\nconst sizeStyles = {\n  1: typeStyles.heading1,\n  2: typeStyles.heading2,\n  3: typeStyles.heading3,\n  4: typeStyles.heading4,\n  5: typeStyles.heading5,\n  6: typeStyles.heading6,\n} satisfies Record<HeadingSize, stylex.StyleXStyles>;\n\nfunction Heading({\n  color = \"primary\",\n  level = 2,\n  render,\n  size = level,\n  sx,\n  weight = \"semibold\",\n  ...props\n}: HeadingProps) {\n  return useRender({\n    defaultTagName: `h${level}`,\n    props: mergeProps<\"h2\">(\n      props,\n      stylex.props(\n        styles.base,\n        sizeStyles[size],\n        textWeightStyles[weight],\n        textColorStyles[color],\n        sx\n      )\n    ),\n    render,\n    state: { color, size, slot: \"heading\", weight },\n  });\n}\n\nexport { Heading, headingSizes };\nexport type { HeadingProps, HeadingSize };\n",
      "type": "registry:component"
    }
  ],
  "docs": "Usage: https://constella.aayush.cv/docs/components/heading/index.md",
  "type": "registry:ui"
}