Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
243443b
add banner markup & sass
heymatthenry May 14, 2024
ff91027
Add basic banner toggle behavior
heymatthenry May 14, 2024
b64371b
just use hidden attribute on banner
heymatthenry May 20, 2024
130446c
add workspace
heymatthenry May 20, 2024
c4f8c72
Add identifier component
May 24, 2024
3d348a9
Add scaffolding to elements
May 28, 2024
dae3bb9
Add attribute-based identifier
May 29, 2024
eb8c394
Replace inline classes with slot names
May 29, 2024
78ff480
Clean up code
May 30, 2024
0bb3b3a
Check for existence of slot elements before manipulating
May 30, 2024
f346baf
Generate logo wrapper; clean up code and comments
May 30, 2024
d732d9d
Add examples of diff logo counts
May 30, 2024
d510eb4
Add attribute objects; change snake case -> camel
May 31, 2024
bafc957
Add language options
May 31, 2024
46082c5
Move language content to JSON
May 31, 2024
33c567f
Use maps to scaffold links and logos
Jun 5, 2024
d6d17e1
Add customContent object; add disclaimer text
Jun 5, 2024
8cb8a1e
Add taxpayer disclosure; customContent > langContent
Jun 5, 2024
09a060c
Add secondary parent agency; comment out examples
Jun 6, 2024
7c31f9e
Organize component options
Jun 6, 2024
7d98d5b
Add TODO comments
Jun 7, 2024
494503e
Show "no logo" example
Jun 7, 2024
ad19ad2
Merge branch 'jm/add-storybook'
Jun 11, 2024
e2cc3db
Add first pass at identifier storybook
Jun 12, 2024
9995dcb
Consolidate SB templates; Move to connectedCallback; update data;
Jun 12, 2024
dd67c06
Fix nologo null definition
Jun 12, 2024
9c9efcd
Add taxpayer disclaimer stories
Jun 12, 2024
7a52bdf
Merge branch 'jm/add-storybook' of https://github.com/uswds/uswds-nex…
Jun 12, 2024
e253bfb
Remove banner code
Jun 12, 2024
34163d2
Remove banner workspace from package.json
Jun 12, 2024
06473f9
Move data out of JSON into args
Jun 13, 2024
97394bf
Add default Spanish args
Jun 14, 2024
7e11513
Check for logos before adding logos wrapper
Jun 14, 2024
9d5878a
Format quote type
Jun 14, 2024
25e4849
Make aria labels customizable
Jun 14, 2024
4b9d73b
Wrap "An official" text in aria-hidden span
Jun 14, 2024
2a87372
Run prettier
Jun 14, 2024
516a6de
Update display styles for usagov-description
Jun 14, 2024
21bf54b
Format render code for docs
Jun 14, 2024
114d3c5
Create separate templates for component sections
Jun 14, 2024
e7aa5f7
Run prettier
Jun 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 215 additions & 0 deletions web-components/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>USWDS + Lit</title>
<script type="module" src="/src/components/usa-link/index.js"></script>
<script type="module" src="/src/components/usa-identifier/index.js"></script>
<script type="module" src="/src/components/usa-identifier-attributes/index.js"></script>
<script type="module" src="/src/components/usa-identifier-attributes-object/index.js"></script>

