govuk_publishing_components 46.4.0 → 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/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/views/govuk_publishing_components/components/_heading.html.erb +24 -9
- data/app/views/govuk_publishing_components/components/_skip_link.html.erb +6 -1
- 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_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/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 -36
- 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 -146
- 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/zh-tw.yml
CHANGED
data/config/locales/zh.yml
CHANGED
@@ -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"
|
metadata
CHANGED
@@ -1,29 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 47.0.0
|
5
5
|
platform: ruby
|
6
|
-
original_platform: ''
|
7
6
|
authors:
|
8
7
|
- GOV.UK Dev
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: chartkick
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
12
|
- !ruby/object:Gem::Dependency
|
28
13
|
name: govuk_app_config
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -479,7 +464,6 @@ files:
|
|
479
464
|
- app/assets/javascripts/govuk_publishing_components/components/add-another.js
|
480
465
|
- app/assets/javascripts/govuk_publishing_components/components/button.js
|
481
466
|
- app/assets/javascripts/govuk_publishing_components/components/character-count.js
|
482
|
-
- app/assets/javascripts/govuk_publishing_components/components/chart.js
|
483
467
|
- app/assets/javascripts/govuk_publishing_components/components/checkboxes.js
|
484
468
|
- app/assets/javascripts/govuk_publishing_components/components/contextual-guidance.js
|
485
469
|
- app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js
|
@@ -540,8 +524,6 @@ files:
|
|
540
524
|
- app/assets/stylesheets/govuk_publishing_components/components/_button.scss
|
541
525
|
- app/assets/stylesheets/govuk_publishing_components/components/_cards.scss
|
542
526
|
- app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss
|
543
|
-
- app/assets/stylesheets/govuk_publishing_components/components/_chart.scss
|
544
|
-
- app/assets/stylesheets/govuk_publishing_components/components/_chat-entry.scss
|
545
527
|
- app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss
|
546
528
|
- app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss
|
547
529
|
- app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss
|
@@ -682,8 +664,6 @@ files:
|
|
682
664
|
- app/views/govuk_publishing_components/components/_button.html.erb
|
683
665
|
- app/views/govuk_publishing_components/components/_cards.html.erb
|
684
666
|
- app/views/govuk_publishing_components/components/_character_count.html.erb
|
685
|
-
- app/views/govuk_publishing_components/components/_chart.html.erb
|
686
|
-
- app/views/govuk_publishing_components/components/_chat_entry.html.erb
|
687
667
|
- app/views/govuk_publishing_components/components/_checkboxes.html.erb
|
688
668
|
- app/views/govuk_publishing_components/components/_contents_list.html.erb
|
689
669
|
- app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb
|
@@ -779,8 +759,6 @@ files:
|
|
779
759
|
- app/views/govuk_publishing_components/components/docs/button.yml
|
780
760
|
- app/views/govuk_publishing_components/components/docs/cards.yml
|
781
761
|
- app/views/govuk_publishing_components/components/docs/character_count.yml
|
782
|
-
- app/views/govuk_publishing_components/components/docs/chart.yml
|
783
|
-
- app/views/govuk_publishing_components/components/docs/chat_entry.yml
|
784
762
|
- app/views/govuk_publishing_components/components/docs/checkboxes.yml
|
785
763
|
- app/views/govuk_publishing_components/components/docs/contents_list.yml
|
786
764
|
- app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml
|
@@ -960,7 +938,6 @@ files:
|
|
960
938
|
- lib/govuk_publishing_components/presenters/breadcrumb_selector.rb
|
961
939
|
- lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb
|
962
940
|
- lib/govuk_publishing_components/presenters/button_helper.rb
|
963
|
-
- lib/govuk_publishing_components/presenters/chart_helper.rb
|
964
941
|
- lib/govuk_publishing_components/presenters/checkboxes_helper.rb
|
965
942
|
- lib/govuk_publishing_components/presenters/component_wrapper_helper.rb
|
966
943
|
- lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors.rb
|
@@ -1070,16 +1047,6 @@ files:
|
|
1070
1047
|
- node_modules/axe-core/locales/zh_TW.json
|
1071
1048
|
- node_modules/axe-core/package.json
|
1072
1049
|
- node_modules/axe-core/sri-history.json
|
1073
|
-
- node_modules/chartkick/LICENSE.txt
|
1074
|
-
- node_modules/chartkick/README.md
|
1075
|
-
- node_modules/chartkick/chart.js/chart.esm.js
|
1076
|
-
- node_modules/chartkick/chart.js/package.json
|
1077
|
-
- node_modules/chartkick/dist/chartkick.esm.js
|
1078
|
-
- node_modules/chartkick/dist/chartkick.js
|
1079
|
-
- node_modules/chartkick/dist/chartkick.min.js
|
1080
|
-
- node_modules/chartkick/highcharts/highcharts.esm.js
|
1081
|
-
- node_modules/chartkick/highcharts/package.json
|
1082
|
-
- node_modules/chartkick/package.json
|
1083
1050
|
- node_modules/govuk-frontend/README.md
|
1084
1051
|
- node_modules/govuk-frontend/dist/govuk-prototype-kit/init.js
|
1085
1052
|
- node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss
|
@@ -2027,7 +1994,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2027
1994
|
- !ruby/object:Gem::Version
|
2028
1995
|
version: '0'
|
2029
1996
|
requirements: []
|
2030
|
-
rubygems_version: 3.6.
|
1997
|
+
rubygems_version: 3.6.2
|
2031
1998
|
specification_version: 4
|
2032
1999
|
summary: A gem to document components in GOV.UK frontend applications
|
2033
2000
|
test_files: []
|
@@ -1 +0,0 @@
|
|
1
|
-
//= require chartkick
|
@@ -1,57 +0,0 @@
|
|
1
|
-
@import "govuk_publishing_components/individual_component_support";
|
2
|
-
|
3
|
-
.gem-c-chart {
|
4
|
-
position: relative;
|
5
|
-
|
6
|
-
// slight hack to hide the table automatically added by the charts JS
|
7
|
-
// not needed as we already output the table manually in the component
|
8
|
-
svg + div:has(table) {
|
9
|
-
display: none;
|
10
|
-
}
|
11
|
-
|
12
|
-
.google-visualization-tooltip {
|
13
|
-
background-color: govuk-colour("black");
|
14
|
-
box-shadow: none;
|
15
|
-
border: 0;
|
16
|
-
|
17
|
-
span {
|
18
|
-
color: govuk-colour("white");
|
19
|
-
@include govuk-font($size: 16, $weight: bold);
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
.gem-c-chart__table-wrapper {
|
25
|
-
overflow: auto;
|
26
|
-
}
|
27
|
-
|
28
|
-
.gem-c-chart__table {
|
29
|
-
margin-top: govuk-spacing(3);
|
30
|
-
|
31
|
-
.govuk-table {
|
32
|
-
margin: 0;
|
33
|
-
}
|
34
|
-
|
35
|
-
.govuk-table .govuk-table__header {
|
36
|
-
text-align: center;
|
37
|
-
}
|
38
|
-
|
39
|
-
.govuk-table .govuk-table__cell {
|
40
|
-
text-align: center;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
.gem-c-chart .gem-c-chart__a11y-note-link {
|
45
|
-
display: none;
|
46
|
-
margin-bottom: govuk-spacing(2);
|
47
|
-
}
|
48
|
-
|
49
|
-
.js-enabled {
|
50
|
-
.gem-c-chart .gem-c-chart__a11y-note-link {
|
51
|
-
display: inline;
|
52
|
-
}
|
53
|
-
|
54
|
-
.gem-c-chart .gem-c-chart__a11y-note-link:focus-within {
|
55
|
-
display: inline-block;
|
56
|
-
}
|
57
|
-
}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
@import "govuk_publishing_components/individual_component_support";
|
2
|
-
|
3
|
-
.gem-c-chat-entry {
|
4
|
-
display: flex;
|
5
|
-
align-items: flex-start;
|
6
|
-
background-color: govuk-tint(govuk-colour("blue"), 90%);
|
7
|
-
padding: govuk-spacing(4);
|
8
|
-
}
|
9
|
-
|
10
|
-
.gem-c-chat-entry--margin-top-until-tablet {
|
11
|
-
@include govuk-media-query($until: tablet) {
|
12
|
-
margin-top: 35px;
|
13
|
-
}
|
14
|
-
}
|
15
|
-
|
16
|
-
.gem-c-chat-entry--border-top {
|
17
|
-
border-top: 2px solid govuk-colour("blue");
|
18
|
-
padding-top: govuk-spacing(5);
|
19
|
-
}
|
20
|
-
|
21
|
-
.gem-c-chat-entry--border-bottom {
|
22
|
-
border-bottom: 2px solid govuk-colour("blue");
|
23
|
-
padding-bottom: govuk-spacing(5);
|
24
|
-
}
|
25
|
-
|
26
|
-
.gem-c-chat-entry__image {
|
27
|
-
flex-shrink: 0;
|
28
|
-
height: 40px;
|
29
|
-
margin-right: govuk-spacing(3);
|
30
|
-
width: 40px;
|
31
|
-
}
|
32
|
-
|
33
|
-
.gem-c-chat-entry__heading {
|
34
|
-
margin: 0 0 govuk-spacing(2);
|
35
|
-
font-size: 19px;
|
36
|
-
font-size: govuk-px-to-rem(19);
|
37
|
-
line-height: 1.25;
|
38
|
-
@include govuk-typography-common;
|
39
|
-
}
|
@@ -1,146 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
add_gem_component_stylesheet("chart")
|
3
|
-
add_gem_component_stylesheet("table")
|
4
|
-
add_gem_component_stylesheet("details")
|
5
|
-
add_gem_component_stylesheet("heading")
|
6
|
-
add_gem_component_stylesheet("skip-link")
|
7
|
-
|
8
|
-
chart_heading_level ||= 2
|
9
|
-
table_direction ||= "horizontal"
|
10
|
-
rows ||= []
|
11
|
-
keys ||= []
|
12
|
-
chart_overview ||= nil
|
13
|
-
chart_type ||= "line"
|
14
|
-
minimal ||= false
|
15
|
-
hide_heading ||= minimal
|
16
|
-
link ||= false
|
17
|
-
local_assigns[:margin_bottom] ||= 3
|
18
|
-
|
19
|
-
chart_id = "chart-id-#{SecureRandom.hex(4)}"
|
20
|
-
table_id = "table-id-#{SecureRandom.hex(4)}"
|
21
|
-
@external_script ||= OpenStruct.new(loaded: 0)
|
22
|
-
@external_script[:loaded] += 1
|
23
|
-
|
24
|
-
chart_helper = GovukPublishingComponents::Presenters::ChartHelper.new(local_assigns)
|
25
|
-
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
26
|
-
component_helper.add_class("gem-c-chart")
|
27
|
-
component_helper.add_class("gem-c-chart--minimal") if minimal
|
28
|
-
|
29
|
-
require "chartkick"
|
30
|
-
Chartkick.options[:html] = '<div id="%{id}"><noscript><p class="govuk-body">Our charts are built using JavaScript but all the data is also available in the table below.</p></noscript></div>'
|
31
|
-
|
32
|
-
if !minimal && !chart_heading
|
33
|
-
raise ArgumentError, "A chart heading must be provided for accessibility purposes."
|
34
|
-
end
|
35
|
-
%>
|
36
|
-
<% if rows.length > 0 && keys.length > 0 %>
|
37
|
-
<%= javascript_include_tag "https://www.gstatic.com/charts/loader.js" if @external_script[:loaded] == 1 %>
|
38
|
-
<%= tag.div(**component_helper.all_attributes) do %>
|
39
|
-
<% if chart_heading && !hide_heading %>
|
40
|
-
<div class="govuk-grid-row">
|
41
|
-
<div class="govuk-grid-column-two-thirds">
|
42
|
-
<%= render "govuk_publishing_components/components/heading", {
|
43
|
-
text: chart_heading,
|
44
|
-
heading_level: chart_heading_level,
|
45
|
-
margin_bottom: 2,
|
46
|
-
} %>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
<% end %>
|
50
|
-
|
51
|
-
<% aria_attributes = { hidden: true } if minimal %>
|
52
|
-
<%= content_tag :div, id: chart_id, class: "gem-c-chart__chart", aria: aria_attributes do %>
|
53
|
-
<% unless minimal %>
|
54
|
-
<div class="govuk-visually-hidden">
|
55
|
-
<%= content_tag :div, chart_overview, class: "gem-c-chart__a11y-note-1" if chart_overview %>
|
56
|
-
<%= content_tag :div, t("components.chart.accessibility_html"), class: "gem-c-chart__a11y-note-2" %>
|
57
|
-
</div>
|
58
|
-
<span class="gem-c-chart__a11y-note-link">
|
59
|
-
<%= render "govuk_publishing_components/components/skip_link", {
|
60
|
-
text: t("components.chart.accessibility_link", chart_heading: chart_heading),
|
61
|
-
href: "##{table_id}"
|
62
|
-
} %>
|
63
|
-
</span>
|
64
|
-
<% end %>
|
65
|
-
|
66
|
-
<% if chart_type == "column" %>
|
67
|
-
<%= column_chart(chart_helper.chart_format_data, library: chart_helper.chart_options) %>
|
68
|
-
<% elsif chart_type == "bar" %>
|
69
|
-
<%= bar_chart(chart_helper.chart_format_data, library: chart_helper.chart_options) %>
|
70
|
-
<% else %>
|
71
|
-
<%= line_chart(chart_helper.chart_format_data, library: chart_helper.chart_options) %>
|
72
|
-
<% end %>
|
73
|
-
<% end %>
|
74
|
-
|
75
|
-
<% unless minimal %>
|
76
|
-
<div class="gem-c-chart__table" id="<%= table_id %>">
|
77
|
-
<%= render("govuk_publishing_components/components/details",
|
78
|
-
title: t("components.chart.table_dropdown")
|
79
|
-
) do %>
|
80
|
-
<div tabindex="0" class="gem-c-chart__table-wrapper">
|
81
|
-
<table class="govuk-table">
|
82
|
-
<caption class="govuk-visually-hidden" id="<%= "data-table-caption-#{SecureRandom.hex(4)}" %>">
|
83
|
-
<%= t("components.chart.accessibility_heading", chart_heading: chart_heading) %>
|
84
|
-
</caption>
|
85
|
-
<% if table_direction == "horizontal" %>
|
86
|
-
<thead class="govuk-table__head">
|
87
|
-
<tr class="govuk-table__row">
|
88
|
-
<td class="govuk-table__cell"></td>
|
89
|
-
<% keys.each do |key| %>
|
90
|
-
<th class="govuk-table__header" scope="col">
|
91
|
-
<%= key %>
|
92
|
-
</th>
|
93
|
-
<% end %>
|
94
|
-
</tr>
|
95
|
-
</thead>
|
96
|
-
<tbody class="govuk-table__body">
|
97
|
-
<% rows.each do |row| %>
|
98
|
-
<tr class="govuk-table__row">
|
99
|
-
<th class="govuk-table__header" scope="row"><%= row[:label] %></th>
|
100
|
-
<% row[:values].each do |value| %>
|
101
|
-
<td class="govuk-table__cell govuk-table__cell--numeric">
|
102
|
-
<%= number_with_delimiter value %>
|
103
|
-
</td>
|
104
|
-
<% end %>
|
105
|
-
</tr>
|
106
|
-
<% end %>
|
107
|
-
</tbody>
|
108
|
-
<% else %>
|
109
|
-
<thead class="govuk-table__head">
|
110
|
-
<tr class="govuk-table__row">
|
111
|
-
<td class="govuk-table__cell"></td>
|
112
|
-
<% rows.each do |row| %>
|
113
|
-
<th class="govuk-table__header govuk-table__header--stacked" scope="row">
|
114
|
-
<%= row[:label] %>
|
115
|
-
</th>
|
116
|
-
<% end %>
|
117
|
-
</tr>
|
118
|
-
</thead>
|
119
|
-
<tbody class="govuk-table__body">
|
120
|
-
<% keys.each_with_index do |key, index| %>
|
121
|
-
<tr>
|
122
|
-
<th class="govuk-table__header" scope="row">
|
123
|
-
<%= key %>
|
124
|
-
</th>
|
125
|
-
<% rows.each do |row| %>
|
126
|
-
<td class="govuk-table__cell govuk-table__cell--numeric">
|
127
|
-
<%= number_with_delimiter row[:values][index] %>
|
128
|
-
</td>
|
129
|
-
<% end %>
|
130
|
-
</tr>
|
131
|
-
<% end %>
|
132
|
-
</tbody>
|
133
|
-
<% end %>
|
134
|
-
</table>
|
135
|
-
</div>
|
136
|
-
<% end %>
|
137
|
-
</div>
|
138
|
-
|
139
|
-
<% if link %>
|
140
|
-
<p class="govuk-body">
|
141
|
-
<%= link_to "Download chart data", link, class: "govuk-link" %>
|
142
|
-
</p>
|
143
|
-
<% end %>
|
144
|
-
<% end %>
|
145
|
-
<% end %>
|
146
|
-
<% end %>
|
@@ -1,55 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
add_gem_component_stylesheet("chat-entry")
|
3
|
-
local_assigns[:margin_bottom] ||= 6
|
4
|
-
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
5
|
-
href ||= "/chat"
|
6
|
-
heading_text ||= t("components.chat_entry.heading")
|
7
|
-
description_text ||= t("components.chat_entry.description")
|
8
|
-
border_top ||= false
|
9
|
-
border_bottom ||= false
|
10
|
-
disable_ga4 ||= false
|
11
|
-
margin_top_until_tablet ||= false
|
12
|
-
local_assigns[:margin_bottom] ||= 6
|
13
|
-
|
14
|
-
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
15
|
-
component_helper.add_class("gem-c-chat-entry")
|
16
|
-
component_helper.add_class("gem-c-chat-entry--border-top") if border_top
|
17
|
-
component_helper.add_class("gem-c-chat-entry--border-bottom") if border_bottom
|
18
|
-
component_helper.add_class("gem-c-chat-entry--margin-top-until-tablet") if margin_top_until_tablet
|
19
|
-
component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
|
20
|
-
|
21
|
-
unless disable_ga4
|
22
|
-
ga4_link_data = {
|
23
|
-
ga4_link: {
|
24
|
-
event_name: "navigation",
|
25
|
-
type: "callout",
|
26
|
-
section: "GOV.UK Chat entry",
|
27
|
-
}.to_json
|
28
|
-
}
|
29
|
-
end
|
30
|
-
%>
|
31
|
-
|
32
|
-
<%= tag.div(**component_helper.all_attributes) do %>
|
33
|
-
<svg class="gem-c-chat-entry__image" width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
|
34
|
-
<path d="M11.5713 39.7452L25.6112 51.9999H1.96875L11.5713 39.7452Z" fill="#1D70B8"/>
|
35
|
-
<path d="M26 52C40.3594 52 52 40.3594 52 26C52 11.6406 40.3594 0 26 0C11.6406 0 0 11.6406 0 26C0 40.3594 11.6406 52 26 52Z" fill="#1D70B8"/>
|
36
|
-
<mask id="mask0_51852_3730" maskUnits="userSpaceOnUse" x="14" y="32" width="24" height="10">
|
37
|
-
<rect x="15.2981" y="33.1165" width="21.4029" height="6.98153" fill="#D9D9D9" stroke="#F499BE" stroke-width="1.89313"/>
|
38
|
-
</mask>
|
39
|
-
<g mask="url(#mask0_51852_3730)">
|
40
|
-
<path d="M20.5707 34.156C21.8883 37.1549 25.3874 38.518 28.3863 37.2004C31.3852 35.8829 32.7482 32.3837 31.4307 29.3848C30.1132 26.3859 26.614 25.0229 23.6151 26.3404C20.6162 27.658 19.2532 31.1571 20.5707 34.156Z" stroke="#F499BE" stroke-width="4.43733"/>
|
41
|
-
</g>
|
42
|
-
<path d="M17.3401 13.3198L24.2778 25.515H10.4023L17.3401 13.3198Z" fill="#FFDD00"/>
|
43
|
-
<circle cx="34.2507" cy="19.4078" r="6.10621" fill="#F47738"/>
|
44
|
-
</svg>
|
45
|
-
|
46
|
-
<div class="gem-c-chat-entry__description">
|
47
|
-
<%= content_tag(shared_helper.get_heading_level, class: "gem-c-chat-entry__heading") do %>
|
48
|
-
<%= link_to heading_text, href, class: "govuk-link", data: ga4_link_data %>
|
49
|
-
<% end %>
|
50
|
-
|
51
|
-
<% if description_text %>
|
52
|
-
<p class="govuk-body govuk-!-margin-bottom-0"><%= description_text %></p>
|
53
|
-
<% end %>
|
54
|
-
</div>
|
55
|
-
<% end %>
|