@nationalarchives/frontend 0.1.24-prerelease → 0.1.25-prerelease
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/README.md +22 -0
- package/govuk-prototype-kit.config.json +4 -12
- package/nationalarchives/all.css +2 -2
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +1 -1
- package/nationalarchives/components/button/button.css +1 -1
- package/nationalarchives/components/button/button.css.map +1 -1
- package/nationalarchives/components/button/button.scss +8 -8
- package/nationalarchives/components/button/template.njk +2 -2
- package/nationalarchives/components/card/card.css +1 -1
- package/nationalarchives/components/card/card.css.map +1 -1
- package/nationalarchives/components/card/card.scss +6 -2
- package/nationalarchives/components/card/card.stories.js +6 -78
- package/nationalarchives/components/card/fixtures.json +17 -17
- package/nationalarchives/components/card/macro-options.json +41 -17
- package/nationalarchives/components/card/template.njk +46 -45
- package/nationalarchives/components/cookie-banner/cookie-banner.css +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/cookie-banner.mjs +17 -16
- package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +92 -42
- package/nationalarchives/components/cookie-banner/fixtures.json +35 -8
- package/nationalarchives/components/cookie-banner/macro-options.json +7 -1
- package/nationalarchives/components/cookie-banner/template.njk +1 -1
- package/nationalarchives/components/featured-records/featured-records.css +1 -1
- package/nationalarchives/components/featured-records/featured-records.css.map +1 -1
- package/nationalarchives/components/filters/filters.css +1 -1
- package/nationalarchives/components/filters/filters.css.map +1 -1
- package/nationalarchives/components/filters/filters.scss +6 -6
- package/nationalarchives/components/filters/template.njk +1 -1
- package/nationalarchives/components/footer/footer.css +1 -1
- package/nationalarchives/components/footer/footer.css.map +1 -1
- package/nationalarchives/components/footer/footer.stories.js +1 -1
- package/nationalarchives/components/footer/template.njk +3 -3
- package/nationalarchives/components/gallery/gallery.css +1 -1
- package/nationalarchives/components/gallery/gallery.css.map +1 -1
- package/nationalarchives/components/gallery/gallery.stories.js +2 -2
- package/nationalarchives/components/grid/grid.css +1 -1
- package/nationalarchives/components/grid/grid.css.map +1 -1
- package/nationalarchives/components/grid/grid.scss +12 -0
- package/nationalarchives/components/grid/grid.stories.js +12 -0
- package/nationalarchives/components/header/header.css +1 -1
- package/nationalarchives/components/header/header.css.map +1 -1
- package/nationalarchives/components/header/header.scss +13 -19
- package/nationalarchives/components/header/template.njk +2 -2
- package/nationalarchives/components/hero/hero.css +1 -1
- package/nationalarchives/components/hero/hero.css.map +1 -1
- package/nationalarchives/components/hero/hero.scss +2 -2
- package/nationalarchives/components/hero/hero.stories.js +6 -0
- package/nationalarchives/components/index-grid/index-grid.css +1 -1
- package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
- package/nationalarchives/components/index-grid/index-grid.stories.js +3 -1
- package/nationalarchives/components/message/message.css +1 -1
- package/nationalarchives/components/message/message.css.map +1 -1
- package/nationalarchives/components/pagination/macro-options.json +6 -0
- package/nationalarchives/components/pagination/pagination.css +1 -1
- package/nationalarchives/components/pagination/pagination.css.map +1 -1
- package/nationalarchives/components/pagination/pagination.scss +4 -0
- package/nationalarchives/components/pagination/pagination.stories.js +63 -2
- package/nationalarchives/components/pagination/template.njk +9 -2
- package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
- package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
- package/nationalarchives/components/picture/picture.css +1 -1
- package/nationalarchives/components/picture/picture.css.map +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +3 -0
- 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.stories.js +4 -1
- package/nationalarchives/components/tabs/tabs.css +1 -1
- package/nationalarchives/components/tabs/tabs.css.map +1 -1
- package/nationalarchives/components/tabs/tabs.stories.js +6 -3
- package/nationalarchives/lib/cookies.mjs +165 -62
- package/nationalarchives/prototype-kit.css +2 -2
- package/nationalarchives/prototype-kit.css.map +1 -1
- package/nationalarchives/prototype-kit.scss +3 -3
- package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +153 -65
- package/nationalarchives/stories/utilities/overrides/overrides.stories.js +1 -0
- package/nationalarchives/stories/utilities/tables/tables.mdx +8 -0
- package/nationalarchives/stories/utilities/tables/tables.stories.js +45 -0
- package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +59 -19
- package/nationalarchives/templates/layouts/_prototype-kit.njk +2 -0
- package/nationalarchives/tests/cookies.test.js +427 -0
- package/nationalarchives/tests/uuid.test.js +17 -0
- package/nationalarchives/tools/_colour.scss +2 -0
- package/nationalarchives/utilities/_index.scss +1 -0
- package/nationalarchives/utilities/_lists.scss +5 -0
- package/nationalarchives/utilities/_tables.scss +86 -0
- package/nationalarchives/utilities/_typography.scss +5 -20
- package/nationalarchives/variables/_colour.scss +1 -0
- package/package.json +6 -6
@@ -446,64 +446,68 @@ const Template = ({ theme, accent }) => {
|
|
446
446
|
classes: "tna-hero--demo",
|
447
447
|
},
|
448
448
|
})}
|
449
|
-
<div class="tna-
|
450
|
-
<
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
449
|
+
<div class="tna-section tna-!--padding-bottom-s">
|
450
|
+
<ul class="tna-ul tna-ul--plain tna-container">
|
451
|
+
<li class="tna-column tna-column--width-1-3 tna-column--width-1-2-small tna-column--full-tiny">
|
452
|
+
${Card({
|
453
|
+
params: {
|
454
|
+
...cardDefaultOptions,
|
455
|
+
classes: "tna-!--margin-bottom-m",
|
456
|
+
},
|
457
|
+
})}
|
458
|
+
</li>
|
459
|
+
<li class="tna-column tna-column--width-1-3 tna-column--width-1-2-small tna-column--full-tiny">
|
460
|
+
${Card({
|
461
|
+
params: {
|
462
|
+
...cardDefaultOptions,
|
463
|
+
style: "boxed",
|
464
|
+
classes: "tna-!--margin-bottom-m",
|
465
|
+
},
|
466
|
+
})}
|
467
|
+
</li>
|
468
|
+
<li class="tna-column tna-column--width-1-3 tna-column--width-1-2-small tna-column--full-tiny">
|
469
|
+
${Card({
|
470
|
+
params: {
|
471
|
+
...cardDefaultOptions,
|
472
|
+
style: "accent",
|
473
|
+
classes: "tna-!--margin-bottom-m",
|
474
|
+
},
|
475
|
+
})}
|
476
|
+
</li>
|
477
|
+
</ul>
|
476
478
|
</div>
|
477
479
|
<hr>
|
478
|
-
<div class="tna-
|
479
|
-
<
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
480
|
+
<div class="tna-section">
|
481
|
+
<ul class="tna-ul tna-ul--plain tna-container">
|
482
|
+
<li class="tna-column tna-column--width-2-3 tna-column--full-medium tna-column--full-small tna-column--full-tiny">
|
483
|
+
${Card({
|
484
|
+
params: {
|
485
|
+
...cardDefaultOptions,
|
486
|
+
horizontal: true,
|
487
|
+
classes: "tna-!--margin-bottom-m",
|
488
|
+
},
|
489
|
+
})}
|
490
|
+
</li>
|
491
|
+
<li class="tna-column tna-column--width-2-3 tna-column--full-medium tna-column--full-small tna-column--full-tiny">
|
492
|
+
${Card({
|
493
|
+
params: {
|
494
|
+
...cardDefaultOptions,
|
495
|
+
horizontal: true,
|
496
|
+
style: "boxed",
|
497
|
+
classes: "tna-!--margin-bottom-m",
|
498
|
+
},
|
499
|
+
})}
|
500
|
+
</li>
|
501
|
+
<li class="tna-column tna-column--width-2-3 tna-column--full-medium tna-column--full-small tna-column--full-tiny">
|
502
|
+
${Card({
|
503
|
+
params: {
|
504
|
+
...cardDefaultOptions,
|
505
|
+
horizontal: true,
|
506
|
+
style: "accent",
|
507
|
+
},
|
508
|
+
})}
|
509
|
+
</li>
|
510
|
+
</ul>
|
507
511
|
</div>
|
508
512
|
<hr>
|
509
513
|
<div class="tna-container tna-section">
|
@@ -612,7 +616,7 @@ const Template = ({ theme, accent }) => {
|
|
612
616
|
${IndexGrid({
|
613
617
|
params: {
|
614
618
|
heading: { title: "My dogs 1", level: 3, href: "#" },
|
615
|
-
items: Array(
|
619
|
+
items: Array(6)
|
616
620
|
.fill({
|
617
621
|
...{
|
618
622
|
href: "#",
|
@@ -690,11 +694,11 @@ const Template = ({ theme, accent }) => {
|
|
690
694
|
</div>
|
691
695
|
</div>
|
692
696
|
</div>
|
693
|
-
<div class="tna-section tna-background-
|
697
|
+
<div class="tna-section tna-background-tint">
|
694
698
|
${IndexGrid({
|
695
699
|
params: {
|
696
700
|
heading: { title: "My dogs 2", level: 3, href: "#" },
|
697
|
-
items: Array(
|
701
|
+
items: Array(6)
|
698
702
|
.fill({
|
699
703
|
...{
|
700
704
|
href: "#",
|
@@ -772,11 +776,93 @@ const Template = ({ theme, accent }) => {
|
|
772
776
|
</div>
|
773
777
|
</div>
|
774
778
|
</div>
|
775
|
-
<div class="tna-section tna-background-
|
779
|
+
<div class="tna-section tna-background-contrast">
|
776
780
|
${IndexGrid({
|
777
781
|
params: {
|
778
782
|
heading: { title: "My dogs 3", level: 3, href: "#" },
|
779
|
-
items: Array(
|
783
|
+
items: Array(6)
|
784
|
+
.fill({
|
785
|
+
...{
|
786
|
+
href: "#",
|
787
|
+
src: "https://picsum.photos/id/237/800/600",
|
788
|
+
alt: "Photo of a puppy",
|
789
|
+
width: "800",
|
790
|
+
height: "600",
|
791
|
+
title: "Cat",
|
792
|
+
subtitle: "4 photos",
|
793
|
+
},
|
794
|
+
})
|
795
|
+
.map((item, index) => {
|
796
|
+
const pseudoRandom = ((index * 29) % 8) + 1;
|
797
|
+
return {
|
798
|
+
...item,
|
799
|
+
href: `#/category-${index}`,
|
800
|
+
title: `Category #${index + 101}`,
|
801
|
+
subtitle: `${pseudoRandom} photos`,
|
802
|
+
};
|
803
|
+
}),
|
804
|
+
columns: 4,
|
805
|
+
columnsMedium: 3,
|
806
|
+
columnsSmall: 2,
|
807
|
+
columnsTiny: 1,
|
808
|
+
},
|
809
|
+
})}
|
810
|
+
<div class="tna-container">
|
811
|
+
<div class="tna-column tna-column--full">
|
812
|
+
${Pagination({
|
813
|
+
params: {
|
814
|
+
landmarkLabel: "My dogs 2 results",
|
815
|
+
previous: {
|
816
|
+
href: "#",
|
817
|
+
},
|
818
|
+
items: [
|
819
|
+
{
|
820
|
+
number: 1,
|
821
|
+
href: "#",
|
822
|
+
},
|
823
|
+
{
|
824
|
+
ellipsis: true,
|
825
|
+
},
|
826
|
+
{
|
827
|
+
number: 6,
|
828
|
+
href: "#",
|
829
|
+
},
|
830
|
+
{
|
831
|
+
number: 7,
|
832
|
+
current: true,
|
833
|
+
href: "#",
|
834
|
+
},
|
835
|
+
{
|
836
|
+
number: 8,
|
837
|
+
href: "#",
|
838
|
+
},
|
839
|
+
{
|
840
|
+
ellipsis: true,
|
841
|
+
},
|
842
|
+
{
|
843
|
+
number: 42,
|
844
|
+
href: "#",
|
845
|
+
},
|
846
|
+
],
|
847
|
+
next: {
|
848
|
+
href: "#",
|
849
|
+
},
|
850
|
+
classes: "tna-pagination--demo",
|
851
|
+
},
|
852
|
+
})}
|
853
|
+
<div class="tna-button-group">
|
854
|
+
<a href="#" class="tna-button" role="button">Primary button</a>
|
855
|
+
<a href="#" class="tna-button tna-button--accent" role="button">Accent button</a>
|
856
|
+
<a href="" class="tna-button tna-button--plain" role="button">Plain button</a>
|
857
|
+
</div>
|
858
|
+
</div>
|
859
|
+
</div>
|
860
|
+
</div>
|
861
|
+
<div class="tna-section tna-background-accent-light">
|
862
|
+
${IndexGrid({
|
863
|
+
params: {
|
864
|
+
heading: { title: "My dogs 4", level: 3, href: "#" },
|
865
|
+
items: Array(6)
|
780
866
|
.fill({
|
781
867
|
...{
|
782
868
|
href: "#",
|
@@ -857,8 +943,8 @@ const Template = ({ theme, accent }) => {
|
|
857
943
|
<div class="tna-section tna-background-accent">
|
858
944
|
${IndexGrid({
|
859
945
|
params: {
|
860
|
-
heading: { title: "My dogs
|
861
|
-
items: Array(
|
946
|
+
heading: { title: "My dogs 5", level: 3, href: "#" },
|
947
|
+
items: Array(6)
|
862
948
|
.fill({
|
863
949
|
...{
|
864
950
|
href: "#",
|
@@ -1068,7 +1154,7 @@ const Template = ({ theme, accent }) => {
|
|
1068
1154
|
href: "#",
|
1069
1155
|
},
|
1070
1156
|
{
|
1071
|
-
text: "Terms and
|
1157
|
+
text: "Terms and conditions",
|
1072
1158
|
href: "#",
|
1073
1159
|
},
|
1074
1160
|
{
|
@@ -1087,7 +1173,9 @@ const Template = ({ theme, accent }) => {
|
|
1087
1173
|
};
|
1088
1174
|
|
1089
1175
|
export const System = Template.bind({});
|
1090
|
-
|
1176
|
+
System.parameters = {
|
1177
|
+
chromatic: { disableSnapshot: true },
|
1178
|
+
};
|
1091
1179
|
System.args = {
|
1092
1180
|
theme: "system",
|
1093
1181
|
accent: "pink",
|
@@ -0,0 +1,45 @@
|
|
1
|
+
export default {
|
2
|
+
title: "Utilities/Tables",
|
3
|
+
};
|
4
|
+
|
5
|
+
const TableTemplate = () =>
|
6
|
+
`<table class="tna-table">
|
7
|
+
<caption class="tna-table__caption tna-heading-m tna-visually-hidden">Primary options</caption>
|
8
|
+
<thead class="tna-table__head">
|
9
|
+
<tr class="tna-table__row">
|
10
|
+
<th class="tna-table__header" scope="col">Name</th>
|
11
|
+
<th class="tna-table__header" scope="col">Type</th>
|
12
|
+
<th class="tna-table__header" scope="col">Description</th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
<tbody class="tna-table__body">
|
16
|
+
<tr class="tna-table__row">
|
17
|
+
<th class="tna-table__header" scope="row">items</th>
|
18
|
+
<td class="tna-table__cell">array</td>
|
19
|
+
<td class="tna-table__cell">
|
20
|
+
<p><strong>Required.</strong></p>
|
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>
|
28
|
+
</tr>
|
29
|
+
<tr class="tna-table__row">
|
30
|
+
<th class="tna-table__header" scope="row">classes</th>
|
31
|
+
<td class="tna-table__cell">string</td>
|
32
|
+
<td class="tna-table__cell">
|
33
|
+
<p>Classes to add to the breadcrumbs.</p>
|
34
|
+
</td>
|
35
|
+
</tr>
|
36
|
+
<tr class="tna-table__row">
|
37
|
+
<th class="tna-table__header" scope="row">attributes</th>
|
38
|
+
<td class="tna-table__cell">object</td>
|
39
|
+
<td class="tna-table__cell">
|
40
|
+
<p>HTML attributes (for example data attributes) to add to the breadcrumbs.</p>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
</tbody>
|
44
|
+
</table>`;
|
45
|
+
export const Table = TableTemplate.bind({});
|
@@ -3,7 +3,7 @@ const argTypes = {
|
|
3
3
|
title: { control: "text" },
|
4
4
|
level: { control: "number", min: 1, max: 6, step: 1 },
|
5
5
|
size: { control: "radio", options: ["m", "l", "xl"] },
|
6
|
-
|
6
|
+
plainSupertitle: { control: "boolean" },
|
7
7
|
};
|
8
8
|
|
9
9
|
export default {
|
@@ -11,35 +11,75 @@ export default {
|
|
11
11
|
argTypes,
|
12
12
|
};
|
13
13
|
|
14
|
-
const
|
14
|
+
const HeadingGroupTemplate = ({
|
15
15
|
supertitle,
|
16
16
|
title,
|
17
|
-
level
|
18
|
-
size
|
19
|
-
|
17
|
+
level,
|
18
|
+
size,
|
19
|
+
plainSupertitle,
|
20
20
|
}) =>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<span class="tna-hgroup__title">${title}</span>
|
26
|
-
</h${level}>
|
27
|
-
</hgroup>`
|
28
|
-
: `<hgroup class="tna-hgroup-${size}">
|
29
|
-
<p class="tna-hgroup__supertitle">${supertitle}</p>
|
21
|
+
`<hgroup class="tna-hgroup-${size}">
|
22
|
+
<p class="tna-hgroup__supertitle${
|
23
|
+
plainSupertitle ? " tna-hgroup__supertitle--plain" : ""
|
24
|
+
}">${supertitle}</p>
|
30
25
|
<h${level} class="tna-hgroup__title">${title}</h${level}>
|
31
26
|
</hgroup>`;
|
32
27
|
|
33
|
-
export const HeadingGroup =
|
28
|
+
export const HeadingGroup = HeadingGroupTemplate.bind({});
|
34
29
|
HeadingGroup.args = {
|
30
|
+
supertitle: "Record revealed",
|
31
|
+
title: "The Monteagle Letter",
|
32
|
+
level: 3,
|
33
|
+
size: "l",
|
34
|
+
plainSupertitle: false,
|
35
|
+
};
|
36
|
+
|
37
|
+
const HeadingGroupSingleSentenceTemplate = ({
|
38
|
+
supertitle,
|
39
|
+
title,
|
40
|
+
level,
|
41
|
+
size,
|
42
|
+
plainSupertitle,
|
43
|
+
}) =>
|
44
|
+
`<hgroup class="tna-hgroup-${size}">
|
45
|
+
<h${level} class="tna-hgroup__title">
|
46
|
+
<span class="tna-hgroup__supertitle${
|
47
|
+
plainSupertitle ? " tna-hgroup__supertitle--plain" : ""
|
48
|
+
}">${supertitle}</span>
|
49
|
+
<span class="tna-hgroup__title">${title}</span>
|
50
|
+
</h${level}>
|
51
|
+
</hgroup>`;
|
52
|
+
|
53
|
+
export const HeadingGroupSingleSentence =
|
54
|
+
HeadingGroupSingleSentenceTemplate.bind({});
|
55
|
+
HeadingGroupSingleSentence.args = {
|
35
56
|
supertitle: "The story of",
|
36
57
|
title: "Alice Hawkins",
|
37
|
-
|
58
|
+
level: 3,
|
59
|
+
size: "l",
|
60
|
+
plainSupertitle: false,
|
38
61
|
};
|
39
62
|
|
40
|
-
|
41
|
-
|
63
|
+
const HeadingGroupPlainSupertitleTemplate = ({
|
64
|
+
supertitle,
|
65
|
+
title,
|
66
|
+
level,
|
67
|
+
size,
|
68
|
+
plainSupertitle,
|
69
|
+
}) =>
|
70
|
+
`<hgroup class="tna-hgroup-${size}">
|
71
|
+
<p class="tna-hgroup__supertitle${
|
72
|
+
plainSupertitle ? " tna-hgroup__supertitle--plain" : ""
|
73
|
+
}">${supertitle}</p>
|
74
|
+
<h${level} class="tna-hgroup__title">${title}</h${level}>
|
75
|
+
</hgroup>`;
|
76
|
+
|
77
|
+
export const HeadingGroupPlainSupertitle =
|
78
|
+
HeadingGroupPlainSupertitleTemplate.bind({});
|
79
|
+
HeadingGroupPlainSupertitle.args = {
|
42
80
|
supertitle: "Record revealed",
|
43
81
|
title: "The Monteagle Letter",
|
44
|
-
|
82
|
+
level: 3,
|
83
|
+
size: "l",
|
84
|
+
plainSupertitle: true,
|
45
85
|
};
|
@@ -1,5 +1,7 @@
|
|
1
1
|
{% extends "./_generic.njk" %}
|
2
2
|
|
3
|
+
{% set assetPath = "/plugin-assets/%40nationalarchives%2Ffrontend/nationalarchives/assets" %}
|
4
|
+
|
3
5
|
{% block stylesheets %}
|
4
6
|
{% include "govuk-prototype-kit/includes/stylesheets-plugins.njk" %}
|
5
7
|
<link rel="stylesheet" type="text/css" href="https://use.typekit.net/hkj3kuz.css">
|