govuk_publishing_components 21.56.2 → 21.60.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -6
  3. data/app/assets/javascripts/component_guide/accessibility-test.js +21 -21
  4. data/app/assets/javascripts/component_guide/filter-components.js +19 -19
  5. data/app/assets/javascripts/component_guide/visual-regression.js +38 -37
  6. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +2 -2
  7. data/app/assets/javascripts/govuk_publishing_components/components/details.js +6 -4
  8. data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +14 -0
  9. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +4 -4
  10. data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +31 -0
  11. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +24 -24
  12. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +17 -17
  13. data/app/assets/stylesheets/component_guide/application.scss +15 -15
  14. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +9 -11
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +4 -0
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +5 -8
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +0 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +4 -5
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +3 -8
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -1
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +5 -8
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +1 -0
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +52 -0
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +4 -0
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +2 -2
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -3
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +0 -5
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -4
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -12
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +21 -24
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +4 -8
  35. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +2 -0
  36. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -4
  37. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +2 -4
  38. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -0
  39. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +2 -0
  40. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -0
  41. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
  42. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +2 -0
  43. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -1
  44. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +7 -1
  45. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss +0 -4
  46. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -10
  47. data/app/controllers/govuk_publishing_components/audit_controller.rb +52 -0
  48. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +2 -1
  49. data/app/models/govuk_publishing_components/audit_applications.rb +105 -0
  50. data/app/models/govuk_publishing_components/audit_comparer.rb +185 -0
  51. data/app/models/govuk_publishing_components/audit_components.rb +158 -0
  52. data/app/views/govuk_publishing_components/audit/show.html.erb +229 -0
  53. data/app/views/govuk_publishing_components/component_guide/index.html.erb +9 -4
  54. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
  55. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  56. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +3 -1
  57. data/app/views/govuk_publishing_components/components/_list.html.erb +26 -0
  58. data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -1
  59. data/app/views/govuk_publishing_components/components/_print_link.html.erb +27 -0
  60. data/app/views/govuk_publishing_components/components/_radio.html.erb +13 -5
  61. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +2 -2
  62. data/app/views/govuk_publishing_components/components/docs/action_link.yml +5 -0
  63. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +4 -0
  64. data/app/views/govuk_publishing_components/components/docs/heading.yml +6 -3
  65. data/app/views/govuk_publishing_components/components/docs/list.yml +64 -0
  66. data/app/views/govuk_publishing_components/components/docs/print_link.yml +24 -0
  67. data/app/views/govuk_publishing_components/components/docs/radio.yml +4 -0
  68. data/config/locales/en.yml +2 -0
  69. data/config/routes.rb +1 -0
  70. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +15 -7
  71. data/lib/govuk_publishing_components/presenters/heading_helper.rb +21 -1
  72. data/lib/govuk_publishing_components/version.rb +1 -1
  73. data/node_modules/axe-core/package.json +145 -220
  74. data/node_modules/govuk-frontend/package.json +14 -81
  75. data/node_modules/jquery/package.json +44 -116
  76. metadata +50 -66
  77. data/Rakefile +0 -32
@@ -1 +1,5 @@
1
1
  @import "govuk/components/radios/radios";
2
+
3
+ .gem-c-radio__heading-text {
4
+ margin: 0;
5
+ }
@@ -24,7 +24,7 @@
24
24
  margin-bottom: govuk-spacing(2);
25
25
  }
26
26
 
27
- .gem-c-related-navigation__main-heading + .gem-c-related-navigation__sub-heading {
27
+ .gem-c-related-navigation__main-heading + .gem-c-related-navigation__sub-heading {
28
28
  border-top: 0;
29
29
  padding-top: 0;
30
30
  }
@@ -62,7 +62,7 @@
62
62
 
63
63
  .js-enabled & {
64
64
  display: inline-block;
65
- }
65
+ }
66
66
  }
67
67
 
