@govuk-one-login/frontend-ui 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,17 +44,17 @@ const frontendUi = require("@govuk-one-login/frontend-ui");
44
44
 
45
45
  nunjucksEnv.addGlobal("addLanguageParam", frontendUi.addLanguageParam);
46
46
  nunjucksEnv.addGlobal("contactUsUrl", frontendUi.contactUsUrl);
47
- nunjucksEnv.addGlobal("May_2025_Rebrand", process.env.May_2025_Rebrand == "true");
47
+ nunjucksEnv.addGlobal("MAY_2025_REBRAND_ENABLED", process.env.MAY_2025_REBRAND_ENABLED == "true");
48
48
  ```
49
49
  Typescript:
50
50
  ```typescript
51
51
  import {contactUsUrl, addLanguageParam } from "@govuk-one-login/frontend-ui";
52
52
  nunjucksEnv.addGlobal("addLanguageParam", addLanguageParam);
53
53
  nunjucksEnv.addGlobal("contactUsUrl", contactUsUrl);
54
- nunjucksEnv.addGlobal("May_2025_Rebrand", process.env.May_2025_Rebrand == "true");
54
+ nunjucksEnv.addGlobal("MAY_2025_REBRAND_ENABLED", process.env.MAY_2025_REBRAND_ENABLED == "true");
55
55
  ```
56
56
 
57
- In order to use the `May_2025_Rebrand` variable you will need to create or add to your `.env` file the following `May_2025_Rebrand=`[true/false]
57
+ In order to use the `MAY_2025_REBRAND_ENABLED` variable you will need to create or add to your `.env` file the following `MAY_2025_REBRAND_ENABLED=`[true/false]
58
58
 
59
59
  ### 4. Load Translations and Configure Middleware
60
60
 
@@ -7,7 +7,7 @@
7
7
  {% from "govuk/components/back-link/macro.njk" import govukBackLink %}
8
8
  {% from "frontend-ui/build/components/language-select/macro.njk" import frontendUiLanguageSelect %}
9
9
 
10
- {% if May_2025_Rebrand %}
10
+ {% if MAY_2025_REBRAND_ENABLED %}
11
11
  {%set htmlClasses = 'govuk-template--rebranded'%}
12
12
  {% endif %}
13
13
 
@@ -6,7 +6,7 @@
6
6
  {% from "frontend-ui/build/components/language-select/macro.njk" import frontendUiLanguageSelect %}
7
7
  {% from "frontend-ui/build/components/footer/macro.njk" import frontendUiFooter %}
8
8
 
9
- {% if May_2025_Rebrand %}
9
+ {% if MAY_2025_REBRAND_ENABLED %}
10
10
  {%set htmlClasses = 'govuk-template--rebranded'%}
11
11
  {% endif %}
12
12
 
@@ -6,7 +6,7 @@
6
6
  {% from "frontend-ui/build/components/footer/macro.njk" import frontendUiFooter %}
7
7
  {% from "frontend-ui/build/components/language-select/macro.njk" import frontendUiLanguageSelect %}
8
8
 
9
- {% if May_2025_Rebrand %}
9
+ {% if MAY_2025_REBRAND_ENABLED %}
10
10
  {%set htmlClasses = 'govuk-template--rebranded'%}
11
11
  {% endif %}
12
12
 
@@ -6,7 +6,7 @@
6
6
  {% from "frontend-ui/build/components/footer/macro.njk" import frontendUiFooter %}
7
7
  {% from "frontend-ui/build/components/language-select/macro.njk" import frontendUiLanguageSelect %}
8
8
 
9
- {% if May_2025_Rebrand %}
9
+ {% if MAY_2025_REBRAND_ENABLED %}
10
10
  {%set htmlClasses = 'govuk-template--rebranded'%}
11
11
  {% endif %}
12
12
 
@@ -85,5 +85,14 @@
85
85
  isDataSensitive:{{analyticsDataSensitive}}
86
86
  });
87
87
  </script>
88
+
89
+ {% if deviceIntelligenceEnabled %}
90
+ <script type="module" src="/public/javascripts/deviceIntelligence.js"></script>
91
+ <script type="module" {% if cspNonce %} nonce="{{ cspNonce }}"{% endif %}>
92
+ import { setFingerprintCookie } from "/public/javascripts/deviceIntelligence.js";
93
+ setFingerprintCookie("{{deviceIntelligenceDomain}}")
94
+ </script>
95
+ {% endif %}
96
+
88
97
  {% endblock %}
89
98
  {% endblock %}
@@ -9,7 +9,7 @@
9
9
  {% from basePath ~ "/views/shared/ga4/on-page-load-macro.njk" import ga4OnPageLoad %}
10
10
  {% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}
11
11
 
12
- {% if May_2025_Rebrand %}
12
+ {% if MAY_2025_REBRAND_ENABLED %}
13
13
  {%set htmlClasses = 'govuk-template--rebranded'%}
14
14
  {% endif %}
15
15
 
@@ -7,7 +7,7 @@
7
7
  {% from "frontend-ui/build/components/language-select/macro.njk" import frontendUiLanguageSelect %}
8
8
  {% from "ga4-opl/macro.njk" import ga4OnPageLoad %}
9
9
 
10
- {% if May_2025_Rebrand %}
10
+ {% if MAY_2025_REBRAND_ENABLED %}
11
11
  {%set htmlClasses = 'govuk-template--rebranded'%}
12
12
  {% endif %}
13
13
 
@@ -5,7 +5,7 @@
5
5
  meta: { items: footer.footerNavItems },
6
6
  contentLicence: { html: footer.contentLicence.html },
7
7
  copyright: { text: footer.copyright.text },
8
- rebrand: May_2025_Rebrand,
8
+ rebrand: MAY_2025_REBRAND_ENABLED,
9
9
  attributes: {
10
10
  "aria-label": "footer"
11
11
  }
@@ -1,7 +1,7 @@
1
1
  {% from "../macros/logo.njk" import govukLogo %}
2
2
  {% set header = params.translations %}
3
3
 
4
- {%if May_2025_Rebrand%}
4
+ {%if MAY_2025_REBRAND_ENABLED%}
5
5
  {%- set _rebrand = params.rebrand | default(govukRebrand() if govukRebrand is callable else govukRebrand) -%}
6
6
  {% endif %}
7
7
  <header class="govuk-header {%- if params.classes %} {{ params.classes }}{% endif %}" data-module="govuk-header">
@@ -16,7 +16,7 @@
16
16
  classes: "govuk-header__logotype",
17
17
  ariaLabelText: "GOV.UK",
18
18
  useTudorCrown: params.useTudorCrown,
19
- rebrand: May_2025_Rebrand
19
+ rebrand: MAY_2025_REBRAND_ENABLED
20
20
  }) | trim | indent(8) }}
21
21
  {% if not params.isEmbeddedMobileApp %}
22
22
  </a>
@@ -24,9 +24,9 @@
24
24
  </div>
25
25
  {% if params.signOutLink %}
26
26
  <div class="frontendUi-header__content govuk-header__content">
27
- <nav aria-label="{{header.ariaLabel}}" class="govuk-header__navigation {{ govuk-header__navigation--signOut if params.May_2025_Rebrand }}">
27
+ <nav aria-label="{{header.ariaLabel}}" class="govuk-header__navigation {{ govuk-header__navigation--signOut if params.MAY_2025_REBRAND_ENABLED }}">
28
28
  <ul id="navigation" class="frontendUi_header__signOut govuk-header__navigation-list">
29
- <li class="{{ 'frontendUi_header_signOut-item--rebrand' if May_2025_Rebrand }} {{'frontendUi_header_signOut-item' if not May_2025_Rebrand}} govuk-header__navigation-item{{ ' govuk-header__navigation-item--active' if item.active }}">
29
+ <li class="{{ 'frontendUi_header_signOut-item--rebrand' if MAY_2025_REBRAND_ENABLED }} {{'frontendUi_header_signOut-item' if not MAY_2025_REBRAND_ENABLED}} govuk-header__navigation-item{{ ' govuk-header__navigation-item--active' if item.active }}">
30
30
  <a aria-label="{{header.signOutAriaLabel}}" class="govuk-header__link" href="{{params.signOutLink}}">
31
31
  {{header.signOut}}
32
32
  </a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@govuk-one-login/frontend-ui",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "",
5
5
  "main": "build/cjs/index.cjs",
6
6
  "module": "build/esm/index.js",