govuk_publishing_components 9.12.2 → 9.13.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: 97cdc5455cda72bafd3f8ab687a2fc4d9132db5bbd2c40ec83d46fad3c9840c3
4
- data.tar.gz: c0d4dd97400485c000c59c7313f020099b69a88af5ef98382e216d9250d4dca3
3
+ metadata.gz: 7a8b61958875082d4c07fbe597644029b2aa8430fa88bc7988e87db41880b8f9
4
+ data.tar.gz: 6de83fa7c13a30edcad268f77f9fb2d29a4f69ab8a47c137f488f9514c676b92
5
5
  SHA512:
6
- metadata.gz: 639b3aa83386b2f64d6441a5b1e8863394fe5d72ab99a09e05b5f77620ae5000883ae01e6693c90dcab568f1064f819fd08aa3766a7733f31027d486189ba25c
7
- data.tar.gz: efcd5e351f5a4f313dd2c67b61b5d5eed82807e91380954fd0aac3e0c07fd5a0be755051b20b2b31022e6391f1387f8bba7951a2d1bab31ece7c639f6dcead37
6
+ metadata.gz: f73daf1fd6fdc7135e268b9ff363cf6e07555937fb753735075123028392c5680d322470d003fe4d062cf14394b6a938848a36bafb1fc7c36adcbcc0cb93e5c0
7
+ data.tar.gz: b56d58373dd2688ca846fbbad203206080a64476933baccd5a53e5edf6479f3786b9ff09ac14a4d58729d34fe55bc0d5aae4efd25beeef8fdd079d18b6e6365a
@@ -40,5 +40,6 @@
40
40
  @import "components/subscription-links";
41
41
  @import "components/success-alert";
42
42
  @import "components/taxonomy-navigation";
43
+ @import "components/taxonomy-list";
43
44
  @import "components/title";
44
45
  @import "components/translation-nav";
@@ -64,3 +64,8 @@
64
64
  .gem-c-document-list--top-margin {
65
65
  margin-top: $gutter-two-thirds;
66
66
  }
67
+
68
+ .gem-c-document-list__multi-list {
69
+ width: 100%;
70
+ margin-right: 25px;
71
+ }
@@ -0,0 +1,20 @@
1
+ .gem-c-taxonomy-list {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ margin-top: $gutter-half;
5
+
6
+ @include media(tablet) {
7
+ margin-right: -25px;
8
+ }
9
+ }
10
+
11
+ .gem-c-taxonomy-list__item {
12
+ list-style: none;
13
+
14
+ @include media(tablet) {
15
+ @include box-sizing(border-box);
16
+ width: 33%;
17
+ padding-right: $gutter-one-third;
18
+ vertical-align: top;
19
+ }
20
+ }
@@ -1,5 +1,7 @@
1
1
  <%
2
2
  items ||= []
3
+ within_multitype_list ||= false
4
+ within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list
3
5
  margin_top_class = " gem-c-document-list--top-margin" if local_assigns[:margin_top]
4
6
  margin_bottom_class = " gem-c-document-list--bottom-margin" if local_assigns[:margin_bottom]
5
7
  title_with_context_class = " gem-c-document-list__item-title--context"
@@ -8,9 +10,11 @@
8
10
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
9
11
  %>
10
12
  <% if items.any? %>
11
- <ol class="gem-c-document-list<%= margin_bottom_class %><%= margin_top_class %> <%= brand_helper.brand_class %>">
13
+ <% unless within_multitype_list %>
14
+ <ol class="gem-c-document-list<%= margin_bottom_class %><%= margin_top_class %>">
15
+ <% end %>
12
16
  <% items.each do |item| %>
13
- <li class="gem-c-document-list__item">
17
+ <li class="gem-c-document-list__item<%= within_multitype_list_class %> <%= brand_helper.brand_class %>">
14
18
  <%=
