{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "text",
  "title": "Text",
  "description": "Body-text primitive with token-driven sans family and a size/tone/weight scale; polymorphic via `as`.",
  "dependencies": [
    "@vllnt/ui@^0.3.0",
    "class-variance-authority"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/text/text.tsx",
      "content": "import { createElement } from \"react\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@vllnt/ui\";\n\n/**\n * Body-text scale for the {@link Text} primitive. Exposed so consumers can\n * compose the same token-driven styles onto bespoke elements.\n */\nexport const textVariants = cva(\n  \"font-[family-name:var(--font-sans)] text-foreground\",\n  {\n    defaultVariants: {\n      size: \"base\",\n      tone: \"default\",\n      weight: \"normal\",\n    },\n    variants: {\n      size: {\n        base: \"text-[length:var(--font-size-body)] leading-[var(--line-height-body)]\",\n        caption:\n          \"text-[length:var(--font-size-caption)] leading-[var(--line-height-caption)]\",\n        lead: \"text-[length:var(--font-size-body-lg)] leading-[var(--line-height-body-lg)]\",\n        small:\n          \"text-[length:var(--font-size-body-sm)] leading-[var(--line-height-body-sm)]\",\n      },\n      tone: {\n        default: \"\",\n        muted: \"text-muted-foreground\",\n      },\n      weight: {\n        medium: \"font-medium\",\n        normal: \"font-normal\",\n        semibold: \"font-semibold\",\n      },\n    },\n  },\n);\n\n/** HTML element the {@link Text} primitive renders as. */\nexport type TextElement = \"div\" | \"label\" | \"p\" | \"span\";\n\n/** Props for {@link Text}. */\nexport type TextProps = React.HTMLAttributes<HTMLElement> &\n  VariantProps<typeof textVariants> & {\n    as?: TextElement;\n    ref?: React.Ref<HTMLElement>;\n  };\n\n/**\n * Body text whose family, scale, and weight come from theme-overridable tokens\n * (`--font-sans`, `--font-size-body*`). Polymorphic via `as`. Forwards `ref` to\n * the rendered element.\n *\n * Use `tone=\"muted\"` on the default `background`; on `muted`/`card` surfaces the\n * muted foreground can fall below WCAG AA contrast for body text.\n *\n * @example\n * <Text size=\"lead\" tone=\"muted\">Intro copy</Text>\n */\nconst Text = ({\n  as = \"p\",\n  className,\n  ref,\n  size,\n  tone,\n  weight,\n  ...props\n}: TextProps) =>\n  createElement(as, {\n    className: cn(textVariants({ size, tone, weight }), className),\n    ref,\n    ...props,\n  });\nText.displayName = \"Text\";\n\nexport { Text };\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component",
  "version": "0.3.0",
  "stability": "stable",
  "a11y": {
    "notes": "Renders a semantic element (p, span, div, or label) chosen by `as`, forwards `ref`, and inherits the design-system foreground contrast tokens. Use `tone=\"muted\"` on the default `background` — on `muted`/`card` surfaces the muted foreground can fall below WCAG AA. For a real form label use the Label component, which wires the htmlFor association."
  }
}