<style>
:root {
--theme-link-color: hotpink;
Expand All @@ -28,4 +32,215 @@
</p>
</body>

<h2>Option 1: Minimal markup</h2>
<p>Benefits: content is still available if no JS, intuitive implementation and customization</p>
<h3>Simple implementation</h3>
<ul>
<li>Default content</li>
<li>One agency/logo</li>
</ul>

<!--
TODO:
- consider using named slots for nav links
- improve slot naming to be more intuitive
-->
<usa-identifier>
<a slot="logo" href="https://www.gsa.gov/">
<img
src="https://designsystem.digital.gov/img/gsa-logo.svg"
alt="General Services Administration logo"/>
</a>
<p slot="domain">designsystem.digital.gov</p>
<p slot="disclaimer">An official website of the <a href="https://gsa.gov/">General Services Administration</a></p>
<nav slot="links">
<a href="https://www.gsa.gov/about-us">About GSA</a>
<a href="https://www.gsa.gov/website-information/accessibility-statement">Accessibility statement</a>
<a href="https://www.gsa.gov/reference/freedom-of-information-act-foia">FOIA requests</a>
<a href="https://www.gsa.gov/reference/civil-rights-programs/notification-and-federal-employee-antidiscrimination-and-retaliation-act-of-2002">No FEAR Act data</a>
<a href="https://www.gsaig.gov/">Office of the Inspector General</a>
<a href="https://www.gsa.gov/reference/reports/budget-performance">Performance reports</a>
<a href="https://www.gsa.gov/website-information/website-policies">Privacy policy</a>
</nav>
<div slot="usagov">Looking for U.S. government information and services? <a href="https://www.usa.gov/">Visit USA.gov</a></div>
</usa-identifier>

<h3>Complex implementation</h3>
<ul>
<li>Custom content</li>
<li>Taxpayer disclosure</li>
<li>Multiple agencies/logos</li>
</ul>

<usa-identifier>
<a slot="logo" href="https://www.gsa.gov/">
<img
src="https://designsystem.digital.gov/img/gsa-logo.svg"
alt="General Services Administration logo"/>
</a>
<a slot="logo" href="https://www.gsa.gov/">
<img
src="https://designsystem.digital.gov/img/gsa-logo.svg"
alt="General Services Administration logo"/>
</a>
<p slot="domain">designsystem.digital.gov</p>
<p slot="disclaimer">
Un sitio web oficial de <a href="https://gsa.gov/">General Services Administration</a> y
<a href="https://gsa.gov/">Other agency</a>.
Producido y publicado con dinero de los contribuyentes de impuestos.</p>.
</p>
<nav slot="links">
<a href="https://www.gsa.gov/about-us">Acerca de GSA</a>
<a href="https://www.gsa.gov/website-information/accessibility-statement">Declaración de accesibilidad</a>
<a href="https://www.gsa.gov/reference/freedom-of-information-act-foia">Solicitud a través de FOIA</a>
<a href="https://www.gsa.gov/reference/civil-rights-programs/notification-and-federal-employee-antidiscrimination-and-retaliation-act-of-2002">Datos de la ley No FEAR</a>
<a href="https://www.gsaig.gov/">Oficina del Inspector General</a>
<a href="https://www.gsa.gov/reference/reports/budget-performance">Informes de desempeño</a>
<a href="https://www.gsa.gov/website-information/website-policies">Política de privacidad</a>
</nav>
<div slot="usagov">¿Necesita información y servicios del Gobierno? <a href="https://www.usa.gov/espanol/">Visite USA.gov en Español</a></div>
</usa-identifier>

<h2>Option 2: Attribute-based (attribute objects)</h2>

<h3>Simple implementation</h3>
<ul>
<li>Default content</li>
<li>One agency/logo</li>
<li>No taxpayer disclosure</li>
</ul>

<usa-identifier-attributes-object
siteDomain="designsystem.digital.gov"
parentAgency= '{
"name": "General Services Administration",
"shortname": "GSA",
"url": "https://www.gsa.gov/",
"logo": "https://designsystem.digital.gov/img/gsa-logo.svg"
}'
linkURLs= '{
"about": "https://www.gsa.gov/about-us",
"accessibility": "https://www.gsa.gov/website-information/accessibility-statement",
"NoFEAR": "https://www.gsa.gov/reference/civil-rights-programs/notification-and-federal-employee-antidiscrimination-and-retaliation-act-of-2002",
"FOIA": "https://www.gsa.gov/reference/freedom-of-information-act-foia",
"OIG": "https://www.gsaig.gov/",
"performance": "https://www.gsa.gov/reference/reports/budget-performance",
"privacy": "https://www.gsa.gov/website-information/website-policies"
}'
>
</usa-identifier-attributes-object>

<h3>Medium complexity implementation</h3>
<ul>
<li>USWDS-provided Spanish content</li>
<li>One agency</li>
<li>No logo</li>
<li>Taxpayer disclosure</li>
</ul>

<usa-identifier-attributes-object
language="es"
taxpayerDisclosure
siteDomain="designsystem.digital.gov"
parentAgency= '{
"name": "General Services Administration",
"shortname": "GSA",
"url": "https://www.gsa.gov/"
}'
linkURLs= '{
"about": "https://www.gsa.gov/about-us",
"accessibility": "https://www.gsa.gov/website-information/accessibility-statement",
"NoFEAR": "https://www.gsa.gov/reference/civil-rights-programs/notification-and-federal-employee-antidiscrimination-and-retaliation-act-of-2002",
"FOIA": "https://www.gsa.gov/reference/freedom-of-information-act-foia",
"OIG": "https://www.gsaig.gov/",
"performance": "https://www.gsa.gov/reference/reports/budget-performance",
"privacy": "https://www.gsa.gov/website-information/website-policies"
}'
>
</usa-identifier-attributes-object>


<h3>High complexity implementation</h3>
<ul>
<li>User-provided custom content</li>
<li>Two agencies/logos</li>
<li>Taxpayer disclosure</li>
</ul>


