import { Separator } from "../separator/index.jsx";
import { useToolbarRootContext } from "./toolbar-root-context.jsx";
/**
 * A separator rendered inside a `<Toolbar.Root>`. Wraps the shared
 * `<Separator>` primitive and flips orientation so the visual divider sits
 * perpendicular to the toolbar's main axis.
 */
export function ToolbarSeparator(props) {
  // Optional context read — a standalone `<Toolbar.Separator>` outside a
  // `<Toolbar.Root>` should still render (matches React's implicit
  // tolerance: it consumes the root context but only to read orientation).
  const toolbar = useToolbarRootContext(true);
  const orientation = () => {
    if (props.orientation !== undefined) return props.orientation;
    const toolbarOrientation = toolbar.orientation();
    return toolbarOrientation === "horizontal" ? "vertical" : "horizontal";
  };
  return <Separator {...props} orientation={orientation()} />;
}
//# sourceMappingURL=toolbar-separator.jsx.map
