@ons/design-system 70.0.17 → 72.0.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/components/access-code/_macro.njk +4 -4
- package/components/access-code/_macro.spec.js +8 -8
- package/components/access-code/example-access-code-error.njk +2 -2
- package/components/access-code/example-access-code.njk +2 -2
- package/components/accordion/_macro.njk +1 -1
- package/components/accordion/_macro.spec.js +1 -1
- package/components/address-input/_macro.njk +7 -7
- package/components/address-input/_macro.spec.js +16 -15
- package/components/address-input/autosuggest.address.error.js +1 -1
- package/components/address-input/autosuggest.address.js +25 -25
- package/components/address-input/autosuggest.address.spec.js +6 -5
- package/components/address-input/example-address-input-editable.njk +5 -4
- package/components/address-input/example-address-input.njk +4 -5
- package/components/autosuggest/_autosuggest.scss +8 -8
- package/components/autosuggest/_macro.njk +5 -5
- package/components/autosuggest/autosuggest.spec.js +1 -1
- package/components/back-to-top/_back-to-top.scss +2 -2
- package/components/back-to-top/example-full-page-back-to-top.njk +6 -6
- package/components/breadcrumbs/_breadcrumbs.scss +1 -1
- package/components/button/_button.scss +24 -16
- package/components/button/_macro.njk +3 -3
- package/components/button/example-button-custom.njk +1 -1
- package/components/card/_card.scss +0 -6
- package/components/card/_macro.njk +9 -9
- package/components/card/_macro.spec.js +57 -24
- package/components/card/example-card-set-with-images.njk +30 -18
- package/components/card/example-card-set-with-lists.njk +57 -45
- package/components/card/example-card-set.njk +27 -15
- package/components/card/example-card.njk +9 -5
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/checkboxes/_checkbox.scss +4 -4
- package/components/checkboxes/_checkboxes.scss +1 -1
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +4 -4
- package/components/cookies-banner/_cookies-banner.scss +5 -5
- package/components/cookies-banner/_macro.njk +15 -13
- package/components/cookies-banner/_macro.spec.js +1 -1
- package/components/details/_details.scss +5 -6
- package/components/details/_macro.njk +4 -4
- package/components/details/_macro.spec.js +1 -1
- package/components/document-list/_document-list.scss +0 -2
- package/components/document-list/_macro.njk +18 -18
- package/components/document-list/_macro.spec.js +16 -14
- package/components/document-list/example-document-list-article-featured.njk +5 -3
- package/components/document-list/example-document-list-articles.njk +15 -9
- package/components/document-list/example-document-list-downloads.njk +15 -9
- package/components/document-list/example-document-list-search-result-featured.njk +5 -3
- package/components/document-list/example-document-list-search-results.njk +20 -12
- package/components/download-resources/_download-resources.scss +1 -2
- package/components/download-resources/download-resources.spec.js +12 -6
- package/components/external-link/_macro.njk +1 -1
- package/components/external-link/_macro.spec.js +1 -1
- package/components/external-link/example-external-link.njk +1 -1
- package/components/feedback/_macro.njk +1 -1
- package/components/feedback/_macro.spec.js +3 -3
- package/components/feedback/example-feedback-call-to-action.njk +1 -1
- package/components/field/_field-group.scss +0 -2
- package/components/field/_field.scss +1 -2
- package/components/fieldset/_fieldset.scss +2 -2
- package/components/fieldset/_macro.njk +1 -1
- package/components/fieldset/_macro.spec.js +1 -1
- package/components/footer/_footer.scss +12 -7
- package/components/footer/_macro.njk +54 -34
- package/components/footer/_macro.spec.js +90 -28
- package/components/footer/example-footer-cymraeg.njk +1 -1
- package/components/footer/example-footer-transactional.njk +1 -1
- package/components/footer/example-footer-warning.njk +1 -1
- package/components/footer/example-footer-with-alternative-organisation.njk +99 -94
- package/components/footer/example-footer-with-coat-of-arms.njk +1 -1
- package/components/footer/example-footer-with-copyright.njk +1 -1
- package/components/footer/example-footer-with-multiple-logos-and-split-display.njk +173 -0
- package/components/footer/example-footer-with-multiple-logos.njk +172 -0
- package/components/footer/example-footer.njk +1 -1
- package/components/header/_header.scss +7 -14
- package/components/header/_macro.njk +19 -19
- package/components/header/_macro.spec.js +17 -17
- package/components/header/example-header-external-for-surveys.njk +2 -2
- package/components/header/example-header-external-welsh.njk +2 -2
- package/components/header/example-header-external-with-sub-navigation-removed.njk +1 -1
- package/components/header/example-header-external-with-sub-navigation.njk +1 -1
- package/components/header/example-header-multiple-logos.njk +4 -4
- package/components/hero/_hero.scss +6 -8
- package/components/hero/_macro.njk +1 -1
- package/components/icon/_icon.scss +4 -4
- package/components/icon/_macro.njk +4 -4
- package/components/icon/_macro.spec.js +2 -2
- package/components/image/_image.scss +1 -1
- package/components/image/_macro.njk +1 -1
- package/components/image/_macro.spec.js +10 -10
- package/components/image/example-image-for-regular-screens.njk +1 -1
- package/components/input/_input-type.scss +0 -2
- package/components/input/_input.scss +10 -10
- package/components/input/_macro.njk +4 -2
- package/components/input/example-input-search-with-character-check.njk +1 -1
- package/components/input/example-input-search.njk +1 -1
- package/components/label/_label.scss +1 -3
- package/components/language-selector/_macro.njk +3 -3
- package/components/language-selector/_macro.spec.js +7 -7
- package/components/list/_list.scss +1 -5
- package/components/list/_macro.njk +9 -10
- package/components/list/_macro.spec.js +50 -9
- package/components/list/example-inline-list-with-social-icon-prefix.njk +1 -1
- package/components/message/_macro.njk +3 -3
- package/components/message/_macro.spec.js +3 -3
- package/components/message-list/_macro.njk +2 -2
- package/components/message-list/_macro.spec.js +8 -4
- package/components/message-list/_message-list.scss +2 -2
- package/components/navigation/_macro.njk +9 -9
- package/components/navigation/_macro.spec.js +2 -2
- package/components/navigation/_navigation.scss +2 -6
- package/components/navigation/navigation.dom.js +1 -1
- package/components/navigation/navigation.spec.js +4 -4
- package/components/pagination/_macro.njk +2 -2
- package/components/pagination/_pagination.scss +1 -7
- package/components/panel/_macro.njk +5 -4
- package/components/panel/_macro.spec.js +2 -2
- package/components/panel/_panel.scss +12 -8
- package/components/password/_macro.njk +1 -1
- package/components/password/_macro.spec.js +2 -2
- package/components/phase-banner/_macro.njk +1 -1
- package/components/phase-banner/_phase-banner.scss +3 -4
- package/components/phase-banner/example-phase-banner-alpha.njk +1 -1
- package/components/phase-banner/example-phase-banner-beta.njk +1 -1
- package/components/question/_macro.njk +8 -8
- package/components/question/_macro.spec.js +3 -3
- package/components/question/_question.scss +3 -3
- package/components/radios/_macro.njk +1 -1
- package/components/radios/_macro.spec.js +1 -1
- package/components/radios/_radios.scss +1 -1
- package/components/radios/example-radios-with-clear-button-expanded.njk +1 -1
- package/components/radios/example-radios-with-clear-button.njk +1 -1
- package/components/related-content/_macro.spec.js +2 -2
- package/components/related-content/_related-content.scss +1 -1
- package/components/related-content/example-related-content-general.njk +2 -2
- package/components/related-content/example-related-content-social-media.njk +1 -1
- package/components/reply/_macro.njk +3 -1
- package/components/reply/_macro.spec.js +1 -1
- package/components/reply/reply.spec.js +1 -1
- package/components/section-navigation/_macro.njk +10 -10
- package/components/section-navigation/_macro.spec.js +15 -15
- package/components/section-navigation/_section-navigation.scss +4 -10
- package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk +3 -3
- package/components/section-navigation/example-section-navigation-vertical.njk +14 -14
- package/components/section-navigation/example-section-navigation.njk +3 -3
- package/components/select/example-select-with-inline-label.njk +1 -1
- package/components/share-page/_macro.njk +7 -7
- package/components/share-page/_macro.spec.js +2 -2
- package/components/share-page/example-share-page.njk +1 -1
- package/components/status/_status.scss +1 -1
- package/components/summary/_macro.njk +33 -33
- package/components/summary/_macro.spec.js +34 -34
- package/components/summary/_summary.scss +2 -4
- package/components/summary/example-summary-card-grouped.njk +34 -34
- package/components/summary/example-summary-grouped-total.njk +7 -7
- package/components/summary/example-summary-grouped-with-errors.njk +9 -9
- package/components/summary/example-summary-grouped.njk +34 -34
- package/components/summary/example-summary-household.njk +7 -7
- package/components/summary/example-summary-hub-minimal.njk +8 -8
- package/components/summary/example-summary-hub.njk +16 -16
- package/components/summary/example-summary-multiple.njk +7 -7
- package/components/summary/example-summary-no-action.njk +5 -5
- package/components/summary/example-summary.njk +9 -9
- package/components/table/_table.scss +2 -3
- package/components/table-of-contents/_macro.njk +3 -3
- package/components/table-of-contents/_macro.spec.js +3 -3
- package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +1 -1
- package/components/tabs/_macro.njk +3 -3
- package/components/tabs/_macro.spec.js +3 -3
- package/components/tabs/_tabs.scss +3 -4
- package/components/tabs/example-tabs-details.njk +1 -1
- package/components/text-indent/_text-indent.scss +1 -1
- package/components/timeline/_macro.njk +4 -4
- package/components/timeline/_macro.spec.js +3 -3
- package/components/timeline/_timeline.scss +4 -3
- package/components/timeline/example-timeline.njk +1 -1
- package/components/upload/_upload.scss +2 -2
- package/components/video/_macro.njk +4 -4
- package/components/video/_macro.spec.js +2 -2
- package/components/video/_video.scss +1 -1
- package/components/video/example-video.njk +2 -2
- package/components/video/video.spec.js +2 -2
- package/css/main.css +1 -1
- package/layout/_dsTemplate.njk +1 -1
- package/layout/_template.njk +31 -31
- package/package.json +4 -5
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +2 -0
- package/scss/base/_typography.scss +0 -2
- package/scss/main.scss +0 -1
- package/scss/objects/_container.scss +1 -1
- package/scss/objects/_page.scss +2 -3
- package/scss/overrides/rtl.scss +1 -1
- package/scss/utilities/_grid.scss +103 -96
- package/scss/utilities/_margin.scss +11 -5
- package/scss/utilities/_padding.scss +12 -5
- package/scss/utilities/_typography.scss +2 -1
- package/scss/vars/_forms.scss +8 -10
- package/scss/vars/_grid.scss +4 -4
- package/scss/vars/_typography.scss +26 -19
- package/components/call-to-action/_call-to-action.scss +0 -8
- package/components/call-to-action/_macro.njk +0 -24
- package/components/call-to-action/_macro.spec.js +0 -48
- package/components/call-to-action/example-call-to-action-default.njk +0 -15
- package/components/metadata/_macro.njk +0 -14
package/scss/base/_global.scss
CHANGED
package/scss/main.scss
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
@import '../components/breadcrumbs/breadcrumbs';
|
|
11
11
|
@import '../components/browser-banner/browser-banner';
|
|
12
12
|
@import '../components/button/button';
|
|
13
|
-
@import '../components/call-to-action/call-to-action';
|
|
14
13
|
@import '../components/card/card';
|
|
15
14
|
@import '../components/checkboxes/checkbox';
|
|
16
15
|
@import '../components/checkboxes/checkboxes';
|
package/scss/objects/_page.scss
CHANGED
package/scss/overrides/rtl.scss
CHANGED
|
@@ -4,108 +4,143 @@
|
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
font-size: 0;
|
|
6
6
|
margin-left: -$grid-gutters;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.ons-grid--float {
|
|
10
|
-
letter-spacing: 0;
|
|
11
|
-
}
|
|
12
7
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.ons-grid__col {
|
|
16
|
-
text-align: left;
|
|
8
|
+
&--float {
|
|
9
|
+
letter-spacing: 0;
|
|
17
10
|
}
|
|
18
|
-
}
|
|
19
11
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
12
|
+
&--center {
|
|
13
|
+
text-align: center;
|
|
23
14
|
|
|
24
|
-
.ons-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
.ons-grid__col {
|
|
16
|
+
text-align: left;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-all {
|
|
20
|
+
text-align: center;
|
|
21
|
+
}
|
|
28
22
|
}
|
|
29
|
-
}
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
&--reverse {
|
|
25
|
+
direction: rtl;
|
|
26
|
+
|
|
27
|
+
.ons-grid__col {
|
|
28
|
+
direction: ltr;
|
|
29
|
+
}
|
|
34
30
|
}
|
|
35
|
-
|
|
31
|
+
|
|
32
|
+
&--spaced {
|
|
36
33
|
.ons-grid__col {
|
|
37
|
-
margin-bottom:
|
|
34
|
+
margin-bottom: $grid-gutters;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.ons-grid--tight {
|
|
38
|
+
.ons-grid__col {
|
|
39
|
+
margin-bottom: math.div($grid-gutters, 2);
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
|
-
}
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
&--align-mid {
|
|
45
|
+
.ons-grid__col {
|
|
46
|
+
vertical-align: middle;
|
|
47
|
+
}
|
|
45
48
|
}
|
|
46
|
-
}
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
&--stagger-align {
|
|
51
|
+
.ons-grid__col:nth-of-type(1n) {
|
|
52
|
+
text-align: right;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ons-grid__col:nth-of-type(2n) {
|
|
56
|
+
text-align: left;
|
|
57
|
+
}
|
|
51
58
|
}
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
|
|
60
|
+
&--tight {
|
|
61
|
+
margin-left: math.div(-$grid-gutters, 2);
|
|
62
|
+
|
|
63
|
+
.ons-grid__col {
|
|
64
|
+
padding-left: math.div($grid-gutters, 2);
|
|
65
|
+
}
|
|
54
66
|
}
|
|
55
|
-
}
|
|
56
67
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.ons-grid__col {
|
|
60
|
-
padding-left: math.div($grid-gutters, 2);
|
|
68
|
+
&--loose {
|
|
69
|
+
margin-left: -$grid-gutters * 2;
|
|
61
70
|
}
|
|
62
|
-
}
|
|
63
71
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
72
|
+
&--gutterless {
|
|
73
|
+
margin-left: 0;
|
|
67
74
|
|
|
68
|
-
.ons-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
padding-left: 0;
|
|
75
|
+
.ons-grid__col {
|
|
76
|
+
padding-left: 0;
|
|
77
|
+
}
|
|
72
78
|
}
|
|
73
|
-
}
|
|
74
79
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
&--pixelgutter {
|
|
81
|
+
margin-left: 1px;
|
|
82
|
+
|
|
83
|
+
.ons-grid__col {
|
|
84
|
+
margin-bottom: 1px;
|
|
85
|
+
padding-left: 1px;
|
|
86
|
+
}
|
|
80
87
|
}
|
|
81
|
-
}
|
|
82
88
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
&-flex {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-flow: row wrap;
|
|
86
92
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
&--center {
|
|
94
|
+
justify-content: center;
|
|
95
|
+
}
|
|
90
96
|
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
&--between {
|
|
98
|
+
justify-content: space-between;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&--vertical-top {
|
|
102
|
+
align-items: start;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&--vertical-center {
|
|
106
|
+
align-items: center;
|
|
107
|
+
}
|
|
93
108
|
}
|
|
94
109
|
|
|
95
|
-
|
|
96
|
-
|
|
110
|
+
&__col {
|
|
111
|
+
background-clip: content-box;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
display: inline-block;
|
|
114
|
+
// Fixes text overflow issues
|
|
115
|
+
min-width: 0;
|
|
116
|
+
padding-left: $grid-gutters;
|
|
117
|
+
vertical-align: top;
|
|
118
|
+
width: 100%;
|
|
119
|
+
|
|
120
|
+
.ons-grid--float & {
|
|
121
|
+
display: block;
|
|
122
|
+
float: left;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&--loose {
|
|
126
|
+
padding-left: $grid-gutters * 2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ons-grid-flex & {
|
|
130
|
+
width: auto;
|
|
131
|
+
}
|
|
97
132
|
}
|
|
98
133
|
|
|
99
|
-
|
|
100
|
-
|
|
134
|
+
&_col--flex {
|
|
135
|
+
display: flex;
|
|
101
136
|
}
|
|
102
137
|
}
|
|
103
138
|
|
|
104
|
-
@include bp-suffix(ons-grid--no-wrap) {
|
|
139
|
+
@include bp-suffix(ons-grid-flex--no-wrap) {
|
|
105
140
|
flex-wrap: nowrap;
|
|
106
141
|
}
|
|
107
142
|
|
|
108
|
-
@include bp-suffix(ons-grid--column, $create-between-breakpoints: true) {
|
|
143
|
+
@include bp-suffix(ons-grid-flex--column, $create-between-breakpoints: true) {
|
|
109
144
|
flex-direction: column;
|
|
110
145
|
}
|
|
111
146
|
|
|
@@ -124,34 +159,6 @@
|
|
|
124
159
|
}
|
|
125
160
|
}
|
|
126
161
|
|
|
127
|
-
.ons-grid__col {
|
|
128
|
-
background-clip: content-box;
|
|
129
|
-
box-sizing: border-box;
|
|
130
|
-
display: inline-block;
|
|
131
|
-
// Fixes text overflow issues
|
|
132
|
-
min-width: 0;
|
|
133
|
-
padding-left: $grid-gutters;
|
|
134
|
-
vertical-align: top;
|
|
135
|
-
width: 100%;
|
|
136
|
-
|
|
137
|
-
.ons-grid--float & {
|
|
138
|
-
display: block;
|
|
139
|
-
float: left;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
&--loose {
|
|
143
|
-
padding-left: $grid-gutters * 2;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.ons-grid--flex & {
|
|
147
|
-
width: auto;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.ons-grid__col--flex {
|
|
152
|
-
display: flex;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
162
|
@include bp-suffix(ons-grid__col--sticky) {
|
|
156
163
|
position: sticky;
|
|
157
164
|
top: 2rem;
|
|
@@ -206,7 +213,7 @@
|
|
|
206
213
|
@include bp-suffix(ons-col-auto) {
|
|
207
214
|
width: auto;
|
|
208
215
|
|
|
209
|
-
.ons-grid
|
|
216
|
+
.ons-grid-flex & {
|
|
210
217
|
flex-basis: auto;
|
|
211
218
|
max-width: 100%;
|
|
212
219
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
$sizes: (
|
|
2
2
|
no: 0,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
4xs: 0.125rem,
|
|
4
|
+
3xs: 0.25rem,
|
|
5
|
+
2xs: 0.5rem,
|
|
6
|
+
xs: 0.75rem,
|
|
5
7
|
s: 1rem,
|
|
6
|
-
m: 1.
|
|
7
|
-
l:
|
|
8
|
-
xl:
|
|
8
|
+
m: 1.25rem,
|
|
9
|
+
l: 1.5rem,
|
|
10
|
+
xl: 2rem,
|
|
11
|
+
2xl: 2.5rem,
|
|
12
|
+
3xl: 3rem,
|
|
13
|
+
4xl: 4rem,
|
|
14
|
+
5xl: 5rem,
|
|
9
15
|
auto: auto,
|
|
10
16
|
);
|
|
11
17
|
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
$sizes: (
|
|
2
2
|
no: 0,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
4xs: 0.125rem,
|
|
4
|
+
3xs: 0.25rem,
|
|
5
|
+
2xs: 0.5rem,
|
|
6
|
+
xs: 0.75rem,
|
|
5
7
|
s: 1rem,
|
|
6
|
-
m: 1.
|
|
7
|
-
l:
|
|
8
|
-
xl:
|
|
8
|
+
m: 1.25rem,
|
|
9
|
+
l: 1.5rem,
|
|
10
|
+
xl: 2rem,
|
|
11
|
+
2xl: 2.5rem,
|
|
12
|
+
3xl: 3rem,
|
|
13
|
+
4xl: 4rem,
|
|
14
|
+
5xl: 5rem,
|
|
15
|
+
auto: auto,
|
|
9
16
|
);
|
|
10
17
|
|
|
11
18
|
$padding: (
|
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
font-size: rems($small-size, $base);
|
|
8
8
|
font-weight: map.get($props, weight);
|
|
9
|
-
line-height: map.get($props, line-height);
|
|
9
|
+
line-height: map.get($props, line-height-mobile);
|
|
10
10
|
|
|
11
11
|
@if $small-size != $large-size {
|
|
12
12
|
@include mq(m) {
|
|
13
13
|
font-size: rems($large-size, $base);
|
|
14
|
+
line-height: map.get($props, line-height-desktop);
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
}
|
package/scss/vars/_forms.scss
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
@import '../helpers/functions';
|
|
2
|
-
|
|
3
1
|
$input-radius: 3px;
|
|
4
|
-
$input-padding-vertical: 0.
|
|
2
|
+
$input-padding-vertical: 0.25rem;
|
|
5
3
|
$input-padding-horizontal: 0.5rem;
|
|
6
|
-
$input-width:
|
|
4
|
+
$input-width: 22.5rem;
|
|
7
5
|
$input-border-width: 1px;
|
|
8
6
|
$input-widths: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 40, 50;
|
|
9
7
|
// Widest character (capital W) is 1.0065rem wide
|
|
10
|
-
$char-max-width:
|
|
11
|
-
// Widest number (4) is 0.
|
|
12
|
-
$num-max-width: 0.
|
|
8
|
+
$char-max-width: 1.013rem;
|
|
9
|
+
// Widest number (4) is 0.607rem wide
|
|
10
|
+
$num-max-width: 0.607rem;
|
|
13
11
|
// Not the width of a space, the width of the space between characters with no spaces between
|
|
14
|
-
$char-space-width: 0.
|
|
12
|
+
$char-space-width: 0.033rem;
|
|
15
13
|
// Space width
|
|
16
|
-
$nbsp-width: 0.
|
|
14
|
+
$nbsp-width: 0.288rem;
|
|
17
15
|
|
|
18
16
|
@mixin input-width($class-name, $char-width: $char-max-width) {
|
|
19
17
|
@each $width in $input-widths {
|
|
@@ -35,7 +33,7 @@ $nbsp-width: 0.256rem;
|
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
@function input-width-calc($chars: 1, $char-width: $char-max-width, $spaces: 0, $num-chars: 0) {
|
|
38
|
-
// Space between characters is 0.
|
|
36
|
+
// Space between characters is 0.033rem wide
|
|
39
37
|
// Extra 2 pixels are to prevent clipping when the cursor is visible (2px is needed for iOS)
|
|
40
38
|
|
|
41
39
|
$padding-width: $input-padding-horizontal * 2;
|
package/scss/vars/_grid.scss
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
|
|
3
3
|
$grid-bp: (
|
|
4
|
-
|
|
4
|
+
'2xs': 300px,
|
|
5
5
|
xs: 400px,
|
|
6
6
|
s: 500px,
|
|
7
7
|
m: 740px,
|
|
8
8
|
l: 980px,
|
|
9
9
|
xl: 1300px,
|
|
10
|
-
|
|
10
|
+
'2xl': 1600px,
|
|
11
11
|
) !default;
|
|
12
12
|
|
|
13
|
-
$grid-max-width:
|
|
14
|
-
$grid-max-1280:
|
|
13
|
+
$grid-max-width: 64.625625rem !default;
|
|
14
|
+
$grid-max-1280: 79.9999rem !default;
|
|
15
15
|
$grid-cols: 12 !default;
|
|
16
16
|
$grid-cols-mobile: 4 !default;
|
|
17
17
|
$grid-gutters: 1rem !default;
|
|
@@ -2,66 +2,73 @@ $font-sans: 'OpenSans', 'Helvetica Neue', arial, sans-serif !default;
|
|
|
2
2
|
$font-serif: georgia, serif !default;
|
|
3
3
|
$font-mono: 'RobotoMono', monospace !default;
|
|
4
4
|
|
|
5
|
-
$base-font-size: 1rem;
|
|
6
|
-
$base-line-height: 1.5;
|
|
7
|
-
|
|
8
5
|
$font-weight-regular: 400;
|
|
9
6
|
$font-weight-bold: 700;
|
|
10
|
-
|
|
7
|
+
|
|
8
|
+
$base: 16px;
|
|
11
9
|
|
|
12
10
|
$type-matrix: (
|
|
13
|
-
ons-u-fs-
|
|
11
|
+
ons-u-fs-3xl: (
|
|
14
12
|
small: 32px,
|
|
15
13
|
large: 48px,
|
|
16
14
|
weight: $font-weight-bold,
|
|
17
|
-
line-height:
|
|
15
|
+
line-height-mobile: 44px,
|
|
16
|
+
line-height-desktop: 56px,
|
|
18
17
|
),
|
|
19
|
-
ons-u-fs-
|
|
18
|
+
ons-u-fs-2xl: (
|
|
20
19
|
small: 28px,
|
|
21
20
|
large: 36px,
|
|
22
21
|
weight: $font-weight-bold,
|
|
23
|
-
line-height:
|
|
22
|
+
line-height-mobile: 40px,
|
|
23
|
+
line-height-desktop: 48px,
|
|
24
24
|
),
|
|
25
25
|
ons-u-fs-xl: (
|
|
26
26
|
small: 26px,
|
|
27
27
|
large: 30px,
|
|
28
28
|
weight: $font-weight-bold,
|
|
29
|
-
line-height:
|
|
29
|
+
line-height-mobile: 36px,
|
|
30
|
+
line-height-desktop: 40px,
|
|
30
31
|
),
|
|
31
32
|
ons-u-fs-l: (
|
|
32
33
|
small: 24px,
|
|
33
34
|
large: 26px,
|
|
34
35
|
weight: $font-weight-bold,
|
|
35
|
-
line-height:
|
|
36
|
+
line-height-mobile: 32px,
|
|
37
|
+
line-height-desktop: 36px,
|
|
36
38
|
),
|
|
37
39
|
ons-u-fs-m: (
|
|
38
40
|
small: 20px,
|
|
39
41
|
large: 22px,
|
|
40
42
|
weight: $font-weight-bold,
|
|
41
|
-
line-height:
|
|
43
|
+
line-height-mobile: 28px,
|
|
44
|
+
line-height-desktop: 32px,
|
|
42
45
|
),
|
|
43
46
|
ons-u-fs-r--b: (
|
|
44
|
-
small:
|
|
45
|
-
large:
|
|
47
|
+
small: 18px,
|
|
48
|
+
large: 18px,
|
|
46
49
|
weight: $font-weight-bold,
|
|
47
|
-
line-height:
|
|
50
|
+
line-height-mobile: 28px,
|
|
51
|
+
line-height-desktop: 28px,
|
|
48
52
|
),
|
|
49
53
|
ons-u-fs-r: (
|
|
50
|
-
small:
|
|
51
|
-
large:
|
|
54
|
+
small: 18px,
|
|
55
|
+
large: 18px,
|
|
52
56
|
weight: $font-weight-regular,
|
|
53
|
-
line-height:
|
|
57
|
+
line-height-mobile: 28px,
|
|
58
|
+
line-height-desktop: 28px,
|
|
54
59
|
),
|
|
55
60
|
ons-u-fs-s--b: (
|
|
56
61
|
small: 14px,
|
|
57
62
|
large: 14px,
|
|
58
63
|
weight: $font-weight-bold,
|
|
59
|
-
line-height:
|
|
64
|
+
line-height-mobile: 20px,
|
|
65
|
+
line-height-desktop: 20px,
|
|
60
66
|
),
|
|
61
67
|
ons-u-fs-s: (
|
|
62
68
|
small: 14px,
|
|
63
69
|
large: 14px,
|
|
64
70
|
weight: $font-weight-regular,
|
|
65
|
-
line-height:
|
|
71
|
+
line-height-mobile: 20px,
|
|
72
|
+
line-height-desktop: 20px,
|
|
66
73
|
),
|
|
67
74
|
);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{% macro onsCallToAction(params) %}
|
|
2
|
-
{% from "components/button/_macro.njk" import onsButton %}
|
|
3
|
-
<div class="ons-call-to-action">
|
|
4
|
-
<div class="ons-container">
|
|
5
|
-
<div class="ons-grid ons-grid--flex ons-grid--vertical-center ons-grid--no-wrap@s">
|
|
6
|
-
<div class="ons-grid__col ons-col-auto ons-u-flex-shrink@s">
|
|
7
|
-
<h2 class="ons-call-to-action__heading ons-u-fs-r--b ons-u-di">{{ params.headingText }}</h2>
|
|
8
|
-
{% if params.paragraphText %}
|
|
9
|
-
<p class="ons-call-to-action__text ons-u-di">{{ params.paragraphText }}</p>
|
|
10
|
-
{% endif %}
|
|
11
|
-
</div>
|
|
12
|
-
<div class="ons-grid__col ons-col-auto ons-u-flex-no-grow ons-u-mt-xs@xxs@s">
|
|
13
|
-
{{
|
|
14
|
-
onsButton({
|
|
15
|
-
"text": params.button.text,
|
|
16
|
-
"url": params.button.url,
|
|
17
|
-
"variants": "small"
|
|
18
|
-
})
|
|
19
|
-
}}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
{% endmacro %}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/** @jest-environment jsdom */
|
|
2
|
-
|
|
3
|
-
import * as cheerio from 'cheerio';
|
|
4
|
-
|
|
5
|
-
import axe from '../../tests/helpers/axe';
|
|
6
|
-
import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
|
|
7
|
-
|
|
8
|
-
const EXAMPLE_CALL_TO_ACTION = {
|
|
9
|
-
headingText: 'Call to action heading.',
|
|
10
|
-
paragraphText: 'Descriptive text about call to action',
|
|
11
|
-
button: {
|
|
12
|
-
text: 'Start',
|
|
13
|
-
url: 'https://example.com/start',
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
describe('macro: call-to-action', () => {
|
|
18
|
-
it('passes jest-axe checks', async () => {
|
|
19
|
-
const $ = cheerio.load(renderComponent('call-to-action', EXAMPLE_CALL_TO_ACTION));
|
|
20
|
-
|
|
21
|
-
const results = await axe($.html());
|
|
22
|
-
expect(results).toHaveNoViolations();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('has the provided `headingText`', () => {
|
|
26
|
-
const $ = cheerio.load(renderComponent('call-to-action', EXAMPLE_CALL_TO_ACTION));
|
|
27
|
-
|
|
28
|
-
const headingText = $('.ons-call-to-action__heading').text().trim();
|
|
29
|
-
expect(headingText).toBe('Call to action heading.');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('has the provided `paragraphText`', () => {
|
|
33
|
-
const $ = cheerio.load(renderComponent('call-to-action', EXAMPLE_CALL_TO_ACTION));
|
|
34
|
-
|
|
35
|
-
const paragraphText = $('.ons-call-to-action__text').text().trim();
|
|
36
|
-
expect(paragraphText).toBe('Descriptive text about call to action');
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('outputs the expected call-to-action button', () => {
|
|
40
|
-
const faker = templateFaker();
|
|
41
|
-
const buttonSpy = faker.spy('button');
|
|
42
|
-
|
|
43
|
-
faker.renderComponent('call-to-action', EXAMPLE_CALL_TO_ACTION);
|
|
44
|
-
|
|
45
|
-
expect(buttonSpy.occurrences[0]).toHaveProperty('text', 'Start');
|
|
46
|
-
expect(buttonSpy.occurrences[0]).toHaveProperty('url', 'https://example.com/start');
|
|
47
|
-
});
|
|
48
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
'fullWidth': true
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
{% from "components/call-to-action/_macro.njk" import onsCallToAction %}
|
|
6
|
-
{{-
|
|
7
|
-
onsCallToAction({
|
|
8
|
-
"headingText": 'Call to action heading.',
|
|
9
|
-
"paragraphText": 'Descriptive text about call to action',
|
|
10
|
-
"button": {
|
|
11
|
-
"text": 'Start',
|
|
12
|
-
"url": '#0'
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
-}}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{% from "components/description-list/_macro.njk" import onsDescriptionList %}
|
|
2
|
-
|
|
3
|
-
{% macro onsMetadata(params) %}
|
|
4
|
-
{{
|
|
5
|
-
onsDescriptionList({
|
|
6
|
-
"id": params.id,
|
|
7
|
-
"classes": params.classes,
|
|
8
|
-
"descriptionListLabel": params.metadataLabel,
|
|
9
|
-
"termCol": params.termCol,
|
|
10
|
-
"descriptionCol": params.descriptionCol,
|
|
11
|
-
"itemsList": params.itemsList
|
|
12
|
-
})
|
|
13
|
-
}}
|
|
14
|
-
{% endmacro %}
|