Upload brand files
Dropping a PDF into a project shows a Progress bar with the file name, the percentage and 2.4 of 6 MB as its hint. A failed upload turns the bar to error and says why.
Components / FeedbackStable
Shows how much of a known amount is done with a bar, the jobs behind it with a task list, or where someone is in a short sequence with steps.
2.4 of 6 MB
import { useId } from 'react'
// Nacre Progress: shows how much of a known amount is done. Steps (Steps.tsx) shows where someone is in a short
// sequence. React plus Tailwind classes only; needs nacre-theme.css. Motion: the fill is a full-width bar scaled on X
// from its start edge (gentle 360 out), never resized, so a new value mid-flight retargets from where it is drawn. A
// round cap rides on its end by translate, so the end stays round at any scale. Indeterminate (no known amount): a
// segment 40 % wide sweeps across, a loop on the in-out curve; with reduced motion it rests in the middle.
export type ProgressSize = 'sm' | 'md'
export type ProgressTone = 'neutral' | 'accent' | 'success' | 'error'
export type ProgressProps = {
label: string
value: number
max?: number
hideLabel?: boolean
showValue?: boolean
hint?: string
size?: ProgressSize
tone?: ProgressTone
/** The amount is not known yet: no value is announced and a segment sweeps across. */
indeterminate?: boolean
className?: string
}
const fills: Record<ProgressTone, string> = { neutral: 'bg-action', accent: 'bg-accent', success: 'bg-success', error: 'bg-error' }
export function Progress({ label, value, max = 100, hideLabel = false, showValue = false, hint, size = 'md', tone = 'neutral', indeterminate = false, className = '' }: ProgressProps) {
const id = useId()
const now = Number.isFinite(value) ? Math.min(Math.max(value, 0), max) : 0
// Multiply first so whole percentages stay exact (0.4 * 100 is not 40 in floating point).
const pct = max > 0 ? (now * 100) / max : 0
return (
<div data-part="root" className={`flex flex-col gap-2 ${className}`}>
<div className="flex items-baseline justify-between gap-3">
<span id={`${id}-label`} data-part="label" className={hideLabel ? 'sr-only' : 'text-label text-fg-strong'}>{label}</span>
{showValue && !indeterminate && (
<span data-part="value" aria-hidden="true" className="font-mono text-caption text-fg-muted tabular-nums">
{`${Math.round(pct)}%`}
</span>
)}
</div>
<div
role="progressbar"
aria-labelledby={`${id}-label`}
aria-valuemin={0}
aria-valuemax={max}
aria-valuenow={indeterminate ? undefined : now}
aria-describedby={hint ? `${id}-hint` : undefined}
data-part="track"
className={`relative overflow-hidden rounded-full bg-sunken ${size === 'sm' ? 'h-1' : 'h-2 ring-1 ring-line-subtle'}`}
>
{indeterminate ? (
<div data-part="indeterminate" className={`h-full w-2/5 translate-x-[75%] rounded-full motion-safe:animate-indeterminate ${fills[tone]}`} />
) : (
<>
<div
data-part="fill"
style={{ transform: `scaleX(${pct / 100})` }}
className={`size-full origin-left transition-transform duration-(--nx-dur-gentle) ease-out rtl:origin-right ${fills[tone]}`}
/>
{/* The cap's centre sits on the fill's end: a full-width layer moved by translate, a round end at its edge. */}
<div
data-part="cap"
aria-hidden="true"
style={{ transform: `translateX(calc(${pct - 100}% + ${size === 'sm' ? 2 : 4}px))` }}
className={`absolute inset-0 flex justify-end transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:scale-x-[-1] ${pct > 0 ? '' : 'opacity-0'}`}
>
<span className={`aspect-square h-full rounded-full ${fills[tone]}`} />
</div>
</>
)}
</div>
{hint && <p id={`${id}-hint`} data-part="hint" className="text-caption text-fg-muted">{hint}</p>}
</div>
)
}
import type { ReactNode } from 'react'
// Nacre Steps: shows where someone is in a short sequence. Server-safe like Progress (no hooks, no state). React plus
// Tailwind classes only; needs nacre-theme.css. Motion: while the current step is busy, an arc turns around its
// number. When the step finishes, the arc shrinks to .5 and blurs out, the marker fills (quick 160) and the check draws
// in left to right with clip-path (base 240 out, after the arc has gone), so the spinner reads as turning into the
// check. The connector to the next step fills the same quick 160. Reduced motion: the arc stands still and the change
// is instant.
export type Step = { label: string; description?: ReactNode }
export type StepsOrientation = 'horizontal' | 'vertical'
export type StepsProps = {
label: string
steps: Step[]
current: number
/** The current step is working (saving, checking): an arc turns around its number until current moves on. */
busy?: boolean
orientation?: StepsOrientation
className?: string
}
const markerTone = {
complete: 'bg-action text-on-action',
current: 'border border-line-strong bg-surface text-fg-strong',
upcoming: 'border border-line text-fg-muted',
} as const
// Busy: the ring steps back to a quiet line so the turning arc on it reads.
const busyTone = 'border border-line bg-surface text-fg-strong'
/** Steps before `current` are done, `current` is where the person is, the rest are ahead. current = steps.length: all done. */
export function Steps({ label, steps, current, busy = false, orientation = 'horizontal', className = '' }: StepsProps) {
const row = orientation === 'horizontal'
return (
<ol aria-label={label} data-part="steps" className={`flex ${row ? '' : 'flex-col'} ${className}`}>
{steps.map((s, i) => {
const state = i < current ? 'complete' : i === current ? 'current' : 'upcoming'
const last = i === steps.length - 1
return (
<li key={i} data-part="step" data-state={state} aria-current={state === 'current' ? 'step' : undefined} className={row ? 'flex min-w-0 flex-1 flex-col gap-2' : 'flex gap-3'}>
<span className={row ? 'flex items-center' : 'flex flex-col items-center'}>
<span data-part="marker" className={`relative inline-grid size-6 shrink-0 place-items-center rounded-full text-caption font-[600] transition-colors duration-(--nx-dur-quick) ease-out ${state === 'current' && busy ? busyTone : markerTone[state]}`}>
{state === 'complete' ? (
<svg
data-part="check"
aria-hidden="true"
viewBox="0 0 16 16"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="col-start-1 row-start-1 size-3.5 [clip-path:inset(0)] transition-[clip-path] delay-[80ms] duration-(--nx-dur-base) ease-out starting:[clip-path:inset(0_100%_0_0)]"
>
<path d="M3.5 8.5l3 3 6-7" />
</svg>
) : (
<span aria-hidden="true" className="col-start-1 row-start-1">{i + 1}</span>
)}
{/* Kept in every state, so leaving busy (or finishing) plays its exit instead of vanishing. */}
<svg
data-part="spinner"
aria-hidden="true"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
className={`pointer-events-none absolute -inset-px size-[calc(100%+2px)] text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin ${state === 'current' && busy ? '' : 'scale-50 opacity-0 blur-[2px]'}`}
>
<path d="M12 1a11 11 0 0 1 11 11" />
</svg>
</span>
{!last && (
<span
data-part="connector"
aria-hidden="true"
className={`${row ? 'mx-2 h-px flex-1' : 'my-1 min-h-4 w-px flex-1'} transition-colors duration-(--nx-dur-quick) ease-out bg-line`}
/>
)}
</span>
{/* In a row the text keeps 12 px clear of the next step and breaks long words with a hyphen, so neighbours
never touch on a narrow screen. */}
<span className={`flex min-w-0 flex-col gap-0.5 ${row ? `hyphens-auto [overflow-wrap:anywhere] ${last ? '' : 'pe-3'}` : last ? '' : 'pb-6'}`}>
<span data-part="step-label" className={`text-label ${state === 'upcoming' ? 'text-fg-muted' : 'text-fg-strong'}`}>
{s.label}
{state === 'complete' && <span className="sr-only">, done</span>}
{state === 'current' && busy && <span className="sr-only">, in progress</span>}
</span>
{s.description && <span className="text-caption text-fg-muted">{s.description}</span>}
</span>
</li>
)
})}
</ol>
)
}
'use client'
import { useLayoutEffect, useRef, useState, type MouseEvent } from 'react'
// Nacre TaskList: the jobs behind a longer wait, each with its own state, so people see what is done, what runs now
// and what failed. Ships with Progress (the overall amount) and Steps (where someone is). React plus Tailwind classes
// only; needs nacre-theme.css. Motion: rows rise in 8 px, 40 ms apart. A running task turns an arc around its number;
// when it finishes, the arc shrinks and blurs out while a filled marker springs in (scale .5 to 1) and its check or
// cross draws in by clip-path. The status pill swaps with a blur. A task's own progress fills a soft green wash behind its row by scaleX.
// Opening a task's details reveals the row from its bottom edge by clip-path while the rows below slide down by
// translate (base 240 out); closing plays it back. A click mid-flight turns it around from where it is drawn.
// Keyboard toggles, reduced motion and [data-nacre-motion="off"] change at once.
export type TaskStatus = 'pending' | 'running' | 'done' | 'failed'
export type TaskDetail = { label: string; meta?: string }
export type Task = {
id: string
label: string
status: TaskStatus
/** A short amount at the end of the row: 48 pages, 12 swatches. */
meta?: string
/** 0 to 100 while running: shown as a percentage and a line under the row. */
progress?: number
details?: TaskDetail[]
}
export type TaskListProps = {
label: string
tasks: Task[]
/** Ids of tasks whose details are open (controlled). Leave out to let the list keep its own. */
open?: string[]
defaultOpen?: string[]
onOpenChange?: (open: string[]) => void
/** Shows a Retry button on failed tasks. */
onRetry?: (id: string) => void
className?: string
}
const said: Record<TaskStatus, string> = { pending: 'waiting', running: 'in progress', done: 'done', failed: 'failed' }
function motionOk(el: Element): boolean {
return !window.matchMedia('(prefers-reduced-motion: reduce)').matches && !el.closest('[data-nacre-motion="off"]')
}
function tokenMs(el: Element, name: string, fallback: number): number {
const v = getComputedStyle(el).getPropertyValue(name).trim()
const n = parseFloat(v)
if (!Number.isFinite(n)) return fallback
return v.endsWith('ms') ? n : v.endsWith('s') ? n * 1000 : n
}
/** Done and failed markers: a filled circle that springs in, its mark drawn left to right. Keyed by status, so a
* change mounts a new one and @starting-style plays its entry. */
function Mark({ status }: { status: 'done' | 'failed' }) {
const done = status === 'done'
return (
<span
data-part="mark"
className={`absolute inset-0 grid place-items-center rounded-full text-on-action transition-[scale,opacity] duration-(--nx-dur-base) ease-spring starting:scale-50 starting:opacity-0 ${done ? 'bg-success' : 'bg-error-strong'}`}
>
<svg
data-part={done ? 'check' : 'cross'}
aria-hidden="true"
viewBox="0 0 16 16"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className="size-3.5 [clip-path:inset(0)] transition-[clip-path] delay-[80ms] duration-(--nx-dur-base) ease-out starting:[clip-path:inset(0_100%_0_0)]"
>
<path d={done ? 'M3.5 8.5l3 3 6-7' : 'M4.5 4.5l7 7M11.5 4.5l-7 7'} />
</svg>
</span>
)
}
export function TaskList({ label, tasks, open, defaultOpen = [], onOpenChange, onRetry, className = '' }: TaskListProps) {
const [own, setOwn] = useState(defaultOpen)
const openIds = open ?? own
// Rows whose details stay mounted while their close plays.
const [closing, setClosing] = useState<string[]>([])
const rows = useRef(new Map<string, HTMLLIElement>())
const anims = useRef(new Map<string, Animation[]>())
// An open to play once its details are laid out, from this many px tall.
const plan = useRef<{ id: string; from: number } | null>(null)
const stop = (id: string) => {
anims.current.get(id)?.forEach((a) => a.cancel())
anims.current.delete(id)
}
const panelOf = (id: string) => rows.current.get(id)?.querySelector<HTMLElement>('[data-part="details"]') ?? null
/** How tall a row's details are drawn right now (mid-flight included). */
const tall = (id: string): number => panelOf(id)?.getBoundingClientRect().height ?? 0
/** Moves a row's details between two heights. Height is animated here on purpose: the page below, and any frame
* around the list, must follow the row continuously, which a transform cannot do. Retargets from what is drawn. */
const play = (id: string, from: number, to: number, done?: () => void) => {
const panel = panelOf(id)
const li = rows.current.get(id)
if (!panel || !li) return done?.()
stop(id)
const full = panel.firstElementChild instanceof HTMLElement ? panel.firstElementChild.offsetHeight : Math.max(from, to, 1)
const opts: KeyframeAnimationOptions = {
duration: Math.max(120, tokenMs(li, '--nx-dur-base', 240) * (Math.abs(to - from) / Math.max(full, 1))),
easing: getComputedStyle(li).getPropertyValue('--nx-ease-out').trim() || 'cubic-bezier(.23, 1, .32, 1)',
fill: 'both',
}
const h = (px: number) => ({ height: `${px}px` })
// The content rides with the reveal: it rises out of the row head as the box grows, so box and text move as one.
const inner = panel.firstElementChild as HTMLElement | null
const at = (px: number) => { const r = Math.min(Math.max(px / Math.max(full, 1), 0), 1); return { opacity: r, transform: `translateY(${(r - 1) * 10}px)` } }
const list = [panel.animate([h(from), h(to)], opts)]
if (inner) list.push(inner.animate([at(from), at(to)], opts))
anims.current.set(id, list)
list[0].onfinish = () => {
if (anims.current.get(id) !== list) return
if (done) done()
else stop(id)
}
}
const toggle = (id: string, e: MouseEvent) => {
const li = rows.current.get(id)
const willOpen = !openIds.includes(id)
const next = willOpen ? [...openIds, id] : openIds.filter((x) => x !== id)
// A keyboard click (detail 0) changes at once.
const animate = !!li && e.detail > 0 && motionOk(li)
if (willOpen) {
plan.current = animate ? { id, from: closing.includes(id) ? tall(id) : 0 } : null
if (!animate) stop(id)
setClosing((c) => c.filter((x) => x !== id))
} else if (animate) {
const from = tall(id)
setClosing((c) => [...c, id])
play(id, from, 0, () => setClosing((c) => c.filter((x) => x !== id)))
} else stop(id)
if (open === undefined) setOwn(next)
onOpenChange?.(next)
}
useLayoutEffect(() => {
const p = plan.current
if (p && openIds.includes(p.id)) {
plan.current = null
const inner = panelOf(p.id)?.firstElementChild as HTMLElement | null
play(p.id, p.from, inner?.offsetHeight ?? 0, () => stop(p.id))
}
// A finished close has unmounted its details in this commit: let go of the held frames now, so nothing jumps.
for (const id of [...anims.current.keys()]) if (!openIds.includes(id) && !closing.includes(id)) stop(id)
})
return (
<ul aria-label={label} data-part="list" className={`flex flex-col gap-2 ${className}`}>
{tasks.map((t, i) => {
const shown = openIds.includes(t.id) || closing.includes(t.id)
const expanded = openIds.includes(t.id)
const hasDetails = !!t.details?.length
const running = t.status === 'running'
const pct = running && t.progress !== undefined ? Math.min(Math.max(Math.round(t.progress), 0), 100) : undefined
const panelId = `task-${t.id}-details`
const head = (
<>
<span data-part="status" className="relative grid size-6 shrink-0 place-items-center">
<span aria-hidden="true" className={`absolute inset-0 rounded-full border bg-surface transition-colors duration-(--nx-dur-quick) ease-out border-line-control`} />
<span aria-hidden="true" className={`text-caption font-[500] tabular-nums ${running ? 'text-fg-strong' : 'text-fg-muted'}`}>{i + 1}</span>
{/* Kept in every state, so finishing plays its exit instead of vanishing. */}
<svg
data-part="spinner"
aria-hidden="true"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
className={`pointer-events-none absolute inset-0 size-full text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin ${running ? '' : 'scale-50 opacity-0 blur-[2px]'}`}
>
<path d="M12 1a11 11 0 0 1 11 11" />
</svg>
{(t.status === 'done' || t.status === 'failed') && <Mark key={t.status} status={t.status} />}
</span>
<span data-part="task-label" className={`min-w-0 flex-1 truncate text-label font-[600] ${t.status === 'pending' ? 'text-fg-muted' : 'text-fg-strong'}`}>
{t.label}
<span className="sr-only">{`, ${said[t.status]}${pct !== undefined ? ` ${pct}%` : ''}`}</span>
</span>
{pct !== undefined ? (
<span data-part="meta" aria-hidden="true" className="shrink-0 font-mono text-caption text-fg-muted tabular-nums">{`${pct}%`}</span>
) : (
// The amount gives way on a narrow row, and next to Retry, so the label keeps its room.
t.meta && !(t.status === 'failed' && onRetry) && (
<span data-part="meta" className="hidden shrink-0 text-caption text-fg-muted tabular-nums @min-[18rem]:inline">{t.meta}</span>
)
)}
{(t.status === 'done' || t.status === 'failed') && (
<span
key={t.status}
data-part="pill"
aria-hidden="true"
className={`inline-flex h-6 shrink-0 items-center rounded-full px-2.5 text-caption font-[600] transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out starting:scale-90 starting:opacity-0 starting:blur-[4px] ${t.status === 'done' ? 'bg-success-soft text-success-strong' : 'bg-error-soft text-error-strong'}`}
>
{t.status === 'done' ? 'Done' : 'Failed'}
</span>
)}
{hasDetails && (
<svg
data-part="chevron"
aria-hidden="true"
viewBox="0 0 16 16"
fill="none"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
className={`size-4 shrink-0 text-icon-muted transition-[rotate] duration-(--nx-dur-base) ease-out ${expanded ? 'rotate-180' : ''}`}
>
<path d="M4 6l4 4 4-4" />
</svg>
)}
</>
)
return (
<li
key={t.id}
ref={(el) => {
if (el) rows.current.set(t.id, el)
else rows.current.delete(t.id)
}}
data-part="task"
data-state={t.status}
style={{ transitionDelay: `${i * 40}ms` }}
className="@container relative overflow-hidden rounded-md border border-line-subtle bg-sunken transition-[opacity,translate] duration-(--nx-dur-gentle) ease-out starting:translate-y-2 starting:opacity-0"
>
<div className="flex items-center">
{hasDetails ? (
<button
type="button"
data-part="trigger"
aria-expanded={expanded}
aria-controls={shown ? panelId : undefined}
onClick={(e) => toggle(t.id, e)}
className="flex min-h-11 min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-md px-3 text-start transition-colors duration-(--nx-dur-quick) ease-out hover:bg-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus"
>
{head}
</button>
) : (
<div className="flex min-h-11 min-w-0 flex-1 items-center gap-3 px-3">{head}</div>
)}
{t.status === 'failed' && onRetry && (
<button
type="button"
data-part="retry"
onClick={() => onRetry(t.id)}
className="me-2 inline-flex h-7 shrink-0 cursor-pointer items-center gap-1.5 rounded-full border border-line bg-secondary px-2.5 text-caption font-[600] text-fg-strong transition-[opacity,scale,background-color] duration-(--nx-dur-quick) ease-out hover:border-line-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus starting:scale-90 starting:opacity-0"
>
<svg aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" className="size-3.5">
<path d="M13 8a5 5 0 1 1-1.5-3.55M13 2.5v3h-3" />
</svg>
Retry
<span className="sr-only">{` ${t.label}`}</span>
</button>
)}
</div>
{/* The task's own progress: a soft green wash across the row head, scaled from its start, behind the content. */}
<span aria-hidden="true" className="pointer-events-none absolute inset-x-0 top-0 h-11">
<span
data-part="bar"
style={{ transform: `scaleX(${(pct ?? (t.status === 'done' ? 100 : 0)) / 100})` }}
className={`block size-full origin-left bg-success-soft/60 transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:origin-right ${pct !== undefined ? '' : 'opacity-0'}`}
/>
</span>
{hasDetails && shown && (
<div id={panelId} data-part="details" className="overflow-hidden">
<div>
<ul className="flex flex-col gap-1.5 border-t border-line-subtle py-3 ps-12 pe-4">
{t.details!.map((d, j) => (
<li
key={d.label}
data-part="detail"
className="flex items-baseline justify-between gap-3"
>
<span className="min-w-0 text-caption text-fg">{d.label}</span>
{d.meta && <span className="shrink-0 font-mono text-caption text-fg-muted tabular-nums">{d.meta}</span>}
</li>
))}
</ul>
</div>
</div>
)}
</li>
)
})}
</ul>
)
}
<div data-part="root" class="flex flex-col gap-2 ">
<div class="flex items-baseline justify-between gap-3">
<span id="_R_1_-label" data-part="label" class="text-label text-fg-strong">Uploading brand-guidelines.pdf</span>
<span data-part="value" aria-hidden="true" class="font-mono text-caption text-fg-muted tabular-nums">40%</span>
</div>
<div role="progressbar" aria-labelledby="_R_1_-label" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40" aria-describedby="_R_1_-hint" data-part="track" class="relative overflow-hidden rounded-full bg-sunken h-2 ring-1 ring-line-subtle">
<div data-part="fill" style="transform:scaleX(0.4)" class="size-full origin-left transition-transform duration-(--nx-dur-gentle) ease-out rtl:origin-right bg-action"></div>
<div data-part="cap" aria-hidden="true" style="transform:translateX(calc(-60% + 4px))" class="absolute inset-0 flex justify-end transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:scale-x-[-1] ">
<span class="aspect-square h-full rounded-full bg-action"></span>
</div>
</div>
<p id="_R_1_-hint" data-part="hint" class="text-caption text-fg-muted">2.4 of 6 MB</p>
</div>
<ol aria-label="New project setup" data-part="steps" class="flex ">
<li data-part="step" data-state="complete" class="flex min-w-0 flex-1 flex-col gap-2">
<span class="flex items-center">
<span data-part="marker" class="relative inline-grid size-6 shrink-0 place-items-center rounded-full text-caption font-[600] transition-colors duration-(--nx-dur-quick) ease-out bg-action text-on-action">
<svg data-part="check" aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="col-start-1 row-start-1 size-3.5 [clip-path:inset(0)] transition-[clip-path] delay-[80ms] duration-(--nx-dur-base) ease-out starting:[clip-path:inset(0_100%_0_0)]">
<path d="M3.5 8.5l3 3 6-7"></path>
</svg>
<svg data-part="spinner" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="pointer-events-none absolute -inset-px size-[calc(100%+2px)] text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin scale-50 opacity-0 blur-[2px]">
<path d="M12 1a11 11 0 0 1 11 11"></path>
</svg>
</span>
<span data-part="connector" aria-hidden="true" class="mx-2 h-px flex-1 transition-colors duration-(--nx-dur-quick) ease-out bg-line"></span>
</span>
<span class="flex min-w-0 flex-col gap-0.5 hyphens-auto [overflow-wrap:anywhere] pe-3">
<span data-part="step-label" class="text-label text-fg-strong">
Details
<span class="sr-only">, done</span>
</span>
<span class="text-caption text-fg-muted">Name and dates</span>
</span>
</li>
<li data-part="step" data-state="complete" class="flex min-w-0 flex-1 flex-col gap-2">
<span class="flex items-center">
<span data-part="marker" class="relative inline-grid size-6 shrink-0 place-items-center rounded-full text-caption font-[600] transition-colors duration-(--nx-dur-quick) ease-out bg-action text-on-action">
<svg data-part="check" aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="col-start-1 row-start-1 size-3.5 [clip-path:inset(0)] transition-[clip-path] delay-[80ms] duration-(--nx-dur-base) ease-out starting:[clip-path:inset(0_100%_0_0)]">
<path d="M3.5 8.5l3 3 6-7"></path>
</svg>
<svg data-part="spinner" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="pointer-events-none absolute -inset-px size-[calc(100%+2px)] text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin scale-50 opacity-0 blur-[2px]">
<path d="M12 1a11 11 0 0 1 11 11"></path>
</svg>
</span>
<span data-part="connector" aria-hidden="true" class="mx-2 h-px flex-1 transition-colors duration-(--nx-dur-quick) ease-out bg-line"></span>
</span>
<span class="flex min-w-0 flex-col gap-0.5 hyphens-auto [overflow-wrap:anywhere] pe-3">
<span data-part="step-label" class="text-label text-fg-strong">
Team
<span class="sr-only">, done</span>
</span>
<span class="text-caption text-fg-muted">Who works on it</span>
</span>
</li>
<li data-part="step" data-state="current" aria-current="step" class="flex min-w-0 flex-1 flex-col gap-2">
<span class="flex items-center">
<span data-part="marker" class="relative inline-grid size-6 shrink-0 place-items-center rounded-full text-caption font-[600] transition-colors duration-(--nx-dur-quick) ease-out border border-line-strong bg-surface text-fg-strong">
<span aria-hidden="true" class="col-start-1 row-start-1">3</span>
<svg data-part="spinner" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="pointer-events-none absolute -inset-px size-[calc(100%+2px)] text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin scale-50 opacity-0 blur-[2px]">
<path d="M12 1a11 11 0 0 1 11 11"></path>
</svg>
</span>
<span data-part="connector" aria-hidden="true" class="mx-2 h-px flex-1 transition-colors duration-(--nx-dur-quick) ease-out bg-line"></span>
</span>
<span class="flex min-w-0 flex-col gap-0.5 hyphens-auto [overflow-wrap:anywhere] pe-3">
<span data-part="step-label" class="text-label text-fg-strong">Tasks</span>
<span class="text-caption text-fg-muted">First milestones</span>
</span>
</li>
<li data-part="step" data-state="upcoming" class="flex min-w-0 flex-1 flex-col gap-2">
<span class="flex items-center">
<span data-part="marker" class="relative inline-grid size-6 shrink-0 place-items-center rounded-full text-caption font-[600] transition-colors duration-(--nx-dur-quick) ease-out border border-line text-fg-muted">
<span aria-hidden="true" class="col-start-1 row-start-1">4</span>
<svg data-part="spinner" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="pointer-events-none absolute -inset-px size-[calc(100%+2px)] text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin scale-50 opacity-0 blur-[2px]">
<path d="M12 1a11 11 0 0 1 11 11"></path>
</svg>
</span>
</span>
<span class="flex min-w-0 flex-col gap-0.5 hyphens-auto [overflow-wrap:anywhere] ">
<span data-part="step-label" class="text-label text-fg-muted">Review</span>
<span class="text-caption text-fg-muted">Check and create</span>
</span>
</li>
</ol>
<ul aria-label="Preparing brand-guidelines.pdf" data-part="list" class="flex flex-col gap-2 ">
<li data-part="task" data-state="done" style="transition-delay:0ms" class="@container relative overflow-hidden rounded-md border border-line-subtle bg-sunken transition-[opacity,translate] duration-(--nx-dur-gentle) ease-out starting:translate-y-2 starting:opacity-0">
<div class="flex items-center">
<button type="button" data-part="trigger" aria-expanded="false" class="flex min-h-11 min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-md px-3 text-start transition-colors duration-(--nx-dur-quick) ease-out hover:bg-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus">
<span data-part="status" class="relative grid size-6 shrink-0 place-items-center">
<span aria-hidden="true" class="absolute inset-0 rounded-full border bg-surface transition-colors duration-(--nx-dur-quick) ease-out border-line-control"></span>
<span aria-hidden="true" class="text-caption font-[500] tabular-nums text-fg-muted">1</span>
<svg data-part="spinner" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="pointer-events-none absolute inset-0 size-full text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin scale-50 opacity-0 blur-[2px]">
<path d="M12 1a11 11 0 0 1 11 11"></path>
</svg>
<span data-part="mark" class="absolute inset-0 grid place-items-center rounded-full text-on-action transition-[scale,opacity] duration-(--nx-dur-base) ease-spring starting:scale-50 starting:opacity-0 bg-success">
<svg data-part="check" aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-3.5 [clip-path:inset(0)] transition-[clip-path] delay-[80ms] duration-(--nx-dur-base) ease-out starting:[clip-path:inset(0_100%_0_0)]">
<path d="M3.5 8.5l3 3 6-7"></path>
</svg>
</span>
</span>
<span data-part="task-label" class="min-w-0 flex-1 truncate text-label font-[600] text-fg-strong">
Upload the file
<span class="sr-only">, done</span>
</span>
<span data-part="meta" class="hidden shrink-0 text-caption text-fg-muted tabular-nums @min-[18rem]:inline">6 MB</span>
<span data-part="pill" aria-hidden="true" class="inline-flex h-6 shrink-0 items-center rounded-full px-2.5 text-caption font-[600] transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out starting:scale-90 starting:opacity-0 starting:blur-[4px] bg-success-soft text-success-strong">Done</span>
<svg data-part="chevron" aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-icon-muted transition-[rotate] duration-(--nx-dur-base) ease-out ">
<path d="M4 6l4 4 4-4"></path>
</svg>
</button>
</div>
<span aria-hidden="true" class="pointer-events-none absolute inset-x-0 top-0 h-11">
<span data-part="bar" style="transform:scaleX(1)" class="block size-full origin-left bg-success-soft/60 transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:origin-right opacity-0"></span>
</span>
</li>
<li data-part="task" data-state="running" style="transition-delay:40ms" class="@container relative overflow-hidden rounded-md border border-line-subtle bg-sunken transition-[opacity,translate] duration-(--nx-dur-gentle) ease-out starting:translate-y-2 starting:opacity-0">
<div class="flex items-center">
<button type="button" data-part="trigger" aria-expanded="false" class="flex min-h-11 min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-md px-3 text-start transition-colors duration-(--nx-dur-quick) ease-out hover:bg-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus">
<span data-part="status" class="relative grid size-6 shrink-0 place-items-center">
<span aria-hidden="true" class="absolute inset-0 rounded-full border bg-surface transition-colors duration-(--nx-dur-quick) ease-out border-line-control"></span>
<span aria-hidden="true" class="text-caption font-[500] tabular-nums text-fg-strong">2</span>
<svg data-part="spinner" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="pointer-events-none absolute inset-0 size-full text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin ">
<path d="M12 1a11 11 0 0 1 11 11"></path>
</svg>
</span>
<span data-part="task-label" class="min-w-0 flex-1 truncate text-label font-[600] text-fg-strong">
Read the pages
<span class="sr-only">, in progress 60%</span>
</span>
<span data-part="meta" aria-hidden="true" class="shrink-0 font-mono text-caption text-fg-muted tabular-nums">60%</span>
<svg data-part="chevron" aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-icon-muted transition-[rotate] duration-(--nx-dur-base) ease-out ">
<path d="M4 6l4 4 4-4"></path>
</svg>
</button>
</div>
<span aria-hidden="true" class="pointer-events-none absolute inset-x-0 top-0 h-11">
<span data-part="bar" style="transform:scaleX(0.6)" class="block size-full origin-left bg-success-soft/60 transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:origin-right "></span>
</span>
</li>
<li data-part="task" data-state="pending" style="transition-delay:80ms" class="@container relative overflow-hidden rounded-md border border-line-subtle bg-sunken transition-[opacity,translate] duration-(--nx-dur-gentle) ease-out starting:translate-y-2 starting:opacity-0">
<div class="flex items-center">
<button type="button" data-part="trigger" aria-expanded="false" class="flex min-h-11 min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-md px-3 text-start transition-colors duration-(--nx-dur-quick) ease-out hover:bg-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus">
<span data-part="status" class="relative grid size-6 shrink-0 place-items-center">
<span aria-hidden="true" class="absolute inset-0 rounded-full border bg-surface transition-colors duration-(--nx-dur-quick) ease-out border-line-control"></span>
<span aria-hidden="true" class="text-caption font-[500] tabular-nums text-fg-muted">3</span>
<svg data-part="spinner" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="pointer-events-none absolute inset-0 size-full text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin scale-50 opacity-0 blur-[2px]">
<path d="M12 1a11 11 0 0 1 11 11"></path>
</svg>
</span>
<span data-part="task-label" class="min-w-0 flex-1 truncate text-label font-[600] text-fg-muted">
Pull out colours
<span class="sr-only">, waiting</span>
</span>
<span data-part="meta" class="hidden shrink-0 text-caption text-fg-muted tabular-nums @min-[18rem]:inline">12 swatches</span>
<svg data-part="chevron" aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-icon-muted transition-[rotate] duration-(--nx-dur-base) ease-out ">
<path d="M4 6l4 4 4-4"></path>
</svg>
</button>
</div>
<span aria-hidden="true" class="pointer-events-none absolute inset-x-0 top-0 h-11">
<span data-part="bar" style="transform:scaleX(0)" class="block size-full origin-left bg-success-soft/60 transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:origin-right opacity-0"></span>
</span>
</li>
<li data-part="task" data-state="pending" style="transition-delay:120ms" class="@container relative overflow-hidden rounded-md border border-line-subtle bg-sunken transition-[opacity,translate] duration-(--nx-dur-gentle) ease-out starting:translate-y-2 starting:opacity-0">
<div class="flex items-center">
<button type="button" data-part="trigger" aria-expanded="false" class="flex min-h-11 min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-md px-3 text-start transition-colors duration-(--nx-dur-quick) ease-out hover:bg-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus">
<span data-part="status" class="relative grid size-6 shrink-0 place-items-center">
<span aria-hidden="true" class="absolute inset-0 rounded-full border bg-surface transition-colors duration-(--nx-dur-quick) ease-out border-line-control"></span>
<span aria-hidden="true" class="text-caption font-[500] tabular-nums text-fg-muted">4</span>
<svg data-part="spinner" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="pointer-events-none absolute inset-0 size-full text-action transition-[opacity,scale,filter] duration-(--nx-dur-quick) ease-out motion-safe:animate-spin scale-50 opacity-0 blur-[2px]">
<path d="M12 1a11 11 0 0 1 11 11"></path>
</svg>
</span>
<span data-part="task-label" class="min-w-0 flex-1 truncate text-label font-[600] text-fg-muted">
Match the fonts
<span class="sr-only">, waiting</span>
</span>
<span data-part="meta" class="hidden shrink-0 text-caption text-fg-muted tabular-nums @min-[18rem]:inline">3 families</span>
<svg data-part="chevron" aria-hidden="true" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="size-4 shrink-0 text-icon-muted transition-[rotate] duration-(--nx-dur-base) ease-out ">
<path d="M4 6l4 4 4-4"></path>
</svg>
</button>
</div>
<span aria-hidden="true" class="pointer-events-none absolute inset-x-0 top-0 h-11">
<span data-part="bar" style="transform:scaleX(0)" class="block size-full origin-left bg-success-soft/60 transition-[transform,opacity] duration-(--nx-dur-gentle) ease-out rtl:origin-right opacity-0"></span>
</span>
</li>
</ul>/* The Tailwind theme lines Progress and steps uses. They come from nacre-theme.css (Resources, Tokens), which also defines
the --nx-* values these lines point at. Import that file once; this list is what this component needs from it. */
@theme inline {
--color-surface: var(--nx-surface);
--color-sunken: var(--nx-sunken);
--color-fg-strong: var(--nx-fg-strong);
--color-fg: var(--nx-fg);
--color-fg-muted: var(--nx-fg-muted);
--color-on-action: var(--nx-on-action);
--color-line-subtle: var(--nx-line-subtle);
--color-line: var(--nx-line);
--color-line-strong: var(--nx-line-strong);
--color-line-control: var(--nx-line-control);
--color-focus: var(--nx-focus);
--color-icon-muted: var(--nx-icon-muted);
--color-action: var(--nx-action);
--color-accent: var(--nx-accent);
--color-secondary: var(--nx-secondary);
--color-row-hover: var(--nx-row-hover);
--color-success-strong: var(--nx-success-strong);
--color-success: var(--nx-success);
--color-success-soft: var(--nx-success-soft);
--color-error-strong: var(--nx-error-strong);
--color-error: var(--nx-error);
--color-error-soft: var(--nx-error-soft);
--font-mono: var(--font-geist-mono), ui-monospace, monospace;
--text-label: 0.8125rem;
--text-label--line-height: 1rem;
--text-label--letter-spacing: 0em;
--text-label--font-weight: 600;
--text-caption: 0.75rem;
--text-caption--line-height: 1rem;
--text-caption--letter-spacing: 0.01em;
--text-caption--font-weight: 400;
--spacing: 0.25rem;
--radius-md: 1.125rem;
--ease-out: cubic-bezier(.23, 1, .32, 1);
--ease-spring: linear(0, 0.036 3.1%, 0.128 6.3%, 0.251 9.4%, 0.389 12.5%, 0.526 15.6%, 0.655 18.8%, 0.769 21.9%, 0.864 25%, 0.939 28.1%, 0.996 31.3%, 1.036 34.4%, 1.062 37.5%, 1.075 40.6%, 1.08 43.8%, 1.077 46.9%, 1.07 50%, 1.061 53.1%, 1.05 56.3%, 1.039 59.4%, 1.028 62.5%, 1.019 65.6%, 1.011 68.8%, 1.005 71.9%, 1.001 75%, 0.997 78.1%, 0.995 81.3%, 0.994 84.4%, 0.994 87.5%, 0.994 90.6%, 0.994 93.8%, 0.995 96.9%, 1);
--animate-spin: nx-spin var(--nx-dur-slow) linear infinite;
--animate-indeterminate: nx-indeterminate calc(var(--nx-dur-slow) * 2.5) var(--nx-ease-in-out) infinite;
@keyframes nx-spin {
to { transform: rotate(360deg); }
}
@keyframes nx-indeterminate {
from { translate: -100%; }
to { translate: 250%; }
}
}
Dropping a PDF into a project shows a Progress bar with the file name, the percentage and 2.4 of 6 MB as its hint. A failed upload turns the bar to error and says why.
Under the upload bar a TaskList names the four jobs. The one running turns its arc and shows its own percentage; a font that cannot be matched marks its task failed with a Retry button, while the others finish.
The new project flow shows four Steps across the top: Details, Team, Tasks, Review. Finished steps get a check; the current one is announced as the current step.
DoSay what is progressing in the label: Uploading brand-guidelines.pdf.
Don'tLabel it Loading.
DoGive each task a verb and an object: Pull out colours.
Don'tShow internal job names such as extract_v2.
DoKeep Steps to five or fewer, with short labels.
Don'tSqueeze eight steps across a phone; use vertical Steps instead.
2.4 of 6 MB
Counting the files first.