@nationalarchives/frontend 0.1.20-prerelease → 0.1.22-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.
Files changed (162) hide show
  1. package/README.md +1 -1
  2. package/govuk-prototype-kit.config.json +7 -2
  3. package/nationalarchives/_prototype-kit.scss +16 -0
  4. package/nationalarchives/all.css +3 -3
  5. package/nationalarchives/all.css.map +1 -1
  6. package/nationalarchives/all.js +1 -1
  7. package/nationalarchives/all.js.map +1 -1
  8. package/nationalarchives/all.mjs +17 -10
  9. package/nationalarchives/all.scss +1 -5
  10. package/nationalarchives/assets/images/favicon.ico +0 -0
  11. package/nationalarchives/assets/images/mask-icon.svg +17 -5
  12. package/nationalarchives/assets/images/mstile-150x150.png +0 -0
  13. package/nationalarchives/components/_index.scss +1 -0
  14. package/nationalarchives/components/breadcrumbs/breadcrumbs.css +1 -1
  15. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  17. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  18. package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +5 -15
  19. package/nationalarchives/components/breadcrumbs/breadcrumbs.scss +12 -4
  20. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +64 -0
  21. package/nationalarchives/components/breadcrumbs/fixtures.json +2 -2
  22. package/nationalarchives/components/breadcrumbs/template.njk +11 -15
  23. package/nationalarchives/components/button/_button-group.scss +1 -1
  24. package/nationalarchives/components/button/button.css +1 -13
  25. package/nationalarchives/components/button/button.css.map +1 -1
  26. package/nationalarchives/components/button/button.scss +24 -6
  27. package/nationalarchives/components/card/card.css +1 -13
  28. package/nationalarchives/components/card/card.css.map +1 -1
  29. package/nationalarchives/components/card/card.scss +52 -7
  30. package/nationalarchives/components/card/card.stories.js +78 -36
  31. package/nationalarchives/components/card/fixtures.json +40 -16
  32. package/nationalarchives/components/card/macro-options.json +26 -0
  33. package/nationalarchives/components/card/template.njk +38 -26
  34. package/nationalarchives/components/cookie-banner/cookie-banner.css +1 -13
  35. package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
  36. package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
  37. package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
  38. package/nationalarchives/components/cookie-banner/cookie-banner.mjs +15 -7
  39. package/nationalarchives/components/cookie-banner/cookie-banner.scss +9 -1
  40. package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +23 -10
  41. package/nationalarchives/components/cookie-banner/macro-options.json +1 -1
  42. package/nationalarchives/components/cookie-banner/template.njk +4 -4
  43. package/nationalarchives/components/filters/filters.css +1 -1
  44. package/nationalarchives/components/filters/filters.css.map +1 -1
  45. package/nationalarchives/components/filters/filters.scss +2 -2
  46. package/nationalarchives/components/footer/fixtures.json +1 -1
  47. package/nationalarchives/components/footer/footer.css +1 -13
  48. package/nationalarchives/components/footer/footer.css.map +1 -1
  49. package/nationalarchives/components/footer/footer.scss +8 -55
  50. package/nationalarchives/components/footer/footer.stories.js +1 -1
  51. package/nationalarchives/components/footer/template.njk +16 -14
  52. package/nationalarchives/components/gallery/gallery.css +1 -13
  53. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  54. package/nationalarchives/components/gallery/template.njk +2 -2
  55. package/nationalarchives/components/grid/grid.css +1 -1
  56. package/nationalarchives/components/grid/grid.css.map +1 -1
  57. package/nationalarchives/components/grid/grid.scss +15 -11
  58. package/nationalarchives/components/grid/grid.stories.js +21 -0
  59. package/nationalarchives/components/grid/macro-options.json +48 -0
  60. package/nationalarchives/components/grid/template.njk +29 -3
  61. package/nationalarchives/components/header/header.css +1 -1
  62. package/nationalarchives/components/header/header.css.map +1 -1
  63. package/nationalarchives/components/header/header.scss +60 -145
  64. package/nationalarchives/components/header/header.stories.js +2 -0
  65. package/nationalarchives/components/header/macro-options.json +12 -0
  66. package/nationalarchives/components/header/template.njk +6 -1
  67. package/nationalarchives/components/hero/fixtures.json +166 -6
  68. package/nationalarchives/components/hero/hero.css +1 -1
  69. package/nationalarchives/components/hero/hero.css.map +1 -1
  70. package/nationalarchives/components/hero/hero.scss +187 -64
  71. package/nationalarchives/components/hero/hero.stories.js +98 -23
  72. package/nationalarchives/components/hero/macro-options.json +48 -12
  73. package/nationalarchives/components/hero/template.njk +34 -24
  74. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  75. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  76. package/nationalarchives/components/index-grid/template.njk +2 -2
  77. package/nationalarchives/components/message/message.css +1 -1
  78. package/nationalarchives/components/message/message.css.map +1 -1
  79. package/nationalarchives/components/message/message.scss +4 -0
  80. package/nationalarchives/components/pagination/_index.scss +1 -0
  81. package/nationalarchives/components/pagination/fixtures.json +4 -0
  82. package/nationalarchives/components/pagination/macro-options.json +116 -0
  83. package/nationalarchives/components/pagination/macro.njk +3 -0
  84. package/nationalarchives/components/pagination/pagination.css +1 -0
  85. package/nationalarchives/components/pagination/pagination.css.map +1 -0
  86. package/nationalarchives/components/pagination/pagination.scss +98 -0
  87. package/nationalarchives/components/pagination/pagination.stories.js +73 -0
  88. package/nationalarchives/components/pagination/template.njk +38 -0
  89. package/nationalarchives/components/phase-banner/phase-banner.css +1 -1
  90. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  91. package/nationalarchives/components/phase-banner/phase-banner.scss +5 -1
  92. package/nationalarchives/components/picture/picture.css +1 -13
  93. package/nationalarchives/components/picture/picture.css.map +1 -1
  94. package/nationalarchives/components/picture/picture.scss +1 -1
  95. package/nationalarchives/components/picture/picture.stories.js +2 -2
  96. package/nationalarchives/components/profile/profile.css +1 -1
  97. package/nationalarchives/components/profile/profile.css.map +1 -1
  98. package/nationalarchives/components/profile/template.njk +2 -2
  99. package/nationalarchives/components/sensitive-image/sensitive-image.css +1 -1
  100. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +1 -1
  101. package/nationalarchives/components/skip-link/fixtures.json +1 -1
  102. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  103. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  104. package/nationalarchives/components/skip-link/skip-link.js +2 -0
  105. package/nationalarchives/components/skip-link/skip-link.js.map +1 -0
  106. package/nationalarchives/components/skip-link/skip-link.mjs +40 -0
  107. package/nationalarchives/components/skip-link/skip-link.scss +18 -16
  108. package/nationalarchives/components/skip-link/skip-link.stories.js +48 -6
  109. package/nationalarchives/components/skip-link/template.njk +1 -1
  110. package/nationalarchives/components/tabs/tabs.css +1 -1
  111. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  112. package/nationalarchives/components/tabs/tabs.js +1 -1
  113. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  114. package/nationalarchives/components/tabs/tabs.mjs +6 -2
  115. package/nationalarchives/components/tabs/tabs.scss +17 -2
  116. package/nationalarchives/components/tabs/tabs.stories.js +6 -6
  117. package/nationalarchives/lib/_font-awesome.scss +3 -2
  118. package/nationalarchives/lib/cookies.mjs +122 -50
  119. package/nationalarchives/stories/development/contributing.mdx +0 -10
  120. package/nationalarchives/stories/development/cookies.mdx +82 -0
  121. package/nationalarchives/stories/development/structure.mdx +88 -0
  122. package/nationalarchives/stories/development/using/compiled.mdx +9 -0
  123. package/nationalarchives/stories/development/using/hosted.mdx +53 -0
  124. package/nationalarchives/stories/development/using/npm.mdx +59 -0
  125. package/nationalarchives/stories/utilities/colour-schemes/colour-schemes.stories.js +333 -72
  126. package/nationalarchives/stories/utilities/overrides/overrides.stories.js +10 -21
  127. package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +2 -2
  128. package/nationalarchives/stories/utilities/typography/headings.stories.js +6 -3
  129. package/nationalarchives/stories/utilities/typography/lists.stories.js +93 -0
  130. package/nationalarchives/stories/utilities/typography/typography.mdx +11 -1
  131. package/nationalarchives/stories/utilities/typography/typography.stories.js +1 -1
  132. package/nationalarchives/templates/homepage.njk +11 -58
  133. package/nationalarchives/templates/layouts/_generic.njk +31 -14
  134. package/nationalarchives/templates/layouts/_prototype-kit.njk +11 -0
  135. package/nationalarchives/templates/search-results.njk +11 -15
  136. package/nationalarchives/templates/topics.njk +18 -22
  137. package/nationalarchives/tools/_colour.scss +77 -23
  138. package/nationalarchives/tools/_grid.scss +12 -12
  139. package/nationalarchives/tools/_media.scss +6 -0
  140. package/nationalarchives/tools/_spacing.scss +6 -6
  141. package/nationalarchives/tools/_typography.scss +4 -2
  142. package/nationalarchives/utilities/_a11y.scss +15 -0
  143. package/nationalarchives/utilities/_columns.scss +42 -0
  144. package/nationalarchives/utilities/_debug.scss +1 -1
  145. package/nationalarchives/utilities/_global.scss +32 -32
  146. package/nationalarchives/utilities/_index.scss +2 -0
  147. package/nationalarchives/utilities/_lists.scss +181 -0
  148. package/nationalarchives/utilities/_typography.scss +129 -138
  149. package/nationalarchives/variables/_assets.scss +2 -1
  150. package/nationalarchives/variables/_colour.scss +94 -74
  151. package/nationalarchives/variables/_features.scss +1 -0
  152. package/nationalarchives/variables/_grid.scss +5 -5
  153. package/nationalarchives/variables/_index.scss +1 -0
  154. package/nationalarchives/variables/_media.scss +29 -29
  155. package/nationalarchives/variables/_typography.scss +15 -12
  156. package/package.json +15 -14
  157. package/nationalarchives/_features.scss +0 -1
  158. package/nationalarchives/assets/images/tna-horizontal-logo-inverted.svg +0 -51
  159. package/nationalarchives/assets/images/tna-horizontal-logo.svg +0 -51
  160. package/nationalarchives/stories/design/about.mdx +0 -25
  161. package/nationalarchives/stories/development/relationships.mdx +0 -57
  162. package/nationalarchives/stories/development/using.mdx +0 -75
