@ministryofjustice/frontend 3.7.0 → 4.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/govuk-prototype-kit.config.json +44 -32
- package/moj/_base.scss +8 -0
- package/moj/all.jquery.min.js +1 -1
- package/moj/all.jquery.min.js.map +1 -1
- package/moj/all.js +7 -7
- package/moj/all.js.map +1 -1
- package/moj/all.scss +4 -9
- package/moj/components/_all.scss +33 -33
- package/moj/components/action-bar/_action-bar.scss +2 -0
- package/moj/components/add-another/_add-another.scss +2 -0
- package/moj/components/alert/_alert.scss +18 -15
- package/moj/components/alert/template.njk +1 -1
- package/moj/components/badge/README.md +1 -1
- package/moj/components/badge/_badge.scss +3 -1
- package/moj/components/badge/macro.njk +1 -1
- package/moj/components/banner/README.md +3 -0
- package/moj/components/banner/_banner.scss +3 -1
- package/moj/components/button-menu/README.md +2 -2
- package/moj/components/button-menu/_button-menu.scss +15 -18
- package/moj/components/button-menu/template.njk +7 -9
- package/moj/components/cookie-banner/_cookie-banner.scss +3 -2
- package/moj/components/currency-input/README.md +4 -4
- package/moj/components/currency-input/_currency-input.scss +3 -1
- package/moj/components/date-picker/README.md +1 -1
- package/moj/components/date-picker/_date-picker.scss +11 -12
- package/moj/components/filter/_filter.scss +7 -4
- package/moj/components/form-validator/README.md +2 -4
- package/moj/components/header/README.md +1 -1
- package/moj/components/header/_header.scss +9 -6
- package/moj/components/header/template.njk +2 -2
- package/moj/components/identity-bar/_identity-bar.scss +5 -2
- package/moj/components/interruption-card/_interruption-card.scss +3 -1
- package/moj/components/messages/README.md +15 -10
- package/moj/components/messages/_messages.scss +4 -2
- package/moj/components/multi-file-upload/_multi-file-upload.scss +2 -0
- package/moj/components/multi-file-upload/multi-file-upload.js +6 -6
- package/moj/components/multi-file-upload/multi-file-upload.js.map +1 -1
- package/moj/components/multi-file-upload/multi-file-upload.mjs +6 -6
- package/moj/components/multi-file-upload/multi-file-upload.mjs.map +1 -1
- package/moj/components/notification-badge/_notification-badge.scss +3 -2
- package/moj/components/organisation-switcher/_organisation-switcher.scss +3 -1
- package/moj/components/page-header-actions/_page-header-actions.scss +2 -0
- package/moj/components/pagination/_pagination.scss +13 -5
- package/moj/components/password-reveal/README.md +2 -2
- package/moj/components/password-reveal/_password-reveal.scss +2 -0
- package/moj/components/primary-navigation/README.md +1 -1
- package/moj/components/primary-navigation/_primary-navigation.scss +14 -5
- package/moj/components/progress-bar/_progress-bar.scss +5 -2
- package/moj/components/rich-text-editor/README.md +4 -4
- package/moj/components/rich-text-editor/_rich-text-editor.scss +3 -0
- package/moj/components/search/_search.scss +2 -0
- package/moj/components/search-toggle/search-toggle.scss +3 -1
- package/moj/components/side-navigation/README.md +1 -1
- package/moj/components/side-navigation/_side-navigation.scss +3 -1
- package/moj/components/sortable-table/_sortable-table.scss +2 -0
- package/moj/components/sub-navigation/README.md +1 -1
- package/moj/components/sub-navigation/_sub-navigation.scss +12 -4
- package/moj/components/tag/README.md +2 -2
- package/moj/components/tag/_tag.scss +2 -0
- package/moj/components/task-list/README.md +3 -3
- package/moj/components/task-list/_task-list.scss +4 -2
- package/moj/components/ticket-panel/README.md +1 -1
- package/moj/components/ticket-panel/_ticket-panel.scss +2 -0
- package/moj/components/timeline/README.md +15 -10
- package/moj/components/timeline/_timeline.scss +7 -4
- package/moj/helpers/_all.scss +2 -2
- package/moj/helpers/_links.scss +4 -2
- package/moj/moj-frontend.min.css +1 -2
- package/moj/moj-frontend.min.css.map +1 -1
- package/moj/moj-frontend.min.js +1 -1
- package/moj/moj-frontend.min.js.map +1 -1
- package/moj/objects/_all.scss +4 -4
- package/moj/objects/_button-group.scss +94 -13
- package/moj/objects/_filter-layout.scss +2 -0
- package/moj/objects/_scrollable-pane.scss +2 -0
- package/moj/objects/_width-container.scss +3 -0
- package/moj/settings/_all.scss +4 -3
- package/moj/settings/_assets.scss +5 -2
- package/moj/settings/_colours.scss +5 -0
- package/moj/settings/_measurements.scss +3 -1
- package/moj/settings/_typography.scss +13 -0
- package/moj/utilities/_all.scss +2 -2
- package/moj/utilities/_hidden.scss +2 -0
- package/moj/utilities/_width-container.scss +2 -0
- package/moj/vendor/govuk-frontend/_base.scss +5 -0
- package/moj/vendor/govuk-frontend/_index.scss +21 -0
- package/package.json +3 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Rich text editor
|
|
1
|
+
# Rich text editor (Archived)
|
|
2
2
|
|
|
3
|
-
- [Guidance](https://design-patterns.service.justice.gov.uk/
|
|
3
|
+
- [Guidance](https://design-patterns.service.justice.gov.uk/archive/rich-text-editor)
|
|
4
4
|
|
|
5
5
|
## Example
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```html
|
|
8
8
|
<script>
|
|
9
9
|
new MOJFrontend.RichTextEditor({
|
|
10
10
|
textarea: $('.js-editor'),
|
|
11
11
|
toolbar: { 'bold': true, 'italic': true, 'underline': true, 'bullets': true, 'numbers': true }
|
|
12
|
-
})
|
|
12
|
+
})
|
|
13
13
|
</script>
|
|
14
14
|
```
|
|
15
15
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
@use "../../vendor/govuk-frontend" as *;
|
|
2
|
+
|
|
1
3
|
.moj-search-toggle__button {
|
|
2
|
-
@include govuk-font($size: 19, $weight: bold);
|
|
3
4
|
display: inline-block;
|
|
4
5
|
padding-top: 12px;
|
|
5
6
|
padding-right: 0;
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
-webkit-font-smoothing: antialiased;
|
|
13
14
|
-webkit-appearance: none;
|
|
14
15
|
appearance: none;
|
|
16
|
+
@include govuk-font($size: 19, $weight: bold);
|
|
15
17
|
|
|
16
18
|
&__icon {
|
|
17
19
|
display: inline-block;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "../../vendor/govuk-frontend" as *;
|
|
2
|
+
|
|
1
3
|
/* ==========================================================================
|
|
2
4
|
#SIDE NAVIGATION
|
|
3
5
|
========================================================================== */
|
|
@@ -17,12 +19,12 @@
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
.moj-side-navigation__title {
|
|
20
|
-
@include govuk-font($size: 19);
|
|
21
22
|
margin: 0;
|
|
22
23
|
padding: govuk-spacing(2);
|
|
23
24
|
padding-left: govuk-spacing(2) + 4px;
|
|
24
25
|
color: govuk-colour("dark-grey");
|
|
25
26
|
font-weight: normal;
|
|
27
|
+
@include govuk-font($size: 19);
|
|
26
28
|
|
|
27
29
|
@include govuk-media-query($until: tablet) {
|
|
28
30
|
display: none;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "../../vendor/govuk-frontend" as *;
|
|
2
|
+
|
|
1
3
|
/* ==========================================================================
|
|
2
4
|
#SECONDARY NAV
|
|
3
5
|
========================================================================== */
|
|
@@ -19,10 +21,10 @@
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.moj-sub-navigation__item {
|
|
22
|
-
@include govuk-font(19);
|
|
23
24
|
display: block;
|
|
24
25
|
margin-top: -1px;
|
|
25
26
|
box-shadow: inset 0 -1px 0 $govuk-border-colour;
|
|
27
|
+
@include govuk-font(19);
|
|
26
28
|
|
|
27
29
|
&:last-child {
|
|
28
30
|
box-shadow: none;
|
|
@@ -37,19 +39,25 @@
|
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
.moj-sub-navigation__link {
|
|
40
|
-
@include govuk-link-common;
|
|
41
|
-
@include govuk-link-style-default;
|
|
42
42
|
display: block;
|
|
43
43
|
position: relative;
|
|
44
44
|
padding-top: 12px;
|
|
45
45
|
padding-bottom: 12px;
|
|
46
46
|
padding-left: govuk-spacing(3);
|
|
47
|
-
|
|
47
|
+
@include govuk-link-common;
|
|
48
|
+
@include govuk-link-style-default;
|
|
48
49
|
|
|
49
50
|
@include govuk-media-query($from: tablet) {
|
|
50
51
|
padding-left: 0;
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
&:link,
|
|
55
|
+
&:visited,
|
|
56
|
+
&:hover,
|
|
57
|
+
&:active {
|
|
58
|
+
text-decoration: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
53
61
|
&:link,
|
|
54
62
|
&:visited {
|
|
55
63
|
color: $govuk-link-colour;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Task list
|
|
1
|
+
# Task list (Archived)
|
|
2
2
|
|
|
3
|
-
- [Guidance](https://design-patterns.service.justice.gov.uk/
|
|
3
|
+
- [Guidance](https://design-patterns.service.justice.gov.uk/archive/task-list)
|
|
4
4
|
|
|
5
5
|
## Example
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```njk
|
|
8
8
|
{{ mojTaskList({
|
|
9
9
|
sections: [
|
|
10
10
|
{
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "../../vendor/govuk-frontend" as *;
|
|
2
|
+
|
|
1
3
|
/* ==========================================================================
|
|
2
4
|
#TASK LIST
|
|
3
5
|
========================================================================== */
|
|
@@ -27,10 +29,10 @@
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
.moj-task-list__items {
|
|
30
|
-
@include govuk-font($size: 19);
|
|
31
|
-
@include govuk-responsive-margin(9, "bottom");
|
|
32
32
|
padding-left: 0;
|
|
33
33
|
list-style: none;
|
|
34
|
+
@include govuk-font($size: 19);
|
|
35
|
+
@include govuk-responsive-margin(9, "bottom");
|
|
34
36
|
@include govuk-media-query($from: tablet) {
|
|
35
37
|
padding-left: govuk-spacing(6);
|
|
36
38
|
}
|
|
@@ -4,22 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
### Installation
|
|
6
6
|
|
|
7
|
-
You will need to install the
|
|
7
|
+
You will need to install the MoJ Frontend Nunjucks filters to use the `mojTimeline()` Nunjucks macro:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
mojFilters
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
1. Import the filters
|
|
10
|
+
|
|
11
|
+
```mjs
|
|
12
|
+
import mojFilters from '@ministryofjustice/frontend/moj/filters/all.js'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. Add the filters to your Nunjucks environment
|
|
16
|
+
|
|
17
|
+
```mjs
|
|
18
|
+
for (const [name, filter] of Object.entries(mojFilters())) {
|
|
19
|
+
nunjucksAppEnv.addFilter(name, filter)
|
|
20
|
+
}
|
|
21
|
+
```
|
|
17
22
|
|
|
18
23
|
## Example
|
|
19
24
|
|
|
20
25
|
Below is a typical example of the timeline component in use.
|
|
21
26
|
|
|
22
|
-
```
|
|
27
|
+
```njk
|
|
23
28
|
{{ mojTimeline({
|
|
24
29
|
items: [
|
|
25
30
|
{
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@use "../../settings/assets" as *;
|
|
2
|
+
@use "../../vendor/govuk-frontend" as *;
|
|
3
|
+
|
|
1
4
|
/* ==========================================================================
|
|
2
5
|
#TIMELINE
|
|
3
6
|
========================================================================== */
|
|
@@ -43,26 +46,26 @@
|
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
.moj-timeline__title {
|
|
46
|
-
@include govuk-font($size: 19, $weight: bold);
|
|
47
49
|
display: inline;
|
|
50
|
+
@include govuk-font($size: 19, $weight: bold);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.moj-timeline__byline {
|
|
51
|
-
@include govuk-font($size: 19);
|
|
52
54
|
display: inline;
|
|
53
55
|
margin: 0;
|
|
54
56
|
color: $govuk-secondary-text-colour;
|
|
57
|
+
@include govuk-font($size: 19);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
.moj-timeline__date {
|
|
58
|
-
@include govuk-font($size: 16);
|
|
59
61
|
margin-top: govuk-spacing(1);
|
|
60
62
|
margin-bottom: 0;
|
|
63
|
+
@include govuk-font($size: 16);
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
.moj-timeline__description {
|
|
64
|
-
@include govuk-font($size: 19);
|
|
65
67
|
margin-top: govuk-spacing(4);
|
|
68
|
+
@include govuk-font($size: 19);
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
/* ==========================================================================
|
package/moj/helpers/_all.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward "hidden";
|
|
2
|
+
@forward "links";
|
package/moj/helpers/_links.scss
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "sass:color";
|
|
2
|
+
@use "../settings/colours" as *;
|
|
3
|
+
@use "../vendor/govuk-frontend" as *;
|
|
2
4
|
|
|
3
5
|
@mixin moj-link-style-warning {
|
|
4
6
|
&:link,
|
|
@@ -7,7 +9,7 @@
|
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
&:hover {
|
|
10
|
-
color: scale
|
|
12
|
+
color: color.scale($moj-warning-link-colour, $lightness: -30%);
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
&:active {
|