@nationalarchives/frontend 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/nationalarchives/all.css +1 -1
  2. package/nationalarchives/all.css.map +1 -1
  3. package/nationalarchives/all.js +1 -1
  4. package/nationalarchives/all.js.map +1 -1
  5. package/nationalarchives/analytics.js +1 -1
  6. package/nationalarchives/analytics.js.map +1 -1
  7. package/nationalarchives/analytics.mjs +1 -1
  8. package/nationalarchives/components/accordion/accordion.css +1 -1
  9. package/nationalarchives/components/accordion/accordion.css.map +1 -1
  10. package/nationalarchives/components/accordion/accordion.js +1 -1
  11. package/nationalarchives/components/accordion/accordion.js.map +1 -1
  12. package/nationalarchives/components/accordion/accordion.mjs +1 -4
  13. package/nationalarchives/components/accordion/accordion.scss +4 -0
  14. package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
  15. package/nationalarchives/components/breadcrumbs/breadcrumbs.js +1 -1
  16. package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
  17. package/nationalarchives/components/button/button.css.map +1 -1
  18. package/nationalarchives/components/card/card.css +1 -1
  19. package/nationalarchives/components/card/card.css.map +1 -1
  20. package/nationalarchives/components/card/card.scss +15 -0
  21. package/nationalarchives/components/card/fixtures.json +74 -26
  22. package/nationalarchives/components/card/macro-options.json +7 -7
  23. package/nationalarchives/components/card/template.njk +7 -4
  24. package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
  25. package/nationalarchives/components/compound-filters/compound-filters.css.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/date-input/date-input.css.map +1 -1
  29. package/nationalarchives/components/date-search/date-search.css.map +1 -1
  30. package/nationalarchives/components/details/details.css.map +1 -1
  31. package/nationalarchives/components/details/template.njk +3 -1
  32. package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
  33. package/nationalarchives/components/error-summary/error-summary.js +1 -1
  34. package/nationalarchives/components/error-summary/error-summary.js.map +1 -1
  35. package/nationalarchives/components/files-list/files-list.css +1 -1
  36. package/nationalarchives/components/files-list/files-list.css.map +1 -1
  37. package/nationalarchives/components/files-list/files-list.scss +0 -6
  38. package/nationalarchives/components/files-list/fixtures.json +6 -3
  39. package/nationalarchives/components/files-list/macro-options.json +6 -0
  40. package/nationalarchives/components/files-list/template.njk +3 -3
  41. package/nationalarchives/components/footer/footer.css.map +1 -1
  42. package/nationalarchives/components/footer/footer.js +1 -1
  43. package/nationalarchives/components/footer/footer.js.map +1 -1
  44. package/nationalarchives/components/gallery/fixtures.json +1 -1
  45. package/nationalarchives/components/gallery/gallery.css +1 -1
  46. package/nationalarchives/components/gallery/gallery.css.map +1 -1
  47. package/nationalarchives/components/gallery/gallery.js +1 -1
  48. package/nationalarchives/components/gallery/gallery.js.map +1 -1
  49. package/nationalarchives/components/gallery/gallery.scss +31 -23
  50. package/nationalarchives/components/gallery/template.njk +3 -5
  51. package/nationalarchives/components/global-header/global-header.css.map +1 -1
  52. package/nationalarchives/components/global-header/global-header.js +1 -1
  53. package/nationalarchives/components/global-header/global-header.js.map +1 -1
  54. package/nationalarchives/components/header/header.css.map +1 -1
  55. package/nationalarchives/components/header/header.js +1 -1
  56. package/nationalarchives/components/header/header.js.map +1 -1
  57. package/nationalarchives/components/hero/hero.css.map +1 -1
  58. package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
  59. package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
  60. package/nationalarchives/components/picture/picture.css.map +1 -1
  61. package/nationalarchives/components/picture/picture.js +1 -1
  62. package/nationalarchives/components/picture/picture.js.map +1 -1
  63. package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -1
  64. package/nationalarchives/components/radios/radios.css.map +1 -1
  65. package/nationalarchives/components/records-list/records-list.css.map +1 -1
  66. package/nationalarchives/components/search-field/search-field.css.map +1 -1
  67. package/nationalarchives/components/select/select.css.map +1 -1
  68. package/nationalarchives/components/sidebar/sidebar.css.map +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.css.map +1 -1
  73. package/nationalarchives/components/tabs/tabs.js +1 -1
  74. package/nationalarchives/components/tabs/tabs.js.map +1 -1
  75. package/nationalarchives/components/text-input/text-input.css.map +1 -1
  76. package/nationalarchives/components/textarea/textarea.css.map +1 -1
  77. package/nationalarchives/components/warning/warning.css.map +1 -1
  78. package/nationalarchives/global-header-package.css +1 -1
  79. package/nationalarchives/global-header-package.css.map +1 -1
  80. package/nationalarchives/print.css.map +1 -1
  81. package/nationalarchives/prototype-kit.css +1 -1
  82. package/nationalarchives/prototype-kit.css.map +1 -1
  83. package/nationalarchives/templates/fixtures.json +1 -1
  84. package/nationalarchives/tools/_colour.scss +3 -3
  85. package/nationalarchives/utilities/grid/_index.scss +5 -0
  86. package/nationalarchives/utilities/lists/_index.scss +11 -2
  87. package/nationalarchives/utilities/tables/_index.scss +15 -3
  88. package/nationalarchives/utilities/typography/_index.scss +25 -5
  89. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAA8B,qBAAID,IAElCD,EAA2B,qBAAIC,GAChC,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC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ACtDC,EAASzK,SAAS0K,cAAc,UACtCD,EAAOE,OAAQ,EACfF,EAAOG,IAAM,8CAAHnN,OAAiDL,KAAKqM,OAAM,gBAClEc,EACFA,EAAYhI,WAAWsI,aAAaJ,EAAQF,GAE5CvK,SAAS6I,KAAKiC,YAAYL,GAE5BrN,KAAKgN,mBAAoB,EACzB,IAAMW,EAAc3N,KAAK4N,iBACrB/O,OAAOuF,KAAKuJ,GAAahN,QAC3BX,KAAK8M,gBAAgBa,EAEzB,CACA3N,KAAK+M,iBAAkB,CACzB,CACF,GAEA,CAAApO,IAAA,kBAAAa,MACA,WAAkB,IAAAqO,EAAA,KACZ7N,KAAK+M,kBACPtN,OAAOO,KAAKsM,aAAc,EAC1BtM,KAAK8J,QAAQ5F,IAAIlE,KAAKsM,WAAY,QAClCzN,OAAOuF,KAAKpE,KAAK8J,QAAQxG,KAAKzC,SAAQ,SAAClC,GACjCA,EAAImP,WAAW,QACjBD,EAAK/D,QAAO,OAAQnL,EAExB,IACAqB,KAAK+M,iBAAkB,EAG3B,IAAC,CA1GM,CAAS5D,GA6GZ4E,EAAU,CAAEnJ,WAAAA,EAAYiB,kBAAAA,EAAmBS,aAAAA,G","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/lib/cookies.mjs","webpack://TNAFrontend/./src/nationalarchives/lib/analytics-helpers.mjs","webpack://TNAFrontend/./src/nationalarchives/components/breadcrumbs/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/checkboxes/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/footer/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/global-header/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/header/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/picture/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/radios/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/search-field/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/text-input/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/textarea/analytics.js","webpack://TNAFrontend/./src/nationalarchives/analytics.mjs","webpack://TNAFrontend/./src/nationalarchives/components/hero/analytics.js"],"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([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontendAnalytics\"] = factory();\n\telse\n\t\troot[\"TNAFrontendAnalytics\"] = 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};","window.TNAFrontendCookies = window.TNAFrontendCookies || null;\nwindow.TNAFrontendCookieEvents = window.TNAFrontendCookieEvents || null;\n\nexport class CookieEventHandler {\n events = {};\n oneTimeEvents = {};\n\n constructor() {\n if (window.TNAFrontendCookieEvents) {\n return window.TNAFrontendCookieEvents;\n }\n window.TNAFrontendCookieEvents = this;\n }\n\n /**\n * Add an event listener.\n * @param {String} event - The event to add a listener for.\n * @param {Function} callback - The callback function to call when the event is triggered.\n */\n on(event, callback) {\n if (!Object.hasOwn(this.events, event)) {\n this.events[event] = [];\n }\n this.events[event] = [...this.events[event], callback];\n }\n\n once(event, callback) {\n if (!Object.hasOwn(this.oneTimeEvents, event)) {\n this.oneTimeEvents[event] = [];\n }\n this.oneTimeEvents[event] = [...this.oneTimeEvents[event], callback];\n }\n\n /** @protected */\n trigger(event, data = {}) {\n if (Object.hasOwn(this.events, event)) {\n this.events[event].forEach((eventToTrigger) =>\n eventToTrigger.call(this, data),\n );\n }\n if (Object.hasOwn(this.oneTimeEvents, event)) {\n for (let i = this.oneTimeEvents[event].length - 1; i >= 0; i--) {\n const eventToTrigger = this.oneTimeEvents[event][i];\n eventToTrigger.call(this, data);\n this.oneTimeEvents[event].splice(i, 1);\n }\n }\n }\n}\n\n/**\n * Class to handle cookies.\n * @class Cookies\n * @constructor\n * @public\n */\nexport default class Cookies {\n /** @protected */\n extraPolicies = [];\n /** @protected */\n domain = \"\";\n /** @protected */\n path = \"\";\n /** @protected */\n secure = true;\n /** @protected */\n policiesKey = \"\";\n /** @protected */\n events = null;\n\n /**\n * Create a cookie handler.\n * @param {String} [options.extraPolicies=[]] - The extra cookie policies to manage in addition to essential, settings and usage.\n * @param {String} [options.domain=\"\"] - The domain to register the cookie with.\n * @param {String} [options.path=\"\"] - The domain to register the cookie with.\n * @param {String} [options.secure=true] - Only set cookie in HTTPS environments.\n * @param {String} [options.policiesKey=\"cookies_policy\"] - The name of the cookie.\n * @param {String} [options.newInstance=false] - Create a fresh instance of the cookie class.\n */\n constructor(options = {}) {\n const {\n extraPolicies = [],\n domain = \"\",\n path = \"/\",\n secure = true,\n policiesKey = \"cookies_policy\",\n newInstance = false,\n } = options;\n if (newInstance) {\n this.destroyInstance();\n } else if (window.TNAFrontendCookies) {\n return window.TNAFrontendCookies;\n }\n this.extraPolicies = extraPolicies;\n this.domain = domain;\n this.path = path;\n this.secure = secure;\n this.policiesKey = policiesKey;\n this.events = new CookieEventHandler();\n this.init();\n window.TNAFrontendCookies = this;\n }\n\n /** @protected */\n init() {\n this.savePolicies({\n ...Object.fromEntries(\n this.extraPolicies.map((k) => [k.toLowerCase(), false]),\n ),\n usage: false,\n settings: false,\n ...this.policies,\n essential: true,\n });\n }\n\n destroyInstance() {\n window.TNAFrontendCookies = null;\n }\n\n /** @protected */\n get all() {\n const deserialised = {};\n document.cookie\n .split(\"; \")\n .filter((x) => x)\n .forEach((cookie) => {\n const parts = cookie.trim().split(\"=\");\n if (parts[0]) {\n deserialised[parts[0]] = parts[1];\n }\n });\n return deserialised;\n }\n\n /** @protected */\n get policies() {\n try {\n return JSON.parse(this.get(this.policiesKey) || \"{}\");\n } catch (e) {\n return {};\n }\n }\n\n /**\n * Check to see whether a cookie exists or not.\n * @param {String} key - The cookie name.\n * @returns {Boolean}\n */\n exists(key) {\n return Object.hasOwn(this.all, key);\n }\n\n /**\n * Check to see whether a cookie has a particular value.\n * @param {String} key - The cookie name.\n * @param {String|Number|Boolean} value - The value to check against.\n * @returns\n */\n hasValue(key, value) {\n return this.get(key) == value;\n }\n\n /**\n * Get a cookie.\n * @param {String} key - The cookie name.\n * @returns {String|Number|Boolean}\n */\n get(key) {\n return this.exists(key) ? decodeURIComponent(this.all[key]) : null;\n }\n\n /**\n * Set a cookie.\n * @param {String} key - The cookie name.\n * @param {String|Number|Boolean} value - The cookie value.\n * @param {Object} options\n * @param {Number} [options.maxAge=31536000] - The maximum age of the cookie in seconds.\n * @param {String} [options.path=/] - The path to register the cookie for.\n * @param {String} [options.sameSite=Lax] - The sameSite attribute.\n * @param {String} [options.domain=this.domain] - The domain to register the cookie with.\n * @param {String} [options.path=this.path] - The path to register the cookie with.\n * @param {String} [options.secure=this.secure] - Only set cookie in HTTPS environments.\n */\n set(key, value, options = {}) {\n const {\n maxAge = 60 * 60 * 24 * 365,\n sameSite = \"Lax\",\n domain = this.domain,\n path = this.path,\n secure = this.secure,\n } = options;\n if (!key) {\n return;\n }\n const cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)};${\n domain ? ` domain=${domain}; ` : \"\"\n } samesite=${sameSite}; path=${path}; max-age=${maxAge}${\n secure ? \"; secure\" : \"\"\n }`;\n document.cookie = cookie;\n this.events.trigger(\"setCookie\", {\n key,\n value,\n maxAge,\n path,\n sameSite,\n domain,\n secure,\n cookie,\n });\n }\n\n /**\n * Delete a cookie.\n * @param {String} key - The cookie name.\n * @param {String} [path=/] - The path to the cookie is registered on.\n */\n delete(key, path = \"/\", domain = null) {\n const options = { maxAge: -1, path, domain: domain || undefined };\n this.set(key, \"\", options);\n this.events.trigger(\"deleteCookie\", { key, ...options });\n }\n\n /**\n * Delete all cookies.\n */\n deleteAll(path = \"/\", domain = null) {\n Object.keys(this.all).forEach((cookie) => {\n this.delete(cookie, path, domain);\n });\n this.events.trigger(\"deleteAllCookies\", { path, domain });\n }\n\n /**\n * Accept a policy.\n * @param {String} policy - The name of the policy.\n */\n acceptPolicy(policy) {\n this.setPolicy(policy, true);\n this.events.trigger(\"acceptPolicy\", policy);\n this.events.trigger(\"changePolicy\", { [policy]: true });\n }\n\n /**\n * Reject a policy.\n * @param {String} policy - The name of the policy.\n */\n rejectPolicy(policy) {\n this.setPolicy(policy, false);\n this.events.trigger(\"rejectPolicy\", policy);\n this.events.trigger(\"changePolicy\", { [policy]: false });\n }\n\n /**\n * Set a policy.\n * @param {String} policy - The name of the policy.\n * @param {Boolean} accepted - Whether the policy is accepted or not.\n */\n setPolicy(policy, accepted) {\n if (policy === \"essential\") {\n return;\n }\n this.savePolicies({\n ...this.policies,\n [policy]: accepted,\n essential: true,\n });\n this.events.trigger(\"changePolicy\", { [policy]: accepted });\n }\n\n /**\n * Accept all the cookie policies.\n */\n acceptAllPolicies() {\n const allPolicies = Object.fromEntries(\n Object.keys(this.policies).map((k) => [k.toLowerCase(), true]),\n );\n this.savePolicies(allPolicies);\n this.events.trigger(\"acceptAllPolicies\");\n this.events.trigger(\"changePolicy\", allPolicies);\n }\n\n /**\n * Reject all the cookie policies.\n */\n rejectAllPolicies() {\n const allPolicies = {\n ...Object.fromEntries(\n Object.keys(this.policies).map((k) => [k.toLowerCase(), false]),\n ),\n essential: true,\n };\n this.savePolicies(allPolicies);\n this.events.trigger(\"rejectAllPolicies\");\n this.events.trigger(\"changePolicy\", allPolicies);\n }\n\n /**\n * Commit policy preferences to the browser.\n * @param {object} policies - The policies to commit.\n */\n savePolicies(policies) {\n this.set(this.policiesKey, JSON.stringify(policies));\n }\n\n /**\n * Get the acceptance status of a policy.\n * @param {String} policy - The name of the policy.\n * @returns {Boolean}\n */\n isPolicyAccepted(policy) {\n return Object.hasOwn(this.policies, policy)\n ? this.policies[policy] === true\n : null;\n }\n\n /**\n * Add an event listener.\n * @param {String} event - The event to add a listener for.\n * @param {Function} callback - The callback function to call when the event is triggered.\n */\n on(event, callback) {\n this.events.on(event, callback);\n }\n\n /**\n * Add a one-time event listener.\n * @param {String} event - The event to add a listener for.\n * @param {Function} callback - The callback function to call when the event is triggered.\n */\n once(event, callback) {\n this.events.once(event, callback);\n }\n}\n","const getXPathTo = ($element) => {\n if ($element.id !== \"\") {\n return 'id(\"' + $element.id + '\")';\n }\n if ($element === document.body) {\n return $element.tagName;\n }\n let ix = 0;\n const siblings = $element.parentNode.childNodes;\n for (let i = 0; i < siblings.length; i++) {\n const sibling = siblings[i];\n if (sibling === $element)\n return (\n getXPathTo($element.parentNode) +\n \"/\" +\n $element.tagName +\n \"[\" +\n (ix + 1) +\n \"]\"\n );\n if (sibling.nodeType === 1 && sibling.tagName === $element.tagName) ix++;\n }\n};\n\nconst includesAny = (arr, values) => values.some((v) => arr.includes(v));\n\nconst getClosestHeading = ($element) => {\n let heading = \"\";\n let $search = $element;\n do {\n while ($search.previousElementSibling) {\n $search = $search.previousElementSibling;\n if (\n [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"].includes($search.tagName) ||\n ($search.classList.length &&\n includesAny(Array.from($search.classList), [\n \"tna-heading-xl\",\n \"tna-heading-l\",\n \"tna-heading-m\",\n \"tna-heading-s\",\n ]))\n ) {\n heading = $search.innerText;\n break;\n }\n }\n $search = $search.parentElement;\n } while ($search.parentElement && !heading);\n return heading;\n};\n\nconst valueGetters = {\n text: ($el) => $el.innerText,\n html: ($el) => $el.innerHTML,\n value: ($el) => $el.value,\n index: ($el, $scope, event, index) => index,\n checked: ($el) => ($el.checked ? \"checked\" : \"unchecked\"),\n expanded: ($el) => {\n const expanded = $el.getAttribute(\"aria-expanded\");\n if (expanded === null) {\n return null;\n }\n return expanded.toString() === \"true\" ? \"opened\" : \"closed\";\n },\n closestHeading: ($el) => getClosestHeading($el),\n};\n\nexport { getXPathTo, getClosestHeading, valueGetters };\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-breadcrumbs\",\n areaName: \"breadcrumbs\",\n events: [\n {\n eventName: \"click\",\n targetElement:\n \".tna-breadcrumbs__item--expandable button.tna-breadcrumbs__link\",\n on: \"click\",\n data: { state: \"expand\", value: valueGetters.html },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-checkboxes\",\n areaName: \"checkboxes\",\n events: [\n {\n eventName: \"toggle\",\n targetElement: \".tna-checkboxes__item input\",\n on: \"change\",\n data: {\n state: valueGetters.checked,\n // eslint-disable-next-line no-unused-vars\n value: ($el, $scope, event) => $el.parentNode.innerText,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope\n .closest(\".tna-form__group\")\n ?.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-footer\",\n areaName: \"footer\",\n rootEventName: \"global_navigation\",\n events: [\n {\n eventName: \"link.click\",\n targetElement: \".tna-footer__navigation-block-item-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Link\",\n data_section: valueGetters.closestHeading,\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"social_link.click\",\n targetElement: \".tna-footer__social-item-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Icon\",\n data_section: \"Social media\",\n data_link: ($el) => $el.getAttribute(\"data-name\"),\n },\n },\n {\n eventName: \"legal_link.click\",\n targetElement: \".tna-footer__legal-item-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Link\",\n data_section: \"Legal information\",\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"mailing_list.click\",\n targetElement: \".tna-footer__mailing-list a.tna-button\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Button\",\n data_section: \"Mailing list\",\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"ogl.click\",\n targetElement: \".tna-footer__licence p a.tna-footer__link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Link\",\n data_section: \"OGL\",\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"govuk.click\",\n targetElement: \".tna-footer__govuk-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Logo\",\n data_section: \"GOV.UK\",\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"theme.change\",\n targetElement: \".tna-footer__theme-selector-button\",\n on: \"click\",\n data: {\n value: valueGetters.value,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-global-header\",\n areaName: \"header\",\n rootEventName: \"global_navigation\",\n events: [\n {\n eventName: \"toggle\",\n targetElement: \".tna-global-header__navigation-button\",\n on: \"click\",\n data: {\n state: valueGetters.expanded,\n },\n rootData: {\n data_component_name: \"Header\",\n data_link_type: \"Mobile menu\",\n data_link: ($el) => {\n const expanded = $el.getAttribute(\"aria-expanded\");\n if (expanded === null) {\n return null;\n }\n return expanded.toString() === \"true\" ? \"Open menu\" : \"Close menu\";\n },\n data_section: \"Burger menu\",\n },\n },\n {\n eventName: \"logo.click\",\n targetElement: \".tna-global-header__logo\",\n on: \"click\",\n rootData: {\n data_component_name: \"Header\",\n data_link_type: \"Logo\",\n data_link: \"The National Archives\",\n data_section: \"Top navigation and logo\",\n },\n },\n {\n eventName: \"primary_link.click\",\n targetElement: \".tna-global-header__navigation-item-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Header\",\n data_link_type: \"Menu\",\n data_section: valueGetters.text,\n data_position: 1,\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"secondary_link.click\",\n targetElement: \".tna-global-header__top-navigation-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Header\",\n data_link_type: \"Icon\",\n data_link: valueGetters.text,\n data_section: \"Top navigation and logo\",\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-header\",\n areaName: \"header\",\n events: [\n {\n eventName: \"toggle\",\n targetElement: \".tna-header__navigation-toggle-button\",\n on: \"click\",\n data: {\n state: valueGetters.expanded,\n },\n },\n ],\n },\n];\n","import {\n getClosestHeading,\n valueGetters,\n} from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-picture\",\n areaName: \"picture\",\n events: [\n {\n eventName: \"toggle_transcript\",\n targetElement: \".tna-picture__toggle-transcript\",\n on: \"click\",\n data: {\n state: valueGetters.expanded,\n // eslint-disable-next-line no-unused-vars\n value: ($el, $scope, event) => {\n const heading = getClosestHeading($scope);\n const image = $scope.querySelector(\".tna-picture__image\");\n const imageSrc = image.getAttribute(\"src\");\n const imageAlt = image.getAttribute(\"alt\");\n const value = `${imageAlt} (${imageSrc})`;\n return heading ? `${heading} > ${value}` : value;\n },\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-radios\",\n areaName: \"radios\",\n events: [\n {\n eventName: \"toggle\",\n targetElement: \".tna-radios__item input\",\n on: \"change\",\n data: {\n state: valueGetters.checked,\n // eslint-disable-next-line no-unused-vars\n value: ($el, $scope, event) => $el.parentNode.innerText,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope\n .closest(\".tna-form__group\")\n ?.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-search-field\",\n areaName: \"search-field\",\n events: [\n {\n eventName: \"blurred\",\n targetElement: \".tna-search-field__input\",\n on: \"blur\",\n data: {\n // eslint-disable-next-line no-unused-vars\n value: valueGetters.value,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-text-input\",\n areaName: \"text-input\",\n events: [\n {\n eventName: \"blurred\",\n on: \"blur\",\n data: {\n // eslint-disable-next-line no-unused-vars\n value: valueGetters.value,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope\n .closest(\".tna-form__group\")\n ?.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-textarea\",\n areaName: \"textarea\",\n events: [\n {\n eventName: \"blurred\",\n on: \"blur\",\n data: {\n // eslint-disable-next-line no-unused-vars\n value: valueGetters.value,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope\n .closest(\".tna-form__group\")\n ?.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import Cookies from \"./lib/cookies.mjs\";\nimport {\n getXPathTo,\n getClosestHeading,\n valueGetters,\n} from \"./lib/analytics-helpers.mjs\";\nimport BreadcrumbAnalytics from \"./components/breadcrumbs/analytics.js\";\nimport CheckboxesAnalytics from \"./components/checkboxes/analytics.js\";\nimport FooterAnalytics from \"./components/footer/analytics.js\";\nimport GlobalHeaderAnalytics from \"./components/global-header/analytics.js\";\nimport HeaderAnalytics from \"./components/header/analytics.js\";\nimport HeroAnalytics from \"./components/hero/analytics.js\";\nimport PictureAnalytics from \"./components/picture/analytics.js\";\nimport RadiosAnalytics from \"./components/radios/analytics.js\";\nimport SearchFieldAnalytics from \"./components/search-field/analytics.js\";\nimport TextInputAnalytics from \"./components/text-input/analytics.js\";\nimport TextareaAnalytics from \"./components/textarea/analytics.js\";\n\nconst componentAnalytics = [\n ...BreadcrumbAnalytics,\n ...CheckboxesAnalytics,\n ...FooterAnalytics,\n ...GlobalHeaderAnalytics,\n ...HeaderAnalytics,\n ...HeroAnalytics,\n ...PictureAnalytics,\n ...RadiosAnalytics,\n ...SearchFieldAnalytics,\n ...TextInputAnalytics,\n ...TextareaAnalytics,\n];\n\nclass EventTracker {\n /** @protected */\n cookies = new (window.TNAFrontend?.Cookies || Cookies)();\n\n /** @protected */\n events = [];\n\n /** @protected */\n startTime = new Date();\n\n /** @protected */\n prefix = \"tna\";\n\n /** @protected */\n addTrackingCode = true;\n\n constructor(options = {}) {\n const { prefix = null, addTrackingCode = true } = options;\n if (prefix) {\n this.prefix = prefix;\n }\n this.addTrackingCode = addTrackingCode;\n }\n\n start(initAll) {\n if (!navigator.doNotTrack || navigator.doNotTrack !== 1) {\n if (this.cookies.isPolicyAccepted(\"usage\")) {\n this.enableTracking();\n }\n this.cookies.on(\"changePolicy\", (policies) => {\n if (Object.hasOwn(policies, \"usage\")) {\n if (policies[\"usage\"]) {\n this.enableTracking();\n } else {\n this.disableTracking();\n }\n }\n });\n if (initAll) {\n this.initAll();\n }\n }\n }\n\n enableTracking() {}\n\n disableTracking() {}\n\n /**\n * Initialise all TNA Frontend component analytics.\n */\n initAll() {\n componentAnalytics.forEach((componentConfig) => {\n this.addListeners(\n componentConfig.scope,\n componentConfig.areaName,\n componentConfig.events,\n componentConfig.rootEventName || \"\",\n );\n });\n }\n\n /**\n * Add an event listener.\n * @param {String|HTMLElement} scope - The element to which the listener is scoped.\n * @param {String} areaName - The name of the component to pass on to the tracker.\n * @param {{eventName: String, targetElement: String|undefined, on: String, data: {value: Function|String|undefined, state: Function|String|undefined, group: Function|String|undefined, [String]: String|Integer}, rootData:{[String]: Function|String}}[]} events - The configuration of events to track along with their optional value and state which can be computed.\n * @param {String} rootEventName - The event name to use if specified (prefix).\n */\n addListeners(scope, areaName, events, rootEventName = \"\") {\n let scopeArray;\n if (typeof scope === \"string\") {\n scopeArray = Array.from(document.querySelectorAll(scope));\n } else if (typeof scope === \"object\") {\n scopeArray = [scope];\n }\n if (!scopeArray) {\n return;\n }\n scopeArray.forEach(($scope) => {\n events.forEach((eventConfig) => {\n if (!eventConfig.on) {\n return;\n }\n if (eventConfig.targetElement) {\n Array.from(\n $scope.querySelectorAll(eventConfig.targetElement),\n ).forEach(($el, index) =>\n this.attachListener(\n $el,\n $scope,\n rootEventName,\n eventConfig,\n scope,\n areaName,\n index + 1,\n ),\n );\n } else {\n this.attachListener(\n $scope,\n $scope,\n rootEventName,\n eventConfig,\n scope,\n areaName,\n 1,\n );\n }\n });\n });\n }\n\n /** @protected */\n generateEventName(areaName, eventConfig) {\n return `${this.prefix}.${areaName}.${eventConfig.eventName || eventConfig.on}`;\n }\n\n /** @protected */\n attachListener(\n $el,\n $scope,\n rootEventName,\n eventConfig,\n scope,\n areaName,\n index,\n ) {\n const { on, data, targetElement, rootData = {} } = eventConfig;\n $el.addEventListener(on, (event) =>\n this.recordEvent(\n rootEventName\n ? `${this.prefix}.${rootEventName}`\n : this.generateEventName(areaName, eventConfig),\n {\n ...data,\n name: this.generateEventName(areaName, eventConfig),\n value: data?.value\n ? this.computedValue(data.value, $el, $scope, event, index)\n : null,\n state: data?.state\n ? this.computedValue(data.state, $el, $scope, event, index)\n : null,\n group: data?.group\n ? this.computedValue(data.group, $el, $scope, event, index)\n : null,\n xPath: getXPathTo($el),\n targetElement: targetElement,\n timeSincePageLoad: new Date() - this.startTime,\n index,\n scope,\n areaName,\n },\n Object.fromEntries(\n Object.entries(rootData).map(([key, value]) => [\n key,\n this.computedValue(value, $el, $scope, event, index),\n ]),\n ),\n ),\n );\n }\n\n /** @protected */\n computedValue(value, $el, $scope, event, index) {\n return typeof value === \"function\"\n ? value.call(this, $el, $scope, event, index)\n : value ?? null;\n }\n\n /** @protected */\n recordEvent(eventName, data, rootData = {}) {\n this.events.push({\n event: eventName,\n [`${this.prefix}.event`]: data,\n ...rootData,\n });\n }\n\n /** @protected */\n getTnaMetaTags() {\n return Object.fromEntries(\n Array.from(\n document.head.querySelectorAll(\n `meta[name^='${this.prefix}.'][content]`,\n ),\n ).map(($metaEl) => [\n $metaEl.getAttribute(\"name\"),\n $metaEl.getAttribute(\"content\"),\n ]),\n );\n }\n}\n\n/**\n * Class to handle Google Analytics 4 reporting.\n * @class GA4\n * @extends EventTracker\n * @constructor\n * @public\n */\nclass GA4 extends EventTracker {\n /** @protected */\n trackingCodeAdded = false;\n\n /** @protected */\n trackingEnabled = false;\n\n /** @protected */\n gTagId;\n\n constructor(options = {}) {\n if (window.TNAFrontendAnalytics) {\n return window.TNAFrontendAnalytics;\n }\n const {\n id = \"\",\n prefix = null,\n initAll = true,\n addTrackingCode = true,\n } = options;\n super({ prefix, addTrackingCode });\n window.TNAFrontendAnalytics = this;\n this.gTagId = id;\n this.ga4Disable = `ga-disable-${this.gTagId}`;\n window.dataLayer = window.dataLayer || [];\n if (!this.cookies.isPolicyAccepted(\"usage\")) {\n window[this.ga4Disable] = true;\n this.cookies.set(this.ga4Disable, \"true\");\n }\n this.start(initAll);\n }\n\n destroy() {\n window.TNAFrontendAnalytics = null;\n }\n\n /** @protected */\n recordEvent(eventName, data, rootData = {}) {\n const ga4Data = {\n event: eventName,\n ...Object.fromEntries(\n Object.entries(data).map(([key, value]) => [\n `${this.prefix}.event.${key}`,\n value,\n ]),\n ),\n ...rootData,\n };\n this.pushToDataLayer(ga4Data);\n }\n\n /** @protected */\n gtag() {\n this.pushToDataLayer(arguments);\n }\n\n /** @protected */\n pushToDataLayer(data) {\n window.dataLayer.push(data);\n }\n\n /** @protected */\n enableTracking() {\n if (!this.trackingEnabled) {\n window[this.ga4Disable] = false;\n this.cookies.set(this.ga4Disable, \"false\");\n if (!this.trackingCodeAdded && this.addTrackingCode) {\n if (!this.gTagId) {\n throw Error(\"ID was not specified\");\n }\n this.pushToDataLayer({\n \"gtm.start\": new Date().getTime(),\n event: \"gtm.js\",\n });\n const firstScript = document.getElementsByTagName(\"script\")[0];\n const script = document.createElement(\"script\");\n script.async = true;\n script.src = `https://www.googletagmanager.com/gtm.js?id=${this.gTagId}&l=dataLayer`;\n if (firstScript) {\n firstScript.parentNode.insertBefore(script, firstScript);\n } else {\n document.head.appendChild(script);\n }\n this.trackingCodeAdded = true;\n const tnaMetaTags = this.getTnaMetaTags();\n if (Object.keys(tnaMetaTags).length) {\n this.pushToDataLayer(tnaMetaTags);\n }\n }\n this.trackingEnabled = true;\n }\n }\n\n /** @protected */\n disableTracking() {\n if (this.trackingEnabled) {\n window[this.ga4Disable] = true;\n this.cookies.set(this.ga4Disable, \"true\");\n Object.keys(this.cookies.all).forEach((key) => {\n if (key.startsWith(\"_ga\")) {\n this.cookies.delete(key);\n }\n });\n this.trackingEnabled = false;\n // window.location.reload();\n }\n }\n}\n\nconst helpers = { getXPathTo, getClosestHeading, valueGetters };\n\nexport { EventTracker, GA4, helpers };\n","export default [\n {\n scope: \".tna-hero\",\n areaName: \"hero\",\n events: [\n {\n eventName: \"toggle_caption\",\n targetElement: \".tna-hero__details-summary\",\n on: \"click\",\n data: {\n // eslint-disable-next-line no-unused-vars\n state: ($el, $scope, event) => {\n const wasExpanded =\n $scope\n .querySelector(\".tna-hero__details\")\n ?.hasAttribute(\"open\") ?? false;\n return wasExpanded ? \"closed\" : \"opened\";\n },\n // eslint-disable-next-line no-unused-vars\n value: ($el, $scope, event) =>\n $scope.querySelector(\"img[alt]\")?.getAttribute(\"alt\"),\n },\n },\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","window","TNAFrontendCookies","TNAFrontendCookieEvents","CookieEventHandler","_createClass","_classCallCheck","_defineProperty","this","event","callback","hasOwn","events","concat","_toConsumableArray","oneTimeEvents","_this","data","arguments","length","undefined","forEach","eventToTrigger","i","splice","Cookies","options","_options$extraPolicie","extraPolicies","_options$domain","domain","_options$path","path","_options$secure","secure","_options$policiesKey","policiesKey","_options$newInstance","newInstance","destroyInstance","init","savePolicies","_objectSpread","fromEntries","map","k","toLowerCase","usage","settings","policies","essential","deserialised","document","cookie","split","filter","x","parts","trim","JSON","parse","e","all","exists","decodeURIComponent","_options$maxAge","maxAge","_options$sameSite","sameSite","_options$domain2","_options$path2","_options$secure2","encodeURIComponent","trigger","set","_this2","keys","policy","setPolicy","accepted","allPolicies","stringify","on","once","getXPathTo","$element","id","body","tagName","ix","siblings","parentNode","childNodes","sibling","nodeType","includesAny","arr","values","some","v","includes","getClosestHeading","heading","$search","previousElementSibling","classList","Array","from","innerText","parentElement","valueGetters","text","$el","html","innerHTML","index","$scope","checked","expanded","getAttribute","toString","closestHeading","scope","areaName","eventName","targetElement","state","group","_$scope$closest","closest","querySelector","rootEventName","rootData","data_component_name","data_link_type","data_section","data_link","data_position","image","imageSrc","imageAlt","_$scope$querySelector","componentAnalytics","CheckboxesAnalytics","FooterAnalytics","GlobalHeaderAnalytics","HeaderAnalytics","_$scope$querySelector2","hasAttribute","_$scope$querySelector3","PictureAnalytics","RadiosAnalytics","SearchFieldAnalytics","TextInputAnalytics","TextareaAnalytics","EventTracker","_window$TNAFrontend","TNAFrontend","Date","_options$prefix","prefix","_options$addTrackingC","addTrackingCode","initAll","navigator","doNotTrack","cookies","isPolicyAccepted","enableTracking","disableTracking","componentConfig","addListeners","scopeArray","_this3","querySelectorAll","_typeof","eventConfig","attachListener","_this4","_eventConfig$rootData","addEventListener","recordEvent","generateEventName","name","computedValue","xPath","timeSincePageLoad","startTime","entries","_ref","_ref2","_slicedToArray","push","head","$metaEl","GA4","_EventTracker2","_this5","TNAFrontendAnalytics","_possibleConstructorReturn","_options$id","_options$prefix2","_options$initAll","_options$addTrackingC2","_callSuper","gTagId","ga4Disable","dataLayer","start","_inherits","_this6","ga4Data","_ref3","_ref4","pushToDataLayer","trackingEnabled","trackingCodeAdded","Error","getTime","firstScript","getElementsByTagName","script","createElement","async","src","insertBefore","appendChild","tnaMetaTags","getTnaMetaTags","_this7","startsWith","helpers"],"sourceRoot":""}
