govuk_publishing_components 21.53.0 → 21.55.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/action-link--nhs.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link--nhs.svg +1 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow--simple.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow.png +0 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +5 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +38 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +0 -38
- data/app/controllers/govuk_publishing_components/component_guide_controller.rb +34 -22
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +23 -3
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +28 -8
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +43 -15
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +23 -0
- data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +11 -9
- data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +8 -1
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +1 -1
- data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +7 -6
- data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +77 -0
- data/lib/govuk_publishing_components/presenters/schema_org.rb +24 -16
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/CHANGELOG.md +6 -0
- data/node_modules/axe-core/axe.js +19 -3
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/bower.json +1 -1
- data/node_modules/axe-core/lib/commons/dom/get-element-stack.js +27 -1
- data/node_modules/axe-core/package.json +21 -21
- data/node_modules/axe-core/sri-history.json +4 -0
- data/node_modules/govuk-frontend/README.md +6 -6
- data/node_modules/govuk-frontend/govuk/_base.scss +3 -0
- data/node_modules/govuk-frontend/govuk/all.js +1 -1
- data/node_modules/govuk-frontend/govuk/all.scss +1 -3
- data/node_modules/govuk-frontend/govuk/components/_all.scss +31 -29
- data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -208
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +207 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -65
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +112 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -118
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +138 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +12 -1
- data/node_modules/govuk-frontend/govuk/components/button/_button.scss +2 -284
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +280 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -31
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +28 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -308
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +304 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -30
- data/node_modules/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
- data/node_modules/govuk-frontend/govuk/components/details/_details.scss +2 -88
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +84 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -15
- data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +11 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -59
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +55 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -68
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
- data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -81
- data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +77 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +2 -244
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +238 -0
- data/node_modules/govuk-frontend/govuk/components/header/_header.scss +2 -318
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +312 -0
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/hint/_hint.scss +2 -50
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +46 -0
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +99 -0
- data/node_modules/govuk-frontend/govuk/components/input/_input.scss +2 -103
- data/node_modules/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -28
- data/node_modules/govuk-frontend/govuk/components/label/_index.scss +41 -0
- data/node_modules/govuk-frontend/govuk/components/label/_label.scss +2 -45
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +40 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_panel.scss +2 -44
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -31
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +342 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +2 -346
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +53 -0
- data/node_modules/govuk-frontend/govuk/components/select/_select.scss +2 -57
- data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +33 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -37
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +153 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -157
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +50 -0
- data/node_modules/govuk-frontend/govuk/components/table/_table.scss +2 -54
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +138 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -142
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +87 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +2 -91
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +51 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -55
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +56 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -60
- data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_links.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_lists.scss +17 -3
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_template.scss +5 -3
- data/node_modules/govuk-frontend/govuk/core/_typography.scss +5 -3
- data/node_modules/govuk-frontend/govuk/helpers/_clearfix.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +2 -1
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +1 -1
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +1 -3
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +1 -3
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +5 -3
- data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +2 -4
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +5 -3
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +5 -3
- data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +1 -1
- data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +1 -1
- data/node_modules/govuk-frontend/package.json +21 -21
- metadata +49 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 417ac5b68c2937c585f441854215684db548772993c21ca5fcd4cda7a34fdf0f
|
4
|
+
data.tar.gz: 206dc5df8e79d3d92c3a0bcc8e2823a41d6f61b5bfd1ecf6df1ce5dd01cd7004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05bab4bb91aaf768e8998f8be4c3088600ee4c75e7bf8873d9023421e5e686937118d021efaa939f8bbc2e2020520369099dfcb1bda1c14dd5eb1883ffde045d
|
7
|
+
data.tar.gz: 266f2889088edc5bf591597d3d6608fe023171e1d8b53895c5cd887b4a845e85e2ed61d690e3f7c85bb0f6e62b05c8648b87639ff3c8f53c5f7702c7c6c1bcc5
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg fill="none" height="227" viewBox="0 0 227 227" width="227" xmlns="http://www.w3.org/2000/svg"><path d="m55.7 226.5c-30.4 0-55.2-24.8-55.2-55.2v-115.6c0-30.4 24.8-55.2 55.2-55.2h115.6c30.4 0 55.2 24.8 55.2 55.2v115.6c0 30.4-24.8 55.2-55.2 55.2z" fill="#0ba23b"/><path d="m171.3 1c30.2 0 54.7 24.5 54.7 54.7v115.6c0 30.2-24.5 54.7-54.7 54.7h-115.6c-30.2 0-54.7-24.5-54.7-54.7v-115.6c0-30.2 24.5-54.7 54.7-54.7zm0-1h-115.6c-30.7 0-55.7 25-55.7 55.7v115.6c0 30.7 25 55.7 55.7 55.7h115.6c30.7 0 55.7-25 55.7-55.7v-115.6c0-30.7-25-55.7-55.7-55.7z" fill="#0ba23b"/><path d="m113.5 52.7-.5-.3-112 112v6.9c0 7.3 1.5 14.3 4.1 20.7l107.9-107.9.5.3 108.2 108.2c2.8-6.5 4.3-13.8 4.3-21.3v-6.1z" fill="#fcf411"/><path d="m171.3 1h-3l57.7 57.7v-3c0-30.2-24.5-54.7-54.7-54.7z" fill="#fcf411"/><path d="m57.8 1h-2.1c-30.2 0-54.7 24.5-54.7 54.7v2.1z" fill="#fcf411"/><path d="m226 94.5-93.5-93.5h-38.8l-92.7 92.7v31.7l112-112 .5.3 112.5 112.5z" fill="#fcf411"/><path d="m205.8 213.8-92.3-92.3-.5-.3-92.2002 92.2c6 5 13.1 8.7 20.9 10.8l71.3002-71.3.5.3 71.1 71.1c7.9-1.9 15.1-5.6 21.2-10.5z" fill="#fcf411"/><path d="m112.1 188.3 1 1 .8-.8z" fill="#fcf411"/><path d="m149.8 226-36.7-36.7-36.7001 36.7z" fill="#fcf411"/><path d="m166.5 213.1h-106.0001c-25.7 0-46.6-20.9-46.6-46.6v-106c0-25.7 20.9-46.6 46.6-46.6h106.0001c25.7 0 46.6 20.9 46.6 46.6v106c0 25.7-20.9 46.6-46.6 46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3.4-.7s-2-1.1-2.9-2.1-1.5-2.1-2-3.4c-.5-1.4-.8-3-.8-4.8 0-1.7.2-3.2.7-4.6.4-1.4 1.1-2.5 1.9-3.5s1.9-1.7 3.1-2.2 2.7-.8 4.3-.8c2.2 0 4 .4 5.4 1.2s2.5 2 3.4 3.4c.8 1.4 1.4 3.1 1.8 5.1.3 1.9.5 4 .5 6.1 0 2.5-.2 4.9-.6 7.2s-1.1 4.3-2.1 6.1c-1 1.7-2.3 3.1-4 4.2s-3.8 1.6-6.4 1.6c-1.6 0-2.8-.1-3.9-.4-1-.3-1.8-.5-2.4-.8zm4.1-17.7c0 1.8.3 3.4 1 4.6s1.8 1.8 3.4 1.8c1.5 0 2.5-.6 3.3-1.7.7-1.1 1.1-2.7 1.1-4.6 0-2-.3-3.6-1-4.7s-1.8-1.7-3.3-1.7c-1.6 0-2.7.6-3.4 1.7-.7 1-1.1 2.6-1.1 4.6z"/></g></svg>
|
Binary file
|
Binary file
|
Binary file
|
data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
CHANGED
@@ -109,6 +109,8 @@
|
|
109
109
|
event.target.f.title = videoTitle + ' (video)'
|
110
110
|
},
|
111
111
|
onStateChange: function (event) {
|
112
|
+
var eventData = event.data
|
113
|
+
var eventTarget = event.target
|
112
114
|
var states = {
|
113
115
|
"-1": "VideoUnstarted",
|
114
116
|
"0": "VideoEnded",
|
@@ -117,14 +119,13 @@
|
|
117
119
|
"3": "VideoBuffering",
|
118
120
|
"5": "VideoCued"
|
119
121
|
}
|
120
|
-
|
121
|
-
if (states[event.data] && options.tracking && options.tracking.hasTracking
|
122
|
+
if (states[eventData] && options.tracking && options.tracking.hasTracking
|
122
123
|
&& window.GOVUK.analytics && window.GOVUK.analytics.trackEvent)
|
123
124
|
{
|
124
125
|
var tracking = {
|
125
126
|
category: options.tracking.category,
|
126
|
-
action: states[
|
127
|
-
label: { transport: 'beacon', label:
|
127
|
+
action: states[eventData],
|
128
|
+
label: { transport: 'beacon', label: eventTarget.getVideoData && eventTarget.getVideoData().title }
|
128
129
|
}
|
129
130
|
|
130
131
|
window.GOVUK.analytics.trackEvent(tracking.category, tracking.action, tracking.label)
|
@@ -7,8 +7,8 @@
|
|
7
7
|
width: 50px;
|
8
8
|
height: 45px;
|
9
9
|
// sass-lint:disable no-duplicate-properties
|
10
|
-
background
|
11
|
-
background
|
10
|
+
background: image-url("govuk_publishing_components/action-link-arrow.png");
|
11
|
+
background: image-url("govuk_publishing_components/action-link-arrow.svg"), linear-gradient(transparent, transparent);
|
12
12
|
// sass-lint:enable no-duplicate-properties
|
13
13
|
background-repeat: no-repeat;
|
14
14
|
background-position: 0 50%;
|
@@ -63,6 +63,20 @@
|
|
63
63
|
}
|
64
64
|
}
|
65
65
|
|
66
|
+
.gem-c-action-link--mobile-subtext {
|
67
|
+
.gem-c-action-link__subtext-wrapper {
|
68
|
+
display: block;
|
69
|
+
}
|
70
|
+
|
71
|
+
.gem-c-action-link__subtext {
|
72
|
+
padding: 0;
|
73
|
+
|
74
|
+
&:before {
|
75
|
+
display: none;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
66
80
|
.gem-c-action-link__subtext {
|
67
81
|
@include govuk-font(19);
|
68
82
|
display: block;
|
@@ -90,9 +104,10 @@
|
|
90
104
|
width: 30px;
|
91
105
|
height: 30px;
|
92
106
|
// sass-lint:disable no-duplicate-properties
|
93
|
-
background
|
94
|
-
background
|
107
|
+
background: image-url("govuk_publishing_components/action-link-arrow--simple.png");
|
108
|
+
background: image-url("govuk_publishing_components/action-link-arrow--simple.svg"), linear-gradient(transparent, transparent);
|
95
109
|
// sass-lint:enable no-duplicate-properties
|
110
|
+
background-repeat: no-repeat;
|
96
111
|
background-size: 25px auto;
|
97
112
|
background-position: 0 2px;
|
98
113
|
}
|
@@ -113,9 +128,10 @@
|
|
113
128
|
width: 30px;
|
114
129
|
height: 30px;
|
115
130
|
// sass-lint:disable no-duplicate-properties
|
116
|
-
background
|
117
|
-
background
|
131
|
+
background: image-url("govuk_publishing_components/action-link-arrow--dark.png");
|
132
|
+
background: image-url("govuk_publishing_components/action-link-arrow--dark.svg"), linear-gradient(transparent, transparent);
|
118
133
|
// sass-lint:enable no-duplicate-properties
|
134
|
+
background-repeat: no-repeat;
|
119
135
|
background-size: 25px auto;
|
120
136
|
background-position: 0 2px;
|
121
137
|
}
|
@@ -125,10 +141,25 @@
|
|
125
141
|
}
|
126
142
|
}
|
127
143
|
|
144
|
+
.gem-c-action-link--nhs {
|
145
|
+
&:before {
|
146
|
+
width: 80px;
|
147
|
+
height: 70px;
|
148
|
+
// sass-lint:disable no-duplicate-properties
|
149
|
+
background: image-url("govuk_publishing_components/action-link--nhs.png");
|
150
|
+
background: image-url("govuk_publishing_components/action-link--nhs.svg"), linear-gradient(transparent, transparent);
|
151
|
+
// sass-lint:enable no-duplicate-properties
|
152
|
+
background-repeat: no-repeat;
|
153
|
+
background-size: 85% auto;
|
154
|
+
background-position: 0 50%;
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
128
158
|
.gem-c-action-link--light-text {
|
129
159
|
color: govuk-colour("white");
|
130
160
|
|
131
|
-
.gem-c-action-link__link
|
161
|
+
.gem-c-action-link__link,
|
162
|
+
.gem-c-action-link__subtext-link {
|
132
163
|
text-decoration: underline;
|
133
164
|
|
134
165
|
&:link,
|
@@ -1,39 +1 @@
|
|
1
1
|
@import "govuk/components/back-link/back-link";
|
2
|
-
|
3
|
-
.govuk-back-link {
|
4
|
-
&[href] {
|
5
|
-
text-decoration: underline;
|
6
|
-
border-bottom: 1px solid transparent;
|
7
|
-
|
8
|
-
&:focus {
|
9
|
-
text-decoration: none;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
|
13
|
-
&:before {
|
14
|
-
content: "";
|
15
|
-
display: block;
|
16
|
-
position: absolute;
|
17
|
-
top: 0;
|
18
|
-
bottom: 1px;
|
19
|
-
left: 3px;
|
20
|
-
width: 7px;
|
21
|
-
height: 7px;
|
22
|
-
-webkit-transform: rotate(225deg);
|
23
|
-
-ms-transform: rotate(225deg);
|
24
|
-
transform: rotate(225deg);
|
25
|
-
border: solid;
|
26
|
-
border-width: 1px 1px 0 0;
|
27
|
-
clip-path: inherit;
|
28
|
-
-webkit-clip-path: inherit;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
.govuk-back-link::after {
|
33
|
-
content: "";
|
34
|
-
position: absolute;
|
35
|
-
top: -14px;
|
36
|
-
right: 0;
|
37
|
-
left: 0;
|
38
|
-
bottom: -14px;
|
39
|
-
}
|
@@ -47,16 +47,7 @@ module GovukPublishingComponents
|
|
47
47
|
additional_files = "@import 'govuk_publishing_components/govuk_frontend_support';\n"
|
48
48
|
additional_files << "@import 'govuk_publishing_components/component_support';\n" unless print_styles
|
49
49
|
|
50
|
-
components = components_in_use
|
51
|
-
extra_components = []
|
52
|
-
|
53
|
-
components.each do |component|
|
54
|
-
components_in_component = components_within_component(component)
|
55
|
-
extra_components << components_in_component
|
56
|
-
end
|
57
|
-
|
58
|
-
components << extra_components.compact
|
59
|
-
components = components.flatten.uniq.sort
|
50
|
+
components = find_all_partials_in(components_in_use)
|
60
51
|
|
61
52
|
components.map { |component|
|
62
53
|
"@import 'govuk_publishing_components/components/#{print_path}#{component.gsub('_', '-')}';" if component_has_sass_file(component.gsub("_", "-"), print_styles)
|
@@ -66,16 +57,7 @@ module GovukPublishingComponents
|
|
66
57
|
def components_in_use_js
|
67
58
|
additional_files = "//= require govuk_publishing_components/lib\n"
|
68
59
|
|
69
|
-
components = components_in_use
|
70
|
-
extra_components = []
|
71
|
-
|
72
|
-
components.each do |component|
|
73
|
-
components_in_component = components_within_component(component)
|
74
|
-
extra_components << components_in_component
|
75
|
-
end
|
76
|
-
|
77
|
-
components << extra_components.compact
|
78
|
-
components = components.flatten.uniq.sort
|
60
|
+
components = find_all_partials_in(components_in_use)
|
79
61
|
|
80
62
|
components.map { |component|
|
81
63
|
"//= require govuk_publishing_components/components/#{component.gsub('_', '-')}" if component_has_js_file(component.gsub("_", "-"))
|
@@ -110,6 +92,34 @@ module GovukPublishingComponents
|
|
110
92
|
matches.flatten.uniq.map(&:to_s).sort.map { |m| m.gsub("govuk_publishing_components/components/", "") }
|
111
93
|
end
|
112
94
|
|
95
|
+
def find_all_partials_in(components)
|
96
|
+
components_to_search = components
|
97
|
+
partials_found = true
|
98
|
+
|
99
|
+
while partials_found
|
100
|
+
extra_components = find_partials_in(components_to_search)
|
101
|
+
|
102
|
+
if extra_components.any?
|
103
|
+
components << extra_components
|
104
|
+
components_to_search = extra_components
|
105
|
+
else
|
106
|
+
partials_found = false
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
components.flatten.uniq.sort
|
111
|
+
end
|
112
|
+
|
113
|
+
def find_partials_in(components)
|
114
|
+
extra_components = []
|
115
|
+
components.each do |component|
|
116
|
+
components_in_component = components_within_component(component)
|
117
|
+
extra_components << components_in_component
|
118
|
+
end
|
119
|
+
|
120
|
+
extra_components.flatten.uniq.sort
|
121
|
+
end
|
122
|
+
|
113
123
|
def component_has_sass_file(component, print_styles)
|
114
124
|
print_path = "print/" if print_styles
|
115
125
|
Pathname.new(@component_gem_path + "/app/assets/stylesheets/govuk_publishing_components/components/#{print_path}_#{component}.scss").exist?
|
@@ -120,8 +130,10 @@ module GovukPublishingComponents
|
|
120
130
|
end
|
121
131
|
|
122
132
|
def components_within_component(component)
|
123
|
-
|
124
|
-
|
133
|
+
filename = @component_gem_path + "/app/views/govuk_publishing_components/components/#{component}.html.erb"
|
134
|
+
filename = filename.sub(/.*\K\//, "/_") # files begin with _ but the method may have been passed 'filename' or 'dir/partial'
|
135
|
+
data = File.read(filename)
|
136
|
+
match = data.scan(/(govuk_publishing_components\/components\/[\/a-z_-]+)/)
|
125
137
|
match.flatten.uniq.map(&:to_s).sort.map { |m| m.gsub("govuk_publishing_components/components/", "") }
|
126
138
|
end
|
127
139
|
|
@@ -6,34 +6,54 @@
|
|
6
6
|
nowrap_text ||= false
|
7
7
|
href ||= false
|
8
8
|
subtext ||= false
|
9
|
+
subtext_href ||= false
|
10
|
+
mobile_subtext ||= false
|
9
11
|
light_text ||= false
|
10
12
|
simple ||= false
|
11
13
|
dark_icon ||= false
|
14
|
+
nhs_icon ||= false
|
12
15
|
data ||= nil
|
13
16
|
classes ||= nil
|
14
17
|
|
15
18
|
css_classes = %w(gem-c-action-link)
|
16
19
|
css_classes << "gem-c-action-link--light-text" if light_text
|
17
20
|
css_classes << "gem-c-action-link--dark-icon" if dark_icon
|
21
|
+
css_classes << "gem-c-action-link--nhs" if nhs_icon
|
18
22
|
css_classes << "gem-c-action-link--simple" if simple
|
19
23
|
css_classes << "gem-c-action-link--with-subtext" if subtext
|
24
|
+
css_classes << "gem-c-action-link--mobile-subtext" if mobile_subtext
|
20
25
|
css_classes << (shared_helper.get_margin_bottom)
|
21
26
|
|
22
27
|
link_classes = %w(govuk-link gem-c-action-link__link)
|
23
28
|
link_classes << shared_helper.classes if classes
|
24
29
|
%>
|
25
|
-
<% if
|
30
|
+
<% if text.present? %>
|
26
31
|
<div class="<%= css_classes.join(' ') %>">
|
27
32
|
<% contents = capture do %>
|
28
33
|
<span class="gem-c-action-link__link-wrapper">
|
29
|
-
|
34
|
+
<% main_text = capture do %>
|
30
35
|
<%= text %>
|
31
36
|
<%= content_tag(:span, nowrap_text, class: "gem-c-action-link__nowrap-text") if nowrap_text %>
|
32
37
|
<% end %>
|
38
|
+
|
39
|
+
<% if href.present? %>
|
40
|
+
<%= link_to href, class: link_classes, data: data do %>
|
41
|
+
<%= main_text %>
|
42
|
+
<% end %>
|
43
|
+
<% else %>
|
44
|
+
<%= main_text %>
|
45
|
+
<% end %>
|
33
46
|
</span>
|
47
|
+
|
34
48
|
<% if subtext %>
|
35
49
|
<span class="gem-c-action-link__subtext-wrapper">
|
36
|
-
|
50
|
+
<% if subtext_href %>
|
51
|
+
<%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") do %>
|
52
|
+
<%= link_to subtext, subtext_href, class: "gem-c-action-link__subtext-link govuk-link", data: data %>
|
53
|
+
<% end %>
|
54
|
+
<% else %>
|
55
|
+
<%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") %>
|
56
|
+
<% end %>
|
37
57
|
</span>
|
38
58
|
<% end %>
|
39
59
|
<% end %>
|
@@ -1,29 +1,49 @@
|
|
1
1
|
<%
|
2
2
|
title ||= false
|
3
3
|
path ||= false
|
4
|
-
tracking_id ||= false
|
5
4
|
breadcrumbs = [
|
6
5
|
{ title: "Home", url: "/" },
|
7
6
|
{ title: title, url: path }
|
8
7
|
]
|
9
8
|
breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
|
9
|
+
|
10
|
+
tracking_id ||= false
|
11
|
+
tracking_category ||= "stepNavHeaderClicked"
|
12
|
+
tracking_action ||= "top"
|
13
|
+
tracking_label ||= path
|
14
|
+
tracking_dimension_enabled = tracking_dimension_enabled != false
|
15
|
+
tracking_dimension ||= title
|
16
|
+
tracking_dimension_index ||= 29
|
17
|
+
|
18
|
+
if tracking_id
|
19
|
+
tracking_options ||= ({ dimension96: tracking_id }).to_json
|
20
|
+
end
|
21
|
+
|
22
|
+
local_assigns[:margin_bottom] ||= 0
|
23
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
24
|
+
classes = "gem-c-step-nav-header #{shared_helper.get_margin_bottom}"
|
10
25
|
%>
|
11
26
|
<% if title %>
|
12
27
|
<script type="application/ld+json">
|
13
28
|
<%= raw breadcrumb_presenter.structured_data.to_json %>
|
14
29
|
</script>
|
15
30
|
|
16
|
-
<div class="
|
31
|
+
<div class="<%= classes %>" data-module="track-click">
|
17
32
|
<span class="gem-c-step-nav-header__part-of">Part of</span>
|
18
33
|
<% if path %>
|
19
34
|
<a href="<%= path %>"
|
20
35
|
class="gem-c-step-nav-header__title"
|
21
|
-
data-track-category="
|
22
|
-
data-track-action="
|
23
|
-
data-track-label="<%=
|
24
|
-
|
25
|
-
|
26
|
-
|
36
|
+
data-track-category="<%= tracking_category %>"
|
37
|
+
data-track-action="<%= tracking_action %>"
|
38
|
+
data-track-label="<%= tracking_label %>"
|
39
|
+
<% if tracking_dimension_enabled %>
|
40
|
+
data-track-dimension="<%= tracking_dimension %>"
|
41
|
+
data-track-dimension-index="<%= tracking_dimension_index %>"
|
42
|
+
<% end %>
|
43
|
+
<% if tracking_id %>
|
44
|
+
data-track-options='<%= tracking_options %>'
|
45
|
+
<% end %>
|
46
|
+
>
|
27
47
|
<%= title %>
|
28
48
|
</a>
|
29
49
|
<% else %>
|
@@ -6,56 +6,84 @@ examples:
|
|
6
6
|
default:
|
7
7
|
data:
|
8
8
|
text: Go to NHS 111 online
|
9
|
-
href:
|
9
|
+
href: "/page"
|
10
10
|
with_bottom_margin:
|
11
11
|
data:
|
12
12
|
text: Look at this margin
|
13
|
-
href:
|
13
|
+
href: "/page"
|
14
14
|
margin_bottom: 9
|
15
15
|
with_data_attributes:
|
16
16
|
data:
|
17
17
|
text: "Coronavirus (COVID-19)"
|
18
|
-
href:
|
18
|
+
href: "/page"
|
19
19
|
data:
|
20
20
|
attr_test: "hasDataAttribute"
|
21
21
|
with_js_classes:
|
22
22
|
description: Use `js-` prefixed classes only as interaction hooks – to query and operate on elements via JavaScript. Classes are added to the link itself.
|
23
23
|
data:
|
24
24
|
text: "Coronavirus (COVID-19)"
|
25
|
-
href:
|
25
|
+
href: "/page"
|
26
26
|
classes: 'js-hook'
|
27
27
|
with_no_wrapping_text:
|
28
28
|
data:
|
29
29
|
text: "Coronavirus (COVID-19):"
|
30
30
|
nowrap_text: what you need to do
|
31
|
-
href:
|
31
|
+
href: "/page"
|
32
32
|
with_light_text:
|
33
33
|
data:
|
34
34
|
text: "Coronavirus (COVID-19)"
|
35
|
-
href:
|
35
|
+
href: "/page"
|
36
36
|
light_text: true
|
37
37
|
context:
|
38
38
|
dark_background: true
|
39
39
|
with_subtext:
|
40
40
|
data:
|
41
|
-
text:
|
42
|
-
href:
|
43
|
-
subtext:
|
41
|
+
text: Emergency something
|
42
|
+
href: "/page"
|
43
|
+
subtext: This is about the emergency
|
44
44
|
with_subtext_on_a_dark_background:
|
45
45
|
data:
|
46
|
-
text:
|
47
|
-
href:
|
48
|
-
subtext:
|
46
|
+
text: Emergency something
|
47
|
+
href: "/page"
|
48
|
+
subtext: This is about the emergency that is happening right now unfortunately so pay attention
|
49
|
+
light_text: true
|
50
|
+
context:
|
51
|
+
dark_background: true
|
52
|
+
mobile_subtext:
|
53
|
+
description: Lock the subtext beneath the main text, so the component with subtext always appears as it does on mobile.
|
54
|
+
data:
|
55
|
+
text: Try not to panic now
|
56
|
+
href: "/page"
|
57
|
+
subtext: "The thing that is happening is pretty scary but we'll get through it"
|
58
|
+
mobile_subtext: true
|
59
|
+
with_link_on_subtext:
|
60
|
+
description: The subtext can also be a link if required. The link on the main text is optional.
|
61
|
+
data:
|
62
|
+
text: Remain calm
|
63
|
+
subtext: Better things are ahead
|
64
|
+
subtext_href: "/page"
|
65
|
+
with_link_on_subtext_on_a_dark_background:
|
66
|
+
data:
|
67
|
+
text: Remain calm
|
68
|
+
subtext: Better things are ahead
|
69
|
+
subtext_href: "/page"
|
49
70
|
light_text: true
|
50
71
|
context:
|
51
72
|
dark_background: true
|
52
73
|
simple_arrow:
|
53
74
|
data:
|
54
|
-
text:
|
75
|
+
text: Getting financial help and keeping your business safe
|
55
76
|
href: "/financial-help"
|
56
77
|
simple: true
|
57
78
|
with_dark_icon:
|
58
79
|
data:
|
59
|
-
text:
|
60
|
-
href:
|
80
|
+
text: Coronavirus (COVID-19)
|
81
|
+
href: "/my-test-page"
|
61
82
|
dark_icon: true
|
83
|
+
with_nhs_icon:
|
84
|
+
data:
|
85
|
+
text: Something about the NHS
|
86
|
+
subtext: Perhaps you'd like to click here
|
87
|
+
subtext_href: "/page"
|
88
|
+
mobile_subtext: true
|
89
|
+
nhs_icon: true
|