@nationalarchives/frontend 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/nationalarchives/all+analytics.js +1 -1
  2. package/nationalarchives/all+analytics.js.map +1 -1
  3. package/nationalarchives/all+analytics.mjs +2 -0
  4. package/nationalarchives/all.css +1 -1
  5. package/nationalarchives/all.css.map +1 -1
  6. package/nationalarchives/all.js +1 -1
  7. package/nationalarchives/all.js.map +1 -1
  8. package/nationalarchives/all.mjs +7 -0
  9. package/nationalarchives/analytics.js +1 -1
  10. package/nationalarchives/analytics.js.map +1 -1
  11. package/nationalarchives/analytics.mjs +80 -67
  12. package/nationalarchives/components/accordion/accordion.js +1 -1
  13. package/nationalarchives/components/accordion/accordion.js.map +1 -1
  14. package/nationalarchives/components/accordion/accordion.mjs +2 -2
  15. package/nationalarchives/components/checkboxes/analytics.js +3 -2
  16. package/nationalarchives/components/cookie-banner/macro-options.json +1 -1
  17. package/nationalarchives/components/gallery/analytics.js +25 -7
  18. package/nationalarchives/components/radios/analytics.js +2 -1
  19. package/nationalarchives/components/search-field/analytics.js +1 -1
  20. package/nationalarchives/components/sidebar/analytics.js +1 -1
  21. package/nationalarchives/components/text-input/analytics.js +2 -1
  22. package/nationalarchives/components/text-input/fixtures.json +18 -6
  23. package/nationalarchives/components/text-input/macro-options.json +6 -0
  24. package/nationalarchives/components/text-input/template.njk +1 -1
  25. package/nationalarchives/components/text-input/text-input.css +1 -1
  26. package/nationalarchives/components/text-input/text-input.css.map +1 -1
  27. package/nationalarchives/components/text-input/text-input.js +2 -0
  28. package/nationalarchives/components/text-input/text-input.js.map +1 -0
  29. package/nationalarchives/components/text-input/text-input.mjs +58 -0
  30. package/nationalarchives/components/text-input/text-input.njk +4 -2
  31. package/nationalarchives/components/text-input/text-input.scss +25 -1
  32. package/nationalarchives/components/textarea/analytics.js +2 -1
  33. package/nationalarchives/lib/analytics-helpers.mjs +1 -0
  34. package/nationalarchives/prototype-kit.css +1 -1
  35. package/nationalarchives/prototype-kit.css.map +1 -1
  36. package/package.json +3 -3
