@ons/design-system 63.0.0 → 65.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/access-code/_macro.njk +2 -2
- package/components/access-code/_macro.spec.js +2 -2
- package/components/access-code/access-code.dom.js +11 -0
- package/components/access-code/{uac.js → access-code.js} +1 -1
- package/components/access-code/{uac.scss → access-code.scss} +1 -1
- package/components/access-code/example-access-code-error.njk +6 -6
- package/components/access-code/example-access-code.njk +4 -4
- package/components/accordion/_macro.njk +2 -2
- package/components/accordion/_macro.spec.js +3 -3
- package/components/accordion/accordion.dom.js +1 -1
- package/components/accordion/accordion.js +1 -1
- package/components/breadcrumbs/_breadcrumbs.scss +6 -6
- package/components/breadcrumbs/_macro.njk +4 -4
- package/components/breadcrumbs/_macro.spec.js +13 -13
- package/components/button/_button.scss +27 -27
- package/components/button/_macro.spec.js +2 -2
- package/components/call-to-action/_macro.njk +1 -1
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/char-check-limit/_macro.spec.js +1 -1
- package/components/char-check-limit/character-check.spec.js +16 -16
- package/components/checkboxes/_macro.njk +3 -1
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +1 -0
- package/components/cookies-banner/_macro.njk +2 -2
- package/components/cookies-banner/_macro.spec.js +2 -2
- package/components/date-input/_macro.njk +3 -3
- package/components/date-input/_macro.spec.js +118 -0
- package/components/date-input/example-date-input-error-for-single-field.njk +63 -0
- package/components/details/_details.scss +1 -1
- package/components/external-link/_external-link.scss +3 -3
- package/components/external-link/_macro.njk +1 -1
- package/components/footer/_footer.scss +2 -2
- package/components/footer/example-footer-with-alternative-organisation.njk +5 -5
- package/components/header/_header.scss +8 -8
- package/components/icon/_icon.scss +1 -1
- package/components/icon/_macro.njk +35 -35
- package/components/icon/_macro.spec.js +1 -1
- package/components/image/_image.scss +2 -2
- package/components/image/_macro.njk +4 -6
- package/components/image/_macro.spec.js +10 -10
- package/components/input/_input.scss +6 -0
- package/components/input/_macro.njk +20 -13
- package/components/input/_macro.spec.js +2 -22
- package/components/{search/example-search-with-character-check.njk → input/example-input-search-with-character-check.njk} +1 -2
- package/components/{search/example-search-with-placeholder.njk → input/example-input-search-with-placeholder.njk} +1 -2
- package/components/{search/example-search.njk → input/example-input-search.njk} +1 -2
- package/components/mutually-exclusive/_macro.njk +4 -3
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
- package/components/pagination/_macro.njk +2 -2
- package/components/pagination/example-pagination-first.njk +0 -2
- package/components/pagination/example-pagination-last.njk +0 -2
- package/components/pagination/example-pagination-with-no-range-indicator.njk +0 -2
- package/components/pagination/example-pagination.njk +0 -2
- package/components/panel/_macro.njk +1 -1
- package/components/panel/_panel.scss +7 -7
- package/components/password/_macro.njk +1 -1
- package/components/password/example-password.njk +1 -2
- package/components/quote/_quote.scss +1 -1
- package/components/radios/_macro.njk +1 -1
- package/components/select/_macro.njk +1 -2
- package/components/skip-to-content/_macro.njk +2 -1
- package/components/skip-to-content/_macro.spec.js +17 -3
- package/components/skip-to-content/_skip.scss +1 -1
- package/components/skip-to-content/skip-to-content.dom.js +1 -1
- package/components/skip-to-content/skip-to-content.spec.js +3 -3
- package/components/summary/_macro.njk +1 -2
- package/components/summary/_macro.spec.js +7 -22
- package/components/summary/_summary.scss +1 -1
- package/components/summary/example-summary-grouped-total.njk +0 -2
- package/components/summary/example-summary-grouped-with-errors.njk +0 -4
- package/components/summary/example-summary-grouped.njk +0 -19
- package/components/summary/example-summary-household.njk +0 -5
- package/components/summary/example-summary-hub.njk +0 -8
- package/components/summary/example-summary-multiple.njk +0 -4
- package/components/summary/example-summary.njk +0 -4
- package/components/table/_macro.njk +1 -1
- package/components/table/_macro.spec.js +16 -0
- package/components/table/_table.scss +6 -6
- package/components/table/example-table-numeric.njk +6 -3
- package/components/table/sortable-table.js +1 -1
- package/components/tabs/_macro.njk +4 -3
- package/components/tabs/_macro.spec.js +23 -0
- package/components/tabs/_tabs.scss +11 -15
- package/components/tabs/example-tabs.njk +6 -6
- package/components/tabs/tabs.js +24 -8
- package/components/tabs/tabs.spec.js +40 -2
- package/components/textarea/_macro.njk +2 -2
- package/components/textarea/_macro.spec.js +2 -2
- package/components/textarea/textarea.spec.js +6 -10
- package/components/timeline/_macro.njk +18 -22
- package/components/timeline/_macro.spec.js +18 -0
- package/components/video/example-video.njk +1 -1
- package/components/video/video.js +10 -1
- package/components/video/video.spec.js +33 -0
- package/css/main.css +3 -3
- package/css/print.css +1 -1
- package/js/main.js +1 -1
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +1 -1
- package/scss/main.scss +1 -2
- package/scss/objects/_spacing.scss +3 -3
- package/scss/overrides/hcm.scss +6 -6
- package/scss/overrides/rtl.scss +2 -2
- package/scss/print.scss +1 -1
- package/components/access-code/uac.dom.js +0 -11
- package/components/search/_macro.njk +0 -30
- package/components/search/_macro.spec.js +0 -69
- package/components/search/_search.scss +0 -9
- /package/components/access-code/{uac.spec.js → access-code.spec.js} +0 -0
package/scss/base/_global.scss
CHANGED
|
@@ -61,7 +61,7 @@ a {
|
|
|
61
61
|
color: var(--ons-color-text-link-hover);
|
|
62
62
|
text-decoration: underline solid var(--ons-color-text-link-hover) 2px;
|
|
63
63
|
}
|
|
64
|
-
&:focus:not(.ons-btn--link):not(.ons-btn--ghost):not(.ons-js-clear-btn):not(.ons-download__thumbnail--link):not(.ons-tab--row):not(.ons-skip-
|
|
64
|
+
&:focus:not(.ons-btn--link):not(.ons-btn--ghost):not(.ons-js-clear-btn):not(.ons-download__thumbnail--link):not(.ons-tab--row):not(.ons-skip-to-content) {
|
|
65
65
|
@extend %a-focus;
|
|
66
66
|
}
|
|
67
67
|
}
|
package/scss/main.scss
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@import 'helpers/index';
|
|
4
4
|
@import 'base/index';
|
|
5
5
|
@import 'objects/index';
|
|
6
|
-
@import '../components/access-code/
|
|
6
|
+
@import '../components/access-code/access-code';
|
|
7
7
|
@import '../components/address-output/address-output';
|
|
8
8
|
@import '../components/autosuggest/autosuggest';
|
|
9
9
|
@import '../components/breadcrumbs/breadcrumbs';
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
@import '../components/radios/radios';
|
|
48
48
|
@import '../components/related-content/related-content';
|
|
49
49
|
@import '../components/relationships/relationships';
|
|
50
|
-
@import '../components/search/search';
|
|
51
50
|
@import '../components/section-navigation/section-navigation';
|
|
52
51
|
@import '../components/skip-to-content/skip';
|
|
53
52
|
@import '../components/status/status';
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
.ons-field-group +,
|
|
3
3
|
.ons-fieldset +,
|
|
4
4
|
.ons-input-items +,
|
|
5
|
-
.ons-
|
|
5
|
+
.ons-image +,
|
|
6
6
|
.ons-panel +,
|
|
7
7
|
.ons-summary__group +,
|
|
8
8
|
.ons-details:not(.ons-details--accordion) + {
|
|
9
|
-
.ons-
|
|
9
|
+
.ons-image,
|
|
10
10
|
.ons-panel,
|
|
11
11
|
.ons-field,
|
|
12
12
|
.ons-field-group,
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.ons-
|
|
20
|
+
.ons-breadcrumbs + .ons-grid {
|
|
21
21
|
margin-top: -1rem;
|
|
22
22
|
}
|
package/scss/overrides/hcm.scss
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Brightness makes all images black, except transparent parts, which remain transparent
|
|
4
4
|
// Then, invert(1) makes the black parts white
|
|
5
5
|
.ons-footer__ogl-img,
|
|
6
|
-
.ons-quote .ons-
|
|
6
|
+
.ons-quote .ons-icon,
|
|
7
7
|
.ons-footer img {
|
|
8
8
|
filter: brightness(0) invert(1);
|
|
9
9
|
}
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
// Select - Overrides custom background image icon
|
|
37
37
|
.ons-input--select {
|
|
38
38
|
background: var(--ons-color-input-bg)
|
|
39
|
-
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ons-
|
|
39
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ons-icon' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1.5.3 6 5.4 10.5.3c.2-.2.4-.2.6 0l.7.7c.1.2.1.4 0 .5L6.3 7.7c-.2.2-.4.2-.6 0L.2 1.6C.1 1.4.1 1.2.2 1L.9.3c.2-.1.4-.1.6 0z'/%3E%3C/svg%3E")
|
|
40
40
|
no-repeat center right 10px;
|
|
41
41
|
background-size: 1rem;
|
|
42
42
|
}
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
|
|
49
49
|
// Element icons – matches icon with the link colour
|
|
50
50
|
.ons-details,
|
|
51
|
-
.ons-
|
|
51
|
+
.ons-breadcrumbs__item,
|
|
52
52
|
.ons-panel,
|
|
53
53
|
.ons-btn__inner,
|
|
54
54
|
.ons-external-link,
|
|
55
55
|
.ons-list--icons {
|
|
56
|
-
& .ons-
|
|
56
|
+
& .ons-icon {
|
|
57
57
|
fill: currentColor !important;
|
|
58
58
|
forced-color-adjust: auto;
|
|
59
59
|
}
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
.ons-header__org-logo,
|
|
64
64
|
.ons-header__title-logo,
|
|
65
65
|
.ons-footer {
|
|
66
|
-
& .ons-
|
|
66
|
+
& .ons-icon--logo {
|
|
67
67
|
fill: currentColor !important;
|
|
68
68
|
forced-color-adjust: auto;
|
|
69
69
|
}
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// Add borders to separate banners with no backgrounds
|
|
118
|
-
.ons-skip-
|
|
118
|
+
.ons-skip-to-content,
|
|
119
119
|
.ons-browser-banner,
|
|
120
120
|
.ons-cookies-banner,
|
|
121
121
|
.ons-header,
|
package/scss/overrides/rtl.scss
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
|
|
64
64
|
// Buttons
|
|
65
65
|
.ons-btn {
|
|
66
|
-
.ons-
|
|
66
|
+
.ons-icon {
|
|
67
67
|
margin: 0 0.5rem 0.1rem 0;
|
|
68
68
|
transform: rotate(180deg);
|
|
69
69
|
}
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
margin: 0 2rem 0 0;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.ons-
|
|
86
|
+
.ons-icon {
|
|
87
87
|
transform: rotate(180deg);
|
|
88
88
|
}
|
|
89
89
|
}
|
package/scss/print.scss
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import domready from '../../js/domready';
|
|
2
|
-
|
|
3
|
-
domready(async () => {
|
|
4
|
-
const uacInputs = [...document.querySelectorAll('.ons-js-uac')];
|
|
5
|
-
|
|
6
|
-
if (uacInputs.length) {
|
|
7
|
-
const UAC = (await import('./uac')).default;
|
|
8
|
-
|
|
9
|
-
uacInputs.forEach(element => new UAC(element));
|
|
10
|
-
}
|
|
11
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{% macro onsSearch(params) %}
|
|
2
|
-
{% from "components/button/_macro.njk" import onsButton %}
|
|
3
|
-
|
|
4
|
-
{% set content = caller() %}
|
|
5
|
-
|
|
6
|
-
<div class="ons-search-component">
|
|
7
|
-
{{ content | safe }}
|
|
8
|
-
|
|
9
|
-
{%- set buttonLabel -%}
|
|
10
|
-
{%- if params.searchButton.visuallyHideButtonText == true -%}
|
|
11
|
-
<span class="ons-u-vh">{{ params.searchButton.text }}</span>
|
|
12
|
-
{%- else -%}
|
|
13
|
-
{{ params.searchButton.text }}
|
|
14
|
-
{%- endif -%}
|
|
15
|
-
{%- endset -%}
|
|
16
|
-
|
|
17
|
-
{{
|
|
18
|
-
onsButton({
|
|
19
|
-
"type": params.searchButton.type,
|
|
20
|
-
"html": buttonLabel,
|
|
21
|
-
"id": params.searchButton.id,
|
|
22
|
-
"variants": 'small',
|
|
23
|
-
"classes": 'ons-search__btn' + (" " + params.searchButton.classes if params.searchButton.classes else ""),
|
|
24
|
-
"attributes": params.searchButton.attributes,
|
|
25
|
-
"iconType": params.searchButton.iconType,
|
|
26
|
-
"iconPosition": 'only' if params.searchButton.visuallyHideButtonText == true else 'before'
|
|
27
|
-
})
|
|
28
|
-
}}
|
|
29
|
-
</div>
|
|
30
|
-
{% endmacro %}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/** @jest-environment jsdom */
|
|
2
|
-
|
|
3
|
-
import * as cheerio from 'cheerio';
|
|
4
|
-
|
|
5
|
-
import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
|
|
6
|
-
|
|
7
|
-
const EXAMPLE_SEARCH = {
|
|
8
|
-
searchButton: {
|
|
9
|
-
id: 'search-button-id',
|
|
10
|
-
type: 'button',
|
|
11
|
-
text: 'Search for address',
|
|
12
|
-
iconType: 'search',
|
|
13
|
-
classes: 'extra-search-button-class',
|
|
14
|
-
attributes: { a: 42 },
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const FAKE_NESTED_CONTENT = '<span class="test--nested">Nested content...</span>';
|
|
19
|
-
|
|
20
|
-
describe('macro: search', () => {
|
|
21
|
-
it('renders expected nested content', () => {
|
|
22
|
-
const $ = cheerio.load(renderComponent('search', EXAMPLE_SEARCH, FAKE_NESTED_CONTENT));
|
|
23
|
-
|
|
24
|
-
expect($('.ons-search-component .test--nested').text()).toBe('Nested content...');
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('renders button component', () => {
|
|
28
|
-
const faker = templateFaker();
|
|
29
|
-
const buttonSpy = faker.spy('button');
|
|
30
|
-
|
|
31
|
-
faker.renderComponent('input', EXAMPLE_SEARCH);
|
|
32
|
-
|
|
33
|
-
expect(buttonSpy.occurrences[0]).toEqual({
|
|
34
|
-
id: 'search-button-id',
|
|
35
|
-
type: 'button',
|
|
36
|
-
html: 'Search for address',
|
|
37
|
-
variants: 'small',
|
|
38
|
-
classes: 'ons-search__btn extra-search-button-class',
|
|
39
|
-
attributes: EXAMPLE_SEARCH.searchButton.attributes,
|
|
40
|
-
iconType: 'search',
|
|
41
|
-
iconPosition: 'before',
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('renders button component with a visibly hidden label when specified', () => {
|
|
46
|
-
const faker = templateFaker();
|
|
47
|
-
const buttonSpy = faker.spy('button');
|
|
48
|
-
|
|
49
|
-
faker.renderComponent('input', {
|
|
50
|
-
searchButton: {
|
|
51
|
-
id: 'search-button-id',
|
|
52
|
-
type: 'button',
|
|
53
|
-
text: 'Search for address',
|
|
54
|
-
iconType: 'search',
|
|
55
|
-
visuallyHideButtonText: true,
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
expect(buttonSpy.occurrences[0]).toEqual({
|
|
60
|
-
id: 'search-button-id',
|
|
61
|
-
type: 'button',
|
|
62
|
-
html: '<span class="ons-u-vh">Search for address</span>',
|
|
63
|
-
variants: 'small',
|
|
64
|
-
classes: 'ons-search__btn',
|
|
65
|
-
iconPosition: 'only',
|
|
66
|
-
iconType: 'search',
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
});
|
|
File without changes
|