govuk_publishing_components 21.50.1 → 21.54.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/all_components.js +1 -3
  3. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +3 -0
  4. data/app/assets/javascripts/govuk_publishing_components/components/button.js +5 -0
  5. data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +3 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +2 -1
  7. data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +3 -0
  8. data/app/assets/javascripts/govuk_publishing_components/components/header.js +5 -0
  9. data/app/assets/javascripts/govuk_publishing_components/components/radio.js +3 -0
  10. data/app/assets/javascripts/govuk_publishing_components/components/tabs.js +5 -0
  11. data/app/assets/javascripts/govuk_publishing_components/lib.js +1 -0
  12. data/app/assets/javascripts/govuk_publishing_components/modules.js +15 -3
  13. data/app/assets/stylesheets/component_guide/application.scss +0 -7
  14. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +4 -13
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +13 -4
  16. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +0 -3
  18. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +24 -0
  19. data/app/views/govuk_publishing_components/component_guide/index.html.erb +8 -1
  20. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +5 -36
  21. data/app/views/govuk_publishing_components/components/_input.html.erb +12 -1
  22. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +28 -8
  23. data/app/views/govuk_publishing_components/components/docs/input.yml +9 -0
  24. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +23 -0
  25. data/lib/govuk_publishing_components.rb +1 -0
  26. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +107 -0
  27. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +26 -9
  28. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb +1 -3
  29. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +40 -19
  30. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +5 -29
  31. data/lib/govuk_publishing_components/version.rb +1 -1
  32. data/node_modules/axe-core/CHANGELOG.md +6 -0
  33. data/node_modules/axe-core/axe.js +19 -3
  34. data/node_modules/axe-core/axe.min.js +2 -2
  35. data/node_modules/axe-core/bower.json +1 -1
  36. data/node_modules/axe-core/lib/commons/dom/get-element-stack.js +27 -1
  37. data/node_modules/axe-core/package.json +21 -21
  38. data/node_modules/axe-core/sri-history.json +4 -0
  39. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aba7af8d97c47a66a1cc2e94b2140a16a7575f106405043722de56e026f48818
4
- data.tar.gz: 9ef24b3f37b401f85f3c83bb77c34b6a86291016082ff489decbd07ec2618002
3
+ metadata.gz: f56d2e2736866df3cdbc9707a0add0da3bf84b188b3f4fdfeb1f1c7b522e5585
4
+ data.tar.gz: 6a03e5093606f297e742415fa87adad884d4529d15ad91296ba7651934415b1c
5
5
  SHA512:
6
- metadata.gz: 9cef0d13da3a06b72d2120250fdc957bc060452a324ea86927bd87d93a1ad9401ce3c7dc9e778c3f668535309f904acd1d275a5ff11f1a5ebca7a2456cbf0543
7
- data.tar.gz: b80eed8af5d8b9d830d8d02acd65a81e3d5b0e089bf4d100b2694f2ccd6621dddb34e2f86adc2a66623a59faef85f623a2305976083d90cbce2930fa4947f8d6
6
+ metadata.gz: 7c463802fc7d7cf753bcae4d7501547af06be56fe0b1104587399834b439102da473a8b484d48b2e9a6d4c7baeed71ecf168118e30076ec9cc26f24fa51251b9
7
+ data.tar.gz: ff4eaaa5ffd4e7b8e9fd071ac61b6aec2e0b316b17c3352372e44cba06fb58f740602bb6e0e56bbe031f6c21a80ff1db302ef0911abc130810904355d7698e0f
@@ -1,6 +1,4 @@
1
1
  // = require_tree ./lib
2
2
  // = require_tree ./components
3
- // = require govuk/all.js
4
3
 
5
- // Initialise all GOVUKFrontend components
6
- window.GOVUKFrontend.initAll()
4
+ window.GOVUKFrontend.initAll = function () {}
@@ -1,2 +1,5 @@
1
1
  // This component relies on JavaScript from GOV.UK Frontend
