component Timeline { outputs { select(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object }) } props { size: string = "default" color: string = "primary" title: string = "Timeline" description: string = "" items: unknown[] = [] variant: string = "default" class: string = "" } view {
{#if title || description}
{#if title}

{title}

{/if} {#if description}

{description}

{/if}
{/if}
    {#each items as item, index}
  1. {item.title || item.label}

    {#if item.subtitle}

    {item.subtitle}

    {/if}
    {#if item.date || item.meta} {/if}
    {#if item.description}

    {item.description}

    {/if} {#if item.href} {item.actionLabel || "View details"} {/if}
  2. {:empty}
  3. No timeline items available.
  4. {/each}
} style { .wrn-timeline { width: 100%; } .wrn-timeline__header { margin-bottom: 1.5rem; } .wrn-timeline__title { color: var(--wrn-color-text); font-size: 1.25rem; font-weight: 700; } .wrn-timeline__description { max-width: 42rem; margin-top: 0.5rem; color: var(--wrn-color-text-muted); line-height: 1.75rem; } .wrn-timeline__list { position: relative; margin-left: 1rem; border-left: 1px solid var(--wrn-color-border); } .wrn-timeline__item { position: relative; padding: 0 0 2rem 2rem; cursor: pointer; } .wrn-timeline__item:last-child { padding-bottom: 0; } .wrn-timeline__marker { position: absolute; top: 0; left: -1.05rem; display: flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border: 4px solid var(--wrn-color-background); border-radius: 50%; color: var(--wrn-color-on-primary); background: var(--wrn-color-primary); box-shadow: var(--wrn-shadow-1); } .wrn-timeline__marker:is([data-status="complete"], [data-status="success"]) { background: var(--wrn-color-success); } .wrn-timeline__marker:is([data-status="warning"], [data-status="pending"]) { background: var(--wrn-color-warning); } .wrn-timeline__marker:is([data-status="danger"], [data-status="failed"]) { background: var(--wrn-color-danger); } .wrn-timeline__card { padding: 1.25rem; border: 1px solid var(--wrn-color-border); border-radius: calc(var(--wrn-radius) * 1.5); background: var(--wrn-color-surface-raised); box-shadow: var(--wrn-shadow-1); } .wrn-timeline__card[data-variant="minimal"] { padding: 0; border-color: transparent; background: transparent; box-shadow: none; } .wrn-timeline__card-header { display: flex; flex-direction: column; gap: 0.5rem; } .wrn-timeline__item-title { color: var(--wrn-color-text); font-weight: 700; } .wrn-timeline__subtitle { margin-top: 0.25rem; color: var(--wrn-color-primary); font-size: 0.875rem; font-weight: 500; } .wrn-timeline__time { flex: none; color: var(--wrn-color-text-muted); font-size: 0.875rem; } .wrn-timeline__copy { margin-top: 0.75rem; color: var(--wrn-color-text-muted); font-size: 0.875rem; line-height: 1.5rem; } .wrn-timeline__action { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1rem; color: var(--wrn-color-primary); font-size: 0.875rem; font-weight: 600; } .wrn-timeline__action:hover { color: var(--wrn-color-primary-hover); } .wrn-timeline__action-icon { width: 1rem; height: 1rem; } .wrn-timeline__empty { padding-left: 2rem; color: var(--wrn-color-text-muted); font-size: 0.875rem; } @media (min-width: 40rem) { .wrn-timeline__card-header { flex-direction: row; align-items: flex-start; justify-content: space-between; } } } }