govuk_publishing_components 21.46.0 → 21.47.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d54671ad8f273c7964008613ed64cb631808376ac9a1dbb9b810649dbb13909
4
- data.tar.gz: a5497f0e68627da627a50ea02d4fad88af8e6f58f79d7482b1c5f12d45d3fbb7
3
+ metadata.gz: a88b34716fb241b208992a85a5554ad8b041729523c3a10c7274818b00d0c936
4
+ data.tar.gz: 7a0d928fdd91e5bec26a068e81086a9e5667076dfd554b458cae25cb3266b97d
5
5
  SHA512:
6
- metadata.gz: c4a9b2848c97f714246a21736f7bd0aa2febec61777da0b8319cf77d354db2048e1b4dd552698e30d61edc7d613cd6db8582b014936da86ce339e45cde8a61bb
7
- data.tar.gz: 9ce6d6e08b93012137c37b489f16d45ffd784739df06ab7e65d50979417499a7dee7f7ea1af551bb8418e28e371cb27f17de8504085a12a173c60d5b14239359
6
+ metadata.gz: 8b66ecac6dc60e0f92c6518c49beb6e52ea3fc242ee59122c746a392547aab37fd26ff0cc83b2fbeea78fb4f0ef540f413d04a92f91493117c7b6f48326dd150
7
+ data.tar.gz: 935b0628237148bab2337d69336a48617014dd9e164e2678cf70003005b29899c7c535b15b2171704c7f3b3375018b97ccfc487c56dba9f582157407d718a8a5
@@ -0,0 +1,5 @@
1
+ <svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="11.5" cy="11.5" r="11.5" fill="#272828"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.9429 11.7949L10.4402 7.29222L11.7327 5.99967L17.528 11.7949L11.7327 17.5902L10.4402 16.2976L14.9429 11.7949Z" fill="#fff500"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.95631 10.881L15.4414 10.881L15.4414 12.709L3.95631 12.709L3.95631 10.881Z" fill="#fff500"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.9429 11.7949L10.4402 7.29222L11.7327 5.99967L17.528 11.7949L11.7327 17.5902L10.4402 16.2976L14.9429 11.7949Z" fill="#272828"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.95631 10.881L15.4414 10.881L15.4414 12.709L3.95631 12.709L3.95631 10.881Z" fill="#272828"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="19.5" cy="19.5" r="19.5" fill="#fff500"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M24.0343 20L14.1812 10.1469L17.0096 7.31848L29.6912 20L17.0096 32.6815L14.1812 29.8531L24.0343 20Z" fill="#272828"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0.000423781 18L25.1328 18L25.1328 22L0.000423431 22L0.000423781 18Z" fill="#272828"/>
5
+ </svg>
@@ -18,6 +18,7 @@
18
18
 
19
19
  // components
20
20
  @import "components/accordion";
21
+ @import "components/action-link";
21
22
  @import "components/attachment";
22
23
  @import "components/attachment-link";
23
24
  @import "components/back-link";