2
2
  // = require govuk/components/accordion/accordion.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.Accordion = window.GOVUKFrontend
@@ -0,0 +1,5 @@
1
+ // This component relies on JavaScript from GOV.UK Frontend
2
+ // = require govuk/components/button/button.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.Button = window.GOVUKFrontend
@@ -1,2 +1,5 @@
1
1
  // This component relies on JavaScript from GOV.UK Frontend
2
2
  // = require govuk/components/character-count/character-count.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.CharacterCount = window.GOVUKFrontend
@@ -1,7 +1,8 @@
1
1
  /* eslint-env jquery */
2
2
  // = require govuk/components/checkboxes/checkboxes.js
3
3
  window.GOVUK = window.GOVUK || {}
4
- window.GOVUK.Modules = window.GOVUK.Modules || {};
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.Checkboxes = window.GOVUKFrontend;
5
6
 
6
7
  (function (Modules) {
7
8
  'use strict'
@@ -1,2 +1,5 @@
1
1
  // This component relies on JavaScript from GOV.UK Frontend
2
2
  // = require govuk/components/error-summary/error-summary.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.ErrorSummary = window.GOVUKFrontend
@@ -0,0 +1,5 @@
1
+ // This component relies on JavaScript from GOV.UK Frontend
2
+ // = require govuk/components/header/header.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.Header = window.GOVUKFrontend
@@ -1,2 +1,5 @@
1
1
  // This component relies on JavaScript from GOV.UK Frontend
2
2
  // = require govuk/components/radios/radios.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.Radios = window.GOVUKFrontend
@@ -0,0 +1,5 @@
1
+ // This component relies on JavaScript from GOV.UK Frontend
2
+ // = require govuk/components/tabs/tabs.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.Tabs = window.GOVUKFrontend
@@ -0,0 +1 @@
1
+ // = require_tree ./lib
@@ -28,13 +28,25 @@
28
28
  for (var i = 0, l = modules.length; i < l; i++) {
29
29
  var module
30
30
  var element = $(modules[i])
31
- var type = camelCaseAndCapitalise(element.data('module'))
31
+ var moduleName = camelCaseAndCapitalise(element.data('module'))
32
32
  var started = element.data('module-started')
33
+ var frontendModuleName = moduleName.replace('Govuk', '')
33
34
 
34
- if (typeof GOVUK.Modules[type] === 'function' && !started) {
35
- module = new GOVUK.Modules[type]()
35
+ if ( // GOV.UK Publishing & Legacy Modules
36
+ typeof GOVUK.Modules[moduleName] === 'function' &&
37
+ !GOVUK.Modules[moduleName].prototype.init &&
38
+ !started
39
+ ) {
40
+ module = new GOVUK.Modules[moduleName]()
36
41
  module.start(element)
37
42
  element.data('module-started', true)
43
+ } else if ( // GOV.UK Frontend Modules
44
+ typeof GOVUK.Modules[frontendModuleName] === 'function' &&
45
+ GOVUK.Modules[frontendModuleName].prototype.init &&
46
+ !started
47
+ ) {
48
+ module = new GOVUK.Modules[frontendModuleName](element[0]).init()
49
+ element.data('module-started', true)
38
50
  }
39
51
  }
40
52
 
@@ -1,12 +1,5 @@
1
1
  // This file contains the styles for the Component Guide.
2
2
 
3
- @import "govuk_publishing_components/components/helpers/govuk-frontend-settings";
4
- @import "govuk_publishing_components/components/helpers/markdown-typography";
5
- @import "govuk/settings/all";
6
- @import "govuk/tools/all";
7
- @import "govuk/helpers/all";
8
- @import "govuk/core/all";
9
-
10
3
  @import "govuk_publishing_components/all_components";
11
4
 
12
5
  $gem-guide-border-width: 1px;
@@ -1,20 +1,11 @@
1
1
  // This is the file that the application needs to include in order to use
2
2
  // the components.
3
3
 
4
- // Include all of the GOV.UK Frontend styles. This includes fonts, and individual components.
4
+ @import "govuk_publishing_components/govuk_frontend_support";
5
+ @import "govuk_publishing_components/component_support";
5
6
 
6
- @import "components/helpers/govuk-frontend-settings";
7
-
8
- // Include common imports used by many components
9
- @import "govuk/all";
10
-
11
- @import "components/helpers/variables";
12
- @import "components/helpers/brand-colours";
13
- @import "components/mixins/govuk-template-link-focus-override";
14
- @import "components/mixins/media-down";
15
- @import "components/mixins/margins";
16
- @import "components/mixins/clearfix";
17
- @import "components/mixins/css3";
7
+ // Include all govuk frontend components
8
+ @import "govuk/components/all";
18
9
 
19
10
  // components
20
11
  @import "components/accordion";
@@ -31,22 +31,31 @@
31
31
  }
32
32
  }
33
33
 
34
+ .gem-c-input__prefix,
34
35
  .gem-c-input__suffix {
35
36
  @include govuk-font($size: 19);
36
37
 
37
38
  background-color: govuk-colour("light-grey", $legacy: "grey-3");
38
39
  border: $govuk-border-width-form-element solid $govuk-input-border-colour;
39
- border-left: 0;
40
40
  box-sizing: border-box;
41
41
  cursor: default; // emphasise non-editable status of prefixes and suffixes
42
42
  display: inline-block;
43
- flex: 0 0 0;
44
- padding: govuk-spacing(1);
45
43
  white-space: nowrap;
46
44
  width: auto;
45
+ text-align: center;
47
46
  height: 40px;
47
+ padding: govuk-spacing(1);
48
+ min-width: 40px;
48
49
  @if $govuk-typography-use-rem {
49
- height: govuk-px-to-rem(40px);
50
+ min-width: govuk-px-to-rem(40px);
50
51
  }
51
52
  margin-top: 0;
52
53
  }
54
+
55
+ .gem-c-input__prefix {
56
+ border-right: 0;
57
+ }
58
+
59
+ .gem-c-input__suffix {
60
+ border-left: 0;
61
+ }
@@ -10,7 +10,7 @@
10
10
  margin-left: 0;
11
11
  padding: .75em 0 .75em 2.5em;
12
12
 
13
- @for $i from 1 through 14 {
13
+ @for $i from 1 through 30 {
14
14
  &:nth-child(#{$i}) {
15
15
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Ccircle cx='125' cy='125' r='100' fill='black' /%3E%3Ctext x='50%25' y='50%25' text-anchor='middle' alignment-baseline='middle' font-family='sans-serif' font-size='100px' fill='white'%3E#{$i}%3C/text%3E%3C/svg%3E");
16
16
  background-repeat: no-repeat;
@@ -1,6 +1,3 @@
1
- @import "govuk/settings/colours-organisations";
2
- @import "govuk/helpers/colour";
3
-
4
1
  @mixin organisation-brand-colour {
5
2
  @each $organisation in map-keys($govuk-colours-organisations) {
6
3
  .brand--#{$organisation} {
@@ -10,6 +10,7 @@ module GovukPublishingComponents
10
10
  @components_in_use_docs = components_in_use_docs.used_in_this_app
11
11
  @components_in_use_sass = components_in_use_sass(false)
12
12
  @components_in_use_print_sass = components_in_use_sass(true)
13
+ @components_in_use_js = components_in_use_js
13
14
  end
14
15
 
15
16
  def show
@@ -62,6 +63,25 @@ module GovukPublishingComponents
62
63
  }.compact.uniq.sort.join("\n").squeeze("\n").prepend(additional_files)
63
64
  end
64
65
 
66
+ def components_in_use_js
67
+ additional_files = "//= require govuk_publishing_components/lib\n"
68
+
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
79
+
80
+ components.map { |component|
81
+ "//= require govuk_publishing_components/components/#{component.gsub('_', '-')}" if component_has_js_file(component.gsub("_", "-"))
82
+ }.compact.uniq.sort.join("\n").squeeze("\n").prepend(additional_files)
83
+ end
84
+
65
85
  private
66
86
 
67
87
  def component_docs
@@ -95,6 +115,10 @@ module GovukPublishingComponents
95
115
  Pathname.new(@component_gem_path + "/app/assets/stylesheets/govuk_publishing_components/components/#{print_path}_#{component}.scss").exist?
96
116
  end
97
117
 
118
+ def component_has_js_file(component)
119
+ Pathname.new(@component_gem_path + "/app/assets/javascripts/govuk_publishing_components/components/#{component}.js").exist?
120
+ end
121
+
98
122
  def components_within_component(component)
99
123
  data = File.read(@component_gem_path + "/app/views/govuk_publishing_components/components/_#{component}.html.erb")
100
124
  match = data.scan(/(govuk_publishing_components\/components\/[a-z_-]+)/)
@@ -20,7 +20,7 @@
20
20
  <h2 class="component-doc-h2">Gem components used by this app (<%= @components_in_use_docs.length %>)</h2>
21
21
 
22
22
  <%= render "govuk_publishing_components/components/details", {
23
- title: "Suggested Sass for this application"
23
+ title: "Suggested imports for this application"
24
24
  } do %>
25
25
  <%= render "govuk_publishing_components/components/textarea", {
26
26
  label: {
@@ -36,6 +36,13 @@
36
36
  name: "print-sass",
37
37
  value: @components_in_use_print_sass
38
38
  } %>
39
+ <%= render "govuk_publishing_components/components/textarea", {
40
+ label: {
41
+ text: "Add this to your application's main js file, before your other local imports."
42
+ },
43
+ name: "main-js",
44
+ value: @components_in_use_js
45
+ } %>
39
46
  <% end %>
40
47
  <pre>
41
48
 
@@ -1,47 +1,16 @@
1
- <% navigation = GovukPublishingComponents::Presenters::ContextualNavigation.new(content_item, request) %>
2
1
  <% prioritise_taxon_breadcrumbs ||= false %>
2
+ <% breadcrumb_selector = GovukPublishingComponents::Presenters::BreadcrumbSelector.call(content_item, request, prioritise_taxon_breadcrumbs) %>
3
3
  <% inverse ||= false %>
4
4
  <% collapse_on_mobile ||= true unless local_assigns[:collapse_on_mobile].eql?(false) %>
5
5
 
6
6
  <div class='gem-c-contextual-breadcrumbs'>
7
-
8
- <% if navigation.priority_taxon %>
9
- <%= render 'govuk_publishing_components/components/step_by_step_nav_header',
10
- {
11
- title: navigation.priority_taxon['title'],
12
- path: navigation.priority_taxon['base_path']
13
- }
14
- %>
15
- <% elsif navigation.content_tagged_to_current_step_by_step? %>
16
- <%# Rendering step by step nav breadcrumbs because there's 1 step by step %>
7
+ <% if breadcrumb_selector[:step_by_step] %>
17
8
  <%= render 'govuk_publishing_components/components/step_by_step_nav_header',
18
- navigation.step_nav_helper.header %>
19
- <% elsif navigation.content_tagged_to_a_finder? %>
20
- <%# Rendering finder breadcrumbs because the page is tagged to a finder %>
21
- <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: navigation.breadcrumbs, inverse: inverse, collapse_on_mobile: collapse_on_mobile %>
22
- <% elsif navigation.content_is_tagged_to_a_live_taxon? && prioritise_taxon_breadcrumbs %>
23
- <%# Rendering taxonomy breadcrumbs because the page is tagged to live taxons
24
- and we want to prioritise them over all other breadcrumbs %>
9
+ breadcrumb_selector[:breadcrumbs] %>
10
+ <% elsif breadcrumb_selector[:breadcrumbs] %>
25
11
  <%= render 'govuk_publishing_components/components/breadcrumbs',
26
- breadcrumbs: navigation.taxon_breadcrumbs[:breadcrumbs],
12
+ breadcrumbs: breadcrumb_selector[:breadcrumbs],
27
13
  inverse: inverse,
28
14
  collapse_on_mobile: collapse_on_mobile %>
29
- <% elsif navigation.content_tagged_to_mainstream_browse_pages? %>
30
- <%# Rendering parent-based breadcrumbs because the page is tagged to mainstream browse %>
31
- <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: navigation.breadcrumbs, inverse: inverse, collapse_on_mobile: collapse_on_mobile %>
32
- <% elsif navigation.content_has_curated_related_items? %>
33
- <%# Rendering parent-based breadcrumbs because the page has curated related links %>
34
- <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: navigation.breadcrumbs, inverse: inverse, collapse_on_mobile: collapse_on_mobile %>
35
- <% elsif navigation.content_is_tagged_to_a_live_taxon? && !navigation.content_is_a_specialist_document? %>
36
- <%# Rendering taxonomy breadcrumbs because the page is tagged to live taxons %>
37
- <%= render 'govuk_publishing_components/components/breadcrumbs',
38
- breadcrumbs: navigation.taxon_breadcrumbs[:breadcrumbs],
39
- inverse: inverse,
40
- collapse_on_mobile: collapse_on_mobile %>
41
- <% elsif navigation.breadcrumbs.any? %>
42
- <%# Rendering parent-based breadcrumbs because no browse, no related links, no live taxons %>
43
- <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: navigation.breadcrumbs, inverse: inverse, collapse_on_mobile: collapse_on_mobile %>
44
- <% else %>
45
- <%# Not rendering any breadcrumbs because there aren't any %>
46
15
  <% end %>
47
16
  </div>
@@ -22,6 +22,7 @@
22
22
  error_id = "error-#{SecureRandom.hex(4)}"
23
23
  search_icon ||= nil
24
24
  heading_size = false unless ['s', 'm', 'l', 'xl'].include?(heading_size)
25
+ prefix ||= nil
25
26
  suffix ||= nil
26
27
 
27
28
  css_classes = %w(gem-c-input govuk-input)
@@ -92,7 +93,17 @@
92
93
  }
93
94
  %>
94
95
 
95
- <% if suffix %>
96
+ <% if prefix && suffix %>
97
+ <%= tag.div class: "gem-c-input__wrapper" do %>
98
+ <%= tag.span prefix, class: "gem-c-input__prefix", aria: { hidden: true } %>
99
+ <%= input_tag %>
100
+ <%= tag.span suffix, class: "gem-c-input__suffix", aria: { hidden: true } %>
101
+ <% end %>
102
+ <% elsif prefix %>
103
+ <%= tag.div class: "gem-c-input__wrapper" do %>
104
+ <%= tag.span prefix, class: "gem-c-input__prefix", aria: { hidden: true } %><%= input_tag %>
105
+ <% end %>
106
+ <% elsif suffix %>
96
107
  <%= tag.div class: "gem-c-input__wrapper" do %>
97
108
  <%= input_tag %><%= tag.span suffix, class: "gem-c-input__suffix", aria: { hidden: true } %>
98
109
  <% end %>
@@ -1,29 +1,49 @@
1
1
  <%
2
2
  title ||= false
3
3
  path ||= false
4
- tracking_id ||= false
5
4
  breadcrumbs = [
6
5
  { title: "Home", url: "/" },
7
6
  { title: title, url: path }
8
7
  ]
9
8
  breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
9
+
10
+ tracking_id ||= false
11
+ tracking_category ||= "stepNavHeaderClicked"
12
+ tracking_action ||= "top"
13
+ tracking_label ||= path
14
+ tracking_dimension_enabled = tracking_dimension_enabled != false
15
+ tracking_dimension ||= title
16
+ tracking_dimension_index ||= 29
17
+
18
+ if tracking_id
19
+ tracking_options ||= ({ dimension96: tracking_id }).to_json
20
+ end
21
+
22
+ local_assigns[:margin_bottom] ||= 0
23
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
24
+ classes = "gem-c-step-nav-header #{shared_helper.get_margin_bottom}"
10
25
  %>
11
26
  <% if title %>
12
27
  <script type="application/ld+json">
13
28
  <%= raw breadcrumb_presenter.structured_data.to_json %>
14
29
  </script>
15
30
 
16
- <div class="gem-c-step-nav-header" data-module="track-click">
31
+ <div class="<%= classes %>" data-module="track-click">
17
32
  <span class="gem-c-step-nav-header__part-of">Part of</span>
18
33
  <% if path %>
19
34
  <a href="<%= path %>"
20
35
  class="gem-c-step-nav-header__title"
21
- data-track-category="stepNavHeaderClicked"
22
- data-track-action="top"
23
- data-track-label="<%= path %>"
24
- data-track-dimension="<%= title %>"
25
- data-track-dimension-index="29"
26
- data-track-options='{"dimension96" : "<%= tracking_id %>" }'>
36
+ data-track-category="<%= tracking_category %>"
37
+ data-track-action="<%= tracking_action %>"
38
+ data-track-label="<%= tracking_label %>"
39
+ <% if tracking_dimension_enabled %>
40
+ data-track-dimension="<%= tracking_dimension %>"
41
+ data-track-dimension-index="<%= tracking_dimension_index %>"
42
+ <% end %>
43
+ <% if tracking_id %>
44
+ data-track-options='<%= tracking_options %>'
45
+ <% end %>
46
+ >
27
47
  <%= title %>
28
48
  </a>
29
49
  <% else %>
@@ -140,6 +140,15 @@ examples:
140
140
  name: "lead-times"
141
141
  width: 10
142
142
  suffix: "days"
143
+ with_prefix_and_suffix:
144
+ description: To help users understand how the input should look like. Often used for units of measurement.
145
+ data:
146
+ label:
147
+ text: "Cost per item, in pounds"
148
+ name: "Cost-per-item"
149
+ width: 10
150
+ prefix: "£"
151
+ suffix: "per item"
143
152
  with_suffix_and_error:
144
153
  description: To help users understand how the input should look like. Often used for units of measurement.
145
154
  data:
@@ -20,9 +20,32 @@ examples:
20
20
  data:
21
21
  title: 'Coronavirus: businesses and self-employed people'
22
22
  path: /childcare-parenting/pregnancy-and-birth
23
+ with_margin_bottom:
24
+ description: |
25
+ The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of 30px.
26
+ data:
27
+ title: 'Learn to practice flexible spacing: step by step'
28
+ margin_bottom: 9
23
29
  with_unique_tracking:
24
30
  description: In order to identify the step by step navigation the component is part of, we need to track a unique ID of the navigation in Google Analytics. This ID should be the same across all pages that are linked from and are part of that navigation. Its value is included in any tracking events, specifically in dimension96. It refers to the ID of the step nav that the component links to.
25
31
  data:
26
32
  title: 'With a tracking id'
27
33
  path: '#'
28
34
  tracking_id: 'this-is-the-tracking-id'
35
+ with_custom_tracking:
36
+ data:
37
+ title: 'With a custom tracking'
38
+ path: '#'
39
+ tracking_category: "customTrackingCategoryClicked"
40
+ tracking_action: "customTrackingAction"
41
+ tracking_label: "customTrackingLabel"
42
+ tracking_dimension: "customTrackingDimension"
43
+ tracking_dimension_index: "23"
44
+ without_custom_dimension:
45
+ data:
46
+ title: 'Without custom dimensions'
47
+ path: '#'
48
+ tracking_category: "customTrackingCategoryClicked"
49
+ tracking_action: "customTrackingAction"
50
+ tracking_label: "customTrackingLabel"
51
+ tracking_dimension_enabled: false