govuk_publishing_components 21.3.0 → 21.4.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/crests/bis_crest_13px.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/crests/bis_crest_13px_x2-2.png +0 -0
  4. data/app/assets/images/govuk_publishing_components/crests/bis_crest_13px_x2.png +0 -0
  5. data/app/assets/images/govuk_publishing_components/crests/bis_crest_18px.png +0 -0
  6. data/app/assets/images/govuk_publishing_components/crests/bis_crest_18px_x2.png +0 -0
  7. data/app/assets/images/govuk_publishing_components/crests/coastguard_13px.png +0 -0
  8. data/app/assets/images/govuk_publishing_components/crests/coastguard_13px_x2.png +0 -0
  9. data/app/assets/images/govuk_publishing_components/crests/coastguard_18px.png +0 -0
  10. data/app/assets/images/govuk_publishing_components/crests/coastguard_18px_x2.png +0 -0
  11. data/app/assets/images/govuk_publishing_components/crests/dit_crest_13px.png +0 -0
  12. data/app/assets/images/govuk_publishing_components/crests/dit_crest_13px_x2.png +0 -0
  13. data/app/assets/images/govuk_publishing_components/crests/dit_crest_18px.png +0 -0
  14. data/app/assets/images/govuk_publishing_components/crests/dit_crest_18px_x2.png +0 -0
  15. data/app/assets/images/govuk_publishing_components/crests/hmrc_crest_13px.png +0 -0
  16. data/app/assets/images/govuk_publishing_components/crests/hmrc_crest_13px_x2.png +0 -0
  17. data/app/assets/images/govuk_publishing_components/crests/hmrc_crest_18px.png +0 -0
  18. data/app/assets/images/govuk_publishing_components/crests/hmrc_crest_18px_x2.png +0 -0
  19. data/app/assets/images/govuk_publishing_components/crests/ho_crest_13px.png +0 -0
  20. data/app/assets/images/govuk_publishing_components/crests/ho_crest_13px_x2.png +0 -0
  21. data/app/assets/images/govuk_publishing_components/crests/ho_crest_18px.png +0 -0
  22. data/app/assets/images/govuk_publishing_components/crests/ho_crest_18px_x2.png +0 -0
  23. data/app/assets/images/govuk_publishing_components/crests/mod_crest_13px.png +0 -0
  24. data/app/assets/images/govuk_publishing_components/crests/mod_crest_13px_x2.png +0 -0
  25. data/app/assets/images/govuk_publishing_components/crests/mod_crest_18px.png +0 -0
  26. data/app/assets/images/govuk_publishing_components/crests/mod_crest_18px_x2.png +0 -0
  27. data/app/assets/images/govuk_publishing_components/crests/org_crest_13px.png +0 -0
  28. data/app/assets/images/govuk_publishing_components/crests/org_crest_13px_x2.png +0 -0
  29. data/app/assets/images/govuk_publishing_components/crests/org_crest_18px.png +0 -0
  30. data/app/assets/images/govuk_publishing_components/crests/org_crest_18px_x2.png +0 -0
  31. data/app/assets/images/govuk_publishing_components/crests/portcullis_13px.png +0 -0
  32. data/app/assets/images/govuk_publishing_components/crests/portcullis_13px_x2.png +0 -0
  33. data/app/assets/images/govuk_publishing_components/crests/portcullis_18px.png +0 -0
  34. data/app/assets/images/govuk_publishing_components/crests/portcullis_18px_x2.png +0 -0
  35. data/app/assets/images/govuk_publishing_components/crests/so_crest_13px.png +0 -0
  36. data/app/assets/images/govuk_publishing_components/crests/so_crest_13px_x2.png +0 -0
  37. data/app/assets/images/govuk_publishing_components/crests/so_crest_18px.png +0 -0
  38. data/app/assets/images/govuk_publishing_components/crests/so_crest_18px_x2.png +0 -0
  39. data/app/assets/images/govuk_publishing_components/crests/ukaea_crest_13px.png +0 -0
  40. data/app/assets/images/govuk_publishing_components/crests/ukaea_crest_13px_x2.png +0 -0
  41. data/app/assets/images/govuk_publishing_components/crests/ukaea_crest_18px.png +0 -0
  42. data/app/assets/images/govuk_publishing_components/crests/ukaea_crest_18px_x2.png +0 -0
  43. data/app/assets/images/govuk_publishing_components/crests/ukho_13px.png +0 -0
  44. data/app/assets/images/govuk_publishing_components/crests/ukho_13px_x2.png +0 -0
  45. data/app/assets/images/govuk_publishing_components/crests/ukho_18px.png +0 -0
  46. data/app/assets/images/govuk_publishing_components/crests/ukho_18px_x2.png +0 -0
  47. data/app/assets/images/govuk_publishing_components/crests/wales_crest_13px.png +0 -0
  48. data/app/assets/images/govuk_publishing_components/crests/wales_crest_13px_x2.png +0 -0
  49. data/app/assets/images/govuk_publishing_components/crests/wales_crest_18px.png +0 -0
  50. data/app/assets/images/govuk_publishing_components/crests/wales_crest_18px_x2.png +0 -0
  51. data/app/assets/stylesheets/component_guide/application.scss +6 -8
  52. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +4 -5
  53. data/app/controllers/govuk_publishing_components/application_controller.rb +11 -0
  54. data/app/views/govuk_publishing_components/component_guide/example.html.erb +3 -3
  55. data/app/views/govuk_publishing_components/component_guide/show.html.erb +10 -11
  56. data/config/initializers/assets.rb +1 -0
  57. data/lib/govuk_publishing_components/version.rb +1 -1
  58. metadata +51 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbcad820792648c45683e5b4226a47f17353ec7c8018089dd375e239db1ee43e
