@ministryofjustice/frontend 2.0.0-beta.0 → 2.0.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.
Files changed (92) hide show
  1. package/README.md +1 -2
  2. package/moj/all.jquery.min.js +1 -1
  3. package/moj/all.js +85 -85
  4. package/moj/all.scss +2 -0
  5. package/moj/assets/images/icon-alert-information.svg +0 -0
  6. package/moj/assets/images/icon-alert-success.svg +0 -0
  7. package/moj/assets/images/icon-alert-warning.svg +0 -0
  8. package/moj/assets/images/icon-arrow-black-down.svg +0 -0
  9. package/moj/assets/images/icon-arrow-black-up.svg +0 -0
  10. package/moj/assets/images/icon-arrow-white-down.svg +0 -0
  11. package/moj/assets/images/icon-arrow-white-up.svg +0 -0
  12. package/moj/assets/images/icon-close-cross-black.svg +0 -0
  13. package/moj/assets/images/icon-document.png +0 -0
  14. package/moj/assets/images/icon-document.svg +0 -0
  15. package/moj/assets/images/icon-progress-tick.png +0 -0
  16. package/moj/assets/images/icon-progress-tick.svg +0 -0
  17. package/moj/assets/images/icon-search-white.svg +0 -0
  18. package/moj/assets/images/icon-tag-remove-cross-white.svg +0 -0
  19. package/moj/assets/images/icon-tag-remove-cross.svg +0 -0
  20. package/moj/assets/images/icon-toggle-plus-minus.svg +0 -0
  21. package/moj/assets/images/icon-wysiwyg-bold.svg +0 -0
  22. package/moj/assets/images/icon-wysiwyg-italic.svg +0 -0
  23. package/moj/assets/images/icon-wysiwyg-ordered-list.svg +0 -0
  24. package/moj/assets/images/icon-wysiwyg-underline.svg +0 -0
  25. package/moj/assets/images/icon-wysiwyg-unordered-list.svg +0 -0
  26. package/moj/assets/images/moj-apple-touch-icon-152x152.png +0 -0
  27. package/moj/assets/images/moj-apple-touch-icon-167x167.png +0 -0
  28. package/moj/assets/images/moj-apple-touch-icon-180x180.png +0 -0
  29. package/moj/assets/images/moj-apple-touch-icon.png +0 -0
  30. package/moj/assets/images/moj-logotype-crest.png +0 -0
  31. package/moj/assets/images/moj-logotype-crest.svg +0 -0
  32. package/moj/assets/images/moj-opengraph-image.png +0 -0
  33. package/moj/components/_all.scss +0 -0
  34. package/moj/components/add-another/README.md +0 -0
  35. package/moj/components/add-another/_add-another.scss +0 -0
  36. package/moj/components/add-another/add-another.js +0 -0
  37. package/moj/components/cookie-banner/README.md +0 -0
  38. package/moj/components/cookie-banner/_cookie-banner.scss +2 -0
  39. package/moj/components/form-validator/README.md +0 -0
  40. package/moj/components/form-validator/form-validator.js +0 -0
  41. package/moj/components/pagination/README.md +0 -0
  42. package/moj/components/pagination/_pagination.scss +0 -0
  43. package/moj/components/pagination/macro.njk +0 -0
  44. package/moj/components/pagination/template.njk +0 -0
  45. package/moj/components/progress-bar/README.md +0 -0
  46. package/moj/components/progress-bar/_progress-bar.scss +1 -19
  47. package/moj/components/progress-bar/macro.njk +0 -0
  48. package/moj/components/progress-bar/template.njk +0 -0
  49. package/moj/components/rich-text-editor/README.md +0 -0
  50. package/moj/components/rich-text-editor/_rich-text-editor.scss +0 -0
  51. package/moj/components/rich-text-editor/rich-text-editor.js +0 -0
  52. package/moj/components/search/README.md +0 -0
  53. package/moj/components/search/_search.scss +0 -0
  54. package/moj/components/search/macro.njk +0 -0
  55. package/moj/components/search/template.njk +0 -0
  56. package/moj/components/search-toggle/README.md +0 -0
  57. package/moj/components/sortable-table/README.md +0 -0
  58. package/moj/components/sortable-table/_sortable-table.scss +0 -0
  59. package/moj/components/sortable-table/sortable-table.js +0 -0
  60. package/moj/components/sub-navigation/README.md +0 -0
  61. package/moj/components/sub-navigation/_sub-navigation.scss +0 -6
  62. package/moj/components/sub-navigation/macro.njk +0 -0
  63. package/moj/components/sub-navigation/template.njk +0 -0
  64. package/moj/components/ticket-panel/README.md +0 -0
  65. package/moj/components/ticket-panel/_ticket-panel.scss +0 -0
  66. package/moj/components/ticket-panel/macro.njk +0 -0
  67. package/moj/components/ticket-panel/template.njk +0 -0
  68. package/moj/components/timeline/README.md +0 -0
  69. package/moj/components/timeline/_timeline.scss +0 -6
  70. package/moj/components/timeline/macro.njk +0 -0
  71. package/moj/components/timeline/template.njk +0 -0
  72. package/moj/helpers/_all.scss +0 -1
  73. package/moj/helpers/_hidden.scss +0 -0
  74. package/moj/helpers.js +0 -0
  75. package/moj/namespace.js +0 -0
  76. package/moj/objects/_all.scss +0 -0
  77. package/moj/objects/_filter-layout.scss +0 -0
  78. package/moj/objects/_scrollable-pane.scss +0 -0
  79. package/moj/objects/_width-container.scss +1 -5
  80. package/moj/settings/_all.scss +0 -1
  81. package/moj/settings/_assets.scss +0 -0
  82. package/moj/settings/_colours.scss +0 -0
  83. package/moj/settings/_measurements.scss +0 -0
  84. package/moj/utilities/_all.scss +0 -0
  85. package/moj/utilities/_hidden.scss +0 -0
  86. package/moj/utilities/_width-container.scss +0 -0
  87. package/moj/vendor/html5shiv.js +0 -0
  88. package/moj/vendor/jquery.js +0 -0
  89. package/package.json +1 -1
  90. package/moj/all-ie8.scss +0 -3
  91. package/moj/helpers/_ie8.scss +0 -5
  92. package/moj/settings/_ie8.scss +0 -1
