@ons/design-system 65.1.0 → 65.2.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/README.md +1 -0
- package/components/access-code/access-code.scss +3 -3
- package/components/access-code/example-access-code-error.njk +1 -1
- package/components/access-code/example-access-code.njk +1 -1
- package/components/accordion/example-accordion-open.njk +10 -10
- package/components/accordion/example-accordion.njk +1 -1
- package/components/address-input/example-address-input-editable.njk +2 -2
- package/components/address-input/example-address-input-manual.njk +3 -3
- package/components/address-input/example-address-input.njk +2 -2
- package/components/autosuggest/_autosuggest.scss +3 -8
- package/components/autosuggest/_macro.njk +2 -3
- package/components/autosuggest/autosuggest.js +2 -1
- package/components/autosuggest/autosuggest.spec.js +89 -55
- package/components/autosuggest/autosuggest.ui.js +8 -12
- package/components/autosuggest/example-autosuggest-country-multiple.njk +4 -3
- package/components/autosuggest/example-autosuggest-country.njk +1 -1
- package/components/back-link/example-back-link.njk +1 -1
- package/components/button/_button.scss +11 -14
- package/components/card/example-card-set-with-images.njk +3 -3
- package/components/card/example-card-set-with-lists.njk +3 -3
- package/components/card/example-card-set.njk +3 -3
- package/components/card/example-card.njk +1 -1
- package/components/checkboxes/_checkbox.scss +1 -4
- package/components/checkboxes/example-checkboxes-disabled.njk +3 -3
- package/components/checkboxes/example-checkboxes-error.njk +7 -7
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -7
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +9 -9
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +8 -8
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +8 -8
- package/components/checkboxes/example-checkboxes-with-revealed-radios-expanded.njk +8 -8
- package/components/checkboxes/example-checkboxes-with-revealed-radios.njk +8 -8
- package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +4 -4
- package/components/checkboxes/example-checkboxes-with-revealed-select.njk +4 -4
- package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +6 -6
- package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +6 -6
- package/components/checkboxes/example-checkboxes-with-select-all-button.njk +4 -4
- package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +6 -6
- package/components/checkboxes/example-checkboxes-without-border.njk +3 -3
- package/components/checkboxes/example-checkboxes.njk +4 -4
- package/components/date-input/example-date-input-error.njk +2 -2
- package/components/date-input/example-date-input.njk +1 -1
- package/components/details/example-details-with-warning.njk +1 -1
- package/components/details/example-details.njk +1 -1
- package/components/download-resources/_download-resources.scss +3 -5
- package/components/duration/example-duration-error.njk +6 -6
- package/components/duration/example-duration.njk +5 -5
- package/components/external-link/example-external-link.njk +1 -1
- package/components/header/example-header-external-with-service-links.njk +1 -1
- package/components/header/example-header-internal.njk +1 -1
- package/components/helpers/_grid.scss +6 -0
- package/components/helpers/grid.njk +19 -0
- package/components/input/_input-type.scss +2 -8
- package/components/input/_input.scss +4 -3
- package/components/input/example-input-email.njk +1 -1
- package/components/input/example-input-number.njk +1 -1
- package/components/input/example-input-numeric-values.njk +7 -7
- package/components/input/example-input-text-with-character-limit-checker.njk +1 -1
- package/components/input/example-input-text-with-description.njk +1 -1
- package/components/input/example-input-text.njk +1 -1
- package/components/modal/_modal.scss +3 -6
- package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -6
- package/components/mutually-exclusive/example-mutually-exclusive-date-with-error.njk +2 -2
- package/components/mutually-exclusive/example-mutually-exclusive-email.njk +2 -2
- package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +5 -5
- package/components/navigation/navigation.js +6 -2
- package/components/phase-banner/example-phase-banner-alpha.njk +13 -2
- package/components/phase-banner/example-phase-banner-beta.njk +13 -2
- package/components/radios/example-radios-with-clear-button-expanded.njk +9 -9
- package/components/radios/example-radios-with-clear-button.njk +9 -9
- package/components/radios/example-radios-with-descriptions.njk +5 -5
- package/components/radios/example-radios-with-error.njk +4 -4
- package/components/radios/example-radios-with-revealed-checkboxes-expanded.njk +8 -8
- package/components/radios/example-radios-with-revealed-checkboxes.njk +8 -8
- package/components/radios/example-radios-with-revealed-radios-expanded.njk +9 -9
- package/components/radios/example-radios-with-revealed-radios.njk +8 -8
- package/components/radios/example-radios-with-revealed-select-expanded.njk +5 -5
- package/components/radios/example-radios-with-revealed-select.njk +4 -4
- package/components/radios/example-radios-with-revealed-text-input-expanded.njk +9 -9
- package/components/radios/example-radios-with-revealed-text-input.njk +9 -9
- package/components/radios/example-radios-with-visible-text-input.njk +3 -3
- package/components/relationships/example-relationships-error.njk +13 -13
- package/components/relationships/example-relationships-you.njk +13 -13
- package/components/relationships/example-relationships.njk +13 -13
- package/components/select/example-select-with-error.njk +1 -1
- package/components/select/example-select-with-inline-label.njk +1 -1
- package/components/select/example-select.njk +1 -1
- package/components/table/_table.scss +7 -3
- package/components/textarea/example-textarea-error.njk +1 -1
- package/components/upload/example-upload-error.njk +1 -1
- package/components/upload/example-upload.njk +1 -1
- package/css/main.css +3 -3
- package/package.json +8 -10
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +3 -2
- package/scss/main.scss +1 -0
- package/scss/overrides/hcm.scss +10 -10
package/README.md
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
text-transform: uppercase;
|
|
7
7
|
width: 15.1em;
|
|
8
8
|
|
|
9
|
-
@media all and (
|
|
9
|
+
@media all and (width >= 375px) {
|
|
10
10
|
font-size: 20px !important;
|
|
11
11
|
width: 15.1em !important;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
@media all and (
|
|
14
|
+
@media all and (width <= 374px) {
|
|
15
15
|
letter-spacing: 0;
|
|
16
16
|
max-width: 12.6em !important;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
@media all and (
|
|
19
|
+
@media all and (width <= 299px) {
|
|
20
20
|
max-width: 100%;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"name": "dietary",
|
|
14
14
|
"checkboxes": [
|
|
15
15
|
{
|
|
16
|
-
"id": "data",
|
|
16
|
+
"id": "data-checkbox",
|
|
17
17
|
"label": {
|
|
18
18
|
"text": "Data (309)"
|
|
19
19
|
},
|
|
20
20
|
"value": "data"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
"id": "publications",
|
|
23
|
+
"id": "publications-checkbox",
|
|
24
24
|
"label": {
|
|
25
25
|
"text": "Publications (137)"
|
|
26
26
|
},
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
"name": "name",
|
|
34
34
|
"checkboxes": [
|
|
35
35
|
{
|
|
36
|
-
"id": "datasets",
|
|
36
|
+
"id": "datasets-checkbox",
|
|
37
37
|
"label": {
|
|
38
38
|
"text": "Datasets (100)"
|
|
39
39
|
},
|
|
40
40
|
"value": "datasets"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
"id": "timeseries",
|
|
43
|
+
"id": "timeseries-checkbox",
|
|
44
44
|
"label": {
|
|
45
45
|
"text": "Timeseries (20)"
|
|
46
46
|
},
|
|
47
47
|
"value": "timeseries"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
"id": "requested",
|
|
50
|
+
"id": "requested-checkbox",
|
|
51
51
|
"label": {
|
|
52
52
|
"text": "User requested data (16)"
|
|
53
53
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
"id": "areas",
|
|
60
|
+
"id": "areas-checkbox",
|
|
61
61
|
"label": {
|
|
62
62
|
"text": "Areas (0)"
|
|
63
63
|
},
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"name": "dietary",
|
|
79
79
|
"checkboxes": [
|
|
80
80
|
{
|
|
81
|
-
"id": "crime",
|
|
81
|
+
"id": "crime-checkbox",
|
|
82
82
|
"label": {
|
|
83
83
|
"text": "Crime (200)"
|
|
84
84
|
},
|
|
@@ -86,14 +86,14 @@
|
|
|
86
86
|
"checked": true
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
"id": "education",
|
|
89
|
+
"id": "education-checkbox",
|
|
90
90
|
"label": {
|
|
91
91
|
"text": "Education (55)"
|
|
92
92
|
},
|
|
93
|
-
"value": "education"
|
|
93
|
+
"value": "education-checkbox"
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
"id": "disability",
|
|
96
|
+
"id": "disability-checkbox",
|
|
97
97
|
"label": {
|
|
98
98
|
"text": "Disability (67)"
|
|
99
99
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{% from "components/address-input/_macro.njk" import onsAddressInput %}
|
|
2
2
|
|
|
3
3
|
{{ onsAddressInput({
|
|
4
|
-
"id": "address",
|
|
4
|
+
"id": "address-input-editable",
|
|
5
5
|
"dontWrap": true,
|
|
6
6
|
"label": {
|
|
7
7
|
"text": "Enter address or postcode and select from results",
|
|
8
|
-
"id": "address-label"
|
|
8
|
+
"id": "address-label-input-editable"
|
|
9
9
|
},
|
|
10
10
|
"isEditable": true,
|
|
11
11
|
"mandatory": true,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{% from "components/address-input/_macro.njk" import onsAddressInput %}
|
|
2
2
|
|
|
3
3
|
{{ onsAddressInput({
|
|
4
|
-
"id": "address",
|
|
4
|
+
"id": "address-input-manual",
|
|
5
5
|
"dontWrap": true,
|
|
6
6
|
"manualEntry": true,
|
|
7
7
|
"label": {
|
|
8
8
|
"text": "Enter address or postcode and select from results",
|
|
9
|
-
"id": "address-label"
|
|
9
|
+
"id": "address-label-input-manual"
|
|
10
10
|
},
|
|
11
11
|
"line1": {
|
|
12
12
|
"label": "Address line 1"
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
"postcode": {
|
|
21
21
|
"label": "Postcode"
|
|
22
22
|
}
|
|
23
|
-
}) }}
|
|
23
|
+
}) }}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{% from "components/address-input/_macro.njk" import onsAddressInput %}
|
|
2
2
|
|
|
3
3
|
{{ onsAddressInput({
|
|
4
|
-
"id": "address",
|
|
4
|
+
"id": "address-input",
|
|
5
5
|
"dontWrap": true,
|
|
6
6
|
"label": {
|
|
7
7
|
"text": "Enter address or postcode and select from results",
|
|
8
|
-
"id": "address-label"
|
|
8
|
+
"id": "address-label-input"
|
|
9
9
|
},
|
|
10
10
|
"isEditable": false,
|
|
11
11
|
"mandatory": true,
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
border-bottom: 1px solid var(--ons-color-input-border);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
&:not(&--no-results
|
|
54
|
+
&:not(&--no-results, &--more-results):hover,
|
|
55
55
|
&--focused:not(&--no-results) {
|
|
56
56
|
background: var(--ons-color-text-link-hover);
|
|
57
57
|
border-color: var(--ons-color-text-link-hover);
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
&:active:not(&--no-results
|
|
66
|
+
&:active:not(&--no-results, &--more-results) {
|
|
67
67
|
background: var(--ons-color-focus);
|
|
68
68
|
color: var(--ons-color-text-link-focus);
|
|
69
69
|
|
|
@@ -91,11 +91,6 @@
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
&__wrapper {
|
|
95
|
-
max-width: max-content;
|
|
96
|
-
width: 100%;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
94
|
&__panel.ons-panel--warn {
|
|
100
95
|
background: none;
|
|
101
96
|
border: 0;
|
|
@@ -133,7 +128,7 @@
|
|
|
133
128
|
&--header {
|
|
134
129
|
.ons-autosuggest__results {
|
|
135
130
|
border: none;
|
|
136
|
-
box-shadow: 0 0 5px 0
|
|
131
|
+
box-shadow: 0 0 5px 0 rgb(34 34 34 / 60%);
|
|
137
132
|
left: 0;
|
|
138
133
|
position: absolute;
|
|
139
134
|
z-index: 10;
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
{% if params.tooManyResults %}data-too-many-results="{{ params.tooManyResults }}"{% endif %}
|
|
29
29
|
{% if params.errorMessageAPI %}data-error-api="{{ params.errorMessageAPI }}"{% endif %}
|
|
30
30
|
{% if params.errorMessageAPILinkText %}data-error-api-link-text="{{ params.errorMessageAPILinkText }}"{% endif %}
|
|
31
|
+
{% if params.language %}data-lang="{{ params.language }}"{% endif %}
|
|
31
32
|
{% if params.options %}
|
|
32
33
|
{% if params.options.oneYearAgo %}data-options-one-year-ago="true"{% endif %}
|
|
33
34
|
{% if params.options.regionCode %}data-options-region-code="{{ params.options.regionCode }}"{% endif %}
|
|
@@ -36,14 +37,13 @@
|
|
|
36
37
|
>
|
|
37
38
|
|
|
38
39
|
{% set autosuggestResults %}
|
|
39
|
-
<div class="ons-autosuggest__results ons-js-autosuggest-results">
|
|
40
|
+
<div class="ons-autosuggest__results ons-js-autosuggest-results{% if params.width %} ons-input--w-{{ params.width }}{% else %} ons-input--w-20{% endif %}">
|
|
40
41
|
<div id="{{ params.resultsTitleId }}" class="ons-autosuggest__results-title ons-u-fs-s">{{ params.resultsTitle }}</div>
|
|
41
42
|
<ul class="ons-autosuggest__listbox ons-js-autosuggest-listbox" title="{{ params.resultsTitle }}" role="listbox" id="{{ params.id }}-listbox" tabindex="-1"></ul>
|
|
42
43
|
</div>
|
|
43
44
|
<div class="ons-autosuggest__instructions ons-u-vh ons-js-autosuggest-instructions" id="{{ params.id }}-instructions" tabindex="-1">{{ params.instructions }}</div>
|
|
44
45
|
<div class="ons-autosuggest__status ons-u-vh ons-js-autosuggest-aria-status" aria-live="assertive" aria-atomic="true" role="status" tabindex="-1"></div>
|
|
45
46
|
{% endset %}
|
|
46
|
-
<div class="ons-autosuggest__wrapper">
|
|
47
47
|
{{ onsInput({
|
|
48
48
|
"id": params.id,
|
|
49
49
|
"classes": "ons-js-autosuggest-input " + (params.classes if params.classes else ''),
|
|
@@ -69,6 +69,5 @@
|
|
|
69
69
|
{% if not params.mutuallyExclusive %}
|
|
70
70
|
{{ autosuggestResults | safe }}
|
|
71
71
|
{% endif %}
|
|
72
|
-
</div>
|
|
73
72
|
</div>
|
|
74
73
|
{% endmacro %}
|
|
@@ -3,6 +3,7 @@ import AutosuggestUI from './autosuggest.ui';
|
|
|
3
3
|
export default class Autosuggest {
|
|
4
4
|
constructor(context) {
|
|
5
5
|
this.context = context;
|
|
6
|
+
this.language = context.getAttribute('data-lang');
|
|
6
7
|
|
|
7
8
|
this.autosuggest = new AutosuggestUI({
|
|
8
9
|
context,
|
|
@@ -13,7 +14,7 @@ export default class Autosuggest {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
get lang() {
|
|
16
|
-
return document.documentElement.getAttribute('lang').toLowerCase();
|
|
17
|
+
return !this.language ? document.documentElement.getAttribute('lang').toLowerCase() : this.language.toLowerCase();
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
async onSelect(result) {
|