@nationalarchives/frontend 0.1.65 → 0.2.0

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 (205) hide show
  1. package/config/.eslintrc.js +1 -1
  2. package/config/.htmlvalidate.json +12 -5
  3. package/config/stylelint.config.js +1 -0
  4. package/nationalarchives/all.css +1 -1
  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 +0 -18
  9. package/nationalarchives/components/_forms.scss +9 -0
  10. package/nationalarchives/components/_index.scss +2 -35
  11. package/nationalarchives/components/_presentation.scss +23 -0
  12. package/nationalarchives/components/accordion/accordion.css.map +1 -1
  13. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  14. package/nationalarchives/components/button/button.css +1 -1
  15. package/nationalarchives/components/button/button.css.map +1 -1
  16. package/nationalarchives/components/button/button.scss +9 -9
  17. package/nationalarchives/components/card/card.css +1 -1
  18. package/nationalarchives/components/card/card.css.map +1 -1
  19. package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
  20. package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
  21. package/nationalarchives/components/checkboxes/checkboxes.njk +1 -1
  22. package/nationalarchives/components/checkboxes/checkboxes.scss +1 -1
  23. package/nationalarchives/components/checkboxes/macro-options.json +6 -0
  24. package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
  25. package/nationalarchives/components/date-input/date-input.css +1 -1
  26. package/nationalarchives/components/date-input/date-input.css.map +1 -1
  27. package/nationalarchives/components/date-input/date-input.scss +2 -2
  28. package/nationalarchives/components/date-input/fixtures.json +5 -5
  29. package/nationalarchives/components/date-input/template.njk +1 -1
  30. package/nationalarchives/components/date-search/date-search.css +1 -1
  31. package/nationalarchives/components/date-search/date-search.css.map +1 -1
  32. package/nationalarchives/components/date-search/date-search.scss +2 -2
  33. package/nationalarchives/components/details/details.css.map +1 -1
  34. package/nationalarchives/components/error-summary/error-summary.css +1 -1
  35. package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
  36. package/nationalarchives/components/error-summary/error-summary.js +1 -1
  37. package/nationalarchives/components/error-summary/error-summary.js.map +1 -1
  38. package/nationalarchives/components/error-summary/error-summary.mjs +1 -1
  39. package/nationalarchives/components/error-summary/error-summary.scss +3 -4
  40. package/nationalarchives/components/files-list/_index.scss +1 -0
  41. package/nationalarchives/components/files-list/files-list.css +1 -0
  42. package/nationalarchives/components/files-list/files-list.css.map +1 -0
  43. package/nationalarchives/components/{files/files.scss → files-list/files-list.scss} +2 -1
  44. package/nationalarchives/components/files-list/fixtures.json +71 -0
  45. package/nationalarchives/components/files-list/macro.njk +3 -0
  46. package/nationalarchives/components/files-list/template.njk +33 -0
  47. package/nationalarchives/components/footer/footer.css.map +1 -1
  48. package/nationalarchives/components/gallery/fixtures.json +1 -1
  49. package/nationalarchives/components/gallery/gallery.css +1 -1
  50. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  51. package/nationalarchives/components/gallery/gallery.scss +5 -6
  52. package/nationalarchives/components/gallery/template.njk +11 -7
  53. package/nationalarchives/components/global-header/global-header.css.map +1 -1
  54. package/nationalarchives/components/header/header.css.map +1 -1
  55. package/nationalarchives/components/hero/hero.css +1 -1
  56. package/nationalarchives/components/hero/hero.css.map +1 -1
  57. package/nationalarchives/components/hero/hero.scss +0 -24
  58. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  59. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  60. package/nationalarchives/components/index-grid/index-grid.scss +1 -1
  61. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  62. package/nationalarchives/components/picture/picture.css.map +1 -1
  63. package/nationalarchives/components/quick-filters/quick-filters.css +1 -1
  64. package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -1
  65. package/nationalarchives/components/radios/radios.css +1 -1
  66. package/nationalarchives/components/radios/radios.css.map +1 -1
  67. package/nationalarchives/components/radios/radios.scss +1 -1
  68. package/nationalarchives/components/records-list/_index.scss +1 -0
  69. package/nationalarchives/components/records-list/fixtures.json +42 -0
  70. package/nationalarchives/components/records-list/macro.njk +3 -0
  71. package/nationalarchives/components/records-list/records-list.css +1 -0
  72. package/nationalarchives/components/records-list/records-list.css.map +1 -0
  73. package/nationalarchives/components/{featured-records/featured-records.scss → records-list/records-list.scss} +1 -1
  74. package/nationalarchives/components/records-list/template.njk +21 -0
  75. package/nationalarchives/components/search-field/search-field.css +1 -1
  76. package/nationalarchives/components/search-field/search-field.css.map +1 -1
  77. package/nationalarchives/components/search-field/search-field.scss +1 -1
  78. package/nationalarchives/components/select/select.css +1 -1
  79. package/nationalarchives/components/select/select.css.map +1 -1
  80. package/nationalarchives/components/select/select.scss +2 -2
  81. package/nationalarchives/components/sidebar/fixtures.json +12 -2
  82. package/nationalarchives/components/sidebar/sidebar.css +1 -1
  83. package/nationalarchives/components/sidebar/sidebar.css.map +1 -1
  84. package/nationalarchives/components/sidebar/template.njk +9 -0
  85. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  86. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  87. package/nationalarchives/components/text-input/text-input.css +1 -1
  88. package/nationalarchives/components/text-input/text-input.css.map +1 -1
  89. package/nationalarchives/components/text-input/text-input.scss +2 -2
  90. package/nationalarchives/components/textarea/textarea.css +1 -1
  91. package/nationalarchives/components/textarea/textarea.css.map +1 -1
  92. package/nationalarchives/components/textarea/textarea.scss +2 -2
  93. package/nationalarchives/components/warning/warning.css +1 -1
  94. package/nationalarchives/components/warning/warning.css.map +1 -1
  95. package/nationalarchives/components/warning/warning.scss +1 -0
  96. package/nationalarchives/global-header-package.css +1 -1
  97. package/nationalarchives/global-header-package.css.map +1 -1
  98. package/nationalarchives/global-header-package.scss +1 -1
  99. package/nationalarchives/print.css +1 -1
  100. package/nationalarchives/print.css.map +1 -1
  101. package/nationalarchives/prototype-kit.css +1 -1
  102. package/nationalarchives/prototype-kit.css.map +1 -1
  103. package/nationalarchives/tools/_colour.scss +25 -50
  104. package/nationalarchives/utilities/_columns.scss +1 -1
  105. package/nationalarchives/utilities/_index.scss +1 -0
  106. package/nationalarchives/utilities/_reset.scss +2 -8
  107. package/nationalarchives/utilities/{_colour.scss → colour/_index.scss} +2 -2
  108. package/nationalarchives/utilities/{_forms.scss → forms/_index.scss} +6 -6
  109. package/nationalarchives/utilities/grid/macro.njk +3 -0
  110. package/nationalarchives/utilities/{_lists.scss → lists/_index.scss} +16 -7
  111. package/nationalarchives/utilities/{_overrides.scss → overrides/_index.scss} +2 -2
  112. package/nationalarchives/utilities/{_tables.scss → tables/_index.scss} +5 -5
  113. package/nationalarchives/utilities/{_typography.scss → typography/_index.scss} +5 -5
  114. package/nationalarchives/variables/_colour.scss +12 -5
  115. package/package.json +1 -1
  116. package/nationalarchives/components/accordion/accordion.stories.js +0 -432
  117. package/nationalarchives/components/breadcrumbs/breadcrumbs.stories.js +0 -128
  118. package/nationalarchives/components/button/button-group.stories.js +0 -114
  119. package/nationalarchives/components/button/button.stories.js +0 -207
  120. package/nationalarchives/components/card/card.stories.js +0 -402
  121. package/nationalarchives/components/checkboxes/checkboxes.stories.js +0 -241
  122. package/nationalarchives/components/compound-filters/compound-filters.stories.js +0 -61
  123. package/nationalarchives/components/cookie-banner/cookie-banner.stories.js +0 -250
  124. package/nationalarchives/components/date-input/date-input.stories.js +0 -119
  125. package/nationalarchives/components/date-search/date-search.stories.js +0 -124
  126. package/nationalarchives/components/details/details.stories.js +0 -33
  127. package/nationalarchives/components/error-summary/error-summary.stories.js +0 -59
  128. package/nationalarchives/components/featured-records/_index.scss +0 -1
  129. package/nationalarchives/components/featured-records/featured-records.css +0 -1
  130. package/nationalarchives/components/featured-records/featured-records.css.map +0 -1
  131. package/nationalarchives/components/featured-records/featured-records.stories.js +0 -50
  132. package/nationalarchives/components/featured-records/fixtures.json +0 -42
  133. package/nationalarchives/components/featured-records/macro.njk +0 -3
  134. package/nationalarchives/components/featured-records/template.njk +0 -21
  135. package/nationalarchives/components/files/_index.scss +0 -1
  136. package/nationalarchives/components/files/files.css +0 -1
  137. package/nationalarchives/components/files/files.css.map +0 -1
  138. package/nationalarchives/components/files/files.stories.js +0 -59
  139. package/nationalarchives/components/files/fixtures.json +0 -71
  140. package/nationalarchives/components/files/macro.njk +0 -3
  141. package/nationalarchives/components/files/template.njk +0 -33
  142. package/nationalarchives/components/footer/footer.stories.js +0 -241
  143. package/nationalarchives/components/gallery/gallery.stories.js +0 -87
  144. package/nationalarchives/components/global-header/global-header.stories.js +0 -364
  145. package/nationalarchives/components/grid/_index.scss +0 -1
  146. package/nationalarchives/components/grid/grid.css +0 -1
  147. package/nationalarchives/components/grid/grid.css.map +0 -1
  148. package/nationalarchives/components/grid/grid.stories.js +0 -279
  149. package/nationalarchives/components/grid/macro.njk +0 -3
  150. package/nationalarchives/components/header/header.stories.js +0 -239
  151. package/nationalarchives/components/hero/hero.stories.js +0 -326
  152. package/nationalarchives/components/index-grid/index-grid.stories.js +0 -128
  153. package/nationalarchives/components/pagination/pagination.stories.js +0 -532
  154. package/nationalarchives/components/phase-banner/phase-banner.stories.js +0 -39
  155. package/nationalarchives/components/picture/picture.stories.js +0 -75
  156. package/nationalarchives/components/quick-filters/quick-filters.stories.js +0 -76
  157. package/nationalarchives/components/radios/radios.stories.js +0 -244
  158. package/nationalarchives/components/search-field/search-field.stories.js +0 -88
  159. package/nationalarchives/components/search-filters/_index.scss +0 -1
  160. package/nationalarchives/components/search-filters/fixtures.json +0 -16
  161. package/nationalarchives/components/search-filters/macro-options.json +0 -39
  162. package/nationalarchives/components/search-filters/macro.njk +0 -3
  163. package/nationalarchives/components/search-filters/search-filters.css +0 -1
  164. package/nationalarchives/components/search-filters/search-filters.css.map +0 -1
  165. package/nationalarchives/components/search-filters/search-filters.js +0 -2
  166. package/nationalarchives/components/search-filters/search-filters.js.map +0 -1
  167. package/nationalarchives/components/search-filters/search-filters.mjs +0 -67
  168. package/nationalarchives/components/search-filters/search-filters.scss +0 -198
  169. package/nationalarchives/components/search-filters/search-filters.stories.js +0 -207
  170. package/nationalarchives/components/search-filters/template.njk +0 -108
  171. package/nationalarchives/components/select/select.stories.js +0 -197
  172. package/nationalarchives/components/sensitive-image/_index.scss +0 -1
  173. package/nationalarchives/components/sensitive-image/fixtures.json +0 -51
  174. package/nationalarchives/components/sensitive-image/macro-options.json +0 -58
  175. package/nationalarchives/components/sensitive-image/macro.njk +0 -3
  176. package/nationalarchives/components/sensitive-image/sensitive-image.css +0 -1
  177. package/nationalarchives/components/sensitive-image/sensitive-image.css.map +0 -1
  178. package/nationalarchives/components/sensitive-image/sensitive-image.js +0 -2
  179. package/nationalarchives/components/sensitive-image/sensitive-image.js.map +0 -1
  180. package/nationalarchives/components/sensitive-image/sensitive-image.mjs +0 -23
  181. package/nationalarchives/components/sensitive-image/sensitive-image.scss +0 -85
  182. package/nationalarchives/components/sensitive-image/sensitive-image.stories.js +0 -86
  183. package/nationalarchives/components/sensitive-image/template.njk +0 -11
  184. package/nationalarchives/components/sidebar/sidebar.stories.js +0 -227
  185. package/nationalarchives/components/skip-link/skip-link.stories.js +0 -76
  186. package/nationalarchives/components/tabs/tabs.stories.js +0 -300
  187. package/nationalarchives/components/text-input/text-input.stories.js +0 -188
  188. package/nationalarchives/components/textarea/textarea.stories.js +0 -130
  189. package/nationalarchives/components/warning/warning.stories.js +0 -39
  190. package/nationalarchives/stories/intro.mdx +0 -13
  191. package/nationalarchives/stories/utilities/colour-schemes/colour-combinations.stories.js +0 -293
  192. package/nationalarchives/stories/utilities/colour-schemes/colour-themes.stories.js +0 -1513
  193. package/nationalarchives/stories/utilities/forms/forms.mdx +0 -117
  194. package/nationalarchives/stories/utilities/lists/lists.stories.js +0 -212
  195. package/nationalarchives/stories/utilities/overrides/overrides.stories.js +0 -42
  196. package/nationalarchives/stories/utilities/tables/tables.stories.js +0 -47
  197. package/nationalarchives/stories/utilities/typography/heading-groups.stories.js +0 -94
  198. package/nationalarchives/stories/utilities/typography/headings.stories.js +0 -33
  199. package/nationalarchives/stories/utilities/typography/typography.stories.js +0 -91
  200. package/nationalarchives/components/{files → files-list}/macro-options.json +0 -0
  201. package/nationalarchives/components/{featured-records → records-list}/macro-options.json +0 -0
  202. package/nationalarchives/{components/grid/grid.scss → utilities/grid/_index.scss} +1 -1
  203. /package/nationalarchives/{components → utilities}/grid/fixtures.json +0 -0
  204. /package/nationalarchives/{components → utilities}/grid/macro-options.json +0 -0
  205. /package/nationalarchives/{components → utilities}/grid/template.njk +0 -0
