@govuk-one-login/frontend-ui 1.5.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +42 -0
  2. package/build/all.css +1 -1
  3. package/build/cjs/backend/index.cjs +14 -2
  4. package/build/cjs/backend/index.d.cts +10 -0
  5. package/build/cjs/backend/index.d.ts +10 -0
  6. package/build/cjs/backend/index.d.ts.map +1 -1
  7. package/build/cjs/frontend/index.cjs +225 -268
  8. package/build/cjs/frontend/index.d.cts +2 -1
  9. package/build/cjs/frontend/index.d.ts +2 -1
  10. package/build/cjs/frontend/index.d.ts.map +1 -1
  11. package/build/cjs/frontend/spinner/__tests__/spinner.test.d.ts +0 -4
  12. package/build/cjs/frontend/spinner/__tests__/spinner.test.d.ts.map +1 -1
  13. package/build/cjs/frontend/spinner/spinner.d.ts +54 -84
  14. package/build/cjs/frontend/spinner/spinner.d.ts.map +1 -1
  15. package/build/components/_all.scss +1 -0
  16. package/build/components/bases/identity/identity-base-form.njk +54 -33
  17. package/build/components/bases/identity/identity-base-page.njk +54 -32
  18. package/build/components/bases/ipv-core/ipv-core-base.njk +16 -9
  19. package/build/components/progress-button/_index.scss +44 -0
  20. package/build/components/progress-button/macro.njk +2 -0
  21. package/build/components/progress-button/progress-button.yaml +13 -0
  22. package/build/components/progress-button/template.njk +120 -0
  23. package/build/components/spinner/README.md +70 -52
  24. package/build/components/spinner/_index.scss +2 -11
  25. package/build/components/spinner/template.njk +15 -8
  26. package/build/esm/backend/index.d.ts +10 -0
  27. package/build/esm/backend/index.d.ts.map +1 -1
  28. package/build/esm/backend/index.js +14 -2
  29. package/build/esm/frontend/index.d.ts +2 -1
  30. package/build/esm/frontend/index.d.ts.map +1 -1
  31. package/build/esm/frontend/index.js +226 -269
  32. package/build/esm/frontend/spinner/__tests__/spinner.test.d.ts +0 -4
  33. package/build/esm/frontend/spinner/__tests__/spinner.test.d.ts.map +1 -1
  34. package/build/esm/frontend/spinner/spinner.d.ts +54 -84
  35. package/build/esm/frontend/spinner/spinner.d.ts.map +1 -1
  36. package/package.json +3 -2
  37. package/build/components/spinner/api.njk +0 -27