@@ -1,5 +1,6 @@
1
1
  const argTypes = {
2
2
  items: { control: "object" },
3
+ plain: { control: "boolean" },
3
4
  };
4
5
 
5
6
  export default {
@@ -36,3 +37,95 @@ OrderedListPlain.args = {
36
37
  items: ["Alpha", "Beta", "Gamma"],
37
38
  plain: true,
38
39
  };
40
+
41
+ const DescriptionListTemplate = ({ items, plain }) =>
42
+ `<dl class="tna-dl${plain ? " tna-dl--plain" : ""}${
43
+ items.some((item) => item.icon) ? " tna-dl--icon-padding" : ""
44
+ }">${items.reduce(
45
+ (list, item) => `${list}
46
+ <dt>
47
+ ${item.icon ? `<i class="fa-solid fa-${item.icon}"></i>` : ""}
48
+ ${item.title}
49
+ </dt>
50
+ ${
51
+ Array.isArray(item.description)
52
+ ? item.description.reduce(
53
+ (descriptions, description) =>
54
+ `${descriptions}<dd>${description}</dd>`,
55
+ "",
56
+ )
57
+ : `<dd>${item.description}</dd>`
58
+ }`,
59
+ "",
60
+ )}
61
+ </dl>`;
62
+
63
+ export const DescriptionList = DescriptionListTemplate.bind({});
64
+ DescriptionList.args = {
65
+ items: [
66
+ { title: "Alpha", description: "Lorem ipsum" },
67
+ { title: "Beta", description: "Lorem ipsum" },
68
+ { title: "Gamma", description: "Lorem ipsum" },
69
+ { title: "Delta", description: "Lorem ipsum" },
70
+ { title: "Epsilon", description: "Lorem ipsum" },
71
+ { title: "Zeta", description: "Lorem ipsum" },
72
+ { title: "Eta", description: "Lorem ipsum" },
73
+ ],
74
+ };
75
+
76
+ export const PlainDescriptionList = DescriptionListTemplate.bind({});
77
+ PlainDescriptionList.args = {
78
+ items: [
79
+ { title: "Alpha", description: "Lorem ipsum" },
80
+ { title: "Beta", description: "Lorem ipsum" },
81
+ { title: "Gamma", description: "Lorem ipsum" },
82
+ { title: "Delta", description: "Lorem ipsum" },
83
+ ],
84
+ plain: true,
85
+ };
86
+
87
+ export const DescriptionListWithIcons = DescriptionListTemplate.bind({});
88
+ DescriptionListWithIcons.args = {
89
+ items: [
90
+ {
91
+ title: "Held by",
92
+ description: "The National Archives, Kew",
93
+ icon: "landmark",
94
+ },
95
+ { title: "Date", description: "1972&ndash;1979", icon: "calendar" },
96
+ { title: "Reference", description: "LC 4", icon: "database" },
97
+ ],
98
+ };
99
+
100
+ export const PlainDescriptionListWithIcons = DescriptionListTemplate.bind({});
101
+ PlainDescriptionListWithIcons.args = {
102
+ items: [
103
+ {
104
+ title: "Held by",
105
+ description: "The National Archives, Kew",
106
+ icon: "landmark",
107
+ },
108
+ { title: "Date", description: "1972&ndash;1979", icon: "calendar" },
109
+ { title: "Reference", description: "LC 4", icon: "database" },
110
+ ],
111
+ plain: true,
112
+ };
113
+
114
+ export const ComplexDescriptionList = DescriptionListTemplate.bind({});
115
+ ComplexDescriptionList.args = {
116
+ items: [
117
+ { title: "Alpha", description: "Lorem ipsum" },
118
+ { title: "Beta", description: "Lorem ipsum" },
119
+ {
120
+ title: "Gamma",
121
+ description: ["Lorem ipsum 1", "Lorem ipsum 2", "Lorem ipsum 3"],
122
+ },
123
+ {
124
+ title: "Delta",
125
+ description: ["Lorem ipsum 1", "Lorem ipsum 2", "Lorem ipsum 3"],
126
+ },
127
+ { title: "Epsilon", description: ["Lorem ipsum 1", "Lorem ipsum 2"] },
128
+ { title: "Zeta", description: "Lorem ipsum" },
129
+ { title: "Eta", description: ["Lorem ipsum 1", "Lorem ipsum 2"] },
130
+ ],
131
+ };
@@ -32,7 +32,17 @@ In the second example, the heading will be read as two separate sentences; `Reco
32
32
  <Canvas of={TypographyStories.Paragraph} />
33
33
  <Canvas of={TypographyStories.Blockquote} />
34
34
  <Canvas of={TypographyStories.SceneSetter} />
35
+
36
+ ## Lists
37
+
35
38
  <Canvas of={ListStories.UnorderedList} />
36
- <Canvas of={ListStories.UnorderedListPlain} />
37
39
  <Canvas of={ListStories.OrderedList} />
40
+ <Canvas of={ListStories.DescriptionList} />
41
+ <Canvas of={ListStories.DescriptionListWithIcons} />
42
+
43
+ ### Plain versions
44
+
45
+ <Canvas of={ListStories.UnorderedListPlain} />
38
46
  <Canvas of={ListStories.OrderedListPlain} />
47
+ <Canvas of={ListStories.PlainDescriptionList} />
48
+ <Canvas of={ListStories.PlainDescriptionListWithIcons} />
@@ -19,7 +19,7 @@ Paragraph.args = {
19
19
  };
20
20
 
21
21
  const HeadingLinkTemplate = ({ text, href }) =>
22
- `<h2 class="tna-heading">
22
+ `<h2 class="tna-heading-s">
23
23
  <a href="${href}">${text}</a>
24
24
  </h2>`;
25
25
  export const HeadingLink = HeadingLinkTemplate.bind({});
@@ -1,64 +1,17 @@
1
- {% from "../components/card/macro.njk" import tnaCard %}
1
+ {% from "nationalarchives/components/card/macro.njk" import tnaCard %}
2
2
 
3
- {% extends "./layouts/_prototype-kit.njk" %}
3
+ {% extends "nationalarchives/templates/layouts/_prototype-kit.njk" %}
4
4
 
5
- {% block pageTitle %}The National Archives | Welcome{% endblock %}
5
+ {% block pageTitle %}Welcome - The National Archives{% endblock %}
6
6
 
7
7
  {% block content %}
8
- <div class="tna-container">
9
- <div class="tna-column tna-column--full">
10
- <h1 class="tna-heading tna-heading--xl">
11
- Welcome
12
- </h1>
8
+ <div class="tna-section">
9
+ <div class="tna-container">
10
+ <div class="tna-column tna-column--full">
11
+ <h1 class="tna-heading-xl">
12
+ Welcome
13
+ </h1>
14
+ </div>
15
+ </div>
13
16
  </div>
14
- <div class="tna-column tna-column--full">
15
- {{ tnaCard({
16
- "heading": {
17
- "supertitle": "Card supertitle",
18
- "title": "Card title",
19
- "level": 2,
20
- "size": "m"
21
- },
22
- "href": "#",
23
- "image": {
24
- "src": "https://loremflickr.com/640/360",
25
- "alt": "A placeholder image"
26
- },
27
- "body": "<p>Card body</p>",
28
- "actions": [
29
- {
30
- "text": "Card action",
31
- "href": "#",
32
- "title": "Go and do the action"
33
- }
34
- ],
35
- "featured": true,
36
- "htmlElement": "article"
37
- }) }}
38
- </div>
39
- {% for item in range(0, 6) -%}
40
- <div class="tna-column tna-column--width-1-3 tna-column--width-1-2-medium tna-column--full-small tna-column--full-tiny">
41
- {{ tnaCard({
42
- "heading": {
43
- "supertitle": "Card supertitle",
44
- "title": "Card title",
45
- "level": 3
46
- },
47
- "href": "#",
48
- "image": {
49
- "src": "https://loremflickr.com/640/360",
50
- "alt": "A placeholder image"
51
- },
52
- "body": "<p>Card body</p>",
53
- "actions": [
54
- {
55
- "text": "Card action",
56
- "href": "#",
57
- "title": "Go and do the action"
58
- }
59
- ]
60
- }) }}
61
- </div>
62
- {%- endfor %}
63
- </div>
64
17
  {% endblock %}
@@ -1,8 +1,10 @@
1
1
  {# Based on https://github.com/alphagov/govuk-frontend/blob/8b6bf304b9fc891f64459c25a08f3d623f3fea72/packages/govuk-frontend/src/govuk/template.njk #}
2
2
  {% from "nationalarchives/components/cookie-banner/macro.njk" import tnaCookieBanner -%}
3
+ {% from "nationalarchives/components/footer/macro.njk" import tnaFooter -%}
4
+ {% from "nationalarchives/components/header/macro.njk" import tnaHeader -%}
3
5
  {% from "nationalarchives/components/skip-link/macro.njk" import tnaSkipLink -%}
4
6
  <!DOCTYPE html>
5
- <html lang="{{ htmlLang | default('en-GB') }}" class="tna-template {{ htmlClasses }}">
7
+ <html lang="{{ htmlLang | default('en-GB') }}" class="tna-template tna-template--{{ theme | default('system') }}-theme tna-template--{{ themeAccent | default('black') }}-accent {{ htmlClasses }}">
6
8
  <head>
7
9
  <meta charset="utf-8">
8
10
  <title>{% block pageTitle %}The National Archives{% endblock %}</title>
@@ -12,34 +14,38 @@
12
14
 
13
15
  {% block headIcons %}
14
16
  <link rel="shortcut icon" sizes="16x16 32x32 48x48" href="{{ assetPath | default('/assets') }}/images/favicon.ico" type="image/x-icon">
15
- <link rel="mask-icon" href="{{ assetPath | default('/assets') }}/images/govuk-mask-icon.svg" color="{{ themeColor | default('#0b0c0c') }}"> {# Hardcoded value of $govuk-black #}
16
- <link rel="apple-touch-icon" sizes="180x180" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-180x180.png">
17
- <link rel="apple-touch-icon" sizes="167x167" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-167x167.png">
18
- <link rel="apple-touch-icon" sizes="152x152" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon-152x152.png">
19
- <link rel="apple-touch-icon" href="{{ assetPath | default('/assets') }}/images/govuk-apple-touch-icon.png">
17
+ <link rel="mask-icon" href="{{ assetPath | default('/assets') }}/images/mask-icon.svg" color="{{ themeColor | default('#000000') }}">
18
+ <link rel="apple-touch-icon" sizes="180x180" href="{{ assetPath | default('/assets') }}/images/apple-touch-icon-180x180.png">
19
+ <link rel="apple-touch-icon" sizes="167x167" href="{{ assetPath | default('/assets') }}/images/apple-touch-icon-167x167.png">
20
+ <link rel="apple-touch-icon" sizes="152x152" href="{{ assetPath | default('/assets') }}/images/apple-touch-icon-152x152.png">
21
+ <link rel="apple-touch-icon" href="{{ assetPath | default('/assets') }}/images/apple-touch-icon.png">
20
22
  {% endblock %}
21
23
 
22
24
  {% block head %}{% endblock %}
23
25
 
24
- {% block stylesheets %}{% endblock %}
26
+ {% block stylesheets %}
27
+ <link rel="stylesheet" type="text/css" href="{{ tnaFrontendCssPath | default('/static/tna-frontend') }}/all.css">
28
+ {% endblock %}
25
29
  </head>
26
30
  <body class="tna-template__body {{ bodyClasses }}" {%- for attribute, value in bodyAttributes %} {{attribute}}="{{value}}"{% endfor %}>
27
31
  {% block bodyStart %}
28
32
  {% block cookies %}
29
- {{ tnaCookieBanner({
30
- url: '#'
31
- }) }}
33
+ {{ tnaCookieBanner({
34
+ url: '#'
35
+ }) }}
32
36
  {% endblock %}
33
37
 
34
38
  {% block skipLink %}
35
39
  {{ tnaSkipLink({
36
- href: '#main-content',
40
+ href: 'main-content',
37
41
  text: 'Skip to main content'
38
42
  }) }}
39
43
  {% endblock %}
40
44
  {% endblock %}
41
45
 
42
- {% block header %}{% endblock %}
46
+ {% block header %}
47
+ {{ tnaHeader({}) }}
48
+ {% endblock %}
43
49
 
44
50
  {% block main %}
45
51
  {% block beforeContent %}{% endblock %}
@@ -49,8 +55,19 @@
49
55
  {% block afterContent %}{% endblock %}
50
56
  {% endblock %}
51
57
 
52
- {% block footer %}{% endblock %}
58
+ {% block footer %}
59
+ {{ tnaFooter({}) }}
60
+ {% endblock %}
53
61
 
54
- {% block bodyEnd %}{% endblock %}
62
+ {% block bodyEnd %}
63
+ <script src="{{ tnaFrontendJsPath | default('/static/tna-frontend') }}/all.js"></script>
64
+ <script>
65
+ if (window.TNAFrontend && window.TNAFrontend.initAll) {
66
+ document.addEventListener("DOMContentLoaded", function() {
67
+ window.TNAFrontend.initAll();
68
+ });
69
+ }
70
+ </script>
71
+ {% endblock %}
55
72
  </body>
56
73
  </html>
@@ -3,3 +3,14 @@
3
3
  {% block stylesheets %}
4
4
  {% include "govuk-prototype-kit/includes/stylesheets-plugins.njk" %}
5
5
  {% endblock %}
6
+
7
+ {% block bodyEnd %}
8
+ {% include "govuk-prototype-kit/includes/scripts.njk" %}
9
+ <script>
10
+ if (window.TNAFrontend && window.TNAFrontend.initAll) {
11
+ document.addEventListener("DOMContentLoaded", function() {
12
+ window.TNAFrontend.initAll();
13
+ });
14
+ }
15
+ </script>
16
+ {% endblock %}
@@ -1,8 +1,8 @@
1
- {% from "../components/card/macro.njk" import tnaCard %}
1
+ {% from "nationalarchives/components/card/macro.njk" import tnaCard %}
2
2
 
3
- {% extends "./layouts/_prototype-kit.njk" %}
3
+ {% extends "nationalarchives/templates/layouts/_prototype-kit.njk" %}
4
4
 
5
- {% block pageTitle %}The National Archives | Results{% endblock %}
5
+ {% block pageTitle %}Search - The National Archives{% endblock %}
6
6
 
7
7
  {% block main %}
8
8
  <div class="tna-container">
@@ -12,24 +12,20 @@
12
12
  <main class="tna-main-wrapper tna-column tna-column--container tna-column--3-4 tna-column--width-2-3-medium tna-column--full-small tna-column--full-tiny {{ mainClasses }}" id="main-content" role="main"{% if mainLang %} lang="{{ mainLang }}"{% endif %}>
13
13
  {% block beforeContent %}{% endblock %}
14
14
  <div class="tna-column tna-column--full">
15
- <h1 class="tna-heading tna-heading--xl">
15
+ <h1 class="tna-heading-xl">
16
16
  Search results for "foobar"
17
17
  </h1>
18
18
  </div>
19
19
  {% for item in range(0, 6) -%}
20
20
  <div class="tna-column tna-column--width-1-2 tna-column--width-full-small tna-column--width-full-tiny">
21
21
  {{ tnaCard({
22
- "heading": {
23
- "supertitle": "Card supertitle",
24
- "title": "Card title",
25
- "level": 2
26
- },
27
- "href": "#",
28
- "image": {
29
- "src": "https://loremflickr.com/640/360",
30
- "alt": "A placeholder image"
31
- },
32
- "body": "<p>Card body</p>",
22
+ supertitle: "Card supertitle",
23
+ title: "Card title",
24
+ headingLevel: 2,
25
+ href: "#",
26
+ imageSrc: "https://loremflickr.com/640/360",
27
+ imageAlt: "A placeholder image",
28
+ body: "<p>Card body</p>"
33
29
  }) }}
34
30
  </div>
35
31
  {%- endfor %}
@@ -1,19 +1,19 @@
1
- {% from "../components/card/macro.njk" import tnaCard %}
2
- {% from "../components/hero/macro.njk" import tnaHero %}
1
+ {% from "nationalarchives/components/card/macro.njk" import tnaCard %}
2
+ {% from "nationalarchives/components/hero/macro.njk" import tnaHero %}
3
3
 
4
- {% extends "./layouts/_prototype-kit.njk" %}
4
+ {% extends "nationalarchives/templates/layouts/_prototype-kit.njk" %}
5
5
 
6
- {% block pageTitle %}The National Archives | Topics{% endblock %}
6
+ {% block pageTitle %}Topics - The National Archives{% endblock %}
7
7
 
8
8
  {% block main %}
9
9
  <main class="tna-main-wrapper">
10
10
  {{ tnaHero({
11
- "heading": "Title",
12
- "body": "<p>Body</p>",
13
- "image": {
14
- "src": "https://picsum.photos/id/29/640/360",
15
- "alt": "A placeholder image",
16
- "information": "Photo of some mountains by a famous photographer, ©2012"
11
+ heading: "Title",
12
+ body: "<p>Body</p>",
13
+ image: {
14
+ src: "https://picsum.photos/id/29/640/360",
15
+ alt: "A placeholder image",
16
+ information: "Photo of some mountains by a famous photographer, ©2012"
17
17
  }
18
18
  }) }}
19
19
  <div class="tna-container">
@@ -23,18 +23,14 @@
23
23
  {% for item in range(0, 6) -%}
24
24
  <div class="tna-column tna-column--width-1-3 tna-column--width-1-2-medium tna-column--width-full-small tna-column--width-full-tiny">
25
25
  {{ tnaCard({
26
- "heading": {
27
- "supertitle": "Card supertitle",
28
- "title": "Card title",
29
- "level": 3
30
- },
31
- "href": "#",
32
- "image": {
33
- "src": "https://loremflickr.com/640/360",
34
- "alt": "A placeholder image"
35
- },
36
- "body": "<p>Card body</p>",
37
- }) }}
26
+ supertitle: "Card supertitle",
27
+ title: "Card title",
28
+ headingLevel: 2,
29
+ href: "#",
30
+ imageSrc: "https://loremflickr.com/640/360",
31
+ imageAlt: "A placeholder image",
32
+ body: "<p>Card body</p>"
33
+ }) }}
38
34
  </div>
