govuk_publishing_components 58.1.1 → 59.0.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/select-with-search/cross-icon.svg +6 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-search-tracker.js +4 -0
- data/app/assets/javascripts/govuk_publishing_components/components/select-with-search.js +57 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +14 -136
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +6 -48
- data/app/assets/stylesheets/govuk_publishing_components/components/_select-with-search.scss +168 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_tag.scss +14 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -1
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +4 -37
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_select.html.erb +22 -23
- data/app/views/govuk_publishing_components/components/_select_with_search.html.erb +14 -0
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +17 -9
- data/app/views/govuk_publishing_components/components/_tag.html.erb +20 -0
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +0 -62
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +13 -0
- data/app/views/govuk_publishing_components/components/docs/select.yml +11 -0
- data/app/views/govuk_publishing_components/components/docs/select_with_search.yml +196 -0
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +10 -0
- data/app/views/govuk_publishing_components/components/docs/signup_link.yml +0 -7
- data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +1 -7
- data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +1 -7
- data/app/views/govuk_publishing_components/components/docs/tag.yml +57 -0
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +16 -5
- data/lib/govuk_publishing_components/presenters/heading_helper.rb +1 -2
- data/lib/govuk_publishing_components/presenters/select_helper.rb +8 -5
- data/lib/govuk_publishing_components/presenters/select_with_search_helper.rb +92 -0
- data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +1 -0
- data/node_modules/choices.js/LICENSE +21 -0
- data/node_modules/choices.js/README.md +1360 -0
- data/node_modules/choices.js/package.json +173 -0
- data/node_modules/choices.js/public/assets/scripts/choices.js +5230 -0
- data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -0
- data/node_modules/choices.js/public/assets/scripts/choices.mjs +5222 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +4748 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +4740 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +3631 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +3623 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +3590 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -0
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +3582 -0
- data/node_modules/choices.js/public/assets/styles/base.css +180 -0
- data/node_modules/choices.js/public/assets/styles/base.css.map +1 -0
- data/node_modules/choices.js/public/assets/styles/base.min.css +1 -0
- data/node_modules/choices.js/public/assets/styles/choices.css +338 -0
- data/node_modules/choices.js/public/assets/styles/choices.css.map +1 -0
- data/node_modules/choices.js/public/assets/styles/choices.min.css +1 -0
- data/node_modules/choices.js/public/types/src/index.d.ts +6 -0
- data/node_modules/choices.js/public/types/src/scripts/actions/choices.d.ts +30 -0
- data/node_modules/choices.js/public/types/src/scripts/actions/groups.d.ts +8 -0
- data/node_modules/choices.js/public/types/src/scripts/actions/items.d.ts +17 -0
- data/node_modules/choices.js/public/types/src/scripts/choices.d.ts +210 -0
- data/node_modules/choices.js/public/types/src/scripts/components/container.d.ts +36 -0
- data/node_modules/choices.js/public/types/src/scripts/components/dropdown.d.ts +21 -0
- data/node_modules/choices.js/public/types/src/scripts/components/index.d.ts +7 -0
- data/node_modules/choices.js/public/types/src/scripts/components/input.d.ts +37 -0
- data/node_modules/choices.js/public/types/src/scripts/components/list.d.ts +14 -0
- data/node_modules/choices.js/public/types/src/scripts/components/wrapped-element.d.ts +21 -0
- data/node_modules/choices.js/public/types/src/scripts/components/wrapped-input.d.ts +3 -0
- data/node_modules/choices.js/public/types/src/scripts/components/wrapped-select.d.ts +20 -0
- data/node_modules/choices.js/public/types/src/scripts/constants.d.ts +1 -0
- data/node_modules/choices.js/public/types/src/scripts/defaults.d.ts +4 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/action-type.d.ts +13 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/build-flags.d.ts +11 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/choice-full.d.ts +23 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/class-names.d.ts +61 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/event-choice.d.ts +7 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/event-type.d.ts +14 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/group-full.d.ts +10 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/index.d.ts +14 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/input-choice.d.ts +15 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/input-group.d.ts +10 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/item.d.ts +17 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/keycode-map.d.ts +13 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/options.d.ts +566 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/passed-element-type.d.ts +7 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/passed-element.d.ts +95 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/position-options-type.d.ts +1 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/search.d.ts +11 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/state.d.ts +10 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/store.d.ts +64 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/string-pre-escaped.d.ts +3 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/string-untrusted.d.ts +4 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/templates.d.ts +29 -0
- data/node_modules/choices.js/public/types/src/scripts/interfaces/types.d.ts +18 -0
- data/node_modules/choices.js/public/types/src/scripts/lib/choice-input.d.ts +9 -0
- data/node_modules/choices.js/public/types/src/scripts/lib/html-guard-statements.d.ts +4 -0
- data/node_modules/choices.js/public/types/src/scripts/lib/utils.d.ts +31 -0
- data/node_modules/choices.js/public/types/src/scripts/reducers/choices.d.ts +8 -0
- data/node_modules/choices.js/public/types/src/scripts/reducers/groups.d.ts +8 -0
- data/node_modules/choices.js/public/types/src/scripts/reducers/items.d.ts +9 -0
- data/node_modules/choices.js/public/types/src/scripts/search/fuse.d.ts +14 -0
- data/node_modules/choices.js/public/types/src/scripts/search/index.d.ts +3 -0
- data/node_modules/choices.js/public/types/src/scripts/search/kmp.d.ts +11 -0
- data/node_modules/choices.js/public/types/src/scripts/search/prefix-filter.d.ts +11 -0
- data/node_modules/choices.js/public/types/src/scripts/store/store.d.ts +59 -0
- data/node_modules/choices.js/public/types/src/scripts/templates.d.ts +8 -0
- data/node_modules/choices.js/src/entry.js +3 -0
- data/node_modules/choices.js/src/icons/cross-inverse.svg +1 -0
- data/node_modules/choices.js/src/icons/cross.svg +1 -0
- data/node_modules/choices.js/src/index.ts +8 -0
- data/node_modules/choices.js/src/scripts/actions/choices.ts +59 -0
- data/node_modules/choices.js/src/scripts/actions/groups.ts +14 -0
- data/node_modules/choices.js/src/scripts/actions/items.ts +34 -0
- data/node_modules/choices.js/src/scripts/choices.ts +2364 -0
- data/node_modules/choices.js/src/scripts/components/container.ts +157 -0
- data/node_modules/choices.js/src/scripts/components/dropdown.ts +50 -0
- data/node_modules/choices.js/src/scripts/components/index.ts +8 -0
- data/node_modules/choices.js/src/scripts/components/input.ts +146 -0
- data/node_modules/choices.js/src/scripts/components/list.ts +89 -0
- data/node_modules/choices.js/src/scripts/components/wrapped-element.ts +89 -0
- data/node_modules/choices.js/src/scripts/components/wrapped-input.ts +3 -0
- data/node_modules/choices.js/src/scripts/components/wrapped-select.ts +115 -0
- data/node_modules/choices.js/src/scripts/constants.ts +1 -0
- data/node_modules/choices.js/src/scripts/defaults.ts +93 -0
- data/node_modules/choices.js/src/scripts/interfaces/action-type.ts +15 -0
- data/node_modules/choices.js/src/scripts/interfaces/build-flags.ts +17 -0
- data/node_modules/choices.js/src/scripts/interfaces/choice-full.ts +30 -0
- data/node_modules/choices.js/src/scripts/interfaces/class-names.ts +61 -0
- data/node_modules/choices.js/src/scripts/interfaces/event-choice.ts +9 -0
- data/node_modules/choices.js/src/scripts/interfaces/event-type.ts +16 -0
- data/node_modules/choices.js/src/scripts/interfaces/group-full.ts +12 -0
- data/node_modules/choices.js/src/scripts/interfaces/index.ts +14 -0
- data/node_modules/choices.js/src/scripts/interfaces/input-choice.ts +17 -0
- data/node_modules/choices.js/src/scripts/interfaces/input-group.ts +11 -0
- data/node_modules/choices.js/src/scripts/interfaces/item.ts +17 -0
- data/node_modules/choices.js/src/scripts/interfaces/keycode-map.ts +13 -0
- data/node_modules/choices.js/src/scripts/interfaces/options.ts +619 -0
- data/node_modules/choices.js/src/scripts/interfaces/passed-element-type.ts +9 -0
- data/node_modules/choices.js/src/scripts/interfaces/passed-element.ts +96 -0
- data/node_modules/choices.js/src/scripts/interfaces/position-options-type.ts +1 -0
- data/node_modules/choices.js/src/scripts/interfaces/search.ts +12 -0
- data/node_modules/choices.js/src/scripts/interfaces/state.ts +12 -0
- data/node_modules/choices.js/src/scripts/interfaces/store.ts +84 -0
- data/node_modules/choices.js/src/scripts/interfaces/string-pre-escaped.ts +3 -0
- data/node_modules/choices.js/src/scripts/interfaces/string-untrusted.ts +5 -0
- data/node_modules/choices.js/src/scripts/interfaces/templates.ts +66 -0
- data/node_modules/choices.js/src/scripts/interfaces/types.ts +21 -0
- data/node_modules/choices.js/src/scripts/lib/choice-input.ts +88 -0
- data/node_modules/choices.js/src/scripts/lib/html-guard-statements.ts +7 -0
- data/node_modules/choices.js/src/scripts/lib/utils.ts +230 -0
- data/node_modules/choices.js/src/scripts/reducers/choices.ts +86 -0
- data/node_modules/choices.js/src/scripts/reducers/groups.ts +32 -0
- data/node_modules/choices.js/src/scripts/reducers/items.ts +86 -0
- data/node_modules/choices.js/src/scripts/search/fuse.ts +59 -0
- data/node_modules/choices.js/src/scripts/search/index.ts +17 -0
- data/node_modules/choices.js/src/scripts/search/kmp.ts +87 -0
- data/node_modules/choices.js/src/scripts/search/prefix-filter.ts +42 -0
- data/node_modules/choices.js/src/scripts/store/store.ts +184 -0
- data/node_modules/choices.js/src/scripts/templates.ts +409 -0
- data/node_modules/choices.js/src/styles/base.scss +189 -0
- data/node_modules/choices.js/src/styles/choices.scss +414 -0
- data/node_modules/choices.js/src/tsconfig.json +22 -0
- metadata +137 -4
- data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.svg +0 -5
- data/app/assets/images/govuk_publishing_components/action-link-arrow--simple-light.svg +0 -4
- data/app/assets/images/govuk_publishing_components/action-link-arrow.svg +0 -5
@@ -8,42 +8,41 @@
|
|
8
8
|
is_page_heading ||= false
|
9
9
|
data_attributes ||= {}
|
10
10
|
aria_controls ||= nil
|
11
|
+
heading_size ||= false
|
12
|
+
multiple ||= false
|
13
|
+
include_blank ||= false
|
11
14
|
|
12
|
-
|
13
|
-
heading_size = false unless shared_helper.valid_heading_size?(heading_size)
|
14
|
-
select_helper = GovukPublishingComponents::Presenters::SelectHelper.new(local_assigns)
|
15
|
+
select_helper ||= GovukPublishingComponents::Presenters::SelectHelper.new(local_assigns)
|
15
16
|
|
16
17
|
aria_attributes = {
|
17
18
|
controls: aria_controls,
|
18
19
|
describedby: select_helper.describedby
|
19
20
|
}
|
20
21
|
%>
|
21
|
-
<% if select_helper.
|
22
|
+
<% if select_helper.options_markup.present? && id && label %>
|
22
23
|
<%= content_tag :div, class: select_helper.css_classes do %>
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
<% if select_helper.hint %>
|
34
|
-
<%= render "govuk_publishing_components/components/hint", {
|
35
|
-
id: select_helper.hint_id,
|
36
|
-
text: hint
|
37
|
-
} %>
|
38
|
-
<% end %>
|
24
|
+
<%= render "govuk_publishing_components/components/label", {
|
25
|
+
id: "#{id}-label",
|
26
|
+
html_for: id,
|
27
|
+
text: label,
|
28
|
+
heading_size:,
|
29
|
+
is_page_heading:,
|
30
|
+
hint_text: select_helper.hint,
|
31
|
+
hint_id: select_helper.hint_id,
|
32
|
+
} %>
|
39
33
|
|
40
|
-
<% if select_helper.
|
34
|
+
<% if select_helper.error_items.any? %>
|
41
35
|
<%= render "govuk_publishing_components/components/error_message", {
|
42
36
|
id: select_helper.error_id,
|
43
|
-
|
37
|
+
items: select_helper.error_items,
|
44
38
|
} %>
|
45
39
|
<% end %>
|
46
40
|
|
47
|
-
|
41
|
+
<%# Create null input so that the value is cleared if no options are selected %>
|
42
|
+
<%# https://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-select-label-Gotcha %>
|
43
|
+
<% if multiple %>
|
44
|
+
<%= hidden_field_tag name, nil %>
|
45
|
+
<% end %>
|
46
|
+
<%= select_tag name, select_helper.options_markup, id: id, class: select_helper.select_classes, aria: aria_attributes, data: data_attributes, multiple: %>
|
48
47
|
<% end %>
|
49
48
|
<% end %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%
|
2
|
+
add_gem_component_stylesheet("select-with-search")
|
3
|
+
|
4
|
+
# select_helper.select_classes generates "gem-c-select-with-search"
|
5
|
+
select_helper = GovukPublishingComponents::Presenters::SelectWithSearchHelper.new(local_assigns)
|
6
|
+
|
7
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
8
|
+
component_helper.add_data_attribute({ module: "select-with-search" })
|
9
|
+
%>
|
10
|
+
<%= render "govuk_publishing_components/components/select", {
|
11
|
+
**local_assigns,
|
12
|
+
**component_helper.all_attributes,
|
13
|
+
select_helper:
|
14
|
+
}.with_indifferent_access %>
|
@@ -77,18 +77,18 @@
|
|
77
77
|
data: data_attributes,
|
78
78
|
class: "govuk-link govuk-link--no-underline gem-c-share-links__link" do %>
|
79
79
|
<span class="gem-c-share-links__link-icon">
|
80
|
-
<% if link[:icon] == '
|
81
|
-
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"
|
82
|
-
<path fill="currentColor" d="
|
83
|
-
</svg>
|
84
|
-
<% elsif link[:icon] == 'twitter' %>
|
85
|
-
<svg viewBox="0 0 1200 1227" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
86
|
-
<path fill="currentColor" d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
|
80
|
+
<% if link[:icon] == 'bluesky' %>
|
81
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
82
|
+
<path fill="currentColor" d="M5.2,2.9c2.8,2.1,5.7,6.3,6.8,8.5,1.1-2.2,4-6.4,6.8-8.5,2-1.5,5.2-2.6,5.2,1s-.4,6.2-.7,7c-.9,3.1-4,3.8-6.8,3.4,4.9.8,6.1,3.6,3.4,6.3-5.1,5.2-7.3-1.3-7.8-3-.1-.3-.2-.4-.2-.3,0-.1,0,0-.2.3-.6,1.7-2.8,8.2-7.8,3-2.7-2.7-1.4-5.5,3.4-6.3-2.8.5-5.9-.3-6.8-3.4-.2-.9-.7-6.3-.7-7C0,.2,3.2,1.4,5.2,2.9Z"/>
|
87
83
|
</svg>
|
88
84
|
<% elsif link[:icon] == 'email' %>
|
89
85
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 73.84 73.84" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
90
86
|
<path fill="currentColor" d="M36.92,0A36.92,36.92,0,1,0,73.84,36.92,36.92,36.92,0,0,0,36.92,0ZM58.37,21,36.92,39.45,15.47,21ZM11.65,23.66,26.27,36.23,11.65,49.9ZM15.1,52.83,29.7,39.18l7.22,6.21,7.22-6.21,14.6,13.65ZM62.19,49.9,47.57,36.23,62.19,23.66Z"/>
|
91
87
|
</svg>
|
88
|
+
<% elsif link[:icon] == 'facebook' %>
|
89
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
90
|
+
<path fill="currentColor" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
|
91
|
+
</svg>
|
92
92
|
<% elsif link[:icon] == 'flickr' %>
|
93
93
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
94
94
|
<path fill="currentColor" d="M5.334 6.666C2.3884 6.666 0 9.055 0 12c0 2.9456 2.3884 5.334 5.334 5.334 2.9456 0 5.332-2.3884 5.332-5.334 0-2.945-2.3864-5.334-5.332-5.334zm13.332 0c-2.9456 0-5.332 2.389-5.332 5.334 0 2.9456 2.3864 5.334 5.332 5.334C21.6116 17.334 24 14.9456 24 12c0-2.945-2.3884-5.334-5.334-5.334Z"/>
|
@@ -101,14 +101,22 @@
|
|
101
101
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
102
102
|
<path fill="currentColor" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>
|
103
103
|
</svg>
|
104
|
-
<% elsif link[:icon] == '
|
104
|
+
<% elsif link[:icon] == 'threads' %>
|
105
105
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
106
|
-
<path fill="currentColor" d="
|
106
|
+
<path fill="currentColor" d="M12.2,24h0c-3.6,0-6.3-1.2-8.2-3.5-1.6-2.1-2.5-4.9-2.5-8.5h0c0-3.6.9-6.4,2.5-8.5C5.8,1.2,8.6,0,12.2,0h0c2.7,0,5,.7,6.8,2.1,1.7,1.3,2.9,3.1,3.5,5.5l-2,.6c-1.1-4-3.9-6-8.3-6s-5.1.9-6.5,2.7c-1.3,1.7-2,4.1-2.1,7.2,0,3.1.7,5.5,2.1,7.2,1.4,1.8,3.6,2.7,6.5,2.7s4.4-.6,5.8-2,1.6-3.6,1.1-4.8c-.3-.7-.9-1.3-1.6-1.7-.2,1.4-.6,2.4-1.3,3.3-.9,1.1-2.1,1.7-3.7,1.8-1.2,0-2.4-.2-3.3-.8-1.1-.7-1.7-1.7-1.8-3,0-1.2.4-2.3,1.3-3.1.9-.8,2.1-1.2,3.6-1.3,1.1,0,2.1,0,3,.1-.1-.7-.4-1.3-.7-1.8-.5-.6-1.3-.9-2.4-.9h0c-.8,0-2,.2-2.7,1.3l-1.8-1.2c1-1.5,2.6-2.3,4.5-2.3h0c3.2,0,5.1,2,5.3,5.4.1,0,.2,0,.3.1,1.5.7,2.6,1.8,3.2,3.1.8,1.8.9,4.8-1.5,7.2-1.9,1.8-4.1,2.6-7.3,2.6h0ZM13.2,12.3h-.7c-1.8.1-3,.9-2.9,2.1,0,1.3,1.5,1.8,2.8,1.8s2.8-.5,3.1-3.7c-.7-.1-1.4-.2-2.2-.2h-.1Z"/>
|
107
|
+
</svg>
|
108
|
+
<% elsif link[:icon] == 'twitter' %>
|
109
|
+
<svg viewBox="0 0 1200 1227" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
110
|
+
<path fill="currentColor" d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
|
107
111
|
</svg>
|
108
112
|
<% elsif link[:icon] == 'whatsapp' %>
|
109
113
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
110
114
|
<path fill="currentColor" d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/>
|
111
115
|
</svg>
|
116
|
+
<% elsif link[:icon] == 'youtube' %>
|
117
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
118
|
+
<path fill="currentColor" d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/>
|
119
|
+
</svg>
|
112
120
|
<% else %>
|
113
121
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 73.84 73.84" aria-hidden="true" focusable="false" width="0" height="0" class="gem-c-share-links__svg">
|
114
122
|
<path fill="currentColor" d="M36.92,0A36.92,36.92,0,1,0,73.84,36.92,36.92,36.92,0,0,0,36.92,0ZM56.3,48.27a1.42,1.42,0,0,1-1.42,1.42h-19v9.18l-9.18-9.18H19a1.43,1.43,0,0,1-1.43-1.43V20.52A1.43,1.43,0,0,1,19,19.09H54.88a1.43,1.43,0,0,1,1.42,1.42Z"/>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%
|
2
|
+
add_gem_component_stylesheet("tag")
|
3
|
+
|
4
|
+
text ||= nil
|
5
|
+
if text.blank?
|
6
|
+
raise ArgumentError, "The tag component requires text"
|
7
|
+
end
|
8
|
+
text = text.capitalize
|
9
|
+
|
10
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
11
|
+
component_helper.add_class('govuk-tag gem-c-tag')
|
12
|
+
|
13
|
+
colours = %w[grey green turquoise blue light-blue purple pink red orange yellow]
|
14
|
+
colour ||= nil
|
15
|
+
component_helper.add_class("govuk-tag--#{colour}") if colours.include?(colour)
|
16
|
+
%>
|
17
|
+
|
18
|
+
<%= tag.strong(**component_helper.all_attributes) do %>
|
19
|
+
<%= text %>
|
20
|
+
<% end %>
|
@@ -13,11 +13,6 @@ examples:
|
|
13
13
|
text: Look at this margin
|
14
14
|
href: "/page"
|
15
15
|
margin_bottom: 9
|
16
|
-
with_no_wrapping_text:
|
17
|
-
data:
|
18
|
-
text: "Coronavirus (COVID-19):"
|
19
|
-
nowrap_text: what you need to do
|
20
|
-
href: "/page"
|
21
16
|
inverse:
|
22
17
|
data:
|
23
18
|
text: "Coronavirus (COVID-19)"
|
@@ -25,65 +20,8 @@ examples:
|
|
25
20
|
inverse: true
|
26
21
|
context:
|
27
22
|
dark_background: true
|
28
|
-
with_subtext:
|
29
|
-
data:
|
30
|
-
text: Emergency something
|
31
|
-
href: "/page"
|
32
|
-
subtext: This is about the emergency
|
33
|
-
with_subtext_on_a_dark_background:
|
34
|
-
data:
|
35
|
-
text: Emergency something
|
36
|
-
href: "/page"
|
37
|
-
subtext: This is about the emergency that is happening right now unfortunately so pay attention
|
38
|
-
inverse: true
|
39
|
-
context:
|
40
|
-
dark_background: true
|
41
|
-
mobile_subtext:
|
42
|
-
description: Lock the subtext beneath the main text, so the component with subtext always appears as it does on mobile.
|
43
|
-
data:
|
44
|
-
text: Try not to panic now
|
45
|
-
href: "/page"
|
46
|
-
subtext: "The thing that is happening is pretty scary but we'll get through it"
|
47
|
-
mobile_subtext: true
|
48
|
-
with_link_on_subtext:
|
49
|
-
description: The subtext can also be a link if required. The link on the main text is optional.
|
50
|
-
data:
|
51
|
-
text: Remain calm
|
52
|
-
subtext: Better things are ahead
|
53
|
-
subtext_href: "/page"
|
54
|
-
with_link_on_subtext_on_a_dark_background:
|
55
|
-
data:
|
56
|
-
text: Remain calm
|
57
|
-
subtext: Better things are ahead
|
58
|
-
subtext_href: "/page"
|
59
|
-
inverse: true
|
60
|
-
context:
|
61
|
-
dark_background: true
|
62
23
|
simple_arrow:
|
63
24
|
data:
|
64
25
|
text: Getting financial help and keeping your business safe
|
65
26
|
href: "/financial-help"
|
66
27
|
simple: true
|
67
|
-
simple_light_arrow:
|
68
|
-
data:
|
69
|
-
text: Getting financial help and keeping your business safe
|
70
|
-
href: "/financial-help"
|
71
|
-
inverse: true
|
72
|
-
simple_light: true
|
73
|
-
context:
|
74
|
-
dark_background: true
|
75
|
-
with_dark_icon:
|
76
|
-
data:
|
77
|
-
text: Coronavirus (COVID-19)
|
78
|
-
href: "/my-test-page"
|
79
|
-
dark_icon: true
|
80
|
-
with_dark_large_icon:
|
81
|
-
data:
|
82
|
-
text: Coronavirus (COVID-19)
|
83
|
-
href: "/my-test-page"
|
84
|
-
dark_large_icon: true
|
85
|
-
with_light_icon:
|
86
|
-
data:
|
87
|
-
text: Coronavirus (COVID-19)
|
88
|
-
href: "/my-test-page"
|
89
|
-
light_icon: true
|
@@ -42,6 +42,19 @@ examples:
|
|
42
42
|
- text: Hidden on desktop
|
43
43
|
href: "item-3"
|
44
44
|
show_only_in_collapsed_menu: true
|
45
|
+
with_product_name_and_navigation:
|
46
|
+
data:
|
47
|
+
product_name: Component Guide 999.9.9
|
48
|
+
environment: production
|
49
|
+
navigation_items:
|
50
|
+
- text: Navigation item 1
|
51
|
+
href: "item-1"
|
52
|
+
active: true
|
53
|
+
- text: Navigation item 2
|
54
|
+
href: "item-2"
|
55
|
+
- text: Hidden on desktop
|
56
|
+
href: "item-3"
|
57
|
+
show_only_in_collapsed_menu: true
|
45
58
|
with_navigation_link_data_attributes:
|
46
59
|
description: Supports adding data attributes i.e for tracking
|
47
60
|
data:
|
@@ -174,3 +174,14 @@ examples:
|
|
174
174
|
value: option1
|
175
175
|
- text: Option two
|
176
176
|
value: option2
|
177
|
+
with_multiple:
|
178
|
+
data:
|
179
|
+
id: dropdown-multiple-id
|
180
|
+
id: dropdown-multiple
|
181
|
+
label: My Dropdown
|
182
|
+
multiple: true
|
183
|
+
options:
|
184
|
+
- text: Option one
|
185
|
+
value: option1
|
186
|
+
- text: Option two
|
187
|
+
value: option2
|
@@ -0,0 +1,196 @@
|
|
1
|
+
name: Select with search (experimental)
|
2
|
+
description: A dropdown select with search
|
3
|
+
body: |
|
4
|
+
A Javascript enhanced dropdown select. This component is progressively enhanced, if
|
5
|
+
Javascript is unavailable then it will use the select component.
|
6
|
+
|
7
|
+
This is an experimental component as it currently fails WCAG compliance for keyboard navigation. The total number of options are not
|
8
|
+
announced when using Voice Over.
|
9
|
+
accessibility_criteria: |
|
10
|
+
- accept focus
|
11
|
+
- be focusable with a keyboard
|
12
|
+
- be usable with a keyboard
|
13
|
+
- indicate when it has focus
|
14
|
+
examples:
|
15
|
+
default:
|
16
|
+
data:
|
17
|
+
id: dropdown-default
|
18
|
+
label: My Dropdown
|
19
|
+
options:
|
20
|
+
- text: Option one
|
21
|
+
value: option1
|
22
|
+
- text: Option two
|
23
|
+
value: option2
|
24
|
+
- text: Option three
|
25
|
+
value: option3
|
26
|
+
with_blank_option:
|
27
|
+
description: Include a blank option
|
28
|
+
data:
|
29
|
+
id: dropdown-with-blank
|
30
|
+
label: With blank option
|
31
|
+
include_blank: true
|
32
|
+
options:
|
33
|
+
- text: Option one
|
34
|
+
value: option1
|
35
|
+
- text: Option two
|
36
|
+
value: option2
|
37
|
+
- text: Option three
|
38
|
+
value: option3
|
39
|
+
with_grouped_options:
|
40
|
+
description: Options can be grouped
|
41
|
+
data:
|
42
|
+
id: dropdown-with-grouped-options
|
43
|
+
label: Select a city
|
44
|
+
grouped_options:
|
45
|
+
- - England
|
46
|
+
- - text: Bath
|
47
|
+
value: bath
|
48
|
+
- text: Bristol
|
49
|
+
value: bristol
|
50
|
+
- text: London
|
51
|
+
value: london
|
52
|
+
- text: Manchester
|
53
|
+
value: manchester
|
54
|
+
- - Northern Ireland
|
55
|
+
- - text: Bangor
|
56
|
+
value: bangor
|
57
|
+
- text: Belfast
|
58
|
+
value: belfast
|
59
|
+
- - Scotland
|
60
|
+
- - text: Dundee
|
61
|
+
value: dundee
|
62
|
+
- text: Edinburgh
|
63
|
+
value: edinburgh
|
64
|
+
- text: Glasgow
|
65
|
+
value: glasgow
|
66
|
+
- - Wales
|
67
|
+
- - text: Cardiff
|
68
|
+
value: cardiff
|
69
|
+
- text: Swansea
|
70
|
+
value: swansea
|
71
|
+
with_grouped_options_and_blank_option:
|
72
|
+
description: Options can be grouped and include a blank option
|
73
|
+
data:
|
74
|
+
id: dropdown-with-grouped-options-and-blank
|
75
|
+
label: Select a city
|
76
|
+
include_blank: true
|
77
|
+
grouped_options:
|
78
|
+
- - England
|
79
|
+
- - text: Bath
|
80
|
+
value: bath
|
81
|
+
- text: Bristol
|
82
|
+
value: bristol
|
83
|
+
- text: London
|
84
|
+
value: london
|
85
|
+
- text: Manchester
|
86
|
+
value: manchester
|
87
|
+
- - Northern Ireland
|
88
|
+
- - text: Bangor
|
89
|
+
value: bangor
|
90
|
+
- text: Belfast
|
91
|
+
value: belfast
|
92
|
+
- - Scotland
|
93
|
+
- - text: Dundee
|
94
|
+
value: dundee
|
95
|
+
- text: Edinburgh
|
96
|
+
value: edinburgh
|
97
|
+
- text: Glasgow
|
98
|
+
value: glasgow
|
99
|
+
- - Wales
|
100
|
+
- - text: Cardiff
|
101
|
+
value: cardiff
|
102
|
+
- text: Swansea
|
103
|
+
value: swansea
|
104
|
+
with_different_id_and_name:
|
105
|
+
description: If no name is provided, name defaults to the (required) value of id.
|
106
|
+
data:
|
107
|
+
id: dropdown-with-different-id-and-name
|
108
|
+
label: My Dropdown
|
109
|
+
name: dropdown[1]
|
110
|
+
options:
|
111
|
+
- text: Option one
|
112
|
+
value: option1
|
113
|
+
- text: Option two
|
114
|
+
value: option2
|
115
|
+
with_data_attributes:
|
116
|
+
data:
|
117
|
+
id: dropdown-with-data-attributes
|
118
|
+
data_attributes:
|
119
|
+
module: not-a-module
|
120
|
+
loose: moose
|
121
|
+
label: Select your country
|
122
|
+
options:
|
123
|
+
- text: France
|
124
|
+
value: fr
|
125
|
+
- text: Germany
|
126
|
+
value: de
|
127
|
+
- text: United Kingdom
|
128
|
+
value: uk
|
129
|
+
with_preselect:
|
130
|
+
data:
|
131
|
+
id: dropdown-with-preselect
|
132
|
+
label: Option 2 preselected
|
133
|
+
options:
|
134
|
+
- text: Option one
|
135
|
+
value: option1
|
136
|
+
- text: Option two
|
137
|
+
value: option2
|
138
|
+
selected: true
|
139
|
+
- text: Option three
|
140
|
+
value: option3
|
141
|
+
with_hint:
|
142
|
+
description: When a hint is included the `aria-describedby` attribute of the select is included to point to the hint. When an error and a hint are present, that attribute includes the IDs of both the hint and the error.
|
143
|
+
data:
|
144
|
+
id: dropdown-with-hint
|
145
|
+
label: Choose your preferred thing
|
146
|
+
hint: You might need some more information here
|
147
|
+
hint_id: optional-hint-id
|
148
|
+
options:
|
149
|
+
- text: Something
|
150
|
+
value: option1
|
151
|
+
- text: Something else
|
152
|
+
value: option2
|
153
|
+
with_error:
|
154
|
+
description: An arbitrary number of separate error items can be passed to the component.
|
155
|
+
data:
|
156
|
+
id: dropdown-with-error
|
157
|
+
label: How will you be travelling to the conference?
|
158
|
+
error_items:
|
159
|
+
- text: Please choose an option
|
160
|
+
include_blank: true
|
161
|
+
options:
|
162
|
+
- text: Public transport
|
163
|
+
value: option1
|
164
|
+
- text: Will make own arrangements
|
165
|
+
value: option2
|
166
|
+
with_custom_label_size:
|
167
|
+
description: Make the label different sizes. Valid options are `s`, `m`, `l` and `xl`.
|
168
|
+
data:
|
169
|
+
id: dropdown-with-custom-label-size
|
170
|
+
label: Bigger!
|
171
|
+
heading_size: xl
|
172
|
+
options:
|
173
|
+
- text: Option one
|
174
|
+
value: option1
|
175
|
+
- text: Option two
|
176
|
+
value: option2
|
177
|
+
- text: Option three
|
178
|
+
value: option3
|
179
|
+
with_multiple_select_enabled:
|
180
|
+
description: Allow multiple items to be selected and de-selected.
|
181
|
+
data:
|
182
|
+
id: dropdown-with-multiple
|
183
|
+
label: Select your country
|
184
|
+
include_blank: true
|
185
|
+
multiple: true
|
186
|
+
options:
|
187
|
+
- text: France
|
188
|
+
value: fr
|
189
|
+
selected: false
|
190
|
+
- text: Germany
|
191
|
+
value: de
|
192
|
+
selected: false
|
193
|
+
- text: The United Kingdom of Great Britain and Northern Ireland
|
194
|
+
value: uk
|
195
|
+
- text: Democratic Republic of the Congo
|
196
|
+
value: cg
|
@@ -251,6 +251,16 @@ examples:
|
|
251
251
|
text: 'Linkedin',
|
252
252
|
icon: 'linkedin'
|
253
253
|
},
|
254
|
+
{
|
255
|
+
href: '/threads-share-link',
|
256
|
+
text: 'Threads',
|
257
|
+
icon: 'threads'
|
258
|
+
},
|
259
|
+
{
|
260
|
+
href: '/bluesky-share-link',
|
261
|
+
text: 'Bluesky',
|
262
|
+
icon: 'bluesky'
|
263
|
+
},
|
254
264
|
{
|
255
265
|
href: '/whatsapp-share-link',
|
256
266
|
text: 'WhatsApp',
|
@@ -24,13 +24,6 @@ examples:
|
|
24
24
|
data:
|
25
25
|
link_text: 'Click right here to sign up!!'
|
26
26
|
link_href: '/this-signs-you-up'
|
27
|
-
with_custom_margin_bottom:
|
28
|
-
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom.
|
29
|
-
data:
|
30
|
-
heading: 'Sign up for email notifications'
|
31
|
-
link_text: 'Click right here to sign up!!'
|
32
|
-
link_href: '/this-signs-you-up'
|
33
|
-
margin_bottom: 8
|
34
27
|
with_custom_heading_level:
|
35
28
|
description: Override default heading level by passing through `heading_level` parameter (defaults to `h3`).
|
36
29
|
data:
|
data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml
CHANGED
@@ -9,7 +9,7 @@ body: |
|
|
9
9
|
When the button is clicked, the `base_path` is submitted to an endpoint which proceeds to check the user's authentication status and whether they are already subscribed to the page or not. Depending on these factors, they will be routed accordingly.
|
10
10
|
accessibility_criteria: |
|
11
11
|
- The bell icon must be presentational and ignored by screen readers.
|
12
|
-
uses_component_wrapper_helper: true
|
12
|
+
uses_component_wrapper_helper: true
|
13
13
|
examples:
|
14
14
|
default:
|
15
15
|
description: By default this component prompts the user to subscribe to email notifications to this page.
|
@@ -33,12 +33,6 @@ examples:
|
|
33
33
|
index_link: 1
|
34
34
|
index_total: 1
|
35
35
|
section: "Top"
|
36
|
-
with_margin_bottom:
|
37
|
-
description: |
|
38
|
-
The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of 15px.
|
39
|
-
data:
|
40
|
-
base_path: '/current-page-path'
|
41
|
-
margin_bottom: 5
|
42
36
|
with_js_enhancement:
|
43
37
|
description: |
|
44
38
|
If the `js-enhancement` flag is present, the component uses JavaScript to check if the user has already subscribed to email notifications on the current page and accordingly updates its tracking attribute and (optionally) button text.
|
@@ -20,12 +20,6 @@ examples:
|
|
20
20
|
data:
|
21
21
|
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
22
22
|
feed_link: '/foreign-travel-advice/singapore.atom'
|
23
|
-
with_margin:
|
24
|
-
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom, although some margin is supplied by the links themselves (so that when they stack on mobile there is space between them).
|
25
|
-
data:
|
26
|
-
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
27
|
-
feed_link: '/foreign-travel-advice/singapore.atom'
|
28
|
-
margin_bottom: 9
|
29
23
|
with_only_email_signup_link:
|
30
24
|
data:
|
31
25
|
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
@@ -70,7 +64,7 @@ examples:
|
|
70
64
|
small_form: true
|
71
65
|
without_heading:
|
72
66
|
description: |
|
73
|
-
By default the component includes
|
67
|
+
By default the component includes a visually hidden h2 heading. This option removes it, because the component could be used anywhere on the page and could otherwise break the heading structure.
|
74
68
|
data:
|
75
69
|
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
76
70
|
feed_link: '/foreign-travel-advice/singapore.atom'
|
@@ -0,0 +1,57 @@
|
|
1
|
+
name: Tag
|
2
|
+
description: Use the tag component to show users the status of something. For example, the server environment the page is being rendered from.
|
3
|
+
accessibility_criteria: |
|
4
|
+
- should have a text colour contrast ratio of more than 4.5:1 with its background to be visually distinct
|
5
|
+
- does not use colour alone to convey information
|
6
|
+
- should not be used within a link, as a button, or for interactivity
|
7
|
+
uses_component_wrapper_helper: true
|
8
|
+
govuk_frontend_components:
|
9
|
+
- tag
|
10
|
+
examples:
|
11
|
+
default:
|
12
|
+
data:
|
13
|
+
text: Hello world!
|
14
|
+
sentence_case_conversion:
|
15
|
+
description: The component automatically converts text to sentence case as shown.
|
16
|
+
data:
|
17
|
+
text: HELLO WORLD!
|
18
|
+
grey:
|
19
|
+
data:
|
20
|
+
text: Hello world!
|
21
|
+
colour: grey
|
22
|
+
green:
|
23
|
+
data:
|
24
|
+
text: Hello world!
|
25
|
+
colour: green
|
26
|
+
turquoise:
|
27
|
+
data:
|
28
|
+
text: Hello world!
|
29
|
+
colour: turquoise
|
30
|
+
blue:
|
31
|
+
data:
|
32
|
+
text: Hello world!
|
33
|
+
colour: blue
|
34
|
+
light_blue:
|
35
|
+
data:
|
36
|
+
text: Hello world!
|
37
|
+
colour: light-blue
|
38
|
+
purple:
|
39
|
+
data:
|
40
|
+
text: Hello world!
|
41
|
+
colour: purple
|
42
|
+
pink:
|
43
|
+
data:
|
44
|
+
text: Hello world!
|
45
|
+
colour: pink
|
46
|
+
red:
|
47
|
+
data:
|
48
|
+
text: Hello world!
|
49
|
+
colour: red
|
50
|
+
orange:
|
51
|
+
data:
|
52
|
+
text: Hello world!
|
53
|
+
colour: orange
|
54
|
+
yellow:
|
55
|
+
data:
|
56
|
+
text: Hello world!
|
57
|
+
colour: yellow
|
@@ -1,3 +1,19 @@
|
|
1
|
+
<%
|
2
|
+
colour_map = {
|
3
|
+
"production" => "red",
|
4
|
+
"staging" => "yellow",
|
5
|
+
"integration" => "yellow",
|
6
|
+
"example" => "purple",
|
7
|
+
"development" => "grey",
|
8
|
+
}
|
9
|
+
|
10
|
+
environment_exists = !environment.blank?
|
11
|
+
%>
|
12
|
+
<% if environment_exists %>
|
13
|
+
<div class="gem-c-header__environment">
|
14
|
+
<%= render "govuk_publishing_components/components/tag", { text: environment, colour: colour_map[environment.downcase] } %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
1
17
|
<div class="govuk-header__logo gem-c-header__logo">
|
2
18
|
<a href="<%= logo_link %>" class="govuk-header__link govuk-header__link--homepage">
|
3
19
|
<%= render "govuk_publishing_components/components/govuk_logo/govuk_logo" %>
|
@@ -6,10 +22,5 @@
|
|
6
22
|
<%= product_name %>
|
7
23
|
</span>
|
8
24
|
<% end %>
|
9
|
-
<% if environment %>
|
10
|
-
<span class="gem-c-environment-tag govuk-tag gem-c-environment-tag--<%= environment %>">
|
11
|
-
<%= environment.titleize %>
|
12
|
-
</span>
|
13
|
-
<% end %>
|
14
25
|
</a>
|
15
26
|
</div>
|
@@ -17,7 +17,6 @@ module GovukPublishingComponents
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def heading_size(option)
|
20
|
-
gem_class = "gem-c-heading--font-size-"
|
21
20
|
govuk_class = "govuk-heading-"
|
22
21
|
|
23
22
|
case option
|
@@ -30,7 +29,7 @@ module GovukPublishingComponents
|
|
30
29
|
when 19, "s"
|
31
30
|
"#{govuk_class}s"
|
32
31
|
else
|
33
|
-
"#{
|
32
|
+
"#{govuk_class}m"
|
34
33
|
end
|
35
34
|
end
|
36
35
|
end
|