@@ -182,70 +182,61 @@ class EventTracker {
182
182
  index,
183
183
  instance,
184
184
  ) {
185
- const { on, data, targetElement, rootData = {} } = eventConfig;
186
- $el.addEventListener(on, (event) =>
187
- this.recordEvent(
188
- rootEventName
189
- ? `${this.prefix}.${rootEventName}`
190
- : this.generateEventName(areaName, eventConfig),
191
- {
192
- ...data,
193
- name: this.generateEventName(areaName, eventConfig),
194
- value: data?.value
195
- ? this.computedValue(
196
- data.value,
197
- $el,
198
- $scope,
199
- event,
200
- index,
201
- instance,
202
- )
203
- : null,
204
- state: data?.state
205
- ? this.computedValue(
206
- data.state,
207
- $el,
208
- $scope,
209
- event,
210
- index,
211
- instance,
212
- )
213
- : null,
214
- group: data?.group
215
- ? this.computedValue(
216
- data.group,
217
- $el,
218
- $scope,
219
- event,
220
- index,
221
- instance,
222
- )
223
- : null,
224
- xPath: getXPathTo($el),
225
- targetElement: targetElement,
226
- timeSincePageLoad: new Date() - this.startTime,
227
- index,
228
- instance,
229
- scope,
230
- areaName,
231
- },
232
- Object.fromEntries(
233
- Object.entries({ ...rootDefaultData, ...rootData }).map(
234
- ([key, value]) => [
235
- key,
236
- this.computedValue(value, $el, $scope, event, index, instance),
237
- ],
185
+ const {
186
+ on,
187
+ data,
188
+ targetElement,
189
+ rootData = {},
190
+ onCondition = null,
191
+ } = eventConfig;
192
+ $el.addEventListener(on, (event) => {
193
+ const computedValueParameters = [$el, $scope, event, index, instance];
194
+ if (
195
+ onCondition === null ||
196
+ this.computedValue(onCondition, ...computedValueParameters)
197
+ ) {
198
+ this.recordEvent(
199
+ rootEventName
200
+ ? `${this.prefix}.${rootEventName}`
201
+ : this.generateEventName(areaName, eventConfig),
202
+ {
203
+ ...data,
204
+ name: this.generateEventName(areaName, eventConfig),
205
+ value: data?.value
206
+ ? this.computedValue(data.value, ...computedValueParameters)
207
+ : null,
208
+ state: data?.state
209
+ ? this.computedValue(data.state, ...computedValueParameters)
210
+ : null,
211
+ group: data?.group
212
+ ? this.computedValue(data.group, ...computedValueParameters)
213
+ : null,
214
+ xPath: getXPathTo($el),
215
+ targetElement: targetElement,
216
+ timeSincePageLoad: new Date() - this.startTime,
217
+ index,
218
+ instance,
219
+ scope,
220
+ areaName,
221
+ },
222
+ Object.fromEntries(
223
+ Object.entries({ ...rootDefaultData, ...rootData }).map(
224
+ ([key, value]) => [
225
+ key,
226
+ this.computedValue(value, ...computedValueParameters),
227
+ ],
228
+ ),
238
229
  ),
239
- ),
240
- ),
241
- );
230
+ );
231
+ }
232
+ });
242
233
  }
243
234
 
244
235
  /** @protected */
245
- computedValue(value, $el, $scope, event, index, instance) {
246
- return typeof value === "function"
247
- ? value.call(this, $el, $scope, event, index, instance)
248
- : (value ?? null);
236
+ computedValue(valueOrFunction, $el, $scope, event, index, instance) {
237
+ return typeof valueOrFunction === "function"
238
+ ? valueOrFunction.call(this, $el, $scope, event, index, instance)
239
+ : (valueOrFunction ?? null);
249
240
  }
250
241
 
251
242
  /** @protected */
@@ -259,8 +250,8 @@ class EventTracker {
259
250
 
260
251
  /** @protected */
261
252
  getTnaMetaTags() {
262
- return Object.fromEntries(
263
- Array.from(
253
+ return Object.fromEntries([
254
+ ...Array.from(
264
255
  document.head.querySelectorAll(
265
256
  `meta[name^="${this.prefix}_root:"][content]`,
266
257
  ),
@@ -270,7 +261,7 @@ class EventTracker {
270
261
  .replace(new RegExp(`^${this.prefix}_root:`), ""),
271
262
  $metaEl.getAttribute("content"),
272
263
  ]),
273
- Array.from(
264
+ ...Array.from(
274
265
  document.head.querySelectorAll(
275
266
  `meta[name^="${this.prefix}."][content]`,
276
267
  ),
@@ -278,7 +269,30 @@ class EventTracker {
278
269
  $metaEl.getAttribute("name"),
279
270
  $metaEl.getAttribute("content"),
280
271
  ]),
281
- );
272
+ ]);
273
+ }
274
+
275
+ /** @protected */
276
+ getUserPreferences() {
277
+ const userPreferences = {};
278
+ userPreferences[`${this.prefix}.pref.prefers-color-scheme`] =
279
+ window.matchMedia?.("(prefers-color-scheme: dark)").matches
280
+ ? "dark"
281
+ : "light";
282
+ userPreferences[`${this.prefix}.pref.forced-colors`] = window.matchMedia?.(
283
+ "(forced-colors: active)",
284
+ ).matches;
285
+ userPreferences[`${this.prefix}.pref.prefers-contrast`] =
286
+ window.matchMedia?.("(prefers-contrast: more)").matches
287
+ ? "more"
288
+ : window.matchMedia?.("(prefers-contrast: less)").matches
289
+ ? "less"
290
+ : "";
291
+ userPreferences[`${this.prefix}.pref.prefers-reduced-motion`] =
292
+ window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
293
+ userPreferences[`${this.prefix}.pref.prefers-reduced-transparency`] =
294
+ window.matchMedia?.("(prefers-reduced-transparency: reduce)").matches;
295
+ return userPreferences;
282
296
  }
283
297
  }
284
298
 
@@ -365,9 +379,9 @@ class GA4 extends EventTracker {
365
379
  if (!this.gTagId) {
366
380
  throw Error("ID was not specified");
367
381
  }
368
- const tnaMetaTags = this.getTnaMetaTags();
369
382
  this.pushToDataLayer({
370
- ...tnaMetaTags,
383
+ ...this.getTnaMetaTags(),
384
+ ...this.getUserPreferences(),
371
385
  "gtm.start": new Date().getTime(),
372
386
  event: "gtm.js",
373
387
  });
@@ -397,7 +411,6 @@ class GA4 extends EventTracker {
397
411
  }
398
412
  });
399
413
  this.trackingEnabled = false;
400
- // window.location.reload();
401
414
  }
402
415
  }
403
416
  }
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TNAFrontend",[],t):"object"==typeof exports?exports.TNAFrontend=t():e.TNAFrontend=t()}(self,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}e.r(t),e.d(t,{Accordion:()=>i});var i=function(){return e=function e(t){var r,o,i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,(o=n(o="polyfillRequired"))in r?Object.defineProperty(r,o,{value:null,enumerable:!0,configurable:!0,writable:!0}):r[o]=null,this.$module=t,this.$items=t&&t.querySelectorAll(".tna-accordion__item"),this.$module&&this.$items&&(this.allowMultipleItemsOpen="true"===this.$module.dataset.multiselectable,this.$items.forEach((function(e){return i.initItem(e)})),this.initState())},(t=[{key:"initItem",value:function(e){var t=this,r=e.querySelector(".tna-accordion__heading"),o=e.querySelector(".tna-accordion__body");if(r&&o){e.classList.add("tna-accordion__details"),e.classList.remove("tna-accordion__item"),r.removeAttribute("class"),o.classList.add("tna-accordion__content"),o.classList.remove("tna-accordion__body"),o.setAttribute("hidden","until-found");var n=document.createElement("button");n.classList.add("tna-accordion__summary"),n.setAttribute("aria-controls",o.id),r.parentNode.insertBefore(n,r.nextSibling),n.appendChild(r),n.addEventListener("click",(function(){"true"===n.getAttribute("aria-expanded")?t.closeItem(e):t.openItem(e)}))}}},{key:"initState",value:function(){var e=this;this.$items.forEach((function(t){"true"===t.dataset.isopen?e.openItem(t):e.closeItem(t),t.removeAttribute("data-isopen")}))}},{key:"openItem",value:function(e){this.allowMultipleItemsOpen||this.closeAllItemsExcept(e);var t=e.querySelector(".tna-accordion__summary"),r=e.querySelector(".tna-accordion__content");t.setAttribute("aria-expanded","true"),t.setAttribute("aria-label","".concat(t.innerText,", Hide this section")),r.removeAttribute("hidden")}},{key:"closeItem",value:function(e){var t=e.querySelector(".tna-accordion__summary"),r=e.querySelector(".tna-accordion__content");t.setAttribute("aria-expanded","false"),t.setAttribute("aria-label","".concat(t.innerText,", Show this section")),r.setAttribute("hidden","until-found")}},{key:"closeAllItemsExcept",value:function(e){var t=this;Array.from(this.$items).filter((function(t){return t.querySelector(".tna-accordion__summary")!==e&&"true"===t.querySelector(".tna-accordion__summary").getAttribute("aria-expanded")})).forEach((function(e){return t.closeItem(e)}))}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();return t})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TNAFrontend",[],t):"object"==typeof exports?exports.TNAFrontend=t():e.TNAFrontend=t()}(self,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}e.r(t),e.d(t,{Accordion:()=>i});var i=function(){return e=function e(t){var r,o,i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,(o=n(o="polyfillRequired"))in r?Object.defineProperty(r,o,{value:null,enumerable:!0,configurable:!0,writable:!0}):r[o]=null,this.$module=t,this.$items=t&&t.querySelectorAll(".tna-accordion__item"),this.$module&&this.$items&&(this.allowMultipleItemsOpen="true"===this.$module.dataset.multiselectable,this.$items.forEach((function(e){return i.initItem(e)})),this.initState())},(t=[{key:"initItem",value:function(e){var t=this,r=e.querySelector(".tna-accordion__heading"),o=e.querySelector(".tna-accordion__body");if(r&&o){e.classList.add("tna-accordion__details"),e.classList.remove("tna-accordion__item"),r.removeAttribute("class"),o.classList.add("tna-accordion__content"),o.classList.remove("tna-accordion__body"),o.setAttribute("hidden","until-found");var n=document.createElement("button");n.classList.add("tna-accordion__summary"),n.setAttribute("aria-controls",o.id),r.parentNode.insertBefore(n,r.nextSibling),n.appendChild(r),n.addEventListener("click",(function(){"true"===n.getAttribute("aria-expanded")?t.closeItem(e):t.openItem(e)}))}}},{key:"initState",value:function(){var e=this;this.$items.forEach((function(t){"true"===t.dataset.isopen?e.openItem(t):e.closeItem(t),t.removeAttribute("data-isopen")}))}},{key:"openItem",value:function(e){this.allowMultipleItemsOpen||this.closeAllItemsExcept(e);var t=e.querySelector(".tna-accordion__summary"),r=e.querySelector(".tna-accordion__content");t.setAttribute("aria-expanded","true"),t.setAttribute("aria-label","".concat(t.innerText.trim(),", Hide this section")),r.removeAttribute("hidden")}},{key:"closeItem",value:function(e){var t=e.querySelector(".tna-accordion__summary"),r=e.querySelector(".tna-accordion__content");t.setAttribute("aria-expanded","false"),t.setAttribute("aria-label","".concat(t.innerText.trim(),", Show this section")),r.setAttribute("hidden","until-found")}},{key:"closeAllItemsExcept",value:function(e){var t=this;Array.from(this.$items).filter((function(t){return t.querySelector(".tna-accordion__summary")!==e&&"true"===t.querySelector(".tna-accordion__summary").getAttribute("aria-expanded")})).forEach((function(e){return t.closeItem(e)}))}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();return t})()));
2
2
  //# sourceMappingURL=accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/accordion/accordion.js","mappings":"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","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/accordion/accordion.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class Accordion {\n polyfillRequired = null;\n\n constructor($module) {\n this.$module = $module;\n this.$items = $module && $module.querySelectorAll(\".tna-accordion__item\");\n if (!this.$module || !this.$items) {\n return;\n }\n\n this.allowMultipleItemsOpen =\n this.$module.dataset[\"multiselectable\"] === \"true\";\n\n this.$items.forEach(($item) => this.initItem($item));\n this.initState();\n }\n\n initItem($item) {\n const $heading = $item.querySelector(\".tna-accordion__heading\");\n const $content = $item.querySelector(\".tna-accordion__body\");\n\n if (!$heading || !$content) {\n return;\n }\n\n $item.classList.add(\"tna-accordion__details\");\n $item.classList.remove(\"tna-accordion__item\");\n\n $heading.removeAttribute(\"class\");\n\n $content.classList.add(\"tna-accordion__content\");\n $content.classList.remove(\"tna-accordion__body\");\n $content.setAttribute(\"hidden\", \"until-found\");\n\n const $headingButton = document.createElement(\"button\");\n $headingButton.classList.add(\"tna-accordion__summary\");\n $headingButton.setAttribute(\"aria-controls\", $content.id);\n $heading.parentNode.insertBefore($headingButton, $heading.nextSibling);\n $headingButton.appendChild($heading);\n\n $headingButton.addEventListener(\"click\", () => {\n const isOpen = $headingButton.getAttribute(\"aria-expanded\") === \"true\";\n if (isOpen) {\n this.closeItem($item);\n } else {\n this.openItem($item);\n }\n });\n }\n\n initState() {\n this.$items.forEach(($item) => {\n if ($item.dataset[\"isopen\"] === \"true\") {\n this.openItem($item);\n } else {\n this.closeItem($item);\n }\n $item.removeAttribute(\"data-isopen\");\n });\n }\n\n openItem($item) {\n if (!this.allowMultipleItemsOpen) {\n this.closeAllItemsExcept($item);\n }\n const $headingButton = $item.querySelector(\".tna-accordion__summary\");\n const $content = $item.querySelector(\".tna-accordion__content\");\n $headingButton.setAttribute(\"aria-expanded\", \"true\");\n $headingButton.setAttribute(\n \"aria-label\",\n `${$headingButton.innerText}, Hide this section`,\n );\n $content.removeAttribute(\"hidden\");\n // $content.setAttribute(\"tabindex\", \"0\");\n }\n\n closeItem($item) {\n const $headingButton = $item.querySelector(\".tna-accordion__summary\");\n const $content = $item.querySelector(\".tna-accordion__content\");\n $headingButton.setAttribute(\"aria-expanded\", \"false\");\n $headingButton.setAttribute(\n \"aria-label\",\n `${$headingButton.innerText}, Show this section`,\n );\n $content.setAttribute(\"hidden\", \"until-found\");\n // $content.setAttribute(\"tabindex\", \"-1\");\n }\n\n closeAllItemsExcept($excludeItem) {\n Array.from(this.$items)\n .filter(\n ($item) =>\n $item.querySelector(\".tna-accordion__summary\") !== $excludeItem &&\n $item\n .querySelector(\".tna-accordion__summary\")\n .getAttribute(\"aria-expanded\") === \"true\",\n )\n .forEach(($item) => this.closeItem($item));\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Accordion","$module","_this","_classCallCheck","this","$items","querySelectorAll","allowMultipleItemsOpen","dataset","forEach","$item","initItem","initState","_this2","$heading","querySelector","$content","classList","add","remove","removeAttribute","setAttribute","$headingButton","document","createElement","id","parentNode","insertBefore","nextSibling","appendChild","addEventListener","getAttribute","closeItem","openItem","_this3","closeAllItemsExcept","concat","innerText","$excludeItem","_this4","Array","from","filter"],"sourceRoot":""}
