{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "separator",
  "title": "Separator",
  "description": "A thin line in the theme's border color between groups of content, horizontal or vertical.",
  "dependencies": [
    "@base-ui/react@^1.8.0"
  ],
  "registryDependencies": [
    "@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/separator/separator.tsx",
      "content": "\"use client\";\n\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\nimport type { HTMLAttributes, JSX, ReactNode, Ref } from \"react\";\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\";\n\n/** The props Separator adds to the `<div>` attributes it passes through. */\nexport interface SeparatorOwnProps {\n  /**\n   * `horizontal` spans the width of its container between stacked content; `vertical`\n   * stands as tall as its row between side-by-side items (put it in a flex row).\n   * @default \"horizontal\"\n   */\n  orientation?: \"horizontal\" | \"vertical\" | (string & { 'Use \"horizontal\" or \"vertical\"': never }) | undefined;\n  /**\n   * Hides the line from screen readers (`role=\"none\"`). Use it when the line only\n   * decorates, such as between a heading and its text; leave it off when it divides\n   * two groups of content a reader should hear as separate.\n   */\n  decorative?: boolean | undefined;\n  /**\n   * Colors the lines and the label from the theme, for an accent line such as where unread\n   * messages start. Without it the lines are the border color and the label is muted.\n   * `secondary` is a surface, not a line color, so it is not a tone here.\n   */\n  tone?:\n    | \"primary\"\n    | \"destructive\"\n    | \"success\"\n    | \"warning\"\n    | (string & { 'danger is \"destructive\"; accent is \"primary\"; neutral is no tone': never })\n    | undefined;\n  /**\n   * A short word in the middle of a horizontal line, such as \"or\" between two ways to sign\n   * in: `<Separator label=\"or\" />`. The label is read as text in its place, and the lines on\n   * either side are hidden from screen readers. Only for `horizontal`.\n   * @claim \"A short word in the middle\" registry/ouro/components/ouro/separator/separator.test.tsx verify:testExists(registry/ouro/components/ouro/separator/separator.test.tsx::Separator > puts a label in the middle of a horizontal line, read as text while the lines are hidden)\n   */\n  label?: ReactNode;\n  /** Layout only: margins, width, flex sizing (`my-4`, `flex-1`). Appearance classes warn in development. */\n  className?: string | undefined;\n  ref?: Ref<HTMLDivElement> | undefined;\n\n  /** Not a prop. Ouro UI uses `orientation`: `<Separator orientation=\"vertical\" />`. */\n  vertical?: { 'Use <Separator orientation=\"vertical\" />': never };\n  /** Not a prop. The text in the middle of the line is `label`: `<Separator label=\"or\" />`. */\n  children?: { 'Use <Separator label=\"or\" />': never };\n  /** Not a prop. The text in the middle of the line is `label`: `<Separator label=\"or\" />`. */\n  text?: { 'Use <Separator label=\"or\" />': never };\n}\n\n/** Props for {@link Separator}: its own props and the `<div>` attributes it passes through. */\nexport type SeparatorProps = Omit<HTMLAttributes<HTMLDivElement>, keyof SeparatorOwnProps | \"role\"> & SeparatorOwnProps;\n\nconst orientations = {\n  horizontal: \"h-px w-full\",\n  vertical: \"w-px self-stretch\",\n} as const;\n\nconst line = \"h-px min-w-0 flex-1 shrink border-0\";\n\n// Class strings are literal so the app's Tailwind finds them. A forced-colours line is drawn\n// in CanvasText, because forced colours would otherwise drop its background.\nconst tones = {\n  primary: { line: \"bg-primary forced-colors:bg-[CanvasText]\", label: \"text-primary\" },\n  destructive: { line: \"bg-destructive forced-colors:bg-[CanvasText]\", label: \"text-destructive\" },\n  success: { line: \"bg-success forced-colors:bg-[CanvasText]\", label: \"text-success\" },\n  warning: { line: \"bg-warning forced-colors:bg-[CanvasText]\", label: \"text-warning\" },\n} as const;\n\n/**\n * A thin line in the theme's border color between groups of content, horizontal or\n * vertical. Built on Base UI's Separator, so it is a `role=\"separator\"` with its\n * orientation for screen readers, unless `decorative`. With `label` it is a horizontal\n * line with a word in its middle, such as \"or\" between two ways to sign in. With `tone`\n * the lines and the label take the tone's color, such as an accent line where unread\n * messages start.\n *\n * Use spacing (margins or a gap) instead when whitespace alone separates the groups,\n * and a `Heading` when the next group needs a name.\n *\n * @group Display\n * @see https://ui.ouroboros.bot/docs/separator\n *\n * @example\n * <Separator className=\"my-4\" />\n * <div className=\"flex items-center gap-3\">\n *   <Button variant=\"plain\">Edit</Button>\n *   <Separator orientation=\"vertical\" />\n *   <Button variant=\"plain\">Share</Button>\n * </div>\n * <Separator label=\"or\" className=\"my-6\" />\n * <Separator tone=\"primary\" label=\"New since you left · 2 messages\" />\n * @claim \"With `label` it is a horizontal\" registry/ouro/components/ouro/separator/separator.test.tsx verify:testExists(registry/ouro/components/ouro/separator/separator.test.tsx::Separator > puts a label in the middle of a horizontal line, read as text while the lines are hidden)\n */\nexport function Separator(props: SeparatorProps): JSX.Element {\n  const {\n    orientation: orientationProp = \"horizontal\",\n    decorative,\n    tone: toneProp,\n    label,\n    className,\n    // Guard props (hint types), dropped here so they never reach the DOM.\n    vertical,\n    children,\n    text,\n    ...rest\n  } = props;\n  // An orientation that is not one of Ouro UI's (a type error) warns and renders horizontal.\n  const orientation = Object.hasOwn(orientations, orientationProp) ? (orientationProp as keyof typeof orientations) : \"horizontal\";\n  const labelled = label != null && label !== false;\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, String(toneProp)) ? (toneProp as keyof typeof tones) : undefined;\n  const lineColor = tone ? tones[tone].line : \"bg-border\";\n  const labelColor = tone ? tones[tone].label : \"text-muted-foreground\";\n  useAppearanceClassNameCheck(\n    \"Separator\",\n    className,\n    process.env.NODE_ENV !== \"production\"\n      ? (token: string) => `remove \"${token}\"; Separator uses the theme's --border color`\n      : /* istanbul ignore next @preserve -- production only */ \"\",\n  );\n  useDevWarnings(\n    \"Separator\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          vertical !== undefined && [\"vertical is not a prop\", '<Separator orientation=\"vertical\" />'],\n          orientation !== orientationProp && [\n            `orientation=\"${String(orientationProp)}\" is not an orientation; use \"horizontal\", \"vertical\"`,\n            /col|vert|^y$/i.test(String(orientationProp)) ? '<Separator orientation=\"vertical\" />' : '<Separator orientation=\"horizontal\" />',\n          ],\n          tone !== toneProp &&\n            (toneProp === \"neutral\"\n              ? ['tone=\"neutral\" is not a tone; a line without a tone is the default', \"<Separator>\"]\n              : toneWarning(\"Separator\", String(toneProp), Object.keys(tones))),\n          children !== undefined && [\"Separator takes no children; its text is label\", `<Separator label=\"${typeof children === \"string\" ? children : \"or\"}\" />`],\n          text !== undefined && [\"text is not a prop\", `<Separator label=\"${typeof text === \"string\" ? text : \"or\"}\" />`],\n          labelled && orientation === \"vertical\" && [\"label works on a horizontal line only, so the line renders horizontal\", `<Separator label=\"or\" />`],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n  if (labelled) {\n    // The text reads in its place; the two lines only decorate it.\n    return (\n      <div\n        {...rest}\n        data-ouro=\"separator\"\n        data-orientation=\"horizontal\"\n        className={cn(\"flex w-full min-w-0 items-center gap-3\", className)}\n      >\n        <BaseSeparator role=\"none\" aria-orientation={undefined} data-slot=\"separator-line\" className={cn(line, lineColor)} />\n        <span data-slot=\"separator-label\" className={cn(\"max-w-full shrink-0 text-center text-sm leading-5\", labelColor)}>\n          {label}\n        </span>\n        <BaseSeparator role=\"none\" aria-orientation={undefined} data-slot=\"separator-line\" className={cn(line, lineColor)} />\n      </div>\n    );\n  }\n  return (\n    <BaseSeparator\n      {...rest}\n      orientation={orientation}\n      {...(decorative ? { role: \"none\", \"aria-orientation\": undefined } : {})}\n      data-ouro=\"separator\"\n      className={cn(\"shrink-0 border-0\", lineColor, orientations[orientation], className)}\n    />\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/separator/separator.tsx"
    }
  ],
  "docs": "A thin line in the theme's border color between groups of content, horizontal or vertical. Import: import { Separator } from \"@/components/ouro/separator/separator\", 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/separator.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}