@@ -0,0 +1,146 @@
1
+ .gem-c-action-link {
2
+ display: table;
3
+
4
+ &:before {
5
+ content: "";
6
+ display: table-cell;
7
+ width: 50px;
8
+ height: 45px;
9
+ // sass-lint:disable no-duplicate-properties
10
+ background-image: image-url("govuk_publishing_components/action-link-arrow.png");
11
+ background-image: image-url("govuk_publishing_components/action-link-arrow.svg");
12
+ // sass-lint:enable no-duplicate-properties
13
+ background-repeat: no-repeat;
14
+ background-position: 0 50%;
15
+ background-size: 37px auto;
16
+ }
17
+
18
+ @include govuk-media-query($until: tablet) {
19
+ max-width: 410px;
20
+ }
21
+ }
22
+
23
+ .gem-c-action-link__link-wrapper {
24
+ @include govuk-font(19, $weight: bold, $line-height: 1.3);
25
+ display: table-cell;
26
+ vertical-align: middle;
27
+ }
28
+
29
+ .gem-c-action-link__link {
30
+ color: inherit;
31
+
32
+ &:hover {
33
+ text-decoration: underline;
34
+ }
35
+
36
+ &:focus,
37
+ &:active {
38
+ text-decoration: none;
39
+ color: govuk-colour("black");
40
+ }
41
+ }
42
+
43
+ .gem-c-action-link__nowrap-text {
44
+ white-space: nowrap;
45
+ }
46
+
47
+ .gem-c-action-link--with-subtext {
48
+ max-width: none;
49
+
50
+ .gem-c-action-link__link-wrapper,
51
+ .gem-c-action-link__subtext-wrapper {
52
+ display: block;
53
+
54
+ @include govuk-media-query($from: tablet) {
55
+ display: table-cell;
56
+ vertical-align: middle;
57
+ }
58
+ }
59
+ }
60
+
61
+ .gem-c-action-link__subtext {
62
+ @include govuk-font(19);
63
+ display: block;
64
+ font-weight: normal;
65
+ color: inherit;
66
+
67
+ @include govuk-media-query($from: tablet) {
68
+ position: relative;
69
+ padding-left: govuk-spacing(4);
70
+
71
+ &:before {
72
+ content: "";
73
+ position: absolute;
74
+ top: 0;
75
+ left: govuk-spacing(2);
76
+ width: govuk-spacing(2);
77
+ height: 100%;
78
+ border-left: solid 1px $govuk-text-colour;
79
+ }
80
+ }
81
+ }
82
+
83
+ .gem-c-action-link--simple {
84
+ &:before {
85
+ width: 30px;
86
+ height: 30px;
87
+ // sass-lint:disable no-duplicate-properties
88
+ background-image: image-url("govuk_publishing_components/action-link-arrow--simple.png");
89
+ background-image: image-url("govuk_publishing_components/action-link-arrow--simple.svg");
90
+ // sass-lint:enable no-duplicate-properties
91
+ background-size: 25px auto;
92
+ background-position: 0 0;
93
+ }
94
+
95
+ .gem-c-action-link__link {
96
+ text-decoration: none;
97
+ }
98
+ }
99
+
100
+ .gem-c-action-link--dark-icon {
101
+ max-width: none;
102
+
103
+ @include govuk-media-query($until: tablet) {
104
+ margin-bottom: govuk-spacing(2);
105
+ }
106
+
107
+ &:before {
108
+ width: 30px;
109
+ height: 30px;
110
+ // sass-lint:disable no-duplicate-properties
111
+ background-image: image-url("govuk_publishing_components/action-link-arrow--dark.png");
112
+ background-image: image-url("govuk_publishing_components/action-link-arrow--dark.svg");
113
+ // sass-lint:enable no-duplicate-properties
114
+ background-size: 25px auto;
115
+ background-position: 0 0;
116
+ }
117
+
118
+ .gem-c-action-link__link {
119
+ text-decoration: none;
120
+ }
121
+ }
122
+
123
+ .gem-c-action-link--light-text {
124
+ color: govuk-colour("white");
125
+
126
+ .gem-c-action-link__link {
127
+ text-decoration: underline;
128
+
129
+ &:link,
130
+ &:visited {
131
+ color: govuk-colour("white");
132
+ }
133
+
134
+ &:focus,
135
+ &:active {
136
+ text-decoration: none;
137
+ color: govuk-colour("black");
138
+ }
139
+ }
140
+
141
+ .gem-c-action-link__subtext {
142
+ &:before {
143
+ border-color: govuk-colour("white");
144
+ }
145
+ }
146
+ }
@@ -0,0 +1,34 @@
1
+ <%
2
+ local_assigns[:margin_bottom] ||= 0
3
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
4
+
5
+ text ||= false
6
+ nowrap_text ||= false
7
+ href ||= false
8
+ subtext ||= false
9
+ light_text ||= false
10
+ simple ||= false
11
+ dark_icon ||= false
12
+ data ||= nil
13
+ css_classes = %w(gem-c-action-link)
14
+ css_classes << "gem-c-action-link--light-text" if light_text
15
+ css_classes << "gem-c-action-link--dark-icon" if dark_icon
16
+ css_classes << "gem-c-action-link--simple" if simple
17
+ css_classes << "gem-c-action-link--with-subtext" if subtext
18
+ css_classes << (shared_helper.get_margin_bottom)
19
+ %>
20
+ <% if href.present? && text.present? %>
21
+ <div class="<%= css_classes.join(' ') %>">
22
+ <span class="gem-c-action-link__link-wrapper">
23
+ <%= link_to href, :class => "govuk-link gem-c-action-link__link", :data => data do %>
24
+ <%= text %>
25
+ <%= content_tag(:span, nowrap_text, class: "gem-c-action-link__nowrap-text") if nowrap_text %>
26
+ <% end %>
27
+ </span>
28
+ <% if subtext %>
29
+ <span class="gem-c-action-link__subtext-wrapper">
30
+ <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") %>
31
+ </span>
32
+ <% end %>
33
+ </div>
34
+ <% end %>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ id ||= nil
2
3
  id_prefix ||= "radio-#{SecureRandom.hex(4)}"