@@ -0,0 +1,120 @@
1
+ {% set progressButton = params.translations %}
2
+
3
+
4
+ {# Set classes for this component #}
5
+ {%- set classNames = "govuk-button govuk-button--progress" -%}
6
+
7
+ {%- if params.classes %}
8
+ {% set classNames = classNames + " " + params.classes %}
9
+ {% endif %}
10
+ {% if params.disabled %}
11
+ {% set classNames = classNames + " govuk-button--disabled" %}
12
+ {% endif -%}
13
+
14
+ {%- if params.element %}
15
+ {% set element = params.element | lower %}
16
+ {% else %}
17
+ {% if params.href %}
18
+ {% set element = 'a' %}
19
+ {% else %}
20
+ {% set element = 'button' %}
21
+ {% endif %}
22
+ {% endif -%}
23
+
24
+ {% if params.isStartButton %}
25
+ {% set iconHtml %}
26
+ {#- The SVG needs `focusable="false"` so that Internet Explorer does not
27
+ treat it as an interactive element - without this it will be
28
+ 'focusable' when using the keyboard to navigate. #}
29
+ <svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
30
+ <path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"/>
31
+ </svg>
32
+ {% endset %}
33
+ {% set classNames = classNames + " govuk-button--start" %}
34
+ {% endif %}
35
+
36
+ {#- Define common attributes that we can use across all element types #}
37
+
38
+ {%- set commonAttributes %} class="{{ classNames }}" data-module="govuk-button"{% for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}{% if params.id %} id="{{ params.id }}"{% endif %}{% endset %}
39
+
40
+ {#- Define common attributes we can use for both button and input types #}
41
+
42
+ {%- set buttonAttributes %}{% if params.name %} name="{{ params.name }}"{% endif %}{% if params.disabled %} disabled="disabled" aria-disabled="true"{% endif %}{% if params.preventDoubleClick !== undefined %} data-prevent-double-click="{{params.preventDoubleClick}}"{% endif %}{% endset %}
43
+
44
+
45
+ {%- if element == 'a' %}
46
+ <a href="{{ params.href if params.href else '#' }}" role="button" draggable="false" {{- commonAttributes | safe }}
47
+ aria-live="assertive"
48
+ onclick="
49
+ this.blur();
50
+ this.dataPreventDoubleClick = 'true';
51
+ this.classList.add('govuk-button--progress-loading');
52
+ this.innerText = '{{ progressButton.waitingText }}';
53
+ this.ariaLabel = '{{ progressButton.waitingText }}';
54
+ setTimeout(() => {
55
+ this.innerText = '{{ progressButton.longWaitingText }}';
56
+ this.ariaLabel = '{{ progressButton.longWaitingText }}';
57
+ }, 5000);
58
+ setTimeout(() => {
59
+ window.location.href = '{{ params.errorPage | default('#') }}';
60
+ }, 10000);
61
+ ">
62
+ {% if params.html %}
63
+ {{ params.html | safe }}
64
+ {% elseif params.text %}
65
+ {{ params.text | safe }}
66
+ {% else %}
67
+ {{ progressButton.text }}
68
+ {% endif %}
69
+ {{- iconHtml | safe | trim | indent(2, true) if iconHtml -}}
70
+ </a>
71
+
72
+ {%- elseif element == 'button' %}
73
+ <button {%- if params.value %} value="{{ params.value }}"{% endif %}{%- if params.type %} type="{{ params.type }}"{% endif %} {{- buttonAttributes | safe }} {{- commonAttributes | safe }}
74
+ aria-live="assertive"
75
+ onclick="
76
+ this.blur();
77
+ this.dataPreventDoubleClick = 'true';
78
+ this.classList.add('govuk-button--progress-loading');
79
+ this.innerText = '{{ progressButton.waitingText }}';
80
+ this.ariaLabel = '{{ progressButton.waitingText }}';
81
+ setTimeout(() => {
82
+ this.innerText = '{{ progressButton.longWaitingText }}';
83
+ this.ariaLabel = '{{ progressButton.longWaitingText }}';
84
+ }, 5000);
85
+ setTimeout(() => {
86
+ window.location.href = '{{ params.errorPage | default('#') }}';
87
+ }, 10000);
88
+ ">
89
+ {% if params.html %}
90
+ {{ params.html | safe }}
91
+ {% elseif params.text %}
92
+ {{ params.text | safe }}
93
+ {% else %}
94
+ {{ progressButton.text }}
95
+ {% endif %}
96
+ {{- iconHtml | safe | trim | indent(2, true) if iconHtml -}}
97
+
98
+ </button>
99
+
100
+ {%- elseif element == 'input' %}
101
+ <input value="{{ params.value }}" type="{{ params.type if params.type else 'submit'}}"{{- buttonAttributes | safe }} {{- commonAttributes | safe }}
102
+ aria-live="assertive"
103
+ onclick="
104
+ this.blur();
105
+ this.dataPreventDoubleClick = 'true';
106
+ this.classList.add('govuk-button--progress-loading');
107
+ this.value = '{{ progressButton.waitingText }}';
108
+ this.ariaLabel = '{{ progressButton.waitingText }}';
109
+ setTimeout(() => {
110
+ this.value = '{{ progressButton.longWaitingText }}';
111
+ this.ariaLabel = '{{ progressButton.longWaitingText }}';
112
+ }, 5000);
113
+ setTimeout(() => {
114
+ window.location.href = '{{ params.errorPage | default('#') }}';
115
+ }, 10000);
116
+ return false;
117
+ "
118
+ >
119
+ {{- iconHtml | safe | trim | indent(2, true) if iconHtml -}}
120
+ {% endif %}
@@ -1,47 +1,82 @@
1
1
  # Spinner
2
2
 
3
- This component can be imported to be displayed before the page loads. Currently the logic has been set up to **display** the spinner.
4
-
5
- Should you need to ensure it displays before the page renders any data, this should be done within the app.
6
-
7
- ## Timer
3
+ This component:
4
+ - Displays an animated spinner graphic
5
+ - Repeatedly calls a supplied function
6
+ - Stops the spinner animation when the function returns success, failure, or doesn't return either after a certain amount of time
7
+ - Displays different HTML for the different phases of its lifecycle
8
+
9
+ It consists of code in `../../frontend-src/spinner/spinner.ts` and styling in `_index.scss`
10
+
11
+ ## Requirements
12
+
13
+ For the spinner to perform correctly it requires the following:
14
+ - A container `div` to display within
15
+ - A polling function to call repeatedly until it returns success or failure
16
+ - An optional success function to call once if the polling function returns success
17
+ - An optional error function to call once if the polling function returns failure, or we reach the abort duration
18
+ - A div with id `no-js-content`. This should contain the HTML to display if the user has JS disabled
19
+ - An optional div with id `wait-content`. This should contain the default HTML to display under the spinner
20
+ - An optional div with id `long-wait-content`. This should contain the HTML to display under the spinner once it has been spinning for the specified long wait duration
21
+ - An optional div with id `success-content`. This should contain the HTML to display under the spinner once the polling function returns success
22
+ - An optional div with id `error-content`. This should contain the HTML to display under the spinner if the polling function returns failure, or doesn't return success before the abort duration is reached
23
+ - An optional data attribute `data-ms-before-informing-of-long-wait` to set the amount of time the spinner will spin before displaying the `long-wait-content`
24
+ - An optional data attribute `data-ms-before-abort` to set the amount of time the spinner will spin before displaying the `error-content` and calling the `errorFunction`
25
+ - An optional data attribute `data-ms-between-dom-update` to set the amount of time between updates to the spinner UI
26
+ - An optional data attribute `data-ms-between-requests` to set the amount of time between calls to the `pollingFunction`
27
+ - An optional data attribute `data-hide-spinner-on-error` to hide the spinner graphic on error (defaults to false)
28
+ - An optional data attribute `aria-alert-completion-text`. If supplied this text will be set as an aria alert if the spinner completes successfully
29
+
30
+ For example:
31
+
32
+ ```html
33
+ <div id="spinner-container"
34
+ data-ms-before-informing-of-long-wait="10000"
35
+ data-ms-before-abort="30000"
36
+ data-ms-between-dom-update="1000"
37
+ data-ms-between-requests="2000"
38
+ data-hide-spinner-on-error="true"
39
+ data-aria-alert-completion-text="Task completed successfully, you may now continue">
40
+ <div id="no-js-content"><p class="centre govuk-body">JS is disabled</p></div>
41
+ <div id="wait-content" style="display:none"><p class="centre govuk-body">Waiting</p></div>
42
+ <div id="long-wait-content" style="display:none"><p class="centre govuk-body">Still waiting</p></div>
43
+ <div id="success-content" style="display:none"><p class="centre govuk-body">Success!</p></div>
44
+ <div id="error-content" style="display:none"><p class="centre govuk-body">Error :(</p></div>
45
+ </div>
46
+ ```
8
47
 
9
- The timer is set to two seconds and this is done in the route. There is a file called `api.njk` and this binds the data attributes that are needed for the script to be run.
48
+ Note that the content divs (except for the no-js div) have `style="display:none"` to hide them until they are needed.
10
49
 
11
- ```njk
12
- {% extends "layouts/main.njk" %}
50
+ ```typescript
51
+ async function pollFunction(abortSignal): PollResult {
52
+ // Check for success
53
+ }
13
54
 
14
- {% set url = "/api" %}
55
+ function successFunction(): void {
56
+ // Optionally do stuff, e.g. enable a button, redirect, etc
57
+ }
15
58
 
16
- {% block content %}
17
- <div id="spinner-container"
18
- data-initial-heading="Initial heading text"
19
- data-initial-spinnerStateText="Initial spinner state text"
20
- data-initial-spinnerState="pending"
21
- data-error-heading="Error heading"
22
- data-error-messageText="Error message text"
23
- data-error-whatYouCanDo-heading="Error what you can do heading"
24
- data-error-whatYouCanDo-message-text1="Error what you can do message text1"
25
- data-error-whatYouCanDo-message-link-href="Error what you can do message link href"
26
- data-error-whatYouCanDo-message-link-text="Error what you can do message link text"
27
- data-error-whatYouCanDo-message-text2="Error what you can do message link text2"
28
- data-complete-spinnerState="complete"
29
- data-longWait-spinnerStateText="Long wait spinner state">
30
- </div>
59
+ function errorFunction(): void {
60
+ // Optionally do stuff, e.g. enable a button, redirect, etc
61
+ }
31
62
 
32
- {% endblock %}
63
+ useSpinner("spinner-container", pollingFunction, successFunction, errorFunction);
64
+ ```
33
65
 
34
- {% block pageScripts %}
66
+ ## Lifecycle
35
67
 
36
- {% endblock %}
68
+ The spinner starts in the waiting state and displays the `wait` content under the animated spinner graphic content.
69
+ If a call to the polling function returns `success` the spinner will stop animating, display the `success-content` content, and call the `successFunction` (if specified)
70
+ If a call to the polling function returns `failure` the spinner will stop animating, display the `error-content` content, and call the `errorFunction` (if specified)
71
+ If the spinner waits past the `long-wait` duration while the polling function keeps returning `pending` the spinner will display the `long-wait-content` content
72
+ If the spinner waits past the `abort` duration while the polling function keeps returning `pending` the spinner will stop animating, display the `error-content` content, and call the `errorFunction` (if specified)
37
73
 
74
+ ### Page refreshes
38
75
 
39
- ```
76
+ When the spinner starts for the first time it stores the current time in session storage. If the page is refreshed the spinner will retrieve the initial start time from session storage and update itself appropriately.
40
77
 
41
78
  ## Scripts
42
79
 
43
- The script finds the DOM element of the ID `spinner-container` and then runs the animation, it has the flexibility for an error state to be handled or for spinner to take longer/shorter.
44
-
45
80
  Within the frontend-ui package, this script is bundled within `frontend-src`, so that it can be used in the alpha-app.
46
81
 
47
82
  Please note that in the `package.json` file of the frontend-ui repo the files needed for the spinner are exported as follows:
@@ -63,11 +98,13 @@ The default import is at the top and the one at the bottom ensures, the correct
63
98
 
64
99
  Configurations to the alpha-app have also been made to ensure these script files work accordingly however this should not affect any users wanting to use the spinner component from the frontend-ui package.
65
100
 
66
- ## Routes
101
+ ## Manual Testing
102
+
103
+ The nunjucks files in this folder are to allow automated accessibility testing, most users of the spinner component will only need the CSS and script files.
67
104
 
68
- The way testing is done for visual purposes of the components within the frontend-ui package is through the alpha-app.
105
+ There is a `/spinner` page in the alpha-app that will display the spinner component.
69
106
 
70
- The routes are set with Express and it is important to note, this route setting is important within the user's application to ensure the spinner works effectively.
107
+ An endpoint has been created in the alpha-app at `/api` that will return a pending result for a specified number of requests before returning a success response.
71
108
 
72
109
  ```js
73
110
  let counter = 0;
@@ -86,22 +123,3 @@ app.get("/api", (req, res) => {
86
123
  }
87
124
  });
88
125
  ```
89
-
90
- This block of code is used **before** any middleware is set, to ensure the params at the end of the route can be captured. This is also helpful as usually the spinner is the first thing to render, whilst the page waits for data to be loaded.
91
-
92
- There is a counter set here and within `template.njk` the url sets the processing time (defaulted to 2 currently).
93
-
94
- ```njk
95
- {% block content %}
96
-
97
- {% set url = "/api?processingTime=2" %}
98
-
99
-
100
- <div id="spinner-container" data-api-route="{{ url }}">
101
-
102
- </div>
103
-
104
- {% endblock %}
105
- ```
106
-
107
- It is important that the url is set and the page uses the correct ID.
@@ -6,7 +6,7 @@
6
6
  border-style: solid;
7
7
  border-color: #dee0e2;
8
8
  border-top-color: #005ea5;
9
- margin-bottom: govuk-spacing(3);
9
+ margin-bottom: 15px;
10
10
 
11
11
  @media (forced-colors: active) {
12
12
  forced-color-adjust: none;
@@ -22,22 +22,13 @@
22
22
  transform: rotate(0.125turn);
23
23
  }
24
24
 
25
- &__ready {
25
+ &__finished {
26
26
  border-color: #005ea5;
27
27
  -webkit-animation: none;
28
28
  animation: none;
29
29
  }
30
30
  }
31
31
 
32
- #spinner-container {
33
- &__error {
34
- .spinner,
35
- .spinner-state-text {
36
- display: none;
37
- }
38
- }
39
- }
40
-
41
32
  @-webkit-keyframes spin {
42
33
  0% {
43
34
  -webkit-transform: rotate(0deg);
@@ -1,11 +1,18 @@
1
+ {# This template is for use in accessbility testing. #}
1
2
  {% block content %}
2
3
 
3
- {% set url = "/api?processingTime=2" %}
4
+ <main>
5
+ <div id="spinner-container"
6
+ data-ms-before-informing-of-long-wait="4000"
7
+ data-ms-before-abort="9000"
8
+ data-ms-between-dom-update="1000"
9
+ data-ms-between-requests="3000">
10
+ <div id="no-js-content"><p class="centre govuk-body">JS is disabled</p></div>
11
+ <div id="wait-content" style="display:none"><p class="centre govuk-body">Waiting</p></div>
12
+ <div id="long-wait-content" style="display:none"><p class="centre govuk-body">Still waiting</p></div>
13
+ <div id="success-content" style="display:none"><p class="centre govuk-body">Success!</p></div>
14
+ <div id="error-content" style="display:none"><p class="centre govuk-body">Error :(</p></div>
15
+ </div>
16
+ </main>
4
17
 
5
-
6
- <div id="spinner-container" data-api-route="{{ url }}">
7
-
8
- </div>
9
-
10
-
11
- {% endblock %}
18
+ {% endblock %}
@@ -91,6 +91,11 @@ export declare const frontendUiTranslationEn: {
91
91
  skipLink: {
92
92
  title: string;
93
93
  };
94
+ progressButton: {
95
+ text: string;
96
+ waitingText: string;
97
+ longWaitingText: string;
98
+ };
94
99
  };
95
100
  export declare const frontendUiTranslationCy: {
96
101
  cookieBanner: {
@@ -149,6 +154,11 @@ export declare const frontendUiTranslationCy: {
149
154
  skipLink: {
150
155
  title: string;
151
156
  };
157
+ progressButton: {
158
+ text: string;
159
+ waitingText: string;
160
+ longWaitingText: string;
161
+ };
152
162
  };
153
163
  export {};
154
164
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQ1D,UAAU,QAAQ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O,SAerE,CAAC;AAGF,eAAO,MAAM,kCAAkC,GAC7C,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,YAAY,SAUnB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,UAU3D;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAkBhE;AAED,eAAO,MAAM,mBAAmB,GAC9B,cAAc,OAAO,OAAO,EAC5B,WAAW,MAAM,SASlB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAuBxB,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAgB,CAAC;AACrD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAgB,CAAC"}
@@ -71,13 +71,19 @@ var phaseBanner$1 = {
71
71
  var skipLink$1 = {
72
72
  title: "Neidio i'r prif gynnwys"
73
73
  };
74
+ var progressButton$1 = {
75
+ text: "Parhau",
76
+ waitingText: "Aros",
77
+ longWaitingText: "Parhau i aros"
78
+ };
74
79
  var translationCy = {
75
80
  cookieBanner: cookieBanner$1,
76
81
  footer: footer$1,
77
82
  header: header$1,
78
83
  languageSelect: languageSelect$1,
79
84
  phaseBanner: phaseBanner$1,
80
- skipLink: skipLink$1
85
+ skipLink: skipLink$1,
86
+ progressButton: progressButton$1
81
87
  };
82
88
 
83
89
  var cookieBanner = {
@@ -150,13 +156,19 @@ var phaseBanner = {
150
156
  var skipLink = {
151
157
  title: "Skip to main content"
152
158
  };
159
+ var progressButton = {
160
+ text: "Continue",
161
+ waitingText: "Wait",
162
+ longWaitingText: "Keep waiting"
163
+ };
153
164
  var translationEn = {
154
165
  cookieBanner: cookieBanner,
155
166
  footer: footer,
156
167
  header: header,
157
168
  languageSelect: languageSelect,
158
169
  phaseBanner: phaseBanner,
159
- skipLink: skipLink
170
+ skipLink: skipLink,
171
+ progressButton: progressButton
160
172
  };
161
173
 
162
174
  // Implementation
@@ -1,2 +1,3 @@
1
- export { useSpinner } from "./spinner/spinner";
1
+ export { useSpinner, PollResult } from "./spinner/spinner";
2
+ export type { PollingFunction } from "./spinner/spinner";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../frontend-src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../frontend-src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}