govuk_publishing_components 24.7.0 → 24.9.2

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 (121) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/application.js +3 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +35 -4
  4. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -0
  5. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +1 -1
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -2
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +0 -8
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +2 -2
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +1 -2
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -4
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -11
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +0 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +0 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +0 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +0 -1
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +0 -4
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +0 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -32
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +0 -5
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +0 -4
  21. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +16 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +0 -1
  23. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +15 -0
  24. data/app/controllers/govuk_publishing_components/audit_controller.rb +21 -17
  25. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +9 -0
  26. data/app/helpers/govuk_publishing_components/application_helper.rb +3 -0
  27. data/app/models/govuk_publishing_components/audit_applications.rb +3 -3
  28. data/app/models/govuk_publishing_components/audit_comparer.rb +16 -8
  29. data/app/models/govuk_publishing_components/audit_components.rb +6 -3
  30. data/app/views/govuk_publishing_components/audit/_applications.html.erb +126 -0
  31. data/app/views/govuk_publishing_components/audit/_components.html.erb +142 -0
  32. data/app/views/govuk_publishing_components/audit/show.html.erb +22 -277
  33. data/app/views/govuk_publishing_components/component_guide/index.html.erb +18 -2
  34. data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -1
  35. data/app/views/govuk_publishing_components/components/_accordion.html.erb +25 -0
  36. data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
  37. data/app/views/govuk_publishing_components/components/_image_card.html.erb +14 -11
  38. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -2
  39. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +2 -2
  40. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +2 -2
  41. data/app/views/govuk_publishing_components/components/_print_link.html.erb +2 -2
  42. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  43. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +4 -4
  44. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +3 -3
  45. data/app/views/govuk_publishing_components/components/_success_alert.html.erb +24 -8
  46. data/app/views/govuk_publishing_components/components/_title.html.erb +6 -2
  47. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
  48. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +1 -1
  49. data/app/views/govuk_publishing_components/components/docs/accordion.yml +73 -73
  50. data/app/views/govuk_publishing_components/components/docs/button.yml +7 -6
  51. data/app/views/govuk_publishing_components/components/docs/image_card.yml +12 -0
  52. data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +3 -0
  53. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +12 -1
  54. data/config/locales/ar.yml +1 -0
  55. data/config/locales/az.yml +1 -0
  56. data/config/locales/be.yml +1 -0
  57. data/config/locales/bg.yml +1 -0
  58. data/config/locales/bn.yml +1 -0
  59. data/config/locales/cs.yml +1 -0
  60. data/config/locales/da.yml +1 -0
  61. data/config/locales/de.yml +1 -0
  62. data/config/locales/dr.yml +1 -0
  63. data/config/locales/el.yml +1 -0
  64. data/config/locales/en.yml +11 -0
  65. data/config/locales/es-419.yml +1 -0
  66. data/config/locales/es.yml +1 -0
  67. data/config/locales/fa.yml +1 -0
  68. data/config/locales/fi.yml +1 -0
  69. data/config/locales/gd.yml +1 -0
  70. data/config/locales/gu.yml +1 -0
  71. data/config/locales/he.yml +1 -0
  72. data/config/locales/hi.yml +1 -0
  73. data/config/locales/hr.yml +1 -0
  74. data/config/locales/hu.yml +1 -0
  75. data/config/locales/hy.yml +1 -0
  76. data/config/locales/id.yml +1 -0
  77. data/config/locales/is.yml +1 -0
  78. data/config/locales/it.yml +1 -0
  79. data/config/locales/ja.yml +1 -0
  80. data/config/locales/ka.yml +1 -0
  81. data/config/locales/kk.yml +1 -0
  82. data/config/locales/ko.yml +1 -0
  83. data/config/locales/lt.yml +1 -0
  84. data/config/locales/lv.yml +1 -0
  85. data/config/locales/ms.yml +1 -0
  86. data/config/locales/mt.yml +1 -0
  87. data/config/locales/nl.yml +1 -0
  88. data/config/locales/no.yml +1 -0
  89. data/config/locales/pa-pk.yml +1 -0
  90. data/config/locales/pa.yml +1 -0
  91. data/config/locales/pl.yml +1 -0
  92. data/config/locales/ps.yml +1 -0
  93. data/config/locales/pt.yml +1 -0
  94. data/config/locales/ro.yml +1 -0
  95. data/config/locales/ru.yml +1 -0
  96. data/config/locales/si.yml +1 -0
  97. data/config/locales/sk.yml +1 -0
  98. data/config/locales/sl.yml +1 -0
  99. data/config/locales/so.yml +1 -0
  100. data/config/locales/sq.yml +1 -0
  101. data/config/locales/sr.yml +1 -0
  102. data/config/locales/sv.yml +1 -0
  103. data/config/locales/sw.yml +1 -0
  104. data/config/locales/ta.yml +1 -0
  105. data/config/locales/th.yml +1 -0
  106. data/config/locales/tk.yml +1 -0
  107. data/config/locales/tr.yml +1 -0
  108. data/config/locales/uk.yml +1 -0
  109. data/config/locales/ur.yml +1 -0
  110. data/config/locales/uz.yml +1 -0
  111. data/config/locales/vi.yml +1 -0
  112. data/config/locales/zh-hk.yml +1 -0
  113. data/config/locales/zh-tw.yml +1 -0
  114. data/config/locales/zh.yml +1 -0
  115. data/lib/govuk_publishing_components/presenters/button_helper.rb +13 -2
  116. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +0 -4
  117. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +15 -31
  118. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +1 -0
  119. data/lib/govuk_publishing_components/presenters/shared_helper.rb +10 -0
  120. data/lib/govuk_publishing_components/version.rb +1 -1
  121. metadata +84 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a7574209e732b2fdc01f77d8655487f1e22717a095577726c8fb3ab73cb5147
