Merge branch 'main' of https://github.com/GSA/notifications-admin into 718-clean-up-components-section

# Conflicts:
#	app/templates/components/components/footer/_footer.scss
#	app/templates/components/components/hint/_hint.scss
#	app/templates/views/service-settings/data-retention.html
#	app/templates/views/service-settings/sms-senders.html
#	app/templates/views/two-factor-webauthn.html
#	app/templates/views/user-profile/security-keys.html
This commit is contained in:
Jonathan Bobel
2023-08-31 12:06:55 -04:00
186 changed files with 3619 additions and 16898 deletions

View File

@@ -49,7 +49,7 @@
visuallyHiddenText: params.errorMessage.visuallyHiddenText
}) | indent(2) | trim }}
{% endif %}
<div class="govuk-checkboxes test {%- if params.classes %} {{ params.classes }}{% endif %}"
<div class="govuk-checkboxes {%- if params.classes %} {{ params.classes }}{% endif %}"
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}
{%- if isConditional %} data-module="checkboxes"{% endif -%}>
{% for item in params.items %}

View File

@@ -0,0 +1,236 @@
@import "../../settings/all";
@import "../../tools/all";
@import "../../helpers/all";
@import "../../helpers/typography";
@include govuk-exports("govuk/component/footer") {
$usa-footer-background: $govuk-canvas-background-colour;
$usa-footer-border-top: #a1acb2;
$usa-footer-border: govuk-colour("grey-2");
$usa-footer-text: #454a4c;
$usa-footer-link: $usa-footer-text;
$usa-footer-link-hover: #171819;
// Based on the govuk-crest-2x.png image dimensions.
$usa-footer-crest-image-width-2x: 250px;
$usa-footer-crest-image-height-2x: 204px;
// Half the 2x image so that it fits the regular 1x size.
$usa-footer-crest-image-width: ($usa-footer-crest-image-width-2x / 2);
$usa-footer-crest-image-height: ($usa-footer-crest-image-height-2x / 2);
.usa-footer {
@include govuk-font($size: 16);
@include govuk-responsive-padding(7, "top");
@include govuk-responsive-padding(5, "bottom");
border-top: 1px solid $usa-footer-border-top;
color: $usa-footer-text;
background: $usa-footer-background;
}
.usa-footer__link {
@include govuk-focusable-fill;
&:link,
&:visited {
color: $usa-footer-link;
}
&:hover,
&:active {
color: $usa-footer-link-hover;
}
// When focussed, the text colour needs to be darker to ensure that colour
// contrast is still acceptable
&:focus {
color: $govuk-focus-text-colour;
}
// alphagov/govuk_template includes a specific a:link:focus selector
// designed to make unvisited links a slightly darker blue when focussed, so
// we need to override the text colour for that combination of selectors.
@include govuk-compatibility(govuk_template) {
&:link:focus {
@include govuk-text-colour;
}
}
}
.usa-footer__section-break {
margin: 0; // Reset `<hr>` default margins
@include govuk-responsive-margin(8, "bottom");
border: 0; // Reset `<hr>` default borders
border-bottom: 1px solid $usa-footer-border;
}
.usa-footer__meta {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex; // Support: Flexbox
margin-right: -$govuk-gutter-half;
margin-left: -$govuk-gutter-half;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap; // Support: Flexbox
-webkit-box-align: end;
-webkit-align-items: flex-end;
-ms-flex-align: end;
align-items: flex-end; // Support: Flexbox
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center; // Support: Flexbox
}
.usa-footer__meta-item {
margin-right: $govuk-gutter-half;
margin-bottom: govuk-spacing(5);
margin-left: $govuk-gutter-half;
}
.usa-footer__meta-item--grow {
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1; // Support: Flexbox
@include mq ($until: tablet) {
-webkit-flex-basis: 320px;
-ms-flex-preferred-size: 320px;
flex-basis: 320px; // Support: Flexbox
}
}
.usa-footer__licence-logo {
display: inline-block;
margin-right: govuk-spacing(2);
@include mq ($until: desktop) {
margin-bottom: govuk-spacing(3);
}
vertical-align: top;
}
.usa-footer__licence-description {
display: inline-block;
}
.usa-footer__copyright-logo {
display: inline-block;
min-width: $usa-footer-crest-image-width;
padding-top: ($usa-footer-crest-image-height + govuk-spacing(2));
background-image: govuk-image-url("govuk-crest.png");
@include govuk-device-pixel-ratio {
background-image: govuk-image-url("govuk-crest-2x.png");
}
background-repeat: no-repeat;
background-position: 50% 0%;
background-size: $usa-footer-crest-image-width $usa-footer-crest-image-height;
text-align: center;
text-decoration: none;
white-space: nowrap;
}
.usa-footer__inline-list {
margin-top: 0;
margin-bottom: govuk-spacing(3);
padding: 0;
}
.usa-footer__meta-custom {
margin-bottom: govuk-spacing(4);
}
.usa-footer__inline-list-item {
display: inline-block;
margin-right: govuk-spacing(3);
margin-bottom: govuk-spacing(1);
}
.usa-footer__heading {
@include govuk-responsive-margin(7, "bottom");
padding-bottom: govuk-spacing(4);
@include mq ($until: tablet) {
padding-bottom: govuk-spacing(2);
}
border-bottom: 1px solid $usa-footer-border;
}
.usa-footer__navigation {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex; // Support: Flexbox
margin-right: -$govuk-gutter-half;
margin-left: -$govuk-gutter-half;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap; // Support: Flexbox
}
.usa-footer__section {
display: inline-block;
margin-right: $govuk-gutter-half;
margin-bottom: $govuk-gutter;
margin-left: $govuk-gutter-half;
vertical-align: top;
// Ensure columns take up equal width (typically one-half:one-half)
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1; // Support: Flexbox
-webkit-flex-shrink: 1;
-ms-flex-negative: 1;
flex-shrink: 1; // Support: Flexbox
@include mq ($until: desktop) {
// Make sure columns do not drop below 200px in width
// Will typically result in wrapping, and end up in a single column on smaller screens.
-webkit-flex-basis: 200px;
-ms-flex-preferred-size: 200px;
flex-basis: 200px; // Support: Flexbox
}
}
// Sections two-third:one-third on desktop
@include mq ($from: desktop) {
.usa-footer__section:first-child {
-webkit-box-flex: 2;
-webkit-flex-grow: 2;
-ms-flex-positive: 2;
flex-grow: 2; // Support: Flexbox
}
}
.usa-footer__list {
margin: 0;
padding: 0;
list-style: none;
-webkit-column-gap: $govuk-gutter;
-moz-column-gap: $govuk-gutter;
column-gap: $govuk-gutter; // Support: Columns
}
@include mq ($from: desktop) {
.usa-footer__list--columns-2 {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2; // Support: Columns
}
.usa-footer__list--columns-3 {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3; // Support: Columns
}
}
.usa-footer__list-item {
@include govuk-responsive-margin(4, "bottom");
}
.usa-footer__list-item:last-child {
margin-bottom: 0;
}
}

