govuk_publishing_components 15.3.0 → 16.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/govspeak.js +26 -0
  3. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js +26 -0
  4. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +96 -0
  5. data/app/assets/javascripts/govuk_publishing_components/vendor/jquery-ui-1.10.2.custom.js +1639 -0
  6. data/app/assets/javascripts/govuk_publishing_components/vendor/jquery.player.min.js +25 -0
  7. data/app/assets/javascripts/govuk_publishing_components/vendor/magna-charta.min.js +4 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_accessible-autocomplete.scss +1 -7
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +1 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +5 -5
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +0 -4
  13. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +5 -5
  15. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +1 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +3 -3
  17. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/{form-download.scss → _form-download.scss} +1 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +1 -1
  19. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +4 -4
  20. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +1 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +7 -0
  22. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +2 -2
  23. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +3 -3
  24. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +2 -2
  25. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
  26. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +11 -9
  27. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +2 -2
  28. data/app/views/govuk_publishing_components/components/_accessible_autocomplete.html.erb +17 -19
  29. data/app/views/govuk_publishing_components/components/_details.html.erb +2 -1
  30. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +2 -2
  31. data/app/views/govuk_publishing_components/components/_govspeak.html.erb +1 -1
  32. data/app/views/govuk_publishing_components/components/_inset_text.html.erb +1 -4
  33. data/app/views/govuk_publishing_components/components/_label.html.erb +5 -4
  34. data/app/views/govuk_publishing_components/components/_radio.html.erb +4 -5
  35. data/app/views/govuk_publishing_components/components/_textarea.html.erb +2 -0
  36. data/app/views/govuk_publishing_components/components/_warning_text.html.erb +1 -5
  37. data/app/views/govuk_publishing_components/components/docs/accessible_autocomplete.yml +0 -8
  38. data/app/views/govuk_publishing_components/components/docs/details.yml +6 -0
  39. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -4
  40. data/app/views/govuk_publishing_components/components/docs/label.yml +9 -0
  41. data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +2 -2
  42. data/lib/govuk_publishing_components/version.rb +1 -1
  43. data/node_modules/accessible-autocomplete/package.json +1 -1
  44. metadata +10 -5
@@ -1,5 +1,6 @@
1
1
  <% data_attributes ||= nil %>
2
- <%= tag.details class: "gem-c-details govuk-details", data: data_attributes do %>
2
+ <% open ||= nil %>
3
+ <%= tag.details class: "gem-c-details govuk-details", data: data_attributes, open: open do %>
3
4
  <summary class="govuk-details__summary">
4
5
  <span class="govuk-details__summary-text">
5
6
  <%= title %>
@@ -40,8 +40,8 @@
40
40
  </a>
41
41
  </li>
42
42
  <li>
43
- <a class="<%= 'active' if active == 'announcements' %>" href="/government/announcements">
44
- <%= t("govuk_component.government_navigation.announcements", default: "Announcements") %>
43
+ <a class="<%= 'active' if active == 'announcements' %>" href="/news-and-communications">
44
+ <%= t("govuk_component.government_navigation.news_and_communications", default: "News and communications") %>
45
45
  </a>
46
46
  </li>
47
47
  </ul>
@@ -7,7 +7,7 @@
7
7
  classes << "disable-youtube" if disable_youtube_expansions
8
8
  %>
9
9
 
10
- <div class="gem-c-govspeak govuk-govspeak <%= classes.join(" ") %>">
10
+ <div class="gem-c-govspeak govuk-govspeak <%= classes.join(" ") %>" data-module="govspeak">
11
11
  <% if local_assigns.include?(:content) %>
12
12
  <% if content.html_safe? %>
13
13
  <%= content %>
@@ -1,10 +1,7 @@
1
1
  <%
2
2
  id ||= "inset-text-#{SecureRandom.hex(4)}"
3
- classes ||= ''
4
- css_classes = %w( gem-c-inset-text govuk-inset-text )
5
- css_classes << classes if classes
6
3
  %>
7
4
 
8
- <%= tag.div id: id, class: css_classes do %>
5
+ <%= tag.div id: id, class: "gem-c-inset-text govuk-inset-text" do %>
9
6
  <%= text %>
10
7
  <% end %>
@@ -1,13 +1,14 @@
1
1
  <%
2
- classes ||= ''
3
2
  hint_text ||= ''
4
- hint_text_classes ||= ''
3
+ is_radio_label ||= false
5
4
  bold ||= false
5
+
6
6
  css_classes = %w( gem-c-label govuk-label )
7
7
  css_classes << "govuk-label--s" if bold
8
- css_classes << classes if classes
8
+ css_classes << "govuk-radios__label" if is_radio_label
9
+
9
10
  hint_text_css_classes = %w( govuk-hint )
10
- hint_text_css_classes << hint_text_classes if hint_text_classes
11
+ hint_text_css_classes << "govuk-radios__hint" if is_radio_label
11
12
  %>
12
13
 
13
14
  <%= tag.label for: html_for, class: css_classes do %>
