govuk_publishing_components 12.18.0 → 12.19.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: 9637ab77188a87e3315641594e6b9b8658353730fdad44ec14e8b4883cb79a0b
4
- data.tar.gz: eb41ede84098dc57a10a1401239f1d8766f66680256f9b9e8b18dc6ff0bb82b2
3
+ metadata.gz: 673562f05efb32c78351c8203fab3ab6ab91fad2d78994e7b71c9f63b57eef2e
4
+ data.tar.gz: 411852c68773f034b6a1e7e4306dd252a38492421b30ffb4395bb65ba2aef7d0
5
5
  SHA512:
6
- metadata.gz: 71b761c24f67ac9dd032dddaef4ff3bffc03423d376ed786176446fe1c44072c8aa41518a59d81301641190fc5534b2cc113f39e48e8d3ef786b0fc675a3f2e7
7
- data.tar.gz: 1bee91ed89443c0d31e09597b5f56c8d56a329ecf763eb8ea0ac15d3442ea721087e1b0f85f29f26c6c1c60327033d4e928a5a8119666622e705810949bc9947
6
+ metadata.gz: 6b3fa833c9418774f104f0c2b3d804ac8530b3cc08c62462b28eef17602bfb53a5caaec29c408660a2f10fcc5a1cd2f131cc3b763ed55ec539304155cdf37942
7
+ data.tar.gz: 64852351b8c1c5fd3efe46091f68d005dea1da90d67073e37e69c5ec694b2a68ad7a7df48f8abd24705b62dbd17ed987416956f640270e8e56ca2547c360c04c
@@ -32,7 +32,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
32
32
  };
33
33
 