View File

@@ -41,7 +41,7 @@
<h2 class="usa-sr-only">{{ params.meta.visuallyHiddenTitle | default("Support links") }}</h2>
{% if params.meta.items %}
{% for item in params.meta.items %}
<a class="govuk-footer__link" href="{{ item.href }}" {% for attribute, value in item.attributes %}
<a class="usa-footer__link" href="{{ item.href }}" {% for attribute, value in item.attributes %}
{{attribute}}="{{value}}" {% endfor %}>
{{ item.text }}
</a>

View File

@@ -1,53 +1,39 @@
<!-- usa banner -->
<section class="usa-banner" aria-label="Official website of the United States government">
<section class="usa-banner site-banner" aria-label="Official website of the United States government,,,,,,">
<div class="usa-accordion">
<header class="usa-banner__header">
<div class="usa-banner__inner">
<div class="grid-col-auto">
<img aria-hidden="true" class="usa-banner__header-flag" src="/static/images/us_flag_small.png" alt="" />
<img aria-hidden="true" class="usa-banner__header-flag" src="/static/img/us_flag_small.png" alt="" />
</div>
<div class="grid-col-fill tablet:grid-col-auto" aria-hidden="true">
<p class="usa-banner__header-text">
An official website of the United States government
</p>
<p class="usa-banner__header-text">An official website of the United States government</p>
<p class="usa-banner__header-action">Heres how you know</p>
</div>
<button type="button" class="usa-accordion__button usa-banner__button" aria-expanded="false"
aria-controls="gov-banner-default-default">
<button type="button" class="usa-accordion__button usa-banner__button" aria-expanded="false" aria-controls="gov-banner">
<span class="usa-banner__button-text">Heres how you know</span>
</button>
</div>
</header>
<div class="usa-banner__content usa-accordion__content" id="gov-banner-default-default">
<div class="usa-banner__content usa-accordion__content" id="gov-banner" hidden="">
<div class="grid-row grid-gap-lg">
<div class="usa-banner__guidance tablet:grid-col-6">
<img class="usa-banner__icon usa-media-block__img" src="/static/images/icon-dot-gov.svg" role="img" alt=""
aria-hidden="true" />
<img class="usa-banner__icon usa-media-block__img" src="/static/img/icon-dot-gov.svg" role="img" alt="" aria-hidden="true">
<div class="usa-media-block__body">
<p>
<strong>Official websites use .gov</strong><br />A
<strong>.gov</strong> website belongs to an official government
organization in the United States.
<strong>Official websites use .gov</strong>
<br>
A <strong>.gov</strong> website belongs to an official government organization in the United States.
</p>
</div>
</div>
<div class="usa-banner__guidance tablet:grid-col-6">
<img class="usa-banner__icon usa-media-block__img" src="/static/images/icon-https.svg" role="img" alt=""
aria-hidden="true" />
<img class="usa-banner__icon usa-media-block__img" src="/static/img/icon-https.svg" role="img" alt="" aria-hidden="true">
<div class="usa-media-block__body">
<p>
<strong>Secure .gov websites use HTTPS</strong><br />A
<strong>lock</strong> (
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" width="52" height="64" viewBox="0 0 52 64"
class="usa-banner__lock-image" role="img" aria-labelledby="banner-lock-description-default"
focusable="false">
<title id="banner-lock-title-default">Lock</title>
<desc id="banner-lock-description-default">Locked padlock icon</desc>
<path fill="#000000" fill-rule="evenodd"
d="M26 0c10.493 0 19 8.507 19 19v9h3a4 4 0 0 1 4 4v28a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V32a4 4 0 0 1 4-4h3v-9C7 8.507 15.507 0 26 0zm0 8c-5.979 0-10.843 4.77-10.996 10.712L15 19v9h22v-9c0-6.075-4.925-11-11-11z" />
</svg> </span>) or <strong>https://</strong> means youve safely connected to
the .gov website. Share sensitive information only on official,
secure websites.
<strong>Secure .gov websites use HTTPS</strong>
<br>
A <strong>lock</strong> ( <span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" width="52" height="64" viewBox="0 0 52 64" class="usa-banner__lock-image" role="img" aria-labelledby="banner-lock-description" focusable="false"><title id="banner-lock-title">Lock</title><desc id="banner-lock-description">Locked padlock</desc><path fill="#000000" fill-rule="evenodd" d="M26 0c10.493 0 19 8.507 19 19v9h3a4 4 0 0 1 4 4v28a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V32a4 4 0 0 1 4-4h3v-9C7 8.507 15.507 0 26 0zm0 8c-5.979 0-10.843 4.77-10.996 10.712L15 19v9h22v-9c0-6.075-4.925-11-11-11z"></path></svg></span> ) or <strong>https://</strong> means youve safely connected to the .gov website. Share sensitive information only on official, secure websites.
</p>
</div>
</div>

View File

@@ -0,0 +1,50 @@
@import "../../settings/all";
@import "../../tools/all";
@import "../../helpers/all";
@include govuk-exports("govuk/component/hint") {
.usa-hint {
@include govuk-font($size: 19);
display: block;
margin-bottom: govuk-spacing(3);
color: $govuk-secondary-text-colour;
}
// Reduces margin-bottom of hint when used after the default label (no class)
// or govuk-label--s for better vertical alignment.
// This adjustment will not work when the label is inside the <h1>, however it
// is unlikely that the default or govuk-label--s class would be used in this
// case.
// This adjustment will not work in browsers that do not support :not().
// Users with these browsers will see the default size margin (5px larger).
.govuk-label:not(.govuk-label--m):not(.govuk-label--l):not(.govuk-label--xl) + .usa-hint {
margin-bottom: govuk-spacing(2);
}
// Reduces margin-bottom of hint when used after the default legend (no class)
// or govuk-fieldset__legend--s for better vertical alignment.
// This adjustment will not work when the legend is outside the <h1>, however
// it is unlikely that the default or govuk-fieldset__legend--s class would be
// used in this case.
// This adjustment will not work in browsers that do not support :not().
// Users with these browsers will see the default size margin (5px larger).
.govuk-fieldset__legend:not(.govuk-fieldset__legend--m):not(.govuk-fieldset__legend--l):not(.govuk-fieldset__legend--xl) + .usa-hint {
margin-bottom: govuk-spacing(2);
}
// Reduces visual spacing of legend when there is a hint
.govuk-fieldset__legend + .usa-hint,
.govuk-fieldset__legend + .usa-hint {
margin-top: -(govuk-spacing(1));
}
}

View File

@@ -8,7 +8,7 @@
{% endset %}
{% if params.isPageHeading %}
<h1 class="govuk-label-wrapper">{{ labelHtml | safe | indent(2) }}</h1>
<h1 class="usa-radio__label-wrapper">{{ labelHtml | safe | indent(2) }}</h1>
{% else %}
{{ labelHtml | safe }}
{% endif %}

View File

@@ -43,19 +43,19 @@
visuallyHiddenText: params.errorMessage.visuallyHiddenText
}) | indent(2) | trim }}
{% endif %}
<div class="govuk-radios {%- if params.classes %} {{ params.classes }}{% endif %}{%- if isConditional %} govuk-radios--conditional{% endif -%}"
<div class="usa-radios {%- if params.classes %} {{ params.classes }}{% endif %}{%- if isConditional %} usa-radios--conditional{% endif -%}"
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}
{%- if isConditional %} data-module="radios"{% endif -%}>
{% for item in params.items %}
{% set id = item.id if item.id else idPrefix + "-" + loop.index %}
{% set conditionalId = "conditional-" + id %}
{%- if item.divider %}
<div class="govuk-radios__divider">{{ item.divider }}</div>
<div class="usa-radios__divider">{{ item.divider }}</div>
{%- else %}
{% set hasHint = true if item.hint.text or item.hint.html %}
{% set itemHintId = id + '-item-hint' %}
<div class="govuk-radios__item">
<input class="govuk-radios__input" id="{{ id }}" name="{{ params.name }}" type="radio" value="{{ item.value }}"
<div class="usa-radio">
<input class="usa-radio__input" id="{{ id }}" name="{{ params.name }}" type="radio" value="{{ item.value }}"
{{-" checked" if item.checked }}
{{-" disabled" if item.disabled }}
{%- if item.conditional %} data-aria-controls="{{ conditionalId }}"{% endif -%}
@@ -64,14 +64,14 @@
{{ usaLabel({
html: item.html,
text: item.text,
classes: 'govuk-radios__label' + (' ' + item.label.classes if item.label.classes),
classes: 'usa-radio__label' + (' ' + item.label.classes if item.label.classes),
attributes: item.label.attributes,
for: id
}) | indent(6) | trim }}
{%- if hasHint %}
{{ usaHint({
id: itemHintId,
classes: 'govuk-radios__hint',
classes: 'usa-checkbox__label-description',
attributes: item.hint.attributes,
html: item.hint.html,
text: item.hint.text
@@ -79,7 +79,7 @@
{%- endif %}
</div>
{% if item.conditional %}
<div class="govuk-radios__conditional{% if not item.checked %} govuk-radios__conditional--hidden{% endif %}" id="{{ conditionalId }}">
<div class="usa-radios__conditional{% if not item.checked %} usa-radios__conditional--hidden{% endif %}" id="{{ conditionalId }}">
{{ item.conditional.html | safe }}
</div>
{% endif %}

View File

@@ -36,9 +36,9 @@
{% set autocomplete = "" %}
{% endif %}
{% if entry.errors %}
{% set label_classes = "govuk-input--numbered__label govuk-input--numbered__label--error" %}
{% set label_classes = "usa-input--numbered__label usa-input--numbered__label--error" %}
{% else %}
{% set label_classes = "govuk-input--numbered__label" %}
{% set label_classes = "usa-input--numbered__label" %}
{% endif %}
{% set field_name = field.name + "-" + loop.index|string %}
{{ entry(param_extensions={
@@ -48,7 +48,7 @@
"html": '<span class="usa-sr-only">' + item_name + ' number </span>' + loop.index|string + '.',
"classes": label_classes
},
"classes": "govuk-input--numbered ",
"classes": "usa-input--numbered ",
"value": field.data[loop.index0],
"autocomplete": autocomplete
}) }}

View File

@@ -29,7 +29,7 @@
) %}
<div class="{{ wrapping_class }} {% if field.errors %} form-group-error{% endif %}">
<fieldset>
<legend class="form-label {% if bold_legend %}govuk-!-font-weight-bold{% endif %}">
<legend class="form-label {% if bold_legend %}bold{% endif %}">
{{ field.label.text }}
{% if field.errors %}
<span class="error-message" data-module="track-error" data-error-type="{{ field.errors[0] }}" data-error-label="{{ field.name }}">

View File

@@ -2,6 +2,6 @@
{% if service %}
<a class="usa-link" href="{{ url_for(endpoint, service_id=service.id) }}">{{ link_text }}</a>
{% else %}
<b class="govuk-!-font-weight-bold">{{ link_text|capitalize }}</b>
<b>{{ link_text|capitalize }}</b>
{% endif %}
{% endmacro %}