govuk_publishing_components 62.0.0 → 62.2.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/javascripts/govuk_publishing_components/components/option-select.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/filter-list.js +48 -0
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +373 -245
- data/app/assets/stylesheets/component_guide/application.scss +1 -42
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +5 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +6 -11
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +34 -165
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +9 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +6 -38
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +2 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +6 -1
- data/app/controllers/govuk_publishing_components/applications_page_controller.rb +50 -0
- data/app/models/govuk_publishing_components/applications_page.rb +64 -0
- data/app/views/govuk_publishing_components/applications_page/_table-content.html.erb +39 -0
- data/app/views/govuk_publishing_components/applications_page/show.html.erb +37 -0
- data/app/views/govuk_publishing_components/audit/show.html.erb +5 -1
- data/app/views/govuk_publishing_components/component_guide/_component_list.html.erb +14 -0
- data/app/views/govuk_publishing_components/component_guide/example.html.erb +3 -3
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +50 -75
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +7 -7
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +11 -13
- data/app/views/govuk_publishing_components/components/_inverse_header.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb +27 -25
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +14 -0
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +7 -1
- data/config/routes.rb +1 -0
- data/lib/govuk_publishing_components/minitest/component_guide_test.rb +1 -1
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +0 -1
- data/lib/govuk_publishing_components/presenters/organisation_logo_helper.rb +7 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +37 -133
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +37 -133
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/fixtures.json +34 -29
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/macro-options.json +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-default.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-conditional-reveal.html +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-divider-and-none.html +30 -30
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-error.html +26 -26
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-hint.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small-with-long-text.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-small.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-conditional-items.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-and-none.html +30 -30
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-divider-none-and-conditional-items.html +40 -40
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-error-message.html +32 -32
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hint.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-hints-on-items.html +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-legend-as-a-page-heading.html +27 -27
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-optional-form-group-classes-showing-group-error.html +36 -36
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-pre-checked-values.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template-with-very-long-option-text.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +2 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +36 -132
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +36 -132
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +35 -6
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +17 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-multiple-files.html +10 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +20 -20
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +7 -15
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/fixtures.json +36 -31
- data/node_modules/govuk-frontend/dist/govuk/components/radios/macro-options.json +3 -3
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-default.html +17 -17
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-inline.html +19 -19
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-inline.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-a-divider.html +24 -24
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-conditional-reveal.html +27 -27
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-error.html +26 -26
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-hint.html +25 -25
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small-with-long-text.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-small.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-a-divider.html +24 -24
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-item-checked.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items-and-pre-checked-value.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-conditional-items.html +35 -35
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-fieldset-and-error-message.html +20 -20
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hint.html +19 -19
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-hints-on-items.html +23 -23
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-legend-as-page-heading.html +21 -21
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-optional-form-group-classes-showing-group-error.html +36 -36
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template-with-very-long-option-text.html +28 -28
- data/node_modules/govuk-frontend/dist/govuk/components/radios/template.njk +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +1 -7
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +5 -5
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +16 -16
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +46 -0
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-forced-hover-state.html +37 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +1 -7
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +3 -3
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +34 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +172 -33
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +1 -126
- data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +5 -5
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +7 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +1 -1
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
- data/node_modules/govuk-frontend/package.json +9 -8
- metadata +9 -4
- data/app/assets/javascripts/component_guide/filter-components.js +0 -35
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
- data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss.map +0 -1
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
add_gem_component_stylesheet("table")
|
|
3
3
|
add_gem_component_stylesheet("select")
|
|
4
4
|
add_gem_component_stylesheet("summary-list")
|
|
5
|
+
content_for :title, "Component audit"
|
|
5
6
|
%>
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
<%= render "govuk_publishing_components/components/back_link", {
|
|
9
|
+
href: "/component-guide",
|
|
10
|
+
} %>
|
|
11
|
+
|
|
8
12
|
<%= render "govuk_publishing_components/components/heading", {
|
|
9
13
|
text: "Components audit",
|
|
10
14
|
heading_level: 1,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<% if local_assigns[:heading] %>
|
|
2
|
+
<h2 class="govuk-heading-m"><%= local_assigns[:heading] %> (<%= local_assigns[:size] %>)</h2>
|
|
3
|
+
<% end %>
|
|
4
|
+
<%= local_assigns[:details] if local_assigns[:details] %>
|
|
5
|
+
<ul class="govuk-list govuk-list--bullet govuk-list--spaced">
|
|
6
|
+
<% local_assigns[:components].each do |component_doc| %>
|
|
7
|
+
<li data-filter-item>
|
|
8
|
+
<%= link_to component_doc.name, component_doc_path(component_doc.id), class: "govuk-link" %>
|
|
9
|
+
<p class="govuk-body">
|
|
10
|
+
<%= component_doc.description %>
|
|
11
|
+
</p>
|
|
12
|
+
</li>
|
|
13
|
+
<% end %>
|
|
14
|
+
</ul>
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
<div class="component-markdown">
|
|
23
23
|
<%= raw(@component_example.html_description) %>
|
|
24
24
|
</div>
|
|
25
|
-
<h2 class="
|
|
25
|
+
<h2 class="govuk-heading-m">
|
|
26
26
|
How it looks
|
|
27
|
-
<small>(<a href="<%= component_preview_path(@component_doc.id, @component_example.id) %>" class="govuk-link">preview</a>)</small>
|
|
27
|
+
<small class="govuk-!-font-size-16">(<a href="<%= component_preview_path(@component_doc.id, @component_example.id) %>" class="govuk-link">preview</a>)</small>
|
|
28
28
|
</h2>
|
|
29
29
|
<%= render partial: "govuk_publishing_components/component_guide/component_doc/preview", locals: { component_doc: @component_doc, example: @component_example } %>
|
|
30
30
|
|
|
31
|
-
<h2 class="
|
|
31
|
+
<h2 class="govuk-heading-m govuk-!-margin-top-4">How to call this example</h2>
|
|
32
32
|
<%= code_example %>
|
|
33
33
|
</div>
|
|
34
34
|
</div>
|
|
@@ -5,94 +5,69 @@
|
|
|
5
5
|
margin_bottom: 8,
|
|
6
6
|
} %>
|
|
7
7
|
|
|
8
|
-
<div class="component-markdown">
|
|
8
|
+
<div class="component-markdown govuk-!-margin-bottom-8">
|
|
9
9
|
<p>Components are packages of template, style, behaviour and documentation that live in your application.</p>
|
|
10
10
|
<p>See the <a href="https://github.com/alphagov/govuk_publishing_components">govuk_publishing_components gem</a> for further details, or <a href="https://docs.publishing.service.gov.uk/manual/components.html#component-guides">a list of all component guides</a>.</p>
|
|
11
11
|
<ul>
|
|
12
12
|
<li>Read about how to <a href="https://github.com/alphagov/govuk_publishing_components/blob/main/docs/publishing-to-rubygems.md">release a new version of the gem</a></li>
|
|
13
13
|
<li><a href="/component-guide/audit">View component audits</a></li>
|
|
14
|
+
<li><a href="/component-guide/applications">View application information</a></li>
|
|
14
15
|
</ul>
|
|
15
16
|
</div>
|
|
16
17
|
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
<div data-module="filter-list" data-filter-label="Search components">
|
|
19
|
+
<% if !ENV["MAIN_COMPONENT_GUIDE"] %>
|
|
20
|
+
<%= render partial: "component_list", locals: {
|
|
21
|
+
heading: "Components in this application",
|
|
22
|
+
size: @component_docs.length,
|
|
23
|
+
components: @component_docs,
|
|
24
|
+
} %>
|
|
22
25
|
|
|
23
|
-
<%
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<%=
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
<% details = capture do %>
|
|
27
|
+
<%= render "govuk_publishing_components/components/details", {
|
|
28
|
+
title: "Suggested imports for this application",
|
|
29
|
+
margin_bottom: 6,
|
|
30
|
+
} do %>
|
|
31
|
+
<%= render "govuk_publishing_components/components/textarea", {
|
|
32
|
+
label: {
|
|
33
|
+
text: "Add this to your application's main scss file, before your other local imports.",
|
|
34
|
+
},
|
|
35
|
+
name: "main-sass",
|
|
36
|
+
value: @components_in_use_sass,
|
|
37
|
+
} %>
|
|
38
|
+
<%= render "govuk_publishing_components/components/textarea", {
|
|
39
|
+
label: {
|
|
40
|
+
text: "Add this to your application's main js file, before your other local imports.",
|
|
41
|
+
},
|
|
42
|
+
name: "main-js",
|
|
43
|
+
value: @components_in_use_js,
|
|
44
|
+
margin_bottom: 0,
|
|
45
|
+
} %>
|
|
46
|
+
<% end %>
|
|
33
47
|
<% end %>
|
|
34
|
-
</ul>
|
|
35
|
-
|
|
36
|
-
<h2 class="component-doc-h2">Gem components used by this app (<%= @used_components.length %>)</h2>
|
|
37
48
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
text: "Add this to your application's main scss file, before your other local imports.",
|
|
44
|
-
},
|
|
45
|
-
name: "main-sass",
|
|
46
|
-
value: @components_in_use_sass,
|
|
49
|
+
<%= render partial: "component_list", locals: {
|
|
50
|
+
heading: "Gem components used by this app",
|
|
51
|
+
size: @used_components.length,
|
|
52
|
+
components: @used_components,
|
|
53
|
+
details: details,
|
|
47
54
|
} %>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
value: @components_in_use_js,
|
|
55
|
+
|
|
56
|
+
<%= render partial: "component_list", locals: {
|
|
57
|
+
heading: "Gem components not used by this app",
|
|
58
|
+
size: @unused_components.length,
|
|
59
|
+
components: @unused_components,
|
|
54
60
|
} %>
|
|
61
|
+
<% else %>
|
|
62
|
+
<div id="list-all-components-in-the-gem">
|
|
63
|
+
<%= render partial: "component_list", locals: {
|
|
64
|
+
size: @gem_component_docs.length,
|
|
65
|
+
components: @gem_component_docs,
|
|
66
|
+
} %>
|
|
67
|
+
</div>
|
|
55
68
|
<% end %>
|
|
56
|
-
<pre>
|
|
57
|
-
|
|
58
|
-
</pre>
|
|
59
|
-
|
|
60
|
-
<ul class="component-list">
|
|
61
|
-
<% @used_components.each do |component_doc| %>
|
|
62
|
-
<li>
|
|
63
|
-
<%= link_to component_doc.name, component_doc_path(component_doc.id), class: "govuk-link" %>
|
|
64
|
-
<p>
|
|
65
|
-
<%= component_doc.description %>
|
|
66
|
-
</p>
|
|
67
|
-
</li>
|
|
68
|
-
<% end %>
|
|
69
|
-
</ul>
|
|
70
|
-
|
|
71
|
-
<h2 class="component-doc-h2">Gem components not used by this app (<%= @unused_components.length %>)</h2>
|
|
72
|
-
<ul class="component-list">
|
|
73
|
-
<% @unused_components.each do |component_doc| %>
|
|
74
|
-
<li>
|
|
75
|
-
<%= link_to component_doc.name, component_doc_path(component_doc.id), class: "govuk-link" %>
|
|
76
|
-
<p>
|
|
77
|
-
<%= component_doc.description %>
|
|
78
|
-
</p>
|
|
79
|
-
</li>
|
|
80
|
-
<% end %>
|
|
81
|
-
</ul>
|
|
82
|
-
|
|
83
|
-
<% else %>
|
|
84
|
-
<ul class="component-list" id="list-all-components-in-the-gem">
|
|
85
|
-
<% @gem_component_docs.each do |component_doc| %>
|
|
86
|
-
<li>
|
|
87
|
-
<%= link_to component_doc.name, component_doc_path(component_doc.id), class: "govuk-link" %>
|
|
88
|
-
<p>
|
|
89
|
-
<%= component_doc.description %>
|
|
90
|
-
</p>
|
|
91
|
-
</li>
|
|
92
|
-
<% end %>
|
|
93
|
-
</ul>
|
|
94
|
-
<% end %>
|
|
95
69
|
|
|
96
|
-
<div class="component-markdown">
|
|
97
|
-
|
|
70
|
+
<div class="component-markdown">
|
|
71
|
+
<p class="govuk-body">If you cannot find a suitable component consider extending an existing component or <a href="https://github.com/alphagov/govuk_publishing_components/blob/main/docs/generate-a-new-component.md">creating a new one</a>.</p>
|
|
72
|
+
</div>
|
|
98
73
|
</div>
|
|
@@ -64,18 +64,18 @@
|
|
|
64
64
|
} %>
|
|
65
65
|
</div>
|
|
66
66
|
|
|
67
|
-
<h2 class="
|
|
67
|
+
<h2 class="govuk-heading-m" id="how-it-looks">
|
|
68
68
|
<a href="<%= component_example_path(@component_doc.id, "default") %>" class="govuk-link">How it looks</a>
|
|
69
|
-
<small>(<a href="<%= component_preview_path(@component_doc.id, "default") %>" class="govuk-link">preview</a>)</small>
|
|
70
|
-
<small>(<a href="<%= component_preview_all_path(@component_doc.id) %>" class="govuk-link">preview all</a>)</small>
|
|
69
|
+
<small class="govuk-!-font-size-16">(<a href="<%= component_preview_path(@component_doc.id, "default") %>" class="govuk-link">preview</a>)</small>
|
|
70
|
+
<small class="govuk-!-font-size-16">(<a href="<%= component_preview_all_path(@component_doc.id) %>" class="govuk-link">preview all</a>)</small>
|
|
71
71
|
</h2>
|
|
72
72
|
<%= render "govuk_publishing_components/component_guide/component_doc/preview", component_doc: @component_doc, example: @component_doc.example %>
|
|
73
73
|
|
|
74
|
-
<h2 class="
|
|
74
|
+
<h2 class="govuk-heading-m govuk-!-margin-top-4" id="how-to-call-this-component">How to call this component</h2>
|
|
75
75
|
<%= render "govuk_publishing_components/component_guide/component_doc/call", component_doc: @component_doc, example: @component_doc.example %>
|
|
76
76
|
|
|
77
77
|
<% if @component_doc.govuk_frontend_components.any? %>
|
|
78
|
-
<h2 class="
|
|
78
|
+
<h2 class="govuk-heading-m" id="govuk-design-system">GOV.UK Design System</h2>
|
|
79
79
|
<div class="component-markdown">
|
|
80
80
|
<p>This component incorporates components from the <%= link_to "GOV.UK Design System", "https://design-system.service.gov.uk" %>:</p>
|
|
81
81
|
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<% if @component_doc.accessibility_criteria.present? %>
|
|
91
91
|
<div class="govuk-grid-row component-accessibility-criteria" id="accessibility-acceptance-criteria">
|
|
92
92
|
<div class="govuk-grid-column-two-thirds">
|
|
93
|
-
<h2 class="
|
|
93
|
+
<h2 class="govuk-heading-m">Accessibility acceptance criteria</h2>
|
|
94
94
|
<div class="component-markdown">
|
|
95
95
|
<%= raw(@component_doc.html_accessibility_criteria) %>
|
|
96
96
|
</div>
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
|
|
101
101
|
<% if @component_doc.other_examples.any? or @component_doc.uses_component_wrapper_helper? %>
|
|
102
102
|
<div class="examples">
|
|
103
|
-
<h2 class="
|
|
103
|
+
<h2 class="govuk-heading-m" id="other-examples">Other examples</h2>
|
|
104
104
|
|
|
105
105
|
<% if @component_doc.uses_component_wrapper_helper? %>
|
|
106
106
|
<div class="component-example" id="standard-options">
|
|
@@ -9,14 +9,11 @@
|
|
|
9
9
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
10
10
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
|
11
11
|
component_helper.add_class("gem-c-image-card")
|
|
12
|
-
component_helper.add_class("govuk-grid-row") if card_helper.two_thirds
|
|
13
12
|
component_helper.add_class("gem-c-image-card--large") if card_helper.large
|
|
14
13
|
component_helper.add_class("gem-c-image-card--two-thirds") if card_helper.two_thirds
|
|
15
|
-
component_helper.add_class("gem-c-image-card--no-image") unless (card_helper.image_src || card_helper.youtube_video_id)
|
|
16
14
|
component_helper.add_class(brand_helper.brand_class) if brand_helper.brand_class
|
|
17
15
|
|
|
18
16
|
text_wrapper_classes = %w[gem-c-image-card__text-wrapper]
|
|
19
|
-
text_wrapper_classes << "gem-c-image-card__text-wrapper--two-thirds" if card_helper.two_thirds
|
|
20
17
|
|
|
21
18
|
font_size ||= card_helper.large ? "m" : "s"
|
|
22
19
|
heading_class = %w[gem-c-image-card__title]
|
|
@@ -42,19 +39,20 @@
|
|
|
42
39
|
<% if card_helper.href || card_helper.extra_details.any? %>
|
|
43
40
|
<%= tag.div(**component_helper.all_attributes) do %>
|
|
44
41
|
<%= content_tag(:div, class: text_wrapper_classes) do %>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
<%= card_helper.context %>
|
|
43
|
+
|
|
44
|
+
<% if card_helper.heading_text %>
|
|
45
|
+
<%= content_tag(shared_helper.get_heading_level, class: heading_class) do %>
|
|
46
|
+
<% if card_helper.href %>
|
|
47
|
+
<%= link_to card_helper.heading_text, card_helper.href, class: heading_link_classes %>
|
|
48
|
+
<% else %>
|
|
49
|
+
<%= card_helper.heading_text %>
|
|
53
50
|
<% end %>
|
|
54
51
|
<% end %>
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
<% end %>
|
|
53
|
+
|
|
57
54
|
<%= card_helper.description %>
|
|
55
|
+
|
|
58
56
|
<% if card_helper.extra_details.any? %>
|
|
59
57
|
<ul class="gem-c-image-card__list <%= "gem-c-image-card__list--indented" if not card_helper.extra_details_no_indent %>">
|
|
60
58
|
<% card_helper.extra_details.each do |link| %>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
component_helper.add_class("gem-c-inverse-header--html-publication-header") if local_assigns[:html_publication_header]
|
|
12
12
|
component_helper.add_class("govuk-!-padding-top-#{padding_top}") if [*0..9].include?(padding_top)
|
|
13
13
|
component_helper.add_class("govuk-!-padding-bottom-#{padding_bottom}") if [*0..9].include?(padding_bottom)
|
|
14
|
+
component_helper.add_class("gem-c-inverse-header--hmrc-header") if local_assigns[:hmrc_header]
|
|
14
15
|
%>
|
|
15
16
|
<% block = yield %>
|
|
16
17
|
<% unless block.empty? %>
|
data/app/views/govuk_publishing_components/components/contextual_sidebar/_ukraine_cta.html.erb
CHANGED
|
@@ -4,31 +4,33 @@
|
|
|
4
4
|
lang = shared_helper.t_locale("components.related_navigation.ukraine.title")
|
|
5
5
|
data_module = "ga4-link-tracker" unless disable_ga4
|
|
6
6
|
%>
|
|
7
|
-
|
|
8
|
-
<%= tag.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
link[:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
<div class="gem-c-contextual-sidebar__cta-ukraine">
|
|
8
|
+
<%= tag.div class: "gem-c-contextual-sidebar__cta", data: { module: data_module } do %>
|
|
9
|
+
<%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
|
|
10
|
+
<%= tag.ul class: "gem-c-contextual-sidebar__list" do %>
|
|
11
|
+
<% index_total = t("components.related_navigation.ukraine.links").length %>
|
|
12
|
+
<% t("components.related_navigation.ukraine.links").each_with_index do |link, index| %>
|
|
13
|
+
<%= tag.li class: "gem-c-contextual-sidebar__text govuk-body" do %>
|
|
14
|
+
<%
|
|
15
|
+
ga4_attributes = {
|
|
16
|
+
event_name: "navigation",
|
|
17
|
+
type: "related content",
|
|
18
|
+
index_section: "#{ga4_tracking_counts.index_section_count}",
|
|
19
|
+
index_link: "#{index + 1}",
|
|
20
|
+
index_section_count: "#{ga4_tracking_counts.index_section_count}",
|
|
21
|
+
index_total: "#{index_total}",
|
|
22
|
+
section: title,
|
|
23
|
+
} unless disable_ga4
|
|
24
|
+
%>
|
|
25
|
+
<%= link_to link[:label],
|
|
26
|
+
link[:href],
|
|
27
|
+
class: "govuk-link",
|
|
28
|
+
data: {
|
|
29
|
+
ga4_link: ga4_attributes,
|
|
30
|
+
},
|
|
31
|
+
lang: lang %>
|
|
32
|
+
<% end %>
|
|
31
33
|
<% end %>
|
|
32
34
|
<% end %>
|
|
33
35
|
<% end %>
|
|
34
|
-
|
|
36
|
+
</div>
|
|
@@ -874,6 +874,12 @@ examples:
|
|
|
874
874
|
<li>two</li>
|
|
875
875
|
<li>three</li>
|
|
876
876
|
</ul>
|
|
877
|
+
<h2>unordered list without bullets:</h2>
|
|
878
|
+
<ul class="list-no-bullets">
|
|
879
|
+
<li>one</li>
|
|
880
|
+
<li>two</li>
|
|
881
|
+
<li>three</li>
|
|
882
|
+
</ul>
|
|
877
883
|
legislative_lists:
|
|
878
884
|
description: Example taken from [GOV.UK Immigration rules](https://www.gov.uk/guidance/immigration-rules/immigration-rules-introduction)
|
|
879
885
|
data:
|
|
@@ -72,6 +72,20 @@ examples:
|
|
|
72
72
|
margin_bottom: 0
|
|
73
73
|
} %>
|
|
74
74
|
<!-- end of example content -->
|
|
75
|
+
hmrc_header:
|
|
76
|
+
description: For use on HMRC manual pages such as [Capital Gains Manual](https://www.gov.uk/hmrc-internal-manuals/capital-gains-manual).
|
|
77
|
+
data:
|
|
78
|
+
hmrc_header: true
|
|
79
|
+
block: |
|
|
80
|
+
<!-- example content -->
|
|
81
|
+
<%= render "govuk_publishing_components/components/heading", {
|
|
82
|
+
context: "HMRC internal manual",
|
|
83
|
+
text: "Capital Gains Manual",
|
|
84
|
+
inverse: true,
|
|
85
|
+
margin_bottom: 0,
|
|
86
|
+
font_size: "xl"
|
|
87
|
+
} %>
|
|
88
|
+
<!-- end of example content -->
|
|
75
89
|
with_paragraph_and_link:
|
|
76
90
|
data:
|
|
77
91
|
block: |
|
|
@@ -28,6 +28,12 @@ examples:
|
|
|
28
28
|
name: 'Single Identity'
|
|
29
29
|
url: 'http://www.gov.uk'
|
|
30
30
|
crest: 'single-identity'
|
|
31
|
+
no_identity:
|
|
32
|
+
data:
|
|
33
|
+
organisation:
|
|
34
|
+
name: 'No Identity'
|
|
35
|
+
url: 'http://www.gov.uk'
|
|
36
|
+
crest: 'no-identity'
|
|
31
37
|
attorney_generals_office:
|
|
32
38
|
data:
|
|
33
39
|
organisation:
|
|
@@ -139,7 +145,7 @@ examples:
|
|
|
139
145
|
name: 'Land Registry'
|
|
140
146
|
url: '/government/organisations/land-registry'
|
|
141
147
|
brand: 'department-for-business-innovation-skills'
|
|
142
|
-
crest:
|
|
148
|
+
crest: "custom"
|
|
143
149
|
image:
|
|
144
150
|
url: 'https://assets.publishing.service.gov.uk/government/uploads/system/uploads/organisation/logo/69/HMLR_logo.png'
|
|
145
151
|
alt_text: 'Land Registry'
|
data/config/routes.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
GovukPublishingComponents::Engine.routes.draw do
|
|
2
2
|
get "/audit" => "audit#show", as: :audit
|
|
3
|
+
get "/applications" => "applications_page#show", as: :apps
|
|
3
4
|
root to: "component_guide#index", as: :component_guide
|
|
4
5
|
get ":component/preview" => "component_guide#preview", as: :component_preview_all
|
|
5
6
|
get ":component/:example/preview" => "component_guide#preview", as: :component_preview
|
|
@@ -11,7 +11,7 @@ module GovukPublishingComponents
|
|
|
11
11
|
assert_equal "function", evaluate_script("typeof window.GOVUK.AccessibilityTest"), "AccessibilityTest JavaScript isn’t available"
|
|
12
12
|
assert_equal "string", evaluate_script("typeof window.axe.version"), "aXe accessibility test library isn’t available"
|
|
13
13
|
|
|
14
|
-
all(:css, ".
|
|
14
|
+
all(:css, ".govuk-list.govuk-list--bullet a").map { |el| "#{el[:href]}/preview" }.each do |component|
|
|
15
15
|
visit component
|
|
16
16
|
assert page.has_css?(".js-test-a11y-finished"), "Accessibility test did not run on #{component}"
|
|
17
17
|
assert page.has_css?(".js-test-a11y-success"), "Accessibility test found violations on #{component}"
|
|
@@ -30,9 +30,15 @@ module GovukPublishingComponents
|
|
|
30
30
|
logo_class = "gem-c-organisation-logo__container"
|
|
31
31
|
logo_class = "#{logo_class} gem-c-organisation-logo__link" if url
|
|
32
32
|
logo_class = "#{logo_class} gem-c-organisation-logo__link-hide-underline" if hide_underline
|
|
33
|
-
logo_class = "#{logo_class} gem-c-organisation-logo__crest gem-c-organisation-logo__crest--#{crest}" if
|
|
33
|
+
logo_class = "#{logo_class} gem-c-organisation-logo__crest gem-c-organisation-logo__crest--#{crest}" if crest_has_visual_identity?
|
|
34
34
|
logo_class
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
def crest_has_visual_identity?
|
|
40
|
+
crest.present? && !%w[no-identity custom].include?(crest)
|
|
41
|
+
end
|
|
36
42
|
end
|
|
37
43
|
end
|
|
38
44
|
end
|