package/moj/all.js CHANGED
@@ -369,6 +369,91 @@ MOJFrontend.ButtonMenu.prototype.focusPrevious = function(currentButton) {
369
369
  this.container.find('[role=menuitem]').last().focus();
370
370
  }
371
371
  };
372
+ MOJFrontend.FilterToggleButton = function(options) {
373
+ this.options = options;
374
+ this.container = this.options.toggleButton.container;
375
+ this.createToggleButton();
376
+ this.setupResponsiveChecks();
377
+ this.options.filter.container.attr('tabindex', '-1');
378
+ if(this.options.startHidden) {
379
+ this.hideMenu();
380
+ }
381
+ };
382
+
383
+ MOJFrontend.FilterToggleButton.prototype.setupResponsiveChecks = function() {
384
+ this.mq = window.matchMedia(this.options.bigModeMediaQuery);
385
+ this.mq.addListener($.proxy(this, 'checkMode'));
386
+ this.checkMode(this.mq);
387
+ };
388
+
389
+ MOJFrontend.FilterToggleButton.prototype.createToggleButton = function() {
390
+ this.menuButton = $('<button class="govuk-button '+this.options.toggleButton.classes+'" type="button" aria-haspopup="true" aria-expanded="false">'+this.options.toggleButton.showText+'</button>');
391
+ this.menuButton.on('click', $.proxy(this, 'onMenuButtonClick'));
392
+ this.options.toggleButton.container.append(this.menuButton);
393
+ };
394
+
395
+ MOJFrontend.FilterToggleButton.prototype.checkMode = function(mq) {
396
+ if(mq.matches) {
397
+ this.enableBigMode();
398
+ } else {
399
+ this.enableSmallMode();
400
+ }
401
+ };
402
+
403
+ MOJFrontend.FilterToggleButton.prototype.enableBigMode = function() {
404
+ this.showMenu();
405
+ this.removeCloseButton();
406
+ };
407
+
408
+ MOJFrontend.FilterToggleButton.prototype.enableSmallMode = function() {
409
+ this.hideMenu();
410
+ this.addCloseButton();
411
+ };
412
+
413
+ MOJFrontend.FilterToggleButton.prototype.addCloseButton = function() {
414
+ if(this.options.closeButton) {
415
+ this.closeButton = $('<button class="moj-filter__close" type="button">'+this.options.closeButton.text+'</button>');
416
+ this.closeButton.on('click', $.proxy(this, 'onCloseClick'));
417
+ this.options.closeButton.container.append(this.closeButton);
418
+ }
419
+ };
420
+
421
+ MOJFrontend.FilterToggleButton.prototype.onCloseClick = function() {
422
+ this.hideMenu();
423
+ this.menuButton.focus();
424
+ };
425
+
426
+ MOJFrontend.FilterToggleButton.prototype.removeCloseButton = function() {
427
+ if(this.closeButton) {
428
+ this.closeButton.remove();
429
+ this.closeButton = null;
430
+ }
431
+ };
432
+
433
+ MOJFrontend.FilterToggleButton.prototype.hideMenu = function() {
434
+ this.menuButton.attr('aria-expanded', 'false');
435
+ this.options.filter.container.addClass('moj-js-hidden');
436
+ this.menuButton.text(this.options.toggleButton.showText);
437
+ };
438
+
439
+ MOJFrontend.FilterToggleButton.prototype.showMenu = function() {
440
+ this.menuButton.attr('aria-expanded', 'true');
441
+ this.options.filter.container.removeClass('moj-js-hidden');
442
+ this.menuButton.text(this.options.toggleButton.hideText);
443
+ };
444
+
445
+ MOJFrontend.FilterToggleButton.prototype.onMenuButtonClick = function() {
446
+ this.toggle();
447
+ };
448
+
449
+ MOJFrontend.FilterToggleButton.prototype.toggle = function() {
450
+ if(this.menuButton.attr('aria-expanded') == 'false') {
451
+ this.showMenu();
452
+ this.options.filter.container.focus();
453
+ } else {
454
+ this.hideMenu();
455
+ }
456
+ };
372
457
  MOJFrontend.FormValidator = function(form, options) {
373
458
  this.form = form;
374
459
  this.errors = [];
@@ -525,91 +610,6 @@ MOJFrontend.FormValidator.prototype.validate = function() {
525
610
  }
526
611
  return this.errors.length === 0;
527
612
  };