@@ -1,51 +0,0 @@
1
- {
2
- "component": "sensitive image",
3
- "fixtures": [
4
- {
5
- "name": "minimal",
6
- "options": {
7
- "image": {
8
- "src": "https://picsum.photos/id/237/800/600",
9
- "alt": "A placeholder image",
10
- "width": 800,
11
- "height": 600
12
- },
13
- "warning": "This is a gory photo",
14
- "action": "Show me the gory photo"
15
- },
16
- "html": "<div class=\"tna-sensitive-image\" data-module=\"tna-sensitive-image\" style=\"--sensitive-image: url('https://picsum.photos/id/237/800/600'); --sensitive-image-width: 800; --sensitive-image-height: 600\"><p class=\"tna-sensitive-image__warning\">This is a gory photo</p><details class=\"tna-sensitive-image__details\"><summary class=\"tna-sensitive-image__show\" data-action=\"Show me the gory photo\">Show me the gory photo</summary><div class=\"tna-sensitive-image__container\"><img src=\"https://picsum.photos/id/237/800/600\" alt=\"A placeholder image\" class=\"tna-sensitive-image__image\"></div></details></div>"
17
- },
18
- {
19
- "name": "with classes",
20
- "options": {
21
- "image": {
22
- "src": "https://picsum.photos/id/237/800/600",
23
- "alt": "A placeholder image",
24
- "width": 800,
25
- "height": 600
26
- },
27
- "warning": "This is a gory photo",
28
- "action": "Show me the gory photo",
29
- "classes": "sensitive-image__test-class"
30
- },
31
- "html": "<div class=\"tna-sensitive-image sensitive-image__test-class\" data-module=\"tna-sensitive-image\" style=\"--sensitive-image: url('https://picsum.photos/id/237/800/600'); --sensitive-image-width: 800; --sensitive-image-height: 600\"><p class=\"tna-sensitive-image__warning\">This is a gory photo</p><details class=\"tna-sensitive-image__details\"><summary class=\"tna-sensitive-image__show\" data-action=\"Show me the gory photo\">Show me the gory photo</summary><div class=\"tna-sensitive-image__container\"><img src=\"https://picsum.photos/id/237/800/600\" alt=\"A placeholder image\" class=\"tna-sensitive-image__image\"></div></details></div>"
32
- },
33
- {
34
- "name": "with attributes",
35
- "options": {
36
- "image": {
37
- "src": "https://picsum.photos/id/237/800/600",
38
- "alt": "A placeholder image",
39
- "width": 800,
40
- "height": 600
41
- },
42
- "warning": "This is a gory photo",
43
- "action": "Show me the gory photo",
44
- "attributes": {
45
- "data-testattribute": "foobar"
46
- }
47
- },
48
- "html": "<div class=\"tna-sensitive-image\" data-module=\"tna-sensitive-image\" style=\"--sensitive-image: url('https://picsum.photos/id/237/800/600'); --sensitive-image-width: 800; --sensitive-image-height: 600\" data-testattribute=\"foobar\"><p class=\"tna-sensitive-image__warning\">This is a gory photo</p><details class=\"tna-sensitive-image__details\"><summary class=\"tna-sensitive-image__show\" data-action=\"Show me the gory photo\">Show me the gory photo</summary><div class=\"tna-sensitive-image__container\"><img src=\"https://picsum.photos/id/237/800/600\" alt=\"A placeholder image\" class=\"tna-sensitive-image__image\"></div></details></div>"
49
- }
50
- ]
51
- }
@@ -1,58 +0,0 @@
1
- [
2
- {
3
- "name": "image",
4
- "type": "object",
5
- "required": true,
6
- "description": "",
7
- "params": [
8
- {
9
- "name": "src",
10
- "type": "string",
11
- "required": true,
12
- "description": ""
13
- },
14
- {
15
- "name": "alt",
16
- "type": "string",
17
- "required": true,
18
- "description": ""
19
- },
20
- {
21
- "name": "width",
22
- "type": "string",
23
- "required": true,
24
- "description": ""
25
- },
26
- {
27
- "name": "height",
28
- "type": "string",
29
- "required": true,
30
- "description": ""
31
- }
32
- ]
33
- },
34
- {
35
- "name": "warning",
36
- "type": "string",
37
- "required": true,
38
- "description": ""
39
- },
40
- {
41
- "name": "action",
42
- "type": "string",
43
- "required": true,
44
- "description": ""
45
- },
46
- {
47
- "name": "classes",
48
- "type": "string",
49
- "required": false,
50
- "description": "Classes to add to the sensitive image."
51
- },
52
- {
53
- "name": "attributes",
54
- "type": "object",
55
- "required": false,
56
- "description": "HTML attributes (for example data attributes) to add to the sensitive image."
57
- }
58
- ]
@@ -1,3 +0,0 @@
1
- {% macro tnaSensitiveImage(params) %}
2
- {%- include "nationalarchives/components/sensitive-image/template.njk" -%}
3
- {% endmacro %}
@@ -1 +0,0 @@
1
- .tna-sensitive-image__details{position:relative}.tna-sensitive-image__details::after{content:"";width:100%;padding-bottom:calc(100%*var(--sensitive-image-height)/var(--sensitive-image-width));display:block;position:relative;z-index:-1;background-image:var(--sensitive-image);background-size:contain;background-clip:padding-box;filter:blur(20px) saturate(0)}.tna-sensitive-image__show{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;z-index:1;font-size:0;cursor:pointer}.tna-sensitive-image__show::after{content:attr(data-action);padding:4px 16px;color:var(--button-text, rgb(255, 255, 255));font-size:1.125rem;font-weight:700;background-color:var(--button-background, rgb(1, 1, 1));border:4px var(--button-background, rgb(1, 1, 1)) solid}.tna-sensitive-image__show:hover::after{text-decoration:none;color:var(--font-dark, rgb(1, 1, 1));background-color:var(--background, #f4f4f4)}.tna-sensitive-image__image{width:100%}.tna-sensitive-image__details[open]::after,.tna-sensitive-image__details[open] .tna-sensitive-image__show{display:none}/*# sourceMappingURL=sensitive-image.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/components/sensitive-image/sensitive-image.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss","../../../../src/nationalarchives/tools/_colour.scss"],"names":[],"mappings":"AAUE,8BACE,kBAEA,qCACE,WAEA,WACA,qFAIA,cAEA,kBACA,WAEA,wCACA,wBACA,4BAEA,8BAIJ,2BACE,aACA,mBACA,uBAEA,kBACA,QACA,UAEA,YAEA,eAEA,kCACE,0BAEA,8DC5CJ,mBAiBA,YCYsB,ICmBtB,wDA0BI,wDHlBA,wCACE,qBGbN,qCAIA,4CHoBA,4BACE,WAIA,0GAEE","file":"sensitive-image.css","sourcesContent":["@use \"../../tools/colour\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-sensitive-image {\n $button-border-width: 4px !default;\n\n &__warning {\n }\n\n &__details {\n position: relative;\n\n &::after {\n content: \"\";\n\n width: 100%;\n padding-bottom: calc(\n 100% * var(--sensitive-image-height) / var(--sensitive-image-width)\n );\n\n display: block;\n\n position: relative;\n z-index: -1;\n\n background-image: var(--sensitive-image);\n background-size: contain;\n background-clip: padding-box;\n\n filter: blur(20px) saturate(0);\n }\n }\n\n &__show {\n display: flex;\n align-items: center;\n justify-content: center;\n\n position: absolute;\n inset: 0;\n z-index: 1;\n\n font-size: 0;\n\n cursor: pointer;\n\n &::after {\n content: attr(data-action);\n\n padding: spacing.space(0.25) spacing.space(1);\n\n @include colour.colour-font(\"button-text\");\n @include typography.font-size(18);\n @include typography.main-font-weight-bold;\n\n @include colour.colour-background(\"button-background\");\n\n @include colour.colour-border(\"button-background\", $button-border-width);\n }\n\n &:hover {\n &::after {\n text-decoration: none;\n @include colour.colour-font(\"font-dark\");\n\n @include colour.colour-background(\"background\");\n }\n }\n }\n\n &__container {\n }\n\n &__image {\n width: 100%;\n }\n\n &__details[open] {\n &::after,\n .tna-sensitive-image__show {\n display: none;\n }\n }\n}\n","@use \"sass:math\";\n@use \"../variables/typography\";\n@use \"colour\";\n@use \"media\";\n\n@mixin font-size($font-size-px) {\n font-size: #{math.div($font-size-px, typography.$relative-1rem-px)}rem;\n}\n\n@mixin relative-font-size($font-size-px) {\n @warn \"relative-font-size() will soon be deprecated in favour of font-size().\";\n @include font-size($font-size-px);\n}\n\n@mixin main-font-weight {\n font-weight: typography.$main-font-weight;\n}\n\n@mixin main-font-weight-medium {\n font-weight: typography.$main-font-weight-medium;\n}\n\n@mixin main-font-weight-bold {\n font-weight: typography.$main-font-weight-bold;\n}\n\n@mixin main-font($bold: false) {\n font-family: typography.$main-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n font-variation-settings: \"wdth\" 100;\n @if $bold {\n @include main-font-weight-bold;\n } @else {\n @include main-font-weight;\n }\n}\n\n@mixin heading-font {\n font-family: typography.$heading-font-family;\n font-weight: typography.$heading-font-weight;\n}\n\n@mixin detail-font($bold: false) {\n font-family: typography.$detail-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n @if $bold {\n font-weight: typography.$detail-font-weight-bold;\n } @else {\n font-weight: typography.$detail-font-weight;\n }\n}\n\n@mixin detail-font-small {\n @include detail-font;\n @include font-size(14);\n line-height: 1.1;\n text-transform: uppercase;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n\n@mixin heading-generator(\n $font-size-default,\n $font-size-medium,\n $font-size-small,\n $font-size-tiny,\n $line-height\n) {\n $small-and-tiny-identical: $font-size-small == $font-size-tiny;\n $medium-small-and-tiny-identical: $font-size-medium == $font-size-small and\n $small-and-tiny-identical;\n $all-identical: $font-size-default == $font-size-medium and\n $medium-small-and-tiny-identical and $small-and-tiny-identical;\n line-height: $line-height;\n @include font-size($font-size-default);\n\n @if $all-identical != true {\n @if $medium-small-and-tiny-identical != true {\n @include media.on-medium {\n @include font-size($font-size-medium);\n }\n\n @if $small-and-tiny-identical != true {\n @include media.on-small {\n @include font-size($font-size-small);\n }\n\n @include media.on-tiny {\n @include font-size($font-size-tiny);\n }\n } @else {\n @include media.on-mobile {\n @include font-size($font-size-small);\n }\n }\n } @else {\n @include media.on-smaller-than-large {\n @include font-size($font-size-medium);\n }\n }\n }\n}\n","/*\n * ------------------------------------------\n * The typefaces, sizes and spacings that are\n * defined in this file have been selected to\n * ensure 100% match with the latest National\n * Archives brand guidelines - avoid changing\n * or overwriting any of these values without\n * signing off with the Digital Services team\n * first\n * ------------------------------------------\n */\n\n$relative-1rem-px: 16; // 16px = 1rem\n\n/*\n * ------------------------------------------\n * When true, use the included font files for\n * Open Sans and Roboto Mono, rather than the\n * versions hosted by Google Fonts\n * ------------------------------------------\n */\n$use-local-fonts: false !default;\n\n$body-font-size-px: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: 1.75 !default;\n\n$interactive-text-decoration-thickness: 3.5px !default;\n\n$main-font-family-name: \"Open Sans\" !default;\n$main-font-family:\n #{$main-font-family-name},\n sans-serif;\n$main-font-weight: 400 !default;\n$main-font-weight-medium: 600 !default;\n$main-font-weight-bold: 700 !default;\n$main-font-file: \"OpenSans-Regular.ttf\" !default;\n$main-font-file-medium: \"OpenSans-SemiBold.ttf\" !default;\n$main-font-file-bold: \"OpenSans-Bold.ttf\" !default;\n\n/*\n * ------------------------------------------\n * To use Supria Sans Condensed (which is the\n * approved heading typeface for The National\n * Archives), you need to obtain a licence to\n * properly embed the CSS files with the font\n * definitions in your service - check with a\n * member of the Digital Services team on how\n * to get a licence\n * ------------------------------------------\n */\n$heading-font-family-name: \"supria-sans-condensed\" !default;\n$heading-font-family:\n #{$heading-font-family-name},\n \"Arial Narrow\",\n sans-serif;\n$heading-font-weight: 500 !default;\n\n/*\n * ------------------------------------------\n * The detail font should be a monospace font\n * and is used for chips, supertitles as well\n * as the date search component\n * ------------------------------------------\n */\n$detail-font-family-name: \"Roboto Mono\" !default;\n$detail-font-family:\n #{$detail-font-family-name},\n monospace;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n$detail-font-file: \"RobotoMono-Regular.ttf\" !default;\n$detail-font-file-bold: \"RobotoMono-Medium.ttf\" !default;\n\n$heading-xl-font-size-default: 64 !default;\n$heading-xl-font-size-medium: 48 !default;\n$heading-xl-font-size-small: 36 !default;\n$heading-xl-font-size-tiny: $heading-xl-font-size-small !default;\n$heading-xl-line-height: 1.1 !default;\n\n$heading-l-font-size-default: 36 !default;\n$heading-l-font-size-medium: 30 !default;\n$heading-l-font-size-small: 28 !default;\n$heading-l-font-size-tiny: 25 !default;\n$heading-l-line-height: 1.3 !default;\n\n$heading-m-font-size-default: 22 !default;\n$heading-m-font-size-medium: 21 !default;\n$heading-m-font-size-small: 20 !default;\n$heading-m-font-size-tiny: 19 !default;\n$heading-m-line-height: 1.6 !default;\n\n$heading-s-font-size-default: 18 !default;\n$heading-s-font-size-medium: $heading-s-font-size-default !default;\n$heading-s-font-size-small: $heading-s-font-size-default !default;\n$heading-s-font-size-tiny: $heading-s-font-size-default !default;\n$heading-s-line-height: 1.6 !default;\n","@use \"sass:list\";\n@use \"sass:map\";\n@use \"../variables/borders\";\n@use \"../variables/colour\";\n@use \"../tools/media\";\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)} if($important, !important, null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width colour-var($colour) $style if($important, !important, null);\n } @else {\n outline-color: colour-var($colour) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if($important, !important, null);\n}\n\n@mixin thick-keyline($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline-dark\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline-dark\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"accent-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"accent-border\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"form-error\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"form-error\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour) {\n @if $direction != \"\" {\n border-#{$direction}: borders.$thick-border-width\n #{brand-colour($brandColour)}\n solid;\n } @else {\n border: borders.$thick-border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n// Use light theme colours (except for \"form-error\")\n%light {\n @include colour-css-vars(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\"form-error\");\n }\n}\n\n@mixin light {\n @extend %light;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n --accent-border: var(--font-base);\n --accent-list-marker: var(--font-base);\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n }\n\n .tna-template--dark-theme & {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n\n @include colour-background(\"background\");\n @include colour-font(\"font-base\");\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n// Remove accent and contrast values (except for \"form-error\")\n%plain {\n @include colour-css-vars(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\"form-error\");\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n @include colour-css-vars-dark(\"form-error\");\n }\n\n @media (prefers-contrast: more) and (prefers-color-scheme: dark) {\n @include colour-css-vars-high-contrast-dark(\"form-error\");\n }\n }\n\n .tna-template--dark-theme & {\n @include colour-css-vars-dark(\"form-error\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast-dark(\"form-error\");\n }\n }\n\n @include colour-background(\"background\");\n}\n\n@mixin plain {\n @extend %plain;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-border: #{colour.brand-colour(\"yellow\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"brown\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accent-text: #{colour.brand-colour(\"white\")} !important;\n --button-accent-background: #{colour.brand-colour(\"brown\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accent-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --accent-border: #{colour.brand-colour(\"black\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"grey\")} !important;\n --button-accent-text: #{colour.brand-colour(\"black\")} !important;\n --button-accent-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %accent-lighter-text;\n @extend %black-accent;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --accent-border: #{colour.brand-colour(\"pink\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"pink\")} !important;\n --button-accent-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %accent-lighter-text;\n @extend %pink-accent;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --accent-border: #{colour.brand-colour(\"orange\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"orange\")} !important;\n --button-accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %accent-lighter-text;\n @extend %orange-accent;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --accent-border: #{colour.brand-colour(\"green\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"green\")} !important;\n --button-accent-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %accent-lighter-text;\n @extend %green-accent;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --accent-border: #{colour.brand-colour(\"blue\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"blue\")} !important;\n --button-accent-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %accent-lighter-text;\n @extend %blue-accent;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TNAFrontend",[],t):"object"==typeof exports?exports.TNAFrontend=t():e.TNAFrontend=t()}(self,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function r(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}e.r(t),e.d(t,{SensitiveImage:()=>n});var n=function(){return e=function e(t){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$module=t,this.$imageDetails=t&&t.querySelector(".tna-sensitive-image__details"),this.$image=t&&t.querySelector(".tna-sensitive-image__image"),this.imageIsVisible=!1,this.$module&&this.$imageDetails&&this.$image&&this.$imageDetails.addEventListener("toggle",(function(){return o.handleImageDetailsToggle()}))},(t=[{key:"handleImageDetailsToggle",value:function(){this.$imageDetails.hasAttribute("open")&&this.$image.focus({preventScroll:!0,focusVisible:!0})}}])&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();return t})()));
2
- //# sourceMappingURL=sensitive-image.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components/sensitive-image/sensitive-image.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,IAEzBD,EAAkB,YAAIC,GACvB,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,8sBCLvD,IAAMC,EAAc,WAexB,O,EAdD,SAAAA,EAAYC,GAAS,IAAAC,EAAA,M,4FAAAC,CAAA,KAAAH,GACnBI,KAAKH,QAAUA,EACfG,KAAKC,cACHJ,GAAWA,EAAQK,cAAc,iCACnCF,KAAKG,OACHN,GAAWA,EAAQK,cAAc,+BACnCF,KAAKI,gBAAiB,EAEjBJ,KAAKH,SAAYG,KAAKC,eAAkBD,KAAKG,QAGlDH,KAAKC,cAAcI,iBAAiB,UAAU,kBAC5CP,EAAKQ,0BAA0B,GAEnC,G,EAAC,EAAAxB,IAAA,2BAAAa,MAED,WACMK,KAAKC,cAAcM,aAAa,SAClCP,KAAKG,OAAOK,MAAM,CAAEC,eAAe,EAAMC,cAAc,GAE3D,M,6EAAC,CArBwB,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/sensitive-image/sensitive-image.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\"] = 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};","export class SensitiveImage {\n constructor($module) {\n this.$module = $module;\n this.$imageDetails =\n $module && $module.querySelector(\".tna-sensitive-image__details\");\n this.$image =\n $module && $module.querySelector(\".tna-sensitive-image__image\");\n this.imageIsVisible = false;\n\n if (!this.$module || !this.$imageDetails || !this.$image) {\n return;\n }\n this.$imageDetails.addEventListener(\"toggle\", () =>\n this.handleImageDetailsToggle(),\n );\n }\n\n handleImageDetailsToggle() {\n if (this.$imageDetails.hasAttribute(\"open\")) {\n this.$image.focus({ preventScroll: true, focusVisible: true });\n }\n }\n}\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","SensitiveImage","$module","_this","_classCallCheck","this","$imageDetails","querySelector","$image","imageIsVisible","addEventListener","handleImageDetailsToggle","hasAttribute","focus","preventScroll","focusVisible"],"sourceRoot":""}
@@ -1,23 +0,0 @@
1
- export class SensitiveImage {
2
- constructor($module) {
3
- this.$module = $module;
4
- this.$imageDetails =
5
- $module && $module.querySelector(".tna-sensitive-image__details");
6
- this.$image =
7
- $module && $module.querySelector(".tna-sensitive-image__image");
8
- this.imageIsVisible = false;
9
-
10
- if (!this.$module || !this.$imageDetails || !this.$image) {
11
- return;
12
- }
13
- this.$imageDetails.addEventListener("toggle", () =>
14
- this.handleImageDetailsToggle(),
15
- );
16
- }
17
-
18
- handleImageDetailsToggle() {
19
- if (this.$imageDetails.hasAttribute("open")) {
20
- this.$image.focus({ preventScroll: true, focusVisible: true });
21
- }
22
- }
23
- }
@@ -1,85 +0,0 @@
1
- @use "../../tools/colour";
2
- @use "../../tools/spacing";
3
- @use "../../tools/typography";
4
-
5
- .tna-sensitive-image {
6
- $button-border-width: 4px !default;
7
-
8
- &__warning {
9
- }
10
-
11
- &__details {
12
- position: relative;
13
-
14
- &::after {
15
- content: "";
16
-
17
- width: 100%;
18
- padding-bottom: calc(
19
- 100% * var(--sensitive-image-height) / var(--sensitive-image-width)
20
- );
21
-
22
- display: block;
23
-
24
- position: relative;
25
- z-index: -1;
26
-
27
- background-image: var(--sensitive-image);
28
- background-size: contain;
29
- background-clip: padding-box;
30
-
31
- filter: blur(20px) saturate(0);
32
- }
33
- }
34
-
35
- &__show {
36
- display: flex;
37
- align-items: center;
38
- justify-content: center;
39
-
40
- position: absolute;
41
- inset: 0;
42
- z-index: 1;
43
-
44
- font-size: 0;
45
-
46
- cursor: pointer;
47
-
48
- &::after {
49
- content: attr(data-action);
50
-
51
- padding: spacing.space(0.25) spacing.space(1);
52
-
53
- @include colour.colour-font("button-text");
54
- @include typography.font-size(18);
55
- @include typography.main-font-weight-bold;
56
-
57
- @include colour.colour-background("button-background");
58
-
59
- @include colour.colour-border("button-background", $button-border-width);
60
- }
61
-
62
- &:hover {
63
- &::after {
64
- text-decoration: none;
65
- @include colour.colour-font("font-dark");
66
-
67
- @include colour.colour-background("background");
68
- }
69
- }
70
- }
71
-
72
- &__container {
73
- }
74
-
75
- &__image {
76
- width: 100%;
77
- }
78
-
79
- &__details[open] {
80
- &::after,
81
- .tna-sensitive-image__show {
82
- display: none;
83
- }
84
- }
85
- }
@@ -1,86 +0,0 @@
1
- import SensitiveImage from "./template.njk";
2
- import macroOptions from "./macro-options.json";
3
- import { within, userEvent, expect } from "@storybook/test";
4
-
5
- const argTypes = {
6
- src: { control: "text" },
7
- alt: { control: "text" },
8
- warning: { control: "text" },
9
- action: { control: "text" },
10
- classes: { control: "text" },
11
- attributes: { control: "object" },
12
- };
13
-
14
- Object.keys(argTypes).forEach((argType) => {
15
- argTypes[argType].description = macroOptions.find(
16
- (option) => option.name === argType,
17
- )?.description;
18
- });
19
-
20
- export default {
21
- title: "Components/Sensitive image",
22
- argTypes,
23
- };
24
-
25
- const Template = ({ image, warning, action, classes, attributes }) =>
26
- SensitiveImage({
27
- params: {
28
- image,
29
- warning,
30
- action,
31
- classes,
32
- attributes,
33
- },
34
- });
35
-
36
- export const Standard = Template.bind({});
37
- Standard.args = {
38
- image: {
39
- src: "https://picsum.photos/id/237/800/600",
40
- alt: "A placeholder image",
41
- width: 800,
42
- height: 600,
43
- },
44
- warning: "This is a gory photo",
45
- action: "Show me the gory photo",
46
- classes: "tna-sensitive-image--demo",
47
- attributes: {
48
- "data-testid": "sensitive-image-test",
49
- },
50
- };
51
-
52
- export const Test = Template.bind({});
53
- Test.parameters = {
54
- chromatic: { disableSnapshot: true },
55
- };
56
- Test.args = {
57
- image: {
58
- src: "https://picsum.photos/id/237/800/600",
59
- alt: "A placeholder image",
60
- width: 800,
61
- height: 600,
62
- },
63
- warning: "This is a gory photo",
64
- action: "Show me the gory photo",
65
- classes: "tna-sensitive-image--demo",
66
- attributes: {
67
- "data-testid": "sensitive-image-test",
68
- },
69
- };
70
-
71
- Test.play = async ({ args, canvasElement }) => {
72
- await new Promise((r) => setTimeout(r, 100));
73
-
74
- const canvas = within(canvasElement);
75
-
76
- const image = canvas.getByAltText(args.image.alt);
77
- await expect(image).not.toBeVisible();
78
- const warning = canvas.getByText(args.warning);
79
- await expect(warning).toBeVisible();
80
- const summaryOpen = canvas.getByText(args.action);
81
- await expect(summaryOpen).toBeVisible();
82
-
83
- await userEvent.click(summaryOpen);
84
- await expect(image).toBeVisible();
85
- await expect(warning).toBeVisible();
86
- };
@@ -1,11 +0,0 @@
1
- {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
- {%- set classes = containerClasses | join(' ') -%}
3
- <div class="tna-sensitive-image{% if classes %} {{ classes }}{% endif %}" data-module="tna-sensitive-image" style="--sensitive-image: url('{{ params.image.src }}'); --sensitive-image-width: {{ params.image.width }}; --sensitive-image-height: {{ params.image.height }}"{% for attribute, value in params.attributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}>
4
- <p class="tna-sensitive-image__warning">{{ params.warning }}</p>
5
- <details class="tna-sensitive-image__details">
6
- <summary class="tna-sensitive-image__show" data-action="{{ params.action }}">{{ params.action }}</summary>
7
- <div class="tna-sensitive-image__container">
8
- <img src="{{ params.image.src }}" alt="{{ params.image.alt }}" class="tna-sensitive-image__image">
9
- </div>
10
- </details>
11
- </div>
@@ -1,227 +0,0 @@
1
- import Sidebar from "./template.njk";
2
- import macroOptions from "./macro-options.json";
3
-
4
- const argTypes = {
5
- title: { control: "text" },
6
- headingLevel: { control: { type: "number", min: 1, max: 6 } },
7
- headingSize: { control: "inline-radio", options: ["s", "m", "l"] },
8
- items: { control: "object" },
9
- type: { control: "radio", options: ["contents", "sections", "pages"] },
10
- sticky: { control: "boolean" },
11
- classes: { control: "text" },
12
- attributes: { control: "object" },
13
- };
14
-
15
- Object.keys(argTypes).forEach((argType) => {
16
- argTypes[argType].description = macroOptions.find(
17
- (option) => option.name === argType,
18
- )?.description;
19
- });
20
-
21
- export default {
22
- title: "Components/Sidebar",
23
- argTypes,
24
- };
25
-
26
- const Template = ({
27
- title,
28
- headingLevel,
29
- headingSize,
30
- items,
31
- type,
32
- sticky,
33
- classes,
34
- attributes,
35
- }) =>
36
- Sidebar({
37
- params: {
38
- title,
39
- headingLevel,
40
- headingSize,
41
- items,
42
- type,
43
- sticky,
44
- classes,
45
- attributes,
46
- },
47
- });
48
-
49
- export const Contents = Template.bind({});
50
- Contents.args = {
51
- title: "Contents",
52
- headingLevel: 2,
53
- items: [
54
- {
55
- text: "Accessibility statement",
56
- href: "#",
57
- },
58
- {
59
- text: "Feedback and contact information",
60
- href: "#",
61
- },
62
- {
63
- text: "Enforcement procedure",
64
- href: "#",
65
- },
66
- {
67
- text: "Compliance status",
68
- href: "#",
69
- },
70
- {
71
- text: "Non-accessible content",
72
- href: "#",
73
- children: [
74
- {
75
- text: "Non-compliance with the accessibility regulations",
76
- href: "#",
77
- },
78
- {
79
- text: "Disproportionate burden",
80
- href: "#",
81
- },
82
- {
83
- text: "Content that’s not within the scope of the accessibility regulations",
84
- href: "#",
85
- },
86
- ],
87
- },
88
- {
89
- text: "Other identified and tracked accessibility concerns",
90
- href: "#",
91
- },
92
- {
93
- text: "Testing our products for accessibility",
94
- href: "#",
95
- },
96
- {
97
- text: "How the National Archives Design System team makes their websites accessible",
98
- href: "#",
99
- },
100
- {
101
- text: "Preparation of this accessibility statement",
102
- href: "#",
103
- },
104
- ],
105
- type: "contents",
106
- classes: "tna-sidebar--demo",
107
- };
108
-
109
- export const Sections = Template.bind({});
110
- Sections.args = {
111
- title: "On this page",
112
- headingLevel: 2,
113
- items: [
114
- {
115
- text: "A band of guerrillas",
116
- href: "#",
117
- current: true,
118
- },
119
- {
120
- text: "War begins",
121
- href: "#",
122
- },
123
- {
124
- text: "Forming the ERC",
125
- href: "#",
126
- },
127
- {
128
- text: "The fall of Hong Kong",
129
- href: "#",
130
- },
131
- {
132
- text: "The ERC's guerrilla activities",
133
- href: "#",
134
- },
135
- {
136
- text: "Chan Chak’s escape",
137
- href: "#",
138
- },
139
- {
140
- text: "Francis Lee and Lieutenant Colonel Ride",
141
- href: "#",
142
- },
143
- {
144
- text: "Raymond Wong's recommendation",
145
- href: "#",
146
- },
147
- {
148
- text: "Co-operation between the ERC and BAAG",
149
- href: "#",
150
- },
151
- {
152
- text: "The ERC's legacy",
153
- href: "#",
154
- },
155
- {
156
- text: "Exhibition",
157
- href: "#",
158
- },
159
- ],
160
- type: "sections",
161
- classes: "tna-sidebar--demo",
162
- };
163
-
164
- export const Pages = Template.bind({});
165
- Pages.args = {
166
- title: "Components",
167
- headingLevel: 2,
168
- items: [
169
- {
170
- text: "Accordion",
171
- href: "#",
172
- },
173
- {
174
- text: "Breadcrumbs",
175
- href: "#",
176
- },
177
- {
178
- text: "Button",
179
- href: "#",
180
- current: true,
181
- children: [
182
- {
183
- text: "Status",
184
- href: "#",
185
- },
186
- {
187
- text: "Icons",
188
- href: "#",
189
- },
190
- {
191
- text: "Button groups",
192
- href: "#",
193
- },
194
- ],
195
- },
196
- {
197
- text: "Card",
198
- href: "#",
199
- },
200
- {
201
- text: "Checkboxes",
202
- href: "#",
203
- },
204
- {
205
- text: "Compound filters",
206
- href: "#",
207
- },
208
- {
209
- text: "Cookie banner",
210
- href: "#",
211
- },
212
- {
213
- text: "Date input",
214
- href: "#",
215
- },
216
- {
217
- text: "Date search",
218
- href: "#",
219
- },
220
- {
221
- text: "Details",
222
- href: "#",
223
- },
224
- ],
225
- type: "pages",
226
- classes: "tna-sidebar--demo",
227
- };