4
- data.tar.gz: 30e3861a060a0c9c476a3f0d0ee2628753e7fcd7972ce638f2ea7ec5ea33a5de
3
+ metadata.gz: 076d12dde5ae718e4121452456f278ab864c4b58b95e2e1bc38be2ce9baf24f0
4
+ data.tar.gz: 876634e138bef21c35e7a1766f3e65f9bfb04b6636e3bff57a9515d8731cbfa5
5
5
  SHA512:
6
- metadata.gz: 2a77463ccd09451691c92bcf2a10fac990b9ce93d37320a1a9b300626b9902d6c054ac8afd26aae9b330f37460f0113e9e1f8a75297fb7f4a89438a4a64a0b5f
7
- data.tar.gz: 8dccc6978ed550e5ee4718ab0e3bdd08752b1738dc1cefa3b914eff872ae6ce541e965b1548315ac7a102be4fb9251bf08dbb0bf2ae90b426980dfd9d05ecb85
6
+ metadata.gz: e82a6343d77e6abd5cd893a51311dc4af3a6581f1dd735e546eb58ddf5f66c412f4969ae9129937c303b02f123de16722b6d524320379d48bdf0778b79b63808
7
+ data.tar.gz: 959208582bc3452e230d01a66541d04c98ef267abaa2c5d7a284ca7c4118c2f607abea49e2bc821acbd9f5c651d2534d9d6f9d1a4c6ac503729869688be1f200
@@ -7,6 +7,8 @@
7
7
  @import "govuk/helpers/all";
8
8
  @import "govuk/core/all";
9
9
 
10
+ $gem-guide-border-width: 1px;
11
+
10
12
  .component-guide-wrapper {
11
13
  padding-bottom: $govuk-gutter * 1.5;
12
14
  }
@@ -34,10 +36,6 @@
34
36
  }
35
37
  }
36
38
 
37
- .component-body {
38
- margin-bottom: $govuk-gutter * 1.5;
39
- }
40
-
41
39
  .component-guide-hidden {
42
40
  display: none;
43
41
  }
@@ -86,13 +84,13 @@
86
84
  }
87
85
 
