Skip to content

Logistics ​

Node timeline: steps JSON dual-channel [{ state?, time?, desc?, title? }] (newest-first convention — the first entry is the latest progress), reverse flips the render direction (for hosts whose data is chronological); the current node is highlighted (state: 'done' | 'current' | 'pending', derived by default — when nothing is declared the first entry is current and the rest are done; with explicit declarations, undeclared entries split around the first open entry: earlier = done, later = pending); collapse (collapsed shows only the latest 2 + an “expand all N” toggle); action slots for copy-tracking / copy-address (the host owns the copy logic, the component provides the slot and layout).

Basic timeline (default state derivation) ​

With no state declared: the first entry (latest progress) is current with aria-current="step", the rest are done. Each li's aria-label carries the state text (not color-only):

Basic trajectory (newest first, first entry in progress)

Explicit states & reverse ​

Full-flow node data: declare done / current / pending explicitly; undeclared entries derive around the first open entry. reverse flips the render order (chronological timeline; aria-current follows the semantic node, not the DOM position):

Explicit states + reverse (chronological)

Collapse & expand ​

collapsed shows only the latest 2 entries plus an “expand all N” toggle; clicking writes the attribute back and fires oas-toggle (detail { collapsed }, the order-card event convention); steps ≤ 2 entries hide the toggle:

Collapsed (latest 2 only) + toggle feedback

Click “expand all 5” / “collapse” to see the oas-toggle feedback.

Action slots (copy tracking / address) ​

The actions slot: the copy logic belongs to the host (navigator.clipboard on your side); the component provides the slot container and layout; with no content the whole action row hides:

Copy tracking number / address actions

Copy numberCopy address

Click an action button to see the host-side copy feedback.

Keyboard & accessibility ​

  • Timeline uses a legal ol > li combination (ol's native list semantics + aria-label “Delivery tracking”; toggle / actions / empty state live outside the ol — non-entry nodes never enter list semantics).
  • Current node aria-current="step"; every li's aria-label carries the state text (completed / in progress / pending) plus title / time / desc — state is not color-only (visually the current dot is larger and the title bolder).
  • Toggle button text is the state (“expand all N” / “collapse”); actions area role="group" + aria-label “Related actions”.
  • Empty / invalid steps renders the empty state (invalid JSON warns once and treats it as empty).
  • Connector lines and layout mirror via logical properties (RTL safe); colors are token-based (dark theme follows).

Custom styling notes ​

::part(timeline) is the ol container; each ::part(item) contains ::part(dot) (target via data-state="done|current|pending") and ::part(title) / ::part(time) / ::part(desc); connector lines draw on the item's ::before. Restyle state dots via ::part(dot) combined with host-side [data-state] selectors.

API ​

oas-logistics ​

Attributes ​

AttributeDescriptionTypeDefault
collapsedCollapsed: shows only the latest 2 entries (toggle hidden for ≤2 entries); user toggles write the attribute back and fire oas-toggleboolean—
reverseFlips the render order (for chronological host data; aria-current follows the semantic node, not the DOM position)boolean—
stepsDelivery nodes JSON array [{ state?, time?, desc?, title? }] (newest-first; entries without title and desc are ignored; invalid JSON warns once and renders the empty state)LogisticsStep[] | string—

Property (JS property; see each row for attribute reflection) ​

PropertyDescriptionTypeDefault
collapsedCollapsed state: get+set dual channel (boolean), writes reflect the collapsed attribute (host writes are silent; only user clicks fire)boolean—
stepsDelivery nodes: get+set dual channel (array or JSON string), writes reflect the steps attributeLogisticsStep[] | string—

Events ​

EventDescription
oas-toggleFires after the user toggles expand / collapse, detail: { collapsed } (the new state); host writes to collapsed do not fire

Slots ​

NameDescription
actionsAction row (copy tracking / copy address — copy logic and accessible names belong to the host buttons; the component provides the slot and layout; hides when empty)

Released under the MIT OR Apache-2.0 License.