Skip to content

feat: Added timeline component - #2157

Draft
rkaraivanov wants to merge 7 commits into
masterfrom
rkaraivanov/timeline
Draft

rkaraivanov wants to merge 7 commits into
masterfrom
rkaraivanov/timeline

Conversation

@rkaraivanov

@rkaraivanov rkaraivanov commented Mar 24, 2026

Copy link
Copy Markdown
Member

Type of Change

  • New feature (non-breaking change that adds functionality)

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally
  • I have updated documentation if needed

…e and complete API

The container now owns the grid tracks and every item lays its parts out
through `subgrid`, so the connector stays aligned across items of any
size and the `opposite` track sizes to its widest entry instead of taking
half the width. The `data-orientation` propagation and the per-item
`1fr 3rem 1fr` grids are gone.

Items resolve their layout from the parent through a Lit context that
publishes the timeline instance and expose the result as custom states
(`ig-horizontal`, `ig-start`, `ig-previous-complete`) styled with
`:host(:state(...))`. An item whose `complete` changes only nudges the
next item, since that is the only sibling that derives from it.

API:
- timeline `position` (`alternate` | `start` | `end`) sets the content
  side for all items; item `position` still overrides per item
- item `active` emphasizes the indicator and sets `aria-current`
- item `complete` fills the indicator and draws the connector segment to
  the next item solid, so a run of complete items reads as progress
- timeline is `role=list`, items are `role=listitem`, via internals
- an empty `indicator` collapses to a dot and an empty `opposite` takes
  no space
- entrance and hover motion respect `prefers-reduced-motion`

Also registers both elements in `defineAllComponents` (they were
missing), exports the `Timeline*` types, adds a 17-test spec with a11y
audits in both orientations, updates the stories to use the container
`position`, and adds an order-tracking story.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant