@ons/design-system 54.0.1 → 55.2.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 +3 -3
- package/components/accordion/_macro.njk +1 -1
- package/components/address-input/_macro.njk +7 -7
- package/components/address-output/_macro.njk +7 -7
- package/components/autosuggest/_macro.njk +19 -19
- package/components/breadcrumbs/_macro.njk +3 -3
- package/components/browser-banner/_macro.njk +1 -1
- package/components/browser-banner/_macro.spec.js +31 -0
- package/components/button/_button.scss +21 -7
- package/components/button/_macro.njk +25 -25
- package/components/button/_macro.spec.js +2 -2
- package/components/call-to-action/_macro.njk +1 -1
- package/components/card/_macro.njk +10 -10
- package/components/checkboxes/_checkbox-macro.njk +9 -9
- package/components/checkboxes/_checkbox.scss +43 -10
- package/components/checkboxes/_macro.njk +10 -10
- package/components/checkboxes/checkbox-with-fieldset.js +6 -5
- package/components/checkboxes/checkboxes.dom.js +6 -9
- package/components/code-highlight/_macro.njk +1 -1
- package/components/collapsible/_collapsible.scss +2 -1
- package/components/collapsible/_macro.njk +7 -7
- package/components/date-input/_macro.njk +5 -5
- package/components/document-list/_macro.njk +29 -29
- package/components/document-list/document-list.scss +2 -0
- package/components/download-resources/download-resources.js +19 -0
- package/components/download-resources/download-resources.spec.js +95 -0
- package/components/duration/_macro.njk +9 -9
- package/components/duration/_macro.spec.js +0 -3
- package/components/error/_macro.njk +1 -1
- package/components/external-link/_macro.njk +2 -2
- package/components/external-link/_macro.spec.js +2 -2
- package/components/feedback/_macro.njk +2 -2
- package/components/field/_macro.njk +5 -5
- package/components/fieldset/_fieldset.scss +11 -1
- package/components/fieldset/_macro.njk +15 -14
- package/components/fieldset/_macro.spec.js +27 -5
- package/components/footer/_footer.scss +1 -0
- package/components/footer/_macro.njk +18 -18
- package/components/footer/_macro.spec.js +18 -0
- package/components/header/_header.scss +7 -2
- package/components/header/_macro.njk +63 -37
- package/components/header/_macro.spec.js +82 -14
- package/components/hero/_macro.njk +16 -16
- package/components/hero/_macro.spec.js +1 -1
- package/components/icons/_macro.njk +2 -2
- package/components/images/_macro.njk +3 -3
- package/components/input/_input-type.scss +7 -0
- package/components/input/_input.scss +13 -2
- package/components/input/_macro.njk +40 -34
- package/components/input/_macro.spec.js +64 -59
- package/components/label/_label.scss +1 -1
- package/components/label/_macro.njk +27 -15
- package/components/label/_macro.spec.js +31 -0
- package/components/language-selector/_macro.njk +1 -1
- package/components/lists/_macro.njk +22 -22
- package/components/lists/_macro.spec.js +2 -2
- package/components/message/_macro.njk +6 -6
- package/components/message/_message.scss +1 -0
- package/components/message-list/_macro.njk +1 -1
- package/components/metadata/_macro.njk +2 -2
- package/components/modal/_macro.njk +6 -6
- package/components/modal/_modal.scss +10 -9
- package/components/mutually-exclusive/_macro.njk +1 -1
- package/components/mutually-exclusive/mutually-exclusive.js +3 -1
- package/components/navigation/_macro.njk +9 -10
- package/components/navigation/_macro.spec.js +0 -1
- package/components/pagination/_macro.njk +3 -3
- package/components/pagination/_pagination.scss +1 -0
- package/components/panel/_macro.njk +38 -43
- package/components/panel/_macro.spec.js +24 -33
- package/components/panel/_panel.scss +13 -5
- package/components/phase-banner/_macro.njk +1 -1
- package/components/phase-banner/_macro.spec.js +31 -0
- package/components/phase-banner/_phase-banner.scss +1 -0
- package/components/promotional-banner/_macro.njk +2 -2
- package/components/question/_macro.njk +18 -18
- package/components/quote/_macro.njk +2 -2
- package/components/radios/_macro.njk +8 -8
- package/components/radios/_radio.scss +15 -3
- package/components/radios/check-radios.js +5 -1
- package/components/related-content/_macro.njk +2 -2
- package/components/relationships/_macro.njk +2 -2
- package/components/reply/_macro.njk +2 -2
- package/components/section-navigation/_macro.njk +2 -2
- package/components/select/_macro.njk +8 -8
- package/components/share-page/_macro.njk +2 -2
- package/components/skip-to-content/_skip.scss +2 -1
- package/components/status/_macro.njk +2 -2
- package/components/summary/_macro.njk +25 -25
- package/components/table/_macro.njk +13 -12
- package/components/table/_macro.spec.js +0 -27
- package/components/table/_table.scss +13 -6
- package/components/table/sortable-table.js +1 -0
- package/components/table-of-contents/_macro.njk +4 -4
- package/components/tabs/_tabs.scss +5 -3
- package/components/textarea/_macro.njk +8 -8
- package/components/timeline/_macro.njk +1 -1
- package/components/video/_macro.njk +1 -1
- package/css/census.css +1 -1
- package/css/ids.css +1 -1
- package/css/main.css +1 -1
- package/layout/_template.njk +57 -44
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +1 -0
- package/scss/overrides/hcm.scss +205 -46
- package/scss/patternlib.scss +1 -0
|
@@ -480,33 +480,6 @@ describe('macro: table', () => {
|
|
|
480
480
|
|
|
481
481
|
expect($('.ons-table').attr('data-aria-desc')).toBe('descending');
|
|
482
482
|
});
|
|
483
|
-
|
|
484
|
-
it('adds visually hidden class to column headers', () => {
|
|
485
|
-
const $ = cheerio.load(renderComponent('table', params));
|
|
486
|
-
|
|
487
|
-
const hasClass = mapAll($('.ons-table__header > span'), node => node.hasClass('ons-u-vh'));
|
|
488
|
-
expect(hasClass).toEqual([true, true, true]);
|
|
489
|
-
});
|
|
490
|
-
|
|
491
|
-
it('renders "sort-sprite" icon for each column header', () => {
|
|
492
|
-
const faker = templateFaker();
|
|
493
|
-
const iconsSpy = faker.spy('icons');
|
|
494
|
-
|
|
495
|
-
faker.renderComponent('table', params);
|
|
496
|
-
|
|
497
|
-
expect(iconsSpy.occurrences[0]).toEqual({
|
|
498
|
-
iconType: 'sort-sprite',
|
|
499
|
-
id: 'Column 1',
|
|
500
|
-
});
|
|
501
|
-
expect(iconsSpy.occurrences[1]).toEqual({
|
|
502
|
-
iconType: 'sort-sprite',
|
|
503
|
-
id: 'Column 2',
|
|
504
|
-
});
|
|
505
|
-
expect(iconsSpy.occurrences[2]).toEqual({
|
|
506
|
-
iconType: 'sort-sprite',
|
|
507
|
-
id: 'Column 3',
|
|
508
|
-
});
|
|
509
|
-
});
|
|
510
483
|
});
|
|
511
484
|
|
|
512
485
|
describe('table caption', () => {
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
margin-bottom: 1rem;
|
|
5
5
|
width: 100%;
|
|
6
6
|
|
|
7
|
+
&__head {
|
|
8
|
+
border-bottom: 2px solid $color-grey-75;
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
&__caption {
|
|
8
12
|
font-weight: 700;
|
|
9
13
|
text-align: left;
|
|
@@ -13,7 +17,7 @@
|
|
|
13
17
|
&__cell {
|
|
14
18
|
@include nth-element(1, 0);
|
|
15
19
|
|
|
16
|
-
border-bottom: 2px solid $color-grey-
|
|
20
|
+
border-bottom: 2px solid $color-grey-75;
|
|
17
21
|
overflow: hidden;
|
|
18
22
|
padding: 0.5rem 0 0.5rem 1rem;
|
|
19
23
|
text-align: left;
|
|
@@ -64,8 +68,12 @@
|
|
|
64
68
|
display: none;
|
|
65
69
|
}
|
|
66
70
|
|
|
71
|
+
.ons-table__head {
|
|
72
|
+
border-bottom: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
67
75
|
.ons-table__body .ons-table__row {
|
|
68
|
-
border-bottom: 2px solid $color-grey-
|
|
76
|
+
border-bottom: 2px solid $color-grey-75;
|
|
69
77
|
display: block;
|
|
70
78
|
margin-bottom: 1rem;
|
|
71
79
|
}
|
|
@@ -108,7 +116,8 @@
|
|
|
108
116
|
width: 100%;
|
|
109
117
|
&:focus {
|
|
110
118
|
box-shadow: 0 0 0 3px $color-page-light, 0 0 0 5px $color-text-link-focus, 0 0 0 8px $color-focus;
|
|
111
|
-
outline:
|
|
119
|
+
outline: 3px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
|
|
120
|
+
outline-offset: 1px;
|
|
112
121
|
}
|
|
113
122
|
.ons-table__header,
|
|
114
123
|
.ons-table__cell {
|
|
@@ -182,8 +191,6 @@
|
|
|
182
191
|
}
|
|
183
192
|
|
|
184
193
|
.ons-table__header {
|
|
185
|
-
position: relative;
|
|
186
|
-
|
|
187
194
|
.ons-table__sort-button {
|
|
188
195
|
background-color: transparent;
|
|
189
196
|
border: 0;
|
|
@@ -205,7 +212,7 @@
|
|
|
205
212
|
}
|
|
206
213
|
|
|
207
214
|
.ons-svg-icon {
|
|
208
|
-
fill: $color-grey-
|
|
215
|
+
fill: $color-grey-75;
|
|
209
216
|
height: 0.8rem;
|
|
210
217
|
padding-bottom: 0.1rem;
|
|
211
218
|
width: 0.8rem;
|
|
@@ -28,6 +28,7 @@ export default class TableSort {
|
|
|
28
28
|
createHeadingButtons(heading, i) {
|
|
29
29
|
const text = heading.textContent.trim();
|
|
30
30
|
heading.childNodes[1].remove();
|
|
31
|
+
heading.childNodes[2].classList.remove('ons-u-d-no');
|
|
31
32
|
const button = document.createElement('button');
|
|
32
33
|
button.setAttribute('aria-label', this.table.getAttribute('data-aria-sort') + ' ' + text);
|
|
33
34
|
button.setAttribute('type', 'button');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% from "components/skip-to-content/_macro.njk" import onsSkipToContent %}
|
|
4
4
|
|
|
5
5
|
<aside class="ons-toc-container" role="complementary">
|
|
6
|
-
{% if params.skipLink
|
|
6
|
+
{% if params.skipLink %}
|
|
7
7
|
{{
|
|
8
8
|
onsSkipToContent({
|
|
9
9
|
"url": params.skipLink.url,
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
<nav class="ons-toc" aria-label="{{ params.ariaLabel | default('Table of contents') }}">
|
|
16
16
|
<h2 class="ons-toc__title ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h2>
|
|
17
|
-
{% if params.lists
|
|
17
|
+
{% if params.lists %}
|
|
18
18
|
{% for list in params.lists %}
|
|
19
|
-
{% if list.listHeading
|
|
19
|
+
{% if list.listHeading %}
|
|
20
20
|
<h3 class="ons-u-fs-r ons-u-mb-xs">{{ list.listHeading }}<span class="ons-u-vh"> {{ list.listHeadingHidden }}</span>:</h3>
|
|
21
21
|
{% endif %}
|
|
22
22
|
{{
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
})
|
|
29
29
|
}}
|
|
30
30
|
{% endfor %}
|
|
31
|
-
{% elif params.itemsList
|
|
31
|
+
{% elif params.itemsList %}
|
|
32
32
|
{{
|
|
33
33
|
onsList({
|
|
34
34
|
"element": 'ol',
|
|
@@ -71,7 +71,10 @@
|
|
|
71
71
|
inset -17px 0 0 0 $color-button-secondary,
|
|
72
72
|
inset 0 -13px 0 0 $color-text-link-focus;
|
|
73
73
|
color: $color-text-link-focus;
|
|
74
|
-
|
|
74
|
+
|
|
75
|
+
// Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
|
|
76
|
+
outline: 3px solid transparent;
|
|
77
|
+
outline-offset: 1px;
|
|
75
78
|
text-decoration: underline solid $color-text 2px;
|
|
76
79
|
}
|
|
77
80
|
|
|
@@ -86,7 +89,6 @@
|
|
|
86
89
|
|
|
87
90
|
&:focus {
|
|
88
91
|
background-color: $color-focus;
|
|
89
|
-
border-bottom: 1px solid $color-page-light;
|
|
90
92
|
box-shadow: inset 0 0 0 9px $color-page-light,
|
|
91
93
|
inset 17px 0 0 0 $color-page-light,
|
|
92
94
|
inset -17px 0 0 0 $color-page-light,
|
|
@@ -108,7 +110,7 @@
|
|
|
108
110
|
|
|
109
111
|
&:focus {
|
|
110
112
|
box-shadow: 0 0 0 3px $color-page-light, 0 0 0 5px $color-text-link-focus, 0 0 0 8px $color-focus;
|
|
111
|
-
outline:
|
|
113
|
+
outline: 3px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
|
|
112
114
|
z-index: 1;
|
|
113
115
|
}
|
|
114
116
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{% set field %}
|
|
9
9
|
{% set textareaExclusiveClass = " ons-js-exclusive-group-item" if params.mutuallyExclusive else "" %}
|
|
10
10
|
|
|
11
|
-
{% if params.label
|
|
11
|
+
{% if params.label %}
|
|
12
12
|
{{ onsLabel({
|
|
13
13
|
"for": params.id,
|
|
14
14
|
"text": params.label.text,
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
|
|
20
20
|
<textarea
|
|
21
21
|
id="{{ params.id }}"
|
|
22
|
-
class="ons-input ons-input--textarea {% if params.error
|
|
23
|
-
{% if params.name
|
|
22
|
+
class="ons-input ons-input--textarea {% if params.error %} ons-input--error {% endif %}{% if params.charCheckLimit and params.charCheckLimit.limit %} ons-js-char-limit-input{% endif %}{{ textareaExclusiveClass }} {{ params.classes if params.classes }} {% if params.width %}ons-input--w-{{ params.width }}{% endif %}"
|
|
23
|
+
{% if params.name %}
|
|
24
24
|
name="{{ params.name }}"
|
|
25
25
|
{% endif %}
|
|
26
26
|
rows="{{ params.rows | default(8) }}"
|
|
27
|
-
{% if params.charCheckLimit
|
|
27
|
+
{% if params.charCheckLimit and params.charCheckLimit.limit %}
|
|
28
28
|
maxlength="{{ params.charCheckLimit.limit }}"
|
|
29
29
|
data-char-limit-ref="{{ params.id }}-lim-remaining"
|
|
30
30
|
aria-describedby="{{ params.id }}-lim-remaining"
|
|
31
31
|
{% endif %}
|
|
32
|
-
{% if params.attributes
|
|
33
|
-
>{{ params.value if params.value
|
|
32
|
+
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
|
|
33
|
+
>{{ params.value if params.value }}</textarea>
|
|
34
34
|
|
|
35
|
-
{% if params.charCheckLimit
|
|
35
|
+
{% if params.charCheckLimit and params.charCheckLimit.limit %}
|
|
36
36
|
{% call onsCharLimit({
|
|
37
37
|
"id": params.id ~ "-lim",
|
|
38
38
|
"limit": params.charCheckLimit.limit,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
{% endif %}
|
|
44
44
|
{% endset %}
|
|
45
45
|
|
|
46
|
-
{% if params.mutuallyExclusive
|
|
46
|
+
{% if params.mutuallyExclusive %}
|
|
47
47
|
{% call onsMutuallyExclusive({
|
|
48
48
|
"id": params.fieldId,
|
|
49
49
|
"classes": params.fieldClasses,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{%- macro onsVideo(params) -%}
|
|
2
2
|
<div class="ons-video">
|
|
3
|
-
{% if params.youtubeUrl
|
|
3
|
+
{% if params.youtubeUrl %}
|
|
4
4
|
<iframe title="{{ params.title }}" class="ons-video__iframe" src="{{ params.youtubeUrl }}" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
5
5
|
{% endif %}
|
|
6
6
|
</div>
|