-
Notifications
You must be signed in to change notification settings - Fork 174
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 #361 from 18F/release-1.3.0
Release 1.3.0
- Loading branch information
Showing
55 changed files
with
804 additions
and
117 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ node_modules/ | |
npm-debug.log | ||
.bundle/ | ||
assets/ | ||
.jekyll_get_cache/ |
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 @@ | ||
--- | ||
title: Validation | ||
parent: Form controls | ||
maturity: alpha | ||
order: 06 | ||
lead: Stating validation requirements up front, with live feedback, means users won't be left guessing. | ||
--- | ||
|
||
{% include code/preview.html component="validation" %} | ||
{% include code/accordion.html component="validation" %} | ||
<div class="usa-accordion-bordered"> | ||
<button class="usa-button-unstyled usa-accordion-button" | ||
aria-expanded="true" aria-controls="validation-docs"> | ||
Documentation | ||
</button> | ||
<div id="validation-docs" aria-hidden="false" class="usa-accordion-content"> | ||
<h4 class="usa-heading">Guidance</h4> | ||
<ul class="usa-content-list"> | ||
<li>Input fields which have custom validation logic can automatically | ||
provide helpful feedback to users if they are assigned a | ||
<code>data-validation-element</code> attribute set to a | ||
CSS selector that uniquely identifies a <code>.usa-checklist</code>, | ||
e.g. <code>data-validation-element="#validate-code"</code>.</li> | ||
<li> | ||
For each kind of validation you'd like to provide feedback on: | ||
<ol> | ||
<li>Come up with a name for the validator, e.g. | ||
<code>uppercase</code>. It shouldn't have any spaces in it.</li> | ||
<li>On one of the list elements in the <code>.usa-checklist</code>, | ||
set the <code>data-validator</code> attribute to the | ||
name of the validator, e.g. <code>data-validator="uppercase"</code>. | ||
This is the list item that will appear "checked" when the | ||
validator's condition is met.</li> | ||
<li>On the input field, add a field called | ||
<code>data-validate-<em>validator name</em></code> and set | ||
its value to a <a href="https://regexone.com/">regular | ||
expression</a> that represents whether the validator's | ||
condition is met, e.g. <code>data-validate-uppercase="[A-Z]"</code>.</li> | ||
</ol> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> |
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
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,24 @@ | ||
<form class="usa-form"> | ||
<fieldset> | ||
<legend class="usa-drop_text">Enter a code</legend> | ||
|
||
<div class="usa-alert usa-alert-info"> | ||
<div class="usa-alert-body"> | ||
<h3 class="usa-alert-heading">Codes must:</h3> | ||
</div> | ||
<ul class="usa-checklist" id="validate-code"> | ||
<li data-validator="uppercase">Have at least 1 uppercase character</li> | ||
<li data-validator="numerical">Have at least 1 numerical character</li> | ||
</ul> | ||
</div> | ||
|
||
<label for="code">Code</label> | ||
<input id="code" name="code" type="text" | ||
aria-describedby="validate-code" | ||
data-validate-uppercase="[A-Z]" | ||
data-validate-numerical="\d" | ||
data-validation-element="#validate-code"> | ||
|
||
<input type="submit" value="Submit code"> | ||
</fieldset> | ||
</form> |
Oops, something went wrong.