528
- MOJFrontend.FilterToggleButton = function(options) {
529
- this.options = options;
530
- this.container = this.options.toggleButton.container;
531
- this.createToggleButton();
532
- this.setupResponsiveChecks();
533
- this.options.filter.container.attr('tabindex', '-1');
534
- if(this.options.startHidden) {
535
- this.hideMenu();
536
- }
537
- };
538
-
539
- MOJFrontend.FilterToggleButton.prototype.setupResponsiveChecks = function() {
540
- this.mq = window.matchMedia(this.options.bigModeMediaQuery);
541
- this.mq.addListener($.proxy(this, 'checkMode'));
542
- this.checkMode(this.mq);
543
- };
544
-
545
- MOJFrontend.FilterToggleButton.prototype.createToggleButton = function() {
546
- this.menuButton = $('<button class="govuk-button '+this.options.toggleButton.classes+'" type="button" aria-haspopup="true" aria-expanded="false">'+this.options.toggleButton.showText+'</button>');
547
- this.menuButton.on('click', $.proxy(this, 'onMenuButtonClick'));
548
- this.options.toggleButton.container.append(this.menuButton);
549
- };
550
-
551
- MOJFrontend.FilterToggleButton.prototype.checkMode = function(mq) {
552
- if(mq.matches) {
553
- this.enableBigMode();
554
- } else {
555
- this.enableSmallMode();
556
- }
557
- };
558
-
559
- MOJFrontend.FilterToggleButton.prototype.enableBigMode = function() {
560
- this.showMenu();
561
- this.removeCloseButton();
562
- };
563
-
564
- MOJFrontend.FilterToggleButton.prototype.enableSmallMode = function() {
565
- this.hideMenu();
566
- this.addCloseButton();
567
- };
568
-
569
- MOJFrontend.FilterToggleButton.prototype.addCloseButton = function() {
570
- if(this.options.closeButton) {
571
- this.closeButton = $('<button class="moj-filter__close" type="button">'+this.options.closeButton.text+'</button>');
572
- this.closeButton.on('click', $.proxy(this, 'onCloseClick'));
573
- this.options.closeButton.container.append(this.closeButton);
574
- }
575
- };
576
-
577
- MOJFrontend.FilterToggleButton.prototype.onCloseClick = function() {
578
- this.hideMenu();
579
- this.menuButton.focus();
580
- };
581
-
582
- MOJFrontend.FilterToggleButton.prototype.removeCloseButton = function() {
583
- if(this.closeButton) {
584
- this.closeButton.remove();
585
- this.closeButton = null;
586
- }
587
- };
588
-
589
- MOJFrontend.FilterToggleButton.prototype.hideMenu = function() {
590
- this.menuButton.attr('aria-expanded', 'false');
591
- this.options.filter.container.addClass('moj-js-hidden');
592
- this.menuButton.text(this.options.toggleButton.showText);
593
- };
594
-
595
- MOJFrontend.FilterToggleButton.prototype.showMenu = function() {
596
- this.menuButton.attr('aria-expanded', 'true');
597
- this.options.filter.container.removeClass('moj-js-hidden');
598
- this.menuButton.text(this.options.toggleButton.hideText);
599
- };
600
-
601
- MOJFrontend.FilterToggleButton.prototype.onMenuButtonClick = function() {
602
- this.toggle();
603
- };
604
-
605
- MOJFrontend.FilterToggleButton.prototype.toggle = function() {
606
- if(this.menuButton.attr('aria-expanded') == 'false') {
607
- this.showMenu();
608
- this.options.filter.container.focus();
609
- } else {
610
- this.hideMenu();
611
- }
612
- };
613
613
  if(MOJFrontend.dragAndDropSupported() && MOJFrontend.formDataSupported() && MOJFrontend.fileApiSupported()) {
614
614
  MOJFrontend.MultiFileUpload = function(params) {
615
615
  this.defaultParams = {
package/moj/all.scss CHANGED
@@ -1,3 +1,5 @@
1
+ @import "node_modules/govuk-frontend/dist/govuk/base";
2
+
1
3
  @import "settings/all";
2
4
  @import "helpers/all";
3
5
  @import "objects/all";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,5 @@
1
+ @import "node_modules/govuk-frontend/dist/govuk/objects/width-container";
2
+
1
3
  .moj-cookie-banner {
2
4
  display: none;
3
5
  @include govuk-font(16);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -15,13 +15,6 @@
15
15
  text-align: justify;
16
16
  vertical-align: top;
17
17
 
18
- // IE8 does not support the text justify approach for spacing
19
- @include govuk-if-ie8 {
20
- display: table;
21
- table-layout: fixed;
22
- width: 100%;
23
- }
24
-
25
18
  &::after {
26
19
  content: "";
27
20
  display: inline-block;
@@ -47,11 +40,6 @@
47
40
  text-align: center;
48
41
  vertical-align: top;
49
42
 
50
- // IE8 does not support the text justify approach for spacing
51
- @include govuk-if-ie8 {
52
- display: table-cell;
53
- }
54
-
55
43
  &:first-child,
56
44
  &:last-child {
57
45
  &::before {
@@ -91,7 +79,7 @@
91
79
  position: relative;
92
80
  background-color: govuk-colour("white");
93
81
  border: 6px solid govuk-colour("green");
94
- border-radius: 50%; // IE8 does not support border radius but we’re ok with that
82
+ border-radius: 50%;
95
83
  box-sizing: border-box;
96
84
  display: block;
97
85
  height: 32px;
@@ -105,12 +93,6 @@
105
93
  background-image: url(#{$moj-images-path}icon-progress-tick.svg);
106
94
  background-position: 50% 50%;
107
95
  background-repeat: no-repeat;
108
-
109
- // IE8 does not support box shadow, so use a standard border.
110
- @include govuk-if-ie8 {
111
- background-image: url(#{$moj-images-path}icon-progress-tick.png);
112
- }
113
-
114
96
  }
115
97
 
116
98
  .moj-progress-bar__label {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -17,12 +17,6 @@
17
17
  box-shadow: inset 0 -1px 0 $govuk-border-colour;
18
18
  width: 100%;
19
19
  }
20
-
21
- // IE8 does not support box shadow, so use a standard border.
22
- @include govuk-if-ie8 {
23
- border-bottom: 1px solid $govuk-border-colour;
24
- }
25
-
26
20
  }
27
21
 
28
22
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -106,10 +106,4 @@
106
106
  &:focus {
107
107
  color: govuk-colour("black"); // Focus colour on yellow should really be black.
108
108
  }
109
-
110
- // IE8 does not support box shadow, so use a standard border.
111
- @include govuk-if-ie8 {
112
- background-image: url(#{$moj-images-path}icon-document.png);
113
- }
114
-
115
109
  }
File without changes
File without changes
@@ -1,2 +1 @@
1
1
  @import "hidden";
2
- @import "ie8";
File without changes
package/moj/helpers.js CHANGED
File without changes
package/moj/namespace.js CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -2,10 +2,6 @@
2
2
  // Limit the width of the container to the page width
3
3
  max-width: $width;
4
4
 
5
- @include govuk-if-ie8 {
6
- width: $width;
7
- }
8
-
9
5
  // On mobile, add half width gutters
10
6
  margin: 0 $moj-gutter-half;
11
7
 
@@ -19,4 +15,4 @@
19
15
  @include govuk-media-query($and: "(min-width: #{($width + $moj-gutter * 2)})") {
20
16
  margin: 0 auto;
21
17
  }
22
- }
18
+ }
@@ -1,4 +1,3 @@
1
1
  @import "assets";
2
- @import "ie8";
3
2
  @import "measurements";
4
3
  @import "colours";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
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": "2.0.0-beta.0",
4
+ "version": "2.0.0",
5
5
  "main": "moj/all.js",
6
6
  "sass": "moj/all.scss",
7
7
  "engines": {
package/moj/all-ie8.scss DELETED
@@ -1,3 +0,0 @@
1
- $govuk-is-ie8: true;
2
-
3
- @import "all";
@@ -1,5 +0,0 @@
1
- @mixin govuk-if-ie8 {
2
- @if $govuk-is-ie8 {
3
- @content;
4
- }
5
- }
@@ -1 +0,0 @@
1
- $govuk-is-ie8: false !default;