govuk_publishing_components 46.3.1 → 47.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +10 -1
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +6 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +4 -4
- data/app/models/govuk_publishing_components/component_doc.rb +1 -1
- data/app/models/govuk_publishing_components/component_wrapper_helper_options.rb +1 -0
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_contextual_guidance.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_details.html.erb +1 -4
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_govspeak.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_heading.html.erb +24 -10
- data/app/views/govuk_publishing_components/components/_hint.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_inset_text.html.erb +1 -3
- data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_notice.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_password_input.html.erb +1 -3
- data/app/views/govuk_publishing_components/components/_radio.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_signup_link.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +3 -4
- data/app/views/govuk_publishing_components/components/_skip_link.html.erb +6 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +17 -12
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +4 -7
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +6 -5
- data/app/views/govuk_publishing_components/components/docs/heading.yml +34 -10
- data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/skip_link.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +1 -0
- data/config/locales/ar.yml +0 -8
- data/config/locales/az.yml +0 -8
- data/config/locales/be.yml +0 -8
- data/config/locales/bg.yml +0 -8
- data/config/locales/bn.yml +0 -8
- data/config/locales/cs.yml +0 -8
- data/config/locales/cy.yml +0 -8
- data/config/locales/da.yml +0 -8
- data/config/locales/de.yml +0 -8
- data/config/locales/dr.yml +0 -8
- data/config/locales/el.yml +0 -8
- data/config/locales/en.yml +0 -8
- data/config/locales/es-419.yml +0 -8
- data/config/locales/es.yml +0 -8
- data/config/locales/et.yml +0 -8
- data/config/locales/fa.yml +0 -8
- data/config/locales/fi.yml +0 -8
- data/config/locales/fr.yml +0 -8
- data/config/locales/gd.yml +0 -8
- data/config/locales/gu.yml +0 -8
- data/config/locales/he.yml +0 -8
- data/config/locales/hi.yml +0 -8
- data/config/locales/hr.yml +0 -8
- data/config/locales/hu.yml +0 -8
- data/config/locales/hy.yml +0 -8
- data/config/locales/id.yml +0 -8
- data/config/locales/is.yml +0 -8
- data/config/locales/it.yml +0 -8
- data/config/locales/ja.yml +0 -8
- data/config/locales/ka.yml +0 -8
- data/config/locales/kk.yml +0 -8
- data/config/locales/ko.yml +0 -8
- data/config/locales/lt.yml +0 -8
- data/config/locales/lv.yml +0 -8
- data/config/locales/ms.yml +0 -8
- data/config/locales/mt.yml +0 -8
- data/config/locales/nl.yml +0 -8
- data/config/locales/no.yml +0 -8
- data/config/locales/pa-pk.yml +0 -8
- data/config/locales/pa.yml +0 -8
- data/config/locales/pl.yml +0 -8
- data/config/locales/ps.yml +0 -8
- data/config/locales/pt.yml +0 -8
- data/config/locales/ro.yml +0 -8
- data/config/locales/ru.yml +0 -8
- data/config/locales/si.yml +0 -8
- data/config/locales/sk.yml +0 -8
- data/config/locales/sl.yml +0 -8
- data/config/locales/so.yml +0 -8
- data/config/locales/sq.yml +0 -8
- data/config/locales/sr.yml +0 -8
- data/config/locales/sv.yml +0 -8
- data/config/locales/sw.yml +0 -8
- data/config/locales/ta.yml +0 -8
- data/config/locales/th.yml +0 -8
- data/config/locales/tk.yml +0 -8
- data/config/locales/tr.yml +0 -8
- data/config/locales/uk.yml +0 -8
- data/config/locales/ur.yml +0 -8
- data/config/locales/uz.yml +0 -8
- data/config/locales/vi.yml +0 -8
- data/config/locales/zh-hk.yml +0 -8
- data/config/locales/zh-tw.yml +0 -8
- data/config/locales/zh.yml +0 -8
- data/lib/govuk_publishing_components/presenters/component_wrapper_helper.rb +13 -0
- data/lib/govuk_publishing_components/presenters/heading_helper.rb +3 -3
- data/lib/govuk_publishing_components/presenters/organisation_logo_helper.rb +3 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +0 -1
- metadata +3 -38
- data/app/assets/javascripts/govuk_publishing_components/components/chart.js +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_chart.scss +0 -57
- data/app/assets/stylesheets/govuk_publishing_components/components/_chat-entry.scss +0 -39
- data/app/views/govuk_publishing_components/components/_chart.html.erb +0 -147
- data/app/views/govuk_publishing_components/components/_chat_entry.html.erb +0 -55
- data/app/views/govuk_publishing_components/components/docs/chart.yml +0 -576
- data/app/views/govuk_publishing_components/components/docs/chat_entry.yml +0 -45
- data/lib/govuk_publishing_components/presenters/chart_helper.rb +0 -112
- data/node_modules/chartkick/LICENSE.txt +0 -22
- data/node_modules/chartkick/README.md +0 -593
- data/node_modules/chartkick/chart.js/chart.esm.js +0 -5
- data/node_modules/chartkick/chart.js/package.json +0 -6
- data/node_modules/chartkick/dist/chartkick.esm.js +0 -2562
- data/node_modules/chartkick/dist/chartkick.js +0 -2570
- data/node_modules/chartkick/dist/chartkick.min.js +0 -2
- data/node_modules/chartkick/highcharts/highcharts.esm.js +0 -4
- data/node_modules/chartkick/highcharts/package.json +0 -6
- data/node_modules/chartkick/package.json +0 -50
data/config/locales/ms.yml
CHANGED
data/config/locales/mt.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/no.yml
CHANGED
data/config/locales/pa-pk.yml
CHANGED
data/config/locales/pa.yml
CHANGED
data/config/locales/pl.yml
CHANGED
data/config/locales/ps.yml
CHANGED
data/config/locales/pt.yml
CHANGED
data/config/locales/ro.yml
CHANGED
data/config/locales/ru.yml
CHANGED
data/config/locales/si.yml
CHANGED
data/config/locales/sk.yml
CHANGED
data/config/locales/sl.yml
CHANGED
data/config/locales/so.yml
CHANGED
@@ -32,14 +32,6 @@ so:
|
|
32
32
|
type:
|
33
33
|
characters: dabeecadaha
|
34
34
|
words: kalmadaha
|
35
|
-
chart:
|
36
|
-
accessibility_heading:
|
37
|
-
accessibility_html:
|
38
|
-
accessibility_link:
|
39
|
-
table_dropdown:
|
40
|
-
chat_entry:
|
41
|
-
description:
|
42
|
-
heading:
|
43
35
|
checkboxes:
|
44
36
|
or: ama
|
45
37
|
contents_list:
|
data/config/locales/sq.yml
CHANGED
data/config/locales/sr.yml
CHANGED
data/config/locales/sv.yml
CHANGED
data/config/locales/sw.yml
CHANGED
data/config/locales/ta.yml
CHANGED
@@ -32,14 +32,6 @@ ta:
|
|
32
32
|
type:
|
33
33
|
characters: எழுத்துருக்கள்
|
34
34
|
words: சொற்கள்
|
35
|
-
chart:
|
36
|
-
accessibility_heading:
|
37
|
-
accessibility_html:
|
38
|
-
accessibility_link:
|
39
|
-
table_dropdown:
|
40
|
-
chat_entry:
|
41
|
-
description:
|
42
|
-
heading:
|
43
35
|
checkboxes:
|
44
36
|
or: அல்லது
|
45
37
|
contents_list:
|
data/config/locales/th.yml
CHANGED
data/config/locales/tk.yml
CHANGED
data/config/locales/tr.yml
CHANGED
data/config/locales/uk.yml
CHANGED
data/config/locales/ur.yml
CHANGED
data/config/locales/uz.yml
CHANGED
data/config/locales/vi.yml
CHANGED
data/config/locales/zh-hk.yml
CHANGED
data/config/locales/zh-tw.yml
CHANGED
data/config/locales/zh.yml
CHANGED
@@ -14,6 +14,7 @@ module GovukPublishingComponents
|
|
14
14
|
check_hidden_is_valid(@options[:hidden]) if @options.include?(:hidden)
|
15
15
|
check_tabindex_is_valid(@options[:tabindex]) if @options.include?(:tabindex)
|
16
16
|
check_dir_is_valid(@options[:dir]) if @options.include?(:dir)
|
17
|
+
check_margin_bottom_is_valid(@options[:margin_bottom]) if @options.include?(:margin_bottom)
|
17
18
|
end
|
18
19
|
|
19
20
|
def all_attributes
|
@@ -22,7 +23,10 @@ module GovukPublishingComponents
|
|
22
23
|
attributes[:id] = @options[:id] unless @options[:id].blank?
|
23
24
|
attributes[:data] = @options[:data_attributes] unless @options[:data_attributes].blank?
|
24
25
|
attributes[:aria] = @options[:aria] unless @options[:aria].blank?
|
26
|
+
|
27
|
+
((@options[:classes] ||= "") << " govuk-!-margin-bottom-#{@options[:margin_bottom]}").strip! if @options[:margin_bottom]
|
25
28
|
attributes[:class] = @options[:classes] unless @options[:classes].blank?
|
29
|
+
|
26
30
|
attributes[:role] = @options[:role] unless @options[:role].blank?
|
27
31
|
attributes[:lang] = @options[:lang] unless @options[:lang].blank?
|
28
32
|
attributes[:open] = @options[:open] unless @options[:open].blank?
|
@@ -83,6 +87,11 @@ module GovukPublishingComponents
|
|
83
87
|
@options[:dir] = dir_attribute
|
84
88
|
end
|
85
89
|
|
90
|
+
def set_margin_bottom(margin_bottom)
|
91
|
+
check_margin_bottom_is_valid(margin_bottom)
|
92
|
+
@options[:margin_bottom] = margin_bottom
|
93
|
+
end
|
94
|
+
|
86
95
|
private
|
87
96
|
|
88
97
|
def check_id_is_valid(id)
|
@@ -170,6 +179,10 @@ module GovukPublishingComponents
|
|
170
179
|
end
|
171
180
|
end
|
172
181
|
|
182
|
+
def check_margin_bottom_is_valid(margin_bottom)
|
183
|
+
raise(ArgumentError, "margin_bottom option (#{margin_bottom}) is not recognised") unless [*0..9].include?(margin_bottom)
|
184
|
+
end
|
185
|
+
|
173
186
|
def check_dir_is_valid(dir_attribute)
|
174
187
|
return if dir_attribute.nil?
|
175
188
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
module GovukPublishingComponents
|
2
2
|
module Presenters
|
3
3
|
class HeadingHelper
|
4
|
-
attr_reader :heading_tag, :id, :classes
|
4
|
+
attr_reader :heading_tag, :id, :classes, :heading_classes
|
5
5
|
|
6
6
|
def initialize(options)
|
7
7
|
@id = options[:id]
|
8
8
|
|
9
9
|
@classes = ""
|
10
|
-
@classes << heading_size(options[:font_size])
|
11
|
-
@classes << " gem-c-heading--mobile-top-margin" if options[:mobile_top_margin]
|
12
10
|
@classes << " gem-c-heading--padding" if options[:padding]
|
13
11
|
@classes << " gem-c-heading--border-top-#{options[:border_top]}" if [1, 2, 5].include? options[:border_top]
|
14
12
|
@classes << " gem-c-heading--inverse" if options[:inverse]
|
13
|
+
|
14
|
+
@heading_classes = "gem-c-heading__text #{heading_size(options[:font_size])}"
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
@@ -4,7 +4,7 @@ module GovukPublishingComponents
|
|
4
4
|
include ActionView::Helpers
|
5
5
|
include ActionView::Context
|
6
6
|
|
7
|
-
attr_reader :name, :url, :crest, :image, :logo_image_src, :logo_image_alt
|
7
|
+
attr_reader :name, :url, :crest, :image, :logo_image_src, :logo_image_alt, :hide_underline
|
8
8
|
|
9
9
|
def initialize(local_assigns)
|
10
10
|
@name = local_assigns[:organisation][:name]
|
@@ -15,6 +15,7 @@ module GovukPublishingComponents
|
|
15
15
|
@logo_image_src = local_assigns[:organisation][:image][:url] || false
|
16
16
|
@logo_image_alt = local_assigns[:organisation][:image][:alt_text] || false
|
17
17
|
end
|
18
|
+
@hide_underline = local_assigns[:hide_underline] || false
|
18
19
|
end
|
19
20
|
|
20
21
|
def logo_content
|
@@ -28,6 +29,7 @@ module GovukPublishingComponents
|
|
28
29
|
def logo_container_class
|
29
30
|
logo_class = "gem-c-organisation-logo__container"
|
30
31
|
logo_class = "#{logo_class} gem-c-organisation-logo__link" if url
|
32
|
+
logo_class = "#{logo_class} gem-c-organisation-logo__link-hide-underline" if hide_underline
|
31
33
|
logo_class = "#{logo_class} gem-c-organisation-logo__crest gem-c-organisation-logo__crest--#{crest}" if crest
|
32
34
|
logo_class
|
33
35
|
end
|
@@ -15,7 +15,6 @@ require "govuk_publishing_components/presenters/big_number_helper"
|
|
15
15
|
require "govuk_publishing_components/presenters/breadcrumbs_helper"
|
16
16
|
require "govuk_publishing_components/presenters/breadcrumb_selector"
|
17
17
|
require "govuk_publishing_components/presenters/button_helper"
|
18
|
-
require "govuk_publishing_components/presenters/chart_helper"
|
19
18
|
require "govuk_publishing_components/presenters/contextual_navigation"
|
20
19
|
require "govuk_publishing_components/presenters/devolved_nations_helper"
|
21
20
|
require "govuk_publishing_components/presenters/emergency_banner_helper"
|