@nationalarchives/frontend 1.4.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) 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/all.mjs +11 -1
  8. package/nationalarchives/assets/images/favicon.ico +0 -0
  9. package/nationalarchives/assets/images/favicon.svg +7 -0
  10. package/nationalarchives/assets/images/mstile-150x150.png +0 -0
  11. package/nationalarchives/assets/images/nationalarchives-opengraph-image.png +0 -0
  12. package/nationalarchives/components/TextAreaCharacterCount/TextAreaCharacterCount.js +2 -0
  13. package/nationalarchives/components/TextAreaCharacterCount/TextAreaCharacterCount.js.map +1 -0
  14. package/nationalarchives/components/TextAreaItemisedRows/TextAreaItemisedRows.js +2 -0
  15. package/nationalarchives/components/TextAreaItemisedRows/TextAreaItemisedRows.js.map +1 -0
  16. package/nationalarchives/components/accordion/accordion.css +1 -1
  17. package/nationalarchives/components/accordion/accordion.css.map +1 -1
  18. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  19. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  20. package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +1 -1
  21. package/nationalarchives/components/button/button.css +1 -1
  22. package/nationalarchives/components/button/button.css.map +1 -1
  23. package/nationalarchives/components/button/fixtures.json +1 -1
  24. package/nationalarchives/components/button/template.njk +1 -1
  25. package/nationalarchives/components/card/card.css +1 -1
  26. package/nationalarchives/components/card/card.css.map +1 -1
  27. package/nationalarchives/components/card/fixtures.json +1 -1
  28. package/nationalarchives/components/card/template.njk +1 -1
  29. package/nationalarchives/components/checkboxes/fixtures.json +1 -1
  30. package/nationalarchives/components/code-block/code-block.css +1 -1
  31. package/nationalarchives/components/code-block/code-block.css.map +1 -1
  32. package/nationalarchives/components/code-block/fixtures.json +1 -1
  33. package/nationalarchives/components/compound-filters/compound-filters.css +1 -1
  34. package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
  35. package/nationalarchives/components/date-input/fixtures.json +1 -1
  36. package/nationalarchives/components/date-input/macro-options.json +2 -1
  37. package/nationalarchives/components/date-search/fixtures.json +1 -1
  38. package/nationalarchives/components/error-summary/error-summary.css +1 -1
  39. package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
  40. package/nationalarchives/components/fieldset/fieldset.css +1 -1
  41. package/nationalarchives/components/fieldset/fieldset.css.map +1 -1
  42. package/nationalarchives/components/fieldset/template.njk +1 -1
  43. package/nationalarchives/components/file-input/fixtures.json +1 -1
  44. package/nationalarchives/components/files-list/files-list.css +1 -1
  45. package/nationalarchives/components/files-list/files-list.css.map +1 -1
  46. package/nationalarchives/components/footer/fixtures.json +4 -4
  47. package/nationalarchives/components/footer/template.njk +2 -2
  48. package/nationalarchives/components/gallery/gallery.css +1 -1
  49. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  50. package/nationalarchives/components/hero/fixtures.json +1 -1
  51. package/nationalarchives/components/index-grid/fixtures.json +1 -1
  52. package/nationalarchives/components/index-grid/index-grid.css +1 -1
  53. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  54. package/nationalarchives/components/index-grid/template.njk +1 -1
  55. package/nationalarchives/components/pagination/fixtures.json +4 -4
  56. package/nationalarchives/components/pagination/pagination.css +1 -1
  57. package/nationalarchives/components/pagination/pagination.css.map +1 -1
  58. package/nationalarchives/components/picture/fixtures.json +1 -1
  59. package/nationalarchives/components/picture/picture.css +1 -1
  60. package/nationalarchives/components/picture/picture.css.map +1 -1
  61. package/nationalarchives/components/radios/fixtures.json +1 -1
  62. package/nationalarchives/components/select/fixtures.json +1 -1
  63. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  64. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  65. package/nationalarchives/components/tabs/fixtures.json +133 -12
  66. package/nationalarchives/components/tabs/macro-options.json +13 -0
  67. package/nationalarchives/components/tabs/tabs.css +1 -1
  68. package/nationalarchives/components/tabs/tabs.css.map +1 -1
  69. package/nationalarchives/components/tabs/tabs.js +1 -1
  70. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  71. package/nationalarchives/components/tabs/tabs.mjs +12 -11
  72. package/nationalarchives/components/tabs/tabs.scss +13 -2
  73. package/nationalarchives/components/tabs/template.njk +8 -5
  74. package/nationalarchives/components/tags/tags.css +1 -1
  75. package/nationalarchives/components/tags/tags.css.map +1 -1
  76. package/nationalarchives/components/text-input/fixtures.json +1 -1
  77. package/nationalarchives/components/textarea/TextAreaCharacterCount.mjs +160 -0
  78. package/nationalarchives/components/textarea/TextAreaItemisedRows.mjs +202 -0
  79. package/nationalarchives/components/textarea/fixtures.json +42 -1
  80. package/nationalarchives/components/textarea/macro-options.json +36 -1
  81. package/nationalarchives/components/textarea/template.njk +11 -2
  82. package/nationalarchives/components/textarea/textarea.css +1 -1
  83. package/nationalarchives/components/textarea/textarea.css.map +1 -1
  84. package/nationalarchives/components/textarea/textarea.js +1 -1
  85. package/nationalarchives/components/textarea/textarea.js.map +1 -1
  86. package/nationalarchives/components/textarea/textarea.mjs +3 -197
  87. package/nationalarchives/components/textarea/textarea.scss +12 -1
  88. package/nationalarchives/components/warning/warning.css +1 -1
  89. package/nationalarchives/components/warning/warning.css.map +1 -1
  90. package/nationalarchives/error-page.css +1 -1
  91. package/nationalarchives/error-page.css.map +1 -1
  92. package/nationalarchives/prototype-kit.css +1 -1
  93. package/nationalarchives/prototype-kit.css.map +1 -1
  94. package/nationalarchives/templates/fixtures.json +3 -3
  95. package/nationalarchives/templates/layouts/_generic.njk +2 -14
  96. package/nationalarchives/templates/macros/title.njk +63 -0
  97. package/nationalarchives/tools/_spacing.scss +2 -1
  98. package/nationalarchives/utilities/a11y/_index.scss +1 -2
  99. package/nationalarchives/utilities/forms/form-item.njk +1 -1
  100. package/nationalarchives/utilities/typography/_index.scss +13 -5
  101. package/package.json +4 -4
  102. package/nationalarchives/assets/images/nationalarchives-opengraph-image-dark.png +0 -0
@@ -15,7 +15,10 @@ import { Sidebar } from "./components/sidebar/sidebar.mjs";
15
15
  import { SkipLink } from "./components/skip-link/skip-link.mjs";
16
16
  import { Tabs } from "./components/tabs/tabs.mjs";
17
17
  import { TextInputPassword } from "./components/text-input/text-input.mjs";
18
- import { TextAreaItemisedRows } from "./components/textarea/textarea.mjs";
18
+ import {
19
+ TextAreaCharacterCount,
20
+ TextAreaItemisedRows,
21
+ } from "./components/textarea/textarea.mjs";
19
22
  import { checkTableForScroll, updateTimeElement } from "./lib/helpers.mjs";
20
23
 
21
24
  const initAll = (options = {}) => {
@@ -164,6 +167,13 @@ const initAll = (options = {}) => {
164
167
  new TextAreaItemisedRows($textAreaWithItemisedRows, { enhancedHint });
165
168
  });
166
169
 
