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

USWDS-Sandbox: Zebra prototype #126

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0fe018e
First draft of zebra prototype
amyleadem Feb 23, 2024
4ed56fb
Move code out of includes
amyleadem Feb 26, 2024
a67d836
Clean up styles
amyleadem Feb 26, 2024
177037a
Remove status-alert.html
amyleadem Feb 27, 2024
93f5c85
Convert to includes
amyleadem Feb 28, 2024
9f9b92e
Add zebra 2/3; add mem date variants
amyleadem Feb 28, 2024
cea422d
create zebra.json and form-bottom.html
amyleadem Feb 28, 2024
2cc4804
Add site alert types
amyleadem Feb 28, 2024
21d4930
Move content to nps-form.html; move site alert data
amyleadem Feb 29, 2024
155561e
Rename nps-form; Move site alert before banenr
amyleadem Feb 29, 2024
5ceb909
Move error hint
amyleadem Feb 29, 2024
b5a4279
Add navbar icons
amyleadem Feb 29, 2024
1da0c1a
Fix index.md links
amyleadem Feb 29, 2024
9b8fe2a
Tweak vertical margins
amyleadem Mar 4, 2024
74fe381
Add $utilities-use-important: true
amyleadem Mar 4, 2024
e1e56e9
Update placement of hint text
amyleadem Mar 4, 2024
6000ae9
Fix header icon asset links
amyleadem Mar 4, 2024
a4b5f81
Update mem date values/constraints
amyleadem Mar 4, 2024
c18332d
Add time constraints to time picker
amyleadem Mar 4, 2024
602161d
Update reference to time picker
amyleadem Mar 4, 2024
90905de
Update hint text; add error class to conduct radio
amyleadem Mar 4, 2024
bbdff60
Update radio - activities legend
amyleadem Mar 5, 2024
f76e914
Add confirmation page; update submit action
amyleadem Mar 5, 2024
cc4b273
Add formaction to submit button
amyleadem Mar 6, 2024
5b7dbf2
Add hint text after selecting "do not agree"
amyleadem Mar 6, 2024
2c5fb30
Change top margin on submit input
amyleadem Mar 6, 2024
a852944
Add ariadescribedby to submit button
amyleadem Mar 6, 2024
27f1d9c
Change style of hintText after "do not agree"
amyleadem Mar 6, 2024
7a4b48e
Format code and add to-do comments
amyleadem Mar 6, 2024
d0fcd5c
Change agency name to U.S. National Parks
amyleadem Mar 6, 2024
33ce129
Change time picker to 7am-7pm
amyleadem Mar 6, 2024
42d3284
Add icon to hint text
amyleadem Mar 6, 2024
5def71e
Add url filter to hiintIcon
mahoneycm Mar 6, 2024
c18bc4c
Update memorable date text example to match number format for month i…
mahoneycm Mar 11, 2024
0323bb3
Remove type="text" from memorable date input
amyleadem Mar 18, 2024
541e3e5
Replace height/width icon utilities with square
amyleadem Mar 18, 2024
6c895b7
Remove pointer events style rule
amyleadem Mar 18, 2024
dace753
Format code
amyleadem Mar 18, 2024
4b1a2ea
Add icon to emergency alert
amyleadem Mar 21, 2024
67a2a64
Add form 4 with input placeholder text
amyleadem Mar 21, 2024
77a5f5d
Add placeholder text to form 2; adjust alignment
amyleadem Mar 21, 2024
dc55d13
Remove form 4 and placeholder include
amyleadem Mar 21, 2024
e63b697
Create alt screen reader readout
amyleadem Mar 22, 2024
612525a
Remove placeholder text from form 4
amyleadem Mar 26, 2024
c242a32
Move test form 4 into form 2
amyleadem Mar 27, 2024
b582bc4
Update status site alert aria-label
amyleadem Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/_data/meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"project": {
"name": "Prototype Lab",
"agency": "Agency",
"agency_shortname": "Agency",
"name": "U.S. National Parks",
"agency": "U.S. National Parks",
"agency_shortname": "USNP",
"domain": "agency.gov"
}
}
3 changes: 3 additions & 0 deletions src/_data/zebra.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Same day reservations at Purplestone National Park"
}
38 changes: 38 additions & 0 deletions src/_includes/zebra/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!--
Variations from default:
- Simplified text and structure
- Added utility classes
- Added icon list

Deviates a lot from standard content - Does not need to be made reusable
-->