1
+ {"version":3,"file":"components/accordion/accordion.js","mappings":"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","sources":["webpack://TNAFrontend/webpack/universalModuleDefinition","webpack://TNAFrontend/webpack/bootstrap","webpack://TNAFrontend/webpack/runtime/define property getters","webpack://TNAFrontend/webpack/runtime/hasOwnProperty shorthand","webpack://TNAFrontend/webpack/runtime/make namespace object","webpack://TNAFrontend/./src/nationalarchives/components/accordion/accordion.mjs"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"TNAFrontend\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"TNAFrontend\"] = factory();\n\telse\n\t\troot[\"TNAFrontend\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export class Accordion {\n polyfillRequired = null;\n\n constructor($module) {\n this.$module = $module;\n this.$items = $module && $module.querySelectorAll(\".tna-accordion__item\");\n if (!this.$module || !this.$items) {\n return;\n }\n\n this.allowMultipleItemsOpen =\n this.$module.dataset[\"multiselectable\"] === \"true\";\n\n this.$items.forEach(($item) => this.initItem($item));\n this.initState();\n }\n\n initItem($item) {\n const $heading = $item.querySelector(\".tna-accordion__heading\");\n const $content = $item.querySelector(\".tna-accordion__body\");\n\n if (!$heading || !$content) {\n return;\n }\n\n $item.classList.add(\"tna-accordion__details\");\n $item.classList.remove(\"tna-accordion__item\");\n\n $heading.removeAttribute(\"class\");\n\n $content.classList.add(\"tna-accordion__content\");\n $content.classList.remove(\"tna-accordion__body\");\n $content.setAttribute(\"hidden\", \"until-found\");\n\n const $headingButton = document.createElement(\"button\");\n $headingButton.classList.add(\"tna-accordion__summary\");\n $headingButton.setAttribute(\"aria-controls\", $content.id);\n $heading.parentNode.insertBefore($headingButton, $heading.nextSibling);\n $headingButton.appendChild($heading);\n\n $headingButton.addEventListener(\"click\", () => {\n const isOpen = $headingButton.getAttribute(\"aria-expanded\") === \"true\";\n if (isOpen) {\n this.closeItem($item);\n } else {\n this.openItem($item);\n }\n });\n }\n\n initState() {\n this.$items.forEach(($item) => {\n if ($item.dataset[\"isopen\"] === \"true\") {\n this.openItem($item);\n } else {\n this.closeItem($item);\n }\n $item.removeAttribute(\"data-isopen\");\n });\n }\n\n openItem($item) {\n if (!this.allowMultipleItemsOpen) {\n this.closeAllItemsExcept($item);\n }\n const $headingButton = $item.querySelector(\".tna-accordion__summary\");\n const $content = $item.querySelector(\".tna-accordion__content\");\n $headingButton.setAttribute(\"aria-expanded\", \"true\");\n $headingButton.setAttribute(\n \"aria-label\",\n `${$headingButton.innerText.trim()}, Hide this section`,\n );\n $content.removeAttribute(\"hidden\");\n // $content.setAttribute(\"tabindex\", \"0\");\n }\n\n closeItem($item) {\n const $headingButton = $item.querySelector(\".tna-accordion__summary\");\n const $content = $item.querySelector(\".tna-accordion__content\");\n $headingButton.setAttribute(\"aria-expanded\", \"false\");\n $headingButton.setAttribute(\n \"aria-label\",\n `${$headingButton.innerText.trim()}, Show this section`,\n );\n $content.setAttribute(\"hidden\", \"until-found\");\n // $content.setAttribute(\"tabindex\", \"-1\");\n }\n\n closeAllItemsExcept($excludeItem) {\n Array.from(this.$items)\n .filter(\n ($item) =>\n $item.querySelector(\".tna-accordion__summary\") !== $excludeItem &&\n $item\n .querySelector(\".tna-accordion__summary\")\n .getAttribute(\"aria-expanded\") === \"true\",\n )\n .forEach(($item) => this.closeItem($item));\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","Accordion","$module","_this","_classCallCheck","this","$items","querySelectorAll","allowMultipleItemsOpen","dataset","forEach","$item","initItem","initState","_this2","$heading","querySelector","$content","classList","add","remove","removeAttribute","setAttribute","$headingButton","document","createElement","id","parentNode","insertBefore","nextSibling","appendChild","addEventListener","getAttribute","closeItem","openItem","_this3","closeAllItemsExcept","concat","innerText","trim","$excludeItem","_this4","Array","from","filter"],"sourceRoot":""}
@@ -68,7 +68,7 @@ export class Accordion {
68
68
  $headingButton.setAttribute("aria-expanded", "true");
69
69
  $headingButton.setAttribute(
70
70
  "aria-label",
71
- `${$headingButton.innerText}, Hide this section`,
71
+ `${$headingButton.innerText.trim()}, Hide this section`,
72
72
  );
73
73
  $content.removeAttribute("hidden");
74
74
  // $content.setAttribute("tabindex", "0");
@@ -80,7 +80,7 @@ export class Accordion {
80
80
  $headingButton.setAttribute("aria-expanded", "false");
81
81
  $headingButton.setAttribute(
82
82
  "aria-label",
83
- `${$headingButton.innerText}, Show this section`,
83
+ `${$headingButton.innerText.trim()}, Show this section`,
84
84
  );
85
85
  $content.setAttribute("hidden", "until-found");
86
86
  // $content.setAttribute("tabindex", "-1");
@@ -12,12 +12,13 @@ export default [
12
12
  data: {
13
13
  state: valueGetters.checked,
14
14
  // eslint-disable-next-line no-unused-vars
15
- value: ($el, $scope, event) => $el.parentNode.innerText,
15
+ value: ($el, $scope, event) => $el.parentNode.innerText.trim(),
16
16
  // eslint-disable-next-line no-unused-vars
17
17
  group: ($el, $scope, event) =>
18
18
  $scope
19
19
  .closest(".tna-form__group")
20
- ?.querySelector(".tna-form__heading")?.innerText,
20
+ ?.querySelector(".tna-form__heading")
21
+ ?.innerText?.trim(),
21
22
  },
22
23
  },
23
24
  ],
@@ -42,7 +42,7 @@
42
42
  "description": ""
43
43
  },
