@nationalarchives/frontend 0.41.1 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/.htmlvalidate.json +2 -1
- package/nationalarchives/all+analytics.js +1 -1
- package/nationalarchives/all+analytics.js.map +1 -1
- package/nationalarchives/all+analytics.mjs +5 -3
- package/nationalarchives/all.css +1 -1
- package/nationalarchives/all.css.map +1 -1
- package/nationalarchives/all.js +1 -1
- package/nationalarchives/all.js.map +1 -1
- package/nationalarchives/all.mjs +44 -30
- package/nationalarchives/analytics.js +1 -1
- package/nationalarchives/analytics.js.map +1 -1
- package/nationalarchives/analytics.mjs +39 -21
- package/nationalarchives/components/accordion/accordion.css +1 -1
- package/nationalarchives/components/accordion/accordion.css.map +1 -1
- package/nationalarchives/components/accordion/accordion.js +1 -1
- package/nationalarchives/components/accordion/accordion.js.map +1 -1
- package/nationalarchives/components/accordion/accordion.mjs +1 -1
- package/nationalarchives/components/back-link/back-link.css.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.css.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.js.map +1 -1
- package/nationalarchives/components/breadcrumbs/breadcrumbs.mjs +2 -1
- package/nationalarchives/components/button/button.css +1 -1
- package/nationalarchives/components/button/button.css.map +1 -1
- package/nationalarchives/components/button/button.scss +2 -1
- package/nationalarchives/components/card/card.css +1 -1
- package/nationalarchives/components/card/card.css.map +1 -1
- package/nationalarchives/components/card/card.scss +4 -4
- package/nationalarchives/components/checkboxes/checkboxes.css +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.css.map +1 -1
- package/nationalarchives/components/checkboxes/checkboxes.scss +2 -2
- package/nationalarchives/components/checkboxes/fixtures.json +27 -0
- package/nationalarchives/components/checkboxes/macro-options.json +6 -0
- package/nationalarchives/components/checkboxes/template.njk +2 -2
- package/nationalarchives/components/code-block/code-block.css +1 -1
- package/nationalarchives/components/code-block/code-block.css.map +1 -1
- package/nationalarchives/components/code-block/code-block.js +1 -1
- package/nationalarchives/components/code-block/code-block.js.map +1 -1
- package/nationalarchives/components/code-block/code-block.mjs +2 -2
- package/nationalarchives/components/code-block/code-block.scss +4 -4
- package/nationalarchives/components/code-block/fixtures.json +6 -6
- package/nationalarchives/components/code-block/macro-options.json +1 -1
- package/nationalarchives/components/code-block/template.njk +12 -12
- package/nationalarchives/components/compound-filters/compound-filters.css +1 -1
- package/nationalarchives/components/compound-filters/compound-filters.css.map +1 -1
- package/nationalarchives/components/compound-filters/compound-filters.scss +2 -2
- package/nationalarchives/components/cookie-banner/cookie-banner.css.map +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js +1 -1
- package/nationalarchives/components/cookie-banner/cookie-banner.js.map +1 -1
- package/nationalarchives/components/date-input/date-input.css.map +1 -1
- package/nationalarchives/components/date-input/date-input.js +1 -1
- package/nationalarchives/components/date-input/date-input.js.map +1 -1
- package/nationalarchives/components/date-input/date-input.mjs +5 -2
- package/nationalarchives/components/details/analytics.js +1 -1
- package/nationalarchives/components/details/details.css.map +1 -1
- package/nationalarchives/components/details/macro-options.json +1 -1
- package/nationalarchives/components/error-summary/error-summary.css.map +1 -1
- package/nationalarchives/components/error-summary/error-summary.js +1 -1
- package/nationalarchives/components/error-summary/error-summary.js.map +1 -1
- package/nationalarchives/components/error-summary/error-summary.mjs +19 -15
- package/nationalarchives/components/fieldset/fieldset.css.map +1 -1
- package/nationalarchives/components/file-input/analytics.js +3 -3
- package/nationalarchives/components/file-input/file-input.css.map +1 -1
- package/nationalarchives/components/file-input/file-input.js +1 -1
- package/nationalarchives/components/file-input/file-input.js.map +1 -1
- package/nationalarchives/components/file-input/file-input.mjs +33 -17
- package/nationalarchives/components/files-list/files-list.css +1 -1
- package/nationalarchives/components/files-list/files-list.css.map +1 -1
- package/nationalarchives/components/files-list/files-list.scss +8 -8
- package/nationalarchives/components/footer/fixtures.json +2 -2
- package/nationalarchives/components/footer/footer.css.map +1 -1
- package/nationalarchives/components/footer/footer.js +1 -1
- package/nationalarchives/components/footer/footer.js.map +1 -1
- package/nationalarchives/components/footer/footer.mjs +2 -2
- package/nationalarchives/components/footer/template.njk +3 -3
- package/nationalarchives/components/gallery/analytics.js +1 -0
- package/nationalarchives/components/gallery/gallery.css.map +1 -1
- package/nationalarchives/components/gallery/gallery.js +1 -1
- package/nationalarchives/components/gallery/gallery.js.map +1 -1
- package/nationalarchives/components/gallery/gallery.mjs +16 -4
- package/nationalarchives/components/global-header/global-header.css.map +1 -1
- package/nationalarchives/components/global-header/global-header.js +1 -1
- package/nationalarchives/components/global-header/global-header.js.map +1 -1
- package/nationalarchives/components/global-header/global-header.mjs +11 -11
- package/nationalarchives/components/global-header/global-header.scss +1 -0
- package/nationalarchives/components/header/header.css.map +1 -1
- package/nationalarchives/components/header/header.js +1 -1
- package/nationalarchives/components/header/header.js.map +1 -1
- package/nationalarchives/components/header/header.mjs +11 -11
- package/nationalarchives/components/hero/hero.css.map +1 -1
- package/nationalarchives/components/index-grid/index-grid.css +1 -1
- package/nationalarchives/components/index-grid/index-grid.css.map +1 -1
- package/nationalarchives/components/index-grid/index-grid.scss +3 -3
- package/nationalarchives/components/pagination/pagination.css.map +1 -1
- package/nationalarchives/components/panel/panel.css.map +1 -1
- package/nationalarchives/components/phase-banner/phase-banner.css.map +1 -1
- package/nationalarchives/components/picture/picture.css.map +1 -1
- package/nationalarchives/components/picture/picture.js +1 -1
- package/nationalarchives/components/picture/picture.js.map +1 -1
- package/nationalarchives/components/picture/picture.mjs +4 -2
- package/nationalarchives/components/quick-filters/quick-filters.css.map +1 -1
- package/nationalarchives/components/radios/fixtures.json +27 -0
- package/nationalarchives/components/radios/macro-options.json +7 -1
- package/nationalarchives/components/radios/radios.css +1 -1
- package/nationalarchives/components/radios/radios.css.map +1 -1
- package/nationalarchives/components/radios/radios.scss +2 -2
- package/nationalarchives/components/radios/template.njk +2 -2
- package/nationalarchives/components/search-field/analytics.js +0 -1
- package/nationalarchives/components/search-field/search-field.css +1 -1
- package/nationalarchives/components/search-field/search-field.css.map +1 -1
- package/nationalarchives/components/search-field/search-field.scss +2 -2
- package/nationalarchives/components/secondary-navigation/secondary-navigation.css +1 -1
- package/nationalarchives/components/secondary-navigation/secondary-navigation.css.map +1 -1
- package/nationalarchives/components/secondary-navigation/secondary-navigation.scss +4 -3
- package/nationalarchives/components/sidebar/fixtures.json +69 -0
- package/nationalarchives/components/sidebar/macro-options.json +7 -0
- package/nationalarchives/components/sidebar/sidebar.css +1 -1
- package/nationalarchives/components/sidebar/sidebar.css.map +1 -1
- package/nationalarchives/components/sidebar/sidebar.js +2 -0
- package/nationalarchives/components/sidebar/sidebar.js.map +1 -0
- package/nationalarchives/components/sidebar/sidebar.mjs +97 -0
- package/nationalarchives/components/sidebar/sidebar.scss +2 -2
- package/nationalarchives/components/sidebar/template.njk +1 -1
- package/nationalarchives/components/skip-link/skip-link.css +1 -1
- package/nationalarchives/components/skip-link/skip-link.css.map +1 -1
- package/nationalarchives/components/tabs/tabs.css.map +1 -1
- package/nationalarchives/components/tabs/tabs.js.map +1 -1
- package/nationalarchives/components/tabs/tabs.mjs +11 -3
- package/nationalarchives/components/text-input/analytics.js +1 -1
- package/nationalarchives/components/text-input/fixtures.json +14 -2
- package/nationalarchives/components/text-input/template.njk +1 -1
- package/nationalarchives/components/textarea/analytics.js +0 -1
- package/nationalarchives/components/textarea/textarea.css +1 -1
- package/nationalarchives/components/textarea/textarea.css.map +1 -1
- package/nationalarchives/components/textarea/textarea.js +1 -1
- package/nationalarchives/components/textarea/textarea.js.map +1 -1
- package/nationalarchives/components/textarea/textarea.mjs +19 -13
- package/nationalarchives/components/textarea/textarea.scss +2 -2
- package/nationalarchives/components/warning/warning.css +1 -1
- package/nationalarchives/components/warning/warning.css.map +1 -1
- package/nationalarchives/components/warning/warning.scss +2 -2
- package/nationalarchives/error-page.css +1 -1
- package/nationalarchives/error-page.css.map +1 -1
- package/nationalarchives/lib/analytics-helpers.mjs +21 -19
- package/nationalarchives/lib/cookie-events.mjs +70 -0
- package/nationalarchives/lib/cookies.mjs +54 -92
- package/nationalarchives/lib/helpers.mjs +7 -13
- package/nationalarchives/lib/uuid.mjs +5 -3
- package/nationalarchives/prototype-kit.css +1 -1
- package/nationalarchives/prototype-kit.css.map +1 -1
- package/nationalarchives/templates/fixtures.json +1 -1
- package/nationalarchives/templates/layouts/email.njk +2 -2
- package/nationalarchives/templates/prototype-kit/plain-with-sidebar.njk +74 -0
- package/nationalarchives/templates/prototype-kit/plain.njk +1 -1
- package/nationalarchives/tools/_grid.scss +3 -0
- package/nationalarchives/tools/_typography.scss +1 -1
- package/nationalarchives/utilities/reset/_index.scss +4 -0
- package/nationalarchives/utilities/tables/_index.scss +6 -5
- package/nationalarchives/utilities/typography/_index.scss +1 -0
- package/package.json +18 -22
- package/config/.eslintrc.js +0 -25
- package/config/stylelint.config.js +0 -244
- package/nationalarchives/templates/prototype-kit/index-grid.njk +0 -146
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/footer/footer.js","mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,iBAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,GACC,CATD,CASCK,KAAA,0zECTDC,OAAOC,mBAAqBD,OAAOC,oBAAsB,KACzDD,OAAOE,wBAA0BF,OAAOE,yBAA2B,KAE5D,IAAMC,EAAkB,WAY5B,OAAAC,EAPD,SAAAD,IAA2B,IAAfE,EAAKC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAEf,GAFuBG,EAAAC,KAAAP,GAAAQ,EAAAD,KAAA,SAJhB,CAAC,GAACC,EAAAD,KAAA,gBACK,CAAC,GAACC,EAAAD,KAAA,SACV,GAGNA,KAAKL,MAAQA,EACTL,OAAOE,wBAET,OADAQ,KAAKE,IAAI,mDACFZ,OAAOE,wB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EAChBzJ,KAAKwI,QAAQgB,iBAAiB,YAChCxJ,KAAKwI,QAAQrC,IAAInG,KAAKgI,gBAAiBhI,KAAKsI,cAE5CtI,KAAKmI,qBAAqBkB,gBAAgB,SAE9C,GAAC,CAAAlJ,IAAA,4BAAAC,MAED,SAA0ByJ,GACxBrJ,MAAMmI,KAAK3I,KAAKyI,uBAAuBnH,QAAQ,SAACwH,GAC1CA,EAAQ1I,QAAUyJ,EAAgBzJ,OACpC0I,EAAQY,UAAUC,OAAO,qBACzBb,EAAQM,aAAa,gBAAgB,KAErCN,EAAQY,UAAUE,IAAI,qBACtBd,EAAQO,gBAAgB,gBAE5B,EACF,mFAAC,CA/GgB","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/./src/nationalarchives/lib/cookies.mjs","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/footer/footer.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 ","window.TNAFrontendCookies = window.TNAFrontendCookies || null;\nwindow.TNAFrontendCookieEvents = window.TNAFrontendCookieEvents || null;\n\nexport class CookieEventHandler {\n events = {};\n oneTimeEvents = {};\n debug = false;\n\n constructor(debug = false) {\n this.debug = debug;\n if (window.TNAFrontendCookieEvents) {\n this.log(\"Using existing TNAFrontendCookieEvents instance\");\n return window.TNAFrontendCookieEvents;\n }\n window.TNAFrontendCookieEvents = this;\n }\n\n log(...args) {\n if (this.debug) {\n console.log(\"[TNA Frontend Cookie Events]\", ...args);\n }\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.log(`Triggering event: ${event}`, data);\n this.events[event].forEach((eventToTrigger) =>\n eventToTrigger.call(this, data),\n );\n }\n if (Object.hasOwn(this.oneTimeEvents, event)) {\n this.log(`Triggering one-time event: ${event}`, data);\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\nconst tnaCookiePolicies = [\"usage\", \"settings\", \"marketing\", \"essential\"];\n\n/**\n * Class to handle cookies.\n * @class Cookies\n * @constructor\n * @public\n */\nexport default class Cookies {\n /** @protected */\n defaultDomain = \"\";\n /** @protected */\n defaultPath = \"\";\n /** @protected */\n secure = true;\n /** @protected */\n policiesKey = \"\";\n /** @protected */\n events = null;\n /** @protected */\n defaultAge = null;\n /** @protected */\n policiesCorrectOnInit = false;\n /** @protected */\n debug = document.documentElement.dataset.tnaFrontendDebug === \"true\";\n\n /**\n * Create a cookie handler.\n * @param {String} [options.defaultDomain] - The domain to register the cookie with.\n * @param {String} [options.path] - The domain to register the cookie with.\n * @param {Boolean} [options.secure] - Only set cookie in HTTPS environments.\n * @param {String} [options.policiesKey] - The name of the cookie.\n * @param {Number} [options.defaultAge] - The default age of non-session cookies.\n * @param {String} [options.newInstance=false] - Create a fresh instance of the cookie class.\n * @param {Boolean} [options.noInit=false] - Don't initialise a blank cookie policy.\n */\n constructor(options = {}) {\n const {\n defaultDomain,\n defaultPath,\n secure,\n policiesKey,\n defaultAge,\n newInstance = false,\n noInit = false,\n } = options;\n if (!newInstance && window.TNAFrontendCookies) {\n return window.TNAFrontendCookies;\n }\n if (defaultDomain === undefined) {\n this.defaultDomain =\n document.documentElement.dataset.tnaCookiesDomain ||\n window.location.hostname;\n } else {\n this.defaultDomain = defaultDomain;\n }\n if (defaultPath === undefined) {\n this.defaultPath = document.documentElement.dataset.tnaCookiesPath || \"/\";\n } else {\n this.defaultPath = defaultPath;\n }\n if (secure === undefined) {\n this.secure =\n document.documentElement.dataset.tnaCookiesInsecure !== \"true\";\n } else {\n this.secure = secure;\n }\n if (policiesKey === undefined) {\n this.policiesKey =\n document.documentElement.dataset.tnaCookiesPoliciesKey ||\n \"cookies_policy\";\n } else {\n this.policiesKey = policiesKey;\n }\n if (defaultAge === undefined) {\n this.defaultAge =\n parseInt(document.documentElement.dataset.tnaCookiesDefaultAge) ||\n 31536000; // 365 days;\n } else {\n this.defaultAge = defaultAge;\n }\n this.events = new CookieEventHandler(this.debug);\n this.policiesCorrectOnInit =\n Object.keys(this.policies).length === tnaCookiePolicies.length &&\n tnaCookiePolicies.every(\n (policy) =>\n Object.keys(this.policies).includes(policy) &&\n typeof this.policies[policy] === \"boolean\",\n );\n if (!this.policiesCorrectOnInit && !noInit) {\n this.init();\n }\n this.log({\n defaultDomain: this.defaultDomain,\n defaultPath: this.defaultPath,\n secure: this.secure,\n policiesKey: this.policiesKey,\n defaultAge: this.defaultAge,\n policiesCorrectOnInit: this.policiesCorrectOnInit,\n });\n if (!newInstance && !window.TNAFrontendCookies) {\n window.TNAFrontendCookies = this;\n }\n }\n\n /** @protected */\n init() {\n const existingPolicies = this.policies;\n this.log(\"Existing policies on init:\", existingPolicies);\n const filteredExistingPolicies = Object.fromEntries(\n Object.keys(existingPolicies)\n .filter((policy) => tnaCookiePolicies.includes(policy))\n .map((policy) => [policy, existingPolicies[policy]]),\n );\n if (Object.keys(filteredExistingPolicies).length > 0) {\n this.log(\"Filtered existing policies:\", filteredExistingPolicies);\n }\n this.savePolicies({\n usage: false,\n settings: false,\n marketing: false,\n ...filteredExistingPolicies,\n essential: true,\n });\n }\n\n log(...args) {\n if (this.debug) {\n console.log(\"[TNA Frontend Cookies]\", ...args, this.all);\n }\n }\n\n destroyInstance() {\n this.log(\"Destroying TNAFrontendCookies instance\");\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=this.defaultAge] - 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.defaultDomain] - The domain to register the cookie with.\n * @param {String} [options.path=this.defaultPath] - The path to register the cookie with.\n * @param {String} [options.secure=this.secure] - Only set cookie in HTTPS environments.\n * @param {String} [options.session=false] - Set a session cookie.\n */\n set(key, value, options = {}) {\n const {\n maxAge = this.defaultAge,\n sameSite = \"Lax\",\n domain = this.defaultDomain,\n path = this.defaultPath,\n secure = this.secure,\n session = false,\n } = options;\n if (!key) {\n return;\n }\n const cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)}; domain=${domain}; samesite=${sameSite}; path=${path}${!session ? `; max-age=${maxAge}` : \"\"}${\n secure ? \"; secure\" : \"\"\n }`;\n document.cookie = cookie;\n this.log(\"Set cookie:\", {\n key,\n value,\n maxAge,\n path,\n sameSite,\n domain,\n secure,\n session,\n cookie,\n });\n this.events.trigger(\"setCookie\", {\n key,\n value,\n maxAge,\n path,\n sameSite,\n domain,\n secure,\n session,\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 = this.defaultDomain) {\n const options = { maxAge: -1, path, domain: domain || undefined };\n this.set(key, \"\", options);\n this.log(\"Deleted cookie:\", { key, path, domain, ...options });\n this.events.trigger(\"deleteCookie\", { key, ...options });\n }\n\n /**\n * Delete all cookies.\n */\n deleteAll(path = \"/\", domain = this.defaultDomain) {\n Object.keys(this.all).forEach((cookie) => {\n this.delete(cookie, path, domain);\n });\n this.log(\"Deleted all cookies\", { path, domain });\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.log(\"Accepting policy:\", 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.log(\"Rejecting policy:\", 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 this.log(\"Cannot change essential policy, it is always accepted.\");\n return;\n }\n this.log(`Setting policy ${policy} to ${accepted}`);\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 this.log(\"Accepting all policies\");\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 this.log(\"Rejecting all policies\");\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.log(\"Saving policies:\", 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.log(`Adding event listener for: ${event}`);\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.log(`Adding one-time event listener for: ${event}`);\n this.events.once(event, callback);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import Cookies from \"../../lib/cookies.mjs\";\n\nexport class Footer {\n constructor($module, themeCookieName = \"theme\") {\n this.$module = $module;\n this.$themeSelector =\n $module && $module.querySelector(\".tna-footer__theme-selector\");\n this.$themeSelectorNotice =\n $module && $module.querySelector(\".tna-footer__theme-selector-notice\");\n this.$themeSelectorEnableSettingsCookiesButton =\n this.$themeSelectorNotice &&\n this.$themeSelectorNotice.querySelector(\n \".tna-footer__theme-selector-enable-settings-cookies\",\n );\n this.$tnaTemplate = document.querySelector(\".tna-template\");\n\n if (\n !this.$module ||\n !this.$themeSelector ||\n !this.$themeSelectorNotice ||\n !this.$themeSelectorEnableSettingsCookiesButton ||\n !this.$tnaTemplate\n ) {\n return;\n }\n\n this.currentTheme = this.$themeSelector.dataset.themeOnLoad;\n\n this.themeCookieName = themeCookieName;\n\n this.cookies = new Cookies();\n\n this.$themeSelectorButtons = this.$themeSelector.querySelectorAll(\n \"button.tna-footer__theme-selector-button[value]\",\n );\n\n Array.from(this.$themeSelectorButtons).forEach(($themeSelectorButton) => {\n $themeSelectorButton.addEventListener(\"click\", (e) => {\n const $button = e.target;\n this.setTheme($button.value);\n this.selectThemeSelectorButton($button);\n });\n });\n\n this.$themeSelectorEnableSettingsCookiesButton.addEventListener(\n \"click\",\n () => {\n this.cookies.acceptPolicy(\"settings\");\n },\n );\n\n this.showThemeSelector();\n this.cookies.on(\"changePolicy\", (data) => {\n if (Object.hasOwn(data, \"settings\")) {\n if (data.settings === true) {\n this.cookies.set(this.themeCookieName, this.currentTheme);\n this.$themeSelectorNotice.setAttribute(\"hidden\", \"\");\n } else {\n this.cookies.delete(this.themeCookieName);\n this.$themeSelectorNotice.removeAttribute(\"hidden\");\n }\n }\n });\n }\n\n showThemeSelector() {\n this.$themeSelector.removeAttribute(\"hidden\");\n if (this.cookies.exists(this.themeCookieName)) {\n const $currentThemeButton = Array.from(this.$themeSelectorButtons).find(\n ($button) => $button.value === this.cookies.get(this.themeCookieName),\n );\n if ($currentThemeButton) {\n this.selectThemeSelectorButton($currentThemeButton);\n }\n }\n if (!this.cookies.isPolicyAccepted(\"settings\")) {\n this.$themeSelectorNotice.removeAttribute(\"hidden\");\n }\n }\n\n setTheme(theme) {\n if (theme === \"light\") {\n this.$tnaTemplate.classList.remove(\n \"tna-template--system-theme\",\n \"tna-template--dark-theme\",\n );\n } else if (theme === \"dark\") {\n this.$tnaTemplate.classList.remove(\"tna-template--system-theme\");\n this.$tnaTemplate.classList.add(`tna-template--dark-theme`);\n } else if (theme === \"system\") {\n this.$tnaTemplate.classList.remove(\"tna-template--dark-theme\");\n this.$tnaTemplate.classList.add(`tna-template--system-theme`);\n } else {\n return;\n }\n this.currentTheme = theme;\n if (this.cookies.isPolicyAccepted(\"settings\")) {\n this.cookies.set(this.themeCookieName, this.currentTheme);\n } else {\n this.$themeSelectorNotice.removeAttribute(\"hidden\");\n }\n }\n\n selectThemeSelectorButton($selectedButton) {\n Array.from(this.$themeSelectorButtons).forEach(($button) => {\n if ($button.value === $selectedButton.value) {\n $button.classList.remove(\"tna-button--plain\");\n $button.setAttribute(\"aria-current\", true);\n } else {\n $button.classList.add(\"tna-button--plain\");\n $button.removeAttribute(\"aria-current\");\n }\n });\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","window","TNAFrontendCookies","TNAFrontendCookieEvents","CookieEventHandler","_createClass","debug","arguments","length","undefined","_classCallCheck","this","_defineProperty","log","key","value","_console","_len","args","Array","_key","console","apply","concat","event","callback","Object","hasOwn","events","_toConsumableArray","oneTimeEvents","_this","data","forEach","eventToTrigger","call","i","splice","tnaCookiePolicies","Cookies","_this2","options","document","documentElement","dataset","tnaFrontendDebug","defaultDomain","defaultPath","secure","policiesKey","defaultAge","_options$newInstance","newInstance","_options$noInit","noInit","tnaCookiesDomain","location","hostname","tnaCookiesPath","tnaCookiesInsecure","tnaCookiesPoliciesKey","parseInt","tnaCookiesDefaultAge","policiesCorrectOnInit","keys","policies","every","policy","includes","init","existingPolicies","filteredExistingPolicies","fromEntries","filter","map","savePolicies","_objectSpread","usage","settings","marketing","essential","_console2","_len2","_key2","all","get","deserialised","cookie","split","x","parts","trim","JSON","parse","e","exists","decodeURIComponent","_options$maxAge","maxAge","_options$sameSite","sameSite","_options$domain","domain","_options$path","path","_options$secure","_options$session","session","encodeURIComponent","trigger","set","_this3","setPolicy","accepted","allPolicies","k","toLowerCase","stringify","on","once","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","o","defineProperty","enumerable","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","Footer","$module","themeCookieName","$themeSelector","querySelector","$themeSelectorNotice","$themeSelectorEnableSettingsCookiesButton","$tnaTemplate","currentTheme","themeOnLoad","cookies","$themeSelectorButtons","querySelectorAll","from","$themeSelectorButton","addEventListener","$button","target","setTheme","selectThemeSelectorButton","acceptPolicy","showThemeSelector","setAttribute","removeAttribute","$currentThemeButton","find","isPolicyAccepted","theme","classList","remove","add","$selectedButton"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/footer/footer.js","mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,iBAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,GACC,CATD,CASCK,KAAA,8jDCTDC,EAAAC,QAAOC,0BAAPF,EAAOE,wBAA4B,MAE5B,MAAMC,EAAkB,WAa5B,SARD,SAAAA,IAA2B,IAAfC,EAAKC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAEf,+FAFuBG,CAAAC,KAAAN,GAAAO,EAAAD,KAAA,SAJhB,CAAC,GAACC,EAAAD,KAAA,gBACK,CAAC,GAACC,EAAAD,KAAA,SACV,GAGNA,KAAKL,MAAQA,EACTH,OAAOC,wBAGT,OAFAO,KAAKE,IAAI,mDAEFV,OAAOC,wBAEhBD,OAAOC,wBAA0BO,IACnC,IAAC,EAAAG,IAAA,MAAAC,MAED,WACE,GAAIJ,KAAKL,MAAO,SAAAU,EAAAC,EAAAV,UAAAC,OADXU,EAAI,IAAAC,MAAAF,GAAAG,EAAA,EAAAA,EAAAH,EAAAG,IAAJF,EAAIE,GAAAb,UAAAa,IAGPJ,EAAAK,SAAQR,IAAGS,MAAAN,EAAA,CAAC,gCAA8BO,OAAKL,GACjD,CACF,GAEA,CAAAJ,IAAA,KAAAC,MAKA,SAAGS,EAAOC,GACHC,OAAOC,OAAOhB,KAAKiB,OAAQJ,KAC9Bb,KAAKiB,OAAOJ,GAAS,IAEvBb,KAAKiB,OAAOJ,GAAM,GAAAD,OAAAM,EAAOlB,KAAKiB,OAAOJ,IAAM,CAAEC,GAC/C,GAAC,CAAAX,IAAA,OAAAC,MAED,SAAKS,EAAOC,GACLC,OAAOC,OAAOhB,KAAKmB,cAA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webpack://TNAFrontend/./src/nationalarchives/lib/cookie-events.mjs","webpack://TNAFrontend/./src/nationalarchives/lib/cookies.mjs","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/footer/footer.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 ","window.TNAFrontendCookieEvents ||= null;\n\nexport class CookieEventHandler {\n events = {};\n oneTimeEvents = {};\n debug = false;\n\n constructor(debug = false) {\n this.debug = debug;\n if (window.TNAFrontendCookieEvents) {\n this.log(\"Using existing TNAFrontendCookieEvents instance\");\n /* eslint-disable-next-line no-constructor-return */\n return window.TNAFrontendCookieEvents;\n }\n window.TNAFrontendCookieEvents = this;\n }\n\n log(...args) {\n if (this.debug) {\n /* eslint-disable-next-line no-console */\n console.log(\"[TNA Frontend Cookie Events]\", ...args);\n }\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.log(`Triggering event: ${event}`, data);\n this.events[event].forEach((eventToTrigger) =>\n eventToTrigger.call(this, data),\n );\n }\n if (Object.hasOwn(this.oneTimeEvents, event)) {\n this.log(`Triggering one-time event: ${event}`, data);\n\n for (\n /* eslint-disable-next-line no-magic-numbers */\n let eventIndex = this.oneTimeEvents[event].length - 1;\n /* eslint-disable-next-line no-magic-numbers */\n eventIndex >= 0;\n /* eslint-disable-next-line no-magic-numbers */\n eventIndex -= 1\n ) {\n const eventToTrigger = this.oneTimeEvents[event][eventIndex];\n eventToTrigger.call(this, data);\n /* eslint-disable-next-line no-magic-numbers */\n this.oneTimeEvents[event].splice(eventIndex, 1);\n }\n }\n }\n}\n","/* eslint-disable max-lines */\n/* eslint-disable no-console */\n\nimport { CookieEventHandler } from \"./cookie-events.mjs\";\n\nwindow.TNAFrontendCookies ||= null;\n\nconst tnaCookiePolicies = [\"usage\", \"settings\", \"marketing\", \"essential\"];\n\n/**\n * Class to handle cookies.\n * @class Cookies\n * @constructor\n * @public\n */\nexport default class Cookies {\n /** @protected */\n defaultDomain = \"\";\n /** @protected */\n defaultPath = \"\";\n /** @protected */\n secure = true;\n /** @protected */\n policiesKey = \"\";\n /** @protected */\n events = null;\n /** @protected */\n defaultAge = null;\n /** @protected */\n policiesCorrectOnInit = false;\n /** @protected */\n debug = document.documentElement.dataset.tnaFrontendDebug === \"true\";\n\n /**\n * Create a cookie handler.\n * @param {String} [options.defaultDomain] - The domain to register the cookie with.\n * @param {String} [options.path] - The domain to register the cookie with.\n * @param {Boolean} [options.secure] - Only set cookie in HTTPS environments.\n * @param {String} [options.policiesKey] - The name of the cookie.\n * @param {Number} [options.defaultAge] - The default age of non-session cookies.\n * @param {String} [options.newInstance=false] - Create a fresh instance of the cookie class.\n * @param {Boolean} [options.noInit=false] - Don't initialise a blank cookie policy.\n */\n constructor(options = {}) {\n const {\n defaultDomain,\n defaultPath,\n secure,\n policiesKey,\n defaultAge,\n newInstance = false,\n noInit = false,\n } = options;\n if (!newInstance && window.TNAFrontendCookies) {\n /* eslint-disable-next-line no-constructor-return */\n return window.TNAFrontendCookies;\n }\n if (defaultDomain) {\n this.defaultDomain = defaultDomain;\n } else {\n this.defaultDomain =\n document.documentElement.dataset.tnaCookiesDomain ||\n window.location.hostname;\n }\n if (defaultPath) {\n this.defaultPath = defaultPath;\n } else {\n this.defaultPath = document.documentElement.dataset.tnaCookiesPath || \"/\";\n }\n if (secure) {\n this.secure = secure;\n } else {\n this.secure =\n document.documentElement.dataset.tnaCookiesInsecure !== \"true\";\n }\n if (policiesKey) {\n this.policiesKey = policiesKey;\n } else {\n this.policiesKey =\n document.documentElement.dataset.tnaCookiesPoliciesKey ||\n \"cookies_policy\";\n }\n if (defaultAge) {\n this.defaultAge = defaultAge;\n } else {\n /* eslint-disable-next-line no-magic-numbers */\n const secondsInAYear = 365 * 24 * 60 * 60;\n this.defaultAge =\n parseInt(document.documentElement.dataset.tnaCookiesDefaultAge, 10) ||\n secondsInAYear;\n }\n this.events = new CookieEventHandler(this.debug);\n this.policiesCorrectOnInit =\n Object.keys(this.policies).length === tnaCookiePolicies.length &&\n tnaCookiePolicies.every(\n (policy) =>\n Object.keys(this.policies).includes(policy) &&\n typeof this.policies[policy] === \"boolean\",\n );\n if (!this.policiesCorrectOnInit && !noInit) {\n this.init();\n }\n this.log({\n defaultDomain: this.defaultDomain,\n defaultPath: this.defaultPath,\n secure: this.secure,\n policiesKey: this.policiesKey,\n defaultAge: this.defaultAge,\n policiesCorrectOnInit: this.policiesCorrectOnInit,\n });\n if (!newInstance && !window.TNAFrontendCookies) {\n window.TNAFrontendCookies = this;\n }\n }\n\n /** @protected */\n init() {\n const existingPolicies = this.policies;\n this.log(\"Existing policies on init:\", existingPolicies);\n const filteredExistingPolicies = Object.fromEntries(\n Object.keys(existingPolicies)\n .filter((policy) => tnaCookiePolicies.includes(policy))\n .map((policy) => [policy, existingPolicies[policy]]),\n );\n if (Object.keys(filteredExistingPolicies).length) {\n this.log(\"Filtered existing policies:\", filteredExistingPolicies);\n }\n this.savePolicies({\n usage: false,\n settings: false,\n marketing: false,\n ...filteredExistingPolicies,\n essential: true,\n });\n }\n\n log(...args) {\n if (this.debug) {\n console.log(\"[TNA Frontend Cookies]\", ...args, this.all);\n }\n }\n\n destroyInstance() {\n this.log(\"Destroying TNAFrontendCookies instance\");\n window.TNAFrontendCookies = null;\n }\n\n /** @protected */\n /* eslint-disable-next-line class-methods-use-this */\n get all() {\n const deserialised = {};\n document.cookie\n .split(\"; \")\n .filter((cookie) => cookie.trim() !== \"\")\n .forEach((cookie) => {\n const parts = cookie.trim().split(\"=\");\n const [key, value] = parts;\n if (key) {\n deserialised[key] = decodeURIComponent(value || \"\");\n }\n });\n return deserialised;\n }\n\n /** @protected */\n get policies() {\n try {\n return JSON.parse(this.get(this.policiesKey) || \"{}\");\n // eslint-disable-next-line no-unused-vars\n } catch (error) {\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|null}\n */\n get(key) {\n if (this.exists(key)) {\n return decodeURIComponent(this.all[key]);\n }\n return 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=this.defaultAge] - 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.defaultDomain] - The domain to register the cookie with.\n * @param {String} [options.path=this.defaultPath] - The path to register the cookie with.\n * @param {String} [options.secure=this.secure] - Only set cookie in HTTPS environments.\n * @param {String} [options.session=false] - Set a session cookie.\n */\n set(key, value, options = {}) {\n const {\n maxAge = this.defaultAge,\n sameSite = \"Lax\",\n domain = this.defaultDomain,\n path = this.defaultPath,\n secure = this.secure,\n session = false,\n } = options;\n if (!key) {\n return;\n }\n let secureString = \"\";\n if (secure) {\n secureString = \"; secure\";\n }\n let sessionString = \"\";\n if (!session) {\n sessionString = `; max-age=${maxAge}`;\n }\n const cookie = `${encodeURIComponent(key)}=${encodeURIComponent(value)}; domain=${domain}; samesite=${sameSite}; path=${path}${sessionString}${secureString}`;\n document.cookie = cookie;\n this.log(\"Set cookie:\", {\n key,\n value,\n maxAge,\n path,\n sameSite,\n domain,\n secure,\n session,\n cookie,\n });\n this.events.trigger(\"setCookie\", {\n key,\n value,\n maxAge,\n path,\n sameSite,\n domain,\n secure,\n session,\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 = this.defaultDomain) {\n const options = { maxAge: -1, path, domain: domain || this.defaultDomain };\n this.set(key, \"\", options);\n this.log(\"Deleted cookie:\", { key, path, domain, ...options });\n this.events.trigger(\"deleteCookie\", { key, ...options });\n }\n\n /**\n * Delete all cookies.\n */\n deleteAll(path = \"/\", domain = this.defaultDomain) {\n Object.keys(this.all).forEach((cookie) => {\n this.delete(cookie, path, domain);\n });\n this.log(\"Deleted all cookies\", { path, domain });\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.log(\"Accepting policy:\", 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.log(\"Rejecting policy:\", 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 this.log(\"Cannot change essential policy, it is always accepted.\");\n return;\n }\n this.log(`Setting policy ${policy} to ${accepted}`);\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 this.log(\"Accepting all policies\");\n const allPolicies = Object.fromEntries(\n Object.keys(this.policies).map((key) => [key.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 this.log(\"Rejecting all policies\");\n const allPolicies = {\n ...Object.fromEntries(\n Object.keys(this.policies).map((key) => [key.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.log(\"Saving policies:\", 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 if (Object.hasOwn(this.policies, policy)) {\n return this.policies[policy] === true;\n }\n return 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.log(`Adding event listener for: ${event}`);\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.log(`Adding one-time event listener for: ${event}`);\n this.events.once(event, callback);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import Cookies from \"../../lib/cookies.mjs\";\n\nexport class Footer {\n constructor($module, themeCookieName = \"theme\") {\n this.$module = $module;\n this.$themeSelector =\n $module && $module.querySelector(\".tna-footer__theme-selector\");\n this.$themeSelectorNotice =\n $module && $module.querySelector(\".tna-footer__theme-selector-notice\");\n this.$themeSelectorEnableSettingsCookiesButton =\n this.$themeSelectorNotice &&\n this.$themeSelectorNotice.querySelector(\n \".tna-footer__theme-selector-enable-settings-cookies\",\n );\n this.$tnaTemplate = document.querySelector(\".tna-template\");\n\n if (\n !this.$module ||\n !this.$themeSelector ||\n !this.$themeSelectorNotice ||\n !this.$themeSelectorEnableSettingsCookiesButton ||\n !this.$tnaTemplate\n ) {\n return;\n }\n\n this.currentTheme = this.$themeSelector.dataset.themeOnLoad;\n\n this.themeCookieName = themeCookieName;\n\n this.cookies = new Cookies();\n\n this.$themeSelectorButtons = this.$themeSelector.querySelectorAll(\n \"button.tna-footer__theme-selector-button[value]\",\n );\n\n Array.from(this.$themeSelectorButtons).forEach(($themeSelectorButton) => {\n $themeSelectorButton.addEventListener(\"click\", (event) => {\n const $button = event.target;\n this.setTheme($button.value);\n this.selectThemeSelectorButton($button);\n });\n });\n\n this.$themeSelectorEnableSettingsCookiesButton.addEventListener(\n \"click\",\n () => {\n this.cookies.acceptPolicy(\"settings\");\n },\n );\n\n this.showThemeSelector();\n this.cookies.on(\"changePolicy\", (data) => {\n if (Object.hasOwn(data, \"settings\")) {\n if (data.settings === true) {\n this.cookies.set(this.themeCookieName, this.currentTheme);\n this.$themeSelectorNotice.setAttribute(\"hidden\", \"\");\n } else {\n this.cookies.delete(this.themeCookieName);\n this.$themeSelectorNotice.removeAttribute(\"hidden\");\n }\n }\n });\n }\n\n showThemeSelector() {\n this.$themeSelector.removeAttribute(\"hidden\");\n if (this.cookies.exists(this.themeCookieName)) {\n const $currentThemeButton = Array.from(this.$themeSelectorButtons).find(\n ($button) => $button.value === this.cookies.get(this.themeCookieName),\n );\n if ($currentThemeButton) {\n this.selectThemeSelectorButton($currentThemeButton);\n }\n }\n if (!this.cookies.isPolicyAccepted(\"settings\")) {\n this.$themeSelectorNotice.removeAttribute(\"hidden\");\n }\n }\n\n setTheme(theme) {\n if (theme === \"light\") {\n this.$tnaTemplate.classList.remove(\n \"tna-template--system-theme\",\n \"tna-template--dark-theme\",\n );\n } else if (theme === \"dark\") {\n this.$tnaTemplate.classList.remove(\"tna-template--system-theme\");\n this.$tnaTemplate.classList.add(`tna-template--dark-theme`);\n } else if (theme === \"system\") {\n this.$tnaTemplate.classList.remove(\"tna-template--dark-theme\");\n this.$tnaTemplate.classList.add(`tna-template--system-theme`);\n } else {\n return;\n }\n this.currentTheme = theme;\n if (this.cookies.isPolicyAccepted(\"settings\")) {\n this.cookies.set(this.themeCookieName, this.currentTheme);\n } else {\n this.$themeSelectorNotice.removeAttribute(\"hidden\");\n }\n }\n\n selectThemeSelectorButton($selectedButton) {\n Array.from(this.$themeSelectorButtons).forEach(($button) => {\n if ($button.value === $selectedButton.value) {\n $button.classList.remove(\"tna-button--plain\");\n $button.setAttribute(\"aria-current\", true);\n } else {\n $button.classList.add(\"tna-button--plain\");\n $button.removeAttribute(\"aria-current\");\n }\n });\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","_window","window","TNAFrontendCookieEvents","CookieEventHandler","debug","arguments","length","undefined","_classCallCheck","this","_defineProperty","log","key","value","_console","_len","args","Array","_key","console","apply","concat","event","callback","Object","hasOwn","events","_toConsumableArray","oneTimeEvents","_this","data","forEach","eventToTrigger","call","eventIndex","splice","TNAFrontendCookies","tnaCookiePolicies","Cookies","options","document","documentElement","dataset","tnaFrontendDebug","defaultDomain","defaultPath","secure","policiesKey","defaultAge","_options$newInstance","newInstance","_options$noInit","noInit","tnaCookiesDomain","location","hostname","tnaCookiesPath","tnaCookiesInsecure","tnaCookiesPoliciesKey","parseInt","tnaCookiesDefaultAge","policiesCorrectOnInit","keys","policies","every","policy","includes","init","existingPolicies","filteredExistingPolicies","fromEntries","filter","map","savePolicies","_objectSpread","usage","settings","marketing","essential","all","get","deserialised","cookie","split","trim","_parts","_slicedToArray","decodeURIComponent","JSON","parse","error","exists","_options$maxAge","maxAge","_options$sameSite","sameSite","_options$domain","domain","_options$path","path","_options$secure","_options$session","session","secureString","sessionString","encodeURIComponent","trigger","set","_this2","setPolicy","accepted","allPolicies","toLowerCase","stringify","on","once","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","o","defineProperty","enumerable","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","Footer","$module","themeCookieName","$themeSelector","querySelector","$themeSelectorNotice","$themeSelectorEnableSettingsCookiesButton","$tnaTemplate","currentTheme","themeOnLoad","cookies","$themeSelectorButtons","querySelectorAll","from","$themeSelectorButton","addEventListener","$button","target","setTheme","selectThemeSelectorButton","acceptPolicy","showThemeSelector","setAttribute","removeAttribute","$currentThemeButton","find","isPolicyAccepted","theme","classList","remove","add","$selectedButton"],"sourceRoot":""}
|
|
@@ -35,8 +35,8 @@ export class Footer {
|
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
Array.from(this.$themeSelectorButtons).forEach(($themeSelectorButton) => {
|
|
38
|
-
$themeSelectorButton.addEventListener("click", (
|
|
39
|
-
const $button =
|
|
38
|
+
$themeSelectorButton.addEventListener("click", (event) => {
|
|
39
|
+
const $button = event.target;
|
|
40
40
|
this.setTheme($button.value);
|
|
41
41
|
this.selectThemeSelectorButton($button);
|
|
42
42
|
});
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
items: [
|
|
53
53
|
{
|
|
54
54
|
text: "About us",
|
|
55
|
-
href: (params.defaultContentBaseURL or "") ~ "/about/"
|
|
55
|
+
href: (params.defaultContentBaseURL or "") ~ "/about-us/"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
text: "Contact us",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
text: "Press room",
|
|
79
|
-
href: (params.defaultContentBaseURL or "") ~ "/about/press-
|
|
79
|
+
href: (params.defaultContentBaseURL or "") ~ "/about-us/press-and-media/"
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
text: "Jobs",
|
|
83
|
-
href: (params.defaultContentBaseURL or "") ~ "/about/jobs/"
|
|
83
|
+
href: (params.defaultContentBaseURL or "") ~ "/about-us/jobs-and-opportunities/"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
text: "British citizenship services",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/gallery/gallery.scss","../../../../src/nationalarchives/tools/_a11y.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss","../../../../src/nationalarchives/tools/_borders.scss","../../../../src/nationalarchives/variables/_borders.scss","../../../../src/nationalarchives/tools/_media.scss"],"names":[],"mappings":"AA8OA,8DACE,yCACA,uCACA,uCACA,yCACA,yCACA,6BACA,6CACA,mCACA,6CACA,2CACA,uDACA,uDACA,mEACA,6CA3KA,4CAJA,gCAmOF,sBACE,qCAhOA,4CAyOF,uFACE,uCACA,qCACA,qCACA,uCACA,uCACA,2BACA,mCACA,iCACA,2CACA,yCACA,yCACA,qDACA,qDACA,iEAvPA,4CAJA,gCAwcF,8BACE,wGAMA,0BACA,0BAEA,4DAEA,+BAZF,8BAaI,2BCxgBJ,aACE,gBAUA,yBACE,aC9BJ,aAGE,aACA,kDACA,WAEA,mBAEA,qBACE,oBAEA,gBACA,WAEA,aACA,SAGF,2BACE,OAGF,qDAEE,gBACA,WAGF,oBACE,kBACA,UAEA,mBAEA,iDCeF,wBAEA,2BDZA,mBACE,aACA,sBACA,oBACA,uBAGF,0BACE,oBAEA,cACA,kBEpCF,YCiBsB,IDlCtB,eF2DA,0BACE,aACA,sBACA,oBACA,SAGF,gCACE,WAEA,kBIxEF,cCDsB,ILgFtB,yBACE,cAGF,+BACE,mBACA,oBAEA,sBFSE,2DEJJ,iCACE,WACA,gBACA,iBAEA,kBACA,SACA,UAEA,oBAEA,wDACE,aAIJ,gCACE,UAEA,aACA,mBAEA,kBACA,MACA,SAEA,yBAEA,YACA,mBAEA,UAEA,eACA,oBE1GF,YCiBsB,IH4FpB,oFAEE,UAIJ,8BACE,kBAEA,2BAEA,OAGF,8BACE,mBAEA,yBAEA,QAMA,kFFhFF,gDAIA,uEAiCI,mEEmDJ,qCACE,WAEA,aACA,cAEA,cACA,UFzEE,0GE8EF,yBAGF,mEACE,0BAGF,mEACE,wBAGF,yBACE,iBACA,2CACA,aAEA,gBACA,WAEA,aACA,qCACA,2BACA,SAEA,cAGF,8BACE,YACA,aACA,eAEA,kBAEA,YIhNF,cCDsB,ILoNpB,eAOE,2CACE,WAEA,kBACA,QACA,UFrHF,0DE8HA,wDACE,WAEA,kBACA,QACA,UF9BJ,8BEqCF,oCACE,WACA,YAEA,kBACA,QACA,iBAGF,oCACE,wBAEA,qBAEA,kBACA,MACA,OACA,UAEA,0BF7LF,qCIvEA,iBAiBA,YCiBsB,ILyCtB,4CEiME,wBAGF,0DACE,gBACA,iBAGF,mDACE,WACA,YAEA,kBACA,QACA,UACA,mBMnPF,kDNuPE,yBACE,sCMpNJ,wBNyNE,yBACE,sCMlPJ,wBNuPE,oCE3SF,oBFgTA,sBInTA,cCDsB,ILyTtB,2CACE,aAGF,uDACE,SAGF,gDACE,iBAGF,sDACE,mBAGF,qDACE,kBACA,iBAGF,mFACE","file":"gallery.css","sourcesContent":["@use \"sass:list\";\n@use \"sass:map\";\n@use \"sass:meta\";\n@use \"../variables/borders\";\n@use \"../variables/forms\";\n@use \"../variables/colour\";\n@use \"../variables/features\";\n@use \"../tools/media\";\n\n$base-colours: (\n \"background\",\n \"font-base\",\n \"font-dark\",\n \"font-light\",\n \"icon-light\",\n \"link\",\n \"link-visited\",\n \"keyline\",\n \"keyline-dark\"\n);\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index((\"keyline\", \"keyline-dark\"), $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour)\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)}\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if(sass($important): !important; else: null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n outline-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n%colour-input {\n @include colour-font(\"input-foreground\");\n @include colour-background(\"input-background\");\n @include colour-border(\"input-border\", forms.$form-field-border-width);\n}\n\n@mixin colour-input() {\n @extend %colour-input;\n}\n\n@mixin thick-keyline($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline-dark\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline-dark\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"accent-border\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"accent-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n $border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"form-error-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour, $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width #{brand-colour($brandColour)} solid;\n } @else {\n border: $border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n@mixin thick-keyline-transparent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width transparent solid;\n } @else {\n border: $border-width transparent solid;\n }\n}\n\n%always-light {\n @include colour-css-vars;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast;\n }\n}\n\n@mixin always-light {\n @extend %always-light;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-border: var(--accent-border-bright);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-border: var(--accent-border-bright);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%base {\n @each $name, $value in $base-colours {\n --#{$name}: var(--base-#{$value});\n }\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin base {\n @extend %base;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n --accent-border: var(--accent-background);\n\n @include colour-background(\"background\");\n @include colour-font(\"font-base\");\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n }\n\n .tna-template--dark-theme & {\n // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-border: #{colour.brand-colour(\"yellow\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"yellow\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"yellow\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --accent-border: #{colour.brand-colour(\"black\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"grey\")} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %accent-lighter-text;\n @extend %black-accent;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --accent-border: #{colour.brand-colour(\"maroon\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"pink\")} !important;\n --button-accented-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %accent-lighter-text;\n @extend %pink-accent;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --accent-border: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"orange\")} !important;\n --button-accented-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %accent-lighter-text;\n @extend %orange-accent;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --accent-border: #{colour.brand-colour(\"forest\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"green\")} !important;\n --button-accented-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %accent-lighter-text;\n @extend %green-accent;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --accent-border: #{colour.brand-colour(\"navy\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"blue\")} !important;\n --button-accented-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %accent-lighter-text;\n @extend %blue-accent;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n\n%image-loader-background {\n background: linear-gradient(\n -45deg,\n rgb(0 0 0 / 25%),\n rgb(255 255 255 / 25%),\n rgb(0 0 0 / 25%)\n );\n background-size: 500% 500%;\n background-position: 0 50%;\n\n animation: image-loader-background ease-in-out 1.2s infinite;\n\n @media (prefers-reduced-motion) {\n animation: none !important;\n }\n}\n\n@mixin image-loader-background {\n @if features.$image-loader-animations {\n @extend %image-loader-background;\n }\n}\n","@use \"sass:map\";\n@use \"sass:math\";\n@use \"../variables/spacing\";\n@use \"../variables/typography\";\n@use \"../tools/media\";\n\n/*\n * ------------------------------------------\n * Spacing is created with rem rather than px\n * units as when users use a custom font size\n * some browsers handle the resize of rem and\n * em separately from px which causes spacing\n * and layout issues, so to ensure everything\n * remaians consistent we use rem for spacing\n * and typography. The original intention was\n * separation so that we could scale the type\n * without affecting spacing, but in practice\n * there are too many ways to change the font\n * size in various browsers and devices\n * ------------------------------------------\n */\n@function space($size) {\n // @return #{$size * spacing.$spacing-unit-px}px;\n @return #{$size}rem;\n}\n\n%space-above {\n margin-top: space(2);\n @extend %no-space-above-for-first-children;\n}\n\n%space-only-above {\n margin: #{space(2)} 0 0;\n @extend %no-space-above-for-first-children;\n}\n\n%no-space-above-for-first-children {\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above($zero-other-margins: false) {\n @if $zero-other-margins {\n @extend %space-only-above;\n } @else {\n @extend %space-above;\n }\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"../../variables/borders\" as bordersVars;\n@use \"../../tools/a11y\";\n@use \"../../tools/borders\";\n@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-gallery {\n @include spacing.space-above;\n\n display: grid;\n grid-template: min-content min-content 1fr / 2fr 1fr;\n gap: 0 spacing.space(1);\n\n border-radius: 0.1px;\n\n &__header {\n padding-bottom: spacing.space(1);\n\n grid-column: 1 / 3;\n grid-row: 1;\n\n display: flex;\n gap: spacing.space(2);\n }\n\n &__header-inner {\n flex: 1;\n }\n\n &__items,\n &__navigation-buttons {\n grid-column: 1 / 3;\n grid-row: 2;\n }\n\n &__items {\n position: relative;\n z-index: 1;\n\n border-radius: 0.1px;\n\n .tna-template--clicked &:focus {\n @include a11y.no-focus-outline;\n }\n }\n\n &__item {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: center;\n }\n\n &__item-header {\n padding: 0 spacing.space(1) spacing.space(1);\n\n line-height: 1;\n text-align: center;\n\n @include typography.main-font-weight-bold;\n @include typography.font-size(16);\n }\n\n &__item-figure {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: spacing.space(1);\n }\n\n &__item-figure-inner {\n width: 100%;\n\n position: relative;\n\n @include colour.contrast;\n\n @include borders.rounded-border;\n }\n\n &__item-image {\n margin: 0 auto;\n }\n\n &__item-description {\n margin-bottom: spacing.space(1);\n padding: spacing.space(0.5) spacing.space(1);\n\n align-self: flex-start;\n\n @include colour.thick-keyline-dark(left);\n }\n\n &__navigation-buttons {\n width: 100%;\n max-height: 50vh;\n aspect-ratio: 3 / 2;\n\n position: relative;\n top: spacing.space(2);\n z-index: 2;\n\n pointer-events: none;\n\n .tna-template--touched & {\n display: none;\n }\n }\n\n &__navigation-button {\n width: 35%;\n\n display: flex;\n align-items: center;\n\n position: absolute;\n top: 0;\n bottom: 0;\n\n background: transparent;\n\n border: none;\n border-radius: 0.1px;\n\n opacity: 0;\n\n cursor: pointer;\n pointer-events: auto;\n @include typography.main-font-weight-bold;\n\n &:hover,\n &:focus-visible {\n opacity: 1;\n }\n }\n\n &__navigation-prev {\n padding-left: 1rem;\n\n justify-content: flex-start;\n\n left: 0;\n }\n\n &__navigation-next {\n padding-right: 1rem;\n\n justify-content: flex-end;\n\n right: 0;\n }\n\n &__navigation-button-label {\n @include colour.accent;\n\n &,\n &:hover {\n @include colour.colour-font(\"button-accented-text\");\n @include colour.colour-background(\"button-accented-background\");\n @include colour.colour-border(\"button-accented-background\");\n }\n }\n\n &__navigation-button-icon {\n content: \"\";\n\n width: 0.75rem;\n height: 0.75rem;\n\n display: block;\n flex: none;\n\n @include colour.colour-border(\"font-dark\", 4px, solid, top);\n @include colour.colour-border(\"font-dark\", 4px, solid, right);\n\n transform-origin: 50% 50%;\n }\n\n &__navigation-prev &__navigation-button-icon {\n transform: rotate(-135deg);\n }\n\n &__navigation-next &__navigation-button-icon {\n transform: rotate(45deg);\n }\n\n &__navigation {\n max-height: 40rem;\n max-height: clamp(15rem, calc(100vh - #{spacing.space(2)}), 40rem);\n padding: spacing.space(1);\n\n grid-column: 1 / 3;\n grid-row: 3;\n\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n grid-auto-rows: min-content;\n gap: spacing.space(1);\n\n overflow: auto;\n }\n\n &__navigation-item {\n min-width: 0;\n min-height: 0;\n aspect-ratio: 1;\n\n position: relative;\n\n border: none;\n @include borders.rounded-border;\n\n cursor: pointer;\n\n @include colour.contrast;\n\n @include colour.image-loader-background;\n\n &:hover {\n &::after {\n content: \"\";\n\n position: absolute;\n inset: 0;\n z-index: 2;\n\n @include colour.thick-keyline-accent;\n }\n }\n\n &[aria-current=\"true\"] {\n @include colour.accent;\n\n &::after {\n content: \"\";\n\n position: absolute;\n inset: 0;\n z-index: 2;\n\n @include colour.thick-keyline-brand(\"\", \"black\");\n }\n }\n }\n\n &__navigation-item-image {\n width: 100%;\n height: 100%;\n\n position: absolute;\n inset: 0;\n object-fit: cover;\n }\n\n &__navigation-item-label {\n padding: spacing.space(0.25) spacing.space(0.75);\n\n display: inline-block;\n\n position: absolute;\n top: 0;\n left: 0;\n z-index: 4;\n\n text-transform: capitalize;\n\n @include colour.colour-font(\"font-dark\");\n @include typography.font-size(24);\n @include typography.main-font-weight-bold;\n\n @include colour.colour-background(\"background\");\n\n border-radius: 0 0 bordersVars.$rounded-border-radius 0;\n }\n\n &--interactive &__item-figure-inner {\n max-height: 50vh;\n aspect-ratio: 3 / 2;\n }\n\n &--interactive &__item-image {\n width: 100%;\n height: 100%;\n\n position: absolute;\n inset: 0;\n z-index: 1;\n object-fit: contain;\n }\n\n @include media.on-medium {\n &__navigation {\n grid-template-columns: repeat(4, 1fr);\n }\n }\n\n @include media.on-mobile {\n &__navigation {\n grid-template-columns: repeat(3, 1fr);\n }\n }\n\n @include media.on-tiny {\n &__navigation-item-label {\n @include typography.font-size(18);\n }\n }\n\n &--bounded {\n @include borders.rounded-border;\n @include colour.tint;\n }\n\n &--bounded &__header {\n padding: spacing.space(1);\n }\n\n &--bounded &__navigation-buttons {\n top: spacing.space(3);\n }\n\n &--bounded &__item-header {\n padding-top: spacing.space(1);\n }\n\n &--bounded &__item-figure-inner {\n border-radius: 0.1px;\n }\n\n &--bounded &__item-description {\n margin-right: spacing.space(1);\n margin-left: spacing.space(1);\n }\n\n &__items--hide-item-titles &__item &__item-header {\n display: none;\n }\n}\n","@use \"../variables/a11y\";\n@use \"colour\";\n@use \"borders\";\n\n@mixin visually-hidden {\n width: 1px !important;\n height: 1px !important;\n margin: 0 !important;\n padding: 0 !important;\n\n overflow: hidden !important;\n\n position: absolute !important;\n top: -9999px !important;\n left: -9999px !important;\n z-index: -1 !important;\n\n background-color: transparent !important;\n\n border: 0 !important;\n\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n}\n\n%focus-outline {\n outline: a11y.$focus-outline-outer-width colour.brand-colour(\"black\") solid !important;\n outline-offset: a11y.$focus-outline-inner-width !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"yellow\") !important;\n\n transition:\n outline-offset 0.1s,\n box-shadow 0.1s;\n\n .tna-template--dark-theme & {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"black\") !important;\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"black\") !important;\n }\n }\n}\n\n@mixin focus-outline {\n @extend %focus-outline;\n}\n\n@mixin no-focus-outline {\n outline: none !important;\n\n box-shadow: none !important;\n}\n\n%active-outline {\n outline: a11y.$focus-outline-active-outer-width colour.brand-colour(\"black\")\n solid !important;\n outline-offset: a11y.$focus-outline-active-inner-width !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"yellow\") !important;\n\n transition: none;\n\n .tna-template--dark-theme & {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"black\") !important;\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"black\") !important;\n }\n }\n}\n\n@mixin active-outline {\n @extend %active-outline;\n}\n\n%faux-full-outline {\n position: relative;\n}\n\n%faux-full-outline-anchor {\n &::before {\n content: \"\";\n\n position: absolute;\n inset: 0;\n z-index: 9;\n\n @include borders.rounded-border;\n }\n\n &:focus,\n &:active {\n @include no-focus-outline;\n }\n\n &:focus {\n &::before {\n @include focus-outline;\n }\n }\n\n &:active {\n &::before {\n @include active-outline;\n }\n }\n}\n\n@mixin faux-full-outline($anchor_selector) {\n @extend %faux-full-outline;\n\n #{$anchor_selector} {\n @extend %faux-full-outline-anchor;\n }\n}\n\n%focus-indicator-only-on-keyboard-focus {\n &:focus:not(:focus-visible) {\n @include no-focus-outline;\n }\n}\n\n@mixin focus-indicator-only-on-keyboard-focus {\n @extend %focus-indicator-only-on-keyboard-focus;\n}\n","@use \"sass: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 interactable-text-decoration {\n text-decoration-thickness: typography.$interactable-text-decoration-thickness;\n text-underline-offset: typography.$interactable-text-decoration-offset;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n text-underline-offset: typography.$interactable-text-decoration-offset;\n}\n\n@mixin heading-generator(\n $font-size-default,\n $font-size-medium,\n $font-size-small,\n $font-size-tiny,\n $line-height\n) {\n $small-and-tiny-identical: $font-size-small == $font-size-tiny;\n $medium-small-and-tiny-identical: $font-size-medium == $font-size-small and\n $small-and-tiny-identical;\n $all-identical: $font-size-default == $font-size-medium and\n $medium-small-and-tiny-identical and $small-and-tiny-identical;\n line-height: $line-height;\n @include font-size($font-size-default);\n\n @if $all-identical != true {\n @if $medium-small-and-tiny-identical != true {\n @include media.on-medium {\n @include font-size($font-size-medium);\n }\n\n @if $small-and-tiny-identical != true {\n @include media.on-small {\n @include font-size($font-size-small);\n }\n\n @include media.on-tiny {\n @include font-size($font-size-tiny);\n }\n } @else {\n @include media.on-mobile {\n @include font-size($font-size-small);\n }\n }\n } @else {\n @include media.on-smaller-than-large {\n @include font-size($font-size-medium);\n }\n }\n }\n}\n","@use \"sass:math\";\n\n/*\n * ------------------------------------------\n * The typefaces, sizes and spacings that are\n * defined in this file have been selected to\n * ensure 100% match with the latest National\n * Archives brand guidelines - avoid changing\n * or overwriting any of these values without\n * signing off with the Digital Services team\n * first\n * ------------------------------------------\n */\n\n$relative-1rem-px: 16; // 16px = 1rem\n\n/*\n * ------------------------------------------\n * When true, use the included font files for\n * Open Sans and Roboto Mono, rather than the\n * versions hosted by Google Fonts\n * ------------------------------------------\n */\n$use-local-fonts: false !default;\n\n$body-font-size-px: 19 !default;\n$body-font-size-px-medium: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: 1.75 !default;\n\n$interactable-text-decoration-offset: 0.125em !default;\n$interactable-text-decoration-thickness: #{math.div(1.5, $relative-1rem-px)}rem !default;\n$interactive-text-decoration-thickness: #{math.div(4, $relative-1rem-px)}rem !default;\n\n$main-font-family-name: \"Open Sans\" !default;\n$main-font-family:\n #{$main-font-family-name},\n sans-serif;\n$main-font-weight: 400 !default;\n$main-font-weight-medium: 600 !default;\n$main-font-weight-bold: 700 !default;\n$main-font-file: \"OpenSans-Regular.ttf\" !default;\n$main-font-file-medium: \"OpenSans-SemiBold.ttf\" !default;\n$main-font-file-bold: \"OpenSans-Bold.ttf\" !default;\n\n/*\n * ------------------------------------------\n * To use Supria Sans Condensed (which is the\n * approved heading typeface for The National\n * Archives), you need to obtain a licence to\n * properly embed the CSS files with the font\n * definitions in your service - check with a\n * member of the Digital Services team on how\n * to get a licence\n * ------------------------------------------\n */\n$heading-font-family-name: \"supria-sans-condensed\" !default;\n$heading-font-family:\n #{$heading-font-family-name},\n \"Arial Narrow\",\n sans-serif;\n$heading-font-weight: 500 !default;\n\n/*\n * ------------------------------------------\n * The detail font should be a monospace font\n * and is used for chips, supertitles as well\n * as the date search component\n * ------------------------------------------\n */\n$detail-font-family-name: \"Roboto Mono\" !default;\n$detail-font-family:\n #{$detail-font-family-name},\n monospace;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n$detail-font-file: \"RobotoMono-Regular.ttf\" !default;\n$detail-font-file-bold: \"RobotoMono-Medium.ttf\" !default;\n\n$heading-xl-font-size-default: 64 !default;\n$heading-xl-font-size-medium: 48 !default;\n$heading-xl-font-size-small: 36 !default;\n$heading-xl-font-size-tiny: $heading-xl-font-size-small !default;\n$heading-xl-line-height: 1.1 !default;\n\n$heading-l-font-size-default: 36 !default;\n$heading-l-font-size-medium: 32 !default;\n$heading-l-font-size-small: 29 !default;\n$heading-l-font-size-tiny: $heading-l-font-size-small !default;\n$heading-l-line-height: 1.15 !default;\n\n$heading-m-font-size-default: 22 !default;\n$heading-m-font-size-medium: $heading-m-font-size-default !default;\n$heading-m-font-size-small: 21 !default;\n$heading-m-font-size-tiny: $heading-m-font-size-small !default;\n$heading-m-line-height: 1.4 !default;\n\n$heading-s-font-size-default: 19 !default;\n$heading-s-font-size-medium: $heading-s-font-size-default !default;\n$heading-s-font-size-small: $heading-s-font-size-default !default;\n$heading-s-font-size-tiny: $heading-s-font-size-default !default;\n$heading-s-line-height: 1.5 !default;\n\n$code-font-family: Consolas, Monaco, \"Ubuntu Mono\", monospace !default;\n","@use \"../variables/borders\";\n\n@mixin rounded-border {\n border-radius: borders.$rounded-border-radius;\n}\n","$thick-border-width: 5px !default;\n$very-thick-border-width: 8px !default;\n$rounded-border-radius: 2px !default;\n","@use \"sass:math\";\n@use \"../variables/media\";\n@use \"../variables/typography\";\n\n$smallest-large-device-em: #{math.div(\n media.$largest-medium-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-medium-device-em: #{math.div(\n media.$largest-medium-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-medium-device-em: #{math.div(\n media.$largest-small-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-small-device-em: #{math.div(\n media.$largest-small-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-small-device-em: #{math.div(\n media.$largest-tiny-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-tiny-device-em: #{math.div(\n media.$largest-tiny-device-px,\n typography.$relative-1rem-px\n )}em;\n\n$media-large: \"(min-width: #{$smallest-large-device-em})\";\n$media-lt-large: \"(max-width: #{$largest-medium-device-em})\";\n$media-medium: \"(min-width: #{$smallest-medium-device-em}) and (max-width: #{$largest-medium-device-em})\";\n$media-gt-mobile: \"(min-width: #{$smallest-medium-device-em})\";\n$media-mobile: \"(max-width: #{$largest-small-device-em})\";\n$media-small: \"(min-width: #{$smallest-small-device-em}) and (max-width: #{$largest-small-device-em})\";\n$media-gt-tiny: \"(min-width: #{$smallest-small-device-em})\";\n$media-tiny: \"(max-width: #{$largest-tiny-device-em})\";\n\n// https://nationalarchives.github.io/design-system/styles/media/#media-queries\n@mixin on-large() {\n @media #{$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/tools/_spacing.scss","../../../../src/nationalarchives/components/gallery/gallery.scss","../../../../src/nationalarchives/tools/_a11y.scss","../../../../src/nationalarchives/tools/_typography.scss","../../../../src/nationalarchives/variables/_typography.scss","../../../../src/nationalarchives/tools/_borders.scss","../../../../src/nationalarchives/variables/_borders.scss","../../../../src/nationalarchives/tools/_media.scss"],"names":[],"mappings":"AA8OA,8DACE,yCACA,uCACA,uCACA,yCACA,yCACA,6BACA,6CACA,mCACA,6CACA,2CACA,uDACA,uDACA,mEACA,6CA3KA,4CAJA,gCAmOF,sBACE,qCAhOA,4CAyOF,uFACE,uCACA,qCACA,qCACA,uCACA,uCACA,2BACA,mCACA,iCACA,2CACA,yCACA,yCACA,qDACA,qDACA,iEAvPA,4CAJA,gCAwcF,8BACE,wGAMA,0BACA,0BAEA,4DAEA,+BAZF,8BAaI,2BCxgBJ,aACE,gBAUA,yBACE,aC9BJ,aAGE,aACA,kDACA,WAEA,mBAEA,qBACE,oBAEA,gBACA,WAEA,aACA,SAGF,2BACE,OAGF,qDAEE,gBACA,WAGF,oBACE,kBACA,UAEA,mBAEA,iDCeF,wBAEA,2BDZA,mBACE,aACA,sBACA,oBACA,uBAGF,0BACE,oBAEA,cACA,kBEpCF,YCiBsB,IDlCtB,eF2DA,0BACE,aACA,sBACA,oBACA,SAGF,gCACE,WAEA,kBIxEF,cCDsB,ILgFtB,yBACE,cAGF,+BACE,mBACA,oBAEA,sBFSE,2DEJJ,iCACE,WACA,gBACA,iBAEA,kBACA,SACA,UAEA,oBAEA,wDACE,aAIJ,gCACE,UAEA,aACA,mBAEA,kBACA,MACA,SAEA,yBAEA,YACA,mBAEA,UAEA,eACA,oBE1GF,YCiBsB,IH4FpB,oFAEE,UAIJ,8BACE,kBAEA,2BAEA,OAGF,8BACE,mBAEA,yBAEA,QAMA,kFFhFF,gDAIA,uEAiCI,mEEmDJ,qCACE,WAEA,aACA,cAEA,cACA,UFzEE,0GE8EF,yBAGF,mEACE,0BAGF,mEACE,wBAGF,yBACE,iBACA,2CACA,aAEA,gBACA,WAEA,aACA,qCACA,2BACA,SAEA,cAGF,8BACE,YACA,aACA,eAEA,kBAEA,YIhNF,cCDsB,ILoNpB,eAOE,2CACE,WAEA,kBACA,QACA,UFrHF,0DE8HA,wDACE,WAEA,kBACA,QACA,UF9BJ,8BEqCF,oCACE,WACA,YAEA,kBACA,QACA,iBAGF,oCACE,wBAEA,qBAEA,kBACA,MACA,OACA,UAEA,0BF7LF,qCIvEA,iBAiBA,YCiBsB,ILyCtB,4CEiME,wBAGF,0DACE,gBACA,iBAGF,mDACE,WACA,YAEA,kBACA,QACA,UACA,mBMnPF,kDNuPE,yBACE,sCMpNJ,wBNyNE,yBACE,sCMlPJ,wBNuPE,oCE3SF,oBFgTA,sBInTA,cCDsB,ILyTtB,2CACE,aAGF,uDACE,SAGF,gDACE,iBAGF,sDACE,mBAGF,qDACE,kBACA,iBAGF,mFACE","file":"gallery.css","sourcesContent":["@use \"sass:list\";\n@use \"sass:map\";\n@use \"sass:meta\";\n@use \"../variables/borders\";\n@use \"../variables/forms\";\n@use \"../variables/colour\";\n@use \"../variables/features\";\n@use \"../tools/media\";\n\n$base-colours: (\n \"background\",\n \"font-base\",\n \"font-dark\",\n \"font-light\",\n \"icon-light\",\n \"link\",\n \"link-visited\",\n \"keyline\",\n \"keyline-dark\"\n);\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index($base-colours, $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n @if list.index((\"keyline\", \"keyline-dark\"), $name) {\n --base-#{$name}: #{$value};\n }\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour)\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)}\n if(sass($important): !important; else: null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if(sass($important): !important; else: null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width\n colour-var($colour)\n $style\n if(sass($important): !important; else: null);\n } @else {\n outline-color: colour-var($colour)\n if(sass($important): !important; else: null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if(sass($important): !important; else: null);\n}\n\n%colour-input {\n @include colour-font(\"input-foreground\");\n @include colour-background(\"input-background\");\n @include colour-border(\"input-border\", forms.$form-field-border-width);\n}\n\n@mixin colour-input() {\n @extend %colour-input;\n}\n\n@mixin thick-keyline($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"keyline-dark\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"keyline-dark\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\"accent-border\", $border-width, solid, $direction);\n } @else {\n @include colour-border(\"accent-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n $border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"form-error-border\", $border-width, solid);\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour, $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width #{brand-colour($brandColour)} solid;\n } @else {\n border: $border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n@mixin thick-keyline-transparent($direction: \"\", $veryThick: false) {\n $border-width: borders.$thick-border-width;\n @if $veryThick {\n $border-width: borders.$very-thick-border-width;\n }\n @if $direction != \"\" {\n border-#{$direction}: $border-width transparent solid;\n } @else {\n border: $border-width transparent solid;\n }\n}\n\n%always-light {\n @include colour-css-vars;\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast;\n }\n}\n\n@mixin always-light {\n @extend %always-light;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-border: var(--accent-border-bright);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-border: var(--accent-border-bright);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%base {\n @each $name, $value in $base-colours {\n --#{$name}: var(--base-#{$value});\n }\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin base {\n @extend %base;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n --accent-border: var(--accent-background);\n\n @include colour-background(\"background\");\n @include colour-font(\"font-base\");\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n }\n\n .tna-template--dark-theme & {\n // --link: #{map.get(colour.$colour-palette-default, \"link\")};\n // --link-visited: #{map.get(colour.$colour-palette-default, \"link-visited\")};\n\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-border: #{colour.brand-colour(\"yellow\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"yellow\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"yellow\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --accent-border: #{colour.brand-colour(\"black\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"grey\")} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %accent-lighter-text;\n @extend %black-accent;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --accent-border: #{colour.brand-colour(\"maroon\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"pink\")} !important;\n --button-accented-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %accent-lighter-text;\n @extend %pink-accent;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --accent-border: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"orange\")} !important;\n --button-accented-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %accent-lighter-text;\n @extend %orange-accent;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --accent-border: #{colour.brand-colour(\"forest\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"green\")} !important;\n --button-accented-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %accent-lighter-text;\n @extend %green-accent;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --accent-border: #{colour.brand-colour(\"navy\")} !important;\n --accent-border-bright: #{colour.brand-colour(\"blue\")} !important;\n --button-accented-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %accent-lighter-text;\n @extend %blue-accent;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n\n%image-loader-background {\n background: linear-gradient(\n -45deg,\n rgb(0 0 0 / 25%),\n rgb(255 255 255 / 25%),\n rgb(0 0 0 / 25%)\n );\n background-size: 500% 500%;\n background-position: 0 50%;\n\n animation: image-loader-background ease-in-out 1.2s infinite;\n\n @media (prefers-reduced-motion) {\n animation: none !important;\n }\n}\n\n@mixin image-loader-background {\n @if features.$image-loader-animations {\n @extend %image-loader-background;\n }\n}\n","@use \"sass:map\";\n@use \"sass:math\";\n@use \"../variables/spacing\";\n@use \"../variables/typography\";\n@use \"../tools/media\";\n\n/*\n * ------------------------------------------\n * Spacing is created with rem rather than px\n * units as when users use a custom font size\n * some browsers handle the resize of rem and\n * em separately from px which causes spacing\n * and layout issues, so to ensure everything\n * remaians consistent we use rem for spacing\n * and typography. The original intention was\n * separation so that we could scale the type\n * without affecting spacing, but in practice\n * there are too many ways to change the font\n * size in various browsers and devices\n * ------------------------------------------\n */\n@function space($size) {\n // @return #{$size * spacing.$spacing-unit-px}px;\n @return #{$size}rem;\n}\n\n%space-above {\n margin-top: space(2);\n @extend %no-space-above-for-first-children;\n}\n\n%space-only-above {\n margin: #{space(2)} 0 0;\n @extend %no-space-above-for-first-children;\n}\n\n%no-space-above-for-first-children {\n &:first-child {\n margin-top: 0;\n }\n}\n\n@mixin space-above($zero-other-margins: false) {\n @if $zero-other-margins {\n @extend %space-only-above;\n } @else {\n @extend %space-above;\n }\n}\n\n@mixin no-spacing-generator($suffix: \"\") {\n @if $suffix != \"\" {\n $suffix: \"-\" + $suffix;\n }\n @each $property in margin, padding {\n @each $direction in top, bottom {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix},\n .tna-\\!--no-#{$property}-#{$combined-direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n } @else {\n .tna-\\!--no-#{$property}-#{$direction}#{$suffix} {\n #{$property}-#{$direction}: 0 !important;\n }\n }\n }\n }\n}\n\n@mixin spacing-generator($suffix: \"\") {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n\n @include media.on-mobile {\n @each $property in margin, padding {\n @each $direction in top, bottom {\n @each $size, $amount in spacing.$spacing-mobile {\n @if $direction == all {\n .tna-\\!--#{$property}-#{$size} {\n #{$property}: #{space($amount)} !important;\n }\n } @else {\n $combined-direction: \"\";\n @if $direction == top or $direction == bottom {\n $combined-direction: vertical;\n } @else if $direction == right or $direction == left {\n $combined-direction: horizontal;\n }\n @if $combined-direction {\n .tna-\\!--#{$property}-#{$direction}-#{$size},\n .tna-\\!--#{$property}-#{$combined-direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n } @else {\n .tna-\\!--#{$property}-#{$direction}-#{$size} {\n #{$property}-#{$direction}: #{space($amount)} !important;\n }\n }\n }\n }\n }\n }\n }\n}\n","@use \"../../variables/borders\" as bordersVars;\n@use \"../../tools/a11y\";\n@use \"../../tools/borders\";\n@use \"../../tools/colour\";\n@use \"../../tools/media\";\n@use \"../../tools/spacing\";\n@use \"../../tools/typography\";\n\n.tna-gallery {\n @include spacing.space-above;\n\n display: grid;\n grid-template: min-content min-content 1fr / 2fr 1fr;\n gap: 0 spacing.space(1);\n\n border-radius: 0.1px;\n\n &__header {\n padding-bottom: spacing.space(1);\n\n grid-column: 1 / 3;\n grid-row: 1;\n\n display: flex;\n gap: spacing.space(2);\n }\n\n &__header-inner {\n flex: 1;\n }\n\n &__items,\n &__navigation-buttons {\n grid-column: 1 / 3;\n grid-row: 2;\n }\n\n &__items {\n position: relative;\n z-index: 1;\n\n border-radius: 0.1px;\n\n .tna-template--clicked &:focus {\n @include a11y.no-focus-outline;\n }\n }\n\n &__item {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: center;\n }\n\n &__item-header {\n padding: 0 spacing.space(1) spacing.space(1);\n\n line-height: 1;\n text-align: center;\n\n @include typography.main-font-weight-bold;\n @include typography.font-size(16);\n }\n\n &__item-figure {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: spacing.space(1);\n }\n\n &__item-figure-inner {\n width: 100%;\n\n position: relative;\n\n @include colour.contrast;\n\n @include borders.rounded-border;\n }\n\n &__item-image {\n margin: 0 auto;\n }\n\n &__item-description {\n margin-bottom: spacing.space(1);\n padding: spacing.space(0.5) spacing.space(1);\n\n align-self: flex-start;\n\n @include colour.thick-keyline-dark(left);\n }\n\n &__navigation-buttons {\n width: 100%;\n max-height: 50vh;\n aspect-ratio: 3 / 2;\n\n position: relative;\n top: spacing.space(2);\n z-index: 2;\n\n pointer-events: none;\n\n .tna-template--touched & {\n display: none;\n }\n }\n\n &__navigation-button {\n width: 35%;\n\n display: flex;\n align-items: center;\n\n position: absolute;\n top: 0;\n bottom: 0;\n\n background: transparent;\n\n border: none;\n border-radius: 0.1px;\n\n opacity: 0;\n\n cursor: pointer;\n pointer-events: auto;\n @include typography.main-font-weight-bold;\n\n &:hover,\n &:focus-visible {\n opacity: 1;\n }\n }\n\n &__navigation-prev {\n padding-left: 1rem;\n\n justify-content: flex-start;\n\n left: 0;\n }\n\n &__navigation-next {\n padding-right: 1rem;\n\n justify-content: flex-end;\n\n right: 0;\n }\n\n &__navigation-button-label {\n @include colour.accent;\n\n &,\n &:hover {\n @include colour.colour-font(\"button-accented-text\");\n @include colour.colour-background(\"button-accented-background\");\n @include colour.colour-border(\"button-accented-background\");\n }\n }\n\n &__navigation-button-icon {\n content: \"\";\n\n width: 0.75rem;\n height: 0.75rem;\n\n display: block;\n flex: none;\n\n @include colour.colour-border(\"font-dark\", 4px, solid, top);\n @include colour.colour-border(\"font-dark\", 4px, solid, right);\n\n transform-origin: 50% 50%;\n }\n\n &__navigation-prev &__navigation-button-icon {\n transform: rotate(-135deg);\n }\n\n &__navigation-next &__navigation-button-icon {\n transform: rotate(45deg);\n }\n\n &__navigation {\n max-height: 40rem;\n max-height: clamp(15rem, calc(100vh - #{spacing.space(2)}), 40rem);\n padding: spacing.space(1);\n\n grid-column: 1 / 3;\n grid-row: 3;\n\n display: grid;\n grid-template-columns: repeat(6, 1fr);\n grid-auto-rows: min-content;\n gap: spacing.space(1);\n\n overflow: auto;\n }\n\n &__navigation-item {\n min-width: 0;\n min-height: 0;\n aspect-ratio: 1;\n\n position: relative;\n\n border: none;\n @include borders.rounded-border;\n\n cursor: pointer;\n\n @include colour.contrast;\n\n @include colour.image-loader-background;\n\n &:hover {\n &::after {\n content: \"\";\n\n position: absolute;\n inset: 0;\n z-index: 2;\n\n @include colour.thick-keyline-accent;\n }\n }\n\n &[aria-current=\"true\"] {\n @include colour.accent;\n\n &::after {\n content: \"\";\n\n position: absolute;\n inset: 0;\n z-index: 2;\n\n @include colour.thick-keyline-brand(\"\", \"black\");\n }\n }\n }\n\n &__navigation-item-image {\n width: 100%;\n height: 100%;\n\n position: absolute;\n inset: 0;\n object-fit: cover;\n }\n\n &__navigation-item-label {\n padding: spacing.space(0.25) spacing.space(0.75);\n\n display: inline-block;\n\n position: absolute;\n top: 0;\n left: 0;\n z-index: 4;\n\n text-transform: capitalize;\n\n @include colour.colour-font(\"font-dark\");\n @include typography.font-size(24);\n @include typography.main-font-weight-bold;\n\n @include colour.colour-background(\"background\");\n\n border-radius: 0 0 bordersVars.$rounded-border-radius 0;\n }\n\n &--interactive &__item-figure-inner {\n max-height: 50vh;\n aspect-ratio: 3 / 2;\n }\n\n &--interactive &__item-image {\n width: 100%;\n height: 100%;\n\n position: absolute;\n inset: 0;\n z-index: 1;\n object-fit: contain;\n }\n\n @include media.on-medium {\n &__navigation {\n grid-template-columns: repeat(4, 1fr);\n }\n }\n\n @include media.on-mobile {\n &__navigation {\n grid-template-columns: repeat(3, 1fr);\n }\n }\n\n @include media.on-tiny {\n &__navigation-item-label {\n @include typography.font-size(18);\n }\n }\n\n &--bounded {\n @include borders.rounded-border;\n @include colour.tint;\n }\n\n &--bounded &__header {\n padding: spacing.space(1);\n }\n\n &--bounded &__navigation-buttons {\n top: spacing.space(3);\n }\n\n &--bounded &__item-header {\n padding-top: spacing.space(1);\n }\n\n &--bounded &__item-figure-inner {\n border-radius: 0.1px;\n }\n\n &--bounded &__item-description {\n margin-right: spacing.space(1);\n margin-left: spacing.space(1);\n }\n\n &__items--hide-item-titles &__item &__item-header {\n display: none;\n }\n}\n","@use \"../variables/a11y\";\n@use \"colour\";\n@use \"borders\";\n\n@mixin visually-hidden {\n width: 1px !important;\n height: 1px !important;\n margin: 0 !important;\n padding: 0 !important;\n\n overflow: hidden !important;\n\n position: absolute !important;\n top: -9999px !important;\n left: -9999px !important;\n z-index: -1 !important;\n\n background-color: transparent !important;\n\n border: 0 !important;\n\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n}\n\n%focus-outline {\n outline: a11y.$focus-outline-outer-width colour.brand-colour(\"black\") solid !important;\n outline-offset: a11y.$focus-outline-inner-width !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"yellow\") !important;\n\n transition:\n outline-offset 0.1s,\n box-shadow 0.1s;\n\n .tna-template--dark-theme & {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"black\") !important;\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-inner-width\n colour.brand-colour(\"black\") !important;\n }\n }\n}\n\n@mixin focus-outline {\n @extend %focus-outline;\n}\n\n@mixin no-focus-outline {\n outline: none !important;\n\n box-shadow: none !important;\n}\n\n%active-outline {\n outline: a11y.$focus-outline-active-outer-width colour.brand-colour(\"black\")\n solid !important;\n outline-offset: a11y.$focus-outline-active-inner-width !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"yellow\") !important;\n\n transition: none;\n\n .tna-template--dark-theme & {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"black\") !important;\n }\n\n .tna-template--system-theme & {\n @media (prefers-color-scheme: dark) {\n outline-color: colour.brand-colour(\"yellow\") !important;\n\n box-shadow: 0 0 0 a11y.$focus-outline-active-inner-width\n colour.brand-colour(\"black\") !important;\n }\n }\n}\n\n@mixin active-outline {\n @extend %active-outline;\n}\n\n%faux-full-outline {\n position: relative;\n}\n\n%faux-full-outline-anchor {\n &::before {\n content: \"\";\n\n position: absolute;\n inset: 0;\n z-index: 9;\n\n @include borders.rounded-border;\n }\n\n &:focus,\n &:active {\n @include no-focus-outline;\n }\n\n &:focus {\n &::before {\n @include focus-outline;\n }\n }\n\n &:active {\n &::before {\n @include active-outline;\n }\n }\n}\n\n@mixin faux-full-outline($anchor_selector) {\n @extend %faux-full-outline;\n\n #{$anchor_selector} {\n @extend %faux-full-outline-anchor;\n }\n}\n\n%focus-indicator-only-on-keyboard-focus {\n &:focus:not(:focus-visible) {\n @include no-focus-outline;\n }\n}\n\n@mixin focus-indicator-only-on-keyboard-focus {\n @extend %focus-indicator-only-on-keyboard-focus;\n}\n","@use \"sass:math\";\n@use \"../variables/typography\";\n@use \"colour\";\n@use \"media\";\n\n@mixin font-size($font-size-px) {\n font-size: #{math.div($font-size-px, typography.$relative-1rem-px)}rem;\n}\n\n@mixin relative-font-size($font-size-px) {\n @warn \"relative-font-size() will soon be deprecated in favour of font-size().\";\n @include font-size($font-size-px);\n}\n\n@mixin main-font-weight {\n font-weight: typography.$main-font-weight;\n}\n\n@mixin main-font-weight-medium {\n font-weight: typography.$main-font-weight-medium;\n}\n\n@mixin main-font-weight-bold {\n font-weight: typography.$main-font-weight-bold;\n}\n\n@mixin main-font($bold: false) {\n font-family: typography.$main-font-family;\n font-variation-settings: \"wdth\" 100;\n font-style: normal;\n font-optical-sizing: auto;\n @if $bold {\n @include main-font-weight-bold;\n } @else {\n @include main-font-weight;\n }\n}\n\n@mixin heading-font {\n font-family: typography.$heading-font-family;\n font-weight: typography.$heading-font-weight;\n}\n\n@mixin detail-font($bold: false) {\n font-family: typography.$detail-font-family;\n font-style: normal;\n font-optical-sizing: auto;\n @if $bold {\n font-weight: typography.$detail-font-weight-bold;\n } @else {\n font-weight: typography.$detail-font-weight;\n }\n}\n\n@mixin detail-font-small {\n @include detail-font;\n @include font-size(14);\n line-height: 1.1;\n text-transform: uppercase;\n}\n\n@mixin interactable-text-decoration {\n text-decoration-thickness: typography.$interactable-text-decoration-thickness;\n text-underline-offset: typography.$interactable-text-decoration-offset;\n}\n\n@mixin interacted-text-decoration {\n text-decoration: underline;\n text-decoration-thickness: typography.$interactive-text-decoration-thickness;\n text-underline-offset: typography.$interactable-text-decoration-offset;\n}\n\n@mixin heading-generator(\n $font-size-default,\n $font-size-medium,\n $font-size-small,\n $font-size-tiny,\n $line-height\n) {\n $small-and-tiny-identical: $font-size-small == $font-size-tiny;\n $medium-small-and-tiny-identical: $font-size-medium == $font-size-small and\n $small-and-tiny-identical;\n $all-identical: $font-size-default == $font-size-medium and\n $medium-small-and-tiny-identical and $small-and-tiny-identical;\n line-height: $line-height;\n @include font-size($font-size-default);\n\n @if $all-identical != true {\n @if $medium-small-and-tiny-identical != true {\n @include media.on-medium {\n @include font-size($font-size-medium);\n }\n\n @if $small-and-tiny-identical != true {\n @include media.on-small {\n @include font-size($font-size-small);\n }\n\n @include media.on-tiny {\n @include font-size($font-size-tiny);\n }\n } @else {\n @include media.on-mobile {\n @include font-size($font-size-small);\n }\n }\n } @else {\n @include media.on-smaller-than-large {\n @include font-size($font-size-medium);\n }\n }\n }\n}\n","@use \"sass:math\";\n\n/*\n * ------------------------------------------\n * The typefaces, sizes and spacings that are\n * defined in this file have been selected to\n * ensure 100% match with the latest National\n * Archives brand guidelines - avoid changing\n * or overwriting any of these values without\n * signing off with the Digital Services team\n * first\n * ------------------------------------------\n */\n\n$relative-1rem-px: 16; // 16px = 1rem\n\n/*\n * ------------------------------------------\n * When true, use the included font files for\n * Open Sans and Roboto Mono, rather than the\n * versions hosted by Google Fonts\n * ------------------------------------------\n */\n$use-local-fonts: false !default;\n\n$body-font-size-px: 19 !default;\n$body-font-size-px-medium: 18 !default;\n$body-font-size-px-mobile: 17 !default;\n$body-line-height: 1.75 !default;\n\n$interactable-text-decoration-offset: 0.125em !default;\n$interactable-text-decoration-thickness: #{math.div(1.5, $relative-1rem-px)}rem !default;\n$interactive-text-decoration-thickness: #{math.div(4, $relative-1rem-px)}rem !default;\n\n$main-font-family-name: \"Open Sans\" !default;\n$main-font-family:\n #{$main-font-family-name},\n sans-serif;\n$main-font-weight: 400 !default;\n$main-font-weight-medium: 600 !default;\n$main-font-weight-bold: 700 !default;\n$main-font-file: \"OpenSans-Regular.ttf\" !default;\n$main-font-file-medium: \"OpenSans-SemiBold.ttf\" !default;\n$main-font-file-bold: \"OpenSans-Bold.ttf\" !default;\n\n/*\n * ------------------------------------------\n * To use Supria Sans Condensed (which is the\n * approved heading typeface for The National\n * Archives), you need to obtain a licence to\n * properly embed the CSS files with the font\n * definitions in your service - check with a\n * member of the Digital Services team on how\n * to get a licence\n * ------------------------------------------\n */\n$heading-font-family-name: \"supria-sans-condensed\" !default;\n$heading-font-family:\n #{$heading-font-family-name},\n \"Arial Narrow\",\n sans-serif;\n$heading-font-weight: 500 !default;\n\n/*\n * ------------------------------------------\n * The detail font should be a monospace font\n * and is used for chips, supertitles as well\n * as the date search component\n * ------------------------------------------\n */\n$detail-font-family-name: \"Roboto Mono\" !default;\n$detail-font-family:\n #{$detail-font-family-name},\n monospace;\n$detail-font-weight: 400 !default;\n$detail-font-weight-bold: 500 !default;\n$detail-font-file: \"RobotoMono-Regular.ttf\" !default;\n$detail-font-file-bold: \"RobotoMono-Medium.ttf\" !default;\n\n$heading-xl-font-size-default: 64 !default;\n$heading-xl-font-size-medium: 48 !default;\n$heading-xl-font-size-small: 36 !default;\n$heading-xl-font-size-tiny: $heading-xl-font-size-small !default;\n$heading-xl-line-height: 1.1 !default;\n\n$heading-l-font-size-default: 36 !default;\n$heading-l-font-size-medium: 32 !default;\n$heading-l-font-size-small: 29 !default;\n$heading-l-font-size-tiny: $heading-l-font-size-small !default;\n$heading-l-line-height: 1.15 !default;\n\n$heading-m-font-size-default: 22 !default;\n$heading-m-font-size-medium: $heading-m-font-size-default !default;\n$heading-m-font-size-small: 21 !default;\n$heading-m-font-size-tiny: $heading-m-font-size-small !default;\n$heading-m-line-height: 1.4 !default;\n\n$heading-s-font-size-default: 19 !default;\n$heading-s-font-size-medium: $heading-s-font-size-default !default;\n$heading-s-font-size-small: $heading-s-font-size-default !default;\n$heading-s-font-size-tiny: $heading-s-font-size-default !default;\n$heading-s-line-height: 1.5 !default;\n\n$code-font-family: Consolas, Monaco, \"Ubuntu Mono\", monospace !default;\n","@use \"../variables/borders\";\n\n@mixin rounded-border {\n border-radius: borders.$rounded-border-radius;\n}\n","$thick-border-width: 5px !default;\n$very-thick-border-width: 8px !default;\n$rounded-border-radius: 2px !default;\n","@use \"sass:math\";\n@use \"../variables/media\";\n@use \"../variables/typography\";\n\n$smallest-large-device-em: #{math.div(\n media.$largest-medium-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-medium-device-em: #{math.div(\n media.$largest-medium-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-medium-device-em: #{math.div(\n media.$largest-small-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-small-device-em: #{math.div(\n media.$largest-small-device-px,\n typography.$relative-1rem-px\n )}em;\n$smallest-small-device-em: #{math.div(\n media.$largest-tiny-device-px + 1,\n typography.$relative-1rem-px\n )}em;\n$largest-tiny-device-em: #{math.div(\n media.$largest-tiny-device-px,\n typography.$relative-1rem-px\n )}em;\n\n$media-large: \"(min-width: #{$smallest-large-device-em})\";\n$media-lt-large: \"(max-width: #{$largest-medium-device-em})\";\n$media-medium: \"(min-width: #{$smallest-medium-device-em}) and (max-width: #{$largest-medium-device-em})\";\n$media-gt-mobile: \"(min-width: #{$smallest-medium-device-em})\";\n$media-mobile: \"(max-width: #{$largest-small-device-em})\";\n$media-small: \"(min-width: #{$smallest-small-device-em}) and (max-width: #{$largest-small-device-em})\";\n$media-gt-tiny: \"(min-width: #{$smallest-small-device-em})\";\n$media-tiny: \"(max-width: #{$largest-tiny-device-em})\";\n\n// https://nationalarchives.github.io/design-system/styles/media/#media-queries\n@mixin on-large() {\n @media #{$media-large} {\n @content;\n }\n}\n\n@mixin on-medium() {\n @media #{$media-medium} {\n @content;\n }\n}\n\n@mixin on-small() {\n @media #{$media-small} {\n @content;\n }\n}\n\n@mixin on-tiny() {\n @media #{$media-tiny} {\n @content;\n }\n}\n\n@mixin on-larger-than-mobile() {\n @media #{$media-gt-mobile} {\n @content;\n }\n}\n\n@mixin on-larger-than-tiny() {\n @media #{$media-gt-tiny} {\n @content;\n }\n}\n\n@mixin on-smaller-than-large() {\n @media #{$media-lt-large} {\n @content;\n }\n}\n\n@mixin on-mobile() {\n @media #{$media-mobile} {\n @content;\n }\n}\n\n@mixin on-print() {\n @media print {\n @content;\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("TNAFrontend",[],e):"object"==typeof exports?exports.TNAFrontend=e():t.TNAFrontend=e()}(self,()=>(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,r(n.key),n)}}function r(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}t.r(e),t.d(e,{Gallery:()=>o});var o=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$module=e,this.$itemsContainer=e&&e.querySelector(".tna-gallery__items"),this.$items=this.$itemsContainer&&this.$itemsContainer.querySelectorAll(".tna-gallery__item"),this.$navigation=e&&e.querySelector(".tna-gallery__navigation"),this.$navigationItems=this.$navigation&&e.querySelectorAll(".tna-gallery__navigation-item"),this.$navigationButtons=e&&e.querySelector(".tna-gallery__navigation-buttons"),this.$module&&this.$itemsContainer&&this.$items&&!(this.$items.length<2)&&this.$navigation&&this.$navigationItems&&this.$navigationButtons&&(this.$module.classList.add("tna-gallery--interactive"),this.$navigationButtonPrev=this.$navigationButtons.querySelector(".tna-gallery__navigation-prev"),this.$navigationButtonNext=this.$navigationButtons.querySelector(".tna-gallery__navigation-next"),this.setup(),this.currentId=this.$items[0].id,this.showItem(this.currentId))},e=[{key:"setup",value:function(){var t,e,i,n=this;this.$items.forEach(function(t){var e;t.setAttribute("hidden",""),t.setAttribute("aria-hidden","true"),null===(e=t.querySelector(".tna-gallery__item-header"))||void 0===e||e.setAttribute("aria-hidden","true")}),this.$navigation.removeAttribute("hidden"),this.$navigationItems.forEach(function(t){t.addEventListener("click",function(){n.showItem(t.getAttribute("aria-controls")),n.$itemsContainer.setAttribute("tabindex","0"),n.$itemsContainer.focus()})}),this.$module.addEventListener("keydown",function(t){var e=!1;switch(t.key){case"ArrowLeft":case"ArrowUp":n.showPreviousItem(),e=!0;break;case"ArrowRight":case"ArrowDown":n.showNextItem(),e=!0;break;case"Home":n.showFirstItem(),e=!0;break;case"End":n.showLastItem(),e=!0}e&&(t.stopPropagation(),t.preventDefault())}),null===(t=this.$navigationButtons)||void 0===t||t.removeAttribute("hidden"),null===(e=this.$navigationButtonPrev)||void 0===e||e.addEventListener("click",function(){n.showPreviousItem()}),null===(i=this.$navigationButtonNext)||void 0===i||i.addEventListener("click",function(){n.showNextItem()}),this.$liveRegion=document.createElement("div"),this.$liveRegion.setAttribute("aria-live","polite"),this.$liveRegion.setAttribute("aria-atomic","true"),this.$liveRegion.setAttribute("class","tna-gallery__item-header"),this.$itemsContainer.prepend(this.$liveRegion),this.$itemsContainer.classList.add("tna-gallery__items--hide-item-titles"),this.$itemsContainer.addEventListener("blur",function(){return n.$itemsContainer.removeAttribute("tabindex")})}},{key:"showItem",value:function(t){this.$items.forEach(function(e){t&&e.id===t?(e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.setAttribute("hidden",""),e.setAttribute("aria-hidden","true"))}),this.$navigationItems.forEach(function(e){t&&e.getAttribute("aria-controls")===t?e.setAttribute("aria-current","true"):e.setAttribute("aria-current","false")}),this.currentId=t,this.$liveRegion.textContent="Image ".concat(this.getCurrentItemIndex()+1," of ").concat(this.$items.length)}},{key:"getCurrentItemIndex",value:function(){var t=this;return Array.from(this.$items).findIndex(function(e){return e.id===t.currentId})}},{key:"showPreviousItem",value:function(){var t=this.getCurrentItemIndex()-1;t<0&&(t=this.$items.length-1),this.showItem(this.$items[t].id)}},{key:"showNextItem",value:function(){var t=this.getCurrentItemIndex()+1;t>=this.$items.length&&(t=0),this.showItem(this.$items[t].id)}},{key:"showFirstItem",value:function(){this.showItem(this.$items[0].id)}},{key:"showLastItem",value:function(){this.showItem(this.$items[this.$items.length-1].id)}}]
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("TNAFrontend",[],e):"object"==typeof exports?exports.TNAFrontend=e():t.TNAFrontend=e()}(self,()=>(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,r(n.key),n)}}function r(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}t.r(e),t.d(e,{Gallery:()=>o});var o=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$module=e,this.$itemsContainer=e&&e.querySelector(".tna-gallery__items"),this.$items=this.$itemsContainer&&this.$itemsContainer.querySelectorAll(".tna-gallery__item"),this.$navigation=e&&e.querySelector(".tna-gallery__navigation"),this.$navigationItems=this.$navigation&&e.querySelectorAll(".tna-gallery__navigation-item"),this.$navigationButtons=e&&e.querySelector(".tna-gallery__navigation-buttons"),this.$module&&this.$itemsContainer&&this.$items&&!(this.$items.length<2)&&this.$navigation&&this.$navigationItems&&this.$navigationButtons&&(this.$module.classList.add("tna-gallery--interactive"),this.$navigationButtonPrev=this.$navigationButtons.querySelector(".tna-gallery__navigation-prev"),this.$navigationButtonNext=this.$navigationButtons.querySelector(".tna-gallery__navigation-next"),this.setup(),this.currentId=this.$items[0].id,this.showItem(this.currentId))},(e=[{key:"setup",value:function(){var t,e,i,n=this;this.$items.forEach(function(t){var e;t.setAttribute("hidden",""),t.setAttribute("aria-hidden","true"),null===(e=t.querySelector(".tna-gallery__item-header"))||void 0===e||e.setAttribute("aria-hidden","true")}),this.$navigation.removeAttribute("hidden"),this.$navigationItems.forEach(function(t){t.addEventListener("click",function(){n.showItem(t.getAttribute("aria-controls")),n.$itemsContainer.setAttribute("tabindex","0"),n.$itemsContainer.focus()})}),this.$module.addEventListener("keydown",function(t){var e=!1;switch(t.key){case"ArrowLeft":case"ArrowUp":n.showPreviousItem(),e=!0;break;case"ArrowRight":case"ArrowDown":n.showNextItem(),e=!0;break;case"Home":n.showFirstItem(),e=!0;break;case"End":n.showLastItem(),e=!0}e&&(t.stopPropagation(),t.preventDefault())}),null===(t=this.$navigationButtons)||void 0===t||t.removeAttribute("hidden"),null===(e=this.$navigationButtonPrev)||void 0===e||e.addEventListener("click",function(){n.showPreviousItem()}),null===(i=this.$navigationButtonNext)||void 0===i||i.addEventListener("click",function(){n.showNextItem()}),this.$liveRegion=document.createElement("div"),this.$liveRegion.setAttribute("aria-live","polite"),this.$liveRegion.setAttribute("aria-atomic","true"),this.$liveRegion.setAttribute("class","tna-gallery__item-header"),this.$itemsContainer.prepend(this.$liveRegion),this.$itemsContainer.classList.add("tna-gallery__items--hide-item-titles"),this.$itemsContainer.addEventListener("blur",function(){return n.$itemsContainer.removeAttribute("tabindex")})}},{key:"showItem",value:function(t){this.$items.forEach(function(e){t&&e.id===t?(e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.setAttribute("hidden",""),e.setAttribute("aria-hidden","true"))}),this.$navigationItems.forEach(function(e){t&&e.getAttribute("aria-controls")===t?e.setAttribute("aria-current","true"):e.setAttribute("aria-current","false")}),this.currentId=t,this.$liveRegion.textContent="Image ".concat(this.getCurrentItemIndex()+1," of ").concat(this.$items.length)}},{key:"getCurrentItemIndex",value:function(){var t=this;return Array.from(this.$items).findIndex(function(e){return e.id===t.currentId})}},{key:"showPreviousItem",value:function(){var t=this.getCurrentItemIndex()-1;t<0&&(t=this.$items.length-1),this.showItem(this.$items[t].id)}},{key:"showNextItem",value:function(){var t=this.getCurrentItemIndex()+1;t>=this.$items.length&&(t=0),this.showItem(this.$items[t].id)}},{key:"showFirstItem",value:function(){this.showItem(this.$items[0].id)}},{key:"showLastItem",value:function(){this.showItem(this.$items[this.$items.length-1].id)}}])&&n(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();return e})());
|
|
2
2
|
//# sourceMappingURL=gallery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/gallery/gallery.js","mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,iBAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,GACC,CATD,CASCK,KAAA,uBCRD,IAAAC,EAAA,CCAAA,EAAA,CAAAL,EAAAM,KACA,QAAAC,KAAAD,EACAD,EAAAG,EAAAF,EAAAC,KAAAF,EAAAG,EAAAR,EAAAO,IACAE,OAAAC,eAAAV,EAAAO,EAAA,CAAyCI,YAAA,EAAAC,IAAAN,EAAAC,MCJzCF,EAAA,CAAAQ,EAAAC,IAAAL,OAAAM,UAAAC,eAAAC,KAAAJ,EAAAC,GCCAT,EAAAL,IACA,oBAAAkB,QAAAA,OAAAC,aACAV,OAAAC,eAAAV,EAAAkB,OAAAC,YAAA,CAAuDC,MAAA,WAEvDX,OAAAC,eAAAV,EAAA,cAAgDoB,OAAA,2sBCLzC,IAAMC,EAAO,WAwCjB,SAvCD,SAAAA,EAAYC,gGAASC,CAAAC,KAAAH,GACnBG,KAAKF,QAAUA,EACfE,KAAKC,gBACHH,GAAWA,EAAQI,cAAc,uBACnCF,KAAKG,OACHH,KAAKC,iBACLD,KAAKC,gBAAgBG,iBAAiB,sBACxCJ,KAAKK,YACHP,GAAW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MP,KAAO6B,EAAK9B,SAAS,EAE1C,GAAC,CAAA/B,IAAA,mBAAAa,MAED,WACE,IAAIoD,EAAkBhD,KAAK2C,sBAAwB,EAC/CK,EAAkB,IACpBA,EAAkBhD,KAAKG,OAAOK,OAAS,GAEzCR,KAAKgB,SAAShB,KAAKG,OAAO6C,GAAiBjC,GAC7C,GAAC,CAAAhC,IAAA,eAAAa,MAED,WACE,IAAIoD,EAAkBhD,KAAK2C,sBAAwB,EAC/CK,GAAmBhD,KAAKG,OAAOK,SACjCwC,EAAkB,GAEpBhD,KAAKgB,SAAShB,KAAKG,OAAO6C,GAAiBjC,GAC7C,GAAC,CAAAhC,IAAA,gBAAAa,MAED,WACEI,KAAKgB,SAAShB,KAAKG,OAAO,GAAGY,GAC/B,GAAC,CAAAhC,IAAA,eAAAa,MAED,WACEI,KAAKgB,SAAShB,KAAKG,OAAOH,KAAKG,OAAOK,OAAS,GAAGO,GACpD,oFAAC,CA9JiB","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/gallery/gallery.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 Gallery {\n constructor($module) {\n this.$module = $module;\n this.$itemsContainer =\n $module && $module.querySelector(\".tna-gallery__items\");\n this.$items =\n this.$itemsContainer &&\n this.$itemsContainer.querySelectorAll(\".tna-gallery__item\");\n this.$navigation =\n $module && $module.querySelector(\".tna-gallery__navigation\");\n this.$navigationItems =\n this.$navigation &&\n $module.querySelectorAll(\".tna-gallery__navigation-item\");\n this.$navigationButtons =\n $module && $module.querySelector(\".tna-gallery__navigation-buttons\");\n\n if (\n !this.$module ||\n !this.$itemsContainer ||\n !this.$items ||\n this.$items.length < 2 ||\n !this.$navigation ||\n !this.$navigationItems ||\n !this.$navigationButtons\n ) {\n return;\n }\n\n this.$module.classList.add(\"tna-gallery--interactive\");\n\n this.$navigationButtonPrev = this.$navigationButtons.querySelector(\n \".tna-gallery__navigation-prev\",\n );\n this.$navigationButtonNext = this.$navigationButtons.querySelector(\n \".tna-gallery__navigation-next\",\n );\n\n this.setup();\n this.currentId = this.$items[0].id;\n this.showItem(this.currentId);\n }\n\n setup() {\n this.$items.forEach(($item) => {\n $item.setAttribute(\"hidden\", \"\");\n $item.setAttribute(\"aria-hidden\", \"true\");\n $item\n .querySelector(\".tna-gallery__item-header\")\n ?.setAttribute(\"aria-hidden\", \"true\");\n });\n this.$navigation.removeAttribute(\"hidden\");\n this.$navigationItems.forEach(($item) => {\n $item.addEventListener(\"click\", () => {\n this.showItem($item.getAttribute(\"aria-controls\"));\n this.$itemsContainer.setAttribute(\"tabindex\", \"0\");\n this.$itemsContainer.focus();\n });\n });\n this.$module.addEventListener(\"keydown\", (e) => {\n let preventDefaultKeyAction = false;\n switch (e.key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n this.showPreviousItem();\n preventDefaultKeyAction = true;\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n this.showNextItem();\n preventDefaultKeyAction = true;\n break;\n case \"Home\":\n this.showFirstItem();\n preventDefaultKeyAction = true;\n break;\n case \"End\":\n this.showLastItem();\n preventDefaultKeyAction = true;\n break;\n }\n if (preventDefaultKeyAction) {\n e.stopPropagation();\n e.preventDefault();\n }\n });\n\n this.$navigationButtons?.removeAttribute(\"hidden\");\n this.$navigationButtonPrev?.addEventListener(\"click\", () => {\n this.showPreviousItem();\n });\n this.$navigationButtonNext?.addEventListener(\"click\", () => {\n this.showNextItem();\n });\n\n this.$liveRegion = document.createElement(\"div\");\n this.$liveRegion.setAttribute(\"aria-live\", \"polite\");\n this.$liveRegion.setAttribute(\"aria-atomic\", \"true\");\n this.$liveRegion.setAttribute(\"class\", \"tna-gallery__item-header\");\n this.$itemsContainer.prepend(this.$liveRegion);\n this.$itemsContainer.classList.add(\"tna-gallery__items--hide-item-titles\");\n this.$itemsContainer.addEventListener(\"blur\", () =>\n this.$itemsContainer.removeAttribute(\"tabindex\"),\n );\n }\n\n showItem(id) {\n this.$items.forEach(($item) => {\n if (id && $item.id === id) {\n $item.removeAttribute(\"hidden\");\n $item.removeAttribute(\"aria-hidden\");\n } else {\n $item.setAttribute(\"hidden\", \"\");\n $item.setAttribute(\"aria-hidden\", \"true\");\n }\n });\n this.$navigationItems.forEach(($item) => {\n if (id) {\n if ($item.getAttribute(\"aria-controls\") === id) {\n $item.setAttribute(\"aria-current\", \"true\");\n } else {\n $item.setAttribute(\"aria-current\", \"false\");\n }\n } else {\n $item.setAttribute(\"aria-current\", \"false\");\n }\n });\n this.currentId = id;\n this.$liveRegion.textContent = `Image ${this.getCurrentItemIndex() + 1} of ${this.$items.length}`;\n }\n\n getCurrentItemIndex() {\n return Array.from(this.$items).findIndex(\n ($item) => $item.id === this.currentId,\n );\n }\n\n showPreviousItem() {\n let nextIndexToShow = this.getCurrentItemIndex() - 1;\n if (nextIndexToShow < 0) {\n nextIndexToShow = this.$items.length - 1;\n }\n this.showItem(this.$items[nextIndexToShow].id);\n }\n\n showNextItem() {\n let nextIndexToShow = this.getCurrentItemIndex() + 1;\n if (nextIndexToShow >= this.$items.length) {\n nextIndexToShow = 0;\n }\n this.showItem(this.$items[nextIndexToShow].id);\n }\n\n showFirstItem() {\n this.showItem(this.$items[0].id);\n }\n\n showLastItem() {\n this.showItem(this.$items[this.$items.length - 1].id);\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","Gallery","$module","_classCallCheck","this","$itemsContainer","querySelector","$items","querySelectorAll","$navigation","$navigationItems","$navigationButtons","length","classList","add","$navigationButtonPrev","$navigationButtonNext","setup","currentId","id","showItem","_this$$navigationButt","_this$$navigationButt2","_this$$navigationButt3","_this","forEach","$item","_$item$querySelector","setAttribute","removeAttribute","addEventListener","getAttribute","focus","e","preventDefaultKeyAction","showPreviousItem","showNextItem","showFirstItem","showLastItem","stopPropagation","preventDefault","$liveRegion","document","createElement","prepend","textContent","concat","getCurrentItemIndex","_this2","Array","from","findIndex","nextIndexToShow"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/gallery/gallery.js","mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,iBAAAH,GACA,iBAAAC,QACAA,QAAA,YAAAD,IAEAD,EAAA,YAAAC,GACC,CATD,CASCK,KAAA,uBCRD,IAAAC,EAAA,CCAAA,EAAA,CAAAL,EAAAM,KACA,QAAAC,KAAAD,EACAD,EAAAG,EAAAF,EAAAC,KAAAF,EAAAG,EAAAR,EAAAO,IACAE,OAAAC,eAAAV,EAAAO,EAAA,CAAyCI,YAAA,EAA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gB,iBAEtBH,EAAME,aAAa,SAAU,IAC7BF,EAAME,aAAa,cAAe,QAEtC,GACAxB,KAAKM,iBAAiBe,QAAQ,SAACC,GACzBP,GACEO,EAAMK,aAAa,mBAAqBZ,EAC1CO,EAAME,aAAa,eAAgB,QAKrCF,EAAME,aAAa,eAAgB,QAEvC,GACAxB,KAAKc,UAAYC,EAEjBf,KAAKqC,YAAYI,YAAW,SAAAC,OAAY1C,KAAK2C,sBAAwB,EAAC,QAAAD,OAAO1C,KAAKG,OAAOK,OAC3F,GAAC,CAAAzB,IAAA,sBAAAa,MAED,WAAsB,IAAAgD,EAAA5C,KACpB,OAAO6C,MAAMC,KAAK9C,KAAKG,QAAQ4C,UAC7B,SAACzB,GAAK,OAAKA,EAAMP,KAAO6B,EAAK9B,SAAS,EAE1C,GAAC,CAAA/B,IAAA,mBAAAa,MAED,WAEE,IAAIoD,EAAkBhD,KAAK2C,sBAAwB,EAE/CK,EAAkB,IAEpBA,EAAkBhD,KAAKG,OAAOK,OAAS,GAEzCR,KAAKgB,SAAShB,KAAKG,OAAO6C,GAAiBjC,GAC7C,GAAC,CAAAhC,IAAA,eAAAa,MAED,WAEE,IAAIoD,EAAkBhD,KAAK2C,sBAAwB,EAC/CK,GAAmBhD,KAAKG,OAAOK,SAEjCwC,EAAkB,GAEpBhD,KAAKgB,SAAShB,KAAKG,OAAO6C,GAAiBjC,GAC7C,GAAC,CAAAhC,IAAA,gBAAAa,MAED,WAEEI,KAAKgB,SAAShB,KAAKG,OAAO,GAAGY,GAC/B,GAAC,CAAAhC,IAAA,eAAAa,MAED,WAEEI,KAAKgB,SAAShB,KAAKG,OAAOH,KAAKG,OAAOK,OAAS,GAAGO,GACpD,mFAAC,CA1KiB","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/gallery/gallery.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 Gallery {\n constructor($module) {\n this.$module = $module;\n this.$itemsContainer =\n $module && $module.querySelector(\".tna-gallery__items\");\n this.$items =\n this.$itemsContainer &&\n this.$itemsContainer.querySelectorAll(\".tna-gallery__item\");\n this.$navigation =\n $module && $module.querySelector(\".tna-gallery__navigation\");\n this.$navigationItems =\n this.$navigation &&\n $module.querySelectorAll(\".tna-gallery__navigation-item\");\n this.$navigationButtons =\n $module && $module.querySelector(\".tna-gallery__navigation-buttons\");\n\n if (\n !this.$module ||\n !this.$itemsContainer ||\n !this.$items ||\n /* eslint-disable-next-line no-magic-numbers */\n this.$items.length < 2 ||\n !this.$navigation ||\n !this.$navigationItems ||\n !this.$navigationButtons\n ) {\n return;\n }\n\n this.$module.classList.add(\"tna-gallery--interactive\");\n\n this.$navigationButtonPrev = this.$navigationButtons.querySelector(\n \".tna-gallery__navigation-prev\",\n );\n this.$navigationButtonNext = this.$navigationButtons.querySelector(\n \".tna-gallery__navigation-next\",\n );\n\n this.setup();\n /* eslint-disable-next-line no-magic-numbers */\n this.currentId = this.$items[0].id;\n this.showItem(this.currentId);\n }\n\n setup() {\n this.$items.forEach(($item) => {\n $item.setAttribute(\"hidden\", \"\");\n $item.setAttribute(\"aria-hidden\", \"true\");\n $item\n .querySelector(\".tna-gallery__item-header\")\n ?.setAttribute(\"aria-hidden\", \"true\");\n });\n this.$navigation.removeAttribute(\"hidden\");\n this.$navigationItems.forEach(($item) => {\n $item.addEventListener(\"click\", () => {\n this.showItem($item.getAttribute(\"aria-controls\"));\n this.$itemsContainer.setAttribute(\"tabindex\", \"0\");\n this.$itemsContainer.focus();\n });\n });\n this.$module.addEventListener(\"keydown\", (event) => {\n let preventDefaultKeyAction = false;\n switch (event.key) {\n case \"ArrowLeft\":\n case \"ArrowUp\":\n this.showPreviousItem();\n preventDefaultKeyAction = true;\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n this.showNextItem();\n preventDefaultKeyAction = true;\n break;\n case \"Home\":\n this.showFirstItem();\n preventDefaultKeyAction = true;\n break;\n case \"End\":\n this.showLastItem();\n preventDefaultKeyAction = true;\n break;\n default:\n break;\n }\n if (preventDefaultKeyAction) {\n event.stopPropagation();\n event.preventDefault();\n }\n });\n\n this.$navigationButtons?.removeAttribute(\"hidden\");\n this.$navigationButtonPrev?.addEventListener(\"click\", () => {\n this.showPreviousItem();\n });\n this.$navigationButtonNext?.addEventListener(\"click\", () => {\n this.showNextItem();\n });\n\n this.$liveRegion = document.createElement(\"div\");\n this.$liveRegion.setAttribute(\"aria-live\", \"polite\");\n this.$liveRegion.setAttribute(\"aria-atomic\", \"true\");\n this.$liveRegion.setAttribute(\"class\", \"tna-gallery__item-header\");\n this.$itemsContainer.prepend(this.$liveRegion);\n this.$itemsContainer.classList.add(\"tna-gallery__items--hide-item-titles\");\n this.$itemsContainer.addEventListener(\"blur\", () =>\n this.$itemsContainer.removeAttribute(\"tabindex\"),\n );\n }\n\n showItem(id) {\n this.$items.forEach(($item) => {\n if (id && $item.id === id) {\n $item.removeAttribute(\"hidden\");\n $item.removeAttribute(\"aria-hidden\");\n } else {\n $item.setAttribute(\"hidden\", \"\");\n $item.setAttribute(\"aria-hidden\", \"true\");\n }\n });\n this.$navigationItems.forEach(($item) => {\n if (id) {\n if ($item.getAttribute(\"aria-controls\") === id) {\n $item.setAttribute(\"aria-current\", \"true\");\n } else {\n $item.setAttribute(\"aria-current\", \"false\");\n }\n } else {\n $item.setAttribute(\"aria-current\", \"false\");\n }\n });\n this.currentId = id;\n /* eslint-disable-next-line no-magic-numbers */\n this.$liveRegion.textContent = `Image ${this.getCurrentItemIndex() + 1} of ${this.$items.length}`;\n }\n\n getCurrentItemIndex() {\n return Array.from(this.$items).findIndex(\n ($item) => $item.id === this.currentId,\n );\n }\n\n showPreviousItem() {\n /* eslint-disable-next-line no-magic-numbers */\n let nextIndexToShow = this.getCurrentItemIndex() - 1;\n /* eslint-disable-next-line no-magic-numbers */\n if (nextIndexToShow < 0) {\n /* eslint-disable-next-line no-magic-numbers */\n nextIndexToShow = this.$items.length - 1;\n }\n this.showItem(this.$items[nextIndexToShow].id);\n }\n\n showNextItem() {\n /* eslint-disable-next-line no-magic-numbers */\n let nextIndexToShow = this.getCurrentItemIndex() + 1;\n if (nextIndexToShow >= this.$items.length) {\n /* eslint-disable-next-line no-magic-numbers */\n nextIndexToShow = 0;\n }\n this.showItem(this.$items[nextIndexToShow].id);\n }\n\n showFirstItem() {\n /* eslint-disable-next-line no-magic-numbers */\n this.showItem(this.$items[0].id);\n }\n\n showLastItem() {\n /* eslint-disable-next-line no-magic-numbers */\n this.showItem(this.$items[this.$items.length - 1].id);\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","Gallery","$module","_classCallCheck","this","$itemsContainer","querySelector","$items","querySelectorAll","$navigation","$navigationItems","$navigationButtons","length","classList","add","$navigationButtonPrev","$navigationButtonNext","setup","currentId","id","showItem","_this$$navigationButt","_this$$navigationButt2","_this$$navigationButt3","_this","forEach","$item","_$item$querySelector","setAttribute","removeAttribute","addEventListener","getAttribute","focus","event","preventDefaultKeyAction","showPreviousItem","showNextItem","showFirstItem","showLastItem","stopPropagation","preventDefault","$liveRegion","document","createElement","prepend","textContent","concat","getCurrentItemIndex","_this2","Array","from","findIndex","nextIndexToShow"],"sourceRoot":""}
|
|
@@ -18,6 +18,7 @@ export class Gallery {
|
|
|
18
18
|
!this.$module ||
|
|
19
19
|
!this.$itemsContainer ||
|
|
20
20
|
!this.$items ||
|
|
21
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
21
22
|
this.$items.length < 2 ||
|
|
22
23
|
!this.$navigation ||
|
|
23
24
|
!this.$navigationItems ||
|
|
@@ -36,6 +37,7 @@ export class Gallery {
|
|
|
36
37
|
);
|
|
37
38
|
|
|
38
39
|
this.setup();
|
|
40
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
39
41
|
this.currentId = this.$items[0].id;
|
|
40
42
|
this.showItem(this.currentId);
|
|
41
43
|
}
|
|
@@ -56,9 +58,9 @@ export class Gallery {
|
|
|
56
58
|
this.$itemsContainer.focus();
|
|
57
59
|
});
|
|
58
60
|
});
|
|
59
|
-
this.$module.addEventListener("keydown", (
|
|
61
|
+
this.$module.addEventListener("keydown", (event) => {
|
|
60
62
|
let preventDefaultKeyAction = false;
|
|
61
|
-
switch (
|
|
63
|
+
switch (event.key) {
|
|
62
64
|
case "ArrowLeft":
|
|
63
65
|
case "ArrowUp":
|
|
64
66
|
this.showPreviousItem();
|
|
@@ -77,10 +79,12 @@ export class Gallery {
|
|
|
77
79
|
this.showLastItem();
|
|
78
80
|
preventDefaultKeyAction = true;
|
|
79
81
|
break;
|
|
82
|
+
default:
|
|
83
|
+
break;
|
|
80
84
|
}
|
|
81
85
|
if (preventDefaultKeyAction) {
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
event.stopPropagation();
|
|
87
|
+
event.preventDefault();
|
|
84
88
|
}
|
|
85
89
|
});
|
|
86
90
|
|
|
@@ -125,6 +129,7 @@ export class Gallery {
|
|
|
125
129
|
}
|
|
126
130
|
});
|
|
127
131
|
this.currentId = id;
|
|
132
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
128
133
|
this.$liveRegion.textContent = `Image ${this.getCurrentItemIndex() + 1} of ${this.$items.length}`;
|
|
129
134
|
}
|
|
130
135
|
|
|
@@ -135,26 +140,33 @@ export class Gallery {
|
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
showPreviousItem() {
|
|
143
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
138
144
|
let nextIndexToShow = this.getCurrentItemIndex() - 1;
|
|
145
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
139
146
|
if (nextIndexToShow < 0) {
|
|
147
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
140
148
|
nextIndexToShow = this.$items.length - 1;
|
|
141
149
|
}
|
|
142
150
|
this.showItem(this.$items[nextIndexToShow].id);
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
showNextItem() {
|
|
154
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
146
155
|
let nextIndexToShow = this.getCurrentItemIndex() + 1;
|
|
147
156
|
if (nextIndexToShow >= this.$items.length) {
|
|
157
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
148
158
|
nextIndexToShow = 0;
|
|
149
159
|
}
|
|
150
160
|
this.showItem(this.$items[nextIndexToShow].id);
|
|
151
161
|
}
|
|
152
162
|
|
|
153
163
|
showFirstItem() {
|
|
164
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
154
165
|
this.showItem(this.$items[0].id);
|
|
155
166
|
}
|
|
156
167
|
|
|
157
168
|
showLastItem() {
|
|
169
|
+
/* eslint-disable-next-line no-magic-numbers */
|
|
158
170
|
this.showItem(this.$items[this.$items.length - 1].id);
|
|
159
171
|
}
|
|
160
172
|
}
|