govuk_publishing_components 17.15.0 → 17.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9efc12b3a7bac033538c37f639b3d445b7143048cef4cb79f023dcc0f2c73327
4
- data.tar.gz: 8764534227e500e355d10106fa48207ef289eccb96ecb685167b7f8d1bdc2649
3
+ metadata.gz: cdaa42c19f8a80868991b0c0e2e71a395157646a467ba370feed0c5de6f14fef
4
+ data.tar.gz: d298c0038c8681fc915002dc50302806571fe57902ef68e44d2c409692a3ba7d
5
5
  SHA512:
6
- metadata.gz: '06985cc2887f08e4689f82bf2611ca5a5697d80e81ca0bdbd4a39c7937806218a9d4d5a9837cb1f5a01f8bcf74989d9f49380cdc3f1a5f67fcac528bd7afb672'
7
- data.tar.gz: 5f1956bf05209b2f62a3df019606d6ed44515da8a2d5fd731882dd2297bb235e51e78881ea0d326bb5755c127003921136d07e4eb239633aa88d545d9cb28745
6
+ metadata.gz: b2790a4941d7b4b6d6b5e65162efe05770e33eb0a928fa3524cb7c08f1208f33b97bee095a0cf4bb25c0243728b64267a4b892b13904423e47487a3dd0ead52c
7
+ data.tar.gz: 63934ae81bd49e440358b247ad9d3c45ec4c6075db00e405a512212d4f78da5fd50f74afa66899eee85ef0c47e39df8dd026a0453b86e27f51064392bee51fbb
@@ -1,22 +1,23 @@
1
1
  .gem-c-image-card {
2
- // if this extends grid-row a margin-bottom can't
3
- // be applied as the extend overrides it
4
- @extend %contain-floats;
5
- margin: 0 (-$gutter-half) $gutter (-$gutter-half);
6
- position: relative;
2
+ @include govuk-clearfix;
7
3
  @include govuk-text-colour;
4
+
5
+ margin: 0 (- govuk-spacing(3)) govuk-spacing(6) (- govuk-spacing(3));
6
+ position: relative;
8
7
  }
9
8
 
