@nationalarchives/frontend 0.1.41 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.mjs +18 -0
- package/nationalarchives/analytics.js +2 -0
- package/nationalarchives/analytics.js.map +1 -0
- package/nationalarchives/analytics.mjs +281 -0
- package/nationalarchives/components/_index.scss +3 -1
- package/nationalarchives/components/breadcrumbs/analytics.js +17 -0
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +3 -1
- package/nationalarchives/components/breadcrumbs/fixtures.json +69 -6
- package/nationalarchives/components/breadcrumbs/macro-options.json +12 -6
- package/nationalarchives/components/breadcrumbs/template.njk +12 -4
- package/nationalarchives/components/button/_index.scss +1 -0
- package/nationalarchives/components/button/button-group.stories.js +122 -0
- package/nationalarchives/components/button/button.css +1 -1
- package/nationalarchives/components/button/button.css.map +1 -1
- package/nationalarchives/components/button/button.scss +5 -8
- package/nationalarchives/components/button/button.stories.js +36 -38
- package/nationalarchives/components/button/fixtures.json +5 -10
- package/nationalarchives/components/button/template.njk +11 -10
- package/nationalarchives/components/card/card.css +1 -1
- package/nationalarchives/components/card/card.css.map +1 -1
- package/nationalarchives/components/card/card.scss +6 -0
- package/nationalarchives/components/card/card.stories.js +11 -0
- package/nationalarchives/components/card/fixtures.json +17 -34
- package/nationalarchives/components/checkboxes/analytics.js +25 -0
- package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.njk +12 -0
- package/nationalarchives/components/checkboxes/checkboxes.scss +1 -0
- package/nationalarchives/components/checkboxes/fixtures.json +6 -12
- package/nationalarchives/components/checkboxes/template.njk +10 -7
- package/nationalarchives/components/compound-filters/compound-filters.css +1 -1
- package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
- package/nationalarchives/components/compound-filters/compound-filters.scss +2 -0
- package/nationalarchives/components/compound-filters/fixtures.json +1 -2
- package/nationalarchives/components/compound-filters/template.njk +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
- package/nationalarchives/components/cookie-banner/fixtures.json +10 -20
- package/nationalarchives/components/date-input/date-input.css +1 -1
- package/nationalarchives/components/date-input/date-input.css.map +1 -1
- package/nationalarchives/components/date-input/fixtures.json +5 -10
- package/nationalarchives/components/date-input/template.njk +9 -9
- package/nationalarchives/components/date-search/date-search.css +1 -1
- package/nationalarchives/components/date-search/date-search.css.map +1 -1
- package/nationalarchives/components/date-search/date-search.njk +7 -0
- package/nationalarchives/components/date-search/fixtures.json +6 -12
- package/nationalarchives/components/date-search/template.njk +6 -7
- package/nationalarchives/components/error-summary/_index.scss +1 -0
- package/nationalarchives/components/error-summary/error-summary.css +1 -0
- package/nationalarchives/components/error-summary/error-summary.css.map +1 -0
- package/nationalarchives/components/error-summary/error-summary.js +2 -0
- package/nationalarchives/components/error-summary/error-summary.js.map +1 -0
- package/nationalarchives/components/error-summary/error-summary.mjs +51 -0
- package/nationalarchives/components/error-summary/error-summary.scss +39 -0
- package/nationalarchives/components/error-summary/error-summary.stories.js +59 -0
- package/nationalarchives/components/error-summary/fixtures.json +24 -0
- package/nationalarchives/components/error-summary/macro-options.json +52 -0
- package/nationalarchives/components/error-summary/macro.njk +3 -0
- package/nationalarchives/components/error-summary/template.njk +15 -0
- package/nationalarchives/components/featured-records/featured-records.css +1 -1
- package/nationalarchives/components/featured-records/featured-records.css.map +1 -1
- package/nationalarchives/components/featured-records/featured-records.scss +1 -1
- package/nationalarchives/components/featured-records/fixtures.json +2 -4
- package/nationalarchives/components/footer/analytics.js +97 -0
- package/nationalarchives/components/footer/fixtures.json +8 -15
- package/nationalarchives/components/footer/footer.css +1 -1
- package/nationalarchives/components/footer/footer.css.map +1 -1
- package/nationalarchives/components/footer/footer.scss +4 -2
- package/nationalarchives/components/footer/footer.stories.js +5 -11
- package/nationalarchives/components/footer/template.njk +13 -10
- package/nationalarchives/components/gallery/gallery.css.map +1 -1
- package/nationalarchives/components/global-header/analytics.js +57 -0
- package/nationalarchives/components/global-header/fixtures.json +1 -2
- package/nationalarchives/components/global-header/global-header.css +1 -1
- package/nationalarchives/components/global-header/global-header.css.map +1 -1
- package/nationalarchives/components/global-header/global-header.js +1 -1
- package/nationalarchives/components/global-header/global-header.js.map +1 -1
- package/nationalarchives/components/global-header/global-header.mjs +40 -79
- package/nationalarchives/components/global-header/global-header.scss +9 -6
- package/nationalarchives/components/global-header/global-header.stories.js +32 -20
- package/nationalarchives/components/global-header/macro-options.json +12 -0
- package/nationalarchives/components/global-header/template.njk +7 -7
- package/nationalarchives/components/grid/fixtures.json +13 -26
- package/nationalarchives/components/grid/grid.css +1 -1
- package/nationalarchives/components/grid/grid.css.map +1 -1
- package/nationalarchives/components/grid/grid.scss +0 -1
- package/nationalarchives/components/header/analytics.js +18 -0
- package/nationalarchives/components/header/fixtures.json +1 -2
- package/nationalarchives/components/header/header.css +1 -1
- package/nationalarchives/components/header/header.css.map +1 -1
- package/nationalarchives/components/header/header.js +1 -1
- package/nationalarchives/components/header/header.js.map +1 -1
- package/nationalarchives/components/header/header.mjs +32 -41
- package/nationalarchives/components/header/header.scss +3 -2
- package/nationalarchives/components/header/macro-options.json +6 -0
- package/nationalarchives/components/header/template.njk +6 -6
- package/nationalarchives/components/hero/analytics.js +26 -0
- package/nationalarchives/components/hero/fixtures.json +12 -24
- package/nationalarchives/components/hero/hero.css +1 -1
- package/nationalarchives/components/hero/hero.css.map +1 -1
- package/nationalarchives/components/hero/hero.scss +1 -1
- package/nationalarchives/components/index-grid/fixtures.json +8 -16
- package/nationalarchives/components/index-grid/index-grid.css +1 -1
- package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
- package/nationalarchives/components/message/fixtures.json +1 -2
- package/nationalarchives/components/message/message.css +1 -1
- package/nationalarchives/components/message/message.css.map +1 -1
- package/nationalarchives/components/message/message.scss +2 -3
- package/nationalarchives/components/message/phase-banner.stories.js +1 -1
- package/nationalarchives/components/pagination/fixtures.json +1 -2
- package/nationalarchives/components/pagination/macro-options.json +6 -0
- package/nationalarchives/components/pagination/pagination.stories.js +44 -0
- package/nationalarchives/components/pagination/template.njk +4 -1
- package/nationalarchives/components/phase-banner/fixtures.json +4 -8
- package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
- package/nationalarchives/components/picture/analytics.js +30 -0
- package/nationalarchives/components/picture/fixtures.json +5 -10
- package/nationalarchives/components/picture/picture.css.map +1 -1
- package/nationalarchives/components/quick-filters/_index.scss +1 -0
- package/nationalarchives/components/quick-filters/fixtures.json +51 -0
- package/nationalarchives/components/{filters → quick-filters}/macro-options.json +2 -2
- package/nationalarchives/components/quick-filters/macro.njk +3 -0
- package/nationalarchives/components/quick-filters/quick-filters.css +1 -0
- package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -0
- package/nationalarchives/components/{filters/filters.scss → quick-filters/quick-filters.scss} +10 -8
- package/nationalarchives/components/{filters/filters.stories.js → quick-filters/quick-filters.stories.js} +2 -2
- package/nationalarchives/components/quick-filters/template.njk +8 -0
- package/nationalarchives/components/radios/analytics.js +25 -0
- package/nationalarchives/components/radios/fixtures.json +6 -12
- package/nationalarchives/components/radios/radios.css +1 -1
- package/nationalarchives/components/radios/radios.css.map +1 -1
- package/nationalarchives/components/radios/radios.njk +12 -0
- package/nationalarchives/components/radios/template.njk +6 -13
- package/nationalarchives/components/search-field/analytics.js +22 -0
- package/nationalarchives/components/search-field/fixtures.json +3 -6
- package/nationalarchives/components/search-field/search-field.css +1 -1
- package/nationalarchives/components/search-field/search-field.css.map +1 -1
- package/nationalarchives/components/search-field/search-field.scss +7 -2
- package/nationalarchives/components/search-field/template.njk +4 -4
- package/nationalarchives/components/search-filters/_index.scss +1 -0
- package/nationalarchives/components/search-filters/fixtures.json +16 -0
- package/nationalarchives/components/search-filters/macro-options.json +39 -0
- package/nationalarchives/components/search-filters/macro.njk +3 -0
- package/nationalarchives/components/search-filters/search-filters.css +1 -0
- package/nationalarchives/components/search-filters/search-filters.css.map +1 -0
- package/nationalarchives/components/search-filters/search-filters.js +2 -0
- package/nationalarchives/components/search-filters/search-filters.js.map +1 -0
- package/nationalarchives/components/search-filters/search-filters.mjs +67 -0
- package/nationalarchives/components/search-filters/search-filters.scss +163 -0
- package/nationalarchives/components/search-filters/search-filters.stories.js +207 -0
- package/nationalarchives/components/search-filters/template.njk +107 -0
- package/nationalarchives/components/select/fixtures.json +6 -12
- package/nationalarchives/components/select/select.css +1 -1
- package/nationalarchives/components/select/select.css.map +1 -1
- package/nationalarchives/components/select/select.scss +1 -1
- package/nationalarchives/components/select/template.njk +4 -4
- package/nationalarchives/components/sensitive-image/fixtures.json +3 -6
- package/nationalarchives/components/skip-link/fixtures.json +1 -2
- package/nationalarchives/components/skip-link/skip-link.css +1 -1
- package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
- package/nationalarchives/components/skip-link/skip-link.scss +1 -1
- package/nationalarchives/components/tabs/fixtures.json +1 -2
- package/nationalarchives/components/tabs/tabs.css.map +1 -1
- package/nationalarchives/components/text-input/analytics.js +23 -0
- package/nationalarchives/components/text-input/fixtures.json +6 -12
- package/nationalarchives/components/text-input/template.njk +6 -10
- package/nationalarchives/components/text-input/text-input.css +1 -1
- package/nationalarchives/components/text-input/text-input.css.map +1 -1
- package/nationalarchives/components/text-input/text-input.njk +10 -0
- package/nationalarchives/components/text-input/text-input.scss +1 -1
- package/nationalarchives/components/textarea/analytics.js +23 -0
- package/nationalarchives/components/textarea/fixtures.json +6 -12
- package/nationalarchives/components/textarea/template.njk +5 -5
- package/nationalarchives/components/textarea/textarea.css +1 -1
- package/nationalarchives/components/textarea/textarea.css.map +1 -1
- package/nationalarchives/components/textarea/textarea.scss +1 -1
- package/nationalarchives/global-header-package.css +1 -1
- package/nationalarchives/global-header-package.css.map +1 -1
- package/nationalarchives/global-header-package.scss +4 -6
- package/nationalarchives/lib/analytics-helpers.mjs +68 -0
- package/nationalarchives/lib/cookies.mjs +59 -35
- package/nationalarchives/prototype-kit.css +1 -1
- package/nationalarchives/prototype-kit.css.map +1 -1
- package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +49 -22
- package/nationalarchives/stories/utilities/forms/forms.mdx +6 -6
- package/nationalarchives/stories/utilities/tables/tables.stories.js +30 -28
- package/nationalarchives/tests/analytics.test.js +11 -0
- package/nationalarchives/tests/cookies.test.js +21 -0
- package/nationalarchives/tests/uuid.test.js +0 -6
- package/nationalarchives/tools/_a11y.scss +11 -2
- package/nationalarchives/tools/_colour.scss +47 -14
- package/nationalarchives/utilities/_a11y.scss +4 -0
- package/nationalarchives/utilities/_forms.scss +7 -1
- package/nationalarchives/utilities/_global.scss +3 -1
- package/nationalarchives/utilities/_reset.scss +5 -2
- package/nationalarchives/utilities/_tables.scss +23 -6
- package/nationalarchives/utilities/_typography.scss +5 -21
- package/nationalarchives/variables/_a11y.scss +2 -0
- package/nationalarchives/variables/_colour.scss +2 -0
- package/nationalarchives/variables/_forms.scss +1 -1
- package/nationalarchives/variables/_index.scss +1 -0
- package/package.json +2 -2
- package/nationalarchives/components/filters/_index.scss +0 -1
- package/nationalarchives/components/filters/filters.css +0 -1
- package/nationalarchives/components/filters/filters.css.map +0 -1
- package/nationalarchives/components/filters/fixtures.json +0 -51
- package/nationalarchives/components/filters/macro.njk +0 -3
- package/nationalarchives/components/filters/template.njk +0 -8
@@ -3,6 +3,7 @@ import Breadcrumbs from "../../../components/breadcrumbs/template.njk";
|
|
3
3
|
import Button from "../../../components/button/template.njk";
|
4
4
|
import Card from "../../../components/card/template.njk";
|
5
5
|
import Checkboxes from "../../../components/checkboxes/template.njk";
|
6
|
+
import ErrorSummary from "../../../components/error-summary/template.njk";
|
6
7
|
import FeaturedRecords from "../../../components/featured-records/template.njk";
|
7
8
|
import Footer from "../../../components/footer/template.njk";
|
8
9
|
import Gallery from "../../../components/gallery/template.njk";
|
@@ -651,7 +652,7 @@ const Template = ({ theme, accent }) => {
|
|
651
652
|
title: "My dogs 1",
|
652
653
|
headingLevel: 3,
|
653
654
|
headingHref: "#",
|
654
|
-
items: Array(
|
655
|
+
items: Array(4)
|
655
656
|
.fill({
|
656
657
|
...{
|
657
658
|
href: "#",
|
@@ -735,7 +736,7 @@ const Template = ({ theme, accent }) => {
|
|
735
736
|
title: "My dogs 2",
|
736
737
|
headingLevel: 3,
|
737
738
|
headingHref: "#",
|
738
|
-
items: Array(
|
739
|
+
items: Array(4)
|
739
740
|
.fill({
|
740
741
|
...{
|
741
742
|
href: "#",
|
@@ -819,7 +820,7 @@ const Template = ({ theme, accent }) => {
|
|
819
820
|
title: "My dogs 3",
|
820
821
|
headingLevel: 3,
|
821
822
|
headingHref: "#",
|
822
|
-
items: Array(
|
823
|
+
items: Array(4)
|
823
824
|
.fill({
|
824
825
|
...{
|
825
826
|
href: "#",
|
@@ -903,7 +904,7 @@ const Template = ({ theme, accent }) => {
|
|
903
904
|
title: "My dogs 4",
|
904
905
|
headingLevel: 3,
|
905
906
|
headingHref: "#",
|
906
|
-
items: Array(
|
907
|
+
items: Array(4)
|
907
908
|
.fill({
|
908
909
|
...{
|
909
910
|
href: "#",
|
@@ -987,7 +988,7 @@ const Template = ({ theme, accent }) => {
|
|
987
988
|
title: "My dogs 5",
|
988
989
|
headingLevel: 3,
|
989
990
|
headingHref: "#",
|
990
|
-
items: Array(
|
991
|
+
items: Array(4)
|
991
992
|
.fill({
|
992
993
|
...{
|
993
994
|
href: "#",
|
@@ -1065,6 +1066,21 @@ const Template = ({ theme, accent }) => {
|
|
1065
1066
|
</div>
|
1066
1067
|
</div>
|
1067
1068
|
</div>
|
1069
|
+
<div class="tna-section tna-background-contrast">
|
1070
|
+
<div class="tna-container">
|
1071
|
+
<div class="tna-column tna-column--width-2-3 tna-column--full-small tna-column--full-tiny">
|
1072
|
+
${SearchField({
|
1073
|
+
params: {
|
1074
|
+
label: "Catalogue search results",
|
1075
|
+
headingLevel: 3,
|
1076
|
+
headingSize: "l",
|
1077
|
+
id: "search1",
|
1078
|
+
name: "q",
|
1079
|
+
},
|
1080
|
+
})}
|
1081
|
+
</div>
|
1082
|
+
</div>
|
1083
|
+
</div>
|
1068
1084
|
<div class="tna-section">
|
1069
1085
|
<div class="tna-container">
|
1070
1086
|
<div class="tna-column tna-column--width-2-3 tna-column--full-small tna-column--full-tiny">
|
@@ -1072,13 +1088,17 @@ const Template = ({ theme, accent }) => {
|
|
1072
1088
|
<h2 class="tna-heading tna-heading--l">
|
1073
1089
|
Forms
|
1074
1090
|
</h2>
|
1075
|
-
${
|
1091
|
+
${ErrorSummary({
|
1076
1092
|
params: {
|
1077
|
-
|
1078
|
-
headingLevel:
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1093
|
+
title: "There is a problem",
|
1094
|
+
headingLevel: 2,
|
1095
|
+
items: [
|
1096
|
+
{
|
1097
|
+
text: "Enter a valid email address",
|
1098
|
+
href: "#email",
|
1099
|
+
},
|
1100
|
+
],
|
1101
|
+
disableAutoFocus: true,
|
1082
1102
|
},
|
1083
1103
|
})}
|
1084
1104
|
${TextInput({
|
@@ -1099,6 +1119,9 @@ const Template = ({ theme, accent }) => {
|
|
1099
1119
|
id: "email",
|
1100
1120
|
name: "email",
|
1101
1121
|
autofill: "email",
|
1122
|
+
error: {
|
1123
|
+
text: "Enter a valid email address",
|
1124
|
+
},
|
1102
1125
|
},
|
1103
1126
|
})}
|
1104
1127
|
${Select({
|
@@ -1194,37 +1217,32 @@ const Template = ({ theme, accent }) => {
|
|
1194
1217
|
</main>
|
1195
1218
|
${Footer({
|
1196
1219
|
params: {
|
1197
|
-
meta: "<p>Open today<br>09:00&
|
1220
|
+
meta: "<p>Open today<br>09:00–19:00</p>",
|
1198
1221
|
social: [
|
1199
1222
|
{
|
1200
1223
|
href: "https://twitter.com/UKNatArchives",
|
1201
1224
|
icon: "twitter",
|
1202
|
-
title: "
|
1225
|
+
title: "The National Archives X feed (formally known as Twitter)",
|
1203
1226
|
},
|
1204
1227
|
{
|
1205
1228
|
href: "https://www.youtube.com/c/TheNationalArchivesUK",
|
1206
1229
|
icon: "youtube",
|
1207
|
-
title: "
|
1230
|
+
title: "The National Archives YouTube channel",
|
1208
1231
|
},
|
1209
1232
|
{
|
1210
1233
|
href: "https://www.facebook.com/TheNationalArchives",
|
1211
1234
|
icon: "facebook",
|
1212
|
-
title: "
|
1235
|
+
title: "The National Archives Facebook page",
|
1213
1236
|
},
|
1214
1237
|
{
|
1215
1238
|
href: "https://www.flickr.com/photos/nationalarchives",
|
1216
1239
|
icon: "flickr",
|
1217
|
-
title: "
|
1240
|
+
title: "The National Archives Flickr feed",
|
1218
1241
|
},
|
1219
1242
|
{
|
1220
1243
|
href: "https://www.instagram.com/nationalarchivesuk/",
|
1221
1244
|
icon: "instagram",
|
1222
|
-
title: "
|
1223
|
-
},
|
1224
|
-
{
|
1225
|
-
href: "https://www.nationalarchives.gov.uk/rss/",
|
1226
|
-
icon: "rss",
|
1227
|
-
title: "Read our RSS feed",
|
1245
|
+
title: "The National Archives Instagram feed",
|
1228
1246
|
},
|
1229
1247
|
],
|
1230
1248
|
navigation: [
|
@@ -1345,18 +1363,27 @@ Light.args = {
|
|
1345
1363
|
};
|
1346
1364
|
|
1347
1365
|
export const Dark = Template.bind({});
|
1366
|
+
Dark.parameters = {
|
1367
|
+
chromatic: { disableSnapshot: true },
|
1368
|
+
};
|
1348
1369
|
Dark.args = {
|
1349
1370
|
theme: "dark",
|
1350
1371
|
accent: "pink",
|
1351
1372
|
};
|
1352
1373
|
|
1353
1374
|
export const LightHighContrast = Template.bind({});
|
1375
|
+
LightHighContrast.parameters = {
|
1376
|
+
chromatic: { disableSnapshot: true },
|
1377
|
+
};
|
1354
1378
|
LightHighContrast.args = {
|
1355
1379
|
theme: "light high-contrast",
|
1356
1380
|
accent: "pink",
|
1357
1381
|
};
|
1358
1382
|
|
1359
1383
|
export const DarkHighContrast = Template.bind({});
|
1384
|
+
DarkHighContrast.parameters = {
|
1385
|
+
chromatic: { disableSnapshot: true },
|
1386
|
+
};
|
1360
1387
|
DarkHighContrast.args = {
|
1361
1388
|
theme: "dark high-contrast",
|
1362
1389
|
accent: "pink",
|
@@ -43,26 +43,26 @@ import * as SearchFieldStories from "../../../components/search-field/search-fie
|
|
43
43
|
<div class="tna-form__group-contents">
|
44
44
|
|
45
45
|
<h4 class="tna-form__heading tna-form__heading--m">
|
46
|
-
<label class="tna-form__label" for="
|
46
|
+
<label class="tna-form__label" for="ELEMENT-ID">
|
47
47
|
<!-- Field title -->
|
48
48
|
</label>
|
49
49
|
</h4>
|
50
50
|
|
51
51
|
<!-- Optional hint
|
52
|
-
<p id="
|
52
|
+
<p id="ELEMENT-ID-hint" class="tna-form__hint">
|
53
53
|
[Hint text]
|
54
54
|
</p>
|
55
55
|
-->
|
56
56
|
|
57
57
|
<!-- Optional error
|
58
|
-
<p id="
|
58
|
+
<p id="ELEMENT-ID-error" class="tna-form__error-message">
|
59
59
|
<span class="tna-!--visually-hidden">Error:</span> [Error text]
|
60
60
|
</p>
|
61
61
|
-->
|
62
62
|
|
63
63
|
</div>
|
64
64
|
|
65
|
-
<!-- Field id="
|
65
|
+
<!-- Field id="ELEMENT-ID"
|
66
66
|
If hint:
|
67
67
|
aria-describedby="tna-form__ELEMENT-ID-hint"
|
68
68
|
If error:
|
@@ -97,13 +97,13 @@ import * as SearchFieldStories from "../../../components/search-field/search-fie
|
|
97
97
|
</legend>
|
98
98
|
|
99
99
|
<!-- Optional hint
|
100
|
-
<p id="
|
100
|
+
<p id="ELEMENT-ID-hint" class="tna-form__hint">
|
101
101
|
[Hint text]
|
102
102
|
</p>
|
103
103
|
-->
|
104
104
|
|
105
105
|
<!-- Optional error
|
106
|
-
<p id="
|
106
|
+
<p id="ELEMENT-ID-error" class="tna-form__error-message">
|
107
107
|
<span class="tna-!--visually-hidden">Error:</span> [Error text]
|
108
108
|
</p>
|
109
109
|
-->
|
@@ -4,42 +4,44 @@ export default {
|
|
4
4
|
|
5
5
|
const TableTemplate = () =>
|
6
6
|
`<table class="tna-table">
|
7
|
-
<caption class="tna-table__caption
|
7
|
+
<caption class="tna-table__caption">
|
8
|
+
Records added and removed between 2020 and 2022
|
9
|
+
</caption>
|
8
10
|
<thead class="tna-table__head">
|
9
11
|
<tr class="tna-table__row">
|
10
|
-
<th class="tna-table__header" scope="col">
|
11
|
-
<th class="tna-table__header" scope="col">
|
12
|
-
<th class="tna-table__header" scope="col">
|
12
|
+
<th class="tna-table__header" scope="col">Year</th>
|
13
|
+
<th class="tna-table__header" scope="col">Chinese zodiac sign</th>
|
14
|
+
<th class="tna-table__header tna-table__header--numeric" scope="col">Records added</th>
|
15
|
+
<th class="tna-table__header tna-table__header--numeric" scope="col">Size (megabytes)</th>
|
13
16
|
</tr>
|
14
17
|
</thead>
|
15
18
|
<tbody class="tna-table__body">
|
16
|
-
<tr
|
17
|
-
<th class="tna-table__header" scope="row">
|
18
|
-
<td class="tna-table__cell">
|
19
|
-
<td class="tna-table__cell">
|
20
|
-
|
21
|
-
<p>See items.</p>
|
22
|
-
</td>
|
23
|
-
</tr>
|
24
|
-
<tr class="tna-table__row">
|
25
|
-
<th class="tna-table__header" scope="row">noCollapse</th>
|
26
|
-
<td class="tna-table__cell">string</td>
|
27
|
-
<td class="tna-table__cell"></td>
|
19
|
+
<tr>
|
20
|
+
<th class="tna-table__header" scope="row">2020</th>
|
21
|
+
<td class="tna-table__cell">Rat</td>
|
22
|
+
<td class="tna-table__cell tna-table__cell--numeric">123,456</td>
|
23
|
+
<td class="tna-table__cell tna-table__cell--numeric">789</td>
|
28
24
|
</tr>
|
29
|
-
<tr
|
30
|
-
<th class="tna-table__header" scope="row">
|
31
|
-
<td class="tna-table__cell">
|
32
|
-
<td class="tna-table__cell">
|
33
|
-
|
34
|
-
</td>
|
25
|
+
<tr>
|
26
|
+
<th class="tna-table__header" scope="row">2021</th>
|
27
|
+
<td class="tna-table__cell">Ox</td>
|
28
|
+
<td class="tna-table__cell tna-table__cell--numeric">456,789</td>
|
29
|
+
<td class="tna-table__cell tna-table__cell--numeric">123</td>
|
35
30
|
</tr>
|
36
|
-
<tr
|
37
|
-
<th class="tna-table__header" scope="row">
|
38
|
-
<td class="tna-table__cell">
|
39
|
-
<td class="tna-table__cell">
|
40
|
-
|
41
|
-
</td>
|
31
|
+
<tr>
|
32
|
+
<th class="tna-table__header" scope="row">2022</th>
|
33
|
+
<td class="tna-table__cell">Tiger</td>
|
34
|
+
<td class="tna-table__cell tna-table__cell--numeric">42,424</td>
|
35
|
+
<td class="tna-table__cell tna-table__cell--numeric">1,337</td>
|
42
36
|
</tr>
|
43
37
|
</tbody>
|
38
|
+
<tfoot class="tna-table__foot">
|
39
|
+
<tr>
|
40
|
+
<th class="tna-table__header" scope="row">Totals</th>
|
41
|
+
<td class="tna-table__cell"></td>
|
42
|
+
<td class="tna-table__cell tna-table__cell--numeric">622,669</td>
|
43
|
+
<td class="tna-table__cell tna-table__cell--numeric">2,249</td>
|
44
|
+
</tr>
|
45
|
+
</tfoot>
|
44
46
|
</table>`;
|
45
47
|
export const Table = TableTemplate.bind({});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { describe, expect, test } from "@jest/globals";
|
2
|
+
import { GA4 } from "../analytics.mjs";
|
3
|
+
|
4
|
+
describe("Analytics", () => {
|
5
|
+
test("Initialisation", async () => {
|
6
|
+
const id = "example-id";
|
7
|
+
const ga4 = new GA4(id);
|
8
|
+
|
9
|
+
expect(ga4.gTagId).toEqual(id);
|
10
|
+
});
|
11
|
+
});
|
@@ -347,6 +347,8 @@ describe("No existing cookies", () => {
|
|
347
347
|
const testKey = "foo";
|
348
348
|
const testValue = "bar";
|
349
349
|
|
350
|
+
expect(mockCallback.mock.calls).toHaveLength(0);
|
351
|
+
|
350
352
|
cookies1.set(testKey, testValue);
|
351
353
|
expect(mockCallback.mock.calls).toHaveLength(1);
|
352
354
|
|
@@ -357,6 +359,25 @@ describe("No existing cookies", () => {
|
|
357
359
|
expect(mockCallback.mock.calls).toHaveLength(3);
|
358
360
|
});
|
359
361
|
|
362
|
+
test("One-time events", async () => {
|
363
|
+
const mockCallback = jest.fn();
|
364
|
+
|
365
|
+
const cookies = new Cookies();
|
366
|
+
|
367
|
+
cookies.once("setCookie", mockCallback);
|
368
|
+
|
369
|
+
const testKey = "foo";
|
370
|
+
const testValue = "bar";
|
371
|
+
|
372
|
+
expect(mockCallback.mock.calls).toHaveLength(0);
|
373
|
+
|
374
|
+
cookies.set(testKey, testValue);
|
375
|
+
expect(mockCallback.mock.calls).toHaveLength(1);
|
376
|
+
|
377
|
+
cookies.set(testKey, testValue);
|
378
|
+
expect(mockCallback.mock.calls).toHaveLength(1);
|
379
|
+
});
|
380
|
+
|
360
381
|
test("Custom policies", async () => {
|
361
382
|
const cookies = new Cookies({ extraPolicies: ["custom"] });
|
362
383
|
|
@@ -1,12 +1,6 @@
|
|
1
1
|
import { describe, expect, test } from "@jest/globals";
|
2
|
-
import { TextEncoder, TextDecoder, store, options } from "util";
|
3
2
|
import uuidv4 from "../lib/uuid.mjs";
|
4
3
|
|
5
|
-
global.TextEncoder = TextEncoder;
|
6
|
-
global.TextDecoder = TextDecoder;
|
7
|
-
global.store = store;
|
8
|
-
global.options = options;
|
9
|
-
|
10
4
|
describe("UUID", () => {
|
11
5
|
test("Initialisation", async () => {
|
12
6
|
const uuid1 = uuidv4();
|
@@ -1,6 +1,15 @@
|
|
1
|
+
@use "../variables/a11y";
|
1
2
|
@use "colour";
|
2
3
|
|
3
4
|
@mixin focus-outline {
|
4
|
-
@include colour.colour-outline(
|
5
|
-
|
5
|
+
@include colour.colour-outline(
|
6
|
+
"focus-outline",
|
7
|
+
a11y.$focus-outline-width,
|
8
|
+
solid
|
9
|
+
);
|
10
|
+
outline-offset: a11y.$focus-outline-offset;
|
11
|
+
}
|
12
|
+
|
13
|
+
@mixin active-outline {
|
14
|
+
outline-offset: a11y.$focus-outline-offset * 2;
|
6
15
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
@use "sass:map";
|
2
|
+
@use "sass:list";
|
2
3
|
@use "../variables/colour";
|
3
4
|
@use "../tools/media";
|
4
5
|
|
@@ -6,27 +7,35 @@
|
|
6
7
|
@return colour.brand-colour($colour, $opacity);
|
7
8
|
}
|
8
9
|
|
9
|
-
@mixin colour-css-vars() {
|
10
|
+
@mixin colour-css-vars($excludes...) {
|
10
11
|
@each $name, $value in colour.$colour-palette-default {
|
11
|
-
|
12
|
+
@if not list.index($excludes, $name) {
|
13
|
+
--#{$name}: #{$value};
|
14
|
+
}
|
12
15
|
}
|
13
16
|
}
|
14
17
|
|
15
|
-
@mixin colour-css-vars-dark() {
|
18
|
+
@mixin colour-css-vars-dark($excludes...) {
|
16
19
|
@each $name, $value in colour.$colour-palette-dark {
|
17
|
-
|
20
|
+
@if not list.index($excludes, $name) {
|
21
|
+
--#{$name}: #{$value};
|
22
|
+
}
|
18
23
|
}
|
19
24
|
}
|
20
25
|
|
21
|
-
@mixin colour-css-vars-high-contrast() {
|
26
|
+
@mixin colour-css-vars-high-contrast($excludes...) {
|
22
27
|
@each $name, $value in colour.$colour-palette-high-contrast {
|
23
|
-
|
28
|
+
@if not list.index($excludes, $name) {
|
29
|
+
--#{$name}: #{$value};
|
30
|
+
}
|
24
31
|
}
|
25
32
|
}
|
26
33
|
|
27
|
-
@mixin colour-css-vars-high-contrast-dark() {
|
34
|
+
@mixin colour-css-vars-high-contrast-dark($excludes...) {
|
28
35
|
@each $name, $value in colour.$colour-palette-high-contrast-dark {
|
29
|
-
|
36
|
+
@if not list.index($excludes, $name) {
|
37
|
+
--#{$name}: #{$value};
|
38
|
+
}
|
30
39
|
}
|
31
40
|
}
|
32
41
|
|
@@ -88,6 +97,10 @@
|
|
88
97
|
background-color: var(--#{$colour}) if($important, !important, null);
|
89
98
|
}
|
90
99
|
|
100
|
+
@mixin colour-background-brand($brandColour, $important: false) {
|
101
|
+
background-color: #{brand-colour($brandColour)} if($important, !important, null);
|
102
|
+
}
|
103
|
+
|
91
104
|
@mixin colour-border(
|
92
105
|
$colour,
|
93
106
|
$width: "",
|
@@ -150,15 +163,35 @@
|
|
150
163
|
fill: var(--#{$colour}) if($important, !important, null);
|
151
164
|
}
|
152
165
|
|
166
|
+
@mixin thick-keyline($direction) {
|
167
|
+
@include colour-border("keyline", 5px, solid, $direction);
|
168
|
+
}
|
169
|
+
|
170
|
+
@mixin thick-keyline-dark($direction) {
|
171
|
+
@include colour-border("keyline-dark", 5px, solid, $direction);
|
172
|
+
}
|
173
|
+
|
174
|
+
@mixin thick-keyline-accent($direction) {
|
175
|
+
@include colour-border("accent-background", 5px, solid, $direction);
|
176
|
+
}
|
177
|
+
|
178
|
+
@mixin thick-keyline-error($direction) {
|
179
|
+
@include colour-border("form-error", 5px, solid, $direction);
|
180
|
+
}
|
181
|
+
|
182
|
+
@mixin thick-keyline-brand($direction, $brandColour) {
|
183
|
+
border-#{$direction}: 5px #{brand-colour($brandColour)} solid;
|
184
|
+
}
|
185
|
+
|
153
186
|
%light {
|
154
|
-
@include colour-css-vars;
|
187
|
+
@include colour-css-vars("form-error");
|
155
188
|
|
156
189
|
@media (prefers-contrast: more) {
|
157
|
-
@include colour-css-vars-high-contrast;
|
190
|
+
@include colour-css-vars-high-contrast("form-error");
|
158
191
|
}
|
159
192
|
|
160
193
|
.tna-template--high-contrast-theme & {
|
161
|
-
@include colour-css-vars-high-contrast;
|
194
|
+
@include colour-css-vars-high-contrast("form-error");
|
162
195
|
}
|
163
196
|
}
|
164
197
|
|
@@ -167,14 +200,14 @@
|
|
167
200
|
}
|
168
201
|
|
169
202
|
%dark {
|
170
|
-
@include colour-css-vars-dark;
|
203
|
+
@include colour-css-vars-dark("form-error");
|
171
204
|
|
172
205
|
@media (prefers-contrast: more) {
|
173
|
-
@include colour-css-vars-high-contrast-dark;
|
206
|
+
@include colour-css-vars-high-contrast-dark("form-error");
|
174
207
|
}
|
175
208
|
|
176
209
|
.tna-template--high-contrast-theme & {
|
177
|
-
@include colour-css-vars-high-contrast-dark;
|
210
|
+
@include colour-css-vars-high-contrast-dark("form-error");
|
178
211
|
}
|
179
212
|
}
|
180
213
|
|
@@ -4,6 +4,12 @@
|
|
4
4
|
@use "../tools/spacing";
|
5
5
|
@use "../tools/typography";
|
6
6
|
|
7
|
+
button,
|
8
|
+
input,
|
9
|
+
select {
|
10
|
+
border-radius: 0.1px;
|
11
|
+
}
|
12
|
+
|
7
13
|
.tna-form {
|
8
14
|
&__group {
|
9
15
|
@include spacing.space-above;
|
@@ -11,7 +17,7 @@
|
|
11
17
|
&--error {
|
12
18
|
padding-left: 1rem;
|
13
19
|
|
14
|
-
@include colour.
|
20
|
+
@include colour.thick-keyline-error(left);
|
15
21
|
}
|
16
22
|
}
|
17
23
|
|
@@ -19,7 +19,9 @@
|
|
19
19
|
margin: 0;
|
20
20
|
padding: 0;
|
21
21
|
|
22
|
-
&:has(.tna-header
|
22
|
+
&:has(:is(.tna-global-header, .tna-header)):has(
|
23
|
+
#main-content[role="main"]
|
24
|
+
):has(.tna-footer) {
|
23
25
|
display: flex;
|
24
26
|
flex-direction: column;
|
25
27
|
|
@@ -1,5 +1,10 @@
|
|
1
1
|
@use "../tools/colour";
|
2
2
|
|
3
|
+
* {
|
4
|
+
margin: 0;
|
5
|
+
padding: 0;
|
6
|
+
}
|
7
|
+
|
3
8
|
img,
|
4
9
|
svg,
|
5
10
|
picture,
|
@@ -21,8 +26,6 @@ canvas {
|
|
21
26
|
}
|
22
27
|
|
23
28
|
hr {
|
24
|
-
margin: 0;
|
25
|
-
|
26
29
|
border-width: 1px 0 0;
|
27
30
|
@include colour.colour-border("keyline");
|
28
31
|
border-style: solid;
|
@@ -4,7 +4,6 @@
|
|
4
4
|
@use "../tools/media";
|
5
5
|
@use "../tools/spacing";
|
6
6
|
@use "../tools/typography";
|
7
|
-
@use "../variables/assets";
|
8
7
|
@use "../variables/grid";
|
9
8
|
|
10
9
|
.tna-table {
|
@@ -20,23 +19,32 @@
|
|
20
19
|
}
|
21
20
|
|
22
21
|
&__caption {
|
23
|
-
|
22
|
+
padding: 1rem 0;
|
24
23
|
|
25
|
-
|
24
|
+
caption-side: bottom;
|
25
|
+
|
26
|
+
@include typography.relative-font-size(16);
|
26
27
|
}
|
27
28
|
|
28
29
|
&__head {
|
30
|
+
vertical-align: bottom;
|
29
31
|
}
|
30
32
|
|
31
|
-
&
|
33
|
+
&__body {
|
34
|
+
vertical-align: top;
|
32
35
|
}
|
33
36
|
|
34
|
-
&
|
37
|
+
&__foot {
|
38
|
+
@include typography.main-font-weight-bold;
|
39
|
+
vertical-align: top;
|
35
40
|
}
|
36
41
|
|
37
42
|
&__row {
|
38
43
|
}
|
39
44
|
|
45
|
+
&__header {
|
46
|
+
}
|
47
|
+
|
40
48
|
&__cell {
|
41
49
|
}
|
42
50
|
|
@@ -53,10 +61,19 @@
|
|
53
61
|
&:last-child {
|
54
62
|
padding-right: 0;
|
55
63
|
}
|
64
|
+
|
65
|
+
&--numeric {
|
66
|
+
text-align: right;
|
67
|
+
}
|
56
68
|
}
|
57
69
|
|
58
70
|
&__head &__header {
|
59
|
-
@include colour.colour-border("keyline-dark",
|
71
|
+
@include colour.colour-border("keyline-dark", 4px, solid, bottom);
|
72
|
+
}
|
73
|
+
|
74
|
+
&__foot &__header,
|
75
|
+
&__foot &__cell {
|
76
|
+
@include colour.colour-border("keyline-dark", 4px, solid, top);
|
60
77
|
}
|
61
78
|
|
62
79
|
p {
|