govuk_publishing_components 24.3.1 → 24.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbfbb444f86b61f46e110ab8615ca02b163357d6bf3125c4f4459bed3da8b92d
4
- data.tar.gz: 012a4752e5fd69378516db6348f18b14902714dc56e209951879f490af850f77
3
+ metadata.gz: c4d1ec41252338a07ea74058d30230718eeb00761dce65a04735b66f59c75edc
4
+ data.tar.gz: 2a9a849880b9ac590a9c1139d6aff23d4192ab85fd4263c766601ddda3d3ccb8
5
5
  SHA512:
6
- metadata.gz: 94f375971a2803179d77d070ee86113ea6e6a17d5e547d94c7229b7fcd643b2e8636eccb1f03369e26bb074517bdf411312826a721701efd55363fab244033a2
7
- data.tar.gz: 62c13a38b68951a6492044e29b4a7989ea2ea62e185b58c307707bdbbe9a013e4db03dc7c52b7d378f04474be5e8505751e5395d4c58f5d6cc8e8ded2a9ede83
6
+ metadata.gz: d4b9e972b59ff07f4ab7d5b58699ac24518c2420a66785f429a65d997ba546be5cdb8974522dbb7e13d96745e3f1eb54d13c8d6e8a5a04b1ef185f23fbd60e85
7
+ data.tar.gz: 3348baaafb42e9c5e78168a0628c4c1ada2b3087a4e6c990aa890e8ed71597614bf442db7d18fdc95deda650957bdbda339d8c1095947f3ae533d3319b3a874b
@@ -11,8 +11,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
11
11
  this.$module.revertToPasswordOnFormSubmit = this.revertToPasswordOnFormSubmit.bind(this)
12
12
  this.input.classList.add('gem-c-input--with-password')
13
13
 
14
- this.showPasswordText = this.$module.getAttribute('data-show')
15
- this.hidePasswordText = this.$module.getAttribute('data-hide')
14
+ this.showPasswordText = this.$module.getAttribute('data-show-text')
15
+ this.hidePasswordText = this.$module.getAttribute('data-hide-text')
16
+ this.showPasswordFullText = this.$module.getAttribute('data-show-full-text')
17
+ this.hidePasswordFullText = this.$module.getAttribute('data-hide-full-text')
16
18
  this.shownPassword = this.$module.getAttribute('data-announce-show')
17
19
  this.hiddenPassword = this.$module.getAttribute('data-announce-hide')
18
20
 
@@ -27,6 +29,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
27
29
  this.showHide.className = 'gem-c-show-password__toggle'
28
30
  this.showHide.setAttribute('aria-controls', this.input.getAttribute('id'))
29
31
  this.showHide.setAttribute('type', 'button')
32
+ this.showHide.setAttribute('aria-label', this.showPasswordFullText)
30
33
  this.showHide.innerHTML = this.showPasswordText
31
34
  this.wrapper.insertBefore(this.showHide, this.input.nextSibling)
32
35
 
@@ -50,12 +53,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
50
53
  ShowPassword.prototype.togglePassword = function (event) {
51
54
  event.preventDefault()
52
55
  this.showHide.innerHTML = this.showHide.innerHTML === this.showPasswordText ? this.hidePasswordText : this.showPasswordText
56
+ this.showHide.setAttribute('aria-label', this.showHide.getAttribute('aria-label') === this.showPasswordFullText ? this.hidePasswordFullText : this.showPasswordFullText)
53
57
  this.statusText.innerHTML = this.statusText.innerHTML === this.shownPassword ? this.hiddenPassword : this.shownPassword
54
58
  this.input.setAttribute('type', this.input.getAttribute('type') === 'text' ? 'password' : 'text')
55
59
  }
56
60
 
57
61
  ShowPassword.prototype.revertToPasswordOnFormSubmit = function (event) {
58
62
  this.showHide.innerHTML = this.showPasswordText
63
+ this.showHide.setAttribute('aria-label', this.showPasswordFullText)
59
64
  this.statusText.innerHTML = this.hiddenPassword
60
65
  this.input.setAttribute('type', 'password')
61
66
  }
@@ -21,6 +21,17 @@
21
21
  border-color: govuk-colour("white");
22
22
  }
23
23
 
