govuk_publishing_components 13.7.0 → 13.8.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: 15cf96f125f89a65e28a51450d8a135906d877cdadcca39b2acb0be159879295
4
- data.tar.gz: a27d8357503ffcae6c47a090b7c43791a63e860f70aebca9dfbe45af11efb01f
3
+ metadata.gz: 27bb1983d939c2b0178f74229c78a912811ed892e32b6869d77ddaf2b089a58a
4
+ data.tar.gz: c1e6ab12c9cfc5fe6c0a87fa1f701235b1f94fced5dc4b572f48e86f0535773c
5
5
  SHA512:
6
- metadata.gz: af4fa01ba4e02ad638ecb433d9a5515bdaa399cd93c8d6992f5f9626fda74e40d7ca29680e717ba7c617a73f76dede2f5c2ce88edb072af06e614ea0cdd1e7ef
7
- data.tar.gz: e83abd9b33797e68a9fff43cb204d501840f8d02b89fb018eb1d568b7ef252c3f76cd288e4dd0843971b697404ff0de5b3fd5b15a5bc99d2ee5119ee1647581e
6
+ metadata.gz: 4fb7a1c1ef6cb45c8002dfe5d89f0ffa59024473320a436758d1a9d145a8e3d5b1d7719b0b7346379ce1598b1003d60842456b82f3ff972636ee2a1f529b237f
7
+ data.tar.gz: 1a33708b2cd550298c2985f731c6fad09e0890affd70bf5a8906a7fd530a6d6c717465043b62ed31db250537d347c2902261541a717515f8ced22010006ee719
@@ -18,7 +18,7 @@
18
18
  <% elsif navigation.content_has_curated_related_items? %>
19
19
  <%# Rendering parent-based breadcrumbs because the page has curated related links %>
20
20
  <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: navigation.breadcrumbs %>
21
- <% elsif navigation.content_is_tagged_to_a_live_taxon? %>
21
+ <% elsif navigation.content_is_tagged_to_a_live_taxon? && !navigation.content_is_a_specialist_document? %>
22
22
  <%# Rendering taxonomy breadcrumbs because the page is tagged to live taxons %>
23
23
  <%= render 'govuk_publishing_components/components/breadcrumbs',
24
24
  breadcrumbs: navigation.taxon_breadcrumbs[:breadcrumbs],
@@ -21,7 +21,7 @@ module GovukPublishingComponents
21
21
  end
22
22
 
23
23
  def breadcrumbs
24
- if content_item["schema_name"] == "specialist_document"
24
+ if content_is_a_specialist_document?
25
25
  parent_finder = content_item.dig("links", "finder", 0)
26
26
  return [] unless parent_finder
27
27
 
@@ -52,6 +52,10 @@ module GovukPublishingComponents
52
52
  content_item.dig("links", "taxons").to_a.any? { |taxon| taxon["phase"] == "live" }
53
53
  end
54
54
 
55
+ def content_is_a_specialist_document?
56
+ content_item["schema_name"] == "specialist_document"
57
+ end
58
+
55
59
  def content_tagged_to_current_step_by_step?
56
60
  # TODO: remove indirection here
57
61
  step_nav_helper.show_header?
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '13.7.0'.freeze
2
+ VERSION = '13.8.0'.freeze
3
3
  end
@@ -1703,8 +1703,10 @@ Checkboxes.prototype.setAttributes = function ($input) {
1703
1703
  var inputIsChecked = $input.checked;
1704
1704
  $input.setAttribute('aria-expanded', inputIsChecked);
1705
1705
 
1706
- var $content = document.querySelector('#' + $input.getAttribute('aria-controls'));
1707
- $content.classList.toggle('govuk-checkboxes__conditional--hidden', !inputIsChecked);
1706
+ var $content = this.$module.querySelector('#' + $input.getAttribute('aria-controls'));
1707
+ if ($content) {
1708
+ $content.classList.toggle('govuk-checkboxes__conditional--hidden', !inputIsChecked);
1709
+ }
1708
1710
  };
1709
1711
 