4
- data.tar.gz: af0f5bb6c5b9639b8879e700cf89b22cc479d3ed44346cc3884d4d5c8261baab
3
+ metadata.gz: 9ad726f2e544e7165c409104245f6b1e8e0c9bf97c4e10984db45411cc007892
4
+ data.tar.gz: 7aca349410d2615a5ba3810bdd90c4a355477dc017c7e72f9b626c35630139ba
5
5
  SHA512:
6
- metadata.gz: '09bbd9e420b9fc045fd8e9d8088bd15a586fb2281d5b639f33ed2d1f5138abf08e899fc06bab4f5f726f308792859e39d156e2355e3e2c486a40548854b32797'
7
- data.tar.gz: 6b9fe00e353b48620e520b8507636a79668d02ccd8c1f5f3ac43ee296fd87287c6bd7c1229e13f203d3a18c966a33141c61a40881a2f92ec3abe2a0b5459d10c
6
+ metadata.gz: 850ab9d67ae304803e0060aa16c969cc621df866eca8ea15eff8617e68d0149e618d0cc946da6da4b5bce7549033b8d60f0fb93d0fd316fe60e0f0ce75df606d
7
+ data.tar.gz: 9cdda0e734f05dd8c89e3bebd17800401492977650cfa2016eb51abec02362f1faf3d0668b33b2ead3067386b1c8c278a5fda1a269fb40685c0d23f659dc5343
@@ -1,2 +1,5 @@
1
1
  //= require_tree ./vendor
2
2
  //= require_tree .
3
+ //= require ../govuk_publishing_components/dependencies
4
+ //= require ../govuk_publishing_components/components/accordion
5
+ //= require ../govuk_publishing_components/components/tabs
@@ -31,7 +31,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
31
31
  this.upChevonIconClass = 'gem-c-accordion-nav__chevron'
32
32
  this.downChevonIconClass = 'gem-c-accordion-nav__chevron--down'
33
33
 
34
- // Indicate that js has worked
34
+ // Translated component content and language attribute pulled from data attributes
35
+ this.$module.actions = {}
36
+ this.$module.actions.locale = this.$module.getAttribute('data-locale')
37
+ this.$module.actions.showText = this.$module.getAttribute('data-show-text')
38
+ this.$module.actions.hideText = this.$module.getAttribute('data-hide-text')
39
+ this.$module.actions.showAllText = this.$module.getAttribute('data-show-all-text')
40
+ this.$module.actions.hideAllText = this.$module.getAttribute('data-hide-all-text')
41
+ this.$module.actions.thisSectionVisuallyHidden = this.$module.getAttribute('data-this-section-visually-hidden')
42
+
43
+ // Indicate that JavaScript has worked
35
44
  this.$module.classList.add('gem-c-accordion--active')
