{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "text",
  "title": "Text",
  "description": "Body text in the theme's type scale and colors.",
  "registryDependencies": [
    "@ouro/lib-appearance-hints",
    "@ouro/lib-class-name-check",
    "@ouro/lib-cn",
    "@ouro/lib-env",
    "@ouro/lib-tones",
    "@ouro/lib-use-dev-messages"
  ],
  "files": [
    {
      "path": "registry/ouro/components/ouro/text/text-styles.ts",
      "content": "export { alignClasses, checkAlign };\nexport type { TextAlign };\n\n// Alignment shared by Text and Heading, apart from the components so each component\n// file exports only components (React Fast Refresh). The export list comes first because\n// the shadcn CLI drops comments before a file's first statement.\n\n/** Text alignment, in writing direction: `start` is left in English and right in Arabic. */\ntype TextAlign = \"start\" | \"center\" | \"end\";\n\n/**\n * Alignment classes, shared with `Heading`.\n *\n * @internal\n */\nconst alignClasses = { start: \"text-start\", center: \"text-center\", end: \"text-end\" } as const;\n\n/**\n * The value an `align` prop is, or `undefined` (inherited) with the dev message for one\n * that is not: `left` and `right` point to `start` and `end`. Shared with `Heading`.\n *\n * @internal\n */\nfunction checkAlign(component: string, align: string | undefined): [TextAlign | undefined, readonly [string, string] | false] {\n  if (align === undefined || Object.hasOwn(alignClasses, align)) return [align as TextAlign | undefined, false];\n  const fix = align === \"right\" ? \"end\" : \"start\";\n  return [\n    undefined,\n    process.env.NODE_ENV !== \"production\"\n      ? [`align=\"${align}\" is not an alignment; use \"start\", \"center\", \"end\"`, `<${component} align=\"${fix}\">`]\n      : /* istanbul ignore next @preserve -- production only */ false,\n  ];\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/text/text-styles.ts"
    },
    {
      "path": "registry/ouro/components/ouro/text/text.tsx",
      "content": "\"use client\";\n\nimport type { CSSProperties, HTMLAttributes, JSX, ReactNode, Ref } from \"react\";\nimport { fontFor, isWeight, sizeFor, toneFor } from \"@/registry/ouro/lib/ouro/appearance-hints\";\nimport { useAppearanceClassNameCheck } from \"@/registry/ouro/lib/ouro/class-name-check\";\nimport { cn } from \"@/registry/ouro/lib/ouro/cn\";\nimport { useDevWarnings } from \"@/registry/ouro/lib/ouro/use-dev-messages\";\nimport { toneWarning } from \"@/registry/ouro/lib/ouro/tones\";\nimport { alignClasses, checkAlign, type TextAlign } from \"@/registry/ouro/components/ouro/text/text-styles\";\n\nexport type { TextAlign } from \"@/registry/ouro/components/ouro/text/text-styles\";\n\n/** The props Text adds to the HTML attributes it passes through. */\nexport interface TextOwnProps {\n  /** The element to render. Use `span` inside other text, `div` around block content. @default \"p\" */\n  as?: \"p\" | \"span\" | \"div\" | (string & { 'Use \"p\", \"span\" or \"div\"; for a title use Heading': never }) | undefined;\n  /** Type size from the theme. @default \"md\" */\n  size?: \"sm\" | \"md\" | \"lg\" | (string & { 'Use \"sm\", \"md\" or \"lg\"; for a title use Heading': never }) | undefined;\n  /**\n   * Text color: `default` foreground, `muted` for secondary text, or a tone for\n   * status text (`destructive` for an error). `secondary` is the same as `muted`,\n   * because shadcn's `--secondary` is a surface color, not a text color. @default \"default\"\n   */\n  tone?:\n    | \"default\"\n    | \"muted\"\n    | \"primary\"\n    | \"secondary\"\n    | \"destructive\"\n    | \"success\"\n    | \"warning\"\n    | (string & { 'danger is \"destructive\"; accent is \"primary\"; neutral is \"secondary\"': never })\n    | undefined;\n  /** Alignment in writing direction. @default inherited */\n  align?: TextAlign | (string & { 'Use \"start\", \"center\" or \"end\": left is \"start\", right is \"end\"': never }) | undefined;\n  /**\n   * Layout only: margins, width, grid placement (`mt-2`, `max-w-prose`).\n   * Appearance classes warn in development; use `size`, `tone` and `align`.\n   */\n  className?: string | undefined;\n  /** The text. Inline elements such as `<strong>` and `<a>` are fine inside. */\n  children: ReactNode;\n  ref?: Ref<HTMLElement> | undefined;\n  /** Not a prop. Ouro UI uses `tone`: `<Text tone=\"muted\">`. */\n  color?: { 'Use <Text tone=\"muted\">': never };\n  /**\n   * Not a prop. Text has no variants; use `size` and `tone`: `<Text size=\"sm\" tone=\"muted\">`.\n   *\n   * @claim \"Text has no variants; use `size`\" registry/ouro/components/ouro/text/text.test.tsx verify:testExists(registry/ouro/components/ouro/text/text.test.tsx::runtime guards > strips variant from Text and warns with the fix)\n   */\n  variant?: { 'Use <Text size=\"sm\" tone=\"muted\">': never };\n}\n\n/**\n * Props for {@link Text}. `truncate` (one line) and `lines` (many) are exclusive. The\n * HTML attributes sit outside the `truncate`/`lines` union, which keeps the editor's\n * hover docs on every prop.\n * @claim \"The HTML attributes sit outside the\" registry/ouro/components/ouro/text/text.test.tsx verify:testExists(registry/ouro/components/ouro/text/text.test.tsx::Text > passes HTML attributes and a ref through)\n * @claim \"The HTML attributes sit outside the\" registry/ouro/components/ouro/text/text.tsx verify:fileLine(registry/ouro/components/ouro/text/text.tsx, /^export\\stype\\sTextProps\\s=\\sOmit</)\n */\nexport type TextProps = Omit<\n  HTMLAttributes<HTMLElement>,\n  \"color\" | \"className\" | \"children\" | \"truncate\" | \"lines\" | keyof TextOwnProps\n> &\n  TextOwnProps &\n  (\n    | {\n        /** Cuts the text to one line with an ellipsis. Use `lines` for more than one line. */\n        truncate?: boolean | undefined;\n        /** Not with `truncate`. Use `truncate` for one line or `lines` for more, not both. */\n        lines?: never;\n      }\n    | {\n        /** Clamps the text to this many lines with an ellipsis. Use `truncate` for one line. */\n        lines?: number | undefined;\n        /** Not with `lines`. Use `truncate` for one line or `lines` for more, not both. */\n        truncate?: never;\n      }\n  );\n\nconst sizes = { sm: \"text-sm\", md: \"text-base\", lg: \"text-lg\" } as const;\n\nconst tones = {\n  default: \"text-foreground\",\n  muted: \"text-muted-foreground\",\n  primary: \"text-primary\",\n  secondary: \"text-muted-foreground\",\n  destructive: \"text-destructive\",\n  success: \"text-success\",\n  warning: \"text-warning\",\n} as const;\n\nconst tags = [\"p\", \"span\", \"div\"] as const;\n\nfunction textTone(token: string): string {\n  const tone = toneFor(token);\n  return tone === \"secondary\" ? \"muted\" : tone;\n}\n\nfunction textHint(token: string): string {\n  const size = sizeFor(token, [\"sm\", \"sm\", \"md\", \"lg\", \"lg\", \"lg\", \"lg\"]);\n  if (size) return `size=\"${size}\"`;\n  if (isWeight(token)) return \"<Text><strong>…</strong></Text>\";\n  if (token.startsWith(\"font-\")) return fontFor(\"Text\", token);\n  return `tone=\"${textTone(token)}\"`;\n}\n\n/**\n * Body text in the theme's type scale and colors. Renders a `<p>` by default.\n * It wraps with `text-wrap: pretty`, so a paragraph does not end on one stranded word.\n *\n * Use `Heading` instead for titles (it renders `<h1>`–`<h6>`). Inside a\n * `Button`, pass plain text as children; the button styles it.\n *\n * @group Text\n * @see https://ui.ouroboros.bot/docs/text\n *\n * @example\n * <Text>Braise for three hours.</Text>\n * <Text size=\"sm\" tone=\"muted\">Updated 2 days ago</Text>\n * <Text tone=\"destructive\">Recipe not saved: the server is offline.</Text>\n * <Text lines={2}>{recipe.description}</Text>\n */\nexport function Text(props: TextProps): JSX.Element {\n  const {\n    as: asProp = \"p\",\n    size: sizeProp = \"md\",\n    tone: toneProp = \"default\",\n    align: alignProp,\n    truncate,\n    lines,\n    className,\n    style,\n    ref,\n    // Guard props (hint types), dropped here so they never reach the DOM.\n    color,\n    variant,\n    ...rest\n  } = props;\n  // A tone that is not one of Ouro UI's (a type error) warns and renders the default.\n  const tone = Object.hasOwn(tones, toneProp) ? (toneProp as keyof typeof tones) : \"default\";\n  // Likewise an element, size or alignment: it renders a <p>, size md, or inherited alignment.\n  const Tag = tags.includes(asProp as (typeof tags)[number]) ? (asProp as (typeof tags)[number]) : \"p\";\n  const size = Object.hasOwn(sizes, sizeProp) ? (sizeProp as keyof typeof sizes) : \"md\";\n  const [align, alignWarning] = checkAlign(\"Text\", alignProp);\n  useAppearanceClassNameCheck(\n    \"Text\",\n    className,\n    process.env.NODE_ENV !== \"production\" ? textHint : /* istanbul ignore next @preserve -- production only */ \"\",\n    process.env.NODE_ENV !== \"production\" ? 'align=\"center\"' : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n  useDevWarnings(\n    \"Text\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          tone !== toneProp && toneWarning(\"Text\", String(toneProp), Object.keys(tones)),\n          Tag !== asProp && [\n            `as=\"${String(asProp)}\" is not an element Text renders; use \"p\", \"span\", \"div\"`,\n            /^h[1-6]$/.test(String(asProp)) ? `<Heading level={${String(asProp).slice(1)}}>` : '<Text as=\"span\">',\n          ],\n          size !== sizeProp && [\n            `size=\"${String(sizeProp)}\" is not a size; use \"sm\", \"md\", \"lg\"`,\n            /xl$/.test(String(sizeProp)) ? \"<Heading level={2}>\" : '<Text size=\"md\">',\n          ],\n          alignWarning,\n          color !== undefined && [\"color is not a prop\", `<Text tone=\"${textTone(`text-${String(color)}`)}\">`],\n          variant !== undefined && [\"variant is not a prop; Text has no variants\", '<Text size=\"sm\" tone=\"muted\">'],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n  const classes = cn(\n    // A `<p>` has a margin in the browser's stylesheet. It is cleared in a sublayer of\n    // Tailwind's utilities (`[@layer_ouro-reset]:`), which every plain utility beats whatever\n    // its specificity: a parent's `space-y-4` (a `:where()` rule) and the app's margin class.\n    \"[@layer_ouro-reset]:m-0\",\n    sizes[size],\n    tones[tone],\n    align && alignClasses[align],\n    truncate ? \"truncate\" : \"text-pretty\",\n    lines !== undefined && \"line-clamp-(--ouro-lines)\",\n    className,\n  );\n  const finalStyle = lines !== undefined ? ({ ...style, \"--ouro-lines\": lines } as CSSProperties) : style;\n  return <Tag {...rest} ref={ref as Ref<HTMLParagraphElement>} data-ouro=\"text\" className={classes} style={finalStyle} />;\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/text/text.tsx"
    }
  ],
  "docs": "Body text in the theme's type scale and colors. Import: import { Text } from \"@/components/ouro/text/text\", with @/components replaced by your components alias (aliases.components in components.json, such as ~/components). Also installed: the helpers it imports in lib/ouro. Needs ouro-base in your stylesheet: add that item once per app, from the same place as this one, if you have not. Docs: https://ui.ouroboros.bot/docs/text.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}