44
44
  {
45
- "name": "cookiesPreferencesSetKey",
45
+ "name": "preferencesSetKey",
46
46
  "type": "string",
47
47
  "required": false,
48
48
  "description": ""
@@ -11,7 +11,7 @@ export default [
11
11
  $scope.querySelectorAll(".tna-gallery__navigation-item").length,
12
12
  media_provider: "tna",
13
13
  media_title: ($el, $scope, event, index, instance) =>
14
- $scope.querySelector(".tna-gallery__header-inner")?.innerText ||
14
+ $scope.querySelector(".tna-gallery__header-inner")?.innerText?.trim() ||
15
15
  `gallery_${instance}`,
16
16
  media_progress: ($el, $scope) =>
17
17
  (Array.from(
@@ -40,9 +40,11 @@ export default [
40
40
  on: "click",
41
41
  data: {
42
42
  value: ($el, $scope) =>
43
- $scope.querySelector(
44
- ".tna-gallery__item:not([hidden]) .tna-gallery__item-header",
45
- ).innerText,
43
+ $scope
44
+ .querySelector(
45
+ ".tna-gallery__item:not([hidden]) .tna-gallery__item-header",
46
+ )
47
+ ?.innerText?.trim(),
46
48
  },
47
49
  rootData: {
48
50
  data_link: "previous",
@@ -55,9 +57,11 @@ export default [
55
57
  on: "click",
56
58
  data: {
57
59
  value: ($el, $scope) =>
58
- $scope.querySelector(
59
- ".tna-gallery__item:not([hidden]) .tna-gallery__item-header",
60
- ).innerText,
60
+ $scope
61
+ .querySelector(
62
+ ".tna-gallery__item:not([hidden]) .tna-gallery__item-header",
63
+ )
64
+ ?.innerText?.trim(),
61
65
  },
62
66
  rootData: {
63
67
  data_link: "next",
@@ -67,9 +71,23 @@ export default [
67
71
  {
68
72
  eventName: "keypress",
69
73
  on: "keydown",
74
+ onCondition: ($el, $scope, event) =>
75
+ [
76
+ "ArrowLeft",
77
+ "ArrowRight",
78
+ "ArrowUp",
79
+ "ArrowDown",
80
+ "End",
81
+ "Home",
82
+ "Escape",
83
+ ].includes(event.key),
70
84
  data: {
71
85
  value: ($el, $scope, event) => event.key,
72
86
  },
87
+ rootData: {
88
+ data_link: "keypress",
89
+ media_action: "progress",
90
+ },
73
91
  },
74
92
  {
75
93
  eventName: "enter-fullscreen",
@@ -17,7 +17,8 @@ export default [
17
17
  group: ($el, $scope, event) =>
18
18
  $scope
19
19
  .closest(".tna-form__group")
20
- ?.querySelector(".tna-form__heading")?.innerText,
20
+ ?.querySelector(".tna-form__heading")
21
+ ?.innerText?.trim(),
21
22
  },
22
23
  },
23
24
  ],
@@ -14,7 +14,7 @@ export default [
14
14
  value: valueGetters.value,
15
15
  // eslint-disable-next-line no-unused-vars
16
16
  group: ($el, $scope, event) =>
17
- $scope.querySelector(".tna-form__heading")?.innerText,
17
+ $scope.querySelector(".tna-form__heading")?.innerText?.trim(),
18
18
  },
19
19
  },
20
20
  ],
@@ -8,7 +8,7 @@ export default [
8
8
  rootData: {
9
9
  data_component_name: "sidebar",
10
10
  data_section: ($el, $scope) =>
11
- $scope.querySelector(".tna-sidebar__heading").innerText,
11
+ $scope.querySelector(".tna-sidebar__heading")?.innerText?.trim(),
12
12
  },
13
13
  events: [
14
14
  {
@@ -15,7 +15,8 @@ export default [
15
15
  group: ($el, $scope, event) =>
16
16
  $scope
17
17
  .closest(".tna-form__group")
18
- ?.querySelector(".tna-form__heading")?.innerText,
18
+ ?.querySelector(".tna-form__heading")
19
+ ?.innerText?.trim(),
19
20
  },
20
21
  },
21
22
  ],
@@ -10,7 +10,7 @@
10
10
  "id": "name",
11
11
  "name": "name"
12
12
  },
13
- "html": "<div class=\"tna-form__group\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4></div><input type=\"text\" id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"\" spellcheck=\"false\"></div>"
13
+ "html": "<div class=\"tna-form__group\" data-module=\"tna-text-input\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4></div><input id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"\" type=\"text\" spellcheck=\"false\"></div>"
14
14
  },
15
15
  {
16
16
  "name": "text input with a preselected value",
@@ -22,7 +22,7 @@
22
22
  "name": "name",
23
23
  "value": "John"
24
24
  },
25
- "html": "<div class=\"tna-form__group\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4></div><input type=\"text\" id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"John\" spellcheck=\"false\"></div>"
25
+ "html": "<div class=\"tna-form__group\" data-module=\"tna-text-input\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4></div><input id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"John\" type=\"text\" spellcheck=\"false\"></div>"
26
26
  },
27
27
  {
28
28
  "name": "text input with a hint",
@@ -34,7 +34,7 @@
34
34
  "name": "name",
35
35
  "hint": "What people call you by."
36
36
  },
37
- "html": "<div class=\"tna-form__group\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4><p id=\"name-hint\" class=\"tna-form__hint\">What people call you by.</p></div><input type=\"text\" id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"\" spellcheck=\"false\" aria-describedby=\"name-hint \"></div>"
37
+ "html": "<div class=\"tna-form__group\" data-module=\"tna-text-input\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4><p id=\"name-hint\" class=\"tna-form__hint\">What people call you by.</p></div><input id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"\" aria-describedby=\"name-hint \" type=\"text\" spellcheck=\"false\"></div>"
38
38
  },
39
39
  {
40
40
  "name": "text input with an error",
@@ -48,7 +48,7 @@
48
48
  "text": "Enter a name"
49
49
  }
50
50
  },
51
- "html": "<div class=\"tna-form__group tna-form__group--error\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4><p id=\"name-error\" class=\"tna-form__error-message\"><span class=\"tna-!--visually-hidden\">Error:</span> Enter a name</p></div><input type=\"text\" id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"\" spellcheck=\"false\" aria-describedby=\" name-error\"></div>"
51
+ "html": "<div class=\"tna-form__group tna-form__group--error\" data-module=\"tna-text-input\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4><p id=\"name-error\" class=\"tna-form__error-message\"><span class=\"tna-!--visually-hidden\">Error:</span> Enter a name</p></div><input id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"\" aria-describedby=\" name-error\" type=\"text\" spellcheck=\"false\"></div>"
52
52
  },
53
53
  {
54
54
  "name": "inline text input",
@@ -60,7 +60,7 @@
60
60
  "name": "name",
61
61
  "inline": true
62
62
  },
63
- "html": "<div class=\"tna-form__group tna-form__group--inline\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4></div><input type=\"text\" id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"\" spellcheck=\"false\"></div>"
63
+ "html": "<div class=\"tna-form__group tna-form__group--inline\" data-module=\"tna-text-input\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4></div><input id=\"name\" class=\"tna-text-input \" name=\"name\" value=\"\" type=\"text\" spellcheck=\"false\"></div>"
64
64
  },