1710
1712
  Checkboxes.prototype.handleClick = function (event) {
@@ -1982,8 +1984,10 @@ Radios.prototype.setAttributes = function ($input) {
1982
1984
  var inputIsChecked = $input.checked;
1983
1985
  $input.setAttribute('aria-expanded', inputIsChecked);
1984
1986
 
1985
- var $content = document.querySelector('#' + $input.getAttribute('aria-controls'));
1986
- $content.classList.toggle('govuk-radios__conditional--hidden', !inputIsChecked);
1987
+ var $content = this.$module.querySelector('#' + $input.getAttribute('aria-controls'));
1988
+ if ($content) {
1989
+ $content.classList.toggle('govuk-radios__conditional--hidden', !inputIsChecked);
1990
+ }
1987
1991
  };
1988
1992
 
1989
1993
  Radios.prototype.handleClick = function (event) {
@@ -2311,6 +2315,7 @@ function initAll () {
2311
2315
  }
2312
2316
 
2313
2317
  exports.initAll = initAll;
2318
+ exports.Accordion = Accordion;
2314
2319
  exports.Button = Button;
2315
2320
  exports.Details = Details;
2316
2321
  exports.CharacterCount = CharacterCount;
@@ -7,13 +7,11 @@
7
7
 
8
8
  .govuk-accordion {
9
9
  @include govuk-responsive-margin(6, "bottom");
10
- // Border at the bottom of the whole accordion
11
- border-bottom: 1px solid $govuk-border-colour;
12
10
  }
13
11
 
14
12
  // Borders between accordion sections
15
13
  .govuk-accordion__section {
16
- border-top: 1px solid $govuk-border-colour;
14
+ padding-top: govuk-spacing(3);
17
15
  }
18
16
 
19
17
  .govuk-accordion__section-header {
@@ -28,6 +26,7 @@
28
26
  // Buttons within the sections don’t need default styling
29
27
  .govuk-accordion__section-button {
30
28
  @include govuk-font($size: 24, $weight: bold);
29
+ display: inline-block;
31
30
  margin-bottom: 0;
32
31
  padding-top: govuk-spacing(3);
33
32
  }
@@ -37,9 +36,25 @@
37
36
  margin-bottom: 0;
38
37
  }
39
38
 
39
+ // Remove the bottom margin from the last item inside the content
40
+ .govuk-accordion__section-content > :last-child {
41
+ margin-bottom: 0;
42
+ }
43
+
40
44
  // JavaScript enabled
41
45
  .js-enabled {
42
46
 
47
+ .govuk-accordion {
48
+ // Border at the bottom of the whole accordion
49
+ border-bottom: 1px solid $govuk-border-colour;
50
+ }
51
+
52
+ // Borders between accordion sections
53
+ .govuk-accordion__section {
54
+ padding-top: 0;
55
+ border-top: 1px solid $govuk-border-colour;
56
+ }
57
+
43
58
  // Hide the body of collapsed sections
44
59
  .govuk-accordion__section-content {
45
60
  display: none;
@@ -47,11 +62,6 @@
47
62
  @include govuk-responsive-padding(3, "bottom");
48
63
  }
49
64
 
50
- // Remove the bottom margin from the last item inside the content
51
- .govuk-accordion__section-content > :last-child {
52
- margin-bottom: 0;
53
- }
54
-
55
65
  // Show the body of expanded sections
56
66
  .govuk-accordion__section--expanded .govuk-accordion__section-content {
57
67
  display: block;
@@ -83,6 +93,11 @@
83
93
  // Section headers have a grey background on hover as an additional affodance
84
94
  .govuk-accordion__section-header:hover {
85
95
  background-color: govuk-colour("grey-4");
96
+ // For devices that can't hover such as touch devices,
97
+ // remove hover state as it can be stuck in that state (iOS).
98
+ @media (hover: none) {
99
+ background-color: initial;
100
+ }
86
101
  }
87
102
 
88
103
  // Setting focus styles on header so that summary that is not part of the button is included in focus
@@ -1065,8 +1065,10 @@ Checkboxes.prototype.setAttributes = function ($input) {
1065
1065
  var inputIsChecked = $input.checked;
1066
1066
  $input.setAttribute('aria-expanded', inputIsChecked);
1067
1067
 
1068
- var $content = document.querySelector('#' + $input.getAttribute('aria-controls'));
1069
- $content.classList.toggle('govuk-checkboxes__conditional--hidden', !inputIsChecked);
1068
+ var $content = this.$module.querySelector('#' + $input.getAttribute('aria-controls'));
1069
+ if ($content) {
1070
+ $content.classList.toggle('govuk-checkboxes__conditional--hidden', !inputIsChecked);
1071
+ }
1070
1072
  };
1071
1073
 
1072
1074
  Checkboxes.prototype.handleClick = function (event) {
@@ -41,6 +41,12 @@
41
41
  "required": false,
42
42
  "description": "If provided, it will be used as the initial value of the input."
43
43
  },
44
+ {
45
+ "name": "autocomplete",
46
+ "type": "string",
47
+ "required": false,
48
+ "description": "Attribute to [identify input purpose](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html), for instance \"postal-code\" or \"username\". See [autofill](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill) for full list of attributes that can be used."
49
+ },
44
50
  {
45
51
  "name": "classes",
46
52
  "type": "string",
@@ -65,6 +65,7 @@
65
65
  name: (params.namePrefix + "-" + item.name) if params.namePrefix else item.name,
66
66
  value: item.value,
67
67
  type: "number",
68
+ autocomplete: item.autocomplete,
68
69
  attributes: {
69
70
  pattern: "[0-9]*"
70
71
  }
@@ -124,13 +124,18 @@
124
124
  @include govuk-font($size: 24, $weight: bold);
125
125
  }
126
126
 
127
+ .govuk-header__logo,
128
+ .govuk-header__content {
129
+ box-sizing: border-box;
130
+ }
131
+
127
132
  .govuk-header__logo {
128
133
  @include govuk-responsive-margin(2, "bottom");
129
134
  padding-right: govuk-spacing(8);
130
135
 
131
136
  @include mq ($from: desktop) {
132
137
  width: 33.33%;
133
- padding-right: 0;
138
+ padding-right: $govuk-gutter-half;
134
139
  float: left;
135
140
  vertical-align: top;
136
141
  }
@@ -139,6 +144,7 @@
139
144
  .govuk-header__content {
140
145
  @include mq ($from: desktop) {
141
146
  width: 66.66%;
147
+ padding-left: $govuk-gutter-half;
142
148
  float: left;
143
149
  }
144
150
  }
@@ -64,6 +64,12 @@
64
64
  "required": false,
65
65
  "description": "Classes to add to the anchor tag."
66
66
  },
67
+ {
68
+ "name": "autocomplete",
69
+ "type": "string",
70
+ "required": false,
71
+ "description": "Attribute to [identify input purpose](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html), for instance \"postal-code\" or \"username\". See [autofill](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill) for full list of attributes that can be used."
72
+ },
67
73
  {
68
74
  "name": "attributes",
69
75
  "type": "object",
@@ -39,5 +39,6 @@
39
39
  <input class="govuk-input {%- if params.classes %} {{ params.classes }}{% endif %} {%- if params.errorMessage %} govuk-input--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" type="{{ params.type | default('text') }}"
40
40
  {%- if params.value %} value="{{ params.value}}"{% endif %}
41
41
  {%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
42
+ {%- if params.autocomplete %} autocomplete="{{ params.autocomplete}}"{% endif %}
42
43
  {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
43
44
  </div>
@@ -1065,8 +1065,10 @@ Radios.prototype.setAttributes = function ($input) {
1065
1065
  var inputIsChecked = $input.checked;
1066
1066
  $input.setAttribute('aria-expanded', inputIsChecked);
1067
1067
 
1068
- var $content = document.querySelector('#' + $input.getAttribute('aria-controls'));
1069
- $content.classList.toggle('govuk-radios__conditional--hidden', !inputIsChecked);
1068
+ var $content = this.$module.querySelector('#' + $input.getAttribute('aria-controls'));
1069
+ if ($content) {
1070
+ $content.classList.toggle('govuk-radios__conditional--hidden', !inputIsChecked);
1071
+ }
1070
1072
  };
1071
1073
 
1072
1074
  Radios.prototype.handleClick = function (event) {
@@ -70,6 +70,12 @@
70
70
  "required": false,
71
71
  "description": "Classes to add to the textarea."
72
72
  },
73
+ {
74
+ "name": "autocomplete",
75
+ "type": "string",
76
+ "required": false,
77
+ "description": "Attribute to [identify input purpose](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html), for instance \"postal-code\" or \"username\". See [autofill](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill) for full list of attributes that can be used."
78
+ },
73
79
  {
74
80
  "name": "attributes",
75
81
  "type": "object",
@@ -38,5 +38,6 @@
38
38
  {% endif %}
39
39
  <textarea class="govuk-textarea {{- ' govuk-textarea--error' if params.errorMessage }} {{- ' ' + params.classes if params.classes}}" id="{{ params.id }}" name="{{ params.name }}" rows="{%if params.rows %} {{- params.rows -}} {% else %}5{%endif %}"
40
40
  {%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %}
41
+ {%- if params.autocomplete %} autocomplete="{{ params.autocomplete}}"{% endif %}
41
42
  {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.value }}</textarea>
42
43
  </div>
@@ -2,10 +2,6 @@
2
2
  // Limit the width of the container to the page width
3
3
  max-width: $govuk-page-width;
4
4
 
5
- @include govuk-if-ie8 {
6
- width: $govuk-page-width;
7
- }
8
-
9
5
  // On mobile, add half width gutters
10
6
  margin: 0 $govuk-gutter-half;
11
7
 
@@ -19,6 +15,13 @@
19
15
  @include govuk-media-query($and: "(min-width: #{($govuk-page-width + $govuk-gutter * 2)})") {
20
16
  margin: 0 auto;
21
17
  }
18
+
19
+ @include govuk-if-ie8 {
20
+ width: $govuk-page-width;
21
+ // Since media queries are not supported in IE8,
22
+ // we need to duplicate this margin that centers the page.
23
+ margin: 0 auto;
24
+ }
22
25
  }
23
26
 
24
27
  @include govuk-exports("govuk/objects/width-container") {
@@ -15,13 +15,13 @@
15
15
  ],
16
16
  "_from": "govuk-frontend@>=2.5.1 <3.0.0",
17
17
  "_hasShrinkwrap": false,
18
- "_id": "govuk-frontend@2.5.1",
18
+ "_id": "govuk-frontend@2.6.0",
19
19
  "_inCache": true,
20
20
  "_location": "/govuk-frontend",
21
21
  "_nodeVersion": "8.9.4",
22
22
  "_npmOperationalInternal": {
23
23
  "host": "s3://npm-registry-packages",
24
- "tmp": "tmp/govuk-frontend_2.5.1_1547637318677_0.8220506682257378"
24
+ "tmp": "tmp/govuk-frontend_2.6.0_1548932459296_0.8612397921795296"
25
25
  },
26
26
  "_npmUser": {
27
27
  "name": "govuk-patterns-and-tools",
@@ -41,8 +41,8 @@
41
41
  "_requiredBy": [
42
42
  "/"
43
43
  ],
44
- "_resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-2.5.1.tgz",
45
- "_shasum": "96082aedfef23bfce6591c3520b06d803be2d7fa",
44
+ "_resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-2.6.0.tgz",
45
+ "_shasum": "373153a14868b39fe19372c3fb9c3ca9c946e6e1",
46
46
  "_shrinkwrap": null,
47
47
  "_spec": "govuk-frontend@^2.5.1",
48
48
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
@@ -59,12 +59,12 @@
59
59
  "devDependencies": {},
60
60
  "directories": {},
61
61
  "dist": {
62
- "integrity": "sha512-DDi1HGRTNRH/UmqOYACOR01V+aae36pnHHf5/g08spscJO5AazA/BQTenlNm8WFJ4UAeikb1TrCbgGWJE4Vypw==",
63
- "shasum": "96082aedfef23bfce6591c3520b06d803be2d7fa",
64
- "tarball": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-2.5.1.tgz",
62
+ "integrity": "sha512-JA1tk0MpkxJzoVjJ367JaoRIDHxUK9QqpG11aLlXlhEVcgCX3WBAxsVpx/dC7SwKBmM+F1C4yao0PLQzDFvmkg==",
63
+ "shasum": "373153a14868b39fe19372c3fb9c3ca9c946e6e1",
64
+ "tarball": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-2.6.0.tgz",
65
65
  "fileCount": 256,
66
- "unpackedSize": 1341333,
67
- "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPxJHCRA9TVsSAnZWagAAHpoP/0M5mrc5AA4/NkSyTpfJ\n0mbatgQeaTw0ABdK267bb0VWsk5+Jg0O5hnOF1SxTgWLWEU96gikjAZ46u3C\nfS09ycAhJ7bwykmz851JLnbG6UWgB3COkT/ZHhIuAjy9ulI8TvXf3ruFs4cT\nkEHHEpZlDxRJo6tbyzcp9s6t91vSqP899w8RxSj0/0l8v/t1Dbjx8CC7wJl9\nc6wl/ZyxfmvTFyKsZDD1h21K+5TsI4Xdukj64IwVA05PVAQMhXEMLWO1Khw0\nkFvUeDyr31topkGLbPgkvyoMqyRgIt+0FeumED+F8De7KYHc9xVbX0zGzYlR\n//5bgE9K2I+JQDYxIkDzDDjboiay70mWNFuhQJbOl4zXpkkxYJ5hWN6YqG4W\ntRPVBZR9L2GCWyYRvgim64zz+6uuJ2kGD+a3QoH4N0Pgw6VwJ9HnaBy+qo/a\nDCKPyST4xwP18O9Pb80CKzWQ6Am5jTkjiJfxmc83dgHnc8B48k+6O0vGGDuL\nTKCyPLJb4Xm0yYfXpDz23Xr2N+ahPjPHVVEJpKHBHVJemhcM4EBfUaJFkUfR\nCovhp+AqCUWYj00b3PTPb/TKEvMXti70kQ9hhEpg3HQV0HJOoyqaGk5GnB0B\n2I6oPzwaF0JOFTXtkoUawQRu3lb4cuqcrk2rdE8vwU3Lmm5cl0O6a6Tjat4u\ngkbT\r\n=f9P7\r\n-----END PGP SIGNATURE-----\r\n"
66
+ "unpackedSize": 1343673,
67
+ "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUtVrCRA9TVsSAnZWagAAeXgP/1N3FnFujvMRL44cyUqC\nGA2HmIA2xb+RjM1CJlTqCLbHGZciDp5TYDTp/43ktUrkupZNT/LDynCd+Ofg\nYeZzP0Q29rn+dUveLAoeNxAW7ZJZL7Dvpe6I4FY1FCDg8iIOatgKRS3sJcDW\nResPuDaidCzmV5sSOsFiRTcyvpHiTYC1X9vbDvqc6HHTmezjWXKMxi4cKaJp\n8R6A016xFjk94cknL5VHOAFE6Zz1RG5OQ63UUl30PRHIhahOqb2FaI4GI1hO\nFCAuGBX+2GC2baVtNmoXA0aL9ceo8sIn/l27jpjEyWV7okHARH8wrR/TUm3P\nfCQyW90HTTbvXdfvIxnR41olt74JLuamjNSGkgH7J9xOiEprqbxaDBFWlsdn\nKfvHUDa6o8eCHZu4qq91ByT0ipm7SJpVVpnAcyqY0uK2I2v9nGobmpyLgTQL\nbzbGQywQjlkN7Npzt1FSF599iY7C3wzuuDJ2f+vTa2xrgPBSzj/pf5Z3q5c/\nX0OZ0qm4Fb8iVCW9Oq3QK0juZtu3556MfLPyr7oD+9l8b0vF3j6nmHik3HzB\nGiYsyjFysf4zQrKx/m0GEJi42OM4nxMH2IDTBdXpFhk0J9DA2EuTXJpbPzYr\njRY5BlDUapuHftvb1Jot0fv7Hd2cTWVNp/a9/Bz/YaQI93WGqAm3u+LMmZER\nDcOW\r\n=dN/T\r\n-----END PGP SIGNATURE-----\r\n"
68
68
  },
69
69
  "engines": {
70
70
  "node": ">= 4.2.0"
@@ -92,5 +92,5 @@
92
92
  "url": "git+https://github.com/alphagov/govuk-frontend.git"
93
93
  },
94
94
  "sass": "all.scss",
95
- "version": "2.5.1"
95
+ "version": "2.6.0"
96
96
  }
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: 13.7.0
4
+ version: 13.8.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-01-24 00:00:00.000000000 Z
11
+ date: 2019-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govspeak
@@ -318,10 +318,10 @@ files:
318
318
  - app/assets/javascripts/govuk_publishing_components/components/feedback.js
319
319
  - app/assets/javascripts/govuk_publishing_components/components/initial-focus.js
320
320
  - app/assets/javascripts/govuk_publishing_components/components/radio.js
321
- - app/assets/javascripts/govuk_publishing_components/components/select.js
322
321
  - app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
323
322
  - app/assets/javascripts/govuk_publishing_components/dependencies.js
324
323
  - app/assets/javascripts/govuk_publishing_components/lib/current-location.js
324
+ - app/assets/javascripts/govuk_publishing_components/lib/select.js
325
325
  - app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
326
326
  - app/assets/javascripts/govuk_publishing_components/lib/toggle.js
327
327
  - app/assets/javascripts/govuk_publishing_components/vendor/modernizr.js