content_block_tools 1.1.2 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd6b4006445fa5c5a11bf7f14e6ccfcd1819a9bc043af6f3ad19a56334d54172
4
- data.tar.gz: 8c513039b815152a5a3bdb0171dc89e4ec6934068ebc46c25c93d64801943d1f
3
+ metadata.gz: 31aa623f594711bad29bb3e3dcd8540565f469a3432d9fd4a2d6d01e00cbef99
4
+ data.tar.gz: dbe0f54e0ed010a2cb110259ca56d81cadd782373119aa632d7b447c03fd10c2
5
5
  SHA512:
6
- metadata.gz: 2c96843959e74701746dc5aa20e8b605ad811c810b703f55d6d2cd3ad84a5c17c43bfefe741a5099fedc31f3a67480ee3c4e1d9d8a0ef24d9d4fe4f9ea3eec54
7
- data.tar.gz: d7a5a5463e75a58b615fa680e4f0ef264d95e1b5c14c2474b40fdc2e61c9bcb01064052cbcf70461968c059206b3fb288ea658328b9554bd3a15e002e17283a9
6
+ metadata.gz: e8f105b4fda9c8680ebf69f1bc48f79278e861050035a5febeac7d0cc932f1dc96dfcc793f1cb4c12161b57e24d17bc55da55b13ce125efe7d0118bd0648bc58
7
+ data.tar.gz: 868af6b530f82d1bc74877aa6baca6f20ebd86c07cd62b1ce233ddae724865676bca53d249ecce791a75377411761f073b094aa14265b6899baf7c36f1ebab3b
@@ -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.0"
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.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
@@ -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
- }