15
19
  link_to(
16
20
  item[:link][:text],
@@ -45,5 +49,7 @@
45
49
  <% end %>
46
50
  </li>
47
51
  <% end %>
48
- </ol>
52
+ <% unless within_multitype_list %>
53
+ </ol>
54
+ <% end %>
49
55
  <% end %>
@@ -1,11 +1,14 @@
1
1
  <%
2
2
  items ||= []
3
3
  inverse ||= false
4
+ within_multitype_list ||= false
4
5
  inverse_class = "gem-c-highlight-boxes--inverse" if inverse
5
6
  highlight_boxes_helper = GovukPublishingComponents::Presenters::HighlightBoxesHelper.new(local_assigns)
6
7
  %>
7
8
  <% if items.any? %>
8
- <ol class="gem-c-highlight-boxes" <%= "data-module=track-click" if highlight_boxes_helper.data_tracking? %>>
9
+ <% unless within_multitype_list %>
10
+ <ol class="gem-c-highlight-boxes" <%= "data-module=track-click" if highlight_boxes_helper.data_tracking? %>>
11
+ <% end %>
9
12
  <% items.each do |content_item| %>
10
13
  <li class="gem-c-highlight-boxes__item-wrapper">
11
14
  <div class="gem-c-highlight-boxes__item <%= inverse_class %>">
@@ -35,5 +38,7 @@
35
38
  </div>
36
39
  </li>
37
40
  <% end %>
38
- </ol>
41
+ <% unless within_multitype_list %>
42
+ </ol>
43
+ <% end %>
39
44
  <% end %>
@@ -14,6 +14,7 @@
14
14
  <%= stylesheet_link_tag "govuk_publishing_components/admin_styles_ie8" %>
15
15
  <![endif]-->
16
16
  <%= javascript_include_tag "govuk_publishing_components/vendor/modernizr" %>
17
+ <%= yield :head %>
17
18
  </head>
18
19
  <body class="govuk-template__body">
19
20
  <script>
@@ -0,0 +1,29 @@
1
+ <%
2
+ highlight_box ||= false
3
+ document_list ||= false
4
+ image_cards ||= false
5
+
6
+ highlight_box.merge!({within_multitype_list: true}) if highlight_box
7
+ document_list.merge!({within_multitype_list: true}) if document_list
8
+
9
+ taxonomy_list_helper = GovukPublishingComponents::Presenters::TaxonomyListHelper.new(image_cards)
10
+ %>
11
+ <% if highlight_box || document_list || image_cards %>
12
+ <ul class="gem-c-taxonomy-list" data-module="track-click">
13
+ <% if image_cards %>
14
+ <% taxonomy_list_helper.image_card_data.each do |image_card| %>
15
+ <li class="gem-c-taxonomy-list__item">
16
+ <%= render "govuk_publishing_components/components/image_card", image_card %>
17
+ </li>
18
+ <% end %>
19
+ <% end %>
20
+
21
+ <% if highlight_box %>
22
+ <%= render "govuk_publishing_components/components/highlight_boxes", highlight_box %>
23
+ <% end %>
24
+
25
+ <% if document_list %>
26
+ <%= render "govuk_publishing_components/components/document_list", document_list %>
27
+ <% end %>
28
+ </ul>
29
+ <% end %>
@@ -0,0 +1,107 @@
1
+ name: Taxonomy list
2
+ description: Wraps the highlight box, document list and image card components in one list. This is commonly used on topic pages for links to tagged content.
3
+ body: |
4
+ The [highlight box](/component-guide/highlight_boxes), [document list](/component-guide/document_list) and [image card](/component-guide/image_card) components are standalone components.
5
+
6
+ However, there are some use cases where we want to use these components together to render one list of links. This is not possible when using the components separately.
7
+ This component wraps these components in one list, and applies relevant styling to get them to display appropriately together.
8
+
9
+ **Note:** At the moment, this component only works when displaying either highlight box + document list **or** image cards + document list. The layout for combining all three together hasn't been fixed.
10
+ accessibility_criteria: |
11
+ The taxonomy list should:
12
+
13
+ - Wrap all links in one list
14
+ - Should not be used to display links that don't belong together in one list
15
+ shared_accessibility_criteria:
16
+ - link
17
+ examples:
18
+ default:
19
+ data:
20
+ highlight_box:
21
+ inverse: true
22
+ items:
23
+ - link:
24
+ text: If your child is taken into care
25
+ path: /child-into-care
26
+ description: Information on what to do if your child is taken into care
27
+ metadata:
28
+ document_type: Detailed guide
29
+ - link:
30
+ text: High needs funding
31
+ path: /high-needs-funding
32
+ metadata:
33
+ document_type: Guide
34
+ public_updated_at: 2016-06-27 10:29:44
35
+ - link:
36
+ text: Student Finance
37
+ path: /student-finance
38
+ description: Student loan information
39
+ metadata:
40
+ document_type: Detailed guide
41
+ - link:
42
+ text: If your child is taken into care
43
+ path: /child-into-care
44
+ description: Information on what to do if your child is taken into care
45
+ metadata:
46
+ document_type: Detailed guide
47
+ document_list:
48
+ items:
49
+ - link:
50
+ text: If your child is taken into care
51
+ path: /child-into-care
52
+ metadata:
53
+ document_type: Detailed guide
54
+ - link:
55
+ text: High needs funding
56
+ path: /high-needs-funding
57
+ metadata:
58
+ document_type: Guide
59
+ with_image_cards:
60
+ data:
61
+ image_cards:
62
+ items:
63
+ - link:
64
+ path: /not-a-page
65
+ text: News headline
66
+ heading_level: 0
67
+ image:
68
+ url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
69
+ alt: some meaningful alt text please
70
+ context: The Rt Hon
71
+ - link:
72
+ path: /not-a-page
73
+ text: News headline
74
+ heading_level: 0
75
+ image:
76
+ url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
77
+ alt: some meaningful alt text please
78
+ context: The Rt Hon
79
+ - link:
80
+ path: /not-a-page
81
+ text: News headline
82
+ heading_level: 0
83
+ image:
84
+ url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
85
+ alt: some meaningful alt text please
86
+ context: The Rt Hon
87
+ - link:
88
+ path: /not-a-page
89
+ text: News headline
90
+ heading_level: 0
91
+ image:
92
+ url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
93
+ alt: some meaningful alt text please
94
+ context: The Rt Hon
95
+ document_list:
96
+ items:
97
+ - link:
98
+ text: If your child is taken into care
99
+ path: /child-into-care
100
+ description: What happens if your child is taken into care
101
+ metadata:
102
+ document_type: Detailed guide
103
+ - link:
104
+ text: High needs funding
105
+ path: /high-needs-funding
106
+ metadata:
107
+ document_type: Guide
@@ -22,6 +22,7 @@ require "govuk_publishing_components/presenters/contents_list_helper"
22
22
  require "govuk_publishing_components/presenters/image_card_helper"
23
23
  require "govuk_publishing_components/presenters/organisation_logo_helper"
24
24
  require "govuk_publishing_components/presenters/highlight_boxes_helper"
25
+ require "govuk_publishing_components/presenters/taxonomy_list_helper"
25
26
 
26
27
  require "govuk_publishing_components/app_helpers/taxon_breadcrumbs"
27
28
  require "govuk_publishing_components/app_helpers/brand_helper"
@@ -0,0 +1,23 @@
1
+ module GovukPublishingComponents
2
+ module Presenters
3
+ class TaxonomyListHelper
4
+ def initialize(image_cards)
5
+ @image_cards = image_cards
6
+ end
7
+
8
+ def image_card_data
9
+ @image_cards[:items].map do |image_card|
10
+ {
11
+ context: image_card[:image][:context],
12
+ href: image_card[:link][:path],
13
+ heading_text: image_card[:link][:text],
14
+ image_src: image_card[:image][:url],
15
+ image_alt: image_card[:image][:alt],
16
+ heading_level: image_card[:link][:heading_level],
17
+ href_data_attributes: (image_card[:link][:data_attributes] if image_card[:link][:data_attributes])
18
+ }
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '9.12.2'.freeze
2
+ VERSION = '9.13.0'.freeze
3
3
  end
@@ -1,49 +1,31 @@
1
1
  {
2
2
  "_args": [
3
3
  [
4
- {
5
- "raw": "govuk-frontend@^1.2.0",
6
- "scope": null,
7
- "escapedName": "govuk-frontend",
8
- "name": "govuk-frontend",
9
- "rawSpec": "^1.2.0",
10
- "spec": ">=1.2.0 <2.0.0",
11
- "type": "range"
12
- },
4
+ "govuk-frontend@1.2.0",
13
5
  "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ"
14
6
  ]
15
7
  ],
16
- "_from": "govuk-frontend@>=1.2.0 <2.0.0",
8
+ "_from": "govuk-frontend@1.2.0",
17
9
  "_id": "govuk-frontend@1.2.0",
18
- "_inCache": true,
10
+ "_inBundle": false,
11
+ "_integrity": "sha512-pHKghu9J1nB7F/MKpiYaimPoJXUJdmMZUGuORv9K1Ek1sVNdTRlEKR+rogpfR4GkroS0tS1LMwQJrQkiCvxIIw==",
19
12
  "_location": "/govuk-frontend",
20
- "_nodeVersion": "8.9.4",
21
- "_npmOperationalInternal": {
22
- "host": "s3://npm-registry-packages",
23
- "tmp": "tmp/govuk-frontend_1.2.0_1532676432170_0.8460384917464794"
24
- },
25
- "_npmUser": {
26
- "name": "govuk-patterns-and-tools",
27
- "email": "design-system-pipeline@digital.cabinet-office.gov.uk"
28
- },
29
- "_npmVersion": "5.6.0",
30
13
  "_phantomChildren": {},
31
14
  "_requested": {
32
- "raw": "govuk-frontend@^1.2.0",
33
- "scope": null,
34
- "escapedName": "govuk-frontend",
15
+ "type": "version",
16
+ "registry": true,
17
+ "raw": "govuk-frontend@1.2.0",
35
18
  "name": "govuk-frontend",
36
- "rawSpec": "^1.2.0",
37
- "spec": ">=1.2.0 <2.0.0",
38
- "type": "range"
19
+ "escapedName": "govuk-frontend",
20
+ "rawSpec": "1.2.0",
21
+ "saveSpec": null,
22
+ "fetchSpec": "1.2.0"
39
23
  },
40
24
  "_requiredBy": [
41
25
  "/"
42
26
  ],
43
27
  "_resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-1.2.0.tgz",
44
- "_shasum": "a741364f903534755e134c0db6ac65a63a368592",
45
- "_shrinkwrap": null,
46
- "_spec": "govuk-frontend@^1.2.0",
28
+ "_spec": "1.2.0",
47
29
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
48
30
  "author": {
49
31
  "name": "GOV.UK Design System Team",
@@ -53,18 +35,7 @@
53
35
  "bugs": {
54
36
  "url": "https://github.com/alphagov/govuk-frontend/issues"
55
37
  },
56
- "dependencies": {},
57
38
  "description": "GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.",
58
- "devDependencies": {},
59
- "directories": {},
60
- "dist": {
61
- "integrity": "sha512-pHKghu9J1nB7F/MKpiYaimPoJXUJdmMZUGuORv9K1Ek1sVNdTRlEKR+rogpfR4GkroS0tS1LMwQJrQkiCvxIIw==",
62
- "shasum": "a741364f903534755e134c0db6ac65a63a368592",
63
- "tarball": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-1.2.0.tgz",
64
- "fileCount": 211,
65
- "unpackedSize": 1374381,
66
- "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWslQCRA9TVsSAnZWagAAJXcP/1FbQ/s+ZDBeLjmSgYGu\np+gLSDEO+V7kpNuSqAME0tS5JeJOEyj8IB0KoYASyENv08ezL2yXe7f+P8SX\nX3RIMa5QjYBxTP4ImhSlRUjCyygcoX3e4khOxzno1/+OCaTrz5Kv6CoADCRu\nmu0Lz0JtYSYFoxxfbxUUbSesmYlLvkzMtmL+uMkj0+BTT7VNynWLUEKfqR1f\n1hDJCDkG5ClwfOVt7EfjxN2Ih4q9hRrClLT3xZJFTzV9xP180tn06Yw9OoNL\nX32Ii63LVjvl6gIvUPXLkY7VgbqZ8q7Y4WfJaiNVNbYydq3lNxe+BN2WMwJ8\nNG0deFEHRiIqjhTp2cyWU3WeZyv7Ca7/9YdaeVPXmb3gN93UapVFVJdENV6H\nDgJ81kTFNy0PM7pnjbI06rOxvPVhSEwN2ChyV2Y3A5upVfNNh8isYmV62WP/\nTppqqLBjglQuAkc8L0CNQfR0iHBMDTNOh0qDYT6ITbmyC4++Ws6qqsCMV0Pt\naD9jwplH/KBMhwu4epX1z6OpFkL2B1gYKhy05bOVN5k+s0wkXZiu4nGMKKMP\nMz+twbyT4a5jiGpPkm+tzKHl22XQaLY7F6Qe1F9/mT9iikrryfWxaeIvxkUj\nitkfgq9467oxpglauyD8Zekss5MH0dOR4Er80H+uiK7zcIdMDIem/kjBetJ8\nx4F7\r\n=bd4f\r\n-----END PGP SIGNATURE-----\r\n"
67
- },
68
39
  "engines": {
69
40
  "node": ">= 4.2.0"
70
41
  },
@@ -77,15 +48,7 @@
77
48
  ],
78
49
  "license": "MIT",
79
50
  "main": "all.js",
80
- "maintainers": [
81
- {
82
- "name": "govuk-patterns-and-tools",
83
- "email": "design-system-pipeline@digital.cabinet-office.gov.uk"
84
- }
85
- ],
86
51
  "name": "govuk-frontend",
87
- "optionalDependencies": {},
88
- "readme": "ERROR: No README data found!",
89
52
  "repository": {
90
53
  "type": "git",
91
54
  "url": "git+https://github.com/alphagov/govuk-frontend.git"
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: 9.12.2
4
+ version: 9.13.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: 2018-08-10 00:00:00.000000000 Z
11
+ date: 2018-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -378,6 +378,7 @@ files:
378
378
  - app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss
379
379
  - app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss
380
380
  - app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss
381
+ - app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss
381
382
  - app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-navigation.scss
382
383
  - app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss
383
384
  - app/assets/stylesheets/govuk_publishing_components/components/_title.scss
@@ -482,6 +483,7 @@ files:
482
483
  - app/views/govuk_publishing_components/components/_subscription-links.html.erb
483
484
  - app/views/govuk_publishing_components/components/_success_alert.html.erb
484
485
  - app/views/govuk_publishing_components/components/_tabs.html.erb
486
+ - app/views/govuk_publishing_components/components/_taxonomy_list.html.erb
485
487
  - app/views/govuk_publishing_components/components/_taxonomy_navigation.html.erb
486
488
  - app/views/govuk_publishing_components/components/_textarea.html.erb
487
489
  - app/views/govuk_publishing_components/components/_title.html.erb
@@ -532,6 +534,7 @@ files:
532
534
  - app/views/govuk_publishing_components/components/docs/subscription-links.yml
533
535
  - app/views/govuk_publishing_components/components/docs/success_alert.yml
534
536
  - app/views/govuk_publishing_components/components/docs/tabs.yml
537
+ - app/views/govuk_publishing_components/components/docs/taxonomy_list.yml
535
538
  - app/views/govuk_publishing_components/components/docs/taxonomy_navigation.yml
536
539
  - app/views/govuk_publishing_components/components/docs/textarea.yml
537
540
  - app/views/govuk_publishing_components/components/docs/title.yml
@@ -580,6 +583,7 @@ files:
580
583
  - lib/govuk_publishing_components/presenters/services.rb
581
584
  - lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb
582
585
  - lib/govuk_publishing_components/presenters/subscription_links_helper.rb
586
+ - lib/govuk_publishing_components/presenters/taxonomy_list_helper.rb
583
587
  - lib/govuk_publishing_components/presenters/taxonomy_navigation.rb
584
588
  - lib/govuk_publishing_components/presenters/translation_nav_helper.rb
585
589
  - lib/govuk_publishing_components/version.rb