<!-- TODO: re-organize these objects to be more intuitive. Don't separate out "langContent" -->
<usa-identifier-attributes-object
taxpayerDisclosure
siteDomain="[French] designsystem.digital.gov"
parentAgency= '{
"name": "[French] General Services Administration",
"shortname": "[French] GSA",
"url": "https://www.gsa.gov/",
"logo": "https://designsystem.digital.gov/img/gsa-logo.svg"
}'
secondaryParentAgency= '{
"name": "[French] Other agency",
"shortname": "OA",
"url": "https://www.oa.gov/",
"logo": "https://designsystem.digital.gov/assets/img/circle-gray-20.svg"
}'
langContent= '{
"aria_label": "Agency identifier",
"disclaimer": "[French] An official website of the",
"taxpayer": "[French]Produced and published at taxpayer expense",
"conjunction": "et",
"linkLabels": {
"about": "[French] About",
"accessibility": "[French] Accessibility statement",
"FOIA": "[French] FOIA requests",
"noFEAR": "[French] No FEAR Act data",
"OIG": "[French] Office of the Inspector General",
"performance": "[French] Performance reports",
"privacy": "[French] Privacy policy"
},
"usagov": {
"aria_label": "[French] U.S. government information and services",
"description": "[French] Looking for U.S. government information and services?",
"link": {
"label": "[French] Visit USA.gov",
"url": "https://www.usa.gov/"
}
}
}'
linkURLs= '{
"about": "https://www.gsa.gov/about-us",
"accessibility": "https://www.gsa.gov/website-information/accessibility-statement",
"NoFEAR": "https://www.gsa.gov/reference/civil-rights-programs/notification-and-federal-employee-antidiscrimination-and-retaliation-act-of-2002",
"FOIA": "https://www.gsa.gov/reference/freedom-of-information-act-foia",
"OIG": "https://www.gsaig.gov/",
"performance": "https://www.gsa.gov/reference/reports/budget-performance",
"privacy": "https://www.gsa.gov/website-information/website-policies"
}'
>
</usa-identifier-attributes-object>


<h2>Option 3: Attribute-based (flat structure)</h2>
<h3>Simple implementation</h3>
<ul>
<li>Default content</li>
<li>One agency/logo</li>
</ul>

<usa-identifier-attributes
siteDomain="designsystem.digital.gov"
parentName="General Services Administration"
parentShortname="GSA"
parentHref="https://www.gsa.gov/"
parentLogo="https://designsystem.digital.gov/img/gsa-logo.svg"
linkAccessibility="https://www.gsa.gov/website-information/accessibility-statement"
linkAbout="https://www.gsa.gov/about-us"
linkFOIA="https://www.gsa.gov/reference/freedom-of-information-act-foia"
linkNoFEAR="https://www.gsa.gov/reference/civil-rights-programs/notification-and-federal-employee-antidiscrimination-and-retaliation-act-of-2002"
linkOIG="https://www.gsaig.gov/"
linkPerformance="https://www.gsa.gov/reference/reports/budget-performance"
linkPrivacy="https://www.gsa.gov/website-information/website-policies"
>
</usa-identifier-attributes>
</body>
</html>
8 changes: 8 additions & 0 deletions web-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as DefaultContent } from "./usa-identifier.json";
export { default as EsContent } from "./usa-identifier~lang-es.json";
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"aria_label": "Agency identifier",
"disclaimer": "An official website of the",
"taxpayer": "Produced and published at taxpayer expense",
"conjunction": "and",
"linkLabels": {
"about": "About",
"accessibility": "Accessibility statement",
"FOIA": "FOIA requests",
"noFEAR": "No FEAR Act data",
"OIG": "Office of the Inspector General",
"performance": "Performance reports",
"privacy": "Privacy policy"
},
"usagov": {
"aria_label": "U.S. government information and services",
"description": "Looking for U.S. government information and services?",
"link": {
"label": "Visit USA.gov",
"url": "https://www.usa.gov/"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"aria_label": "Identificador de la agencia,",
"disclaimer": "Un sitio web oficial de",
"taxpayer": "Producido y publicado con dinero de los contribuyentes de impuestos",
"conjunction": "y",
"linkLabels": {
"about": "Acerca de",
"accessibility": "Declaración de accesibilidad",
"FOIA": "Solicitud a través de FOIA",
"noFEAR": "Datos de la ley No FEAR",
"OIG": "Oficina del Inspector General",
"performance": "Informes de desempeño",
"privacy": "Política de privacidad"
},
"usagov": {
"aria_label": "Información y servicios del Gobierno de EE. UU.,",
"description": "¿Necesita información y servicios del Gobierno?",
"link": {
"label": "Visite USA.gov en Español",
"url": "https://www.usa.gov/espanol/"
}
}
}
Loading