68
68
  .gem-c-related-navigation__section-link {
@@ -9,6 +9,7 @@ $large-input-size: 50px;
9
9
  .gem-c-search__label {
10
10
  @include govuk-font($size: 19, $line-height: $input-size);
11
11
  display: block;
12
+ background: govuk-colour("white");
12
13
 
13
14
  h1 {
14
15
  @include govuk-font($size: 19, $line-height: $input-size);
@@ -17,8 +18,10 @@ $large-input-size: 50px;
17
18
 
18
19
  .js-enabled & {
19
20
  position: absolute;
20
- left: govuk-spacing(3);
21
- top: 1px;
21
+ left: 2px;
22
+ top: 2px;
23
+ bottom: 2px;
24
+ padding-left: govuk-spacing(3);
22
25
  z-index: 1;
23
26
  color: $govuk-secondary-text-colour;
24
27
  }
@@ -157,7 +160,6 @@ $large-input-size: 50px;
157
160
  }
158
161
 
159
162
  .gem-c-search--on-white {
160
-
161
163
  .gem-c-search__submit {
162
164
  background-color: govuk-colour("blue");
163
165
  color: govuk-colour("white");
@@ -201,6 +203,8 @@ $large-input-size: 50px;
201
203
  .gem-c-search--separate-label {
202
204
  .gem-c-search__label {
203
205
  position: relative;
206
+ top: auto;
204
207
  left: auto;
208
+ padding-left: 0;
205
209
  }
206
210
  }
@@ -11,16 +11,11 @@
11
11
  }
12
12
  }
13
13
 
14
- // scss-lint:disable SelectorFormat
15
-
16
14
  .gem-c-step-nav-header__part-of {
17
15
  @include govuk-font(19, $weight: bold);
18
16
  display: block;
19
17
  }
20
18
 
21
19
  .gem-c-step-nav-header__title {
22
- @extend %govuk-link;
23
20
  @include govuk-font(24, $weight: bold, $line-height: 1);
24
21
  }
25
-
26
- // scss-lint:enable SelectorFormat
@@ -12,6 +12,7 @@
12
12
 
13
13
  .gem-c-step-nav-related__links {
14
14
  @include govuk-font(16);
15
+ list-style: none;
15
16
  margin: 0;
16
17
  padding: 0;
17
18
  }
@@ -42,10 +43,6 @@
42
43
  }
43
44
  }
44
45
 
45
- .gem-c-step-nav-related__links {
46
- list-style: none;
47
- }
48
-
49
46
  .gem-c-step-nav-related__link-item {
50
47
  margin-top: govuk-spacing(3);
51
48
  }
@@ -29,7 +29,7 @@ $top-border: solid 2px govuk-colour("mid-grey", $legacy: "grey-3");
29
29
  // we want to ensure that both large and small step navs have the same size font on mobile
30
30
  // this will stop text resizing if compatibility mode is turned off