3
4
  items ||= []
4
5
 
@@ -34,7 +35,7 @@
34
35
  # check if any item is set as being conditional
35
36
  has_conditional = items.any? { |item| item.is_a?(Hash) && item[:conditional] }
36
37
  %>
37
- <%= content_tag :div, class: form_group_css_classes do %>
38
+ <%= tag.div id: id, class: form_group_css_classes do %>
38
39
  <%= tag.fieldset class: "govuk-fieldset", "aria-describedby": aria do %>
39
40
 
40
41
  <% if heading.present? %>
@@ -0,0 +1,55 @@
1
+ name: Action link
2
+ description: Use action links to help users get to the next stage of a journey quickly.
3
+ shared_accessibility_criteria:
4
+ - link
5
+ examples:
6
+ default:
7
+ data:
8
+ text: Go to NHS 111 online
9
+ href: '/my-test-page'
10
+ with_bottom_margin:
11
+ data:
12
+ text: Look at this margin
13
+ href: '/my-test-page'
14
+ margin_bottom: 9
15
+ with_data_attributes:
16
+ data:
17
+ text: "Coronavirus (COVID-19)"
18
+ href: '/my-test-page'
19
+ data:
20
+ attr_test: "hasDataAttribute"
21
+ with_no_wrapping_text:
22
+ data:
23
+ text: "Coronavirus (COVID-19):"
24
+ nowrap_text: what you need to do
25
+ href: '/my-test-page'
26
+ with_light_text:
27
+ data:
28
+ text: "Coronavirus (COVID-19)"
29
+ href: '/my-test-page'
30
+ light_text: true
31
+ context:
32
+ dark_background: true
33
+ with_subtext:
34
+ data:
35
+ text: "Emergency something"
36
+ href: '/page'
37
+ subtext: "This is about the emergency"
38
+ with_subtext_on_a_dark_background:
39
+ data:
40
+ text: "Emergency something"
41
+ href: '/page'
42
+ subtext: "This is about the emergency that is happening right now unfortunately so pay attention"
43
+ light_text: true
44
+ context:
45
+ dark_background: true
46
+ simple_arrow:
47
+ data:
48
+ text: "Getting financial help and keeping your business safe"
49
+ href: "/financial-help"
50
+ simple: true
51
+ with_dark_icon:
52
+ data:
53
+ text: "Coronavirus (COVID-19)"
54
+ href: '/my-test-page'
55
+ dark_icon: true
@@ -346,3 +346,12 @@ examples:
346
346
  text: "On"
347
347
  - value: "off"
348
348
  text: "Off"
349
+ with_custom_id_attribute:
350
+ data:
351
+ name: "radio-group"
352
+ id: "radio-group"
353
+ items:
354
+ - value: "government-gateway"
355
+ text: "Use Government Gateway"
356
+ - value: "govuk-verify"
357
+ text: "Use GOV.UK Verify"
@@ -26,7 +26,7 @@ module GovukPublishingComponents
26
26
  private
27
27
 
28
28
  def create_directory_if_not_exists(dir)
29
- if !File.directory?(dir)
29
+ unless File.directory?(dir)
30
30
  puts("Directory #{dir} not found, creating")
31
31
  FileUtils.mkdir_p dir
32
32
  end
@@ -3,10 +3,25 @@ require "action_view"
3
3
  module GovukPublishingComponents
4
4
  module Presenters
5
5
  class ButtonHelper
6
- attr_reader :href, :text, :title, :info_text, :info_text_classes,
7
- :rel, :data_attributes, :margin_bottom, :inline_layout,
8
- :target, :type, :start, :secondary, :secondary_quiet,
9
- :destructive, :name, :value, :classes, :aria_label
6
+ attr_reader :href,
7
+ :text,
8
+ :title,
9
+ :info_text,
10
+ :info_text_classes,
11
+ :rel,
12
+ :data_attributes,
13
+ :margin_bottom,
14
+ :inline_layout,
15
+ :target,
16
+ :type,
17
+ :start,
18
+ :secondary,
19
+ :secondary_quiet,
20
+ :destructive,
21
+ :name,
22
+ :value,
23
+ :classes,
24
+ :aria_label
10
25
 