65
65
  {
66
66
  "name": "text input size",
@@ -72,7 +72,19 @@
72
72
  "name": "name",
73
73
  "size": "m"
74
74
  },
75
- "html": "<div class=\"tna-form__group\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4></div><input type=\"text\" id=\"name\" class=\"tna-text-input tna-text-input--m \" name=\"name\" value=\"\" spellcheck=\"false\"></div>"
75
+ "html": "<div class=\"tna-form__group\" data-module=\"tna-text-input\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"name\">Enter your first name</label></h4></div><input id=\"name\" class=\"tna-text-input tna-text-input--m \" name=\"name\" value=\"\" type=\"text\" spellcheck=\"false\"></div>"
76
+ },
77
+ {
78
+ "name": "password",
79
+ "options": {
80
+ "label": "Enter your password",
81
+ "headingLevel": 4,
82
+ "headingSize": "m",
83
+ "id": "password",
84
+ "name": "password",
85
+ "size": "m"
86
+ },
87
+ "html": "<div class=\"tna-form__group\" data-module=\"tna-text-input\"><div class=\"tna-form__group-contents\"><h4 class=\"tna-form__heading tna-form__heading--m\"><label class=\"tna-form__label\" for=\"password\">Enter your password</label></h4></div><input id=\"password\" class=\"tna-text-input tna-text-input--m \" name=\"password\" value=\"\" type=\"text\" spellcheck=\"false\"></div>"
76
88
  }
77
89
  ]
78
90
  }
@@ -55,6 +55,12 @@
55
55
  }
56
56
  ]
57
57
  },
