import { injectComponentStyle } from "@bysages/core/styling"; import type * as React from "react"; import type { HTMLAttributes } from "react"; /** A line of moments: Root is the ordered thread, Item one moment on it, * Marker the point where the thread passes, Content what the moment * holds. The hairline between markers is drawn by the stylesheet. */ function part(name: string, tag: string) { const Tag = tag as "ol"; const Component = ({ children, ...rest }: HTMLAttributes) => ( {children} ); Component.displayName = "Timeline" + name; return Component; } function Root({ orientation = "vertical", children, ...rest }: HTMLAttributes & { children?: React.ReactNode; orientation?: "vertical" | "horizontal"; }) { injectComponentStyle("timeline"); return (
    {children}
); } Root.displayName = "TimelineRoot"; const Item = part("Item", "li"); const Marker = part("Marker", "span"); const Content = part("Content", "div"); export const Timeline = Object.assign(Root, { Root, Item, Marker, Content }); injectComponentStyle("timeline");