@ons/design-system 67.2.0 → 69.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/README.md +5 -0
- package/components/access-code/_macro.njk +1 -1
- package/components/access-code/_macro.spec.js +2 -10
- package/components/access-code/access-code.dom.js +1 -1
- package/components/access-code/access-code.spec.js +2 -2
- package/components/access-code/example-access-code-error.njk +9 -14
- package/components/access-code/example-access-code.njk +3 -5
- package/components/accordion/accordion.js +4 -4
- package/components/address-input/_macro.spec.js +3 -15
- package/components/address-input/autosuggest.address.dom.js +1 -1
- package/components/address-input/autosuggest.address.js +3 -2
- package/components/address-input/autosuggest.address.setter.js +3 -3
- package/components/address-input/autosuggest.address.spec.js +66 -69
- package/components/address-output/_macro.spec.js +6 -30
- package/components/autosuggest/autosuggest.dom.js +1 -1
- package/components/autosuggest/autosuggest.helpers.js +1 -1
- package/components/back-to-top/_back-to-top.scss +34 -0
- package/components/back-to-top/_macro.njk +17 -0
- package/components/back-to-top/_macro.spec.js +60 -0
- package/components/back-to-top/back-to-top.dom.js +12 -0
- package/components/back-to-top/back-to-top.js +58 -0
- package/components/back-to-top/back-to-top.spec.js +117 -0
- package/components/back-to-top/example-back-to-top.njk +37 -0
- package/components/back-to-top/example-full-page-back-to-top.njk +192 -0
- package/components/browser-banner/_macro.spec.js +4 -12
- package/components/button/_macro.njk +6 -6
- package/components/button/_macro.spec.js +1 -5
- package/components/button/button.js +7 -8
- package/components/button/button.spec.js +17 -39
- package/components/call-to-action/_macro.spec.js +2 -6
- package/components/card/_macro.njk +25 -25
- package/components/card/_macro.spec.js +6 -30
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/char-check-limit/_macro.spec.js +3 -7
- package/components/char-check-limit/character-check.spec.js +24 -20
- package/components/checkboxes/_checkbox-macro.njk +1 -1
- package/components/checkboxes/_checkbox.scss +0 -3
- package/components/checkboxes/_macro.spec.js +1 -5
- package/components/checkboxes/checkbox-with-autoselect.js +3 -3
- package/components/checkboxes/checkbox-with-fieldset.js +2 -2
- package/components/checkboxes/checkboxes-with-reveal.js +4 -2
- package/components/checkboxes/checkboxes.dom.js +2 -2
- package/components/checkboxes/checkboxes.spec.js +13 -13
- package/components/content-pagination/_macro.spec.js +2 -2
- package/components/cookies-banner/cookies-banner.dom.js +1 -1
- package/components/cookies-banner/cookies-banner.js +1 -1
- package/components/cookies-banner/cookies-banner.spec.js +7 -7
- package/components/details/details.spec.js +12 -12
- package/components/details/example-details-with-warning.njk +5 -7
- package/components/document-list/_macro.spec.js +9 -27
- package/components/document-list/document-list.scss +1 -1
- package/components/document-list/example-document-list-downloads.njk +3 -3
- package/components/document-list/example-document-list-search-result-featured.njk +1 -1
- package/components/document-list/example-document-list-search-results.njk +3 -3
- package/components/download-resources/download-resources.js +54 -54
- package/components/download-resources/download-resources.spec.js +3 -1
- package/components/error/_macro.njk +1 -1
- package/components/error/_macro.spec.js +2 -6
- package/components/feedback/_macro.spec.js +4 -20
- package/components/field/_macro.spec.js +1 -3
- package/components/fieldset/_fieldset.scss +1 -2
- package/components/fieldset/_macro.spec.js +3 -9
- package/components/footer/_footer.scss +8 -0
- package/components/footer/_macro.njk +8 -7
- package/components/footer/_macro.spec.js +14 -2
- package/components/helpers/grid.njk +15 -15
- package/components/icon/_macro.njk +7 -3
- package/components/icon/_macro.spec.js +4 -12
- package/components/image/_macro.spec.js +1 -5
- package/components/input/_macro.njk +22 -23
- package/components/input/_macro.spec.js +1 -1
- package/components/input/character-check.dom.js +1 -1
- package/components/input/input.spec.js +1 -4
- package/components/label/_label.scss +1 -0
- package/components/label/_macro.njk +2 -2
- package/components/label/_macro.spec.js +4 -13
- package/components/list/_macro.spec.js +4 -12
- package/components/message/_macro.njk +17 -17
- package/components/message/_macro.spec.js +9 -33
- package/components/message-list/_macro.spec.js +7 -39
- package/components/modal/_macro.spec.js +3 -9
- package/components/modal/modal.dom.js +1 -1
- package/components/modal/modal.spec.js +5 -5
- package/components/mutually-exclusive/_macro.spec.js +2 -10
- package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +26 -26
- package/components/mutually-exclusive/mutually-exclusive.date.spec.js +9 -9
- package/components/mutually-exclusive/mutually-exclusive.dom.js +1 -1
- package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +8 -8
- package/components/mutually-exclusive/mutually-exclusive.email.spec.js +7 -7
- package/components/mutually-exclusive/mutually-exclusive.js +13 -13
- package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +29 -29
- package/components/mutually-exclusive/mutually-exclusive.number.spec.js +7 -7
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +8 -8
- package/components/navigation/navigation.spec.js +0 -2
- package/components/pagination/_macro.spec.js +11 -53
- package/components/panel/_macro.njk +17 -17
- package/components/panel/_macro.spec.js +25 -25
- package/components/panel/_panel.scss +10 -9
- package/components/panel/example-panel-bare.njk +3 -4
- package/components/panel/example-panel-with-announcement.njk +6 -10
- package/components/panel/example-panel-with-error-summary.njk +2 -2
- package/components/panel/example-panel-with-information.njk +0 -1
- package/components/panel/example-panel-with-success-message.njk +1 -1
- package/components/panel/example-panel-with-warning.njk +2 -3
- package/components/password/password.dom.js +1 -1
- package/components/phase-banner/_macro.spec.js +3 -9
- package/components/question/_macro.njk +1 -1
- package/components/question/_macro.spec.js +5 -19
- package/components/question/_question.scss +1 -4
- package/components/question/example-question-interviewer-note.njk +1 -1
- package/components/quote/_macro.spec.js +2 -10
- package/components/radios/clear-radios.js +3 -3
- package/components/radios/radio-with-fieldset.js +4 -4
- package/components/radios/radios.dom.js +1 -1
- package/components/radios/radios.spec.js +26 -26
- package/components/related-content/_macro.spec.js +2 -4
- package/components/related-content/_section-macro.spec.js +2 -8
- package/components/relationships/example-relationships-error.njk +16 -18
- package/components/relationships/relationships.dom.js +1 -1
- package/components/relationships/relationships.js +2 -2
- package/components/reply/_macro.spec.js +3 -3
- package/components/reply/reply.dom.js +1 -1
- package/components/reply/reply.spec.js +3 -3
- package/components/section-navigation/_macro.spec.js +13 -21
- package/components/select/_macro.spec.js +6 -6
- package/components/share-page/_macro.spec.js +6 -14
- package/components/skip-to-content/_macro.spec.js +3 -11
- package/components/skip-to-content/skip-to-content.dom.js +1 -1
- package/components/skip-to-content/skip-to-content.js +1 -1
- package/components/skip-to-content/skip-to-content.spec.js +2 -2
- package/components/status/_macro.njk +2 -2
- package/components/status/_macro.spec.js +5 -9
- package/components/status/example-status-dead.njk +1 -1
- package/components/status/example-status-error.njk +1 -1
- package/components/status/example-status-pending.njk +1 -1
- package/components/status/example-status-small.njk +1 -1
- package/components/status/example-status-success.njk +1 -1
- package/components/summary/_macro.njk +4 -5
- package/components/summary/_macro.spec.js +27 -9
- package/components/table/_macro.spec.js +6 -10
- package/components/table/scrollable-table.dom.js +1 -1
- package/components/table/scrollable-table.js +1 -1
- package/components/table/sortable-table.js +4 -4
- package/components/table/table.spec.js +21 -17
- package/components/table-of-contents/_macro.njk +31 -31
- package/components/table-of-contents/_macro.spec.js +3 -11
- package/components/table-of-contents/toc.dom.js +1 -1
- package/components/table-of-contents/toc.spec.js +36 -32
- package/components/tabs/example-tabs-details.njk +1 -1
- package/components/tabs/tabs.dom.js +1 -1
- package/components/tabs/tabs.js +8 -8
- package/components/text-indent/_macro.spec.js +2 -6
- package/components/textarea/textarea.dom.js +1 -1
- package/components/textarea/textarea.spec.js +8 -8
- package/components/timeout-modal/_macro.spec.js +1 -3
- package/components/timeout-modal/timeout-modal.dom.js +1 -1
- package/components/timeout-modal/timeout-modal.spec.js +10 -10
- package/components/timeout-panel/_macro.njk +16 -17
- package/components/timeout-panel/_macro.spec.js +1 -1
- package/components/timeout-panel/timeout-panel.dom.js +1 -1
- package/components/timeout-panel/timeout-panel.spec.js +8 -8
- package/components/video/_macro.spec.js +1 -5
- package/components/video/video.dom.js +1 -1
- package/components/video/video.spec.js +16 -12
- package/css/main.css +1 -1
- package/favicons/safari-pinned-tab.svg +23 -23
- package/js/analytics.js +15 -14
- package/js/cookies-settings.dom.js +1 -1
- package/js/cookies-settings.spec.js +19 -19
- package/js/domready.js +1 -1
- package/js/fetch.js +1 -1
- package/js/inpagelink.js +3 -3
- package/js/main.js +1 -0
- package/js/print-button.js +1 -1
- package/js/timeout.js +1 -1
- package/package.json +2 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_typography.scss +8 -2
- package/scss/main.scss +1 -0
- package/scss/overrides/hcm.scss +8 -1
- package/scss/vars/_colors.scss +2 -1
|
@@ -36,7 +36,7 @@ describe('macro: timeout panel', () => {
|
|
|
36
36
|
expect(panelSpy.occurrences[0]).toEqual({
|
|
37
37
|
id: 'countdown',
|
|
38
38
|
classes: 'ons-js-panel-with-countdown',
|
|
39
|
-
|
|
39
|
+
variant: 'warn',
|
|
40
40
|
attributes: {
|
|
41
41
|
'data-redirect-url': '#!',
|
|
42
42
|
'data-server-session-expires-at': '000-000-000',
|
|
@@ -6,7 +6,7 @@ async function timeoutPanels() {
|
|
|
6
6
|
if (panels.length) {
|
|
7
7
|
const Timeout = (await import('../../js/timeout')).default;
|
|
8
8
|
|
|
9
|
-
panels.forEach(context => {
|
|
9
|
+
panels.forEach((context) => {
|
|
10
10
|
let time = context.getAttribute('data-server-session-expires-at');
|
|
11
11
|
new Timeout(context, null, time, false, true);
|
|
12
12
|
});
|
|
@@ -28,9 +28,9 @@ describe('script: timeout panel', () => {
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
it('shows the time counting down', async () => {
|
|
31
|
-
const timeAtStart = await page.$eval('.ons-js-timeout-timer', element => element.innerHTML);
|
|
31
|
+
const timeAtStart = await page.$eval('.ons-js-timeout-timer', (element) => element.innerHTML);
|
|
32
32
|
await page.waitForTimeout(1000);
|
|
33
|
-
const timeAfterOneSecond = await page.$eval('.ons-js-timeout-timer', element => element.innerHTML);
|
|
33
|
+
const timeAfterOneSecond = await page.$eval('.ons-js-timeout-timer', (element) => element.innerHTML);
|
|
34
34
|
expect(timeAfterOneSecond).not.toEqual(timeAtStart);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
@@ -49,7 +49,7 @@ describe('script: timeout panel', () => {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
it('displays the `minutes` (plural) string', async () => {
|
|
52
|
-
const timeString = await page.$eval('.ons-js-timeout-timer', element => element.innerHTML);
|
|
52
|
+
const timeString = await page.$eval('.ons-js-timeout-timer', (element) => element.innerHTML);
|
|
53
53
|
expect(timeString).toEqual(expect.stringContaining('minutes'));
|
|
54
54
|
});
|
|
55
55
|
});
|
|
@@ -68,7 +68,7 @@ describe('script: timeout panel', () => {
|
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
it('displays the `seconds` (plural) string', async () => {
|
|
71
|
-
const timeString = await page.$eval('.ons-js-timeout-timer span', element => element.innerHTML);
|
|
71
|
+
const timeString = await page.$eval('.ons-js-timeout-timer span', (element) => element.innerHTML);
|
|
72
72
|
expect(timeString).toEqual(expect.stringContaining('seconds'));
|
|
73
73
|
});
|
|
74
74
|
});
|
|
@@ -87,7 +87,7 @@ describe('script: timeout panel', () => {
|
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it('displays the `minute` (singular) string', async () => {
|
|
90
|
-
const timeString = await page.$eval('.ons-js-timeout-timer', element => element.innerHTML);
|
|
90
|
+
const timeString = await page.$eval('.ons-js-timeout-timer', (element) => element.innerHTML);
|
|
91
91
|
expect(timeString).toEqual(expect.stringContaining('minute'));
|
|
92
92
|
});
|
|
93
93
|
});
|
|
@@ -106,7 +106,7 @@ describe('script: timeout panel', () => {
|
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
it('displays the `second` (singular) string', async () => {
|
|
109
|
-
const timeString = await page.$eval('.ons-js-timeout-timer span', element => element.innerHTML);
|
|
109
|
+
const timeString = await page.$eval('.ons-js-timeout-timer span', (element) => element.innerHTML);
|
|
110
110
|
expect(timeString).toEqual(expect.stringContaining('second'));
|
|
111
111
|
});
|
|
112
112
|
});
|
|
@@ -125,7 +125,7 @@ describe('script: timeout panel', () => {
|
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
it('displays the `countdownExpiredText` text', async () => {
|
|
128
|
-
const timeString = await page.$eval('.ons-js-timeout-timer', element => element.innerHTML);
|
|
128
|
+
const timeString = await page.$eval('.ons-js-timeout-timer', (element) => element.innerHTML);
|
|
129
129
|
expect(timeString).toEqual(expect.stringContaining('You are being signed out'));
|
|
130
130
|
});
|
|
131
131
|
|
|
@@ -154,7 +154,7 @@ describe('script: timeout panel', () => {
|
|
|
154
154
|
});
|
|
155
155
|
|
|
156
156
|
it('displays the `nojsText` text', async () => {
|
|
157
|
-
const nojsText = await page.$eval('.ons-js-nojs-text', element => element.innerHTML);
|
|
157
|
+
const nojsText = await page.$eval('.ons-js-nojs-text', (element) => element.innerHTML);
|
|
158
158
|
expect(nojsText.trim()).toBe('For security, your answers will only be available to view for another 1 minute');
|
|
159
159
|
});
|
|
160
160
|
});
|
|
@@ -46,11 +46,7 @@ describe('macro: video', () => {
|
|
|
46
46
|
it('outputs the provided link text', () => {
|
|
47
47
|
const $ = cheerio.load(renderComponent('video', EXAMPLE_VIDEO_YOUTUBE));
|
|
48
48
|
|
|
49
|
-
expect(
|
|
50
|
-
$('.ons-video__link-text')
|
|
51
|
-
.text()
|
|
52
|
-
.trim(),
|
|
53
|
-
).toBe('Example link text');
|
|
49
|
+
expect($('.ons-video__link-text').text().trim()).toBe('Example link text');
|
|
54
50
|
});
|
|
55
51
|
|
|
56
52
|
it('outputs a hyperlink with the provided `url`', () => {
|
|
@@ -22,14 +22,14 @@ describe('script: video', () => {
|
|
|
22
22
|
it('should show the placeholder content', async () => {
|
|
23
23
|
await setTestPage('/test', renderComponent('video', EXAMPLE_VIDEO_YOUTUBE));
|
|
24
24
|
|
|
25
|
-
const displayStyle = await page.$eval('.ons-js-video-placeholder', node => window.getComputedStyle(node).getPropertyValue('display'));
|
|
25
|
+
const displayStyle = await page.$eval('.ons-js-video-placeholder', (node) => window.getComputedStyle(node).getPropertyValue('display'));
|
|
26
26
|
expect(displayStyle).toBe('block');
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
it('should not show the iframe', async () => {
|
|
30
30
|
await setTestPage('/test', renderComponent('video', EXAMPLE_VIDEO_YOUTUBE));
|
|
31
31
|
|
|
32
|
-
const displayStyle = await page.$eval('.ons-js-video-iframe', node => window.getComputedStyle(node).getPropertyValue('display'));
|
|
32
|
+
const displayStyle = await page.$eval('.ons-js-video-iframe', (node) => window.getComputedStyle(node).getPropertyValue('display'));
|
|
33
33
|
expect(displayStyle).toBe('none');
|
|
34
34
|
});
|
|
35
35
|
|
|
@@ -44,29 +44,31 @@ describe('script: video', () => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
it('should hide the placeholder content', async () => {
|
|
47
|
-
const displayStyle = await page.$eval('.ons-js-video-placeholder', node =>
|
|
47
|
+
const displayStyle = await page.$eval('.ons-js-video-placeholder', (node) =>
|
|
48
|
+
window.getComputedStyle(node).getPropertyValue('display'),
|
|
49
|
+
);
|
|
48
50
|
expect(displayStyle).toBe('none');
|
|
49
51
|
}, 10000);
|
|
50
52
|
|
|
51
53
|
it('should show the iframe', async () => {
|
|
52
|
-
const displayStyle = await page.$eval('.ons-js-video-iframe', node => window.getComputedStyle(node).getPropertyValue('display'));
|
|
54
|
+
const displayStyle = await page.$eval('.ons-js-video-iframe', (node) => window.getComputedStyle(node).getPropertyValue('display'));
|
|
53
55
|
expect(displayStyle).toBe('block');
|
|
54
56
|
}, 10000);
|
|
55
57
|
|
|
56
58
|
it('should add the correct modifier class', async () => {
|
|
57
|
-
const hasClass = await page.$eval('.ons-js-video', node => node.classList.contains('ons-video--hasIframe'));
|
|
59
|
+
const hasClass = await page.$eval('.ons-js-video', (node) => node.classList.contains('ons-video--hasIframe'));
|
|
58
60
|
expect(hasClass).toBe(true);
|
|
59
61
|
}, 10000);
|
|
60
62
|
|
|
61
63
|
it('should not add dnt to YouTube videos', async () => {
|
|
62
|
-
const src = await page.$eval('.ons-js-video-iframe', node => node.getAttribute('src'));
|
|
64
|
+
const src = await page.$eval('.ons-js-video-iframe', (node) => node.getAttribute('src'));
|
|
63
65
|
expect(src.includes('?dnt=1')).toBe(false);
|
|
64
66
|
}, 10000);
|
|
65
67
|
|
|
66
68
|
it('should add dnt to Vimeo videos', async () => {
|
|
67
69
|
await setTestPage('/test', renderComponent('video', EXAMPLE_VIDEO_VIMEO));
|
|
68
70
|
|
|
69
|
-
const src = await page.$eval('.ons-js-video-iframe', node => node.getAttribute('src'));
|
|
71
|
+
const src = await page.$eval('.ons-js-video-iframe', (node) => node.getAttribute('src'));
|
|
70
72
|
expect(src.includes('?dnt=1')).toBe(true);
|
|
71
73
|
}, 10000);
|
|
72
74
|
});
|
|
@@ -82,21 +84,23 @@ describe('script: video', () => {
|
|
|
82
84
|
});
|
|
83
85
|
|
|
84
86
|
it('should hide the placeholder content', async () => {
|
|
85
|
-
const displayStyle = await page.$eval('.ons-js-video-placeholder', node =>
|
|
87
|
+
const displayStyle = await page.$eval('.ons-js-video-placeholder', (node) =>
|
|
88
|
+
window.getComputedStyle(node).getPropertyValue('display'),
|
|
89
|
+
);
|
|
86
90
|
expect(displayStyle).toBe('none');
|
|
87
91
|
});
|
|
88
92
|
|
|
89
93
|
it('should show the iframe', async () => {
|
|
90
|
-
const displayStyle = await page.$eval('.ons-js-video-iframe', node => window.getComputedStyle(node).getPropertyValue('display'));
|
|
94
|
+
const displayStyle = await page.$eval('.ons-js-video-iframe', (node) => window.getComputedStyle(node).getPropertyValue('display'));
|
|
91
95
|
expect(displayStyle).toBe('block');
|
|
92
96
|
});
|
|
93
97
|
|
|
94
98
|
it('should add the correct modifier class', async () => {
|
|
95
|
-
const hasClass = await page.$eval('.ons-js-video', node => node.classList.contains('ons-video--hasIframe'));
|
|
99
|
+
const hasClass = await page.$eval('.ons-js-video', (node) => node.classList.contains('ons-video--hasIframe'));
|
|
96
100
|
expect(hasClass).toBe(true);
|
|
97
101
|
}, 10000);
|
|
98
102
|
it('should not add dnt to YouTube videos', async () => {
|
|
99
|
-
const src = await page.$eval('.ons-js-video-iframe', node => node.getAttribute('src'));
|
|
103
|
+
const src = await page.$eval('.ons-js-video-iframe', (node) => node.getAttribute('src'));
|
|
100
104
|
expect(src.includes('?dnt=1')).toBe(false);
|
|
101
105
|
}, 10000);
|
|
102
106
|
|
|
@@ -108,7 +112,7 @@ describe('script: video', () => {
|
|
|
108
112
|
);
|
|
109
113
|
await page.click('.ons-js-accept-cookies');
|
|
110
114
|
|
|
111
|
-
const src = await page.$eval('.ons-js-video-iframe', node => node.getAttribute('src'));
|
|
115
|
+
const src = await page.$eval('.ons-js-video-iframe', (node) => node.getAttribute('src'));
|
|
112
116
|
expect(src.includes('?dnt=1')).toBe(true);
|
|
113
117
|
}, 10000);
|
|
114
118
|
});
|