@@ -89,8 +89,7 @@
89
89
  <%= render "govuk_publishing_components/components/label", {
90
90
  hint_id: label_hint_id,
91
91
  html_for: label_id,
92
- classes: "govuk-radios__label",
93
- hint_text_classes: "govuk-radios__hint",
92
+ is_radio_label: true,
94
93
  hint_text: item[:hint_text],
95
94
  text: item[:text],
96
95
  bold: item[:bold]
@@ -98,9 +97,9 @@
98
97
  <% end %>
99
98
 
100
99
  <% if item[:conditional] %>
101
- <div class="govuk-radios__conditional govuk-radios__conditional--hidden" id="<%= conditional_id %>">
102
- <%= item[:conditional] %>
103
- </div>
100
+ <div class="govuk-radios__conditional govuk-radios__conditional--hidden" id="<%= conditional_id %>">
101
+ <%= item[:conditional] %>
102
+ </div>
104
103
  <% end %>
105
104
 
106
105
  <% end %>
@@ -7,6 +7,7 @@
7
7
 
8
8
  label ||= nil
9
9
  hint ||= nil
10
+ margin_bottom ||= 3
10
11
  error_message ||= nil
11
12
  error_items ||= nil
12
13
  character_count ||= nil
@@ -18,6 +19,7 @@
18
19
  css_classes = %w(gem-c-textarea govuk-textarea)
19
20
  css_classes << "js-character-count" if character_count
20
21
  css_classes << "govuk-textarea--error" if has_error
22
+ css_classes << ([*0..9].include?(margin_bottom) ? "govuk-!-margin-bottom-#{margin_bottom}" : "govuk-!-margin-bottom-3")
21
23
  form_group_css_classes = %w(govuk-form-group)
22
24
  form_group_css_classes << "govuk-form-group--error" if has_error
23
25
 
@@ -1,21 +1,17 @@
1
1
  <%
2
2
  id ||= "warning-text-#{SecureRandom.hex(4)}"
3
- classes ||= ''
4
3
  text_assistive ||= 'Warning'
5
4
  text_icon ||= '!'
6
5
  large_font ||= false
7
6
  highlight_text ||= false
8
7
 
9
- css_classes = %w(gem-c-warning-text govuk-warning-text)
10
- css_classes << classes if classes
11
-
12
8
  text_classes = %w(govuk-warning-text__text)
13
9
  text_classes << "gem-c-warning-text__text--no-indent" if text_icon.empty?
14
10
  text_classes << "gem-c-warning-text__text--large" if large_font
15
11
  text_classes << "gem-c-warning-text__text--highlight" if highlight_text
16
12
  %>
17
13
 
18
- <%= tag.div id: id, class: css_classes do %>
14
+ <%= tag.div id: id, class: "gem-c-warning-text govuk-warning-text" do %>
19
15
  <% unless text_icon.empty? %>
20
16
  <%= tag.span text_icon, class: "govuk-warning-text__icon", "aria-hidden": "true" %>
21
17
  <% end %>
@@ -47,11 +47,3 @@ examples:
47
47
  label:
48
48
  text: 'Countries'
49
49
  options: [['France', 'fr'], ['Germany', 'de'], ['Sweden', 'se'], ['Switzerland', 'ch'], ['United Kingdom', 'gb'], ['United States', 'us'], ['The Separate Customs Territory of Taiwan, Penghu, Kinmen, and Matsu (Chinese Taipei)', 'tw']]
50
- with_multiple_selections_hide_facets:
51
- description: This parameter hides the facet tags shown by the component in multiple mode when options have been chosen. This seems counter to likely requirements but is needed for finders where the app generates its own facet tags.
52
- data:
53
- multiple: true
54
- hide_facets: true
55
- label:
56
- text: 'Countries'
57
- options: [['France', 'fr'], ['Germany', 'de'], ['Sweden', 'se'], ['Switzerland', 'ch'], ['United Kingdom', 'gb'], ['United States', 'us'], ['The Separate Customs Territory of Taiwan, Penghu, Kinmen, and Matsu (Chinese Taipei)', 'tw']]
@@ -28,3 +28,9 @@ examples:
28
28
  tracking: GTM-123AB
29
29
  block: |
30
30
  We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
31
+ open:
32
+ data:
33
+ title: Help with nationality
34
+ open: true
35
+ block: |
36
+ We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
@@ -7,12 +7,11 @@ body: |
7
7
 
8
8
  It applies styling to standard Markdown content, eg; paragraphs, headings and lists. It also applies styling to Govspeak specific markup, like [callouts](https://github.com/alphagov/govspeak#callouts), [contacts](https://github.com/alphagov/govspeak#points-of-contact) and [highlights](https://github.com/alphagov/govspeak#highlights).
9
9
 
10
- Static also [applies some Javascript behaviours to this component][1].
10
+ Some JavaScript behaviours are applied to this component:
11
11
 
12
- - Progressively enhanced, accessible charts (using [Magna Charta](https://github.com/alphagov/magna-charta), derived from tabular data (see example below)
13
- - Progressively enhanced, accessible embedded YouTube player (using [AccessibleMediaPlayer](https://github.com/alphagov/Accessible-Media-Player))
12
+ - Progressively enhanced, accessible charts (using [Magna Charta](https://github.com/alphagov/magna-charta), derived from tabular data (see [example](./govspeak/charts))
13
+ - Progressively enhanced, accessible embedded YouTube player (using [AccessibleMediaPlayer](https://github.com/alphagov/Accessible-Media-Player)) (see [example](./govspeak/with_youtube_embed))
14
14
 
15
- [1]: https://github.com/alphagov/static/tree/master/app/assets/javascripts/govuk-component
16
15
  accessibility_criteria: |
17
16
  - headings must be part of a correct heading structure for the page
18
17
  - text should have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
@@ -34,3 +34,12 @@ examples:
34
34
  html_for: "id-that-matches-input"
35
35
  hint_id: "should-match-aria-describedby-input-bold"
36
36
  hint_text: "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
37
+ inside_a_radio_component:
38
+ description: Then the label is used inside the [radio component](/component-guide/radio) additional classes are required on the radio, which are added by this option. This is already handled by the radio component and is a specific use case, but is worth documenting.
39
+ data:
40
+ text: "National Insurance number"
41
+ html_for: "id-that-matches-input"
42
+ is_radio_label: true
43
+ html_for: "id-radio"
44
+ hint_id: "id-radio"
45
+ hint_text: "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
@@ -107,8 +107,8 @@ examples:
107
107
  text: Policies
108
108
  - href: '/government/publications'
109
109
  text: Publications
110
- - href: '/government/announcements'
111
- text: Announcements
110
+ - href: '/news-and-communications'
111
+ text: News and communications
112
112
  meta:
113
113
  items:
114
114
  - href: '/help'
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '15.3.0'.freeze
2
+ VERSION = '16.0.0'.freeze
3
3
  end
@@ -49,7 +49,7 @@
49
49
  "/"
50
50
  ],
51
51
  "_resolved": "git://github.com/alphagov/accessible-autocomplete.git#0c518b4fa79b9a95b544410858486ed9e6403c84",
52
- "_shasum": "2a23fb1556e095fb6cdf1a602bf8a237de5122db",
52
+ "_shasum": "8ebbd2fed8be30664e8a43095c0a70ae6e55c294",
53
53
  "_shrinkwrap": null,
54
54
  "_spec": "accessible-autocomplete@git://github.com/alphagov/accessible-autocomplete.git#add-multiselect-support",
55
55
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
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: 15.3.0
4
+ version: 16.0.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-02-18 00:00:00.000000000 Z
11
+ date: 2019-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govspeak
@@ -316,14 +316,20 @@ files:
316
316
  - app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js
317
317
  - app/assets/javascripts/govuk_publishing_components/components/error-summary.js
318
318
  - app/assets/javascripts/govuk_publishing_components/components/feedback.js
319
+ - app/assets/javascripts/govuk_publishing_components/components/govspeak.js
319
320
  - app/assets/javascripts/govuk_publishing_components/components/initial-focus.js
320
321
  - app/assets/javascripts/govuk_publishing_components/components/radio.js
321
322
  - app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
322
323
  - app/assets/javascripts/govuk_publishing_components/dependencies.js
323
324
  - app/assets/javascripts/govuk_publishing_components/lib/current-location.js
325
+ - app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
326
+ - app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
324
327
  - app/assets/javascripts/govuk_publishing_components/lib/select.js
325
328
  - app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
326
329
  - app/assets/javascripts/govuk_publishing_components/lib/toggle.js
330
+ - app/assets/javascripts/govuk_publishing_components/vendor/jquery-ui-1.10.2.custom.js
331
+ - app/assets/javascripts/govuk_publishing_components/vendor/jquery.player.min.js
332
+ - app/assets/javascripts/govuk_publishing_components/vendor/magna-charta.min.js
327
333
  - app/assets/javascripts/govuk_publishing_components/vendor/modernizr.js
328
334
  - app/assets/stylesheets/component_guide/application.scss
329
335
  - app/assets/stylesheets/govuk_publishing_components/_all_components.scss
@@ -392,6 +398,7 @@ files:
392
398
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss
393
399
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss
394
400
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss
401
+ - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_form-download.scss
395
402
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss
396
403
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss
397
404
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss
@@ -405,7 +412,6 @@ files:
405
412
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
406
413
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss
407
414
  - app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss
408
- - app/assets/stylesheets/govuk_publishing_components/components/govspeak/form-download.scss
409
415
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss
410
416
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss
411
417
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss
@@ -1079,8 +1085,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1079
1085
  - !ruby/object:Gem::Version
1080
1086
  version: '0'
1081
1087
  requirements: []
1082
- rubyforge_project:
1083
- rubygems_version: 2.7.6
1088
+ rubygems_version: 3.0.1
1084
1089
  signing_key:
1085
1090
  specification_version: 4
1086
1091
  summary: A gem to document components in GOV.UK frontend applications