配送ルートRouteStopsExperimental
Ordered route / itinerary list: numbered stops with a per-stop status (pending / current / completed / failed / delayed) driving the marker and a status label, a planned-vs-actual time pair with a signed delay, the current stop wired with aria-current, and a trailing actions slot. For delivery tracking, picking walk-paths and any sequenced-stop flow.
プレビュー
Props
表は横にスクロールできます
| プロパティ | 型 | 初期値 | 説明 |
|---|---|---|---|
| stops | RouteStopItem[] | - | Ordered stops. Each: id / title / description / status / plannedTime / actualTime / delayMinutes / seq / meta / actions. |
| RouteStopItem.status | "pending" | "current" | "completed" | "failed" | "delayed" | - | Drives the marker, the status label/Badge, and (for current) aria-current="step". Completed = check, failed = ×, delayed = clock. |
| RouteStopItem.plannedTime / actualTime | string ("HH:MM") | - | Planned ETA vs actual arrival. A signed delay (Delta) is computed from both when delayMinutes is omitted. |
| RouteStopItem.delayMinutes | number | - | Delay in minutes (+late / −early). Shown via Delta (late → destructive, early → success). |
| RouteStopItem.actions | ReactNode | - | Trailing per-stop actions (status update, reschedule). |
| statusLabels | Partial<Record<RouteStopStatus, string>> | - | Localize the status labels. |
| hideTimes | boolean | - | Hide the planned / actual time + delay row. Default false. |
| className | string | - | Additional CSS class names. |
Usage
import { RouteStops, type RouteStopItem } from "@gunjo/ui"
const stops: RouteStopItem[] = [
{ id: "1", title: "佐藤 一郎", description: "渋谷区神南 1-2-3",
status: "completed", plannedTime: "09:30", actualTime: "09:28", meta: "2 個" },
{ id: "3", title: "高橋 花子", description: "渋谷区道玄坂 2-6-7",
status: "current", plannedTime: "10:15", actualTime: "10:21", meta: "1 個",
actions: <Button size="sm" variant="outline">完了</Button> },
{ id: "4", title: "田中 工業", status: "failed", plannedTime: "10:40",
actions: <Button size="sm" variant="outline">再配達を設定</Button> },
{ id: "5", title: "山田 太郎", status: "delayed", plannedTime: "11:00", delayMinutes: 18 },
{ id: "6", title: "伊藤 ストア", status: "pending", plannedTime: "11:25" },
]
<RouteStops stops={stops} />