@@ -2,19 +2,20 @@ import * as React from 'react';
22import { Title } from '../../components/Title' ;
33import {
44 Button ,
5+ CheckBox ,
56 FormItem ,
7+ FormLabel ,
68 H2 ,
79 H3 ,
810 H4 ,
911 IconButton ,
1012 Li ,
11- ModalDialog ,
1213 P ,
1314 RadioButton ,
15+ TextField ,
1416 TextLink ,
1517 Ul ,
1618} from '../../components/parts' ;
17- import { NoLabel } from '../../components/examples/form' ;
1819import { publicPath } from '../../utils/publicPath' ;
1920import {
2021 MdAdd ,
@@ -28,9 +29,7 @@ import {
2829 ExampleContainer ,
2930 FieldWithBadErrorMessage ,
3031} from '../../components/examples' ;
31- import styled from 'styled-components' ;
32-
33- const modalDelay = 5 ;
32+ import { styled } from 'styled-components' ;
3433
3534const SmallButton = styled . button `
3635 width: 1rem;
@@ -59,6 +58,10 @@ const SmallButton = styled.button`
5958 }
6059` ;
6160
61+ const GrayText = styled . p `
62+ color: #999;
63+ ` ;
64+
6265const Practice = ( ) : JSX . Element => {
6366 React . useEffect ( ( ) => {
6467 const html = document . getElementsByTagName ( 'html' ) [ 0 ] ;
@@ -84,28 +87,10 @@ const Practice = (): JSX.Element => {
8487 | 'overseas'
8588 > ( ) ;
8689 const [ counter , setCounter ] = React . useState ( 12345 ) ;
87- const [ modalOpen , setModalOpen ] = React . useState ( false ) ;
88- const intervalRef = React . useRef < NodeJS . Timeout | null > ( null ) ;
89- React . useEffect ( ( ) => {
90- if ( ! intervalRef . current ) {
91- intervalRef . current = setTimeout ( ( ) => {
92- setModalOpen ( true ) ;
93- } , modalDelay * 1000 ) ;
94- }
95- return ( ) => {
96- if ( intervalRef . current ) {
97- clearTimeout ( intervalRef . current ) ;
98- }
99- } ;
100- } , [ ] ) ;
10190
10291 return (
10392 < >
10493 < Title > アクセシビリティチェックの練習ページ</ Title >
105- < ModalDialog open = { modalOpen } onClose = { ( ) => setModalOpen ( false ) } >
106- < H2 > 見てくれてありがとう</ H2 >
107- < P > 閲覧しはじめて{ modalDelay } 秒経ちました</ P >
108- </ ModalDialog >
10994
11095 < H2 > アクセシビリティチェックの練習ページ</ H2 >
11196 < P >
@@ -197,11 +182,34 @@ const Practice = (): JSX.Element => {
197182 </ ExampleContainer >
198183
199184 < H3 as = "h4" > フォーム</ H3 >
200- < NoLabel />
201- < ExampleContainer >
202- < FieldWithBadErrorMessage fieldAriaLabel = "ご住所" />
203- </ ExampleContainer >
204185 < ExampleContainer >
186+ < FormItem >
187+ < label htmlFor = "name" >
188+ < FormLabel > 氏名</ FormLabel >
189+ </ label >
190+ < TextField type = "text" />
191+ < GrayText > 姓と名の間には全角スペースを入れてください</ GrayText >
192+ </ FormItem >
193+ < FormItem >
194+ < FormLabel > メールアドレス</ FormLabel >
195+ < TextField type = "email" id = "name" />
196+ </ FormItem >
197+ < FormItem >
198+ < fieldset >
199+ < legend >
200+ < FormLabel > 性別</ FormLabel >
201+ </ legend >
202+ < RadioButton name = "sex" value = "1" >
203+ 男性
204+ </ RadioButton >
205+ < RadioButton name = "sex" value = "2" >
206+ 女性
207+ </ RadioButton >
208+ < RadioButton name = "sex" value = "9" >
209+ その他
210+ </ RadioButton >
211+ </ fieldset >
212+ </ FormItem >
205213 < FormItem >
206214 < fieldset >
207215 < legend > 年代</ legend >
@@ -372,6 +380,14 @@ const Practice = (): JSX.Element => {
372380 </ RadioButton >
373381 </ fieldset >
374382 </ FormItem >
383+ < FormItem >
384+ < CheckBox name = "toc" value = "agree" >
385+ 利用規約に同意する
386+ </ CheckBox >
387+ </ FormItem >
388+ </ ExampleContainer >
389+ < ExampleContainer >
390+ < FieldWithBadErrorMessage fieldAriaLabel = "postal-code" />
375391 </ ExampleContainer >
376392 < div style = { { marginTop : '1rem' } } >
377393 < Button
0 commit comments