10
9
  .gem-c-image-card__image-wrapper {
11
- @include grid-column(1 / 3, mobile);
10
+ @include govuk-grid-column(one-third, $class: false, $at: mobile);
11
+ @include govuk-grid-column(full, $class: false, $at: tablet);
12
+
12
13
  margin: 0;
13
14
 
14
- @include media(tablet) {
15
- margin-bottom: $gutter-one-third;
15
+ @include govuk-media-query($from: tablet) {
16
+ margin-bottom: govuk-spacing(2);
16
17
  }
17
18
 
18
19
  + .gem-c-image-card__text-wrapper {
19
- @include media(mobile) {
20
+ @include govuk-media-query($until: tablet) {
20
21
  padding-left: 0;
21
22
  }
22
23
  }
@@ -28,11 +29,12 @@
28
29
  }
29
30
 
30
31
  .gem-c-image-card__text-wrapper {
31
- @include grid-column(2 / 3, mobile);
32
+ @include govuk-grid-column(two-thirds, $class: false, $at: mobile);
33
+ @include govuk-grid-column(full, $class: false, $at: tablet);
32
34
  }
33
35
 
34
36
  .gem-c-image-card__title {
35
- @include bold-19;
37
+ @include govuk-font(19, $weight: bold);
36
38
  margin: 0;
37
39
  }
38
40
 
@@ -52,8 +54,8 @@
52
54
  position: absolute;
53
55
  z-index: 1;
54
56
  top: 0;
55
- left: $gutter-half;
56
- right: $gutter-half;
57
+ left: govuk-spacing(3);
58
+ right: govuk-spacing(3);
57
59
  height: 100%;
58
60
  $ie-background: rgba(255, 255, 255, 0);
59
61
  background: $ie-background; // because internet explorer
@@ -69,18 +71,18 @@
69
71
 
70
72
  .gem-c-image-card__context,
71
73
  .gem-c-image-card__metadata {
72
- @include core-14;
73
- margin: 0 0 $gutter-one-quarter;
74
- color: $grey-1;
74
+ @include govuk-font(14);
75
+ margin: 0 0 (govuk-spacing(3) / 2);
76
+ color: govuk-colour("grey-1");
75
77
 
76
- @include media(tablet) {
78
+ @include govuk-media-query($from: tablet) {
77
79
  margin-bottom: 0;
78
80
  }
79
81
  }
80
82
 
81
83
  .gem-c-image-card__description {
82
84
  @include govuk-font($size: 16);
83
- padding-top: $gutter-one-quarter;
85
+ padding-top: (govuk-spacing(3) / 2);
84
86
  word-wrap: break-word;
85
87
  }
86
88
 
@@ -88,7 +90,7 @@
88
90
  @include govuk-font($size: 16);
89
91
  position: relative;
90
92
  z-index: 2;
91
- padding: $gutter-one-quarter 0 0 0;
93
+ padding: (govuk-spacing(3) / 2) 0 0 0;
92
94
  margin: 0;
93
95
  list-style: none;
94
96
 
@@ -97,7 +99,7 @@
97
99
  }
98
100
 
99
101
  &.gem-c-image-card__list--indented {
100
- padding-left: $gutter-half;
102
+ padding-left: govuk-spacing(3);
101
103
 
102
104
  .gem-c-image-card__list-item {
103
105
  position: relative;
@@ -105,50 +107,50 @@
105
107
  &:before {
106
108
  content: "-";
107
109
  position: absolute;
108
- left: -$gutter-half;
110
+ left: (- govuk-spacing(3));
109
111
  }
110
112
  }
111
113
  }
112
114
  }
113
115
 
114
116
  .gem-c-image-card--large.gem-c-image-card {
115
- margin: 0 0 30px 0;
117
+ margin: 0 0 govuk-spacing(6) 0;
116
118
  }
117
119
 
118
120
  .gem-c-image-card--large {
119
121
  .gem-c-image-card__image-wrapper {
120
- padding: 0 $gutter-one-third 0 0;
121
- margin: 0;
122
- float: left;
123
- max-width: 66.66%;
124
- }
122
+ @include govuk-grid-column(two-thirds, $class: false, $at: tablet);
125
123
 
126
- .gem-c-image-card__text-wrapper {
127
- overflow: hidden;
128
- }
124
+ margin-bottom: govuk-spacing(2);
125
+ float: none;
126
+ width: auto;
127
+ max-width: 100%;
128
+ padding: 0;
129
129
 
130
- .gem-c-image-card__image-wrapper {
131
- @include media(mobile) {
132
- margin-bottom: $gutter-one-third;
133
- padding: 0;
130
+ @include govuk-media-query($from: tablet) {
131
+ padding: 0 govuk-spacing(2) 0 0;
132
+ margin-bottom: 0;
134
133
  }
135
134
  }
136
135
 
137
- .gem-c-image-card__image-wrapper,
138
136
  .gem-c-image-card__text-wrapper {
139
- @include media(mobile) {
140
- float: none;
141
- width: auto;
142
- max-width: 100%;
137
+ @include govuk-grid-column(one-third, $class: false, $at: tablet);
138
+
139
+ padding: 0;
140
+ overflow: hidden;
141
+
142
+ @include govuk-media-query($from: tablet) {
143
+ padding: 0 govuk-spacing(3);
144
+ margin-bottom: 0;
143
145
  }
144
146
  }
145
147
 
146
148
  .gem-c-image-card__title {
147
- @include bold-24;
148
- padding-bottom: $gutter-one-third;
149
+ @include govuk-font(24, $weight: bold);
150
+ padding-bottom: govuk-spacing(2);
149
151
  }
150
152
 
151
153
  .gem-c-image-card__description {
152
- @include core-19;
154
+ @include govuk-font(19);
153
155
  }
154
156
  }
@@ -10,15 +10,13 @@ $large-input-size: 50px;
10
10
  display: block;
11
11
 
12
12
  h1 {
13
- @include core-19($line-height: $input-size, $line-height-640: $input-size);
13
+ @include govuk-font($size: 19, $line-height: $input-size);
14
14
  margin: 0;
15
15
  }
16
16
  }
17
17
 
18
18
  .gem-c-search__input[type="search"] { // overly specific to prevent some overrides from outside
19
- @include box-sizing(border-box);
20
- @include core-19($line-height: (28 / 19), $line-height-640: (28 / 16));
21
- @include appearance(none);
19
+ @include govuk-font($size: 19, $line-height: (28 / 19));
22
20
  @include govuk-focusable;
23
21
 
24
22
  padding: 6px;
@@ -26,8 +24,12 @@ $large-input-size: 50px;
26
24
  width: 100%;
27
25
  height: $input-size;
28
26
  border: 0;
29
- background: $white;
27
+ background: govuk-colour("white");
30
28
  border-radius: 0; //otherwise iphones apply an automatic border radius
29
+ box-sizing: border-box;
30
+ -webkit-appearance: none;
31
+ -moz-appearance: none;
32
+ appearance: none;
31
33
  }
32
34
 
33
35
  .gem-c-search__submit {
@@ -38,92 +40,87 @@ $large-input-size: 50px;
38
40
  border-radius: 0;
39
41
  }
40
42
 
41
- // IE6 + IE7 always get the simplest version, regardless of whether javascript is enabled
42
- @if ($is-ie == false) or ($ie-version >= 8) {
43
- .js-enabled {
44
- .gem-c-search__label {
45
- @include core-19($line-height: $input-size, $line-height-640: $input-size);
43
+ .js-enabled {
44
+ .gem-c-search__label {
45
+ @include govuk-font($size: 19, $line-height: $input-size);
46
46
 
47
- position: absolute;
48
- left: 15px;
49
- top: 1px;
50
- z-index: 1;
51
- color: $secondary-text-colour;
52
- }
47
+ position: absolute;
48
+ left: govuk-spacing(3);
49
+ top: 1px;
50
+ z-index: 1;
51
+ color: $govuk-secondary-text-colour;
53
52
  }
53
+ }
54
54
 
55
- .gem-c-search__item-wrapper {
56
- display: table;
57
- width: 100%;
58
- background: $white;
59
- }
55
+ .gem-c-search__item-wrapper {
56
+ display: table;
57
+ width: 100%;
58
+ background: govuk-colour("white");
59
+ }
60
60
 
61
- //general class applied to search input and button wrapper
62
- .gem-c-search__item {
63
- position: relative;
64
- display: table-cell;
65
- vertical-align: top;
66
- }
61
+ //general class applied to search input and button wrapper
62
+ .gem-c-search__item {
63
+ position: relative;
64
+ display: table-cell;
65
+ vertical-align: top;
66
+ }
67
67
 
68
- .gem-c-search__input[type="search"] {
69
- margin: 0;
68
+ .gem-c-search__input[type="search"] {
69
+ margin: 0;
70
70
 
71
- // the .focus class is added by JS and ensures that the input remains above the label once clicked/filled in
72
- &:focus,
73
- &.focus {
74
- z-index: 2;
75
- }
71
+ // the .focus class is added by JS and ensures that the input remains above the label once clicked/filled in
72
+ &:focus,
73
+ &.focus {
74
+ z-index: 2;
76
75
  }
76
+ }
77
77
 
78
- .gem-c-search__submit-wrapper {
79
- width: 1%;
80
- }
78
+ .gem-c-search__submit-wrapper {
79
+ width: 1%;
80
+ }
81
81
 
82
- .gem-c-search__submit {
83
- position: relative;
84
- padding: 0;
85
- width: $input-size;
86
- height: $input-size;
87
- background-image: image-url("govuk_publishing_components/search-button.png");
88
- background-repeat: no-repeat;
89
- background-position: 2px 50%;
90
- text-indent: -5000px;
91
- overflow: hidden;
92
-
93
- &:focus {
94
- z-index: 2;
95
- }
82
+ .gem-c-search__submit {
83
+ position: relative;
84
+ padding: 0;
85
+ width: $input-size;
86
+ height: $input-size;
87
+ background-image: image-url("govuk_publishing_components/search-button.png");
88
+ background-repeat: no-repeat;
89
+ background-position: 2px 50%;
90
+ text-indent: -5000px;
91
+ overflow: hidden;
96
92
 
97
- &::-moz-focus-inner {
98
- border: 0;
99
- }
93
+ &:focus {
94
+ z-index: 2;
95
+ }
100
96
 
101
- @include device-pixel-ratio {
102
- background-size: 52.5px auto;
103
- background-position: 115% 50%;
104
- }
97
+ &::-moz-focus-inner {
98
+ border: 0;
99
+ }
100
+
101
+ @include govuk-device-pixel-ratio {
102
+ background-size: 52.5px auto;
103
+ background-position: 115% 50%;
105
104
  }
106
105
  }
107
106
 
108
107
  .gem-c-search--on-govuk-blue {
109
108
  .gem-c-search__label {
110
- color: $white;
109
+ color: govuk-colour("white");
111
110
  }
112
111
 
113
112
  .gem-c-search__submit {
114
- background-color: $black;
115
- color: $white;
113
+ background-color: govuk-colour("black");
114
+ color: govuk-colour("white");
116
115
 
117
116
  &:hover {
118
- background-color: lighten($black, 5%);
117
+ background-color: lighten(govuk-colour("black"), 5%);
119
118
  }
120
119
  }
121
120
 
122
- @if ($is-ie == false) or ($ie-version >= 8) {
123
- .js-enabled & {
124
- .gem-c-search__label {
125
- color: $secondary-text-colour;
126
- }
121
+ .js-enabled & {
122
+ .gem-c-search__label {
123
+ color: $govuk-secondary-text-colour;
127
124
  }
128
125
  }
129
126
  }
@@ -131,38 +128,36 @@ $large-input-size: 50px;
131
128
 
132
129
  .gem-c-search--on-white {
133
130
  .gem-c-search__label {
134
- color: $black;
131
+ color: govuk-colour("black");
135
132
  }
136
133
 
137
134
  .gem-c-search__input[type="search"] {
138
- border: solid 1px $grey-2;
135
+ border: solid 1px govuk-colour("grey-2");
139
136
  }
140
137
 
141
138
  .gem-c-search__submit {
142
- background-color: $light-blue;
143
- color: $white;
139
+ background-color: govuk-colour("light-blue");
140
+ color: govuk-colour("white");
144
141
 
145
142
  &:hover {
146
- background-color: lighten($light-blue, 5%);
143
+ background-color: lighten(govuk-colour("light-blue"), 5%);
147
144
  }
148
145
  }
149
146
 
150
- @if ($is-ie == false) or ($ie-version >= 8) {
151
- .gem-c-search__input[type="search"] {
152
- border-right: 0;
153
- }
147
+ .gem-c-search__input[type="search"] {
148
+ border-right: 0;
149
+ }
154
150
 
155
- .js-enabled & {
156
- .gem-c-search__label {
157
- color: $secondary-text-colour;
158
- }
151
+ .js-enabled & {
152
+ .gem-c-search__label {
153
+ color: $govuk-secondary-text-colour;
159
154
  }
160
155
  }
161
156
  }
162
157
 
163
158
  .gem-c-search--large {
164
159
  .gem-c-search__label {
165
- @include core-19($line-height: $large-input-size, $line-height-640: $large-input-size);
160
+ @include govuk-font($size: 19, $line-height: $large-input-size);
166
161
  }
167
162
 
168
163
  .gem-c-search__input[type="search"] {
@@ -174,7 +169,7 @@ $large-input-size: 50px;
174
169
  height: $large-input-size;
175
170
  background-position: 8px 50%;
176
171
 
177
- @include device-pixel-ratio {
172
+ @include govuk-device-pixel-ratio {
178
173
  background-size: 60px auto;
179
174
  background-position: 160% 50%;
180
175
  }
@@ -1,4 +1,4 @@
1
- <% meta_tags = GovukPublishingComponents::Presenters::MetaTags.new(content_item, local_assigns).meta_tags %>
1
+ <% meta_tags = GovukPublishingComponents::Presenters::MetaTags.new(content_item, local_assigns, request).meta_tags %>
2
2
 
3
3
  <% meta_tags.each do |name, content| %>
4
4
  <meta name="<%= name %>" content="<%= content %>">
@@ -150,7 +150,7 @@ examples:
150
150
  data:
151
151
  large: true
152
152
  href: "/still-not-a-page"
153
- image_src: "https://assets.publishing.service.gov.uk/frontend/homepage/leaving-the-eu-bc9992ee672a30d8e8a3e195c9afa750e618748130a4e073a593ba36dfc29af9.jpg"
153
+ image_src: "https://assets.publishing.service.gov.uk/frontend/homepage/uk-leaves-the-eu-d84d2981a9953d8b1261c9d25016223b0a8af3c096fa2d5e03510d73a78e3c60.jpg"
154
154
  image_alt: "some meaningful alt text please"
155
155
  context:
156
156
  date: 2017-06-14 11:30:00
@@ -204,4 +204,3 @@ examples:
204
204
  }
205
205
  ]
206
206
  extra_links_no_indent: true
207
-
@@ -1,9 +1,9 @@
1
1
  module GovukPublishingComponents
2
2
  module Presenters
3
3
  class MetaTags
4
- attr_reader :content_item, :details, :links, :local_assigns
4
+ attr_reader :content_item, :details, :links, :local_assigns, :request
5
5
 
6
- def initialize(content_item, local_assigns)
6
+ def initialize(content_item, local_assigns, request)
7
7
  # We have to call deep_symbolize_keys because we're often dealing with a
8
8
  # parsed JSON document which will have string keys by default, but our
9
9
  # components use symbol keys and we want consistency.
@@ -11,6 +11,7 @@ module GovukPublishingComponents
11
11
  @details = @content_item[:details] || {}
12
12
  @links = @content_item[:links] || {}
13
13
  @local_assigns = local_assigns
14
+ @request = request
14
15
  end
15
16
 
16
17
  def meta_tags
@@ -98,6 +99,14 @@ module GovukPublishingComponents
98
99
  stepnavs = links[:part_of_step_navs] || []
99
100
  stepnavs_content = stepnavs.map { |stepnav| stepnav[:content_id] }.join(",")
100
101
  meta_tags["govuk:stepnavs"] = stepnavs_content if stepnavs_content.present?
102
+
103
+ step_nav_helper = PageWithStepByStepNavigation.new(content_item, request.path, request.query_parameters)
104
+ if step_nav_helper.show_secondary_step_by_step?
105
+ meta_tags["govuk:navigation-page-type"] = "Secondary step by step shown"
106
+ elsif step_nav_helper.show_header?
107
+ meta_tags["govuk:navigation-page-type"] = "Primary step by step shown"
108
+ end
109
+
101
110
  meta_tags
102
111
  end
103
112
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '17.15.0'.freeze
2
+ VERSION = '17.16.0'.freeze
3
3
  end
@@ -49,7 +49,7 @@
49
49
  "/"
50
50
  ],
51
51
  "_resolved": "git://github.com/alphagov/accessible-autocomplete.git#3523dd9fffc70cbd9f6f555f75863c33a709f49e",
52
- "_shasum": "e90b620884c34d12eeb583d4639556727b4bb978",
52
+ "_shasum": "5566724b506194c06c4d6e3660c1c741eebe3879",
53
53
  "_shrinkwrap": null,
54
54
  "_spec": "accessible-autocomplete@git://github.com/alphagov/accessible-autocomplete.git#add-multiselect-support",
55
55
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
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: 17.15.0
4
+ version: 17.16.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: 2019-07-16 00:00:00.000000000 Z
11
+ date: 2019-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters