@nationalarchives/frontend 1.2.0 → 1.3.1

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 (132) hide show
  1. package/nationalarchives/all+analytics.js +1 -1
  2. package/nationalarchives/all+analytics.js.map +1 -1
  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/analytics.js +1 -1
  8. package/nationalarchives/analytics.js.map +1 -1
  9. package/nationalarchives/components/_presentation.scss +1 -1
  10. package/nationalarchives/components/accordion/accordion.css.map +1 -1
  11. package/nationalarchives/components/accordion/accordion.js +1 -1
  12. package/nationalarchives/components/accordion/accordion.js.map +1 -1
  13. package/nationalarchives/components/back-link/back-link.css.map +1 -1
  14. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  15. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  17. package/nationalarchives/components/button/button.css.map +1 -1
  18. package/nationalarchives/components/button/button.scss +0 -1
  19. package/nationalarchives/components/card/card.css +1 -1
  20. package/nationalarchives/components/card/card.css.map +1 -1
  21. package/nationalarchives/components/card/card.scss +2 -2
  22. package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
  23. package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
  24. package/nationalarchives/components/checkboxes/checkboxes.scss +26 -13
  25. package/nationalarchives/components/checkboxes/fixtures.json +52 -0
  26. package/nationalarchives/components/code-block/code-block.css.map +1 -1
  27. package/nationalarchives/components/code-block/code-block.js +1 -1
  28. package/nationalarchives/components/code-block/code-block.js.map +1 -1
  29. package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
  30. package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
  31. package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
  32. package/nationalarchives/components/cookie-banner/cookie-banner.mjs +14 -31
  33. package/nationalarchives/components/cookie-banner/fixtures.json +0 -9
  34. package/nationalarchives/components/cookie-banner/macro-options.json +0 -7
  35. package/nationalarchives/components/cookie-banner/template.njk +0 -1
  36. package/nationalarchives/components/date-input/date-input.css +1 -1
  37. package/nationalarchives/components/date-input/date-input.css.map +1 -1
  38. package/nationalarchives/components/date-input/date-input.js +1 -1
  39. package/nationalarchives/components/date-input/date-input.js.map +1 -1
  40. package/nationalarchives/components/date-input/fixtures.json +24 -0
  41. package/nationalarchives/components/date-search/date-search.css +1 -1
  42. package/nationalarchives/components/date-search/date-search.css.map +1 -1
  43. package/nationalarchives/components/details/details.css.map +1 -1
  44. package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
  45. package/nationalarchives/components/error-summary/error-summary.js +1 -1
  46. package/nationalarchives/components/error-summary/error-summary.js.map +1 -1
  47. package/nationalarchives/components/fieldset/fieldset.css.map +1 -1
  48. package/nationalarchives/components/file-input/file-input.css.map +1 -1
  49. package/nationalarchives/components/file-input/file-input.js +1 -1
  50. package/nationalarchives/components/file-input/file-input.js.map +1 -1
  51. package/nationalarchives/components/files-list/files-list.css.map +1 -1
  52. package/nationalarchives/components/footer/footer.css.map +1 -1
  53. package/nationalarchives/components/footer/footer.js +1 -1
  54. package/nationalarchives/components/footer/footer.js.map +1 -1
  55. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  56. package/nationalarchives/components/gallery/gallery.js +1 -1
  57. package/nationalarchives/components/gallery/gallery.js.map +1 -1
  58. package/nationalarchives/components/global-header/global-header.css.map +1 -1
  59. package/nationalarchives/components/global-header/global-header.js +1 -1
  60. package/nationalarchives/components/global-header/global-header.js.map +1 -1
  61. package/nationalarchives/components/header/header.css.map +1 -1
  62. package/nationalarchives/components/header/header.js +1 -1
  63. package/nationalarchives/components/header/header.js.map +1 -1
  64. package/nationalarchives/components/hero/fixtures.json +7 -7
  65. package/nationalarchives/components/hero/hero.css.map +1 -1
  66. package/nationalarchives/components/hero/template.njk +1 -1
  67. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  68. package/nationalarchives/components/panel/panel.css.map +1 -1
  69. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  70. package/nationalarchives/components/picture/picture.css +1 -1
  71. package/nationalarchives/components/picture/picture.css.map +1 -1
  72. package/nationalarchives/components/picture/picture.js +1 -1
  73. package/nationalarchives/components/picture/picture.js.map +1 -1
  74. package/nationalarchives/components/picture/picture.scss +4 -0
  75. package/nationalarchives/components/radios/fixtures.json +52 -0
  76. package/nationalarchives/components/radios/radios.css +1 -1
  77. package/nationalarchives/components/radios/radios.css.map +1 -1
  78. package/nationalarchives/components/radios/radios.scss +26 -13
  79. package/nationalarchives/components/search-field/search-field.css +1 -1
  80. package/nationalarchives/components/search-field/search-field.css.map +1 -1
  81. package/nationalarchives/components/secondary-navigation/secondary-navigation.css.map +1 -1
  82. package/nationalarchives/components/select/select.css +1 -1
  83. package/nationalarchives/components/select/select.css.map +1 -1
  84. package/nationalarchives/components/sidebar/sidebar.css.map +1 -1
  85. package/nationalarchives/components/sidebar/sidebar.js +1 -1
  86. package/nationalarchives/components/sidebar/sidebar.js.map +1 -1
  87. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  88. package/nationalarchives/components/skip-link/skip-link.js +1 -1
  89. package/nationalarchives/components/skip-link/skip-link.js.map +1 -1
  90. package/nationalarchives/components/tabs/macro-options.json +21 -0
  91. package/nationalarchives/components/tabs/tabs.css +1 -1
  92. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  93. package/nationalarchives/components/tabs/tabs.js +1 -1
  94. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  95. package/nationalarchives/components/tabs/tabs.mjs +22 -6
  96. package/nationalarchives/components/tabs/tabs.scss +31 -33
  97. package/nationalarchives/components/tabs/template.njk +3 -3
  98. package/nationalarchives/components/tags/_index.scss +1 -0
  99. package/nationalarchives/components/tags/fixtures.json +194 -0
  100. package/nationalarchives/components/tags/macro-options.json +73 -0
  101. package/nationalarchives/components/tags/macro.njk +3 -0
  102. package/nationalarchives/components/tags/tags.css +1 -0
  103. package/nationalarchives/components/tags/tags.css.map +1 -0
  104. package/nationalarchives/components/tags/tags.scss +68 -0
  105. package/nationalarchives/components/tags/template.njk +20 -0
  106. package/nationalarchives/components/text-input/text-input.css +1 -1
  107. package/nationalarchives/components/text-input/text-input.css.map +1 -1
  108. package/nationalarchives/components/text-input/text-input.js +1 -1
  109. package/nationalarchives/components/text-input/text-input.js.map +1 -1
  110. package/nationalarchives/components/textarea/textarea.css +1 -1
  111. package/nationalarchives/components/textarea/textarea.css.map +1 -1
  112. package/nationalarchives/components/textarea/textarea.js +1 -1
  113. package/nationalarchives/components/textarea/textarea.js.map +1 -1
  114. package/nationalarchives/components/warning/warning.css.map +1 -1
  115. package/nationalarchives/error-page.css.map +1 -1
  116. package/nationalarchives/print.css.map +1 -1
  117. package/nationalarchives/prototype-kit.css +1 -1
  118. package/nationalarchives/prototype-kit.css.map +1 -1
  119. package/nationalarchives/templates/fixtures.json +25 -0
  120. package/nationalarchives/templates/layouts/_generic.njk +14 -2
  121. package/nationalarchives/tools/_colour.scss +5 -0
  122. package/nationalarchives/variables/_a11y.scss +2 -0
  123. package/nationalarchives/variables/_forms.scss +2 -0
  124. package/package.json +2 -2
  125. package/nationalarchives/components/quick-filters/_index.scss +0 -1
  126. package/nationalarchives/components/quick-filters/fixtures.json +0 -131
  127. package/nationalarchives/components/quick-filters/macro-options.json +0 -54
  128. package/nationalarchives/components/quick-filters/macro.njk +0 -3
  129. package/nationalarchives/components/quick-filters/quick-filters.css +0 -1
  130. package/nationalarchives/components/quick-filters/quick-filters.css.map +0 -1
  131. package/nationalarchives/components/quick-filters/quick-filters.scss +0 -70
  132. package/nationalarchives/components/quick-filters/template.njk +0 -13
