import { Canvas, Controls, Meta, Title } from '@storybook/addon-docs/blocks';
import * as EventLogStories from './EventLog.stories';
<Meta of={EventLogStories} name='Usage' />
<Title />
## Purpose
A list of events over time, with an optional rail that joins their icons.
## TL;DR: Chain of Thought, Event Log or Timeline?
- **Chain of Thought:** an agent's reasoning under a reply, behind a summary line ("Thought for 17s") that opens on demand. No line, no rail.
- **Event Log:** events that happened or are happening, one line each (status icon, label, time). Always open, and the main content of a screen: a deploy history, an event log, an agent's run. Optional rail between the icons.
- **Timeline:** steps people read in order, often still ahead of them, with a heading and a paragraph each, on a card or flat. One line runs down the whole list: the stages of an application process.
Quick test:
1. Do the steps sit under a reply and need to stay out of the way? **Chain of Thought.**
2. Otherwise, does each entry have a status icon or a time at the end of the row? **Event Log.**
3. Otherwise, does each have a heading and a paragraph? **Timeline.**
A Chain of Thought is built from an Event Log and uses the same rows, and it can sit inside an Event Log as one entry in a log. Do not mix Event Log Items and Timeline in one list.
## Usage
Use it for an event log, a deploy history or an agent's run: anything that reads top to bottom in time order.
- Each child becomes a list item. `EventLogItem`s are joined by the rail; a divider, a Chain of Thought or a Thinking State in between breaks it.
- Turn on `hasRail` for a log of events over time, especially with timestamps, where people scan down to find when something happened. Dividers split the log into segments, since they break the rail.
- Leave it off where the list sits under a summary line, as in Chain of Thought, and for a short progress list with no timestamps; the status icons already show the order.
- For rows with large content under them (logs, diagrams, screenshots), start without a rail.
- To show an agent joining a log, put an agentic Labeled Divider before its items and mark them `isAgentic`.
## Accessibility
- The list is an ordered list (`ol`) and each child is a list item, so a screen reader announces how many entries there are. A divider child keeps its own separator role.
- The rail is decorative and is not announced.
- Keyboard: the list itself has no tab stop. Only an Event Log Item with expandable detail is focusable (see its page).
- What is announced: each item's status text and label, once. Write labels that do not repeat the status.
- Text is passed in by the screen, so translate it there; the status strings are the `labelStrings` prop on Event Log Item.
- Color contrast and the a11y panel in light and dark: not checked.
## Implementation
See the table below for the available props. Event Log Item has its own page.
- `size` — Text size of the items, as a `pds-copy-*` class on the list (default `xs`). Items read it by inheritance.
<hr />
<Canvas of={EventLogStories.Default} />
<Controls of={EventLogStories.Default} />
Event Log
Net-new, in two parts.
Net-new componentOpen in Storybook