@ministryofjustice/frontend 0.2.4 → 1.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/README.md +6 -4
- package/moj/all.js +5 -1
- package/moj/assets/images/moj-apple-touch-icon-152x152.png +0 -0
- package/moj/assets/images/moj-apple-touch-icon-167x167.png +0 -0
- package/moj/assets/images/moj-apple-touch-icon-180x180.png +0 -0
- package/moj/assets/images/moj-apple-touch-icon.png +0 -0
- package/moj/assets/images/moj-opengraph-image.png +0 -0
- package/moj/components/add-another/_add-another.scss +3 -2
- package/moj/components/add-another/add-another.js +5 -1
- package/moj/components/filter/_filter.scss +1 -0
- package/moj/components/sub-navigation/template.njk +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
MOJ Frontend contains the code you need to start building user interfaces for UK Ministry of Justice government services.
|
|
8
8
|
|
|
9
|
-
See live examples of MOJ Frontend components, and guidance on when to use them in your service, in the [MOJ
|
|
9
|
+
See live examples of MOJ Frontend components, and guidance on when to use them in your service, in the [MOJ Pattern Library documentation](https://design-patterns.service.justice.gov.uk/).
|
|
10
10
|
|
|
11
11
|
## Contribution Guidelines
|
|
12
12
|
|
|
@@ -14,13 +14,15 @@ If you want to help us build MOJ Frontend, view our [contribution guidelines](CO
|
|
|
14
14
|
|
|
15
15
|
## Contact the team
|
|
16
16
|
|
|
17
|
-
MOJ Frontend is maintained by the
|
|
17
|
+
MOJ Frontend is maintained by staff in the Ministry of Justice. If you need support, you can use [GitHub discussions](https://github.com/ministryofjustice/moj-frontend/discussions) or one of our Slack channels:
|
|
18
|
+
- [#moj-pattern-library-support](https://mojdt.slack.com/archives/CH5RUSB27) on MOJ Digital & Technology
|
|
19
|
+
- [#moj-design-system channel](https://ukgovernmentdigital.slack.com/archives/CJ6QDRDGC) on UK Government Digital
|
|
18
20
|
|
|
19
21
|
## Quick start
|
|
20
22
|
|
|
21
|
-
We recommend [installing MOJ Frontend using node package manager (npm)](
|
|
23
|
+
We recommend [installing MOJ Frontend using node package manager (npm)](https://design-patterns.service.justice.gov.uk/get-started/installing-with-npm/).
|
|
22
24
|
|
|
23
|
-
Once installed, you will be able to use the code from the examples in the [MOJ
|
|
25
|
+
Once installed, you will be able to use the code from the examples in the [MOJ Pattern Library](https://design-patterns.service.justice.gov.uk/) in your service.
|
|
24
26
|
|
|
25
27
|
## Browser support
|
|
26
28
|
|
package/moj/all.js
CHANGED
|
@@ -174,9 +174,13 @@ MOJFrontend.AddAnother.prototype.getNewItem = function() {
|
|
|
174
174
|
|
|
175
175
|
MOJFrontend.AddAnother.prototype.updateAttributes = function(index, item) {
|
|
176
176
|
item.find('[data-name]').each(function(i, el) {
|
|
177
|
+
var originalId = el.id
|
|
178
|
+
|
|
177
179
|
el.name = $(el).attr('data-name').replace(/%index%/, index);
|
|
178
180
|
el.id = $(el).attr('data-id').replace(/%index%/, index);
|
|
179
|
-
|
|
181
|
+
|
|
182
|
+
var label = $(el).siblings('label')[0] || $(el).parents('label')[0] || item.find('[for="' + originalId + '"]')[0];
|
|
183
|
+
label.htmlFor = el.id;
|
|
180
184
|
});
|
|
181
185
|
};
|
|
182
186
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
&__title {
|
|
18
18
|
float: left;
|
|
19
|
-
padding: 4px 0;
|
|
19
|
+
padding: 4px 100px 4px 0;
|
|
20
20
|
width: 100%;
|
|
21
21
|
|
|
22
22
|
& + .govuk-form-group {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
position: absolute;
|
|
29
29
|
right: 0;
|
|
30
30
|
top: 0;
|
|
31
|
+
width: auto;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
&__add-button {
|
|
@@ -40,4 +41,4 @@
|
|
|
40
41
|
color: $govuk-focus-text-colour;
|
|
41
42
|
box-shadow: 0 -2px $govuk-focus-colour, 0 4px $govuk-focus-text-colour;
|
|
42
43
|
outline: none;
|
|
43
|
-
}
|
|
44
|
+
}
|
|
@@ -42,9 +42,13 @@ MOJFrontend.AddAnother.prototype.getNewItem = function() {
|
|
|
42
42
|
|
|
43
43
|
MOJFrontend.AddAnother.prototype.updateAttributes = function(index, item) {
|
|
44
44
|
item.find('[data-name]').each(function(i, el) {
|
|
45
|
+
var originalId = el.id
|
|
46
|
+
|
|
45
47
|
el.name = $(el).attr('data-name').replace(/%index%/, index);
|
|
46
48
|
el.id = $(el).attr('data-id').replace(/%index%/, index);
|
|
47
|
-
|
|
49
|
+
|
|
50
|
+
var label = $(el).siblings('label')[0] || $(el).parents('label')[0] || item.find('[for="' + originalId + '"]')[0];
|
|
51
|
+
label.htmlFor = el.id;
|
|
48
52
|
});
|
|
49
53
|
};
|
|
50
54
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<nav class="moj-sub-navigation {{- ' ' + params.classes if params.classes}}"
|
|
1
|
+
<nav class="moj-sub-navigation {{- ' ' + params.classes if params.classes}}" aria-label="{{ params.label or 'Secondary navigation region' }}" {%- for attribute, value in params.attributes -%} {{ attribute }}="{{ value }}"{% endfor %}>
|
|
2
2
|
|
|
3
3
|
<ul class="moj-sub-navigation__list">
|
|
4
4
|
|
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": "0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"main": "moj/all.js",
|
|
6
6
|
"sass": "moj/all.scss",
|
|
7
7
|
"engines": {
|