import { useState } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display"; import { FormField, PasswordInput, PasswordStrength } from "@godxjp/ui/data-entry"; import { Flex, PageContainer } from "@godxjp/ui/layout"; /** * PasswordStrength — 0-4 score bar + rule checklist paired with PasswordInput. * Always render immediately below the PasswordInput it evaluates. * Composed only from real @godxjp/ui components. */ export default function Demo() { const [signupPassword, setSignupPassword] = useState(""); /* Seeded so the PASSED state is on screen without typing: the checklist's success icon is * otherwise only reachable by interaction, which means no sweep can measure it (gh#612). */ const [resetPassword, setResetPassword] = useState("Passw0rdSeed"); return ( 新規登録フォーム PasswordInput の直下に配置し、入力と同時にスコアを表示する。 setSignupPassword(e.target.value)} placeholder="8文字以上のパスワード" /> カスタムルール + ラベル rules で評価項目を絞り込み、labels でスコア表示を日本語化。 setResetPassword(e.target.value)} placeholder="新しいパスワード" /> チェックリスト非表示 showChecklist={"{false}"} でスコアバーのみ表示するコンパクト版。 ); }