24
+ .gem-c-breadcrumbs--border-bottom {
25
+ border-bottom: 1px solid $govuk-border-colour;
26
+ padding-bottom: govuk-spacing(1);
27
+
28
+ &.govuk-breadcrumbs--collapse-on-mobile {
29
+ @include govuk-media-query($until: tablet) {
30
+ padding-bottom: 0;
31
+ }
32
+ }
33
+ }
34
+
24
35
  .govuk-breadcrumbs--collapse-on-mobile {
25
36
  @include govuk-media-query($until: tablet) {
26
37
  .govuk-breadcrumbs__list-item {
@@ -1,19 +1,22 @@
1
1
  <%
2
+ border ||= false
2
3
  breadcrumbs ||= []
3
- inverse ||= false
4
4
  collapse_on_mobile ||= false
5
+ inverse ||= false
6
+
5
7
  breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
6
8
 
7
- classes = "gem-c-breadcrumbs govuk-breadcrumbs"
8
- classes << " govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
9
- classes << " gem-c-breadcrumbs--inverse" if inverse
9
+ classes = %w[gem-c-breadcrumbs govuk-breadcrumbs]
10
+ classes << "govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
11
+ classes << "gem-c-breadcrumbs--inverse" if inverse
12
+ classes << "gem-c-breadcrumbs--border-bottom" if border == "bottom"
10
13
  %>
11
14
 
12
15
  <script type="application/ld+json">
13
16
  <%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
14
17
  </script>
15
18
 
16
- <div class="<%= classes %>" data-module="gem-track-click">
19
+ <div class="<%= classes.join(" ") %>" data-module="gem-track-click">
17
20
  <ol class="govuk-breadcrumbs__list">
18
21
  <% breadcrumbs.each_with_index do |crumb, index| %>
19
22
  <% breadcrumb = GovukPublishingComponents::Presenters::Breadcrumb.new(crumb, index) %>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
2
3
  id ||= nil
3
4
  id_prefix ||= "radio-#{SecureRandom.hex(4)}"
4
5
  items ||= []
@@ -54,7 +55,7 @@
54
55
  <% end %>
55
56
  <% else %>
56
57
  <%= tag.legend class: legend_classes do %>
57
- <%= tag.h2 heading, class: "govuk-fieldset__heading" %>
58
+ <%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-fieldset__heading") %>
58
59
  <% end %>
59
60
  <% end %>
60
61
  <% end %>
@@ -19,10 +19,12 @@
19
19
  data: {
20
20
  module: "show-password",
21
21
  disable_form_submit_check: disable_form_submit_check,
22
- show: t('components.input.show'),
23
- hide: t('components.input.hide'),
24
- announce_show: t('components.input.announce_show'),
25
- announce_hide: t('components.input.announce_hide')
22
+ show_text: t('components.show_password.show'),
23
+ hide_text: t('components.show_password.hide'),
24
+ show_full_text: t('components.show_password.show_password'),
25
+ hide_full_text: t('components.show_password.hide_password'),
26
+ announce_show: t('components.show_password.announce_show'),
27
+ announce_hide: t('components.show_password.announce_hide')
26
28
  } do %>
27
29
  <%= render "govuk_publishing_components/components/input", {
28
30
  label: label,
@@ -97,3 +97,25 @@ examples:
97
97
  url: '/browse/abroad'
98
98
  - title: 'Travel abroad'
99
99
  url: '/browse/abroad/travel-abroad'
100
+ with_border:
101
+ description: "Set a border below the breadcrumb. Off by default."
102
+ data:
103
+ border: "bottom"
104
+ breadcrumbs:
105
+ - title: "Section"
106
+ url: "/section"
107
+ - title: "Sub-section"
108
+ url: "/section/sub-section"
109
+ - title: "Sub-sub-section"
110
+ url: "/section/sub-section/sub-section"
111
+ with_border_and_collapse_on_mobile:
112
+ data:
113
+ border: "bottom"
114
+ collapse_on_mobile: true
115
+ breadcrumbs:
116
+ - title: "Section"
117
+ url: "/section"
118
+ - title: "Sub-section"
119
+ url: "/section/sub-section"
120
+ - title: "Sub-sub-section"
121
+ url: "/section/sub-section/sub-section"
@@ -184,7 +184,7 @@ examples:
184
184
  text: "Blue"
185
185
  with_custom_heading_size:
186
186
  description: |
187
- This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
187
+ This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
188
188
 
189
189
  If the is_page_heading option is true and heading_size is not set, the text size will be xl.
190
190
  data:
@@ -198,6 +198,19 @@ examples:
198
198
  text: "Green"
199
199
  - value: "blue"
200
200
  text: "Blue"
201
+ with_custom_heading_level:
202
+ description: This allows the heading level to be changed. Heading level will default to `h2` if nothing is passed.
203
+ data:
204
+ name: "radio-group-description"
205
+ heading: "What is your favourite colour?"
206
+ heading_level: 3
207
+ items:
208
+ - value: "red"
209
+ text: "Red"
210
+ - value: "green"
211
+ text: "Green"
212
+ - value: "blue"
213
+ text: "Blue"
201
214
  with_hint_text_on_radios:
202
215
  data:
203
216
  name: "radio-group-hint-text"
@@ -54,11 +54,6 @@ en:
54
54
  what_wrong: "What went wrong?"
55
55
  send_me_survey: "Send me the survey"
56
56
  send: "Send"
57
- input:
58
- show: Show
59
- hide: Hide
60
- announce_show: Your password is shown
61
- announce_hide: Your password is hidden
62
57
  organisation_schema:
63
58
  all_content_search_description: "Find all content from %{organisation}"
64
59
  radio:
@@ -90,6 +85,13 @@ en:
90
85
  policies: "Policies"
91
86
  statistical_data_sets: "Statistical data sets"
92
87
  topical_events: "Topical events"
88
+ show_password:
89
+ show: Show
90
+ hide: Hide
91
+ show_password: Show password
92
+ hide_password: Hide password
93
+ announce_show: Your password is shown
94
+ announce_hide: Your password is hidden
93
95
  print_link:
94
96
  text: "Print this page"
95
97
  skip_link:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.3.1".freeze
2
+ VERSION = "24.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: 24.3.1
4
+ version: 24.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: 2021-02-25 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config