@nationalarchives/frontend 0.1.9-prerelease → 0.1.10-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 (57) hide show
  1. package/README.md +2 -2
  2. package/nationalarchives/_features.scss +1 -0
  3. package/nationalarchives/all.css +1 -1
  4. package/nationalarchives/all.css.map +1 -1
  5. package/nationalarchives/all.js +1 -1
  6. package/nationalarchives/all.js.map +1 -1
  7. package/nationalarchives/all.mjs +37 -2
  8. package/nationalarchives/assets/images/footer/facebook.svg +11 -0
  9. package/nationalarchives/assets/images/footer/flickr.svg +11 -0
  10. package/nationalarchives/assets/images/footer/instagram.svg +17 -0
  11. package/nationalarchives/assets/images/footer/rss.svg +13 -0
  12. package/nationalarchives/assets/images/footer/twitter.svg +14 -0
  13. package/nationalarchives/assets/images/footer/youtube.svg +12 -0
  14. package/nationalarchives/components/_all.scss +3 -0
  15. package/nationalarchives/components/breadcrumbs/_index.scss +2 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +1 -2
  17. package/nationalarchives/components/button/button.stories.js +1 -2
  18. package/nationalarchives/components/card/card.stories.js +1 -2
  19. package/nationalarchives/components/filters/filters.stories.js +1 -2
  20. package/nationalarchives/components/footer/_index.scss +46 -3
  21. package/nationalarchives/components/footer/fixtures.json +1 -1
  22. package/nationalarchives/components/footer/footer.stories.js +21 -24
  23. package/nationalarchives/components/footer/macro-options.json +12 -6
  24. package/nationalarchives/components/footer/template.njk +23 -13
  25. package/nationalarchives/components/grid/grid.stories.js +2 -3
  26. package/nationalarchives/components/header/_index.scss +180 -36
  27. package/nationalarchives/components/header/header.js +1 -1
  28. package/nationalarchives/components/header/header.js.map +1 -1
  29. package/nationalarchives/components/header/header.mjs +6 -0
  30. package/nationalarchives/components/header/header.stories.js +14 -5
  31. package/nationalarchives/components/header/macro-options.json +57 -5
  32. package/nationalarchives/components/header/template.njk +20 -8
  33. package/nationalarchives/components/hero/_index.scss +3 -0
  34. package/nationalarchives/components/hero/hero.stories.js +15 -13
  35. package/nationalarchives/components/hero/macro-options.json +1 -1
  36. package/nationalarchives/components/phase-banner/_index.scss +43 -0
  37. package/nationalarchives/components/phase-banner/fixtures.json +14 -0
  38. package/nationalarchives/components/phase-banner/macro-options.json +26 -0
  39. package/nationalarchives/components/phase-banner/macro.njk +3 -0
  40. package/nationalarchives/components/phase-banner/phase-banner.stories.js +38 -0
  41. package/nationalarchives/components/phase-banner/template.njk +16 -0
  42. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +1 -2
  43. package/nationalarchives/stories/development/contributing.mdx +38 -0
  44. package/nationalarchives/stories/development/dependencies.mdx +2 -0
  45. package/nationalarchives/stories/development/technologies.mdx +65 -0
  46. package/nationalarchives/templates/layouts/_generic.njk +1 -1
  47. package/nationalarchives/tools/_all.scss +1 -0
  48. package/nationalarchives/tools/_assets.scss +5 -0
  49. package/nationalarchives/tools/_media.scss +12 -11
  50. package/nationalarchives/utilities/_global.scss +95 -2
  51. package/nationalarchives/utilities/_typography.scss +109 -97
  52. package/nationalarchives/variables/_all.scss +1 -0
  53. package/nationalarchives/variables/_assets.scss +1 -0
  54. package/nationalarchives/variables/_colour.scss +88 -4
  55. package/nationalarchives/variables/_media.scss +39 -11
  56. package/package.json +15 -13
  57. package/nationalarchives/stories/development/structure.mdx +0 -7
@@ -1,8 +1,9 @@
1
1
  import Footer from "./template.njk";
2
- import "./_index.scss";
3
2
  import macroOptions from "./macro-options.json";
4
3
 
