govuk_publishing_components 25.3.1 → 25.4.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: 4a7604846e82e7d5741665c02447fd53ed8b8e144b93764dffaedf745a4751a4
4
- data.tar.gz: bcb4e7566730869377d7c1570acc4dce95200267a3d3f79567d82a266d878d61
3
+ metadata.gz: d8c8ce0242fc9e1dac0d594933ea4f0edc235315a3fbc1e021d38e000ba28326
4
+ data.tar.gz: 36e25da868ef4303c553bf2bbca204a0b765ac87e4b84921984dd2c0da4217e1
5
5
  SHA512:
6
- metadata.gz: 40cf20a95a9129391d7395f71421ebfcf38656427a2b2f6f9e309164513751080bbb5eee944633c5d42a4ab7051ac1a26215fce1e97f45d0c97bff5017dcb602
7
- data.tar.gz: 3c2673f73683ca6375a62ec8c94ac7ee79bfd9a965cff5ba008d56f93a3c3fff41c473f2f9e79b74d0f2ba40fa23c093b805a782375b5030b1dc3eddd87404d2
6
+ metadata.gz: 100b3c1fc07b20fedb2acb1d4e2993b8f8bf38e8ab725b3af0d8f409ce71ba6d7c50953b76757852b59429e6b4cf5acaaea0827571279944b585cb3ecd76c3ea
7
+ data.tar.gz: 21e3f30700778d5d1b021294a366c00b6c9a407232184201eac41145c415c052432ae05d35e9905721b1ee91e851761de6191ab5c56919177b31f49bc7c2de65
@@ -7,7 +7,7 @@
7
7
 
8
8
  GOVUK.modules = {
9
9
  find: function (container) {
10
- container = container || $(document)
10
+ container = $(container || document)
11
11
 
12
12
  var modules
13
13
  var moduleSelector = '[data-module]'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "25.3.1".freeze
2
+ VERSION = "25.4.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: 25.3.1
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-12 00:00:00.000000000 Z
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