govuk_publishing_components 25.3.1 → 25.4.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 +4 -4
- data/app/assets/javascripts/govuk_publishing_components/modules.js +1 -1
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +9 -0
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +3 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8c8ce0242fc9e1dac0d594933ea4f0edc235315a3fbc1e021d38e000ba28326
|
|
4
|
+
data.tar.gz: 36e25da868ef4303c553bf2bbca204a0b765ac87e4b84921984dd2c0da4217e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 100b3c1fc07b20fedb2acb1d4e2993b8f8bf38e8ab725b3af0d8f409ce71ba6d7c50953b76757852b59429e6b4cf5acaaea0827571279944b585cb3ecd76c3ea
|
|
7
|
+
data.tar.gz: 21e3f30700778d5d1b021294a366c00b6c9a407232184201eac41145c415c052432ae05d35e9905721b1ee91e851761de6191ab5c56919177b31f49bc7c2de65
|
|
@@ -35,6 +35,15 @@ examples:
|
|
|
35
35
|
image_alt: "some meaningful alt text please"
|
|
36
36
|
heading_text: "I am not a heading"
|
|
37
37
|
heading_level: 0
|
|
38
|
+
with_lazy_loading:
|
|
39
|
+
description: The image can have an attribute of lazy loading. Defaults to auto if not passed.
|
|
40
|
+
data:
|
|
41
|
+
href: "/really-not-a-page"
|
|
42
|
+
image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
|
|
43
|
+
image_alt: "some meaningful alt text please"
|
|
44
|
+
image_loading: "lazy"
|
|
45
|
+
heading_text: "I am not a heading"
|
|
46
|
+
heading_level: 0
|
|
38
47
|
with_different_link_size:
|
|
39
48
|
description: |
|
|
40
49
|
Set a different font size for the link. Uses the [GOV.UK Frontend heading sizes](https://design-system.service.gov.uk/styles/typography/#headings) but defaults to 19px for legacy reasons. Valid options are `xl`, `l`, `m` and `s`.
|
|
@@ -4,7 +4,7 @@ module GovukPublishingComponents
|
|
|
4
4
|
include ActionView::Helpers
|
|
5
5
|
include ActionView::Context
|
|
6
6
|
|
|
7
|
-
attr_reader :href, :href_data_attributes, :extra_links, :large, :extra_links_no_indent, :heading_text, :metadata, :lang
|
|
7
|
+
attr_reader :href, :href_data_attributes, :extra_links, :large, :extra_links_no_indent, :heading_text, :metadata, :lang, :image_loading
|
|
8
8
|
|
|
9
9
|
def initialize(local_assigns)
|
|
10
10
|
@href = local_assigns[:href]
|
|
@@ -12,6 +12,7 @@ module GovukPublishingComponents
|
|
|
12
12
|
@extra_links = local_assigns[:extra_links] || []
|
|
13
13
|
@image_src = local_assigns[:image_src]
|
|
14
14
|
@image_alt = local_assigns[:image_alt] || ""
|
|
15
|
+
@image_loading = local_assigns[:image_loading] || "auto"
|
|
15
16
|
@context = local_assigns[:context]
|
|
16
17
|
@description = local_assigns[:description]
|
|
17
18
|
@large = local_assigns[:large]
|
|
@@ -35,7 +36,7 @@ module GovukPublishingComponents
|
|
|
35
36
|
def image
|
|
36
37
|
if @image_src
|
|
37
38
|
content_tag(:figure, class: "gem-c-image-card__image-wrapper") do
|
|
38
|
-
image_tag(@image_src, class: "gem-c-image-card__image", alt: @image_alt)
|
|
39
|
+
image_tag(@image_src, class: "gem-c-image-card__image", alt: @image_alt, loading: @image_loading)
|
|
39
40
|
end
|
|
40
41
|
end
|
|
41
42
|
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: 25.
|
|
4
|
+
version: 25.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-08-
|
|
11
|
+
date: 2021-08-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: govuk_app_config
|