<!--start simple footer-->
<footer class="usa-footer">
<div class="usa-footer__primary-section">
<div class="grid-container padding-bottom-2">
<h2 class="padding-top-2">Contact Us</h2>
<ul class="usa-icon-list">
<li class="usa-icon-list__item">
<div class="usa-icon-list__icon">
<svg class="usa-icon" aria-hidden="true" role="img">
<use xlink:href="{{ '/assets/img/sprite.svg#phone' | url }}"></use>
</svg>
</div>
<div class="usa-icon-list__content">
Call us at <a class="usa-link" href="tel:5554443333">555-444-3333</a>
</div>
</li>
<li class="usa-icon-list__item">
<div class="usa-icon-list__icon">
<svg class="usa-icon" aria-hidden="true" role="img">
<use xlink:href="{{ '/assets/img/sprite.svg#mail_outline' | url }}"></use>
</svg>
</div>
<div class="usa-icon-list__content">Email us at <a class="usa-link" href="mailto:purplestone@parks.gov">purplestone@parks.gov</a></div>
</li>
</ul>
</div>
</div>
</footer>
<!--start simple footer-->
4 changes: 4 additions & 0 deletions src/_includes/zebra/form-bottom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% include "zebra/radio--activities.html" %}
{% include "zebra/time-picker.html" %}
{% include "zebra/radio--conduct.html" %}
{% include "zebra/submit.html" %}
33 changes: 33 additions & 0 deletions src/_includes/zebra/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
Variations from default:
- Simplified text and structure
- Added utility classes
- Added non-functional icons

Deviates a lot from standard content - Does not need to be made reusable
-->
<!--start simple header-->
<header class="usa-header usa-header--basic bg-ink">
<div class="usa-nav-container padding-y-1">
<div class="usa-navbar border-0 display-flex flex-align-center flex-justify width-full">
<div class="usa-logo margin-y-0">
<a href="javascript:void(0)" title="{{ meta.project.name }}">
<em class="usa-logo__text text-white font-sans-md">
{{ meta.project.name }}
</em>
</a>
</div>
<div class="display-flex flex-align-center">
<svg class="usa-icon text-white height-4 width-4 margin-right-1" aria-labelledby="search-title" role="img">
<title id="search-title">Search</title>
<use xlink:href={{ "/assets/img/sprite.svg#search" | url }}></use>
</svg>
<svg class="usa-icon text-white height-4 width-4" aria-labelledby="menu-title" role="img">
amyleadem marked this conversation as resolved.
Show resolved Hide resolved
<title id="menu-title">Menu</title>
<use xlink:href={{ "/assets/img/sprite.svg#menu" | url }}></use>
</svg>
</div>
</div>
</div>
</header>
<!--end simple header-->
3 changes: 3 additions & 0 deletions src/_includes/zebra/intro.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>A red asterisk (<abbr title="required" class="usa-hint usa-hint--required">*</abbr>) indicates a required field.</p>

<p class="margin-top-4 margin-bottom-1"><strong>You must be at least 18 years old to reserve an activity.</strong></p>
149 changes: 149 additions & 0 deletions src/_includes/zebra/memorable-date--select.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<!--
Variations from default:
- Changed text inputs to select

Not a standard pattern - should not be reused
-->
<!--start memorable date-->
<fieldset class="usa-fieldset margin-top-0">
<legend class="usa-legend margin-top-0">
What is your date of birth?
<abbr title="required" class="usa-hint usa-hint--required">*</abbr>
</legend>
<span class="usa-hint" id="mdHint">For example: January 19 2000</span>
<div class="usa-memorable-date">
<div class="usa-form-group usa-form-group--month usa-form-group--select">
<label class="usa-label" for="date_of_birth_month">Month</label>
<select
class="usa-select"
id="date_of_birth_month"
name="date_of_birth_month"
aria-describedby="mdHint"
required
>
<option value>- Select -</option>
<option value="1">01 - January</option>
<option value="2">02 - February</option>
<option value="3">03 - March</option>
<option value="4">04 - April</option>
<option value="5">05 - May</option>
<option value="6">06 - June</option>
<option value="7">07 - July</option>
<option value="8">08 - August</option>
<option value="9">09 - September</option>
<option value="10">10 - October</option>
<option value="11">11 - November</option>
<option value="12">12 - December</option>
</select>
</div>
<div class="usa-form-group usa-form-group--day">
<label class="usa-label" for="date_of_birth_day">Day</label>
<select
class="usa-select"
id="date_of_birth_day"
name="date_of_birth_day"
aria-describedby="mdHint"
required
>
<option value>- Select -</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="30">31</option>
</select>
</div>
<div class="usa-form-group usa-form-group--year">
<label class="usa-label" for="date_of_birth_year">Year</label>
<select
class="usa-select"
id="date_of_birth_day"
name="date_of_birth_day"
aria-describedby="mdHint"
required
>
<option value>- Select -</option>
<option value="2006">2006</option>
<option value="2005">2005</option>
<option value="2004">2004</option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
<option value="2000">2000</option>
<option value="1999">1999</option>
<option value="1998">1998</option>
<option value="1997">1997</option>
<option value="1996">1996</option>
<option value="1995">1995</option>
<option value="1994">1994</option>
<option value="1993">1993</option>
<option value="1992">1992</option>
<option value="1991">1991</option>
<option value="1990">1990</option>
<option value="1989">1989</option>
<option value="1988">1988</option>
<option value="1987">1987</option>
<option value="1986">1986</option>
<option value="1985">1985</option>
<option value="1984">1984</option>
<option value="1983">1983</option>
<option value="1982">1982</option>
<option value="1981">1981</option>
<option value="1980">1980</option>
<option value="1979">1979</option>
<option value="1978">1978</option>
<option value="1977">1977</option>
<option value="1976">1976</option>
<option value="1975">1975</option>
<option value="1974">1974</option>
<option value="1973">1973</option>
<option value="1972">1972</option>
<option value="1971">1971</option>
<option value="1970">1970</option>
<option value="1969">1969</option>
<option value="1968">1968</option>
<option value="1967">1967</option>
<option value="1966">1966</option>
<option value="1965">1965</option>
<option value="1965">1964</option>
<option value="1963">1963</option>
<option value="1962">1962</option>
<option value="1961">1961</option>
<option value="1960">1960</option>
<option value="1959">1959</option>
<option value="1958">1958</option>
<option value="1957">1957</option>
<option value="1956">1956</option>
<option value="1955">1955</option>
<option value="1954">1954</option>
</select>
</div>
</div>
</fieldset>
<!--end memorable date-->
61 changes: 61 additions & 0 deletions src/_includes/zebra/memorable-date--text.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!--
Variations from default:
- Changed select to text input

