@nationalarchives/frontend 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/nationalarchives/all+analytics.js +1 -1
  2. package/nationalarchives/all+analytics.js.map +1 -1
  3. package/nationalarchives/all+analytics.mjs +0 -2
  4. package/nationalarchives/all.css +1 -1
  5. package/nationalarchives/all.css.map +1 -1
  6. package/nationalarchives/all.js +1 -1
  7. package/nationalarchives/all.js.map +1 -1
  8. package/nationalarchives/all.mjs +0 -2
  9. package/nationalarchives/analytics.js +1 -1
  10. package/nationalarchives/analytics.js.map +1 -1
  11. package/nationalarchives/analytics.mjs +4 -3
  12. package/nationalarchives/assets/fonts/fa-brands-400.woff2 +0 -0
  13. package/nationalarchives/assets/fonts/fa-solid-900.woff2 +0 -0
  14. package/nationalarchives/components/accordion/accordion.js +1 -1
  15. package/nationalarchives/components/accordion/accordion.js.map +1 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  17. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  18. package/nationalarchives/components/button/button.css +1 -1
  19. package/nationalarchives/components/button/button.css.map +1 -1
  20. package/nationalarchives/components/button/button.scss +3 -1
  21. package/nationalarchives/components/checkboxes/fixtures.json +25 -0
  22. package/nationalarchives/components/checkboxes/macro-options.json +9 -3
  23. package/nationalarchives/components/checkboxes/template.njk +1 -1
  24. package/nationalarchives/components/code-block/code-block.js +1 -1
  25. package/nationalarchives/components/code-block/code-block.js.map +1 -1
  26. package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
  27. package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
  28. package/nationalarchives/components/cookie-banner/cookie-banner.mjs +5 -5
  29. package/nationalarchives/components/date-input/date-input.js +1 -1
  30. package/nationalarchives/components/date-input/date-input.js.map +1 -1
  31. package/nationalarchives/components/date-input/date-input.mjs +0 -4
  32. package/nationalarchives/components/error-summary/error-summary.js +1 -1
  33. package/nationalarchives/components/error-summary/error-summary.js.map +1 -1
  34. package/nationalarchives/components/file-input/file-input.js +1 -1
  35. package/nationalarchives/components/file-input/file-input.js.map +1 -1
  36. package/nationalarchives/components/file-input/file-input.mjs +3 -13
  37. package/nationalarchives/components/files-list/macro-options.json +1 -1
  38. package/nationalarchives/components/footer/fixtures.json +2 -2
  39. package/nationalarchives/components/footer/footer.css +1 -1
  40. package/nationalarchives/components/footer/footer.css.map +1 -1
  41. package/nationalarchives/components/footer/footer.js +1 -1
  42. package/nationalarchives/components/footer/footer.js.map +1 -1
  43. package/nationalarchives/components/footer/footer.mjs +5 -5
  44. package/nationalarchives/components/footer/template.njk +2 -2
  45. package/nationalarchives/components/gallery/gallery.js +1 -1
  46. package/nationalarchives/components/gallery/gallery.js.map +1 -1
  47. package/nationalarchives/components/global-header/global-header.css +1 -1
  48. package/nationalarchives/components/global-header/global-header.css.map +1 -1
  49. package/nationalarchives/components/global-header/global-header.js +1 -1
  50. package/nationalarchives/components/global-header/global-header.js.map +1 -1
  51. package/nationalarchives/components/header/header.css +1 -1
  52. package/nationalarchives/components/header/header.css.map +1 -1
  53. package/nationalarchives/components/header/header.js +1 -1
  54. package/nationalarchives/components/header/header.js.map +1 -1
  55. package/nationalarchives/components/hero/hero.css +1 -1
  56. package/nationalarchives/components/hero/hero.css.map +1 -1
  57. package/nationalarchives/components/hero/hero.scss +1 -1
  58. package/nationalarchives/components/picture/picture.js +1 -1
  59. package/nationalarchives/components/picture/picture.js.map +1 -1
  60. package/nationalarchives/components/radios/fixtures.json +25 -0
  61. package/nationalarchives/components/radios/macro-options.json +7 -1
  62. package/nationalarchives/components/radios/template.njk +1 -1
  63. package/nationalarchives/components/sidebar/fixtures.json +14 -6
  64. package/nationalarchives/components/sidebar/macro-options.json +56 -0
  65. package/nationalarchives/components/sidebar/sidebar.js +1 -1
  66. package/nationalarchives/components/sidebar/sidebar.js.map +1 -1
  67. package/nationalarchives/components/sidebar/template.njk +3 -3
  68. package/nationalarchives/components/skip-link/skip-link.css +1 -1
  69. package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
  70. package/nationalarchives/components/skip-link/skip-link.js +1 -1
  71. package/nationalarchives/components/skip-link/skip-link.js.map +1 -1
  72. package/nationalarchives/components/tabs/tabs.js +1 -1
  73. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  74. package/nationalarchives/components/text-input/text-input.js +1 -1
  75. package/nationalarchives/components/text-input/text-input.js.map +1 -1
  76. package/nationalarchives/components/textarea/textarea.js +1 -1
  77. package/nationalarchives/components/textarea/textarea.js.map +1 -1
  78. package/nationalarchives/error-page.css +1 -1
  79. package/nationalarchives/error-page.css.map +1 -1
  80. package/nationalarchives/font-awesome.css +5 -5
  81. package/nationalarchives/font-awesome.css.map +1 -1
  82. package/nationalarchives/ie.css +1 -1
  83. package/nationalarchives/ie.css.map +1 -1
  84. package/nationalarchives/print.css +1 -1
  85. package/nationalarchives/print.css.map +1 -1
  86. package/nationalarchives/print.scss +17 -1
  87. package/nationalarchives/prototype-kit.css +1 -1
  88. package/nationalarchives/prototype-kit.css.map +1 -1
  89. package/nationalarchives/utilities/overrides/_index.scss +0 -6
  90. package/package.json +17 -19
  91. package/nationalarchives/lib/cookie-events.mjs +0 -70
  92. package/nationalarchives/lib/cookies.mjs +0 -398
