UNPKG

mithril-materialized

Version:
44 lines (43 loc) 1.73 kB
import m, { FactoryComponent, Attributes } from 'mithril'; export interface TimelineItemAttrs { /** Unique identifier for the timeline item */ id?: string; /** Main label/title for the timeline item */ label?: string; /** Optional description text */ description?: string; /** Timestamp for the item (string or Date object) */ timestamp?: string | Date; /** Custom content to render instead of label/description */ content?: m.Children; /** Material icon name for the timeline dot */ icon?: string; /** Color theme for the timeline item */ color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info'; /** Click handler for the timeline item */ onclick?: (item: TimelineItemAttrs, event: Event) => void; /** Whether the item is disabled */ disabled?: boolean; /** Custom CSS class for the item */ className?: string; } export interface TimelineAttrs extends Attributes { /** Array of timeline items to display */ items: TimelineItemAttrs[]; /** Position of content relative to the timeline line (vertical only) */ position?: 'left' | 'right' | 'alternate'; /** Whether to show the connecting line between items */ showConnector?: boolean; /** Custom CSS class for the timeline container */ className?: string; /** Whether to show timestamps */ showTimestamps?: boolean; /** Compact mode with reduced spacing */ compact?: boolean; } /** * Timeline Component * Displays a sequence of events in chronological order with connecting lines * Supports both vertical and horizontal orientations with Material Design styling */ export declare const Timeline: FactoryComponent<TimelineAttrs>;