UNCLASSIFIED

Commit c6f704e5 authored by Anne Demey's avatar Anne Demey
Browse files

Merge pull request #50 in USAFHNI/digital-trinity from feature/accessibility to develop

* commit 'cfa515ee':
  Adjusting aria live tags for contact forms
  adding the rest prop properly (spreading it to child component)
  updated the accessibility to the forms so that the keyboard arrow navigation can work and removed the tabIndex from modal
  updated the accessibilty features for the site feedback form and engagement request form
parents e8be170e cfa515ee
...@@ -16,7 +16,7 @@ import { PrimaryButton } from './core'; ...@@ -16,7 +16,7 @@ import { PrimaryButton } from './core';
const korolevFont = 'korolev, Helvetica Neue, Helvetica, Arial, sans-serif'; const korolevFont = 'korolev, Helvetica Neue, Helvetica, Arial, sans-serif';
const ContactForm = ({ onClose }) => { const ContactForm = ({ onClose, ...rest }) => {
const [submitting, setSubmitting] = useState(); const [submitting, setSubmitting] = useState();
const [success, setSuccess] = useState(); const [success, setSuccess] = useState();
...@@ -37,7 +37,7 @@ const ContactForm = ({ onClose }) => { ...@@ -37,7 +37,7 @@ const ContactForm = ({ onClose }) => {
}; };
return ( return (
<Box> <Box {...rest}>
<Box <Box
pad="medium" pad="medium"
background="black" background="black"
...@@ -54,7 +54,13 @@ const ContactForm = ({ onClose }) => { ...@@ -54,7 +54,13 @@ const ContactForm = ({ onClose }) => {
> >
REQUEST A CONSULTATION REQUEST A CONSULTATION
</Heading> </Heading>
{onClose && <Button icon={<Close />} onClick={onClose}></Button>} {onClose && (
<Button
icon={<Close />}
onClick={onClose}
a11yTitle="close this dialog"
></Button>
)}
</Box> </Box>
<Box <Box
pad="medium" pad="medium"
...@@ -77,7 +83,7 @@ const ContactForm = ({ onClose }) => { ...@@ -77,7 +83,7 @@ const ContactForm = ({ onClose }) => {
</Text>{' '} </Text>{' '}
data only. data only.
</Text> </Text>
<Form onSubmit={handleSubmit}> <Form onSubmit={handleSubmit} aria-live="assertive">
<FormField <FormField
name="entry.1114584563" name="entry.1114584563"
htmlFor="text-input-name" htmlFor="text-input-name"
...@@ -144,7 +150,7 @@ const ContactForm = ({ onClose }) => { ...@@ -144,7 +150,7 @@ const ContactForm = ({ onClose }) => {
<PrimaryButton <PrimaryButton
pad={{ vertical: 'large' }} pad={{ vertical: 'large' }}
type="submit" type="submit"
a11yTitle="Submit" a11yTitle="Submit this consultation request form"
label="Submit" label="Submit"
style={{ width: onClose ? '250px' : '100%' }} style={{ width: onClose ? '250px' : '100%' }}
/> />
...@@ -180,13 +186,14 @@ const ContactForm = ({ onClose }) => { ...@@ -180,13 +186,14 @@ const ContactForm = ({ onClose }) => {
style={{ style={{
fontFamily: korolevFont, fontFamily: korolevFont,
}} }}
aria-live="polite"
> >
REQUESTING CONSULTATION REQUESTING CONSULTATION
</Text> </Text>
</Box> </Box>
)} )}
{success && ( {success && (
<Box pad="large" align="center" justify="center"> <Box pad="large" align="center" justify="center" aria-live="polite">
<Heading <Heading
level={3} level={3}
style={{ fontFamily: korolevFont }} style={{ fontFamily: korolevFont }}
......
...@@ -38,7 +38,7 @@ const FeedbackForm = ({ onClose }) => { ...@@ -38,7 +38,7 @@ const FeedbackForm = ({ onClose }) => {
}; };
return ( return (
<Box> <Box role="dialog" aria-modal="true" a11yTitle="Send us your feedback">
<Box <Box
pad="medium" pad="medium"
background="black" background="black"
...@@ -55,12 +55,16 @@ const FeedbackForm = ({ onClose }) => { ...@@ -55,12 +55,16 @@ const FeedbackForm = ({ onClose }) => {
> >
SEND US YOUR FEEDBACK SEND US YOUR FEEDBACK
</Heading> </Heading>
<Button icon={<Close />} onClick={onClose}></Button> <Button
icon={<Close />}
onClick={onClose}
a11yTitle="close this dialog"
></Button>
</Box> </Box>
<Box pad="medium" style={{ position: 'relative' }}> <Box pad="medium" style={{ position: 'relative' }}>
{!success && ( {!success && (
<Box> <Box>
<Form onSubmit={handleSubmit}> <Form onSubmit={handleSubmit} aria-live="assertive">
<FormField <FormField
name="entry.675672969" name="entry.675672969"
htmlFor="text-input-comments" htmlFor="text-input-comments"
...@@ -136,7 +140,7 @@ const FeedbackForm = ({ onClose }) => { ...@@ -136,7 +140,7 @@ const FeedbackForm = ({ onClose }) => {
<PrimaryButton <PrimaryButton
pad={{ vertical: 'large' }} pad={{ vertical: 'large' }}
type="submit" type="submit"
a11yTitle="Submit" a11yTitle="Submit your feedback"
label="Submit" label="Submit"
style={{ width: '250px' }} style={{ width: '250px' }}
/> />
...@@ -172,13 +176,20 @@ const FeedbackForm = ({ onClose }) => { ...@@ -172,13 +176,20 @@ const FeedbackForm = ({ onClose }) => {
style={{ style={{
fontFamily: korolevFont, fontFamily: korolevFont,
}} }}
aria-live="polite"
> >
SENDING FEEDBACK SENDING FEEDBACK
</Text> </Text>
</Box> </Box>
)} )}
{success && ( {success && (
<Box pad="large" align="center" justify="center" gap="small"> <Box
pad="large"
align="center"
justify="center"
gap="small"
aria-live="polite"
>
<Heading <Heading
level={3} level={3}
style={{ fontFamily: korolevFont }} style={{ fontFamily: korolevFont }}
...@@ -187,7 +198,11 @@ const FeedbackForm = ({ onClose }) => { ...@@ -187,7 +198,11 @@ const FeedbackForm = ({ onClose }) => {
FEEDBACK SENT FEEDBACK SENT
</Heading> </Heading>
<Text textAlign="center">Thanks for sharing with us.</Text> <Text textAlign="center">Thanks for sharing with us.</Text>
<SecondaryButton onClick={onClose} label="Close" /> <SecondaryButton
onClick={onClose}
label="Close"
a11yTitle="Close this dialog"
/>
</Box> </Box>
)} )}
</Box> </Box>
......
...@@ -111,7 +111,12 @@ const Solutions = ({ data }) => { ...@@ -111,7 +111,12 @@ const Solutions = ({ data }) => {
}} }}
> >
<Layer animation="fadeIn"> <Layer animation="fadeIn">
<ContactForm onClose={handleModalToggle} /> <ContactForm
onClose={handleModalToggle}
role="dialog"
aria-modal="true"
a11yTitle="request a consultation"
/>
</Layer> </Layer>
</ThemeContext.Extend> </ThemeContext.Extend>
)} )}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment