govuk_publishing_components 24.16.1 → 24.17.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/images/govuk_publishing_components/action-link-arrow--brexit.svg +3 -0
- data/app/assets/javascripts/govuk_publishing_components/components/button.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +10 -10
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +5 -5
- data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/tabs.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/all.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/modules.js +23 -20
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/all.js +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +25 -0
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_details.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +2 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c57ef1405fbd96f5987dc24d795eb197a2682388ba0f3ccd4d09e933a5c0e8d2
|
|
4
|
+
data.tar.gz: 1213a4f3a3ac27a30ddba5a3f265607a1ff2970a5ee47896759c50986ab16f19
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f769ee68de178a08f866be215ed3c01a9a113c83cc56c120dbb47093659dfeeda6e4ca5f20d576b000125efaff11423a034a4931a138f31fcf95b6fae6c91809
|
|
7
|
+
data.tar.gz: 6aa9cd20cc9e8bd4c3a5c377bb863ec02704bbbf8eddf9f28153b102b0c32b001b5f23ca7539a453b67cdc7b551447e762c6ff1a47114a20581e876e1ed083f4
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="38" height="36" viewBox="0 0 38 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M38 35.8461C34.8518 35.8299 31.701 35.8136 28.5528 35.7974C28.5447 29.2599 28.5366 22.7252 28.5284 16.1878C21.8989 22.7252 15.2721 29.2599 8.64252 35.7974C5.8547 35.792 3.06417 35.7838 0.276344 35.7784C0.262798 34.1366 0.249251 32.4948 0.232996 30.8503C7.36917 23.7195 14.5026 16.5833 21.6388 9.44717C14.4268 9.47697 7.21204 9.50406 0 9.53387C3.17254 6.35862 6.34778 3.18608 9.52032 0.010837C19.0135 0.00812776 28.5068 0.00270925 38 0C38 11.9234 38 23.8577 38 35.8461Z" fill="#FF003B"/>
|
|
3
|
+
</svg>
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// = require govuk/components/character-count/character-count.js
|
|
3
3
|
window.GOVUK = window.GOVUK || {}
|
|
4
4
|
window.GOVUK.Modules = window.GOVUK.Modules || {}
|
|
5
|
-
window.GOVUK.Modules.
|
|
5
|
+
window.GOVUK.Modules.GovukCharacterCount = window.GOVUKFrontend
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
// = require govuk/components/checkboxes/checkboxes.js
|
|
4
4
|
window.GOVUK = window.GOVUK || {}
|
|
5
5
|
window.GOVUK.Modules = window.GOVUK.Modules || {}
|
|
6
|
-
window.GOVUK.Modules.
|
|
6
|
+
window.GOVUK.Modules.GovukCheckboxes = window.GOVUKFrontend;
|
|
7
7
|
|
|
8
8
|
(function (Modules) {
|
|
9
|
-
function
|
|
9
|
+
function GemCheckboxes ($module) {
|
|
10
10
|
this.$module = $module
|
|
11
11
|
this.$checkboxes = this.$module.querySelectorAll('input[type=checkbox]')
|
|
12
12
|
this.$nestedCheckboxes = this.$module.querySelectorAll('[data-nested=true] input[type=checkbox]')
|
|
13
13
|
this.$exclusiveCheckboxes = this.$module.querySelectorAll('[data-exclusive=true] input[type=checkbox]')
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
GemCheckboxes.prototype.init = function () {
|
|
17
17
|
this.applyAriaControlsAttributes(this.$module)
|
|
18
18
|
|
|
19
19
|
for (var i = 0; i < this.$checkboxes.length; i++) {
|
|
@@ -29,7 +29,7 @@ window.GOVUK.Modules.Checkboxes = window.GOVUKFrontend;
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
GemCheckboxes.prototype.handleCheckboxChange = function (event) {
|
|
33
33
|
if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
|
|
34
34
|
// Where checkboxes are manipulated externally in finders, `suppressAnalytics`
|
|
35
35
|
// is passed to prevent duplicate GA events.
|
|
@@ -58,7 +58,7 @@ window.GOVUK.Modules.Checkboxes = window.GOVUKFrontend;
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
GemCheckboxes.prototype.handleNestedCheckboxChange = function (event) {
|
|
62
62
|
var $checkbox = event.target
|
|
63
63
|
var $isNested = $checkbox.closest('.govuk-checkboxes--nested')
|
|
64
64
|
var $hasNested = this.$module.querySelector('.govuk-checkboxes--nested[data-parent=' + $checkbox.id + ']')
|
|
@@ -70,7 +70,7 @@ window.GOVUK.Modules.Checkboxes = window.GOVUKFrontend;
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
GemCheckboxes.prototype.toggleNestedCheckboxes = function ($scope, $checkbox) {
|
|
74
74
|
var $nestedCheckboxes = $scope.querySelectorAll('input[type=checkbox]')
|
|
75
75
|
if ($checkbox.checked) {
|
|
76
76
|
for (var i = 0; i < $nestedCheckboxes.length; i++) {
|
|
@@ -83,7 +83,7 @@ window.GOVUK.Modules.Checkboxes = window.GOVUKFrontend;
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
GemCheckboxes.prototype.toggleParentCheckbox = function ($scope, $checkbox) {
|
|
87
87
|
var $inputs = $scope.querySelectorAll('input')
|
|
88
88
|
var $checkedInputs = $scope.querySelectorAll('input:checked')
|
|
89
89
|
var parentId = $scope.getAttribute('data-parent')
|
|
@@ -96,7 +96,7 @@ window.GOVUK.Modules.Checkboxes = window.GOVUKFrontend;
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
GemCheckboxes.prototype.handleExclusiveCheckboxChange = function (event) {
|
|
100
100
|
var $currentCheckbox = event.target
|
|
101
101
|
var $checkboxes = $currentCheckbox.closest('.govuk-checkboxes')
|
|
102
102
|
var $exclusiveOption = $checkboxes.querySelector('input[type=checkbox][data-exclusive]')
|
|
@@ -113,7 +113,7 @@ window.GOVUK.Modules.Checkboxes = window.GOVUKFrontend;
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
GemCheckboxes.prototype.applyAriaControlsAttributes = function ($scope) {
|
|
117
117
|
var $inputs = $scope.querySelectorAll('[data-controls]')
|
|
118
118
|
|
|
119
119
|
for (var i = 0; i < $inputs.length; i++) {
|
|
@@ -121,5 +121,5 @@ window.GOVUK.Modules.Checkboxes = window.GOVUKFrontend;
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
Modules.
|
|
124
|
+
Modules.GemCheckboxes = GemCheckboxes
|
|
125
125
|
})(window.GOVUK.Modules)
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// = require govuk/components/details/details.js
|
|
3
3
|
window.GOVUK = window.GOVUK || {}
|
|
4
4
|
window.GOVUK.Modules = window.GOVUK.Modules || {}
|
|
5
|
-
window.GOVUK.Modules.
|
|
5
|
+
window.GOVUK.Modules.GovukDetails = window.GOVUKFrontend;
|
|
6
6
|
|
|
7
7
|
(function (Modules) {
|
|
8
|
-
function
|
|
8
|
+
function GemDetails ($module) {
|
|
9
9
|
this.$module = $module
|
|
10
10
|
this.customTrackLabel = this.$module.getAttribute('data-track-label')
|
|
11
11
|
this.detailsClick = this.$module.querySelector('[data-details-track-click]')
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
GemDetails.prototype.init = function () {
|
|
15
15
|
if (this.customTrackLabel) { // If a custom label has been provided, we can simply call the tracking module
|
|
16
16
|
var trackDetails = new window.GOVUK.Modules.GemTrackClick()
|
|
17
17
|
trackDetails.start($(this.$module))
|
|
@@ -22,7 +22,7 @@ window.GOVUK.Modules.Details = window.GOVUKFrontend;
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
GemDetails.prototype.trackDefault = function (element) {
|
|
26
26
|
if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
|
|
27
27
|
var componentStatus = (element.getAttribute('open') == null) ? 'open' : 'closed'
|
|
28
28
|
var trackCategory = element.getAttribute('data-track-category')
|
|
@@ -45,5 +45,5 @@ window.GOVUK.Modules.Details = window.GOVUKFrontend;
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
Modules.
|
|
48
|
+
Modules.GemDetails = GemDetails
|
|
49
49
|
})(window.GOVUK.Modules)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// = require_tree ./
|
|
@@ -26,29 +26,32 @@
|
|
|
26
26
|
var modules = this.find(container)
|
|
27
27
|
|
|
28
28
|
for (var i = 0, l = modules.length; i < l; i++) {
|
|
29
|
-
var module
|
|
30
29
|
var element = $(modules[i])
|
|
31
|
-
var
|
|
32
|
-
var started = element.data('module-started')
|
|
33
|
-
var frontendModuleName = moduleName.replace('Govuk', '')
|
|
30
|
+
var moduleNames = element.data('module').split(' ')
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
for (var j = 0, k = moduleNames.length; j < k; j++) {
|
|
33
|
+
var module
|
|
34
|
+
var moduleName = camelCaseAndCapitalise(moduleNames[j])
|
|
35
|
+
var started = element.data(moduleNames[j] + '-module-started')
|
|
36
|
+
|
|
37
|
+
if ( // GOV.UK Publishing & Legacy Modules
|
|
38
|
+
typeof GOVUK.Modules[moduleName] === 'function' &&
|
|
39
|
+
!GOVUK.Modules[moduleName].prototype.init &&
|
|
40
|
+
!started
|
|
41
|
+
) {
|
|
42
|
+
module = new GOVUK.Modules[moduleName]()
|
|
43
|
+
module.start(element)
|
|
44
|
+
element.data(moduleNames[j] + '-module-started', true)
|
|
45
|
+
}
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
if ( // GOV.UK Frontend Modules
|
|
48
|
+
typeof GOVUK.Modules[moduleName] === 'function' &&
|
|
49
|
+
GOVUK.Modules[moduleName].prototype.init &&
|
|
50
|
+
!started
|
|
51
|
+
) {
|
|
52
|
+
module = new GOVUK.Modules[moduleName](element[0]).init()
|
|
53
|
+
element.data(moduleNames[j] + '-module-started', true)
|
|
54
|
+
}
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// = require_tree ./
|
|
@@ -146,6 +146,31 @@
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
.gem-c-action-link--brexit {
|
|
150
|
+
max-width: none;
|
|
151
|
+
|
|
152
|
+
&:before {
|
|
153
|
+
height: 30px;
|
|
154
|
+
width: 35px;
|
|
155
|
+
background-image: image-url("govuk_publishing_components/action-link-arrow--brexit.svg");
|
|
156
|
+
background-repeat: no-repeat;
|
|
157
|
+
background-size: 25px auto;
|
|
158
|
+
background-position: 0 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@include govuk-media-query($until: tablet) {
|
|
162
|
+
margin-bottom: govuk-spacing(2);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@include govuk-media-query($from: tablet) {
|
|
166
|
+
margin-bottom: govuk-spacing(2);
|
|
167
|
+
|
|
168
|
+
&:before {
|
|
169
|
+
background-position: 0 4px;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
149
174
|
.gem-c-action-link--nhs {
|
|
150
175
|
&:before {
|
|
151
176
|
width: 80px;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
dark_icon ||= false
|
|
15
15
|
small_icon ||= false
|
|
16
16
|
nhs_icon ||= false
|
|
17
|
+
brexit_icon ||= false
|
|
17
18
|
transparent_icon ||= false
|
|
18
19
|
data ||= nil
|
|
19
20
|
classes ||= nil
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
css_classes << "gem-c-action-link--small-icon" if small_icon
|
|
26
27
|
css_classes << "gem-c-action-link--transparent-icon" if transparent_icon
|
|
27
28
|
css_classes << "gem-c-action-link--nhs" if nhs_icon
|
|
29
|
+
css_classes << "gem-c-action-link--brexit" if brexit_icon
|
|
28
30
|
css_classes << "gem-c-action-link--simple" if simple
|
|
29
31
|
css_classes << "gem-c-action-link--simple-light" if simple_light
|
|
30
32
|
css_classes << "gem-c-action-link--with-subtext" if subtext
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
id = cb_helper.id
|
|
5
5
|
%>
|
|
6
6
|
|
|
7
|
-
<%= tag.div id: id, class: cb_helper.css_classes, data: { module: "
|
|
7
|
+
<%= tag.div id: id, class: cb_helper.css_classes, data: { module: "gem-checkboxes" } do %>
|
|
8
8
|
<% if cb_helper.should_have_fieldset %>
|
|
9
9
|
<% if cb_helper.heading_markup %>
|
|
10
10
|
<%= tag.fieldset class: "govuk-fieldset", "aria-describedby": cb_helper.fieldset_describedby do %>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<% end %>
|
|
24
24
|
|
|
25
25
|
<%= tag.ul class: cb_helper.list_classes, data: {
|
|
26
|
-
module: ('checkboxes' if cb_helper.has_conditional),
|
|
26
|
+
module: ('govuk-checkboxes' if cb_helper.has_conditional),
|
|
27
27
|
nested: ('true' if cb_helper.has_nested),
|
|
28
28
|
exclusive: ('true' if cb_helper.has_exclusive)
|
|
29
29
|
} do %>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
css_classes << (shared_helper.get_margin_bottom)
|
|
8
8
|
|
|
9
9
|
data_attributes ||= {}
|
|
10
|
-
data_attributes[:module] = 'govuk-details'
|
|
10
|
+
data_attributes[:module] = 'govuk-details gem-details'
|
|
11
11
|
%>
|
|
12
12
|
<%= tag.details class: css_classes, data: data_attributes, open: open do %>
|
|
13
13
|
<summary class="govuk-details__summary" data-details-track-click>
|
|
@@ -101,11 +101,11 @@ examples:
|
|
|
101
101
|
text: Coronavirus (COVID-19)
|
|
102
102
|
href: "/my-test-page"
|
|
103
103
|
dark_icon: true
|
|
104
|
-
|
|
104
|
+
with_brexit_icon_and_custom_font_size:
|
|
105
105
|
data:
|
|
106
106
|
text: Guidance for businesses
|
|
107
107
|
href: "/guidance-for-businesses"
|
|
108
|
-
|
|
108
|
+
brexit_icon: true
|
|
109
109
|
font_size: m
|
|
110
110
|
with_nhs_icon:
|
|
111
111
|
data:
|
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: 24.
|
|
4
|
+
version: 24.17.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-06-
|
|
11
|
+
date: 2021-06-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: govuk_app_config
|
|
@@ -364,6 +364,7 @@ files:
|
|
|
364
364
|
- app/assets/config/govuk_publishing_components_manifest.js
|
|
365
365
|
- app/assets/images/govuk_publishing_components/action-link--nhs.png
|
|
366
366
|
- app/assets/images/govuk_publishing_components/action-link--nhs.svg
|
|
367
|
+
- app/assets/images/govuk_publishing_components/action-link-arrow--brexit.svg
|
|
367
368
|
- app/assets/images/govuk_publishing_components/action-link-arrow--dark.png
|
|
368
369
|
- app/assets/images/govuk_publishing_components/action-link-arrow--dark.svg
|
|
369
370
|
- app/assets/images/govuk_publishing_components/action-link-arrow--simple-light.png
|
|
@@ -486,6 +487,7 @@ files:
|
|
|
486
487
|
- app/assets/javascripts/govuk_publishing_components/lib.js
|
|
487
488
|
- app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js
|
|
488
489
|
- app/assets/javascripts/govuk_publishing_components/lib/current-location.js
|
|
490
|
+
- app/assets/javascripts/govuk_publishing_components/lib/govspeak/all.js
|
|
489
491
|
- app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
|
|
490
492
|
- app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js
|
|
491
493
|
- app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
|
|
@@ -504,6 +506,7 @@ files:
|
|
|
504
506
|
- app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-polyfill.js
|
|
505
507
|
- app/assets/javascripts/govuk_publishing_components/vendor/lux/lux.js
|
|
506
508
|
- app/assets/javascripts/govuk_publishing_components/vendor/modernizr.js
|
|
509
|
+
- app/assets/javascripts/govuk_publishing_components/vendor/polyfills/all.js
|
|
507
510
|
- app/assets/javascripts/govuk_publishing_components/vendor/polyfills/closest.js
|
|
508
511
|
- app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js
|
|
509
512
|
- app/assets/javascripts/govuk_publishing_components/vendor/polyfills/indexOf.js
|