34
34
  this.toggleParentCheckbox = function(scope, checkbox) {
35
- var siblings = $(checkbox).parent('.govuk-checkboxes__item').siblings();
35
+ var siblings = $(checkbox).closest('.gem-c-checkboxes__list-item').siblings();
36
36
  var parent_id = scope.data('parent');
37
37
 
38
38
  if (checkbox.checked && siblings.length == siblings.find(':checked').length) {
@@ -1,10 +1,28 @@
1
1
  .govuk-checkboxes--nested {
2
2
  margin-left: (govuk-spacing(3) + 3px);
3
- padding-left: govuk-spacing(4);
4
3
  box-sizing: border-box;
5
4
  border-left-style: solid;
6
5
  border-left-width: 4px;
7
6
  border-color: govuk-colour('grey-2');
7
+ margin-top: govuk-spacing(2);
8
+ margin-bottom: govuk-spacing(2);
8
9
  padding: govuk-spacing(2) govuk-spacing(4);
9
- margin-bottom: govuk-spacing(3);
10
+
11
+ &.gem-c-checkboxes__list {
12
+ padding-left: govuk-spacing(4);
13
+ }
14
+ }
15
+
16
+ .gem-c-checkboxes__list {
17
+ padding-left: govuk-spacing(0);
18
+ }
19
+
20
+ .gem-c-checkboxes__list-item {
21
+ list-style: none;
22
+ margin-bottom: govuk-spacing(2);
23
+ }
24
+
25
+ .gem-c-checkboxes__list-item:last-child,
26
+ .gem-c-checkboxes__list-item:last-of-type {
27
+ margin-bottom: govuk-spacing(0);
10
28
  }
@@ -34,30 +34,34 @@
34
34
  <%= tag.span error, id: "#{id}-error", class: "govuk-error-message" %>
35
35
  <% end %>
36
36
 
37
- <%= tag.div class: "govuk-checkboxes", data: {
37
+ <%= tag.ul class: "govuk-checkboxes gem-c-checkboxes__list", data: {
38
38
  module: ('checkboxes' if has_conditional),
39
39
  nested: ('true' if has_nested),
40
40
  } do %>
41
41
  <% items.each_with_index do |item, index| %>
42
- <%= render 'govuk_publishing_components/components/checkbox', {
43
- id: id,
44
- name: name,
45
- item: item,
46
- index: index,
47
- } %>
48
- <% if item[:conditional] %>
49
- <%= tag.div item[:conditional], id: "#{id}-#{index}-conditional-#{index}", class: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden" %>
50
- <% end %>
42
+ <%= tag.li class: "gem-c-checkboxes__list-item" do %>
43
+ <%= render 'govuk_publishing_components/components/checkbox', {
44
+ id: id,
45
+ name: name,
46
+ item: item,
47
+ index: index,
48
+ } %>
49
+ <% if item[:conditional] %>
50
+ <%= tag.div item[:conditional], id: "#{id}-#{index}-conditional-#{index}", class: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden" %>
51
+ <% end %>
51
52
 
52
- <% if item[:items].present? %>
53
- <%= tag.div id: "#{id}-nested-#{index}", class: "govuk-checkboxes govuk-checkboxes--nested", data: { parent: "#{id}-#{index}" } do %>
54
- <% item[:items].each_with_index do |nested_item, nested_index| %>
55
- <%= render 'govuk_publishing_components/components/checkbox', {
56
- id: id,
57
- name: name,
58
- item: nested_item,
59
- index: "#{index}-#{nested_index}",
60
- } %>
53
+ <% if item[:items].present? %>
54
+ <%= tag.ul id: "#{id}-nested-#{index}", class: "govuk-checkboxes govuk-checkboxes--nested gem-c-checkboxes__list", data: { parent: "#{id}-#{index}" } do %>
55
+ <% item[:items].each_with_index do |nested_item, nested_index| %>
56
+ <%= tag.li class: "gem-c-checkboxes__list-item" do %>
57
+ <%= render 'govuk_publishing_components/components/checkbox', {
58
+ id: id,
59
+ name: name,
60
+ item: nested_item,
61
+ index: "#{index}-#{nested_index}",
62
+ } %>
63
+ <% end %>
64
+ <% end %>
61
65
  <% end %>
62
66
  <% end %>
63
67
  <% end %>
@@ -1,5 +1,6 @@
1
1
  <%
2
2
  button_data_attributes ||= nil
3
+ input_data_attributes ||= nil
3
4
  %>
4
5
  <div class="gem-c-copy-to-clipboard" data-module="copy-to-clipboard">
5
6
  <%= render "govuk_publishing_components/components/input", {
@@ -8,6 +9,7 @@
8
9
  },
9
10
  name: SecureRandom.hex,
10
11
  value: copyable_content,
12
+ data: input_data_attributes,
11
13
  readonly: true,
12
14
  } %>
13
15
 
@@ -1,4 +1,5 @@
1
- <details class="gem-c-details govuk-details">
1
+ <% data_attributes ||= nil %>
2
+ <%= tag.details class: "gem-c-details govuk-details", data: data_attributes do %>
2
3
  <summary class="govuk-details__summary">
3
4
  <span class="govuk-details__summary-text">
4
5
  <%= title %>
@@ -7,4 +8,4 @@
7
8
  <div class="govuk-details__text">
8
9
  <%= yield %>
9
10
  </div>
10
- </details>
11
+ <% end %>
@@ -13,9 +13,10 @@
13
13
  <ul class="govuk-tabs__list">
14
14
  <% tabs.each do |tab| %>
15
15
  <li class="govuk-tabs__list-item">
16
- <a class="govuk-tabs__tab" href="#<%= tab[:id] %>">
17
- <%= tab[:label] %>
18
- </a>
16
+ <%= link_to(tab[:label],
17
+ "##{tab[:id]}",
18
+ class: "govuk-tabs__tab",
19
+ data: tab[:tab_data_attributes]) %>
19
20
  </li>
20
21
  <% end %>
21
22
  </ul>
@@ -6,10 +6,12 @@ examples:
6
6
  label: Copy and send this link to someone and they’ll be able to preview your draft on GOV.UK.
7
7
  copyable_content: http://www.example.org
8
8
  button_text: Copy link
9
- with_button_data_attributes:
9
+ with_data_attributes:
10
10
  data:
11
11
  label: Copy and send this link to someone and they’ll be able to preview your draft on GOV.UK.
12
12
  copyable_content: http://www.example.org
13
+ input_data_attributes:
14
+ "tracking-code": GA-123ABC
13
15
  button_text: Copy link
14
16
  button_data_attributes:
15
17
  "tracking-code": GA-123ABC
@@ -21,3 +21,10 @@ examples:
21
21
  title: Help with nationality
22
22
  block: |
23
23
  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.
24
+ with_data_attributes:
25
+ data:
26
+ title: Help with nationality
27
+ data_attributes:
28
+ tracking: GTM-123AB
29
+ block: |
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.
@@ -64,3 +64,20 @@ examples:
64
64
  label: "Single piece of content"
65
65
  content: |
66
66
  <p class="govuk-body-m">Here is a single piece of content, there should be no tabs.</p>
67
+ with_data_attributes:
68
+ data:
69
+ tabs:
70
+ - id: "tab-with-data-attributes-1"
71
+ label: "First section"
72
+ title: "First section"
73
+ tab_data_attributes:
74
+ tracking: GTM-123AB
75
+ content: |
76
+ <p class="govuk-body-m">Fusce at dictum tellus, ac accumsan est. Nulla vitae turpis in nulla gravida tincidunt. Duis lectus felis, tempus id bibendum sit amet, posuere ut elit. Donec enim odio, eleifend in urna a, sagittis egestas est. Proin id ex ultricies, porta eros id, vehicula quam. Morbi non sagittis velit.</p>
77
+ - id: "tab-with-data-attributes-2"
78
+ label: "Second section"
79
+ title: "Second section"
80
+ tab_data_attributes:
81
+ tracking: GTM-123AB
82
+ content: |
83
+ <p class="govuk-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam congue elementum commodo. Vestibulum elit turpis, efficitur quis posuere vitae, commodo vitae augue. Donec ut pharetra ligula. Phasellus ac mauris eu felis bibendum dapibus rutrum sed quam. Pellentesque posuere ante id consequat pretium.</p>
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '12.18.0'.freeze
2
+ VERSION = '12.19.0'.freeze
3
3
  end
@@ -2,18 +2,18 @@
2
2
  "_args": [
3
3
  [
4
4
  {
5
- "raw": "govuk-frontend@^2.2.0",
5
+ "raw": "govuk-frontend@^2.4.0",
6
6
  "scope": null,
7
7
  "escapedName": "govuk-frontend",
8
8
  "name": "govuk-frontend",
9
- "rawSpec": "^2.2.0",
10
- "spec": ">=2.2.0 <3.0.0",
9
+ "rawSpec": "^2.4.0",
10
+ "spec": ">=2.4.0 <3.0.0",
11
11
  "type": "range"
12
12
  },
13
13
  "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ"
14
14
  ]
15
15
  ],
16
- "_from": "govuk-frontend@>=2.2.0 <3.0.0",
16
+ "_from": "govuk-frontend@>=2.4.0 <3.0.0",
17
17
  "_hasShrinkwrap": false,
18
18
  "_id": "govuk-frontend@2.4.0",
19
19
  "_inCache": true,
@@ -30,12 +30,12 @@
30
30
  "_npmVersion": "5.6.0",
31
31
  "_phantomChildren": {},
32
32
  "_requested": {
33
- "raw": "govuk-frontend@^2.2.0",
33
+ "raw": "govuk-frontend@^2.4.0",
34
34
  "scope": null,
35
35
  "escapedName": "govuk-frontend",
36
36
  "name": "govuk-frontend",
37
- "rawSpec": "^2.2.0",
38
- "spec": ">=2.2.0 <3.0.0",
37
+ "rawSpec": "^2.4.0",
38
+ "spec": ">=2.4.0 <3.0.0",
39
39
  "type": "range"
40
40
  },
41
41
  "_requiredBy": [
@@ -44,7 +44,7 @@
44
44
  "_resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-2.4.0.tgz",
45
45
  "_shasum": "a4f32f09f2120166006f2d0c2aa32cccf75f95ef",
46
46
  "_shrinkwrap": null,
47
- "_spec": "govuk-frontend@^2.2.0",
47
+ "_spec": "govuk-frontend@^2.4.0",
48
48
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
49
49
  "author": {
50
50
  "name": "GOV.UK Design System Team",
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: 12.18.0
4
+ version: 12.19.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: 2018-12-04 00:00:00.000000000 Z
11
+ date: 2018-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govspeak