36
45
 
37
46
  this.initControls()
@@ -117,7 +126,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
117
126
  // Build additional copy for assistive technology
118
127
  var srAdditionalCopy = document.createElement('span')
119
128
  srAdditionalCopy.classList.add('govuk-visually-hidden')
120
- srAdditionalCopy.innerHTML = ' this section'
129
+ srAdditionalCopy.innerHTML = this.$module.actions.thisSectionVisuallyHidden
130
+
131
+ if (this.$module.actions.locale) {
132
+ srAdditionalCopy.lang = this.filterLocale('this_section_visually_hidden')
133
+ }
121
134
 
122
135
  // Build additional wrapper for toggle text, place icon after wrapped text.
123
136
  var wrapperShowHideIcon = document.createElement('span')
@@ -178,12 +191,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
178
191
  var icon = section.querySelector('.' + this.upChevonIconClass)
179
192
  var showHideText = section.querySelector('.' + this.sectionShowHideTextClass)
180
193
  var button = section.querySelector('.' + this.sectionButtonClass)
181
- var newButtonText = expanded ? 'Hide' : 'Show'
194
+ var newButtonText = expanded ? this.$module.actions.hideText : this.$module.actions.showText
182
195
 
183
196
  showHideText.innerHTML = newButtonText
184
197
  button.setAttribute('aria-expanded', expanded)
185
198
  button.classList.add(this.toggleLinkClass)
186
199
 
200
+ if (this.$module.actions.locale) {
201
+ showHideText.lang = this.filterLocale(expanded ? 'hide_text' : 'show_text')
202
+ }
203
+
187
204
  // Swap icon, change class
188
205
  if (expanded) {
189
206
  section.classList.add(this.sectionExpandedClass)
@@ -218,10 +235,15 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
218
235
  GemAccordion.prototype.updateOpenAllButton = function (expanded) {
219
236
  var icon = this.openAllButton.querySelector('.' + this.upChevonIconClass)
220
237
  var openAllCopy = this.openAllButton.querySelector('.' + this.openAllTextClass)
221
- var newButtonText = expanded ? 'Hide all sections' : 'Show all sections'
238
+ var newButtonText = expanded ? this.$module.actions.hideAllText : this.$module.actions.showAllText
239
+
222
240
  this.openAllButton.setAttribute('aria-expanded', expanded)
223
241
  openAllCopy.innerHTML = newButtonText
224
242
 
243
+ if (this.$module.actions.locale) {
244
+ openAllCopy.lang = this.filterLocale(expanded ? 'hide_all_text' : 'show_all_text')
245
+ }
246
+
225
247
  // Swap icon, toggle class
226
248
  if (expanded) {
227
249
  icon.classList.remove(this.downChevonIconClass)
@@ -329,5 +351,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
329
351
  return target
330
352
  }
331
353
 
354
+ GemAccordion.prototype.filterLocale = function (key) {
355
+ if (this.$module.actions.locale && this.$module.actions.locale.indexOf('{') !== -1) {
356
+ var locales = JSON.parse(this.$module.actions.locale)
357
+ return locales[key]
358
+ } else if (this.$module.actions.locale) {
359
+ return this.$module.actions.locale
360
+ }
361
+ }
362
+
332
363
  Modules.GemAccordion = GemAccordion
333
364
  })(window.GOVUK.Modules)
@@ -25,6 +25,7 @@
25
25
  govuk_browser_upgrade_dismisssed: 'settings',
26
26
  govuk_not_first_visit: 'settings',
27
27
  analytics_next_page_call: 'usage',
28
+ user_nation: 'settings',
28
29
  _ga: 'usage',
29
30
  _gid: 'usage',
30
31
  _gat: 'usage',
@@ -188,7 +188,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
188
188
  toggleStatus.classList.add('govuk-visually-hidden', 'mc-toggle-status')
189
189
  toggleStatus.setAttribute('role', 'alert')
190
190
 