31
31
  @mixin step-nav-font($size, $tablet-size: $size, $weight: normal, $line-height: 1.3, $tablet-line-height: $line-height) {
32
- @include govuk-typography-common();
32
+ @include govuk-typography-common;
33
33
  font-size: $size + px;
34
34
  font-weight: $weight;
35
35
  line-height: $line-height;
@@ -122,7 +122,7 @@ $top-border: solid 2px govuk-colour("mid-grey", $legacy: "grey-3");
122
122
  @include govuk-media-query($from: tablet) {
123
123
  padding-left: govuk-spacing(9);
124
124
 
125
- &:after {
125
+ &:after { // stylelint-disable-line max-nesting-depth
126
126
  @include step-nav-line-position-large;
127
127
  top: govuk-spacing(6);
128
128
  }
@@ -145,12 +145,8 @@ $top-border: solid 2px govuk-colour("mid-grey", $legacy: "grey-3");
145
145
  }
146
146
 
147
147
  &:after {
148
- // scss-lint:disable DuplicateProperty
149
- // sass-lint:disable no-duplicate-properties
150
148
  height: -webkit-calc(100% - #{govuk-spacing(3)}); // fallback for iphone 4
151
149
  height: calc(100% - #{govuk-spacing(3)});
152
- // sass-lint:enable no-duplicate-properties
153
- // scss-lint:enable DuplicateProperty
154
150
  }
155
151
 
156
152
  .gem-c-step-nav__help:after {
@@ -322,12 +318,6 @@ $top-border: solid 2px govuk-colour("mid-grey", $legacy: "grey-3");
322
318
 
323
319
  + .gem-c-step-nav__list {
324
320
  margin-top: -5px;
325
-
326
- .gem-c-step-nav--large & {
327
- @include govuk-media-query($from: tablet) {
328
- margin-top: -govuk-spacing(3);
329
- }
330
- }
331
321
  }
332
322
 
333
323
  .gem-c-step-nav--large & {
@@ -335,6 +325,12 @@ $top-border: solid 2px govuk-colour("mid-grey", $legacy: "grey-3");
335
325
  padding-bottom: govuk-spacing(6);
336
326
  }
337
327
  }
328
+
329
+ .gem-c-step-nav--large & + .gem-c-step-nav__list {
330
+ @include govuk-media-query($from: tablet) {
331
+ margin-top: -govuk-spacing(3);
332
+ }
333
+ }
338
334
  }
339
335
 
340
336
  .gem-c-step-nav__list {
@@ -37,28 +37,26 @@ $table-row-even-background-colour: govuk-colour("light-grey", $legacy: "grey-4")
37
37
  padding-right: $sort-link-arrow-size;
38
38
  color: $govuk-link-colour;
39
39
  text-decoration: none;
40
+ }
40
41
 
41
- &:focus {
42
- @include govuk-focused-text;
43
- }
44
-
45
- &::after {
46
- content: "";
47
- position: absolute;
48
- top: 5px;
49
- right: 0;
50
-
51
- @include govuk-shape-arrow($direction: up, $base: $sort-link-arrow-size-small, $display: block);
52
- }
42
+ .app-table__sort-link:focus {
43
+ @include govuk-focused-text;
44
+ }
53
45
 
54
- &::before {
55
- content: "";
56
- position: absolute;
57
- top: 13px;
58
- right: 0;
46
+ .app-table__sort-link:after {
47
+ content: "";
48
+ position: absolute;
49
+ top: 5px;
50
+ right: 0;
51
+ @include govuk-shape-arrow($direction: up, $base: $sort-link-arrow-size-small, $display: block);
52
+ }
59
53
 
60
- @include govuk-shape-arrow($direction: down, $base: $sort-link-arrow-size-small, $display: block);
61
- }
54
+ .app-table__sort-link:before {
55
+ content: "";
56
+ position: absolute;
57
+ top: 13px;
58
+ right: 0;
59
+ @include govuk-shape-arrow($direction: down, $base: $sort-link-arrow-size-small, $display: block);
62
60
  }
63
61
  }
64
62
 
@@ -81,12 +79,12 @@ $table-row-even-background-colour: govuk-colour("light-grey", $legacy: "grey-4")
81
79
  }
82
80
  }
83
81
 