@@ -1 +1 @@
1
- {"version":3,"file":"components/accordion/accordion.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,wECPM,MA+FMC,EAAuBC,IAClC,MAAMC,EAAWD,EAAcE,cAAc,WACU,SAAjDF,EAAcG,QAAQC,yBACtBH,IAAaA,EAASI,KACxBJ,EAASI,GAAK,kBAAiB,EAAAC,EAAAC,QAEjCP,EAAcG,QAAQC,uBAAyB,QAE7CJ,EAAcQ,YAAcR,EAAcS,aAC5CT,EAAcU,aAAa,WAAY,KACvCV,EAAcU,aAAa,OAAQ,UACnCV,EAAcU,aAAa,kBAAmBT,GAAUI,IAAM,IAC9DL,EAAcW,UAAUC,IAAI,+BAE5BZ,EAAca,gBAAgB,YAC9Bb,EAAca,gBAAgB,QAC9Bb,EAAca,gBAAgB,mBAC9Bb,EAAcW,UAAUG,OAAO,4DChHnC,MAQAC,EARe,KACZ,CAAC,MAAQ,KAAO,KAAO,KAAO,MAAMC,QAAQ,UAAYC,IAErDA,EACCC,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAM,IAAOH,EAAO,GAC/DI,SAAS,OCNfC,EAAA,GAGA,SAAAC,EAAAC,GAEA,IAAAC,EAAAH,EAAAE,GACA,QAAAE,IAAAD,EACA,OAAAA,EAAA/B,QAGA,IAAAC,EAAA2B,EAAAE,GAAA,CAGA9B,QAAA,IAOA,OAHAiC,EAAAH,GAAA7B,EAAAA,EAAAD,QAAA6B,GAGA5B,EAAAD,OACA,CCrBA6B,EAAAK,EAAA,CAAAlC,EAAAmC,KACA,QAAAC,KAAAD,EACAN,EAAAQ,EAAAF,EAAAC,KAAAP,EAAAQ,EAAArC,EAAAoC,IACAE,OAAAC,eAAAvC,EAAAoC,EAAA,CAAyCI,YAAA,EAAAC,IAAAN,EAAAC,MCJzCP,EAAAQ,EAAA,CAAAK,EAAAC,IAAAL,OAAAM,UAAAC,eAAAC,KAAAJ,EAAAC,GCCAd,EAAAkB,EAAA/C,IACA,oBAAAgD,QAAAA,OAAAC,aACAX,OAAAC,eAAAvC,EAAAgD,OAAAC,YAAA,CAAuDC,MAAA,WAEvDZ,OAAAC,eAAAvC,EAAA,cAAgDkD,OAAA,2DCHzC,MAAMC,EACX,WAAAC,CAAYC,GACVC,KAAKD,QAAUA,EACfC,KAAKC,OAASF,GAAWA,EAAQG,iBAAiB,wBAC7CF,KAAKD,SAAYC,KAAKC,SAI3BD,KAAKG,uBACqC,SAAxCH,KAAKD,QAAQ5C,QAAQiD,eAEvBJ,KAAKC,OAAOI,QAASC,GAAUN,KAAKO,SAASD,IAC7CN,KAAKQ,YAELR,KAAKS,iBAAmBT,KAAKD,QAAQ7C,cACnC,8BAEE8C,KAAKS,mBACPT,KAAKU,sBACLV,KAAKS,iBAAiB5C,gBAAgB,UACtCmC,KAAKS,iBAAiBE,iBAAiB,QAAS,KAC1CX,KAAKY,YACPZ,KAAKC,OAAOI,QAASC,GAAUN,KAAKa,UAAUP,IAE9CN,KAAKC,OAAOI,QAASC,GAAUN,KAAKc,SAASR,IAE/CN,KAAKU,yBAGX,CAEA,QAAAH,CAASD,GACP,MAAMS,EAAWT,EAAMpD,cAAc,2BAC/B8D,EAAWV,EAAMpD,cAAc,wBAErC,IAAK6D,IAAaC,EAChB,OAGFV,EAAM3C,UAAUC,IAAI,0BACpB0C,EAAM3C,UAAUG,OAAO,uBAEvBiD,EAASlD,gBAAgB,SAEzBmD,EAASrD,UAAUC,IAAI,0BACvBoD,EAASrD,UAAUG,OAAO,uBAC1BkD,EAAStD,aAAa,SAAU,IAEhC,MAAMuD,EAAiBC,SAASC,cAAc,UAC9CF,EAAetD,UAAUC,IAAI,0BAC7BqD,EAAevD,aAAa,OAAQ,UACpCuD,EAAevD,aAAa,gBAAiBsD,EAAS3D,IACtD4D,EAAeG,UAAYL,EAASK,UACpCL,EAASK,UAAY,GACrBL,EAASM,YAAYJ,GAErBA,EAAeN,iBAAiB,QAAS,KACyB,SAAjDM,EAAeK,aAAa,iBAEzCtB,KAAKa,UAAUP,GAEfN,KAAKc,SAASR,IAGpB,CAEA,SAAAE,GACER,KAAKC,OAAOI,QAASC,IACU,SAAzBA,EAAMnD,QAAQoE,OAChBvB,KAAKc,SAASR,GAEdN,KAAKa,UAAUP,GAEjBA,EAAMzC,gBAAgB,gBAE1B,CAEA,QAAAiD,CAASR,GACFN,KAAKG,wBACRH,KAAKwB,oBAAoBlB,GAE3B,MAAMW,EAAiBX,EAAMpD,cAAc,2BACrC8D,EAAWV,EAAMpD,cAAc,2BACrC+D,EAAevD,aAAa,gBAAiB,QAC7CuD,EAAevD,aACb,aACA,GAAGuD,EAAeG,UAAUK,6BAE9BT,EAASnD,gBAAgB,UAEzBmC,KAAKU,sBAEL,MAAM1D,EAAgBgE,EAASd,iBAAiB,sBAC5ClD,GACFA,EAAcqD,QAASqB,KACrB,EAAAC,EAAAC,IAAoBF,IAG1B,CAEA,SAAAb,CAAUP,GACR,MAAMW,EAAiBX,EAAMpD,cAAc,2BACrC8D,EAAWV,EAAMpD,cAAc,2BACrC+D,EAAevD,aAAa,gBAAiB,SAC7CuD,EAAevD,aACb,aACA,GAAGuD,EAAeG,UAAUK,6BAE9BT,EAAStD,aAAa,SAAU,IAEhCsC,KAAKU,qBACP,CAEA,mBAAAc,CAAoBK,GAClBC,MAAMC,KAAK/B,KAAKC,QACb+B,OACE1B,GACCA,EAAMpD,cAAc,6BAA+B2E,GAGd,SAFrCvB,EACGpD,cAAc,2BACdoE,aAAa,kBAEnBjB,QAASC,GAAUN,KAAKa,UAAUP,GACvC,CAEA,SAAAM,GACE,OAAOkB,MAAMC,KAAK/B,KAAKC,QAAQgC,MAC5B3B,GAGsC,SAFrCA,EACGpD,cAAc,2BACdoE,aAAa,iBAEtB,CAEA,mBAAAZ,GACMV,KAAKS,mBACHT,KAAKY,YACPZ,KAAKS,iBAAiBW,UACpBpB,KAAKS,iBAAiBtD,QAAQ+E,eAAiB,oBAEjDlC,KAAKS,iBAAiBW,UACpBpB,KAAKS,iBAAiBtD,QAAQgF,cAAgB,oBAGtD","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/helpers.mjs","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/accordion/accordion.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 ","import uuidv4 from \"./uuid.mjs\";\n\nexport const iso8601ToPrettyDatetime = (dateStr) => {\n const datetime = dateStr;\n\n if (!datetime) {\n throw new Error(\"No datetime provided\");\n }\n const isDateTime =\n /^\\d{4}(?:-\\d{2}){2}(?:T| )\\d{2}(?::\\d{2}){1,2}(?:\\.\\d+)?(?:Z|(?:[+-]\\d{2}:\\d{2}))?$/u.test(\n datetime,\n );\n const isDate = /^\\d{4}(?:-\\d{2}){2}$/u.test(datetime);\n if (!isDateTime && !isDate) {\n throw new Error(\"Invalid datetime provided\");\n }\n\n const date = new Date(datetime);\n if (!(date instanceof Date) || isNaN(date)) {\n throw new Error(\"Invalid datetime provided\");\n }\n\n const dayString = date.toLocaleDateString(\"en-GB\", {\n weekday: \"long\",\n });\n const dateString = date.toLocaleDateString(\"en-GB\", {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n });\n\n if (isDateTime && (date.getHours() || date.getMinutes())) {\n let timeString = date.toLocaleTimeString(\"en-GB\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n if (date.getSeconds()) {\n timeString = date.toLocaleTimeString(\"en-GB\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n });\n }\n return `${dayString} ${dateString}, ${timeString}`;\n }\n return `${dayString} ${dateString}`;\n};\n\n/*\n * ==========================================\n * Transform any <time> element into a pretty\n * and human readable format that is based on\n * the valid ISO 8601 datetime attribute. The\n * replaced value will be localised according\n * to user's system settings, repurposing the\n * original text content as a title attribute\n * to allow users to see the value. A null or\n * invalid datetime format will result in the\n * element not being modified. If the updated\n * value is similar to the starting value for\n * the element text content, then the element\n * will not be updated to avoid redundancy.\n * ------------------------------------------\n * For example if the user's system has a UTC\n * timezone set then the element:\n *\n * <time\n * datetime=\"2026-03-05T13:48:00-05:00\"\n * >\n * 5 March 2026, 13:48 (UTC -5)\n * </time>\n *\n * would become:\n *\n * <time\n * datetime=\"2026-03-05T13:48:00-05:00\"\n * title=\"5 March 2026, 13:48 (UTC -5)\"\n * >\n * Thursday 5 March 2026, 09:48\n * </time>\n * ==========================================\n */\nexport const updateTimeElement = ($el) => {\n const datetime = $el.getAttribute(\"datetime\");\n\n try {\n const prettyDatetime = iso8601ToPrettyDatetime(datetime);\n if (!prettyDatetime.includes($el.textContent)) {\n $el.setAttribute(\"title\", $el.textContent);\n $el.textContent = prettyDatetime;\n }\n // eslint-disable-next-line no-unused-vars\n } catch (error) {\n // Do nothing if the datetime is invalid or not provided\n }\n};\n\nexport const checkTableForScroll = ($tableWrapper) => {\n const $caption = $tableWrapper.querySelector(\"caption\");\n if (!($tableWrapper.dataset.tableScrollInitialised === \"true\")) {\n if ($caption && !$caption.id) {\n $caption.id = `table-caption-${uuidv4()}`;\n }\n $tableWrapper.dataset.tableScrollInitialised = \"true\";\n }\n if ($tableWrapper.scrollWidth > $tableWrapper.clientWidth) {\n $tableWrapper.setAttribute(\"tabindex\", \"0\");\n $tableWrapper.setAttribute(\"role\", \"region\");\n $tableWrapper.setAttribute(\"aria-labelledby\", $caption?.id || \"\");\n $tableWrapper.classList.add(\"tna-table-wrapper--scroll\");\n } else {\n $tableWrapper.removeAttribute(\"tabindex\");\n $tableWrapper.removeAttribute(\"role\");\n $tableWrapper.removeAttribute(\"aria-labelledby\");\n $tableWrapper.classList.remove(\"tna-table-wrapper--scroll\");\n }\n};\n","/* 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\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar 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\tvar 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 functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { checkTableForScroll } from \"../../lib/helpers.mjs\";\n\nexport class Accordion {\n constructor($module) {\n this.$module = $module;\n this.$items = $module && $module.querySelectorAll(\".tna-accordion__item\");\n if (!this.$module || !this.$items) {\n return;\n }\n\n this.allowMultipleItemsOpen =\n this.$module.dataset.singleOpenItem !== \"true\";\n\n this.$items.forEach(($item) => this.initItem($item));\n this.initState();\n\n this.$toggleAllButton = this.$module.querySelector(\n \".tna-accordion__toggle-all\",\n );\n if (this.$toggleAllButton) {\n this.syncToggleAllButton();\n this.$toggleAllButton.removeAttribute(\"hidden\");\n this.$toggleAllButton.addEventListener(\"click\", () => {\n if (this.isAllOpen()) {\n this.$items.forEach(($item) => this.closeItem($item));\n } else {\n this.$items.forEach(($item) => this.openItem($item));\n }\n this.syncToggleAllButton();\n });\n }\n }\n\n initItem($item) {\n const $heading = $item.querySelector(\".tna-accordion__heading\");\n const $content = $item.querySelector(\".tna-accordion__body\");\n\n if (!$heading || !$content) {\n return;\n }\n\n $item.classList.add(\"tna-accordion__details\");\n $item.classList.remove(\"tna-accordion__item\");\n\n $heading.removeAttribute(\"class\");\n\n $content.classList.add(\"tna-accordion__content\");\n $content.classList.remove(\"tna-accordion__body\");\n $content.setAttribute(\"hidden\", \"\");\n\n const $headingButton = document.createElement(\"button\");\n $headingButton.classList.add(\"tna-accordion__summary\");\n $headingButton.setAttribute(\"type\", \"button\");\n $headingButton.setAttribute(\"aria-controls\", $content.id);\n $headingButton.innerText = $heading.innerText;\n $heading.innerText = \"\";\n $heading.appendChild($headingButton);\n\n $headingButton.addEventListener(\"click\", () => {\n const isOpen = $headingButton.getAttribute(\"aria-expanded\") === \"true\";\n if (isOpen) {\n this.closeItem($item);\n } else {\n this.openItem($item);\n }\n });\n }\n\n initState() {\n this.$items.forEach(($item) => {\n if ($item.dataset.isopen === \"true\") {\n this.openItem($item);\n } else {\n this.closeItem($item);\n }\n $item.removeAttribute(\"data-isopen\");\n });\n }\n\n openItem($item) {\n if (!this.allowMultipleItemsOpen) {\n this.closeAllItemsExcept($item);\n }\n const $headingButton = $item.querySelector(\".tna-accordion__summary\");\n const $content = $item.querySelector(\".tna-accordion__content\");\n $headingButton.setAttribute(\"aria-expanded\", \"true\");\n $headingButton.setAttribute(\n \"aria-label\",\n `${$headingButton.innerText.trim()}, Hide this section`,\n );\n $content.removeAttribute(\"hidden\");\n // $content.setAttribute(\"tabindex\", \"0\");\n this.syncToggleAllButton();\n\n const $tableWrapper = $content.querySelectorAll(\".tna-table-wrapper\");\n if ($tableWrapper) {\n $tableWrapper.forEach(($wrapper) => {\n checkTableForScroll($wrapper);\n });\n }\n }\n\n closeItem($item) {\n const $headingButton = $item.querySelector(\".tna-accordion__summary\");\n const $content = $item.querySelector(\".tna-accordion__content\");\n $headingButton.setAttribute(\"aria-expanded\", \"false\");\n $headingButton.setAttribute(\n \"aria-label\",\n `${$headingButton.innerText.trim()}, Show this section`,\n );\n $content.setAttribute(\"hidden\", \"\");\n // $content.setAttribute(\"tabindex\", \"-1\");\n this.syncToggleAllButton();\n }\n\n closeAllItemsExcept($excludeItem) {\n Array.from(this.$items)\n .filter(\n ($item) =>\n $item.querySelector(\".tna-accordion__summary\") !== $excludeItem &&\n $item\n .querySelector(\".tna-accordion__summary\")\n .getAttribute(\"aria-expanded\") === \"true\",\n )\n .forEach(($item) => this.closeItem($item));\n }\n\n isAllOpen() {\n return Array.from(this.$items).every(\n ($item) =>\n $item\n .querySelector(\".tna-accordion__summary\")\n .getAttribute(\"aria-expanded\") === \"true\",\n );\n }\n\n syncToggleAllButton() {\n if (this.$toggleAllButton) {\n if (this.isAllOpen()) {\n this.$toggleAllButton.innerText =\n this.$toggleAllButton.dataset.closeAllLabel || \"Hide all sections\";\n } else {\n this.$toggleAllButton.innerText =\n this.$toggleAllButton.dataset.openAllLabel || \"Show all sections\";\n }\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","checkTableForScroll","$tableWrapper","$caption","querySelector","dataset","tableScrollInitialised","id","_uuid_mjs__WEBPACK_IMPORTED_MODULE_0__","A","scrollWidth","clientWidth","setAttribute","classList","add","removeAttribute","remove","__WEBPACK_DEFAULT_EXPORT__","replace","char","crypto","getRandomValues","Uint8Array","toString","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Accordion","constructor","$module","this","$items","querySelectorAll","allowMultipleItemsOpen","singleOpenItem","forEach","$item","initItem","initState","$toggleAllButton","syncToggleAllButton","addEventListener","isAllOpen","closeItem","openItem","$heading","$content","$headingButton","document","createElement","innerText","appendChild","getAttribute","isopen","closeAllItemsExcept","trim","$wrapper","_lib_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__","DJ","$excludeItem","Array","from","filter","every","closeAllLabel","openAllLabel"],"sourceRoot":""}
1
+ {"version":3,"file":"components/accordion/accordion.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,oECwFmCC,IAClC,MAAMC,EAAWD,EAAcE,cAAc,WACU,SAAjDF,EAAcG,QAAQC,yBACtBH,IAAaA,EAASI,KACxBJ,EAASI,GAAK,kBAAiB,EAAAC,EAAAC,QAEjCP,EAAcG,QAAQC,uBAAyB,QAE7CJ,EAAcQ,YAAcR,EAAcS,aAC5CT,EAAcU,aAAa,WAAY,KACvCV,EAAcU,aAAa,OAAQ,UACnCV,EAAcU,aAAa,kBAAmBT,GAAUI,IAAM,IAC9DL,EAAcW,UAAUC,IAAI,+BAE5BZ,EAAca,gBAAgB,YAC9Bb,EAAca,gBAAgB,QAC9Bb,EAAca,gBAAgB,mBAC9Bb,EAAcW,UAAUG,OAAO,0DChHpB,KACZ,CAAC,MAAQ,KAAO,KAAO,KAAO,MAAMC,QAAQ,UAAYC,IAErDA,EACCC,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAM,IAAOH,EAAO,GAC/DI,SAAS,SCNf,MAAAC,EAAA,GAGA,SAAAC,EAAAC,GAEA,MAAAC,EAAAH,EAAAE,GACA,QAAAE,IAAAD,EACA,OAAAA,EAAA7B,QAGA,MAAAC,EAAAyB,EAAAE,GAAA,CAGA5B,QAAA,IAOA,OAHA+B,EAAAH,GAAA3B,EAAAA,EAAAD,QAAA2B,GAGA1B,EAAAD,OACA,CCrBA2B,EAAAK,EAAA,CAAAhC,EAAAiC,KACA,GAAAC,MAAAC,QAAAF,GAEA,IADA,IAAAG,EAAA,EACAA,EAAAH,EAAAI,QAAA,CACA,IAAAC,EAAAL,EAAAG,KACAG,EAAAN,EAAAG,KACAT,EAAAa,EAAAxC,EAAAsC,GAMK,IAAAC,GAAyBH,IAL9B,IAAAG,EACAE,OAAAC,eAAA1C,EAAAsC,EAAA,CAA2CK,YAAA,EAAAC,MAAAX,EAAAG,OAE3CK,OAAAC,eAAA1C,EAAAsC,EAAA,CAA2CK,YAAA,EAAAE,IAAAN,GAG3C,MAEA,QAAAD,KAAAL,EACAN,EAAAa,EAAAP,EAAAK,KAAAX,EAAAa,EAAAxC,EAAAsC,IACAG,OAAAC,eAAA1C,EAAAsC,EAAA,CAA0CK,YAAA,EAAAE,IAAAZ,EAAAK,MClB1CX,EAAAa,EAAA,CAAAM,EAAAC,IAAAN,OAAAO,UAAAC,eAAAC,KAAAJ,EAAAC,GCCApB,EAAAwB,EAAAnD,IACAoD,OAAAC,aACAZ,OAAAC,eAAA1C,EAAAoD,OAAAC,YAAA,CAAuDT,MAAA,WAEvDH,OAAAC,eAAA1C,EAAA,cAAgD4C,OAAA,2DCHzC,MAAMU,EACX,WAAAC,CAAYC,GACVC,KAAKD,QAAUA,EACfC,KAAKC,OAASF,GAAWA,EAAQG,iBAAiB,wBAC7CF,KAAKD,SAAYC,KAAKC,SAI3BD,KAAKG,uBACqC,SAAxCH,KAAKD,QAAQhD,QAAQqD,eAEvBJ,KAAKC,OAAOI,QAASC,GAAUN,KAAKO,SAASD,IAC7CN,KAAKQ,YAELR,KAAKS,iBAAmBT,KAAKD,QAAQjD,cACnC,8BAEEkD,KAAKS,mBACPT,KAAKU,sBACLV,KAAKS,iBAAiBhD,gBAAgB,UACtCuC,KAAKS,iBAAiBE,iBAAiB,QAAS,KAC1CX,KAAKY,YACPZ,KAAKC,OAAOI,QAASC,GAAUN,KAAKa,UAAUP,IAE9CN,KAAKC,OAAOI,QAASC,GAAUN,KAAKc,SAASR,IAE/CN,KAAKU,yBAGX,CAEA,QAAAH,CAASD,GACP,MAAMS,EAAWT,EAAMxD,cAAc,2BAC/BkE,EAAWV,EAAMxD,cAAc,wBAErC,IAAKiE,IAAaC,EAChB,OAGFV,EAAM/C,UAAUC,IAAI,0BACpB8C,EAAM/C,UAAUG,OAAO,uBAEvBqD,EAAStD,gBAAgB,SAEzBuD,EAASzD,UAAUC,IAAI,0BACvBwD,EAASzD,UAAUG,OAAO,uBAC1BsD,EAAS1D,aAAa,SAAU,IAEhC,MAAM2D,EAAiBC,SAASC,cAAc,UAC9CF,EAAe1D,UAAUC,IAAI,0BAC7ByD,EAAe3D,aAAa,OAAQ,UACpC2D,EAAe3D,aAAa,gBAAiB0D,EAAS/D,IACtDgE,EAAeG,UAAYL,EAASK,UACpCL,EAASK,UAAY,GACrBL,EAASM,YAAYJ,GAErBA,EAAeN,iBAAiB,QAAS,KACyB,SAAjDM,EAAeK,aAAa,iBAEzCtB,KAAKa,UAAUP,GAEfN,KAAKc,SAASR,IAGpB,CAEA,SAAAE,GACER,KAAKC,OAAOI,QAASC,IACU,SAAzBA,EAAMvD,QAAQwE,OAChBvB,KAAKc,SAASR,GAEdN,KAAKa,UAAUP,GAEjBA,EAAM7C,gBAAgB,gBAE1B,CAEA,QAAAqD,CAASR,GACFN,KAAKG,wBACRH,KAAKwB,oBAAoBlB,GAE3B,MAAMW,EAAiBX,EAAMxD,cAAc,2BACrCkE,EAAWV,EAAMxD,cAAc,2BACrCmE,EAAe3D,aAAa,gBAAiB,QAC7C2D,EAAe3D,aACb,aACA,GAAG2D,EAAeG,UAAUK,6BAE9BT,EAASvD,gBAAgB,UAEzBuC,KAAKU,sBAEL,MAAM9D,EAAgBoE,EAASd,iBAAiB,sBAC5CtD,GACFA,EAAcyD,QAASqB,KACrB,EAAAC,EAAAC,IAAoBF,IAG1B,CAEA,SAAAb,CAAUP,GACR,MAAMW,EAAiBX,EAAMxD,cAAc,2BACrCkE,EAAWV,EAAMxD,cAAc,2BACrCmE,EAAe3D,aAAa,gBAAiB,SAC7C2D,EAAe3D,aACb,aACA,GAAG2D,EAAeG,UAAUK,6BAE9BT,EAAS1D,aAAa,SAAU,IAEhC0C,KAAKU,qBACP,CAEA,mBAAAc,CAAoBK,GAClBpD,MAAMqD,KAAK9B,KAAKC,QACb8B,OACEzB,GACCA,EAAMxD,cAAc,6BAA+B+E,GAGd,SAFrCvB,EACGxD,cAAc,2BACdwE,aAAa,kBAEnBjB,QAASC,GAAUN,KAAKa,UAAUP,GACvC,CAEA,SAAAM,GACE,OAAOnC,MAAMqD,KAAK9B,KAAKC,QAAQ+B,MAC5B1B,GAGsC,SAFrCA,EACGxD,cAAc,2BACdwE,aAAa,iBAEtB,CAEA,mBAAAZ,GACMV,KAAKS,mBACHT,KAAKY,YACPZ,KAAKS,iBAAiBW,UACpBpB,KAAKS,iBAAiB1D,QAAQkF,eAAiB,oBAEjDjC,KAAKS,iBAAiBW,UACpBpB,KAAKS,iBAAiB1D,QAAQmF,cAAgB,oBAGtD","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/helpers.mjs","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/accordion/accordion.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 ","import uuidv4 from \"./uuid.mjs\";\n\nexport const iso8601ToPrettyDatetime = (dateStr) => {\n const datetime = dateStr;\n\n if (!datetime) {\n throw new Error(\"No datetime provided\");\n }\n const isDateTime =\n /^\\d{4}(?:-\\d{2}){2}(?:T| )\\d{2}(?::\\d{2}){1,2}(?:\\.\\d+)?(?:Z|(?:[+-]\\d{2}:\\d{2}))?$/u.test(\n datetime,\n );\n const isDate = /^\\d{4}(?:-\\d{2}){2}$/u.test(datetime);\n if (!isDateTime && !isDate) {\n throw new Error(\"Invalid datetime provided\");\n }\n\n const date = new Date(datetime);\n if (!(date instanceof Date) || isNaN(date)) {\n throw new Error(\"Invalid datetime provided\");\n }\n\n const dayString = date.toLocaleDateString(\"en-GB\", {\n weekday: \"long\",\n });\n const dateString = date.toLocaleDateString(\"en-GB\", {\n day: \"numeric\",\n month: \"long\",\n year: \"numeric\",\n });\n\n if (isDateTime && (date.getHours() || date.getMinutes())) {\n let timeString = date.toLocaleTimeString(\"en-GB\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n if (date.getSeconds()) {\n timeString = date.toLocaleTimeString(\"en-GB\", {\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n });\n }\n return `${dayString} ${dateString}, ${timeString}`;\n }\n return `${dayString} ${dateString}`;\n};\n\n/*\n * ==========================================\n * Transform any <time> element into a pretty\n * and human readable format that is based on\n * the valid ISO 8601 datetime attribute. The\n * replaced value will be localised according\n * to user's system settings, repurposing the\n * original text content as a title attribute\n * to allow users to see the value. A null or\n * invalid datetime format will result in the\n * element not being modified. If the updated\n * value is similar to the starting value for\n * the element text content, then the element\n * will not be updated to avoid redundancy.\n * ------------------------------------------\n * For example if the user's system has a UTC\n * timezone set then the element:\n *\n * <time\n * datetime=\"2026-03-05T13:48:00-05:00\"\n * >\n * 5 March 2026, 13:48 (UTC -5)\n * </time>\n *\n * would become:\n *\n * <time\n * datetime=\"2026-03-05T13:48:00-05:00\"\n * title=\"5 March 2026, 13:48 (UTC -5)\"\n * >\n * Thursday 5 March 2026, 09:48\n * </time>\n * ==========================================\n */\nexport const updateTimeElement = ($el) => {\n const datetime = $el.getAttribute(\"datetime\");\n\n try {\n const prettyDatetime = iso8601ToPrettyDatetime(datetime);\n if (!prettyDatetime.includes($el.textContent)) {\n $el.setAttribute(\"title\", $el.textContent);\n $el.textContent = prettyDatetime;\n }\n // eslint-disable-next-line no-unused-vars\n } catch (error) {\n // Do nothing if the datetime is invalid or not provided\n }\n};\n\nexport const checkTableForScroll = ($tableWrapper) => {\n const $caption = $tableWrapper.querySelector(\"caption\");\n if (!($tableWrapper.dataset.tableScrollInitialised === \"true\")) {\n if ($caption && !$caption.id) {\n $caption.id = `table-caption-${uuidv4()}`;\n }\n $tableWrapper.dataset.tableScrollInitialised = \"true\";\n }\n if ($tableWrapper.scrollWidth > $tableWrapper.clientWidth) {\n $tableWrapper.setAttribute(\"tabindex\", \"0\");\n $tableWrapper.setAttribute(\"role\", \"region\");\n $tableWrapper.setAttribute(\"aria-labelledby\", $caption?.id || \"\");\n $tableWrapper.classList.add(\"tna-table-wrapper--scroll\");\n } else {\n $tableWrapper.removeAttribute(\"tabindex\");\n $tableWrapper.removeAttribute(\"role\");\n $tableWrapper.removeAttribute(\"aria-labelledby\");\n $tableWrapper.classList.remove(\"tna-table-wrapper--scroll\");\n }\n};\n","/* 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\tif(!__webpack_require__.o(exports, key)) {\n\t\t\t\tif(binding === 0) {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, value: definition[i++] });\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: binding });\n\t\t\t\t}\n\t\t\t} else if(binding === 0) { i++; }\n\t\t}\n\t} else {\n\t\tfor(var key in definition) {\n\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t\t}\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { checkTableForScroll } from \"../../lib/helpers.mjs\";\n\nexport class Accordion {\n constructor($module) {\n this.$module = $module;\n this.$items = $module && $module.querySelectorAll(\".tna-accordion__item\");\n if (!this.$module || !this.$items) {\n return;\n }\n\n this.allowMultipleItemsOpen =\n this.$module.dataset.singleOpenItem !== \"true\";\n\n this.$items.forEach(($item) => this.initItem($item));\n this.initState();\n\n this.$toggleAllButton = this.$module.querySelector(\n \".tna-accordion__toggle-all\",\n );\n if (this.$toggleAllButton) {\n this.syncToggleAllButton();\n this.$toggleAllButton.removeAttribute(\"hidden\");\n this.$toggleAllButton.addEventListener(\"click\", () => {\n if (this.isAllOpen()) {\n this.$items.forEach(($item) => this.closeItem($item));\n } else {\n this.$items.forEach(($item) => this.openItem($item));\n }\n this.syncToggleAllButton();\n });\n }\n }\n\n initItem($item) {\n const $heading = $item.querySelector(\".tna-accordion__heading\");\n const $content = $item.querySelector(\".tna-accordion__body\");\n\n if (!$heading || !$content) {\n return;\n }\n\n $item.classList.add(\"tna-accordion__details\");\n $item.classList.remove(\"tna-accordion__item\");\n\n $heading.removeAttribute(\"class\");\n\n $content.classList.add(\"tna-accordion__content\");\n $content.classList.remove(\"tna-accordion__body\");\n $content.setAttribute(\"hidden\", \"\");\n\n const $headingButton = document.createElement(\"button\");\n $headingButton.classList.add(\"tna-accordion__summary\");\n $headingButton.setAttribute(\"type\", \"button\");\n $headingButton.setAttribute(\"aria-controls\", $content.id);\n $headingButton.innerText = $heading.innerText;\n $heading.innerText = \"\";\n $heading.appendChild($headingButton);\n\n $headingButton.addEventListener(\"click\", () => {\n const isOpen = $headingButton.getAttribute(\"aria-expanded\") === \"true\";\n if (isOpen) {\n this.closeItem($item);\n } else {\n this.openItem($item);\n }\n });\n }\n\n initState() {\n this.$items.forEach(($item) => {\n if ($item.dataset.isopen === \"true\") {\n this.openItem($item);\n } else {\n this.closeItem($item);\n }\n $item.removeAttribute(\"data-isopen\");\n });\n }\n\n openItem($item) {\n if (!this.allowMultipleItemsOpen) {\n this.closeAllItemsExcept($item);\n }\n const $headingButton = $item.querySelector(\".tna-accordion__summary\");\n const $content = $item.querySelector(\".tna-accordion__content\");\n $headingButton.setAttribute(\"aria-expanded\", \"true\");\n $headingButton.setAttribute(\n \"aria-label\",\n `${$headingButton.innerText.trim()}, Hide this section`,\n );\n $content.removeAttribute(\"hidden\");\n // $content.setAttribute(\"tabindex\", \"0\");\n this.syncToggleAllButton();\n\n const $tableWrapper = $content.querySelectorAll(\".tna-table-wrapper\");\n if ($tableWrapper) {\n $tableWrapper.forEach(($wrapper) => {\n checkTableForScroll($wrapper);\n });\n }\n }\n\n closeItem($item) {\n const $headingButton = $item.querySelector(\".tna-accordion__summary\");\n const $content = $item.querySelector(\".tna-accordion__content\");\n $headingButton.setAttribute(\"aria-expanded\", \"false\");\n $headingButton.setAttribute(\n \"aria-label\",\n `${$headingButton.innerText.trim()}, Show this section`,\n );\n $content.setAttribute(\"hidden\", \"\");\n // $content.setAttribute(\"tabindex\", \"-1\");\n this.syncToggleAllButton();\n }\n\n closeAllItemsExcept($excludeItem) {\n Array.from(this.$items)\n .filter(\n ($item) =>\n $item.querySelector(\".tna-accordion__summary\") !== $excludeItem &&\n $item\n .querySelector(\".tna-accordion__summary\")\n .getAttribute(\"aria-expanded\") === \"true\",\n )\n .forEach(($item) => this.closeItem($item));\n }\n\n isAllOpen() {\n return Array.from(this.$items).every(\n ($item) =>\n $item\n .querySelector(\".tna-accordion__summary\")\n .getAttribute(\"aria-expanded\") === \"true\",\n );\n }\n\n syncToggleAllButton() {\n if (this.$toggleAllButton) {\n if (this.isAllOpen()) {\n this.$toggleAllButton.innerText =\n this.$toggleAllButton.dataset.closeAllLabel || \"Hide all sections\";\n } else {\n this.$toggleAllButton.innerText =\n this.$toggleAllButton.dataset.openAllLabel || \"Show all sections\";\n }\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","$tableWrapper","$caption","querySelector","dataset","tableScrollInitialised","id","_uuid_mjs__WEBPACK_IMPORTED_MODULE_0__","A","scrollWidth","clientWidth","setAttribute","classList","add","removeAttribute","remove","replace","char","crypto","getRandomValues","Uint8Array","toString","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","Array","isArray","i","length","key","binding","o","Object","defineProperty","enumerable","value","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","Accordion","constructor","$module","this","$items","querySelectorAll","allowMultipleItemsOpen","singleOpenItem","forEach","$item","initItem","initState","$toggleAllButton","syncToggleAllButton","addEventListener","isAllOpen","closeItem","openItem","$heading","$content","$headingButton","document","createElement","innerText","appendChild","getAttribute","isopen","closeAllItemsExcept","trim","$wrapper","_lib_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__","DJ","$excludeItem","from","filter","every","closeAllLabel","openAllLabel"],"sourceRoot":""}
@@ -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:()=>s});const s=()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/gu,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}},t={};function r(s){var a=t[s];if(void 0!==a)return a.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};r.r(s),r.d(s,{Breadcrumbs:()=>i});var a=r(181);class i{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++];r.o(e,a)?0===n&&s++:0===n?Object.defineProperty(e,a,{enumerable:!0,value:t[s++]}):Object.defineProperty(e,a,{enumerable:!0,get:n})}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=>{Symbol.toStringTag&&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,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,iBAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,GACC,CATD,CASCK,KAAA,0DCPD,MAQAC,EARe,KACZ,CAAC,MAAQ,KAAO,KAAO,KAAO,MAAMC,QAAQ,UAAYC,IAErDA,EACCC,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAM,IAAOH,EAAO,GAC/DI,SAAS,OCNfC,EAAA,GAGA,SAAAC,EAAAC,GAEA,IAAAC,EAAAH,EAAAE,GACA,QAAAE,IAAAD,EACA,OAAAA,EAAAf,QAGA,IAAAC,EAAAW,EAAAE,GAAA,CAGAd,QAAA,IAOA,OAHAiB,EAAAH,GAAAb,EAAAA,EAAAD,QAAAa,GAGAZ,EAAAD,OACA,CCrBAa,EAAAK,EAAA,CAAAlB,EAAAmB,KACA,QAAAC,KAAAD,EACAN,EAAAQ,EAAAF,EAAAC,KAAAP,EAAAQ,EAAArB,EAAAoB,IACAE,OAAAC,eAAAvB,EAAAoB,EAAA,CAAyCI,YAAA,EAAAC,IAAAN,EAAAC,MCJzCP,EAAAQ,EAAA,CAAAK,EAAAC,IAAAL,OAAAM,UAAAC,eAAAC,KAAAJ,EAAAC,GCCAd,EAAAkB,EAAA/B,IACA,oBAAAgC,QAAAA,OAAAC,aACAX,OAAAC,eAAAvB,EAAAgC,OAAAC,YAAA,CAAuDC,MAAA,WAEvDZ,OAAAC,eAAAvB,EAAA,cAAgDkC,OAAA,6DCHzC,MAAMC,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,aAAaE,OAAS,IAC1BL,KAAKD,QAAQO,UAAUC,SAAS,iCAEjCP,KAAKQ,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,KACtCrB,KAAKD,QAAQO,UAAUgB,OAAO,8BAC9BV,EAAYU,SACZtB,KAAKD,QAAQqB,aAAa,WAAY,KACtCpB,KAAKD,QAAQwB,QACbvB,KAAKD,QAAQsB,iBACX,OACA,KACErB,KAAKD,QAAQyB,gBAAgB,aAE/B,CAAEC,MAAM,MAGZb,EAAYc,YAAYR,GAExBlB,KAAKC,iBAAiBmB,aAAa,KAAMX,GACzCT,KAAKC,iBAAiB0B,aACpBf,EAEAZ,KAAKG,aAAaH,KAAKG,aAAaE,OAAS,GAAGuB,aAGlD5B,KAAKD,QAAQO,UAAUS,IAAI,6BAC7B","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\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar 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\tvar 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 functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import uuidv4 from \"../../lib/uuid.mjs\";\n\nexport class 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","__WEBPACK_DEFAULT_EXPORT__","replace","char","crypto","getRandomValues","Uint8Array","toString","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Breadcrumbs","constructor","$module","this","$breadcrumbsList","querySelector","$breadcrumbs","querySelectorAll","length","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,sDCPc,KACZ,CAAC,MAAQ,KAAO,KAAO,KAAO,MAAMC,QAAQ,UAAYC,IAErDA,EACCC,OAAOC,gBAAgB,IAAIC,WAAW,IAAI,GAAM,IAAOH,EAAO,GAC/DI,SAAS,SCNf,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,CAAAjB,EAAAkB,KACA,GAAAC,MAAAC,QAAAF,GAEA,IADA,IAAAG,EAAA,EACAA,EAAAH,EAAAI,QAAA,CACA,IAAAC,EAAAL,EAAAG,KACAG,EAAAN,EAAAG,KACAT,EAAAa,EAAAzB,EAAAuB,GAMK,IAAAC,GAAyBH,IAL9B,IAAAG,EACAE,OAAAC,eAAA3B,EAAAuB,EAAA,CAA2CK,YAAA,EAAAC,MAAAX,EAAAG,OAE3CK,OAAAC,eAAA3B,EAAAuB,EAAA,CAA2CK,YAAA,EAAAE,IAAAN,GAG3C,MAEA,QAAAD,KAAAL,EACAN,EAAAa,EAAAP,EAAAK,KAAAX,EAAAa,EAAAzB,EAAAuB,IACAG,OAAAC,eAAA3B,EAAAuB,EAAA,CAA0CK,YAAA,EAAAE,IAAAZ,EAAAK,MClB1CX,EAAAa,EAAA,CAAAM,EAAAC,IAAAN,OAAAO,UAAAC,eAAAC,KAAAJ,EAAAC,GCCApB,EAAAwB,EAAApC,IACAqC,OAAAC,aACAZ,OAAAC,eAAA3B,EAAAqC,OAAAC,YAAA,CAAuDT,MAAA,WAEvDH,OAAAC,eAAA3B,EAAA,cAAgD6B,OAAA,6DCHzC,MAAMU,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,aAAavB,OAAS,IAC1BoB,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,aAAavB,OAAS,GAAG+C,aAGlD3B,KAAKD,QAAQM,UAAUS,IAAI,6BAC7B","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\tif(!__webpack_require__.o(exports, key)) {\n\t\t\t\tif(binding === 0) {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, value: definition[i++] });\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: binding });\n\t\t\t\t}\n\t\t\t} else if(binding === 0) { i++; }\n\t\t}\n\t} else {\n\t\tfor(var key in definition) {\n\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t\t}\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","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","o","Object","defineProperty","enumerable","value","get","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 +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:visited,.tna-button--plain:hover{color:var(--link, #005fa3)}.tna-button--plain:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}.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;font-size:0.875rem;line-height:1.5rem}.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{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:visited,.tna-button--plain:hover{color:var(--link, #005fa3)}.tna-button--plain:hover{text-decoration:underline;text-decoration-thickness:0.25rem;text-underline-offset:.125em}.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 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/button/_button-group.scss","../../../../src/nationalarchives/tools/_media.scss","../../../../src/nationalarchives/components/button/button.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss","../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_borders.scss","../../../../src/nationalarchives/variables/_borders.scss"],"names":[],"mappings":"AA0BA,kBACE,gBAUA,8BACE,aCnCJ,kBACE,aACA,eACA,mBACA,SCmDA,wBDvDF,kBASI,sBACA,qBAGF,yBACE,WAGF,2BACE,uBAGF,wBACE,wBCyDF,wBD1DA,wBAII,sBAEA,qBAGF,oCACE,SAEA,OE1BN,YACE,qBAEA,oBACA,qBACA,uBACA,YAEA,iBACA,kBACA,qBACA,kBAEA,eAEA,iCACA,yBCpBA,mBAiBA,YCiBsB,ICyCtB,wDA4BI,wDC1GJ,cCDsB,ILkCtB,iDGyCA,6CHnCA,kBGmCA,6CHjCE,qBAEA,yBAGF,sBACE,cAGF,gBACE,aAEA,kBAEA,cAEA,kBAGF,mBChDA,YCuBiB,IF2Bf,0BAEA,+BAEA,2BACA,mBAEA,+FGKF,2BHEE,yBCZF,0BACA,0BCpCsC,QDqCtC,sBCvCoC,OFsDpC,oBGHA,uEAiCI,mEHzBF,yEGZF,gDHkBE,0BGlBF,qCHuBA,wBACE,2BAEA,uCACE,mBAKJ,wDAEE,iBCzGF,mBD4GE,mBA0CF,uBAtCE,gBACA,eAEA,MAEA,uBACA,yBAEA,iCACE,aAEA,iBC3HJ,mBDgIE,2BACE,cACA,aAwBJ,yFAnBE,gBACA,eAEA,6GACE,aAEA,mBAGF,iGACE,cACA,aDtEJ,wBCoFE,8BAhDA,gBACA,eAEA,MAEA,uBACA,yBAEA,wCACE,aAEA,iBC3HJ,mBDgIE,kCACE,cACA,aAkCF,uGA7BA,gBACA,eAEA,2HACE,aAEA,mBAGF,+GACE,cACA,cAyBF,uDGpGF,qCAIA,4CHyGE,kHG7GF,qCHkHA,sHG9GA,uEAiCI,mEHmFF,4XGxHF,gDH8HE,kIG9HF,oDAIA,qDHiIA,mCAEI,2EGvIJ,qCH4IE,6EGxIF,uEAiCI,mEH4GA,oPGjJJ,gDHuJI,mFGvJJ,oDAIA,sDAqbA,8BHzRE,kBC1KF,0BACA,0BCpCsC,QDqCtC,sBCvCoC","file":"button.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 \"../../tools/media\";\n@use \"../../tools/spacing\";\n\n.tna-button-group {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: spacing.space(1);\n\n @include spacing.space-above;\n\n @include media.on-tiny {\n flex-direction: column;\n align-items: stretch;\n }\n\n &--small {\n gap: spacing.space(0.5);\n }\n\n &--centred {\n justify-content: center;\n }\n\n &--full {\n justify-content: stretch;\n\n @include media.on-mobile {\n flex-direction: column;\n\n align-items: stretch;\n }\n\n .tna-button {\n margin: 0;\n\n flex: 1;\n }\n }\n}\n","@use \"sass:math\";\n@use \"../variables/media\";\n@use \"../variables/typography\";\n\n$smallest-large-device-em: #{math.div(\n media.$largest-medium-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-medium-device-em: #{math.div(\n media.$largest-medium-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-medium-device-em: #{math.div(\n media.$largest-small-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-small-device-em: #{math.div(\n media.$largest-small-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-small-device-em: #{math.div(\n media.$largest-tiny-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-tiny-device-em: #{math.div(\n media.$largest-tiny-device-px,\n typography.$relative-1rem-px\n )}em;\n\n$media-large: \"(min-width: #{$smallest-large-device-em})\";\n$media-lt-large: \"(max-width: #{$largest-medium-device-em})\";\n$media-medium: \"(min-width: #{$smallest-medium-device-em}) and (max-width: #{$largest-medium-device-em})\";\n$media-gt-mobile: \"(min-width: #{$smallest-medium-device-em})\";\n$media-mobile: \"(max-width: #{$largest-small-device-em})\";\n$media-small: \"(min-width: #{$smallest-small-device-em}) and (max-width: #{$largest-small-device-em})\";\n$media-gt-tiny: \"(min-width: #{$smallest-small-device-em})\";\n$media-tiny: \"(max-width: #{$largest-tiny-device-em})\";\n\n// https://nationalarchives.github.io/design-system/styles/media/#media-queries\n@mixin on-large() {\n @media #{$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n","@use \"sass:math\";\n@use \"../../tools/borders\";\n@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n@use \"button-group\";\n\n$button-border-width: 4px !default;\n\n.tna-button {\n padding: spacing.space(0.25) spacing.space(1);\n\n display: inline-flex;\n align-items: baseline;\n justify-content: center;\n gap: spacing.space(0.75);\n\n line-height: 2rem;\n text-align: center;\n text-decoration: none;\n text-wrap: balance;\n\n cursor: pointer;\n\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n\n @include typography.font-size(18);\n @include typography.main-font-weight-bold;\n\n @include colour.colour-background(\"button-background\");\n\n @include colour.colour-border(\"button-background\", $button-border-width);\n @include borders.rounded-border;\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"button-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"button-hover-text\");\n text-decoration: none;\n\n background: transparent;\n }\n\n .fa-solid {\n display: block;\n }\n\n svg {\n height: 1.1em;\n\n align-self: center;\n\n flex-shrink: 0;\n\n fill: currentColor;\n }\n\n &--plain {\n @include typography.main-font-weight;\n text-decoration: underline;\n\n background-color: transparent;\n\n border-color: transparent;\n border-radius: 0.1px;\n\n &,\n &:link,\n &:visited,\n &:hover {\n @include colour.colour-font(\"link\");\n }\n\n &:hover {\n @include typography.interacted-text-decoration;\n }\n }\n\n &--accent {\n @include colour.colour-background(\"button-accented-background\");\n\n @include colour.colour-border(\"button-accented-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"button-accented-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n &--icon-right {\n flex-direction: row-reverse;\n\n &:has(.fa-solid) {\n align-items: center;\n // justify-content: space-between;\n }\n }\n\n &--small,\n &-group--small & {\n padding: 0 spacing.space(0.5);\n\n @include typography.font-size(14);\n line-height: 1.5rem;\n }\n\n @mixin icon-only {\n padding-right: 0;\n padding-left: 0;\n\n gap: 0;\n\n font-size: 0 !important;\n line-height: 0 !important;\n\n .fa-solid {\n width: 2.5rem;\n\n line-height: 2rem;\n\n @include typography.font-size(18);\n }\n\n svg {\n height: 1.5rem;\n margin: 0.5rem;\n }\n }\n\n @mixin icon-only-small {\n padding-right: 0;\n padding-left: 0;\n\n .fa-solid {\n width: 1.5rem;\n\n line-height: 1.5rem;\n }\n\n svg {\n height: 1.2rem;\n margin: 0.5rem;\n }\n }\n\n &--icon-only {\n @include icon-only;\n }\n\n &--small#{&}--icon-only,\n &-group--small &--icon-only {\n @include icon-only-small;\n }\n\n @include media.on-mobile {\n &--icon-only-mobile {\n @include icon-only;\n }\n\n &--small#{&}--icon-only-mobile,\n &-group--small &--icon-only-mobile {\n @include icon-only-small;\n }\n }\n\n &--solid-hover {\n &:not(.tna-button--plain):hover {\n @include colour.colour-font(\"font-dark\");\n\n @include colour.colour-background(\"background\");\n }\n }\n\n .tna-background-accent &,\n .tna-template--dark-theme .tna-background-accent-light & {\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n .tna-background-accent &--accent,\n .tna-template--dark-theme .tna-background-accent-light &--accent {\n @include colour.colour-background(\"contrast-button-background\");\n\n @include colour.colour-border(\"contrast-button-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"contrast-button-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"contrast-font-dark\");\n\n @include colour.colour-background(\"contrast-background\");\n }\n }\n\n @media (prefers-color-scheme: dark) {\n .tna-template--system-theme .tna-background-accent-light & {\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n .tna-template--system-theme .tna-background-accent-light &--accent {\n @include colour.colour-background(\"contrast-button-background\");\n\n @include colour.colour-border(\"contrast-button-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"contrast-button-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"contrast-font-dark\");\n\n @include colour.colour-background(\"contrast-background\");\n }\n }\n }\n\n @include colour.on-forced-colours {\n &:hover {\n @include typography.interacted-text-decoration;\n }\n }\n}\n","@use \"sass:math\";\n@use \"../variables/typography\";\n@use \"colour\";\n@use \"media\";\n\n@mixin font-size($font-size-px) {\n font-size: #{math.div($font-size-px, typography.$relative-1rem-px)}rem;\n}\n\n@mixin relative-font-size($font-size-px) {\n @warn \"relative-font-size() will soon be deprecated in favour of font-size().\";\n @include font-size($font-size-px);\n}\n\n@mixin main-font-weight {\n font-weight: typography.$main-font-weight;\n}\n\n@mixin main-font-weight-medium {\n font-weight: typography.$main-font-weight-medium;\n}\n\n@mixin main-font-weight-bold {\n font-weight: typography.$main-font-weight-bold;\n}\n\n@mixin main-font($bold: false) {\n font-family: typography.$main-font-family;\n font-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","@use \"sass:list\";\n@use \"sass:map\";\n@use \"sass:meta\";\n@use \"../variables/borders\";\n@use \"../variables/forms\";\n@use \"../variables/colour\";\n@use \"../variables/features\";\n@use \"../tools/media\";\n\n$base-colours: (\n \"background\",\n \"font-base\",\n \"font-dark\",\n \"font-light\",\n \"icon-light\",\n \"link\",\n \"link-visited\",\n \"keyline\",\n \"keyline-dark\"\n);\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index((\"keyline\", \"keyline-dark\"), $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour)\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)}\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if(sass($important): !important; else: null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n outline-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n%colour-input {\n @include colour-font(\"input-foreground\");\n @include colour-background(\"input-background\");\n @include colour-border(\"input-border\", forms.$form-field-border-width);\n}\n\n@mixin colour-input() {\n @extend %colour-input;\n}\n\n@mixin thick-keyline($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline-dark\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline-dark\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"accent-border\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"accent-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n $border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"form-error-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour, $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width #{brand-colour($brandColour)} solid;\n } @else {\n border: $border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n@mixin thick-keyline-transparent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width transparent solid;\n } @else {\n border: $border-width transparent solid;\n }\n}\n\n%always-light {\n @include colour-css-vars;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast;\n }\n}\n\n@mixin always-light {\n @extend %always-light;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-border: var(--accent-border-bright);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-border: var(--accent-border-bright);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%base {\n @each $name, $value in $base-colours {\n --#{$name}: var(--base-#{$value});\n }\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin base {\n @extend %base;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n --accent-border: var(--accent-background);\n\n @include colour-background(\"background\");\n @include colour-font(\"font-base\");\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n }\n\n .tna-template--dark-theme & {\n // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-border: #{colour.brand-colour(\"yellow\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"yellow\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"yellow\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --accent-border: #{colour.brand-colour(\"black\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"grey\")} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %accent-lighter-text;\n @extend %black-accent;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --accent-border: #{colour.brand-colour(\"maroon\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"pink\")} !important;\n --button-accented-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %accent-lighter-text;\n @extend %pink-accent;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --accent-border: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"orange\")} !important;\n --button-accented-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %accent-lighter-text;\n @extend %orange-accent;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --accent-border: #{colour.brand-colour(\"forest\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"green\")} !important;\n --button-accented-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %accent-lighter-text;\n @extend %green-accent;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --accent-border: #{colour.brand-colour(\"navy\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"blue\")} !important;\n --button-accented-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %accent-lighter-text;\n @extend %blue-accent;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n\n%image-loader-background {\n background: linear-gradient(\n -45deg,\n rgb(0 0 0 / 25%),\n rgb(255 255 255 / 25%),\n rgb(0 0 0 / 25%)\n );\n background-size: 500% 500%;\n background-position: 0 50%;\n\n animation: image-loader-background ease-in-out 1.2s infinite;\n\n @media (prefers-reduced-motion) {\n animation: none !important;\n }\n}\n\n@mixin image-loader-background {\n @if features.$image-loader-animations {\n @extend %image-loader-background;\n }\n}\n","@use \"../variables/borders\";\n\n@mixin rounded-border {\n border-radius: borders.$rounded-border-radius;\n}\n","$thick-border-width: 5px !default;\n$very-thick-border-width: 8px !default;\n$rounded-border-radius: 2px !default;\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/button/_button-group.scss","../../../../src/nationalarchives/tools/_media.scss","../../../../src/nationalarchives/components/button/button.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss","../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_borders.scss","../../../../src/nationalarchives/variables/_borders.scss"],"names":[],"mappings":"AA0BA,kBACE,gBAUA,8BACE,aCnCJ,kBACE,aACA,eACA,mBACA,SCmDA,wBDvDF,kBASI,sBACA,qBAGF,yBACE,WAGF,2BACE,uBAGF,wBACE,wBCyDF,wBD1DA,wBAII,sBAEA,qBAGF,oCACE,SAEA,OE1BN,YACE,qBAEA,oBACA,qBACA,uBACA,YAEA,iBACA,kBACA,qBACA,kBAEA,eAEA,iCACA,yBCpBA,mBAiBA,YCiBsB,ICyCtB,wDA4BI,wDC1GJ,cCDsB,ILkCtB,iDGyCA,6CHnCA,kBGmCA,6CHjCE,qBAEA,yBAGF,sBACE,cAGF,gBACE,aAEA,kBAEA,cAEA,kBAGF,mBChDA,YCuBiB,IF2Bf,0BAEA,+BAEA,2BACA,mBAEA,+FGKF,2BHEE,yBCZF,0BACA,0BCpCsC,QDqCtC,sBCvCoC,OFsDpC,oBGHA,uEAiCI,mEHzBF,yEGZF,gDHkBE,0BGlBF,qCHuBA,wBACE,2BAEA,uCACE,mBAKJ,wDAEE,iBAEA,aAEA,mBC7GF,mBDwJA,uBAtCE,gBACA,eAEA,MAEA,uBACA,yBAEA,iCACE,aAEA,iBC7HJ,mBDkIE,2BACE,cACA,aAwBJ,yFAnBE,gBACA,eAEA,6GACE,aAEA,mBAGF,iGACE,cACA,aDxEJ,wBCsFE,8BAhDA,gBACA,eAEA,MAEA,uBACA,yBAEA,wCACE,aAEA,iBC7HJ,mBDkIE,kCACE,cACA,aAkCF,uGA7BA,gBACA,eAEA,2HACE,aAEA,mBAGF,+GACE,cACA,cAyBF,uDGtGF,qCAIA,4CH2GE,kHG/GF,qCHoHA,sHGhHA,uEAiCI,mEHqFF,4XG1HF,gDHgIE,kIGhIF,oDAIA,qDHmIA,mCAEI,2EGzIJ,qCH8IE,6EG1IF,uEAiCI,mEH8GA,oPGnJJ,gDHyJI,mFGzJJ,oDAIA,sDAqbA,8BHvRE,kBC5KF,0BACA,0BCpCsC,QDqCtC,sBCvCoC","file":"button.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 \"../../tools/media\";\n@use \"../../tools/spacing\";\n\n.tna-button-group {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: spacing.space(1);\n\n @include spacing.space-above;\n\n @include media.on-tiny {\n flex-direction: column;\n align-items: stretch;\n }\n\n &--small {\n gap: spacing.space(0.5);\n }\n\n &--centred {\n justify-content: center;\n }\n\n &--full {\n justify-content: stretch;\n\n @include media.on-mobile {\n flex-direction: column;\n\n align-items: stretch;\n }\n\n .tna-button {\n margin: 0;\n\n flex: 1;\n }\n }\n}\n","@use \"sass:math\";\n@use \"../variables/media\";\n@use \"../variables/typography\";\n\n$smallest-large-device-em: #{math.div(\n media.$largest-medium-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-medium-device-em: #{math.div(\n media.$largest-medium-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-medium-device-em: #{math.div(\n media.$largest-small-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-small-device-em: #{math.div(\n media.$largest-small-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-small-device-em: #{math.div(\n media.$largest-tiny-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-tiny-device-em: #{math.div(\n media.$largest-tiny-device-px,\n typography.$relative-1rem-px\n )}em;\n\n$media-large: \"(min-width: #{$smallest-large-device-em})\";\n$media-lt-large: \"(max-width: #{$largest-medium-device-em})\";\n$media-medium: \"(min-width: #{$smallest-medium-device-em}) and (max-width: #{$largest-medium-device-em})\";\n$media-gt-mobile: \"(min-width: #{$smallest-medium-device-em})\";\n$media-mobile: \"(max-width: #{$largest-small-device-em})\";\n$media-small: \"(min-width: #{$smallest-small-device-em}) and (max-width: #{$largest-small-device-em})\";\n$media-gt-tiny: \"(min-width: #{$smallest-small-device-em})\";\n$media-tiny: \"(max-width: #{$largest-tiny-device-em})\";\n\n// https://nationalarchives.github.io/design-system/styles/media/#media-queries\n@mixin on-large() {\n @media #{$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n","@use \"sass:math\";\n@use \"../../tools/borders\";\n@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n@use \"button-group\";\n\n$button-border-width: 4px !default;\n\n.tna-button {\n padding: spacing.space(0.25) spacing.space(1);\n\n display: inline-flex;\n align-items: baseline;\n justify-content: center;\n gap: spacing.space(0.75);\n\n line-height: 2rem;\n text-align: center;\n text-decoration: none;\n text-wrap: balance;\n\n cursor: pointer;\n\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n\n @include typography.font-size(18);\n @include typography.main-font-weight-bold;\n\n @include colour.colour-background(\"button-background\");\n\n @include colour.colour-border(\"button-background\", $button-border-width);\n @include borders.rounded-border;\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"button-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"button-hover-text\");\n text-decoration: none;\n\n background: transparent;\n }\n\n .fa-solid {\n display: block;\n }\n\n svg {\n height: 1.1em;\n\n align-self: center;\n\n flex-shrink: 0;\n\n fill: currentColor;\n }\n\n &--plain {\n @include typography.main-font-weight;\n text-decoration: underline;\n\n background-color: transparent;\n\n border-color: transparent;\n border-radius: 0.1px;\n\n &,\n &:link,\n &:visited,\n &:hover {\n @include colour.colour-font(\"link\");\n }\n\n &:hover {\n @include typography.interacted-text-decoration;\n }\n }\n\n &--accent {\n @include colour.colour-background(\"button-accented-background\");\n\n @include colour.colour-border(\"button-accented-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"button-accented-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n &--icon-right {\n flex-direction: row-reverse;\n\n &:has(.fa-solid) {\n align-items: center;\n // justify-content: space-between;\n }\n }\n\n &--small,\n &-group--small & {\n padding: 0 spacing.space(0.5);\n\n gap: spacing.space(0.375);\n\n line-height: 1.5rem;\n @include typography.font-size(14);\n }\n\n @mixin icon-only {\n padding-right: 0;\n padding-left: 0;\n\n gap: 0;\n\n font-size: 0 !important;\n line-height: 0 !important;\n\n .fa-solid {\n width: 2.5rem;\n\n line-height: 2rem;\n\n @include typography.font-size(18);\n }\n\n svg {\n height: 1.5rem;\n margin: 0.5rem;\n }\n }\n\n @mixin icon-only-small {\n padding-right: 0;\n padding-left: 0;\n\n .fa-solid {\n width: 1.5rem;\n\n line-height: 1.5rem;\n }\n\n svg {\n height: 1.2rem;\n margin: 0.5rem;\n }\n }\n\n &--icon-only {\n @include icon-only;\n }\n\n &--small#{&}--icon-only,\n &-group--small &--icon-only {\n @include icon-only-small;\n }\n\n @include media.on-mobile {\n &--icon-only-mobile {\n @include icon-only;\n }\n\n &--small#{&}--icon-only-mobile,\n &-group--small &--icon-only-mobile {\n @include icon-only-small;\n }\n }\n\n &--solid-hover {\n &:not(.tna-button--plain):hover {\n @include colour.colour-font(\"font-dark\");\n\n @include colour.colour-background(\"background\");\n }\n }\n\n .tna-background-accent &,\n .tna-template--dark-theme .tna-background-accent-light & {\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n .tna-background-accent &--accent,\n .tna-template--dark-theme .tna-background-accent-light &--accent {\n @include colour.colour-background(\"contrast-button-background\");\n\n @include colour.colour-border(\"contrast-button-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"contrast-button-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"contrast-font-dark\");\n\n @include colour.colour-background(\"contrast-background\");\n }\n }\n\n @media (prefers-color-scheme: dark) {\n .tna-template--system-theme .tna-background-accent-light & {\n &:hover {\n @include colour.colour-font(\"font-dark\");\n }\n }\n\n .tna-template--system-theme .tna-background-accent-light &--accent {\n @include colour.colour-background(\"contrast-button-background\");\n\n @include colour.colour-border(\"contrast-button-background\");\n\n &,\n &:link,\n &:visited {\n @include colour.colour-font(\"contrast-button-text\");\n }\n\n &:hover {\n @include colour.colour-font(\"contrast-font-dark\");\n\n @include colour.colour-background(\"contrast-background\");\n }\n }\n }\n\n @include colour.on-forced-colours {\n &:hover {\n @include typography.interacted-text-decoration;\n }\n }\n}\n","@use \"sass:math\";\n@use \"../variables/typography\";\n@use \"colour\";\n@use \"media\";\n\n@mixin font-size($font-size-px) {\n font-size: #{math.div($font-size-px, typography.$relative-1rem-px)}rem;\n}\n\n@mixin relative-font-size($font-size-px) {\n @warn \"relative-font-size() will soon be deprecated in favour of font-size().\";\n @include font-size($font-size-px);\n}\n\n@mixin main-font-weight {\n font-weight: typography.$main-font-weight;\n}\n\n@mixin main-font-weight-medium {\n font-weight: typography.$main-font-weight-medium;\n}\n\n@mixin main-font-weight-bold {\n font-weight: typography.$main-font-weight-bold;\n}\n\n@mixin main-font($bold: false) {\n font-family: typography.$main-font-family;\n font-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","@use \"sass:list\";\n@use \"sass:map\";\n@use \"sass:meta\";\n@use \"../variables/borders\";\n@use \"../variables/forms\";\n@use \"../variables/colour\";\n@use \"../variables/features\";\n@use \"../tools/media\";\n\n$base-colours: (\n \"background\",\n \"font-base\",\n \"font-dark\",\n \"font-light\",\n \"icon-light\",\n \"link\",\n \"link-visited\",\n \"keyline\",\n \"keyline-dark\"\n);\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index((\"keyline\", \"keyline-dark\"), $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour)\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)}\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if(sass($important): !important; else: null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n outline-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n%colour-input {\n @include colour-font(\"input-foreground\");\n @include colour-background(\"input-background\");\n @include colour-border(\"input-border\", forms.$form-field-border-width);\n}\n\n@mixin colour-input() {\n @extend %colour-input;\n}\n\n@mixin thick-keyline($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline-dark\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline-dark\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"accent-border\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"accent-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n $border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"form-error-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour, $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width #{brand-colour($brandColour)} solid;\n } @else {\n border: $border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n@mixin thick-keyline-transparent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width transparent solid;\n } @else {\n border: $border-width transparent solid;\n }\n}\n\n%always-light {\n @include colour-css-vars;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast;\n }\n}\n\n@mixin always-light {\n @extend %always-light;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-border: var(--accent-border-bright);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-border: var(--accent-border-bright);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%base {\n @each $name, $value in $base-colours {\n --#{$name}: var(--base-#{$value});\n }\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin base {\n @extend %base;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n --accent-border: var(--accent-background);\n\n @include colour-background(\"background\");\n @include colour-font(\"font-base\");\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n }\n\n .tna-template--dark-theme & {\n // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-border: #{colour.brand-colour(\"yellow\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"yellow\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"yellow\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --accent-border: #{colour.brand-colour(\"black\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"grey\")} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %accent-lighter-text;\n @extend %black-accent;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --accent-border: #{colour.brand-colour(\"maroon\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"pink\")} !important;\n --button-accented-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %accent-lighter-text;\n @extend %pink-accent;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --accent-border: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"orange\")} !important;\n --button-accented-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %accent-lighter-text;\n @extend %orange-accent;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --accent-border: #{colour.brand-colour(\"forest\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"green\")} !important;\n --button-accented-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %accent-lighter-text;\n @extend %green-accent;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --accent-border: #{colour.brand-colour(\"navy\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"blue\")} !important;\n --button-accented-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %accent-lighter-text;\n @extend %blue-accent;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n\n%image-loader-background {\n background: linear-gradient(\n -45deg,\n rgb(0 0 0 / 25%),\n rgb(255 255 255 / 25%),\n rgb(0 0 0 / 25%)\n );\n background-size: 500% 500%;\n background-position: 0 50%;\n\n animation: image-loader-background ease-in-out 1.2s infinite;\n\n @media (prefers-reduced-motion) {\n animation: none !important;\n }\n}\n\n@mixin image-loader-background {\n @if features.$image-loader-animations {\n @extend %image-loader-background;\n }\n}\n","@use \"../variables/borders\";\n\n@mixin rounded-border {\n border-radius: borders.$rounded-border-radius;\n}\n","$thick-border-width: 5px !default;\n$very-thick-border-width: 8px !default;\n$rounded-border-radius: 2px !default;\n"]}
@@ -111,8 +111,10 @@ $button-border-width: 4px !default;
111
111
  &-group--small & {
112
112
  padding: 0 spacing.space(0.5);
113
113
 
114
- @include typography.font-size(14);
114
+ gap: spacing.space(0.375);
115
+
115
116
  line-height: 1.5rem;
117
+ @include typography.font-size(14);
116
118
  }
117
119
 
118
120
  @mixin icon-only {
@@ -289,6 +289,31 @@
289
289
  },
290
290
  "html": "<div class=\"tna-fieldset tna-fieldset--small-hint\"><fieldset class=\"tna-fieldset__inner\"><legend class=\"tna-fieldset__legend\"><span class=\"tna-fieldset__heading tna-heading-m\">Categories</span></legend><div class=\"tna-fieldset__body\"><div class=\"tna-checkboxes\" id=\"categories\"><div class=\"tna-checkboxes__item\"><input type=\"checkbox\" id=\"cat-option-1\" value=\"alpha\" name=\"categories\"><label for=\"cat-option-1\" class=\"tna-checkboxes__item-label\">Alpha</label></div><div class=\"tna-checkboxes__item\"><input type=\"checkbox\" id=\"cat-option-2\" value=\"beta\" name=\"categories\"><label for=\"cat-option-2\" class=\"tna-checkboxes__item-label\">Beta</label></div><div class=\"tna-checkboxes__item\"><input type=\"checkbox\" id=\"cat-option-3\" value=\"gamma\" name=\"categories\"><label for=\"cat-option-3\" class=\"tna-checkboxes__item-label\">Gamma</label></div></div></div></fieldset></div>"
291
291
  },
292
+ {
293
+ "name": "with overriding names",
294
+ "options": {
295
+ "label": "Categories",
296
+ "headingSize": "m",
297
+ "id": "categories",
298
+ "name": "categories",
299
+ "items": [
300
+ {
301
+ "text": "Alpha",
302
+ "value": "alpha"
303
+ },
304
+ {
305
+ "text": "Beta",
306
+ "value": "beta"
307
+ },
308
+ {
309
+ "text": "Gamma",
310
+ "value": "gamma",
311
+ "name": "other-categories"
312
+ }
313
+ ]
314
+ },
315
+ "html": "<div class=\"tna-fieldset tna-fieldset--small-hint\"><fieldset class=\"tna-fieldset__inner\"><legend class=\"tna-fieldset__legend\"><span class=\"tna-fieldset__heading tna-heading-m\">Categories</span></legend><div class=\"tna-fieldset__body\"><div class=\"tna-checkboxes\" id=\"categories\"><div class=\"tna-checkboxes__item\"><input type=\"checkbox\" id=\"categories-alpha\" value=\"alpha\" name=\"categories\"><label for=\"categories-alpha\" class=\"tna-checkboxes__item-label\">Alpha</label></div><div class=\"tna-checkboxes__item\"><input type=\"checkbox\" id=\"categories-beta\" value=\"beta\" name=\"categories\"><label for=\"categories-beta\" class=\"tna-checkboxes__item-label\">Beta</label></div><div class=\"tna-checkboxes__item\"><input type=\"checkbox\" id=\"categories-gamma\" value=\"gamma\" name=\"other-categories\"><label for=\"categories-gamma\" class=\"tna-checkboxes__item-label\">Gamma</label></div></div></div></fieldset></div>"
316
+ },
292
317
  {
293
318
  "name": "with classes",
294
319
  "options": {
@@ -54,7 +54,7 @@
54
54
  "name": "items",
55
55
  "type": "array",
56
56
  "required": true,
57
- "description": "A list of checkbox items.",
57
+ "description": "A list of checkboxes.",
58
58
  "params": [
59
59
  {
60
60
  "name": "id",
@@ -66,13 +66,19 @@
66
66
  "name": "text",
67
67
  "type": "string",
68
68
  "required": true,
69
- "description": "The label of the checkbox item."
69
+ "description": "The label of the checkbox."
70
70
  },
71
71
  {
72
72
  "name": "value",
73
73
  "type": "string",
74
74
  "required": true,
75
- "description": "The form field value."
75
+ "description": "The checkbox value."
76
+ },
77
+ {
78
+ "name": "name",
79
+ "type": "string",
80
+ "required": false,
81
+ "description": "An optional override for the checkbox name. If not set, the main `name` will be used."
76
82
  },
77
83
  {
78
84
  "name": "hint",
@@ -5,7 +5,7 @@
5
5
  <div class="tna-checkboxes{% if params.small or params.inline %} tna-checkboxes--small{% endif %}{% if params.inline %} tna-checkboxes--inline{% endif %}"{% if (params.items | length != 1) %} id="{{ params.id }}"{% endif %}>
6
6
  {%- for item in params.items %}
7
7
  <div class="tna-checkboxes__item">
8
- <input type="checkbox" id="{{ item.id or (params.id if (params.items | length == 1) else params.id ~ '-' ~ item.value) }}"{% if params.classes %} class="{{ params.classes }}"{% endif %} value="{{ item.value }}" name="{{ params.name }}"{% for attribute, value in params.attributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}{% if item.checked %} checked{% endif %}>
8
+ <input type="checkbox" id="{{ item.id or (params.id if (params.items | length == 1) else params.id ~ '-' ~ item.value) }}"{% if params.classes %} class="{{ params.classes }}"{% endif %} value="{{ item.value }}" name="{{ item.name or params.name }}"{% for attribute, value in params.attributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}{% if item.checked %} checked{% endif %}>
9
9
  <label for="{{ item.id or (params.id if (params.items | length == 1) else params.id ~ '-' ~ item.value) }}" class="tna-checkboxes__item-label">
10
10
  {{ item.text }}
11
11
  {%- if item.hint %}
@@ -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={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{CodeBlock:()=>o});class o{constructor(e){this.$module=e,this.$code=this.$module.querySelector("pre code"),this.$copyButton=this.$module.querySelector(".tna-code-block__copy"),this.$module&&this.$code&&this.$copyButton&&navigator.clipboard&&(this.$copyButton.removeAttribute("hidden"),this.$module.classList.add("tna-code-block__copyable"),this.$copyButton.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(this.$code.innerText),this.$copyButton.innerText="Code copied"}catch{}}),this.$copyButton.addEventListener("blur",()=>{this.$copyButton.innerText="Copy code"}))}}return t})());
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,o)=>{if(Array.isArray(o))for(var r=0;r<o.length;){var n=o[r++],c=o[r++];e.o(t,n)?0===c&&r++:0===c?Object.defineProperty(t,n,{enumerable:!0,value:o[r++]}):Object.defineProperty(t,n,{enumerable:!0,get:c})}else for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{CodeBlock:()=>o});class o{constructor(e){this.$module=e,this.$code=this.$module.querySelector("pre code"),this.$copyButton=this.$module.querySelector(".tna-code-block__copy"),this.$module&&this.$code&&this.$copyButton&&navigator.clipboard&&(this.$copyButton.removeAttribute("hidden"),this.$module.classList.add("tna-code-block__copyable"),this.$copyButton.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(this.$code.innerText),this.$copyButton.innerText="Code copied"}catch{}}),this.$copyButton.addEventListener("blur",()=>{this.$copyButton.innerText="Copy code"}))}}return t})());
2
2
  //# sourceMappingURL=code-block.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/code-block/code-block.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,uBCRD,IAAAC,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,IACA,oBAAAkB,QAAAA,OAAAC,aACAV,OAAAC,eAAAV,EAAAkB,OAAAC,YAAA,CAAuDC,MAAA,WAEvDX,OAAAC,eAAAV,EAAA,cAAgDoB,OAAA,2CCLzC,MAAMC,EACX,WAAAC,CAAYC,GACVC,KAAKD,QAAUA,EACfC,KAAKC,MAAQD,KAAKD,QAAQG,cAAc,YACxCF,KAAKG,YAAcH,KAAKD,QAAQG,cAAc,yBAG3CF,KAAKD,SACLC,KAAKC,OACLD,KAAKG,aACLC,UAAUC,YAKbL,KAAKG,YAAYG,gBAAgB,UACjCN,KAAKD,QAAQQ,UAAUC,IAAI,4BAE3BR,KAAKG,YAAYM,iBAAiB,QAASC,UACzC,UACQN,UAAUC,UAAUM,UAAUX,KAAKC,MAAMW,WAC/CZ,KAAKG,YAAYS,UAAY,aAC/B,CAAE,MACA,IAIJZ,KAAKG,YAAYM,iBAAiB,OAAQ,KACxCT,KAAKG,YAAYS,UAAY,cAEjC","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/code-block/code-block.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class CodeBlock {\n constructor($module) {\n this.$module = $module;\n this.$code = this.$module.querySelector(\"pre code\");\n this.$copyButton = this.$module.querySelector(\".tna-code-block__copy\");\n\n if (\n !this.$module ||\n !this.$code ||\n !this.$copyButton ||\n !navigator.clipboard\n ) {\n return;\n }\n\n this.$copyButton.removeAttribute(\"hidden\");\n this.$module.classList.add(\"tna-code-block__copyable\");\n\n this.$copyButton.addEventListener(\"click\", async () => {\n try {\n await navigator.clipboard.writeText(this.$code.innerText);\n this.$copyButton.innerText = \"Code copied\";\n } catch {\n // Continue regardless of error\n }\n });\n\n this.$copyButton.addEventListener(\"blur\", () => {\n this.$copyButton.innerText = \"Copy code\";\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","CodeBlock","constructor","$module","this","$code","querySelector","$copyButton","navigator","clipboard","removeAttribute","classList","add","addEventListener","async","writeText","innerText"],"sourceRoot":""}