191
- link.classList.add('mc-toggle-button')
191
+ link.classList.add('govuk-body-s', 'mc-toggle-button')
192
192
  link.appendChild(toggleText)
193
193
  link.appendChild(toggleStatus)
194
194
 
@@ -1,5 +1,3 @@
1
- $gem-hover-dark-background: #dddcdb;
2
-
3
1
  .gem-c-action-link {
4
2
  display: table;
5
3
 
@@ -1,13 +1,5 @@
1
1
  @import "govuk/components/button/button";
2
2
 
3
- $gem-secondary-button-colour: #00823b;
4
- $gem-secondary-button-hover-colour: darken($gem-secondary-button-colour, 5%);
5
- $gem-secondary-button-background-colour: govuk-colour("white");
6
- $gem-secondary-button-hover-background-colour: govuk-colour("light-grey", $legacy: "grey-4");
7
-
8
- $gem-quiet-button-colour: govuk-colour("dark-grey", $legacy: "grey-1");
9
- $gem-quiet-button-hover-colour: darken($gem-quiet-button-colour, 5%);
10
-
11
3
  // Because govuk-frontend adds a responsive bottom margin by default for each component
12
4
  // we reset it to zero so we can set it separately using `gem-c-button--bottom-margin`
13
5
  // If we decide to use responsive margins consistently across components we can remove this
@@ -6,7 +6,6 @@ $transition-campaign-dark-blue: #1e1348;
6
6
  }
7
7
 
8
8
  .gem-c-contextual-sidebar__brexit-heading {
9
- @extend %govuk-heading-s;
10
9
  margin-top: govuk-spacing(3);
11
10
  margin-bottom: govuk-spacing(2);
12
11
  }
@@ -24,7 +23,6 @@ $transition-campaign-dark-blue: #1e1348;
24
23
  }
25
24
 
26
25
  .gem-c-contextual-sidebar__brexit-text {
27
- @extend %govuk-link;
28
26
  @include govuk-font(16);
29
27
 
30
28
  margin-top: 0;
@@ -38,6 +36,8 @@ $transition-campaign-dark-blue: #1e1348;
38
36
  }
39
37
 
40
38
  .gem-c-contextual-sidebar__brexit-cta:focus {
39
+ box-shadow: 0 $govuk-focus-width $govuk-focus-text-colour;
40
+
41
41
  .gem-c-contextual-sidebar__brexit-text {
42
42
  text-decoration: none;
43
43
  }
@@ -50,11 +50,10 @@
50
50
  }
51
51
 
52
52
  .gem-c-highlight-boxes__title {
53
- @extend %govuk-link;
54
53
  @include govuk-font(19, $weight: bold);
55
54
  display: block;
56
55
  text-decoration: underline;
57
- margin-bottom: 5px;
56
+ margin-bottom: govuk-spacing(1);
58
57
  }
59
58
 
60
59
  .gem-c-highlight-boxes--inverse .gem-c-highlight-boxes__title {
@@ -59,12 +59,10 @@
59
59
  }
60
60
 
61
61
  .gem-c-image-card__title {
62
- @include govuk-font(19, $weight: bold);
63
62
  margin: 0;
64
63
  }
65
64
 
66
65
  .gem-c-image-card__title-link {
67
- @extend %govuk-link;
68
66
  text-decoration: none;
69
67
 
70
68
  &:hover {
@@ -136,7 +134,6 @@
136
134
  }
137
135
 
138
136
  .gem-c-image-card__list-item-link {
139
- @extend %govuk-link;
140
137
  line-height: 1.35em;
141
138
  }
142
139
 
@@ -193,7 +190,6 @@
193
190
  }
194
191
 
195
192
  .gem-c-image-card__title {
196
- @include govuk-font(24, $weight: bold);
197
193
  padding-bottom: govuk-spacing(2);
198
194
  }
199
195
 
@@ -33,7 +33,7 @@
33
33
  .gem-c-layout-header--search-left {
34
34
  .gem-c-header__menu-button.govuk-header__menu-button {
35
35
  margin-top: - govuk-spacing(7);
36
- left: 0;
36
+ left: govuk-spacing(3);
37
37
  }
38
38
 
39
39
  .gem-c-header__nav-wrapper {
@@ -78,16 +78,6 @@
78
78
  }
79
79
  }