170
+ const $textAreaCharacterCounts = $scope.querySelectorAll(
171
+ '[data-module="tna-textarea-character-count"]',
172
+ );
173
+ $textAreaCharacterCounts.forEach(($textAreaCharacterCount) => {
174
+ new TextAreaCharacterCount($textAreaCharacterCount);
175
+ });
176
+
167
177
  const $textInputPasswords = $scope.querySelectorAll(
168
178
  '[data-module="tna-text-input-password"]',
169
179
  );
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
+ <rect x="0" y="0" width="64" height="64" fill="#fff"></rect>
3
+ <rect x="4" y="4" width="56" height="56" fill="#000"></rect>
4
+ <rect x="6" y="6" width="25" height="16" fill="#fff"></rect>
5
+ <rect x="6" y="24" width="52" height="16" fill="#fff"></rect>
6
+ <rect x="6" y="42" width="52" height="16" fill="#fff"></rect>
7
+ </svg>
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TNAFrontend",[],t):"object"==typeof exports?exports.TNAFrontend=t():e.TNAFrontend=t()}(self,()=>(()=>{"use strict";const e={d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{default:()=>r});class r{constructor(e,t={}){this.$module=e,this.$formFieldInput=this.$module&&this.$module.querySelector(".tna-textarea"),this.$formFieldCharacterCount=this.$module&&this.$module.querySelector(".tna-textarea-count"),this.$formFieldCharacterCountScreenReader=this.$module&&this.$module.querySelector(".tna-textarea-count__screen-reader-status"),this.max=parseInt(this.$formFieldInput?.dataset?.maxLength,10),this.countType=this.$formFieldInput?.dataset?.countType||"characters",this.$module&&this.$formFieldInput&&this.$formFieldCharacterCount&&this.$formFieldCharacterCountScreenReader&&this.max&&this.init(t)}init(e){this.threshold=e.threshold||parseInt(this.$formFieldInput?.dataset?.countThreshold,10)||0,this.debounceDuration=e.debounceDuration||parseInt(this.$formFieldInput?.dataset?.debounceDuration,10)||1e3,this.intervalChecker=e.intervalChecker||1e3,this.debounceTimeout=null,this.lastInputValue="",this.$formFieldInput.addEventListener("input",()=>{this.handleInput(),this.lastInputTimestamp=Date.now()}),this.$formFieldInput.addEventListener("focus",()=>{this.handleFocus()}),this.$formFieldInput.addEventListener("blur",()=>{this.handleBlur()}),this.updateVisualCharacterCount(),this.updateScreenReaderCharacterCount()}handleFocus(){this.valueChecker=window.setInterval(()=>{(!this.lastInputTimestamp||Date.now()-this.intervalChecker/2>=this.lastInputTimestamp)&&this.updateIfValueChanged()},this.intervalChecker)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker),this.updateScreenReaderCharacterCount()}updateIfValueChanged(){this.$formFieldInput.value!==this.lastInputValue&&(this.lastInputValue=this.$formFieldInput.value,this.updateVisualCharacterCount(),this.updateScreenReaderCharacterCount())}handleInput(){this.updateVisualCharacterCount(),clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{this.updateScreenReaderCharacterCount()},this.debounceDuration)}getCurrentLength(){if("words"===this.countType){const e=this.$formFieldInput.value.trim();return""===e?0:e.split(/\s+/).length}return this.$formFieldInput.value.length}getCurrentLengthMessage(){const e=this.getCurrentLength();let t=this.countType;return 1===Math.abs(this.max-e)&&(t=t.replace(/s$/,"")),e>this.max?`You have ${(new Intl.NumberFormat).format(e-this.max)} ${t} too many`:`You have ${(new Intl.NumberFormat).format(this.max-e)} ${t} remaining`}isOverThreshold(){return this.getCurrentLength()>this.max}updateVisualCharacterCount(){this.threshold&&(this.getCurrentLength()>this.max*(this.threshold/100)?this.showCharacterCount():this.hideCharacterCount()),this.$formFieldCharacterCount.innerText=this.getCurrentLengthMessage(),this.isOverThreshold()?(this.$formFieldInput.classList.add("tna-textarea--error"),this.$formFieldCharacterCount.classList.add("tna-textarea-count--error")):(this.$formFieldInput.classList.remove("tna-textarea--error"),this.$formFieldCharacterCount.classList.remove("tna-textarea-count--error"))}updateScreenReaderCharacterCount(){const e=this.getCurrentLengthMessage();this.$formFieldCharacterCountScreenReader.innerText=e}showCharacterCount(){this.$formFieldCharacterCount.removeAttribute("hidden"),this.$formFieldCharacterCountScreenReader.removeAttribute("aria-hidden")}hideCharacterCount(){this.$formFieldCharacterCount.setAttribute("hidden",""),this.$formFieldCharacterCountScreenReader.setAttribute("aria-hidden","true")}}return t})());
2
+ //# sourceMappingURL=TextAreaCharacterCount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/TextAreaCharacterCount/TextAreaCharacterCount.js","mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,iBAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,GACC,CATD,CASCK,KAAA,I,mBCRD,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AAmB,GACMxB,KAAKW,YAEHX,KAAKiC,mBAAqBjC,KAAKK,KAAOL,KAAKW,UAAY,KACzDX,KAAKgD,qBAELhD,KAAKiD,sBAITjD,KAAKG,yBAAyB+C,UAAYlD,KAAKsC,0BAC3CtC,KAAK+C,mBACP/C,KAAKC,gBAAgBkD,UAAUC,IAAI,uBACnCpD,KAAKG,yBAAyBgD,UAAUC,IAAI,+BAE5CpD,KAAKC,gBAAgBkD,UAAUE,OAAO,uBACtCrD,KAAKG,yBAAyBgD,UAAUE,OACtC,6BAGN,CAEA,gCAAA5B,GACE,MAAM6B,EAAuBtD,KAAKsC,0BAClCtC,KAAKI,qCAAqC8C,UAAYI,CACxD,CAEA,kBAAAN,GACEhD,KAAKG,yBAAyBoD,gBAAgB,UAC9CvD,KAAKI,qCAAqCmD,gBAAgB,cAC5D,CAEA,kBAAAN,GACEjD,KAAKG,yBAAyBqD,aAAa,SAAU,IACrDxD,KAAKI,qCAAqCoD,aACxC,cACA,OAEJ,E","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/textarea/TextAreaCharacterCount.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 default class TextAreaCharacterCount {\n constructor($module, options = {}) {\n this.$module = $module;\n this.$formFieldInput =\n this.$module && this.$module.querySelector(\".tna-textarea\");\n this.$formFieldCharacterCount =\n this.$module && this.$module.querySelector(\".tna-textarea-count\");\n this.$formFieldCharacterCountScreenReader =\n this.$module &&\n this.$module.querySelector(\".tna-textarea-count__screen-reader-status\");\n this.max = parseInt(this.$formFieldInput?.dataset?.maxLength, 10);\n this.countType = this.$formFieldInput?.dataset?.countType || \"characters\";\n\n if (\n !this.$module ||\n !this.$formFieldInput ||\n !this.$formFieldCharacterCount ||\n !this.$formFieldCharacterCountScreenReader ||\n !this.max\n ) {\n return;\n }\n\n this.init(options);\n }\n\n init(options) {\n this.threshold =\n options.threshold ||\n parseInt(this.$formFieldInput?.dataset?.countThreshold, 10) ||\n /* eslint-disable-next-line no-magic-numbers */\n 0;\n this.debounceDuration =\n options.debounceDuration ||\n parseInt(this.$formFieldInput?.dataset?.debounceDuration, 10) ||\n /* eslint-disable-next-line no-magic-numbers */\n 1000;\n /* eslint-disable-next-line no-magic-numbers */\n this.intervalChecker = options.intervalChecker || 1000;\n this.debounceTimeout = null;\n this.lastInputValue = \"\";\n\n this.$formFieldInput.addEventListener(\"input\", () => {\n this.handleInput();\n this.lastInputTimestamp = Date.now();\n });\n this.$formFieldInput.addEventListener(\"focus\", () => {\n this.handleFocus();\n });\n this.$formFieldInput.addEventListener(\"blur\", () => {\n this.handleBlur();\n });\n this.updateVisualCharacterCount();\n this.updateScreenReaderCharacterCount();\n }\n\n handleFocus() {\n this.valueChecker = window.setInterval(() => {\n if (\n !this.lastInputTimestamp ||\n /* eslint-disable-next-line no-magic-numbers */\n Date.now() - this.intervalChecker / 2 >= this.lastInputTimestamp\n ) {\n this.updateIfValueChanged();\n }\n }, this.intervalChecker);\n }\n\n handleBlur() {\n if (this.valueChecker) {\n window.clearInterval(this.valueChecker);\n }\n this.updateScreenReaderCharacterCount();\n }\n\n updateIfValueChanged() {\n if (this.$formFieldInput.value !== this.lastInputValue) {\n this.lastInputValue = this.$formFieldInput.value;\n this.updateVisualCharacterCount();\n this.updateScreenReaderCharacterCount();\n }\n }\n\n handleInput() {\n this.updateVisualCharacterCount();\n clearTimeout(this.debounceTimeout);\n this.debounceTimeout = setTimeout(() => {\n this.updateScreenReaderCharacterCount();\n }, this.debounceDuration);\n }\n\n getCurrentLength() {\n if (this.countType === \"words\") {\n const trimmedValue = this.$formFieldInput.value.trim();\n if (trimmedValue === \"\") {\n /* eslint-disable-next-line no-magic-numbers */\n return 0;\n }\n return trimmedValue.split(/\\s+/).length;\n }\n return this.$formFieldInput.value.length;\n }\n\n getCurrentLengthMessage() {\n const currentLength = this.getCurrentLength();\n let typeLabel = this.countType;\n /* eslint-disable-next-line no-magic-numbers */\n if (Math.abs(this.max - currentLength) === 1) {\n typeLabel = typeLabel.replace(/s$/, \"\");\n }\n if (currentLength > this.max) {\n return `You have ${new Intl.NumberFormat().format(currentLength - this.max)} ${typeLabel} too many`;\n }\n return `You have ${new Intl.NumberFormat().format(this.max - currentLength)} ${typeLabel} remaining`;\n }\n\n isOverThreshold() {\n return this.getCurrentLength() > this.max;\n }\n\n updateVisualCharacterCount() {\n if (this.threshold) {\n /* eslint-disable-next-line no-magic-numbers */\n if (this.getCurrentLength() > this.max * (this.threshold / 100)) {\n this.showCharacterCount();\n } else {\n this.hideCharacterCount();\n }\n }\n\n this.$formFieldCharacterCount.innerText = this.getCurrentLengthMessage();\n if (this.isOverThreshold()) {\n this.$formFieldInput.classList.add(\"tna-textarea--error\");\n this.$formFieldCharacterCount.classList.add(\"tna-textarea-count--error\");\n } else {\n this.$formFieldInput.classList.remove(\"tna-textarea--error\");\n this.$formFieldCharacterCount.classList.remove(\n \"tna-textarea-count--error\",\n );\n }\n }\n\n updateScreenReaderCharacterCount() {\n const currentLengthMessage = this.getCurrentLengthMessage();\n this.$formFieldCharacterCountScreenReader.innerText = currentLengthMessage;\n }\n\n showCharacterCount() {\n this.$formFieldCharacterCount.removeAttribute(\"hidden\");\n this.$formFieldCharacterCountScreenReader.removeAttribute(\"aria-hidden\");\n }\n\n hideCharacterCount() {\n this.$formFieldCharacterCount.setAttribute(\"hidden\", \"\");\n this.$formFieldCharacterCountScreenReader.setAttribute(\n \"aria-hidden\",\n \"true\",\n );\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","TextAreaCharacterCount","constructor","$module","options","this","$formFieldInput","querySelector","$formFieldCharacterCount","$formFieldCharacterCountScreenReader","max","parseInt","dataset","maxLength","countType","init","threshold","countThreshold","debounceDuration","intervalChecker","debounceTimeout","lastInputValue","addEventListener","handleInput","lastInputTimestamp","Date","now","handleFocus","handleBlur","updateVisualCharacterCount","updateScreenReaderCharacterCount","valueChecker","window","setInterval","updateIfValueChanged","clearInterval","clearTimeout","setTimeout","getCurrentLength","trimmedValue","trim","split","length","getCurrentLengthMessage","currentLength","typeLabel","Math","abs","replace","Intl","NumberFormat","format","isOverThreshold","showCharacterCount","hideCharacterCount","innerText","classList","add","remove","currentLengthMessage","removeAttribute","setAttribute"],"sourceRoot":""}
@@ -0,0 +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)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},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,{default:()=>i});class i{constructor(t,e={}){if(this.$module=t,this.$formFieldInput=this.$module&&this.$module.querySelector(".tna-textarea"),this.$formFieldInputHint=this.$module&&this.$module.querySelector(".tna-form-item__hint"),this.$formFieldBody=this.$module&&this.$module.querySelector(".tna-form-item__body"),!this.$module||!this.$formFieldInput||!this.$formFieldBody||null!==this.$formFieldInput.getAttribute("hidden"))return;if(!(this.$formFieldInput instanceof HTMLTextAreaElement))throw new Error("Expected a textarea element");const{enhancedHint:i}=e;this.enhancedHint=i||"Enter an item and press enter",this.values=this.$formFieldInput.value.split("\n").map(t=>t.trim()).filter(t=>t),this.id=this.$formFieldInput.id,this.init()}init(){this.$formFieldNewInput=document.createElement("input"),this.$formFieldNewInput.classList.add("tna-text-input"),["id","aria-describedby"].forEach(t=>{this.$formFieldNewInput.setAttribute(t,this.$formFieldInput.getAttribute(t)),this.$formFieldInput.removeAttribute(t)}),this.$formFieldBody.appendChild(this.$formFieldNewInput),this.$formFieldInput.setAttribute("hidden",""),this.$formFieldInput.addEventListener("keyup",()=>this.updateList()),this.$formFieldNewInput.addEventListener("keypress",t=>{"Enter"===t.key&&this.appendValue(t.target.value)}),this.$formFieldNewInputAddButton=document.createElement("button"),this.$formFieldNewInputAddButton.setAttribute("type","button"),this.$formFieldNewInputAddButton.classList.add("tna-button","tna-button--small"),this.$formFieldNewInputAddButtonInner=document.createElement("span"),this.$formFieldNewInputAddButtonInner.innerText="Add",this.$formFieldNewInputAddButtonInnerExtra=document.createElement("span"),this.$formFieldNewInputAddButtonInnerExtra.classList.add("tna-visually-hidden"),this.$formFieldNewInputAddButtonInnerExtra.innerText=" to list",this.$formFieldNewInputAddButtonInner.appendChild(this.$formFieldNewInputAddButtonInnerExtra),this.$formFieldNewInputAddButton.appendChild(this.$formFieldNewInputAddButtonInner),this.$formFieldBody.appendChild(this.$formFieldNewInputAddButton),this.$formFieldNewInputAddButton.addEventListener("click",()=>{this.appendValue(this.$formFieldNewInput.value)}),this.$formFieldLiveAria=document.createElement("div"),this.$formFieldLiveAria.setAttribute("aria-live","polite"),this.$formFieldLiveAria.classList.add("tna-visually-hidden"),this.$module.appendChild(this.$formFieldLiveAria),this.$formFieldCounter=document.createElement("p"),this.$formFieldCounter.id=`${this.id}-list-helper`,this.$formFieldCounter.classList.add("tna-!--margin-top-xs"),this.$module.appendChild(this.$formFieldCounter),this.$formFieldNewInput.setAttribute("aria-describedby",`${this.$formFieldNewInput.getAttribute("aria-describedby")} ${this.$formFieldCounter.id}`),this.$valuesList=document.createElement("ul"),this.$valuesList.classList.add("tna-compound-filters","tna-!--margin-top-xs"),this.$valuesList.addEventListener("blur",()=>{this.$valuesList.removeAttribute("tabindex"),this.updateAriaText("")}),this.$module.appendChild(this.$valuesList),this.$formFieldInputHint||(this.$formFieldInputHint=document.createElement("p"),this.$formFieldInputHint.classList.add("tna-form-item__hint"),this.$formFieldBody.parentNode.insertBefore(this.$formFieldInputHint,this.$formFieldBody)),this.$formFieldInputHint.innerText=this.enhancedHint,this.updateList()}updateAriaText(t){this.$formFieldLiveAria.innerText=t}normaliseValue(t){return t.replace(/\s{2,}/u," ").trim()}isValueInList(t){return this.values.map(t=>this.normaliseValue(t).toLowerCase()).includes(t.toLowerCase().trim())}appendValue(t){const e=this.normaliseValue(t);e?this.isValueInList(e)?this.updateAriaText(`'${e}' already added`):(this.values.push(e),this.$formFieldInput.value=this.values.join("\n"),this.updateList(),this.updateAriaText(`'${e}' added`)):this.updateAriaText("Enter an item to add"),this.$formFieldNewInput.value="",this.$formFieldNewInput.focus()}removeValue(t){const e=this.normaliseValue(t);e&&this.isValueInList(e)&&(this.values=this.values.filter(t=>t!==e),this.$formFieldInput.value=this.values.join("\n"),this.updateList(),this.updateAriaText(`'${e}' removed`)),this.values.length?(this.$valuesList.setAttribute("tabindex","0"),this.$valuesList.focus()):this.$formFieldNewInput.focus()}updateList(){this.$valuesList.innerHTML="",this.values.map(t=>{const e=document.createElement("li");e.classList.add("tna-compound-filters__item");const i=document.createElement("span");i.innerText=t,e.appendChild(i);const n=document.createElement("button");return n.innerText=`Remove '${t}'`,n.setAttribute("type","button"),n.classList.add("tna-compound-filters__link"),n.addEventListener("click",()=>{this.removeValue(t)}),e.appendChild(n),e}).forEach(t=>this.$valuesList.appendChild(t));let t="item";1!==this.values.length&&(t+="s");const e=`${(new Intl.NumberFormat).format(this.values.length)} ${t} added`;this.$formFieldCounter.innerText=e}}return e})());
2
+ //# sourceMappingURL=TextAreaItemisedRows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components/TextAreaItemisedRows/TextAreaItemisedRows.js","mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,iBAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,GACC,CATD,CASCK,KAAA,I,mBCRD,MAAAC,EAAA,CCAAA,EAAA,CAAAL,EAAAM,KACA,QAAAC,KAAAD,EACAD,EAAAG,EAAAF,EAAAC,KAAAF,EAAAG,EAAAR,EAAAO,IACAE,OAAAC,eAAAV,EAAAO,EAAA,CAAyCI,YAAA,EAAAC,IAAAN,EAAAC,MCJzCF,EAAA,CAAAQ,EAAAC,IAAAL,OAAAM,UAAAC,eAAAC,KAAAJ,EAAAC,GCCAT,EAAAL,IACAS,OAAAC,eAAAV,EAAAkB,OAAAC,YAAA,CAAsDC,MAAA,WACtDX,OAAAC,eAAAV,EAAA,cAAgDoB,OAAA,M,uCCHjC,MAAMC,EACnB,WAAAC,CAAYC,EAASC,EAAU,CAAC,GAS9B,GARAC,KAAKF,QAAUA,EACfE,KAAKC,gBACHD,KAAKF,SAAWE,KAAKF,QAAQI,cAAc,iBAC7CF,KAAKG,oBACHH,KAAKF,SAAWE,KAAKF,QA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BAAiB,QAAS,KAC1C1B,KAAKoD,YAAYzD,KAEnB6D,EAAM/B,YAAYiC,GACXF,IAERnC,QAASmC,GAAUxD,KAAKqC,YAAYZ,YAAY+B,IAEnD,IAAIG,EAAqB,OAEE,IAAvB3D,KAAKS,OAAO6C,SACdK,GAAsB,KAExB,MAAMC,EAAiB,IAAG,IAAIC,KAAKC,cAAeC,OAAO/D,KAAKS,OAAO6C,WAAWK,UAChF3D,KAAKoC,kBAAkBH,UAAY2B,CACrC,E","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/textarea/TextAreaItemisedRows.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 default class TextAreaItemisedRows {\n constructor($module, options = {}) {\n this.$module = $module;\n this.$formFieldInput =\n this.$module && this.$module.querySelector(\".tna-textarea\");\n this.$formFieldInputHint =\n this.$module && this.$module.querySelector(\".tna-form-item__hint\");\n this.$formFieldBody =\n this.$module && this.$module.querySelector(\".tna-form-item__body\");\n\n if (\n !this.$module ||\n !this.$formFieldInput ||\n !this.$formFieldBody ||\n this.$formFieldInput.getAttribute(\"hidden\") !== null\n ) {\n return;\n }\n\n if (!(this.$formFieldInput instanceof HTMLTextAreaElement)) {\n throw new Error(\"Expected a textarea element\");\n }\n\n const { enhancedHint } = options;\n this.enhancedHint = enhancedHint || \"Enter an item and press enter\";\n\n this.values = this.$formFieldInput.value\n .split(\"\\n\")\n .map((value) => value.trim())\n .filter((value) => value);\n\n this.id = this.$formFieldInput.id;\n\n this.init();\n }\n\n init() {\n this.$formFieldNewInput = document.createElement(\"input\");\n this.$formFieldNewInput.classList.add(\"tna-text-input\");\n [\"id\", \"aria-describedby\"].forEach((attribute) => {\n this.$formFieldNewInput.setAttribute(\n attribute,\n this.$formFieldInput.getAttribute(attribute),\n );\n this.$formFieldInput.removeAttribute(attribute);\n });\n this.$formFieldBody.appendChild(this.$formFieldNewInput);\n this.$formFieldInput.setAttribute(\"hidden\", \"\");\n this.$formFieldInput.addEventListener(\"keyup\", () => this.updateList());\n this.$formFieldNewInput.addEventListener(\"keypress\", (event) => {\n if (event.key === \"Enter\") {\n this.appendValue(event.target.value);\n }\n });\n\n this.$formFieldNewInputAddButton = document.createElement(\"button\");\n this.$formFieldNewInputAddButton.setAttribute(\"type\", \"button\");\n this.$formFieldNewInputAddButton.classList.add(\n \"tna-button\",\n \"tna-button--small\",\n );\n this.$formFieldNewInputAddButtonInner = document.createElement(\"span\");\n this.$formFieldNewInputAddButtonInner.innerText = \"Add\";\n this.$formFieldNewInputAddButtonInnerExtra = document.createElement(\"span\");\n this.$formFieldNewInputAddButtonInnerExtra.classList.add(\n \"tna-visually-hidden\",\n );\n this.$formFieldNewInputAddButtonInnerExtra.innerText = \" to list\";\n this.$formFieldNewInputAddButtonInner.appendChild(\n this.$formFieldNewInputAddButtonInnerExtra,\n );\n this.$formFieldNewInputAddButton.appendChild(\n this.$formFieldNewInputAddButtonInner,\n );\n this.$formFieldBody.appendChild(this.$formFieldNewInputAddButton);\n this.$formFieldNewInputAddButton.addEventListener(\"click\", () => {\n this.appendValue(this.$formFieldNewInput.value);\n });\n\n this.$formFieldLiveAria = document.createElement(\"div\");\n this.$formFieldLiveAria.setAttribute(\"aria-live\", \"polite\");\n this.$formFieldLiveAria.classList.add(\"tna-visually-hidden\");\n this.$module.appendChild(this.$formFieldLiveAria);\n\n this.$formFieldCounter = document.createElement(\"p\");\n this.$formFieldCounter.id = `${this.id}-list-helper`;\n this.$formFieldCounter.classList.add(\"tna-!--margin-top-xs\");\n this.$module.appendChild(this.$formFieldCounter);\n\n this.$formFieldNewInput.setAttribute(\n \"aria-describedby\",\n `${this.$formFieldNewInput.getAttribute(\"aria-describedby\")} ${\n this.$formFieldCounter.id\n }`,\n );\n\n this.$valuesList = document.createElement(\"ul\");\n this.$valuesList.classList.add(\n \"tna-compound-filters\",\n \"tna-!--margin-top-xs\",\n );\n this.$valuesList.addEventListener(\"blur\", () => {\n this.$valuesList.removeAttribute(\"tabindex\");\n this.updateAriaText(\"\");\n });\n this.$module.appendChild(this.$valuesList);\n\n if (!this.$formFieldInputHint) {\n this.$formFieldInputHint = document.createElement(\"p\");\n this.$formFieldInputHint.classList.add(\"tna-form-item__hint\");\n this.$formFieldBody.parentNode.insertBefore(\n this.$formFieldInputHint,\n this.$formFieldBody,\n );\n }\n this.$formFieldInputHint.innerText = this.enhancedHint;\n\n this.updateList();\n }\n\n updateAriaText(content) {\n this.$formFieldLiveAria.innerText = content;\n }\n\n /* eslint-disable-next-line class-methods-use-this */\n normaliseValue(value) {\n return value.replace(/\\s{2,}/u, \" \").trim();\n }\n\n isValueInList(value) {\n return this.values\n .map((eachValue) => this.normaliseValue(eachValue).toLowerCase())\n .includes(value.toLowerCase().trim());\n }\n\n appendValue(value) {\n const newValue = this.normaliseValue(value);\n if (newValue) {\n if (this.isValueInList(newValue)) {\n this.updateAriaText(`'${newValue}' already added`);\n } else {\n this.values.push(newValue);\n this.$formFieldInput.value = this.values.join(\"\\n\");\n this.updateList();\n this.updateAriaText(`'${newValue}' added`);\n }\n } else {\n this.updateAriaText(\"Enter an item to add\");\n }\n this.$formFieldNewInput.value = \"\";\n this.$formFieldNewInput.focus();\n }\n\n removeValue(value) {\n const removeValue = this.normaliseValue(value);\n if (removeValue && this.isValueInList(removeValue)) {\n this.values = this.values.filter(\n (existingValue) => existingValue !== removeValue,\n );\n this.$formFieldInput.value = this.values.join(\"\\n\");\n this.updateList();\n this.updateAriaText(`'${removeValue}' removed`);\n }\n if (this.values.length) {\n this.$valuesList.setAttribute(\"tabindex\", \"0\");\n this.$valuesList.focus();\n } else {\n this.$formFieldNewInput.focus();\n }\n }\n\n updateList() {\n this.$valuesList.innerHTML = \"\";\n this.values\n .map((value) => {\n const $item = document.createElement(\"li\");\n $item.classList.add(\"tna-compound-filters__item\");\n const $itemLabel = document.createElement(\"span\");\n $itemLabel.innerText = value;\n $item.appendChild($itemLabel);\n\n const $removeItemButton = document.createElement(\"button\");\n $removeItemButton.innerText = `Remove '${value}'`;\n $removeItemButton.setAttribute(\"type\", \"button\");\n $removeItemButton.classList.add(\"tna-compound-filters__link\");\n $removeItemButton.addEventListener(\"click\", () => {\n this.removeValue(value);\n });\n $item.appendChild($removeItemButton);\n return $item;\n })\n .forEach(($item) => this.$valuesList.appendChild($item));\n\n let innerTextItemValue = \"item\";\n /* eslint-disable-next-line no-magic-numbers */\n if (this.values.length !== 1) {\n innerTextItemValue += \"s\";\n }\n const innerTextValue = `${new Intl.NumberFormat().format(this.values.length)} ${innerTextItemValue} added`;\n this.$formFieldCounter.innerText = innerTextValue;\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","TextAreaItemisedRows","constructor","$module","options","this","$formFieldInput","querySelector","$formFieldInputHint","$formFieldBody","getAttribute","HTMLTextAreaElement","Error","enhancedHint","values","split","map","trim","filter","id","init","$formFieldNewInput","document","createElement","classList","add","forEach","attribute","setAttribute","removeAttribute","appendChild","addEventListener","updateList","event","appendValue","target","$formFieldNewInputAddButton","$formFieldNewInputAddButtonInner","innerText","$formFieldNewInputAddButtonInnerExtra","$formFieldLiveAria","$formFieldCounter","$valuesList","updateAriaText","parentNode","insertBefore","content","normaliseValue","replace","isValueInList","eachValue","toLowerCase","includes","newValue","push","join","focus","removeValue","existingValue","length","innerHTML","$item","$itemLabel","$removeItemButton","innerTextItemValue","innerTextValue","Intl","NumberFormat","format"],"sourceRoot":""}
@@ -1 +1 @@
1
- .tna-accordion,.tna-accordion__item{margin-top:2rem}.tna-accordion:first-child,.tna-accordion__item:first-child{margin-top:0}.tna-accordion__heading{padding-top:1rem}.tna-accordion__body{padding-top:1rem}.tna-accordion__toggle-all{margin-bottom:1rem;padding:0;background:rgba(0,0,0,0);border:none;border-radius:.1px;cursor:pointer;color:var(--link, #005fa3);font-size:1rem}.tna-accordion__toggle-all:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}.tna-accordion__details{border-bottom:1px var(--keyline, rgba(38, 38, 42, 0.25)) solid;position:relative;z-index:1}.tna-accordion__details:first-of-type{border-top:1px var(--keyline, rgba(38, 38, 42, 0.25)) solid}.tna-accordion__details:has(.tna-accordion__summary:focus){z-index:2}.tna-accordion__summary{width:100%;margin:0;padding:0.5rem 3rem 0.5rem 1rem;display:block;position:relative;line-height:inherit;text-align:left;list-style:none;background:rgba(0,0,0,0);border:none;border-radius:.1px;cursor:pointer;color:var(--font-dark, rgb(1, 1, 1));font-size:1.125rem;font-family:Open Sans,sans-serif;font-variation-settings:"wdth" 100;font-style:normal;font-optical-sizing:auto;font-weight:700}.tna-accordion__summary *{font-size:inherit}.tna-accordion__summary::before{content:"";width:0;height:0;position:absolute;top:calc(50% - 0.4330127019rem);right:.75rem;border-width:0.8660254038rem .5rem 0 .5rem;border-color:var(--font-light, rgba(1, 1, 1, 0.58)) rgba(0,0,0,0);border-style:solid}.tna-accordion__summary:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em;background-color:var(--background-tint, rgb(217, 217, 214))}.tna-accordion__summary:hover::before{border-color:var(--font-dark, rgb(1, 1, 1)) rgba(0,0,0,0)}.tna-accordion__summary[aria-expanded=true]::before{border-width:0 .5rem 0.8660254038rem .5rem}.tna-accordion__content{padding:1rem;position:relative;border-radius:.1px}@media(forced-colors: active){.tna-accordion__summary::before{content:"↓";width:auto;height:auto;top:calc(50% - .5rem);line-height:1rem;border:none}.tna-accordion__summary[aria-expanded=true]::before{content:"↑";border:none}}/*# sourceMappingURL=accordion.css.map */
1
+ .tna-accordion,.tna-accordion__item{margin-top:2rem}.tna-accordion:first-child,.tna-accordion__item:first-child,.tna-accordion:first-child.tna-visually-hidden+*,.tna-accordion__item:first-child.tna-visually-hidden+*{margin-top:0}.tna-accordion__heading{padding-top:1rem}.tna-accordion__body{padding-top:1rem}.tna-accordion__toggle-all{margin-bottom:1rem;padding:0;background:rgba(0,0,0,0);border:none;border-radius:.1px;cursor:pointer;color:var(--link, #005fa3);font-size:1rem}.tna-accordion__toggle-all:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}.tna-accordion__details{border-bottom:1px var(--keyline, rgba(38, 38, 42, 0.25)) solid;position:relative;z-index:1}.tna-accordion__details:first-of-type{border-top:1px var(--keyline, rgba(38, 38, 42, 0.25)) solid}.tna-accordion__details:has(.tna-accordion__summary:focus){z-index:2}.tna-accordion__summary{width:100%;margin:0;padding:0.5rem 3rem 0.5rem 1rem;display:block;position:relative;line-height:inherit;text-align:left;list-style:none;background:rgba(0,0,0,0);border:none;border-radius:.1px;cursor:pointer;color:var(--font-dark, rgb(1, 1, 1));font-size:1.125rem;font-family:Open Sans,sans-serif;font-variation-settings:"wdth" 100;font-style:normal;font-optical-sizing:auto;font-weight:700}.tna-accordion__summary *{font-size:inherit}.tna-accordion__summary::before{content:"";width:0;height:0;position:absolute;top:calc(50% - 0.4330127019rem);right:.75rem;border-width:0.8660254038rem .5rem 0 .5rem;border-color:var(--font-light, rgba(1, 1, 1, 0.58)) rgba(0,0,0,0);border-style:solid}.tna-accordion__summary:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em;background-color:var(--background-tint, rgb(217, 217, 214))}.tna-accordion__summary:hover::before{border-color:var(--font-dark, rgb(1, 1, 1)) rgba(0,0,0,0)}.tna-accordion__summary[aria-expanded=true]::before{border-width:0 .5rem 0.8660254038rem .5rem}.tna-accordion__content{padding:1rem;position:relative;border-radius:.1px}@media(forced-colors: active){.tna-accordion__summary::before{content:"↓";width:auto;height:auto;top:calc(50% - .5rem);line-height:1rem;border:none}.tna-accordion__summary[aria-expanded=true]::before{content:"↑";border:none}}/*# sourceMappingURL=accordion.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/accordion/accordion.scss","../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss"],"names":[],"mappings":"CA0BA,oCACE,gBAUA,4DACE,aCzBF,wBACE,iBAGF,qBACE,iBAIF,2BACE,mBACA,UAEA,yBAEA,YACA,mBAEA,eC+CF,2BCxEA,eF8BE,iCE+BF,0BACA,0BCpCsC,QDqCtC,sBCvCoC,OHWpC,wBC2DI,+DDxDF,kBACA,UAEA,sCCqDE,4DDhDJ,2DACE,UAGF,wBACE,WACA,SACA,gCAGA,cAEA,kBAEA,oBACA,gBAEA,gBAEA,yBAEA,YACA,mBAEA,eCEF,qCCxEA,mBAqBA,YCSA,qBDRA,mCACA,kBACA,yBAPA,YCiBsB,IH0CpB,0BACE,kBAGF,gCACE,WAEA,QACA,SAEA,kBACA,gCACA,aAEA,2CACA,kEACA,mBAGF,8BElCF,0BACA,0BCpCsC,QDqCtC,sBCvCoC,OFoDpC,4DDuBI,sCACE,0DAKF,oDACE,2CAKN,wBACE,aAEA,kBAEA,mBCiZF,8BD5YI,gCACE,YAEA,WACA,YAEA,sBAEA,iBAEA,YAIA,oDACE,YAEA","file":"accordion.css","sourcesContent":["@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 \"sass:math\";\n@use \"../../tools/colour\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-accordion {\n @include spacing.space-above;\n\n // NON INTERACTIVE\n &__item {\n @include spacing.space-above;\n }\n\n &__heading {\n padding-top: spacing.space(1);\n }\n\n &__body {\n padding-top: spacing.space(1);\n }\n\n // INTERACTIVE\n &__toggle-all {\n margin-bottom: spacing.space(1);\n padding: 0;\n\n background: transparent;\n\n border: none;\n border-radius: 0.1px;\n\n cursor: pointer;\n\n @include colour.colour-font(\"link\");\n @include typography.font-size(16);\n\n &:hover {\n @include typography.interacted-text-decoration;\n }\n }\n\n &__details {\n @include colour.colour-border(\"keyline\", 1px, solid, bottom);\n\n position: relative;\n z-index: 1;\n\n &:first-of-type {\n @include colour.colour-border(\"keyline\", 1px, solid, top);\n }\n }\n\n &__details:has(&__summary:focus) {\n z-index: 2;\n }\n\n &__summary {\n width: 100%;\n margin: 0;\n padding: spacing.space(0.5) spacing.space(3) spacing.space(0.5)\n spacing.space(1);\n\n display: block;\n\n position: relative;\n\n line-height: inherit;\n text-align: left;\n\n list-style: none;\n\n background: transparent;\n\n border: none;\n border-radius: 0.1px;\n\n cursor: pointer;\n\n @include colour.colour-font(\"font-dark\");\n @include typography.font-size(18);\n @include typography.main-font(true);\n\n * {\n font-size: inherit;\n }\n\n &::before {\n content: \"\";\n\n width: 0;\n height: 0;\n\n position: absolute;\n top: calc(50% - #{math.div(math.sqrt(3), 4)}rem);\n right: 0.75rem;\n\n border-width: #{math.div(math.sqrt(3), 2)}rem 0.5rem 0 0.5rem;\n border-color: colour.colour-var(\"font-light\") transparent;\n border-style: solid;\n }\n\n &:hover {\n @include typography.interacted-text-decoration;\n @include colour.colour-background(\"background-tint\");\n\n &::before {\n border-color: colour.colour-var(\"font-dark\") transparent;\n }\n }\n\n &[aria-expanded=\"true\"] {\n &::before {\n border-width: 0 0.5rem #{math.div(math.sqrt(3), 2)}rem 0.5rem;\n }\n }\n }\n\n &__content {\n padding: spacing.space(1);\n\n position: relative;\n\n border-radius: 0.1px;\n }\n\n @include colour.on-forced-colours {\n &__summary {\n &::before {\n content: \"\\2193\";\n\n width: auto;\n height: auto;\n\n top: calc(50% - 0.5rem);\n\n line-height: 1rem;\n\n border: none;\n }\n\n &[aria-expanded=\"true\"] {\n &::before {\n content: \"\\2191\";\n\n border: none;\n }\n }\n }\n }\n}\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
+ {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/accordion/accordion.scss","../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss"],"names":[],"mappings":"CA0BA,oCACE,gBAUA,oKAEE,aC1BF,wBACE,iBAGF,qBACE,iBAIF,2BACE,mBACA,UAEA,yBAEA,YACA,mBAEA,eC+CF,2BCxEA,eF8BE,iCE+BF,0BACA,0BCpCsC,QDqCtC,sBCvCoC,OHWpC,wBC2DI,+DDxDF,kBACA,UAEA,sCCqDE,4DDhDJ,2DACE,UAGF,wBACE,WACA,SACA,gCAGA,cAEA,kBAEA,oBACA,gBAEA,gBAEA,yBAEA,YACA,mBAEA,eCEF,qCCxEA,mBAqBA,YCSA,qBDRA,mCACA,kBACA,yBAPA,YCiBsB,IH0CpB,0BACE,kBAGF,gCACE,WAEA,QACA,SAEA,kBACA,gCACA,aAEA,2CACA,kEACA,mBAGF,8BElCF,0BACA,0BCpCsC,QDqCtC,sBCvCoC,OFoDpC,4DDuBI,sCACE,0DAKF,oDACE,2CAKN,wBACE,aAEA,kBAEA,mBCiZF,8BD5YI,gCACE,YAEA,WACA,YAEA,sBAEA,iBAEA,YAIA,oDACE,YAEA","file":"accordion.css","sourcesContent":["@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 &:first-child.tna-visually-hidden + * {\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 \"sass:math\";\n@use \"../../tools/colour\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-accordion {\n @include spacing.space-above;\n\n // NON INTERACTIVE\n &__item {\n @include spacing.space-above;\n }\n\n &__heading {\n padding-top: spacing.space(1);\n }\n\n &__body {\n padding-top: spacing.space(1);\n }\n\n // INTERACTIVE\n &__toggle-all {\n margin-bottom: spacing.space(1);\n padding: 0;\n\n background: transparent;\n\n border: none;\n border-radius: 0.1px;\n\n cursor: pointer;\n\n @include colour.colour-font(\"link\");\n @include typography.font-size(16);\n\n &:hover {\n @include typography.interacted-text-decoration;\n }\n }\n\n &__details {\n @include colour.colour-border(\"keyline\", 1px, solid, bottom);\n\n position: relative;\n z-index: 1;\n\n &:first-of-type {\n @include colour.colour-border(\"keyline\", 1px, solid, top);\n }\n }\n\n &__details:has(&__summary:focus) {\n z-index: 2;\n }\n\n &__summary {\n width: 100%;\n margin: 0;\n padding: spacing.space(0.5) spacing.space(3) spacing.space(0.5)\n spacing.space(1);\n\n display: block;\n\n position: relative;\n\n line-height: inherit;\n text-align: left;\n\n list-style: none;\n\n background: transparent;\n\n border: none;\n border-radius: 0.1px;\n\n cursor: pointer;\n\n @include colour.colour-font(\"font-dark\");\n @include typography.font-size(18);\n @include typography.main-font(true);\n\n * {\n font-size: inherit;\n }\n\n &::before {\n content: \"\";\n\n width: 0;\n height: 0;\n\n position: absolute;\n top: calc(50% - #{math.div(math.sqrt(3), 4)}rem);\n right: 0.75rem;\n\n border-width: #{math.div(math.sqrt(3), 2)}rem 0.5rem 0 0.5rem;\n border-color: colour.colour-var(\"font-light\") transparent;\n border-style: solid;\n }\n\n &:hover {\n @include typography.interacted-text-decoration;\n @include colour.colour-background(\"background-tint\");\n\n &::before {\n border-color: colour.colour-var(\"font-dark\") transparent;\n }\n }\n\n &[aria-expanded=\"true\"] {\n &::before {\n border-width: 0 0.5rem #{math.div(math.sqrt(3), 2)}rem 0.5rem;\n }\n }\n }\n\n &__content {\n padding: spacing.space(1);\n\n position: relative;\n\n border-radius: 0.1px;\n }\n\n @include colour.on-forced-colours {\n &__summary {\n &::before {\n content: \"\\2193\";\n\n width: auto;\n height: auto;\n\n top: calc(50% - 0.5rem);\n\n line-height: 1rem;\n\n border: none;\n }\n\n &[aria-expanded=\"true\"] {\n &::before {\n content: \"\\2191\";\n\n border: none;\n }\n }\n }\n }\n}\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(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TNAFrontend",[],t):"object"==typeof exports?exports.TNAFrontend=t():e.TNAFrontend=t()}(self,()=>(()=>{"use strict";var e={181(e,t,r){r.d(t,["A",0,()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/gu,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))])}};const t={};function r(s){const a=t[s];if(void 0!==a)return a.exports;const n=t[s]={exports:{}};return e[s](n,n.exports,r),n.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var s=0;s<t.length;){var a=t[s++],n=t[s++],i=0===n?{enumerable:!0,value:t[s++]}:{enumerable:!0,get:n};r.o(e,a)||Object.defineProperty(e,a,i)}else for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};let s={};r.r(s),r.d(s,{Breadcrumbs:()=>n});var a=r(181);class n{constructor(e){this.$module=e,this.$breadcrumbsList=e&&e.querySelector(".tna-breadcrumbs__list"),this.$breadcrumbs=e&&this.$breadcrumbsList&&e.querySelectorAll(".tna-breadcrumbs__item"),this.$module&&this.$breadcrumbsList&&this.$breadcrumbs&&this.$breadcrumbs.length>2&&!this.$module.classList.contains("tna-breadcrumbs--no-collapse")&&this.init()}init(){const e=`tna-breadcrumbs-${(0,a.A)()}`,t=document.createElement("li");t.classList.add("tna-breadcrumbs__item","tna-breadcrumbs__item--expandable"),t.style.display="none";const r=document.createElement("button");r.classList.add("tna-breadcrumbs__link"),r.innerHTML="<span class='tna-!--visually-hidden'>Expand breadcrumbs</span>&hellip;",r.setAttribute("type","button"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls",e),r.addEventListener("click",()=>{this.$module.classList.remove("tna-breadcrumbs--collapsed"),t.remove(),this.$module.setAttribute("tabindex","0"),this.$module.focus(),this.$module.addEventListener("blur",()=>{this.$module.removeAttribute("tabindex")},{once:!0})}),t.appendChild(r),this.$breadcrumbsList.setAttribute("id",e),this.$breadcrumbsList.insertBefore(t,this.$breadcrumbs[this.$breadcrumbs.length-2].nextSibling),this.$module.classList.add("tna-breadcrumbs--collapsed")}}return s})());
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TNAFrontend",[],t):"object"==typeof exports?exports.TNAFrontend=t():e.TNAFrontend=t()}(self,()=>(()=>{"use strict";var e={181(e,t,r){r.d(t,["A",0,()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/gu,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))])}};const t={};function r(s){const a=t[s];if(void 0!==a)return a.exports;const n=t[s]={exports:{}};return e[s](n,n.exports,r),n.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var s=0;s<t.length;){var a=t[s++],n=t[s++],i=0===n?{enumerable:!0,value:t[s++]}:{enumerable:!0,get:n};r.o(e,a)||Object.defineProperty(e,a,i)}else for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};let s={};r.r(s),r.d(s,{Breadcrumbs:()=>n});var a=r(181);class n{constructor(e){this.$module=e,this.$breadcrumbsList=e&&e.querySelector(".tna-breadcrumbs__list"),this.$breadcrumbs=e&&this.$breadcrumbsList&&e.querySelectorAll(".tna-breadcrumbs__item"),this.$module&&this.$breadcrumbsList&&this.$breadcrumbs&&this.$breadcrumbs.length>2&&!this.$module.classList.contains("tna-breadcrumbs--no-collapse")&&this.init()}init(){const e=`tna-breadcrumbs-${(0,a.A)()}`,t=document.createElement("li");t.classList.add("tna-breadcrumbs__item","tna-breadcrumbs__item--expandable"),t.style.display="none";const r=document.createElement("button");r.classList.add("tna-breadcrumbs__link"),r.innerHTML="<span class='tna-visually-hidden'>Expand breadcrumbs</span>&hellip;",r.setAttribute("type","button"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls",e),r.addEventListener("click",()=>{this.$module.classList.remove("tna-breadcrumbs--collapsed"),t.remove(),this.$module.setAttribute("tabindex","0"),this.$module.focus(),this.$module.addEventListener("blur",()=>{this.$module.removeAttribute("tabindex")},{once:!0})}),t.appendChild(r),this.$breadcrumbsList.setAttribute("id",e),this.$breadcrumbsList.insertBefore(t,this.$breadcrumbs[this.$breadcrumbs.length-2].nextSibling),this.$module.classList.add("tna-breadcrumbs--collapsed")}}return s})());
2
2
  //# sourceMappingURL=breadcrumbs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/breadcrumbs/breadcrumbs.js","mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,O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AMa,EACX,WAAAC,CAAYC,GACVC,KAAKD,QAAUA,EACfC,KAAKC,iBACHF,GAAWA,EAAQG,cAAc,0BACnCF,KAAKG,aACHJ,GACAC,KAAKC,kBACLF,EAAQK,iBAAiB,0BAEtBJ,KAAKD,SAAYC,KAAKC,kBAAqBD,KAAKG,cAMnDH,KAAKG,aAAaxB,OAAS,IAC1BqB,KAAKD,QAAQM,UAAUC,SAAS,iCAEjCN,KAAKO,MAET,CAEA,IAAAA,GACE,MAAMC,EAAW,oBAAmB,EAAAC,EAAAC,OAC9BC,EAAcC,SAASC,cAAc,MAC3CF,EAAYN,UAAUS,IACpB,wBACA,qCAEFH,EAAYI,MAAMC,QAAU,OAE5B,MAAMC,EAAgBL,SAASC,cAAc,UAC7CI,EAAcZ,UAAUS,IAAI,yBAC5BG,EAAcC,UACZ,yEACFD,EAAcE,aAAa,OAAQ,UACnCF,EAAcE,aAAa,gBAAiB,SAC5CF,EAAcE,aAAa,gBAAiBX,GAC5CS,EAAcG,iBAAiB,QAAS,KACtCpB,KAAKD,QAAQM,UAAUgB,OAAO,8BAC9BV,EAAYU,SACZrB,KAAKD,QAAQoB,aAAa,WAAY,KACtCnB,KAAKD,QAAQuB,QACbtB,KAAKD,QAAQqB,iBACX,OACA,KACEpB,KAAKD,QAAQwB,gBAAgB,aAE/B,CAAEC,MAAM,MAGZb,EAAYc,YAAYR,GAExBjB,KAAKC,iBAAiBkB,aAAa,KAAMX,GACzCR,KAAKC,iBAAiByB,aACpBf,EAEAX,KAAKG,aAAaH,KAAKG,aAAaxB,OAAS,GAAGgD,aAGlD3B,KAAKD,QAAQM,UAAUS,IAAI,6BAC7B,E","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/uuid.mjs","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/breadcrumbs/breadcrumbs.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 ","/* eslint-disable no-magic-numbers */\n/* eslint-disable no-bitwise */\nconst uuidv4 = () =>\n ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/gu, (char) =>\n (\n char ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (char / 4)))\n ).toString(16),\n );\n\nexport default uuidv4;\n","// The module cache\nconst __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tconst cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tconst module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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\tvar descriptor = binding === 0 ? { enumerable: true, value: definition[i++] } : { enumerable: true, get: binding };\n\t\t\tif(!__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, descriptor);\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\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import uuidv4 from \"../../lib/uuid.mjs\";\n\nexport class Breadcrumbs {\n constructor($module) {\n this.$module = $module;\n this.$breadcrumbsList =\n $module && $module.querySelector(\".tna-breadcrumbs__list\");\n this.$breadcrumbs =\n $module &&\n this.$breadcrumbsList &&\n $module.querySelectorAll(\".tna-breadcrumbs__item\");\n\n if (!this.$module || !this.$breadcrumbsList || !this.$breadcrumbs) {\n return;\n }\n\n if (\n /* eslint-disable-next-line no-magic-numbers */\n this.$breadcrumbs.length > 2 &&\n !this.$module.classList.contains(\"tna-breadcrumbs--no-collapse\")\n ) {\n this.init();\n }\n }\n\n init() {\n const uniqueId = `tna-breadcrumbs-${uuidv4()}`;\n const $expandable = document.createElement(\"li\");\n $expandable.classList.add(\n \"tna-breadcrumbs__item\",\n \"tna-breadcrumbs__item--expandable\",\n );\n $expandable.style.display = \"none\";\n\n const $expandButton = document.createElement(\"button\");\n $expandButton.classList.add(\"tna-breadcrumbs__link\");\n $expandButton.innerHTML =\n \"<span class='tna-!--visually-hidden'>Expand breadcrumbs</span>&hellip;\";\n $expandButton.setAttribute(\"type\", \"button\");\n $expandButton.setAttribute(\"aria-expanded\", \"false\");\n $expandButton.setAttribute(\"aria-controls\", uniqueId);\n $expandButton.addEventListener(\"click\", () => {\n this.$module.classList.remove(\"tna-breadcrumbs--collapsed\");\n $expandable.remove();\n this.$module.setAttribute(\"tabindex\", \"0\");\n this.$module.focus();\n this.$module.addEventListener(\n \"blur\",\n () => {\n this.$module.removeAttribute(\"tabindex\");\n },\n { once: true },\n );\n });\n $expandable.appendChild($expandButton);\n\n this.$breadcrumbsList.setAttribute(\"id\", uniqueId);\n this.$breadcrumbsList.insertBefore(\n $expandable,\n /* eslint-disable-next-line no-magic-numbers */\n this.$breadcrumbs[this.$breadcrumbs.length - 2].nextSibling,\n );\n\n this.$module.classList.add(\"tna-breadcrumbs--collapsed\");\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","replace","char","crypto","getRandomValues","Uint8Array","toString","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","Array","isArray","i","length","key","binding","descriptor","enumerable","value","get","o","Object","defineProperty","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","Breadcrumbs","constructor","$module","this","$breadcrumbsList","querySelector","$breadcrumbs","querySelectorAll","classList","contains","init","uniqueId","_lib_uuid_mjs__WEBPACK_IMPORTED_MODULE_0__","A","$expandable","document","createElement","add","style","display","$expandButton","innerHTML","setAttribute","addEventListener","remove","focus","removeAttribute","once","appendChild","insertBefore","nextSibling"],"sourceRoot":""}
1
+ {"version":3,"file":"components/breadcrumbs/breadcrumbs.js","mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,iBAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,GACC,CATD,CASCK,KAAA,I,kDCPc,KACZ,CAAC,MAAQ,KAAO,KAAO,KAAO,MAAMC,QAAQ,UAAYC,IAErDA,EACCC,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAM,IAAOH,EAAO,GAC/DI,SAAS,M,GCNf,MAAAC,EAAA,GAGA,SAAAC,EAAAC,GAEA,MAAAC,EAAAH,EAAAE,GACA,QAAAE,IAAAD,EACA,OAAAA,EAAAd,QAGA,MAAAC,EAAAU,EAAAE,GAAA,CAGAb,QAAA,IAOA,OAHAgB,EAAAH,GAAAZ,EAAAA,EAAAD,QAAAY,GAGAX,EAAAD,OACA,CCrBAY,EAAAK,EAAA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AQ,UACnCF,EAAcE,aAAa,gBAAiB,SAC5CF,EAAcE,aAAa,gBAAiBX,GAC5CS,EAAcG,iBAAiB,QAAS,KACtCpB,KAAKD,QAAQM,UAAUgB,OAAO,8BAC9BV,EAAYU,SACZrB,KAAKD,QAAQoB,aAAa,WAAY,KACtCnB,KAAKD,QAAQuB,QACbtB,KAAKD,QAAQqB,iBACX,OACA,KACEpB,KAAKD,QAAQwB,gBAAgB,aAE/B,CAAEC,MAAM,MAGZb,EAAYc,YAAYR,GAExBjB,KAAKC,iBAAiBkB,aAAa,KAAMX,GACzCR,KAAKC,iBAAiByB,aACpBf,EAEAX,KAAKG,aAAaH,KAAKG,aAAaxB,OAAS,GAAGgD,aAGlD3B,KAAKD,QAAQM,UAAUS,IAAI,6BAC7B,E","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/uuid.mjs","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/breadcrumbs/breadcrumbs.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 ","/* eslint-disable no-magic-numbers */\n/* eslint-disable no-bitwise */\nconst uuidv4 = () =>\n ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/gu, (char) =>\n (\n char ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (char / 4)))\n ).toString(16),\n );\n\nexport default uuidv4;\n","// The module cache\nconst __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tconst cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tconst module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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\tvar descriptor = binding === 0 ? { enumerable: true, value: definition[i++] } : { enumerable: true, get: binding };\n\t\t\tif(!__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, descriptor);\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\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import uuidv4 from \"../../lib/uuid.mjs\";\n\nexport class Breadcrumbs {\n constructor($module) {\n this.$module = $module;\n this.$breadcrumbsList =\n $module && $module.querySelector(\".tna-breadcrumbs__list\");\n this.$breadcrumbs =\n $module &&\n this.$breadcrumbsList &&\n $module.querySelectorAll(\".tna-breadcrumbs__item\");\n\n if (!this.$module || !this.$breadcrumbsList || !this.$breadcrumbs) {\n return;\n }\n\n if (\n /* eslint-disable-next-line no-magic-numbers */\n this.$breadcrumbs.length > 2 &&\n !this.$module.classList.contains(\"tna-breadcrumbs--no-collapse\")\n ) {\n this.init();\n }\n }\n\n init() {\n const uniqueId = `tna-breadcrumbs-${uuidv4()}`;\n const $expandable = document.createElement(\"li\");\n $expandable.classList.add(\n \"tna-breadcrumbs__item\",\n \"tna-breadcrumbs__item--expandable\",\n );\n $expandable.style.display = \"none\";\n\n const $expandButton = document.createElement(\"button\");\n $expandButton.classList.add(\"tna-breadcrumbs__link\");\n $expandButton.innerHTML =\n \"<span class='tna-visually-hidden'>Expand breadcrumbs</span>&hellip;\";\n $expandButton.setAttribute(\"type\", \"button\");\n $expandButton.setAttribute(\"aria-expanded\", \"false\");\n $expandButton.setAttribute(\"aria-controls\", uniqueId);\n $expandButton.addEventListener(\"click\", () => {\n this.$module.classList.remove(\"tna-breadcrumbs--collapsed\");\n $expandable.remove();\n this.$module.setAttribute(\"tabindex\", \"0\");\n this.$module.focus();\n this.$module.addEventListener(\n \"blur\",\n () => {\n this.$module.removeAttribute(\"tabindex\");\n },\n { once: true },\n );\n });\n $expandable.appendChild($expandButton);\n\n this.$breadcrumbsList.setAttribute(\"id\", uniqueId);\n this.$breadcrumbsList.insertBefore(\n $expandable,\n /* eslint-disable-next-line no-magic-numbers */\n this.$breadcrumbs[this.$breadcrumbs.length - 2].nextSibling,\n );\n\n this.$module.classList.add(\"tna-breadcrumbs--collapsed\");\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","replace","char","crypto","getRandomValues","Uint8Array","toString","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","Array","isArray","i","length","key","binding","descriptor","enumerable","value","get","o","Object","defineProperty","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","Breadcrumbs","constructor","$module","this","$breadcrumbsList","querySelector","$breadcrumbs","querySelectorAll","classList","contains","init","uniqueId","_lib_uuid_mjs__WEBPACK_IMPORTED_MODULE_0__","A","$expandable","document","createElement","add","style","display","$expandButton","innerHTML","setAttribute","addEventListener","remove","focus","removeAttribute","once","appendChild","insertBefore","nextSibling"],"sourceRoot":""}
@@ -35,7 +35,7 @@ export class Breadcrumbs {
35
35
  const $expandButton = document.createElement("button");
36
36
  $expandButton.classList.add("tna-breadcrumbs__link");
37
37
  $expandButton.innerHTML =
38
- "<span class='tna-!--visually-hidden'>Expand breadcrumbs</span>&hellip;";
38
+ "<span class='tna-visually-hidden'>Expand breadcrumbs</span>&hellip;";
39
39
  $expandButton.setAttribute("type", "button");
40
40
  $expandButton.setAttribute("aria-expanded", "false");
41
41
  $expandButton.setAttribute("aria-controls", uniqueId);
@@ -1 +1 @@
1
- .tna-button-group{margin-top:2rem}.tna-button-group:first-child{margin-top:0}.tna-button-group{display:flex;flex-wrap:wrap;align-items:center;gap:1rem}@media(max-width: 30em){.tna-button-group{flex-direction:column;align-items:stretch}}.tna-button-group--small{gap:0.5rem}.tna-button-group--centred{justify-content:center}.tna-button-group--full{justify-content:stretch}@media(max-width: 48em){.tna-button-group--full{flex-direction:column;align-items:stretch}}.tna-button-group--full .tna-button{margin:0;flex:1}.tna-button{padding:0.25rem 1rem;display:inline-flex;align-items:baseline;justify-content:center;gap:0.75rem;line-height:2rem;text-align:center;text-decoration:none;text-wrap:balance;cursor:pointer;-webkit-print-color-adjust:exact;print-color-adjust:exact;font-size:1.125rem;font-weight:700;background-color:var(--button-background, rgb(1, 1, 1));border:4px var(--button-background, rgb(1, 1, 1)) solid;border-radius:2px}.tna-button,.tna-button:link,.tna-button:visited{color:var(--button-text, rgb(255, 255, 255))}.tna-button:hover{color:var(--button-hover-text, rgb(1, 1, 1));text-decoration:none;background:rgba(0,0,0,0)}.tna-button .fa-solid{display:block}.tna-button svg{height:1.1em;align-self:center;flex-shrink:0;fill:currentColor}.tna-button--plain{font-weight:400;text-decoration:underline;background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0);border-radius:.1px}.tna-button--plain,.tna-button--plain:link,.tna-button--plain:hover{color:var(--link, #005fa3)}.tna-button--plain:visited{color:var(--link-visited, #634abb)}.tna-button--plain:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}.tna-button--plain.tna-button--no-visited-state:visited{color:var(--link, #005fa3)}.tna-button--accent{background-color:var(--button-accented-background, rgb(140, 150, 148));border-color:var(--button-accented-background, rgb(140, 150, 148))}.tna-button--accent,.tna-button--accent:link,.tna-button--accent:visited{color:var(--button-accented-text, rgb(1, 1, 1))}.tna-button--accent:hover{color:var(--font-dark, rgb(1, 1, 1))}.tna-button--icon-right{flex-direction:row-reverse}.tna-button--icon-right:has(.fa-solid){align-items:center}.tna-button--small,.tna-button-group--small .tna-button{padding:0 0.5rem;gap:0.375rem;line-height:1.5rem;font-size:0.875rem}.tna-button--icon-only{padding-right:0;padding-left:0;gap:0;font-size:0 !important;line-height:0 !important}.tna-button--icon-only .fa-solid{width:2.5rem;line-height:2rem;font-size:1.125rem}.tna-button--icon-only svg{height:1.5rem;margin:.5rem}.tna-button--small.tna-button--icon-only,.tna-button-group--small .tna-button--icon-only{padding-right:0;padding-left:0}.tna-button--small.tna-button--icon-only .fa-solid,.tna-button-group--small .tna-button--icon-only .fa-solid{width:1.5rem;line-height:1.5rem}.tna-button--small.tna-button--icon-only svg,.tna-button-group--small .tna-button--icon-only svg{height:1.2rem;margin:.5rem}@media(max-width: 48em){.tna-button--icon-only-mobile{padding-right:0;padding-left:0;gap:0;font-size:0 !important;line-height:0 !important}.tna-button--icon-only-mobile .fa-solid{width:2.5rem;line-height:2rem;font-size:1.125rem}.tna-button--icon-only-mobile svg{height:1.5rem;margin:.5rem}.tna-button--small.tna-button--icon-only-mobile,.tna-button-group--small .tna-button--icon-only-mobile{padding-right:0;padding-left:0}.tna-button--small.tna-button--icon-only-mobile .fa-solid,.tna-button-group--small .tna-button--icon-only-mobile .fa-solid{width:1.5rem;line-height:1.5rem}.tna-button--small.tna-button--icon-only-mobile svg,.tna-button-group--small .tna-button--icon-only-mobile svg{height:1.2rem;margin:.5rem}}.tna-button--solid-hover:not(.tna-button--plain):hover{color:var(--font-dark, rgb(1, 1, 1));background-color:var(--background, #f4f4f4)}.tna-background-accent .tna-button:hover,.tna-template--dark-theme .tna-background-accent-light .tna-button:hover{color:var(--font-dark, rgb(1, 1, 1))}.tna-background-accent .tna-button--accent,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent{background-color:var(--contrast-button-background, rgb(255, 255, 255));border-color:var(--contrast-button-background, rgb(255, 255, 255))}.tna-background-accent .tna-button--accent,.tna-background-accent .tna-button--accent:link,.tna-background-accent .tna-button--accent:visited,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent:link,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent:visited{color:var(--contrast-button-text, rgb(1, 1, 1))}.tna-background-accent .tna-button--accent:hover,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent:hover{color:var(--contrast-font-dark, rgb(255, 255, 255));background-color:var(--contrast-background, #1e1e1e)}@media(prefers-color-scheme: dark){.tna-template--system-theme .tna-background-accent-light .tna-button:hover{color:var(--font-dark, rgb(1, 1, 1))}.tna-template--system-theme .tna-background-accent-light .tna-button--accent{background-color:var(--contrast-button-background, rgb(255, 255, 255));border-color:var(--contrast-button-background, rgb(255, 255, 255))}.tna-template--system-theme .tna-background-accent-light .tna-button--accent,.tna-template--system-theme .tna-background-accent-light .tna-button--accent:link,.tna-template--system-theme .tna-background-accent-light .tna-button--accent:visited{color:var(--contrast-button-text, rgb(1, 1, 1))}.tna-template--system-theme .tna-background-accent-light .tna-button--accent:hover{color:var(--contrast-font-dark, rgb(255, 255, 255));background-color:var(--contrast-background, #1e1e1e)}}@media(forced-colors: active){.tna-button:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}}/*# sourceMappingURL=button.css.map */
1
+ .tna-button-group{margin-top:2rem}.tna-button-group:first-child,.tna-button-group:first-child.tna-visually-hidden+*{margin-top:0}.tna-button-group{display:flex;flex-wrap:wrap;align-items:center;gap:1rem}@media(max-width: 30em){.tna-button-group{flex-direction:column;align-items:stretch}}.tna-button-group--small{gap:0.5rem}.tna-button-group--centred{justify-content:center}.tna-button-group--full{justify-content:stretch}@media(max-width: 48em){.tna-button-group--full{flex-direction:column;align-items:stretch}}.tna-button-group--full .tna-button{margin:0;flex:1}.tna-button{padding:0.25rem 1rem;display:inline-flex;align-items:baseline;justify-content:center;gap:0.75rem;line-height:2rem;text-align:center;text-decoration:none;text-wrap:balance;cursor:pointer;-webkit-print-color-adjust:exact;print-color-adjust:exact;font-size:1.125rem;font-weight:700;background-color:var(--button-background, rgb(1, 1, 1));border:4px var(--button-background, rgb(1, 1, 1)) solid;border-radius:2px}.tna-button,.tna-button:link,.tna-button:visited{color:var(--button-text, rgb(255, 255, 255))}.tna-button:hover{color:var(--button-hover-text, rgb(1, 1, 1));text-decoration:none;background:rgba(0,0,0,0)}.tna-button .fa-solid{display:block}.tna-button svg{height:1.1em;align-self:center;flex-shrink:0;fill:currentColor}.tna-button--plain{font-weight:400;text-decoration:underline;background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0);border-radius:.1px}.tna-button--plain,.tna-button--plain:link,.tna-button--plain:hover{color:var(--link, #005fa3)}.tna-button--plain:visited{color:var(--link-visited, #634abb)}.tna-button--plain:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}.tna-button--plain.tna-button--no-visited-state:visited{color:var(--link, #005fa3)}.tna-button--accent{background-color:var(--button-accented-background, rgb(140, 150, 148));border-color:var(--button-accented-background, rgb(140, 150, 148))}.tna-button--accent,.tna-button--accent:link,.tna-button--accent:visited{color:var(--button-accented-text, rgb(1, 1, 1))}.tna-button--accent:hover{color:var(--font-dark, rgb(1, 1, 1))}.tna-button--icon-right{flex-direction:row-reverse}.tna-button--icon-right:has(.fa-solid){align-items:center}.tna-button--small,.tna-button-group--small .tna-button{padding:0 0.5rem;gap:0.375rem;line-height:1.5rem;font-size:0.875rem}.tna-button--icon-only{padding-right:0;padding-left:0;gap:0;font-size:0 !important;line-height:0 !important}.tna-button--icon-only .fa-solid{width:2.5rem;line-height:2rem;font-size:1.125rem}.tna-button--icon-only svg{height:1.5rem;margin:.5rem}.tna-button--small.tna-button--icon-only,.tna-button-group--small .tna-button--icon-only{padding-right:0;padding-left:0}.tna-button--small.tna-button--icon-only .fa-solid,.tna-button-group--small .tna-button--icon-only .fa-solid{width:1.5rem;line-height:1.5rem}.tna-button--small.tna-button--icon-only svg,.tna-button-group--small .tna-button--icon-only svg{height:1.2rem;margin:.5rem}@media(max-width: 48em){.tna-button--icon-only-mobile{padding-right:0;padding-left:0;gap:0;font-size:0 !important;line-height:0 !important}.tna-button--icon-only-mobile .fa-solid{width:2.5rem;line-height:2rem;font-size:1.125rem}.tna-button--icon-only-mobile svg{height:1.5rem;margin:.5rem}.tna-button--small.tna-button--icon-only-mobile,.tna-button-group--small .tna-button--icon-only-mobile{padding-right:0;padding-left:0}.tna-button--small.tna-button--icon-only-mobile .fa-solid,.tna-button-group--small .tna-button--icon-only-mobile .fa-solid{width:1.5rem;line-height:1.5rem}.tna-button--small.tna-button--icon-only-mobile svg,.tna-button-group--small .tna-button--icon-only-mobile svg{height:1.2rem;margin:.5rem}}.tna-button--solid-hover:not(.tna-button--plain):hover{color:var(--font-dark, rgb(1, 1, 1));background-color:var(--background, #f4f4f4)}.tna-background-accent .tna-button:hover,.tna-template--dark-theme .tna-background-accent-light .tna-button:hover{color:var(--font-dark, rgb(1, 1, 1))}.tna-background-accent .tna-button--accent,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent{background-color:var(--contrast-button-background, rgb(255, 255, 255));border-color:var(--contrast-button-background, rgb(255, 255, 255))}.tna-background-accent .tna-button--accent,.tna-background-accent .tna-button--accent:link,.tna-background-accent .tna-button--accent:visited,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent:link,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent:visited{color:var(--contrast-button-text, rgb(1, 1, 1))}.tna-background-accent .tna-button--accent:hover,.tna-template--dark-theme .tna-background-accent-light .tna-button--accent:hover{color:var(--contrast-font-dark, rgb(255, 255, 255));background-color:var(--contrast-background, #1e1e1e)}@media(prefers-color-scheme: dark){.tna-template--system-theme .tna-background-accent-light .tna-button:hover{color:var(--font-dark, rgb(1, 1, 1))}.tna-template--system-theme .tna-background-accent-light .tna-button--accent{background-color:var(--contrast-button-background, rgb(255, 255, 255));border-color:var(--contrast-button-background, rgb(255, 255, 255))}.tna-template--system-theme .tna-background-accent-light .tna-button--accent,.tna-template--system-theme .tna-background-accent-light .tna-button--accent:link,.tna-template--system-theme .tna-background-accent-light .tna-button--accent:visited{color:var(--contrast-button-text, rgb(1, 1, 1))}.tna-template--system-theme .tna-background-accent-light .tna-button--accent:hover{color:var(--contrast-font-dark, rgb(255, 255, 255));background-color:var(--contrast-background, #1e1e1e)}}@media(forced-colors: active){.tna-button:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}}/*# sourceMappingURL=button.css.map */