govuk_publishing_components 35.9.0 → 35.10.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: 619cac6fc6ecb8078d66be77a50e1fe4d5f320b61a15e574fbd92a892d896d80
4
- data.tar.gz: d339abcad29fe3e59dafe2157e3ba605c8817563797b30bead89650ebe5d278f
3
+ metadata.gz: 8d14e21647dbbbe8c13a60c4ec7aaf3e1058cf97d9e52abb27e749eb63ec0725
4
+ data.tar.gz: 76f8f7c6c2b641eb874b59f5b73b4c43c21ee3b834c36bd35a2e561fb25993e8
5
5
  SHA512:
6
- metadata.gz: a163d27c8f13d7019869a16ac1f0c58c4c71e88be7c456e1639cb717bdf3f0da4c483ae7336824ed288d2888e5f0e671e1b1120fe910fa75d838aa85da998f98
7
- data.tar.gz: 87d03d1a7c4f50d4065b501c8f415831f218f28e2dd28ebfe61d87d270162ae595899ba46387d5bed9cc3b9472fbc7d47255fd573354bcfcc8477262aa574427
6
+ metadata.gz: 0e55ee7ba5da82893c875901e389f4017d8f0b3a30ed3da20d1f9eda6fca500447a0efe4d0cbc78b37c2c4a422e2a74131ece944c95fcbc8d55dbe143046b4db
7
+ data.tar.gz: 77f9962cda4b334df7d09c40d5c57f17881de115b3feabc5081202ad2179a193d943303548881375502f7adeb484ddb12caca2b3280adb95bbee7264949dc05a
@@ -9,6 +9,9 @@
9
9
  data_attributes ||= {}
10
10
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
11
11
 
12
+ container_class_names = %w[gem-c-attachment govuk-!-display-none-print]
13
+ container_class_names << shared_helper.get_margin_bottom if local_assigns.key?(:margin_bottom)
14
+
12
15
  case attachment.type
13
16
  when "file"
14
17
  if attachment.content_type_name
@@ -48,7 +51,7 @@
48
51
  end
49
52
 
50
53
  %>
51
- <%= tag.section class: "gem-c-attachment govuk-!-display-none-print" do %>
54
+ <%= tag.section class: class_names(container_class_names) do %>
52
55
  <%= tag.div class: "gem-c-attachment__thumbnail" do %>
53
56
  <%= link_to attachment.url,
54
57
  class: "govuk-link",
@@ -86,6 +86,16 @@ examples:
86
86
  file_size: 20000
87
87
  data_attributes:
88
88
  gtm: "attachment-preview"
89
+ with_margin_bottom:
90
+ description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to no margin bottom.
91
+ data:
92
+ attachment:
93
+ title: "Department for Transport information asset register"
94
+ url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/747661/department-for-transport-information-asset-register.csv
95
+ filename: department-for-transport-information-asset-register.csv
96
+ content_type: application/pdf
97
+ file_size: 20000
98
+ margin_bottom: 9
89
99
  command_paper_numbered:
90
100
  description: |
91
101
  Command paper, numbered
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "35.9.0".freeze
2
+ VERSION = "35.10.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: 35.9.0
4
+ version: 35.10.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: 2023-07-03 00:00:00.000000000 Z
11
+ date: 2023-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config