@@ -31,6 +31,27 @@
31
31
  }
32
32
  ]
33
33
  },
34
+ {
35
+ "name": "small",
36
+ "type": "boolean",
37
+ "required": false,
38
+ "description": "If `true`, make the tabs smaller.",
39
+ "default": false
40
+ },
41
+ {
42
+ "name": "activeTabOnLoad",
43
+ "type": "number",
44
+ "required": false,
45
+ "description": "If set, the index of the tab to be active on load. Defaults to the first tab. Use `-1` to have no tab active on load.",
46
+ "default": 0
47
+ },
48
+ {
49
+ "name": "allowClose",
50
+ "type": "boolean",
51
+ "required": false,
52
+ "description": "If `true`, allow tabs to be closed.",
53
+ "default": false
54
+ },
34
55
  {
35
56
  "name": "classes",
36
57
  "type": "string",
@@ -1 +1 @@
1
- .tna-tabs--tint.tna-tabs--interactive .tna-tabs__button[aria-selected=true],.tna-tabs--tint.tna-tabs--interactive .tna-tabs__button:hover .tna-tabs__button-inner,.tna-tabs--tint.tna-tabs--interactive .tna-tabs__button:focus-visible .tna-tabs__button-inner,.tna-tabs--tint.tna-tabs--interactive .tna-tabs__items{--background: var(--background-tint);background-color:var(--background, #f4f4f4)}.tna-tabs__button:active{outline:3px #010101 solid !important;outline-offset:3px !important;box-shadow:0 0 0 3px #fc0 !important;transition:outline-offset .1s,box-shadow .1s}.tna-template--dark-theme .tna-tabs__button:active{outline-color:#fc0 !important;box-shadow:0 0 0 3px #010101 !important}@media(prefers-color-scheme: dark){.tna-template--system-theme .tna-tabs__button:active{outline-color:#fc0 !important;box-shadow:0 0 0 3px #010101 !important}}.tna-tabs{margin-top:2rem}.tna-tabs:first-child{margin-top:0}.tna-tabs__list{margin:0;padding:0;display:flex;flex-wrap:nowrap;align-items:stretch;gap:0.5rem;position:relative;z-index:2;list-style:none}.tna-tabs--small .tna-tabs__list{gap:0.25rem}.tna-tabs__button{padding:5px 0;position:relative;text-align:center;background:rgba(0,0,0,0);border:none;border:1px rgba(0,0,0,0) solid;border-bottom:none;border-radius:2px 2px 0 0;cursor:pointer}.tna-tabs__button[aria-selected=true]{padding-top:0;border-color:var(--keyline, rgba(38, 38, 42, 0.25))}.tna-tabs__button[aria-selected=true]::after{content:"";height:1px;position:absolute;top:100%;right:0;left:0;background-color:var(--background, #f4f4f4)}.tna-tabs__button-inner{padding:0.5rem 0.75rem;display:block;text-decoration:underline;color:var(--font-dark, rgb(1, 1, 1))}.tna-tabs--small .tna-tabs__button-inner{padding:0.25rem 0.5rem 0.125rem;font-size:1rem}.tna-tabs__button:hover .tna-tabs__button-inner,.tna-tabs__button:focus-visible .tna-tabs__button-inner{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}.tna-tabs__button[aria-selected=true] .tna-tabs__button-inner{text-decoration:none;border-top:5px var(--accent-border, rgb(140, 150, 148)) solid;border-radius:1px 1px 0 0}.tna-tabs__items{display:flex;flex-direction:column;gap:2rem;position:relative;z-index:1}.tna-tabs__item{border-radius:0 0 2px 2px}.tna-tabs--interactive .tna-tabs__item{padding:1rem;border:1px var(--keyline, rgba(38, 38, 42, 0.25)) solid}/*# sourceMappingURL=tabs.css.map */
1
+ .tna-tabs__button:active{outline:3px #010101 solid !important;outline-offset:3px !important;box-shadow:0 0 0 3px #fc0 !important;transition:outline-offset .1s,box-shadow .1s}.tna-template--dark-theme .tna-tabs__button:active{outline-color:#fc0 !important;box-shadow:0 0 0 3px #010101 !important}@media(prefers-color-scheme: dark){.tna-template--system-theme .tna-tabs__button:active{outline-color:#fc0 !important;box-shadow:0 0 0 3px #010101 !important}}.tna-tabs__item:focus:not(:focus-visible){outline:none !important;box-shadow:none !important}.tna-tabs{margin-top:2rem}.tna-tabs:first-child{margin-top:0}.tna-tabs__list{margin:0;padding:0;display:flex;flex-wrap:nowrap;align-items:stretch;position:relative;z-index:2;list-style:none}.tna-tabs__button{position:relative;text-align:center;background:rgba(0,0,0,0);border:none;border:1px rgba(0,0,0,0) solid;border-bottom:none;border-radius:2px;cursor:pointer}.tna-tabs__button[aria-selected=true]{padding-top:0;border-color:var(--keyline, rgba(38, 38, 42, 0.25));border-radius:2px 2px 0 0;background-color:var(--background, #f4f4f4)}.tna-tabs__button[aria-selected=true]:focus{border-radius:2px}.tna-tabs__button-inner{margin:0.25rem 0.25rem calc(0.25rem + 1px);padding:0.375rem 0.75rem;display:block;text-decoration:underline;color:var(--font-base, #343338);background-color:var(--background-tint, rgb(217, 217, 214));border-radius:2px}.tna-tabs--small .tna-tabs__button-inner{margin:0.125rem 0.125rem calc(0.125rem + 1px);padding:0.25rem 0.5rem;font-size:1rem}.tna-tabs__button:hover .tna-tabs__button-inner,.tna-tabs__button:focus-visible .tna-tabs__button-inner{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}.tna-tabs__button[aria-selected=true] .tna-tabs__button-inner{text-decoration:none;background:rgba(0,0,0,0);border-radius:1px 1px 0 0}.tna-tabs__items{display:flex;flex-direction:column;gap:2rem;position:relative;z-index:1}.tna-tabs__items:has(:focus-visible){z-index:3}.tna-tabs__item{margin-top:-1px;border-radius:.1px .1px 2px 2px}.tna-tabs--interactive .tna-tabs__item{padding:1rem;border:1px var(--keyline, rgba(38, 38, 42, 0.25)) solid}/*# sourceMappingURL=tabs.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_a11y.scss","../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/tabs/tabs.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss"],"names":[],"mappings":"AAgTA,uTACE,qCAhOA,4CCxDF,yBACE,qCACA,8BAEA,qCAGA,WACE,kCAGF,mDACE,8BAEA,wCAKA,mCADF,qDAEI,8BAEA,yCCrBN,UACE,gBAUA,sBACE,aC3BF,gBACE,SACA,UAEA,aACA,iBACA,oBACA,WAEA,kBACA,UAEA,gBAGF,iCACE,YAGF,kBACE,cAEA,kBAEA,kBAEA,yBAEA,YAEA,+BACA,mBAEA,0BAGA,eAMA,sCACE,cH4DA,oDGxDA,6CACE,WAEA,WAEA,kBACA,SACA,QACA,OHeN,4CGRA,wBACE,uBAEA,cAEA,0BHDF,qCGMA,yCACE,gCC9EF,eDmFA,wGCtBA,0BACA,0BCpCsC,QDqCtC,sBCvCoC,OFgEpC,8DACE,qBHIE,8DGDF,0BAIF,iBACE,aACA,sBACA,SAEA,kBACA,UAGF,gBACE,0BAIF,uCACE,aHRE","file":"tabs.css","sourcesContent":["@use \"sass:list\";\n@use \"sass:map\";\n@use \"sass:meta\";\n@use \"../variables/borders\";\n@use \"../variables/forms\";\n@use \"../variables/colour\";\n@use \"../variables/features\";\n@use \"../tools/media\";\n\n$base-colours: (\n \"background\",\n \"font-base\",\n \"font-dark\",\n \"font-light\",\n \"icon-light\",\n \"link\",\n \"link-visited\",\n \"keyline\",\n \"keyline-dark\"\n);\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 @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\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 @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\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 @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\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 @if list.index((\"keyline\", \"keyline-dark\"), $name) {\n --base-#{$name}: #{$value};\n }\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(sass($important): !important; else: null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour)\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)}\n if(sass($important): !important; else: 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(sass($important): !important; else: null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if(sass($important): !important; else: null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n outline-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n%colour-input {\n @include colour-font(\"input-foreground\");\n @include colour-background(\"input-background\");\n @include colour-border(\"input-border\", forms.$form-field-border-width);\n}\n\n@mixin colour-input() {\n @extend %colour-input;\n}\n\n@mixin thick-keyline($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline-dark\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline-dark\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"accent-border\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"accent-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n $border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"form-error-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour, $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width #{brand-colour($brandColour)} solid;\n } @else {\n border: $border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n@mixin thick-keyline-transparent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width transparent solid;\n } @else {\n border: $border-width transparent solid;\n }\n}\n\n%always-light {\n @include colour-css-vars;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast;\n }\n}\n\n@mixin always-light {\n @extend %always-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-border: var(--accent-border-bright);\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-border: var(--accent-border-bright);\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%base {\n @each $name, $value in $base-colours {\n --#{$name}: var(--base-#{$value});\n }\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin base {\n @extend %base;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\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-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\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(--accent-background);\n\n @include colour-background(\"background\");\n @include colour-font(\"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 --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-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\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 --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-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n}\n\n@mixin accent-light {\n @extend %accent-light;\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-border-bright: #{colour.brand-colour(\"yellow\")} !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.7)} !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-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"yellow\")} !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.7)} !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-accented-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-border-bright: #{colour.brand-colour(\"grey\")} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-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(\"maroon\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"pink\")} !important;\n --button-accented-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(\"chestnut\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"orange\")} !important;\n --button-accented-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(\"forest\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"green\")} !important;\n --button-accented-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(\"navy\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"blue\")} !important;\n --button-accented-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\n%image-loader-background {\n background: linear-gradient(\n -45deg,\n rgb(0 0 0 / 25%),\n rgb(255 255 255 / 25%),\n rgb(0 0 0 / 25%)\n );\n background-size: 500% 500%;\n background-position: 0 50%;\n\n animation: image-loader-background ease-in-out 1.2s infinite;\n\n @media (prefers-reduced-motion) {\n animation: none !important;\n }\n}\n\n@mixin image-loader-background {\n @if features.$image-loader-animations {\n @extend %image-loader-background;\n }\n}\n","@use \"../variables/a11y\";\n@use \"colour\";\n@use \"borders\";\n\n@mixin visually-hidden {\n width: 1px !important;\n height: 1px !important;\n margin: 0 !important;\n padding: 0 !important;\n\n overflow: hidden !important;\n\n position: absolute !important;\n top: -9999px !important;\n left: -9999px !important;\n z-index: -1 !important;\n\n background-color: transparent !important;\n\n border: 0 !important;\n\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n}\n\n%focus-outline {\n outline: a11y.$focus-outline-outer-width colour.brand-colour(\"black\") solid !important;\n outline-offset: a11y.$focus-outline-inner-width !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"yellow\") !important;\n\n transition:\n outline-offset 0.1s,\n box-shadow 0.1s;\n\n .tna-template--dark-theme & {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"black\") !important;\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"black\") !important;\n }\n }\n}\n\n@mixin focus-outline {\n @extend %focus-outline;\n}\n\n@mixin no-focus-outline {\n outline: none !important;\n\n box-shadow: none !important;\n}\n\n%active-outline {\n outline: a11y.$focus-outline-active-outer-width colour.brand-colour(\"black\")\n solid !important;\n outline-offset: a11y.$focus-outline-active-inner-width !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"yellow\") !important;\n\n transition: none;\n\n .tna-template--dark-theme & {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"black\") !important;\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"black\") !important;\n }\n }\n}\n\n@mixin active-outline {\n @extend %active-outline;\n}\n\n%faux-full-outline {\n position: relative;\n}\n\n%faux-full-outline-anchor {\n &::before {\n content: \"\";\n\n position: absolute;\n inset: 0;\n z-index: 9;\n\n @include borders.rounded-border;\n }\n\n &:focus,\n &:active {\n @include no-focus-outline;\n }\n\n &:focus {\n &::before {\n @include focus-outline;\n }\n }\n\n &:active {\n &::before {\n @include active-outline;\n }\n }\n}\n\n@mixin faux-full-outline($anchor_selector) {\n @extend %faux-full-outline;\n\n #{$anchor_selector} {\n @extend %faux-full-outline-anchor;\n }\n}\n\n%focus-indicator-only-on-keyboard-focus {\n &:focus:not(:focus-visible) {\n @include no-focus-outline;\n }\n}\n\n@mixin focus-indicator-only-on-keyboard-focus {\n @extend %focus-indicator-only-on-keyboard-focus;\n}\n","@use \"sass:map\";\n@use \"sass:math\";\n@use \"../variables/spacing\";\n@use \"../variables/typography\";\n@use \"../tools/media\";\n\n/*\n * ------------------------------------------\n * Spacing is created with rem rather than px\n * units as when users use a custom font size\n * some browsers handle the resize of rem and\n * em separately from px which causes spacing\n * and layout issues, so to ensure everything\n * remaians consistent we use rem for spacing\n * and typography. The original intention was\n * separation so that we could scale the type\n * without affecting spacing, but in practice\n * there are too many ways to change the font\n * size in various browsers and devices\n * ------------------------------------------\n */\n@function space($size) {\n // @return #{$size * spacing.$spacing-unit-px}px;\n @return #{$size}rem;\n}\n\n%space-above {\n margin-top: space(2);\n @extend %no-space-above-for-first-children;\n}\n\n%space-only-above {\n margin: #{space(2)} 0 0;\n @extend %no-space-above-for-first-children;\n}\n\n%no-space-above-for-first-children {\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above($zero-other-margins: false) {\n @if $zero-other-margins {\n @extend %space-only-above;\n } @else {\n @extend %space-above;\n }\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"../../variables/borders\" as bordersVars;\n@use \"../../tools/a11y\";\n@use \"../../tools/borders\";\n@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-tabs {\n @include spacing.space-above;\n\n &__list {\n margin: 0;\n padding: 0;\n\n display: flex;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: spacing.space(0.5);\n\n position: relative;\n z-index: 2;\n\n list-style: none;\n }\n\n &--small &__list {\n gap: spacing.space(0.25);\n }\n\n &__button {\n padding: bordersVars.$thick-border-width 0;\n\n position: relative;\n\n text-align: center;\n\n background: transparent;\n\n border: none;\n\n border: 1px transparent solid;\n border-bottom: none;\n\n border-radius: bordersVars.$rounded-border-radius\n bordersVars.$rounded-border-radius 0 0;\n\n cursor: pointer;\n\n &:active {\n @include a11y.focus-outline;\n }\n\n &[aria-selected=\"true\"] {\n padding-top: 0;\n\n @include colour.colour-border(\"keyline\");\n\n &::after {\n content: \"\";\n\n height: 1px;\n\n position: absolute;\n top: 100%;\n right: 0;\n left: 0;\n\n @include colour.colour-background(\"background\");\n }\n }\n }\n\n &__button-inner {\n padding: spacing.space(0.5) spacing.space(0.75);\n\n display: block;\n\n text-decoration: underline;\n\n @include colour.colour-font(\"font-dark\");\n }\n\n &--small &__button-inner {\n padding: spacing.space(0.25) spacing.space(0.5) spacing.space(0.125);\n\n @include typography.font-size(16);\n }\n\n &__button:hover &__button-inner,\n &__button:focus-visible &__button-inner {\n @include typography.interacted-text-decoration;\n }\n\n &__button[aria-selected=\"true\"] &__button-inner {\n text-decoration: none;\n\n @include colour.thick-keyline-accent(top);\n border-radius: #{bordersVars.$rounded-border-radius - 1px}\n #{bordersVars.$rounded-border-radius - 1px} 0 0;\n }\n\n &__items {\n display: flex;\n flex-direction: column;\n gap: spacing.space(2);\n\n position: relative;\n z-index: 1;\n }\n\n &__item {\n border-radius: 0 0 bordersVars.$rounded-border-radius\n bordersVars.$rounded-border-radius;\n }\n\n &--interactive &__item {\n padding: spacing.space(1);\n @include colour.colour-border(\"keyline\", 1px, solid);\n }\n\n &--tint#{&}--interactive &__button[aria-selected=\"true\"],\n &--tint#{&}--interactive &__button:hover &__button-inner,\n &--tint#{&}--interactive &__button:focus-visible &__button-inner,\n &--tint#{&}--interactive &__items {\n @include colour.tint;\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-variation-settings: \"wdth\" 100;\n font-style: normal;\n font-optical-sizing: auto;\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 interactable-text-decoration {\n text-decoration-thickness: typography.$interactable-text-decoration-thickness;\n text-underline-offset: typography.$interactable-text-decoration-offset;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n text-underline-offset: typography.$interactable-text-decoration-offset;\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","@use \"sass:math\";\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: 19 !default;\n$body-font-size-px-medium: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: 1.75 !default;\n\n$interactable-text-decoration-offset: 0.125em !default;\n$interactable-text-decoration-thickness: #{math.div(1.5, $relative-1rem-px)}rem !default;\n$interactive-text-decoration-thickness: #{math.div(4, $relative-1rem-px)}rem !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: 32 !default;\n$heading-l-font-size-small: 29 !default;\n$heading-l-font-size-tiny: $heading-l-font-size-small !default;\n$heading-l-line-height: 1.15 !default;\n\n$heading-m-font-size-default: 22 !default;\n$heading-m-font-size-medium: $heading-m-font-size-default !default;\n$heading-m-font-size-small: 21 !default;\n$heading-m-font-size-tiny: $heading-m-font-size-small !default;\n$heading-m-line-height: 1.4 !default;\n\n$heading-s-font-size-default: 19 !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.5 !default;\n\n$code-font-family: Consolas, Monaco, \"Ubuntu Mono\", monospace !default;\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_a11y.scss","../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/tabs/tabs.scss","../../../../src/nationalarchives/tools/_borders.scss","../../../../src/nationalarchives/variables/_borders.scss","../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss"],"names":[],"mappings":"AAyBA,yBACE,qCACA,8BAEA,qCAGA,WACE,kCAGF,mDACE,8BAEA,wCAKA,mCADF,qDAEI,8BAEA,yCAyFJ,0CA9EA,wBAEA,2BClCF,UACE,gBAUA,sBACE,aC3BF,gBACE,SACA,UAEA,aACA,iBACA,oBAEA,kBACA,UAEA,gBAGF,kBACE,kBAEA,kBAEA,yBAEA,YAEA,+BACA,mBChCF,cCDsB,IFoCpB,eAMA,sCACE,cGsEA,oDHnEA,0BGkCJ,4CH7BI,4CClDJ,cCDsB,IFyDtB,wBACE,2CAEA,yBAEA,cAEA,0BGYF,gCAIA,4DF/EA,cCDsB,IF2EtB,yCACE,8CAEA,uBI1EF,eJ+EA,wGIlBA,0BACA,0BCpCsC,QDqCtC,sBCvCoC,OL4DpC,8DACE,qBAEA,yBAEA,0BAIF,iBACE,aACA,sBACA,SAEA,kBACA,UAEA,qCACE,UAIJ,gBACE,gBAEA,gCAMF,uCACE,aGZE","file":"tabs.css","sourcesContent":["@use \"../variables/a11y\";\n@use \"colour\";\n@use \"borders\";\n\n@mixin visually-hidden {\n width: 1px !important;\n height: 1px !important;\n margin: 0 !important;\n padding: 0 !important;\n\n overflow: hidden !important;\n\n position: absolute !important;\n top: -9999px !important;\n left: -9999px !important;\n z-index: -1 !important;\n\n background-color: transparent !important;\n\n border: 0 !important;\n\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n}\n\n%focus-outline {\n outline: a11y.$focus-outline-outer-width colour.brand-colour(\"black\") solid !important;\n outline-offset: a11y.$focus-outline-inner-width !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"yellow\") !important;\n\n transition:\n outline-offset 0.1s,\n box-shadow 0.1s;\n\n .tna-template--dark-theme & {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"black\") !important;\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"black\") !important;\n }\n }\n}\n\n@mixin focus-outline {\n @extend %focus-outline;\n}\n\n@mixin no-focus-outline {\n outline: none !important;\n\n box-shadow: none !important;\n}\n\n%active-outline {\n outline: a11y.$focus-outline-active-outer-width colour.brand-colour(\"black\")\n solid !important;\n outline-offset: a11y.$focus-outline-active-inner-width !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"yellow\") !important;\n\n transition: none;\n\n .tna-template--dark-theme & {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"black\") !important;\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"black\") !important;\n }\n }\n}\n\n@mixin active-outline {\n @extend %active-outline;\n}\n\n%faux-full-outline {\n position: relative;\n}\n\n%faux-full-outline-anchor {\n &::before {\n content: \"\";\n\n position: absolute;\n inset: 0;\n z-index: 9;\n\n @include borders.rounded-border;\n }\n\n &:focus,\n &:active {\n @include no-focus-outline;\n }\n\n &:focus {\n &::before {\n @include focus-outline;\n }\n }\n\n &:active {\n &::before {\n @include active-outline;\n }\n }\n}\n\n@mixin faux-full-outline($anchor_selector) {\n @extend %faux-full-outline;\n\n #{$anchor_selector} {\n @extend %faux-full-outline-anchor;\n }\n}\n\n%focus-indicator-only-on-keyboard-focus {\n &:focus:not(:focus-visible) {\n @include no-focus-outline;\n }\n}\n\n@mixin focus-indicator-only-on-keyboard-focus {\n @extend %focus-indicator-only-on-keyboard-focus;\n}\n","@use \"sass:map\";\n@use \"sass:math\";\n@use \"../variables/spacing\";\n@use \"../variables/typography\";\n@use \"../tools/media\";\n\n/*\n * ------------------------------------------\n * Spacing is created with rem rather than px\n * units as when users use a custom font size\n * some browsers handle the resize of rem and\n * em separately from px which causes spacing\n * and layout issues, so to ensure everything\n * remaians consistent we use rem for spacing\n * and typography. The original intention was\n * separation so that we could scale the type\n * without affecting spacing, but in practice\n * there are too many ways to change the font\n * size in various browsers and devices\n * ------------------------------------------\n */\n@function space($size) {\n // @return #{$size * spacing.$spacing-unit-px}px;\n @return #{$size}rem;\n}\n\n%space-above {\n margin-top: space(2);\n @extend %no-space-above-for-first-children;\n}\n\n%space-only-above {\n margin: #{space(2)} 0 0;\n @extend %no-space-above-for-first-children;\n}\n\n%no-space-above-for-first-children {\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above($zero-other-margins: false) {\n @if $zero-other-margins {\n @extend %space-only-above;\n } @else {\n @extend %space-above;\n }\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"../../variables/borders\" as bordersVars;\n@use \"../../tools/a11y\";\n@use \"../../tools/borders\";\n@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-tabs {\n @include spacing.space-above;\n\n &__list {\n margin: 0;\n padding: 0;\n\n display: flex;\n flex-wrap: nowrap;\n align-items: stretch;\n\n position: relative;\n z-index: 2;\n\n list-style: none;\n }\n\n &__button {\n position: relative;\n\n text-align: center;\n\n background: transparent;\n\n border: none;\n\n border: 1px transparent solid;\n border-bottom: none;\n @include borders.rounded-border;\n\n cursor: pointer;\n\n &:active {\n @include a11y.focus-outline;\n }\n\n &[aria-selected=\"true\"] {\n padding-top: 0;\n\n @include colour.colour-border(\"keyline\");\n border-radius: bordersVars.$rounded-border-radius\n bordersVars.$rounded-border-radius 0 0;\n\n @include colour.colour-background(\"background\");\n\n &:focus {\n @include borders.rounded-border;\n }\n }\n }\n\n &__button-inner {\n margin: spacing.space(0.25) spacing.space(0.25)\n calc(spacing.space(0.25) + 1px);\n padding: spacing.space(0.375) spacing.space(0.75);\n\n display: block;\n\n text-decoration: underline;\n\n @include colour.colour-font(\"font-base\");\n\n // @include colour.base;\n // @include colour.tint;\n @include colour.colour-background(\"background-tint\");\n\n @include borders.rounded-border;\n }\n\n &--small &__button-inner {\n margin: spacing.space(0.125) spacing.space(0.125)\n calc(spacing.space(0.125) + 1px);\n padding: spacing.space(0.25) spacing.space(0.5);\n\n @include typography.font-size(16);\n }\n\n &__button:hover &__button-inner,\n &__button:focus-visible &__button-inner {\n @include typography.interacted-text-decoration;\n }\n\n &__button[aria-selected=\"true\"] &__button-inner {\n text-decoration: none;\n\n background: transparent;\n\n border-radius: #{bordersVars.$rounded-border-radius - 1px}\n #{bordersVars.$rounded-border-radius - 1px} 0 0;\n }\n\n &__items {\n display: flex;\n flex-direction: column;\n gap: spacing.space(2);\n\n position: relative;\n z-index: 1;\n\n &:has(:focus-visible) {\n z-index: 3;\n }\n }\n\n &__item {\n margin-top: -1px;\n\n border-radius: 0.1px 0.1px #{bordersVars.$rounded-border-radius}\n #{bordersVars.$rounded-border-radius};\n\n @include a11y.focus-indicator-only-on-keyboard-focus;\n }\n\n &--interactive &__item {\n padding: spacing.space(1);\n @include colour.colour-border(\"keyline\", 1px, solid);\n }\n}\n","@use \"../variables/borders\";\n\n@mixin rounded-border {\n border-radius: borders.$rounded-border-radius;\n}\n","$thick-border-width: 5px !default;\n$very-thick-border-width: 8px !default;\n$rounded-border-radius: 2px !default;\n","@use \"sass:list\";\n@use \"sass:map\";\n@use \"sass:meta\";\n@use \"../variables/a11y\";\n@use \"../variables/borders\";\n@use \"../variables/forms\";\n@use \"../variables/colour\";\n@use \"../variables/features\";\n@use \"../tools/media\";\n\n$base-colours: (\n \"background\",\n \"font-base\",\n \"font-dark\",\n \"font-light\",\n \"icon-light\",\n \"link\",\n \"link-visited\",\n \"keyline\",\n \"keyline-dark\"\n);\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 @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\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 @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\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 @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\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 @if list.index((\"keyline\", \"keyline-dark\"), $name) {\n --base-#{$name}: #{$value};\n }\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(sass($important): !important; else: null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour)\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)}\n if(sass($important): !important; else: 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(sass($important): !important; else: null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if(sass($important): !important; else: null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n outline-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n%colour-input {\n @include colour-font(\"input-foreground\");\n @include colour-background(\"input-background\");\n @include colour-border(\"input-border\", forms.$form-field-border-width);\n\n &:hover {\n outline: a11y.$focus-outline-active-total-width var(--keyline) solid;\n }\n}\n\n@mixin colour-input() {\n @extend %colour-input;\n}\n\n@mixin thick-keyline($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline-dark\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline-dark\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"accent-border\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"accent-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n $border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"form-error-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour, $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width #{brand-colour($brandColour)} solid;\n } @else {\n border: $border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n@mixin thick-keyline-transparent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width transparent solid;\n } @else {\n border: $border-width transparent solid;\n }\n}\n\n%always-light {\n @include colour-css-vars;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast;\n }\n}\n\n@mixin always-light {\n @extend %always-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-border: var(--accent-border-bright);\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-border: var(--accent-border-bright);\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%base {\n @each $name, $value in $base-colours {\n --#{$name}: var(--base-#{$value});\n }\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin base {\n @extend %base;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\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-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\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(--accent-background);\n\n @include colour-background(\"background\");\n @include colour-font(\"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 --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-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\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 --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-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n}\n\n@mixin accent-light {\n @extend %accent-light;\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-border-bright: #{colour.brand-colour(\"yellow\")} !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.7)} !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-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"yellow\")} !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.7)} !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-accented-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-border-bright: #{colour.brand-colour(\"grey\")} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-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(\"maroon\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"pink\")} !important;\n --button-accented-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(\"chestnut\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"orange\")} !important;\n --button-accented-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(\"forest\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"green\")} !important;\n --button-accented-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(\"navy\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"blue\")} !important;\n --button-accented-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\n%image-loader-background {\n background: linear-gradient(\n -45deg,\n rgb(0 0 0 / 25%),\n rgb(255 255 255 / 25%),\n rgb(0 0 0 / 25%)\n );\n background-size: 500% 500%;\n background-position: 0 50%;\n\n animation: image-loader-background ease-in-out 1.2s infinite;\n\n @media (prefers-reduced-motion) {\n animation: none !important;\n }\n}\n\n@mixin image-loader-background {\n @if features.$image-loader-animations {\n @extend %image-loader-background;\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-variation-settings: \"wdth\" 100;\n font-style: normal;\n font-optical-sizing: auto;\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 interactable-text-decoration {\n text-decoration-thickness: typography.$interactable-text-decoration-thickness;\n text-underline-offset: typography.$interactable-text-decoration-offset;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n text-underline-offset: typography.$interactable-text-decoration-offset;\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","@use \"sass:math\";\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: 19 !default;\n$body-font-size-px-medium: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: 1.75 !default;\n\n$interactable-text-decoration-offset: 0.125em !default;\n$interactable-text-decoration-thickness: #{math.div(1.5, $relative-1rem-px)}rem !default;\n$interactive-text-decoration-thickness: #{math.div(4, $relative-1rem-px)}rem !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: 32 !default;\n$heading-l-font-size-small: 29 !default;\n$heading-l-font-size-tiny: $heading-l-font-size-small !default;\n$heading-l-line-height: 1.15 !default;\n\n$heading-m-font-size-default: 22 !default;\n$heading-m-font-size-medium: $heading-m-font-size-default !default;\n$heading-m-font-size-small: 21 !default;\n$heading-m-font-size-tiny: $heading-m-font-size-small !default;\n$heading-m-line-height: 1.4 !default;\n\n$heading-s-font-size-default: 19 !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.5 !default;\n\n$code-font-family: Consolas, Monaco, \"Ubuntu Mono\", monospace !default;\n"]}
@@ -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=e()}(self,()=>(()=>{"use strict";const t={d:(e,i)=>{if(Array.isArray(i))for(var s=0;s<i.length;){var r=i[s++],n=i[s++];t.o(e,r)?0===n&&s++:0===n?Object.defineProperty(e,r,{enumerable:!0,value:i[s++]}):Object.defineProperty(e,r,{enumerable:!0,get:n})}else for(var r in i)t.o(i,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:i[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{Tabs:()=>i});class i{constructor(t){this.$module=t,this.$tabList=t&&t.querySelector(".tna-tabs__list"),this.$tabListItemLinks=t&&this.$tabList&&this.$tabList.querySelectorAll(".tna-tabs__button"),this.$tabItems=t&&t.querySelectorAll(".tna-tabs__item"),this.$module&&this.$tabList&&this.$tabListItemLinks&&this.$tabItems&&this.$tabListItemLinks.length===this.$tabItems.length&&(this.currentTabIndex=0,this.init())}init(){this.$module.classList.add("tna-tabs--interactive"),this.$tabList.removeAttribute("hidden"),this.$tabListItemLinks.forEach(t=>{const e=t.getAttribute("aria-controls");t.setAttribute("aria-selected",!1);const i=document.getElementById(e);i.setAttribute("aria-labelledby",t.id),i.setAttribute("role","tabpanel"),t.addEventListener("click",t=>this.handleItemLinkClick(t),!0)}),this.switchTabByIndex(this.currentTabIndex),this.$module.addEventListener("keydown",t=>this.handleItemLinkKeyDown(t))}handleItemLinkClick(t){t.preventDefault();const e=t.currentTarget.getAttribute("aria-controls");this.switchTabByID(e)}handleItemLinkKeyDown(t){let e=!1;switch(t.key){case"ArrowLeft":case"ArrowUp":this.previousTab(),e=!0;break;case"ArrowRight":case"ArrowDown":this.nextTab(),e=!0;break;case"Home":this.switchTabByIndex(0,!0),e=!0;break;case"End":this.switchTabByIndex(this.$tabListItemLinks.length-1,!0),e=!0}e&&(t.stopPropagation(),t.preventDefault())}nextTab(){this.currentTabIndex<this.$tabListItemLinks.length-1?this.switchTabByIndex(this.currentTabIndex+1,!0):this.switchTabByIndex(0,!0)}previousTab(){this.currentTabIndex>=1?this.switchTabByIndex(this.currentTabIndex-1,!0):this.switchTabByIndex(this.$tabListItemLinks.length-1,!0)}switchTabByIndex(t,e=!1){this.currentTabIndex=t,this.$tabListItemLinks.forEach((t,i)=>{i===this.currentTabIndex?(t.setAttribute("aria-selected",!0),t.setAttribute("tabindex","0"),e&&t.focus()):(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"))}),this.$tabItems.forEach((t,e)=>{e===this.currentTabIndex?(t.removeAttribute("hidden"),t.setAttribute("tabindex","0")):(t.setAttribute("hidden",""),t.setAttribute("tabindex","-1"))})}switchTabByID(t){const e=Array.from(this.$tabItems).findIndex(e=>e.getAttribute("id")===t);this.switchTabByIndex(e)}}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=e()}(self,()=>(()=>{"use strict";const t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{Tabs:()=>i});class i{constructor(t){this.$module=t,this.$tabList=t&&t.querySelector(".tna-tabs__list"),this.$tabListItemLinks=t&&this.$tabList&&this.$tabList.querySelectorAll(".tna-tabs__button"),this.$tabItems=t&&t.querySelectorAll(".tna-tabs__item"),this.$module&&this.$tabList&&this.$tabListItemLinks&&this.$tabItems&&this.$tabListItemLinks.length===this.$tabItems.length&&(this.currentTabIndex=this.$module.dataset.activeTabOnLoad?parseInt(this.$module.dataset.activeTabOnLoad,10):0,this.allowClose="true"===this.$module.dataset.allowClose,this.init())}init(){this.$module.classList.add("tna-tabs--interactive"),this.$tabList.removeAttribute("hidden"),this.$tabListItemLinks.forEach(t=>{const e=t.getAttribute("aria-controls");t.setAttribute("aria-selected",!1);const i=document.getElementById(e);i.setAttribute("aria-labelledby",t.id),i.setAttribute("role","tabpanel"),t.addEventListener("click",t=>this.handleItemLinkClick(t),!0)}),this.switchTabByIndex(this.currentTabIndex),this.$module.addEventListener("keydown",t=>this.handleItemLinkKeyDown(t))}handleItemLinkClick(t){t.preventDefault();const e=t.currentTarget.getAttribute("aria-controls");this.switchTabByID(e)}handleItemLinkKeyDown(t){let e=!1;switch(t.key){case"ArrowLeft":case"ArrowUp":this.previousTab(),e=!0;break;case"ArrowRight":case"ArrowDown":this.nextTab(),e=!0;break;case"Home":this.switchTabByIndex(0,!0,!0),e=!0;break;case"End":this.switchTabByIndex(this.$tabListItemLinks.length-1,!0,!0),e=!0}e&&(t.stopPropagation(),t.preventDefault())}nextTab(){this.currentTabIndex<this.$tabListItemLinks.length-1?this.switchTabByIndex(this.currentTabIndex+1,!0):this.switchTabByIndex(0,!0)}previousTab(){this.currentTabIndex>=1?this.switchTabByIndex(this.currentTabIndex-1,!0):this.switchTabByIndex(this.$tabListItemLinks.length-1,!0)}switchTabByIndex(t,e=!1,i=!1){this.currentTabIndex=t,"true"===this.$tabListItemLinks[this.currentTabIndex]?.getAttribute("aria-selected").toString()&&this.allowClose&&!i&&(this.currentTabIndex=-1),this.$tabListItemLinks.forEach((t,i)=>{i===this.currentTabIndex?(t.setAttribute("aria-selected",!0),t.setAttribute("tabindex","0"),e&&t.focus()):(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex",-1===this.currentTabIndex?"0":"-1"))}),this.$tabItems.forEach((t,e)=>{e===this.currentTabIndex?(t.removeAttribute("hidden"),t.setAttribute("tabindex","0")):(t.setAttribute("hidden",""),t.setAttribute("tabindex",-1===this.currentTabIndex?"0":"-1"))})}switchTabByID(t){const e=Array.from(this.$tabItems).findIndex(e=>e.getAttribute("id")===t);this.switchTabByIndex(e)}}return e})());
2
2
  //# sourceMappingURL=tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/tabs/tabs.js","mappings":"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","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/tabs/tabs.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\nconst __webpack_require__ = {};\n\n","// define getter/value functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tif(Array.isArray(definition)) {\n\t\tvar i = 0;\n\t\twhile(i < definition.length) {\n\t\t\tvar key = definition[i++];\n\t\t\tvar binding = definition[i++];\n\t\t\tif(!__webpack_require__.o(exports, key)) {\n\t\t\t\tif(binding === 0) {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, value: definition[i++] });\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: binding });\n\t\t\t\t}\n\t\t\t} else if(binding === 0) { i++; }\n\t\t}\n\t} else {\n\t\tfor(var key in definition) {\n\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t\t}\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(Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class Tabs {\n constructor($module) {\n this.$module = $module;\n this.$tabList = $module && $module.querySelector(\".tna-tabs__list\");\n this.$tabListItemLinks =\n $module &&\n this.$tabList &&\n this.$tabList.querySelectorAll(\".tna-tabs__button\");\n this.$tabItems = $module && $module.querySelectorAll(\".tna-tabs__item\");\n\n if (\n !this.$module ||\n !this.$tabList ||\n !this.$tabListItemLinks ||\n !this.$tabItems ||\n this.$tabListItemLinks.length !== this.$tabItems.length\n ) {\n return;\n }\n\n this.currentTabIndex = 0;\n this.init();\n }\n\n init() {\n this.$module.classList.add(\"tna-tabs--interactive\");\n this.$tabList.removeAttribute(\"hidden\");\n this.$tabListItemLinks.forEach(($tabListItemLink) => {\n const tabPanelID = $tabListItemLink.getAttribute(\"aria-controls\");\n $tabListItemLink.setAttribute(\"aria-selected\", false);\n const $tabPanel = document.getElementById(tabPanelID);\n $tabPanel.setAttribute(\"aria-labelledby\", $tabListItemLink.id);\n $tabPanel.setAttribute(\"role\", \"tabpanel\");\n $tabListItemLink.addEventListener(\n \"click\",\n (event) => this.handleItemLinkClick(event),\n true,\n );\n });\n this.switchTabByIndex(this.currentTabIndex);\n this.$module.addEventListener(\"keydown\", (event) =>\n this.handleItemLinkKeyDown(event),\n );\n }\n\n handleItemLinkClick(itemLinkClickEvent) {\n itemLinkClickEvent.preventDefault();\n const targetItem =\n itemLinkClickEvent.currentTarget.getAttribute(\"aria-controls\");\n this.switchTabByID(targetItem);\n }\n\n handleItemLinkKeyDown(itemLinkKeyDownEvent) {\n let preventDefaultKeyAction = false;\n switch (itemLinkKeyDownEvent.key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n this.previousTab();\n preventDefaultKeyAction = true;\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n this.nextTab();\n preventDefaultKeyAction = true;\n break;\n case \"Home\":\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(0, true);\n preventDefaultKeyAction = true;\n break;\n case \"End\":\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(this.$tabListItemLinks.length - 1, true);\n preventDefaultKeyAction = true;\n break;\n default:\n break;\n }\n if (preventDefaultKeyAction) {\n itemLinkKeyDownEvent.stopPropagation();\n itemLinkKeyDownEvent.preventDefault();\n }\n }\n\n nextTab() {\n /* eslint-disable-next-line no-magic-numbers */\n if (this.currentTabIndex < this.$tabListItemLinks.length - 1) {\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(this.currentTabIndex + 1, true);\n } else {\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(0, true);\n }\n }\n\n previousTab() {\n /* eslint-disable-next-line no-magic-numbers */\n if (this.currentTabIndex >= 1) {\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(this.currentTabIndex - 1, true);\n } else {\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(this.$tabListItemLinks.length - 1, true);\n }\n }\n\n switchTabByIndex(newIndex, switchFocus = false) {\n this.currentTabIndex = newIndex;\n this.$tabListItemLinks.forEach(($tabListItemLink, index) => {\n if (index === this.currentTabIndex) {\n $tabListItemLink.setAttribute(\"aria-selected\", true);\n $tabListItemLink.setAttribute(\"tabindex\", \"0\");\n if (switchFocus) {\n $tabListItemLink.focus();\n }\n } else {\n $tabListItemLink.setAttribute(\"aria-selected\", false);\n $tabListItemLink.setAttribute(\"tabindex\", \"-1\");\n }\n });\n this.$tabItems.forEach(($tabItem, index) => {\n if (index === this.currentTabIndex) {\n $tabItem.removeAttribute(\"hidden\");\n $tabItem.setAttribute(\"tabindex\", \"0\");\n } else {\n $tabItem.setAttribute(\"hidden\", \"\");\n $tabItem.setAttribute(\"tabindex\", \"-1\");\n }\n });\n }\n\n switchTabByID(targetId) {\n const index = Array.from(this.$tabItems).findIndex(\n ($tabItem) => $tabItem.getAttribute(\"id\") === targetId,\n );\n this.switchTabByIndex(index);\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","Array","isArray","i","length","key","binding","o","Object","defineProperty","enumerable","value","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","Tabs","constructor","$module","this","$tabList","querySelector","$tabListItemLinks","querySelectorAll","$tabItems","currentTabIndex","init","classList","add","removeAttribute","forEach","$tabListItemLink","tabPanelID","getAttribute","setAttribute","$tabPanel","document","getElementById","id","addEventListener","event","handleItemLinkClick","switchTabByIndex","handleItemLinkKeyDown","itemLinkClickEvent","preventDefault","targetItem","currentTarget","switchTabByID","itemLinkKeyDownEvent","preventDefaultKeyAction","previousTab","nextTab","stopPropagation","newIndex","switchFocus","index","focus","$tabItem","targetId","from","findIndex"],"sourceRoot":""}
1
+ {"version":3,"file":"components/tabs/tabs.js","mappings":"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","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/tabs/tabs.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\nconst __webpack_require__ = {};\n\n","// define getter/value 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\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class Tabs {\n constructor($module) {\n this.$module = $module;\n this.$tabList = $module && $module.querySelector(\".tna-tabs__list\");\n this.$tabListItemLinks =\n $module &&\n this.$tabList &&\n this.$tabList.querySelectorAll(\".tna-tabs__button\");\n this.$tabItems = $module && $module.querySelectorAll(\".tna-tabs__item\");\n\n if (\n !this.$module ||\n !this.$tabList ||\n !this.$tabListItemLinks ||\n !this.$tabItems ||\n this.$tabListItemLinks.length !== this.$tabItems.length\n ) {\n return;\n }\n\n this.currentTabIndex = this.$module.dataset.activeTabOnLoad\n ? parseInt(this.$module.dataset.activeTabOnLoad, 10)\n : 0;\n this.allowClose = this.$module.dataset.allowClose === \"true\";\n this.init();\n }\n\n init() {\n this.$module.classList.add(\"tna-tabs--interactive\");\n this.$tabList.removeAttribute(\"hidden\");\n this.$tabListItemLinks.forEach(($tabListItemLink) => {\n const tabPanelID = $tabListItemLink.getAttribute(\"aria-controls\");\n $tabListItemLink.setAttribute(\"aria-selected\", false);\n const $tabPanel = document.getElementById(tabPanelID);\n $tabPanel.setAttribute(\"aria-labelledby\", $tabListItemLink.id);\n $tabPanel.setAttribute(\"role\", \"tabpanel\");\n $tabListItemLink.addEventListener(\n \"click\",\n (event) => this.handleItemLinkClick(event),\n true,\n );\n });\n this.switchTabByIndex(this.currentTabIndex);\n this.$module.addEventListener(\"keydown\", (event) =>\n this.handleItemLinkKeyDown(event),\n );\n }\n\n handleItemLinkClick(itemLinkClickEvent) {\n itemLinkClickEvent.preventDefault();\n const targetItem =\n itemLinkClickEvent.currentTarget.getAttribute(\"aria-controls\");\n this.switchTabByID(targetItem);\n }\n\n handleItemLinkKeyDown(itemLinkKeyDownEvent) {\n let preventDefaultKeyAction = false;\n switch (itemLinkKeyDownEvent.key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n this.previousTab();\n preventDefaultKeyAction = true;\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n this.nextTab();\n preventDefaultKeyAction = true;\n break;\n case \"Home\":\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(0, true, true);\n preventDefaultKeyAction = true;\n break;\n case \"End\":\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(this.$tabListItemLinks.length - 1, true, true);\n preventDefaultKeyAction = true;\n break;\n default:\n break;\n }\n if (preventDefaultKeyAction) {\n itemLinkKeyDownEvent.stopPropagation();\n itemLinkKeyDownEvent.preventDefault();\n }\n }\n\n nextTab() {\n /* eslint-disable-next-line no-magic-numbers */\n if (this.currentTabIndex < this.$tabListItemLinks.length - 1) {\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(this.currentTabIndex + 1, true);\n } else {\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(0, true);\n }\n }\n\n previousTab() {\n /* eslint-disable-next-line no-magic-numbers */\n if (this.currentTabIndex >= 1) {\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(this.currentTabIndex - 1, true);\n } else {\n /* eslint-disable-next-line no-magic-numbers */\n this.switchTabByIndex(this.$tabListItemLinks.length - 1, true);\n }\n }\n\n switchTabByIndex(newIndex, switchFocus = false, disallowClose = false) {\n this.currentTabIndex = newIndex;\n const isTabAlreadySelected =\n this.$tabListItemLinks[this.currentTabIndex]\n ?.getAttribute(\"aria-selected\")\n .toString() === \"true\";\n if (isTabAlreadySelected && this.allowClose && !disallowClose) {\n this.currentTabIndex = -1;\n }\n this.$tabListItemLinks.forEach(($tabListItemLink, index) => {\n if (index === this.currentTabIndex) {\n $tabListItemLink.setAttribute(\"aria-selected\", true);\n $tabListItemLink.setAttribute(\"tabindex\", \"0\");\n if (switchFocus) {\n $tabListItemLink.focus();\n }\n } else {\n $tabListItemLink.setAttribute(\"aria-selected\", false);\n $tabListItemLink.setAttribute(\n \"tabindex\",\n this.currentTabIndex === -1 ? \"0\" : \"-1\",\n );\n }\n });\n this.$tabItems.forEach(($tabItem, index) => {\n if (index === this.currentTabIndex) {\n $tabItem.removeAttribute(\"hidden\");\n $tabItem.setAttribute(\"tabindex\", \"0\");\n } else {\n $tabItem.setAttribute(\"hidden\", \"\");\n $tabItem.setAttribute(\n \"tabindex\",\n this.currentTabIndex === -1 ? \"0\" : \"-1\",\n );\n }\n });\n }\n\n switchTabByID(targetId) {\n const index = Array.from(this.$tabItems).findIndex(\n ($tabItem) => $tabItem.getAttribute(\"id\") === targetId,\n );\n this.switchTabByIndex(index);\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","Tabs","constructor","$module","this","$tabList","querySelector","$tabListItemLinks","querySelectorAll","$tabItems","length","currentTabIndex","dataset","activeTabOnLoad","parseInt","allowClose","init","classList","add","removeAttribute","forEach","$tabListItemLink","tabPanelID","getAttribute","setAttribute","$tabPanel","document","getElementById","id","addEventListener","event","handleItemLinkClick","switchTabByIndex","handleItemLinkKeyDown","itemLinkClickEvent","preventDefault","targetItem","currentTarget","switchTabByID","itemLinkKeyDownEvent","preventDefaultKeyAction","previousTab","nextTab","stopPropagation","newIndex","switchFocus","disallowClose","toString","index","focus","$tabItem","targetId","Array","from","findIndex"],"sourceRoot":""}
@@ -18,7 +18,10 @@ export class Tabs {
18
18
  return;
19
19
  }
20
20
 
21
- this.currentTabIndex = 0;
21
+ this.currentTabIndex = this.$module.dataset.activeTabOnLoad
22
+ ? parseInt(this.$module.dataset.activeTabOnLoad, 10)
23
+ : 0;
24
+ this.allowClose = this.$module.dataset.allowClose === "true";
22
25
  this.init();
23
26
  }
24
27
 
@@ -65,12 +68,12 @@ export class Tabs {
65
68
  break;
66
69
  case "Home":
67
70
  /* eslint-disable-next-line no-magic-numbers */
68
- this.switchTabByIndex(0, true);
71
+ this.switchTabByIndex(0, true, true);
69
72
  preventDefaultKeyAction = true;
70
73
  break;
71
74
  case "End":
72
75
  /* eslint-disable-next-line no-magic-numbers */
73
- this.switchTabByIndex(this.$tabListItemLinks.length - 1, true);
76
+ this.switchTabByIndex(this.$tabListItemLinks.length - 1, true, true);
74
77
  preventDefaultKeyAction = true;
75
78
  break;
76
79
  default:
@@ -104,8 +107,15 @@ export class Tabs {
104
107
  }
105
108
  }
106
109
 
107
- switchTabByIndex(newIndex, switchFocus = false) {
110
+ switchTabByIndex(newIndex, switchFocus = false, disallowClose = false) {
108
111
  this.currentTabIndex = newIndex;
112
+ const isTabAlreadySelected =
113
+ this.$tabListItemLinks[this.currentTabIndex]
114
+ ?.getAttribute("aria-selected")
115
+ .toString() === "true";
116
+ if (isTabAlreadySelected && this.allowClose && !disallowClose) {
117
+ this.currentTabIndex = -1;
118
+ }
109
119
  this.$tabListItemLinks.forEach(($tabListItemLink, index) => {
110
120
  if (index === this.currentTabIndex) {
111
121
  $tabListItemLink.setAttribute("aria-selected", true);
@@ -115,7 +125,10 @@ export class Tabs {
115
125
  }
116
126
  } else {
117
127
  $tabListItemLink.setAttribute("aria-selected", false);
118
- $tabListItemLink.setAttribute("tabindex", "-1");
128
+ $tabListItemLink.setAttribute(
129
+ "tabindex",
130
+ this.currentTabIndex === -1 ? "0" : "-1",
131
+ );
119
132
  }
120
133
  });
121
134
  this.$tabItems.forEach(($tabItem, index) => {
@@ -124,7 +137,10 @@ export class Tabs {
124
137
  $tabItem.setAttribute("tabindex", "0");
125
138
  } else {
126
139
  $tabItem.setAttribute("hidden", "");
127
- $tabItem.setAttribute("tabindex", "-1");
140
+ $tabItem.setAttribute(
141
+ "tabindex",
142
+ this.currentTabIndex === -1 ? "0" : "-1",
143
+ );
128
144
  }
129
145
  });
130
146
  }
@@ -16,7 +16,6 @@
16
16
  display: flex;
17
17
  flex-wrap: nowrap;
18
18
  align-items: stretch;
19
- gap: spacing.space(0.5);
20
19
 
21
20
  position: relative;
22
21
  z-index: 2;
@@ -24,13 +23,7 @@
24
23
  list-style: none;
25
24
  }
26
25
 
27
- &--small &__list {
28
- gap: spacing.space(0.25);
29
- }
30
-
31
26
  &__button {
32
- padding: bordersVars.$thick-border-width 0;
33
-
34
27
  position: relative;
35
28
 
36
29
  text-align: center;
@@ -41,9 +34,7 @@
41
34
 
42
35
  border: 1px transparent solid;
43
36
  border-bottom: none;
44
-
45
- border-radius: bordersVars.$rounded-border-radius
46
- bordersVars.$rounded-border-radius 0 0;
37
+ @include borders.rounded-border;
47
38
 
48
39
  cursor: pointer;
49
40
 
@@ -55,34 +46,39 @@
55
46
  padding-top: 0;
56
47
 
57
48
  @include colour.colour-border("keyline");
49
+ border-radius: bordersVars.$rounded-border-radius
50
+ bordersVars.$rounded-border-radius 0 0;
58
51
 
59
- &::after {
60
- content: "";
52
+ @include colour.colour-background("background");
61
53
 
62
- height: 1px;
63
-
64
- position: absolute;
65
- top: 100%;
66
- right: 0;
67
- left: 0;
68
-
69
- @include colour.colour-background("background");
54
+ &:focus {
55
+ @include borders.rounded-border;
70
56
  }
71
57
  }
72
58
  }
73
59
 
74
60
  &__button-inner {
75
- padding: spacing.space(0.5) spacing.space(0.75);
61
+ margin: spacing.space(0.25) spacing.space(0.25)
62
+ calc(spacing.space(0.25) + 1px);
63
+ padding: spacing.space(0.375) spacing.space(0.75);
76
64
 
77
65
  display: block;
78
66
 
79
67
  text-decoration: underline;
80
68
 
81
- @include colour.colour-font("font-dark");
69
+ @include colour.colour-font("font-base");
70
+
71
+ // @include colour.base;
72
+ // @include colour.tint;
73
+ @include colour.colour-background("background-tint");
74
+
75
+ @include borders.rounded-border;
82
76
  }
83
77
 
84
78
  &--small &__button-inner {
85
- padding: spacing.space(0.25) spacing.space(0.5) spacing.space(0.125);
79
+ margin: spacing.space(0.125) spacing.space(0.125)
80
+ calc(spacing.space(0.125) + 1px);
81
+ padding: spacing.space(0.25) spacing.space(0.5);
86
82
 
87
83
  @include typography.font-size(16);
88
84
  }
@@ -95,7 +91,8 @@
95
91
  &__button[aria-selected="true"] &__button-inner {
96
92
  text-decoration: none;
97
93
 
98
- @include colour.thick-keyline-accent(top);
94
+ background: transparent;
95
+
99
96
  border-radius: #{bordersVars.$rounded-border-radius - 1px}
100
97
  #{bordersVars.$rounded-border-radius - 1px} 0 0;
101
98
  }
@@ -107,22 +104,23 @@
107
104
 
108
105
  position: relative;
109
106
  z-index: 1;
107
+
108
+ &:has(:focus-visible) {
109
+ z-index: 3;
110
+ }
110
111
  }
111
112
 
112
113
  &__item {
113
- border-radius: 0 0 bordersVars.$rounded-border-radius
114
- bordersVars.$rounded-border-radius;
114
+ margin-top: -1px;
115
+
116
+ border-radius: 0.1px 0.1px #{bordersVars.$rounded-border-radius}
117
+ #{bordersVars.$rounded-border-radius};
118
+
119
+ @include a11y.focus-indicator-only-on-keyboard-focus;
115
120
  }
116
121
 
117
122
  &--interactive &__item {
118
123
  padding: spacing.space(1);
119
124
  @include colour.colour-border("keyline", 1px, solid);
120
125
  }
121
-
122
- &--tint#{&}--interactive &__button[aria-selected="true"],
123
- &--tint#{&}--interactive &__button:hover &__button-inner,
124
- &--tint#{&}--interactive &__button:focus-visible &__button-inner,
125
- &--tint#{&}--interactive &__items {
126
- @include colour.tint;
127
- }
128
126
  }
