govuk_publishing_components 27.18.0 → 28.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-170.jpg +0 -0
  3. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-240.jpg +0 -0
  4. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-320.jpg +0 -0
  5. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-480.jpg +0 -0
  6. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26.jpg +0 -0
  7. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +2 -20
  8. data/app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js +21 -16
  9. data/app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js +46 -32
  10. data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +20 -7
  11. data/app/assets/javascripts/govuk_publishing_components/analytics/mailto-link-tracker.js +22 -17
  12. data/app/assets/javascripts/govuk_publishing_components/analytics/static-analytics.js +4 -4
  13. data/app/assets/javascripts/govuk_publishing_components/analytics.js +1 -1
  14. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +18 -18
  15. data/app/assets/javascripts/govuk_publishing_components/components/metadata.js +27 -0
  16. data/app/assets/javascripts/govuk_publishing_components/lib/extend-object.js +22 -0
  17. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -2
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +19 -14
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +6 -35
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +17 -7
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +34 -0
  22. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +7 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +6 -0
  24. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -1
  25. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -0
  26. data/app/views/govuk_publishing_components/components/_intervention.html.erb +10 -1
  27. data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -2
  28. data/app/views/govuk_publishing_components/components/_signup_link.html.erb +30 -0
  29. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +3 -3
  30. data/app/views/govuk_publishing_components/components/contextual_sidebar/_covid_cta.html.erb +27 -0
  31. data/app/views/govuk_publishing_components/components/docs/accordion.yml +31 -25
  32. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +15 -87
  33. data/app/views/govuk_publishing_components/components/docs/feedback.yml +5 -0
  34. data/app/views/govuk_publishing_components/components/docs/image_card.yml +29 -0
  35. data/app/views/govuk_publishing_components/components/docs/input.yml +1 -1
  36. data/app/views/govuk_publishing_components/components/docs/intervention.yml +9 -0
  37. data/app/views/govuk_publishing_components/components/docs/signup_link.yml +39 -0
  38. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +1 -1
  39. data/app/views/govuk_publishing_components/components/docs/tabs.yml +2 -2
  40. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +9 -6
  41. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +4 -3
  42. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +4 -4
  43. data/config/locales/ar.yml +0 -8
  44. data/config/locales/az.yml +0 -8
  45. data/config/locales/be.yml +0 -8
  46. data/config/locales/bg.yml +0 -8
  47. data/config/locales/bn.yml +0 -8
  48. data/config/locales/cs.yml +0 -8
  49. data/config/locales/cy.yml +0 -8
  50. data/config/locales/da.yml +0 -8
  51. data/config/locales/de.yml +0 -8
  52. data/config/locales/dr.yml +0 -8
  53. data/config/locales/el.yml +0 -8
  54. data/config/locales/en.yml +4 -10
  55. data/config/locales/es-419.yml +0 -8
  56. data/config/locales/es.yml +0 -8
  57. data/config/locales/et.yml +0 -8
  58. data/config/locales/fa.yml +0 -8
  59. data/config/locales/fi.yml +0 -8
  60. data/config/locales/fr.yml +0 -8
  61. data/config/locales/gd.yml +0 -8
  62. data/config/locales/gu.yml +0 -8
  63. data/config/locales/he.yml +0 -8
  64. data/config/locales/hi.yml +0 -8
  65. data/config/locales/hr.yml +0 -8
  66. data/config/locales/hu.yml +0 -8
  67. data/config/locales/hy.yml +0 -8
  68. data/config/locales/id.yml +0 -8
  69. data/config/locales/is.yml +0 -8
  70. data/config/locales/it.yml +0 -8
  71. data/config/locales/ja.yml +0 -8
  72. data/config/locales/ka.yml +0 -8
  73. data/config/locales/kk.yml +0 -8
  74. data/config/locales/ko.yml +0 -8
  75. data/config/locales/lt.yml +0 -8
  76. data/config/locales/lv.yml +0 -8
  77. data/config/locales/ms.yml +0 -8
  78. data/config/locales/mt.yml +0 -8
  79. data/config/locales/nl.yml +0 -8
  80. data/config/locales/no.yml +0 -8
  81. data/config/locales/pa-pk.yml +0 -8
  82. data/config/locales/pa.yml +0 -8
  83. data/config/locales/pl.yml +0 -8
  84. data/config/locales/ps.yml +0 -8
  85. data/config/locales/pt.yml +0 -8
  86. data/config/locales/ro.yml +0 -8
  87. data/config/locales/ru.yml +0 -8
  88. data/config/locales/si.yml +0 -8
  89. data/config/locales/sk.yml +0 -8
  90. data/config/locales/sl.yml +0 -8
  91. data/config/locales/so.yml +0 -8
  92. data/config/locales/sq.yml +0 -8
  93. data/config/locales/sr.yml +0 -8
  94. data/config/locales/sv.yml +0 -8
  95. data/config/locales/sw.yml +0 -8
  96. data/config/locales/ta.yml +0 -8
  97. data/config/locales/th.yml +0 -8
  98. data/config/locales/tk.yml +0 -8
  99. data/config/locales/tr.yml +0 -8
  100. data/config/locales/uk.yml +0 -8
  101. data/config/locales/ur.yml +0 -8
  102. data/config/locales/uz.yml +0 -8
  103. data/config/locales/vi.yml +0 -8
  104. data/config/locales/zh-hk.yml +0 -8
  105. data/config/locales/zh-tw.yml +0 -8
  106. data/config/locales/zh.yml +0 -8
  107. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +42 -170
  108. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +11 -1
  109. data/lib/govuk_publishing_components/version.rb +1 -1
  110. data/lib/govuk_publishing_components.rb +0 -2
  111. metadata +13 -15
  112. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +0 -237
  113. data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +0 -84
  114. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +0 -21
  115. data/app/views/govuk_publishing_components/components/_admin_analytics.html.erb +0 -20
  116. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +0 -86
  117. data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +0 -47
  118. data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +0 -30
  119. data/app/views/govuk_publishing_components/components/docs/admin_analytics.yml +0 -10
  120. data/app/views/govuk_publishing_components/components/docs/government_navigation.yml +0 -20
  121. data/app/views/govuk_publishing_components/components/docs/highlight_boxes.yml +0 -171
  122. data/app/views/govuk_publishing_components/components/docs/taxonomy_list.yml +0 -112
  123. data/lib/govuk_publishing_components/presenters/highlight_boxes_helper.rb +0 -13
  124. data/lib/govuk_publishing_components/presenters/taxonomy_list_helper.rb +0 -23
