import type { HTMLAttributes, JSX, ReactNode } from 'react';
import type { Severity } from '../../constants/severity.types';
import type { FormatDateOptions } from '../../utils/date/formatDate';
export type TimelineContextMenuActionItem = {
type?: 'item';
label: ReactNode;
icon?: ReactNode;
onClick: () => void;
active?: boolean;
selected?: boolean;
disabled?: boolean;
variant?: 'default' | 'danger';
};
export type TimelineContextMenuHeaderItem = {
type: 'header';
label: ReactNode;
};
export type TimelineContextMenuItem = TimelineContextMenuActionItem | TimelineContextMenuHeaderItem;
export interface TimelineItem {
id?: string;
label: ReactNode;
content: ReactNode;
active?: boolean;
collapsible?: boolean;
severity?: Severity;
icon?: ReactNode;
disabled?: boolean;
/**
* When set, renders a muted timestamp next to the label using the
* component's own date formatting (see `dateOptions`) instead of the
* consumer building one into `label`/`content` by hand.
*/
date?: Date | string | number;
/** Passed through to the internal `formatDate` call for `date`. */
dateOptions?: FormatDateOptions;
/**
* Renders a kebab menu next to the label (same pattern as `Table`'s row
* actions), instead of the consumer putting action buttons directly in
* `label` — those inflate the header's height and throw off its
* alignment with the marker dot.
*/
contextMenuItems?: TimelineContextMenuItem[];
}
type Size = 'sm' | 'md' | 'lg';
type Variant = 'default' | 'outlined';
type OpenIndexes = number[] | 'all';
type RenderMode = 'lazy' | 'eager';
export interface TimelineProps extends Omit, 'children'> {
items: TimelineItem[];
size?: Size;
variant?: Variant;
renderMode?: RenderMode;
/** Uncontrolled default */
defaultOpenIndexes?: OpenIndexes;
/** Controlled state */
openIndexes?: OpenIndexes;
/** Change callback */
onOpenIndexesChange?: (indexes: number[]) => void;
}
export declare function Timeline({ items, size, variant, renderMode, defaultOpenIndexes, openIndexes, onOpenIndexesChange, className, ...rest }: TimelineProps): JSX.Element;
export {};