govuk_publishing_components 21.54.0 → 21.55.4

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.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/action-link--nhs.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/action-link--nhs.svg +1 -0
  4. data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.png +0 -0
  5. data/app/assets/images/govuk_publishing_components/action-link-arrow--simple.png +0 -0
  6. data/app/assets/images/govuk_publishing_components/action-link-arrow.png +0 -0
  7. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +5 -4
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +38 -7
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +0 -38
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +1 -4
  11. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +47 -25
  12. data/app/views/govuk_publishing_components/components/_action_link.html.erb +23 -3
  13. data/app/views/govuk_publishing_components/components/docs/action_link.yml +43 -15
  14. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +7 -7
  15. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +1 -1
  16. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +7 -6
  17. data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +77 -0
  18. data/lib/govuk_publishing_components/presenters/schema_org.rb +24 -16
  19. data/lib/govuk_publishing_components/version.rb +1 -1
  20. data/node_modules/govuk-frontend/README.md +6 -6
  21. data/node_modules/govuk-frontend/govuk/_base.scss +3 -0
  22. data/node_modules/govuk-frontend/govuk/all.js +1 -1
  23. data/node_modules/govuk-frontend/govuk/all.scss +1 -3
  24. data/node_modules/govuk-frontend/govuk/components/_all.scss +31 -29
  25. data/node_modules/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -208
  26. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +207 -0
  27. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +1 -1
  28. data/node_modules/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -65
  29. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +112 -0
  30. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -118
  31. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +138 -0
  32. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +6 -0
  33. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +12 -1
  34. data/node_modules/govuk-frontend/govuk/components/button/_button.scss +2 -284
  35. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +280 -0
  36. data/node_modules/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -31
  37. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +28 -0
  38. data/node_modules/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -308
  39. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +304 -0
  40. data/node_modules/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -30
  41. data/node_modules/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
  42. data/node_modules/govuk-frontend/govuk/components/details/_details.scss +2 -88
  43. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +84 -0
  44. data/node_modules/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -15
  45. data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +11 -0
  46. data/node_modules/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -59
  47. data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +55 -0
  48. data/node_modules/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -68
  49. data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
  50. data/node_modules/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -81
  51. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +77 -0
  52. data/node_modules/govuk-frontend/govuk/components/footer/_footer.scss +2 -244
  53. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +238 -0
  54. data/node_modules/govuk-frontend/govuk/components/header/_header.scss +2 -318
  55. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +312 -0
  56. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +7 -1
  57. data/node_modules/govuk-frontend/govuk/components/header/template.njk +2 -2
  58. data/node_modules/govuk-frontend/govuk/components/hint/_hint.scss +2 -50
  59. data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +46 -0
  60. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +99 -0
  61. data/node_modules/govuk-frontend/govuk/components/input/_input.scss +2 -103
  62. data/node_modules/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
  63. data/node_modules/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -28
  64. data/node_modules/govuk-frontend/govuk/components/label/_index.scss +41 -0
  65. data/node_modules/govuk-frontend/govuk/components/label/_label.scss +2 -45
  66. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +40 -0
  67. data/node_modules/govuk-frontend/govuk/components/panel/_panel.scss +2 -44
  68. data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
  69. data/node_modules/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -31
  70. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +342 -0
  71. data/node_modules/govuk-frontend/govuk/components/radios/_radios.scss +2 -346
  72. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +53 -0
  73. data/node_modules/govuk-frontend/govuk/components/select/_select.scss +2 -57
  74. data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +33 -0
  75. data/node_modules/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -37
  76. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +153 -0
  77. data/node_modules/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -157
  78. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +50 -0
  79. data/node_modules/govuk-frontend/govuk/components/table/_table.scss +2 -54
  80. data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +138 -0
  81. data/node_modules/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -142
  82. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +87 -0
  83. data/node_modules/govuk-frontend/govuk/components/tag/_tag.scss +2 -91
  84. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +51 -0
  85. data/node_modules/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -55
  86. data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +56 -0
  87. data/node_modules/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -60
  88. data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +5 -3
  89. data/node_modules/govuk-frontend/govuk/core/_links.scss +5 -3
  90. data/node_modules/govuk-frontend/govuk/core/_lists.scss +17 -3
  91. data/node_modules/govuk-frontend/govuk/core/_section-break.scss +5 -3
  92. data/node_modules/govuk-frontend/govuk/core/_template.scss +5 -3
  93. data/node_modules/govuk-frontend/govuk/core/_typography.scss +5 -3
  94. data/node_modules/govuk-frontend/govuk/helpers/_clearfix.scss +1 -1
  95. data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +1 -1
  96. data/node_modules/govuk-frontend/govuk/helpers/_grid.scss +2 -1
  97. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -1
  98. data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -1
  99. data/node_modules/govuk-frontend/govuk/helpers/_shape-arrow.scss +1 -1
  100. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +1 -1
  101. data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +1 -1
  102. data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +1 -1
  103. data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +1 -3
  104. data/node_modules/govuk-frontend/govuk/objects/_grid.scss +1 -3
  105. data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +5 -3
  106. data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +2 -4
  107. data/node_modules/govuk-frontend/govuk/overrides/_display.scss +5 -3
  108. data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +5 -3
  109. data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +5 -3
  110. data/node_modules/govuk-frontend/govuk/overrides/_width.scss +5 -3
  111. data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +1 -1
  112. data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +1 -1
  113. data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +1 -1
  114. data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +1 -1
  115. data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +1 -1
  116. data/node_modules/govuk-frontend/govuk/tools/_px-to-em.scss +1 -1
  117. data/node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss +1 -1
  118. data/node_modules/govuk-frontend/package.json +21 -21
  119. metadata +49 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f56d2e2736866df3cdbc9707a0add0da3bf84b188b3f4fdfeb1f1c7b522e5585
