content_block_tools 1.1.2 → 1.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd6b4006445fa5c5a11bf7f14e6ccfcd1819a9bc043af6f3ad19a56334d54172
4
- data.tar.gz: 8c513039b815152a5a3bdb0171dc89e4ec6934068ebc46c25c93d64801943d1f
3
+ metadata.gz: 8eaf6461d1a3b0c0d4f9f9999b13b7dd95f0cb0f07bdad91174dbbfcb0fb94da
4
+ data.tar.gz: ae118092745994163db792b1baca46e534cba8451d49b31cc808f32d7c192d8f
5
5
  SHA512:
6
- metadata.gz: 2c96843959e74701746dc5aa20e8b605ad811c810b703f55d6d2cd3ad84a5c17c43bfefe741a5099fedc31f3a67480ee3c4e1d9d8a0ef24d9d4fe4f9ea3eec54
7
- data.tar.gz: d7a5a5463e75a58b615fa680e4f0ef264d95e1b5c14c2474b40fdc2e61c9bcb01064052cbcf70461968c059206b3fb288ea658328b9554bd3a15e002e17283a9
6
+ metadata.gz: 21dd38c329536b4b25ee51fb09e78822c66fba03ed11c9dacfd6a4758a524adaefcb23b5d77577163ea85c89175c410ca8356e9aa88de1104c97ba6ebf11169a
7
+ data.tar.gz: 1393d4cec16f7bb6d4ee2676cc89e39e4daab8bae297b9451b6da9ab051fc1e36a16ac7f472a6105e5b800c0614767c6b1a678c10b1c4a07ce695b56798e1c81
@@ -1,25 +1,26 @@
1
- @import "govuk/core/links";
2
1
  @import "govuk/core/lists";
3
2
  @import "govuk/core/typography";
4
3
 
