@nationalarchives/frontend 0.1.3-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 +191 -0
- package/govuk-prototype-kit.config.json +14 -0
- package/nationalarchives/_base.scss +6 -0
- package/nationalarchives/_prototype-kit.scss +3 -0
- package/nationalarchives/all.css +1 -0
- package/nationalarchives/all.css.map +1 -0
- package/nationalarchives/all.js +2 -0
- package/nationalarchives/all.js.map +1 -0
- package/nationalarchives/all.mjs +13 -0
- package/nationalarchives/all.scss +9 -0
- package/nationalarchives/assets/images/apple-touch-icon-152x152.png +0 -0
- package/nationalarchives/assets/images/apple-touch-icon-167x167.png +0 -0
- package/nationalarchives/assets/images/apple-touch-icon-180x180.png +0 -0
- package/nationalarchives/assets/images/apple-touch-icon.png +0 -0
- package/nationalarchives/assets/images/favicon.ico +0 -0
- package/nationalarchives/assets/images/mask-icon.svg +6 -0
- package/nationalarchives/assets/images/nationalarchives-opengraph-image.png +0 -0
- package/nationalarchives/assets/images/tna-horizontal-logo-inverted.svg +51 -0
- package/nationalarchives/assets/images/tna-horizontal-logo.svg +51 -0
- package/nationalarchives/assets/images/tna-square-logo-inverted.svg +47 -0
- package/nationalarchives/assets/images/tna-square-logo.svg +47 -0
- package/nationalarchives/components/_all.scss +7 -0
- package/nationalarchives/components/button/_button.scss +2 -0
- package/nationalarchives/components/button/_index.scss +26 -0
- package/nationalarchives/components/button/button.stories.js +52 -0
- package/nationalarchives/components/button/fixtures.json +56 -0
- package/nationalarchives/components/button/macro-options.json +38 -0
- package/nationalarchives/components/button/macro.njk +3 -0
- package/nationalarchives/components/button/template.njk +7 -0
- package/nationalarchives/components/card/_card.scss +2 -0
- package/nationalarchives/components/card/_index.scss +37 -0
- package/nationalarchives/components/card/card.stories.js +77 -0
- package/nationalarchives/components/card/fixtures.json +29 -0
- package/nationalarchives/components/card/macro-options.json +96 -0
- package/nationalarchives/components/card/macro.njk +3 -0
- package/nationalarchives/components/card/template.njk +33 -0
- package/nationalarchives/components/footer/_footer.scss +2 -0
- package/nationalarchives/components/footer/_index.scss +77 -0
- package/nationalarchives/components/footer/fixtures.json +11 -0
- package/nationalarchives/components/footer/footer.stories.js +170 -0
- package/nationalarchives/components/footer/macro-options.json +80 -0
- package/nationalarchives/components/footer/macro.njk +3 -0
- package/nationalarchives/components/footer/template.njk +46 -0
- package/nationalarchives/components/grid/_grid.scss +2 -0
- package/nationalarchives/components/grid/_index.scss +84 -0
- package/nationalarchives/components/grid/fixtures.json +273 -0
- package/nationalarchives/components/grid/grid.stories.js +192 -0
- package/nationalarchives/components/grid/macro-options.json +106 -0
- package/nationalarchives/components/grid/macro.njk +3 -0
- package/nationalarchives/components/grid/template.njk +44 -0
- package/nationalarchives/components/sensitive-image/_index.scss +84 -0
- package/nationalarchives/components/sensitive-image/_sensitive-image.scss +2 -0
- package/nationalarchives/components/sensitive-image/fixtures.json +54 -0
- package/nationalarchives/components/sensitive-image/macro-options.json +58 -0
- package/nationalarchives/components/sensitive-image/macro.njk +3 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.js +2 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.js.map +1 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.mjs +26 -0
- package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +49 -0
- package/nationalarchives/components/sensitive-image/template.njk +10 -0
- package/nationalarchives/stories/development/structure.mdx +7 -0
- package/nationalarchives/stories/global/heading-groups.stories.js +23 -0
- package/nationalarchives/stories/global/headings.stories.js +40 -0
- package/nationalarchives/stories/global/typography.mdx +22 -0
- package/nationalarchives/stories/global/typography.stories.js +15 -0
- package/nationalarchives/tools/_all.scss +1 -0
- package/nationalarchives/tools/_exports.scss +36 -0
- package/nationalarchives/utilities/_all.scss +3 -0
- package/nationalarchives/utilities/_global.scss +39 -0
- package/nationalarchives/utilities/_grid.scss +131 -0
- package/nationalarchives/utilities/_typography.scss +82 -0
- package/nationalarchives/variables/_all.scss +2 -0
- package/nationalarchives/variables/_grid.scss +9 -0
- package/nationalarchives/variables/_media.scss +12 -0
- package/package.json +70 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
{
|
2
|
+
"component": "button",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "plain button",
|
6
|
+
"options": {
|
7
|
+
"text": "Log in",
|
8
|
+
"href": "#"
|
9
|
+
},
|
10
|
+
"html": "<a href=\"#\" class=\"tna-button \">\n Log in\n</a>",
|
11
|
+
"hidden": false
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"name": "with title",
|
15
|
+
"options": {
|
16
|
+
"text": "Log in",
|
17
|
+
"href": "#",
|
18
|
+
"title": "Log in to the service"
|
19
|
+
},
|
20
|
+
"html": "<a href=\"#\" class=\"tna-button \" title=\"Log in to the service\">\n Log in\n</a>",
|
21
|
+
"hidden": false
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"name": "secondary",
|
25
|
+
"options": {
|
26
|
+
"text": "Log in",
|
27
|
+
"href": "#",
|
28
|
+
"secondary": true
|
29
|
+
},
|
30
|
+
"html": "<a href=\"#\" class=\"tna-button tna-button--secondary\">\n Log in\n</a>",
|
31
|
+
"hidden": false
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"name": "with classes",
|
35
|
+
"options": {
|
36
|
+
"text": "Log in",
|
37
|
+
"href": "#",
|
38
|
+
"classes": "button__test-class"
|
39
|
+
},
|
40
|
+
"html": "<a href=\"#\" class=\"tna-button button__test-class\">\n Log in\n</a>",
|
41
|
+
"hidden": false
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"name": "with attributes",
|
45
|
+
"options": {
|
46
|
+
"text": "Log in",
|
47
|
+
"href": "#",
|
48
|
+
"attributes": {
|
49
|
+
"data-testattribute": "foobar"
|
50
|
+
}
|
51
|
+
},
|
52
|
+
"html": "<a href=\"#\" class=\"tna-button \" data-testattribute=\"foobar\">\n Log in\n</a>",
|
53
|
+
"hidden": false
|
54
|
+
}
|
55
|
+
]
|
56
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "text",
|
4
|
+
"type": "string",
|
5
|
+
"required": true,
|
6
|
+
"description": ""
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name": "href",
|
10
|
+
"type": "string",
|
11
|
+
"required": true,
|
12
|
+
"description": ""
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "title",
|
16
|
+
"type": "string",
|
17
|
+
"required": false,
|
18
|
+
"description": ""
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "secondary",
|
22
|
+
"type": "boolean",
|
23
|
+
"required": false,
|
24
|
+
"description": ""
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "classes",
|
28
|
+
"type": "string",
|
29
|
+
"required": false,
|
30
|
+
"description": "Classes to add to the button."
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "attributes",
|
34
|
+
"type": "object",
|
35
|
+
"required": false,
|
36
|
+
"description": "HTML attributes (for example data attributes) to add to the button."
|
37
|
+
}
|
38
|
+
]
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{%- set buttonClasses = [params.classes] if params.classes else [] -%}
|
2
|
+
{%- if params.secondary -%}
|
3
|
+
{%- set buttonClasses = buttonClasses.concat('tna-button--secondary') -%}
|
4
|
+
{%- endif -%}
|
5
|
+
<a href="{{ params.href }}" class="tna-button {{ buttonClasses | join(' ') }}" {%- if params.title %} title="{{ params.title }}"{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
6
|
+
{{ params.text }}
|
7
|
+
</a>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
@include nationalarchives-exports("nationalarchives/components/card") {
|
2
|
+
.tna-card {
|
3
|
+
display: -ms-flexbox;
|
4
|
+
display: flex;
|
5
|
+
-ms-box-orient: vertical;
|
6
|
+
-ms-flex-direction: column;
|
7
|
+
flex-direction: column;
|
8
|
+
}
|
9
|
+
|
10
|
+
.tna-card__heading {
|
11
|
+
order: 2;
|
12
|
+
}
|
13
|
+
|
14
|
+
.tna-card__supertitle {
|
15
|
+
}
|
16
|
+
|
17
|
+
.tna-card__title {
|
18
|
+
}
|
19
|
+
|
20
|
+
.tna-card__title-link {
|
21
|
+
}
|
22
|
+
|
23
|
+
.tna-card__image {
|
24
|
+
order: 1;
|
25
|
+
}
|
26
|
+
|
27
|
+
.tna-card__body {
|
28
|
+
order: 3;
|
29
|
+
}
|
30
|
+
|
31
|
+
.tna-card__actions {
|
32
|
+
order: 4;
|
33
|
+
}
|
34
|
+
|
35
|
+
.tna-card__action {
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import Card from "./template.njk";
|
2
|
+
import "../../all.scss";
|
3
|
+
import "./_card.scss";
|
4
|
+
import macroOptions from "./macro-options.json";
|
5
|
+
|
6
|
+
const argTypes = {
|
7
|
+
supertitle: { control: "text" },
|
8
|
+
title: { control: "text" },
|
9
|
+
href: { control: "text" },
|
10
|
+
image: { control: "object" },
|
11
|
+
body: { control: "text" },
|
12
|
+
text: { control: "text" },
|
13
|
+
actions: { control: "object" },
|
14
|
+
htmlElement: { control: "text" },
|
15
|
+
classes: { control: "text" },
|
16
|
+
attributes: { control: "text" },
|
17
|
+
};
|
18
|
+
|
19
|
+
Object.keys(argTypes).forEach((argType) => {
|
20
|
+
argTypes[argType].description = macroOptions.find(
|
21
|
+
(option) => option.name === argType
|
22
|
+
)?.description;
|
23
|
+
});
|
24
|
+
|
25
|
+
export default {
|
26
|
+
title: "Components/Card",
|
27
|
+
argTypes,
|
28
|
+
};
|
29
|
+
|
30
|
+
const Template = ({
|
31
|
+
supertitle,
|
32
|
+
title,
|
33
|
+
href,
|
34
|
+
image,
|
35
|
+
body,
|
36
|
+
text,
|
37
|
+
actions,
|
38
|
+
htmlElement,
|
39
|
+
classes,
|
40
|
+
attributes,
|
41
|
+
}) => {
|
42
|
+
return Card({
|
43
|
+
params: {
|
44
|
+
supertitle,
|
45
|
+
title,
|
46
|
+
href,
|
47
|
+
image,
|
48
|
+
body,
|
49
|
+
text,
|
50
|
+
actions,
|
51
|
+
htmlElement,
|
52
|
+
classes,
|
53
|
+
attributes,
|
54
|
+
},
|
55
|
+
});
|
56
|
+
};
|
57
|
+
|
58
|
+
export const Standard = Template.bind({});
|
59
|
+
Standard.args = {
|
60
|
+
supertitle: "Card supertitle",
|
61
|
+
title: "Card title",
|
62
|
+
href: "#",
|
63
|
+
image: {
|
64
|
+
src: "https://loremflickr.com/640/360",
|
65
|
+
alt: "A placeholder image",
|
66
|
+
},
|
67
|
+
body: "<p>Card body</p>",
|
68
|
+
actions: [
|
69
|
+
{
|
70
|
+
text: "Card action",
|
71
|
+
href: "#",
|
72
|
+
title: "Go and do the action",
|
73
|
+
},
|
74
|
+
],
|
75
|
+
htmlElement: "article",
|
76
|
+
classes: "tna-card--demo",
|
77
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"component": "card",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "TEMP TEST",
|
6
|
+
"options": {
|
7
|
+
"supertitle": "Card supertitle",
|
8
|
+
"title": "Card title",
|
9
|
+
"href": "#",
|
10
|
+
"image": {
|
11
|
+
"src": "https://loremflickr.com/640/360",
|
12
|
+
"alt": "A placeholder image"
|
13
|
+
},
|
14
|
+
"body": "<p>Card body</p>",
|
15
|
+
"actions": [
|
16
|
+
{
|
17
|
+
"text": "Card action",
|
18
|
+
"href": "#",
|
19
|
+
"title": "Go and do the action"
|
20
|
+
}
|
21
|
+
],
|
22
|
+
"htmlElement": "article",
|
23
|
+
"classes": "tna-card--demo"
|
24
|
+
},
|
25
|
+
"html": "<article class=\"tna-card tna-card--demo\">\n <hgroup class=\"tna-card__heading tna-hgroup\"><p class=\"tna-card__supertitle tna-hgroup__supertitle\">Card supertitle</p><h1 class=\"tna-card__title tna-hgroup__title\"><a href=\"#\" class=\"tna-card__title-link\">Card title</a></h1>\n </hgroup><img src=\"https://loremflickr.com/640/360\" alt=\"A placeholder image\" class=\"tna-card__image\" /><div class=\"tna-card__body\"><p>Card body</p></div><div class=\"tna-card__actions\"><a href=\"#\" class=\"tna-card__action tna-button\"title=\"Go and do the action\">Card action</a></div></article>",
|
26
|
+
"hidden": false
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"name": "supertitle",
|
4
|
+
"type": "string",
|
5
|
+
"required": false,
|
6
|
+
"description": ""
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name": "title",
|
10
|
+
"type": "string",
|
11
|
+
"required": true,
|
12
|
+
"description": ""
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "href",
|
16
|
+
"type": "string",
|
17
|
+
"required": false,
|
18
|
+
"description": ""
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "image",
|
22
|
+
"type": "object",
|
23
|
+
"required": false,
|
24
|
+
"description": "",
|
25
|
+
"params": [
|
26
|
+
{
|
27
|
+
"name": "src",
|
28
|
+
"type": "string",
|
29
|
+
"required": true,
|
30
|
+
"description": ""
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "alt",
|
34
|
+
"type": "string",
|
35
|
+
"required": true,
|
36
|
+
"description": ""
|
37
|
+
}
|
38
|
+
]
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"name": "body",
|
42
|
+
"type": "string",
|
43
|
+
"required": false,
|
44
|
+
"description": ""
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"name": "text",
|
48
|
+
"type": "string",
|
49
|
+
"required": false,
|
50
|
+
"description": ""
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"name": "actions",
|
54
|
+
"type": "array",
|
55
|
+
"required": true,
|
56
|
+
"description": "",
|
57
|
+
"params": [
|
58
|
+
{
|
59
|
+
"name": "text",
|
60
|
+
"type": "string",
|
61
|
+
"required": true,
|
62
|
+
"description": ""
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "href",
|
66
|
+
"type": "string",
|
67
|
+
"required": true,
|
68
|
+
"description": ""
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"name": "title",
|
72
|
+
"type": "string",
|
73
|
+
"required": false,
|
74
|
+
"description": ""
|
75
|
+
}
|
76
|
+
]
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"name": "htmlElement",
|
80
|
+
"type": "string",
|
81
|
+
"required": false,
|
82
|
+
"description": "HTML element of the card."
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"name": "classes",
|
86
|
+
"type": "string",
|
87
|
+
"required": false,
|
88
|
+
"description": "Classes to add to the card."
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"name": "attributes",
|
92
|
+
"type": "object",
|
93
|
+
"required": false,
|
94
|
+
"description": "HTML attributes (for example data attributes) to add to the card."
|
95
|
+
}
|
96
|
+
]
|
@@ -0,0 +1,33 @@
|
|
1
|
+
{%- set htmlElement = params.htmlElement if params.htmlElement else 'div' -%}
|
2
|
+
{%- set containerClasses = [params.classes] if params.classes else [] -%}
|
3
|
+
<{{ htmlElement }} class="tna-card {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
4
|
+
<hgroup class="tna-card__heading tna-hgroup">
|
5
|
+
{%- if params.supertitle -%}
|
6
|
+
<p class="tna-card__supertitle tna-hgroup__supertitle">{{ params.supertitle }}</p>
|
7
|
+
{%- endif -%}
|
8
|
+
<h1 class="tna-card__title tna-hgroup__title">
|
9
|
+
{%- if params.href -%}
|
10
|
+
<a href="{{ params.href }}" class="tna-card__title-link">{{ params.title }}</a>
|
11
|
+
{%- else -%}
|
12
|
+
{{ params.title }}
|
13
|
+
{%- endif -%}
|
14
|
+
</h1>
|
15
|
+
</hgroup>
|
16
|
+
{%- if params.image -%}
|
17
|
+
<img src="{{ params.image.src }}" alt="{{ params.image.alt }}" class="tna-card__image" />
|
18
|
+
{%- endif -%}
|
19
|
+
<div class="tna-card__body">
|
20
|
+
{%- if params.text -%}
|
21
|
+
<p>{{ params.text }}</p>
|
22
|
+
{%- else -%}
|
23
|
+
{{ params.body | safe }}
|
24
|
+
{%- endif -%}
|
25
|
+
</div>
|
26
|
+
{%- if params.actions -%}
|
27
|
+
<div class="tna-card__actions">
|
28
|
+
{%- for item in params.actions -%}
|
29
|
+
<a href="{{ item.href }}" class="tna-card__action tna-button" {%- if item.title %}title="{{ item.title }}"{% endif %}>{{ item.text }}</a>
|
30
|
+
{%- endfor -%}
|
31
|
+
</div>
|
32
|
+
{%- endif -%}
|
33
|
+
</{{ htmlElement }}>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
// @import "../../variables/all";
|
2
|
+
// @import "../../utilities/grid";
|
3
|
+
|
4
|
+
@include nationalarchives-exports("nationalarchives/components/footer") {
|
5
|
+
.tna-footer {
|
6
|
+
padding-top: 3rem;
|
7
|
+
padding-bottom: 3rem;
|
8
|
+
|
9
|
+
color: #fff;
|
10
|
+
|
11
|
+
background-color: #26262a;
|
12
|
+
}
|
13
|
+
|
14
|
+
.tna-footer__link {
|
15
|
+
color: inherit;
|
16
|
+
|
17
|
+
&:hover {
|
18
|
+
color: #f0a;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
.tna-footer__navigation {
|
23
|
+
padding-bottom: 3rem;
|
24
|
+
}
|
25
|
+
|
26
|
+
.tna-footer__navigation-group {
|
27
|
+
}
|
28
|
+
|
29
|
+
.tna-footer__navigation-group-title {
|
30
|
+
}
|
31
|
+
|
32
|
+
.tna-footer__navigation-group-items {
|
33
|
+
padding-left: 0;
|
34
|
+
|
35
|
+
list-style: none;
|
36
|
+
}
|
37
|
+
|
38
|
+
.tna-footer__navigation-group-item {
|
39
|
+
}
|
40
|
+
|
41
|
+
.tna-footer__navigation-group-item-link {
|
42
|
+
}
|
43
|
+
|
44
|
+
.tna-footer__social {
|
45
|
+
padding-bottom: 4rem;
|
46
|
+
}
|
47
|
+
|
48
|
+
.tna-footer__social-item {
|
49
|
+
text-align: center;
|
50
|
+
}
|
51
|
+
|
52
|
+
.tna-footer__social-item-link {
|
53
|
+
}
|
54
|
+
|
55
|
+
.tna-footer__licence-logo {
|
56
|
+
display: block;
|
57
|
+
}
|
58
|
+
|
59
|
+
.tna-footer__govuk-link {
|
60
|
+
display: inline-block;
|
61
|
+
|
62
|
+
color: inherit;
|
63
|
+
fill: #fff;
|
64
|
+
|
65
|
+
&:hover {
|
66
|
+
color: #f0a;
|
67
|
+
fill: #f0a;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
.tna-footer__govuk-logotype-crown {
|
72
|
+
margin: 0 auto;
|
73
|
+
display: block;
|
74
|
+
|
75
|
+
fill: inherit;
|
76
|
+
}
|
77
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{
|
2
|
+
"component": "footer",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "minimal",
|
6
|
+
"options": {},
|
7
|
+
"html": "<footer class=\"tna-footer \"><div class=\"tna-container\">\n <div class=\"tna-column\">\n <svg aria-hidden=\"true\" focusable=\"false\" class=\"tna-footer__licence-logo\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 483.2 195.7\" height=\"17\" width=\"41\">\n <path fill=\"currentColor\" d=\"M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145\"></path>\n </svg>\n </div>\n <div class=\"tna-column tna-column--flex-1\">\n <p>All content is available under the <a href=\"https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/\" class=\"tna-footer__link\">Open Government Licence v3.0</a>, except where otherwise stated</p>\n </div>\n <div class=\"tna-column\">\n <a href=\"#\" class=\"tna-footer__govuk-link\">\n <svg aria-hidden=\"true\" class=\"tna-footer__govuk-logotype-crown\" focusable=\"false\" height=\"30\" viewBox=\"0 0 132 97\" width=\"36\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z\"></path>\n </svg>\n GOV.UK\n </a>\n </div>\n </div>\n</footer>",
|
8
|
+
"hidden": false
|
9
|
+
}
|
10
|
+
]
|
11
|
+
}
|
@@ -0,0 +1,170 @@
|
|
1
|
+
import Footer from "./template.njk";
|
2
|
+
import "../../all.scss";
|
3
|
+
import "./_footer.scss";
|
4
|
+
import macroOptions from "./macro-options.json";
|
5
|
+
|
6
|
+
const argTypes = {
|
7
|
+
navigation: { control: "object" },
|
8
|
+
social: { control: "object" },
|
9
|
+
classes: { control: "text" },
|
10
|
+
attributes: { control: "text" },
|
11
|
+
};
|
12
|
+
|
13
|
+
Object.keys(argTypes).forEach((argType) => {
|
14
|
+
argTypes[argType].description = macroOptions.find(
|
15
|
+
(option) => option.name === argType
|
16
|
+
)?.description;
|
17
|
+
});
|
18
|
+
|
19
|
+
export default {
|
20
|
+
title: "Components/Footer",
|
21
|
+
argTypes,
|
22
|
+
};
|
23
|
+
|
24
|
+
const Template = ({ navigation, social, classes, attributes }) => {
|
25
|
+
return Footer({
|
26
|
+
params: {
|
27
|
+
navigation,
|
28
|
+
social,
|
29
|
+
classes,
|
30
|
+
attributes,
|
31
|
+
},
|
32
|
+
});
|
33
|
+
};
|
34
|
+
|
35
|
+
export const Standard = Template.bind({});
|
36
|
+
Standard.args = {
|
37
|
+
navigation: [
|
38
|
+
{
|
39
|
+
title: "Find out more",
|
40
|
+
items: [
|
41
|
+
{
|
42
|
+
text: "Contact us",
|
43
|
+
href: "#",
|
44
|
+
},
|
45
|
+
{
|
46
|
+
text: "Press room",
|
47
|
+
href: "#",
|
48
|
+
},
|
49
|
+
{
|
50
|
+
text: "Jobs and careers",
|
51
|
+
href: "#",
|
52
|
+
},
|
53
|
+
{
|
54
|
+
text: "Friends of The National Archives",
|
55
|
+
href: "#",
|
56
|
+
},
|
57
|
+
],
|
58
|
+
},
|
59
|
+
{
|
60
|
+
title: "Site help",
|
61
|
+
items: [
|
62
|
+
{
|
63
|
+
text: "Help",
|
64
|
+
href: "#",
|
65
|
+
},
|
66
|
+
{
|
67
|
+
text: "Website A-Z index",
|
68
|
+
href: "#",
|
69
|
+
},
|
70
|
+
{
|
71
|
+
text: "Accessibility",
|
72
|
+
href: "#",
|
73
|
+
},
|
74
|
+
],
|
75
|
+
},
|
76
|
+
{
|
77
|
+
title: "Websites",
|
78
|
+
items: [
|
79
|
+
{
|
80
|
+
text: "Blog",
|
81
|
+
href: "#",
|
82
|
+
},
|
83
|
+
{
|
84
|
+
text: "Podcasts and videos",
|
85
|
+
href: "#",
|
86
|
+
},
|
87
|
+
{
|
88
|
+
text: "Shop",
|
89
|
+
href: "#",
|
90
|
+
},
|
91
|
+
{
|
92
|
+
text: "Image library",
|
93
|
+
href: "#",
|
94
|
+
},
|
95
|
+
{
|
96
|
+
text: "UK Government Web Archive",
|
97
|
+
href: "#",
|
98
|
+
},
|
99
|
+
{
|
100
|
+
text: "Legislation.gov.ukOpens a new window",
|
101
|
+
href: "#",
|
102
|
+
},
|
103
|
+
{
|
104
|
+
text: "Find case law",
|
105
|
+
href: "#",
|
106
|
+
},
|
107
|
+
{
|
108
|
+
text: "The Gazette",
|
109
|
+
href: "#",
|
110
|
+
},
|
111
|
+
],
|
112
|
+
},
|
113
|
+
{
|
114
|
+
title: "Legal",
|
115
|
+
items: [
|
116
|
+
{
|
117
|
+
text: "Terms of use",
|
118
|
+
href: "#",
|
119
|
+
},
|
120
|
+
{
|
121
|
+
text: "Privacy policy",
|
122
|
+
href: "#",
|
123
|
+
},
|
124
|
+
{
|
125
|
+
text: "Cookies",
|
126
|
+
href: "#",
|
127
|
+
},
|
128
|
+
{
|
129
|
+
text: "Freedom of Information",
|
130
|
+
href: "#",
|
131
|
+
},
|
132
|
+
{
|
133
|
+
text: "Transparency",
|
134
|
+
href: "#",
|
135
|
+
},
|
136
|
+
{
|
137
|
+
text: "Our fees",
|
138
|
+
href: "#",
|
139
|
+
},
|
140
|
+
],
|
141
|
+
},
|
142
|
+
],
|
143
|
+
social: [
|
144
|
+
{
|
145
|
+
text: "Twitter",
|
146
|
+
href: "#",
|
147
|
+
},
|
148
|
+
{
|
149
|
+
text: "YouTube",
|
150
|
+
href: "#",
|
151
|
+
},
|
152
|
+
{
|
153
|
+
text: "Flickr",
|
154
|
+
href: "#",
|
155
|
+
},
|
156
|
+
{
|
157
|
+
text: "Facebook",
|
158
|
+
href: "#",
|
159
|
+
},
|
160
|
+
{
|
161
|
+
text: "Instagram",
|
162
|
+
href: "#",
|
163
|
+
},
|
164
|
+
{
|
165
|
+
text: "RSS",
|
166
|
+
href: "#",
|
167
|
+
},
|
168
|
+
],
|
169
|
+
classes: "tna-footer--demo",
|
170
|
+
};
|