@ons/design-system 54.0.0 → 55.1.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/autosuggest/_autosuggest.scss +4 -4
- package/components/autosuggest/autosuggest.spec.js +12 -2
- package/components/autosuggest/autosuggest.ui.js +4 -7
- package/components/browser-banner/_macro.njk +1 -1
- package/components/browser-banner/_macro.spec.js +31 -0
- package/components/button/_button.scss +28 -7
- package/components/button/_macro.njk +1 -1
- package/components/button/_macro.spec.js +2 -2
- package/components/checkboxes/_checkbox.scss +50 -17
- package/components/collapsible/_collapsible.scss +2 -1
- 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/external-link/_macro.njk +1 -1
- package/components/external-link/_macro.spec.js +2 -2
- package/components/fieldset/_fieldset.scss +11 -1
- package/components/fieldset/_macro.njk +9 -8
- package/components/fieldset/_macro.spec.js +27 -5
- package/components/footer/_footer.scss +1 -0
- package/components/footer/_macro.njk +1 -1
- package/components/footer/_macro.spec.js +18 -0
- package/components/header/_header.scss +7 -2
- package/components/header/_macro.njk +34 -8
- package/components/header/_macro.spec.js +82 -14
- package/components/hero/_macro.njk +1 -1
- package/components/hero/_macro.spec.js +1 -1
- package/components/icons/_macro.njk +1 -1
- package/components/input/_input-type.scss +37 -3
- package/components/input/_input.scss +28 -9
- package/components/input/_macro.njk +15 -17
- package/components/label/_label.scss +1 -1
- package/components/label/_macro.njk +27 -15
- package/components/label/_macro.spec.js +31 -0
- package/components/lists/_macro.njk +1 -1
- package/components/lists/_macro.spec.js +2 -2
- package/components/message/_message.scss +1 -0
- package/components/modal/_macro.njk +2 -2
- package/components/modal/_modal.scss +10 -9
- package/components/navigation/_macro.njk +1 -2
- package/components/navigation/_macro.spec.js +0 -1
- package/components/pagination/_pagination.scss +1 -0
- package/components/panel/_macro.njk +6 -9
- package/components/panel/_macro.spec.js +23 -20
- 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/radios/_radio.scss +16 -4
- package/components/relationships/_relationships.scss +2 -2
- package/components/reply/_macro.njk +2 -2
- package/components/skip-to-content/_skip.scss +2 -1
- package/components/table/_macro.njk +3 -2
- package/components/table/_macro.spec.js +0 -27
- package/components/table/_table.scss +15 -7
- package/components/table/sortable-table.js +1 -0
- package/components/tabs/_tabs.scss +57 -34
- package/components/tabs/tabs.js +4 -2
- package/components/upload/_upload.scss +2 -2
- package/css/census.css +1 -1
- package/css/ids.css +1 -1
- package/css/main.css +1 -1
- package/layout/_template.njk +25 -12
- 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 -56
- package/scss/vars/_colors.scss +2 -1
|
@@ -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
|
}
|
|
@@ -107,8 +115,9 @@
|
|
|
107
115
|
overflow-x: scroll;
|
|
108
116
|
width: 100%;
|
|
109
117
|
&:focus {
|
|
110
|
-
|
|
111
|
-
outline
|
|
118
|
+
box-shadow: 0 0 0 3px $color-page-light, 0 0 0 5px $color-text-link-focus, 0 0 0 8px $color-focus;
|
|
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 {
|
|
@@ -119,6 +128,7 @@
|
|
|
119
128
|
.ons-table__right-shadow,
|
|
120
129
|
.ons-table__left-shadow {
|
|
121
130
|
height: 100%;
|
|
131
|
+
padding: 2px;
|
|
122
132
|
position: absolute;
|
|
123
133
|
top: 0;
|
|
124
134
|
width: 5px;
|
|
@@ -181,8 +191,6 @@
|
|
|
181
191
|
}
|
|
182
192
|
|
|
183
193
|
.ons-table__header {
|
|
184
|
-
position: relative;
|
|
185
|
-
|
|
186
194
|
.ons-table__sort-button {
|
|
187
195
|
background-color: transparent;
|
|
188
196
|
border: 0;
|
|
@@ -204,7 +212,7 @@
|
|
|
204
212
|
}
|
|
205
213
|
|
|
206
214
|
.ons-svg-icon {
|
|
207
|
-
fill: $color-grey-
|
|
215
|
+
fill: $color-grey-75;
|
|
208
216
|
height: 0.8rem;
|
|
209
217
|
padding-bottom: 0.1rem;
|
|
210
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');
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
.ons-tabs {
|
|
2
2
|
margin-bottom: 1rem;
|
|
3
|
-
}
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
.ons-
|
|
7
|
-
|
|
8
|
-
margin: 0 0 1rem;
|
|
9
|
-
overflow: visible;
|
|
10
|
-
padding: 0;
|
|
4
|
+
&__title {
|
|
5
|
+
@extend .ons-u-fs-r--b;
|
|
6
|
+
}
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
// Anchor links list
|
|
9
|
+
&__list {
|
|
10
|
+
border-bottom: 0;
|
|
11
|
+
margin: 0 0 1rem;
|
|
12
|
+
overflow: visible;
|
|
13
|
+
padding: 0;
|
|
14
|
+
|
|
15
|
+
// Tabs
|
|
16
|
+
&--row {
|
|
17
|
+
margin: 0;
|
|
18
|
+
position: relative;
|
|
19
|
+
|
|
20
|
+
&::after {
|
|
21
|
+
background: $color-borders;
|
|
22
|
+
bottom: 0;
|
|
23
|
+
box-shadow: 0 1px 0 0 $color-page-light;
|
|
24
|
+
content: '';
|
|
25
|
+
height: 1px;
|
|
26
|
+
left: 0;
|
|
27
|
+
position: absolute;
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
15
31
|
}
|
|
16
32
|
}
|
|
17
33
|
|
|
@@ -32,7 +48,7 @@
|
|
|
32
48
|
border-radius: 3px 3px 0 0;
|
|
33
49
|
color: $color-text;
|
|
34
50
|
display: inline-block;
|
|
35
|
-
height: 2.
|
|
51
|
+
height: 2.55rem;
|
|
36
52
|
line-height: 2.3rem;
|
|
37
53
|
margin: 0 0.1rem 0 0;
|
|
38
54
|
overflow: visible;
|
|
@@ -47,47 +63,54 @@
|
|
|
47
63
|
text-decoration: underline solid $color-text 2px;
|
|
48
64
|
}
|
|
49
65
|
|
|
66
|
+
&:focus {
|
|
67
|
+
background-color: $color-focus;
|
|
68
|
+
border-bottom: 1px solid $color-borders;
|
|
69
|
+
box-shadow: inset 0 0 0 9px $color-button-secondary,
|
|
70
|
+
inset 17px 0 0 0 $color-button-secondary,
|
|
71
|
+
inset -17px 0 0 0 $color-button-secondary,
|
|
72
|
+
inset 0 -13px 0 0 $color-text-link-focus;
|
|
73
|
+
color: $color-text-link-focus;
|
|
74
|
+
|
|
75
|
+
// Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
|
|
76
|
+
outline: 3px solid transparent;
|
|
77
|
+
outline-offset: 1px;
|
|
78
|
+
text-decoration: underline solid $color-text 2px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Tab when selected
|
|
50
82
|
&[aria-selected='true'] {
|
|
51
|
-
background-color: $color-
|
|
83
|
+
background-color: $color-page-light;
|
|
84
|
+
border-bottom: none;
|
|
52
85
|
border-color: $color-borders;
|
|
53
|
-
// Tab when selected
|
|
54
86
|
border-radius: 3px 3px 0 0;
|
|
55
|
-
font-weight: 700;
|
|
56
87
|
text-decoration: none;
|
|
88
|
+
z-index: 1;
|
|
57
89
|
|
|
58
|
-
|
|
59
|
-
background: $color-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// hides the lower border of the active tab.
|
|
66
|
-
position: absolute;
|
|
67
|
-
right: 0;
|
|
68
|
-
z-index: 3;
|
|
90
|
+
&:focus {
|
|
91
|
+
background-color: $color-focus;
|
|
92
|
+
box-shadow: inset 0 0 0 9px $color-page-light,
|
|
93
|
+
inset 17px 0 0 0 $color-page-light,
|
|
94
|
+
inset -17px 0 0 0 $color-page-light,
|
|
95
|
+
inset 0 -13px 0 0 $color-text-link-focus;
|
|
96
|
+
text-decoration: none;
|
|
69
97
|
}
|
|
70
98
|
}
|
|
71
|
-
|
|
72
|
-
&:focus {
|
|
73
|
-
background-color: $color-focus;
|
|
74
|
-
color: $color-text-link-focus;
|
|
75
|
-
outline: none;
|
|
76
|
-
}
|
|
77
99
|
}
|
|
78
100
|
|
|
79
101
|
// Tabs - Panels
|
|
80
102
|
.ons-tabs__panel {
|
|
81
|
-
|
|
103
|
+
padding-bottom: 1rem;
|
|
82
104
|
padding-top: 1rem;
|
|
83
105
|
position: relative;
|
|
84
|
-
z-index: 10;
|
|
85
106
|
|
|
86
107
|
&--hidden {
|
|
87
108
|
display: none;
|
|
88
109
|
}
|
|
89
110
|
|
|
90
111
|
&:focus {
|
|
91
|
-
|
|
112
|
+
box-shadow: 0 0 0 3px $color-page-light, 0 0 0 5px $color-text-link-focus, 0 0 0 8px $color-focus;
|
|
113
|
+
outline: 3px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show box-shadows
|
|
114
|
+
z-index: 1;
|
|
92
115
|
}
|
|
93
116
|
}
|
package/components/tabs/tabs.js
CHANGED
|
@@ -30,8 +30,6 @@ export default class Tabs {
|
|
|
30
30
|
this.jsTabItemAsRowClass = 'ons-tab__list-item--row';
|
|
31
31
|
this.jsTabAsListClass = 'ons-tab--row';
|
|
32
32
|
|
|
33
|
-
this.tabsTitle.classList.add('ons-u-vh');
|
|
34
|
-
|
|
35
33
|
if (matchMediaUtil.hasMatchMedia()) {
|
|
36
34
|
this.setupViewportChecks();
|
|
37
35
|
} else {
|
|
@@ -61,6 +59,8 @@ export default class Tabs {
|
|
|
61
59
|
this.tabList[0].setAttribute('role', 'tablist');
|
|
62
60
|
this.tabList[0].classList.add(this.jsTabListAsRowClass);
|
|
63
61
|
|
|
62
|
+
this.tabsTitle.classList.add('ons-u-vh');
|
|
63
|
+
|
|
64
64
|
this.tabPanels.forEach(panel => {
|
|
65
65
|
panel.setAttribute('tabindex', '0');
|
|
66
66
|
});
|
|
@@ -90,6 +90,8 @@ export default class Tabs {
|
|
|
90
90
|
this.tabList[0].removeAttribute('role');
|
|
91
91
|
this.tabList[0].classList.remove(this.jsTabListAsRowClass);
|
|
92
92
|
|
|
93
|
+
this.tabsTitle.classList.remove('ons-u-vh');
|
|
94
|
+
|
|
93
95
|
this.tabPanels.forEach(panel => {
|
|
94
96
|
panel.removeAttribute('tabindex', '0');
|
|
95
97
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.ons-input--upload {
|
|
2
2
|
background: $color-white;
|
|
3
|
-
border: 1px solid $color-input;
|
|
3
|
+
border: 1px solid $color-input-border;
|
|
4
4
|
border-radius: $input-radius;
|
|
5
5
|
font-size: 1rem;
|
|
6
6
|
padding: 0;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
background: $color-button-secondary;
|
|
10
10
|
border: 0;
|
|
11
11
|
border-bottom-right-radius: 0;
|
|
12
|
-
border-right: 1px solid $color-input;
|
|
12
|
+
border-right: 1px solid $color-input-border;
|
|
13
13
|
border-top-right-radius: 0;
|
|
14
14
|
color: $color-text;
|
|
15
15
|
font-size: 1rem;
|