@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
package/moj/objects/_all.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
1
|
+
@forward "width-container";
|
|
2
|
+
@forward "filter-layout";
|
|
3
|
+
@forward "scrollable-pane";
|
|
4
|
+
@forward "button-group";
|
|
@@ -1,31 +1,112 @@
|
|
|
1
|
+
@use "../vendor/govuk-frontend" as *;
|
|
2
|
+
|
|
3
|
+
// Button groups can be used to group buttons and links together as a group.
|
|
4
|
+
//
|
|
5
|
+
// Within a button group:
|
|
6
|
+
//
|
|
7
|
+
// - links are styled to line up visually with the buttons, including being
|
|
8
|
+
// centre-aligned on mobile
|
|
9
|
+
// - spacing between the buttons and links is handled automatically, including
|
|
10
|
+
// when they wrap across multiple lines
|
|
1
11
|
.moj-button-group {
|
|
2
12
|
$horizontal-gap: govuk-spacing(3);
|
|
3
13
|
$vertical-gap: govuk-spacing(3);
|
|
14
|
+
$link-spacing: govuk-spacing(1);
|
|
15
|
+
|
|
16
|
+
// These need to be kept in sync with the button component's styles
|
|
4
17
|
$button-shadow-size: $govuk-border-width-form-element;
|
|
5
18
|
|
|
6
|
-
|
|
19
|
+
// Flexbox is used to center-align links on mobile, align everything along
|
|
20
|
+
// the baseline on tablet and above, and to removes extra whitespace that
|
|
21
|
+
// we'd get between the buttons and links because they're inline-blocks.
|
|
22
|
+
//
|
|
23
|
+
// Ideally we'd use `gap` with flexbox rather than having to do it all with
|
|
24
|
+
// margins, but unfortunately the support isn't there (yet) and @supports
|
|
25
|
+
// doesn't play nicely with it
|
|
26
|
+
// (https://github.com/w3c/csswg-drafts/issues/3559)
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: center;
|
|
30
|
+
|
|
31
|
+
@include govuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1);
|
|
32
|
+
|
|
33
|
+
// Give links within the button group the same font-size and line-height
|
|
34
|
+
// as buttons.
|
|
35
|
+
//
|
|
36
|
+
// Because we want the focus state to be tight around the link text, we use
|
|
37
|
+
// margins where the buttons would use padding.
|
|
38
|
+
.govuk-link {
|
|
39
|
+
display: inline-block;
|
|
40
|
+
// Prevent links overflowing their container in IE10/11 because of bug
|
|
41
|
+
// with align-items: center
|
|
42
|
+
max-width: 100%;
|
|
43
|
+
margin-top: $link-spacing;
|
|
44
|
+
margin-bottom: $link-spacing + $vertical-gap;
|
|
45
|
+
text-align: center;
|
|
46
|
+
@include govuk-font($size: 19, $line-height: 19px);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Reduce the bottom margin to the size of the vertical gap (accommodating
|
|
50
|
+
// the button shadow) – the 'lost' margin is moved to the button-group.
|
|
51
|
+
.govuk-button,
|
|
52
|
+
.moj-button-menu__item,
|
|
53
|
+
.js-enabled & .moj-button-menu {
|
|
54
|
+
margin-bottom: $vertical-gap + $button-shadow-size;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.moj-button-menu__toggle-button,
|
|
58
|
+
.js-enabled & .moj-button-menu__item {
|
|
59
|
+
margin-bottom: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Set button menu to full width on mobile to match GOV.UK Frontend
|
|
63
|
+
@include govuk-media-query($until: tablet) {
|
|
64
|
+
.moj-button-menu,
|
|
65
|
+
.moj-button-menu__wrapper,
|
|
66
|
+
.moj-button-menu__item {
|
|
67
|
+
width: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.moj-button-menu__wrapper {
|
|
71
|
+
position: relative;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// On tablet and above, we also introduce a 'column gap' between the
|
|
76
|
+
// buttons and links in each row and left align links
|
|
77
|
+
@mixin moj-button-group-inline() {
|
|
78
|
+
// Cancel out the column gap for the last item in each row
|
|
79
|
+
margin-right: ($horizontal-gap * -1);
|
|
7
80
|
|
|
8
|
-
&--inline {
|
|
9
81
|
flex-direction: row;
|
|
10
82
|
flex-wrap: wrap;
|
|
11
83
|
align-items: baseline;
|
|
12
|
-
gap: $horizontal-gap;
|
|
13
|
-
margin-right: 0;
|
|
14
84
|
|
|
85
|
+
.govuk-button,
|
|
86
|
+
.govuk-link,
|
|
15
87
|
.moj-button-menu {
|
|
16
|
-
|
|
88
|
+
width: auto;
|
|
89
|
+
margin-right: $horizontal-gap;
|
|
17
90
|
}
|
|
18
91
|
|
|
19
|
-
.moj-button-
|
|
20
|
-
|
|
92
|
+
.moj-button-menu__toggle-button {
|
|
93
|
+
margin-right: 0;
|
|
21
94
|
}
|
|
22
95
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
> .govuk-link {
|
|
26
|
-
width: auto;
|
|
27
|
-
margin-right: 0;
|
|
28
|
-
margin-bottom: 0;
|
|
96
|
+
.govuk-link {
|
|
97
|
+
text-align: left;
|
|
29
98
|
}
|
|
30
99
|
}
|
|
100
|
+
|
|
101
|
+
// Inline buttons on mobile (optional)
|
|
102
|
+
&--inline {
|
|
103
|
+
@include govuk-media-query($until: tablet) {
|
|
104
|
+
@include moj-button-group-inline;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Inline buttons on tablet and desktop
|
|
109
|
+
@include govuk-media-query($from: tablet) {
|
|
110
|
+
@include moj-button-group-inline;
|
|
111
|
+
}
|
|
31
112
|
}
|
package/moj/settings/_all.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
1
|
+
@forward "assets";
|
|
2
|
+
@forward "measurements";
|
|
3
|
+
@forward "colours";
|
|
4
|
+
@forward "typography";
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
#ASSETS
|
|
3
3
|
========================================================================== */
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// Path to the assets directory, with trailing slash.
|
|
6
6
|
$moj-assets-path: "/assets/" !default;
|
|
7
7
|
|
|
8
|
-
// Path the images folder
|
|
8
|
+
// Path to the images folder, with trailing slash.
|
|
9
9
|
$moj-images-path: "#{$moj-assets-path}images/" !default;
|
|
10
|
+
|
|
11
|
+
// Path to the fonts folder, with trailing slash.
|
|
12
|
+
$moj-fonts-path: "#{$moj-assets-path}fonts/" !default;
|
|
@@ -12,3 +12,8 @@ $moj-secondary-link-hover-color: rgb(23, 24, 25);
|
|
|
12
12
|
$moj-warning-colour: rgb(235, 97, 28);
|
|
13
13
|
// Links need higher contrast still so a modified orange for links
|
|
14
14
|
$moj-warning-link-colour: rgb(199, 82, 40);
|
|
15
|
+
|
|
16
|
+
// Custom colour required for passing WCAG 2.2 AA contrast text/background and
|
|
17
|
+
// background/surrounding
|
|
18
|
+
$moj-button-menu-color: #949494;
|
|
19
|
+
$moj-button-menu-hover-color: #767676;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
|
|
1
3
|
/* ==========================================================================
|
|
2
4
|
#MEASUREMENTS
|
|
3
5
|
========================================================================== */
|
|
@@ -9,4 +11,4 @@ $moj-page-width: 960px !default;
|
|
|
9
11
|
$moj-gutter: 30px !default;
|
|
10
12
|
|
|
11
13
|
// Width of half the gutter between grid columns
|
|
12
|
-
$moj-gutter-half: $moj-gutter
|
|
14
|
+
$moj-gutter-half: math.div($moj-gutter, 2);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
|
|
3
|
+
/* ==========================================================================
|
|
4
|
+
#TYPOGRAPHY
|
|
5
|
+
========================================================================== */
|
|
6
|
+
|
|
7
|
+
/// Font families to use for all typography on screen media
|
|
8
|
+
|
|
9
|
+
$moj-font-family: "GDS Transport", arial, sans-serif !default;
|
|
10
|
+
|
|
11
|
+
/// Exclude @font-face declarations already included in GOV.UK Frontend
|
|
12
|
+
|
|
13
|
+
$moj-include-default-font-face: false;
|
package/moj/utilities/_all.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
1
|
+
@forward "hidden";
|
|
2
|
+
@forward "width-container";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Declare all settings
|
|
2
|
+
@forward "../../settings/all";
|
|
3
|
+
|
|
4
|
+
// Use settings for overrides
|
|
5
|
+
@use "../../settings/all" as *;
|
|
6
|
+
|
|
7
|
+
// GOV.UK Frontend with settings
|
|
8
|
+
@forward "base" with (
|
|
9
|
+
// Assets override
|
|
10
|
+
$govuk-assets-path: $moj-assets-path,
|
|
11
|
+
$govuk-images-path: $moj-images-path,
|
|
12
|
+
$govuk-fonts-path: $moj-fonts-path,
|
|
13
|
+
|
|
14
|
+
// Measurements override
|
|
15
|
+
$govuk-gutter: $moj-gutter,
|
|
16
|
+
$govuk-page-width: $moj-page-width,
|
|
17
|
+
|
|
18
|
+
// Typography override
|
|
19
|
+
$govuk-font-family: $moj-font-family,
|
|
20
|
+
$govuk-include-default-font-face: $moj-include-default-font-face
|
|
21
|
+
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ministryofjustice/frontend",
|
|
3
3
|
"description": "The MOJ Frontend contains the code you need to start building user interfaces for UK Ministry of Justice government services.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.1",
|
|
5
5
|
"main": "moj/all.js",
|
|
6
6
|
"module": "moj/all.mjs",
|
|
7
7
|
"sass": "moj/all.scss",
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"default": "./moj/all.js"
|
|
14
14
|
},
|
|
15
15
|
"./*": "./*",
|
|
16
|
+
"./moj/filters/*": "./moj/filters/*.js",
|
|
17
|
+
"./moj/filters/*.js": "./moj/filters/*.js",
|
|
16
18
|
"./package.json": "./package.json"
|
|
17
19
|
},
|
|
18
20
|
"sideEffects": false,
|