4
- data.tar.gz: 6a03e5093606f297e742415fa87adad884d4529d15ad91296ba7651934415b1c
3
+ metadata.gz: 19ad2a3cf6f68efd7fe8140b3601107d25fff6dd67c3f05b8cde19a0a0cc74f9
4
+ data.tar.gz: 0bb67a7c588c7af08bfbb26159659f6801fece123836933755ba22fac236f3d6
5
5
  SHA512:
6
- metadata.gz: 7c463802fc7d7cf753bcae4d7501547af06be56fe0b1104587399834b439102da473a8b484d48b2e9a6d4c7baeed71ecf168118e30076ec9cc26f24fa51251b9
7
- data.tar.gz: ff4eaaa5ffd4e7b8e9fd071ac61b6aec2e0b316b17c3352372e44cba06fb58f740602bb6e0e56bbe031f6c21a80ff1db302ef0911abc130810904355d7698e0f
6
+ metadata.gz: d2ba559e148e74aec769f2fe1a4cdaa153703290c2c24da22b9607efe9930eba555fe31809f985d18fa481bb5213b24adbbb2bcda2d3b4baa754e7551c8e7e55
7
+ data.tar.gz: 8e84ad0c10264daf7b9a8898f513b9646db50ae1998b4ff3e723b1c45a2a122e135be33f1fbaa79e2dfae15def7fa939c6b162c1259c201b6603c868eefd4d22
@@ -0,0 +1 @@
1
+ <svg fill="none" height="227" viewBox="0 0 227 227" width="227" xmlns="http://www.w3.org/2000/svg"><path d="m55.7 226.5c-30.4 0-55.2-24.8-55.2-55.2v-115.6c0-30.4 24.8-55.2 55.2-55.2h115.6c30.4 0 55.2 24.8 55.2 55.2v115.6c0 30.4-24.8 55.2-55.2 55.2z" fill="#0ba23b"/><path d="m171.3 1c30.2 0 54.7 24.5 54.7 54.7v115.6c0 30.2-24.5 54.7-54.7 54.7h-115.6c-30.2 0-54.7-24.5-54.7-54.7v-115.6c0-30.2 24.5-54.7 54.7-54.7zm0-1h-115.6c-30.7 0-55.7 25-55.7 55.7v115.6c0 30.7 25 55.7 55.7 55.7h115.6c30.7 0 55.7-25 55.7-55.7v-115.6c0-30.7-25-55.7-55.7-55.7z" fill="#0ba23b"/><path d="m113.5 52.7-.5-.3-112 112v6.9c0 7.3 1.5 14.3 4.1 20.7l107.9-107.9.5.3 108.2 108.2c2.8-6.5 4.3-13.8 4.3-21.3v-6.1z" fill="#fcf411"/><path d="m171.3 1h-3l57.7 57.7v-3c0-30.2-24.5-54.7-54.7-54.7z" fill="#fcf411"/><path d="m57.8 1h-2.1c-30.2 0-54.7 24.5-54.7 54.7v2.1z" fill="#fcf411"/><path d="m226 94.5-93.5-93.5h-38.8l-92.7 92.7v31.7l112-112 .5.3 112.5 112.5z" fill="#fcf411"/><path d="m205.8 213.8-92.3-92.3-.5-.3-92.2002 92.2c6 5 13.1 8.7 20.9 10.8l71.3002-71.3.5.3 71.1 71.1c7.9-1.9 15.1-5.6 21.2-10.5z" fill="#fcf411"/><path d="m112.1 188.3 1 1 .8-.8z" fill="#fcf411"/><path d="m149.8 226-36.7-36.7-36.7001 36.7z" fill="#fcf411"/><path d="m166.5 213.1h-106.0001c-25.7 0-46.6-20.9-46.6-46.6v-106c0-25.7 20.9-46.6 46.6-46.6h106.0001c25.7 0 46.6 20.9 46.6 46.6v106c0 25.7-20.9 46.6-46.6 46.6z" fill="#0071b9"/><g fill="#fff"><path d="m56.2998 56.7v48.5h119.7002v-48.5zm26.9 43.7-8.2-27h-.1l-5.4 27h-9.8l8.3-39h13l8 27.1h.1l5.5-27.1h9.8002l-8.3002 39zm39.7002 0 3.5-16.7h-12.3l-3.5 16.7h-10.4l8.1-39h10.5l-3.1 14.9h12.3l3.1-14.9h10.5l-8.1 39zm46.1-30.2c-2.7-1.2-5.6-1.8-8.6-1.8-4.1 0-7.5.6-7.5 3.7 0 5.5 15.1 3.5 15.1 15.3 0 10.8-10 13.6-19.1 13.6-4.1-.1-8.2-.8-12.1-2l2.4-7.9c2.1 1.3 6.2 2.2 9.6 2.2s8.3-.6 8.3-4.6c0-6.3-15.1-3.9-15.1-14.9 0-10.1 8.8-13.1 17.4-13.1 4.8 0 9.3.5 12 1.7z"/><path d="m50.5001 156.8c-.6.4-1.6.6-3 .9-1.3.2-2.8.3-4.3.3-2.6 0-4.9-.4-6.8-1.3s-3.6-2.1-4.9-3.7-2.3-3.4-2.9-5.5c-.7-2.1-1-4.4-1-6.9s.3-4.8 1-6.9 1.6-4 2.9-5.5c1.3-1.6 2.9-2.8 4.8-3.7s4.2-1.3 6.7-1.3c1.7 0 3.3.2 4.6.5s2.3.6 2.9.9l-.3 5.6c-.6-.3-1.5-.7-2.5-1.2s-2.3-.7-3.9-.7c-1.3 0-2.5.2-3.7.7-1.1.5-2.2 1.2-3 2.2-.9 1-1.6 2.3-2.1 3.8-.5 1.6-.8 3.4-.8 5.6s.3 4.1.8 5.6c.5 1.6 1.2 2.8 2.1 3.8s1.9 1.7 3 2.2 2.4.7 3.7.7c1.5 0 2.8-.2 3.8-.5s1.9-.7 2.6-1.3z"/><path d="m52.6001 140.6c0-3 .4-5.7 1.1-7.9s1.7-4 3-5.4c1.2-1.4 2.7-2.5 4.3-3.1 1.6-.7 3.3-1 5.1-1s3.4.3 5.1 1c1.6.7 3.1 1.7 4.3 3.1s2.2 3.2 3 5.4c.7 2.2 1.1 4.8 1.1 7.9 0 3-.4 5.7-1.1 7.9s-1.7 4-3 5.4c-1.2 1.4-2.7 2.5-4.3 3.1-1.6.7-3.3 1-5.1 1s-3.4-.3-5.1-1c-1.6-.7-3.1-1.7-4.3-3.1s-2.2-3.2-3-5.4c-.7-2.3-1.1-4.9-1.1-7.9zm6.4 0c0 2.3.2 4.3.6 5.9s.9 2.9 1.5 3.9 1.4 1.7 2.3 2.2 1.8.7 2.8.7 1.9-.2 2.8-.7 1.6-1.2 2.3-2.2c.6-1 1.1-2.3 1.5-3.9s.6-3.6.6-5.9-.2-4.3-.6-5.9-.9-2.9-1.5-3.9-1.4-1.7-2.3-2.2-1.8-.7-2.8-.7-1.9.2-2.8.7-1.6 1.2-2.3 2.2c-.6 1-1.1 2.3-1.5 3.9s-.6 3.5-.6 5.9z"/><path d="m80.3003 123.6h6.7l6.8 26.1h.1l6.9997-26.1h6.4l-10.2997 33.9h-6.6z"/><path d="m110.4 123.6h6.2v33.9h-6.2z"/><path d="m122.6 123.6h8.8c5.3 0 9.4 1.4 12.1 4.2s4.1 7.1 4.1 12.7c0 2.8-.4 5.3-1.2 7.5-.8 2.1-1.9 3.9-3.4 5.3-1.4 1.4-3.1 2.5-5.1 3.2s-4.1 1-6.5 1h-8.8zm6.2 29.2h2.1c1.7 0 3.3-.3 4.5-.9 1.3-.6 2.3-1.4 3.2-2.5s1.4-2.4 1.8-3.9.6-3.2.6-5-.2-3.5-.6-5-1-2.8-1.8-3.9-1.9-1.9-3.2-2.5-2.8-.8-4.5-.8h-2.1z"/><path d="m152 141.2h11.2v5h-11.2z"/><path d="m170.7 130.8-4.5 4.2-2.9-4.2 8.3-7.2h5.1v33.9h-6z"/><path d="m183.8 151.8c.6.3 1.3.6 2.2.9.9.4 2 .5 3.4.5 1.7 0 3-.4 4-1.2s1.8-1.8 2.3-2.9.9-2.4 1.1-3.7.3-2.5.4-3.5l-.1-.1c-.6.9-1.4 1.7-2.3 2.4-1 .7-2.3 1-3.9 1-1.2 0-2.3-.2-3.4-.7s-2-1.1-2.9-2.1-1.5-2.1-2-3.4c-.5-1.4-.8-3-.8-4.8 0-1.7.2-3.2.7-4.6.4-1.4 1.1-2.5 1.9-3.5s1.9-1.7 3.1-2.2 2.7-.8 4.3-.8c2.2 0 4 .4 5.4 1.2s2.5 2 3.4 3.4c.8 1.4 1.4 3.1 1.8 5.1.3 1.9.5 4 .5 6.1 0 2.5-.2 4.9-.6 7.2s-1.1 4.3-2.1 6.1c-1 1.7-2.3 3.1-4 4.2s-3.8 1.6-6.4 1.6c-1.6 0-2.8-.1-3.9-.4-1-.3-1.8-.5-2.4-.8zm4.1-17.7c0 1.8.3 3.4 1 4.6s1.8 1.8 3.4 1.8c1.5 0 2.5-.6 3.3-1.7.7-1.1 1.1-2.7 1.1-4.6 0-2-.3-3.6-1-4.7s-1.8-1.7-3.3-1.7c-1.6 0-2.7.6-3.4 1.7-.7 1-1.1 2.6-1.1 4.6z"/></g></svg>
@@ -109,6 +109,8 @@
109
109
  event.target.f.title = videoTitle + ' (video)'