58
+ {
59
+ "name": "password",
60
+ "type": "boolean",
61
+ "required": false,
62
+ "description": ""
63
+ },
58
64
  {
59
65
  "name": "spellcheck",
60
66
  "type": "boolean",
@@ -5,7 +5,7 @@
5
5
  {%- set containerClasses = containerClasses.concat('tna-form__group--inline') -%}
6
6
  {%- endif -%}
7
7
  {%- set classes = containerClasses | join(' ') -%}
8
- <div class="tna-form__group{% if params.error %} tna-form__group--error{% endif %}{% if classes %} {{ classes }}{% endif %}" {%- for attribute, value in params.formGroupAttributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}>
8
+ <div class="tna-form__group{% if params.error %} tna-form__group--error{% endif %}{% if classes %} {{ classes }}{% endif %}" data-module="tna-text-input" {%- for attribute, value in params.formGroupAttributes %} {{ attribute }}{% if value !== '' %}="{{ value }}"{% endif %}{% endfor %}>
9
9
  <div class="tna-form__group-contents">
10
10
  <h{{ params.headingLevel }} class="tna-form__heading tna-form__heading--{{ params.headingSize or 'm' }}">
11
11
  <label class="tna-form__label" for="{{ params.id }}">
@@ -1 +1 @@
1
- .tna-text-input{--background: #f4f4f4;--background-tint: rgb(217, 217, 214);--font-base: #343338;--font-dark: rgb(1, 1, 1);--font-light: rgba(1, 1, 1, 0.58);--icon-light: rgba(52, 51, 56, 0.45);--link: #005fa3;--link-visited: #634abb;--keyline: rgba(38, 38, 42, 0.25);--keyline-dark: rgb(38, 38, 42);--input-foreground: rgb(1, 1, 1);--input-background: rgb(255, 255, 255);--input-border: rgb(1, 1, 1);--form-error-text: #c20000;--button-text: rgb(255, 255, 255);--button-background: rgb(1, 1, 1);--button-hover-text: rgb(1, 1, 1);--button-hover-background: rgb(255, 255, 255);--contrast-background: #1e1e1e;--contrast-font-base: rgb(255, 255, 255);--contrast-font-dark: rgb(255, 255, 255);--contrast-font-light: rgba(255, 255, 255, 0.7);--contrast-icon-light: rgba(255, 255, 255, 0.45);--contrast-link: rgb(255, 255, 255);--contrast-link-visited: rgb(255, 255, 255);--contrast-keyline: rgba(255, 255, 255, 0.3);--contrast-keyline-dark: rgba(255, 255, 255, 0.6);--contrast-button-text: rgb(1, 1, 1);--contrast-button-background: rgb(255, 255, 255);--contrast-button-hover-text: rgb(255, 255, 255);--contrast-button-hover-background: rgb(1, 1, 1);--accent-background: #afb6b5;--accent-background-light: rgb(217, 217, 214);--accent-border: rgb(140, 150, 148);--accent-list-marker: rgba(1, 1, 1, 0.58);--accent-font-base: rgb(1, 1, 1);--accent-font-dark: rgb(1, 1, 1);--accent-font-light: rgba(1, 1, 1, 0.7);--accent-icon-light: rgba(1, 1, 1, 0.45);--accent-link: rgb(1, 1, 1);--accent-link-visited: rgb(1, 1, 1);--accent-keyline: rgba(1, 1, 1, 0.3);--accent-keyline-dark: rgba(1, 1, 1, 0.8);--accent-button-text: rgb(255, 255, 255);--accent-button-background: rgb(1, 1, 1);--accent-button-hover-text: rgb(1, 1, 1);--accent-button-hover-background: rgb(255, 255, 255);--button-accented-text: rgb(1, 1, 1);--button-accented-background: rgb(140, 150, 148)}@media(prefers-contrast: more){.tna-text-input{--background: rgb(255, 255, 255);--background-tint: #ddd;--font-base: rgb(1, 1, 1);--font-dark: rgb(1, 1, 1);--font-light: rgb(1, 1, 1);--icon-light: rgba(1, 1, 1, 0.8);--link: #202fbc;--link-visited: #6a286b;--keyline: rgba(1, 1, 1, 0.8);--keyline-dark: rgb(1, 1, 1);--input-foreground: rgb(1, 1, 1);--input-background: rgb(255, 255, 255);--input-border: rgb(1, 1, 1);--form-error-text: #c20000;--button-text: rgb(255, 255, 255);--button-background: rgb(1, 1, 1);--button-hover-text: rgb(1, 1, 1);--button-hover-background: rgb(255, 255, 255);--contrast-background: rgb(1, 1, 1);--contrast-font-base: rgb(255, 255, 255);--contrast-font-dark: rgb(255, 255, 255);--contrast-font-light: rgba(255, 255, 255, 0.8);--contrast-icon-light: rgba(255, 255, 255, 0.45);--contrast-link: rgb(0, 176, 255);--contrast-link-visited: #a8f;--contrast-keyline: rgba(255, 255, 255, 0.3);--contrast-keyline-dark: rgba(255, 255, 255, 0.6);--contrast-button-text: rgb(1, 1, 1);--contrast-button-background: rgb(255, 255, 255);--contrast-button-hover-text: rgb(255, 255, 255);--contrast-button-hover-background: rgb(1, 1, 1);--accent-background: #afb6b5;--accent-background-light: rgb(217, 217, 214);--accent-border: rgb(140, 150, 148);--accent-list-marker: rgba(1, 1, 1, 0.58);--accent-font-base: rgb(1, 1, 1);--accent-font-dark: rgb(1, 1, 1);--accent-font-light: rgba(1, 1, 1, 0.8);--accent-icon-light: rgba(1, 1, 1, 0.45);--accent-link: rgb(1, 1, 1);--accent-link-visited: rgb(1, 1, 1);--accent-keyline: rgba(1, 1, 1, 0.3);--accent-keyline-dark: rgba(1, 1, 1, 0.8);--accent-button-text: rgb(255, 255, 255);--accent-button-background: rgb(1, 1, 1);--accent-button-hover-text: rgb(1, 1, 1);--accent-button-hover-background: rgb(255, 255, 255);--button-accented-text: rgb(1, 1, 1);--button-accented-background: #8f9997}}.tna-text-input{width:100%;padding:0 6px;display:block;box-sizing:border-box;color:var(--input-foreground, rgb(1, 1, 1));line-height:2rem;background-color:var(--input-background, rgb(255, 255, 255));border:2px var(--input-border, rgb(1, 1, 1)) solid;border-radius:.1px}.tna-form__group--error .tna-text-input{border-color:var(--form-error-border, #c20000)}.tna-text-input--xs{max-width:5rem}.tna-text-input--s{max-width:10rem}.tna-text-input--m{max-width:20rem}.tna-text-input--l{max-width:40rem}.tna-text-input--xl{max-width:80rem}/*# sourceMappingURL=text-input.css.map */
1
+ .tna-text-input{--background: #f4f4f4;--background-tint: rgb(217, 217, 214);--font-base: #343338;--font-dark: rgb(1, 1, 1);--font-light: rgba(1, 1, 1, 0.58);--icon-light: rgba(52, 51, 56, 0.45);--link: #005fa3;--link-visited: #634abb;--keyline: rgba(38, 38, 42, 0.25);--keyline-dark: rgb(38, 38, 42);--input-foreground: rgb(1, 1, 1);--input-background: rgb(255, 255, 255);--input-border: rgb(1, 1, 1);--form-error-text: #c20000;--button-text: rgb(255, 255, 255);--button-background: rgb(1, 1, 1);--button-hover-text: rgb(1, 1, 1);--button-hover-background: rgb(255, 255, 255);--contrast-background: #1e1e1e;--contrast-font-base: rgb(255, 255, 255);--contrast-font-dark: rgb(255, 255, 255);--contrast-font-light: rgba(255, 255, 255, 0.7);--contrast-icon-light: rgba(255, 255, 255, 0.45);--contrast-link: rgb(255, 255, 255);--contrast-link-visited: rgb(255, 255, 255);--contrast-keyline: rgba(255, 255, 255, 0.3);--contrast-keyline-dark: rgba(255, 255, 255, 0.6);--contrast-button-text: rgb(1, 1, 1);--contrast-button-background: rgb(255, 255, 255);--contrast-button-hover-text: rgb(255, 255, 255);--contrast-button-hover-background: rgb(1, 1, 1);--accent-background: #afb6b5;--accent-background-light: rgb(217, 217, 214);--accent-border: rgb(140, 150, 148);--accent-list-marker: rgba(1, 1, 1, 0.58);--accent-font-base: rgb(1, 1, 1);--accent-font-dark: rgb(1, 1, 1);--accent-font-light: rgba(1, 1, 1, 0.7);--accent-icon-light: rgba(1, 1, 1, 0.45);--accent-link: rgb(1, 1, 1);--accent-link-visited: rgb(1, 1, 1);--accent-keyline: rgba(1, 1, 1, 0.3);--accent-keyline-dark: rgba(1, 1, 1, 0.8);--accent-button-text: rgb(255, 255, 255);--accent-button-background: rgb(1, 1, 1);--accent-button-hover-text: rgb(1, 1, 1);--accent-button-hover-background: rgb(255, 255, 255);--button-accented-text: rgb(1, 1, 1);--button-accented-background: rgb(140, 150, 148)}@media(prefers-contrast: more){.tna-text-input{--background: rgb(255, 255, 255);--background-tint: #ddd;--font-base: rgb(1, 1, 1);--font-dark: rgb(1, 1, 1);--font-light: rgb(1, 1, 1);--icon-light: rgba(1, 1, 1, 0.8);--link: #202fbc;--link-visited: #6a286b;--keyline: rgba(1, 1, 1, 0.8);--keyline-dark: rgb(1, 1, 1);--input-foreground: rgb(1, 1, 1);--input-background: rgb(255, 255, 255);--input-border: rgb(1, 1, 1);--form-error-text: #c20000;--button-text: rgb(255, 255, 255);--button-background: rgb(1, 1, 1);--button-hover-text: rgb(1, 1, 1);--button-hover-background: rgb(255, 255, 255);--contrast-background: rgb(1, 1, 1);--contrast-font-base: rgb(255, 255, 255);--contrast-font-dark: rgb(255, 255, 255);--contrast-font-light: rgba(255, 255, 255, 0.8);--contrast-icon-light: rgba(255, 255, 255, 0.45);--contrast-link: rgb(0, 176, 255);--contrast-link-visited: #a8f;--contrast-keyline: rgba(255, 255, 255, 0.3);--contrast-keyline-dark: rgba(255, 255, 255, 0.6);--contrast-button-text: rgb(1, 1, 1);--contrast-button-background: rgb(255, 255, 255);--contrast-button-hover-text: rgb(255, 255, 255);--contrast-button-hover-background: rgb(1, 1, 1);--accent-background: #afb6b5;--accent-background-light: rgb(217, 217, 214);--accent-border: rgb(140, 150, 148);--accent-list-marker: rgba(1, 1, 1, 0.58);--accent-font-base: rgb(1, 1, 1);--accent-font-dark: rgb(1, 1, 1);--accent-font-light: rgba(1, 1, 1, 0.8);--accent-icon-light: rgba(1, 1, 1, 0.45);--accent-link: rgb(1, 1, 1);--accent-link-visited: rgb(1, 1, 1);--accent-keyline: rgba(1, 1, 1, 0.3);--accent-keyline-dark: rgba(1, 1, 1, 0.8);--accent-button-text: rgb(255, 255, 255);--accent-button-background: rgb(1, 1, 1);--accent-button-hover-text: rgb(1, 1, 1);--accent-button-hover-background: rgb(255, 255, 255);--button-accented-text: rgb(1, 1, 1);--button-accented-background: #8f9997}}.tna-text-input{padding:0 6px;display:block;box-sizing:border-box;color:var(--input-foreground, rgb(1, 1, 1));line-height:2rem;background-color:var(--input-background, rgb(255, 255, 255));border:2px var(--input-border, rgb(1, 1, 1)) solid;border-radius:.1px}.tna-text-input,.tna-text-input-wrapper{width:100%}.tna-form__group--error .tna-text-input{border-color:var(--form-error-border, #c20000)}.tna-text-input--xs{max-width:5rem}.tna-text-input--s{max-width:10rem}.tna-text-input--m{max-width:20rem}.tna-text-input--l{max-width:40rem}.tna-text-input--xl{max-width:80rem}.tna-text-input-wrapper .tna-text-input{flex:1;border-right-width:0}.tna-text-input-wrapper{display:flex;align-items:stretch}.tna-text-input-wrapper .tna-button{white-space:nowrap}.tna-text-input-wrapper .tna-button svg{width:30px;margin:0}/*# sourceMappingURL=text-input.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/components/text-input/text-input.scss"],"names":[],"mappings":"AAuLA,gBAzKM,0yDA4KJ,+BAHF,gBAzJM,qwDC1BN,gBACE,WACA,cAEA,cACA,sBD0CA,4CCtCA,iBD0CA,6DA2BI,mDChEJ,mBAEA,wCDmEI,+CC/DJ,oBACE,eAGF,mBACE,gBAGF,mBACE,gBAGF,mBACE,gBAGF,oBACE","file":"text-input.css","sourcesContent":["@use \"sass:list\";\n@use \"sass:map\";\n@use \"../variables/borders\";\n@use \"../variables/colour\";\n@use \"../variables/features\";\n@use \"../tools/media\";\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)}\n if($important, !important, null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width colour-var($colour) $style if($important, !important, null);\n } @else {\n outline-color: colour-var($colour) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if($important, !important, null);\n}\n\n@mixin thick-keyline($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline-dark\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline-dark\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"accent-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"accent-border\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\n \"form-error-border\",\n borders.$thick-border-width,\n solid\n );\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour) {\n @if $direction != \"\" {\n border-#{$direction}: borders.$thick-border-width\n #{brand-colour($brandColour)}\n solid;\n } @else {\n border: borders.$thick-border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n@mixin thick-keyline-transparent($direction: \"\") {\n @if $direction != \"\" {\n border-#{$direction}: borders.$thick-border-width transparent solid;\n } @else {\n border: borders.$thick-border-width transparent solid;\n }\n}\n\n// Use light theme colours (except for \"form-error-border\")\n%always-light {\n @include colour-css-vars(\"form-error-border\", \"focus-outline\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\n \"form-error-border\",\n \"focus-outline\"\n );\n }\n}\n\n@mixin always-light {\n @extend %always-light;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n\n // @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n --accent-list-marker: var(--font-base);\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-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n }\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-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-border: #{colour.brand-colour(\"yellow\")} !important;\n // --accent-list-marker: #{colour.brand-colour(\"brown\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n --button-accented-background: #{colour.brand-colour(\"brown\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --accent-border: #{colour.brand-colour(\"black\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"grey\")} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %accent-lighter-text;\n @extend %black-accent;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --accent-border: #{colour.brand-colour(\"pink\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"pink\")} !important;\n --button-accented-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %accent-lighter-text;\n @extend %pink-accent;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --accent-border: #{colour.brand-colour(\"orange\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"orange\")} !important;\n --button-accented-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %accent-lighter-text;\n @extend %orange-accent;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --accent-border: #{colour.brand-colour(\"green\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"green\")} !important;\n --button-accented-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %accent-lighter-text;\n @extend %green-accent;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --accent-border: #{colour.brand-colour(\"blue\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"blue\")} !important;\n --button-accented-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %accent-lighter-text;\n @extend %blue-accent;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n\n@mixin image-loader-background {\n @if features.$image-loader-animations {\n background: linear-gradient(\n -45deg,\n rgba(0 0 0 / 25%),\n rgba(255 255 255 / 25%),\n rgba(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}\n","@use \"../../variables/forms\";\n@use \"../../tools/colour\";\n@use \"../../tools/spacing\";\n\n.tna-text-input {\n width: 100%;\n padding: 0 spacing.space(0.375);\n\n display: block;\n box-sizing: border-box;\n\n @include colour.always-light;\n @include colour.colour-font(\"input-foreground\");\n line-height: 2rem;\n\n @include colour.colour-background(\"input-background\");\n\n @include colour.colour-border(\"input-border\", forms.$form-field-border-width);\n border-radius: 0.1px;\n\n .tna-form__group--error & {\n @include colour.colour-border(\"form-error-border\");\n }\n\n &--xs {\n max-width: 5rem;\n }\n\n &--s {\n max-width: 10rem;\n }\n\n &--m {\n max-width: 20rem;\n }\n\n &--l {\n max-width: 40rem;\n }\n\n &--xl {\n max-width: 80rem;\n }\n}\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../../src/nationalarchives/tools/_colour.scss","../../../../src/nationalarchives/components/text-input/text-input.scss"],"names":[],"mappings":"AAuLA,gBAzKM,0yDA4KJ,+BAHF,gBAzJM,qwDC1BN,gBACE,cAEA,cACA,sBD2CA,4CCvCA,iBD2CA,6DA2BI,mDCjEJ,mBAEA,wCAEE,WAGF,wCD+DI,+CC3DJ,oBACE,eAGF,mBACE,gBAGF,mBACE,gBAGF,mBACE,gBAGF,oBACE,gBAGF,wCACE,OAEA,qBAGF,wBACE,aACA,oBAEA,oCACE,mBAEA,wCACE,WACA","file":"text-input.css","sourcesContent":["@use \"sass:list\";\n@use \"sass:map\";\n@use \"../variables/borders\";\n@use \"../variables/colour\";\n@use \"../variables/features\";\n@use \"../tools/media\";\n\n@function brand-colour($colour, $opacity: 1) {\n @return colour.brand-colour($colour, $opacity);\n}\n\n@mixin colour-css-vars($excludes...) {\n @each $name, $value in colour.$colour-palette-default {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@mixin colour-css-vars-high-contrast-dark($excludes...) {\n @each $name, $value in colour.$colour-palette-high-contrast-dark {\n @if not list.index($excludes, $name) {\n --#{$name}: #{$value};\n }\n }\n}\n\n@function colour-var($colour) {\n @return var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n );\n}\n\n@mixin colour-font($colour, $important: false) {\n color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background($colour, $important: false) {\n background-color: colour-var($colour) if($important, !important, null);\n}\n\n@mixin colour-background-brand($brandColour, $important: false) {\n background-color: #{brand-colour($brandColour)}\n if($important, !important, null);\n}\n\n@mixin colour-border(\n $colour,\n $width: \"\",\n $style: solid,\n $direction: \"\",\n $important: false\n) {\n @if $direction != \"\" {\n @if $width != \"\" {\n border-#{$direction}: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-#{$direction}-color: colour-var($colour)\n if($important, !important, null);\n }\n } @else {\n @if $width != \"\" {\n border: $width\n colour-var($colour)\n $style\n if($important, !important, null);\n } @else {\n border-color: var(\n --#{$colour},\n #{map.get(colour.$colour-palette-default, $colour)}\n )\n if($important, !important, null);\n }\n }\n}\n\n@mixin colour-outline($colour, $width: \"\", $style: solid, $important: false) {\n @if $width != \"\" {\n outline: $width colour-var($colour) $style if($important, !important, null);\n } @else {\n outline-color: colour-var($colour) if($important, !important, null);\n }\n}\n\n@mixin colour-fill($colour, $important: false) {\n fill: colour-var($colour) if($important, !important, null);\n}\n\n@mixin thick-keyline($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-dark($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"keyline-dark\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"keyline-dark\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-accent($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"accent-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\"accent-border\", borders.$thick-border-width, solid);\n }\n}\n\n@mixin thick-keyline-error($direction: \"\") {\n @if $direction != \"\" {\n @include colour-border(\n \"form-error-border\",\n borders.$thick-border-width,\n solid,\n $direction\n );\n } @else {\n @include colour-border(\n \"form-error-border\",\n borders.$thick-border-width,\n solid\n );\n }\n}\n\n@mixin thick-keyline-brand($direction: \"\", $brandColour) {\n @if $direction != \"\" {\n border-#{$direction}: borders.$thick-border-width\n #{brand-colour($brandColour)}\n solid;\n } @else {\n border: borders.$thick-border-width #{brand-colour($brandColour)} solid;\n }\n}\n\n@mixin thick-keyline-transparent($direction: \"\") {\n @if $direction != \"\" {\n border-#{$direction}: borders.$thick-border-width transparent solid;\n } @else {\n border: borders.$thick-border-width transparent solid;\n }\n}\n\n// Use light theme colours (except for \"form-error-border\")\n%always-light {\n @include colour-css-vars(\"form-error-border\", \"focus-outline\");\n\n @media (prefers-contrast: more) {\n @include colour-css-vars-high-contrast(\n \"form-error-border\",\n \"focus-outline\"\n );\n }\n}\n\n@mixin always-light {\n @extend %always-light;\n}\n\n%contrast {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin contrast {\n @extend %contrast;\n}\n\n%contrast-on-mobile {\n @include media.on-mobile {\n --background: var(--contrast-background);\n --font-base: var(--contrast-font-base);\n --font-dark: var(--contrast-font-dark);\n --font-light: var(--contrast-font-light);\n --icon-light: var(--contrast-icon-light);\n --link: var(--contrast-link);\n --link-visited: var(--contrast-link-visited);\n --keyline: var(--contrast-keyline);\n --keyline-dark: var(--contrast-keyline-dark);\n --button-text: var(--contrast-button-text);\n --button-background: var(--contrast-button-background);\n --button-hover-text: var(--contrast-button-hover-text);\n --button-hover-background: var(--contrast-button-hover-background);\n --accent-list-marker: var(--accent-border);\n // --accent-list-marker: var(--font-base);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n }\n}\n\n@mixin contrast-on-mobile {\n @extend %contrast-on-mobile;\n}\n\n%tint {\n --background: var(--background-tint);\n\n @include colour-background(\"background\");\n\n // @include colour-font(\"font-base\");\n}\n\n@mixin tint {\n @extend %tint;\n}\n\n%accent {\n --background: var(--accent-background);\n --font-base: var(--accent-font-base);\n --font-dark: var(--accent-font-dark);\n --font-light: var(--accent-font-light);\n --icon-light: var(--accent-icon-light);\n --link: var(--accent-link);\n --link-visited: var(--accent-link);\n --keyline: var(--accent-keyline);\n --keyline-dark: var(--accent-keyline-dark);\n --accent-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n\n @include colour-background(\"background\");\n\n @include colour-font(\"font-base\");\n}\n\n@mixin accent {\n @extend %accent;\n}\n\n%accent-light {\n --background: var(--accent-background-light);\n --font-base: #{map.get(colour.$colour-palette-default, \"font-base\")};\n --font-dark: #{map.get(colour.$colour-palette-default, \"font-dark\")};\n --font-light: #{map.get(colour.$colour-palette-default, \"font-light\")};\n --icon-light: #{map.get(colour.$colour-palette-default, \"icon-light\")};\n --keyline: #{map.get(colour.$colour-palette-default, \"keyline\")};\n --keyline-dark: #{map.get(colour.$colour-palette-default, \"keyline-dark\")};\n --button-text: #{map.get(colour.$colour-palette-default, \"button-text\")};\n --button-background: #{map.get(\n colour.$colour-palette-default,\n \"button-background\"\n )};\n --button-hover-text: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-text\"\n )};\n --button-hover-background: #{map.get(\n colour.$colour-palette-default,\n \"button-hover-background\"\n )};\n --accent-list-marker: var(--font-base);\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-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n }\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-list-marker: var(--accent-font-base);\n --accent-border: var(--accent-font-dark);\n --button-text: var(--accent-button-text);\n --button-background: var(--accent-button-background);\n --button-hover-text: var(--accent-button-hover-text);\n --button-hover-background: var(--accent-button-hover-background);\n }\n}\n\n@mixin accent-light {\n @extend %accent-light;\n}\n\n%yellow-accent {\n --accent-background: #{colour.brand-colour(\"yellow\")} !important;\n --accent-background-light: #{colour.brand-colour(\"cream\")} !important;\n --accent-border: #{colour.brand-colour(\"yellow\")} !important;\n // --accent-list-marker: #{colour.brand-colour(\"brown\")} !important;\n --accent-font-base: #{colour.brand-colour(\"black\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"black\")} !important;\n --accent-font-light: #{colour.brand-colour(\"black\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"black\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"black\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"black\")} !important;\n --accent-keyline: #{colour.brand-colour(\"black\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"black\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n --button-accented-background: #{colour.brand-colour(\"brown\")} !important;\n}\n\n@mixin yellow-accent {\n @extend %yellow-accent;\n}\n\n%accent-lighter-text {\n --accent-font-base: #{colour.brand-colour(\"white\")} !important;\n --accent-font-dark: #{colour.brand-colour(\"white\")} !important;\n --accent-font-light: #{colour.brand-colour(\"white\", 0.7)} !important;\n --accent-icon-light: #{colour.brand-colour(\"white\", 0.45)} !important;\n --accent-link: #{colour.brand-colour(\"white\")} !important;\n --accent-link-visited: #{colour.brand-colour(\"white\")} !important;\n --accent-keyline: #{colour.brand-colour(\"white\", 0.5)} !important;\n --accent-keyline-dark: #{colour.brand-colour(\"white\", 0.8)} !important;\n --button-accented-text: #{colour.brand-colour(\"white\")} !important;\n}\n\n%black-accent {\n --accent-background: #{colour.brand-colour(\"black\")} !important;\n --accent-background-light: #{colour.brand-colour(\"light-grey\")} !important;\n --accent-border: #{colour.brand-colour(\"black\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"grey\")} !important;\n --button-accented-text: #{colour.brand-colour(\"black\")} !important;\n --button-accented-background: #{colour.brand-colour(\"grey\")} !important;\n}\n\n@mixin black-accent {\n @extend %accent-lighter-text;\n @extend %black-accent;\n}\n\n%pink-accent {\n --accent-background: #{colour.brand-colour(\"maroon\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-pink\")} !important;\n --accent-border: #{colour.brand-colour(\"pink\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"pink\")} !important;\n --button-accented-background: #{colour.brand-colour(\"maroon\")} !important;\n}\n\n@mixin pink-accent {\n @extend %accent-lighter-text;\n @extend %pink-accent;\n}\n\n%orange-accent {\n --accent-background: #{colour.brand-colour(\"chestnut\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-orange\")} !important;\n --accent-border: #{colour.brand-colour(\"orange\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"orange\")} !important;\n --button-accented-background: #{colour.brand-colour(\"chestnut\")} !important;\n}\n\n@mixin orange-accent {\n @extend %accent-lighter-text;\n @extend %orange-accent;\n}\n\n%green-accent {\n --accent-background: #{colour.brand-colour(\"forest\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-green\")} !important;\n --accent-border: #{colour.brand-colour(\"green\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"green\")} !important;\n --button-accented-background: #{colour.brand-colour(\"forest\")} !important;\n}\n\n@mixin green-accent {\n @extend %accent-lighter-text;\n @extend %green-accent;\n}\n\n%blue-accent {\n --accent-background: #{colour.brand-colour(\"navy\")} !important;\n --accent-background-light: #{colour.brand-colour(\"pastel-blue\")} !important;\n --accent-border: #{colour.brand-colour(\"blue\")} !important;\n --accent-list-marker: #{colour.brand-colour(\"blue\")} !important;\n --button-accented-background: #{colour.brand-colour(\"navy\")} !important;\n}\n\n@mixin blue-accent {\n @extend %accent-lighter-text;\n @extend %blue-accent;\n}\n\n@mixin on-high-contrast {\n @media (prefers-contrast: more) {\n @content;\n }\n}\n\n@mixin on-forced-colours {\n @media (forced-colors: active) {\n @content;\n }\n}\n\n@mixin on-high-contrast-and-forced-colours {\n @include on-forced-colours {\n @content;\n }\n\n @include on-high-contrast {\n @content;\n }\n}\n\n@mixin image-loader-background {\n @if features.$image-loader-animations {\n background: linear-gradient(\n -45deg,\n rgba(0 0 0 / 25%),\n rgba(255 255 255 / 25%),\n rgba(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}\n","@use \"../../variables/forms\";\n@use \"../../tools/colour\";\n@use \"../../tools/spacing\";\n\n.tna-text-input {\n padding: 0 spacing.space(0.375);\n\n display: block;\n box-sizing: border-box;\n\n @include colour.always-light;\n @include colour.colour-font(\"input-foreground\");\n line-height: 2rem;\n\n @include colour.colour-background(\"input-background\");\n\n @include colour.colour-border(\"input-border\", forms.$form-field-border-width);\n border-radius: 0.1px;\n\n &,\n &-wrapper {\n width: 100%;\n }\n\n .tna-form__group--error & {\n @include colour.colour-border(\"form-error-border\");\n }\n\n &--xs {\n max-width: 5rem;\n }\n\n &--s {\n max-width: 10rem;\n }\n\n &--m {\n max-width: 20rem;\n }\n\n &--l {\n max-width: 40rem;\n }\n\n &--xl {\n max-width: 80rem;\n }\n\n &-wrapper & {\n flex: 1;\n\n border-right-width: 0;\n }\n\n &-wrapper {\n display: flex;\n align-items: stretch;\n\n .tna-button {\n white-space: nowrap;\n\n svg {\n width: 30px;\n margin: 0;\n }\n }\n }\n}\n"]}