11
26
  def initialize(local_assigns)
12
27
  @href = local_assigns[:href]
@@ -4,8 +4,18 @@ module GovukPublishingComponents
4
4
  include ActionView::Helpers
5
5
  include ActionView::Context
6
6
 
7
- attr_reader :items, :name, :css_classes, :list_classes, :error, :has_conditional,
8
- :has_nested, :id, :hint_text, :description, :heading_size, :heading_caption,
7
+ attr_reader :items,
8
+ :name,
9
+ :css_classes,
10
+ :list_classes,
11
+ :error,
12
+ :has_conditional,
13
+ :has_nested,
14
+ :id,
15
+ :hint_text,
16
+ :description,
17
+ :heading_size,
18
+ :heading_caption,
9
19
  :has_exclusive
10
20
 
11
21
  def initialize(options)
@@ -55,11 +55,13 @@ module GovukPublishingComponents
55
55
 
56
56
  def construct_section_heading(section_title)
57
57
  unless section_title == "related_items"
58
- I18n.t("components.related_#{@context}_navigation." + section_title,
59
- default: [
60
- I18n.t("components.related_navigation." + section_title),
61
- section_title.tr("_", " "),
62
- ])
58
+ I18n.t(
59
+ "components.related_#{@context}_navigation." + section_title,
60
+ default: [
61
+ I18n.t("components.related_navigation." + section_title),
62
+ section_title.tr("_", " "),
63
+ ],
64
+ )
63
65
  end
64
66
  end
65
67
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "21.46.0".freeze
2
+ VERSION = "21.47.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 21.46.0
4
+ version: 21.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-14 00:00:00.000000000 Z
11
+ date: 2020-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters
@@ -329,6 +329,12 @@ files:
329
329
  - README.md
330
330
  - Rakefile
331
331
  - app/assets/config/govuk_publishing_components_manifest.js
332
+ - app/assets/images/govuk_publishing_components/action-link-arrow--dark.png
333
+ - app/assets/images/govuk_publishing_components/action-link-arrow--dark.svg
334
+ - app/assets/images/govuk_publishing_components/action-link-arrow--simple.png
335
+ - app/assets/images/govuk_publishing_components/action-link-arrow--simple.svg
336
+ - app/assets/images/govuk_publishing_components/action-link-arrow.png
337
+ - app/assets/images/govuk_publishing_components/action-link-arrow.svg
332
338
  - app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg
333
339
  - app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg
334
340
  - app/assets/images/govuk_publishing_components/crests/bis_crest_13px.png
@@ -434,6 +440,7 @@ files:
434
440
  - app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss
435
441
  - app/assets/stylesheets/govuk_publishing_components/component_support.scss
436
442
  - app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss
443
+ - app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss
437
444
  - app/assets/stylesheets/govuk_publishing_components/components/_attachment-link.scss
438
445
  - app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss
439
446
  - app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss
@@ -568,6 +575,7 @@ files:
568
575
  - app/views/govuk_publishing_components/component_guide/preview.html.erb
569
576
  - app/views/govuk_publishing_components/component_guide/show.html.erb
570
577
  - app/views/govuk_publishing_components/components/_accordion.html.erb
578
+ - app/views/govuk_publishing_components/components/_action_link.html.erb
571
579
  - app/views/govuk_publishing_components/components/_admin_analytics.html.erb
572
580
  - app/views/govuk_publishing_components/components/_attachment.html.erb
573
581
  - app/views/govuk_publishing_components/components/_attachment_link.html.erb
@@ -642,6 +650,7 @@ files:
642
650
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.svg
643
651
  - app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
644
652
  - app/views/govuk_publishing_components/components/docs/accordion.yml
653
+ - app/views/govuk_publishing_components/components/docs/action_link.yml
645
654
  - app/views/govuk_publishing_components/components/docs/admin_analytics.yml
646
655
  - app/views/govuk_publishing_components/components/docs/attachment.yml
647
656
  - app/views/govuk_publishing_components/components/docs/attachment_link.yml