Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PW strength meter in uswds #78

Merged
merged 16 commits into from
Jun 5, 2019
38 changes: 38 additions & 0 deletions docs/_components/password-strength-meters.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
---
title: Password strength meters
---

The password strength indicator should be used when users are trying to create a password.

## Password component example
{% capture example %}

<div class="grid-row">
<div class="grid-col">
<label for="password_form_password" class="usa-label">Password</label>
<input id="password_form_password" type="text" class="usa-input--lg-password" required="required"
type="password">
</div>
</div>
<div class="grid-row">
<div aria-atomic="true" aria-live="polite" class="lg-password-strength--na" id="lg-password-strength--container">
<div class="lg-password--bar grid-col"></div>
<div class="lg-password--bar grid-col"></div>
<div class="lg-password--bar grid-col"></div>
<div class="lg-password--bar grid-col"></div>
</div>
</div>
<div class="grid-row">
<div class="grid-col lg-password--guidance">
<span>Password strength: </span>
<span class="bold" data-forbidden-passwords="[&quot;[email protected]&quot;, &quot;owq58917&quot;, &quot;cndps&quot;, &quot;com&quot;, &quot;login.gov&quot;]" id="pw-strength-txt" class="lg-password--summary">
...
</span>
<div id="feedback" class="lg-password--explanation">&nbsp;</div>
</div>
</div>
<div class="grid-row">
<div class="grid-col">
<input type="submit" name="commit" value="Continue" class="usa-button" data-disable-with="Continue" disabled>
</div>
</div>

{% endcapture %}
{% include helpers/code-example.html code=example %}
6 changes: 5 additions & 1 deletion docs/_includes/helpers/code-example.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div>{{ include.code }}</div>
<div>
<div class='margin-y-3'>
{{ include.code }}
</div>
</div>

<div markdown="1">
```html
Expand Down
4 changes: 4 additions & 0 deletions docs/_templates/email.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Email
---

{% include helpers/page-preview.html
path="/examples/email-template.html"
%}
Loading