1
+ {"version":3,"file":"components/code-block/code-block.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,uBCRD,MAAAC,EAAA,CCAAA,EAAA,CAAAL,EAAAM,KACA,GAAAC,MAAAC,QAAAF,GAEA,IADA,IAAAG,EAAA,EACAA,EAAAH,EAAAI,QAAA,CACA,IAAAC,EAAAL,EAAAG,KACAG,EAAAN,EAAAG,KACAJ,EAAAQ,EAAAb,EAAAW,GAMK,IAAAC,GAAyBH,IAL9B,IAAAG,EACAE,OAAAC,eAAAf,EAAAW,EAAA,CAA2CK,YAAA,EAAAC,MAAAX,EAAAG,OAE3CK,OAAAC,eAAAf,EAAAW,EAAA,CAA2CK,YAAA,EAAAE,IAAAN,GAG3C,MAEA,QAAAD,KAAAL,EACAD,EAAAQ,EAAAP,EAAAK,KAAAN,EAAAQ,EAAAb,EAAAW,IACAG,OAAAC,eAAAf,EAAAW,EAAA,CAA0CK,YAAA,EAAAE,IAAAZ,EAAAK,MClB1CN,EAAA,CAAAc,EAAAC,IAAAN,OAAAO,UAAAC,eAAAC,KAAAJ,EAAAC,GCCAf,EAAAL,IACAwB,OAAAC,aACAX,OAAAC,eAAAf,EAAAwB,OAAAC,YAAA,CAAuDR,MAAA,WAEvDH,OAAAC,eAAAf,EAAA,cAAgDiB,OAAA,+CCLzC,MAAMS,EACX,WAAAC,CAAYC,GACVC,KAAKD,QAAUA,EACfC,KAAKC,MAAQD,KAAKD,QAAQG,cAAc,YACxCF,KAAKG,YAAcH,KAAKD,QAAQG,cAAc,yBAG3CF,KAAKD,SACLC,KAAKC,OACLD,KAAKG,aACLC,UAAUC,YAKbL,KAAKG,YAAYG,gBAAgB,UACjCN,KAAKD,QAAQQ,UAAUC,IAAI,4BAE3BR,KAAKG,YAAYM,iBAAiB,QAASC,UACzC,UACQN,UAAUC,UAAUM,UAAUX,KAAKC,MAAMW,WAC/CZ,KAAKG,YAAYS,UAAY,aAC/B,CAAE,MACA,IAIJZ,KAAKG,YAAYM,iBAAiB,OAAQ,KACxCT,KAAKG,YAAYS,UAAY,cAEjC","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/code-block/code-block.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nconst __webpack_require__ = {};\n\n","// define getter/value functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tif(Array.isArray(definition)) {\n\t\tvar i = 0;\n\t\twhile(i < definition.length) {\n\t\t\tvar key = definition[i++];\n\t\t\tvar binding = definition[i++];\n\t\t\tif(!__webpack_require__.o(exports, key)) {\n\t\t\t\tif(binding === 0) {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, value: definition[i++] });\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: binding });\n\t\t\t\t}\n\t\t\t} else if(binding === 0) { i++; }\n\t\t}\n\t} else {\n\t\tfor(var key in definition) {\n\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t\t}\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class CodeBlock {\n constructor($module) {\n this.$module = $module;\n this.$code = this.$module.querySelector(\"pre code\");\n this.$copyButton = this.$module.querySelector(\".tna-code-block__copy\");\n\n if (\n !this.$module ||\n !this.$code ||\n !this.$copyButton ||\n !navigator.clipboard\n ) {\n return;\n }\n\n this.$copyButton.removeAttribute(\"hidden\");\n this.$module.classList.add(\"tna-code-block__copyable\");\n\n this.$copyButton.addEventListener(\"click\", async () => {\n try {\n await navigator.clipboard.writeText(this.$code.innerText);\n this.$copyButton.innerText = \"Code copied\";\n } catch {\n // Continue regardless of error\n }\n });\n\n this.$copyButton.addEventListener(\"blur\", () => {\n this.$copyButton.innerText = \"Copy code\";\n });\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","Array","isArray","i","length","key","binding","o","Object","defineProperty","enumerable","value","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","CodeBlock","constructor","$module","this","$code","querySelector","$copyButton","navigator","clipboard","removeAttribute","classList","add","addEventListener","async","writeText","innerText"],"sourceRoot":""}
@@ -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={533(e,t,i){i.d(t,{A:()=>n}),window.TNAFrontendCookieEvents||=null;class s{events={};oneTimeEvents={};debug=!1;constructor(e=!1){if(this.debug=e,window.TNAFrontendCookieEvents)return this.log("Using existing TNAFrontendCookieEvents instance"),window.TNAFrontendCookieEvents;window.TNAFrontendCookieEvents=this}log(...e){this.debug&&console.log("[TNA Frontend Cookie Events]",...e)}on(e,t){Object.hasOwn(this.events,e)||(this.events[e]=[]),this.events[e]=[...this.events[e],t]}once(e,t){Object.hasOwn(this.oneTimeEvents,e)||(this.oneTimeEvents[e]=[]),this.oneTimeEvents[e]=[...this.oneTimeEvents[e],t]}trigger(e,t={}){if(Object.hasOwn(this.events,e)&&(this.log(`Triggering event: ${e}`,t),this.events[e].forEach(e=>e.call(this,t))),Object.hasOwn(this.oneTimeEvents,e)){this.log(`Triggering one-time event: ${e}`,t);for(let i=this.oneTimeEvents[e].length-1;i>=0;i-=1)this.oneTimeEvents[e][i].call(this,t),this.oneTimeEvents[e].splice(i,1)}}}window.TNAFrontendCookies||=null;const o=["usage","settings","marketing","essential"];class n{defaultDomain="";defaultPath="";secure=!0;policiesKey="";events=null;defaultAge=null;policiesCorrectOnInit=!1;debug="true"===document.documentElement.dataset.tnaFrontendDebug;constructor(e={}){const{defaultDomain:t,defaultPath:i,secure:n,policiesKey:c,defaultAge:l,newInstance:r=!1,noInit:a=!1}=e;if(!r&&window.TNAFrontendCookies)return window.TNAFrontendCookies;if(this.defaultDomain=t||document.documentElement.dataset.tnaCookiesDomain||window.location.hostname,this.defaultPath=i||document.documentElement.dataset.tnaCookiesPath||"/",this.secure=n||"true"!==document.documentElement.dataset.tnaCookiesInsecure,this.policiesKey=c||document.documentElement.dataset.tnaCookiesPoliciesKey||"cookies_policy",l)this.defaultAge=l;else{const e=31536e3;this.defaultAge=parseInt(document.documentElement.dataset.tnaCookiesDefaultAge,10)||e}this.events=new s(this.debug),this.policiesCorrectOnInit=Object.keys(this.policies).length===o.length&&o.every(e=>Object.keys(this.policies).includes(e)&&"boolean"==typeof this.policies[e]),this.policiesCorrectOnInit||a||this.init(),this.log({defaultDomain:this.defaultDomain,defaultPath:this.defaultPath,secure:this.secure,policiesKey:this.policiesKey,defaultAge:this.defaultAge,policiesCorrectOnInit:this.policiesCorrectOnInit}),r||window.TNAFrontendCookies||(window.TNAFrontendCookies=this)}init(){const e=this.policies;this.log("Existing policies on init:",e);const t=Object.fromEntries(Object.keys(e).filter(e=>o.includes(e)).map(t=>[t,e[t]]));Object.keys(t).length&&this.log("Filtered existing policies:",t),this.savePolicies({usage:!1,settings:!1,marketing:!1,...t,essential:!0})}log(...e){this.debug&&console.log("[TNA Frontend Cookies]",...e,this.all)}destroyInstance(){this.log("Destroying TNAFrontendCookies instance"),window.TNAFrontendCookies=null}get all(){const e={};return document.cookie.split("; ").filter(e=>""!==e.trim()).forEach(t=>{const i=t.trim().split("="),[s,o]=i;s&&(e[s]=decodeURIComponent(o||""))}),e}get policies(){try{return JSON.parse(this.get(this.policiesKey)||"{}")}catch(e){return{}}}exists(e){return Object.hasOwn(this.all,e)}hasValue(e,t){return this.get(e)===t}get(e){return this.exists(e)?decodeURIComponent(this.all[e]):null}set(e,t,i={}){const{maxAge:s=this.defaultAge,sameSite:o="Lax",domain:n=this.defaultDomain,path:c=this.defaultPath,secure:l=this.secure,session:r=!1}=i;if(!e)return;let a="";l&&(a="; secure");let h="";r||(h=`; max-age=${s}`);const d=`${encodeURIComponent(e)}=${encodeURIComponent(t)}; domain=${n}; samesite=${o}; path=${c}${h}${a}`;document.cookie=d,this.log("Set cookie:",{key:e,value:t,maxAge:s,path:c,sameSite:o,domain:n,secure:l,session:r,cookie:d}),this.events.trigger("setCookie",{key:e,value:t,maxAge:s,path:c,sameSite:o,domain:n,secure:l,session:r,cookie:d})}delete(e,t="/",i=this.defaultDomain){const s={maxAge:-1,path:t,domain:i||this.defaultDomain};this.set(e,"",s),this.log("Deleted cookie:",{key:e,path:t,domain:i,...s}),this.events.trigger("deleteCookie",{key:e,...s})}deleteAll(e="/",t=this.defaultDomain){Object.keys(this.all).forEach(i=>{this.delete(i,e,t)}),this.log("Deleted all cookies",{path:e,domain:t}),this.events.trigger("deleteAllCookies",{path:e,domain:t})}acceptPolicy(e){this.log("Accepting policy:",e),this.setPolicy(e,!0),this.events.trigger("acceptPolicy",e),this.events.trigger("changePolicy",{[e]:!0})}rejectPolicy(e){this.log("Rejecting policy:",e),this.setPolicy(e,!1),this.events.trigger("rejectPolicy",e),this.events.trigger("changePolicy",{[e]:!1})}setPolicy(e,t){"essential"!==e?(this.log(`Setting policy ${e} to ${t}`),this.savePolicies({...this.policies,[e]:t,essential:!0}),this.events.trigger("changePolicy",{[e]:t})):this.log("Cannot change essential policy, it is always accepted.")}acceptAllPolicies(){this.log("Accepting all policies");const e=Object.fromEntries(Object.keys(this.policies).map(e=>[e.toLowerCase(),!0]));this.savePolicies(e),this.events.trigger("acceptAllPolicies"),this.events.trigger("changePolicy",e)}rejectAllPolicies(){this.log("Rejecting all policies");const e={...Object.fromEntries(Object.keys(this.policies).map(e=>[e.toLowerCase(),!1])),essential:!0};this.savePolicies(e),this.events.trigger("rejectAllPolicies"),this.events.trigger("changePolicy",e)}savePolicies(e){this.log("Saving policies:",e),this.set(this.policiesKey,JSON.stringify(e))}isPolicyAccepted(e){return Object.hasOwn(this.policies,e)?!0===this.policies[e]:null}on(e,t){this.log(`Adding event listener for: ${e}`),this.events.on(e,t)}once(e,t){this.log(`Adding one-time event listener for: ${e}`),this.events.once(e,t)}}}},t={};function i(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{CookieBanner:()=>n,Cookies:()=>o.A});var o=i(533);class n{constructor(e){this.$module=e,this.$acceptButton=e&&e.querySelector('[value="accept"]'),this.$rejectButton=e&&e.querySelector('[value="reject"]'),this.$prompt=e&&e.querySelector(".tna-cookie-banner__message--prompt"),this.$acceptedMessage=e&&e.querySelector(".tna-cookie-banner__message--accepted"),this.$rejectedMessage=e&&e.querySelector(".tna-cookie-banner__message--rejected"),this.$closeButtons=e&&e.querySelectorAll('[value="close"]'),this.$module&&this.$acceptButton&&this.$rejectButton&&this.$prompt&&this.$acceptedMessage&&this.$rejectedMessage&&this.$closeButtons&&(this.cookies=new o.A({newInstance:!0}),this.cookiePreferencesSetKey=this.$module.dataset.preferencesKey||"cookie_preferences_set",this.cookies.policiesCorrectOnInit||this.cookies.delete(this.cookiePreferencesSetKey),this.cookies.exists(this.cookiePreferencesSetKey)&&this.cookies.hasValue(this.cookiePreferencesSetKey,"true")||(this.$module.removeAttribute("hidden"),this.$acceptButton.addEventListener("click",()=>this.accept()),this.$rejectButton.addEventListener("click",()=>this.reject())))}accept(){this.$prompt.setAttribute("hidden",""),this.complete(),this.cookies.acceptAllPolicies(),this.$acceptedMessage.removeAttribute("hidden"),this.$acceptedMessage.setAttribute("tabindex","0"),this.$acceptedMessage.focus(),this.$acceptedMessage.addEventListener("blur",()=>{this.$acceptedMessage.removeAttribute("tabindex")})}reject(){this.$prompt.setAttribute("hidden",""),this.complete(),this.cookies.rejectAllPolicies(),this.$rejectedMessage.removeAttribute("hidden"),this.$rejectedMessage.setAttribute("tabindex","0"),this.$rejectedMessage.focus(),this.$rejectedMessage.addEventListener("blur",()=>{this.$rejectedMessage.removeAttribute("tabindex")})}complete(){this.cookies.set(this.cookiePreferencesSetKey,!0),this.$closeButtons.forEach(e=>{e.addEventListener("click",()=>this.close())})}close(){this.$module.setAttribute("hidden","")}}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={404(e,t,s){s.d(t,{A:()=>n});class r{events={};oneTimeEvents={};constructor(){if(window.TNAFrontendCookieEvents&&window.TNAFrontendCookieEvents instanceof r)return window.TNAFrontendCookieEvents;window.TNAFrontendCookieEvents=this}clearAll(){this.events={},this.oneTimeEvents={}}on(e,t){Object.hasOwn(this.events,e)||(this.events[e]=[]),this.events[e]=[...this.events[e],t]}once(e,t){Object.hasOwn(this.oneTimeEvents,e)||(this.oneTimeEvents[e]=[]),this.oneTimeEvents[e]=[...this.oneTimeEvents[e],t]}trigger(e,t={}){Object.hasOwn(this.events,e)&&this.events[e].forEach(e=>e.call(this,t)),Object.hasOwn(this.oneTimeEvents,e)&&(this.oneTimeEvents[e].forEach(e=>e.call(this,t)),this.oneTimeEvents[e]=[])}}class n{defaultDomain="";defaultPath="";secure=!0;preferencesKey="";events=null;defaultAge=null;preferencesCorrectOnInit=!1;tnaCookiePreferences=["usage","settings","marketing","essential"];constructor(e={}){const{defaultDomain:t,defaultPath:s,secure:n,preferencesKey:i,defaultAge:o,noInit:c=!1}=e,a=document.documentElement.dataset;this.defaultDomain=t||a.tnaCookiesDomain||window.location.hostname,this.defaultPath=s||a.tnaCookiesPath||"/",this.secure=n||"true"!==a.tnaCookiesInsecure,this.preferencesKey=i||a.tnaCookiesPreferencesKey||"cookie_preferences",this.defaultAge=o||parseInt(a.tnaCookiesDefaultAge,10)||31536e3,this.events=new r,this.preferencesCorrectOnInit=Object.keys(this.preferences).length===this.tnaCookiePreferences.length&&this.tnaCookiePreferences.every(e=>Object.keys(this.preferences).includes(e)&&"boolean"==typeof this.preferences[e]),this.preferencesCorrectOnInit||c||this.init()}init(){const e=this.preferences,t=Object.fromEntries(Object.keys(e).filter(e=>this.tnaCookiePreferences.includes(e)).map(t=>[t,e[t]]));this.savePreferences({usage:!1,settings:!1,marketing:!1,...t,essential:!0})}get all(){const e={};return document.cookie.split("; ").filter(e=>""!==e.trim()).forEach(t=>{const s=t.trim().split("="),[r,n]=s;r&&(e[r]=decodeURIComponent(n||""))}),e}get preferences(){try{return JSON.parse(this.get(this.preferencesKey)||"{}")}catch(e){return{}}}exists(e){return Object.hasOwn(this.all,e)}hasValue(e,t){return this.get(e)===t}get(e){if(this.exists(e))return decodeURIComponent(this.all[e])}set(e,t,s={}){const{maxAge:r=this.defaultAge,sameSite:n="Lax",domain:i=this.defaultDomain,path:o=this.defaultPath,secure:c=this.secure,session:a=!1}=s;if(!e)return;const h=c?"; secure":"",l=a?"":`; max-age=${r}`,d=`${encodeURIComponent(e)}=${encodeURIComponent(t)}; domain=${i}; samesite=${n}; path=${o}${l}${h}`;document.cookie=d;const f={key:e,value:t,maxAge:r,path:o,sameSite:n,domain:i,secure:c,session:a,cookie:d};this.events.trigger("setCookie",f)}delete(e,t="/",s=this.defaultDomain){const r={maxAge:-1,path:t,domain:s||this.defaultDomain};this.set(e,"",r),this.events.trigger("deleteCookie",{key:e,...r})}deleteAll(e="/",t=this.defaultDomain){Object.keys(this.all).forEach(s=>{this.delete(s,e,t)});const s={path:e,domain:t};this.events.trigger("deleteAllCookies",s)}enablePreference(e){if(!Object.hasOwn(this.preferences,e))throw new Error(`Preference '${e}' does not exist`);this.setPreference(e,!0),this.events.trigger("enablePreference",e),this.events.trigger("changePreference",{[e]:!0})}disablePreference(e){if(!Object.hasOwn(this.preferences,e))throw new Error(`Preference '${e}' does not exist`);this.setPreference(e,!1),this.events.trigger("disablePreference",e),this.events.trigger("changePreference",{[e]:!1})}setPreference(e,t){if(!Object.hasOwn(this.preferences,e))throw new Error(`Preference '${e}' does not exist`);"essential"!==e&&(this.savePreferences({...this.preferences,[e]:t,essential:!0}),this.events.trigger("changePreference",{[e]:t}))}enableAllPreferences(){const e=Object.fromEntries(Object.keys(this.preferences).map(e=>[e.toLowerCase(),!0]));this.savePreferences(e),this.events.trigger("enableAllPreferences"),this.events.trigger("changePreference",e)}disableAllPreferences(){const e={...Object.fromEntries(Object.keys(this.preferences).map(e=>[e.toLowerCase(),!1])),essential:!0};this.savePreferences(e),this.events.trigger("disableAllPreferences"),this.events.trigger("changePreference",e)}savePreferences(e){this.set(this.preferencesKey,JSON.stringify(e))}preference(e){if(Object.hasOwn(this.preferences,e))return!0===this.preferences[e];throw new Error(`Preference '${e}' does not exist`)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}}}};const t={};function s(r){const n=t[r];if(void 0!==n)return n.exports;const i=t[r]={exports:{}};return e[r](i,i.exports,s),i.exports}s.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var n=t[r++],i=t[r++];s.o(e,n)?0===i&&r++:0===i?Object.defineProperty(e,n,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,n,{enumerable:!0,get:i})}else for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};let r={};s.r(r),s.d(r,{CookieBanner:()=>i,Cookies:()=>n.A});var n=s(404);class i{constructor(e){this.$module=e,this.$acceptButton=e&&e.querySelector('[value="accept"]'),this.$rejectButton=e&&e.querySelector('[value="reject"]'),this.$prompt=e&&e.querySelector(".tna-cookie-banner__message--prompt"),this.$acceptedMessage=e&&e.querySelector(".tna-cookie-banner__message--accepted"),this.$rejectedMessage=e&&e.querySelector(".tna-cookie-banner__message--rejected"),this.$closeButtons=e&&e.querySelectorAll('[value="close"]'),this.$module&&this.$acceptButton&&this.$rejectButton&&this.$prompt&&this.$acceptedMessage&&this.$rejectedMessage&&this.$closeButtons&&(this.cookies=new n.A,this.cookiePreferencesSetKey=this.$module.dataset.preferencesKey||"cookie_preferences_set",this.cookies.preferencesCorrectOnInit||this.cookies.delete(this.cookiePreferencesSetKey),this.cookies.exists(this.cookiePreferencesSetKey)&&this.cookies.hasValue(this.cookiePreferencesSetKey,"true")||(this.$module.removeAttribute("hidden"),this.$acceptButton.addEventListener("click",()=>this.accept()),this.$rejectButton.addEventListener("click",()=>this.reject())))}accept(){this.$prompt.setAttribute("hidden",""),this.complete(),this.cookies.enableAllPreferences(),this.$acceptedMessage.removeAttribute("hidden"),this.$acceptedMessage.setAttribute("tabindex","0"),this.$acceptedMessage.focus(),this.$acceptedMessage.addEventListener("blur",()=>{this.$acceptedMessage.removeAttribute("tabindex")})}reject(){this.$prompt.setAttribute("hidden",""),this.complete(),this.cookies.disableAllPreferences(),this.$rejectedMessage.removeAttribute("hidden"),this.$rejectedMessage.setAttribute("tabindex","0"),this.$rejectedMessage.focus(),this.$rejectedMessage.addEventListener("blur",()=>{this.$rejectedMessage.removeAttribute("tabindex")})}complete(){this.cookies.set(this.cookiePreferencesSetKey,!0),this.$closeButtons.forEach(e=>{e.addEventListener("click",()=>this.close())})}close(){this.$module.setAttribute("hidden","")}}return r})());
2
2
  //# sourceMappingURL=cookie-banner.js.map