import { default as React } from 'react'; import { IconContent } from '../types/icon.types.js'; import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types.js'; import { ColorValue } from '../themeProvider/color.types.js'; /** Layout of entries relative to the connecting line. */ export declare enum TimelineAlignment { /** Line and markers on the left, content to the right (the default). */ Left = "left", /** Line and markers on the right, content to the left. */ Right = "right", /** Line down the center, entries alternating left/right. */ Alternate = "alternate" } export type TimelineSlots = 'root' | 'item' | 'marker' | 'dot' | 'connector' | 'content' | 'title' | 'description' | 'timestamp'; export interface TimelineItem { /** Stable identity for the entry, used as its React key. Falls back to its array index when omitted; pass one whenever `items` can be reordered or have entries prepended (e.g. a live "newest first" audit log), so React doesn't misattribute row state across the shift. */ id?: string | number; /** Primary label for the entry. */ title: React.ReactNode; /** Secondary line under the title. */ description?: React.ReactNode; /** Rendered next to the title, e.g. a date or relative time ("2 hours ago"). */ timestamp?: React.ReactNode; /** Icon shown in the marker instead of a plain dot — a FontAwesome icon or any node. */ icon?: IconContent; /** The marker's colour: a `ThemeColor` or any CSS colour. Unset, it is `--timeline-dot-color`. */ color?: ColorValue; /** Extra content rendered under the description, e.g. a diff, an attachment, an actor avatar. */ content?: React.ReactNode; /** Makes the whole entry clickable (e.g. to open the full record), rendering it as an accessible button. */ onClick?: (event: React.MouseEvent) => void; /** Disables the entry: never clickable, dimmed. Only relevant alongside `onClick`. */ disabled?: boolean; } export interface TimelineProps extends HtmlProps { /** The entries to render, in display order (typically newest first for an audit log). */ items?: TimelineItem[]; /** Layout of entries relative to the connecting line (default `Left`). */ alignment?: TimelineAlignment; className?: string; style?: React.CSSProperties; classNames?: SlotClassNames; styles?: SlotStyles; }