1
+ {"version":3,"file":"analytics.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAA8B,qBAAID,IAElCD,EAA2B,qBAAIC,GAChC,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,s0ECL9DC,OA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AahN,QAC3BX,KAAK8M,gBAAgBa,EAEzB,CACA3N,KAAK+M,iBAAkB,CACzB,CACF,GAEA,CAAApO,IAAA,kBAAAa,MACA,WAAkB,IAAAqO,EAAA,KACZ7N,KAAK+M,kBACPtN,OAAOO,KAAKsM,aAAc,EAC1BtM,KAAK8J,QAAQ5F,IAAIlE,KAAKsM,WAAY,QAClCzN,OAAOuF,KAAKpE,KAAK8J,QAAQxG,KAAKzC,SAAQ,SAAClC,GACjCA,EAAImP,WAAW,QACjBD,EAAK/D,QAAO,OAAQnL,EAExB,IACAqB,KAAK+M,iBAAkB,EAG3B,IAAC,CA1GM,CAAS5D,GA6GZ4E,EAAU,CAAEnJ,WAAAA,EAAYiB,kBAAAA,EAAmBS,aAAAA,G","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/lib/cookies.mjs","webpack://TNAFrontend/./src/nationalarchives/lib/analytics-helpers.mjs","webpack://TNAFrontend/./src/nationalarchives/components/breadcrumbs/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/checkboxes/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/footer/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/global-header/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/header/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/picture/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/radios/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/search-field/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/text-input/analytics.js","webpack://TNAFrontend/./src/nationalarchives/components/textarea/analytics.js","webpack://TNAFrontend/./src/nationalarchives/analytics.mjs","webpack://TNAFrontend/./src/nationalarchives/components/hero/analytics.js"],"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([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontendAnalytics\"] = factory();\n\telse\n\t\troot[\"TNAFrontendAnalytics\"] = 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};","window.TNAFrontendCookies = window.TNAFrontendCookies || null;\nwindow.TNAFrontendCookieEvents = window.TNAFrontendCookieEvents || null;\n\nexport class CookieEventHandler {\n events = {};\n oneTimeEvents = {};\n\n constructor() {\n if (window.TNAFrontendCookieEvents) {\n return window.TNAFrontendCookieEvents;\n }\n window.TNAFrontendCookieEvents = this;\n }\n\n /**\n * Add an event listener.\n * @param {String} event - The event to add a listener for.\n * @param {Function} callback - The callback function to call when the event is triggered.\n */\n on(event, callback) {\n if (!Object.hasOwn(this.events, event)) {\n this.events[event] = [];\n }\n this.events[event] = [...this.events[event], callback];\n }\n\n once(event, callback) {\n if (!Object.hasOwn(this.oneTimeEvents, event)) {\n this.oneTimeEvents[event] = [];\n }\n this.oneTimeEvents[event] = [...this.oneTimeEvents[event], callback];\n }\n\n /** @protected */\n trigger(event, data = {}) {\n if (Object.hasOwn(this.events, event)) {\n this.events[event].forEach((eventToTrigger) =>\n eventToTrigger.call(this, data),\n );\n }\n if (Object.hasOwn(this.oneTimeEvents, event)) {\n for (let i = this.oneTimeEvents[event].length - 1; i >= 0; i--) {\n const eventToTrigger = this.oneTimeEvents[event][i];\n eventToTrigger.call(this, data);\n this.oneTimeEvents[event].splice(i, 1);\n }\n }\n }\n}\n\n/**\n * Class to handle cookies.\n * @class Cookies\n * @constructor\n * @public\n */\nexport default class Cookies {\n /** @protected */\n extraPolicies = [];\n /** @protected */\n domain = \"\";\n /** @protected */\n path = \"\";\n /** @protected */\n secure = true;\n /** @protected */\n policiesKey = \"\";\n /** @protected */\n events = null;\n\n /**\n * Create a cookie handler.\n * @param {String} [options.extraPolicies=[]] - The extra cookie policies to manage in addition to essential, settings and usage.\n * @param {String} [options.domain=\"\"] - The domain to register the cookie with.\n * @param {String} [options.path=\"\"] - The domain to register the cookie with.\n * @param {String} [options.secure=true] - Only set cookie in HTTPS environments.\n * @param {String} [options.policiesKey=\"cookies_policy\"] - The name of the cookie.\n * @param {String} [options.newInstance=false] - Create a fresh instance of the cookie class.\n */\n constructor(options = {}) {\n const {\n extraPolicies = [],\n domain = \"\",\n path = \"/\",\n secure = true,\n policiesKey = \"cookies_policy\",\n newInstance = false,\n } = options;\n if (newInstance) {\n this.destroyInstance();\n } else if (window.TNAFrontendCookies) {\n return window.TNAFrontendCookies;\n }\n this.extraPolicies = extraPolicies;\n this.domain = domain;\n this.path = path;\n this.secure = secure;\n this.policiesKey = policiesKey;\n this.events = new CookieEventHandler();\n this.init();\n window.TNAFrontendCookies = this;\n }\n\n /** @protected */\n init() {\n this.savePolicies({\n ...Object.fromEntries(\n this.extraPolicies.map((k) => [k.toLowerCase(), false]),\n ),\n usage: false,\n settings: false,\n ...this.policies,\n essential: true,\n });\n }\n\n destroyInstance() {\n window.TNAFrontendCookies = null;\n }\n\n /** @protected */\n get all() {\n const deserialised = {};\n document.cookie\n .split(\"; \")\n .filter((x) => x)\n .forEach((cookie) => {\n const parts = cookie.trim().split(\"=\");\n if (parts[0]) {\n deserialised[parts[0]] = parts[1];\n }\n });\n return deserialised;\n }\n\n /** @protected */\n get policies() {\n try {\n return JSON.parse(this.get(this.policiesKey) || \"{}\");\n } catch (e) {\n return {};\n }\n }\n\n /**\n * Check to see whether a cookie exists or not.\n * @param {String} key - The cookie name.\n * @returns {Boolean}\n */\n exists(key) {\n return Object.hasOwn(this.all, key);\n }\n\n /**\n * Check to see whether a cookie has a particular value.\n * @param {String} key - The cookie name.\n * @param {String|Number|Boolean} value - The value to check against.\n * @returns\n */\n hasValue(key, value) {\n return this.get(key) == value;\n }\n\n /**\n * Get a cookie.\n * @param {String} key - The cookie name.\n * @returns {String|Number|Boolean}\n */\n get(key) {\n return this.exists(key) ? decodeURIComponent(this.all[key]) : null;\n }\n\n /**\n * Set a cookie.\n * @param {String} key - The cookie name.\n * @param {String|Number|Boolean} value - The cookie value.\n * @param {Object} options\n * @param {Number} [options.maxAge=31536000] - The maximum age of the cookie in seconds.\n * @param {String} [options.path=/] - The path to register the cookie for.\n * @param {String} [options.sameSite=Lax] - The sameSite attribute.\n * @param {String} [options.domain=this.domain] - The domain to register the cookie with.\n * @param {String} [options.path=this.path] - The path to register the cookie with.\n * @param {String} [options.secure=this.secure] - Only set cookie in HTTPS environments.\n */\n set(key, value, options = {}) {\n const {\n maxAge = 60 * 60 * 24 * 365,\n sameSite = \"Lax\",\n domain = this.domain,\n path = this.path,\n secure = this.secure,\n } = options;\n if (!key) {\n return;\n }\n const cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)};${\n domain ? ` domain=${domain}; ` : \"\"\n } samesite=${sameSite}; path=${path}; max-age=${maxAge}${\n secure ? \"; secure\" : \"\"\n }`;\n document.cookie = cookie;\n this.events.trigger(\"setCookie\", {\n key,\n value,\n maxAge,\n path,\n sameSite,\n domain,\n secure,\n cookie,\n });\n }\n\n /**\n * Delete a cookie.\n * @param {String} key - The cookie name.\n * @param {String} [path=/] - The path to the cookie is registered on.\n */\n delete(key, path = \"/\", domain = null) {\n const options = { maxAge: -1, path, domain: domain || undefined };\n this.set(key, \"\", options);\n this.events.trigger(\"deleteCookie\", { key, ...options });\n }\n\n /**\n * Delete all cookies.\n */\n deleteAll(path = \"/\", domain = null) {\n Object.keys(this.all).forEach((cookie) => {\n this.delete(cookie, path, domain);\n });\n this.events.trigger(\"deleteAllCookies\", { path, domain });\n }\n\n /**\n * Accept a policy.\n * @param {String} policy - The name of the policy.\n */\n acceptPolicy(policy) {\n this.setPolicy(policy, true);\n this.events.trigger(\"acceptPolicy\", policy);\n this.events.trigger(\"changePolicy\", { [policy]: true });\n }\n\n /**\n * Reject a policy.\n * @param {String} policy - The name of the policy.\n */\n rejectPolicy(policy) {\n this.setPolicy(policy, false);\n this.events.trigger(\"rejectPolicy\", policy);\n this.events.trigger(\"changePolicy\", { [policy]: false });\n }\n\n /**\n * Set a policy.\n * @param {String} policy - The name of the policy.\n * @param {Boolean} accepted - Whether the policy is accepted or not.\n */\n setPolicy(policy, accepted) {\n if (policy === \"essential\") {\n return;\n }\n this.savePolicies({\n ...this.policies,\n [policy]: accepted,\n essential: true,\n });\n this.events.trigger(\"changePolicy\", { [policy]: accepted });\n }\n\n /**\n * Accept all the cookie policies.\n */\n acceptAllPolicies() {\n const allPolicies = Object.fromEntries(\n Object.keys(this.policies).map((k) => [k.toLowerCase(), true]),\n );\n this.savePolicies(allPolicies);\n this.events.trigger(\"acceptAllPolicies\");\n this.events.trigger(\"changePolicy\", allPolicies);\n }\n\n /**\n * Reject all the cookie policies.\n */\n rejectAllPolicies() {\n const allPolicies = {\n ...Object.fromEntries(\n Object.keys(this.policies).map((k) => [k.toLowerCase(), false]),\n ),\n essential: true,\n };\n this.savePolicies(allPolicies);\n this.events.trigger(\"rejectAllPolicies\");\n this.events.trigger(\"changePolicy\", allPolicies);\n }\n\n /**\n * Commit policy preferences to the browser.\n * @param {object} policies - The policies to commit.\n */\n savePolicies(policies) {\n this.set(this.policiesKey, JSON.stringify(policies));\n }\n\n /**\n * Get the acceptance status of a policy.\n * @param {String} policy - The name of the policy.\n * @returns {Boolean}\n */\n isPolicyAccepted(policy) {\n return Object.hasOwn(this.policies, policy)\n ? this.policies[policy] === true\n : null;\n }\n\n /**\n * Add an event listener.\n * @param {String} event - The event to add a listener for.\n * @param {Function} callback - The callback function to call when the event is triggered.\n */\n on(event, callback) {\n this.events.on(event, callback);\n }\n\n /**\n * Add a one-time event listener.\n * @param {String} event - The event to add a listener for.\n * @param {Function} callback - The callback function to call when the event is triggered.\n */\n once(event, callback) {\n this.events.once(event, callback);\n }\n}\n","const getXPathTo = ($element) => {\n if ($element.id !== \"\") {\n return 'id(\"' + $element.id + '\")';\n }\n if ($element === document.body) {\n return $element.tagName;\n }\n let ix = 0;\n const siblings = $element.parentNode.childNodes;\n for (let i = 0; i < siblings.length; i++) {\n const sibling = siblings[i];\n if (sibling === $element)\n return (\n getXPathTo($element.parentNode) +\n \"/\" +\n $element.tagName +\n \"[\" +\n (ix + 1) +\n \"]\"\n );\n if (sibling.nodeType === 1 && sibling.tagName === $element.tagName) ix++;\n }\n};\n\nconst includesAny = (arr, values) => values.some((v) => arr.includes(v));\n\nconst getClosestHeading = ($element) => {\n let heading = \"\";\n let $search = $element;\n do {\n while ($search.previousElementSibling) {\n $search = $search.previousElementSibling;\n if (\n [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"].includes($search.tagName) ||\n ($search.classList.length &&\n includesAny(Array.from($search.classList), [\n \"tna-heading-xl\",\n \"tna-heading-l\",\n \"tna-heading-m\",\n \"tna-heading-s\",\n ]))\n ) {\n heading = $search.innerText;\n break;\n }\n }\n $search = $search.parentElement;\n } while ($search.parentElement && !heading);\n return heading;\n};\n\nconst valueGetters = {\n text: ($el) => $el.innerText,\n html: ($el) => $el.innerHTML,\n value: ($el) => $el.value,\n index: ($el, $scope, event, index) => index,\n checked: ($el) => ($el.checked ? \"checked\" : \"unchecked\"),\n expanded: ($el) => {\n const expanded = $el.getAttribute(\"aria-expanded\");\n if (expanded === null) {\n return null;\n }\n return expanded.toString() === \"true\" ? \"opened\" : \"closed\";\n },\n closestHeading: ($el) => getClosestHeading($el),\n};\n\nexport { getXPathTo, getClosestHeading, valueGetters };\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-breadcrumbs\",\n areaName: \"breadcrumbs\",\n events: [\n {\n eventName: \"click\",\n targetElement:\n \".tna-breadcrumbs__item--expandable button.tna-breadcrumbs__link\",\n on: \"click\",\n data: { state: \"expand\", value: valueGetters.html },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-checkboxes\",\n areaName: \"checkboxes\",\n events: [\n {\n eventName: \"toggle\",\n targetElement: \".tna-checkboxes__item input\",\n on: \"change\",\n data: {\n state: valueGetters.checked,\n // eslint-disable-next-line no-unused-vars\n value: ($el, $scope, event) => $el.parentNode.innerText,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope\n .closest(\".tna-form__group\")\n ?.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-footer\",\n areaName: \"footer\",\n rootEventName: \"global_navigation\",\n events: [\n {\n eventName: \"link.click\",\n targetElement: \".tna-footer__navigation-block-item-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Link\",\n data_section: valueGetters.closestHeading,\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"social_link.click\",\n targetElement: \".tna-footer__social-item-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Icon\",\n data_section: \"Social media\",\n data_link: ($el) => $el.getAttribute(\"data-name\"),\n },\n },\n {\n eventName: \"legal_link.click\",\n targetElement: \".tna-footer__legal-item-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Link\",\n data_section: \"Legal information\",\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"mailing_list.click\",\n targetElement: \".tna-footer__mailing-list a.tna-button\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Button\",\n data_section: \"Mailing list\",\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"ogl.click\",\n targetElement: \".tna-footer__licence p a.tna-footer__link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Link\",\n data_section: \"OGL\",\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"govuk.click\",\n targetElement: \".tna-footer__govuk-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Footer\",\n data_link_type: \"Logo\",\n data_section: \"GOV.UK\",\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"theme.change\",\n targetElement: \".tna-footer__theme-selector-button\",\n on: \"click\",\n data: {\n value: valueGetters.value,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-global-header\",\n areaName: \"header\",\n rootEventName: \"global_navigation\",\n events: [\n {\n eventName: \"toggle\",\n targetElement: \".tna-global-header__navigation-button\",\n on: \"click\",\n data: {\n state: valueGetters.expanded,\n },\n rootData: {\n data_component_name: \"Header\",\n data_link_type: \"Mobile menu\",\n data_link: ($el) => {\n const expanded = $el.getAttribute(\"aria-expanded\");\n if (expanded === null) {\n return null;\n }\n return expanded.toString() === \"true\" ? \"Open menu\" : \"Close menu\";\n },\n data_section: \"Burger menu\",\n },\n },\n {\n eventName: \"logo.click\",\n targetElement: \".tna-global-header__logo\",\n on: \"click\",\n rootData: {\n data_component_name: \"Header\",\n data_link_type: \"Logo\",\n data_link: \"The National Archives\",\n data_section: \"Top navigation and logo\",\n },\n },\n {\n eventName: \"primary_link.click\",\n targetElement: \".tna-global-header__navigation-item-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Header\",\n data_link_type: \"Menu\",\n data_section: valueGetters.text,\n data_position: 1,\n data_link: valueGetters.text,\n },\n },\n {\n eventName: \"secondary_link.click\",\n targetElement: \".tna-global-header__top-navigation-link\",\n on: \"click\",\n data: {\n value: valueGetters.text,\n },\n rootData: {\n data_component_name: \"Header\",\n data_link_type: \"Icon\",\n data_link: valueGetters.text,\n data_section: \"Top navigation and logo\",\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-header\",\n areaName: \"header\",\n events: [\n {\n eventName: \"toggle\",\n targetElement: \".tna-header__navigation-toggle-button\",\n on: \"click\",\n data: {\n state: valueGetters.expanded,\n },\n },\n ],\n },\n];\n","import {\n getClosestHeading,\n valueGetters,\n} from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-picture\",\n areaName: \"picture\",\n events: [\n {\n eventName: \"toggle_transcript\",\n targetElement: \".tna-picture__toggle-transcript\",\n on: \"click\",\n data: {\n state: valueGetters.expanded,\n // eslint-disable-next-line no-unused-vars\n value: ($el, $scope, event) => {\n const heading = getClosestHeading($scope);\n const image = $scope.querySelector(\".tna-picture__image\");\n const imageSrc = image.getAttribute(\"src\");\n const imageAlt = image.getAttribute(\"alt\");\n const value = `${imageAlt} (${imageSrc})`;\n return heading ? `${heading} > ${value}` : value;\n },\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-radios\",\n areaName: \"radios\",\n events: [\n {\n eventName: \"toggle\",\n targetElement: \".tna-radios__item input\",\n on: \"change\",\n data: {\n state: valueGetters.checked,\n // eslint-disable-next-line no-unused-vars\n value: ($el, $scope, event) => $el.parentNode.innerText,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope\n .closest(\".tna-form__group\")\n ?.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-search-field\",\n areaName: \"search-field\",\n events: [\n {\n eventName: \"blurred\",\n targetElement: \".tna-search-field__input\",\n on: \"blur\",\n data: {\n // eslint-disable-next-line no-unused-vars\n value: valueGetters.value,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-text-input\",\n areaName: \"text-input\",\n events: [\n {\n eventName: \"blurred\",\n on: \"blur\",\n data: {\n // eslint-disable-next-line no-unused-vars\n value: valueGetters.value,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope\n .closest(\".tna-form__group\")\n ?.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import { valueGetters } from \"../../lib/analytics-helpers.mjs\";\n\nexport default [\n {\n scope: \".tna-textarea\",\n areaName: \"textarea\",\n events: [\n {\n eventName: \"blurred\",\n on: \"blur\",\n data: {\n // eslint-disable-next-line no-unused-vars\n value: valueGetters.value,\n // eslint-disable-next-line no-unused-vars\n group: ($el, $scope, event) =>\n $scope\n .closest(\".tna-form__group\")\n ?.querySelector(\".tna-form__heading\")?.innerText,\n },\n },\n ],\n },\n];\n","import Cookies from \"./lib/cookies.mjs\";\nimport {\n getXPathTo,\n getClosestHeading,\n valueGetters,\n} from \"./lib/analytics-helpers.mjs\";\nimport BreadcrumbAnalytics from \"./components/breadcrumbs/analytics.js\";\nimport CheckboxesAnalytics from \"./components/checkboxes/analytics.js\";\nimport FooterAnalytics from \"./components/footer/analytics.js\";\nimport GlobalHeaderAnalytics from \"./components/global-header/analytics.js\";\nimport HeaderAnalytics from \"./components/header/analytics.js\";\nimport HeroAnalytics from \"./components/hero/analytics.js\";\nimport PictureAnalytics from \"./components/picture/analytics.js\";\nimport RadiosAnalytics from \"./components/radios/analytics.js\";\nimport SearchFieldAnalytics from \"./components/search-field/analytics.js\";\nimport TextInputAnalytics from \"./components/text-input/analytics.js\";\nimport TextareaAnalytics from \"./components/textarea/analytics.js\";\n\nconst componentAnalytics = [\n ...BreadcrumbAnalytics,\n ...CheckboxesAnalytics,\n ...FooterAnalytics,\n ...GlobalHeaderAnalytics,\n ...HeaderAnalytics,\n ...HeroAnalytics,\n ...PictureAnalytics,\n ...RadiosAnalytics,\n ...SearchFieldAnalytics,\n ...TextInputAnalytics,\n ...TextareaAnalytics,\n];\n\nclass EventTracker {\n /** @protected */\n cookies = new (window.TNAFrontend?.Cookies || Cookies)();\n\n /** @protected */\n events = [];\n\n /** @protected */\n startTime = new Date();\n\n /** @protected */\n prefix = \"tna\";\n\n /** @protected */\n addTrackingCode = true;\n\n constructor(options = {}) {\n const { prefix = null, addTrackingCode = true } = options;\n if (prefix) {\n this.prefix = prefix;\n }\n this.addTrackingCode = addTrackingCode;\n }\n\n start(initAll) {\n if (!navigator.doNotTrack || navigator.doNotTrack !== 1) {\n if (this.cookies.isPolicyAccepted(\"usage\")) {\n this.enableTracking();\n }\n this.cookies.on(\"changePolicy\", (policies) => {\n if (Object.hasOwn(policies, \"usage\")) {\n if (policies[\"usage\"]) {\n this.enableTracking();\n } else {\n this.disableTracking();\n }\n }\n });\n if (initAll) {\n this.initAll();\n }\n }\n }\n\n enableTracking() {}\n\n disableTracking() {}\n\n /**\n * Initialise all TNA Frontend component analytics.\n */\n initAll() {\n componentAnalytics.forEach((componentConfig) => {\n this.addListeners(\n componentConfig.scope,\n componentConfig.areaName,\n componentConfig.events,\n componentConfig.rootEventName || \"\",\n );\n });\n }\n\n /**\n * Add an event listener.\n * @param {String|HTMLElement} scope - The element to which the listener is scoped.\n * @param {String} areaName - The name of the component to pass on to the tracker.\n * @param {{eventName: String, targetElement: String|undefined, on: String, data: {value: Function|String|undefined, state: Function|String|undefined, group: Function|String|undefined, [String]: String|Integer}, rootData:{[String]: Function|String}}[]} events - The configuration of events to track along with their optional value and state which can be computed.\n * @param {String} rootEventName - The event name to use if specified (prefix).\n */\n addListeners(scope, areaName, events, rootEventName = \"\") {\n let scopeArray;\n if (typeof scope === \"string\") {\n scopeArray = Array.from(document.querySelectorAll(scope));\n } else if (typeof scope === \"object\") {\n scopeArray = [scope];\n }\n if (!scopeArray) {\n return;\n }\n scopeArray.forEach(($scope) => {\n events.forEach((eventConfig) => {\n if (!eventConfig.on) {\n return;\n }\n if (eventConfig.targetElement) {\n Array.from(\n $scope.querySelectorAll(eventConfig.targetElement),\n ).forEach(($el, index) =>\n this.attachListener(\n $el,\n $scope,\n rootEventName,\n eventConfig,\n scope,\n areaName,\n index + 1,\n ),\n );\n } else {\n this.attachListener(\n $scope,\n $scope,\n rootEventName,\n eventConfig,\n scope,\n areaName,\n 1,\n );\n }\n });\n });\n }\n\n /** @protected */\n generateEventName(areaName, eventConfig) {\n return `${this.prefix}.${areaName}.${eventConfig.eventName || eventConfig.on}`;\n }\n\n /** @protected */\n attachListener(\n $el,\n $scope,\n rootEventName,\n eventConfig,\n scope,\n areaName,\n index,\n ) {\n const { on, data, targetElement, rootData = {} } = eventConfig;\n $el.addEventListener(on, (event) =>\n this.recordEvent(\n rootEventName\n ? `${this.prefix}.${rootEventName}`\n : this.generateEventName(areaName, eventConfig),\n {\n ...data,\n name: this.generateEventName(areaName, eventConfig),\n value: data?.value\n ? this.computedValue(data.value, $el, $scope, event, index)\n : null,\n state: data?.state\n ? this.computedValue(data.state, $el, $scope, event, index)\n : null,\n group: data?.group\n ? this.computedValue(data.group, $el, $scope, event, index)\n : null,\n xPath: getXPathTo($el),\n targetElement: targetElement,\n timeSincePageLoad: new Date() - this.startTime,\n index,\n scope,\n areaName,\n },\n Object.fromEntries(\n Object.entries(rootData).map(([key, value]) => [\n key,\n this.computedValue(value, $el, $scope, event, index),\n ]),\n ),\n ),\n );\n }\n\n /** @protected */\n computedValue(value, $el, $scope, event, index) {\n return typeof value === \"function\"\n ? value.call(this, $el, $scope, event, index)\n : (value ?? null);\n }\n\n /** @protected */\n recordEvent(eventName, data, rootData = {}) {\n this.events.push({\n event: eventName,\n [`${this.prefix}.event`]: data,\n ...rootData,\n });\n }\n\n /** @protected */\n getTnaMetaTags() {\n return Object.fromEntries(\n Array.from(\n document.head.querySelectorAll(\n `meta[name^='${this.prefix}.'][content]`,\n ),\n ).map(($metaEl) => [\n $metaEl.getAttribute(\"name\"),\n $metaEl.getAttribute(\"content\"),\n ]),\n );\n }\n}\n\n/**\n * Class to handle Google Analytics 4 reporting.\n * @class GA4\n * @extends EventTracker\n * @constructor\n * @public\n */\nclass GA4 extends EventTracker {\n /** @protected */\n trackingCodeAdded = false;\n\n /** @protected */\n trackingEnabled = false;\n\n /** @protected */\n gTagId;\n\n constructor(options = {}) {\n if (window.TNAFrontendAnalytics) {\n return window.TNAFrontendAnalytics;\n }\n const {\n id = \"\",\n prefix = null,\n initAll = true,\n addTrackingCode = true,\n } = options;\n super({ prefix, addTrackingCode });\n window.TNAFrontendAnalytics = this;\n this.gTagId = id;\n this.ga4Disable = `ga-disable-${this.gTagId}`;\n window.dataLayer = window.dataLayer || [];\n if (!this.cookies.isPolicyAccepted(\"usage\")) {\n window[this.ga4Disable] = true;\n this.cookies.set(this.ga4Disable, \"true\");\n }\n this.start(initAll);\n }\n\n destroy() {\n window.TNAFrontendAnalytics = null;\n }\n\n /** @protected */\n recordEvent(eventName, data, rootData = {}) {\n const ga4Data = {\n event: eventName,\n ...Object.fromEntries(\n Object.entries(data).map(([key, value]) => [\n `${this.prefix}.event.${key}`,\n value,\n ]),\n ),\n ...rootData,\n };\n this.pushToDataLayer(ga4Data);\n }\n\n /** @protected */\n gtag() {\n this.pushToDataLayer(arguments);\n }\n\n /** @protected */\n pushToDataLayer(data) {\n window.dataLayer.push(data);\n }\n\n /** @protected */\n enableTracking() {\n if (!this.trackingEnabled) {\n window[this.ga4Disable] = false;\n this.cookies.set(this.ga4Disable, \"false\");\n if (!this.trackingCodeAdded && this.addTrackingCode) {\n if (!this.gTagId) {\n throw Error(\"ID was not specified\");\n }\n this.pushToDataLayer({\n \"gtm.start\": new Date().getTime(),\n event: \"gtm.js\",\n });\n const firstScript = document.getElementsByTagName(\"script\")[0];\n const script = document.createElement(\"script\");\n script.async = true;\n script.src = `https://www.googletagmanager.com/gtm.js?id=${this.gTagId}&l=dataLayer`;\n if (firstScript) {\n firstScript.parentNode.insertBefore(script, firstScript);\n } else {\n document.head.appendChild(script);\n }\n this.trackingCodeAdded = true;\n const tnaMetaTags = this.getTnaMetaTags();\n if (Object.keys(tnaMetaTags).length) {\n this.pushToDataLayer(tnaMetaTags);\n }\n }\n this.trackingEnabled = true;\n }\n }\n\n /** @protected */\n disableTracking() {\n if (this.trackingEnabled) {\n window[this.ga4Disable] = true;\n this.cookies.set(this.ga4Disable, \"true\");\n Object.keys(this.cookies.all).forEach((key) => {\n if (key.startsWith(\"_ga\")) {\n this.cookies.delete(key);\n }\n });\n this.trackingEnabled = false;\n // window.location.reload();\n }\n }\n}\n\nconst helpers = { getXPathTo, getClosestHeading, valueGetters };\n\nexport { EventTracker, GA4, helpers };\n","export default [\n {\n scope: \".tna-hero\",\n areaName: \"hero\",\n events: [\n {\n eventName: \"toggle_caption\",\n targetElement: \".tna-hero__details-summary\",\n on: \"click\",\n data: {\n // eslint-disable-next-line no-unused-vars\n state: ($el, $scope, event) => {\n const wasExpanded =\n $scope\n .querySelector(\".tna-hero__details\")\n ?.hasAttribute(\"open\") ?? false;\n return wasExpanded ? \"closed\" : \"opened\";\n },\n // eslint-disable-next-line no-unused-vars\n value: ($el, $scope, event) =>\n $scope.querySelector(\"img[alt]\")?.getAttribute(\"alt\"),\n },\n },\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","window","TNAFrontendCookies","TNAFrontendCookieEvents","CookieEventHandler","_createClass","_classCallCheck","_defineProperty","this","event","callback","hasOwn","events","concat","_toConsumableArray","oneTimeEvents","_this","data","arguments","length","undefined","forEach","eventToTrigger","i","splice","Cookies","options","_options$extraPolicie","extraPolicies","_options$domain","domain","_options$path","path","_options$secure","secure","_options$policiesKey","policiesKey","_options$newInstance","newInstance","destroyInstance","init","savePolicies","_objectSpread","fromEntries","map","k","toLowerCase","usage","settings","policies","essential","deserialised","document","cookie","split","filter","x","parts","trim","JSON","parse","e","all","exists","decodeURIComponent","_options$maxAge","maxAge","_options$sameSite","sameSite","_options$domain2","_options$path2","_options$secure2","encodeURIComponent","trigger","set","_this2","keys","policy","setPolicy","accepted","allPolicies","stringify","on","once","getXPathTo","$element","id","body","tagName","ix","siblings","parentNode","childNodes","sibling","nodeType","includesAny","arr","values","some","v","includes","getClosestHeading","heading","$search","previousElementSibling","classList","Array","from","innerText","parentElement","valueGetters","text","$el","html","innerHTML","index","$scope","checked","expanded","getAttribute","toString","closestHeading","scope","areaName","eventName","targetElement","state","group","_$scope$closest","closest","querySelector","rootEventName","rootData","data_component_name","data_link_type","data_section","data_link","data_position","image","imageSrc","imageAlt","_$scope$querySelector","componentAnalytics","CheckboxesAnalytics","FooterAnalytics","GlobalHeaderAnalytics","HeaderAnalytics","_$scope$querySelector2","hasAttribute","_$scope$querySelector3","PictureAnalytics","RadiosAnalytics","SearchFieldAnalytics","TextInputAnalytics","TextareaAnalytics","EventTracker","_window$TNAFrontend","TNAFrontend","Date","_options$prefix","prefix","_options$addTrackingC","addTrackingCode","initAll","navigator","doNotTrack","cookies","isPolicyAccepted","enableTracking","disableTracking","componentConfig","addListeners","scopeArray","_this3","querySelectorAll","_typeof","eventConfig","attachListener","_this4","_eventConfig$rootData","addEventListener","recordEvent","generateEventName","name","computedValue","xPath","timeSincePageLoad","startTime","entries","_ref","_ref2","_slicedToArray","push","head","$metaEl","GA4","_EventTracker2","_this5","TNAFrontendAnalytics","_possibleConstructorReturn","_options$id","_options$prefix2","_options$initAll","_options$addTrackingC2","_callSuper","gTagId","ga4Disable","dataLayer","start","_inherits","_this6","ga4Data","_ref3","_ref4","pushToDataLayer","trackingEnabled","trackingCodeAdded","Error","getTime","firstScript","getElementsByTagName","script","createElement","async","src","insertBefore","appendChild","tnaMetaTags","getTnaMetaTags","_this7","startsWith","helpers"],"sourceRoot":""}
@@ -197,7 +197,7 @@ class EventTracker {
197
197
  computedValue(value, $el, $scope, event, index) {
198
198
  return typeof value === "function"
199
199
  ? value.call(this, $el, $scope, event, index)
200
- : value ?? null;
200
+ : (value ?? null);
201
201
  }
202
202
 
203
203
  /** @protected */
@@ -1 +1 @@
1
- .tna-accordion,.tna-accordion__item{margin-top:32px}.tna-accordion:first-child,.tna-accordion__item:first-child{margin-top:0}.tna-accordion__heading{padding-top:16px}.tna-accordion__body{padding-top:16px}.tna-accordion__details{border-bottom:1px var(--keyline, rgb(38 38 42/0.25)) solid;position:relative;z-index:1}.tna-accordion__details:first-child{border-top:1px var(--keyline, rgb(38 38 42/0.25)) solid}.tna-accordion__details:has(.tna-accordion__summary:focus),.tna-accordion__details:has(.tna-accordion__content:focus){z-index:2}.tna-accordion__summary{width:100%;margin:0;padding:8px 48px 8px 16px;display:block;position:relative;line-height:inherit;text-align:left;list-style:none;background:rgba(0,0,0,0);border:none;border-radius:.1px;cursor:pointer;color:var(--font-dark, rgb(1, 1, 1));font-size:1.125rem;font-family:Open Sans,sans-serif;font-style:normal;font-optical-sizing:auto;font-variation-settings:"wdth" 100;font-weight:700}.tna-accordion__summary *{font-size:inherit}.tna-accordion__summary::before{content:"";width:0;height:0;position:absolute;top:calc(50% - 0.4330127019rem);right:.75rem;border-width:0.8660254038rem .5rem 0 .5rem;border-color:var(--font-light, rgb(1 1 1/0.58)) rgba(0,0,0,0);border-style:solid}.tna-accordion__summary:hover{text-decoration:underline;text-decoration-thickness:3.5px;background-color:var(--background-tint, rgb(217, 217, 214))}.tna-accordion__summary:hover::before{border-color:var(--font-dark, rgb(1, 1, 1)) rgba(0,0,0,0)}.tna-accordion__summary[aria-expanded=true]::before{border-width:0 .5rem 0.8660254038rem .5rem}.tna-accordion__content{padding:16px;position:relative;border-radius:.1px}.tna-accordion__content:focus{z-index:2}.tna-accordion__content:has(.tna-table-wrapper):has(.tna-table){padding-right:0;padding-left:0}.tna-accordion__content .tna-table-wrapper{padding-right:0;padding-left:0;left:0}.tna-accordion__content .tna-table{width:calc(100% - 32px);margin-right:16px;margin-left:16px}.tna-accordion__content .tna-table__caption{padding-top:0;padding-bottom:16px;font-size:inherit;line-height:inherit;text-align:left;caption-side:top}@media(forced-colors: active){.tna-accordion__summary::before{content:"↓";width:auto;height:auto;top:calc(50% - .5rem);line-height:1rem;border:none}.tna-accordion__summary[aria-expanded=true]::before{content:"↑";border:none}}/*# sourceMappingURL=accordion.css.map */
1
+ .tna-accordion,.tna-accordion__item{margin-top:32px}.tna-accordion:first-child,.tna-accordion__item:first-child{margin-top:0}.tna-accordion__heading{padding-top:16px}.tna-accordion__body{padding-top:16px}.tna-accordion__details{border-bottom:1px var(--keyline, rgb(38 38 42/0.25)) solid;position:relative;z-index:1}.tna-accordion__details:first-child{border-top:1px var(--keyline, rgb(38 38 42/0.25)) solid}.tna-accordion__details:has(.tna-accordion__summary:focus),.tna-accordion__details:has(.tna-accordion__content:focus){z-index:2}.tna-accordion__summary{width:100%;margin:0;padding:8px 48px 8px 16px;display:block;position:relative;line-height:inherit;text-align:left;list-style:none;background:rgba(0,0,0,0);border:none;border-radius:.1px;cursor:pointer;color:var(--font-dark, rgb(1, 1, 1));font-size:1.125rem;font-family:Open Sans,sans-serif;font-style:normal;font-optical-sizing:auto;font-variation-settings:"wdth" 100;font-weight:700}.tna-accordion__summary *{font-size:inherit}.tna-accordion__summary::before{content:"";width:0;height:0;position:absolute;top:calc(50% - 0.4330127019rem);right:.75rem;border-width:0.8660254038rem .5rem 0 .5rem;border-color:var(--font-light, rgb(1 1 1/0.58)) rgba(0,0,0,0);border-style:solid}.tna-accordion__summary:hover{text-decoration:underline;text-decoration-thickness:3.5px;background-color:var(--background-tint, rgb(217, 217, 214))}.tna-accordion__summary:hover::before{border-color:var(--font-dark, rgb(1, 1, 1)) rgba(0,0,0,0)}.tna-accordion__summary[aria-expanded=true]::before{border-width:0 .5rem 0.8660254038rem .5rem}.tna-accordion__content{padding:16px;position:relative;border-radius:.1px}.tna-accordion__content:focus{z-index:2}.tna-template--clicked .tna-accordion__content:focus{outline:none}.tna-accordion__content:has(.tna-table-wrapper):has(.tna-table){padding-right:0;padding-left:0}.tna-accordion__content .tna-table-wrapper{padding-right:0;padding-left:0;left:0}.tna-accordion__content .tna-table{width:calc(100% - 32px);margin-right:16px;margin-left:16px}.tna-accordion__content .tna-table__caption{padding-top:0;padding-bottom:16px;font-size:inherit;line-height:inherit;text-align:left;caption-side:top}@media(forced-colors: active){.tna-accordion__summary::before{content:"↓";width:auto;height:auto;top:calc(50% - .5rem);line-height:1rem;border:none}.tna-accordion__summary[aria-expanded=true]::before{content:"↑";border:none}}/*# sourceMappingURL=accordion.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/accordion/accordion.scss","../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss"],"names":[],"mappings":"CAUA,oCACE,gBAEA,4DACE,aCDF,wBACE,iBAGF,qBACE,iBAIF,wBCgDI,2DD7CF,kBACA,UAEA,oCC0CE,wDDnCJ,sHAEE,UAGF,wBACE,WACA,SACA,0BAGA,cAEA,kBAEA,oBACA,gBAEA,gBAEA,yBAEA,YACA,mBAEA,eCVF,qCC5CA,mBAqBA,YCIA,qBDHA,kBACA,yBACA,mCAPA,YCYsB,IH+BpB,0BACE,kBAGF,gCACE,WAEA,QACA,SAEA,kBACA,gCACA,aAEA,2CACA,8DACA,mBAGF,8BEvBF,0BACA,0BCpCsC,MF2BtC,4DDmCI,sCACE,0DAKF,oDACE,2CAKN,wBACE,aAEA,kBAEA,mBAEA,8BACE,UAGF,gEACE,gBACA,eAGF,2CACE,gBACA,eAEA,OAGF,mCACE,wBACA,kBACA,iBAEA,4CACE,cACA,oBAEA,kBACA,oBACA,gBACA,iBCmSN,8BD5RI,gCACE,YAEA,WACA,YAEA,sBAEA,iBAEA,YAIA,oDACE,YAEA","file":"accordion.css","sourcesContent":["@use \"sass:map\";\n@use \"sass:math\";\n@use \"../variables/spacing\";\n@use \"../variables/typography\";\n@use \"../tools/media\";\n\n@function space($size) {\n @return #{$size * spacing.$spacing-unit-px}px;\n}\n\n%space-above {\n margin-top: space(2);\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n%space-only-above {\n margin: #{space(2)} 0 0;\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above($zero-other-margins: false) {\n @if $zero-other-margins {\n @extend %space-only-above;\n } @else {\n @extend %space-above;\n }\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"sass:math\";\n@use \"../../tools/colour\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-accordion {\n @include spacing.space-above;\n\n // NON INTERACTIVE\n &__item {\n @include spacing.space-above;\n }\n\n &__heading {\n padding-top: spacing.space(1);\n }\n\n &__body {\n padding-top: spacing.space(1);\n }\n\n // INTERACTIVE\n &__details {\n @include colour.colour-border(\"keyline\", 1px, solid, bottom);\n\n position: relative;\n z-index: 1;\n\n &:first-child {\n @include colour.colour-border(\"keyline\", 1px, solid, top);\n // @include colour.thick-keyline-dark(top);\n // @include colour.thick-keyline-accent(top);\n }\n }\n\n &__details:has(&__summary:focus),\n &__details:has(&__content:focus) {\n z-index: 2;\n }\n\n &__summary {\n width: 100%;\n margin: 0;\n padding: spacing.space(0.5) spacing.space(3) spacing.space(0.5)\n spacing.space(1);\n\n display: block;\n\n position: relative;\n\n line-height: inherit;\n text-align: left;\n\n list-style: none;\n\n background: transparent;\n\n border: none;\n border-radius: 0.1px;\n\n cursor: pointer;\n\n @include colour.colour-font(\"font-dark\");\n @include typography.font-size(18);\n @include typography.main-font(true);\n\n * {\n font-size: inherit;\n }\n\n &::before {\n content: \"\";\n\n width: 0;\n height: 0;\n\n position: absolute;\n top: calc(50% - #{math.div(math.sqrt(3), 4)}rem);\n right: 0.75rem;\n\n border-width: #{math.div(math.sqrt(3), 2)}rem 0.5rem 0 0.5rem;\n border-color: colour.colour-var(\"font-light\") transparent;\n border-style: solid;\n }\n\n &:hover {\n @include typography.interacted-text-decoration;\n @include colour.colour-background(\"background-tint\");\n\n &::before {\n border-color: colour.colour-var(\"font-dark\") transparent;\n }\n }\n\n &[aria-expanded=\"true\"] {\n &::before {\n border-width: 0 0.5rem #{math.div(math.sqrt(3), 2)}rem 0.5rem;\n }\n }\n }\n\n &__content {\n padding: spacing.space(1);\n\n position: relative;\n\n border-radius: 0.1px;\n\n &:focus {\n z-index: 2;\n }\n\n &:has(.tna-table-wrapper):has(.tna-table) {\n padding-right: 0;\n padding-left: 0;\n }\n\n .tna-table-wrapper {\n padding-right: 0;\n padding-left: 0;\n\n left: 0;\n }\n\n .tna-table {\n width: calc(100% - #{spacing.space(2)});\n margin-right: spacing.space(1);\n margin-left: spacing.space(1);\n\n &__caption {\n padding-top: 0;\n padding-bottom: spacing.space(1);\n\n font-size: inherit;\n line-height: inherit;\n text-align: left;\n caption-side: top;\n }\n }\n }\n\n @include colour.on-forced-colours {\n &__summary {\n &::before {\n content: \"\\2193\";\n\n width: auto;\n height: auto;\n\n top: calc(50% - 0.5rem);\n\n line-height: 1rem;\n\n border: none;\n }\n\n &[aria-expanded=\"true\"] {\n &::before {\n content: \"\\2191\";\n\n border: none;\n }\n }\n }\n }\n}\n","@use \"sass:list\";\n@use \"sass:map\";\n@use \"../variables/borders\";\n@use \"../variables/colour\";\n@use \"../tools/media\";\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)} if($important, !important, null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width colour-var($colour) $style if($important, !important, null);\n } @else {\n outline-color: colour-var($colour) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if($important, !important, null);\n}\n\n@mixin thick-keyline($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline-dark\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline-dark\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"accent-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"accent-border\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\n \"form-error-border\",\n borders.$thick-border-width,\n solid\n );\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour) {\n @if $direction != \"\" {\n border-#{$direction}: borders.$thick-border-width\n #{brand-colour($brandColour)}\n solid;\n } @else {\n border: borders.$thick-border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n// Use light theme colours (except for \"form-error-border\")\n%always-light {\n @include colour-css-vars(\"form-error-border\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\"form-error-border\");\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-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n --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(--font-base);\n --accent-list-marker: var(--font-base);\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n }\n\n .tna-template--dark-theme & {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n\n @include colour-background(\"background\");\n @include colour-font(\"font-base\");\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-border: #{colour.brand-colour(\"yellow\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"brown\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n --button-accented-background: #{colour.brand-colour(\"brown\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-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-list-marker: #{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(\"pink\")} !important;\n --accent-list-marker: #{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(\"orange\")} !important;\n --accent-list-marker: #{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(\"green\")} !important;\n --accent-list-marker: #{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(\"blue\")} !important;\n --accent-list-marker: #{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","@use \"sass:math\";\n@use \"../variables/typography\";\n@use \"colour\";\n@use \"media\";\n\n@mixin font-size($font-size-px) {\n font-size: #{math.div($font-size-px, typography.$relative-1rem-px)}rem;\n}\n\n@mixin relative-font-size($font-size-px) {\n @warn \"relative-font-size() will soon be deprecated in favour of font-size().\";\n @include font-size($font-size-px);\n}\n\n@mixin main-font-weight {\n font-weight: typography.$main-font-weight;\n}\n\n@mixin main-font-weight-medium {\n font-weight: typography.$main-font-weight-medium;\n}\n\n@mixin main-font-weight-bold {\n font-weight: typography.$main-font-weight-bold;\n}\n\n@mixin main-font($bold: false) {\n font-family: typography.$main-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n font-variation-settings: \"wdth\" 100;\n @if $bold {\n @include main-font-weight-bold;\n } @else {\n @include main-font-weight;\n }\n}\n\n@mixin heading-font {\n font-family: typography.$heading-font-family;\n font-weight: typography.$heading-font-weight;\n}\n\n@mixin detail-font($bold: false) {\n font-family: typography.$detail-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n @if $bold {\n font-weight: typography.$detail-font-weight-bold;\n } @else {\n font-weight: typography.$detail-font-weight;\n }\n}\n\n@mixin detail-font-small {\n @include detail-font;\n @include font-size(14);\n line-height: 1.1;\n text-transform: uppercase;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n\n@mixin heading-generator(\n $font-size-default,\n $font-size-medium,\n $font-size-small,\n $font-size-tiny,\n $line-height\n) {\n $small-and-tiny-identical: $font-size-small == $font-size-tiny;\n $medium-small-and-tiny-identical: $font-size-medium == $font-size-small and\n $small-and-tiny-identical;\n $all-identical: $font-size-default == $font-size-medium and\n $medium-small-and-tiny-identical and $small-and-tiny-identical;\n line-height: $line-height;\n @include font-size($font-size-default);\n\n @if $all-identical != true {\n @if $medium-small-and-tiny-identical != true {\n @include media.on-medium {\n @include font-size($font-size-medium);\n }\n\n @if $small-and-tiny-identical != true {\n @include media.on-small {\n @include font-size($font-size-small);\n }\n\n @include media.on-tiny {\n @include font-size($font-size-tiny);\n }\n } @else {\n @include media.on-mobile {\n @include font-size($font-size-small);\n }\n }\n } @else {\n @include media.on-smaller-than-large {\n @include font-size($font-size-medium);\n }\n }\n }\n}\n","/*\n * ------------------------------------------\n * The typefaces, sizes and spacings that are\n * defined in this file have been selected to\n * ensure 100% match with the latest National\n * Archives brand guidelines - avoid changing\n * or overwriting any of these values without\n * signing off with the Digital Services team\n * first\n * ------------------------------------------\n */\n\n$relative-1rem-px: 16; // 16px = 1rem\n\n/*\n * ------------------------------------------\n * When true, use the included font files for\n * Open Sans and Roboto Mono, rather than the\n * versions hosted by Google Fonts\n * ------------------------------------------\n */\n$use-local-fonts: false !default;\n\n$body-font-size-px: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: 1.75 !default;\n\n$interactive-text-decoration-thickness: 3.5px !default;\n\n$main-font-family-name: \"Open Sans\" !default;\n$main-font-family:\n #{$main-font-family-name},\n sans-serif;\n$main-font-weight: 400 !default;\n$main-font-weight-medium: 600 !default;\n$main-font-weight-bold: 700 !default;\n$main-font-file: \"OpenSans-Regular.ttf\" !default;\n$main-font-file-medium: \"OpenSans-SemiBold.ttf\" !default;\n$main-font-file-bold: \"OpenSans-Bold.ttf\" !default;\n\n/*\n * ------------------------------------------\n * To use Supria Sans Condensed (which is the\n * approved heading typeface for The National\n * Archives), you need to obtain a licence to\n * properly embed the CSS files with the font\n * definitions in your service - check with a\n * member of the Digital Services team on how\n * to get a licence\n * ------------------------------------------\n */\n$heading-font-family-name: \"supria-sans-condensed\" !default;\n$heading-font-family:\n #{$heading-font-family-name},\n \"Arial Narrow\",\n sans-serif;\n$heading-font-weight: 500 !default;\n\n/*\n * ------------------------------------------\n * The detail font should be a monospace font\n * and is used for chips, supertitles as well\n * as the date search component\n * ------------------------------------------\n */\n$detail-font-family-name: \"Roboto Mono\" !default;\n$detail-font-family:\n #{$detail-font-family-name},\n monospace;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n$detail-font-file: \"RobotoMono-Regular.ttf\" !default;\n$detail-font-file-bold: \"RobotoMono-Medium.ttf\" !default;\n\n$heading-xl-font-size-default: 64 !default;\n$heading-xl-font-size-medium: 48 !default;\n$heading-xl-font-size-small: 36 !default;\n$heading-xl-font-size-tiny: $heading-xl-font-size-small !default;\n$heading-xl-line-height: 1.1 !default;\n\n$heading-l-font-size-default: 36 !default;\n$heading-l-font-size-medium: 30 !default;\n$heading-l-font-size-small: 28 !default;\n$heading-l-font-size-tiny: 25 !default;\n$heading-l-line-height: 1.3 !default;\n\n$heading-m-font-size-default: 22 !default;\n$heading-m-font-size-medium: 21 !default;\n$heading-m-font-size-small: 20 !default;\n$heading-m-font-size-tiny: 19 !default;\n$heading-m-line-height: 1.6 !default;\n\n$heading-s-font-size-default: 18 !default;\n$heading-s-font-size-medium: $heading-s-font-size-default !default;\n$heading-s-font-size-small: $heading-s-font-size-default !default;\n$heading-s-font-size-tiny: $heading-s-font-size-default !default;\n$heading-s-line-height: 1.6 !default;\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/accordion/accordion.scss","../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss"],"names":[],"mappings":"CAUA,oCACE,gBAEA,4DACE,aCDF,wBACE,iBAGF,qBACE,iBAIF,wBCgDI,2DD7CF,kBACA,UAEA,oCC0CE,wDDnCJ,sHAEE,UAGF,wBACE,WACA,SACA,0BAGA,cAEA,kBAEA,oBACA,gBAEA,gBAEA,yBAEA,YACA,mBAEA,eCVF,qCC5CA,mBAqBA,YCIA,qBDHA,kBACA,yBACA,mCAPA,YCYsB,IH+BpB,0BACE,kBAGF,gCACE,WAEA,QACA,SAEA,kBACA,gCACA,aAEA,2CACA,8DACA,mBAGF,8BEvBF,0BACA,0BCpCsC,MF2BtC,4DDmCI,sCACE,0DAKF,oDACE,2CAKN,wBACE,aAEA,kBAEA,mBAEA,8BACE,UAEA,qDACE,aAIJ,gEACE,gBACA,eAGF,2CACE,gBACA,eAEA,OAGF,mCACE,wBACA,kBACA,iBAEA,4CACE,cACA,oBAEA,kBACA,oBACA,gBACA,iBC+RN,8BDxRI,gCACE,YAEA,WACA,YAEA,sBAEA,iBAEA,YAIA,oDACE,YAEA","file":"accordion.css","sourcesContent":["@use \"sass:map\";\n@use \"sass:math\";\n@use \"../variables/spacing\";\n@use \"../variables/typography\";\n@use \"../tools/media\";\n\n@function space($size) {\n @return #{$size * spacing.$spacing-unit-px}px;\n}\n\n%space-above {\n margin-top: space(2);\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n%space-only-above {\n margin: #{space(2)} 0 0;\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above($zero-other-margins: false) {\n @if $zero-other-margins {\n @extend %space-only-above;\n } @else {\n @extend %space-above;\n }\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"sass:math\";\n@use \"../../tools/colour\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-accordion {\n @include spacing.space-above;\n\n // NON INTERACTIVE\n &__item {\n @include spacing.space-above;\n }\n\n &__heading {\n padding-top: spacing.space(1);\n }\n\n &__body {\n padding-top: spacing.space(1);\n }\n\n // INTERACTIVE\n &__details {\n @include colour.colour-border(\"keyline\", 1px, solid, bottom);\n\n position: relative;\n z-index: 1;\n\n &:first-child {\n @include colour.colour-border(\"keyline\", 1px, solid, top);\n // @include colour.thick-keyline-dark(top);\n // @include colour.thick-keyline-accent(top);\n }\n }\n\n &__details:has(&__summary:focus),\n &__details:has(&__content:focus) {\n z-index: 2;\n }\n\n &__summary {\n width: 100%;\n margin: 0;\n padding: spacing.space(0.5) spacing.space(3) spacing.space(0.5)\n spacing.space(1);\n\n display: block;\n\n position: relative;\n\n line-height: inherit;\n text-align: left;\n\n list-style: none;\n\n background: transparent;\n\n border: none;\n border-radius: 0.1px;\n\n cursor: pointer;\n\n @include colour.colour-font(\"font-dark\");\n @include typography.font-size(18);\n @include typography.main-font(true);\n\n * {\n font-size: inherit;\n }\n\n &::before {\n content: \"\";\n\n width: 0;\n height: 0;\n\n position: absolute;\n top: calc(50% - #{math.div(math.sqrt(3), 4)}rem);\n right: 0.75rem;\n\n border-width: #{math.div(math.sqrt(3), 2)}rem 0.5rem 0 0.5rem;\n border-color: colour.colour-var(\"font-light\") transparent;\n border-style: solid;\n }\n\n &:hover {\n @include typography.interacted-text-decoration;\n @include colour.colour-background(\"background-tint\");\n\n &::before {\n border-color: colour.colour-var(\"font-dark\") transparent;\n }\n }\n\n &[aria-expanded=\"true\"] {\n &::before {\n border-width: 0 0.5rem #{math.div(math.sqrt(3), 2)}rem 0.5rem;\n }\n }\n }\n\n &__content {\n padding: spacing.space(1);\n\n position: relative;\n\n border-radius: 0.1px;\n\n &:focus {\n z-index: 2;\n\n .tna-template--clicked & {\n outline: none;\n }\n }\n\n &:has(.tna-table-wrapper):has(.tna-table) {\n padding-right: 0;\n padding-left: 0;\n }\n\n .tna-table-wrapper {\n padding-right: 0;\n padding-left: 0;\n\n left: 0;\n }\n\n .tna-table {\n width: calc(100% - #{spacing.space(2)});\n margin-right: spacing.space(1);\n margin-left: spacing.space(1);\n\n &__caption {\n padding-top: 0;\n padding-bottom: spacing.space(1);\n\n font-size: inherit;\n line-height: inherit;\n text-align: left;\n caption-side: top;\n }\n }\n }\n\n @include colour.on-forced-colours {\n &__summary {\n &::before {\n content: \"\\2193\";\n\n width: auto;\n height: auto;\n\n top: calc(50% - 0.5rem);\n\n line-height: 1rem;\n\n border: none;\n }\n\n &[aria-expanded=\"true\"] {\n &::before {\n content: \"\\2191\";\n\n border: none;\n }\n }\n }\n }\n}\n","@use \"sass:list\";\n@use \"sass:map\";\n@use \"../variables/borders\";\n@use \"../variables/colour\";\n@use \"../tools/media\";\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)} if($important, !important, null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width colour-var($colour) $style if($important, !important, null);\n } @else {\n outline-color: colour-var($colour) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if($important, !important, null);\n}\n\n@mixin thick-keyline($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline-dark\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline-dark\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"accent-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"accent-border\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\n \"form-error-border\",\n borders.$thick-border-width,\n solid\n );\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour) {\n @if $direction != \"\" {\n border-#{$direction}: borders.$thick-border-width\n #{brand-colour($brandColour)}\n solid;\n } @else {\n border: borders.$thick-border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n// Use light theme colours (except for \"form-error-border\")\n%always-light {\n @include colour-css-vars(\"form-error-border\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\"form-error-border\");\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-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n --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(--font-base);\n --accent-list-marker: var(--font-base);\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 }\n\n .tna-template--dark-theme & {\n --link: #{map.get(colour.$colour-palette-default, \"link\")};\n --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n }\n}\n\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-list-marker: #{colour.brand-colour(\"brown\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n --button-accented-background: #{colour.brand-colour(\"brown\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-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-list-marker: #{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(\"pink\")} !important;\n --accent-list-marker: #{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(\"orange\")} !important;\n --accent-list-marker: #{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(\"green\")} !important;\n --accent-list-marker: #{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(\"blue\")} !important;\n --accent-list-marker: #{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","@use \"sass:math\";\n@use \"../variables/typography\";\n@use \"colour\";\n@use \"media\";\n\n@mixin font-size($font-size-px) {\n font-size: #{math.div($font-size-px, typography.$relative-1rem-px)}rem;\n}\n\n@mixin relative-font-size($font-size-px) {\n @warn \"relative-font-size() will soon be deprecated in favour of font-size().\";\n @include font-size($font-size-px);\n}\n\n@mixin main-font-weight {\n font-weight: typography.$main-font-weight;\n}\n\n@mixin main-font-weight-medium {\n font-weight: typography.$main-font-weight-medium;\n}\n\n@mixin main-font-weight-bold {\n font-weight: typography.$main-font-weight-bold;\n}\n\n@mixin main-font($bold: false) {\n font-family: typography.$main-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n font-variation-settings: \"wdth\" 100;\n @if $bold {\n @include main-font-weight-bold;\n } @else {\n @include main-font-weight;\n }\n}\n\n@mixin heading-font {\n font-family: typography.$heading-font-family;\n font-weight: typography.$heading-font-weight;\n}\n\n@mixin detail-font($bold: false) {\n font-family: typography.$detail-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n @if $bold {\n font-weight: typography.$detail-font-weight-bold;\n } @else {\n font-weight: typography.$detail-font-weight;\n }\n}\n\n@mixin detail-font-small {\n @include detail-font;\n @include font-size(14);\n line-height: 1.1;\n text-transform: uppercase;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n}\n\n@mixin heading-generator(\n $font-size-default,\n $font-size-medium,\n $font-size-small,\n $font-size-tiny,\n $line-height\n) {\n $small-and-tiny-identical: $font-size-small == $font-size-tiny;\n $medium-small-and-tiny-identical: $font-size-medium == $font-size-small and\n $small-and-tiny-identical;\n $all-identical: $font-size-default == $font-size-medium and\n $medium-small-and-tiny-identical and $small-and-tiny-identical;\n line-height: $line-height;\n @include font-size($font-size-default);\n\n @if $all-identical != true {\n @if $medium-small-and-tiny-identical != true {\n @include media.on-medium {\n @include font-size($font-size-medium);\n }\n\n @if $small-and-tiny-identical != true {\n @include media.on-small {\n @include font-size($font-size-small);\n }\n\n @include media.on-tiny {\n @include font-size($font-size-tiny);\n }\n } @else {\n @include media.on-mobile {\n @include font-size($font-size-small);\n }\n }\n } @else {\n @include media.on-smaller-than-large {\n @include font-size($font-size-medium);\n }\n }\n }\n}\n","/*\n * ------------------------------------------\n * The typefaces, sizes and spacings that are\n * defined in this file have been selected to\n * ensure 100% match with the latest National\n * Archives brand guidelines - avoid changing\n * or overwriting any of these values without\n * signing off with the Digital Services team\n * first\n * ------------------------------------------\n */\n\n$relative-1rem-px: 16; // 16px = 1rem\n\n/*\n * ------------------------------------------\n * When true, use the included font files for\n * Open Sans and Roboto Mono, rather than the\n * versions hosted by Google Fonts\n * ------------------------------------------\n */\n$use-local-fonts: false !default;\n\n$body-font-size-px: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: 1.75 !default;\n\n$interactive-text-decoration-thickness: 3.5px !default;\n\n$main-font-family-name: \"Open Sans\" !default;\n$main-font-family:\n #{$main-font-family-name},\n sans-serif;\n$main-font-weight: 400 !default;\n$main-font-weight-medium: 600 !default;\n$main-font-weight-bold: 700 !default;\n$main-font-file: \"OpenSans-Regular.ttf\" !default;\n$main-font-file-medium: \"OpenSans-SemiBold.ttf\" !default;\n$main-font-file-bold: \"OpenSans-Bold.ttf\" !default;\n\n/*\n * ------------------------------------------\n * To use Supria Sans Condensed (which is the\n * approved heading typeface for The National\n * Archives), you need to obtain a licence to\n * properly embed the CSS files with the font\n * definitions in your service - check with a\n * member of the Digital Services team on how\n * to get a licence\n * ------------------------------------------\n */\n$heading-font-family-name: \"supria-sans-condensed\" !default;\n$heading-font-family:\n #{$heading-font-family-name},\n \"Arial Narrow\",\n sans-serif;\n$heading-font-weight: 500 !default;\n\n/*\n * ------------------------------------------\n * The detail font should be a monospace font\n * and is used for chips, supertitles as well\n * as the date search component\n * ------------------------------------------\n */\n$detail-font-family-name: \"Roboto Mono\" !default;\n$detail-font-family:\n #{$detail-font-family-name},\n monospace;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n$detail-font-file: \"RobotoMono-Regular.ttf\" !default;\n$detail-font-file-bold: \"RobotoMono-Medium.ttf\" !default;\n\n$heading-xl-font-size-default: 64 !default;\n$heading-xl-font-size-medium: 48 !default;\n$heading-xl-font-size-small: 36 !default;\n$heading-xl-font-size-tiny: $heading-xl-font-size-small !default;\n$heading-xl-line-height: 1.1 !default;\n\n$heading-l-font-size-default: 36 !default;\n$heading-l-font-size-medium: 30 !default;\n$heading-l-font-size-small: 28 !default;\n$heading-l-font-size-tiny: 25 !default;\n$heading-l-line-height: 1.3 !default;\n\n$heading-m-font-size-default: 22 !default;\n$heading-m-font-size-medium: 21 !default;\n$heading-m-font-size-small: 20 !default;\n$heading-m-font-size-tiny: 19 !default;\n$heading-m-line-height: 1.6 !default;\n\n$heading-s-font-size-default: 18 !default;\n$heading-s-font-size-medium: $heading-s-font-size-default !default;\n$heading-s-font-size-small: $heading-s-font-size-default !default;\n$heading-s-font-size-tiny: $heading-s-font-size-default !default;\n$heading-s-line-height: 1.6 !default;\n"]}
@@ -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,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[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={};function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}e.r(t),e.d(t,{Accordion:()=>i});var i=function(){return e=function e(t){var r,n,i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,(n=o(n="polyfillRequired"))in r?Object.defineProperty(r,n,{value:null,enumerable:!0,configurable:!0,writable:!0}):r[n]=null,this.$module=t,this.$items=t&&t.querySelectorAll(".tna-accordion__item"),this.$module&&this.$items&&(this.allowMultipleItemsOpen="true"===this.$module.dataset.multipleitems,this.$items.forEach((function(e){return i.initItem(e)})),this.initState())},(t=[{key:"initItem",value:function(e){var t=this,r=e.querySelector(".tna-accordion__heading"),n=e.querySelector(".tna-accordion__body");if(r&&n){e.classList.add("tna-accordion__details"),e.classList.remove("tna-accordion__item"),r.removeAttribute("class"),n.classList.add("tna-accordion__content"),n.classList.remove("tna-accordion__body"),n.setAttribute("hidden","until-found"),n.addEventListener("blur",(function(){n.removeAttribute("tabindex")}));var o=document.createElement("button");o.classList.add("tna-accordion__summary"),o.setAttribute("aria-controls",n.id),r.parentNode.insertBefore(o,r.nextSibling),o.appendChild(r),o.addEventListener("click",(function(){"true"===o.getAttribute("aria-expanded")?t.closeItem(e):t.openItem(e)}))}}},{key:"initState",value:function(){var e=this;this.$items.forEach((function(t){"true"===t.dataset.isopen?e.openItem(t):e.closeItem(t),t.removeAttribute("data-isopen")}))}},{key:"openItem",value:function(e){this.allowMultipleItemsOpen||this.closeAllItemsExcept(e);var t=e.querySelector(".tna-accordion__summary"),r=e.querySelector(".tna-accordion__content");t.setAttribute("aria-expanded","true"),t.setAttribute("aria-label","".concat(t.innerText,", Hide this section")),r.removeAttribute("hidden"),r.setAttribute("tabindex","0"),r.focus()}},{key:"closeItem",value:function(e){var t=e.querySelector(".tna-accordion__summary"),r=e.querySelector(".tna-accordion__content");t.setAttribute("aria-expanded","false"),t.setAttribute("aria-label","".concat(t.innerText,", Show this section")),r.setAttribute("hidden","until-found")}},{key:"closeAllItemsExcept",value:function(e){var t=this;Array.from(this.$items).filter((function(t){return t.querySelector(".tna-accordion__summary")!==e&&"true"===t.querySelector(".tna-accordion__summary").getAttribute("aria-expanded")})).forEach((function(e){return t.closeItem(e)}))}}])&&n(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();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";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[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={};function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}e.r(t),e.d(t,{Accordion:()=>i});var i=function(){return e=function e(t){var r,n,i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,(n=o(n="polyfillRequired"))in r?Object.defineProperty(r,n,{value:null,enumerable:!0,configurable:!0,writable:!0}):r[n]=null,this.$module=t,this.$items=t&&t.querySelectorAll(".tna-accordion__item"),this.$module&&this.$items&&(this.allowMultipleItemsOpen="true"===this.$module.dataset.multipleitems,this.$items.forEach((function(e){return i.initItem(e)})),this.initState())},(t=[{key:"initItem",value:function(e){var t=this,r=e.querySelector(".tna-accordion__heading"),n=e.querySelector(".tna-accordion__body");if(r&&n){e.classList.add("tna-accordion__details"),e.classList.remove("tna-accordion__item"),r.removeAttribute("class"),n.classList.add("tna-accordion__content"),n.classList.remove("tna-accordion__body"),n.setAttribute("hidden","until-found");var o=document.createElement("button");o.classList.add("tna-accordion__summary"),o.setAttribute("aria-controls",n.id),r.parentNode.insertBefore(o,r.nextSibling),o.appendChild(r),o.addEventListener("click",(function(){"true"===o.getAttribute("aria-expanded")?t.closeItem(e):t.openItem(e)}))}}},{key:"initState",value:function(){var e=this;this.$items.forEach((function(t){"true"===t.dataset.isopen?e.openItem(t):e.closeItem(t),t.removeAttribute("data-isopen")}))}},{key:"openItem",value:function(e){this.allowMultipleItemsOpen||this.closeAllItemsExcept(e);var t=e.querySelector(".tna-accordion__summary"),r=e.querySelector(".tna-accordion__content");t.setAttribute("aria-expanded","true"),t.setAttribute("aria-label","".concat(t.innerText,", Hide this section")),r.removeAttribute("hidden"),r.setAttribute("tabindex","0")}},{key:"closeItem",value:function(e){var t=e.querySelector(".tna-accordion__summary"),r=e.querySelector(".tna-accordion__content");t.setAttribute("aria-expanded","false"),t.setAttribute("aria-label","".concat(t.innerText,", Show this section")),r.setAttribute("hidden","until-found"),r.setAttribute("tabindex","-1")}},{key:"closeAllItemsExcept",value:function(e){var t=this;Array.from(this.$items).filter((function(t){return t.querySelector(".tna-accordion__summary")!==e&&"true"===t.querySelector(".tna-accordion__summary").getAttribute("aria-expanded")})).forEach((function(e){return t.closeItem(e)}))}}])&&n(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();return t})()));
2
2
  //# sourceMappingURL=accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/accordion/accordion.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,GAAIH,GACA,iBAAZC,QACdA,QAAqB,YAAID,IAEzBD,EAAkB,YAAIC,GACvB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,ysBCLvD,IAAMC,EAAS,WAenB,O,EAZD,SAAAA,EAAYC,GAAS,I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wBACRH,KAAK+B,oBAAoBzB,GAE3B,IAAMa,EAAiBb,EAAMK,cAAc,2BACrCC,EAAWN,EAAMK,cAAc,2BACrCQ,EAAeF,aAAa,gBAAiB,QAC7CE,EAAeF,aACb,aAAY,GAAAe,OACTb,EAAec,UAAS,wBAE7BrB,EAASI,gBAAgB,UACzBJ,EAASK,aAAa,WAAY,KAClCL,EAASsB,OACX,GAAC,CAAApD,IAAA,YAAAa,MAED,SAAUW,GACR,IAAMa,EAAiBb,EAAMK,cAAc,2BACrCC,EAAWN,EAAMK,cAAc,2BACrCQ,EAAeF,aAAa,gBAAiB,SAC7CE,EAAeF,aACb,aAAY,GAAAe,OACTb,EAAec,UAAS,wBAE7BrB,EAASK,aAAa,SAAU,cAClC,GAAC,CAAAnC,IAAA,sBAAAa,MAED,SAAoBwC,GAAc,IAAAC,EAAA,KAChCC,MAAMC,KAAKtC,KAAKC,QACbsC,QACC,SAACjC,GAAK,OACJA,EAAMK,cAAc,6BAA+BwB,GAGd,SAFrC7B,EACGK,cAAc,2BACdgB,aAAa,gBAA2B,IAE9CtB,SAAQ,SAACC,GAAK,OAAK8B,EAAKR,UAAUtB,EAAM,GAC7C,M,6EAAC,CArGmB,G","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/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 ","// 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 Accordion {\n polyfillRequired = null;\n\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[\"multipleitems\"] === \"true\";\n\n this.$items.forEach(($item) => this.initItem($item));\n this.initState();\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\", \"until-found\");\n $content.addEventListener(\"blur\", () => {\n $content.removeAttribute(\"tabindex\");\n });\n\n const $headingButton = document.createElement(\"button\");\n $headingButton.classList.add(\"tna-accordion__summary\");\n $headingButton.setAttribute(\"aria-controls\", $content.id);\n $heading.parentNode.insertBefore($headingButton, $heading.nextSibling);\n $headingButton.appendChild($heading);\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}, Hide this section`,\n );\n $content.removeAttribute(\"hidden\");\n $content.setAttribute(\"tabindex\", \"0\");\n $content.focus();\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}, Show this section`,\n );\n $content.setAttribute(\"hidden\", \"until-found\");\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"],"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","Accordion","$module","_this","_classCallCheck","this","$items","querySelectorAll","allowMultipleItemsOpen","dataset","forEach","$item","initItem","initState","_this2","$heading","querySelector","$content","classList","add","remove","removeAttribute","setAttribute","addEventListener","$headingButton","document","createElement","id","parentNode","insertBefore","nextSibling","appendChild","getAttribute","closeItem","openItem","_this3","closeAllItemsExcept","concat","innerText","focus","$excludeItem","_this4","Array","from","filter"],"sourceRoot":""}
1
+ {"version":3,"file":"components/accordion/accordion.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,S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BAA+BuB,GAGd,SAFrC5B,EACGK,cAAc,2BACdgB,aAAa,gBAA2B,IAE9CtB,SAAQ,SAACC,GAAK,OAAK6B,EAAKP,UAAUtB,EAAM,GAC7C,M,6EAAC,CAlGmB,G","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/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 ","// 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 Accordion {\n polyfillRequired = null;\n\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[\"multipleitems\"] === \"true\";\n\n this.$items.forEach(($item) => this.initItem($item));\n this.initState();\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\", \"until-found\");\n\n const $headingButton = document.createElement(\"button\");\n $headingButton.classList.add(\"tna-accordion__summary\");\n $headingButton.setAttribute(\"aria-controls\", $content.id);\n $heading.parentNode.insertBefore($headingButton, $heading.nextSibling);\n $headingButton.appendChild($heading);\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}, Hide this section`,\n );\n $content.removeAttribute(\"hidden\");\n $content.setAttribute(\"tabindex\", \"0\");\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}, Show this section`,\n );\n $content.setAttribute(\"hidden\", \"until-found\");\n $content.setAttribute(\"tabindex\", \"-1\");\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"],"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","Accordion","$module","_this","_classCallCheck","this","$items","querySelectorAll","allowMultipleItemsOpen","dataset","forEach","$item","initItem","initState","_this2","$heading","querySelector","$content","classList","add","remove","removeAttribute","setAttribute","$headingButton","document","createElement","id","parentNode","insertBefore","nextSibling","appendChild","addEventListener","getAttribute","closeItem","openItem","_this3","closeAllItemsExcept","concat","innerText","$excludeItem","_this4","Array","from","filter"],"sourceRoot":""}
@@ -31,9 +31,6 @@ export class Accordion {
31
31
  $content.classList.add("tna-accordion__content");
32
32
  $content.classList.remove("tna-accordion__body");
33
33
  $content.setAttribute("hidden", "until-found");
34
- $content.addEventListener("blur", () => {
35
- $content.removeAttribute("tabindex");
36
- });
37
34
 
38
35
  const $headingButton = document.createElement("button");
39
36
  $headingButton.classList.add("tna-accordion__summary");
@@ -75,7 +72,6 @@ export class Accordion {
75
72
  );
76
73
  $content.removeAttribute("hidden");
77
74
  $content.setAttribute("tabindex", "0");
78
- $content.focus();
79
75
  }
80
76
 
81
77
  closeItem($item) {
@@ -87,6 +83,7 @@ export class Accordion {
87
83
  `${$headingButton.innerText}, Show this section`,
88
84
  );
89
85
  $content.setAttribute("hidden", "until-found");
86
+ $content.setAttribute("tabindex", "-1");
90
87
  }
91
88
 
92
89
  closeAllItemsExcept($excludeItem) {
@@ -108,6 +108,10 @@
108
108
 
109
109
  &:focus {
110
110
  z-index: 2;
111
+
112
+ .tna-template--clicked & {
113
+ outline: none;
114
+ }
111
115
  }
112
116
 
113
117
  &:has(.tna-table-wrapper):has(.tna-table) {