@ons/design-system 46.1.2 → 47.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.
- package/components/document-list/_macro.njk +114 -0
- package/components/document-list/document-list.scss +182 -0
- package/components/download-resources/_download-resources.scss +2 -9
- package/components/download-resources/download-resources.js +2 -2
- package/components/input/_macro.njk +1 -2
- package/components/select/_macro.njk +1 -2
- package/components/textarea/_macro.njk +0 -1
- package/components/timeout-modal/timeout-modal.js +31 -6
- package/components/upload/_macro.njk +0 -1
- package/css/census.css +1 -1
- package/css/main.css +1 -1
- package/img/large/alison-pritchard-featured.jpg +0 -0
- package/img/large/alison-pritchard.jpg +0 -0
- package/img/large/census-monuments-lights-featured.jpg +0 -0
- package/img/large/census-monuments-lights.jpg +0 -0
- package/img/large/ons-award-winners.jpg +0 -0
- package/img/small/alison-pritchard-featured.jpg +0 -0
- package/img/small/alison-pritchard.jpg +0 -0
- package/img/small/census-monuments-lights-featured.jpg +0 -0
- package/img/small/census-monuments-lights.jpg +0 -0
- package/img/small/ons-award-winners.jpg +0 -0
- package/img/small/placeholder-portrait.png +0 -0
- package/js/timeout.js +5 -32
- package/layout/_template.njk +1 -1
- package/package.json +4 -4
- package/scripts/main.es5.js +2 -2
- package/scripts/main.js +1 -1
- package/scss/main.scss +1 -2
- package/scss/vars/_colors.scss +9 -3
- package/components/articles/_articles.scss +0 -86
- package/components/articles/_macro.njk +0 -81
- package/components/downloads/_downloads.scss +0 -39
- package/components/downloads/_macro.njk +0 -66
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/js/timeout.js
CHANGED
|
@@ -51,14 +51,8 @@ export default class Timeout {
|
|
|
51
51
|
async startUiCountdown() {
|
|
52
52
|
this.clearTimers();
|
|
53
53
|
this.countdownStarted = true;
|
|
54
|
-
|
|
55
|
-
if (this.enableTimeoutReset) {
|
|
56
|
-
this.shouldRestartCheck = setInterval(async () => {
|
|
57
|
-
await this.hasExpiryTimeResetInAnotherTab();
|
|
58
|
-
}, 20000);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
54
|
let milliseconds = this.convertTimeToMilliSeconds(this.expiryTime);
|
|
55
|
+
|
|
62
56
|
let seconds = milliseconds / 1000;
|
|
63
57
|
let timers = this.timers;
|
|
64
58
|
let $this = this;
|
|
@@ -83,13 +77,9 @@ export default class Timeout {
|
|
|
83
77
|
($this.endWithFullStop ? '.' : '');
|
|
84
78
|
|
|
85
79
|
if (timerExpired) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
$this.countdown.innerHTML = '<span class="ons-u-fw-b">' + $this.countdownExpiredText + '</span>';
|
|
90
|
-
$this.accessibleCountdown.innerHTML = $this.countdownExpiredText;
|
|
91
|
-
setTimeout($this.redirect.bind($this), 2000);
|
|
92
|
-
}
|
|
80
|
+
$this.countdown.innerHTML = '<span class="ons-u-fw-b">' + $this.countdownExpiredText + '</span>';
|
|
81
|
+
$this.accessibleCountdown.innerHTML = $this.countdownExpiredText;
|
|
82
|
+
setTimeout($this.redirect.bind($this), 2000);
|
|
93
83
|
} else {
|
|
94
84
|
seconds--;
|
|
95
85
|
$this.expiryTimeInMilliseconds = seconds * 1000;
|
|
@@ -111,24 +101,10 @@ export default class Timeout {
|
|
|
111
101
|
})();
|
|
112
102
|
}
|
|
113
103
|
|
|
114
|
-
async hasExpiryTimeResetInAnotherTab() {
|
|
115
|
-
const checkExpiryTime = await this.getExpiryTime();
|
|
116
|
-
|
|
117
|
-
if (checkExpiryTime != this.expiryTime) {
|
|
118
|
-
this.expiryTime = checkExpiryTime;
|
|
119
|
-
this.expiryTimeInMilliseconds = this.convertTimeToMilliSeconds(checkExpiryTime);
|
|
120
|
-
this.restartTimeout(this.expiryTimeInMilliseconds);
|
|
121
|
-
} else {
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
104
|
async restartTimeout(timeInMilliSeconds) {
|
|
127
105
|
this.clearTimers();
|
|
128
|
-
clearInterval(this.shouldRestartCheck);
|
|
129
106
|
this.countdownStarted = false;
|
|
130
|
-
|
|
131
|
-
if (timeInMilliSeconds) {
|
|
107
|
+
if (timeInMilliSeconds !== false) {
|
|
132
108
|
this.expiryTimeInMilliseconds = timeInMilliSeconds;
|
|
133
109
|
} else {
|
|
134
110
|
const createNewExpiryTime = await this.setNewExpiryTime();
|
|
@@ -138,11 +114,8 @@ export default class Timeout {
|
|
|
138
114
|
}
|
|
139
115
|
|
|
140
116
|
async handleWindowFocus() {
|
|
141
|
-
this.expiryTime = await this.getExpiryTime();
|
|
142
117
|
this.clearTimers();
|
|
143
|
-
clearInterval(this.shouldRestartCheck);
|
|
144
118
|
if (this.countdownStarted) {
|
|
145
|
-
this.countdownStarted = false;
|
|
146
119
|
this.startUiCountdown();
|
|
147
120
|
}
|
|
148
121
|
}
|
package/layout/_template.njk
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
{# Production #}
|
|
23
23
|
{% set cdn_url = (pageConfig.cdn.url if pageConfig.cdn is defined and pageConfig.cdn and pageConfig.cdn.url is defined and pageConfig.cdn.url) or "https://cdn.ons.gov.uk/sdc/design-system" %}
|
|
24
24
|
{% set slash = "" if cdn_url | last == "/" else "/" %}
|
|
25
|
-
{% set assetsURL = cdn_url + slash + ((pageConfig.cdn.version
|
|
25
|
+
{% set assetsURL = cdn_url + slash + ((pageConfig.cdn.version if pageConfig.cdn is defined and pageConfig.cdn and pageConfig.cdn.version is defined and pageConfig.cdn.version) or release_version) %}
|
|
26
26
|
{% elif pageInfo is defined and pageInfo and pageInfo.version is defined and pageInfo.version %}
|
|
27
27
|
{# Prototype kits #}
|
|
28
28
|
{% set assetsURL = "/" + pageInfo.version %}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ons/design-system",
|
|
3
3
|
"description": "ONS Design System built CSS, JS, and Nunjucks templates",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "47.0.0",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"chai": "^4.3.4",
|
|
79
79
|
"chai-as-promised": "^7.1.1",
|
|
80
80
|
"chai-spies": "^1.0.0",
|
|
81
|
-
"codecov": "3.
|
|
82
|
-
"core-js": "^3.
|
|
81
|
+
"codecov": "^3.8.3",
|
|
82
|
+
"core-js": "^3.21.1",
|
|
83
83
|
"cssnano": "^4.1.11",
|
|
84
84
|
"dialog-polyfill": "^0.5.6",
|
|
85
85
|
"eslint": "^5.9.0",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"karma-mocha-reporter": "^2.2.5",
|
|
120
120
|
"lighthouse": "^7.5.0",
|
|
121
121
|
"lint-staged": "^8.1.0",
|
|
122
|
-
"lodash": "^4.17.
|
|
122
|
+
"lodash": "^4.17.21",
|
|
123
123
|
"marked": "^2.1.3",
|
|
124
124
|
"mdn-polyfills": "^5.14.0",
|
|
125
125
|
"minimist": "^1.2.5",
|