88
86
  .component-call {
89
- margin-top: $govuk-gutter-half;
87
+ margin-top: -$gem-guide-border-width;
90
88
  margin-bottom: $govuk-gutter-half;
91
89
 
92
90
  font-family: Consolas, Monaco, "Andale Mono", monospace;
93
91
  font-size: 16px;
94
92
  line-height: 1.5;
95
- border: 1px solid $govuk-border-colour;
93
+ border: $gem-guide-border-width solid $govuk-border-colour;
96
94
 
97
95
  &[contenteditable]:hover {
98
96
  cursor: text;
@@ -124,7 +122,7 @@
124
122
 
125
123
  .component-guide-preview {
126
124
  padding: ($govuk-gutter * 1.5) $govuk-gutter $govuk-gutter;
127
- border: 1px solid $govuk-border-colour;
125
+ border: $gem-guide-border-width solid $govuk-border-colour;
128
126
  position: relative;
129
127
 
130
128
  &.direction-rtl {
@@ -165,7 +163,7 @@
165
163
  .component-guide-preview--violation,
166
164
  .component-guide-preview--warning {
167
165
  @include govuk-text-colour;
168
- margin-top: $govuk-gutter-half;
166
+ margin-top: -$gem-guide-border-width;
169
167
 
170
168
  @include govuk-font($size: 19);
171
169
 
@@ -65,21 +65,20 @@
65
65
  }
66
66
  }
67
67
 
68
- // all crest images are currently in whitehall
69
68
  @mixin crest($crest) {
70
- background: image-url("crests/#{$crest}_13px.png") no-repeat 5px 0;
69
+ background: image-url("govuk_publishing_components/crests/#{$crest}_13px.png") no-repeat 5px 0;
71
70
  background-size: auto 20px;
72
71
 
73
72
  @include govuk-device-pixel-ratio {
74
- background-image: image-url("crests/#{$crest}_13px_x2.png");
73
+ background-image: image-url("govuk_publishing_components/crests/#{$crest}_13px_x2.png");
75
74
  }
76
75
 
77
76
  @include govuk-media-query($from: tablet) {
78
- background: image-url("crests/#{$crest}_18px.png") no-repeat 6px 0;
77
+ background: image-url("govuk_publishing_components/crests/#{$crest}_18px.png") no-repeat 6px 0;
79
78
  background-size: auto 26px;
80
79
 
81
80
  @include govuk-device-pixel-ratio {
82
- background-image: image-url("crests/#{$crest}_18px_x2.png");
81
+ background-image: image-url("govuk_publishing_components/crests/#{$crest}_18px_x2.png");
83
82
  }
84
83
  }
85
84
  }
@@ -5,6 +5,17 @@ module GovukPublishingComponents
5
5
  before_action :set_x_frame_options_header
6
6
  before_action :set_disable_slimmer_header
7
7
 
8
+ content_security_policy do |p|
9
+ # don't do anything if the app doesn't have a content security policy
10
+ next unless p.directives.any?
11
+
12
+ # Unfortunately the axe core script uses a dependency that uses eval
13
+ # see: https://github.com/dequelabs/axe-core/issues/1175
14
+ # Thus all components shown by govuk_publishing_components need this
15
+ # enabled
16
+ p.script_src(*p.script_src, :unsafe_eval)
17
+ end
18
+
8
19
  private
9
20
 
10
21
  def set_x_frame_options_header
@@ -6,10 +6,10 @@
6
6
  <div class="component-markdown">
7
7
  <%= raw(@component_example.html_description) %>
8
8
  </div>
9
- <h2 class="component-doc-h2">How to call this example</h2>
10
- <%= render partial: "govuk_publishing_components/component_guide/component_doc/call", locals: { component_doc: @component_doc, example: @component_example } %>
11
-
12
9
  <h2 class="component-doc-h2">How it looks</h2>
13
10
  <%= render partial: "govuk_publishing_components/component_guide/component_doc/preview", locals: { component_doc: @component_doc, example: @component_example } %>
11
+
12
+ <h2 class="component-doc-h2">How to call this example</h2>
13
+ <%= render partial: "govuk_publishing_components/component_guide/component_doc/call", locals: { component_doc: @component_doc, example: @component_example } %>
14
14
  </div>
15
15
  </div>
@@ -16,20 +16,21 @@
16
16
  <div class="component-markdown">
17
17
  <%= raw(@component_doc.html_body) %>
18
18
  </div>
19
+
20
+ <p class="govuk-body"><%= link_to "Search for usage of this component on GitHub", @component_doc.github_search_url, class: "govuk-link" %></p>
19
21
  </div>
20
22
  <% end %>
21
23
  </div>
22
24
  </div>
23
25
 
24
- <div class="component-doc">
25
- <h2 class="component-doc-h2">How to call this component</h2>
26
- <%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: @component_doc.example %>
27
- <%= link_to "Search for usage on GitHub", @component_doc.github_search_url, class: "govuk-link" %>
28
- <h2 class="component-doc-h2">How it looks</h2>
29
- </div>
30
-
26
+ <h2 class="component-doc-h2">How it looks
27
+ <small>(<a href="<%= component_preview_all_path(@component_doc.id) %>" class="govuk-link">preview all</a>)</small>
28
+ </h2>
31
29
  <%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, example: @component_doc.example %>
32
30
 
31
+ <h2 class="component-doc-h2">How to call this component</h2>
32
+ <%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: @component_doc.example %>
33
+
33
34
  <% if @component_doc.govuk_frontend_components.any? %>
34
35
  <h2 class="component-doc-h2">GOV.UK Design System</h2>
35
36
  <div class="component-markdown">
@@ -56,9 +57,7 @@
56
57
 
57
58
  <% if @component_doc.other_examples.any? %>
58
59
  <div class="examples">
59
- <h2 class="component-doc-h2">Other examples
60
- <small>(<a href="<%= component_preview_all_path(@component_doc.id) %>" class="govuk-link">preview all</a>)</small>
61
- </h2>
60
+ <h2 class="component-doc-h2">Other examples</h2>
62
61
  <% @component_doc.other_examples.each do |example| %>
63
62
  <div class="component-example">
64
63
  <h3 class="example-title">
@@ -68,8 +67,8 @@
68
67
  <div class="component-markdown">
69
68
  <%= raw(example.html_description) %>
70
69
  </div>
71
- <%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: example %>
72
70
  <%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, example: example %>
71
+ <%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: example %>
73
72
  </div>
74
73
  <% end %>
75
74
  </div>
@@ -26,6 +26,7 @@ Rails.application.config.assets.precompile += %w(
26
26
  govuk_publishing_components/chevron-banner-hover.svg
27
27
  govuk_publishing_components/chevron-banner-small.svg
28
28
  govuk_publishing_components/chevron-banner-small-focus.svg
29
+ govuk_publishing_components/crests/*.png
29
30
  )
30
31
 
31
32
  # GOV.UK Frontend assets
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '21.3.0'.freeze
2
+ VERSION = '21.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 21.3.0
4
+ version: 21.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-26 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters
@@ -321,6 +321,55 @@ files:
321
321
  - app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg
322
322
  - app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg
323
323
  - app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner.svg
324
+ - app/assets/images/govuk_publishing_components/crests/bis_crest_13px.png
325
+ - app/assets/images/govuk_publishing_components/crests/bis_crest_13px_x2-2.png
326
+ - app/assets/images/govuk_publishing_components/crests/bis_crest_13px_x2.png
327
+ - app/assets/images/govuk_publishing_components/crests/bis_crest_18px.png
328
+ - app/assets/images/govuk_publishing_components/crests/bis_crest_18px_x2.png
329
+ - app/assets/images/govuk_publishing_components/crests/coastguard_13px.png
330
+ - app/assets/images/govuk_publishing_components/crests/coastguard_13px_x2.png
331
+ - app/assets/images/govuk_publishing_components/crests/coastguard_18px.png
332
+ - app/assets/images/govuk_publishing_components/crests/coastguard_18px_x2.png
333
+ - app/assets/images/govuk_publishing_components/crests/dit_crest_13px.png
334
+ - app/assets/images/govuk_publishing_components/crests/dit_crest_13px_x2.png
335
+ - app/assets/images/govuk_publishing_components/crests/dit_crest_18px.png
336
+ - app/assets/images/govuk_publishing_components/crests/dit_crest_18px_x2.png
337
+ - app/assets/images/govuk_publishing_components/crests/hmrc_crest_13px.png
338
+ - app/assets/images/govuk_publishing_components/crests/hmrc_crest_13px_x2.png
339
+ - app/assets/images/govuk_publishing_components/crests/hmrc_crest_18px.png
340
+ - app/assets/images/govuk_publishing_components/crests/hmrc_crest_18px_x2.png
341
+ - app/assets/images/govuk_publishing_components/crests/ho_crest_13px.png
342
+ - app/assets/images/govuk_publishing_components/crests/ho_crest_13px_x2.png
343
+ - app/assets/images/govuk_publishing_components/crests/ho_crest_18px.png
344
+ - app/assets/images/govuk_publishing_components/crests/ho_crest_18px_x2.png
345
+ - app/assets/images/govuk_publishing_components/crests/mod_crest_13px.png
346
+ - app/assets/images/govuk_publishing_components/crests/mod_crest_13px_x2.png
347
+ - app/assets/images/govuk_publishing_components/crests/mod_crest_18px.png
348
+ - app/assets/images/govuk_publishing_components/crests/mod_crest_18px_x2.png
349
+ - app/assets/images/govuk_publishing_components/crests/org_crest_13px.png
350
+ - app/assets/images/govuk_publishing_components/crests/org_crest_13px_x2.png
351
+ - app/assets/images/govuk_publishing_components/crests/org_crest_18px.png
352
+ - app/assets/images/govuk_publishing_components/crests/org_crest_18px_x2.png
353
+ - app/assets/images/govuk_publishing_components/crests/portcullis_13px.png
354
+ - app/assets/images/govuk_publishing_components/crests/portcullis_13px_x2.png
355
+ - app/assets/images/govuk_publishing_components/crests/portcullis_18px.png
356
+ - app/assets/images/govuk_publishing_components/crests/portcullis_18px_x2.png
357
+ - app/assets/images/govuk_publishing_components/crests/so_crest_13px.png
358
+ - app/assets/images/govuk_publishing_components/crests/so_crest_13px_x2.png
359
+ - app/assets/images/govuk_publishing_components/crests/so_crest_18px.png
360
+ - app/assets/images/govuk_publishing_components/crests/so_crest_18px_x2.png
361
+ - app/assets/images/govuk_publishing_components/crests/ukaea_crest_13px.png
362
+ - app/assets/images/govuk_publishing_components/crests/ukaea_crest_13px_x2.png
363
+ - app/assets/images/govuk_publishing_components/crests/ukaea_crest_18px.png
364
+ - app/assets/images/govuk_publishing_components/crests/ukaea_crest_18px_x2.png
365
+ - app/assets/images/govuk_publishing_components/crests/ukho_13px.png
366
+ - app/assets/images/govuk_publishing_components/crests/ukho_13px_x2.png
367
+ - app/assets/images/govuk_publishing_components/crests/ukho_18px.png
368
+ - app/assets/images/govuk_publishing_components/crests/ukho_18px_x2.png
369
+ - app/assets/images/govuk_publishing_components/crests/wales_crest_13px.png
370
+ - app/assets/images/govuk_publishing_components/crests/wales_crest_13px_x2.png
371
+ - app/assets/images/govuk_publishing_components/crests/wales_crest_18px.png
372
+ - app/assets/images/govuk_publishing_components/crests/wales_crest_18px_x2.png
324
373
  - app/assets/images/govuk_publishing_components/favicon-development.png
325
374
  - app/assets/images/govuk_publishing_components/favicon-example.png
326
375
  - app/assets/images/govuk_publishing_components/favicon-integration.png