Skip to content

Commit 6768f7e

Browse files
authored
Merge pull request #361 from 18F/release-1.3.0
Release 1.3.0
2 parents 2310386 + b11ac1d commit 6768f7e

55 files changed

Lines changed: 804 additions & 117 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ node_modules/
77
npm-debug.log
88
.bundle/
99
assets/
10+
.jekyll_get_cache/

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ source 'https://rubygems.org'
33
gem 'jekyll'
44
gem 'json'
55
gem 'redcarpet'
6-
gem 'hash-joiner'
76
gem 'open-uri-cached'
87
gem 'jekyll-redirect-from'
98

109
gem 'rouge', '1.9'
1110
gem 'scss_lint', require: false
1211

1312
gem 'jekyll-compose', group: [:jekyll_plugins]
13+
14+
gem 'rspec-core'
15+
gem 'rspec-expectations'

Gemfile.lock

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ GEM
44
addressable (2.5.1)
55
public_suffix (~> 2.0, >= 2.0.2)
66
colorator (1.1.0)
7+
diff-lcs (1.3)
78
ffi (1.9.18)
89
forwardable-extended (2.6.0)
9-
hash-joiner (0.0.7)
10-
safe_yaml
1110
jekyll (3.4.3)
1211
addressable (~> 2.4)
1312
colorator (~> 1.0)
@@ -44,6 +43,12 @@ GEM
4443
ffi (>= 0.5.0)
4544
redcarpet (3.3.4)
4645
rouge (1.9.0)
46+
rspec-core (3.6.0)
47+
rspec-support (~> 3.6.0)
48+
rspec-expectations (3.6.0)
49+
diff-lcs (>= 1.2.0, < 2.0)
50+
rspec-support (~> 3.6.0)
51+
rspec-support (3.6.0)
4752
safe_yaml (1.0.4)
4853
sass (3.4.23)
4954
scss_lint (0.50.2)
@@ -54,15 +59,16 @@ PLATFORMS
5459
ruby
5560

5661
DEPENDENCIES
57-
hash-joiner
5862
jekyll
5963
jekyll-compose
6064
jekyll-redirect-from
6165
json
6266
open-uri-cached
6367
redcarpet
6468
rouge (= 1.9)
69+
rspec-core
70+
rspec-expectations
6571
scss_lint
6672

