import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"; import { cn } from "./cn"; /* * Base UI's Separator is always `role="separator"` with an `aria-orientation`; * it has no notion of a decorative one. Radix has `decorative`, and both * GoodSync products were on its default of `true` — so every divider they ship * is currently hidden from assistive technology, and every divider NOKL ships * is announced. Seventeen call sites across the two products, not one of which * passes the prop or separates anything a screen reader needs told about: they * are lines between sections of a settings page. * * So `decorative` defaults to true here. A divider that carries no meaning * should not be read out, and making that the default is what keeps the common * case correct without every call site opting in. `decorative={false}` gets Base * UI's semantics back for the rare separator that genuinely delimits content. * * The override works because Base UI puts its own role and aria-orientation * first in the props it merges, so anything passed in wins. A contract test * pins that, since it is the kind of ordering a dependency can quietly change. */ export interface SeparatorProps extends SeparatorPrimitive.Props { /** * Hides the separator from assistive technology. True for a line that is * only a visual divider, which is almost always what a separator is. * @default true */ decorative?: boolean; } function Separator({ className, orientation = "horizontal", decorative = true, ...props }: SeparatorProps) { return ( ); } export { Separator };