5
4
  const argTypes = {
5
+ title: { control: "text" },
6
+ address: { control: "text" },
6
7
  navigation: { control: "object" },
7
8
  social: { control: "object" },
8
9
  classes: { control: "text" },
@@ -16,13 +17,22 @@ Object.keys(argTypes).forEach((argType) => {
16
17
  });
17
18
 
18
19
  export default {
19
- title: "Components/Footer",
20
+ title: "Components/Work in progress/Footer",
20
21
  argTypes,
21
22
  };
22
23
 
23
- const Template = ({ navigation, social, classes, attributes }) => {
24
+ const Template = ({
25
+ title,
26
+ address,
27
+ navigation,
28
+ social,
29
+ classes,
30
+ attributes,
31
+ }) => {
24
32
  return Footer({
25
33
  params: {
34
+ title,
35
+ address,
26
36
  navigation,
27
37
  social,
28
38
  classes,
@@ -33,6 +43,8 @@ const Template = ({ navigation, social, classes, attributes }) => {
33
43
 
34
44
  export const Standard = Template.bind({});
35
45
  Standard.args = {
46
+ title: "The National Archives",
47
+ address: "Kew, Richmond TW9 4DU",
36
48
  navigation: [
37
49
  {
38
50
  title: "Find out more",
@@ -143,47 +155,32 @@ Standard.args = {
143
155
  {
144
156
  text: "Twitter",
145
157
  href: "#",
146
- imageSrc:
147
- "https://upload.wikimedia.org/wikipedia/commons/6/6f/Logo_of_Twitter.svg",
158
+ image: "/images/footer/twitter.svg",
148
159
  },
149
160
  {
150
161
  text: "YouTube",
151
162
  href: "#",
152
- image: `<svg viewBox="409.289 277.787 512 114.301" width="512" height="114.301" xmlns="http://www.w3.org/2000/svg">
153
- <g viewBox="0 0 90 20" preserveAspectRatio="xMidYMid meet" class="style-scope yt-icon" transform="matrix(5.715038, 0, 0, 5.715038, 409.288757, 277.787231)">
154
- <g class="style-scope yt-icon">
155
- <path d="M27.9727 3.12324C27.6435 1.89323 26.6768 0.926623 25.4468 0.597366C23.2197 2.24288e-07 14.285 0 14.285 0C14.285 0 5.35042 2.24288e-07 3.12323 0.597366C1.89323 0.926623 0.926623 1.89323 0.597366 3.12324C2.24288e-07 5.35042 0 10 0 10C0 10 2.24288e-07 14.6496 0.597366 16.8768C0.926623 18.1068 1.89323 19.0734 3.12323 19.4026C5.35042 20 14.285 20 14.285 20C14.285 20 23.2197 20 25.4468 19.4026C26.6768 19.0734 27.6435 18.1068 27.9727 16.8768C28.5701 14.6496 28.5701 10 28.5701 10C28.5701 10 28.5677 5.35042 27.9727 3.12324Z" class="style-scope yt-icon" fill="#FF0000"/>
156
- <path d="M11.4253 14.2854L18.8477 10.0004L11.4253 5.71533V14.2854Z" class="style-scope yt-icon" fill="white"/>
157
- </g>
158
- <g class="style-scope yt-icon">
159
- <g id="youtube-paths" class="style-scope yt-icon">
160
- <path d="M34.6024 13.0036L31.3945 1.41846H34.1932L35.3174 6.6701C35.6043 7.96361 35.8136 9.06662 35.95 9.97913H36.0323C36.1264 9.32532 36.3381 8.22937 36.665 6.68892L37.8291 1.41846H40.6278L37.3799 13.0036V18.561H34.6001V13.0036H34.6024Z" class="style-scope yt-icon" style="fill: rgb(40, 40, 40);"/>
161
- <path d="M41.4697 18.1937C40.9053 17.8127 40.5031 17.22 40.2632 16.4157C40.0257 15.6114 39.9058 14.5437 39.9058 13.2078V11.3898C39.9058 10.0422 40.0422 8.95805 40.315 8.14196C40.5878 7.32588 41.0135 6.72851 41.592 6.35457C42.1706 5.98063 42.9302 5.79248 43.871 5.79248C44.7976 5.79248 45.5384 5.98298 46.0981 6.36398C46.6555 6.74497 47.0647 7.34234 47.3234 8.15137C47.5821 8.96275 47.7115 10.0422 47.7115 11.3898V13.2078C47.7115 14.5437 47.5845 15.6161 47.3329 16.4251C47.0812 17.2365 46.672 17.8292 46.1075 18.2031C45.5431 18.5771 44.7764 18.7652 43.8098 18.7652C42.8126 18.7675 42.0342 18.5747 41.4697 18.1937ZM44.6353 16.2323C44.7905 15.8231 44.8705 15.1575 44.8705 14.2309V10.3292C44.8705 9.43077 44.7929 8.77225 44.6353 8.35833C44.4777 7.94206 44.2026 7.7351 43.8074 7.7351C43.4265 7.7351 43.156 7.94206 43.0008 8.35833C42.8432 8.77461 42.7656 9.43077 42.7656 10.3292V14.2309C42.7656 15.1575 42.8408 15.8254 42.9914 16.2323C43.1419 16.6415 43.4123 16.8461 43.8074 16.8461C44.2026 16.8461 44.4777 16.6415 44.6353 16.2323Z" class="style-scope yt-icon" style="fill: rgb(40, 40, 40);"/>
162
- <path d="M56.8154 18.5634H54.6094L54.3648 17.03H54.3037C53.7039 18.1871 52.8055 18.7656 51.6061 18.7656C50.7759 18.7656 50.1621 18.4928 49.767 17.9496C49.3719 17.4039 49.1743 16.5526 49.1743 15.3955V6.03751H51.9942V15.2308C51.9942 15.7906 52.0553 16.188 52.1776 16.4256C52.2999 16.6631 52.5045 16.783 52.7914 16.783C53.036 16.783 53.2712 16.7078 53.497 16.5573C53.7228 16.4067 53.8874 16.2162 53.9979 15.9858V6.03516H56.8154V18.5634Z" class="style-scope yt-icon" style="fill: rgb(40, 40, 40);"/>
163
- <path d="M64.4755 3.68758H61.6768V18.5629H58.9181V3.68758H56.1194V1.42041H64.4755V3.68758Z" class="style-scope yt-icon" style="fill: rgb(40, 40, 40);"/>
164
- <path d="M71.2768 18.5634H69.0708L68.8262 17.03H68.7651C68.1654 18.1871 67.267 18.7656 66.0675 18.7656C65.2373 18.7656 64.6235 18.4928 64.2284 17.9496C63.8333 17.4039 63.6357 16.5526 63.6357 15.3955V6.03751H66.4556V15.2308C66.4556 15.7906 66.5167 16.188 66.639 16.4256C66.7613 16.6631 66.9659 16.783 67.2529 16.783C67.4974 16.783 67.7326 16.7078 67.9584 16.5573C68.1842 16.4067 68.3488 16.2162 68.4593 15.9858V6.03516H71.2768V18.5634Z" class="style-scope yt-icon" style="fill: rgb(40, 40, 40);"/>
165
- <path d="M80.609 8.0387C80.4373 7.24849 80.1621 6.67699 79.7812 6.32186C79.4002 5.96674 78.8757 5.79035 78.2078 5.79035C77.6904 5.79035 77.2059 5.93616 76.7567 6.23014C76.3075 6.52412 75.9594 6.90747 75.7148 7.38489H75.6937V0.785645H72.9773V18.5608H75.3056L75.5925 17.3755H75.6537C75.8724 17.7988 76.1993 18.1304 76.6344 18.3774C77.0695 18.622 77.554 18.7443 78.0855 18.7443C79.038 18.7443 79.7412 18.3045 80.1904 17.4272C80.6396 16.5476 80.8653 15.1765 80.8653 13.3092V11.3266C80.8653 9.92722 80.7783 8.82892 80.609 8.0387ZM78.0243 13.1492C78.0243 14.0617 77.9867 14.7767 77.9114 15.2941C77.8362 15.8115 77.7115 16.1808 77.5328 16.3971C77.3564 16.6158 77.1165 16.724 76.8178 16.724C76.585 16.724 76.371 16.6699 76.1734 16.5594C75.9759 16.4512 75.816 16.2866 75.6937 16.0702V8.96062C75.7877 8.6196 75.9524 8.34209 76.1852 8.12337C76.4157 7.90465 76.6697 7.79646 76.9401 7.79646C77.2271 7.79646 77.4481 7.90935 77.6034 8.13278C77.7609 8.35855 77.8691 8.73485 77.9303 9.26636C77.9914 9.79787 78.022 10.5528 78.022 11.5335V13.1492H78.0243Z" class="style-scope yt-icon" style="fill: rgb(40, 40, 40);"/>
166
- <path d="M84.8657 13.8712C84.8657 14.6755 84.8892 15.2776 84.9363 15.6798C84.9833 16.0819 85.0821 16.3736 85.2326 16.5594C85.3831 16.7428 85.6136 16.8345 85.9264 16.8345C86.3474 16.8345 86.639 16.6699 86.7942 16.343C86.9518 16.0161 87.0365 15.4705 87.0506 14.7085L89.4824 14.8519C89.4965 14.9601 89.5035 15.1106 89.5035 15.3011C89.5035 16.4582 89.186 17.3237 88.5534 17.8952C87.9208 18.4667 87.0247 18.7536 85.8676 18.7536C84.4777 18.7536 83.504 18.3185 82.9466 17.446C82.3869 16.5735 82.1094 15.2259 82.1094 13.4008V11.2136C82.1094 9.33452 82.3987 7.96105 82.9772 7.09558C83.5558 6.2301 84.5459 5.79736 85.9499 5.79736C86.9165 5.79736 87.6597 5.97375 88.1771 6.32888C88.6945 6.684 89.059 7.23433 89.2707 7.98457C89.4824 8.7348 89.5882 9.76961 89.5882 11.0913V13.2362H84.8657V13.8712ZM85.2232 7.96811C85.0797 8.14449 84.9857 8.43377 84.9363 8.83593C84.8892 9.2381 84.8657 9.84722 84.8657 10.6657V11.5641H86.9283V10.6657C86.9283 9.86133 86.9001 9.25221 86.846 8.83593C86.7919 8.41966 86.6931 8.12803 86.5496 7.95635C86.4062 7.78702 86.1851 7.7 85.8864 7.7C85.5854 7.70235 85.3643 7.79172 85.2232 7.96811Z" class="style-scope yt-icon" style="fill: rgb(40, 40, 40);"/>
167
- </g>
168
- </g>
169
- </g>
170
- </svg>`,
163
+ image: "/images/footer/youtube.svg",
171
164
  },
172
165
  {
173
166
  text: "Flickr",
174
167
  href: "#",
168
+ image: "/images/footer/flickr.svg",
175
169
  },
176
170
  {
177
171
  text: "Facebook",
178
172
  href: "#",
173
+ image: "/images/footer/facebook.svg",
179
174
  },
180
175
  {
181
176
  text: "Instagram",
182
177
  href: "#",
178
+ image: "/images/footer/instagram.svg",
183
179
  },
184
180
  {
185
181
  text: "RSS",
186
182
  href: "#",
183
+ image: "/images/footer/rss.svg",
187
184
  },
188
185
  ],
189
186
  classes: "tna-footer--demo",
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "name": "title",
4
+ "type": "text",
5
+ "required": false,
6
+ "description": ""
7
+ },
8
+ {
9
+ "name": "address",
10
+ "type": "text",
11
+ "required": false,
12
+ "description": ""
13
+ },
2
14
  {
3
15
  "name": "navigation",
4
16
  "type": "array",
@@ -40,12 +52,6 @@
40
52
  "type": "string",
41
53
  "required": false,
42
54
  "description": ""
43
- },
44
- {
45
- "name": "imageSrc",
46
- "type": "string",
47
- "required": false,
48
- "description": ""
49
55
  }
50
56
  ]
51
57
  }
@@ -1,10 +1,26 @@
1
1
  {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
2
  <footer class="tna-footer {{ containerClasses | join(' ') }}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
3
- {%- if params.navigation -%}
3
+ {%- if params.title or params.address -%}
4
+ <div class="tna-container tna-footer__top">
5
+ <div class="tna-column tna-column--full">
6
+ {%- if params.title -%}
7
+ <h2 class="tna-heading tna-heading--l tna-footer__title">
8
+ {{ params.title }}
9
+ </h2>
10
+ {%- endif -%}
11
+ {%- if params.address -%}
12
+ <address class="tna-footer__address">
13
+ {{ params.address }}
14
+ </address>
15
+ {%- endif -%}
16
+ </div>
17
+ </div>
18
+ {%- endif -%}
19
+ {%- if params.navigation -%}
4
20
  <div class="tna-container tna-footer__navigation">
5
21
  {%- for group in params.navigation -%}
6
22
  <nav class="tna-column tna-column--flex-1 tna-column--width-1-2-small tna-column--full-tiny tna-footer__navigation-group" aria-label="{{ group.title }}">
7
- <h4 class="tna-footer__navigation-group-title">{{ group.title }}</h4>
23
+ <h3 class="tna-heading tna-heading--m tna-footer__navigation-group-title">{{ group.title }}</h3>
8
24
  <ul class="tna-footer__navigation-group-items">
9
25
  {%- for item in group.items -%}
10
26
  <li class="tna-footer__navigation-group-item">
@@ -19,25 +35,19 @@
19
35
  {%- if params.social -%}
20
36
  <nav class="tna-container tna-footer__social" aria-label="Social links">
21
37
  {%- for item in params.social -%}
22
- <div class="tna-column tna-column--flex-1 tna-footer__social-item">
38
+ <div class="tna-column tna-column--width-1-4-small tna-column--width-1-2-tiny tna-footer__social-item">
23
39
  <a href="{{ item.href }}" class="tna-footer__social-item-link tna-footer__link" {%- if item.title %}title="{{ item.title }}"{% endif %}>
24
40
  {%- if item.image -%}
25
- <span class="tna-footer__social-item-link-image">
26
- {{ item.image | safe }}
27
- </span>
28
- {%- elif item.imageSrc -%}
29
- <span class="tna-footer__social-item-link-image">
30
- <image src="{{ item.imageSrc }}" alt="" />
31
- </span>
41
+ <img class="tna-footer__social-item-link-image" src="{{ item.image }}" alt="" />
32
42
  {%- endif -%}
33
43
  {{ item.text }}
34
44
  </a>
35
45
  </div>
36
46
  {%- endfor -%}
37
47
  </nav>
38
- {%- endif -%}
48
+ {%- endif -%}
39
49
  <div class="tna-container tna-footer__licence">
40
- <div class="tna-column">
50
+ <div class="tna-column tna-column--full-tiny">
41
51
  <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">
42
52
  <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>
43
53
  </svg>
@@ -45,7 +55,7 @@
45
55
  <div class="tna-column tna-column--flex-1">
46
56
  <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>
47
57
  </div>
48
- <div class="tna-column">
58
+ <div class="tna-column tna-column--full-tiny tna-footer__govuk">
49
59
  <a href="#" class="tna-footer__govuk-link">
50
60
  <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">
51
61
  <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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.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>
@@ -1,5 +1,4 @@
1
1
  import Header from "./template.njk";
2
- import "./_index.scss";
3
2
  import macroOptions from "./macro-options.json";
4
3
 
5
4
  const argTypes = {
@@ -47,7 +46,7 @@ const Template = ({
47
46
 
48
47
  export const Standard = Template.bind({});
49
48
  Standard.args = {
50
- classes: "tna-container--demo",
49
+ classes: "tna-grid--demo",
51
50
  columns: [
52
51
  {
53
52
  html: "<p>Full width</p>",
@@ -189,6 +188,6 @@ const responsiveColumn = {
189
188
  widthTiny: "full",
190
189
  };
191
190
  Responsive.args = {
192
- classes: "tna-container--demo",
191
+ classes: "tna-grid--demo",
193
192
  columns: Array(12).fill({ ...responsiveColumn }),
194
193
  };
@@ -3,12 +3,91 @@
3
3
  @use "../../variables/grid";
4
4
  @use "../../variables/typography";
5
5
  @use "../../tools/media";
6
+ @use "../../tools/typography" as tools;
6
7
 
7
8
  .tna-header {
8
9
  color: #fff;
9
10
 
10
11
  background-color: colour.$tna-black;
11
12
 
13
+ &__exit {
14
+ padding-top: 0.5rem;
15
+ padding-bottom: 0.5rem;
16
+
17
+ text-align: right;
18
+
19
+ background-color: colour.$dark;
20
+ }
21
+
22
+ &__exit-link {
23
+ color: #fff;
24
+ text-decoration: none;
25
+
26
+ &:hover {
27
+ text-decoration: underline;
28
+
29
+ // .tna-header__exit-link-icon {
30
+ // border-color: colour.$tna-yellow;
31
+
32
+ // &::before {
33
+ // border-top-color: colour.$tna-yellow;
34
+ // border-right-color: colour.$tna-yellow;
35
+ // }
36
+
37
+ // &::after {
38
+ // background-color: colour.$tna-yellow;
39
+ // }
40
+ // }
41
+ }
42
+ }
43
+
44
+ &__exit-link-icon {
45
+ width: 0.825rem;
46
+ height: 0.825rem;
47
+ margin-right: 0.125rem;
48
+ margin-left: 0.5rem;
49
+
50
+ display: inline-block;
51
+
52
+ position: relative;
53
+
54
+ vertical-align: middle;
55
+
56
+ border: 0.125rem #fff solid;
57
+
58
+ &::before {
59
+ position: absolute;
60
+ top: -0.25rem;
61
+ right: -0.25rem;
62
+ z-index: 2;
63
+
64
+ border: 0.25rem transparent solid;
65
+ border-top-color: #fff;
66
+ border-right-color: #fff;
67
+
68
+ content: "";
69
+ }
70
+
71
+ &::after {
72
+ width: 0.25rem;
73
+ height: 0.825rem;
74
+
75
+ position: absolute;
76
+ top: -0.125rem;
77
+ right: -0.125rem;
78
+ z-index: 1;
79
+
80
+ background-color: #fff;
81
+
82
+ outline: 0.2rem colour.$dark solid;
83
+
84
+ transform: rotate(45deg) translateX(50%);
85
+ transform-origin: 100% 0;
86
+
87
+ content: "";
88
+ }
89
+ }
90
+
12
91
  &__contents {
13
92
  &.tna-container {
14
93
  justify-content: space-between;
@@ -16,8 +95,8 @@
16
95
  }
17
96
 
18
97
  &__logo {
19
- padding-top: 1.5rem;
20
- padding-bottom: 1.5rem;
98
+ padding-top: 1.25rem;
99
+ padding-bottom: 1.25rem;
21
100
  }
22
101
 
23
102
  &__logo-link {
@@ -28,14 +107,16 @@
28
107
  color: inherit;
29
108
  text-decoration: none;
30
109
 
31
- &:hover {
32
- outline: 0.375rem #fff solid;
110
+ &--href {
111
+ &:hover {
112
+ outline: 0.375rem #fff solid;
113
+ }
33
114
  }
34
115
  }
35
116
 
36
117
  .tna-logo {
37
- width: 100px;
38
- height: 100px;
118
+ width: 6.25rem;
119
+ height: 6.25rem;
39
120
 
40
121
  display: inline-block;
41
122
  }
@@ -52,31 +133,12 @@
52
133
 
53
134
  display: inline-block;
54
135
 
55
- line-height: 2.125rem;
136
+ line-height: 2.125;
56
137
  text-transform: uppercase;
57
138
  }
58
139
 
59
140
  &__navigation-toggle {
60
- }
61
-
62
- &__navigation-toggle-button {
63
- height: 2rem;
64
- padding: 0;
65
-
66
- display: block;
67
-
68
- position: relative;
69
-
70
- appearance: none;
71
-
72
- font-size: 0;
73
-
74
- background: none;
75
-
76
- border: 0 transparent solid;
77
- border-width: 0.25rem 0;
78
-
79
- cursor: pointer;
141
+ align-self: center;
80
142
  }
81
143
 
82
144
  &__hamburger {
@@ -87,6 +149,8 @@
87
149
 
88
150
  background-color: #fff;
89
151
 
152
+ transition: height 1ms 200ms;
153
+
90
154
  &::before,
91
155
  &::after {
92
156
  height: 0.25rem;
@@ -99,6 +163,11 @@
99
163
 
100
164
  background-color: inherit;
101
165
 
166
+ transition:
167
+ top 200ms 200ms,
168
+ bottom 200ms 200ms,
169
+ transform 200ms;
170
+
102
171
  content: "";
103
172
  }
104
173
 
@@ -111,6 +180,52 @@
111
180
  }
112
181
  }
113
182
 
183
+ &__navigation-toggle-button {
184
+ height: 2rem;
185
+ padding: 0;
186
+
187
+ display: block;
188
+
189
+ position: relative;
190
+
191
+ appearance: none;
192
+
193
+ font-size: 0;
194
+
195
+ background: none;
196
+
197
+ border: 0 transparent solid;
198
+ border-width: 0.25rem 0;
199
+
200
+ cursor: pointer;
201
+
202
+ &--opened {
203
+ .tna-header__hamburger {
204
+ height: 0;
205
+
206
+ &::before,
207
+ &::after {
208
+ transition:
209
+ top 200ms,
210
+ bottom 200ms,
211
+ transform 200ms 200ms;
212
+ }
213
+
214
+ &::before {
215
+ top: 0.625rem;
216
+
217
+ transform: rotate(-135deg);
218
+ }
219
+
220
+ &::after {
221
+ bottom: 0.625rem;
222
+
223
+ transform: rotate(135deg);
224
+ }
225
+ }
226
+ }
227
+ }
228
+
114
229
  &--yellow,
115
230
  &--pink,
116
231
  &--orange,
@@ -182,8 +297,8 @@
182
297
 
183
298
  color: inherit;
184
299
  font-family: typography.$font-family-heading;
185
- font-weight: typography.$font-weight-heading;
186
300
  text-decoration: none;
301
+ line-height: 2;
187
302
 
188
303
  transition:
189
304
  color 200ms,
@@ -191,9 +306,11 @@
191
306
 
192
307
  &:hover,
193
308
  &--selected {
194
- color: colour.$tna-black;
309
+ // color: colour.$tna-black;
310
+ @include colour.colour-font("dark-font");
195
311
 
196
- background-color: #fff;
312
+ // background-color: #fff;
313
+ @include colour.colour-background("page-background");
197
314
 
198
315
  transition:
199
316
  color 50ms,
@@ -227,23 +344,33 @@
227
344
  }
228
345
  }
229
346
 
347
+ .tna-logo {
348
+ width: 4.5rem;
349
+ height: 4.5rem;
350
+ }
351
+
352
+ &__logo-strapline {
353
+ line-height: 1.55;
354
+ }
355
+
230
356
  &__navigation-toggle {
231
357
  &.tna-column {
232
- padding-top: 1rem;
233
358
  padding-right: $compensated-container-padding;
234
359
  padding-left: 0;
235
360
  }
236
361
  }
237
362
 
238
363
  &__navigation {
239
- color: colour.$base-font-colour;
364
+ // color: colour.$base-font-colour;
365
+ @include colour.colour-font("base-font");
366
+ @include tools.relative-font-size(20);
240
367
 
241
368
  &.tna-column {
242
369
  padding-right: 0;
243
370
  padding-left: 0;
244
371
  }
245
372
 
246
- .js-enabled & {
373
+ .tna-template--js-enabled & {
247
374
  display: none;
248
375
 
249
376
  &--open {
@@ -255,7 +382,8 @@
255
382
  &__navigation-items {
256
383
  width: 100%;
257
384
 
258
- background-color: #fff;
385
+ // background-color: #fff;
386
+ @include colour.colour-background("page-background");
259
387
  }
260
388
 
261
389
  &__navigation-item {
@@ -263,7 +391,9 @@
263
391
 
264
392
  display: block;
265
393
 
266
- border-bottom: 1px colour.$keyline-colour solid;
394
+ // border-bottom: 1px colour.$keyline-colour solid;
395
+ border-bottom: 1px solid;
396
+ @include colour.colour-border("keyline");
267
397
  }
268
398
 
269
399
  &__navigation-item-link {
@@ -274,6 +404,8 @@
274
404
 
275
405
  position: relative;
276
406
 
407
+ line-height: 1.6;
408
+
277
409
  &::after {
278
410
  width: 0;
279
411
 
@@ -282,7 +414,8 @@
282
414
  bottom: 0;
283
415
  left: 0;
284
416
 
285
- background-color: colour.$tna-black;
417
+ // background-color: colour.$tna-black;
418
+ @include colour.colour-background("dark-font");
286
419
 
287
420
  transition: width 200ms;
288
421
 
@@ -305,4 +438,15 @@
305
438
  }
306
439
  }
307
440
  }
441
+
442
+ @include media.on-tiny {
443
+ .tna-logo {
444
+ width: 3.5rem;
445
+ height: 3.5rem;
446
+ }
447
+
448
+ &__logo-strapline {
449
+ line-height: 1.25;
450
+ }
451
+ }
308
452
  }
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("TNAFrontend",[],e):"object"==typeof exports?exports.TNAFrontend=e():(t.TNAFrontend=t.TNAFrontend||{},t.TNAFrontend["components/header/header"]=e())}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Header:()=>o});function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(void 0,a=function(t,e){if("object"!==n(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o.key),"symbol"===n(a)?a:String(a)),o)}var a}var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$module=e,this.$toggleButtonWrapper=e&&e.querySelector(".tna-header__navigation-toggle"),this.$navigation=e&&e.querySelector(".tna-header__navigation"),this.$links=e&&this.$navigation&&this.$navigation.querySelectorAll("[tabindex='0']"),this.menuOpened=!1,this.mql=window.matchMedia("(max-width: 768px)")}var e,n;return e=t,(n=[{key:"init",value:function(){var t=this;if(this.$module&&this.$toggleButtonWrapper&&this.$navigation){var e="menu-content-".concat(([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)})));this.$navigation.setAttribute("id",e),this.$toggleButton=document.createElement("button"),this.$toggleButton.innerText="Menu",this.$toggleButton.setAttribute("aria-controls",e),this.$toggleButton.setAttribute("aria-haspopup","true"),this.$toggleButton.classList.add("tna-header__navigation-toggle-button"),this.$hamburger=document.createElement("div"),this.$hamburger.classList.add("tna-header__hamburger"),this.$toggleButton.appendChild(this.$hamburger),this.$toggleButtonWrapper.appendChild(this.$toggleButton),this.syncState(),this.$toggleButton.addEventListener("click",(function(){return t.handleToggleNavigation()})),"addEventListener"in this.mql?this.mql.addEventListener("change",(function(){return t.syncState()})):this.mql.addListener((function(){return t.syncState()}))}}},{key:"handleToggleNavigation",value:function(){this.menuOpened=!this.menuOpened,this.syncState()}},{key:"syncState",value:function(){if(this.mql.matches)if(this.menuOpened){this.$navigation.classList.add("tna-header__navigation--open"),this.$navigation.hidden=!1,this.$navigation.setAttribute("aria-hidden","false"),this.$toggleButton.setAttribute("aria-expanded","true"),this.$toggleButton.setAttribute("title","Close menu");for(var t=0;t<this.$links.length;t++)this.$links[t].setAttribute("tabindex","0")}else{this.$navigation.classList.remove("tna-header__navigation--open"),this.$navigation.hidden=!0,this.$navigation.setAttribute("aria-hidden","true"),this.$toggleButton.setAttribute("aria-expanded","false"),this.$toggleButton.setAttribute("title","Open menu");for(var e=0;e<this.$links.length;e++)this.$links[e].setAttribute("tabindex","-1")}else{this.$navigation.classList.add("tna-header__navigation--open"),this.$navigation.hidden=!1,this.$navigation.setAttribute("aria-hidden","false"),this.$toggleButton.setAttribute("aria-expanded","true"),this.$toggleButton.setAttribute("title","Close menu");for(var n=0;n<this.$links.length;n++)this.$links[n].setAttribute("tabindex","0")}}}])&&i(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();return e})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("TNAFrontend",[],e):"object"==typeof exports?exports.TNAFrontend=e():(t.TNAFrontend=t.TNAFrontend||{},t.TNAFrontend["components/header/header"]=e())}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Header:()=>o});function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(void 0,a=function(t,e){if("object"!==n(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o.key),"symbol"===n(a)?a:String(a)),o)}var a}var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$module=e,this.$toggleButtonWrapper=e&&e.querySelector(".tna-header__navigation-toggle"),this.$navigation=e&&e.querySelector(".tna-header__navigation"),this.$links=e&&this.$navigation&&this.$navigation.querySelectorAll("[tabindex='0']"),this.menuOpened=!1,this.mql=window.matchMedia("(max-width: 768px)")}var e,n;return e=t,(n=[{key:"init",value:function(){var t=this;if(this.$module&&this.$toggleButtonWrapper&&this.$navigation){var e="menu-content-".concat(([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)})));this.$navigation.setAttribute("id",e),this.$toggleButton=document.createElement("button"),this.$toggleButton.innerText="Menu",this.$toggleButton.setAttribute("aria-controls",e),this.$toggleButton.setAttribute("aria-haspopup","true"),this.$toggleButton.classList.add("tna-header__navigation-toggle-button"),this.$hamburger=document.createElement("div"),this.$hamburger.classList.add("tna-header__hamburger"),this.$toggleButton.appendChild(this.$hamburger),this.$toggleButtonWrapper.appendChild(this.$toggleButton),this.syncState(),this.$toggleButton.addEventListener("click",(function(){return t.handleToggleNavigation()})),"addEventListener"in this.mql?this.mql.addEventListener("change",(function(){return t.syncState()})):this.mql.addListener((function(){return t.syncState()}))}}},{key:"handleToggleNavigation",value:function(){this.menuOpened=!this.menuOpened,this.syncState()}},{key:"syncState",value:function(){if(this.mql.matches)if(this.menuOpened){this.$navigation.classList.add("tna-header__navigation--open"),this.$navigation.hidden=!1,this.$navigation.setAttribute("aria-hidden","false"),this.$toggleButton.setAttribute("aria-expanded","true"),this.$toggleButton.setAttribute("title","Close menu"),this.$toggleButton.classList.add("tna-header__navigation-toggle-button--opened");for(var t=0;t<this.$links.length;t++)this.$links[t].setAttribute("tabindex","0")}else{this.$navigation.classList.remove("tna-header__navigation--open"),this.$navigation.hidden=!0,this.$navigation.setAttribute("aria-hidden","true"),this.$toggleButton.setAttribute("aria-expanded","false"),this.$toggleButton.setAttribute("title","Open menu"),this.$toggleButton.classList.remove("tna-header__navigation-toggle-button--opened");for(var e=0;e<this.$links.length;e++)this.$links[e].setAttribute("tabindex","-1")}else{this.$navigation.classList.add("tna-header__navigation--open"),this.$navigation.hidden=!1,this.$navigation.setAttribute("aria-hidden","false"),this.$toggleButton.setAttribute("aria-expanded","true"),this.$toggleButton.setAttribute("title","Close menu");for(var n=0;n<this.$links.length;n++)this.$links[n].setAttribute("tabindex","0")}}}])&&i(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();return e})()));
2
2
  //# sourceMappingURL=header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/header/header.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,GAAIH,GACA,iBAAZC,QACdA,QAAqB,YAAID,KAEzBD,EAAkB,YAAIA,EAAkB,aAAK,CAAC,EAAGA,EAAkB,YAAE,4BAA8BC,IACpG,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,qsBCHvD,IAAMC,EAAM,WACjB,SAAAA,EAAYC,I,4FAASC,CAAA,KAAAF,GACnBG,KAAKF,QAAUA,EACfE,KAAKC,qBACHH,GAA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AAA,YAAAa,MAED,WACE,GAAII,KAAKO,IAAIyB,QACX,GAAIhC,KAAKM,WAAY,CACnBN,KAAKG,YAAYqB,UAAUC,IAAI,gCAC/BzB,KAAKG,YAAY8B,QAAS,EAC1BjC,KAAKG,YAAYgB,aAAa,cAAe,SAC7CnB,KAAKoB,cAAcD,aAAa,gBAAiB,QACjDnB,KAAKoB,cAAcD,aAAa,QAAS,cAEzC,IAAK,IAAIe,EAAI,EAAGA,EAAIlC,KAAKI,OAAO+B,OAAQD,IACtClC,KAAKI,OAAO8B,GAAGf,aAAa,WAAY,IAE5C,KAAO,CACLnB,KAAKG,YAAYqB,UAAUY,OAAO,gCAClCpC,KAAKG,YAAY8B,QAAS,EAC1BjC,KAAKG,YAAYgB,aAAa,cAAe,QAC7CnB,KAAKoB,cAAcD,aAAa,gBAAiB,SACjDnB,KAAKoB,cAAcD,aAAa,QAAS,aAEzC,IAAK,IAAIe,EAAI,EAAGA,EAAIlC,KAAKI,OAAO+B,OAAQD,IACtClC,KAAKI,OAAO8B,GAAGf,aAAa,WAAY,KAE5C,KACK,CACLnB,KAAKG,YAAYqB,UAAUC,IAAI,gCAC/BzB,KAAKG,YAAY8B,QAAS,EAC1BjC,KAAKG,YAAYgB,aAAa,cAAe,SAC7CnB,KAAKoB,cAAcD,aAAa,gBAAiB,QACjDnB,KAAKoB,cAAcD,aAAa,QAAS,cAEzC,IAAK,IAAIe,EAAI,EAAGA,EAAIlC,KAAKI,OAAO+B,OAAQD,IACtClC,KAAKI,OAAO8B,GAAGf,aAAa,WAAY,IAE5C,CACF,M,oEAACtB,CAAA,CAlGgB,G","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/header/header.mjs","webpack://TNAFrontend/./src/nationalarchives/lib/uuid.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = root[\"TNAFrontend\"] || {}, root[\"TNAFrontend\"][\"components/header/header\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import uuidv4 from \"../../lib/uuid.mjs\";\n\nexport class Header {\n constructor($module) {\n this.$module = $module;\n this.$toggleButtonWrapper =\n $module && $module.querySelector(\".tna-header__navigation-toggle\");\n this.$navigation =\n $module && $module.querySelector(\".tna-header__navigation\");\n this.$links =\n $module &&\n this.$navigation &&\n this.$navigation.querySelectorAll(\"[tabindex='0']\");\n this.menuOpened = false;\n this.mql = window.matchMedia(\"(max-width: 768px)\");\n }\n\n init() {\n if (!this.$module || !this.$toggleButtonWrapper || !this.$navigation) {\n return;\n }\n\n // const uniqueLinkIds = []\n\n // for (let i = 0; i < this.$links.length; i++) {\n // const uniqueLinkId = uuidv4()\n // this.$links[i].setAttribute(\"id\", uniqueLinkId);\n // uniqueLinkIds.push(uniqueLinkId)\n // }\n\n const uniqueId = `menu-content-${uuidv4()}`;\n this.$navigation.setAttribute(\"id\", uniqueId);\n // this.$navigation.setAttribute(\"aria-owns\", uniqueLinkIds.join(\",\"));\n\n this.$toggleButton = document.createElement(\"button\");\n this.$toggleButton.innerText = \"Menu\";\n this.$toggleButton.setAttribute(\"aria-controls\", uniqueId);\n this.$toggleButton.setAttribute(\"aria-haspopup\", \"true\");\n this.$toggleButton.classList.add(\"tna-header__navigation-toggle-button\");\n\n this.$hamburger = document.createElement(\"div\");\n this.$hamburger.classList.add(\"tna-header__hamburger\");\n\n this.$toggleButton.appendChild(this.$hamburger);\n this.$toggleButtonWrapper.appendChild(this.$toggleButton);\n\n this.syncState();\n\n this.$toggleButton.addEventListener(\"click\", () =>\n this.handleToggleNavigation(),\n );\n\n if (\"addEventListener\" in this.mql) {\n this.mql.addEventListener(\"change\", () => this.syncState());\n // this.mql.addEventListener(\"change\", this.syncState.bind(this));\n } else {\n this.mql.addListener(() => this.syncState());\n // this.mql.addListener(this.syncState.bind(this));\n }\n }\n\n handleToggleNavigation() {\n this.menuOpened = !this.menuOpened;\n this.syncState();\n }\n\n syncState() {\n if (this.mql.matches) {\n if (this.menuOpened) {\n this.$navigation.classList.add(\"tna-header__navigation--open\");\n this.$navigation.hidden = false;\n this.$navigation.setAttribute(\"aria-hidden\", \"false\");\n this.$toggleButton.setAttribute(\"aria-expanded\", \"true\");\n this.$toggleButton.setAttribute(\"title\", \"Close menu\");\n\n for (let i = 0; i < this.$links.length; i++) {\n this.$links[i].setAttribute(\"tabindex\", \"0\");\n }\n } else {\n this.$navigation.classList.remove(\"tna-header__navigation--open\");\n this.$navigation.hidden = true;\n this.$navigation.setAttribute(\"aria-hidden\", \"true\");\n this.$toggleButton.setAttribute(\"aria-expanded\", \"false\");\n this.$toggleButton.setAttribute(\"title\", \"Open menu\");\n\n for (let i = 0; i < this.$links.length; i++) {\n this.$links[i].setAttribute(\"tabindex\", \"-1\");\n }\n }\n } else {\n this.$navigation.classList.add(\"tna-header__navigation--open\");\n this.$navigation.hidden = false;\n this.$navigation.setAttribute(\"aria-hidden\", \"false\");\n this.$toggleButton.setAttribute(\"aria-expanded\", \"true\");\n this.$toggleButton.setAttribute(\"title\", \"Close menu\");\n\n for (let i = 0; i < this.$links.length; i++) {\n this.$links[i].setAttribute(\"tabindex\", \"0\");\n }\n }\n }\n}\n","const uuidv4 = () =>\n ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>\n (\n c ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))\n ).toString(16),\n );\n\nexport default uuidv4;\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Header","$module","_classCallCheck","this","$toggleButtonWrapper","querySelector","$navigation","$links","querySelectorAll","menuOpened","mql","window","matchMedia","_this","uniqueId","concat","replace","c","crypto","getRandomValues","Uint8Array","toString","setAttribute","$toggleButton","document","createElement","innerText","classList","add","$hamburger","appendChild","syncState","addEventListener","handleToggleNavigation","addListener","matches","hidden","i","length","remove"],"sourceRoot":""}