6773
BUNDLED WITH
68-
1.14.6
74+
1.15.1

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You will need to have the following installed on your machine before following t
1717
1. Ruby v2.2.2+, [Installation guides](https://www.ruby-lang.org/en/documentation/installation/)
1818
1. Node v4.2.3+, [Installation guides](https://nodejs.org/en/download/)
1919
1. Bundler v1.12.3+, [Installation guides](http://bundler.io/v1.13/guides/using_bundler_in_application.html#getting-started---installing-bundler-and-bundle-init)
20-
20+
1. Chrome v59 or higher (v60 if on Windows)
2121

2222
### Building the documentation with gulp
2323

@@ -43,7 +43,7 @@ Here are a few other utility commands you may find useful:
4343

4444
- `npm run lint`: Runs `eslint` and `sass-lint` against JavaScript and Sass files.
4545

46-
- `npm test`: Runs `npm run lint` and can also be used to run any tests.
46+
- `npm test`: Runs all tests and linters.
4747

4848
- `npm run watch`: Runs a series of commands that watches for any changes in both the Standards node module and the root level asset folders in this repo.
4949

@@ -76,6 +76,23 @@ https://federalist.fr.cloud.gov/preview/18f/web-design-standards-docs/develop/
7676

7777
See the [`_posts` directory](_posts/#readme) for instructions on adding updates.
7878

79+
### Dynamic content
80+
81+
Some of the content on the documentation site is dynamically fetched from
82+
GitHub. If you want to ensure that its API won't rate-limit you, you
83+
may want to
84+
[create an access token](https://github.com/blog/1509-personal-api-tokens)
85+
and assign it to your `GITHUB_ACCESS_TOKEN` environment variable.
86+
87+
The dynamic content is stored in the `.jekyll_get_cache` directory and
88+
won't be re-fetched once it's cached there. However, this means that your
89+
data can get stale over time, so if you want to ensure that your site
90+
is using the very latest data, you'll want to clear the cache by running:
91+
92+
```
93+
rm -rf .jekyll_get_cache
94+
```
95+
7996
## Contributing
8097

8198
Please read through our [contributing guidelines](CONTRIBUTING.md). These guidelines are directions for opening issues and submitting pull requests, and they also detail the coding and design standards we follow.

_components/buttons.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ lead: Use buttons to signal actions.
3030
<li><code>usa-button-big</code></li>
3131
</ul>
3232
<p>For example, a secondary button style would use the following code:
33-
<code>&lt;a class="usa-button usa-button-secondary" href="/my-link"&gt;My button&lt;/a&gt;</code></p>
33+
<code>&lt;a class="usa-button usa-button-secondary" href=&quot;/my-link"&gt;My button&lt;/a&gt;</code></p>
3434
<h4 class="usa-heading">Accessibility</h4>
3535
<ul class="usa-content-list">
3636
<li>Buttons should display a visible focus state when users tab to them.</li>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Validation
3+
parent: Form controls
4+
maturity: alpha
5+
order: 06
6+
lead: Stating validation requirements up front, with live feedback, means users won't be left guessing.
7+
---
8+
9+
{% include code/preview.html component="validation" %}
10+
{% include code/accordion.html component="validation" %}
11+
<div class="usa-accordion-bordered">
12+
<button class="usa-button-unstyled usa-accordion-button"
13+
aria-expanded="true" aria-controls="validation-docs">
14+
Documentation
15+
</button>
16+
<div id="validation-docs" aria-hidden="false" class="usa-accordion-content">
17+
<h4 class="usa-heading">Guidance</h4>
18+
<ul class="usa-content-list">
19+
<li>Input fields which have custom validation logic can automatically
20+
provide helpful feedback to users if they are assigned a
21+
<code>data-validation-element</code> attribute set to a
22+
CSS selector that uniquely identifies a <code>.usa-checklist</code>,
23+
e.g. <code>data-validation-element="#validate-code"</code>.</li>
24+
<li>
25+
For each kind of validation you'd like to provide feedback on:
26+
<ol>
27+
<li>Come up with a name for the validator, e.g.
28+
<code>uppercase</code>. It shouldn't have any spaces in it.</li>
29+
<li>On one of the list elements in the <code>.usa-checklist</code>,
30+
set the <code>data-validator</code> attribute to the
31+
name of the validator, e.g. <code>data-validator="uppercase"</code>.
32+
This is the list item that will appear "checked" when the
33+
validator's condition is met.</li>
34+
<li>On the input field, add a field called
35+
<code>data-validate-<em>validator name</em></code> and set
36+
its value to a <a href="https://regexone.com/">regular
37+
expression</a> that represents whether the validator's
38+
condition is met, e.g. <code>data-validate-uppercase="[A-Z]"</code>.</li>
39+
</ol>
40+
</li>
41+
</ul>
42+
</div>
43+
</div>

_components/form-controls/form-controls.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ subnav:
1818
href: '#radio-buttons'
1919
- text: Date input
2020
href: '#date-input'
21+
- text: Validation
22+
href: '#validation'
2123
---
2224

2325
{% include accessibility.html %}

_components/form-templates/04-password-reset-form.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ lead: A standard template for resetting a password
2525
<h5>Guidance</h5>
2626
<ul class="usa-content-list">
2727
<li>If users need a password to access your site, they will forget that password and need a way to reset it.</li>
28+
<li>For guidance on the technical details of validation, see the
29+
<a href="/components/form-controls/#validation">validation documentation</a>.</li>
2830
<li>State any password requirements (for example, “Must include one capital letter”) up front. Don’t leave users guessing about password requirements, only to hit them with an error message later.</li>
2931
<li>The requirements shown above are just provided as an example and should not be taken as recommendations.</li>
3032
</ul>

_components/page-templates/template-docs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<button class="usa-menu-btn">Menu</button>
5656
<div class="usa-logo" id="logo">
5757
<em class="usa-logo-text">
58-
<a href="#" title="Home" aria-label="Home">Federal <br>Agency Name</a>
58+
<a href="#" title="Home" aria-label="Federal Agency Name Home">Federal <br>Agency Name</a>
5959
</em>
6060
</div>
6161
</div>

_components/page-templates/template-landing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<button class="usa-menu-btn">Menu</button>
5555
<div class="usa-logo" id="logo">
5656
<em class="usa-logo-text">
57-
<a href="#" title="Home" aria-label="Home">Federal Agency Name</a>
57+
<a href="#" title="Home" aria-label="Federal Agency Name Home">Federal Agency Name</a>
5858
</em>
5959
</div>
6060
</div>

0 commit comments

Comments
 (0)