@ministryofjustice/frontend 3.3.1 → 3.4.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/README.md +4 -10
- package/govuk-prototype-kit.config.json +5 -16
- package/moj/all.jquery.min.js +77 -3
- package/moj/all.js +2021 -1436
- package/moj/all.scss +2 -0
- package/moj/all.spec.js +15 -13
- package/moj/components/_all.scss +1 -0
- package/moj/components/action-bar/_action-bar.scss +4 -6
- package/moj/components/add-another/_add-another.scss +9 -7
- package/moj/components/add-another/add-another.js +90 -69
- package/moj/components/add-another/add-another.spec.js +165 -0
- package/moj/components/alert/README.md +0 -0
- package/moj/components/alert/_alert.scss +142 -0
- package/moj/components/alert/alert.js +247 -0
- package/moj/components/alert/alert.spec.helper.js +67 -0
- package/moj/components/alert/alert.spec.js +229 -0
- package/moj/components/alert/macro.njk +3 -0
- package/moj/components/alert/template.njk +83 -0
- package/moj/components/badge/_badge.scss +3 -4
- package/moj/components/banner/_banner.scss +5 -10
- package/moj/components/button-menu/_button-menu.scss +10 -9
- package/moj/components/button-menu/button-menu.js +139 -136
- package/moj/components/button-menu/button-menu.spec.js +295 -296
- package/moj/components/cookie-banner/_cookie-banner.scss +6 -5
- package/moj/components/currency-input/_currency-input.scss +4 -4
- package/moj/components/date-picker/README.md +14 -17
- package/moj/components/date-picker/_date-picker.scss +122 -106
- package/moj/components/date-picker/date-picker.js +473 -471
- package/moj/components/date-picker/date-picker.spec.js +971 -923
- package/moj/components/filter/README.md +1 -1
- package/moj/components/filter/_filter.scss +53 -75
- package/moj/components/filter-toggle-button/filter-toggle-button.js +71 -67
- package/moj/components/filter-toggle-button/filter-toggle-button.spec.js +203 -205
- package/moj/components/form-validator/form-validator.js +117 -109
- package/moj/components/header/_header.scss +17 -19
- package/moj/components/identity-bar/_identity-bar.scss +5 -5
- package/moj/components/interruption-card/_interruption-card.scss +2 -2
- package/moj/components/messages/_messages.scss +12 -19
- package/moj/components/multi-file-upload/README.md +1 -1
- package/moj/components/multi-file-upload/_multi-file-upload.scss +34 -30
- package/moj/components/multi-file-upload/multi-file-upload.js +188 -152
- package/moj/components/multi-file-upload/multi-file-upload.spec.js +510 -0
- package/moj/components/multi-select/_multi-select.scss +4 -3
- package/moj/components/multi-select/multi-select.js +55 -50
- package/moj/components/multi-select/multi-select.spec.js +72 -79
- package/moj/components/notification-badge/_notification-badge.scss +12 -12
- package/moj/components/organisation-switcher/_organisation-switcher.scss +1 -1
- package/moj/components/page-header-actions/_page-header-actions.scss +3 -2
- package/moj/components/pagination/_pagination.scss +26 -31
- package/moj/components/password-reveal/_password-reveal.scss +1 -2
- package/moj/components/password-reveal/password-reveal.js +22 -21
- package/moj/components/password-reveal/password-reveal.spec.js +39 -37
- package/moj/components/primary-navigation/_primary-navigation.scss +26 -29
- package/moj/components/progress-bar/_progress-bar.scss +21 -26
- package/moj/components/rich-text-editor/_rich-text-editor.scss +17 -16
- package/moj/components/rich-text-editor/rich-text-editor.js +117 -103
- package/moj/components/search/_search.scss +6 -4
- package/moj/components/search-toggle/search-toggle.js +29 -30
- package/moj/components/search-toggle/search-toggle.scss +21 -15
- package/moj/components/search-toggle/search-toggle.spec.js +65 -70
- package/moj/components/side-navigation/_side-navigation.scss +12 -21
- package/moj/components/sortable-table/_sortable-table.scss +25 -23
- package/moj/components/sortable-table/sortable-table.js +139 -117
- package/moj/components/sortable-table/sortable-table.spec.js +362 -0
- package/moj/components/sub-navigation/_sub-navigation.scss +24 -28
- package/moj/components/tag/_tag.scss +8 -9
- package/moj/components/task-list/_task-list.scss +8 -7
- package/moj/components/ticket-panel/_ticket-panel.scss +14 -6
- package/moj/components/timeline/_timeline.scss +18 -20
- package/moj/filters/all.js +28 -30
- package/moj/filters/prototype-kit-13-filters.js +2 -1
- package/moj/helpers/_all.scss +1 -0
- package/moj/helpers/_hidden.scss +1 -1
- package/moj/helpers/_links.scss +20 -0
- package/moj/helpers.js +160 -31
- package/moj/helpers.spec.js +235 -0
- package/moj/init.js +2 -2
- package/moj/moj-frontend.min.css +2 -2
- package/moj/moj-frontend.min.js +77 -3
- package/moj/namespace.js +2 -1
- package/moj/objects/_filter-layout.scss +11 -10
- package/moj/objects/_scrollable-pane.scss +11 -14
- package/moj/settings/_colours.scss +5 -0
- package/moj/settings/_measurements.scss +0 -2
- package/moj/utilities/_hidden.scss +3 -3
- package/moj/utilities/_width-container.scss +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
MOJFrontend.FormValidator = function(form, options) {
|
|
2
|
-
this.form = form
|
|
3
|
-
this.errors = []
|
|
4
|
-
this.validators = []
|
|
5
|
-
$(this.form).on('submit', $.proxy(this, 'onSubmit'))
|
|
6
|
-
this.summary =
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
MOJFrontend.FormValidator = function (form, options) {
|
|
2
|
+
this.form = form
|
|
3
|
+
this.errors = []
|
|
4
|
+
this.validators = []
|
|
5
|
+
$(this.form).on('submit', $.proxy(this, 'onSubmit'))
|
|
6
|
+
this.summary =
|
|
7
|
+
options && options.summary ? $(options.summary) : $('.govuk-error-summary')
|
|
8
|
+
this.originalTitle = document.title
|
|
9
|
+
}
|
|
9
10
|
|
|
10
11
|
MOJFrontend.FormValidator.entityMap = {
|
|
11
12
|
'&': '&',
|
|
@@ -16,141 +17,148 @@ MOJFrontend.FormValidator.entityMap = {
|
|
|
16
17
|
'/': '/',
|
|
17
18
|
'`': '`',
|
|
18
19
|
'=': '='
|
|
19
|
-
}
|
|
20
|
+
}
|
|
20
21
|
|
|
21
|
-
MOJFrontend.FormValidator.prototype.escapeHtml = function(string) {
|
|
22
|
-
return String(string).replace(/[&<>"'
|
|
23
|
-
return MOJFrontend.FormValidator.entityMap[s]
|
|
24
|
-
})
|
|
25
|
-
}
|
|
22
|
+
MOJFrontend.FormValidator.prototype.escapeHtml = function (string) {
|
|
23
|
+
return String(string).replace(/[&<>"'`=/]/g, function fromEntityMap(s) {
|
|
24
|
+
return MOJFrontend.FormValidator.entityMap[s]
|
|
25
|
+
})
|
|
26
|
+
}
|
|
26
27
|
|
|
27
|
-
MOJFrontend.FormValidator.prototype.resetTitle = function() {
|
|
28
|
-
document.title = this.originalTitle
|
|
29
|
-
}
|
|
28
|
+
MOJFrontend.FormValidator.prototype.resetTitle = function () {
|
|
29
|
+
document.title = this.originalTitle
|
|
30
|
+
}
|
|
30
31
|
|
|
31
|
-
MOJFrontend.FormValidator.prototype.updateTitle = function() {
|
|
32
|
-
document.title =
|
|
33
|
-
}
|
|
32
|
+
MOJFrontend.FormValidator.prototype.updateTitle = function () {
|
|
33
|
+
document.title = `${this.errors.length} errors - ${document.title}`
|
|
34
|
+
}
|
|
34
35
|
|
|
35
36
|
MOJFrontend.FormValidator.prototype.showSummary = function () {
|
|
36
|
-
this.summary.html(this.getSummaryHtml())
|
|
37
|
-
this.summary.removeClass('moj-hidden')
|
|
38
|
-
this.summary.attr('aria-labelledby', 'errorSummary-heading')
|
|
39
|
-
this.summary.focus()
|
|
40
|
-
}
|
|
37
|
+
this.summary.html(this.getSummaryHtml())
|
|
38
|
+
this.summary.removeClass('moj-hidden')
|
|
39
|
+
this.summary.attr('aria-labelledby', 'errorSummary-heading')
|
|
40
|
+
this.summary.focus()
|
|
41
|
+
}
|
|
41
42
|
|
|
42
|
-
MOJFrontend.FormValidator.prototype.getSummaryHtml = function() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
html += '<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
html +=
|
|
50
|
-
html +=
|
|
51
|
-
html +=
|
|
52
|
-
html += '</
|
|
43
|
+
MOJFrontend.FormValidator.prototype.getSummaryHtml = function () {
|
|
44
|
+
let html =
|
|
45
|
+
'<h2 id="error-summary-title" class="govuk-error-summary__title">There is a problem</h2>'
|
|
46
|
+
html += '<div class="govuk-error-summary__body">'
|
|
47
|
+
html += '<ul class="govuk-list govuk-error-summary__list">'
|
|
48
|
+
for (let i = 0, j = this.errors.length; i < j; i++) {
|
|
49
|
+
const error = this.errors[i]
|
|
50
|
+
html += '<li>'
|
|
51
|
+
html += `<a href="#${this.escapeHtml(error.fieldName)}">`
|
|
52
|
+
html += this.escapeHtml(error.message)
|
|
53
|
+
html += '</a>'
|
|
54
|
+
html += '</li>'
|
|
53
55
|
}
|
|
54
|
-
html += '</ul>'
|
|
55
|
-
html += '</div>'
|
|
56
|
-
return html
|
|
57
|
-
}
|
|
56
|
+
html += '</ul>'
|
|
57
|
+
html += '</div>'
|
|
58
|
+
return html
|
|
59
|
+
}
|
|
58
60
|
|
|
59
|
-
MOJFrontend.FormValidator.prototype.hideSummary = function() {
|
|
60
|
-
this.summary.addClass('moj-hidden')
|
|
61
|
-
this.summary.removeAttr('aria-labelledby')
|
|
62
|
-
}
|
|
61
|
+
MOJFrontend.FormValidator.prototype.hideSummary = function () {
|
|
62
|
+
this.summary.addClass('moj-hidden')
|
|
63
|
+
this.summary.removeAttr('aria-labelledby')
|
|
64
|
+
}
|
|
63
65
|
|
|
64
66
|
MOJFrontend.FormValidator.prototype.onSubmit = function (e) {
|
|
65
|
-
this.removeInlineErrors()
|
|
66
|
-
this.hideSummary()
|
|
67
|
-
this.resetTitle()
|
|
68
|
-
if(!this.validate()) {
|
|
69
|
-
e.preventDefault()
|
|
70
|
-
this.updateTitle()
|
|
71
|
-
this.showSummary()
|
|
72
|
-
this.showInlineErrors()
|
|
67
|
+
this.removeInlineErrors()
|
|
68
|
+
this.hideSummary()
|
|
69
|
+
this.resetTitle()
|
|
70
|
+
if (!this.validate()) {
|
|
71
|
+
e.preventDefault()
|
|
72
|
+
this.updateTitle()
|
|
73
|
+
this.showSummary()
|
|
74
|
+
this.showInlineErrors()
|
|
73
75
|
}
|
|
74
|
-
}
|
|
76
|
+
}
|
|
75
77
|
|
|
76
|
-
MOJFrontend.FormValidator.prototype.showInlineErrors = function() {
|
|
77
|
-
for (
|
|
78
|
-
this.showInlineError(this.errors[i])
|
|
78
|
+
MOJFrontend.FormValidator.prototype.showInlineErrors = function () {
|
|
79
|
+
for (let i = 0, j = this.errors.length; i < j; i++) {
|
|
80
|
+
this.showInlineError(this.errors[i])
|
|
79
81
|
}
|
|
80
|
-
}
|
|
82
|
+
}
|
|
81
83
|
|
|
82
84
|
MOJFrontend.FormValidator.prototype.showInlineError = function (error) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
fieldContainer.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
85
|
+
const errorSpanId = `${error.fieldName}-error`
|
|
86
|
+
const errorSpan = `<span class="govuk-error-message" id="${
|
|
87
|
+
errorSpanId
|
|
88
|
+
}">${this.escapeHtml(error.message)}</span>`
|
|
89
|
+
const control = $(`#${error.fieldName}`)
|
|
90
|
+
const fieldContainer = control.parents('.govuk-form-group')
|
|
91
|
+
const label = fieldContainer.find('label')
|
|
92
|
+
const legend = fieldContainer.find('legend')
|
|
93
|
+
const fieldset = fieldContainer.find('fieldset')
|
|
94
|
+
fieldContainer.addClass('govuk-form-group--error')
|
|
95
|
+
if (legend.length) {
|
|
96
|
+
legend.after(errorSpan)
|
|
97
|
+
fieldContainer.attr('aria-invalid', 'true')
|
|
98
|
+
MOJFrontend.addAttributeValue(fieldset[0], 'aria-describedby', errorSpanId)
|
|
95
99
|
} else {
|
|
96
|
-
label.after(errorSpan)
|
|
97
|
-
control.attr('aria-invalid', 'true')
|
|
98
|
-
MOJFrontend.addAttributeValue(control[0], 'aria-describedby', errorSpanId)
|
|
100
|
+
label.after(errorSpan)
|
|
101
|
+
control.attr('aria-invalid', 'true')
|
|
102
|
+
MOJFrontend.addAttributeValue(control[0], 'aria-describedby', errorSpanId)
|
|
99
103
|
}
|
|
100
|
-
}
|
|
104
|
+
}
|
|
101
105
|
|
|
102
|
-
MOJFrontend.FormValidator.prototype.removeInlineErrors = function() {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
for (var i = 0; i < this.errors.length; i++) {
|
|
106
|
-
this.removeInlineError(this.errors[i]);
|
|
106
|
+
MOJFrontend.FormValidator.prototype.removeInlineErrors = function () {
|
|
107
|
+
for (let i = 0; i < this.errors.length; i++) {
|
|
108
|
+
this.removeInlineError(this.errors[i])
|
|
107
109
|
}
|
|
108
|
-
}
|
|
110
|
+
}
|
|
109
111
|
|
|
110
|
-
MOJFrontend.FormValidator.prototype.removeInlineError = function(error) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
fieldContainer.find('.govuk-error-message').remove()
|
|
114
|
-
fieldContainer.removeClass('govuk-form-group--error')
|
|
115
|
-
fieldContainer.find(
|
|
116
|
-
|
|
117
|
-
MOJFrontend.removeAttributeValue(
|
|
118
|
-
|
|
112
|
+
MOJFrontend.FormValidator.prototype.removeInlineError = function (error) {
|
|
113
|
+
const control = $(`#${error.fieldName}`)
|
|
114
|
+
const fieldContainer = control.parents('.govuk-form-group')
|
|
115
|
+
fieldContainer.find('.govuk-error-message').remove()
|
|
116
|
+
fieldContainer.removeClass('govuk-form-group--error')
|
|
117
|
+
fieldContainer.find('[aria-invalid]').attr('aria-invalid', 'false')
|
|
118
|
+
const errorSpanId = `${error.fieldName}-error`
|
|
119
|
+
MOJFrontend.removeAttributeValue(
|
|
120
|
+
fieldContainer.find('[aria-describedby]')[0],
|
|
121
|
+
'aria-describedby',
|
|
122
|
+
errorSpanId
|
|
123
|
+
)
|
|
124
|
+
}
|
|
119
125
|
|
|
120
|
-
MOJFrontend.FormValidator.prototype.addValidator = function(fieldName, rules) {
|
|
126
|
+
MOJFrontend.FormValidator.prototype.addValidator = function (fieldName, rules) {
|
|
121
127
|
this.validators.push({
|
|
122
|
-
fieldName
|
|
123
|
-
rules
|
|
128
|
+
fieldName,
|
|
129
|
+
rules,
|
|
124
130
|
field: this.form.elements[fieldName]
|
|
125
|
-
})
|
|
126
|
-
}
|
|
131
|
+
})
|
|
132
|
+
}
|
|
127
133
|
|
|
128
|
-
MOJFrontend.FormValidator.prototype.validate = function() {
|
|
129
|
-
this.errors = []
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
MOJFrontend.FormValidator.prototype.validate = function () {
|
|
135
|
+
this.errors = []
|
|
136
|
+
let validator = null
|
|
137
|
+
let validatorReturnValue = true
|
|
138
|
+
let i
|
|
139
|
+
let j
|
|
134
140
|
for (i = 0; i < this.validators.length; i++) {
|
|
135
|
-
validator = this.validators[i]
|
|
141
|
+
validator = this.validators[i]
|
|
136
142
|
for (j = 0; j < validator.rules.length; j++) {
|
|
137
|
-
validatorReturnValue = validator.rules[j].method(
|
|
138
|
-
validator.
|
|
143
|
+
validatorReturnValue = validator.rules[j].method(
|
|
144
|
+
validator.field,
|
|
145
|
+
validator.rules[j].params
|
|
146
|
+
)
|
|
139
147
|
|
|
140
148
|
if (typeof validatorReturnValue === 'boolean' && !validatorReturnValue) {
|
|
141
149
|
this.errors.push({
|
|
142
150
|
fieldName: validator.fieldName,
|
|
143
151
|
message: validator.rules[j].message
|
|
144
|
-
})
|
|
145
|
-
break
|
|
146
|
-
} else if(typeof validatorReturnValue === 'string') {
|
|
152
|
+
})
|
|
153
|
+
break
|
|
154
|
+
} else if (typeof validatorReturnValue === 'string') {
|
|
147
155
|
this.errors.push({
|
|
148
156
|
fieldName: validatorReturnValue,
|
|
149
157
|
message: validator.rules[j].message
|
|
150
|
-
})
|
|
151
|
-
break
|
|
158
|
+
})
|
|
159
|
+
break
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
162
|
}
|
|
155
|
-
return this.errors.length === 0
|
|
156
|
-
}
|
|
163
|
+
return this.errors.length === 0
|
|
164
|
+
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
========================================================================== */
|
|
4
4
|
|
|
5
5
|
.moj-header {
|
|
6
|
-
background-color: govuk-colour("black");
|
|
7
6
|
padding-top: govuk-spacing(3);
|
|
8
7
|
border-bottom: 10px solid $govuk-brand-colour;
|
|
8
|
+
background-color: govuk-colour("black");
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.moj-header__container {
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
@include govuk-media-query($from: desktop) {
|
|
21
21
|
float: left;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
.moj-header__logotype-crown {
|
|
@@ -28,7 +27,6 @@
|
|
|
28
27
|
top: -4px;
|
|
29
28
|
margin-right: govuk-spacing(1);
|
|
30
29
|
vertical-align: top;
|
|
31
|
-
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
.moj-header__logotype-crest {
|
|
@@ -44,19 +42,19 @@
|
|
|
44
42
|
@include govuk-media-query($from: desktop) {
|
|
45
43
|
float: right;
|
|
46
44
|
}
|
|
47
|
-
|
|
48
45
|
}
|
|
49
46
|
|
|
50
|
-
.moj-header__link,
|
|
47
|
+
.moj-header__link,
|
|
48
|
+
.moj-header__link > a {
|
|
51
49
|
@include govuk-link-common;
|
|
52
50
|
@include govuk-link-style-default;
|
|
53
|
-
border-bottom: 1px solid transparent;
|
|
54
|
-
color: govuk-colour("white");
|
|
55
51
|
display: inline-block;
|
|
56
|
-
text-decoration: none;
|
|
57
|
-
line-height: 25px; // Override due to alignment issue in Chrome
|
|
58
52
|
margin-bottom: -1px;
|
|
59
53
|
overflow: hidden; // Fixes focus gaps in background colour
|
|
54
|
+
border-bottom: 1px solid transparent;
|
|
55
|
+
color: govuk-colour("white");
|
|
56
|
+
line-height: 25px; // Override due to alignment issue in Chrome
|
|
57
|
+
text-decoration: none;
|
|
60
58
|
vertical-align: middle;
|
|
61
59
|
|
|
62
60
|
&:link,
|
|
@@ -78,6 +76,7 @@
|
|
|
78
76
|
&--organisation-name {
|
|
79
77
|
@include govuk-font($size: 24, $weight: "bold");
|
|
80
78
|
vertical-align: middle;
|
|
79
|
+
|
|
81
80
|
&:hover {
|
|
82
81
|
border-color: transparent;
|
|
83
82
|
}
|
|
@@ -93,6 +92,7 @@
|
|
|
93
92
|
@include govuk-media-query($from: desktop) {
|
|
94
93
|
margin-left: govuk-spacing(1);
|
|
95
94
|
}
|
|
95
|
+
|
|
96
96
|
&:hover {
|
|
97
97
|
border-color: transparent;
|
|
98
98
|
}
|
|
@@ -100,20 +100,19 @@
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
.moj-header__link a {
|
|
103
|
-
vertical-align: text-bottom;
|
|
104
103
|
margin-bottom: 1px;
|
|
104
|
+
vertical-align: text-bottom;
|
|
105
105
|
|
|
106
106
|
&:hover {
|
|
107
107
|
border-color: govuk-colour("white");
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
@include govuk-media-query($until: desktop) {
|
|
111
|
-
vertical-align: middle;
|
|
112
111
|
margin-bottom: -1px;
|
|
112
|
+
vertical-align: middle;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
// stylelint-disable-next-line selector-no-qualifying-type
|
|
117
116
|
span.moj-header__link {
|
|
118
117
|
&:hover {
|
|
119
118
|
border-color: transparent;
|
|
@@ -122,15 +121,15 @@ span.moj-header__link {
|
|
|
122
121
|
|
|
123
122
|
// Navigation
|
|
124
123
|
.moj-header__navigation {
|
|
124
|
+
margin-top: govuk-spacing(1) - 2px;
|
|
125
125
|
color: govuk-colour("white");
|
|
126
|
-
margin-top: govuk-spacing(1)-2px;
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
.moj-header__navigation-list {
|
|
130
|
-
font-size: 0; // Removes white space when using inline-block on child element.
|
|
131
|
-
list-style: none;
|
|
132
129
|
margin: 0;
|
|
133
130
|
padding: 0;
|
|
131
|
+
font-size: 0; // Removes white space when using inline-block on child element.
|
|
132
|
+
list-style: none;
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
.moj-header__navigation-item {
|
|
@@ -141,7 +140,6 @@ span.moj-header__link {
|
|
|
141
140
|
&:last-child {
|
|
142
141
|
margin-right: 0;
|
|
143
142
|
}
|
|
144
|
-
|
|
145
143
|
}
|
|
146
144
|
|
|
147
145
|
.moj-header__navigation-link {
|
|
@@ -156,15 +154,15 @@ span.moj-header__link {
|
|
|
156
154
|
}
|
|
157
155
|
|
|
158
156
|
&:hover {
|
|
157
|
+
// stylelint-disable-next-line declaration-no-important
|
|
159
158
|
text-decoration: underline !important;
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
&:focus {
|
|
163
162
|
color: govuk-colour("black");
|
|
164
163
|
}
|
|
165
|
-
|
|
166
164
|
}
|
|
167
165
|
|
|
168
|
-
.moj-header__navigation-link[aria-current=page] {
|
|
166
|
+
.moj-header__navigation-link[aria-current="page"] {
|
|
169
167
|
text-decoration: none;
|
|
170
168
|
}
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
.moj-identity-bar {
|
|
6
6
|
@include govuk-clearfix;
|
|
7
|
+
padding-top: govuk-spacing(2);
|
|
8
|
+
padding-bottom: govuk-spacing(2) - 1px; /* Negative by 1px to compensate */
|
|
9
|
+
color: govuk-colour("black");
|
|
7
10
|
background-color: govuk-colour("white");
|
|
8
11
|
box-shadow: inset 0 -1px 0 0 govuk-colour("mid-grey"); /* Takes up no space */
|
|
9
|
-
color: govuk-colour("black");
|
|
10
|
-
padding-bottom: govuk-spacing(2) - 1px; /* Negative by 1px to compensate */
|
|
11
|
-
padding-top: govuk-spacing(2);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.moj-identity-bar__container {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
font-size: 0; /* Hide whitespace between elements */
|
|
17
17
|
text-align: justify; /* Trick to remove the need for floats */
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
&::after {
|
|
20
20
|
content: "";
|
|
21
21
|
display: inline-block;
|
|
22
22
|
width: 100%;
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
|
|
37
37
|
@include govuk-media-query($from: tablet) {
|
|
38
38
|
display: inline-block;
|
|
39
|
-
vertical-align: top;
|
|
40
39
|
padding-top: govuk-spacing(2) + 1px; /* Alignment tweaks */
|
|
41
40
|
padding-bottom: govuk-spacing(2) - 1px; /* Alignment tweaks */
|
|
41
|
+
vertical-align: top;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
.moj-interruption-card {
|
|
2
|
-
background-color: govuk-colour("blue");
|
|
3
2
|
margin-bottom: govuk-spacing(3);
|
|
4
|
-
@include govuk-responsive-padding(7, $adjustment: $govuk-border-width*-1);
|
|
5
3
|
border: $govuk-border-width solid transparent;
|
|
4
|
+
background-color: govuk-colour("blue");
|
|
5
|
+
@include govuk-responsive-padding(7, $adjustment: $govuk-border-width * -1);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.moj-interruption-card__content {
|
|
@@ -9,38 +9,37 @@
|
|
|
9
9
|
|
|
10
10
|
.moj-message-list {
|
|
11
11
|
min-height: 200px;
|
|
12
|
-
overflow-y: scroll;
|
|
13
|
-
overflow-x: hidden;
|
|
14
12
|
padding: govuk-spacing(1);
|
|
13
|
+
overflow-x: hidden;
|
|
14
|
+
overflow-y: scroll;
|
|
15
15
|
|
|
16
16
|
&__date {
|
|
17
17
|
@include govuk-font($size: 19, $weight: "bold");
|
|
18
|
+
display: inline-block;
|
|
19
|
+
width: 100%;
|
|
18
20
|
padding: govuk-spacing(3) 0;
|
|
19
21
|
color: govuk-colour("dark-grey");
|
|
20
|
-
display: inline-block;
|
|
21
22
|
text-align: center;
|
|
22
|
-
width: 100%;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
.moj-message-item {
|
|
28
|
-
|
|
27
|
+
position: relative;
|
|
29
28
|
margin-bottom: govuk-spacing(1);
|
|
30
29
|
padding: govuk-spacing(3);
|
|
31
|
-
|
|
30
|
+
border-radius: 0.5em 0.5em 0.75em;
|
|
32
31
|
|
|
33
32
|
@include govuk-media-query($from: tablet) {
|
|
34
33
|
width: 50%;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
&--sent {
|
|
38
|
-
color: govuk-colour("white");
|
|
39
|
-
background-color: $govuk-brand-colour;
|
|
40
37
|
margin-right: govuk-spacing(2);
|
|
41
38
|
padding-right: govuk-spacing(5);
|
|
42
|
-
text-align: right;
|
|
43
39
|
float: right;
|
|
40
|
+
color: govuk-colour("white");
|
|
41
|
+
background-color: $govuk-brand-colour;
|
|
42
|
+
text-align: right;
|
|
44
43
|
|
|
45
44
|
&::after {
|
|
46
45
|
content: "";
|
|
@@ -55,24 +54,22 @@
|
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
&--received {
|
|
58
|
-
background-color: govuk-colour("light-grey");
|
|
59
|
-
float: left;
|
|
60
57
|
margin-left: govuk-spacing(2);
|
|
61
58
|
padding-left: govuk-spacing(5);
|
|
59
|
+
float: left;
|
|
60
|
+
background-color: govuk-colour("light-grey");
|
|
62
61
|
|
|
63
62
|
&::after {
|
|
64
63
|
content: "";
|
|
65
64
|
position: absolute;
|
|
66
|
-
left: -1.5em;
|
|
67
65
|
bottom: 0;
|
|
66
|
+
left: -1.5em;
|
|
68
67
|
width: 1.5em;
|
|
69
68
|
height: 1.5em;
|
|
70
69
|
border-right: 1em solid govuk-colour("light-grey");
|
|
71
70
|
border-bottom-right-radius: 1.75em 1.5em;
|
|
72
71
|
}
|
|
73
|
-
|
|
74
72
|
}
|
|
75
|
-
|
|
76
73
|
}
|
|
77
74
|
|
|
78
75
|
.moj-message-item a:link,
|
|
@@ -85,7 +82,6 @@
|
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
.moj-message-item__text {
|
|
88
|
-
|
|
89
85
|
&--sent table {
|
|
90
86
|
color: govuk-colour("white");
|
|
91
87
|
|
|
@@ -93,9 +89,7 @@
|
|
|
93
89
|
& td {
|
|
94
90
|
border-bottom: 1px solid govuk-colour("white");
|
|
95
91
|
}
|
|
96
|
-
|
|
97
92
|
}
|
|
98
|
-
|
|
99
93
|
}
|
|
100
94
|
|
|
101
95
|
.moj-message-item__meta {
|
|
@@ -108,5 +102,4 @@
|
|
|
108
102
|
&--timestamp {
|
|
109
103
|
@include govuk-font($size: 16, $weight: "bold");
|
|
110
104
|
}
|
|
111
|
-
|
|
112
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
# Multi file upload
|
|
1
|
+
# Multi file upload
|
|
@@ -1,66 +1,70 @@
|
|
|
1
1
|
.moj-multi-file-upload {
|
|
2
|
-
|
|
2
|
+
margin-bottom: 40px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.moj-multi-file-upload--enhanced .moj-multi-file-upload__button {
|
|
6
|
-
|
|
6
|
+
display: none;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.moj-multi-file-upload__dropzone {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
display: flex;
|
|
11
|
+
padding: govuk-spacing(9) govuk-spacing(3);
|
|
12
|
+
transition:
|
|
13
|
+
outline-offset 0.1s ease-in-out,
|
|
14
|
+
background-color 0.1s linear;
|
|
15
|
+
outline: 3px dashed govuk-colour("black");
|
|
16
|
+
text-align: center;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
.moj-multi-file-upload__dropzone label {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
display: inline-block;
|
|
21
|
+
width: auto;
|
|
22
|
+
margin-bottom: 0;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
.moj-multi-file-upload__dropzone p {
|
|
24
|
-
margin-bottom: 0;
|
|
25
26
|
margin-right: 10px;
|
|
27
|
+
margin-bottom: 0;
|
|
26
28
|
padding-top: 7px;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
.moj-multi-file-upload__dropzone [type=file] {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
.moj-multi-file-upload__dropzone [type="file"] {
|
|
32
|
+
position: absolute;
|
|
33
|
+
left: -9999em;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
.moj-multi-file-upload--dragover {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
outline-color: #6f777b;
|
|
38
|
+
background: #b1b4b6;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
.moj-multi-file-upload--focused {
|
|
40
|
-
background-color: $govuk-focus-colour;
|
|
41
|
-
color: $govuk-focus-text-colour;
|
|
42
|
-
box-shadow: 0 -2px $govuk-focus-colour, 0 4px $govuk-focus-text-colour;
|
|
43
42
|
outline: none;
|
|
43
|
+
color: $govuk-focus-text-colour;
|
|
44
|
+
background-color: $govuk-focus-colour;
|
|
45
|
+
box-shadow:
|
|
46
|
+
0 -2px $govuk-focus-colour,
|
|
47
|
+
0 4px $govuk-focus-text-colour;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
.moj-multi-file-upload__error {
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
color: govuk-colour("red");
|
|
52
|
+
font-weight: bold;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
.moj-multi-file-upload__success {
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
color: govuk-colour("green");
|
|
57
|
+
font-weight: bold;
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
.moj-multi-file-upload__error svg {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
margin-right: govuk-spacing(2);
|
|
62
|
+
float: left;
|
|
63
|
+
fill: currentcolor;
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
.moj-multi-file-upload__success svg {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
+
margin-right: govuk-spacing(2);
|
|
68
|
+
float: left;
|
|
69
|
+
fill: currentcolor;
|
|
70
|
+
}
|