39
35
  {%- endfor %}
40
36
  </div>
@@ -1,10 +1,9 @@
1
1
  @use "sass:map";
2
- @use "../features";
3
2
  @use "../variables/colour";
4
3
  @use "../tools/media";
5
4
 
6
- @function brand-colour($colour) {
7
- @return map.get(colour.$colour-palette-brand, $colour);
5
+ @function brand-colour($colour, $opacity: 1) {
6
+ @return colour.brand-colour($colour, $opacity);
8
7
  }
9
8
 
10
9
  @mixin colour-css-vars() {
@@ -38,20 +37,22 @@
38
37
  --accent-background-light: #{brand-colour("cream")} !important;
39
38
  --accent-font-base: #{brand-colour("black")} !important;
40
39
  --accent-font-dark: #{brand-colour("black")} !important;
41
- --accent-font-light: #{rgba(brand-colour("black"), 0.7)} !important;
40
+ --accent-font-light: #{brand-colour("black", 0.7)} !important;
41
+ --accent-icon-light: #{brand-colour("black", 0.45)} !important;
42
42
  --accent-link: #{brand-colour("black")} !important;
43
43
  --accent-link-visited: #{brand-colour("black")} !important;
44
- --accent-keyline: #{rgba(brand-colour("black"), 0.5)} !important;
45
- --accent-keyline-dark: #{rgba(brand-colour("black"), 0.8)} !important;
44
+ --accent-keyline: #{brand-colour("black", 0.5)} !important;
45
+ --accent-keyline-dark: #{brand-colour("black", 0.8)} !important;
46
46
  --button-accent-background: #{brand-colour("yellow")} !important;
47
47
  } @else {
48
48
  --accent-font-base: #{brand-colour("white")} !important;
49
49
  --accent-font-dark: #{brand-colour("white")} !important;
50
- --accent-font-light: #{rgba(brand-colour("white"), 0.7)} !important;
50
+ --accent-font-light: #{brand-colour("white", 0.7)} !important;
51
+ --accent-icon-light: #{brand-colour("white", 0.45)} !important;
51
52
  --accent-link: #{brand-colour("white")} !important;
52
53
  --accent-link-visited: #{brand-colour("white")} !important;
53
- --accent-keyline: #{rgba(brand-colour("white"), 0.5)} !important;
54
- --accent-keyline-dark: #{rgba(brand-colour("white"), 0.8)} !important;
54
+ --accent-keyline: #{brand-colour("white", 0.5)} !important;
55
+ --accent-keyline-dark: #{brand-colour("white", 0.8)} !important;
55
56
 
56
57
  @if $colour == "black" {
57
58
  // --accent: #{brand-colour("light-grey")} !important;
@@ -143,10 +144,18 @@
143
144
  }
144
145
  }
145
146
 
146
- @mixin colour-outline($colour, $important: false) {
147
- outline-color: map.get(colour.$colour-palette-default, $colour)
148
- if($important, !important, null);
149
- outline-color: var(--#{$colour}) if($important, !important, null);
147
+ @mixin colour-outline($colour, $width: "", $style: solid, $important: false) {
148
+ @if $width != "" {
149
+ outline: $width
150
+ map.get(colour.$colour-palette-default, $colour)
151
+ $style
152
+ if($important, !important, null);
153
+ outline: $width var(--#{$colour}) $style if($important, !important, null);
154
+ } @else {
155
+ outline-color: map.get(colour.$colour-palette-default, $colour)
156
+ if($important, !important, null);
157
+ outline-color: var(--#{$colour}) if($important, !important, null);
158
+ }
150
159
  }
151
160
 
152
161
  @mixin colour-fill($colour, $important: false) {
@@ -155,20 +164,52 @@
155
164
  fill: var(--#{$colour}) if($important, !important, null);
156
165
  }
157
166
 
158
- %fixed {
159
- @include colour-css-vars;
167
+ %plain {
168
+ .tna-template--system-theme & {
169
+ @include colour-css-vars;
170
+
171
+ @media (prefers-color-scheme: dark) {
172
+ @include colour-css-vars-dark;
173
+ }
174
+
175
+ @media (prefers-contrast: more) {
176
+ @include colour-css-vars-high-contrast;
177
+ }
178
+
179
+ @media (prefers-contrast: more) and (prefers-color-scheme: dark) {
180
+ @include colour-css-vars-high-contrast-dark;
181
+ }
182
+ }
183
+
184
+ .tna-template--light-theme & {
185
+ @include colour-css-vars;
186
+ }
187
+
188
+ .tna-template--dark-theme & {
189
+ @include colour-css-vars-dark;
190
+ }
191
+
192
+ .tna-template--high-contrast-theme & {
193
+ @include colour-css-vars-high-contrast;
194
+ }
195
+
196
+ .tna-template--high-contrast-theme.tna-template--dark-theme & {
197
+ @include colour-css-vars-high-contrast-dark;
198
+ }
160
199
 
161
- @include colour-font("font-base");
200
+ --background: var(--page-background);
162
201
  }
163
202
 
164
- @mixin fixed {
165
- @extend %fixed;
203
+ @mixin plain {
204
+ @extend %plain;
166
205
  }
167
206
 
168
207
  %invert {
208
+ --background: var(--contrast-background);
169
209
  --font-base: var(--contrast-font-base);
170
210
  --font-dark: var(--contrast-font-dark);
171
211
  --font-light: var(--contrast-font-light);
212
+ --icon-light: var(--contrast-icon-light);
172
213
  --link: var(--contrast-link);
173
214
  --link-visited: var(--contrast-link-visited);
174
215
  --keyline: var(--contrast-keyline);
@@ -178,7 +219,7 @@
178
219
  --button-hover-text: var(--contrast-button-hover-text);
179
220
  --button-hover-background: var(--contrast-button-hover-background);
180
221
 
181
- @include colour-background("contrast-background");
222
+ @include colour-background("background");
182
223
 
183
224
  @include colour-font("font-base", false, colour.$colour-palette-dark);
184
225
  }
@@ -189,9 +230,11 @@
189
230
 
190
231
  %invert-on-mobile {
191
232
  @include media.on-mobile {
233
+ --background: var(--contrast-background);
192
234
  --font-base: var(--contrast-font-base);
193
235
  --font-dark: var(--contrast-font-dark);
194
236
  --font-light: var(--contrast-font-light);
237
+ --icon-light: var(--contrast-icon-light);
195
238
  --link: var(--contrast-link);
196
239
  --link-visited: var(--contrast-link-visited);
197
240
  --keyline: var(--contrast-keyline);
@@ -201,7 +244,7 @@
201
244
  --button-hover-text: var(--contrast-button-hover-text);
202
245
  --button-hover-background: var(--contrast-button-hover-background);
203
246
 
204
- @include colour-background("contrast-background");
247
+ @include colour-background("background");
205
248
 
206
249
  @include colour-font("font-base", false, colour.$colour-palette-dark);
207
250
  }
@@ -212,15 +255,17 @@
212
255
  }
213
256
 
214
257
  %accent {
258
+ --background: var(--accent-background);
215
259
  --font-base: var(--accent-font-base);
216
260
  --font-dark: var(--accent-font-dark);
217
261
  --font-light: var(--accent-font-light);
262
+ --icon-light: var(--accent-icon-light);
218
263
  --link: var(--accent-link);
219
264
  --link-visited: var(--accent-link-visited);
220
265
  --keyline: var(--accent-keyline);
221
266
  --keyline-dark: var(--accent-keyline-dark);
222
267
 
223
- @include colour-background("accent-background");
268
+ @include colour-background("background");
224
269
 
225
270
  @include colour-font("font-base", false, colour.$colour-palette-dark);
226
271
  }
@@ -229,6 +274,14 @@
229
274
  @extend %accent;
230
275
  }
231
276
 
277
+ %tint-background {
278
+ @include colour-background("background-tint");
279
+ }
280
+
281
+ @mixin tint-background {
282
+ @extend %tint-background;
283
+ }
284
+
232
285
  %accent-background {
233
286
  @include colour-background("accent-background");
234
287
  }
@@ -238,8 +291,7 @@
238
291
  }
239
292
 
240
293
  %light-accent-background {
241
- @include colour-background("accent-background-light");
242
-
294
+ --background: var(--accent-background-light);
243
295
  --font-base: #{map.get(colour.$colour-palette-default, "font-base")};
244
296
  --font-dark: #{map.get(colour.$colour-palette-default, "font-dark")};
245
297
  --font-light: #{map.get(colour.$colour-palette-default, "font-light")};
@@ -260,6 +312,8 @@
260
312
  colour.$colour-palette-default,
261
313
  "button-hover-background"
262
314
  )};
315
+
316
+ @include colour-background("background");
263
317
  }
264
318
 
265
319
  @mixin light-accent-background {
@@ -24,13 +24,13 @@
24
24
  flex: none;
25
25
  }
26
26
 
27
- // .column--margin-right-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
28
- // margin-right: math.div(100%, $count) * $i;
29
- // }
27
+ &--margin-right-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
28
+ margin-right: math.div(100%, $count) * $i;
29
+ }
30
30
 
31
- // .column--margin-left-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
32
- // margin-left: math.div(100%, $count) * $i;
33
- // }
31
+ &--margin-left-#{math.div($i, $j)}-#{math.div($count, $j)}#{$suffix} {
32
+ margin-left: math.div(100%, $count) * $i;
33
+ }
34
34
 
35
35
  $simplest-fraction-found: true;
36
36
  }
@@ -42,13 +42,13 @@
42
42
  flex: none;
43
43
  }
44
44
 
45
- // .column--margin-right-#{$i}-#{$count}#{$suffix} {
46
- // margin-right: math.div(100%, $count) * $i;
47
- // }
45
+ &--margin-right-#{$i}-#{$count}#{$suffix} {
46
+ margin-right: math.div(100%, $count) * $i;
47
+ }
48
48
 
49
- // .column--margin-left-#{$i}-#{$count}#{$suffix} {
50
- // margin-left: math.div(100%, $count) * $i;
51
- // }
49
+ &--margin-left-#{$i}-#{$count}#{$suffix} {
50
+ margin-left: math.div(100%, $count) * $i;
51
+ }
52
52
  }
53
53
  }
54
54
 
@@ -61,3 +61,9 @@
61
61
  @content;
62
62
  }
63
63
  }
64
+
65
+ @mixin on-print() {
66
+ @media print {
67
+ @content;
68
+ }
69
+ }