110
110
  },
111
111
  onStateChange: function (event) {
112
+ var eventData = event.data
113
+ var eventTarget = event.target
112
114
  var states = {
113
115
  "-1": "VideoUnstarted",
114
116
  "0": "VideoEnded",
@@ -117,14 +119,13 @@
117
119
  "3": "VideoBuffering",
118
120
  "5": "VideoCued"
119
121
  }
120
-
121
- if (states[event.data] && options.tracking && options.tracking.hasTracking
122
+ if (states[eventData] && options.tracking && options.tracking.hasTracking
122
123
  && window.GOVUK.analytics && window.GOVUK.analytics.trackEvent)
123
124
  {
124
125
  var tracking = {
125
126
  category: options.tracking.category,
126
- action: states[event.data],
127
- label: { transport: 'beacon', label: event.target.getVideoUrl() }
127
+ action: states[eventData],
128
+ label: { transport: 'beacon', label: eventTarget.getVideoData && eventTarget.getVideoData().title }
128
129
  }
129
130
 
130
131
  window.GOVUK.analytics.trackEvent(tracking.category, tracking.action, tracking.label)
@@ -7,8 +7,8 @@
7
7
  width: 50px;
8
8
  height: 45px;
9
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");
10
+ background: image-url("govuk_publishing_components/action-link-arrow.png");
11
+ background: image-url("govuk_publishing_components/action-link-arrow.svg"), linear-gradient(transparent, transparent);
12
12
  // sass-lint:enable no-duplicate-properties
13
13
  background-repeat: no-repeat;
14
14
  background-position: 0 50%;
@@ -63,6 +63,20 @@
63
63
  }
64
64
  }
65
65
 
66
+ .gem-c-action-link--mobile-subtext {
67
+ .gem-c-action-link__subtext-wrapper {
68
+ display: block;
69
+ }
70
+
71
+ .gem-c-action-link__subtext {
72
+ padding: 0;
73
+
74
+ &:before {
75
+ display: none;
76
+ }
77
+ }
78
+ }
79
+
66
80
  .gem-c-action-link__subtext {
67
81
  @include govuk-font(19);
68
82
  display: block;
@@ -90,9 +104,10 @@
90
104
  width: 30px;
91
105
  height: 30px;
92
106
  // sass-lint:disable no-duplicate-properties
93
- background-image: image-url("govuk_publishing_components/action-link-arrow--simple.png");
94
- background-image: image-url("govuk_publishing_components/action-link-arrow--simple.svg");
107
+ background: image-url("govuk_publishing_components/action-link-arrow--simple.png");
108
+ background: image-url("govuk_publishing_components/action-link-arrow--simple.svg"), linear-gradient(transparent, transparent);
95
109
  // sass-lint:enable no-duplicate-properties
110
+ background-repeat: no-repeat;
96
111
  background-size: 25px auto;
97
112
  background-position: 0 2px;
98
113
  }
@@ -113,9 +128,10 @@
113
128
  width: 30px;
114
129
  height: 30px;
115
130
  // sass-lint:disable no-duplicate-properties
116
- background-image: image-url("govuk_publishing_components/action-link-arrow--dark.png");
117
- background-image: image-url("govuk_publishing_components/action-link-arrow--dark.svg");
131
+ background: image-url("govuk_publishing_components/action-link-arrow--dark.png");
132
+ background: image-url("govuk_publishing_components/action-link-arrow--dark.svg"), linear-gradient(transparent, transparent);
118
133
  // sass-lint:enable no-duplicate-properties
134
+ background-repeat: no-repeat;
119
135
  background-size: 25px auto;
120
136
  background-position: 0 2px;
121
137
  }