1
+ {"version":3,"file":"components/header/header.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,GAAIH,GACA,iBAAZC,QACdA,QAAqB,YAAID,KAEzBD,EAAkB,YAAIA,EAAkB,aAAK,CAAC,EAAGA,EAAkB,YAAE,4BAA8BC,IACpG,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,I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D,aAAa,QAAS,cAEzC,IAAK,IAAIe,EAAI,EAAGA,EAAIlC,KAAKI,OAAO+B,OAAQD,IACtClC,KAAKI,OAAO8B,GAAGf,aAAa,WAAY,IAE5C,CACF,M,oEAACtB,CAAA,CAxGgB,G","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/header/header.mjs","webpack://TNAFrontend/./src/nationalarchives/lib/uuid.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = root[\"TNAFrontend\"] || {}, root[\"TNAFrontend\"][\"components/header/header\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import uuidv4 from \"../../lib/uuid.mjs\";\n\nexport class Header {\n constructor($module) {\n this.$module = $module;\n this.$toggleButtonWrapper =\n $module && $module.querySelector(\".tna-header__navigation-toggle\");\n this.$navigation =\n $module && $module.querySelector(\".tna-header__navigation\");\n this.$links =\n $module &&\n this.$navigation &&\n this.$navigation.querySelectorAll(\"[tabindex='0']\");\n this.menuOpened = false;\n this.mql = window.matchMedia(\"(max-width: 768px)\");\n }\n\n init() {\n if (!this.$module || !this.$toggleButtonWrapper || !this.$navigation) {\n return;\n }\n\n // const uniqueLinkIds = []\n\n // for (let i = 0; i < this.$links.length; i++) {\n // const uniqueLinkId = uuidv4()\n // this.$links[i].setAttribute(\"id\", uniqueLinkId);\n // uniqueLinkIds.push(uniqueLinkId)\n // }\n\n const uniqueId = `menu-content-${uuidv4()}`;\n this.$navigation.setAttribute(\"id\", uniqueId);\n // this.$navigation.setAttribute(\"aria-owns\", uniqueLinkIds.join(\",\"));\n\n this.$toggleButton = document.createElement(\"button\");\n this.$toggleButton.innerText = \"Menu\";\n this.$toggleButton.setAttribute(\"aria-controls\", uniqueId);\n this.$toggleButton.setAttribute(\"aria-haspopup\", \"true\");\n this.$toggleButton.classList.add(\"tna-header__navigation-toggle-button\");\n\n this.$hamburger = document.createElement(\"div\");\n this.$hamburger.classList.add(\"tna-header__hamburger\");\n\n this.$toggleButton.appendChild(this.$hamburger);\n this.$toggleButtonWrapper.appendChild(this.$toggleButton);\n\n this.syncState();\n\n this.$toggleButton.addEventListener(\"click\", () =>\n this.handleToggleNavigation(),\n );\n\n if (\"addEventListener\" in this.mql) {\n this.mql.addEventListener(\"change\", () => this.syncState());\n // this.mql.addEventListener(\"change\", this.syncState.bind(this));\n } else {\n this.mql.addListener(() => this.syncState());\n // this.mql.addListener(this.syncState.bind(this));\n }\n }\n\n handleToggleNavigation() {\n this.menuOpened = !this.menuOpened;\n this.syncState();\n }\n\n syncState() {\n if (this.mql.matches) {\n if (this.menuOpened) {\n this.$navigation.classList.add(\"tna-header__navigation--open\");\n this.$navigation.hidden = false;\n this.$navigation.setAttribute(\"aria-hidden\", \"false\");\n this.$toggleButton.setAttribute(\"aria-expanded\", \"true\");\n this.$toggleButton.setAttribute(\"title\", \"Close menu\");\n this.$toggleButton.classList.add(\n \"tna-header__navigation-toggle-button--opened\",\n );\n\n for (let i = 0; i < this.$links.length; i++) {\n this.$links[i].setAttribute(\"tabindex\", \"0\");\n }\n } else {\n this.$navigation.classList.remove(\"tna-header__navigation--open\");\n this.$navigation.hidden = true;\n this.$navigation.setAttribute(\"aria-hidden\", \"true\");\n this.$toggleButton.setAttribute(\"aria-expanded\", \"false\");\n this.$toggleButton.setAttribute(\"title\", \"Open menu\");\n this.$toggleButton.classList.remove(\n \"tna-header__navigation-toggle-button--opened\",\n );\n\n for (let i = 0; i < this.$links.length; i++) {\n this.$links[i].setAttribute(\"tabindex\", \"-1\");\n }\n }\n } else {\n this.$navigation.classList.add(\"tna-header__navigation--open\");\n this.$navigation.hidden = false;\n this.$navigation.setAttribute(\"aria-hidden\", \"false\");\n this.$toggleButton.setAttribute(\"aria-expanded\", \"true\");\n this.$toggleButton.setAttribute(\"title\", \"Close menu\");\n\n for (let i = 0; i < this.$links.length; i++) {\n this.$links[i].setAttribute(\"tabindex\", \"0\");\n }\n }\n }\n}\n","const uuidv4 = () =>\n ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>\n (\n c ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))\n ).toString(16),\n );\n\nexport default uuidv4;\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Header","$module","_classCallCheck","this","$toggleButtonWrapper","querySelector","$navigation","$links","querySelectorAll","menuOpened","mql","window","matchMedia","_this","uniqueId","concat","replace","c","crypto","getRandomValues","Uint8Array","toString","setAttribute","$toggleButton","document","createElement","innerText","classList","add","$hamburger","appendChild","syncState","addEventListener","handleToggleNavigation","addListener","matches","hidden","i","length","remove"],"sourceRoot":""}
@@ -72,6 +72,9 @@ export class Header {
72
72
  this.$navigation.setAttribute("aria-hidden", "false");
73
73
  this.$toggleButton.setAttribute("aria-expanded", "true");
74
74
  this.$toggleButton.setAttribute("title", "Close menu");
75
+ this.$toggleButton.classList.add(
76
+ "tna-header__navigation-toggle-button--opened",
77
+ );
75
78
 
76
79
  for (let i = 0; i < this.$links.length; i++) {
77
80
  this.$links[i].setAttribute("tabindex", "0");
@@ -82,6 +85,9 @@ export class Header {
82
85
  this.$navigation.setAttribute("aria-hidden", "true");
83
86
  this.$toggleButton.setAttribute("aria-expanded", "false");
84
87
  this.$toggleButton.setAttribute("title", "Open menu");
88
+ this.$toggleButton.classList.remove(
89
+ "tna-header__navigation-toggle-button--opened",
90
+ );
85
91
 
86
92
  for (let i = 0; i < this.$links.length; i++) {
87
93
  this.$links[i].setAttribute("tabindex", "-1");