80
80
 
81
- @include govuk-compatibility(govuk_template) {
82
- .gem-c-layout-header__search.govuk-grid-column-one-third-from-desktop,
83
- .gem-c-layout-header__logo.govuk-grid-column-one-third-from-desktop,
84
- .gem-c-layout-header__search.govuk-grid-column-one-third,
85
- .gem-c-layout-header__logo.govuk-grid-column-two-thirds {
86
- padding-right: 0;
87
- padding-left: 0;
88
- }
89
- }
90
-
91
81
  .gem-c-layout-header__logo,
92
82
  .gem-c-layout-header__search {
93
83
  @include govuk-media-query($until: "tablet") {
@@ -18,7 +18,6 @@
18
18
  }
19
19
 
20
20
  .gem-c-pagination__link {
21
- @extend %govuk-link;
22
21
  display: block;
23
22
  text-decoration: none;
24
23
  padding-bottom: govuk-spacing(4);
@@ -41,7 +41,6 @@ $gem-c-print-link-background-height: 18px;
41
41
  }
42
42
 
43
43
  .gem-c-print-link__button {
44
- @extend %govuk-body-s;
45
44
  border: 1px solid $govuk-border-colour;
46
45
  color: $govuk-link-colour;
47
46
  cursor: pointer;
@@ -66,7 +66,6 @@
66
66
  }
67
67
 
68
68
  .gem-c-related-navigation__section-link {
69
- @extend %govuk-link;
70
69
  font-weight: bold;
71
70
 
72
71
  @include govuk-template-link-focus-override;
@@ -20,7 +20,6 @@ $share-button-height: 32px;
20
20
  }
21
21
 
22
22
  .gem-c-share-links__link {
23
- @extend %govuk-link;
24
23
  @include govuk-font(16, $weight: bold);
25
24
  margin-right: govuk-spacing(6);
26
25
  text-decoration: none;
@@ -46,7 +46,3 @@
46
46
  .gem-c-step-nav-related__link-item {
47
47
  margin-top: govuk-spacing(3);
48
48
  }
49
-
50
- .gem-c-step-nav-related__link {
51
- @extend %govuk-link;
52
- }
@@ -44,7 +44,6 @@
44
44
  }
45
45
 
46
46
  .gem-c-subscription-links__item {
47
- @extend %govuk-link;
48
47
  display: inline-block;
49
48
  text-decoration: none;
50
49
  background-repeat: no-repeat;
@@ -1,36 +1,5 @@
1
- .gem-c-success-alert {
2
- color: $govuk-text-colour;
3
- padding: govuk-spacing(3);
4
- border: $govuk-border-width-narrow solid $govuk-success-colour;
5
- @include govuk-responsive-margin(8, "bottom");
6
-
7
- @include govuk-media-query($from: tablet) {
8
- padding: govuk-spacing(4);
9
- border-width: $govuk-border-width;
10
- }
11
- }
1
+ @import "govuk/components/notification-banner/notification-banner";
12
2
 
13
3
  .gem-c-success-alert__message {
14
4
  @include govuk-font(19, $weight: bold);
15
- margin: 0;
16
- }
17
-
18
- .gem-c-success-summary__title {
19
- margin-top: 0;
20
- margin-bottom: govuk-spacing(3);
21
-
22
- @include govuk-media-query($from: tablet) {
23
- margin-bottom: govuk-spacing(4);
24
- }
25
-
26
- @include govuk-font(24, $weight: bold);
27
- }
28
-
29
- .gem-c-success-summary__body {
30
- @include govuk-font(19);
31
- margin: 0;
32
- }
33
-
34
- .gem-c-success-alert:focus {
35
- outline: $govuk-focus-width solid $govuk-focus-colour;
36
5
  }
@@ -26,10 +26,5 @@
26
26
  }
27
27
 
28
28
  .gem-c-title__text {
29
- @extend %govuk-heading-xl;
30
29
  margin: 0;
31
30
  }
32
-
33
- .gem-c-title__text--long {
34
- @extend %govuk-heading-l;
35
- }
@@ -30,10 +30,6 @@
30
30
  }
31
31
  }
32
32
 
