-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from unicef/fix/accessibility
Fix accessibility and update docs
- Loading branch information
Showing
25 changed files
with
71,877 additions
and
15,062 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
```jsx | ||
import React, { useState, useRef } from 'react' | ||
import { Grid } from '@material-ui/core' | ||
import { UValidatorForm, UButton, ActiveFormPositiveInteger } from '../../index.js' | ||
|
||
// export default function ActiveFormPositiveInteger() { | ||
|
||
const form = useRef('form') | ||
const [value, setValue] = useState() | ||
|
||
function handleChange(event) { | ||
const { value } = event.target | ||
setValue(value) | ||
} | ||
|
||
function handleSubmit() { | ||
// Submit the changes from here | ||
} | ||
|
||
// return ( | ||
;<UValidatorForm | ||
ref={form} | ||
onSubmit={handleSubmit} | ||
onError={errors => console.log(errors)} | ||
// instantValidate={true} | ||
> | ||
<Grid container spacing={1}> | ||
<Grid item xs={12} lg={4}> | ||
<ActiveFormPositiveInteger | ||
label="Number" | ||
value={value} | ||
onChange={handleChange} | ||
name="number" | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<UButton type="submit">Submit</UButton> | ||
</Grid> | ||
</Grid> | ||
</UValidatorForm> | ||
// ) | ||
// } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
```jsx | ||
import React, { useState, useEffect, useRef } from 'react' | ||
import { Grid } from '@material-ui/core' | ||
import { UValidatorForm, UButton } from '../../index.js' // change it to '@unicef/material-ui' | ||
|
||
|
||
// export default function UPositiveIntegerExample() { | ||
|
||
const form = useRef('form') | ||
const [value, setValue] = useState() | ||
|
||
function handleValue(event) { | ||
const { value } = event.target | ||
setValue(value) | ||
} | ||
|
||
function handleSubmit() { | ||
// Submit the changes from here | ||
} | ||
|
||
// return ( | ||
;<UValidatorForm | ||
ref={form} | ||
onSubmit={handleSubmit} | ||
onError={errors => console.log(errors)} | ||
// instantValidate={true} | ||
> | ||
<Grid container spacing={1}> | ||
<Grid item xs={12} lg={4}> | ||
<UPositiveInteger | ||
label="Number" | ||
value={value} | ||
onChange={handleValue} | ||
name="number" | ||
validators={['required']} | ||
/> | ||
</Grid> | ||
<Grid item xs={12}> | ||
<UButton type="submit">Submit</UButton> | ||
</Grid> | ||
</Grid> | ||
</UValidatorForm> | ||
// ) | ||
// } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.