import type * as React from 'react'; import type { TimeProps } from '../time/types.cjs'; import type { PrimitivePropsWithRef } from '../utils/primitive.cjs'; /** One entry of {@link TimelineProps.items} — a single event on the timeline. */ export interface TimelineItem { /** The event's body, rendered into the derived `TimelineContent`. */ content: React.ReactNode; /** * Metadata on the far side of the marker — a timestamp, an actor, an * elapsed time — rendered into the derived `TimelineOpposite`. * @default undefined — no opposite region is rendered. */ opposite?: React.ReactNode | undefined; /** Semantic Time in the opposite slot; an explicit opposite takes precedence. */ timestamp?: TimeProps['value'] | undefined; /** * What goes inside the derived `TimelineIndicator`; a childless indicator stays decorative and `aria-hidden`, while one with content needs `indicatorLabel`. * @default undefined — a bare, decorative marker. */ indicator?: React.ReactNode | undefined; /** * Accessible name for a non-decorative `indicator`. * @default undefined — the indicator's own text names it. */ indicatorLabel?: string | undefined; /** * Where the event sits in the sequence: complete, current, or pending. * @default undefined — rendered without a state. */ state?: 'complete' | 'current' | 'pending' | undefined; } /** Props for the {@link Timeline} root. */ export interface TimelineProps extends PrimitivePropsWithRef<'ol'> { /** * Events rendered into derived parts per entry; ignored with `children`. * @default undefined */ items?: TimelineItem[] | undefined; /** * Render custom body for each item's `content`; ignored with `children`. * @default undefined */ renderContent?: ((item: TimelineItem) => React.ReactNode) | undefined; /** * Layout axis, exposed as `data-orientation` — purely a styling hook. * @default 'vertical' */ orientation?: 'vertical' | 'horizontal' | undefined; /** * Which side of the rail the skin lays the entries out on, mirrored to `data-align`. * @default undefined — the skin's own default alignment. */ align?: 'end' | 'alternate' | (string & {}) | undefined; } /** Props for a single {@link TimelineItem} entry. */ export interface TimelineItemProps extends PrimitivePropsWithRef<'li'> { /** * Where the event sits in the sequence, mirrored to `data-state` for the skin. * @default undefined — rendered without a state. */ state?: 'complete' | 'current' | 'pending' | undefined; } /** Props for {@link TimelineIndicator}, the dot/icon marker for a `TimelineItem`. */ export interface TimelineIndicatorProps extends PrimitivePropsWithRef<'div'> { } /** Props for {@link TimelineSeparator}, the connecting line between two `TimelineItem`s. */ export interface TimelineSeparatorProps extends PrimitivePropsWithRef<'div'> { } /** Props for {@link TimelineContent}, the body content of a `TimelineItem`. */ export interface TimelineContentProps extends PrimitivePropsWithRef<'div'> { } /** * Props for {@link TimelineOpposite}, the metadata region on the far side of a * `TimelineItem`'s marker — a timestamp, an actor, an elapsed time. */ export interface TimelineOppositeProps extends PrimitivePropsWithRef<'div'> { }