33
- .gem-c-translation-nav__link {
34
- @extend %govuk-link;
35
- }
36
-
37
33
  .gem-c-translation-nav--inverse {
38
34
  border-color: govuk-colour("white");
39
35
 
@@ -1,7 +1,21 @@
1
- @import "govuk/components/button/button";
2
-
3
1
  // stylelint-disable scss/at-extend-no-missing-placeholder
4
2
  .gem-c-govspeak {
3
+ @import "govuk/components/button/button";
4
+
5
+ // Some links in Govspeak should look like buttons[1] when using:
6
+ // ```
7
+ // {button}[Random page](https://gov.uk/random){/button}
8
+ // ```.
9
+ //
10
+ // To make sure that the link styles don't override the button styles this
11
+ // needs more specificity.
12
+ //
13
+ // Govspeak targets link by using element selectors; so the selector
14
+ // `.gem-c-govspeak a:link` will override `.govuk-button`. Extending
15
+ // `govuk-button` here gives `gem-c-govspeak .gem-c-button` and prevents the
16
+ // link-that-looks-like-a-button from being overriden.
17
+
18
+ // [1]: https://github.com/alphagov/govspeak#button
5
19
  .gem-c-button {
6
20
  @extend .govuk-button;
7
21
  }
@@ -271,7 +271,6 @@
271
271
  }
272
272
 
273
273
  .mc-toggle-button {
274
- @extend %govuk-body-s;
275
274
  border: 1px solid $govuk-border-colour;
276
275
  color: $govuk-link-colour;
277
276
  cursor: pointer;
@@ -2,3 +2,18 @@
2
2
  // It provides govuk-frontend but adds no weight to the compiled CSS
3
3
  @import "components/helpers/govuk-frontend-settings";
4
4
  @import "govuk/base";
5
+
6
+ @import 'components/mixins/margins';
7
+ // TODO: remove this focus override when govuk_template is no longer used
8
+ @import 'components/mixins/govuk-template-link-focus-override';
9
+ @import 'components/mixins/css3';
10
+
11
+ $gem-secondary-button-colour: #00823b;
12
+ $gem-secondary-button-hover-colour: darken($gem-secondary-button-colour, 5%);
13
+ $gem-secondary-button-background-colour: govuk-colour("white");
14
+ $gem-secondary-button-hover-background-colour: govuk-colour("light-grey", $legacy: "grey-4");
15
+
16
+ $gem-quiet-button-colour: govuk-colour("dark-grey", $legacy: "grey-1");
17
+ $gem-quiet-button-hover-colour: darken($gem-quiet-button-colour, 5%);
18
+
19
+ $gem-hover-dark-background: #dddcdb;
@@ -1,22 +1,7 @@
1
1
  module GovukPublishingComponents
2
2
  class AuditController < GovukPublishingComponents::ApplicationController
3
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
4
+ application_dirs = %w[
20
5
  collections
21
6
  collections-publisher
22
7
  content-data-admin
@@ -42,10 +27,29 @@ module GovukPublishingComponents
42
27
  travel-advice-publisher
43
28
  whitehall
44
29
  ].sort
30
+ application_dirs = [GovukPublishingComponents::ApplicationHelper.get_application_name_from_path(Rails.root)] unless ENV["MAIN_COMPONENT_GUIDE"]
31
+
32
+ gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
33
+ gem_path = Dir.pwd if ENV["MAIN_COMPONENT_GUIDE"]
34
+
35
+ components = AuditComponents.new(gem_path, false)
36
+ applications = analyse_applications(File.expand_path("..", gem_path), application_dirs)
37
+ compared_data = AuditComparer.new(components.data, applications, false)
38
+
39
+ @applications = compared_data.applications_data || []
40
+ @components = compared_data.gem_data || []
41
+ end
42
+
43
+ private
44
+
45
+ def analyse_applications(path, application_dirs)
46
+ results = []
47
+ @applications_found = false
45
48
 
46
- applications.each do |application|
49
+ application_dirs.each do |application|
47
50
  application_path = [path, application].join("/")
48
51
  app = AuditApplications.new(application_path, application)
52
+ @applications_found = true if app.data[:application_found]
49
53
  results << app.data
50
54
  end
51
55