import { useState } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display"; import { Button, Text } from "@godxjp/ui/general"; import { Flex, PageContainer } from "@godxjp/ui/layout"; import { Steps } from "@godxjp/ui/navigation"; /** * Steps — multi-step progress indicator. Horizontal or vertical, default or dot style. * Drive current from state; use status='error' to mark the active step failed. * Composed only from real @godxjp/ui components. */ const approvalSteps = [ { title: "申請", description: "申請者が提出" }, { title: "一次審査", description: "部門長レビュー" }, { title: "経理承認", description: "経理部チェック" }, { title: "完了", description: "支払処理済" }, ]; const onboardingSteps = [ { title: "基本情報", subtitle: "必須" }, { title: "法人設定", subtitle: "税務情報" }, { title: "銀行口座", subtitle: "入出金" }, { title: "確認・完了" }, ]; export default function Demo() { const [approvalCurrent, setApprovalCurrent] = useState(1); const [wizardCurrent, setWizardCurrent] = useState(0); /* Seeded TRUE so `status="error"` paints on mount. The toggle below is still the point of the * demo, but starting from `false` meant the error state was reachable only by clicking — * and a surface that needs an interaction is a surface no sweep measures (gh#612), which is * how `.ui-steps-title[data-status="error"]` kept the destructive FILL tier unnoticed. */ const [hasError, setHasError] = useState(true); return ( {/* Horizontal — default style with descriptions */} 水平 · default スタイル (経費承認フロー) items に title + description を渡す。current は 0-based index。 前のステップは finish、現在は process、後のステップは wait。 {/* Interactive — advance/retreat */} インタラクティブ · ステップを進む / 戻る onValueChange を渡すと各ステップがクリッカブルになる。ボタンで value を制御することもできる。 {/* Error status on current step */} status="error" — 現在ステップをエラー表示 status prop を error にするとアクティブステップが赤くなる。 バリデーション失敗時にフォームと組み合わせて使う。 {/* Vertical — default style */} 垂直 · default スタイル (法人オンボーディング) orientation="vertical" でサイドバーやサイドパネルに収まる縦型レイアウト。 ステップ {wizardCurrent + 1}: {onboardingSteps[wizardCurrent].title} このステップのフォームコンテンツがここに表示されます。 {/* size union — md (default) vs sm */} size · md (既定) / sm size は各ステップのタイトルと説明の文字サイズを決める。size="md" が既定でページ見出し直下の主要フローに使う。size="sm" はカードヘッダやサイドパネルなど、周囲の密度に合わせて縮める場合に使う。 size="md" size="sm" {/* 320px stress */} 320px stress · 長いタイトル 狭いコンテナで水平 Steps の長い日本語タイトルと説明を確認する。 {/* Dot style — compact */} Dot スタイル · コンパクト (type="dot") type="dot" + size="sm" で最小フットプリントのプログレスガイド。 サイドバーのオンボーディングチェックリストに最適。 {/* Inline row — the hosted-identity / device progression */} Inline 行 · 区切りグリフ (type="inline" · separator) 認証・デバイス系の 1 行プログレス。区切りは既定が chevron (›)、 正典のホステッド ID 画面は arrow (→) — chevron は「掘り下げる」、arrow は「次へ」を意味し、ステップ行の意味は後者。 番号の強調(既定は太字 / 正典はアクセント色)は --steps-inline-index-color / --steps-inline-index-font-weight で、アプリ CSS を書かずに切り替える。 {/* status="error" on the INLINE form too. The vertical/horizontal error title had a route; `.ui-steps-inline-item[data-status="error"] .ui-steps-inline-control` did not, and it reads the same tone token (gh#612). */} {/* Ant Design parity surface — percent + navigation */} percent · navigation (Ant Design パリティ) percent は antd と同じく「現在ステップ」の進捗のみ(0–100 にクランプ)。マーカーの周りに確定アークを描き、role="progressbar" として読み上げられる。type="navigation" は antd のスラブ型ナビゲーションバーで、既定のヘアライン コネクタは切られ、代わりにシェブロンで繋がる。
{}} items={[ { title: "申込", description: "受付済" }, { title: "審査", description: "書類確認中" }, { title: "完了", description: "未着手" }, ]} />
); }