@ons/design-system 44.0.2 → 45.0.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/components/access-code/uac.scss +5 -5
- package/components/address-input/_macro.njk +1 -0
- package/components/address-input/autosuggest.address.js +0 -1
- package/components/autosuggest/_macro.njk +1 -0
- package/components/autosuggest/autosuggest.ui.js +3 -3
- package/components/autosuggest/{code.list.searcher.js → fuse-config.js} +1 -3
- package/components/checkboxes/_checkbox-macro.njk +1 -1
- package/components/checkboxes/_macro.njk +1 -1
- package/components/fieldset/_macro.njk +1 -1
- package/components/header/_header.scss +3 -4
- package/components/header/_macro.njk +2 -2
- package/components/highlight/_highlight.scss +5 -0
- package/components/input/_input.scss +2 -2
- package/components/metadata/_macro.njk +1 -1
- package/components/metadata/_metadata.scss +1 -1
- package/components/modal/_macro.njk +23 -0
- package/components/modal/_modal.scss +32 -0
- package/components/modal/modal.dom.js +14 -0
- package/components/modal/modal.js +104 -0
- package/components/radios/_macro.njk +2 -2
- package/components/table-of-contents/_macro.njk +7 -7
- package/components/textarea/_macro.njk +2 -2
- package/components/timeout-modal/_macro.njk +26 -0
- package/components/timeout-modal/timeout.dom.js +16 -0
- package/components/timeout-modal/timeout.js +289 -0
- package/css/census.css +1 -1
- package/css/main.css +1 -1
- package/favicons/census/cy/android-chrome-192x192.png +0 -0
- package/favicons/census/cy/android-chrome-512x512.png +0 -0
- package/favicons/census/cy/apple-touch-icon.png +0 -0
- package/favicons/census/cy/browserconfig.xml +12 -0
- package/favicons/census/cy/favicon-16x16.png +0 -0
- package/favicons/census/cy/favicon-32x32.png +0 -0
- package/favicons/census/cy/favicon.ico +0 -0
- package/favicons/census/cy/manifest.json +20 -0
- package/favicons/census/cy/mstitle-150x150.png +0 -0
- package/favicons/census/cy/mstitle-310x150.png +0 -0
- package/favicons/census/cy/mstitle-310x310.png +0 -0
- package/favicons/census/cy/mstitle-70x70.png +0 -0
- package/favicons/census/cy/opengraph.png +0 -0
- package/favicons/census/cy/safari-pinned-tab.svg +3 -0
- package/favicons/census/cy/site.webmanifest +19 -0
- package/favicons/census/cy/twitter.png +0 -0
- package/favicons/census/en/android-chrome-192x192.png +0 -0
- package/favicons/census/en/android-chrome-512x512.png +0 -0
- package/favicons/census/en/apple-touch-icon.png +0 -0
- package/favicons/census/en/browserconfig.xml +12 -0
- package/favicons/census/en/favicon-16x16.png +0 -0
- package/favicons/census/en/favicon-32x32.png +0 -0
- package/favicons/census/en/favicon.ico +0 -0
- package/favicons/census/en/manifest.json +20 -0
- package/favicons/census/en/mstitle-150x150.png +0 -0
- package/favicons/census/en/mstitle-310x150.png +0 -0
- package/favicons/census/en/mstitle-310x310.png +0 -0
- package/favicons/census/en/mstitle-70x70.png +0 -0
- package/favicons/census/en/opengraph.png +0 -0
- package/favicons/census/en/safari-pinned-tab.svg +3 -0
- package/favicons/census/en/site.webmanifest +19 -0
- package/favicons/census/en/twitter.png +0 -0
- package/favicons/census/ni/favicon.ico +0 -0
- package/js/abortable-fetch.js +55 -0
- package/js/analytics.js +70 -0
- package/js/cookies-functions.js +182 -0
- package/js/cookies-settings.dom.js +13 -0
- package/js/cookies-settings.js +105 -0
- package/js/domready.js +17 -0
- package/js/fetch.js +19 -0
- package/js/inpagelink.dom.js +13 -0
- package/js/inpagelink.js +31 -0
- package/js/main.js +27 -0
- package/js/polyfills.js +9 -0
- package/js/print-button.js +16 -0
- package/{page-templates → layout}/_template.njk +0 -0
- package/package.json +4 -4
- package/scripts/main.es5.js +2 -2
- package/scripts/main.js +1 -1
- package/scss/main.scss +2 -5
- package/scss/patternlib.scss +3 -0
- package/scss/vars/_vars.scss +1 -1
package/js/inpagelink.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export default function inPageLinks(links) {
|
|
2
|
+
if (document.getElementById('patternlib-page__example') === null) {
|
|
3
|
+
links.forEach(link => {
|
|
4
|
+
const id = link.getAttribute('href').replace('#', '');
|
|
5
|
+
|
|
6
|
+
link.addEventListener('click', event => {
|
|
7
|
+
event.preventDefault();
|
|
8
|
+
focusOnInput(id);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function focusOnInput(id) {
|
|
15
|
+
const container = document.getElementById(id);
|
|
16
|
+
container.scrollIntoView();
|
|
17
|
+
|
|
18
|
+
const input = [
|
|
19
|
+
...container.getElementsByTagName('INPUT'),
|
|
20
|
+
...container.getElementsByTagName('TEXTAREA'),
|
|
21
|
+
...container.getElementsByTagName('SELECT'),
|
|
22
|
+
].filter(input => {
|
|
23
|
+
const type = input.getAttribute('type');
|
|
24
|
+
|
|
25
|
+
return type !== 'readonly' && type !== 'hidden';
|
|
26
|
+
})[0];
|
|
27
|
+
|
|
28
|
+
if (input && input.getAttribute('tabindex') !== '-1') {
|
|
29
|
+
input.focus();
|
|
30
|
+
}
|
|
31
|
+
}
|
package/js/main.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import './inpagelink.dom';
|
|
2
|
+
import './print-button';
|
|
3
|
+
import './cookies-settings.dom';
|
|
4
|
+
import '../components/mutually-exclusive/mutually-exclusive.dom';
|
|
5
|
+
import '../components/textarea/textarea.dom';
|
|
6
|
+
import '../components/password/password.dom';
|
|
7
|
+
import '../components/tabs/tabs.dom';
|
|
8
|
+
import '../components/table-of-contents/toc.dom';
|
|
9
|
+
import '../components/collapsible/collapsible.dom';
|
|
10
|
+
import '../components/table/scrollable-table.dom';
|
|
11
|
+
import '../components/table/sortable-table.dom';
|
|
12
|
+
import '../components/header/header-nav.dom';
|
|
13
|
+
import '../components/access-code/uac.dom';
|
|
14
|
+
import '../components/relationships/relationships.dom';
|
|
15
|
+
import '../components/checkboxes/checkboxes.dom';
|
|
16
|
+
import '../components/radios/radios.dom';
|
|
17
|
+
import '../components/autosuggest/autosuggest.dom';
|
|
18
|
+
import '../components/address-input/autosuggest.address.dom';
|
|
19
|
+
import '../components/input/character-check.dom';
|
|
20
|
+
import '../components/cookies-banner/cookies-banner.dom';
|
|
21
|
+
import '../components/button/button.dom';
|
|
22
|
+
import '../components/reply/reply.dom';
|
|
23
|
+
import '../components/skip-to-content/skip-to-content.dom';
|
|
24
|
+
import '../components/download-resources/download-resources';
|
|
25
|
+
import '../components/select/select';
|
|
26
|
+
import '../components/modal/modal.dom';
|
|
27
|
+
import '../components/timeout-modal/timeout.dom';
|
package/js/polyfills.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This must be included for IE support
|
|
2
|
+
import 'core-js';
|
|
3
|
+
//import 'regenerator-runtime/runtime';
|
|
4
|
+
import 'mdn-polyfills/CustomEvent';
|
|
5
|
+
import 'mdn-polyfills/Node.prototype.append';
|
|
6
|
+
import 'mdn-polyfills/Node.prototype.remove';
|
|
7
|
+
import 'mdn-polyfills/Element.prototype.closest';
|
|
8
|
+
import 'whatwg-fetch';
|
|
9
|
+
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import domready from './domready';
|
|
2
|
+
|
|
3
|
+
export default function addEventListeners() {
|
|
4
|
+
const buttons = [...document.querySelectorAll('.ons-js-print-btn')];
|
|
5
|
+
|
|
6
|
+
buttons.forEach(button => {
|
|
7
|
+
button.addEventListener('click', handleClick);
|
|
8
|
+
button.classList.remove('ons-u-d-no');
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function handleClick() {
|
|
13
|
+
window.print();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
domready(addEventListeners);
|
|
File without changes
|
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": "45.0.1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "STYLES=main gulp build-styles && TEST_MODE=nomodule karma start ./karma.conf.babel-register.js && TEST_MODE=esm karma start ./karma.conf.babel-register.js && codecov",
|
|
20
20
|
"test:browserstack": "STYLES=main gulp build-styles && TEST_MODE=nomodule TEST_ON_BROWSERSTACK=true karma start ./karma.conf.babel-register.js && TEST_MODE=esm TEST_ON_BROWSERSTACK=true karma start ./karma.conf.babel-register.js",
|
|
21
21
|
"test-visual": "yarn build && npx percy exec -- babel-node src/tests/visual/percy.snapshots.js",
|
|
22
|
-
"tidy-clean": "rm -rf build css favicons fonts img components
|
|
22
|
+
"tidy-clean": "rm -rf build css favicons fonts img components layout scripts coverage scss js",
|
|
23
23
|
"check-unused": "npx npm-check-unused",
|
|
24
24
|
"dedupe-deps": "npx yarn-deduplicate yarn.lock",
|
|
25
25
|
"lint-staged": "lint-staged",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"codecov": "3.7.2",
|
|
83
83
|
"core-js": "^3.15.2",
|
|
84
84
|
"cssnano": "^4.1.11",
|
|
85
|
+
"dialog-polyfill": "^0.5.6",
|
|
85
86
|
"eslint": "^5.9.0",
|
|
86
87
|
"eslint-cli": "^1.1.1",
|
|
87
88
|
"eslint-config-prettier": "^3.3.0",
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
"express": "^4.17.1",
|
|
90
91
|
"fetch-mock": "^9.11.0",
|
|
91
92
|
"front-matter": "^4.0.2",
|
|
93
|
+
"fs-extra": "^10.0.0",
|
|
92
94
|
"fuse.js": "^3.6.1",
|
|
93
95
|
"glob": "^7.1.3",
|
|
94
96
|
"gulp": "^4.0.2",
|
|
@@ -123,7 +125,6 @@
|
|
|
123
125
|
"mdn-polyfills": "^5.14.0",
|
|
124
126
|
"minimist": "^1.2.5",
|
|
125
127
|
"mocha": "8.1.3",
|
|
126
|
-
"ncp": "^2.0.0",
|
|
127
128
|
"normalize.css": "^8.0.1",
|
|
128
129
|
"nunjucks": "^3.2.3",
|
|
129
130
|
"postcss": "^8.3.5",
|
|
@@ -137,7 +138,6 @@
|
|
|
137
138
|
"remark-lint": "^8.0.0",
|
|
138
139
|
"remark-preset-lint-recommended": "^5.0.0",
|
|
139
140
|
"replace-in-file": "^6.1.0",
|
|
140
|
-
"rimraf": "^2.6.3",
|
|
141
141
|
"stylelint": "^13.11.0",
|
|
142
142
|
"stylelint-config-recommended": "^3.0.0",
|
|
143
143
|
"stylelint-config-sass-guidelines": "^8.0.0",
|