@@ -125,10 +141,25 @@
125
141
  }
126
142
  }
127
143
 
144
+ .gem-c-action-link--nhs {
145
+ &:before {
146
+ width: 80px;
147
+ height: 70px;
148
+ // sass-lint:disable no-duplicate-properties
149
+ background: image-url("govuk_publishing_components/action-link--nhs.png");
150
+ background: image-url("govuk_publishing_components/action-link--nhs.svg"), linear-gradient(transparent, transparent);
151
+ // sass-lint:enable no-duplicate-properties
152
+ background-repeat: no-repeat;
153
+ background-size: 85% auto;
154
+ background-position: 0 50%;
155
+ }
156
+ }
157
+
128
158
  .gem-c-action-link--light-text {
129
159
  color: govuk-colour("white");
130
160
 
131
- .gem-c-action-link__link {
161
+ .gem-c-action-link__link,
162
+ .gem-c-action-link__subtext-link {
132
163
  text-decoration: underline;
133
164
 
134
165
  &:link,
@@ -1,39 +1 @@
1
1
  @import "govuk/components/back-link/back-link";
2
-
3
- .govuk-back-link {
4
- &[href] {
5
- text-decoration: underline;
6
- border-bottom: 1px solid transparent;
7
-
8
- &:focus {
9
- text-decoration: none;
10
- }
11
- }
12
-
13
- &:before {
14
- content: "";
15
- display: block;
16
- position: absolute;
17
- top: 0;
18
- bottom: 1px;
19
- left: 3px;
20
- width: 7px;
21
- height: 7px;
22
- -webkit-transform: rotate(225deg);
23
- -ms-transform: rotate(225deg);
24
- transform: rotate(225deg);
25
- border: solid;
26
- border-width: 1px 1px 0 0;
27
- clip-path: inherit;
28
- -webkit-clip-path: inherit;
29
- }
30
- }
31
-
32
- .govuk-back-link::after {
33
- content: "";
34
- position: absolute;
35
- top: -14px;
36
- right: 0;
37
- left: 0;
38
- bottom: -14px;
39
- }
@@ -1,8 +1,6 @@
1
1
  .gem-c-feedback {
2
2
  background: govuk-colour("white");
3
- margin: govuk-spacing(6) auto 0 auto;
4
- max-width: $govuk-page-width;
5
- position: relative;
3
+ margin-top: govuk-spacing(6);
6
4
 
7
5
  @include govuk-media-query($from: tablet) {
8
6
  margin-top: govuk-spacing(9);
@@ -182,7 +180,6 @@
182
180
  }
183
181
 
184
182
  .gem-c-feedback__form {
185
- margin: govuk-spacing(3) govuk-spacing(2) 0 govuk-spacing(2);
186
183
  padding: govuk-spacing(3) 0;
187
184
  border-top: govuk-spacing(2) solid govuk-colour("blue");
188
185
 
@@ -2,6 +2,8 @@ module GovukPublishingComponents
2
2
  class ComponentGuideController < GovukPublishingComponents::ApplicationController
3
3
  append_view_path File.join(Rails.root, "app", "views", GovukPublishingComponents::Config.component_directory_name)
4
4
 
5
+ MATCH_COMPONENTS = /(?<=govuk_publishing_components\/components\/)[\/a-zA-Z_-]+(?=['"])/.freeze
6
+
5
7
  def index
6
8
  @application_path = Rails.root
7
9
  @component_gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
@@ -47,16 +49,7 @@ module GovukPublishingComponents
47
49
  additional_files = "@import 'govuk_publishing_components/govuk_frontend_support';\n"
48
50
  additional_files << "@import 'govuk_publishing_components/component_support';\n" unless print_styles
49
51
 
50
- components = components_in_use
51
- extra_components = []
52
-
53
- components.each do |component|
54
- components_in_component = components_within_component(component)
55
- extra_components << components_in_component
56
- end
57
-
58
- components << extra_components.compact
59
- components = components.flatten.uniq.sort
52
+ components = find_all_partials_in(components_in_use)
60
53
 
61
54
  components.map { |component|
62
55
  "@import 'govuk_publishing_components/components/#{print_path}#{component.gsub('_', '-')}';" if component_has_sass_file(component.gsub("_", "-"), print_styles)
@@ -66,16 +59,7 @@ module GovukPublishingComponents
66
59
  def components_in_use_js
67
60
  additional_files = "//= require govuk_publishing_components/lib\n"
68
61
 
69
- components = components_in_use
70
- extra_components = []
71
-
72
- components.each do |component|
73
- components_in_component = components_within_component(component)
74
- extra_components << components_in_component
75
- end
76
-
77
- components << extra_components.compact
78
- components = components.flatten.uniq.sort
62
+ components = find_all_partials_in(components_in_use)
79
63
 
80
64
  components.map { |component|
81
65
  "//= require govuk_publishing_components/components/#{component.gsub('_', '-')}" if component_has_js_file(component.gsub("_", "-"))
@@ -104,10 +88,43 @@ module GovukPublishingComponents
104
88
 
105
89
  files.each do |file|
106
90
  data = File.read(file)
107
- matches << data.scan(/(govuk_publishing_components\/components\/[a-z_-]+)/)
91
+ matches << data.scan(MATCH_COMPONENTS)
108
92
  end
109
93
 
110
- matches.flatten.uniq.map(&:to_s).sort.map { |m| m.gsub("govuk_publishing_components/components/", "") }
94
+ matches.flatten.uniq.map(&:to_s).sort
95
+ end
96
+
97
+ def find_all_partials_in(templates)
98
+ components = [templates]
99
+
100
+ templates.each do |template|
101
+ partials_found = true
102
+ components_to_search = [template]
103
+ components_found = []
104
+
105
+ while partials_found
106
+ extra_components = find_partials_in(components_to_search)
107
+
108
+ if extra_components.any?
109
+ components_found << extra_components
110
+ components_to_search = extra_components
111
+ else
112
+ partials_found = false
113
+ components << components_found.uniq.sort if components_found.any?
114
+ end
115
+ end
116
+ end
117
+
118
+ components.flatten.uniq.sort
119
+ end
120
+
121
+ def find_partials_in(components)
122
+ extra_components = []
123
+ components.each do |component|
124
+ extra_components << components_within_component(component)
125
+ end
126
+
127
+ extra_components.flatten.uniq.sort
111
128
  end
112
129
 
113
130
  def component_has_sass_file(component, print_styles)
@@ -120,9 +137,14 @@ module GovukPublishingComponents
120
137
  end
121
138
 
122
139
  def components_within_component(component)
123
- data = File.read(@component_gem_path + "/app/views/govuk_publishing_components/components/_#{component}.html.erb")
124
- match = data.scan(/(govuk_publishing_components\/components\/[a-z_-]+)/)
125
- match.flatten.uniq.map(&:to_s).sort.map { |m| m.gsub("govuk_publishing_components/components/", "") }
140
+ filename = @component_gem_path + "/app/views/govuk_publishing_components/components/#{component}.html.erb"
141
+ filename = filename.sub(/.*\K\//, "/_") # files begin with _ but the method may have been passed 'filename' or 'dir/partial'
142
+
143
+ return [] unless File.file?(filename)
144
+
145
+ data = File.read(filename)
146
+ match = data.scan(MATCH_COMPONENTS)
147
+ match.flatten.uniq.map(&:to_s).sort
126
148
  end
127
149
 
128
150
  def index_breadcrumb
@@ -6,34 +6,54 @@
6
6
  nowrap_text ||= false
7
7
  href ||= false
8
8
  subtext ||= false
9
+ subtext_href ||= false
10
+ mobile_subtext ||= false
9
11
  light_text ||= false
10
12
  simple ||= false
11
13
  dark_icon ||= false
14
+ nhs_icon ||= false
12
15
  data ||= nil
13
16
  classes ||= nil
14
17
 
15
18
  css_classes = %w(gem-c-action-link)
16
19
  css_classes << "gem-c-action-link--light-text" if light_text
17
20
  css_classes << "gem-c-action-link--dark-icon" if dark_icon
21
+ css_classes << "gem-c-action-link--nhs" if nhs_icon
18
22
  css_classes << "gem-c-action-link--simple" if simple
19
23
  css_classes << "gem-c-action-link--with-subtext" if subtext
24
+ css_classes << "gem-c-action-link--mobile-subtext" if mobile_subtext
20
25
  css_classes << (shared_helper.get_margin_bottom)
21
26
 
22
27
  link_classes = %w(govuk-link gem-c-action-link__link)
23
28
  link_classes << shared_helper.classes if classes
24
29
  %>
25
- <% if href.present? && text.present? %>
30
+ <% if text.present? %>
26
31
  <div class="<%= css_classes.join(' ') %>">
27
32
  <% contents = capture do %>
28
33
  <span class="gem-c-action-link__link-wrapper">
29
- <%= link_to href, :class => link_classes, :data => data do %>
34
+ <% main_text = capture do %>
30
35
  <%= text %>
31
36
  <%= content_tag(:span, nowrap_text, class: "gem-c-action-link__nowrap-text") if nowrap_text %>
32
37
  <% end %>
38
+
39
+ <% if href.present? %>
40
+ <%= link_to href, class: link_classes, data: data do %>
41
+ <%= main_text %>
42
+ <% end %>
43
+ <% else %>
44
+ <%= main_text %>
45
+ <% end %>
33
46
  </span>
47
+
34
48
  <% if subtext %>
35
49
  <span class="gem-c-action-link__subtext-wrapper">
36
- <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") %>
50
+ <% if subtext_href %>
51
+ <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") do %>
52
+ <%= link_to subtext, subtext_href, class: "gem-c-action-link__subtext-link govuk-link", data: data %>
53
+ <% end %>
54
+ <% else %>
55
+ <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") %>
56
+ <% end %>
37
57
  </span>
38
58
  <% end %>
39
59
  <% end %>
@@ -6,56 +6,84 @@ examples:
6
6
  default:
7
7
  data:
8
8
  text: Go to NHS 111 online
9
- href: '/my-test-page'
9
+ href: "/page"
10
10
  with_bottom_margin:
11
11
  data:
12
12
  text: Look at this margin
13
- href: '/my-test-page'
13
+ href: "/page"
14
14
  margin_bottom: 9
15
15
  with_data_attributes:
16
16
  data:
17
17
  text: "Coronavirus (COVID-19)"
18
- href: '/my-test-page'
18
+ href: "/page"
19
19
  data:
20
20
  attr_test: "hasDataAttribute"
21
21
  with_js_classes:
22
22
  description: Use `js-` prefixed classes only as interaction hooks – to query and operate on elements via JavaScript. Classes are added to the link itself.
23
23
  data:
24
24
  text: "Coronavirus (COVID-19)"
25
- href: '/my-test-page'
25
+ href: "/page"
26
26
  classes: 'js-hook'
27
27
  with_no_wrapping_text:
28
28
  data:
29
29
  text: "Coronavirus (COVID-19):"
30
30
  nowrap_text: what you need to do
31
- href: '/my-test-page'
31
+ href: "/page"
32
32
  with_light_text:
33
33
  data:
34
34
  text: "Coronavirus (COVID-19)"
35
- href: '/my-test-page'
35
+ href: "/page"
36
36
  light_text: true
37
37
  context:
38
38
  dark_background: true
39
39
  with_subtext:
40
40
  data:
41
- text: "Emergency something"
42
- href: '/page'
43
- subtext: "This is about the emergency"
41
+ text: Emergency something
42
+ href: "/page"
43
+ subtext: This is about the emergency
44
44
  with_subtext_on_a_dark_background:
45
45
  data:
46
- text: "Emergency something"
47
- href: '/page'
48
- subtext: "This is about the emergency that is happening right now unfortunately so pay attention"
46
+ text: Emergency something
47
+ href: "/page"
48
+ subtext: This is about the emergency that is happening right now unfortunately so pay attention
49
+ light_text: true
50
+ context:
51
+ dark_background: true
52
+ mobile_subtext:
53
+ description: Lock the subtext beneath the main text, so the component with subtext always appears as it does on mobile.
54
+ data:
55
+ text: Try not to panic now
56
+ href: "/page"
57
+ subtext: "The thing that is happening is pretty scary but we'll get through it"
58
+ mobile_subtext: true
59
+ with_link_on_subtext:
60
+ description: The subtext can also be a link if required. The link on the main text is optional.
61
+ data:
62
+ text: Remain calm
63
+ subtext: Better things are ahead
64
+ subtext_href: "/page"
65
+ with_link_on_subtext_on_a_dark_background:
66
+ data:
67
+ text: Remain calm
68
+ subtext: Better things are ahead
69
+ subtext_href: "/page"
49
70
  light_text: true
50
71
  context:
51
72
  dark_background: true
52
73
  simple_arrow:
53
74
  data:
54
- text: "Getting financial help and keeping your business safe"
75
+ text: Getting financial help and keeping your business safe
55
76
  href: "/financial-help"
56
77
  simple: true
57
78
  with_dark_icon:
58
79
  data:
59
- text: "Coronavirus (COVID-19)"
60
- href: '/my-test-page'
80
+ text: Coronavirus (COVID-19)
81
+ href: "/my-test-page"
61
82
  dark_icon: true
83
+ with_nhs_icon:
84
+ data:
85
+ text: Something about the NHS
86
+ subtext: Perhaps you'd like to click here
87
+ subtext_href: "/page"
88
+ mobile_subtext: true
89
+ nhs_icon: true