5
- @import "blocks/contact";
6
-
7
4
  .content-block {
8
- &__body {
9
- @extend %govuk-body-m;
5
+ &__contact-key, &__contact-value, &__contact-list {
6
+ margin: 0;
7
+ padding: 0;
10
8
  }
11
9
 
12
- ul#{&}__list {
13
- @extend %govuk-list;
14
- margin-left: 0;
10
+ &__contact-list {
11
+ .content-block__contact-key {
12
+ @extend %govuk-heading-m;
13
+ }
15
14
 
16
- & > li {
17
- list-style: none;
18
- margin-bottom: govuk-spacing(1);
15
+ &--nested {
16
+ .content-block__contact-key {
17
+ @extend %govuk-heading-s;
18
+ }
19
19
  }
20
20
  }
21
21
 
22
- &__link {
23
- @extend %govuk-link;
22
+ ul.content-block__list {
23
+ @extend %govuk-list;
24
+ margin-left: 0;
24
25
  }
25
26
  }
@@ -1,18 +1,23 @@
1
- <div class="vcard">
2
- <p class="fn org content-block__title"><%= content_block.title %></p>
3
-
4
- <% if !block_type.present? && content_block.details[:description] %>
5
- <%= render_govspeak(content_block.details[:description]) %>
6
- <% end %>
1
+ <dl class="vcard content-block__contact-list">
2
+ <dt class="content-block__contact-key fn org"><%= content_block.title %></dt>
7
3
 
8
4
  <% if block_type.nil? %>
9
- <% BLOCK_TYPES.each do |block_type| %>
10
- <% content_for_block_type(block_type).each do |item| %>
11
- <p class="content-block__subtitle"><%= item[:title] %></p>
12
- <%= component_for_block_type(block_type).new(item:).render.html_safe %>
13
- <% end %>
14
- <% end %>
5
+ <dd class="content-block__contact-value">
6
+ <%= render_govspeak(content_block.details[:description]) if content_block.details[:description] %>
7
+ <dl class="content-block__contact-list--nested">
8
+ <% BLOCK_TYPES.each do |block_type| %>
9
+ <% content_for_block_type(block_type).each do |item| %>
10
+ <dt class="content-block__contact-key"><%= item[:title] %></dt>
11
+ <dd class="content-block__contact-value">
12
+ <%= component_for_block_type(block_type).new(item:).render.html_safe %>
13
+ </dd>
14
+ <% end %>
15
+ <% end %>
16
+ </dl>
17
+ </dd>
15
18
  <% else %>
16
- <%= component_for_block_type(block_type).new(item: item_to_render).render.html_safe %>
19
+ <dd class="content-block__contact-value">
20
+ <%= component_for_block_type(block_type).new(item: item_to_render).render.html_safe %>
21
+ </dd>
17
22
  <% end %>
18
- </div>
23
+ </dl>
@@ -1,4 +1,4 @@
1
- <p class="adr content-block__body">
1
+ <p class="adr">
2
2
  <%= lines.map { |field, value| address_line(field, value) }.join(",<br />").html_safe %>
3
3
  </p>
4
4
 
@@ -1,6 +1,6 @@
1
1
  <ul class="content-block__list">
2
2
  <li>
3
- <a href="<%= item[:url] %>" class="url content-block__link">
3
+ <a href="<%= item[:url] %>" class="url">
4
4
  <%= link_text %>
5
5
  </a>
6
6
  </li>
@@ -1,6 +1,6 @@
1
1
  <ul class="content-block__list">
2
2
  <li>
3
- <a href="<%= "mailto:#{item[:email_address]}#{query_params}" %>" class="email content-block__link">
3
+ <a href="<%= "mailto:#{item[:email_address]}#{query_params}" %>" class="email">
4
4
  <%= link_text %>
5
5
  </a>
6
6
  </li>
@@ -1,5 +1,5 @@
1
1
  <% if item[:description] %>
2
- <%= render_govspeak(item[:description], root_class: "content-block__body") %>
2
+ <%= render_govspeak(item[:description]) %>
3
3
  <% end %>
4
4
 
5
5
  <ul class="content-block__list">
@@ -16,16 +16,16 @@
16
16
  <% end %>
17
17
 
18
18
  <% if show_bsl_guidance? %>
19
- <%= render_govspeak(bsl_guidance[:value], root_class: "content-block__body") %>
19
+ <%= render_govspeak(bsl_guidance[:value]) %>
20
20
  <% end %>
21
21
 
22
22
  <% if show_opening_hours? %>
23
- <%= render_govspeak(opening_hours[:opening_hours], root_class: "content-block__body") %>
23
+ <%= render_govspeak(opening_hours[:opening_hours]) %>
24
24
  <% end %>
25
25
 
26
26
  <% if show_call_charges? %>
27
- <p class="content-block__body">
28
- <a href="<%= call_charges[:call_charges_info_url] %>" class="content-block__link">
27
+ <p>
28
+ <a href="<%= call_charges[:call_charges_info_url] %>">
29
29
  <%= call_charges[:label] %>
30
30
  </a>
31
31
  </p>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentBlockTools
4
- VERSION = "1.1.2"
4
+ VERSION = "1.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: content_block_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
@@ -99,14 +99,14 @@ dependencies:
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 10.6.1
102
+ version: 10.6.3
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 10.6.1
109
+ version: 10.6.3
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: rails
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -142,7 +142,6 @@ extensions: []
142
142
  extra_rdoc_files: []
143
143
  files:
144
144
  - README.md
145
- - app/assets/stylesheets/blocks/_contact.scss
146
145
  - app/assets/stylesheets/content_block_tools.scss
147
146
  - app/components/content_block_tools/base_component.rb
148
147
  - app/components/content_block_tools/contact_component.html.erb
@@ -1,13 +0,0 @@
1
- @import "govuk/core/typography";
2
-
3
- .content-block--contact {
4
- .content-block {
5
- &__title {
6
- @extend %govuk-heading-m;
7
- }
8
-
9
- &__subtitle {
10
- @extend %govuk-heading-s;
11
- }
12
- }
13
- }