@@ -1,9 +1,9 @@
1
1
  {%- set containerClasses = [params.classes] if params.classes else [] -%}
2
- {%- if params.sticky -%}
3
- {%- set containerClasses = containerClasses.concat('tna-tabs--sticky') -%}
2
+ {%- if params.small -%}
3
+ {%- set containerClasses = containerClasses.concat('tna-tabs--small') -%}
4
4
  {%- endif -%}
5
5
  {%- set classes = containerClasses | join(' ') -%}
6
- <div class="tna-tabs{% if classes %} {{ classes }}{% endif %}" data-module="tna-tabs"{% for attribute, value in params.attributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}>
6
+ <div class="tna-tabs{% if classes %} {{ classes }}{% endif %}" data-module="tna-tabs"{% if params.activeTabOnLoad %} data-active-tab-on-load="{{ params.activeTabOnLoad }}"{% endif %}{% if params.allowClose %} data-allow-close="true"{% endif %}{% for attribute, value in params.attributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}>
7
7
  <div class="tna-tabs__list" role="tablist" hidden>
8
8
  {%- for item in params.items %}
9
9
  <button type="button" class="tna-tabs__button" id="{{ item.id }}-tab" aria-controls="{{ item.id }}" role="tab">
@@ -0,0 +1 @@
1
+ @use "tags";