84
- .app-table__sort-link--ascending::before,
85
- .app-table__sort-link--descending::before {
82
+ .app-table__sort-link--ascending:before,
83
+ .app-table__sort-link--descending:before {
86
84
  content: none;
87
85
  }
88
86
 
89
- .app-table__sort-link--ascending::after {
87
+ .app-table__sort-link--ascending:after {
90
88
  content: "";
91
89
  position: absolute;
92
90
  top: $sort-link-arrow-spacing;
@@ -96,7 +94,7 @@ $table-row-even-background-colour: govuk-colour("light-grey", $legacy: "grey-4")
96
94
  @include govuk-shape-arrow($direction: up, $base: $sort-link-arrow-size, $display: inline-block);
97
95
  }
98
96
 
99
- .app-table__sort-link--descending::after {
97
+ .app-table__sort-link--descending:after {
100
98
  content: "";
101
99
  position: absolute;
102
100
  top: $sort-link-arrow-spacing;
@@ -105,7 +103,6 @@ $table-row-even-background-colour: govuk-colour("light-grey", $legacy: "grey-4")
105
103
 
106
104
  @include govuk-shape-arrow($direction: down, $base: $sort-link-arrow-size, $display: inline-block);
107
105
  }
108
-
109
106
  }
110
107
 
111
108
  .govuk-table__row {
@@ -11,25 +11,21 @@
11
11
  // We have some styles within GOVUK (.content-block) which can leak into the list styles for this component.
12
12
  // These styles are defined in Static: https://github.com/alphagov/static/blob/a815620cada7ea1c65428c1c3b3ac4dbe28977bf/app/assets/stylesheets/helpers/_text.scss
13
13
  // This sets more specific selectors so those unwanted styles are overidden
14
- // scss-lint:disable QualifyingElement
15
- // sass-lint:disable no-qualifying-elements
16
- ul.govuk-tabs__list {
14
+ ul.govuk-tabs__list { // stylelint-disable-line selector-no-qualifying-type
17
15
  margin: 0;
18
16
  padding: 0;
19
17
  list-style: none;
20
18
  @include govuk-responsive-margin(6, "bottom");
21
19
  }
22
20
 
23
- li.govuk-tabs__list-item {
21
+ li.govuk-tabs__list-item { // stylelint-disable-line selector-no-qualifying-type
24
22
  margin-left: govuk-spacing(5);
25
23
  }
26
24
 
27
- .js-enabled {
25
+ .js-enabled { // stylelint-disable-line no-duplicate-selectors
28
26
  @include govuk-media-query($from: tablet) {
29
- ul.govuk-tabs__list {
27
+ ul.govuk-tabs__list { // stylelint-disable-line selector-no-qualifying-type
30
28
  margin-bottom: 0;
31
29
  }
32
30
  }
33
31
  }
34
- // scss-lint:enable QualifyingElement
35
- // sass-lint:enable no-qualifying-elements
@@ -5,6 +5,8 @@
5
5
  // - alphagov/whitehall: ✔︎
6
6
  // - alphagov/govspeak: ✔︎
7
7
 
8
+ // stylelint-disable max-nesting-depth
9
+
8
10
  .gem-c-govspeak {
9
11
 
10
12
  // Scope attachment and attachment-link component styles to gem-c-govspeak
@@ -1,7 +1,6 @@
1
1
  @import "govuk/components/button/button";
2
2
 
3
- // scss-lint:disable PlaceholderInExtend
4
- // sass-lint:disable placeholder-in-extend
3
+ // stylelint-disable scss/at-extend-no-missing-placeholder
5
4
  .gem-c-govspeak {
6
5
  .gem-c-button {
7
6
  @extend .govuk-button;
@@ -11,5 +10,3 @@
11
10
  @extend .govuk-button--start;
12
11
  }
13
12
  }
14
- // sass-lint:enable placeholder-in-extend
15
- // scss-lint:enable PlaceholderInExtend
@@ -9,6 +9,8 @@
9
9
  // adapted from magna-charta example stylesheet
10
10
  // https://github.com/alphagov/magna-charta/blob/master/demo/stylesheets/magna-charta.css
11
11
 
12
+ // stylelint-disable max-nesting-depth
13
+
12
14
  .gem-c-govspeak {
13
15
  // DEFAULT CHART STYLES
14
16
 
@@ -266,10 +268,6 @@
266
268
  text-align: left;
267
269
  }
268
270
 
269
- .mc-chart.mc-negative .mc-td.mc-key-cell {
270
- padding-right: 25px;
271
- }
272
-
273
271
  .mc-toggle-link {
274
272
  display: block;
275
273
  margin-top: 30px;
@@ -5,6 +5,8 @@
5
5
  // - alphagov/whitehall: ✔︎
6
6
  // - alphagov/govspeak: ✔︎
7
7
 
8
+ // stylelint-disable max-nesting-depth
9
+
8
10
  .gem-c-govspeak {
9
11
  // .address is used by the `$A` markdown pattern
10
12
  .address,
@@ -9,6 +9,8 @@
9
9
  // - alphagov/whitehall: ✔︎
10
10
  // - alphagov/govspeak: ✔︎
11
11
 
12
+ // stylelint-disable max-nesting-depth
13
+
12
14
  .gem-c-govspeak {
13
15
  .footnotes {
14
16
  border-top: 1px solid govuk-colour("mid-grey", $legacy: "grey-2");
@@ -1,3 +1,5 @@
1
+ // stylelint-disable max-nesting-depth
2
+
1
3
  $highlight-answer-bg-color: govuk-colour("green");
2
4
  $highlight-answer-color: govuk-colour("white");
3
5
 
@@ -1,4 +1,4 @@
1
- .gem-c-govspeak .place {
1
+ .gem-c-govspeak .place {
2
2
  margin: 1.5em 0;
3
3
  border-bottom: solid 1px govuk-colour("mid-grey", $legacy: "grey-2");
4
4
  padding-bottom: 1.5em;
@@ -9,6 +9,8 @@
9
9
  // - alphagov/whitehall: ✔︎
10
10
  // - alphagov/govspeak: ✔︎
11
11
 
12
+ // stylelint-disable max-nesting-depth
13
+
12
14
  .gem-c-govspeak {
13
15
  @include markdown-typography;
14
16
 
@@ -105,7 +105,7 @@
105
105
  }
106
106
 
107
107
  li {
108
- margin: 0 0 5px 0;
108
+ margin: 0 0 5px;
109
109
  padding: 0;
110
110
 
111
111
  p {
@@ -1,3 +1,5 @@
1
+ // stylelint-disable max-nesting-depth
2
+
1
3
  .gem-c-govspeak {
2
4
  .media-player {
3
5
  display: none;
@@ -7,8 +9,12 @@
7
9
  .help-notice,
8
10
  .call-to-action {
9
11
  margin: govuk-spacing(3) 0;
10
- padding: 0 govuk-spacing(3);
12
+ }
13
+
14
+ .call-to-action {
15
+ background: none;
11
16
  border: 1pt solid $govuk-border-colour;
17
+ padding: govuk-spacing(3);
12
18
  }
13
19
 
14
20
  .help-notice p {
@@ -1,5 +1,3 @@
1
- // scss-lint:disable SelectorFormat
2
-
3
1
  .gem-c-step-nav-header__part-of {
4
2
  display: block;
5
3
  }
@@ -11,5 +9,3 @@
11
9
  .gem-c-step-nav-header__skip-link {
12
10
  display: none;
13
11
  }
14
-
15
- // scss-lint:enable SelectorFormat
@@ -1,5 +1,3 @@
1
- // scss-lint:disable SelectorFormat
2
-
3
1
  $grey-2: #bfc1c3;
4
2
  $white: #ffffff;
5
3
  $number-circle-size: 35px;
@@ -40,6 +38,7 @@ $stroke-width: 3px;
40
38
  }
41
39
 
42
40
  .gem-c-step-nav__step {
41
+ padding-left: 60px;
43
42
  position: relative;
44
43
  }
45
44
 
@@ -74,14 +73,9 @@ $stroke-width: 3px;
74
73
  padding-bottom: 1em;
75
74
  }
76
75
 
77
- .gem-c-step-nav__step {
78
- position: relative;
79
- padding-left: 60px;
80
- }
81
-
82
76
  .gem-c-step-nav__title {
83
77
  @include govuk-font(19, $weight: bold);
84
- margin: 0 0 .5em 0;
78
+ margin: 0 0 .5em;
85
79
  padding: 0;
86
80
  }
87
81
 
@@ -120,5 +114,3 @@ $stroke-width: 3px;
120
114
  .gem-c-step-nav__circle-step-colon {
121
115
  display: none;
122
116
  }
123
-
124
- // scss-lint:enable SelectorFormat
@@ -0,0 +1,52 @@
1
+ module GovukPublishingComponents
2
+ class AuditController < GovukPublishingComponents::ApplicationController
3
+ def show
4
+ path = Dir.pwd
5
+
6
+ components = AuditComponents.new(path)
7
+ applications = analyse_applications(File.expand_path("..", path))
8
+ compared_data = AuditComparer.new(components.data, applications)
9
+
10
+ @applications = compared_data.applications_data || []
11
+ @components = compared_data.gem_data || []
12
+ end
13
+
14
+ private
15
+
16
+ def analyse_applications(path)
17
+ results = []
18
+ applications = %w[
19
+ calculators
20
+ collections
21
+ collections-publisher
22
+ content-data-admin
23
+ content-publisher
24
+ email-alert-frontend
25
+ feedback
26
+ finder-frontend
27
+ frontend
28
+ government-frontend
29
+ govspeak-preview
30
+ info-frontend
31
+ licence-finder
32
+ manuals-frontend
33
+ release
34
+ search-admin
35
+ service-manual-frontend
36
+ signon
37
+ smart-answers
38
+ static
39
+ travel-advice-publisher
40
+ whitehall
41
+ ].sort
42
+
43
+ applications.each do |application|
44
+ application_path = [path, application].join("/")
45
+ app = AuditApplications.new(application_path, application)
46
+ results << app.data
47
+ end
48
+
49
+ results
50
+ end
51
+ end
52
+ end