承認ステップApprovalStepsExperimental
Approval-route timeline: each step's state (pending / current / approved / rejected / skipped) maps to a tone, icon, and accessible label, with actor, timestamp, and comment. For expense, ringi, and review approval workflows. Built on Timeline.
プレビュー
Props
表は横にスクロールできます
| プロパティ | 型 | 初期値 | 説明 |
|---|---|---|---|
| steps | ApprovalStep[] | - | Each step: { label, state, actor?, timestamp?, comment? }. |
| state (per step) | "pending" | "current" | "approved" | "rejected" | "skipped" | - | Maps to a marker tone, icon, and text label (state is never colour-only). |
| stateLabels | Partial<Record<state, string>> | - | Localizable state text (also used in each step's aria-label). |
| variant | "default" | "compact" | "default" | Density. |
| className | string | - | Additional CSS class names. |
Usage
import { ApprovalSteps, type ApprovalStep } from "@gunjo/ui"
const steps: ApprovalStep[] = [
{ label: "申請", state: "approved", actor: "山田 太郎", timestamp: "5/20 10:12" },
{ label: "一次承認(上長)", state: "rejected", actor: "佐藤 部長",
timestamp: "5/20 14:40", comment: "勘定科目を会議費に修正のうえ再申請してください。" },
{ label: "経理確認", state: "current", actor: "経理部" },
{ label: "支払", state: "pending" },
]
export function Example() {
return (
<ApprovalSteps steps={steps}
stateLabels={{ approved: "承認", rejected: "差戻し", current: "確認中", pending: "待ち" }} />
)
}