ccs-frontend_helpers 3.4.0 → 3.5.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/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +6 -6
- data/README.md +1 -0
- data/bun.lock +2 -2
- data/lib/ccs/components/ccs/header.rb +4 -3
- data/lib/ccs/components/ccs/logo.rb +73 -14
- data/lib/ccs/frontend_helpers/version.rb +1 -1
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1bf265f14acc642010d47b175977bdffa353900061e2264145423e8bb03000c9
|
|
4
|
+
data.tar.gz: 1fc0369b330f35bbdfe8106c34e96fab791c59ffa796633fdfdc246095b6fdbb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12a68aa2aa3af988e6272c89b9d71d3dea4e745958f873c9dae96a16418ea3d6057b298e87952fc536744d3a63f3b3ab3f8e33a4ac378670a9acd9c838acdab1
|
|
7
|
+
data.tar.gz: 25d9bcb35a00bde3588ffae2a214d6d3c09970e2dd2c1cfdb04da7f3682b022b3ba6eb4e4daaba18303eab53ae5a7126bb16c68720d90bde5a9f901572201796
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
|
@@ -16,7 +16,7 @@ gem 'simplecov', '~> 0.21'
|
|
|
16
16
|
gem 'nokogiri-diff', '~> 0.3.0'
|
|
17
17
|
|
|
18
18
|
# Gems for linting/formatting the package
|
|
19
|
-
gem 'rubocop', '~> 1.
|
|
19
|
+
gem 'rubocop', '~> 1.84'
|
|
20
20
|
gem 'rubocop-capybara', '~> 2.22'
|
|
21
21
|
gem 'rubocop-rails', '~> 2.34'
|
|
22
22
|
gem 'rubocop-rake', '~> 0.7'
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ccs-frontend_helpers (3.
|
|
4
|
+
ccs-frontend_helpers (3.5.0)
|
|
5
5
|
rails (>= 7.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -152,13 +152,13 @@ GEM
|
|
|
152
152
|
nokogiri (~> 1.5)
|
|
153
153
|
tdiff (~> 0.4)
|
|
154
154
|
parallel (1.27.0)
|
|
155
|
-
parser (3.3.10.
|
|
155
|
+
parser (3.3.10.1)
|
|
156
156
|
ast (~> 2.4.1)
|
|
157
157
|
racc
|
|
158
158
|
pp (0.6.3)
|
|
159
159
|
prettyprint
|
|
160
160
|
prettyprint (0.2.0)
|
|
161
|
-
prism (1.
|
|
161
|
+
prism (1.9.0)
|
|
162
162
|
psych (5.3.1)
|
|
163
163
|
date
|
|
164
164
|
stringio
|
|
@@ -224,7 +224,7 @@ GEM
|
|
|
224
224
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
225
225
|
rspec-support (~> 3.13.0)
|
|
226
226
|
rspec-support (3.13.6)
|
|
227
|
-
rubocop (1.
|
|
227
|
+
rubocop (1.84.0)
|
|
228
228
|
json (~> 2.3)
|
|
229
229
|
language_server-protocol (~> 3.17.0.2)
|
|
230
230
|
lint_roller (~> 1.1.0)
|
|
@@ -232,7 +232,7 @@ GEM
|
|
|
232
232
|
parser (>= 3.3.0.2)
|
|
233
233
|
rainbow (>= 2.2.2, < 4.0)
|
|
234
234
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
235
|
-
rubocop-ast (>= 1.
|
|
235
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
236
236
|
ruby-progressbar (~> 1.7)
|
|
237
237
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
238
238
|
rubocop-ast (1.49.0)
|
|
@@ -298,7 +298,7 @@ DEPENDENCIES
|
|
|
298
298
|
nokogiri-diff (~> 0.3.0)
|
|
299
299
|
rake (~> 13.3)
|
|
300
300
|
rspec (~> 3.13)
|
|
301
|
-
rubocop (~> 1.
|
|
301
|
+
rubocop (~> 1.84)
|
|
302
302
|
rubocop-capybara (~> 2.22)
|
|
303
303
|
rubocop-rails (~> 2.34)
|
|
304
304
|
rubocop-rake (~> 0.7)
|
data/README.md
CHANGED
|
@@ -14,6 +14,7 @@ The following table shows the version of CCS Frontend Helpers that you should us
|
|
|
14
14
|
|
|
15
15
|
| CCS Frontend Helpers Version | Target GOV.UK Frontend Version | Target CCS Frontend Version |
|
|
16
16
|
| ----------------------------- | ------------------------------ | --------------------------- |
|
|
17
|
+
| [3.5.0](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/releases/tag/v3.5.0) | [5.14.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.14.0) | [2.5.0](https://github.com/Crown-Commercial-Service/ccs-frontend-project/releases/tag/v2.5.0) |
|
|
17
18
|
| [3.4.0](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/releases/tag/v3.4.0) | [5.14.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.14.0) | [2.4.0](https://github.com/Crown-Commercial-Service/ccs-frontend-project/releases/tag/v2.4.0) |
|
|
18
19
|
| [3.3.0](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/releases/tag/v3.3.0) | [5.13.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.13.0) | [2.3.0](https://github.com/Crown-Commercial-Service/ccs-frontend-project/releases/tag/v2.3.0) |
|
|
19
20
|
| [3.2.0](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/releases/tag/v3.2.0) | [5.13.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.13.0) | [2.2.1](https://github.com/Crown-Commercial-Service/ccs-frontend-project/releases/tag/v2.2.1) |
|
data/bun.lock
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"workspaces": {
|
|
5
5
|
"": {
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"ccs-frontend": "2.
|
|
7
|
+
"ccs-frontend": "2.5.0",
|
|
8
8
|
"govuk-frontend": "5.14.0",
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
12
|
"packages": {
|
|
13
|
-
"ccs-frontend": ["ccs-frontend@2.
|
|
13
|
+
"ccs-frontend": ["ccs-frontend@2.5.0", "", { "peerDependencies": { "govuk-frontend": "^5.14.0", "jquery": "^4.x" } }, "sha512-RlHbYbuzkbEgAtWaLvptMGxKIJrxvjg6VtESLmAAjeW8NxxsErmQudTGrnX1ATsn5UdfH9/sEkmChpjJRikHpQ=="],
|
|
14
14
|
|
|
15
15
|
"govuk-frontend": ["govuk-frontend@5.14.0", "", {}, "sha512-MgfaXswIM6KpXS2T5gltEnzgVLgfM3UoE9+rYkhBiR0suaJ8Let31VZXQZqz9QhiPDbv28fW1nRjIyLujfZIBA=="],
|
|
16
16
|
|
|
@@ -19,6 +19,7 @@ module CCS
|
|
|
19
19
|
|
|
20
20
|
public
|
|
21
21
|
|
|
22
|
+
# @param use_gca_branding [Boolean] flag to use GCA branding in logo
|
|
22
23
|
# @param options [Hash] options that will be used in customising the HTML
|
|
23
24
|
#
|
|
24
25
|
# @option options [String] :classes additional CSS classes for the header HTML
|
|
@@ -26,13 +27,13 @@ module CCS
|
|
|
26
27
|
# @option options [String] :homepage_url URL of the homepage. Defaults to +/https://www.crowncommercial.gov.uk+
|
|
27
28
|
# @option options [Hash] :attributes additional attributes that will added as part of the header HTML
|
|
28
29
|
|
|
29
|
-
def initialize(**)
|
|
30
|
+
def initialize(use_gca_branding: nil, **)
|
|
30
31
|
super
|
|
31
32
|
|
|
32
33
|
@options[:container_classes] ||= 'govuk-width-container'
|
|
33
|
-
@options[:homepage_url] ||= 'https://www.crowncommercial.gov.uk'
|
|
34
|
+
@options[:homepage_url] ||= (use_gca_branding ? 'https://www.gca.gov.uk' : 'https://www.crowncommercial.gov.uk')
|
|
34
35
|
|
|
35
|
-
@logo = Logo.new(context: @context)
|
|
36
|
+
@logo = Logo.new(context: @context, use_gca_branding: use_gca_branding)
|
|
36
37
|
end
|
|
37
38
|
|
|
38
39
|
# Generates the HTML for the CCS Header component
|
|
@@ -7,9 +7,30 @@ module CCS
|
|
|
7
7
|
#
|
|
8
8
|
# This is used for generating the logo component from the
|
|
9
9
|
# {https://github.com/Crown-Commercial-Service/ccs-frontend-project/tree/main/packages/ccs-frontend/src/ccs/components/logo CCS - Components - Logo}
|
|
10
|
+
#
|
|
11
|
+
# @!attribute [r] show_only_crown
|
|
12
|
+
# @return [Boolean] Flag to show only the crown part of the logo
|
|
13
|
+
# @!attribute [r] use_gca_branding
|
|
14
|
+
# @return [Boolean] Flag to use GCA branding in logo
|
|
10
15
|
|
|
11
16
|
class Logo < Base
|
|
12
|
-
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
attr_reader :show_only_crown, :use_gca_branding
|
|
20
|
+
|
|
21
|
+
public
|
|
22
|
+
|
|
23
|
+
# @param show_only_crown [Boolean] flag to show only the crown part of the logo
|
|
24
|
+
# @param use_gca_branding [Boolean] flag to use GCA branding in logo
|
|
25
|
+
|
|
26
|
+
def initialize(show_only_crown: nil, use_gca_branding: nil, **)
|
|
27
|
+
super
|
|
28
|
+
|
|
29
|
+
@show_only_crown = show_only_crown
|
|
30
|
+
@use_gca_branding = use_gca_branding
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
13
34
|
|
|
14
35
|
# Generates the HTML for the CCS Logo.
|
|
15
36
|
# Used in {CCS::Components::CCS::Header Header} and {CCS::Components::CCS::Footer Footer}
|
|
@@ -18,7 +39,7 @@ module CCS
|
|
|
18
39
|
|
|
19
40
|
def render
|
|
20
41
|
tag.span(class: 'ccs-logo') do
|
|
21
|
-
if
|
|
42
|
+
if show_only_crown
|
|
22
43
|
concat(tag.svg(class: 'ccs-logo__svg', xmlns: 'http://www.w3.org/2000/svg', width: '132.22', height: '121', aria: { hidden: 'true' }, focusable: 'false', viewBox: '0 0 371.06668 339.57333') do
|
|
23
44
|
concat(tag.g(transform: 'matrix(1.3333333,0,0,-1.3333333,0,339.57333)') do
|
|
24
45
|
tag.g(transform: 'scale(0.34)') do
|
|
@@ -31,24 +52,36 @@ module CCS
|
|
|
31
52
|
concat(tag.g(transform: 'matrix(1.3333333,0,0,-1.3333333,0,339.57333)') do
|
|
32
53
|
tag.g(transform: 'scale(0.1)') do
|
|
33
54
|
CCS_STACKED_LOGO_PATHS.each { |ccs_logo_path_attributes| concat(tag.path(**ccs_logo_path_attributes)) }
|
|
34
|
-
concat(
|
|
55
|
+
concat(use_gca_branding ? logo_stacked_text_graphic_gca : logo_stacked_text_graphic_ccs)
|
|
35
56
|
end
|
|
36
57
|
end)
|
|
37
58
|
end)
|
|
38
|
-
|
|
39
|
-
concat(tag.
|
|
40
|
-
tag.g(transform: '
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
if use_gca_branding
|
|
60
|
+
concat(tag.svg(class: 'ccs-logo__svg ccs-logo__svg--linear', xmlns: 'http://www.w3.org/2000/svg', width: '378', height: '48.5', aria: { hidden: 'true' }, focusable: 'false', viewBox: '0 0 1061 137') do
|
|
61
|
+
concat(tag.g(transform: 'matrix(1.3333333,0,0,-1.3333333,0,137)') do
|
|
62
|
+
tag.g(transform: 'scale(0.1)') do
|
|
63
|
+
CCS_LINEAR_LOGO_PATHS.each { |ccs_logo_path_attributes| concat(tag.path(**ccs_logo_path_attributes)) }
|
|
64
|
+
concat(logo_linear_text_graphic_gca)
|
|
65
|
+
end
|
|
66
|
+
end)
|
|
44
67
|
end)
|
|
45
|
-
|
|
46
|
-
|
|
68
|
+
concat(tag.span('Government Commercial Agency', class: 'ccs-logo__text', hidden: true))
|
|
69
|
+
else
|
|
70
|
+
concat(tag.svg(class: 'ccs-logo__svg ccs-logo__svg--linear', xmlns: 'http://www.w3.org/2000/svg', width: '320', height: '48.5', aria: { hidden: 'true' }, focusable: 'false', viewBox: '0 0 899 137') do
|
|
71
|
+
concat(tag.g(transform: 'matrix(1.3333333,0,0,-1.3333333,0,137)') do
|
|
72
|
+
tag.g(transform: 'scale(0.1)') do
|
|
73
|
+
CCS_LINEAR_LOGO_PATHS.each { |ccs_logo_path_attributes| concat(tag.path(**ccs_logo_path_attributes)) }
|
|
74
|
+
concat(logo_linear_text_graphic_ccs)
|
|
75
|
+
end
|
|
76
|
+
end)
|
|
77
|
+
end)
|
|
78
|
+
concat(tag.span('Crown Commercial Service', class: 'ccs-logo__text', hidden: true))
|
|
79
|
+
end
|
|
47
80
|
end
|
|
48
81
|
end
|
|
49
82
|
end
|
|
50
83
|
|
|
51
|
-
# rubocop:enable Metrics/AbcSize
|
|
84
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
52
85
|
|
|
53
86
|
# Array of the SVG paths for the CCS Logo
|
|
54
87
|
|
|
@@ -526,7 +559,7 @@ module CCS
|
|
|
526
559
|
|
|
527
560
|
private
|
|
528
561
|
|
|
529
|
-
def
|
|
562
|
+
def logo_stacked_text_graphic_ccs
|
|
530
563
|
tag.g(transform: 'scale(10)') do
|
|
531
564
|
tag.text(
|
|
532
565
|
'xml:space': 'preserve',
|
|
@@ -540,7 +573,21 @@ module CCS
|
|
|
540
573
|
end
|
|
541
574
|
end
|
|
542
575
|
|
|
543
|
-
def
|
|
576
|
+
def logo_stacked_text_graphic_gca
|
|
577
|
+
tag.g(transform: 'scale(10)') do
|
|
578
|
+
tag.text(
|
|
579
|
+
'xml:space': 'preserve',
|
|
580
|
+
transform: 'matrix(1,0,0,-1,20.3102,129.569)',
|
|
581
|
+
class: 'ccs-logo__text-graphic'
|
|
582
|
+
) do
|
|
583
|
+
concat(tag.tspan('Government ', x: '0 35 62 85 110 125 149 188 212 237 250', y: '0', 'sodipodi:role': 'line'))
|
|
584
|
+
concat(tag.tspan('Commercial ', x: '0 33.314499 59.416096 99.105995 138.7959 163.4126 177.5981 201.77882 210.5835 234.9653 244.37253', y: '53', 'sodipodi:role': 'line'))
|
|
585
|
+
concat(tag.tspan('Agency ', x: '0 31.5 58 82.5 108 133.5', y: '106', 'sodipodi:role': 'line'))
|
|
586
|
+
end
|
|
587
|
+
end
|
|
588
|
+
end
|
|
589
|
+
|
|
590
|
+
def logo_linear_text_graphic_ccs
|
|
544
591
|
tag.g(transform: 'scale(10)') do
|
|
545
592
|
tag.text(
|
|
546
593
|
'xml:space': 'preserve',
|
|
@@ -551,6 +598,18 @@ module CCS
|
|
|
551
598
|
end
|
|
552
599
|
end
|
|
553
600
|
end
|
|
601
|
+
|
|
602
|
+
def logo_linear_text_graphic_gca
|
|
603
|
+
tag.g(transform: 'scale(10)') do
|
|
604
|
+
tag.text(
|
|
605
|
+
'xml:space': 'preserve',
|
|
606
|
+
transform: 'matrix(1,0,0,-1,120,30)',
|
|
607
|
+
class: 'ccs-logo__text-graphic'
|
|
608
|
+
) do
|
|
609
|
+
concat(tag.tspan('Government Commercial Agency', x: '0 35 62 85 110 125 149 188 212 237 250 260 293.314499 319.416096 359.105995 398.7959 423.4126 437.5981 461.77882 470.5835 494.9653 504.37253 515 546.5 573 597.5 623 648.5', y: '0', 'sodipodi:role': 'line'))
|
|
610
|
+
end
|
|
611
|
+
end
|
|
612
|
+
end
|
|
554
613
|
end
|
|
555
614
|
end
|
|
556
615
|
end
|
data/package.json
CHANGED