@@ -1,171 +0,0 @@
1
- name: Highlight boxes
2
- description: Displays content item details in a grid of highlight boxes, with a max of 3 items per row.
3
- body: |
4
- The highlight boxes have several optional flags which can be set:
5
-
6
- - Inverse - renders the highlight boxes as white text on a blue background
7
- - Featured - renders a specific highlight box with larger font size
8
- accessibility_criteria: |
9
- The highlight boxes must:
10
-
11
- - be visually distinct from other content on the page
12
- - have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
13
- shared_accessibility_criteria:
14
- - link
15
- examples:
16
- default:
17
- data:
18
- items:
19
- - link:
20
- text: If your child is taken into care
21
- path: /child-into-care
22
- metadata:
23
- document_type: Detailed guide
24
- - link:
25
- text: High needs funding
26
- path: /high-needs-funding
27
- metadata:
28
- document_type: Guide
29
- - link:
30
- text: Joint Statement of the 4th meeting of the UK-China High-Level People to People Dialogue
31
- path: /government/publications/joint-statement-of-the-4th-meeting-of-the-uk-china-high-level-people-to-people-dialogue
32
- metadata:
33
- document_type: Policy paper
34
- with_descriptions_and_metadata:
35
- data:
36
- items:
37
- - link:
38
- text: Becoming an apprentice
39
- path: /becoming-an-apprentice
40
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
41
- metadata:
42
- document_type: Speech
43
- organisation: DfE and Ofqual
44
- public_updated_at: 2016-06-27 10:29:44
45
- - link:
46
- text: Becoming an apprentice
47
- path: /becoming-an-apprentice
48
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
49
- metadata:
50
- document_type: Speech
51
- organisation: DfE and Ofqual
52
- public_updated_at: 2016-06-27 10:29:44
53
- - link:
54
- text: Becoming an apprentice
55
- path: /becoming-an-apprentice
56
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
57
- metadata:
58
- document_type: Speech
59
- organisation: DfE and Ofqual
60
- public_updated_at: 2016-06-27 10:29:44
61
- inverse:
62
- data:
63
- inverse: true
64
- items:
65
- - link:
66
- text: Becoming an apprentice
67
- path: /becoming-an-apprentice
68
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
69
- metadata:
70
- document_type: Speech
71
- organisation: DfE and Ofqual
72
- public_updated_at: 2016-06-27 10:29:44
73
- - link:
74
- text: Becoming an apprentice
75
- path: /becoming-an-apprentice
76
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
77
- metadata:
78
- document_type: Speech
79
- organisation: DfE and Ofqual
80
- public_updated_at: 2016-06-27 10:29:44
81
- - link:
82
- text: Becoming an apprentice
83
- path: /becoming-an-apprentice
84
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
85
- metadata:
86
- document_type: Speech
87
- organisation: DfE and Ofqual
88
- public_updated_at: 2016-06-27 10:29:44
89
- featured_card:
90
- description: "Used to highlight a specific content item within the highlight boxes, e.g: the most popular."
91
- data:
92
- items:
93
- - link:
94
- text: Becoming an apprentice
95
- path: /becoming-an-apprentice
96
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
97
- featured: true
98
- metadata:
99
- document_type: Speech
100
- organisation: DfE and Ofqual
101
- public_updated_at: 2016-06-27 10:29:44
102
- - link:
103
- text: Becoming an apprentice
104
- path: /becoming-an-apprentice
105
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
106
- metadata:
107
- document_type: Speech
108
- organisation: DfE and Ofqual
109
- public_updated_at: 2016-06-27 10:29:44
110
- half_width:
111
- description: The default component displays 3 highlight boxes in on row on desktop; 2 on tablet; and full-width on mobile. There are cases where we might want to show just two items per row even on desktop, for example two-third layouts.
112
- data:
113
- half_width: true
114
- items:
115
- - link:
116
- text: Becoming an apprentice
117
- path: /becoming-an-apprentice
118
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
119
- metadata:
120
- document_type: Speech
121
- organisation: DfE and Ofqual
122
- public_updated_at: 2016-06-27 10:29:44
123
- - link:
124
- text: Becoming an apprentice
125
- path: /becoming-an-apprentice
126
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
127
- metadata:
128
- document_type: Speech
129
- organisation: DfE and Ofqual
130
- public_updated_at: 2016-06-27 10:29:44
131
- - link:
132
- text: Becoming an apprentice
133
- path: /becoming-an-apprentice
134
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
135
- metadata:
136
- document_type: Speech
137
- organisation: DfE and Ofqual
138
- public_updated_at: 2016-06-27 10:29:44
139
- with_data_tracking_attributes:
140
- data:
141
- items:
142
- - link:
143
- text: Becoming an apprentice
144
- path: /becoming-an-apprentice
145
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
146
- data_attributes: {
147
- track_category: "servicesHighlightBoxClicked",
148
- track_action: 1,
149
- track_label: "/becoming-an-apprentice"
150
- }
151
- metadata:
152
- document_type: Speech
153
- organisation: DfE and Ofqual
154
- public_updated_at: 2016-06-27 10:29:44
155
- - link:
156
- text: Becoming an apprentice
157
- path: /becoming-an-apprentice
158
- description: Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship
159
- data_attributes: {
160
- track_category: "servicesHighlightBoxClicked",
161
- track_action: 2,
162
- track_label: "/becoming-an-apprentice",
163
- track_options: {
164
- dimension28: 2,
165
- dimension29: "Becoming an apprentice"
166
- }
167
- }
168
- metadata:
169
- document_type: Speech
170
- organisation: DfE and Ofqual
171
- public_updated_at: 2016-06-27 10:29:44
@@ -1,112 +0,0 @@
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:
71
- text: The Rt Hon
72
- - link:
73
- path: /not-a-page
74
- text: News headline
75
- heading_level: 0
76
- image:
77
- url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
78
- alt: some meaningful alt text please
79
- context:
80
- text: The Rt Hon
81
- - link:
82
- path: /not-a-page
83
- text: News headline
84
- heading_level: 0
85
- image:
86
- url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
87
- alt: some meaningful alt text please
88
- context:
89
- text: The Rt Hon
90
- - link:
91
- path: /not-a-page
92
- text: News headline
93
- heading_level: 0
94
- image:
95
- url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
96
- alt: some meaningful alt text please
97
- context:
98
- text: This is a document
99
- date: 2016-06-27 10:29:44
100
- document_list:
101
- items:
102
- - link:
103
- text: If your child is taken into care
104
- path: /child-into-care
105
- description: What happens if your child is taken into care
106
- metadata:
107
- document_type: Detailed guide
108
- - link:
109
- text: High needs funding
110
- path: /high-needs-funding
111
- metadata:
112
- document_type: Guide
@@ -1,13 +0,0 @@
1
- module GovukPublishingComponents
2
- module Presenters
3
- class HighlightBoxesHelper
4
- def initialize(options)
5
- @items = options[:items]
6
- end
7
-
8
- def data_tracking?
9
- @items.any? { |item| item[:link][:data_attributes] }
10
- end
11
- end
12
- end
13
- end
@@ -1,23 +0,0 @@
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],
18
- }
19
- end
20
- end
21
- end
22
- end
23
- end