Not a standard pattern - should not be reused
-->
<!--start memorable date-->
<fieldset class="usa-fieldset">
<legend class="usa-legend">
What is your date of birth?
<abbr title="required" class="usa-hint usa-hint--required">*</abbr>
</legend>
<span class="usa-hint" id="mdHint">For example: January 19 2000</span>
<div class="usa-memorable-date">
<div class="usa-form-group display-flex">
<div class="usa-form-group usa-form-group--month">
<label class="usa-label" for="date_of_birth_month">Month</label>
<input
type="text"
class="usa-input"
amyleadem marked this conversation as resolved.
Show resolved Hide resolved
aria-describedby="mdHint"
id="date_of_birth_month"
name="date_of_birth_month"
value=""
size="10"
required
/>
</div>
<div class="usa-form-group usa-form-group--day">
<label class="usa-label" for="date_of_birth_day">Day</label>
<input
class="usa-input"
aria-describedby="mdHint"
id="date_of_birth_day"
name="date_of_birth_day"
minlength="2"
maxlength="2"
pattern="[0-9]*"
inputmode="numeric"
value=""
required
/>
</div>
<div class="usa-form-group usa-form-group--year">
<label class="usa-label" for="date_of_birth_year">Year</label>
<input
class="usa-input"
aria-describedby="mdHint"
id="date_of_birth_year"
name="date_of_birth_year"
minlength="4"
maxlength="4"
pattern="[0-9]*"
inputmode="numeric"
value=""
required
/>
</div>
</div>
</fieldset>
<!--end memorable date-->
78 changes: 78 additions & 0 deletions src/_includes/zebra/memorable-date.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--
TODO
- Make this component reusable by using data to set required and length attributes, text content

Variations from default:
- Added utility classes
- Changed legend text
- Added "required" attribute and text
- Added `minlenth` to text inputs

Can be made reusable with small tweaks
-->

<!--start memorable date-->
<fieldset class="usa-fieldset margin-top-0">
<legend class="usa-legend margin-top-0">
What is your date of birth?
<abbr title="required" class="usa-hint usa-hint--required">*</abbr>
</legend>
<span class="usa-hint" id="mdHint">For example: January 19 2000</span>
<div class="usa-memorable-date">
<div class="usa-form-group usa-form-group--month usa-form-group--select">
<label class="usa-label" for="date_of_birth_month">Month</label>
<select
class="usa-select"
id="date_of_birth_month"
name="date_of_birth_month"
aria-describedby="mdHint"
required
>
<option value>- Select -</option>
<option value="1">01 - January</option>
<option value="2">02 - February</option>
<option value="3">03 - March</option>
<option value="4">04 - April</option>
<option value="5">05 - May</option>
<option value="6">06 - June</option>
<option value="7">07 - July</option>
<option value="8">08 - August</option>
<option value="9">09 - September</option>
<option value="10">10 - October</option>
<option value="11">11 - November</option>
<option value="12">12 - December</option>
</select>
</div>
<div class="usa-form-group usa-form-group--day">
<label class="usa-label" for="date_of_birth_day">Day</label>
<input
class="usa-input"
aria-describedby="mdHint"
id="date_of_birth_day"
name="date_of_birth_day"
minlength="2"
maxlength="2"
pattern="[0-9]*"
inputmode="numeric"
value=""
required
/>
</div>
<div class="usa-form-group usa-form-group--year">
<label class="usa-label" for="date_of_birth_year">Year</label>
<input
class="usa-input"
aria-describedby="mdHint"
id="date_of_birth_year"
name="date_of_birth_year"
minlength="4"
maxlength="4"
pattern="[0-9]*"
inputmode="numeric"
value=""
required
/>
</div>
</div>
</fieldset>
<!--end memorable date-->